recognize another memory MCP chip
authorGrazvydas Ignotas <notasas@gmail.com>
Mon, 9 Dec 2013 23:23:06 +0000 (01:23 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Mon, 9 Dec 2013 23:23:06 +0000 (01:23 +0200)
based on gta04 code by H. Nikolaus Schaller

board/pandora/pandora.c
drivers/k9f1g08r0a.c

index f3ffab3..f132ed8 100644 (file)
@@ -193,6 +193,7 @@ static void config_sdram_ddr(u32 cpu_family)
 {
        unsigned char buf[64];
        int ram_type = MICRON_128MB_166MHZ;
+       int mfr, id;
        int ret;
 
        /* reset sdrc controller */
@@ -205,10 +206,16 @@ static void config_sdram_ddr(u32 cpu_family)
 
        /* read NAND id to guess what RAM is attached */
        early_nand_init();
-       ret = nand_read_param_page(buf, sizeof(buf));
-       if (ret == 0) {
-               if (strncmp((char *)buf + 44, "MT29F4G16ABBDA", 14) == 0)
-                       ram_type = MICRON_256MB_200MHZ;
+       ret = nand_readid(&mfr, &id);
+       if (ret == 0 && id == 0xb3) {
+               ram_type = MICRON_256MB_200MHZ;
+       } else {
+               /* others share the same id (bc), luckily NAND model differs */
+               ret = nand_read_param_page(buf, sizeof(buf));
+               if (ret == 0) {
+                       if (strncmp((char *)buf + 44, "MT29F4G16ABBDA", 14) == 0)
+                               ram_type = MICRON_256MB_200MHZ;
+               }
        }
 
        if (ram_type == MICRON_256MB_200MHZ) {
index eeb17c1..2ccf23d 100644 (file)
@@ -46,6 +46,7 @@
 #define MT29F1G_ID             0xa1  /* x8, 1GiB */
 #define MT29F2G_ID             0xba  /* x16, 2GiB */
 #define MT29F4G_ID             0xbc  /* x16, 4GiB */
+#define MT29F8G_ID             0xb3  /* x16, 8GiB */
 
 #define ADDR_COLUMN            1          
 #define ADDR_PAGE              2             
@@ -236,7 +237,7 @@ int nand_chip()
        NAND_DISABLE_CE();
 
        if (((mfr == MT29F1G_MFR || mfr == MT29F1G_MFR2 || mfr == MT29F1G_MFR3) &&
-               (id == MT29F1G_ID || id == MT29F2G_ID || id == MT29F4G_ID)) ||
+               (id == MT29F1G_ID || id == MT29F2G_ID || id == MT29F4G_ID || id == MT29F8G_ID)) ||
             (mfr == K9F1G08R0A_MFR && (id == K9F1G08R0A_ID))) {
                return 0;
        } else {