Devicetree
 help / color / mirror / Atom feed
From: John Williams <john.williams-g5w7nrANp4BDPfheJLI6IQ@public.gmane.org>
To: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
Cc: devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org
Subject: Re: Gpio reset handling
Date: Wed, 16 Sep 2009 08:40:42 +1000	[thread overview]
Message-ID: <1d3f23370909151540p411f0bc0r1c81b68ceb2fb45e@mail.gmail.com> (raw)
In-Reply-To: <fa686aa40909151527r36334528ne1194523f141a8a2-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi Grant,

On Wed, Sep 16, 2009 at 8:27 AM, Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org> wrote:
> On Tue, Sep 15, 2009 at 12:32 PM, Michal Simek <monstr-pSz03upnqPeHXe+LvDLADg@public.gmane.org> wrote:
>> Hi All,
>>
>> I would like to find out proper way how to handle xilinx reset gpio.
>> We are using gpio for soft reset.
> [...]
>> Ok and here about description of reset port
>> I see two option to write new trigger
>> 1. new reset trigger and add it to gpio-leds node - but this should be in gpio-leds node which make
>> no sense to me
>>
>>        reset {
>>                label = "Heartbeat";
>>                gpios = <&gpio_res 3 1>;
>>                linux,default-trigger = "reset";
>>        }
>
> This looks like an abuse of the LED infrastructure.

I agree - we created this idea as a strawman to motivate what follows :)

>> 2. create own reset node
>>
>> reset {
>>        compatible = "gpio-reset";
>>        reset0 {
>>                label "Soft reset";
>>                gpios = <&gpio_res 1 1>;
>>        }
>>
>>        reset1 {
>>                label "Phy reset";
>>                gpios = <&gpio_res 2 1>;
>>        }
>> }
>>
>> For this node there should be better reset description not just label with different description.
>> I expect that it will be useful soft and hard reset and maybe you can find some others.
>
> It sounds like what you are doing is very board specific.  It is
> probably premature to design a 'generic' binding for something that
> may very well not turn out to be very generic at all.

On the contrary - the MicroBlaze CPU itself has no provision for a
self-initiated soft reset.  Instead, the way it is achieved is by
connecting one bit of a GPIO to the AUX_RESET input of Xilinx's
proc_sys_reset IP (also used in PPC designs as you know).  We are
looking for a sensible, flexible way of binding this structure that we
instantiate in almost all MicroBlaze Linux systems.

BTW - how do you handle soft-reset on Xilinx/PPC designs?

> What I'd do is
> create yourself a node for holding board specific properties (like the
> binding to the gpio reset line) and parse that data from your board
> specific setup code.  I suppose you could also do it from an
> of_platform driver, but like irq controllers, it probably doesn't make
> a lot of sense to.

We are trying to avoid board-specific platform code at all costs - the
ability to fully configure a standard kernel onto arbitrary boards via
a DTB is proving very useful, and as I said above we see this
reset-gpio capability as a generic thing that will be used across many
platforms.  We just want to do it right.

>
> So, something like this perhaps:
>
>    machine {
>        compatible = "<vendor>,<board>-machine";
>        soft-reset-gpio = <&gpio_res 1 1>;
>        phy-reset-gpio = <&gpio_res 2 1>;
>    };
>
> I don't much like the node name "machine", but I can't think of
> anything better at the moment.
>
> Note, this suggestion uses "soft-reset-gpio" and "phy-reset-gpio"
> properties instead of the currently documented "gpios" property.  This
> usage isn't supported by the current gpio support code, but that code
> can be modified, and I think this approach is clearer (as long as the
> expected usage of "<vendor>,<board>-machine" is documented.

Given my justification above, can you spare some of your bountiful
neurons on considering how we might do it generically?  Does flattery
work on you? :)

John
-- 
John Williams, PhD, B.Eng, B.IT
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com  p: +61-7-30090663  f: +61-7-30090663

  parent reply	other threads:[~2009-09-15 22:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-15 18:32 Gpio reset handling Michal Simek
     [not found] ` <4AAFDDD1.9070702-pSz03upnqPeHXe+LvDLADg@public.gmane.org>
2009-09-15 22:27   ` Grant Likely
     [not found]     ` <fa686aa40909151527r36334528ne1194523f141a8a2-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-09-15 22:40       ` John Williams [this message]
     [not found]         ` <1d3f23370909151540p411f0bc0r1c81b68ceb2fb45e-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-09-15 23:07           ` Grant Likely
     [not found]             ` <fa686aa40909151607u29d4025ay101e89d9eae5f30a-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-09-17  6:46               ` Michal Simek
     [not found]                 ` <4AB1DB2A.6050109-pSz03upnqPeHXe+LvDLADg@public.gmane.org>
2009-09-17 13:42                   ` Grant Likely
     [not found]                     ` <fa686aa40909170642j63ccef7bnf162cb88b9733023-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-09-17 13:46                       ` Michal Simek
2009-09-16 11:07           ` Martin Donnelly
2009-09-16  0:24       ` David Gibson
     [not found]         ` <20090916002459.GA8891-787xzQ0H9iRg7VrjXcPTGA@public.gmane.org>
2009-09-17  6:46           ` Michal Simek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1d3f23370909151540p411f0bc0r1c81b68ceb2fb45e@mail.gmail.com \
    --to=john.williams-g5w7nranp4bdpfhejli6iq@public.gmane.org \
    --cc=devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org \
    --cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox