From: Grazvydas Ignotas Date: Mon, 9 Dec 2013 23:23:06 +0000 (+0200) Subject: recognize another memory MCP chip X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-x-loader.git;a=commitdiff_plain;h=a23651575e90367757971b92df53bcf3ebd419b6 recognize another memory MCP chip based on gta04 code by H. Nikolaus Schaller --- diff --git a/board/pandora/pandora.c b/board/pandora/pandora.c index f3ffab3..f132ed8 100644 --- a/board/pandora/pandora.c +++ b/board/pandora/pandora.c @@ -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) { diff --git a/drivers/k9f1g08r0a.c b/drivers/k9f1g08r0a.c index eeb17c1..2ccf23d 100644 --- a/drivers/k9f1g08r0a.c +++ b/drivers/k9f1g08r0a.c @@ -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 {