Re: Preprocessor arithmetic in dtsi files (base + offset)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 26/11/2015 17:23, Geert Uytterhoeven wrote:

> I guess this would work, too?
> 
> scu_container@20000000 {
>         compatible = "simple-bus";
> 
>         ranges = <0x0 0x20000000 0x10000>;
>         #address-cells = <1>;
>         #size-cells = <1>;
> 
>         scu: scu@0 {
>                 compatible = "arm,cortex-a9-scu";
>                 reg = <0x0000 0x100>;
> 
>         gic: interrupt-controller@1000 {
>                 compatible = "arm,cortex-a9-gic";
>                 reg = <0x1000 0x1000>, <0x0100 0x0100>;
> 
>         twd-timer@0600 {
>                 compatible = "arm,cortex-a9-twd-timer";
>                 reg = <0x0600 0x10>;
> };
> 
> No more explicit arithmetic needed, just substitute "20000000".

I like it! Only one address to change in the next chip.
Minimizes the risk of missing something.

(I see that armada did something similar, but they also grouped
unrelated stuff. And bcm5301x did exactly what you suggested.)

Wondering if there are macro definitions for the intra-SCU offsets?
So I could have symbolic names, such as

  twd-timer@0600 {
    reg = <TWD_OFFSET 0x10>

Didn't see anything appropriate in include and arch/arm.
Should I include my own definitions at the top of the dtsi?

Regards.

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux