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

* flash/amd.c (amd_flash_autodetect): Function renamed ...
	(amd_flash_autodetect32): ... to this one (patch 772499, Matan Ziv-Av).
	(amd_flash_autodetect8): New function (patch 772499, Matan Ziv-Av).
	(amdstatus29, amdisprotected, amd_flash_print_info, amd_flash_erase_block, amd_flash_program): Local
		variable 'o' becomes global (patch 772499, Matan Ziv-Av).
	(amd_8_flash_driver): Added new driver (patch 772499, Matan Ziv-Av).


git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@498 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Marcel Telka 22 years ago
parent 7cca05a558
commit 266b12cac6

@ -1,3 +1,12 @@
2003-06-18 Marcel Telka <marcel@telka.sk>
* flash/amd.c (amd_flash_autodetect): Function renamed ...
(amd_flash_autodetect32): ... to this one (patch 772499, Matan Ziv-Av).
(amd_flash_autodetect8): New function (patch 772499, Matan Ziv-Av).
(amdstatus29, amdisprotected, amd_flash_print_info, amd_flash_erase_block, amd_flash_program): Local
variable 'o' becomes global (patch 772499, Matan Ziv-Av).
(amd_8_flash_driver): Added new driver (patch 772499, Matan Ziv-Av).
2003-06-18 Marcel Telka <marcel@telka.sk>
* flash/cfi.c (read2): Fixed operator precedence in macro.

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

@ -52,13 +52,24 @@ static int amd_flash_unlock_block( cfi_array_t *cfi_array, uint32_t adr );
static int amd_flash_program( cfi_array_t *cfi_array, uint32_t adr, uint32_t data );
static void amd_flash_read_array( cfi_array_t *cfi_array );
static int o;
/* autodetect, we can handle this chip */
static int
amd_flash_autodetect( cfi_array_t *cfi_array )
amd_flash_autodetect32( cfi_array_t *cfi_array )
{
if(cfi_array->bus_width != 4) return 0;
o = 2; /* Heuristic */
return (cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code == CFI_VENDOR_AMD_SCS);
}
static int
amd_flash_autodetect8( cfi_array_t *cfi_array )
{
if(cfi_array->bus_width != 1) return 0;
o = 1; /* Heuristic */
return (cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code == CFI_VENDOR_AMD_SCS);
}
/*
* check device status
* 1/true PASS
@ -71,7 +82,6 @@ amd_flash_autodetect( cfi_array_t *cfi_array )
static int
amdstatus29( parts *ps, uint32_t adr, uint32_t data )
{
int o = 2;
int timeout;
uint32_t dq7mask = ((1 << 7) << 16) + (1 << 7);
uint32_t dq5mask = ((1 << 5) << 16) + (1 << 5);
@ -134,7 +144,6 @@ static int
amdisprotected( parts *ps, uint32_t adr )
{
uint32_t data;
int o = 2;
bus_write( ps, 0x0555 << o, 0x00aa00aa ); /* autoselect p29, sector erase */
bus_write( ps, 0x02aa << o, 0x00550055 );
@ -151,7 +160,6 @@ amdisprotected( parts *ps, uint32_t adr )
static void
amd_flash_print_info( cfi_array_t *cfi_array )
{
int o = 2;
int mid, cid, prot;
bus_t *bus = cfi_array->bus;
@ -186,7 +194,6 @@ amd_flash_print_info( cfi_array_t *cfi_array )
static int
amd_flash_erase_block( cfi_array_t *cfi_array, uint32_t adr )
{
int o = 2;
bus_t *bus = cfi_array->bus;
printf("flash_erase_block 0x%08X\n", adr);
@ -222,7 +229,6 @@ amd_flash_unlock_block( cfi_array_t *cfi_array, uint32_t adr )
static int
amd_flash_program( cfi_array_t *cfi_array, uint32_t adr, uint32_t data )
{
int o = 2;
int status;
bus_t *bus = cfi_array->bus;
@ -251,7 +257,19 @@ flash_driver_t amd_32_flash_driver = {
4, /* buswidth */
N_("AMD/Fujitsu Standard Command Set"),
N_("supported: AMD 29LV640D, 29LV641D, 29LV642D; 2x16 Bit"),
amd_flash_autodetect,
amd_flash_autodetect32,
amd_flash_print_info,
amd_flash_erase_block,
amd_flash_unlock_block,
amd_flash_program,
amd_flash_read_array,
};
flash_driver_t amd_8_flash_driver = {
1, /* buswidth */
N_("AMD/Fujitsu Standard Command Set"),
N_("supported: AMD 29LV160; 1x8 Bit"),
amd_flash_autodetect8,
amd_flash_print_info,
amd_flash_erase_block,
amd_flash_unlock_block,

Loading…
Cancel
Save