Gpio reset handling

Grant Likely grant.likely at secretlab.ca
Thu Sep 17 23:42:25 EST 2009


On Thu, Sep 17, 2009 at 12:46 AM, Michal Simek <monstr at monstr.eu> wrote:
> Grant Likely wrote:
>> From what I've heard so far, I'd do it the same way but use something
>> like "xlnx,microblaze-gpio-reset" for the compatible value.  As long
>> as you document the binding and post it to the devicetree-discuss
>> mailing list for review you should have no problem doing what you want
>> to do.
>>
>> BTW, start with the "xlnx,microblaze-*" value for now.  A architecture
>> neutral value can always be chosen at a later date if this proves to
>> be useful.
>
> Here I see some problems if we want to use one reset gpio pin with leds.
> It not happen in these days but I expect to use it with heartbeat led.
>
> If I want to use new compatible node, I have to change BSP to support this
> but I can through out this part of code very soon. And if I want to use
> that node with leds then this is wrong.

I think you misunderstand me.  I'm saying create a new node which
references a gpio from the gpio node.  So it would look something like
this (adapting your original example):

               gpio_res: gpio at 81400000 {
                       compatible = "xlnx,xps-gpio-1.00.a";
                       interrupt-parent = <&xps_intc_0>;
                       interrupts = < 7 2 >;
                       reg = < 0x81400000 0x10000 >;
...
                       xlnx,gpio-width = <0x8>;
...
               } ;

gpio-leds {
       compatible = "gpio-leds";
       heartbeat {
               label = "Heartbeat";
               gpios = <&gpio_res 4 1>;
               linux,default-trigger = "heartbeat";
       };

       green {
               label = "Green";
               gpios = <&gpio_res 5 1>;
       };
};

reset {
       compatible = "xlnx,microblaze-reset";
       soft-reset-gpio = <&gpio_res 1 1>;
       phy-reset-gpio = <&gpio_res 2 1>;
}

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.


More information about the devicetree-discuss mailing list