2003-08-28 Marcel Telka <marcel@telka.sk>

* flash/cfi.c (cfi_detect): Replaced bus_width macro with new bus_area.
	* flash/intel.c (intel_flash_autodetect32, intel_flash_autodetect, intel_flash_autodetect8): Ditto.


git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@550 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Marcel Telka 22 years ago
parent 428bd8123f
commit 44ec2fc697

@ -1,3 +1,8 @@
2003-08-28 Marcel Telka <marcel@telka.sk>
* flash/cfi.c (cfi_detect): Replaced bus_width macro with new bus_area.
* flash/intel.c (intel_flash_autodetect32, intel_flash_autodetect, intel_flash_autodetect8): Ditto.
2003-08-27 Marcel Telka <marcel@telka.sk>
* flash/amd.c: Changed included headers.

@ -66,6 +66,7 @@ cfi_detect( bus_t *bus, uint32_t adr, cfi_array_t **cfi_array )
unsigned int d; /* data offset */
int ba; /* bus width address multiplier */
int ma; /* flash mode address multiplier */
bus_area_t area;
if (!cfi_array || !bus)
return -1; /* invalid parameters */
@ -76,7 +77,9 @@ cfi_detect( bus_t *bus, uint32_t adr, cfi_array_t **cfi_array )
(*cfi_array)->bus = bus;
(*cfi_array)->address = adr;
bw = bus_width( bus, adr );
if (bus_area( bus, adr, &area ) != 0)
return -8; /* bus width detection failed */
bw = area.width;
if (bw != 8 && bw != 16 && bw != 32)
return -3; /* invalid bus width */
(*cfi_array)->bus_width = ba = bw / 8;

@ -57,25 +57,40 @@ static int intel_flash_program32( cfi_array_t *cfi_array, uint32_t adr, uint32_t
static int
intel_flash_autodetect32( cfi_array_t *cfi_array )
{
bus_area_t area;
if (bus_area( cfi_array->bus, 0, &area ) != 0)
return 0;
return ((cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code == CFI_VENDOR_INTEL_ECS)
|| (cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code == CFI_VENDOR_INTEL_SCS))
&& (bus_width( cfi_array->bus, 0 ) == 32);
&& (area.width == 32);
}
static int
intel_flash_autodetect( cfi_array_t *cfi_array )
{
bus_area_t area;
if (bus_area( cfi_array->bus, 0, &area ) != 0)
return 0;
return ((cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code == CFI_VENDOR_INTEL_ECS)
|| (cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code == CFI_VENDOR_INTEL_SCS))
&& (bus_width( cfi_array->bus, 0 ) == 16);
&& (area.width == 16);
}
static int
intel_flash_autodetect8( cfi_array_t *cfi_array )
{
bus_area_t area;
if (bus_area( cfi_array->bus, 0, &area ) != 0)
return 0;
return ((cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code == CFI_VENDOR_INTEL_ECS)
|| (cfi_array->cfi_chips[0]->cfi.identification_string.pri_id_code == CFI_VENDOR_INTEL_SCS))
&& (bus_width( cfi_array->bus, 0 ) == 8);
&& (area.width == 8);
}
static void

Loading…
Cancel
Save