From 1dd4faa10c4c67dc9faa6417613d829676a60ffc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnim=20L=C3=A4uger?= Date: Tue, 22 Dec 2009 23:11:27 +0000 Subject: [PATCH] also issue CFI_CMD_READ_ARRAY2, required to reset some AMD/SCS compliant chips that don't honor CFI_CMD_READ_ARRAY1 git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1685 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/ChangeLog | 5 +++++ urjtag/src/flash/cfi.c | 7 +++++++ 2 files changed, 12 insertions(+) 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