[query] how to use "ranges" in device tree

Arnd Bergmann arnd at arndb.de
Fri Apr 17 02:38:45 PDT 2015


On Friday 17 April 2015 16:45:46 Jisheng Zhang wrote:
> > 
> > A nicer (but a little more complicated) way to do this would be to use
> > #address-cells=<2> in the parent bus and use that to enumerate the
> 
> In this way, we need to change all device nodes' "reg" in arch/arm/boot/dts/berlin2q.dtsi?

Correct

> And in arm64 case, we should use #address-cells=<3>?

It depends: if any of the address spaces within are 64-bit wide, yes, otherwise
you can make the virtual spaces just 2-cell wide.

> If above two answer is yes, setting "ranges = <..>" seems add complexity in my
> humble opinion. So is it better to use 1:1 mapping by "ranges;" in "/soc" node?
 
I agree, it gets a little awkward at that point. A better solution here would
be to take the PCI node out of /soc and move it to the root node. This has
the slight downside that you end up with registers being part of /soc and /pci,
but that's perfectly legal.

	Arnd



More information about the linux-arm-kernel mailing list