diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 8d2323a9..2cd5a860 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -1,3 +1,8 @@ +2009-12-23 Arnim Laeuger + + * src/flash/cfi.c: also issue CFI_CMD_READ_ARRAY2, required to reset + some AMD/SCS compliant chips that don't honor CFI_CMD_READ_ARRAY1 + 2009-11-22 Arnim Laeuger * src/flash/intel.c, src/flash/amd.c: set max_bytes_write to std value 1 diff --git a/urjtag/src/flash/cfi.c b/urjtag/src/flash/cfi.c index 5ccc0279..0a95be7e 100644 --- a/urjtag/src/flash/cfi.c +++ b/urjtag/src/flash/cfi.c @@ -143,6 +143,7 @@ urj_flash_cfi_detect (urj_bus_t *bus, uint32_t adr, } write1 (0, CFI_CMD_READ_ARRAY1); + write1 (0, CFI_CMD_READ_ARRAY2); } if (ma > 4) @@ -157,6 +158,7 @@ urj_flash_cfi_detect (urj_bus_t *bus, uint32_t adr, if (read1 (CFI_QUERY_ID_OFFSET + 2) != 'Y') { write1 (0, CFI_CMD_READ_ARRAY1); + write1 (0, CFI_CMD_READ_ARRAY2); urj_error_set (URJ_ERROR_FLASH, "CFI not detected (Y)"); return URJ_STATUS_FAIL; } @@ -166,6 +168,7 @@ urj_flash_cfi_detect (urj_bus_t *bus, uint32_t adr, if (!(*cfi_array)->cfi_chips[d / 8]) { write1 (0, CFI_CMD_READ_ARRAY1); + write1 (0, CFI_CMD_READ_ARRAY2); urj_error_set (URJ_ERROR_OUT_OF_MEMORY, "calloc(%zd,%zd) fails", (size_t) 1, sizeof (urj_flash_cfi_chip_t)); return URJ_STATUS_FAIL; @@ -248,6 +251,7 @@ urj_flash_cfi_detect (urj_bus_t *bus, uint32_t adr, if (!cfi->device_geometry.erase_block_regions) { write1 (0, CFI_CMD_READ_ARRAY1); + write1 (0, CFI_CMD_READ_ARRAY2); urj_error_set (URJ_ERROR_OUT_OF_MEMORY, "malloc(%zd) fails", (size_t) tmp * sizeof (urj_flash_cfi_erase_block_region_t)); @@ -288,6 +292,7 @@ urj_flash_cfi_detect (urj_bus_t *bus, uint32_t adr, if (read1 (0) != 'P' || read1 (1) != 'R' || read1 (2) != 'I') { write1 (0, CFI_CMD_READ_ARRAY1); + write1 (0, CFI_CMD_READ_ARRAY2); urj_error_set (URJ_ERROR_FLASH, "CFI primary vendor table not detected"); return URJ_STATUS_FAIL; @@ -306,6 +311,7 @@ urj_flash_cfi_detect (urj_bus_t *bus, uint32_t adr, if (!pri_vendor_tbl) { write1 (0, CFI_CMD_READ_ARRAY1); + write1 (0, CFI_CMD_READ_ARRAY2); urj_error_set (URJ_ERROR_OUT_OF_MEMORY, "calloc(%zd,%zd) fails", (size_t) 1, sizeof (urj_flash_cfi_amd_pri_extened_query_structure_t) @@ -421,6 +427,7 @@ urj_flash_cfi_detect (urj_bus_t *bus, uint32_t adr, /* Read Array */ write1 (0, CFI_CMD_READ_ARRAY1); + write1 (0, CFI_CMD_READ_ARRAY2); #undef A #undef D