From 69717f9ef666f898d46144720e4df899540ae568 Mon Sep 17 00:00:00 2001 From: Michel Pollet Date: Tue, 24 Mar 2009 00:35:19 +0000 Subject: [PATCH] [MINI2440] startup code cleanup Only turn one LED on. Activated USB device as output for UDC. --- board/mini2440/mini2440.c | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/board/mini2440/mini2440.c b/board/mini2440/mini2440.c index b6370e11..3bc9908d 100644 --- a/board/mini2440/mini2440.c +++ b/board/mini2440/mini2440.c @@ -74,11 +74,11 @@ int board_init (void) /* some delay between MPLL and UPLL */ delay (8000); - gpio->GPACON = 0x007FFFFF; + gpio->GPACON = 0x007FFFFF; /* Port A is all "special" */ // port B outputs reconfigured gpio->GPBCON = (0x1 << 0) | // GPB0 OUT TOUT0 PWM Buzzer - (0x1 << 2) | // GPB1 OUT LCD + (0x2 << 2) | // GPB1 OUT TOUT1 LCD (0x1 << 4) | // GPB2 OUT L3MODE (0x1 << 6) | // GBP3 OUT L3DATA (0x1 << 8) | // GBP4 OUT L3CLOCK @@ -89,19 +89,26 @@ int board_init (void) (0x2 << 18) | // GBP9 --- nXDACK0 CON5 EBI (0x2 << 20) | // GBP10 --- nXDREQ0 CON5 EBI 0; - gpio->GPBUP = (1 << 10) - 1; // disable pullup on all 10 pins - gpio->GPBDAT = 0; + gpio->GPBUP = (1 << 10) - 1; // disable pullup on all 10 pins + gpio->GPBDAT = (0 << 5) | /* turn LED 1 on */ + (1 << 6) | /* turn LED 1 off */ + (1 << 7) | /* turn LED 1 off */ + (1 << 8) /* turn LED 1 off */; // lcd signals on C and D - gpio->GPCCON = 0xAAAAAAAA; - gpio->GPCUP = 0xFFFFFFFF; - gpio->GPDCON = 0xAAAAAAAA; - gpio->GPDUP = 0xFFFFFFFF; + gpio->GPCCON = (0xAAAAAAAA & /* all default IN but ... */ + ~(0x3 << 10)) | /* not pin 5 ... */ + (0x1 << 10); /* that is output (USB) */ + gpio->GPCUP = 0xFFFFFFFF; + gpio->GPCDAT = 0; + + gpio->GPDCON = 0xAAAAAAAA; + gpio->GPDUP = 0xFFFFFFFF; // port E is set for all it's special functions (i2c, spi etc) - gpio->GPECON = 0xAAAAAAAA; - gpio->GPEUP = 0x0000FFFF; + gpio->GPECON = 0xAAAAAAAA; + gpio->GPEUP = 0x0000FFFF; - gpio->GPFCON = + gpio->GPFCON = (0x1 << 0) | // GPG0 EINT0 OUT (0x1 << 2) | // GPG1 EINT1 OUT (0x1 << 4) | // GPG2 EINT2 OUT @@ -111,12 +118,12 @@ int board_init (void) (0x1 << 12) | // GPG6 EINT6 OUT (0x0 << 14) | // GPG7 EINT7 IN DM9000 0; - gpio->GPFDAT = 0; - gpio->GPFUP = ((1 << 7) - 1) // all disabled - & ~( 1 << 7 ) // but for the ethernet one, we need it. - ; + gpio->GPFDAT = 0; + gpio->GPFUP = ((1 << 7) - 1) // all disabled + & ~( 1 << 7 ) // but for the ethernet one, we need it. + ; - gpio->GPGCON = + gpio->GPGCON = (0x0 << 0) | // GPG0 EINT8 IN Key1 (0x1 << 2) | // GPG1 EINT9 OUT Con5 (0x1 << 4) | // GPG2 EINT10 OUT -- 2.11.4.GIT