Commit e587886a6112e476a74a26e6cf7068a23723097c

Authored by Simon Glass
Committed by Bin Meng
1 parent ea4316cdb3

dm: core: Correct low cell in ofnode_read_pci_addr()

This reads the low cell of the PCI address from the wrong cell. Fix it.
Also fix the function that this code came from.

Fixes: 9e51204527 (dm: core: Add operations on device tree references)
Fixes: 4ea5243a3a (fdt: fix fdtdec_get_pci_addr() for CONFIG_PHYS_64BIT)
Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

Showing 2 changed files with 2 additions and 2 deletions Side-by-side Diff

drivers/core/ofnode.c
... ... @@ -617,7 +617,7 @@
617 617 if ((fdt32_to_cpu(*cell) & type) == type) {
618 618 addr->phys_hi = fdt32_to_cpu(cell[0]);
619 619 addr->phys_mid = fdt32_to_cpu(cell[1]);
620   - addr->phys_lo = fdt32_to_cpu(cell[1]);
  620 + addr->phys_lo = fdt32_to_cpu(cell[2]);
621 621 break;
622 622 }
623 623  
... ... @@ -217,7 +217,7 @@
217 217 if ((fdt32_to_cpu(*cell) & type) == type) {
218 218 addr->phys_hi = fdt32_to_cpu(cell[0]);
219 219 addr->phys_mid = fdt32_to_cpu(cell[1]);
220   - addr->phys_lo = fdt32_to_cpu(cell[1]);
  220 + addr->phys_lo = fdt32_to_cpu(cell[2]);
221 221 break;
222 222 }
223 223