mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Earliest possible GPIO toggle on i.mx6
@ 2017-07-05 12:41 Mayur Nande
  2017-07-05 12:51 ` Lucas Stach
  0 siblings, 1 reply; 4+ messages in thread
From: Mayur Nande @ 2017-07-05 12:41 UTC (permalink / raw)
  To: barebox

Hello all,

I have a question regarding the earliest possible GPIO toggle with barebox on imx6. We use boards with imx6 quad core processor (from Phytec). In our hardware design we have a push button controller which has a "KILL" pin attached to one of the GPIO pins on i.mx6. The requirement is that this pin should be set to 1 within 400 ms of power on. I tried setting this at various places in barebox with incremental improvements starting from the init script, board.c, lowlevel.c and then DCD/lowlevel.c combination. 

The best performance I got was by setting the iomux registers (IOMUXC_SW_MUX_CTL_PAD and IOMUXC_SW_PAD_CTL_PAD) in DCD and the GPIO direction and value registers in lowlevel.c (since GPIO controller registers are not accessible with DCD). Even with this, I get the GPIO set in around 460-475ms at the best. I understand that some of the time here is used by the hardware for voltage regulation/crystal stabilization which probably we can't do anything about.

From barebox side, any suggestions or ideas to improve this would be very helpful.
Thank you very much.        

Warm Regards,
Mayur Nande  






_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Earliest possible GPIO toggle on i.mx6
  2017-07-05 12:41 Earliest possible GPIO toggle on i.mx6 Mayur Nande
@ 2017-07-05 12:51 ` Lucas Stach
  2017-07-05 13:18   ` Mayur Nande
  0 siblings, 1 reply; 4+ messages in thread
From: Lucas Stach @ 2017-07-05 12:51 UTC (permalink / raw)
  To: Mayur Nande; +Cc: barebox

Am Mittwoch, den 05.07.2017, 12:41 +0000 schrieb Mayur Nande:
> Hello all,
> 
> I have a question regarding the earliest possible GPIO toggle with
> barebox on imx6. We use boards with imx6 quad core processor (from
> Phytec). In our hardware design we have a push button controller which
> has a "KILL" pin attached to one of the GPIO pins on i.mx6. The
> requirement is that this pin should be set to 1 within 400 ms of power
> on. I tried setting this at various places in barebox with incremental
> improvements starting from the init script, board.c, lowlevel.c and
> then DCD/lowlevel.c combination. 
> 
> The best performance I got was by setting the iomux registers
> (IOMUXC_SW_MUX_CTL_PAD and IOMUXC_SW_PAD_CTL_PAD) in DCD and the GPIO
> direction and value registers in lowlevel.c (since GPIO controller
> registers are not accessible with DCD). Even with this, I get the GPIO
> set in around 460-475ms at the best. I understand that some of the
> time here is used by the hardware for voltage regulation/crystal
> stabilization which probably we can't do anything about.

If lowlevel.c is too late already, the only chance to make this work is
setting the DCD padctl to configure a pull-up/down to satisfy the KILL
pin. Then in the board file set up the GPIO and switch the padctl to
neutral state.

Still 400ms sound like a awfully long time to reach lowlevel init. What
is your boot source, i.e. where is the barebox binary stored?

Regards,
Lucas


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Earliest possible GPIO toggle on i.mx6
  2017-07-05 12:51 ` Lucas Stach
@ 2017-07-05 13:18   ` Mayur Nande
  2017-07-06 14:30     ` Mayur Nande
  0 siblings, 1 reply; 4+ messages in thread
From: Mayur Nande @ 2017-07-05 13:18 UTC (permalink / raw)
  To: 'Lucas Stach'; +Cc: barebox

Hello Lucas, 

Thank you for the reply.

> -----Original Message-----
> From: Lucas Stach [mailto:l.stach@pengutronix.de]
> Sent: Wednesday, July 05, 2017 2:52 PM
> To: Mayur Nande
> Cc: barebox@lists.infradead.org
> Subject: Re: Earliest possible GPIO toggle on i.mx6
> 
> Am Mittwoch, den 05.07.2017, 12:41 +0000 schrieb Mayur Nande:
> > Hello all,
> >
> > I have a question regarding the earliest possible GPIO toggle with
> > barebox on imx6. We use boards with imx6 quad core processor (from
> > Phytec). In our hardware design we have a push button controller which
> > has a "KILL" pin attached to one of the GPIO pins on i.mx6. The
> > requirement is that this pin should be set to 1 within 400 ms of power
> > on. I tried setting this at various places in barebox with incremental
> > improvements starting from the init script, board.c, lowlevel.c and
> > then DCD/lowlevel.c combination.
> >
> > The best performance I got was by setting the iomux registers
> > (IOMUXC_SW_MUX_CTL_PAD and IOMUXC_SW_PAD_CTL_PAD) in DCD
> and the GPIO
> > direction and value registers in lowlevel.c (since GPIO controller
> > registers are not accessible with DCD). Even with this, I get the GPIO
> > set in around 460-475ms at the best. I understand that some of the
> > time here is used by the hardware for voltage regulation/crystal
> > stabilization which probably we can't do anything about.
> 
> If lowlevel.c is too late already, the only chance to make this work is setting
> the DCD padctl to configure a pull-up/down to satisfy the KILL pin. Then in
> the board file set up the GPIO and switch the padctl to neutral state.
Ok, I will try this.

> Still 400ms sound like a awfully long time to reach lowlevel init. What is your
> boot source, i.e. where is the barebox binary stored?
The bootsource is external 8GB SD/MMC card.

Warm Regards,
Mayur

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Earliest possible GPIO toggle on i.mx6
  2017-07-05 13:18   ` Mayur Nande
@ 2017-07-06 14:30     ` Mayur Nande
  0 siblings, 0 replies; 4+ messages in thread
From: Mayur Nande @ 2017-07-06 14:30 UTC (permalink / raw)
  To: 'Lucas Stach'; +Cc: 'barebox@lists.infradead.org'

> -----Original Message-----
> From: Mayur Nande
> Sent: Wednesday, July 05, 2017 3:18 PM
> To: 'Lucas Stach'
> Cc: barebox@lists.infradead.org
> Subject: RE: Earliest possible GPIO toggle on i.mx6
> 
> Hello Lucas,
> 
> Thank you for the reply.
> 
> > -----Original Message-----
> > From: Lucas Stach [mailto:l.stach@pengutronix.de]
> > Sent: Wednesday, July 05, 2017 2:52 PM
> > To: Mayur Nande
> > Cc: barebox@lists.infradead.org
> > Subject: Re: Earliest possible GPIO toggle on i.mx6
> >
> > Am Mittwoch, den 05.07.2017, 12:41 +0000 schrieb Mayur Nande:
> > > Hello all,
> > >
> > > I have a question regarding the earliest possible GPIO toggle with
> > > barebox on imx6. We use boards with imx6 quad core processor (from
> > > Phytec). In our hardware design we have a push button controller
> > > which has a "KILL" pin attached to one of the GPIO pins on i.mx6.
> > > The requirement is that this pin should be set to 1 within 400 ms of
> > > power on. I tried setting this at various places in barebox with
> > > incremental improvements starting from the init script, board.c,
> > > lowlevel.c and then DCD/lowlevel.c combination.
> > >
> > > The best performance I got was by setting the iomux registers
> > > (IOMUXC_SW_MUX_CTL_PAD and IOMUXC_SW_PAD_CTL_PAD) in DCD
> > and the GPIO
> > > direction and value registers in lowlevel.c (since GPIO controller
> > > registers are not accessible with DCD). Even with this, I get the
> > > GPIO set in around 460-475ms at the best. I understand that some of
> > > the time here is used by the hardware for voltage regulation/crystal
> > > stabilization which probably we can't do anything about.
> >
> > If lowlevel.c is too late already, the only chance to make this work
> > is setting the DCD padctl to configure a pull-up/down to satisfy the
> > KILL pin. Then in the board file set up the GPIO and switch the padctl to
> neutral state.
> Ok, I will try this.
I tried this, but unfortunately none of the available internal pull-up and pull-down 
values satisfy the KILL pin (it goes through an digital isolator and we cannot satisfy 
the logic level it asks for). The only way is to set the pin as output. 

> > Still 400ms sound like a awfully long time to reach lowlevel init.
> > What is your boot source, i.e. where is the barebox binary stored?
> The bootsource is external 8GB SD/MMC card.
I also tried the internal emmc just as an experiment and the delay is nearly the same. 

I have some suggestions from Chris Healy like trying SPI NOR and using the fast boot bit of SDHC, 
I will try that as my next steps. The final (non-preferred) solution would be to change the hardware.

Thank you.

Regards
Mayur
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-07-06 14:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-05 12:41 Earliest possible GPIO toggle on i.mx6 Mayur Nande
2017-07-05 12:51 ` Lucas Stach
2017-07-05 13:18   ` Mayur Nande
2017-07-06 14:30     ` Mayur Nande

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox