* [PATCH] hw/ppc: e500: Add missing <ranges> in the eTSEC node
@ 2021-02-24 9:28 Bin Meng
2021-02-28 7:02 ` Bin Meng
0 siblings, 1 reply; 3+ messages in thread
From: Bin Meng @ 2021-02-24 9:28 UTC (permalink / raw)
To: David Gibson, Greg Kurz; +Cc: Bin Meng, qemu-ppc, qemu-devel
From: Bin Meng <bin.meng@windriver.com>
The eTSEC node should provide an empty <ranges> property in the
eTSEC node, otherwise of_translate_address() in the Linux kernel
fails to get the eTSEC register base, reporting:
OF: ** translation for device /platform@f00000000/ethernet@0/queue-group **
OF: bus is default (na=1, ns=1) on /platform@f00000000/ethernet@0
OF: translating address: 00000000
OF: parent bus is default (na=1, ns=1) on /platform@f00000000
OF: no ranges; cannot translate
Per devicetree spec v0.3 [1] chapter 2.3.8:
If the property is not present in a bus node, it is assumed that
no mapping exists between children of the node and the parent
address space.
This is why of_translate_address() aborts the address translation.
Apparently U-Boot devicetree parser seems to be tolerant with
missing <ranges> as this was not noticed when testing with U-Boot.
The empty <ranges> property is present in all kernel shipped dtsi
files for eTSEC, Let's add it to conform with the spec.
[1] https://github.com/devicetree-org/devicetree-specification/releases/download/v0.3/devicetree-specification-v0.3.pdf
Fixes: fdfb7f2cdb2d ("e500: Add support for eTSEC in device tree")
Signed-off-by: Bin Meng <bin.meng@windriver.com>
---
hw/ppc/e500.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index c84a021..79467ac 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -231,6 +231,7 @@ static int create_devtree_etsec(SysBusDevice *sbdev, PlatformDevtreeData *data)
assert(irq2 >= 0);
qemu_fdt_add_subnode(fdt, node);
+ qemu_fdt_setprop(fdt, node, "ranges", NULL, 0);
qemu_fdt_setprop_string(fdt, node, "device_type", "network");
qemu_fdt_setprop_string(fdt, node, "compatible", "fsl,etsec2");
qemu_fdt_setprop_string(fdt, node, "model", "eTSEC");
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] hw/ppc: e500: Add missing <ranges> in the eTSEC node
2021-02-24 9:28 [PATCH] hw/ppc: e500: Add missing <ranges> in the eTSEC node Bin Meng
@ 2021-02-28 7:02 ` Bin Meng
2021-03-01 3:57 ` David Gibson
0 siblings, 1 reply; 3+ messages in thread
From: Bin Meng @ 2021-02-28 7:02 UTC (permalink / raw)
To: David Gibson, Greg Kurz
Cc: Bin Meng, qemu-ppc, qemu-devel@nongnu.org Developers
On Wed, Feb 24, 2021 at 5:28 PM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> From: Bin Meng <bin.meng@windriver.com>
>
> The eTSEC node should provide an empty <ranges> property in the
> eTSEC node, otherwise of_translate_address() in the Linux kernel
> fails to get the eTSEC register base, reporting:
>
> OF: ** translation for device /platform@f00000000/ethernet@0/queue-group **
> OF: bus is default (na=1, ns=1) on /platform@f00000000/ethernet@0
> OF: translating address: 00000000
> OF: parent bus is default (na=1, ns=1) on /platform@f00000000
> OF: no ranges; cannot translate
>
> Per devicetree spec v0.3 [1] chapter 2.3.8:
>
> If the property is not present in a bus node, it is assumed that
> no mapping exists between children of the node and the parent
> address space.
>
> This is why of_translate_address() aborts the address translation.
> Apparently U-Boot devicetree parser seems to be tolerant with
> missing <ranges> as this was not noticed when testing with U-Boot.
> The empty <ranges> property is present in all kernel shipped dtsi
> files for eTSEC, Let's add it to conform with the spec.
>
> [1] https://github.com/devicetree-org/devicetree-specification/releases/download/v0.3/devicetree-specification-v0.3.pdf
>
> Fixes: fdfb7f2cdb2d ("e500: Add support for eTSEC in device tree")
> Signed-off-by: Bin Meng <bin.meng@windriver.com>
> ---
>
> hw/ppc/e500.c | 1 +
> 1 file changed, 1 insertion(+)
>
Ping?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] hw/ppc: e500: Add missing <ranges> in the eTSEC node
2021-02-28 7:02 ` Bin Meng
@ 2021-03-01 3:57 ` David Gibson
0 siblings, 0 replies; 3+ messages in thread
From: David Gibson @ 2021-03-01 3:57 UTC (permalink / raw)
To: Bin Meng; +Cc: Bin Meng, qemu-ppc, Greg Kurz, qemu-devel@nongnu.org Developers
[-- Attachment #1: Type: text/plain, Size: 1864 bytes --]
On Sun, Feb 28, 2021 at 03:02:32PM +0800, Bin Meng wrote:
> On Wed, Feb 24, 2021 at 5:28 PM Bin Meng <bmeng.cn@gmail.com> wrote:
> >
> > From: Bin Meng <bin.meng@windriver.com>
> >
> > The eTSEC node should provide an empty <ranges> property in the
> > eTSEC node, otherwise of_translate_address() in the Linux kernel
> > fails to get the eTSEC register base, reporting:
> >
> > OF: ** translation for device /platform@f00000000/ethernet@0/queue-group **
> > OF: bus is default (na=1, ns=1) on /platform@f00000000/ethernet@0
> > OF: translating address: 00000000
> > OF: parent bus is default (na=1, ns=1) on /platform@f00000000
> > OF: no ranges; cannot translate
> >
> > Per devicetree spec v0.3 [1] chapter 2.3.8:
> >
> > If the property is not present in a bus node, it is assumed that
> > no mapping exists between children of the node and the parent
> > address space.
> >
> > This is why of_translate_address() aborts the address translation.
> > Apparently U-Boot devicetree parser seems to be tolerant with
> > missing <ranges> as this was not noticed when testing with U-Boot.
> > The empty <ranges> property is present in all kernel shipped dtsi
> > files for eTSEC, Let's add it to conform with the spec.
> >
> > [1] https://github.com/devicetree-org/devicetree-specification/releases/download/v0.3/devicetree-specification-v0.3.pdf
> >
> > Fixes: fdfb7f2cdb2d ("e500: Add support for eTSEC in device tree")
> > Signed-off-by: Bin Meng <bin.meng@windriver.com>
> > ---
> >
> > hw/ppc/e500.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
>
> Ping?
Sorry for the delay. Now applied to ppc-for-6.0.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-03-01 6:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-24 9:28 [PATCH] hw/ppc: e500: Add missing <ranges> in the eTSEC node Bin Meng
2021-02-28 7:02 ` Bin Meng
2021-03-01 3:57 ` David Gibson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).