summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamjan Marion <damjan.marion@gmail.com>2011-05-23 13:25:28 +0200
committerØyvind Harboe <oyvind.harboe@zylin.com>2011-05-28 14:30:58 +0200
commitdb91a36fdd888f57f16bd86cd471764565810371 (patch)
tree6e771f55e65e68fe6e6b80c5a1dce3614df396e9
parentacdf14eb437abef6120fb7160f57a2592db45602 (diff)
downloadopenocd+libswd-db91a36fdd888f57f16bd86cd471764565810371.tar.gz
openocd+libswd-db91a36fdd888f57f16bd86cd471764565810371.tar.bz2
openocd+libswd-db91a36fdd888f57f16bd86cd471764565810371.tar.xz
openocd+libswd-db91a36fdd888f57f16bd86cd471764565810371.zip
Improve NAND flash detection
Detect based on both manufacturer id and chip id if manufacturer id is defined in table
-rw-r--r--src/flash/nand/core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/flash/nand/core.c b/src/flash/nand/core.c
index a9fc3cda..c4d92482 100644
--- a/src/flash/nand/core.c
+++ b/src/flash/nand/core.c
@@ -367,7 +367,9 @@ int nand_probe(struct nand_device *nand)
for (i = 0; nand_flash_ids[i].name; i++)
{
- if (nand_flash_ids[i].id == device_id)
+ if (nand_flash_ids[i].id == device_id &&
+ (nand_flash_ids[i].mfr_id == manufacturer_id ||
+ nand_flash_ids[i].mfr_id == 0 ))
{
nand->device = &nand_flash_ids[i];
break;