Message ID | 20190925145750.200592-3-sjg@chromium.org |
---|---|
State | Accepted |
Commit | e587886a6112e476a74a26e6cf7068a23723097c |
Delegated to: | Bin Meng |
Headers | show |
Series | x86: Add initial support for apollolake | expand |
On 9/25/19 8:55 AM, Simon Glass wrote: > 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> > --- > I can't work out why the existing code is correct, but I suppose it might > be for some obscure reason that needs a comment. > > The original patch is here: http://patchwork.ozlabs.org/patch/525853/ This makes sense. I am not sure how the original code worked; I can only assume the mid/low values were always both set to 0, or unused, or something? Tested-by: Stephen Warren <swarren@nvidia.com>
On Wed, Sep 25, 2019 at 10:58 PM Simon Glass <sjg@chromium.org> wrote: > > 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> > --- > I can't work out why the existing code is correct, but I suppose it might > be for some obscure reason that needs a comment. > > The original patch is here: http://patchwork.ozlabs.org/patch/525853/ > > drivers/core/ofnode.c | 2 +- > lib/fdtdec.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > Reviewed-by: Bin Meng <bmeng.cn@gmail.com> I think this should go in v2019.10. Tom, I will prepare a PR soon. Regards, Bin
On Thu, Oct 3, 2019 at 8:47 PM Bin Meng <bmeng.cn@gmail.com> wrote: > > On Wed, Sep 25, 2019 at 10:58 PM Simon Glass <sjg@chromium.org> wrote: > > > > 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> > > --- > > I can't work out why the existing code is correct, but I suppose it might > > be for some obscure reason that needs a comment. > > > > The original patch is here: http://patchwork.ozlabs.org/patch/525853/ > > > > drivers/core/ofnode.c | 2 +- > > lib/fdtdec.c | 2 +- > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > Reviewed-by: Bin Meng <bmeng.cn@gmail.com> > > I think this should go in v2019.10. > > Tom, I will prepare a PR soon. applied to u-boot-x86, thanks!
diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c index 7eca00cd661..5d47eccf1d1 100644 --- a/drivers/core/ofnode.c +++ b/drivers/core/ofnode.c @@ -617,7 +617,7 @@ int ofnode_read_pci_addr(ofnode node, enum fdt_pci_space type, if ((fdt32_to_cpu(*cell) & type) == type) { addr->phys_hi = fdt32_to_cpu(cell[0]); addr->phys_mid = fdt32_to_cpu(cell[1]); - addr->phys_lo = fdt32_to_cpu(cell[1]); + addr->phys_lo = fdt32_to_cpu(cell[2]); break; } diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 74525c84e7b..74430c8b2ff 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -217,7 +217,7 @@ int fdtdec_get_pci_addr(const void *blob, int node, enum fdt_pci_space type, if ((fdt32_to_cpu(*cell) & type) == type) { addr->phys_hi = fdt32_to_cpu(cell[0]); addr->phys_mid = fdt32_to_cpu(cell[1]); - addr->phys_lo = fdt32_to_cpu(cell[1]); + addr->phys_lo = fdt32_to_cpu(cell[2]); break; }
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> --- I can't work out why the existing code is correct, but I suppose it might be for some obscure reason that needs a comment. The original patch is here: http://patchwork.ozlabs.org/patch/525853/ drivers/core/ofnode.c | 2 +- lib/fdtdec.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)