changeset 930:5a826938d005

gsm-fw: experimental support for Compal targets in tpudrv12.[ch]
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Sat, 31 Oct 2015 02:09:48 +0000
parents ad6f1504465d
children d1799aa85e56
files gsm-fw/L1/tpudrv/tpudrv12.c gsm-fw/L1/tpudrv/tpudrv12.h gsm-fw/cfgmagic/target.c139 gsm-fw/cfgmagic/target.c155
diffstat 4 files changed, 113 insertions(+), 42 deletions(-) [+]
line wrap: on
line diff
--- a/gsm-fw/L1/tpudrv/tpudrv12.c	Sat Oct 24 06:54:08 2015 +0000
+++ b/gsm-fw/L1/tpudrv/tpudrv12.c	Sat Oct 31 02:09:48 2015 +0000
@@ -15,8 +15,8 @@
  * tweaking it to match the disassembly of the reference binary object
  * named above.
  *
- * The ugly hacks to support Pirelli DP-L10 in addition to classic
- * TI/Openmoko target devices are original to FreeCalypso.
+ * The ugly hacks to support Compal and Pirelli targets in addition to
+ * classic TI/Openmoko ones are original to FreeCalypso.
  */
 
 #define TPUDRV12_C
@@ -169,7 +169,7 @@
     T_TX_RX tx_rx[2];
 };
 
-#if CONFIG_TARGET_PIRELLI
+#if CONFIG_TARGET_COMPAL || CONFIG_TARGET_PIRELLI
 typedef UWORD16 T_RXTX_UPDOWN;
 #else
 typedef UWORD8  T_RXTX_UPDOWN;
@@ -580,7 +580,7 @@
 	*TP_Ptr++ = TPU_FAT(0x1384);
 	TSP_TO_ABB(0xA0);
 	*TP_Ptr++ = TPU_FAT(16);
-#if CONFIG_TARGET_PIRELLI
+#if CONFIG_TARGET_COMPAL || CONFIG_TARGET_PIRELLI
 	*TP_Ptr++ = TPU_MOVE(TSP_ACT, rf_path[rf_index].tx_up & 0xFF
 					| RF_SER_ON);
 	*TP_Ptr++ = TPU_MOVE(TSP_ACTX, rf_path[rf_index].tx_up >> 8);
--- a/gsm-fw/L1/tpudrv/tpudrv12.h	Sat Oct 24 06:54:08 2015 +0000
+++ b/gsm-fw/L1/tpudrv/tpudrv12.h	Sat Oct 31 02:09:48 2015 +0000
@@ -235,7 +235,7 @@
 #define TEST_TX_ON    0
 #define TEST_RX_ON    0
 
-#if CONFIG_TARGET_GTAMODEM || CONFIG_TARGET_LEONARDO
+#if CONFIG_TARGET_LEONARDO || CONFIG_TARGET_ESAMPLE
 
   // 4-band config (E-sample, P2, Leonardo)
   #define FEM_7         BIT_2     // act2
@@ -255,49 +255,67 @@
   // This configuration is always inverted.
 
   // RX_UP/DOWN and TX_UP/DOWN
-  #if CONFIG_TARGET_GTAMODEM
-    // Openmoko's hobbled triband hardware
-    #define RU_900     ( PA_OFF     | FEM_PINS ^ 0     )
-    #define RD_900     ( PA_OFF     | FEM_PINS ^ 0     )
-    #define TU_900     ( PA_LO_BAND | FEM_PINS ^ FEM_9 )
-    #define TD_900     ( PA_OFF     | FEM_PINS ^ 0     )
+  #define RU_900     ( PA_OFF     | FEM_PINS ^ 0     )
+  #define RD_900     ( PA_OFF     | FEM_PINS ^ 0     )
+  #define TU_900     ( PA_LO_BAND | FEM_PINS ^ FEM_7 )
+  #define TD_900     ( PA_OFF     | FEM_PINS ^ 0     )
+
+  #define RU_850     ( PA_OFF     | FEM_PINS ^ FEM_9 )
+  #define RD_850     ( PA_OFF     | FEM_PINS ^ 0     )
+  #define TU_850     ( PA_LO_BAND | FEM_PINS ^ FEM_7 )
+  #define TD_850     ( PA_OFF     | FEM_PINS ^ 0     )
 
-    #define RU_850     ( PA_OFF     | FEM_PINS ^ 0     )
-    #define RD_850     ( PA_OFF     | FEM_PINS ^ 0     )
-    #define TU_850     ( PA_LO_BAND | FEM_PINS ^ FEM_9 )
-    #define TD_850     ( PA_OFF     | FEM_PINS ^ 0     )
+  #define RU_1800    ( PA_OFF     | FEM_PINS ^ 0     )
+  #define RD_1800    ( PA_OFF     | FEM_PINS ^ 0     )
+  #define TU_1800    ( PA_HI_BAND | FEM_PINS ^ FEM_8 )
+  #define TD_1800    ( PA_OFF     | FEM_PINS ^ 0     )
 
-    #define RU_1800    ( PA_OFF     | FEM_PINS ^ 0     )
-    #define RD_1800    ( PA_OFF     | FEM_PINS ^ 0     )
-    #define TU_1800    ( PA_HI_BAND | FEM_PINS ^ FEM_7 )
-    #define TD_1800    ( PA_OFF     | FEM_PINS ^ 0     )
+  #define RU_1900    ( PA_OFF     | FEM_PINS ^ 0     )
+  #define RD_1900    ( PA_OFF     | FEM_PINS ^ 0     )
+  #define TU_1900    ( PA_HI_BAND | FEM_PINS ^ FEM_8 )
+  #define TD_1900    ( PA_OFF     | FEM_PINS ^ 0     )
+
+#elif CONFIG_TARGET_GTAMODEM
+
+  // Openmoko's triband configuration is a bastardized version
+  // of TI's quadband one from Leonardo/E-Sample
+
+  #define FEM_7         BIT_2     // act2
+  #define FEM_8         BIT_1     // act1
+  #define FEM_9         BIT_4     // act4
 
-    #define RU_1900    ( PA_OFF     | FEM_PINS ^ FEM_8 )
-    #define RD_1900    ( PA_OFF     | FEM_PINS ^ 0     )
-    #define TU_1900    ( PA_HI_BAND | FEM_PINS ^ FEM_7 )
-    #define TD_1900    ( PA_OFF     | FEM_PINS ^ 0     )
-  #else
-    // original quadband arrangement
-    #define RU_900     ( PA_OFF     | FEM_PINS ^ 0     )
-    #define RD_900     ( PA_OFF     | FEM_PINS ^ 0     )
-    #define TU_900     ( PA_LO_BAND | FEM_PINS ^ FEM_7 )
-    #define TD_900     ( PA_OFF     | FEM_PINS ^ 0     )
+  #define PA_HI_BAND    BIT_3   // act3
+  #define PA_LO_BAND    0
+  #define PA_OFF        0
+
+  #define FEM_PINS (FEM_7 | FEM_8 | FEM_9)
+
+  #define FEM_OFF    ( FEM_PINS ^ 0 )
+
+  #define FEM_SLEEP  ( 0 )  
+
+  // This configuration is always inverted.
 
-    #define RU_850     ( PA_OFF     | FEM_PINS ^ FEM_9 )
-    #define RD_850     ( PA_OFF     | FEM_PINS ^ 0     )
-    #define TU_850     ( PA_LO_BAND | FEM_PINS ^ FEM_7 )
-    #define TD_850     ( PA_OFF     | FEM_PINS ^ 0     )
+  // RX_UP/DOWN and TX_UP/DOWN
+  #define RU_900     ( PA_OFF     | FEM_PINS ^ 0     )
+  #define RD_900     ( PA_OFF     | FEM_PINS ^ 0     )
+  #define TU_900     ( PA_LO_BAND | FEM_PINS ^ FEM_9 )
+  #define TD_900     ( PA_OFF     | FEM_PINS ^ 0     )
 
-    #define RU_1800    ( PA_OFF     | FEM_PINS ^ 0     )
-    #define RD_1800    ( PA_OFF     | FEM_PINS ^ 0     )
-    #define TU_1800    ( PA_HI_BAND | FEM_PINS ^ FEM_8 )
-    #define TD_1800    ( PA_OFF     | FEM_PINS ^ 0     )
+  #define RU_850     ( PA_OFF     | FEM_PINS ^ 0     )
+  #define RD_850     ( PA_OFF     | FEM_PINS ^ 0     )
+  #define TU_850     ( PA_LO_BAND | FEM_PINS ^ FEM_9 )
+  #define TD_850     ( PA_OFF     | FEM_PINS ^ 0     )
 
-    #define RU_1900    ( PA_OFF     | FEM_PINS ^ 0     )
-    #define RD_1900    ( PA_OFF     | FEM_PINS ^ 0     )
-    #define TU_1900    ( PA_HI_BAND | FEM_PINS ^ FEM_8 )
-    #define TD_1900    ( PA_OFF     | FEM_PINS ^ 0     )
-  #endif
+  #define RU_1800    ( PA_OFF     | FEM_PINS ^ 0     )
+  #define RD_1800    ( PA_OFF     | FEM_PINS ^ 0     )
+  #define TU_1800    ( PA_HI_BAND | FEM_PINS ^ FEM_7 )
+  #define TD_1800    ( PA_OFF     | FEM_PINS ^ 0     )
+
+  #define RU_1900    ( PA_OFF     | FEM_PINS ^ FEM_8 )
+  #define RD_1900    ( PA_OFF     | FEM_PINS ^ 0     )
+  #define TU_1900    ( PA_HI_BAND | FEM_PINS ^ FEM_7 )
+  #define TD_1900    ( PA_OFF     | FEM_PINS ^ 0     )
 
 #elif CONFIG_TARGET_PIRELLI
 
@@ -338,6 +356,49 @@
   #define TU_1900    ( PA_HI_BAND | ANTSW_TX_HIGH )
   #define TD_1900    ( PA_OFF     | 0             )
 
+#elif CONFIG_TARGET_COMPAL
+
+  #define PA_HI_BAND    BIT_8   // act8
+  #define PA_LO_BAND    0
+  #define PA_OFF        0
+
+  #define PA_ENABLE	BIT_1
+
+  // FEM control signals are active low
+  #define FEM_PINS (BIT_6 | BIT_2)
+
+  #define FEM_OFF    ( FEM_PINS ^ 0 )
+
+  #define FEM_SLEEP  ( 0 )  
+
+  #define FEM_TX_HIGH	BIT_6
+  #if USE_TSPACT2_FOR_TXLOW
+    #define FEM_TX_LOW	BIT_2
+  #else
+    #define FEM_TX_LOW	BIT_6
+  #endif
+
+  // RX_UP/DOWN and TX_UP/DOWN
+  #define RU_900     ( PA_OFF     | FEM_PINS ^ 0           )
+  #define RD_900     ( PA_OFF     | FEM_PINS ^ 0           )
+  #define TU_900     ( PA_LO_BAND | FEM_PINS ^ FEM_TX_LOW  )
+  #define TD_900     ( PA_OFF     | FEM_PINS ^ 0           )
+
+  #define RU_850     ( PA_OFF     | FEM_PINS ^ 0           )
+  #define RD_850     ( PA_OFF     | FEM_PINS ^ 0           )
+  #define TU_850     ( PA_LO_BAND | FEM_PINS ^ FEM_TX_LOW  )
+  #define TD_850     ( PA_OFF     | FEM_PINS ^ 0           )
+
+  #define RU_1800    ( PA_OFF     | FEM_PINS ^ 0           )
+  #define RD_1800    ( PA_OFF     | FEM_PINS ^ 0           )
+  #define TU_1800    ( PA_HI_BAND | FEM_PINS ^ FEM_TX_HIGH )
+  #define TD_1800    ( PA_OFF     | FEM_PINS ^ 0           )
+
+  #define RU_1900    ( PA_OFF     | FEM_PINS ^ 0           )
+  #define RD_1900    ( PA_OFF     | FEM_PINS ^ 0           )
+  #define TU_1900    ( PA_HI_BAND | FEM_PINS ^ FEM_TX_HIGH )
+  #define TD_1900    ( PA_OFF     | FEM_PINS ^ 0           )
+
 #endif  // FreeCalypso target selection
 
 #define TC1_DEVICE_ABB     TC1_DEVICE0  // TSPEN0
--- a/gsm-fw/cfgmagic/target.c139	Sat Oct 24 06:54:08 2015 +0000
+++ b/gsm-fw/cfgmagic/target.c139	Sat Oct 31 02:09:48 2015 +0000
@@ -24,4 +24,9 @@
 # The best we can do for now is lie and pretend to be Leonardo/Openmoko.
 RF_PA=2
 
+# To the best of our knowledge, the correct TSPACT signal to assert
+# for GSM low band transmission is TSPACT2 on this target.
+USE_TSPACT2_FOR_TXLOW=1
+export_to_c	USE_TSPACT2_FOR_TXLOW
+
 RVTMUX_UART_port=MODEM
--- a/gsm-fw/cfgmagic/target.c155	Sat Oct 24 06:54:08 2015 +0000
+++ b/gsm-fw/cfgmagic/target.c155	Sat Oct 31 02:09:48 2015 +0000
@@ -24,4 +24,9 @@
 # The best we can do for now is lie and pretend to be Leonardo/Openmoko.
 RF_PA=2
 
+# To the best of our knowledge, the correct TSPACT signal to assert
+# for GSM low band transmission is TSPACT6 on this target.
+USE_TSPACT2_FOR_TXLOW=0
+export_to_c	USE_TSPACT2_FOR_TXLOW
+
 RVTMUX_UART_port=MODEM