changeset 84:42d766231c46

armio.c: support for C139 and Pirelli targets
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 02 Oct 2016 07:44:36 +0000
parents cff89030b634
children 204d6866901b
files src/cs/drivers/drv_core/armio/armio.c
diffstat 1 files changed, 25 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- 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.