# HG changeset patch # User Mychaela Falconia # Date 1475394276 0 # Node ID 42d766231c46185c8987443d6787b321bd48ea8c # Parent cff89030b634710a2aa8dbc9974d0543d1ed38f0 armio.c: support for C139 and Pirelli targets diff -r cff89030b634 -r 42d766231c46 src/cs/drivers/drv_core/armio/armio.c --- a/src/cs/drivers/drv_core/armio/armio.c Sun Oct 02 07:22:08 2016 +0000 +++ b/src/cs/drivers/drv_core/armio/armio.c Sun Oct 02 07:44:36 2016 +0000 @@ -139,9 +139,9 @@ */ void AI_ResetIoConfig(void) { - *((volatile SYS_UWORD16 *) ARMIO_IO_CNTL) = 0xFFFF; // all bits are inputs -#if (CHIPSET != 12) - *((volatile SYS_UWORD16 *) CLKM_IO_CNTL) = 0; // default config + *((volatile SYS_UWORD16 *) ARMIO_IO_CNTL) = 0xFFFF; // all bits are inputs + #if (CHIPSET != 12) + *((volatile SYS_UWORD16 *) CLKM_IO_CNTL) = 0; // default config #endif /* CHIPSET != 12 */ } @@ -178,9 +178,14 @@ AI_EnableBit(2); AI_EnableBit(4); + #ifdef CONFIG_TARGET_PIRELLI + AI_EnableBit(1); + AI_EnableBit(3); + #endif + /* Bits 5,6,7,8 are used to output I/O 9,10,11,12 or MCSI pins */ /* If Bluetooth, IO should be disabled, outputting MCSI used for Bluetooth voice */ - #ifdef BTEMOBILE + #if defined(BTEMOBILE) || defined(CONFIG_TARGET_PIRELLI) AI_DisableBit(5); AI_DisableBit(6); AI_DisableBit(7); @@ -197,21 +202,22 @@ // ARMIO_OUT register configuration : // set IOs 8,9,10,11,12 and 13 as high // set IOs 0 to 7 as low - #if ((BOARD == 8) || (BOARD == 9)) - *((volatile SYS_UWORD16 *) ARMIO_OUT) = 0x3F00; - - // ARMIO_CNTL_REG register configuration : - // set IOs 0,1,6,8,9,10,11,12 and 13 as ouputs. - AI_ConfigBitAsOutput(0); - AI_ConfigBitAsOutput(1); - AI_ConfigBitAsOutput(6); - AI_ConfigBitAsOutput(8); - AI_ConfigBitAsOutput(9); - AI_ConfigBitAsOutput(10); - AI_ConfigBitAsOutput(11); - AI_ConfigBitAsOutput(12); - AI_ConfigBitAsOutput(13); - #elif ((BOARD == 40) || (BOARD == 41) || (BOARD == 42) || (BOARD == 43) || (BOARD == 45)) + + #ifdef CONFIG_TARGET_C139 + /* C139 GPIO configuration mimics what the original fw sets */ + + /* GPIO out all zeros - the LCD backlight is OFF */ + *((volatile SYS_UWORD16 *) ARMIO_OUT) = 0x0000; + + /* setting of GPIOs as outputs also mimics what the original fw sets */ + *((volatile SYS_UWORD16 *) ARMIO_IO_CNTL) = 0x2A09; + #elif defined(CONFIG_TARGET_PIRELLI) + *((volatile SYS_UWORD16 *) ARMIO_OUT) = 0x0000; + + AI_ConfigBitAsOutput(1); + AI_ConfigBitAsOutput(4); + AI_ConfigBitAsOutput(7); + #else /* classic TI/Openmoko/FreeCalypso targets */ // set IOs 1 and 8 to 13 as high // set IOs 0 and 2 to 7 as low // On D-Sample GPIO 1 must be set to high to enable the audio amplifier.