Thread (1 message) 1 message, 1 author, 2015-11-26

Preprocessor arithmetic in dtsi files (base + offset)

From: robin.murphy@arm.com (Robin Murphy)
Date: 2015-11-26 17:51:28
Also in: linux-devicetree

On 26/11/15 16:23, Geert Uytterhoeven wrote:
[...]
I guess this would work, too?

scu_container at 20000000 {
         compatible = "simple-bus";

         ranges = <0x0 0x20000000 0x10000>;
         #address-cells = <1>;
         #size-cells = <1>;

         scu: scu at 0 {
                 compatible = "arm,cortex-a9-scu";
                 reg = <0x0000 0x100>;

         gic: interrupt-controller at 1000 {
                 compatible = "arm,cortex-a9-gic";
                 reg = <0x1000 0x1000>, <0x0100 0x0100>;

         twd-timer at 0600 {
                 compatible = "arm,cortex-a9-twd-timer";
                 reg = <0x0600 0x10>;
};

No more explicit arithmetic needed, just substitue "20000000".
Which, funnily enough, ends up looking an awful lot like the definition 
in the hardware documentation[1] too ;)

Robin.

[1]:http://infocenter.arm.com/help/topic/com.arm.doc.ddi0407i/CACCJFCJ.html
Gr{oetje,eeting}s,

                         Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                 -- Linus Torvalds

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help