recognize another memory MCP chip
[pandora-x-loader.git] / board / pandora / pandora.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) {