mtd: OneNAND: add support for OneNAND manufactured by Numonyx
authorAdrian Hunter <adrian.hunter@nokia.com>
Tue, 5 May 2009 08:04:19 +0000 (11:04 +0300)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 5 Jun 2009 16:49:25 +0000 (17:49 +0100)
In addition to adding the Numonyx manufacturer code, this patch
also ensures 'sync. write' is disabled when reading identification
data - something that the Numonyx chip objects to, but the
Samsung chip seems to ignore.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/onenand/onenand_base.c
include/linux/mtd/onenand.h

index 30d6999e5f9f5a75a22078ee56459798ea0fc865..2346857a275d98453f95d79be018f8db2efacda9 100644 (file)
@@ -2576,6 +2576,7 @@ static void onenand_print_device_info(int device, int version)
 
 static const struct onenand_manufacturers onenand_manuf_ids[] = {
         {ONENAND_MFR_SAMSUNG, "Samsung"},
+       {ONENAND_MFR_NUMONYX, "Numonyx"},
 };
 
 /**
@@ -2621,7 +2622,7 @@ static int onenand_probe(struct mtd_info *mtd)
        /* Save system configuration 1 */
        syscfg = this->read_word(this->base + ONENAND_REG_SYS_CFG1);
        /* Clear Sync. Burst Read mode to read BootRAM */
-       this->write_word((syscfg & ~ONENAND_SYS_CFG1_SYNC_READ), this->base + ONENAND_REG_SYS_CFG1);
+       this->write_word((syscfg & ~ONENAND_SYS_CFG1_SYNC_READ & ~ONENAND_SYS_CFG1_SYNC_WRITE), this->base + ONENAND_REG_SYS_CFG1);
 
        /* Send the command for reading device ID from BootRAM */
        this->write_word(ONENAND_CMD_READID, this->base + ONENAND_BOOTRAM);
index 9aa2a9149b583991c75054ffd15b583b8e540f3e..0fa3ac4ad5768747bb54ea80a90a8fb9050bc84b 100644 (file)
@@ -176,6 +176,7 @@ struct onenand_chip {
  * OneNAND Flash Manufacturer ID Codes
  */
 #define ONENAND_MFR_SAMSUNG    0xec
+#define ONENAND_MFR_NUMONYX    0x20
 
 /**
  * struct onenand_manufacturers - NAND Flash Manufacturer ID Structure