]> git.sur5r.net Git - openocd/commitdiff
David Brownell <david-b@pacbell.net> NAND: update ids, "nand list" bugfix
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Tue, 19 May 2009 10:04:41 +0000 (10:04 +0000)
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Tue, 19 May 2009 10:04:41 +0000 (10:04 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@1835 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/flash/nand.c
src/flash/nand.h

index 87eb976a79b760e88a0e33c9e479ba0a777e8b30..85ca0fed45cd35c9a5df308e5652982ae08550d7 100644 (file)
@@ -86,6 +86,7 @@ static command_t *nand_cmd;
  */
 static nand_info_t nand_flash_ids[] =
 {
+       /* start "museum" IDs */
        {"NAND 1MiB 5V 8-bit",          0x6e, 256, 1, 0x1000, 0},
        {"NAND 2MiB 5V 8-bit",          0x64, 256, 2, 0x1000, 0},
        {"NAND 4MiB 5V 8-bit",          0x6b, 512, 4, 0x2000, 0},
@@ -101,6 +102,7 @@ static nand_info_t nand_flash_ids[] =
        {"NAND 8MiB 3,3V 8-bit",        0xe6, 512, 8, 0x2000, 0},
        {"NAND 8MiB 1,8V 16-bit",       0x49, 512, 8, 0x2000, NAND_BUSWIDTH_16},
        {"NAND 8MiB 3,3V 16-bit",       0x59, 512, 8, 0x2000, NAND_BUSWIDTH_16},
+       /* end "museum" IDs */
 
        {"NAND 16MiB 1,8V 8-bit",       0x33, 512, 16, 0x4000, 0},
        {"NAND 16MiB 3,3V 8-bit",       0x73, 512, 16, 0x4000, 0},
@@ -172,6 +174,7 @@ static nand_manufacturer_t nand_manuf_ids[] =
        {NAND_MFR_RENESAS, "Renesas"},
        {NAND_MFR_STMICRO, "ST Micro"},
        {NAND_MFR_HYNIX, "Hynix"},
+       {NAND_MFR_MICRON, "Micron"},
        {0x0, NULL},
 };
 
@@ -1062,7 +1065,7 @@ int nand_write_page_raw(struct nand_device_s *device, u32 page, u8 *data, u32 da
 int handle_nand_list_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
 {
        nand_device_t *p;
-       int i = 0;
+       int i;
 
        if (!nand_devices)
        {
@@ -1070,13 +1073,13 @@ int handle_nand_list_command(struct command_context_s *cmd_ctx, char *cmd, char
                return ERROR_OK;
        }
 
-       for (p = nand_devices; p; p = p->next)
+       for (p = nand_devices, i = 0; p; p = p->next, i++)
        {
                if (p->device)
                        command_print(cmd_ctx, "#%i: %s (%s) pagesize: %i, buswidth: %i, erasesize: %i",
-                               i++, p->device->name, p->manufacturer->name, p->page_size, p->bus_width, p->erase_size);
+                               i, p->device->name, p->manufacturer->name, p->page_size, p->bus_width, p->erase_size);
                else
-                       command_print(cmd_ctx, "#%i: not probed");
+                       command_print(cmd_ctx, "#%i: not probed", i);
        }
 
        return ERROR_OK;
index 6f3ea2723e1480ec68f6ff8fe51f4d7d70b1b65a..0ee1ffe83fd38882187a8f4c54e52b67c7c53022 100644 (file)
@@ -95,6 +95,7 @@ enum
        NAND_MFR_RENESAS = 0x07,
        NAND_MFR_STMICRO = 0x20,
        NAND_MFR_HYNIX = 0xad,
+       NAND_MFR_MICRON = 0x2c,
 };
 
 typedef struct nand_manufacturer_s