changeset 170:7290e92f71a9

FFS dev.c & drv.c: updates from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 19 Jun 2019 04:23:24 +0000
parents 9d46c005da91
children 3a8c90814d1a
files src/cs/drivers/drv_app/ffs/board/dev.c src/cs/drivers/drv_app/ffs/board/drv.c
diffstat 2 files changed, 23 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/src/cs/drivers/drv_app/ffs/board/dev.c	Wed Jun 19 04:11:11 2019 +0000
+++ b/src/cs/drivers/drv_app/ffs/board/dev.c	Wed Jun 19 04:23:24 2019 +0000
@@ -428,14 +428,7 @@
     { &flash_16x64[0], (char *) 0x1C0000, MANUFACT_INTEL,   0x88C2,
       FFS_DRIVER_INTEL_SB,  3 },
 
-    /*
-     * A user in the field found that some Mot C11x phones have 2 MiB
-     * of flash, but use some different flash chip, not our familiar
-     * 28F160C3-T.  This chip reports manufacturer ID 0x20 and device
-     * ID 0x88CE, but the CFI structure lists the same sector geometry
-     * as our familiar 28F160C3-T.  Let's treat this mystery flash chip
-     * as equivalent to our familiar one.
-     */
+    /* ST equivalent of 28F160C3T found in some Mot C11x phones */
     { &flash_16x64[0], (char *) 0x1C0000,           0x20,   0x88CE,
       FFS_DRIVER_INTEL_SB,  3 },
 
@@ -444,6 +437,10 @@
     { &flash_16x64[0], (char *) 0x3C0000, MANUFACT_INTEL,   0x88C4,
       FFS_DRIVER_INTEL_SB,  3 },
 
+    /* ST equivalent of 28F320C3T found in some Mot C139 phones */
+    { &flash_16x64[0], (char *) 0x3C0000,           0x20,   0x88BA,
+      FFS_DRIVER_INTEL_SB,  3 },
+
     // Intel 28F640C3-B, 64Mb. Using top-most 16x64kB sectors
     // Changed for C155 aftermarket FFS config: 64x13 at 0x700000
     { &flash_16x64[0], (char *) 0x700000, MANUFACT_INTEL,   0x88CD,
@@ -624,18 +621,22 @@
     // Samsung K5A3340YB Bottom boot, 14Mb + 18Mb (!?)
     { &flash_16x64[0], (char *) 0x380000, MANUFACT_SAMSUNG, 0x223D,
       FFS_DRIVER_AMD_SB,  8 },
-//zack add
-   //Samsung K5A3240CG
-   { &flash_16x64[0], (char *) 0x380000, MANUFACT_SAMSUNG, 0x22A0,
+
+    /* post-TI additions */
+
+    // Samsung K5A32xxCTM (Openmoko)
+    { &flash_16x64[0], (char *) 0x380000, MANUFACT_SAMSUNG, 0x22A0,
       FFS_DRIVER_AMD_SB,  7 }, 
-   //Samsung K5L6331CAA-D270
-    { &flash_16x64[0], (char *) 0x380000, MANUFACT_SAMSUNG, 0x257E,
+
+    // Samsung K5L33xxCAM (Huawei GTM900)
+    // Multi-id device: 0x257E, 0x2503, 0x2501. Converted to 0x0301
+    { &flash_16x64[0], (char *) 0x380000, MANUFACT_SAMSUNG, 0x0301,
+      FFS_DRIVER_AMD_SB,  7 }, 
+
+    // Samsung K5L6331CAA-D270 ?? (stanza came with moko10/11 source)
+    // Multi-id device: 0x257E, 0x2506, 0x2501. Converted to 0x0601
+    { &flash_16x64[0], (char *) 0x380000, MANUFACT_SAMSUNG, 0x0601,
       FFS_DRIVER_AMD_SB,  15 },
-    { &flash_16x64[0], (char *) 0x380000, MANUFACT_SAMSUNG, 0x2506,
-      FFS_DRIVER_AMD_SB,  15 },  
-    { &flash_16x64[0], (char *) 0x380000, MANUFACT_SAMSUNG, 0x2501,
-      FFS_DRIVER_AMD_SB,  15 },  
-//end zack
 
     /********** SST Devices ***********************************************/
 
--- a/src/cs/drivers/drv_app/ffs/board/drv.c	Wed Jun 19 04:11:11 2019 +0000
+++ b/src/cs/drivers/drv_app/ffs/board/drv.c	Wed Jun 19 04:23:24 2019 +0000
@@ -1385,6 +1385,10 @@
               dev.device += ffsdrv_is_new_spansion_flash();
           #endif
         }
+        else if (dev.manufact == MANUFACT_SAMSUNG && device_id[0] == 0x257E) {
+            /* Samsung's version of extended ID */
+            dev.device = (device_id[1] << 8) | (device_id[2] & 0xFF);
+        }
         else 
             dev.device = device_id[0];
 #endif