On Fri, Nov 29, 2013 at 5:41 PM, Gerhard Sittig <gsi@xxxxxxx> wrote: > On Fri, Nov 29, 2013 at 09:59 +0800, Tien Hock Loh wrote: >> >> On Fri, Nov 29, 2013 at 4:24 AM, Gerhard Sittig <gsi@xxxxxxx> wrote: >> > On Wed, Nov 27, 2013 at 11:49 +0800, thloh@xxxxxxxxxx wrote: >> >> >> >> --- /dev/null >> >> +++ b/Documentation/devicetree/bindings/gpio/gpio-altera.txt >> >> @@ -0,0 +1,35 @@ >> >> +[ ... ] >> >> + >> >> +Example: >> >> + >> >> +gpio_altr: gpio_altr { >> >> + compatible = "altr,pio-1.0"; >> >> + reg = <0xff200000 0x10>; >> > >> > This length appears to be less than what the code defines (the >> > latter has offsets beyond 0x10). >> >> The higher registers (0x10 and 0x14) are only available if the >> controller is configured as GPIO output. Thus, there are two >> configuration - one that has the length 0x10 (GPIO without output >> ports), and one with the length 0x20 (GPIO with output ports). Is >> there anything I need to handle for cases like this? > > Hmm. I cannot tell whether there is a preference in mainline or > whether there is prior art of IP blocks having different sizes > depending on their "being compatible" to something or their > configuration and feature set. Others may know more. More of a question to the DT people but having the actual size of this very variant seems to fit the DT paradigm of "describing hardware" precisely. In worst case, what happens? Code dealing with an 0x10 sized controller writes into register 0x14, and instead of silently ignoring a write to the unused memory (unless it causes a bus stall!) you get a nice crash, which in this case is a feature as it helps you debug the code. So I'd say, stick the actual size in the DTS. Yours, Linus Walleij -- 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