ARM-software / bsa-acs

Arm SystemReady : BSA Architecture Compliance Suite
Apache License 2.0
14 stars 40 forks source link

PCI DT parsing is not as per DT spec #312

Closed quic-pansing closed 2 weeks ago

quic-pansing commented 3 weeks ago

https://github.com/ARM-software/bsa-acs/blob/main/pal/uefi_dt/bsa/src/pal_iovirt.c#L751

As per DT schema https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/pci/pci-iommu.yaml#L55

parameter conatain Phandle but BSA expecting offset. line 750 iommu_node = fdt32_to_cpu(Preg_val[1]); This look wrong expectation. This need to replace line with iommu_node = fdt_node_offset_by_phandle((void *)dt_ptr, fdt32_to_cpu(Preg_val[1]););

So suggestion is

like 750 -- iommu_node = fdt32_to_cpu(Preg_val[1]); ++iommu_node = fdt_node_offset_by_phandle((void *)dt_ptr, fdt32_to_cpu(Preg_val[1]); so first we grab phandle then get offset.

above is working. please review and change code.

chetan-rathore commented 2 weeks ago

Hello @quic-pansing,

The PR changes has been merged.

Thanks, ACS team