Added new jedec_exp detection, just for debug (no actual detection, just printf); disabled by default

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1020 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Kolja Waschk 17 years ago
parent 2c09aaca2c
commit 63c961420d

@ -1,5 +1,8 @@
2008-02-15 Kolja Waschk <kawk>
* src/flash/Makefile.am, src/flash/jedec_exp.c, src/flash/detectflash.c,
configure.ac: Experimental new code for flash detection, to be enabled
during configuration with --enable-jedec-exp (disabled by default)
* src/bus/s3c4510x.c: disable debug output (was enabled in 929..)
* include/register.h, src/tap/register.c, src/discovery.c: report if tdo
seems to be stuck during detect_register_size (ie. "detect").

@ -395,6 +395,21 @@ AS_IF([test "x$conservative_flush" = xtrue], [
AC_DEFINE(CONSERVATIVE_FLUSH, 1, [define if conservative queue flushing is enabled])
])
dnl Enable experimental brute-force JEDEC flash autodetection?
AC_ARG_ENABLE(jedec-exp,
[ --enable-jedec-exp Enable experimental JEDEC flash detection],
[case "${enableval}" in
yes) jedecexp=true ;;
no) jedecexp=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-jedec-exp) ;;
esac],
[jedecexp=false])
AS_IF([test "x$jedecexp" = xtrue], [
AM_CONDITIONAL(JEDEC_EXP, true)
AC_DEFINE(JEDEC_EXP, 1, [define if experimental JEDEC flash detection is enabled])
],[
AM_CONDITIONAL(JEDEC_EXP, false)
])
AC_OUTPUT

@ -32,3 +32,9 @@ libflash_a_SOURCES = \
detectflash.c \
intel.c \
jedec.c
if JEDEC_EXP
libflash_a_SOURCES += \
jedec_exp.c
endif

@ -41,6 +41,7 @@
cfi_array_t *cfi_array = NULL;
extern int jedec_exp_detect( bus_t *bus, uint32_t adr, cfi_array_t **cfi_array );
extern int jedec_detect( bus_t *bus, uint32_t adr, cfi_array_t **cfi_array );
extern int amd_detect(bus_t *bus, uint32_t adr, cfi_array_t **cfi_array ); //Ajith
@ -66,17 +67,27 @@ detectflash( bus_t *bus, uint32_t adr )
cfi_array = NULL;
if (jedec_detect( bus, adr, &cfi_array ) != 0) {
cfi_array_free( cfi_array );
cfi_array = NULL;
if(amd_detect(bus, adr, &cfi_array ) != 0)
{
cfi_array_free( cfi_array );
cfi_array->bus_width = 1;
cfi_array = NULL;
printf( _("Flash not found!\n") );
return;
#ifdef JEDEC_EXP
if (jedec_exp_detect( bus, adr, &cfi_array )) {
cfi_array_free( cfi_array );
cfi_array = NULL;
}
#endif
}
}
}
if (cfi_array == NULL)
{
printf( _("Flash not found!\n") );
return;
}
cfi = &cfi_array->cfi_chips[0]->cfi;
/* detect CFI capable devices */

Loading…
Cancel
Save