public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] mpc83xx: set gpio level before direction
@ 2008-08-29 18:37 Peter Korsgaard
  2008-08-29 19:18 ` Kim Phillips
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Korsgaard @ 2008-08-29 18:37 UTC (permalink / raw)
  To: u-boot

Set gpio level register before direction register to inhibit
glitches on high level output pins.

Dir and data gets cleared at powerup, so high level output lines see
a short low pulse between setting the direction and level registers.

Issue was seen on a new board with the nReset line of the NOR flash
connected to a GPIO. Setting the direction register puts the NOR flash
in reset so the next instruction to set the level cannot get executed.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
---
 cpu/mpc83xx/cpu_init.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpu/mpc83xx/cpu_init.c b/cpu/mpc83xx/cpu_init.c
index 67c9e57..4514dbb 100644
--- a/cpu/mpc83xx/cpu_init.c
+++ b/cpu/mpc83xx/cpu_init.c
@@ -283,12 +283,12 @@ void cpu_init_f (volatile immap_t * im)
 	im->sysconf.lblaw[7].ar = CFG_LBLAWAR7_PRELIM;
 #endif
 #ifdef CFG_GPIO1_PRELIM
-	im->gpio[0].dir = CFG_GPIO1_DIR;
 	im->gpio[0].dat = CFG_GPIO1_DAT;
+	im->gpio[0].dir = CFG_GPIO1_DIR;
 #endif
 #ifdef CFG_GPIO2_PRELIM
-	im->gpio[1].dir = CFG_GPIO2_DIR;
 	im->gpio[1].dat = CFG_GPIO2_DAT;
+	im->gpio[1].dir = CFG_GPIO2_DIR;
 #endif
 }
 
-- 
1.5.6.3

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

* [U-Boot] [PATCH] mpc83xx: set gpio level before direction
  2008-08-29 18:37 [U-Boot] [PATCH] mpc83xx: set gpio level before direction Peter Korsgaard
@ 2008-08-29 19:18 ` Kim Phillips
  2008-08-29 21:58   ` Peter Korsgaard
  0 siblings, 1 reply; 3+ messages in thread
From: Kim Phillips @ 2008-08-29 19:18 UTC (permalink / raw)
  To: u-boot

On Fri, 29 Aug 2008 20:37:25 +0200
Peter Korsgaard <jacmet@sunsite.dk> wrote:

> Set gpio level register before direction register to inhibit
> glitches on high level output pins.
> 
> Dir and data gets cleared at powerup, so high level output lines see
> a short low pulse between setting the direction and level registers.
> 
> Issue was seen on a new board with the nReset line of the NOR flash
> connected to a GPIO. Setting the direction register puts the NOR flash
> in reset so the next instruction to set the level cannot get executed.
> 
> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
> ---

Hi Peter,

this is a duplicate of:

http://www.nabble.com/-U-Boot---PATCH--MPC83XX%3A-Fix-GPIO-configuration-to19119329.html#a19119329

so I'll merge your better description and s-o-b to that one if you
don't mind.

Kim

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

* [U-Boot] [PATCH] mpc83xx: set gpio level before direction
  2008-08-29 19:18 ` Kim Phillips
@ 2008-08-29 21:58   ` Peter Korsgaard
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2008-08-29 21:58 UTC (permalink / raw)
  To: u-boot

>>>>> "Kim" == Kim Phillips <kim.phillips@freescale.com> writes:

 Kim> this is a duplicate of:

Ahh sorry, I must have missed that one.

 Kim> so I'll merge your better description and s-o-b to that one if you
 Kim> don't mind.

Yeah, that's fine.

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2008-08-29 21:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-29 18:37 [U-Boot] [PATCH] mpc83xx: set gpio level before direction Peter Korsgaard
2008-08-29 19:18 ` Kim Phillips
2008-08-29 21:58   ` Peter Korsgaard

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