OSDN Git Service

capacity error を関数化、dummy device の容量を増加
authornaruko <naruko@24ea1065-a21e-4ca1-99c9-f5125deb0858>
Tue, 13 Jan 2009 22:35:55 +0000 (22:35 +0000)
committernaruko <naruko@24ea1065-a21e-4ca1-99c9-f5125deb0858>
Tue, 13 Jan 2009 22:35:55 +0000 (22:35 +0000)
git-svn-id: svn+ssh://svn.osdn.net/svnroot/unagi@260 24ea1065-a21e-4ca1-99c9-f5125deb0858

client/trunk/flashmemory.c
client/trunk/flashmemory.h
client/trunk/reader_hongkongfc.c
client/trunk/script.c

index 5409913..f209b53 100644 (file)
@@ -439,10 +439,10 @@ static void dummy_write(const struct flash_order *d, long address, long length,
 /*
 ¥Ç¥Ð¥¤¥¹¥ê¥¹¥È
 */
-//0x80 °Ê¹ß¤ÏËÜÅö¤Î¥Ç¥Ð¥¤¥¹½ÅÊ£¤·¤Ê¤¤¤È»×¤¦. Ã¯¤« JEDEC ¤Î¤È¤³¤ò¤·¤é¤Ù¤Æ.
-static const struct flash_driver DRIVER_SRAM256K = {
-       .name = "SRAM256K",
-       .capacity = 0x8000,
+enum{MEGA = 0x20000};
+static const struct flash_driver DRIVER_SRAM = {
+       .name = "SRAM",
+       .capacity = 4 * MEGA,
        .pagesize = 0,
        .erase_wait = 0,
        .command_mask = 0,
@@ -458,7 +458,7 @@ static const struct flash_driver DRIVER_SRAM256K = {
 
 static const struct flash_driver DRIVER_DUMMY = {
        .name = "dummy",
-       .capacity = 0x40000,
+       .capacity = 16 * MEGA,
        .pagesize = 0,
        .erase_wait = 0,
        .command_mask = 0,
@@ -474,7 +474,7 @@ static const struct flash_driver DRIVER_DUMMY = {
 
 static const struct flash_driver DRIVER_W29C020 = {
        .name = "W29C020",
-       .capacity = 0x40000,
+       .capacity = 2 * MEGA,
        .pagesize = 0x80,
        .erase_wait = 50,
        .command_mask = 0x7fff,
@@ -490,7 +490,7 @@ static const struct flash_driver DRIVER_W29C020 = {
 
 static const struct flash_driver DRIVER_W29C040 = {
        .name = "W29C040",
-       .capacity = 0x80000,
+       .capacity = 4 * MEGA,
        .pagesize = 0x100,
        .erase_wait = 50,
        .command_mask = 0x7fff,
@@ -506,7 +506,7 @@ static const struct flash_driver DRIVER_W29C040 = {
 
 static const struct flash_driver DRIVER_W49F002 = {
        .name = "W49F002",
-       .capacity = 0x40000,
+       .capacity = 2 * MEGA,
        .pagesize = 0,
        .erase_wait = 1000, //typ 0.1, max 0.2 sec
        .command_mask = 0x7fff,
@@ -529,7 +529,7 @@ command address 
 */
 static const struct flash_driver DRIVER_EN29F002T = {
        .name = "EN29F002T",
-       .capacity = 0x40000,
+       .capacity = 2 * MEGA,
        .pagesize = 0,
        .erase_wait = 3000, //typ 2, max 5 sec
        .command_mask = 0x07ff,
@@ -545,7 +545,7 @@ static const struct flash_driver DRIVER_EN29F002T = {
 
 static const struct flash_driver DRIVER_AM29F040B = {
        .name = "AM29F040B",
-       .capacity = 0x80000,
+       .capacity = 4 * MEGA,
        .pagesize = 0,
        .erase_wait = 8000, //typ 8, max 64 sec
        .command_mask = 0x07ff,
@@ -562,7 +562,7 @@ static const struct flash_driver DRIVER_AM29F040B = {
 static const struct flash_driver *DRIVER_LIST[] = {
        &DRIVER_W29C020, &DRIVER_W29C040, 
        &DRIVER_W49F002, &DRIVER_EN29F002T, &DRIVER_AM29F040B,
-       &DRIVER_SRAM256K
+       &DRIVER_SRAM, 
        &DRIVER_DUMMY,
        NULL
 };
index 417890a..039e019 100644 (file)
@@ -52,6 +52,8 @@ struct flash_driver{
 };
 
 const struct flash_driver *flash_driver_get(const char *name);
+
+//0x80 °Ê¹ß¤ÏËÜÅö¤Î¥Ç¥Ð¥¤¥¹½ÅÊ£¤·¤Ê¤¤¤È»×¤¦. Ã¯¤« JEDEC ¤Î¤È¤³¤ò¤·¤é¤Ù¤Æ.
 enum{
        FLASH_ID_DEVICE_SRAM = 0xf0, 
        FLASH_ID_DEVICE_DUMMY
index dc5c55f..b1b7e72 100644 (file)
@@ -225,9 +225,8 @@ static void hk_ppu_write(long address, long data)
        data_port_latch(DATA_SELECT_CONTROL, c);
        //WE up
        c = bit_set(c, BITNUM_PPU_RW);
-       c = bit_set(c, BITNUM_WRITEDATA_OUTPUT);
-       data_port_latch(DATA_SELECT_CONTROL, c);
        //CS up
+       c = bit_set(c, BITNUM_WRITEDATA_OUTPUT);
        data_port_latch(DATA_SELECT_CONTROL, BUS_CONTROL_BUS_STANDBY);
 }
 
index 757ba3b..06a9fed 100644 (file)
@@ -349,6 +349,11 @@ logical_check() 
 */
 static const char LOGICAL_ERROR_PREFIX[] = "logical error:";
 
+static void logical_print_capacityerror(int line, const char *area)
+{
+       printf("%d: %s %s area flash memory capacity error\n", line, LOGICAL_ERROR_PREFIX, area);
+}
+
 static inline void logical_print_illgalarea(int line, const char *area, long address)
 {
        printf("%d:%s illgal %s area $%06x\n", line, LOGICAL_ERROR_PREFIX, area, (int) address);
@@ -546,7 +551,7 @@ static int logical_check(const struct script *s, const struct st_config *c, stru
                        //flash memory capacity check
                        //¤¤¤Þ¤Î¤È¤³¤í == ¤Ë¤·¤Æ¾®¤µ¤¤ÍÆÎ̤⤽¤Î¤¦¤ÁÂбþ
                        else if((c->mode == MODE_ROM_PROGRAM) && (size > c->cpu_flash_driver->capacity)){
-                               printf("%s flash memory capacity error\n", LOGICAL_ERROR_PREFIX);
+                               logical_print_capacityerror(s->line, r->cpu_rom.name);
                                error += 1;
                        }
                        }break;
@@ -567,7 +572,7 @@ static int logical_check(const struct script *s, const struct st_config *c, stru
                                error += 1;
                        }
                        else if((c->mode == MODE_ROM_PROGRAM) && (size > c->ppu_flash_driver->capacity)){
-                               printf("%s flash memory capacity error\n", LOGICAL_ERROR_PREFIX);
+                               logical_print_capacityerror(s->line, r->ppu_rom.name);
                                error += 1;
                        }
                        }