2004-11-18 Marcel Telka <marcel@telka.sk>

* flash/jedec.c (jedec_detect): Added cfi_array allocation (patch 970946, Ian Campbell).


git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@621 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Marcel Telka 20 years ago
parent 2c8a2a4489
commit a0c23d7d2a

@ -1,3 +1,7 @@
2004-11-18 Marcel Telka <marcel@telka.sk>
* flash/jedec.c (jedec_detect): Added cfi_array allocation (patch 970946, Ian Campbell).
2004-11-15 Marcel Telka <marcel@telka.sk>
* flash/intel.c (_intel_flash_print_info): Added support for Intel 28F256J3A (patch 1012140, Jerome Debard).

@ -1,5 +1,6 @@
$Id$
2004-11-18: Fixed segfault in jedec_detect() (patch 970946, Ian Campbell).
2004-11-15: Added support for Intel 28F256J3A (patch 1012140, Jerome Debard).
2003-11-03: Fixed compile error in jedec_detect (bug 828313, Márton Németh).
2003-11-02: Added support for detecting flashes (detectflash) in full address range.

@ -1,5 +1,6 @@
$Id$
Ian Campbell
Jerome Debard
Bradley D. LaRonde
Andreas Mohr

@ -35,10 +35,32 @@
int
jedec_detect( bus_t *bus, uint32_t adr, cfi_array_t **cfi_array )
{
unsigned int bw; /* bus width */
int ba; /* bus width address multiplier */
bus_area_t area;
int mid;
int did;
cfi_query_structure_t *cfi;
if (!cfi_array || !bus)
return -1; /* invalid parameters */
*cfi_array = calloc( 1, sizeof (cfi_array_t) );
if (!*cfi_array)
return -2; /* out of memory */
(*cfi_array)->bus = bus;
(*cfi_array)->address = 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;
(*cfi_array)->cfi_chips = calloc( ba, sizeof (cfi_chip_t *) );
if (!(*cfi_array)->cfi_chips)
return -2; /* out of memory */
/* Query flash. */
bus_write( bus, 0x0, 0xf0 );
bus_write( bus, 0xaaa, 0xaa );

Loading…
Cancel
Save