devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Preprocessor arithmetic in dtsi files (base + offset)
@ 2015-11-26 13:16 Mason
       [not found] ` <56570620.3070106-GANU6spQydw@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Mason @ 2015-11-26 13:16 UTC (permalink / raw)
  To: Linux ARM, DT
  Cc: Mark Rutland, Pawel Moll, Rob Herring, Arnd Bergmann,
	Sebastian Frias

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 = <SCU_BASE 0x100>;
	
	gic: interrupt-controller@XXX {
		compatible = "arm,cortex-a9-gic";
		reg = <SCU_BASE+0x1000 0x1000>, <SCU_BASE+0x100 0x0100>;

	twd-timer@XXX {
		compatible = "arm,cortex-a9-twd-timer";
		reg = <SCU_BASE+0x600 0x10>;

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-12-02 22:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-26 13:16 Preprocessor arithmetic in dtsi files (base + offset) Mason
     [not found] ` <56570620.3070106-GANU6spQydw@public.gmane.org>
2015-11-26 13:52   ` Mark Rutland
2015-11-26 13:59   ` Russell King - ARM Linux
     [not found]     ` <20151126135957.GC8644-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2015-11-26 14:44       ` Mason
     [not found]         ` <56571ACC.9080306-GANU6spQydw@public.gmane.org>
2015-11-26 16:23           ` Geert Uytterhoeven
     [not found]             ` <CAMuHMdX9JRRURMxmNFcKOkzeO1B5Nmnk+XnOpgcLsPbiG4CfSA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-11-26 17:51               ` Robin Murphy
2015-12-02 22:14               ` Mason

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).