From mboxrd@z Thu Jan 1 00:00:00 1970 From: slash.tmp@free.fr (Mason) Date: Thu, 26 Nov 2015 14:16:16 +0100 Subject: Preprocessor arithmetic in dtsi files (base + offset) Message-ID: <56570620.3070106@free.fr> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hello, In the device tree for my ARM platform, I have several nodes with addresses within the SCU block: scu: scu at 20000000 { compatible = "arm,cortex-a9-scu"; reg = <0x20000000 0x100>; gic: interrupt-controller at 20001000 { compatible = "arm,cortex-a9-gic"; reg = <0x20001000 0x1000>, <0x20000100 0x0100>; twd-timer at 20000600 { compatible = "arm,cortex-a9-twd-timer"; reg = <0x20000600 0x10>; Can I use preprocessor arithmetic to abstract the base address, as would be done in C? #define SCU_BASE 0x20000000 scu: scu at XXX { compatible = "arm,cortex-a9-scu"; reg = ; gic: interrupt-controller at XXX { compatible = "arm,cortex-a9-gic"; reg = , ; twd-timer at XXX { compatible = "arm,cortex-a9-twd-timer"; reg = ; Are the @XXX important? Can they be removed altogether? Regards. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mason Subject: Preprocessor arithmetic in dtsi files (base + offset) Date: Thu, 26 Nov 2015 14:16:16 +0100 Message-ID: <56570620.3070106@free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Return-path: Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Linux ARM , DT Cc: Mark Rutland , Pawel Moll , Rob Herring , Arnd Bergmann , Sebastian Frias List-Id: devicetree@vger.kernel.org Hello, In the device tree for my ARM platform, I have several nodes with addresses within the SCU block: scu: scu@20000000 { compatible = "arm,cortex-a9-scu"; reg = <0x20000000 0x100>; gic: interrupt-controller@20001000 { compatible = "arm,cortex-a9-gic"; reg = <0x20001000 0x1000>, <0x20000100 0x0100>; twd-timer@20000600 { compatible = "arm,cortex-a9-twd-timer"; reg = <0x20000600 0x10>; Can I use preprocessor arithmetic to abstract the base address, as would be done in C? #define SCU_BASE 0x20000000 scu: scu@XXX { compatible = "arm,cortex-a9-scu"; reg = ; gic: interrupt-controller@XXX { compatible = "arm,cortex-a9-gic"; reg = , ; twd-timer@XXX { compatible = "arm,cortex-a9-twd-timer"; reg = ; Are the @XXX important? Can they be removed altogether? Regards. -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html