* [U-Boot] [PATCH] fdt: fix fdtdec_get_pci_addr() for CONFIG_PHYS_64BIT
@ 2015-10-02 23:44 Stephen Warren
2015-10-03 14:30 ` Simon Glass
2015-10-06 9:56 ` Thierry Reding
0 siblings, 2 replies; 6+ messages in thread
From: Stephen Warren @ 2015-10-02 23:44 UTC (permalink / raw)
To: u-boot
From: Stephen Warren <swarren@nvidia.com>
PCI addresses are always represented as 3 cells in DT. (one cell for bus
and device, and two cells for a 64-bit addres). This does not vary based
on either the physical address size of the CPU, nor any #address-cells
property in DT (or more precisely, #address-cells must be set to 3 in any
PCIe controller's node).
Fix fdtdec_get_pci_addr() to use conversion functions that operate on
(fixed) cell-sized data rather than (varying) physical-address-sized
data, so that the function works on 64-bit systems.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
lib/fdtdec.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 1fdb4f0d9ce9..275971d40096 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -219,13 +219,13 @@ int fdtdec_get_pci_addr(const void *blob, int node, enum fdt_pci_space type,
for (i = 0; i < num; i++) {
debug("pci address #%d: %08lx %08lx %08lx\n", i,
- (ulong)fdt_addr_to_cpu(cell[0]),
- (ulong)fdt_addr_to_cpu(cell[1]),
- (ulong)fdt_addr_to_cpu(cell[2]));
- if ((fdt_addr_to_cpu(*cell) & type) == type) {
- addr->phys_hi = fdt_addr_to_cpu(cell[0]);
- addr->phys_mid = fdt_addr_to_cpu(cell[1]);
- addr->phys_lo = fdt_addr_to_cpu(cell[2]);
+ (ulong)fdt32_to_cpu(cell[0]),
+ (ulong)fdt32_to_cpu(cell[1]),
+ (ulong)fdt32_to_cpu(cell[2]));
+ 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]);
break;
} else {
cell += (FDT_PCI_ADDR_CELLS +
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [U-Boot] [PATCH] fdt: fix fdtdec_get_pci_addr() for CONFIG_PHYS_64BIT
2015-10-02 23:44 [U-Boot] [PATCH] fdt: fix fdtdec_get_pci_addr() for CONFIG_PHYS_64BIT Stephen Warren
@ 2015-10-03 14:30 ` Simon Glass
2015-10-21 16:31 ` Stephen Warren
2015-10-06 9:56 ` Thierry Reding
1 sibling, 1 reply; 6+ messages in thread
From: Simon Glass @ 2015-10-03 14:30 UTC (permalink / raw)
To: u-boot
On 3 October 2015 at 00:44, Stephen Warren <swarren@wwwdotorg.org> wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> PCI addresses are always represented as 3 cells in DT. (one cell for bus
> and device, and two cells for a 64-bit addres). This does not vary based
> on either the physical address size of the CPU, nor any #address-cells
> property in DT (or more precisely, #address-cells must be set to 3 in any
> PCIe controller's node).
>
> Fix fdtdec_get_pci_addr() to use conversion functions that operate on
> (fixed) cell-sized data rather than (varying) physical-address-sized
> data, so that the function works on 64-bit systems.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
> lib/fdtdec.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
Acked-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] fdt: fix fdtdec_get_pci_addr() for CONFIG_PHYS_64BIT
2015-10-03 14:30 ` Simon Glass
@ 2015-10-21 16:31 ` Stephen Warren
2015-10-21 20:42 ` Simon Glass
0 siblings, 1 reply; 6+ messages in thread
From: Stephen Warren @ 2015-10-21 16:31 UTC (permalink / raw)
To: u-boot
On 10/03/2015 08:30 AM, Simon Glass wrote:
> On 3 October 2015 at 00:44, Stephen Warren <swarren@wwwdotorg.org> wrote:
>> From: Stephen Warren <swarren@nvidia.com>
>>
>> PCI addresses are always represented as 3 cells in DT. (one cell for bus
>> and device, and two cells for a 64-bit addres). This does not vary based
>> on either the physical address size of the CPU, nor any #address-cells
>> property in DT (or more precisely, #address-cells must be set to 3 in any
>> PCIe controller's node).
>>
>> Fix fdtdec_get_pci_addr() to use conversion functions that operate on
>> (fixed) cell-sized data rather than (varying) physical-address-sized
>> data, so that the function works on 64-bit systems.
>>
>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
>> ---
>> lib/fdtdec.c | 14 +++++++-------
>> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> Acked-by: Simon Glass <sjg@chromium.org>
Simon, this patch appears to be assigned to you in patchwork. Will you
apply it now the merge window is open, or are you assuming it will go
through the Tegra tree with all the PCIe patches?
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] fdt: fix fdtdec_get_pci_addr() for CONFIG_PHYS_64BIT
2015-10-21 16:31 ` Stephen Warren
@ 2015-10-21 20:42 ` Simon Glass
2015-10-26 13:26 ` Simon Glass
0 siblings, 1 reply; 6+ messages in thread
From: Simon Glass @ 2015-10-21 20:42 UTC (permalink / raw)
To: u-boot
Hi Stephen,
On 21 October 2015 at 10:31, Stephen Warren <swarren@wwwdotorg.org> wrote:
>
> On 10/03/2015 08:30 AM, Simon Glass wrote:
>>
>> On 3 October 2015 at 00:44, Stephen Warren <swarren@wwwdotorg.org> wrote:
>>>
>>> From: Stephen Warren <swarren@nvidia.com>
>>>
>>> PCI addresses are always represented as 3 cells in DT. (one cell for bus
>>> and device, and two cells for a 64-bit addres). This does not vary based
>>> on either the physical address size of the CPU, nor any #address-cells
>>> property in DT (or more precisely, #address-cells must be set to 3 in any
>>> PCIe controller's node).
>>>
>>> Fix fdtdec_get_pci_addr() to use conversion functions that operate on
>>> (fixed) cell-sized data rather than (varying) physical-address-sized
>>> data, so that the function works on 64-bit systems.
>>>
>>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
>>> ---
>>> lib/fdtdec.c | 14 +++++++-------
>>> 1 file changed, 7 insertions(+), 7 deletions(-)
>>
>>
>> Acked-by: Simon Glass <sjg@chromium.org>
>
>
> Simon, this patch appears to be assigned to you in patchwork. Will you apply it now the merge window is open, or are you assuming it will go through the Tegra tree with all the PCIe patches?
>
I can pick it up.
Regards,
Simon
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] fdt: fix fdtdec_get_pci_addr() for CONFIG_PHYS_64BIT
2015-10-21 20:42 ` Simon Glass
@ 2015-10-26 13:26 ` Simon Glass
0 siblings, 0 replies; 6+ messages in thread
From: Simon Glass @ 2015-10-26 13:26 UTC (permalink / raw)
To: u-boot
On 21 October 2015 at 14:42, Simon Glass <sjg@chromium.org> wrote:
>
> Hi Stephen,
>
> On 21 October 2015 at 10:31, Stephen Warren <swarren@wwwdotorg.org> wrote:
> >
> > On 10/03/2015 08:30 AM, Simon Glass wrote:
> >>
> >> On 3 October 2015 at 00:44, Stephen Warren <swarren@wwwdotorg.org> wrote:
> >>>
> >>> From: Stephen Warren <swarren@nvidia.com>
> >>>
> >>> PCI addresses are always represented as 3 cells in DT. (one cell for bus
> >>> and device, and two cells for a 64-bit addres). This does not vary based
> >>> on either the physical address size of the CPU, nor any #address-cells
> >>> property in DT (or more precisely, #address-cells must be set to 3 in any
> >>> PCIe controller's node).
> >>>
> >>> Fix fdtdec_get_pci_addr() to use conversion functions that operate on
> >>> (fixed) cell-sized data rather than (varying) physical-address-sized
> >>> data, so that the function works on 64-bit systems.
> >>>
> >>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> >>> ---
> >>> lib/fdtdec.c | 14 +++++++-------
> >>> 1 file changed, 7 insertions(+), 7 deletions(-)
> >>
> >>
> >> Acked-by: Simon Glass <sjg@chromium.org>
> >
> >
> > Simon, this patch appears to be assigned to you in patchwork. Will you apply it now the merge window is open, or are you assuming it will go through the Tegra tree with all the PCIe patches?
> >
>
> I can pick it up.
Applied to u-boot-dm.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] fdt: fix fdtdec_get_pci_addr() for CONFIG_PHYS_64BIT
2015-10-02 23:44 [U-Boot] [PATCH] fdt: fix fdtdec_get_pci_addr() for CONFIG_PHYS_64BIT Stephen Warren
2015-10-03 14:30 ` Simon Glass
@ 2015-10-06 9:56 ` Thierry Reding
1 sibling, 0 replies; 6+ messages in thread
From: Thierry Reding @ 2015-10-06 9:56 UTC (permalink / raw)
To: u-boot
On Fri, Oct 02, 2015 at 05:44:06PM -0600, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> PCI addresses are always represented as 3 cells in DT. (one cell for bus
> and device, and two cells for a 64-bit addres). This does not vary based
> on either the physical address size of the CPU, nor any #address-cells
> property in DT (or more precisely, #address-cells must be set to 3 in any
> PCIe controller's node).
>
> Fix fdtdec_get_pci_addr() to use conversion functions that operate on
> (fixed) cell-sized data rather than (varying) physical-address-sized
> data, so that the function works on 64-bit systems.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
> lib/fdtdec.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
This looks very familiar. I think I used to have an equivalent patch in
my tree, but possibly never sent it out because I never managed to get
PCIe to work. Anyway:
Reviewed-by: Thierry Reding <treding@nvidia.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151006/2aba454e/attachment.sig>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-10-26 13:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-02 23:44 [U-Boot] [PATCH] fdt: fix fdtdec_get_pci_addr() for CONFIG_PHYS_64BIT Stephen Warren
2015-10-03 14:30 ` Simon Glass
2015-10-21 16:31 ` Stephen Warren
2015-10-21 20:42 ` Simon Glass
2015-10-26 13:26 ` Simon Glass
2015-10-06 9:56 ` Thierry Reding
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox