diff mbox

reset handling in am335x hwmod data

Message ID 87ehij8lpb.fsf@dell.be.48ers.dk (mailing list archive)
State New, archived
Headers show

Commit Message

Peter Korsgaard Dec. 21, 2012, 3:32 p.m. UTC
Hi,

On a custom am335x board I was surprised to see the kernel resetting
gpio pins not mentioned anywhere in the dts.

In this specific case the pin is connected to nCONFIG of a FPGA. The
FPGA is commanded to start configuration from a SPI flash in the
bootloader, so it can happen in parallel with kernel
load/uncompress/startup, but as the kernel resets the gpio during
initialization this doesn't work.

Digging a bit into it, I see the hwmod of the gpio controller is
configured to reset at startup, and it works correctly (E.G. the pin is
left asserted) if I change it to HWMOD_INIT_NO_RESET:


Now the question is why is this configured like this? I don't have any
experience with omap hwmod, but on other (non-TI) boards I haven't
experienced similar issues. Should E.G. the gpio controllers be changed
to not reset or should it be configurable in the dts?

Comments

Paul Walmsley Dec. 23, 2012, 8:58 p.m. UTC | #1
Hi Peter,

On Fri, 21 Dec 2012, Peter Korsgaard wrote:

> On a custom am335x board I was surprised to see the kernel resetting
> gpio pins not mentioned anywhere in the dts.

The original plan with DT was to start by focusing on devices on the 
board, rather than devices on the SoC.  The GPIO is an SoC device, so 
it's currently managed by the hwmod data.  (This will probably change with 
future kernel releases.)

> In this specific case the pin is connected to nCONFIG of a FPGA. The
> FPGA is commanded to start configuration from a SPI flash in the
> bootloader, so it can happen in parallel with kernel
> load/uncompress/startup, but as the kernel resets the gpio during
> initialization this doesn't work.
> 
> Digging a bit into it, I see the hwmod of the gpio controller is
> configured to reset at startup, and it works correctly (E.G. the pin is
> left asserted) if I change it to HWMOD_INIT_NO_RESET:
> 
> --- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
> +++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
> @@ -992,7 +992,7 @@ static struct omap_hwmod am33xx_gpio1_hwmod = {
>         .name           = "gpio2",
>         .class          = &am33xx_gpio_hwmod_class,
>         .clkdm_name     = "l4ls_clkdm",
> -       .flags          = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
> +       .flags          = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET),
>         .mpu_irqs       = am33xx_gpio1_irqs,
>         .main_clk       = "l4ls_gclk",
>         .prcm           = {
> 
> Now the question is why is this configured like this?

This behavior is intended to decouple the kernel from the bootloader, or 
previously-booted operating system (e.g., the kexec case).  The original 
goal was to place the system in an known safe state as soon as possible 
after the kernel starts.  This is to prevent misconfigured or 
previously-configured devices from trashing memory or chip power 
management in the currently-booted kernel.  It also avoids adding 
inadvertent bootloader dependencies in driver code.

N.B., the plan is to change this behavior over the next few releases.  
Devices that have drivers associated with them will be reset when the 
driver loads.  Driverless devices will be reset after drivers load, late 
in boot.

> Should E.G. the gpio controllers be changed to not reset or should it be 
> configurable in the dts?

Probably the DTS is the right place, since this is a board- and 
bootloader-specific quirk.  The original intention was to allow board 
files to set this HWMOD_INIT_NO_RESET flag themselves - see mach-omap2/ 
omap_hwmod.c:omap_hwmod_no_setup_reset().  But since we've deprecated the 
board files, the DT data seems like the right place.  

It probably shouldn't be a GPIO-specific property.  Other devices like DSS 
will also need some kind of 'no-init-reset' property, since on many 
commercial devices, it's expected that some kind of splash screen will be 
presented by the bootloader and stay on during the boot process.

However, it is probably safest in the long run if you can change the board 
design to require the SoC to actively reset the FPGA, rather than making 
reset the default state.  That way, if there's some hardware bug that 
requires the GPIO block to be reset, or if there's some GPIO glitch during 
power management, the FPGA won't be inadvertently reset.


regards,

- Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Peter Korsgaard Jan. 10, 2013, 7:50 a.m. UTC | #2
>>>>> "Paul" == Paul Walmsley <paul@pwsan.com> writes:

Hi Paul,

Thanks for the detailed explanaition, and sorry for the slow response -
I've been away on holidays.

 >> Now the question is why is this configured like this?

 Paul> This behavior is intended to decouple the kernel from the
 Paul> bootloader, or previously-booted operating system (e.g., the
 Paul> kexec case).  The original goal was to place the system in an
 Paul> known safe state as soon as possible after the kernel starts.
 Paul> This is to prevent misconfigured or previously-configured devices
 Paul> from trashing memory or chip power management in the
 Paul> currently-booted kernel.  It also avoids adding inadvertent
 Paul> bootloader dependencies in driver code.

 Paul> N.B., the plan is to change this behavior over the next few
 Paul> releases.  Devices that have drivers associated with them will be
 Paul> reset when the driver loads.  Driverless devices will be reset
 Paul> after drivers load, late in boot.

 >> Should E.G. the gpio controllers be changed to not reset or should it be 
 >> configurable in the dts?

 Paul> Probably the DTS is the right place, since this is a board- and
 Paul> bootloader-specific quirk.  The original intention was to allow
 Paul> board files to set this HWMOD_INIT_NO_RESET flag themselves - see
 Paul> mach-omap2/ omap_hwmod.c:omap_hwmod_no_setup_reset().  But since
 Paul> we've deprecated the board files, the DT data seems like the
 Paul> right place.

 Paul> It probably shouldn't be a GPIO-specific property.  Other devices
 Paul> like DSS will also need some kind of 'no-init-reset' property,
 Paul> since on many commercial devices, it's expected that some kind of
 Paul> splash screen will be presented by the bootloader and stay on
 Paul> during the boot process.

I tried changing omap_device_build_from_dt() to call
omap_hwmod_no_setup_reset() on the corresponding hwmod if a
ti,no-init-reset was present, but that doesn't work as the hwmod reset
happens quite a bit earlier (in omap_hwmod_setup_all()). Do you have
idea how I could work around this or is that the future reset change you
referred to above?


 Paul> However, it is probably safest in the long run if you can change
 Paul> the board design to require the SoC to actively reset the FPGA,
 Paul> rather than making reset the default state.  That way, if there's
 Paul> some hardware bug that requires the GPIO block to be reset, or if
 Paul> there's some GPIO glitch during power management, the FPGA won't
 Paul> be inadvertently reset.

Yes, I'll try to get that done for the next board spin.

Thanks!
Peter Korsgaard Jan. 18, 2013, 2:18 p.m. UTC | #3
>>>>> "Peter" == Peter Korsgaard <jacmet@sunsite.dk> writes:

Hi,

 Paul> Probably the DTS is the right place, since this is a board- and
 Paul> bootloader-specific quirk.  The original intention was to allow
 Paul> board files to set this HWMOD_INIT_NO_RESET flag themselves - see
 Paul> mach-omap2/ omap_hwmod.c:omap_hwmod_no_setup_reset().  But since
 Paul> we've deprecated the board files, the DT data seems like the
 Paul> right place.

 Paul> It probably shouldn't be a GPIO-specific property.  Other devices
 Paul> like DSS will also need some kind of 'no-init-reset' property,
 Paul> since on many commercial devices, it's expected that some kind of
 Paul> splash screen will be presented by the bootloader and stay on
 Paul> during the boot process.

 Peter> I tried changing omap_device_build_from_dt() to call
 Peter> omap_hwmod_no_setup_reset() on the corresponding hwmod if a
 Peter> ti,no-init-reset was present, but that doesn't work as the hwmod
 Peter> reset happens quite a bit earlier (in
 Peter> omap_hwmod_setup_all()). Do you have idea how I could work
 Peter> around this or is that the future reset change you referred to
 Peter> above?

Paul, any ideas?
Felipe Balbi May 17, 2013, 1:50 p.m. UTC | #4
Hi,

On Sun, Dec 23, 2012 at 08:58:13PM +0000, Paul Walmsley wrote:
> > In this specific case the pin is connected to nCONFIG of a FPGA. The
> > FPGA is commanded to start configuration from a SPI flash in the
> > bootloader, so it can happen in parallel with kernel
> > load/uncompress/startup, but as the kernel resets the gpio during
> > initialization this doesn't work.
> > 
> > Digging a bit into it, I see the hwmod of the gpio controller is
> > configured to reset at startup, and it works correctly (E.G. the pin is
> > left asserted) if I change it to HWMOD_INIT_NO_RESET:
> > 
> > --- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
> > +++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
> > @@ -992,7 +992,7 @@ static struct omap_hwmod am33xx_gpio1_hwmod = {
> >         .name           = "gpio2",
> >         .class          = &am33xx_gpio_hwmod_class,
> >         .clkdm_name     = "l4ls_clkdm",
> > -       .flags          = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
> > +       .flags          = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET),
> >         .mpu_irqs       = am33xx_gpio1_irqs,
> >         .main_clk       = "l4ls_gclk",
> >         .prcm           = {
> > 
> > Now the question is why is this configured like this?
> 
> This behavior is intended to decouple the kernel from the bootloader, or 
> previously-booted operating system (e.g., the kexec case).  The original 
> goal was to place the system in an known safe state as soon as possible 
> after the kernel starts.  This is to prevent misconfigured or 

there is one "issue" with this. At least on AM335x starter kit, GPIO0_7
is used as DDR power pin. If we reset that GPIO bank, DDR looses power
and "for obscure reasons" (:-)) the board doesn't boot.

In this case, we cannot reset that bank, otherwise Starter Kit will
never boot in mainline. Bad PCB design, I know, but it's not something
we can change now :-)

cheers
Peter Korsgaard May 17, 2013, 1:53 p.m. UTC | #5
>>>>> "Felipe" == Felipe Balbi <balbi@ti.com> writes:

Hi,

 >> > +++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
 >> > @@ -992,7 +992,7 @@ static struct omap_hwmod am33xx_gpio1_hwmod = {
 >> >         .name           = "gpio2",
 >> >         .class          = &am33xx_gpio_hwmod_class,
 >> >         .clkdm_name     = "l4ls_clkdm",
 >> > -       .flags          = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
 >> > +       .flags          = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET),
 >> >         .mpu_irqs       = am33xx_gpio1_irqs,
 >> >         .main_clk       = "l4ls_gclk",
 >> >         .prcm           = {
 >> > 
 >> > Now the question is why is this configured like this?
 >> 
 >> This behavior is intended to decouple the kernel from the bootloader, or 
 >> previously-booted operating system (e.g., the kexec case).  The original 
 >> goal was to place the system in an known safe state as soon as possible 
 >> after the kernel starts.  This is to prevent misconfigured or 

 Felipe> there is one "issue" with this. At least on AM335x starter kit,
 Felipe> GPIO0_7 is used as DDR power pin. If we reset that GPIO bank,
 Felipe> DDR looses power and "for obscure reasons" (:-)) the board
 Felipe> doesn't boot.

Heh!

 Felipe> In this case, we cannot reset that bank, otherwise Starter Kit
 Felipe> will never boot in mainline. Bad PCB design, I know, but it's
 Felipe> not something we can change now :-)

Indeed. So that's two examples of people designing boards with the
assumption that gpios will not toggle between bootloader and running
system. Chances are that there will be others.
Kevin Hilman May 17, 2013, 5:08 p.m. UTC | #6
Felipe Balbi <balbi@ti.com> writes:

> Hi,
>
> On Sun, Dec 23, 2012 at 08:58:13PM +0000, Paul Walmsley wrote:
>> > In this specific case the pin is connected to nCONFIG of a FPGA. The
>> > FPGA is commanded to start configuration from a SPI flash in the
>> > bootloader, so it can happen in parallel with kernel
>> > load/uncompress/startup, but as the kernel resets the gpio during
>> > initialization this doesn't work.
>> > 
>> > Digging a bit into it, I see the hwmod of the gpio controller is
>> > configured to reset at startup, and it works correctly (E.G. the pin is
>> > left asserted) if I change it to HWMOD_INIT_NO_RESET:
>> > 
>> > --- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
>> > +++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
>> > @@ -992,7 +992,7 @@ static struct omap_hwmod am33xx_gpio1_hwmod = {
>> >         .name           = "gpio2",
>> >         .class          = &am33xx_gpio_hwmod_class,
>> >         .clkdm_name     = "l4ls_clkdm",
>> > -       .flags          = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
>> > +       .flags          = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET),
>> >         .mpu_irqs       = am33xx_gpio1_irqs,
>> >         .main_clk       = "l4ls_gclk",
>> >         .prcm           = {
>> > 
>> > Now the question is why is this configured like this?
>> 
>> This behavior is intended to decouple the kernel from the bootloader, or 
>> previously-booted operating system (e.g., the kexec case).  The original 
>> goal was to place the system in an known safe state as soon as possible 
>> after the kernel starts.  This is to prevent misconfigured or 
>
> there is one "issue" with this. At least on AM335x starter kit, GPIO0_7
> is used as DDR power pin. If we reset that GPIO bank, DDR looses power
> and "for obscure reasons" (:-)) the board doesn't boot.
>
> In this case, we cannot reset that bank, otherwise Starter Kit will
> never boot in mainline. Bad PCB design, I know, but it's not something
> we can change now :-)

FWIW, we've seen this before (GPIO connected to PMIC reset is a fun
one), and this is why we have omap_hwmod_no_setup_reset().

Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Peter Korsgaard May 17, 2013, 6:10 p.m. UTC | #7
>>>>> "Kevin" == Kevin Hilman <khilman@linaro.org> writes:

 >> In this case, we cannot reset that bank, otherwise Starter Kit will
 >> never boot in mainline. Bad PCB design, I know, but it's not something
 >> we can change now :-)

 Kevin> FWIW, we've seen this before (GPIO connected to PMIC reset is a
 Kevin> fun one), and this is why we have omap_hwmod_no_setup_reset().

Yes, but there's no dts bindings for this, and from a quick test the
reset handling happens before the device tree is probed.
Nishanth Menon May 17, 2013, 6:19 p.m. UTC | #8
On 20:10-20130517, Peter Korsgaard wrote:
> >>>>> "Kevin" == Kevin Hilman <khilman@linaro.org> writes:
> 
>  >> In this case, we cannot reset that bank, otherwise Starter Kit will
>  >> never boot in mainline. Bad PCB design, I know, but it's not something
>  >> we can change now :-)
> 
>  Kevin> FWIW, we've seen this before (GPIO connected to PMIC reset is a
>  Kevin> fun one), and this is why we have omap_hwmod_no_setup_reset().
> 
> Yes, but there's no dts bindings for this, and from a quick test the
> reset handling happens before the device tree is probed.
I have the same issue with TPS62361 on Palmas -> GPIO controls the
voltage register supplying MPU, without any driver setting things up,
GPIO gets reset and obviously voltage value switches to an voltage where
device does not function.

Solution I am working on to solve this is [1]: snippet is part of a
patch that I am working on atm.

This is the right way to do it IMHO. Will allow the driver to exist when
HWMOD will be eventually replaced by some other framework.


[1]: http://pastebin.com/XPmAB1Zb
Vaibhav Hiremath May 20, 2013, 6:38 a.m. UTC | #9
> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> owner@vger.kernel.org] On Behalf Of Menon, Nishanth
> Sent: Friday, May 17, 2013 11:49 PM
> To: Peter Korsgaard
> Cc: Kevin Hilman; Balbi, Felipe; Paul Walmsley; linux-
> omap@vger.kernel.org; Tony Lindgren
> Subject: Re: reset handling in am335x hwmod data
> 
> On 20:10-20130517, Peter Korsgaard wrote:
> > >>>>> "Kevin" == Kevin Hilman <khilman@linaro.org> writes:
> >
> >  >> In this case, we cannot reset that bank, otherwise Starter Kit
> will
> >  >> never boot in mainline. Bad PCB design, I know, but it's not
> something
> >  >> we can change now :-)
> >
> >  Kevin> FWIW, we've seen this before (GPIO connected to PMIC reset is
> a
> >  Kevin> fun one), and this is why we have
> omap_hwmod_no_setup_reset().
> >
> > Yes, but there's no dts bindings for this, and from a quick test the
> > reset handling happens before the device tree is probed.
> I have the same issue with TPS62361 on Palmas -> GPIO controls the
> voltage register supplying MPU, without any driver setting things up,
> GPIO gets reset and obviously voltage value switches to an voltage
> where
> device does not function.
> 
> Solution I am working on to solve this is [1]: snippet is part of a
> patch that I am working on atm.
> 
> This is the right way to do it IMHO. Will allow the driver to exist
> when
> HWMOD will be eventually replaced by some other framework.
> 
> 
> [1]: http://pastebin.com/XPmAB1Zb
> 
> 

Both seems to be different to me. What we need is to
Avoid reset of whole GPIO bank during kernel boot. 

Ideally, it would have been much better if drivers starts handling
Idle, ocp reset and standby on their own (killing dependency on hwmod 
init layer).

But looking at current state,
I agree we need to use DT property here, so how about 
Adding DT property  to GPIO node itself. But we have to parse
It early during hwmod init stage. We should read all DT nodes 
Inside function __setup() function, that way can get rid of
HWMOD_INIT_NO_RESET flag completely. Also, this will handle
Both ocp_reset and domain reset.

Thanks,
Vaibhav
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Vaibhav Hiremath May 20, 2013, 6:55 a.m. UTC | #10
> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> owner@vger.kernel.org] On Behalf Of Hiremath, Vaibhav
> Sent: Monday, May 20, 2013 12:09 PM
> To: Menon, Nishanth; Peter Korsgaard
> Cc: Kevin Hilman; Balbi, Felipe; Paul Walmsley; linux-
> omap@vger.kernel.org; Tony Lindgren
> Subject: RE: reset handling in am335x hwmod data
> 
> 
> > -----Original Message-----
> > From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> > owner@vger.kernel.org] On Behalf Of Menon, Nishanth
> > Sent: Friday, May 17, 2013 11:49 PM
> > To: Peter Korsgaard
> > Cc: Kevin Hilman; Balbi, Felipe; Paul Walmsley; linux-
> > omap@vger.kernel.org; Tony Lindgren
> > Subject: Re: reset handling in am335x hwmod data
> >
> > On 20:10-20130517, Peter Korsgaard wrote:
> > > >>>>> "Kevin" == Kevin Hilman <khilman@linaro.org> writes:
> > >
> > >  >> In this case, we cannot reset that bank, otherwise Starter Kit
> > will
> > >  >> never boot in mainline. Bad PCB design, I know, but it's not
> > something
> > >  >> we can change now :-)
> > >
> > >  Kevin> FWIW, we've seen this before (GPIO connected to PMIC reset
> is
> > a
> > >  Kevin> fun one), and this is why we have
> > omap_hwmod_no_setup_reset().
> > >
> > > Yes, but there's no dts bindings for this, and from a quick test
> the
> > > reset handling happens before the device tree is probed.
> > I have the same issue with TPS62361 on Palmas -> GPIO controls the
> > voltage register supplying MPU, without any driver setting things up,
> > GPIO gets reset and obviously voltage value switches to an voltage
> > where
> > device does not function.
> >
> > Solution I am working on to solve this is [1]: snippet is part of a
> > patch that I am working on atm.
> >
> > This is the right way to do it IMHO. Will allow the driver to exist
> > when
> > HWMOD will be eventually replaced by some other framework.
> >
> >
> > [1]: http://pastebin.com/XPmAB1Zb
> >
> >
> 
> Both seems to be different to me. What we need is to
> Avoid reset of whole GPIO bank during kernel boot.
> 
> Ideally, it would have been much better if drivers starts handling
> Idle, ocp reset and standby on their own (killing dependency on hwmod
> init layer).
> 
> But looking at current state,
> I agree we need to use DT property here, so how about
> Adding DT property  to GPIO node itself. But we have to parse
> It early during hwmod init stage. We should read all DT nodes
> Inside function __setup() function, that way can get rid of
> HWMOD_INIT_NO_RESET flag completely. Also, this will handle
> Both ocp_reset and domain reset.
> 

Forgot to mention, 

Since this is kernel boot failure issue, I think,
By the time we reach to conclusion, another approach is to 
set "HWMOD_INIT_NO_RESET" flag For GPIO0 bank.

Thanks,
Vaibhav
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Nishanth Menon May 20, 2013, 3:06 p.m. UTC | #11
On 01:55-20130520, Hiremath, Vaibhav wrote:
> 
> > -----Original Message-----
> > From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> > owner@vger.kernel.org] On Behalf Of Hiremath, Vaibhav
> > Sent: Monday, May 20, 2013 12:09 PM
> > To: Menon, Nishanth; Peter Korsgaard
> > Cc: Kevin Hilman; Balbi, Felipe; Paul Walmsley; linux-
> > omap@vger.kernel.org; Tony Lindgren
> > Subject: RE: reset handling in am335x hwmod data
> > 
> > 
> > > -----Original Message-----
> > > From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> > > owner@vger.kernel.org] On Behalf Of Menon, Nishanth
> > > Sent: Friday, May 17, 2013 11:49 PM
> > > To: Peter Korsgaard
> > > Cc: Kevin Hilman; Balbi, Felipe; Paul Walmsley; linux-
> > > omap@vger.kernel.org; Tony Lindgren
> > > Subject: Re: reset handling in am335x hwmod data
> > >
> > > On 20:10-20130517, Peter Korsgaard wrote:
> > > > >>>>> "Kevin" == Kevin Hilman <khilman@linaro.org> writes:
> > > >
> > > >  >> In this case, we cannot reset that bank, otherwise Starter Kit
> > > will
> > > >  >> never boot in mainline. Bad PCB design, I know, but it's not
> > > something
> > > >  >> we can change now :-)
> > > >
> > > >  Kevin> FWIW, we've seen this before (GPIO connected to PMIC reset
> > is
> > > a
> > > >  Kevin> fun one), and this is why we have
> > > omap_hwmod_no_setup_reset().
> > > >
> > > > Yes, but there's no dts bindings for this, and from a quick test
> > the
> > > > reset handling happens before the device tree is probed.
> > > I have the same issue with TPS62361 on Palmas -> GPIO controls the
> > > voltage register supplying MPU, without any driver setting things up,
> > > GPIO gets reset and obviously voltage value switches to an voltage
> > > where
> > > device does not function.
> > >
> > > Solution I am working on to solve this is [1]: snippet is part of a
> > > patch that I am working on atm.
> > >
> > > This is the right way to do it IMHO. Will allow the driver to exist
> > > when
> > > HWMOD will be eventually replaced by some other framework.
> > >
> > >
> > > [1]: http://pastebin.com/XPmAB1Zb
> > >
> > >
> > 
> > Both seems to be different to me. What we need is to
> > Avoid reset of whole GPIO bank during kernel boot.
Yes - that is what the above does - as long as the GPIO is requested and
set to the right level by the relevant driver, it is not "unused" and
hence not reset at late_init.

I am a little unclear as to why this needs to have anything to do with
the precise under-lying mechanism (hwmod or something else). May be
"both seem to be different to me" needs a little further elaboration?

Is this because there is no need for an EMIF driver to handle DDR? and
reset of the GPIO will occur as EMIF is configured at bootloader and
there is no need to do that in kernel, correspondingly there is no
"driver" to hold the gpio?
> > 
> > Ideally, it would have been much better if drivers starts handling
> > Idle, ocp reset and standby on their own (killing dependency on hwmod
> > init layer).
> > 
> > But looking at current state,
> > I agree we need to use DT property here, so how about
> > Adding DT property  to GPIO node itself. But we have to parse
I believe you mean at OMAP specific  DT property for hwmod?
something like ti,hwmod-no-init-reset?
> > It early during hwmod init stage. We should read all DT nodes
> > Inside function __setup() function, that way can get rid of
> > HWMOD_INIT_NO_RESET flag completely. Also, this will handle
> > Both ocp_reset and domain reset.
> > 
> 
> Forgot to mention, 
> 
> Since this is kernel boot failure issue, I think,
> By the time we reach to conclusion, another approach is to 
> set "HWMOD_INIT_NO_RESET" flag For GPIO0 bank.
a) if the GPIO gets moved over to some other GPIO bank on another platform,
this wont work
b) for platforms that dont use gpio to hold DDR power, maybe this is not
even relevant and the GPIO bank can safely be reset?
> 
> Thanks,
> Vaibhav
Vaibhav Hiremath May 20, 2013, 5:47 p.m. UTC | #12
> -----Original Message-----
> From: Menon, Nishanth
> Sent: Monday, May 20, 2013 8:36 PM
> To: Hiremath, Vaibhav
> Cc: Peter Korsgaard; Kevin Hilman; Balbi, Felipe; Paul Walmsley; linux-
> omap@vger.kernel.org; Tony Lindgren
> Subject: Re: reset handling in am335x hwmod data
> 
> On 01:55-20130520, Hiremath, Vaibhav wrote:
> >
> > > -----Original Message-----
> > > From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> > > owner@vger.kernel.org] On Behalf Of Hiremath, Vaibhav
> > > Sent: Monday, May 20, 2013 12:09 PM
> > > To: Menon, Nishanth; Peter Korsgaard
> > > Cc: Kevin Hilman; Balbi, Felipe; Paul Walmsley; linux-
> > > omap@vger.kernel.org; Tony Lindgren
> > > Subject: RE: reset handling in am335x hwmod data
> > >
> > >
> > > > -----Original Message-----
> > > > From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> > > > owner@vger.kernel.org] On Behalf Of Menon, Nishanth
> > > > Sent: Friday, May 17, 2013 11:49 PM
> > > > To: Peter Korsgaard
> > > > Cc: Kevin Hilman; Balbi, Felipe; Paul Walmsley; linux-
> > > > omap@vger.kernel.org; Tony Lindgren
> > > > Subject: Re: reset handling in am335x hwmod data
> > > >
> > > > On 20:10-20130517, Peter Korsgaard wrote:
> > > > > >>>>> "Kevin" == Kevin Hilman <khilman@linaro.org> writes:
> > > > >
> > > > >  >> In this case, we cannot reset that bank, otherwise Starter
> Kit
> > > > will
> > > > >  >> never boot in mainline. Bad PCB design, I know, but it's
> not
> > > > something
> > > > >  >> we can change now :-)
> > > > >
> > > > >  Kevin> FWIW, we've seen this before (GPIO connected to PMIC
> reset
> > > is
> > > > a
> > > > >  Kevin> fun one), and this is why we have
> > > > omap_hwmod_no_setup_reset().
> > > > >
> > > > > Yes, but there's no dts bindings for this, and from a quick
> test
> > > the
> > > > > reset handling happens before the device tree is probed.
> > > > I have the same issue with TPS62361 on Palmas -> GPIO controls
> the
> > > > voltage register supplying MPU, without any driver setting things
> up,
> > > > GPIO gets reset and obviously voltage value switches to an
> voltage
> > > > where
> > > > device does not function.
> > > >
> > > > Solution I am working on to solve this is [1]: snippet is part of
> a
> > > > patch that I am working on atm.
> > > >
> > > > This is the right way to do it IMHO. Will allow the driver to
> exist
> > > > when
> > > > HWMOD will be eventually replaced by some other framework.
> > > >
> > > >
> > > > [1]: http://pastebin.com/XPmAB1Zb
> > > >
> > > >
> > >
> > > Both seems to be different to me. What we need is to
> > > Avoid reset of whole GPIO bank during kernel boot.
> Yes - that is what the above does - as long as the GPIO is requested
> and
> set to the right level by the relevant driver, it is not "unused" and
> hence not reset at late_init.
> 

May be I am missing something here,

Isn't _setup_reset() function asserts ocp_reset? And it is core_initcall.

> I am a little unclear as to why this needs to have anything to do with
> the precise under-lying mechanism (hwmod or something else). May be
> "both seem to be different to me" needs a little further elaboration?
> 

GPIO is connected to the DDR VTT control pin, and we have observed that
Due to GPIO bank reset as part of hwmod init during bootup.

> Is this because there is no need for an EMIF driver to handle DDR? and
> reset of the GPIO will occur as EMIF is configured at bootloader and
> there is no need to do that in kernel, correspondingly there is no
> "driver" to hold the gpio?
> > >
> > > Ideally, it would have been much better if drivers starts handling
> > > Idle, ocp reset and standby on their own (killing dependency on
> hwmod
> > > init layer).
> > >
> > > But looking at current state,
> > > I agree we need to use DT property here, so how about
> > > Adding DT property  to GPIO node itself. But we have to parse
> I believe you mean at OMAP specific  DT property for hwmod?
> something like ti,hwmod-no-init-reset?

That’s the idea.

> > > It early during hwmod init stage. We should read all DT nodes
> > > Inside function __setup() function, that way can get rid of
> > > HWMOD_INIT_NO_RESET flag completely. Also, this will handle
> > > Both ocp_reset and domain reset.
> > >
> >
> > Forgot to mention,
> >
> > Since this is kernel boot failure issue, I think,
> > By the time we reach to conclusion, another approach is to
> > set "HWMOD_INIT_NO_RESET" flag For GPIO0 bank.
> a) if the GPIO gets moved over to some other GPIO bank on another
> platform,
> this wont work

Yes that’s true, but such schematic interface is not recommended.
And we have not seen any known side-effect of not resetting GPIO0 bank.

> b) for platforms that dont use gpio to hold DDR power, maybe this is
> not
> even relevant and the GPIO bank can safely be reset?
> >

As I mentioned, there is no known side-effect of not resetting GPIO bank 0.

Thanks,
Vaibhav
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Nishanth Menon May 20, 2013, 6:03 p.m. UTC | #13
On 12:47-20130520, Hiremath, Vaibhav wrote:
[...]
> > > > >
> > > > > On 20:10-20130517, Peter Korsgaard wrote:
> > > > > > >>>>> "Kevin" == Kevin Hilman <khilman@linaro.org> writes:
> > > > > >
> > > > > >  >> In this case, we cannot reset that bank, otherwise Starter
> > Kit
> > > > > will
> > > > > >  >> never boot in mainline. Bad PCB design, I know, but it's
> > not
> > > > > something
> > > > > >  >> we can change now :-)
> > > > > >
> > > > > >  Kevin> FWIW, we've seen this before (GPIO connected to PMIC
> > reset
> > > > is
> > > > > a
> > > > > >  Kevin> fun one), and this is why we have
> > > > > omap_hwmod_no_setup_reset().
> > > > > >
> > > > > > Yes, but there's no dts bindings for this, and from a quick
> > test
> > > > the
> > > > > > reset handling happens before the device tree is probed.
> > > > > I have the same issue with TPS62361 on Palmas -> GPIO controls
> > the
> > > > > voltage register supplying MPU, without any driver setting things
> > up,
> > > > > GPIO gets reset and obviously voltage value switches to an
> > voltage
> > > > > where
> > > > > device does not function.
> > > > >
> > > > > Solution I am working on to solve this is [1]: snippet is part of
> > a
> > > > > patch that I am working on atm.
> > > > >
> > > > > This is the right way to do it IMHO. Will allow the driver to
> > exist
> > > > > when
> > > > > HWMOD will be eventually replaced by some other framework.
> > > > >
> > > > >
> > > > > [1]: http://pastebin.com/XPmAB1Zb
> > > > >
> > > > >
> > > >
> > > > Both seems to be different to me. What we need is to
> > > > Avoid reset of whole GPIO bank during kernel boot.
> > Yes - that is what the above does - as long as the GPIO is requested
> > and
> > set to the right level by the relevant driver, it is not "unused" and
> > hence not reset at late_init.
> > 
> 
> May be I am missing something here,
> 
> Isn't _setup_reset() function asserts ocp_reset? And it is core_initcall.
Hmm.. You are right, I missed that :(
> 
> > I am a little unclear as to why this needs to have anything to do with
> > the precise under-lying mechanism (hwmod or something else). May be
> > "both seem to be different to me" needs a little further elaboration?
> > 
> 
> GPIO is connected to the DDR VTT control pin, and we have observed that
> Due to GPIO bank reset as part of hwmod init during bootup.
> 
> > Is this because there is no need for an EMIF driver to handle DDR? and
> > reset of the GPIO will occur as EMIF is configured at bootloader and
> > there is no need to do that in kernel, correspondingly there is no
> > "driver" to hold the gpio?
> > > >
> > > > Ideally, it would have been much better if drivers starts handling
> > > > Idle, ocp reset and standby on their own (killing dependency on
> > hwmod
> > > > init layer).
> > > >
> > > > But looking at current state,
> > > > I agree we need to use DT property here, so how about
> > > > Adding DT property  to GPIO node itself. But we have to parse
> > I believe you mean at OMAP specific  DT property for hwmod?
> > something like ti,hwmod-no-init-reset?
> 
> That’s the idea.
> 
> > > > It early during hwmod init stage. We should read all DT nodes
> > > > Inside function __setup() function, that way can get rid of
> > > > HWMOD_INIT_NO_RESET flag completely. Also, this will handle
> > > > Both ocp_reset and domain reset.
> > > >
> > >
> > > Forgot to mention,
> > >
> > > Since this is kernel boot failure issue, I think,
> > > By the time we reach to conclusion, another approach is to
> > > set "HWMOD_INIT_NO_RESET" flag For GPIO0 bank.
> > a) if the GPIO gets moved over to some other GPIO bank on another
> > platform,
> > this wont work
> 
> Yes that’s true, but such schematic interface is not recommended.
> And we have not seen any known side-effect of not resetting GPIO0 bank.
unless you mark the GPIO as taken, another driver could in-adverantly
take over the GPIO and set it to a wrong level (we had a similar story
with LED gpio between Panda Vs Panda-ES).

> 
> > b) for platforms that dont use gpio to hold DDR power, maybe this is
> > not
> > even relevant and the GPIO bank can safely be reset?
> > >
> 
> As I mentioned, there is no known side-effect of not resetting GPIO bank 0.
It should depend on the platform.

There are other uses for hwmod-no-reset -> Eg. boot logo displayed by
bootloader - if there is a reset of DSS block and re-configuration, we'd
notice a blank-out, which is not desirable either. There could be a few
other usage based on no-reset.

In all cases, you'd prefer to make this:
a) platform dependent (board dts)
b) reserve GPIO as well so that no other driver'd take it - if they
attempt ther'd at least be some form of warning.
Vaibhav Hiremath May 20, 2013, 6:20 p.m. UTC | #14
DQo+IC0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQo+IEZyb206IE1lbm9uLCBOaXNoYW50aA0K
PiBTZW50OiBNb25kYXksIE1heSAyMCwgMjAxMyAxMTozNCBQTQ0KPiBUbz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m92ZS4NCg0KVGhhbmtzLA0KVmFpYmhhdg0K
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Felipe Balbi June 28, 2013, 10:54 a.m. UTC | #15
Hi,

On Mon, May 20, 2013 at 08:20:29PM +0200, Hiremath, Vaibhav wrote:
> 
> > -----Original Message-----
> > From: Menon, Nishanth
> > Sent: Monday, May 20, 2013 11:34 PM
> > To: Hiremath, Vaibhav
> > Cc: Peter Korsgaard; Kevin Hilman; Balbi, Felipe; Paul Walmsley; linux-
> > omap@vger.kernel.org; Tony Lindgren
> > Subject: Re: reset handling in am335x hwmod data
> > 
> > On 12:47-20130520, Hiremath, Vaibhav wrote:
> > [...]
> > > > > > >
> > > > > > > On 20:10-20130517, Peter Korsgaard wrote:
> > > > > > > > >>>>> "Kevin" == Kevin Hilman <khilman@linaro.org> writes:
> > > > > > > >
> > > > > > > >  >> In this case, we cannot reset that bank, otherwise
> > Starter
> > > > Kit
> > > > > > > will
> > > > > > > >  >> never boot in mainline. Bad PCB design, I know, but
> > it's
> > > > not
> > > > > > > something
> > > > > > > >  >> we can change now :-)
> > > > > > > >
> > > > > > > >  Kevin> FWIW, we've seen this before (GPIO connected to
> > PMIC
> > > > reset
> > > > > > is
> > > > > > > a
> > > > > > > >  Kevin> fun one), and this is why we have
> > > > > > > omap_hwmod_no_setup_reset().
> > > > > > > >
> > > > > > > > Yes, but there's no dts bindings for this, and from a quick
> > > > test
> > > > > > the
> > > > > > > > reset handling happens before the device tree is probed.
> > > > > > > I have the same issue with TPS62361 on Palmas -> GPIO
> > controls
> > > > the
> > > > > > > voltage register supplying MPU, without any driver setting
> > things
> > > > up,
> > > > > > > GPIO gets reset and obviously voltage value switches to an
> > > > voltage
> > > > > > > where
> > > > > > > device does not function.
> > > > > > >
> > > > > > > Solution I am working on to solve this is [1]: snippet is
> > part of
> > > > a
> > > > > > > patch that I am working on atm.
> > > > > > >
> > > > > > > This is the right way to do it IMHO. Will allow the driver to
> > > > exist
> > > > > > > when
> > > > > > > HWMOD will be eventually replaced by some other framework.
> > > > > > >
> > > > > > >
> > > > > > > [1]: http://pastebin.com/XPmAB1Zb
> > > > > > >
> > > > > > >
> > > > > >
> > > > > > Both seems to be different to me. What we need is to
> > > > > > Avoid reset of whole GPIO bank during kernel boot.
> > > > Yes - that is what the above does - as long as the GPIO is
> > requested
> > > > and
> > > > set to the right level by the relevant driver, it is not "unused"
> > and
> > > > hence not reset at late_init.
> > > >
> > >
> > > May be I am missing something here,
> > >
> > > Isn't _setup_reset() function asserts ocp_reset? And it is
> > core_initcall.
> > Hmm.. You are right, I missed that :(
> > >
> > > > I am a little unclear as to why this needs to have anything to do
> > with
> > > > the precise under-lying mechanism (hwmod or something else). May be
> > > > "both seem to be different to me" needs a little further
> > elaboration?
> > > >
> > >
> > > GPIO is connected to the DDR VTT control pin, and we have observed
> > that
> > > Due to GPIO bank reset as part of hwmod init during bootup.
> > >
> > > > Is this because there is no need for an EMIF driver to handle DDR?
> > and
> > > > reset of the GPIO will occur as EMIF is configured at bootloader
> > and
> > > > there is no need to do that in kernel, correspondingly there is no
> > > > "driver" to hold the gpio?
> > > > > >
> > > > > > Ideally, it would have been much better if drivers starts
> > handling
> > > > > > Idle, ocp reset and standby on their own (killing dependency on
> > > > hwmod
> > > > > > init layer).
> > > > > >
> > > > > > But looking at current state,
> > > > > > I agree we need to use DT property here, so how about
> > > > > > Adding DT property  to GPIO node itself. But we have to parse
> > > > I believe you mean at OMAP specific  DT property for hwmod?
> > > > something like ti,hwmod-no-init-reset?
> > >
> > > That’s the idea.
> > >
> > > > > > It early during hwmod init stage. We should read all DT nodes
> > > > > > Inside function __setup() function, that way can get rid of
> > > > > > HWMOD_INIT_NO_RESET flag completely. Also, this will handle
> > > > > > Both ocp_reset and domain reset.
> > > > > >
> > > > >
> > > > > Forgot to mention,
> > > > >
> > > > > Since this is kernel boot failure issue, I think,
> > > > > By the time we reach to conclusion, another approach is to
> > > > > set "HWMOD_INIT_NO_RESET" flag For GPIO0 bank.
> > > > a) if the GPIO gets moved over to some other GPIO bank on another
> > > > platform,
> > > > this wont work
> > >
> > > Yes that’s true, but such schematic interface is not recommended.
> > > And we have not seen any known side-effect of not resetting GPIO0
> > bank.
> > unless you mark the GPIO as taken, another driver could in-adverantly
> > take over the GPIO and set it to a wrong level (we had a similar story
> > with LED gpio between Panda Vs Panda-ES).
> > 
> > >
> > > > b) for platforms that dont use gpio to hold DDR power, maybe this
> > is
> > > > not
> > > > even relevant and the GPIO bank can safely be reset?
> > > > >
> > >
> > > As I mentioned, there is no known side-effect of not resetting GPIO
> > bank 0.
> > It should depend on the platform.
> > 
> > There are other uses for hwmod-no-reset -> Eg. boot logo displayed by
> > bootloader - if there is a reset of DSS block and re-configuration,
> > we'd
> > notice a blank-out, which is not desirable either. There could be a few
> > other usage based on no-reset.
> > 
> > In all cases, you'd prefer to make this:
> > a) platform dependent (board dts)
> > b) reserve GPIO as well so that no other driver'd take it - if they
> > attempt ther'd at least be some form of warning.
> > 
> Completely agree with you on both the points, and my point and all my comments
> Were more related to option 'a' above.

so, what happened here ? Will we not have AM335x-SK working in mainline
just because of the GPIO block being reset ?
Vaibhav Hiremath July 2, 2013, 4:37 a.m. UTC | #16
> -----Original Message-----

> From: Balbi, Felipe

> Sent: Friday, June 28, 2013 4:24 PM

> To: Hiremath, Vaibhav

> Cc: Menon, Nishanth; Peter Korsgaard; Kevin Hilman; Balbi, Felipe; Paul

> Walmsley; linux-omap@vger.kernel.org; Tony Lindgren; Sebastian Andrzej

> Siewior

> Subject: Re: reset handling in am335x hwmod data

> 

> Hi,

> 

> On Mon, May 20, 2013 at 08:20:29PM +0200, Hiremath, Vaibhav wrote:

> >

> > > -----Original Message-----

> > > From: Menon, Nishanth

> > > Sent: Monday, May 20, 2013 11:34 PM

> > > To: Hiremath, Vaibhav

> > > Cc: Peter Korsgaard; Kevin Hilman; Balbi, Felipe; Paul Walmsley;

> linux-

> > > omap@vger.kernel.org; Tony Lindgren

> > > Subject: Re: reset handling in am335x hwmod data

> > >

> > > On 12:47-20130520, Hiremath, Vaibhav wrote:

> > > [...]

> > > > > > > >

> > > > > > > > On 20:10-20130517, Peter Korsgaard wrote:

> > > > > > > > > >>>>> "Kevin" == Kevin Hilman <khilman@linaro.org>

> writes:

> > > > > > > > >

> > > > > > > > >  >> In this case, we cannot reset that bank, otherwise

> > > Starter

> > > > > Kit

> > > > > > > > will

> > > > > > > > >  >> never boot in mainline. Bad PCB design, I know, but

> > > it's

> > > > > not

> > > > > > > > something

> > > > > > > > >  >> we can change now :-)

> > > > > > > > >

> > > > > > > > >  Kevin> FWIW, we've seen this before (GPIO connected to

> > > PMIC

> > > > > reset

> > > > > > > is

> > > > > > > > a

> > > > > > > > >  Kevin> fun one), and this is why we have

> > > > > > > > omap_hwmod_no_setup_reset().

> > > > > > > > >

> > > > > > > > > Yes, but there's no dts bindings for this, and from a

> quick

> > > > > test

> > > > > > > the

> > > > > > > > > reset handling happens before the device tree is

> probed.

> > > > > > > > I have the same issue with TPS62361 on Palmas -> GPIO

> > > controls

> > > > > the

> > > > > > > > voltage register supplying MPU, without any driver

> setting

> > > things

> > > > > up,

> > > > > > > > GPIO gets reset and obviously voltage value switches to

> an

> > > > > voltage

> > > > > > > > where

> > > > > > > > device does not function.

> > > > > > > >

> > > > > > > > Solution I am working on to solve this is [1]: snippet is

> > > part of

> > > > > a

> > > > > > > > patch that I am working on atm.

> > > > > > > >

> > > > > > > > This is the right way to do it IMHO. Will allow the

> driver to

> > > > > exist

> > > > > > > > when

> > > > > > > > HWMOD will be eventually replaced by some other

> framework.

> > > > > > > >

> > > > > > > >

> > > > > > > > [1]: http://pastebin.com/XPmAB1Zb

> > > > > > > >

> > > > > > > >

> > > > > > >

> > > > > > > Both seems to be different to me. What we need is to

> > > > > > > Avoid reset of whole GPIO bank during kernel boot.

> > > > > Yes - that is what the above does - as long as the GPIO is

> > > requested

> > > > > and

> > > > > set to the right level by the relevant driver, it is not

> "unused"

> > > and

> > > > > hence not reset at late_init.

> > > > >

> > > >

> > > > May be I am missing something here,

> > > >

> > > > Isn't _setup_reset() function asserts ocp_reset? And it is

> > > core_initcall.

> > > Hmm.. You are right, I missed that :(

> > > >

> > > > > I am a little unclear as to why this needs to have anything to

> do

> > > with

> > > > > the precise under-lying mechanism (hwmod or something else).

> May be

> > > > > "both seem to be different to me" needs a little further

> > > elaboration?

> > > > >

> > > >

> > > > GPIO is connected to the DDR VTT control pin, and we have

> observed

> > > that

> > > > Due to GPIO bank reset as part of hwmod init during bootup.

> > > >

> > > > > Is this because there is no need for an EMIF driver to handle

> DDR?

> > > and

> > > > > reset of the GPIO will occur as EMIF is configured at

> bootloader

> > > and

> > > > > there is no need to do that in kernel, correspondingly there is

> no

> > > > > "driver" to hold the gpio?

> > > > > > >

> > > > > > > Ideally, it would have been much better if drivers starts

> > > handling

> > > > > > > Idle, ocp reset and standby on their own (killing

> dependency on

> > > > > hwmod

> > > > > > > init layer).

> > > > > > >

> > > > > > > But looking at current state,

> > > > > > > I agree we need to use DT property here, so how about

> > > > > > > Adding DT property  to GPIO node itself. But we have to

> parse

> > > > > I believe you mean at OMAP specific  DT property for hwmod?

> > > > > something like ti,hwmod-no-init-reset?

> > > >

> > > > That’s the idea.

> > > >

> > > > > > > It early during hwmod init stage. We should read all DT

> nodes

> > > > > > > Inside function __setup() function, that way can get rid of

> > > > > > > HWMOD_INIT_NO_RESET flag completely. Also, this will handle

> > > > > > > Both ocp_reset and domain reset.

> > > > > > >

> > > > > >

> > > > > > Forgot to mention,

> > > > > >

> > > > > > Since this is kernel boot failure issue, I think,

> > > > > > By the time we reach to conclusion, another approach is to

> > > > > > set "HWMOD_INIT_NO_RESET" flag For GPIO0 bank.

> > > > > a) if the GPIO gets moved over to some other GPIO bank on

> another

> > > > > platform,

> > > > > this wont work

> > > >

> > > > Yes that’s true, but such schematic interface is not recommended.

> > > > And we have not seen any known side-effect of not resetting GPIO0

> > > bank.

> > > unless you mark the GPIO as taken, another driver could in-

> adverantly

> > > take over the GPIO and set it to a wrong level (we had a similar

> story

> > > with LED gpio between Panda Vs Panda-ES).

> > >

> > > >

> > > > > b) for platforms that dont use gpio to hold DDR power, maybe

> this

> > > is

> > > > > not

> > > > > even relevant and the GPIO bank can safely be reset?

> > > > > >

> > > >

> > > > As I mentioned, there is no known side-effect of not resetting

> GPIO

> > > bank 0.

> > > It should depend on the platform.

> > >

> > > There are other uses for hwmod-no-reset -> Eg. boot logo displayed

> by

> > > bootloader - if there is a reset of DSS block and re-configuration,

> > > we'd

> > > notice a blank-out, which is not desirable either. There could be a

> few

> > > other usage based on no-reset.

> > >

> > > In all cases, you'd prefer to make this:

> > > a) platform dependent (board dts)

> > > b) reserve GPIO as well so that no other driver'd take it - if they

> > > attempt ther'd at least be some form of warning.

> > >

> > Completely agree with you on both the points, and my point and all my

> comments

> > Were more related to option 'a' above.

> 

> so, what happened here ? Will we not have AM335x-SK working in mainline

> just because of the GPIO block being reset ?

> 


Nishant started implementing on this, not sure what state it is in.

Thanks,
Vaibhav
Nishanth Menon July 2, 2013, 1:57 p.m. UTC | #17
On 07/01/2013 11:37 PM, Hiremath, Vaibhav wrote:
>
>> -----Original Message-----
>> From: Balbi, Felipe
>> Sent: Friday, June 28, 2013 4:24 PM
>> To: Hiremath, Vaibhav
>> Cc: Menon, Nishanth; Peter Korsgaard; Kevin Hilman; Balbi, Felipe; Paul
>> Walmsley; linux-omap@vger.kernel.org; Tony Lindgren; Sebastian Andrzej
>> Siewior
>> Subject: Re: reset handling in am335x hwmod data
>>
>> Hi,
>>
>> On Mon, May 20, 2013 at 08:20:29PM +0200, Hiremath, Vaibhav wrote:
>>>
>>>> -----Original Message-----
>>>> From: Menon, Nishanth
>>>> Sent: Monday, May 20, 2013 11:34 PM
>>>> To: Hiremath, Vaibhav
>>>> Cc: Peter Korsgaard; Kevin Hilman; Balbi, Felipe; Paul Walmsley;
>> linux-
>>>> omap@vger.kernel.org; Tony Lindgren
>>>> Subject: Re: reset handling in am335x hwmod data
>>>>
>>>> On 12:47-20130520, Hiremath, Vaibhav wrote:
>>>> [...]
>>>>>>>>>
>>>>>>>>> On 20:10-20130517, Peter Korsgaard wrote:
>>>>>>>>>>>>>>> "Kevin" == Kevin Hilman <khilman@linaro.org>
>> writes:
>>>>>>>>>>
>>>>>>>>>>   >> In this case, we cannot reset that bank, otherwise
>>>> Starter
>>>>>> Kit
>>>>>>>>> will
>>>>>>>>>>   >> never boot in mainline. Bad PCB design, I know, but
>>>> it's
>>>>>> not
>>>>>>>>> something
>>>>>>>>>>   >> we can change now :-)
>>>>>>>>>>
>>>>>>>>>>   Kevin> FWIW, we've seen this before (GPIO connected to
>>>> PMIC
>>>>>> reset
>>>>>>>> is
>>>>>>>>> a
>>>>>>>>>>   Kevin> fun one), and this is why we have
>>>>>>>>> omap_hwmod_no_setup_reset().
>>>>>>>>>>
>>>>>>>>>> Yes, but there's no dts bindings for this, and from a
>> quick
>>>>>> test
>>>>>>>> the
>>>>>>>>>> reset handling happens before the device tree is
>> probed.
>>>>>>>>> I have the same issue with TPS62361 on Palmas -> GPIO
>>>> controls
>>>>>> the
>>>>>>>>> voltage register supplying MPU, without any driver
>> setting
>>>> things
>>>>>> up,
>>>>>>>>> GPIO gets reset and obviously voltage value switches to
>> an
>>>>>> voltage
>>>>>>>>> where
>>>>>>>>> device does not function.
>>>>>>>>>
>>>>>>>>> Solution I am working on to solve this is [1]: snippet is
>>>> part of
>>>>>> a
>>>>>>>>> patch that I am working on atm.
>>>>>>>>>
>>>>>>>>> This is the right way to do it IMHO. Will allow the
>> driver to
>>>>>> exist
>>>>>>>>> when
>>>>>>>>> HWMOD will be eventually replaced by some other
>> framework.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> [1]: http://pastebin.com/XPmAB1Zb
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> Both seems to be different to me. What we need is to
>>>>>>>> Avoid reset of whole GPIO bank during kernel boot.
>>>>>> Yes - that is what the above does - as long as the GPIO is
>>>> requested
>>>>>> and
>>>>>> set to the right level by the relevant driver, it is not
>> "unused"
>>>> and
>>>>>> hence not reset at late_init.
>>>>>>
>>>>>
>>>>> May be I am missing something here,
>>>>>
>>>>> Isn't _setup_reset() function asserts ocp_reset? And it is
>>>> core_initcall.
>>>> Hmm.. You are right, I missed that :(
>>>>>
>>>>>> I am a little unclear as to why this needs to have anything to
>> do
>>>> with
>>>>>> the precise under-lying mechanism (hwmod or something else).
>> May be
>>>>>> "both seem to be different to me" needs a little further
>>>> elaboration?
>>>>>>
>>>>>
>>>>> GPIO is connected to the DDR VTT control pin, and we have
>> observed
>>>> that
>>>>> Due to GPIO bank reset as part of hwmod init during bootup.
>>>>>
>>>>>> Is this because there is no need for an EMIF driver to handle
>> DDR?
>>>> and
>>>>>> reset of the GPIO will occur as EMIF is configured at
>> bootloader
>>>> and
>>>>>> there is no need to do that in kernel, correspondingly there is
>> no
>>>>>> "driver" to hold the gpio?
>>>>>>>>
>>>>>>>> Ideally, it would have been much better if drivers starts
>>>> handling
>>>>>>>> Idle, ocp reset and standby on their own (killing
>> dependency on
>>>>>> hwmod
>>>>>>>> init layer).
>>>>>>>>
>>>>>>>> But looking at current state,
>>>>>>>> I agree we need to use DT property here, so how about
>>>>>>>> Adding DT property  to GPIO node itself. But we have to
>> parse
>>>>>> I believe you mean at OMAP specific  DT property for hwmod?
>>>>>> something like ti,hwmod-no-init-reset?
>>>>>
>>>>> That’s the idea.
>>>>>
>>>>>>>> It early during hwmod init stage. We should read all DT
>> nodes
>>>>>>>> Inside function __setup() function, that way can get rid of
>>>>>>>> HWMOD_INIT_NO_RESET flag completely. Also, this will handle
>>>>>>>> Both ocp_reset and domain reset.
>>>>>>>>
>>>>>>>
>>>>>>> Forgot to mention,
>>>>>>>
>>>>>>> Since this is kernel boot failure issue, I think,
>>>>>>> By the time we reach to conclusion, another approach is to
>>>>>>> set "HWMOD_INIT_NO_RESET" flag For GPIO0 bank.
>>>>>> a) if the GPIO gets moved over to some other GPIO bank on
>> another
>>>>>> platform,
>>>>>> this wont work
>>>>>
>>>>> Yes that’s true, but such schematic interface is not recommended.
>>>>> And we have not seen any known side-effect of not resetting GPIO0
>>>> bank.
>>>> unless you mark the GPIO as taken, another driver could in-
>> adverantly
>>>> take over the GPIO and set it to a wrong level (we had a similar
>> story
>>>> with LED gpio between Panda Vs Panda-ES).
>>>>
>>>>>
>>>>>> b) for platforms that dont use gpio to hold DDR power, maybe
>> this
>>>> is
>>>>>> not
>>>>>> even relevant and the GPIO bank can safely be reset?
>>>>>>>
>>>>>
>>>>> As I mentioned, there is no known side-effect of not resetting
>> GPIO
>>>> bank 0.
>>>> It should depend on the platform.
>>>>
>>>> There are other uses for hwmod-no-reset -> Eg. boot logo displayed
>> by
>>>> bootloader - if there is a reset of DSS block and re-configuration,
>>>> we'd
>>>> notice a blank-out, which is not desirable either. There could be a
>> few
>>>> other usage based on no-reset.
>>>>
>>>> In all cases, you'd prefer to make this:
>>>> a) platform dependent (board dts)
>>>> b) reserve GPIO as well so that no other driver'd take it - if they
>>>> attempt ther'd at least be some form of warning.
>>>>
>>> Completely agree with you on both the points, and my point and all my
>> comments
>>> Were more related to option 'a' above.
>>
>> so, what happened here ? Will we not have AM335x-SK working in mainline
>> just because of the GPIO block being reset ?
>>
>
> Nishant started implementing on this, not sure what state it is in.

Nope. I am not working on this.
diff mbox

Patch

--- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
@@ -992,7 +992,7 @@  static struct omap_hwmod am33xx_gpio1_hwmod = {
        .name           = "gpio2",
        .class          = &am33xx_gpio_hwmod_class,
        .clkdm_name     = "l4ls_clkdm",
-       .flags          = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
+       .flags          = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET),
        .mpu_irqs       = am33xx_gpio1_irqs,
        .main_clk       = "l4ls_gclk",
        .prcm           = {