changeset 187:d05fb947b50d

src/cs: sync with Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 15 Feb 2020 20:23:30 +0000
parents 807fdc70cbd0
children 049091077b51
files src/cs/drivers/drv_app/ffs/board/dev.c src/cs/drivers/drv_core/armio/armio.c src/cs/layer1/tpu_drivers/source0/tpudrv12.h
diffstat 3 files changed, 48 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/src/cs/drivers/drv_app/ffs/board/dev.c	Sat Feb 15 20:12:32 2020 +0000
+++ b/src/cs/drivers/drv_app/ffs/board/dev.c	Sat Feb 15 20:23:30 2020 +0000
@@ -360,7 +360,7 @@
     /*
      * Our familiar version of the Pirelli DP-L10 hw features Spansion
      * S71PL129NC0HFW4B flash (N version, 256 KiB sectors), but apparently
-     * an earlier hw version had S71PL-J flash with 64 KiB sectors,
+     * an earlier hw version had S71PL129J flash with 64 KiB sectors,
      * and Pirelli's official fw supports both.  They have modified
      * TI's flash ID code to generate device ID 0x2100 for the J version
      * or 0x2101 for the N version.  We have now replicated this ID logic
@@ -381,37 +381,50 @@
 #elif defined(CONFIG_TARGET_FCFAM)
 
     /*
-     * Our FreeCalypso hardware family is currently in its infancy
-     * (we have only one board design so far, but hoping to have more),
-     * thus the set of possible flash chip types on FC hw platforms
-     * is expected to grow.  The footprint on our current FCDEV3B PCB
-     * ideally fits Spansion MCPs with two chip select banks (either
-     * S71PL-J or S71PL-N), but can also be fitted with Openmoko's
-     * Samsung K5A3281.  Spansion S71PL129NC0HFW4B (copied from the
-     * Pirelli DP-L10) is our official flash+RAM chip, populated on
-     * our production boards, but now that we have fixed TI's autodetect
-     * code to work with the newer Spansion chips, we can support
-     * all 3 possibilities in our fw with autodetection: S71PL-J,
-     * S71PL-N or K5A32xx.
+     * This table of flash devices covers those possibilities that may occur
+     * on FreeCalypso-branded hardware; we use a new table separate from the
+     * one we inherited from TI/Openmoko.  Originally we had no choice because
+     * we had no working autodetection for our new S71PL129N flash; we now have
+     * working autodetection, but we still use a separate device table for a
+     * few reasons:
      *
-     * For future FreeCalypso hw designs, the Mother's plan is to
-     * keep the high-capacity S71PL129NC0HFW4B for the handset prototype
-     * and UI development board, but for embedded modem products
-     * we will probably switch to Openmoko's K5A32xx.
+     * 1) Our 16 MiB flash options (S71PL129N and S71PL129J) are specific
+     *    to CONFIG_TARGET_FCFAM;
+     *
+     * 2) We gain additional freedoms like having a different FFS config
+     *    for K5A32xxCTM flash in FCFAM vs. Openmoko;
+     *
+     * 3) Less clutter is always good.
      */
 
-    /* S71PL-N, FreeCalypso official, FFS in the first 2 MiB of the 2nd bank */
+    /* S71PL129N, current FCDEV3B hw, FFS in the first 2 MiB of the 2nd bank */
     { &flash_32x256[0], (char *) 0x01800000, MANUFACT_AMD,     0x2101,
       FFS_DRIVER_AMD,  8 },
 
-    /* S71PL-J, currently only theoretical */
+    /* S71PL129J, currently only theoretical */
     { &flash_128x64[0], (char *) 0x01800000, MANUFACT_AMD,     0x2100,
       FFS_DRIVER_AMD, 32 },
 
+    /* S71PL064J, 7x9 mm, attractive option for tight physical form factors */
+    { &flash_16x64[0], (char *) 0x700000, MANUFACT_AMD,     0x0201,
+      FFS_DRIVER_AMD, 15 },
+
+    /* S71PL032J, 7x9 mm, smaller capacity, footprint same as S71PL064J */
+    { &flash_16x64[0], (char *) 0x380000, MANUFACT_AMD,     0x0A01,
+      FFS_DRIVER_AMD,  7 },
+
     /*
-     * K5A32xxCTM from Openmoko, but note our different FFS config:
-     * if we are going to put this smaller flash chip into our embedded
-     * modem products, let's use it efficiently.
+     * Prior to the discovery of S71PL064J as a superior alternative, we were
+     * thinking about using Samsung K5A32xx from Openmoko in embedded modem
+     * products that have no need for huge flash and XRAM.  Now that we have
+     * discovered S71PL064J which is both physically smaller and friendlier in
+     * terms of BGA footprint, it is unlikely that we will go back to K5A32xx.
+     * However, we do have one FCDEV3B board on which we populated a K5A3281CTM
+     * chip, so we are keeping firmware support for it.
+     *
+     * Note that the FFS configuration is different from Openmoko's: the
+     * thinking was that if we were going to use this chip, let's use it
+     * efficiently.
      */
     { &flash_16x64[0], (char *) 0x300000, MANUFACT_SAMSUNG, 0x22A0,
       FFS_DRIVER_AMD, 15 },
@@ -451,6 +464,7 @@
 #else
 
     /* original table from TI/Openmoko, used on TI and Openmoko targets */
+    /* also used on the newly discovered GTM900 and Tango modem targets */
 
     /********** AMD Devices ***********************************************/
 
@@ -492,6 +506,12 @@
     { &flash_16x64[0], (char *) 0x100000, MANUFACT_AMD,     0x2233,
       FFS_DRIVER_AMD, 15 },
 
+    /* newer Spansion devices in AMD ID code space */
+
+    // Spansion S29/S71PL032J. Ignoring the 8kB sectors
+    // Multi-id device: 0x227E, 0x220A, 0x2201. Converted to 0x0A01
+    { &flash_16x64[0], (char *) 0x380000, MANUFACT_AMD,     0x0A01,
+      FFS_DRIVER_AMD,  7 },
 
     /********** Fujitsu Devices *******************************************/
 
--- a/src/cs/drivers/drv_core/armio/armio.c	Sat Feb 15 20:12:32 2020 +0000
+++ b/src/cs/drivers/drv_core/armio/armio.c	Sat Feb 15 20:23:30 2020 +0000
@@ -286,7 +286,7 @@
     #ifndef CONFIG_TARGET_LEONARDO	/* GPIO 2 is an input on Leonardo! */
       AI_ConfigBitAsOutput(2);
     #endif
-    #ifdef CONFIG_TARGET_GTAMODEM
+    #ifdef CONFIG_GPIO3_OUTPUT
       AI_ConfigBitAsOutput(3);
     #endif
     #if defined(CONFIG_TARGET_GTAMODEM) || defined(CONFIG_TARGET_FCFAM)
@@ -301,7 +301,7 @@
       AI_ConfigBitAsOutput(8);
     #endif
     AI_ConfigBitAsOutput(9);
-    #ifdef CONFIG_TARGET_GTAMODEM
+    #ifdef CONFIG_MCSI_UNUSED
       AI_ConfigBitAsOutput(10);
       AI_ConfigBitAsOutput(11);
       AI_ConfigBitAsOutput(12);
--- a/src/cs/layer1/tpu_drivers/source0/tpudrv12.h	Sat Feb 15 20:12:32 2020 +0000
+++ b/src/cs/layer1/tpu_drivers/source0/tpudrv12.h	Sat Feb 15 20:23:30 2020 +0000
@@ -371,11 +371,12 @@
   #define TU_1900    ( PA_HI_BAND | FEM_PINS ^ FEM_TX_HIGH )
   #define TD_1900    ( PA_OFF     | FEM_PINS ^ 0           )
 
-#elif defined(CONFIG_TARGET_GTM900)
+#elif defined(CONFIG_TARGET_MGC2GSMT)
 
   /*
-   * Huawei GTM900-B is very closely based on Leonardo (2-band version),
-   * but the two FEM Tx control signals are reversed.
+   * The common MGC2GSMT version of Huawei GTM900-B is very closely based
+   * on Leonardo (2-band version), but the two FEM Tx control signals
+   * are reversed.
    */
 
   #define FEM_TX_LOW    BIT_1     // act1