changeset 610:0cbe7438f974

armio.c: GPIO config for GTM900 and long-standing GPIO 1 fix
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 17 Jun 2019 21:48:54 +0000
parents 238b67a785f2
children b9ad7bd63f59
files components/drivers_flash src/cs/drivers/drv_core/armio/armio.c
diffstat 2 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/components/drivers_flash	Mon Jun 17 21:25:46 2019 +0000
+++ b/components/drivers_flash	Mon Jun 17 21:48:54 2019 +0000
@@ -1,7 +1,7 @@
 # Building drivers_flash.lib
 
 CFLAGS="-me -pw2 -mn -x -mt -o2 -mw"
-CPPFLAGS="-DTOOL_CHOICE=0 -D_TMS470"
+CPPFLAGS="-DTOOL_CHOICE=0 -D_TMS470 -DMMI=$MMI"
 
 # Includes
 
--- a/src/cs/drivers/drv_core/armio/armio.c	Mon Jun 17 21:25:46 2019 +0000
+++ b/src/cs/drivers/drv_core/armio/armio.c	Mon Jun 17 21:48:54 2019 +0000
@@ -263,18 +263,23 @@
     // On D-Sample GPIO 1 must be set to high to enable the audio amplifier,
     // but on Openmoko's modem it is the interrupt to the AP.
     // On the FCDEV3B it also controls the audio amplifier.
-    // For now we initialize it to low on all targets.
-#if 1
+    // On the GTM900 GPIOs 0 and 1 are RI and DSR outputs, respectively.
+    // For targets other than GTM900, we enable the audio amplifier
+    // if we are in an MMI!=0 build - for ACI builds use the AT@SPKR command.
+#ifdef CONFIG_TARGET_GTM900
+      *((volatile SYS_UWORD16 *) ARMIO_OUT) = 0x3F01;
+#elif (MMI != 0)
+      *((volatile SYS_UWORD16 *) ARMIO_OUT) = 0x3F02;
+#else
       *((volatile SYS_UWORD16 *) ARMIO_OUT) = 0x3F00;
-#else
-      *((volatile SYS_UWORD16 *) ARMIO_OUT) = 0x3F02;
 #endif
 
     // ARMIO_CNTL_REG register configuration :
     // set IOs 1,2,5,7,9,14 and 15 as ouputs.
     // bits conditionalized on CONFIG_TARGET_GTAMODEM or CONFIG_TARGET_FCFAM
     // are FreeCalypso additions
-    #if defined(CONFIG_TARGET_GTAMODEM) || defined(CONFIG_TARGET_FCFAM)
+    #if defined(CONFIG_TARGET_GTAMODEM) || defined(CONFIG_TARGET_FCFAM) || \
+        defined(CONFIG_TARGET_GTM900)
       AI_ConfigBitAsOutput(0);
     #endif
     AI_ConfigBitAsOutput(1);