[linux-cirrus] Re: ep93xx: Port B GPIOs Non Functional

H Hartley Sweeten wrote:
On Wednesday, June 24, 2009 9:40 AM, Andrew McKay wrote:
If your using the Cirrus kernel patches they might be enabling one of the 
external
DMA channels due to the USB gadget device on the "A" series dev boards.  Also,
the IDE controller is probably enabled (even though the EP9301 doesn't have 
IDE).
This would be done in the DeviceCfg register correct?

Correct.

I believe the USB gadget device uses DMA channel 0 so EGPIO's 7/8/9 are going to
be unusable for GPIO.

The IDE uses a bunch of GPIO's but specifically DMARQ comes in on EGPIO2 and 
DASPn
on EGPIO15.

As Ryan pointed out, I don't think the SysCfg register is the problem.  Those 
bits
are basically just latched versions of various pins after reset.
Agreed.

Also a Ryan mentioned, I think you need to check the DeviceCfg register.  To
disable the IDE controller the following bits need to be set EonIDE, GonIDE,
and HonIDE.  BTW, the User's Guide says that the default state of the DeviceCfg
register is 0x000_0000 so the IDE port is enabled by default after reset.
I've checked the DeviceCfg Register from a cold boot and a reset with the FPGA programmed. There is no difference.

Cold boot:
Sys Config (ff930080): 00140800

Reset with FPGA Programmed:
Sys Config (ff930080): 00140800

Address ff900000 is the base virtual address of the 9302's registers in Cirrus Logic's kernel.

I have actually dumped the full Sysctl and GPIO blocks and the differences any differences seem don't seem to be anything that would affect Port B GPIOs:

Ok... Your DeviceCfg register is 00140800 so here's the breakdown for the 
EP9301:

SWRST     : 0
D1onG     : 0 <- should be 0 to disable external DMA1 and allow EGPIO[12:10] to
                 be used as GPIO
D0onG     : 0 <- should be 0 to disable external DMA0 and allow EGPIO[9:7] to be
                 used as GPIO
IonU2     : 0
GonK      : 0 <- needs to be 1 to allow CGPIO[0] to be used as GPIO
TonG      : 0 <- should be 0 to allow EGPIO[3] to be used as GPIO
MonG      : 0 <- should be 0 to allow EGPIO[0] to be used as GPIO
U3EN      : 0
CPENA     : 0
A2onG     : 0 <- should be 0 to allow EGPIO[13] and EGPIO[6] to be used as GPIO
A1onG     : 0 <- should be 0 to allow EGPIO[5:4] to be used as GPIO
U2EN      : 1
EXVC      : 0
U1EN      : 1
TIN       : 0
RSVD      : 0
HC3IN     : 0
HC3EN     : 0 <- should be 0 to allow EGPIO[3] to be used as GPIO
HC1IN     : 0
HC1EN     : 0 <- should be 0 to allow EGPIO[3] to be used as GPIO
HonIDE    : 1 <- should be 1 to disable IDE and allow HGPIO[5:2] to be used as 
GPIO
GonIDE    : 0 <- needs to be 1 to disable IDE
                 EP9301 does not have IDE or Port G GPIO (other than the EECLK 
and
                 EEDAT) but the controller should be disabled just in case
PonG      : 0 <- should be 0 to allow EGPIO[14] to be used as GPIO
EonIDE    : 0 <- needs to be 1 to disable IDE
                 EP9301 does not have IDE or Port E GPIO (other than the RDLED 
and
                 GRLED) but the controller should be disabled just in case
I2SonSSP  : 0
I2SonAC97 : 0
0         : 0
RASonP3   : 0
RAS       : 0
ADCPD     : 0
KEYS      : 0 <- needs to be 1 to disable Key Matrix controller
                 EP9301 does not have this but it should be disables just in 
case
                 to allow CGPIO0 to be used as GPIO
Shena     : 0


Based on that, try setting the DeviceCfg register to 08140d02 and see if that 
helps.


I explicitly set DeviceCfg to 0x08140d02 and still get the same results with the GPIOs.

Sys Config (ff930080): 08140d02

Interesting to note that Redboot is not setting this register correctly. It's not writing the bits to 1 that the documentation says it should.

Any code I've added has always bitmasked bits in, so some of the bits that the documentation says need to be set to 1, were never set to 1.

Andrew

Other related posts: