linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* GPIO @ MPC5200
@ 2008-07-04  9:57 Andre Schwarz
  2008-07-04 14:36 ` Grant Likely
  0 siblings, 1 reply; 4+ messages in thread
From: Andre Schwarz @ 2008-07-04  9:57 UTC (permalink / raw)
  To: s.hauer, Grant Likely; +Cc: linux-ppc list

Sascha, Grant,

I'm running on 2.6.26-rc6 with an MPC5200B based system.

Looks like some (for me) crucial GPIO are touched during boot.
Is this possible ?

Of course I have compiled in GPIO-Lib and specified the GPIOs in the dts.
But no access yet - I'd like to preserve the setup from u-boot...

regards,
Andre

MATRIX VISION GmbH, Talstraße 16, DE-71570 Oppenweiler  - Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschäftsführer: Gerhard Thullner, Werner Armingeon, Uwe Furtner

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

* Re: GPIO @ MPC5200
  2008-07-04  9:57 GPIO @ MPC5200 Andre Schwarz
@ 2008-07-04 14:36 ` Grant Likely
  2008-07-04 15:10   ` Andre Schwarz
  0 siblings, 1 reply; 4+ messages in thread
From: Grant Likely @ 2008-07-04 14:36 UTC (permalink / raw)
  To: Andre Schwarz; +Cc: linux-ppc list

On Fri, Jul 04, 2008 at 11:57:14AM +0200, Andre Schwarz wrote:
> Sascha, Grant,
> 
> I'm running on 2.6.26-rc6 with an MPC5200B based system.
> 
> Looks like some (for me) crucial GPIO are touched during boot.
> Is this possible ?
> 
> Of course I have compiled in GPIO-Lib and specified the GPIOs in the dts.
> But no access yet - I'd like to preserve the setup from u-boot...

The GPIO driver only writes to the GPIO registers when a driver actually
requests to use them.  At probe time, the gpio drivers read the current
values from the GPIO registers, so current config should be preserved.

However, the gpiochip_dir hook explicitly sets the output value when it
is called.  It may be that when you are claiming the GPIO line it is
getting set with a default (and wrong) value.

Another possibility; have you verified that it is the GPIO regs getting
clobbered?  Or is port_config getting changed on you?  Which GPIO pins?

g.

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

* Re: GPIO @ MPC5200
  2008-07-04 14:36 ` Grant Likely
@ 2008-07-04 15:10   ` Andre Schwarz
  2008-07-04 15:58     ` Grant Likely
  0 siblings, 1 reply; 4+ messages in thread
From: Andre Schwarz @ 2008-07-04 15:10 UTC (permalink / raw)
  To: Grant Likely; +Cc: linux-ppc list

Grant Likely schrieb:
> On Fri, Jul 04, 2008 at 11:57:14AM +0200, Andre Schwarz wrote:
>   
>> Sascha, Grant,
>>
>> I'm running on 2.6.26-rc6 with an MPC5200B based system.
>>
>> Looks like some (for me) crucial GPIO are touched during boot.
>> Is this possible ?
>>
>> Of course I have compiled in GPIO-Lib and specified the GPIOs in the dts.
>> But no access yet - I'd like to preserve the setup from u-boot...
>>     
>
> The GPIO driver only writes to the GPIO registers when a driver actually
> requests to use them.  At probe time, the gpio drivers read the current
> values from the GPIO registers, so current config should be preserved.
>
> However, the gpiochip_dir hook explicitly sets the output value when it
> is called.  It may be that when you are claiming the GPIO line it is
> getting set with a default (and wrong) value.
>
> Another possibility; have you verified that it is the GPIO regs getting
> clobbered?  Or is port_config getting changed on you?  Which GPIO pins?
>
> g.
>   

The pin in question is PSC2_4, i.e. a wake-up GPIO.
It is configured as push-pull output and driven high.

Since it has an external pull-down resistor I can't say if it is driven
low or re-configured as an input ...

I removed GPIO Lib and the problem is gone.
I'm not yet using it anyway under linux - they're mainly for system
configuration (setting up muxes etc.).

I'll dig into it when I have some time.

thanks,
Andre






MATRIX VISION GmbH, Talstraße 16, DE-71570 Oppenweiler  - Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschäftsführer: Gerhard Thullner, Werner Armingeon, Uwe Furtner

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

* Re: GPIO @ MPC5200
  2008-07-04 15:10   ` Andre Schwarz
@ 2008-07-04 15:58     ` Grant Likely
  0 siblings, 0 replies; 4+ messages in thread
From: Grant Likely @ 2008-07-04 15:58 UTC (permalink / raw)
  To: Andre Schwarz; +Cc: linux-ppc list

On Fri, Jul 04, 2008 at 05:10:46PM +0200, Andre Schwarz wrote:
> I removed GPIO Lib and the problem is gone.
> I'm not yet using it anyway under linux - they're mainly for system
> configuration (setting up muxes etc.).
> 
> I'll dig into it when I have some time.

When you do, try adding "#define DEBUG" to the top of mpc52xx_gpio.c and
see what comes out of dmesg.

g.

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

end of thread, other threads:[~2008-07-04 15:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-04  9:57 GPIO @ MPC5200 Andre Schwarz
2008-07-04 14:36 ` Grant Likely
2008-07-04 15:10   ` Andre Schwarz
2008-07-04 15:58     ` Grant Likely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).