diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-05-06 09:30:28 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-05-06 09:30:28 +0200 |
commit | 18ffa4da98185f8c5044b381779bf8d6303242c8 (patch) | |
tree | 24632711b8641f3c028f8d4eb2d4d58e7cbad07b | |
parent | c8af035b4176af0e8da2cdd2d10109b56e06444e (diff) | |
parent | 973176d20b87568cee739c7c95bafa80a2034e18 (diff) | |
download | barebox-18ffa4da98185f8c5044b381779bf8d6303242c8.tar.gz barebox-18ffa4da98185f8c5044b381779bf8d6303242c8.tar.xz |
Merge branch 'for-next/mtd'
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 13 | ||||
-rw-r--r-- | drivers/mtd/nand/nand_ids.c | 4 | ||||
-rw-r--r-- | include/linux/mtd/nand.h | 20 |
3 files changed, 20 insertions, 17 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index fa10d9581e..c63aaf9dc1 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -1179,16 +1179,15 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd, return ERR_PTR(-ENODEV); } - /* Lookup the flash id */ - for (i = 0; nand_flash_ids[i].name != NULL; i++) { - if (dev_id == nand_flash_ids[i].id) { - type = &nand_flash_ids[i]; + if (!type) + type = nand_flash_ids; + + for (; type->name != NULL; type++) + if (dev_id == type->id) break; - } - } chip->onfi_version = 0; - if (!type) { + if (!type->name || !type->pagesize) { /* Check is chip is ONFI compliant */ ret = nand_flash_detect_onfi(mtd, chip, &busw); if (ret) diff --git a/drivers/mtd/nand/nand_ids.c b/drivers/mtd/nand/nand_ids.c index 72593d44a8..4f8fb021a9 100644 --- a/drivers/mtd/nand/nand_ids.c +++ b/drivers/mtd/nand/nand_ids.c @@ -178,7 +178,9 @@ struct nand_manufacturers nand_manuf_ids[] = { {NAND_MFR_STMICRO, __NANDSTR("ST Micro")}, {NAND_MFR_HYNIX, __NANDSTR("Hynix")}, {NAND_MFR_MICRON, __NANDSTR("Micron")}, - {NAND_MFR_AMD, __NANDSTR("AMD")}, + {NAND_MFR_AMD, __NANDSTR("AMD/Spansion")}, + {NAND_MFR_MACRONIX, __NANDSTR("Macronix")}, + {NAND_MFR_EON, __NANDSTR("Eon")}, {0x0, "Unknown"} }; diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index dc141a5186..25bae631e5 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h @@ -500,15 +500,17 @@ struct nand_chip { /* * NAND Flash Manufacturer ID Codes */ -#define NAND_MFR_TOSHIBA 0x98 -#define NAND_MFR_SAMSUNG 0xec -#define NAND_MFR_FUJITSU 0x04 -#define NAND_MFR_NATIONAL 0x8f -#define NAND_MFR_RENESAS 0x07 -#define NAND_MFR_STMICRO 0x20 -#define NAND_MFR_HYNIX 0xad -#define NAND_MFR_MICRON 0x2c -#define NAND_MFR_AMD 0x01 +#define NAND_MFR_TOSHIBA 0x98 +#define NAND_MFR_SAMSUNG 0xec +#define NAND_MFR_FUJITSU 0x04 +#define NAND_MFR_NATIONAL 0x8f +#define NAND_MFR_RENESAS 0x07 +#define NAND_MFR_STMICRO 0x20 +#define NAND_MFR_HYNIX 0xad +#define NAND_MFR_MICRON 0x2c +#define NAND_MFR_AMD 0x01 +#define NAND_MFR_MACRONIX 0xc2 +#define NAND_MFR_EON 0x92 /** * struct nand_flash_dev - NAND Flash Device ID Structure |