OSDN Git Service

dummy device を追加
authorsato_tiff <sato_tiff@24ea1065-a21e-4ca1-99c9-f5125deb0858>
Sat, 20 Dec 2008 12:41:14 +0000 (12:41 +0000)
committersato_tiff <sato_tiff@24ea1065-a21e-4ca1-99c9-f5125deb0858>
Sat, 20 Dec 2008 12:41:14 +0000 (12:41 +0000)
git-svn-id: svn+ssh://svn.osdn.net/svnroot/unagi@195 24ea1065-a21e-4ca1-99c9-f5125deb0858

client/trunk/flashmemory.c

index 182568b..3dbea6e 100644 (file)
@@ -212,10 +212,12 @@ static void flash_erase_chip(const struct flash_order *d)
        Sleep(200); //Tec 0.2 sec
 }
 
+#if DEBUG==1
 static void sram_erase(const struct flash_order *d)
 {
        //bank ÀÚ¤êÂؤ¨¤¬È¼¤¦¤Î¤Ç¼ÂÁõ¤Ç¤­¤Ê¤¤
 }
+#endif
 
 /*
 ---- program ----
@@ -290,6 +292,7 @@ byte program mode 
 static void w49f002_write(const struct flash_order *d, long address, long length, const struct memory *m)
 {
        program_byte(d, address, m->data, length);
+       printf("write %s 0x%06x done\n", m->name, (int) m->offset);
 }
 
 
@@ -346,8 +349,6 @@ static void w29c040_write(const struct flash_order *d, long address, long length
        }while(ngblock != 0);
 
        free(cmp);
-//     compare(d, address, data, length);
-//     Sleep(10);
 }
 
 static void sram_write(const struct flash_order *d, long address, long length, const struct memory *m)
@@ -362,11 +363,15 @@ static void sram_write(const struct flash_order *d, long address, long length, c
        }
 }
 
+static void dummy_write(const struct flash_order *d, long address, long length, const struct memory *m)
+{
+}
+
 /*
 ¥Ç¥Ð¥¤¥¹¥ê¥¹¥È
 */
 enum{
-       ID_SRAM = 0
+       ID_SRAM = 0, ID_DUMMY = ID_SRAM
 };
 static const struct flash_driver DRIVER_SRAM256K = {
        .name = "SRAM256K",
@@ -382,6 +387,20 @@ static const struct flash_driver DRIVER_SRAM256K = {
        .write = sram_write
 };
 
+static const struct flash_driver DRIVER_DUMMY = {
+       .name = "dummy",
+       .capacity = 0x40000,
+       .pagesize = 0,
+       .id_manufacurer = ID_DUMMY,
+       .id_device = ID_DUMMY,
+       .productid_check = productid_sram,
+#if DEBUG==1
+       .erase = sram_erase,
+#endif
+       .init = init_nop,
+       .write = dummy_write
+};
+
 static const struct flash_driver DRIVER_W29C020 = {
        .name = "W29C020",
        .capacity = 0x40000,
@@ -460,8 +479,10 @@ static const struct flash_driver DRIVER_AM29F040B = {
 };
 
 static const struct flash_driver *DRIVER_LIST[] = {
-       &DRIVER_W29C020, &DRIVER_W29C040, &DRIVER_W49F002,
+       &DRIVER_W29C020, &DRIVER_W29C040, 
+       &DRIVER_W49F002, &DRIVER_EN29F002T, &DRIVER_AM29F040B,
        &DRIVER_SRAM256K, 
+       &DRIVER_DUMMY,
        NULL
 };