linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* 440gx GPIO
@ 2006-02-14  5:20 Ed Goforth
  2006-02-14  6:59 ` Eugene Surovegin
  0 siblings, 1 reply; 9+ messages in thread
From: Ed Goforth @ 2006-02-14  5:20 UTC (permalink / raw)
  To: linuxppc-embedded

I am struggling with a problem and I hope someone can give me some
pointers.  We have a custom board with a 440gx.  I need to drive GPIO11
low.  The best as I can tell from the docs, I need to set bit 11 of the
TCR to 1 and bit 11 of the OR to 0 to do this.  I'm using kernel
2.4.18-timesys-4.0

Here's what I've tried:

Prior to making an calls, the values of the registers are:
or      0x00101000
tcr     0x00101700
odr     0x00000000
ir      0xeffff820


(from ibm440gx.h)
#define PPC440GX_GPIO0_ADDR  0x0000000140000700


Attempt one: write the bit directly:

  volatile gpio_t *gpio;
  volatile u32 or_reg;

  gpio = (gpio_t *) ioremap_nocache(0x40000700,
                                    sizeof(gpio_t));

  or_reg = gpio->or;
  or_reg &= 0x00100000;
  gpio->or = or_reg;


Attempt two: use the accessor routine:
  extern int ibm_gpio_out(__u32 device, __u32 mask, __u32 data);

  rc = ibm_gpio_out(0, 0x00100000, 0);


With either approach, I can read the registers fine.  But as soon as I
either modify gpio->or or call ibm_gpio_out(), the board hangs hard.

Any hints would be greatly appreciated.  On-list replies are fine; I am
a subscriber.

Thanks,
Ed

^ permalink raw reply	[flat|nested] 9+ messages in thread
* RE: 440gx GPIO
@ 2006-02-15  0:01 Howard, Marc
  2006-02-20 17:13 ` Ed Goforth
  0 siblings, 1 reply; 9+ messages in thread
From: Howard, Marc @ 2006-02-15  0:01 UTC (permalink / raw)
  To: Ed Goforth, linuxppc-embedded


> -----Original Message-----
> From:=20
> linuxppc-embedded-bounces+marc.howard=3Dkla-tencor.com@ozlabs.or
> g=20
> [mailto:linuxppc-embedded-bounces+marc.howard=3Dkla-tencor.com@o
> zlabs.org] On Behalf Of Ed Goforth
> Sent: Tuesday, February 14, 2006 1:47 PM
> To: linuxppc-embedded@ozlabs.org
> Subject: Re: 440gx GPIO
> .....=20
> Well, I was able to manipulate GPIO9, GPIO10 and GPIO12.  It's time to
> turn it over to the hardware people.
>=20

It's AMCC's fault.  They aren't listing the latest errata on their
website.  I downloaded their rev 3.1 ver 1.03 errata last August.
However if you look today you get the rev 3.1 ver 1.02 release.

In the 1.03 errata there is the following bug listed:

*************

GPIO_1:SDR0_PFC[G11E] has no effect.
Category: 6
Overview:
The SDR0_PFC[G11E] bit does not control GPIO11, thus meaning that GPIO11
is always active (unless EMAC group 4 is selected and both GPHYs are in
modes 0 or 1).
  =20
Impact:No impact.
Workaround:
None.

**************

Thus the PFC bit doesn't do anything.  If you're using group 4 "modes 0
or 1" (which mode field are they talking about here?) you're screwed,
you can't use GPIO11.

Curious how they think this has "No impact".  If you're running RGMII
you don't need that pin and it should be available for GPIO11 but
apparently it isn't.

Marc

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

end of thread, other threads:[~2006-02-20 17:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-14  5:20 440gx GPIO Ed Goforth
2006-02-14  6:59 ` Eugene Surovegin
2006-02-14 13:48   ` Ed Goforth
2006-02-14 17:01     ` Eugene Surovegin
2006-02-14 17:10       ` Ed Goforth
2006-02-14 21:47         ` Ed Goforth
2006-02-20 17:20       ` Ed Goforth
  -- strict thread matches above, loose matches on Subject: below --
2006-02-15  0:01 Howard, Marc
2006-02-20 17:13 ` Ed Goforth

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).