2003-06-18 Marcel Telka <marcel@telka.sk>

* flash/cfi.c (read2): Fixed operator precedence in macro.
	(cfi_detect): Fixed CFI detection code (based on patch 753295, Matan Ziv-Av).
	* flash/intel.c (intel_flash_autodetect8): New function (patch 753295, Matan Ziv-Av).
	(intel_8_flash_driver): New driver (patch 753295, Matan Ziv-Av).


git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@486 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Marcel Telka 22 years ago
parent 287f6c5229
commit 8e58ac6d1c

@ -1,3 +1,10 @@
2003-06-18 Marcel Telka <marcel@telka.sk>
* flash/cfi.c (read2): Fixed operator precedence in macro.
(cfi_detect): Fixed CFI detection code (based on patch 753295, Matan Ziv-Av).
* flash/intel.c (intel_flash_autodetect8): New function (patch 753295, Matan Ziv-Av).
(intel_8_flash_driver): New driver (patch 753295, Matan Ziv-Av).
2003-06-12 Marcel Telka <marcel@telka.sk>
* flash/amd.c (amd_flash_autodetect, amd_flash_print_info, amd_flash_erase_block)

@ -0,0 +1,3 @@
$Id$
2003-06-18: Added support for 1 x 8 bit Intel Flash (patch 753295, Matan Ziv-Av).

@ -87,29 +87,29 @@ cfi_detect( bus_t *bus, uint32_t adr, cfi_array_t **cfi_array )
#define D(data) ((data) << d)
#define gD(data) (((data) >> d) & 0xFF)
#define read1(off) gD(bus_read( bus, A(off) ))
#define read2(off) (bus_read_start( bus, A(off) ), gD(bus_read_next( bus, A(off + 1) )) | gD(bus_read_end( bus )) << 8)
#define read2(off) (bus_read_start( bus, A(off) ), gD(bus_read_next( bus, A((off) + 1) )) | gD(bus_read_end( bus )) << 8)
#define write1(off,data) bus_write( bus, A(off), D(data) )
cfi_query_structure_t *cfi;
uint32_t tmp;
ma = 1;
int ret = -4; /* CFI not detected (Q) */
/* detect CFI capable devices - see Table 1 in [1] */
write1( CFI_CMD_QUERY_OFFSET, CFI_CMD_QUERY );
for (ma = 1; ma <= 4; ma *= 2) {
write1( CFI_CMD_QUERY_OFFSET, CFI_CMD_QUERY );
if (read1(CFI_QUERY_ID_OFFSET) != 'Q') {
write1( 0, CFI_CMD_READ_ARRAY1 );
return -4; /* CFI not detected (Q) */
}
if (read1(CFI_QUERY_ID_OFFSET) == 'Q') {
ret = -5; /* CFI not detected (R) */
if (read1(CFI_QUERY_ID_OFFSET + 1) == 'R')
break;
}
for (; ma <= 4; ma *= 2)
if (read1(CFI_QUERY_ID_OFFSET + 1) == 'R')
break;
if (ma > 4) {
write1( 0, CFI_CMD_READ_ARRAY1 );
return -5; /* CFI not detected (R) */
}
if (ma > 4)
return ret; /* CFI not detected (Q or R) */
if (read1(CFI_QUERY_ID_OFFSET + 2) != 'Y') {
write1( 0, CFI_CMD_READ_ARRAY1 );
return -6; /* CFI not detected (Y) */

@ -67,6 +67,12 @@ intel_flash_autodetect( cfi_array_t *cfi_array )
return (cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code == CFI_VENDOR_INTEL_ECS) && (bus_width( cfi_array->bus, 0 ) == 16);
}
static int
intel_flash_autodetect8( cfi_array_t *cfi_array )
{
return (cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code == CFI_VENDOR_INTEL_ECS) && (bus_width( cfi_array->bus, 0 ) == 8);
}
static void
_intel_flash_print_info( bus_t *bus, int o )
{
@ -319,3 +325,15 @@ flash_driver_t intel_16_flash_driver = {
intel_flash_program,
intel_flash_readarray,
};
flash_driver_t intel_8_flash_driver = {
1, /* buswidth */
N_("Intel Standard Command Set"),
N_("supported: 28Fxxxx, 1 x 8 bit"),
intel_flash_autodetect8,
intel_flash_print_info,
intel_flash_erase_block,
intel_flash_unlock_block,
intel_flash_program,
intel_flash_readarray,
};

Loading…
Cancel
Save