Author: hailfinger Date: 2009-06-03 16:46:22 +0200 (Wed, 03 Jun 2009) New Revision: 569
Modified: trunk/flash.h trunk/flashchips.c trunk/jedec.c Log: Add probe_timing information (int uS value). This eliminates the conflicting delay requirements for old and new chips with the same probing sequence.
Signed-Off-by: Maciej Pijanka maciej.pijanka@gmail.com Acked-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Modified: trunk/flash.h =================================================================== --- trunk/flash.h 2009-06-03 07:50:39 UTC (rev 568) +++ trunk/flash.h 2009-06-03 14:46:22 UTC (rev 569) @@ -155,6 +155,9 @@ uint32_t tested;
int (*probe) (struct flashchip *flash); + + /* Delay after "enter/exit ID mode" commands in microseconds. */ + int probe_timing; int (*erase) (struct flashchip *flash); int (*write) (struct flashchip *flash, uint8_t *buf); int (*read) (struct flashchip *flash, uint8_t *buf); @@ -182,6 +185,16 @@ #define TEST_BAD_PREW (TEST_BAD_PROBE | TEST_BAD_READ | TEST_BAD_ERASE | TEST_BAD_WRITE) #define TEST_BAD_MASK 0xf0
+/* Timing used in probe routines. ZERO is -2 to differentiate between an unset + * field and zero delay. + * + * SPI devices will always have zero delay and ignore this field. + */ +#define TIMING_FIXME -1 +/* this is intentionally same value as fixme */ +#define TIMING_IGNORED -1 +#define TIMING_ZERO -2 + extern struct flashchip flashchips[];
struct penable {
Modified: trunk/flashchips.c =================================================================== --- trunk/flashchips.c 2009-06-03 07:50:39 UTC (rev 568) +++ trunk/flashchips.c 2009-06-03 14:46:22 UTC (rev 569) @@ -32,9 +32,10 @@ struct flashchip flashchips[] = {
/* Vendor, Chip, Vendor ID, Chip ID, + * Bus Type, * Total size (kB), Page size (B), * Test status, - * Probe function, Erase function, Write function, Read function + * Probe function, Probe function timing argument, Erase function, Write function, Read function */
{ @@ -47,6 +48,7 @@ .page_size = 256, .tested = TEST_UNTESTED, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_en29f002a, .read = read_memmapped, @@ -62,6 +64,7 @@ .page_size = 256, .tested = TEST_OK_PREW, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_en29f002a, .read = read_memmapped, @@ -77,6 +80,7 @@ .page_size = 64 * 1024, .tested = TEST_UNTESTED, .probe = probe_29f040b, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (am29f040b.c) */ .erase = erase_29f040b, .write = write_29f040b, .read = read_memmapped, @@ -92,6 +96,7 @@ .page_size = 64 * 1024, .tested = TEST_OK_PREW, .probe = probe_29f040b, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (am29f040b.c) */ .erase = erase_29f040b, .write = write_29f040b, .read = read_memmapped, @@ -107,6 +112,7 @@ .page_size = 64 * 1024, .tested = TEST_UNTESTED, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_29f040b, .write = write_29f040b, .read = read_memmapped, @@ -122,6 +128,7 @@ .page_size = 64 * 1024, .tested = TEST_UNTESTED, .probe = probe_29f040b, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (am29f040b.c) */ .erase = erase_29f040b, .write = write_29f040b, .read = read_memmapped, @@ -137,6 +144,7 @@ .page_size = 64 * 1024, .tested = TEST_UNTESTED, .probe = probe_29f040b, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (am29f040b.c) */ .erase = erase_29f040b, .write = write_29f040b, .read = read_memmapped, @@ -152,6 +160,7 @@ .page_size = 128, .tested = TEST_UNTESTED, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_jedec, .read = read_memmapped, @@ -407,7 +416,8 @@ .total_size = 64, .page_size = 128, .tested = TEST_OK_PREW, - .probe = probe_jedec, + .probe = probe_jedec, + .probe_timing = 10000, /* 10mS, Enter=Exec */ .erase = erase_chip_jedec, .write = write_jedec, .read = read_memmapped, @@ -424,6 +434,7 @@ .page_size = 128, .tested = TEST_OK_PRE, .probe = probe_jedec, + .probe_timing = 10000, /* 10mS, Enter=Exec */ .erase = erase_chip_jedec, .write = write_jedec, /* FIXME */ .read = read_memmapped, @@ -439,6 +450,7 @@ .page_size = 256, .tested = TEST_OK_PREW, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_jedec, .read = read_memmapped, @@ -454,6 +466,7 @@ .page_size = 256, .tested = TEST_UNTESTED, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_jedec, .read = read_memmapped, @@ -604,6 +617,7 @@ .page_size = 64, .tested = TEST_OK_PREW, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_49f002, .read = read_memmapped, @@ -619,6 +633,7 @@ .page_size = 256, .tested = TEST_UNTESTED, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, /* doc1008.pdf dont says anything about probe timing */ .erase = erase_chip_jedec, .write = write_49f002, .read = read_memmapped, @@ -634,6 +649,7 @@ .page_size = 256, .tested = TEST_OK_PREW, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, /* doc1008.pdf dont says anything about probe timing */ .erase = erase_chip_jedec, .write = write_49f002, .read = read_memmapped, @@ -664,6 +680,7 @@ .page_size = 64 * 1024, .tested = TEST_UNTESTED, .probe = probe_29f002, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (mx29f002.c) */ .erase = erase_29f002, .write = write_29f002, .read = read_memmapped, @@ -679,6 +696,7 @@ .page_size = 64 * 1024, .tested = TEST_OK_PREW, .probe = probe_29f002, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (mx29f002.c) */ .erase = erase_29f002, .write = write_29f002, .read = read_memmapped, @@ -694,6 +712,7 @@ .page_size = 64 * 1024, .tested = TEST_OK_PR, .probe = probe_29f040b, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (am29f040b.c) */ .erase = erase_29f040b, .write = write_29f040b, .read = read_memmapped, @@ -709,6 +728,7 @@ .page_size = 64 * 1024, .tested = TEST_OK_PREW, .probe = probe_49fl00x, + .probe_timing = TIMING_FIXME, /* routine is wrapper to probe_jedec (pm49fl00x.c) */ .erase = erase_49fl00x, .write = write_49fl00x, .read = read_memmapped, @@ -724,6 +744,7 @@ .page_size = 4096, .tested = TEST_UNTESTED, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_49f002, .read = read_memmapped, @@ -739,6 +760,7 @@ .page_size = 256, .tested = TEST_UNTESTED, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_en29f002a, .read = read_memmapped, @@ -754,6 +776,7 @@ .page_size = 256, .tested = TEST_OK_PREW, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_en29f002a, .read = read_memmapped, @@ -769,6 +792,7 @@ .page_size = 64 * 1024, .tested = TEST_UNTESTED, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = NULL, .write = NULL, .read = read_memmapped, @@ -784,6 +808,7 @@ .page_size = 64 * 1024, .tested = TEST_UNTESTED, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = NULL, .write = NULL, .read = read_memmapped, @@ -799,6 +824,7 @@ .page_size = 64 * 1024, .tested = TEST_UNTESTED, .probe = probe_m29f400bt, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (m29f400bt.c) */ .erase = erase_m29f400bt, .write = write_coreboot_m29f400bt, .read = read_memmapped, @@ -814,6 +840,7 @@ .page_size = 64 * 1024, .tested = TEST_UNTESTED, .probe = probe_m29f400bt, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (m29f400bt.c) */ .erase = erase_m29f400bt, .write = write_coreboot_m29f400bt, .read = read_memmapped, @@ -829,6 +856,7 @@ .page_size = 128 * 1024, /* 8k + 2x4k + 112k */ .tested = TEST_BAD_ERASE|TEST_BAD_WRITE, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = NULL, .write = NULL, .read = read_memmapped, @@ -844,6 +872,7 @@ .page_size = 128 * 1024, /* 112k + 2x4k + 8k */ .tested = TEST_OK_PR|TEST_BAD_ERASE|TEST_BAD_WRITE, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = NULL, .write = NULL, .read = read_memmapped, @@ -1054,6 +1083,7 @@ .page_size = 64 * 1024, .tested = TEST_UNTESTED, .probe = probe_29f002, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (mx29f002.c) */ .erase = erase_29f002, .write = write_29f002, .read = read_memmapped, @@ -1069,6 +1099,7 @@ .page_size = 64 * 1024, .tested = TEST_OK_PREW, .probe = probe_29f002, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (mx29f002.c) */ .erase = erase_29f002, .write = write_29f002, .read = read_memmapped, @@ -1084,6 +1115,7 @@ .page_size = 64 * 1024, .tested = TEST_OK_PR, .probe = probe_29f002, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (mx29f002.c) */ .erase = erase_29f002, .write = write_29f002, .read = read_memmapped, @@ -1264,6 +1296,7 @@ .page_size = 4096, .tested = TEST_OK_PREW, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_49f002, .read = read_memmapped, @@ -1279,6 +1312,7 @@ .page_size = 16 * 1024, .tested = TEST_OK_PREW, .probe = probe_49fl00x, + .probe_timing = TIMING_FIXME, /* routine is wrapper to probe_jedec (pm49fl00x.c) */ .erase = erase_49fl00x, .write = write_49fl00x, .read = read_memmapped, @@ -1294,6 +1328,7 @@ .page_size = 64 * 1024, .tested = TEST_OK_PREW, .probe = probe_49fl00x, + .probe_timing = TIMING_FIXME, /* routine is wrapper to probe_jedec (pm49fl00x.c) */ .erase = erase_49fl00x, .write = write_49fl00x, .read = read_memmapped, @@ -1309,6 +1344,7 @@ .page_size = 64 * 1024, .tested = TEST_UNTESTED, .probe = probe_lhf00l04, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (sharplhf00l04.c) */ .erase = erase_lhf00l04, .write = write_lhf00l04, .read = read_memmapped, @@ -1429,6 +1465,7 @@ .page_size = 256, .tested = TEST_UNTESTED, .probe = probe_28sf040, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (sst28sf040.c) */ .erase = erase_28sf040, .write = write_28sf040, .read = read_memmapped, @@ -1444,6 +1481,7 @@ .page_size = 128, .tested = TEST_OK_PREW, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_jedec, .read = read_memmapped, @@ -1459,6 +1497,7 @@ .page_size = 128, .tested = TEST_UNTESTED, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_jedec, .read = read_memmapped, @@ -1474,6 +1513,7 @@ .page_size = 128, .tested = TEST_OK_PREW, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_jedec, .read = read_memmapped, @@ -1489,6 +1529,7 @@ .page_size = 128, .tested = TEST_UNTESTED, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_jedec, .read = read_memmapped, @@ -1504,6 +1545,7 @@ .page_size = 4096, .tested = TEST_OK_PREW, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_49f002, .read = read_memmapped, @@ -1519,6 +1561,7 @@ .page_size = 4096, .tested = TEST_OK_PREW, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_49f002, .read = read_memmapped, @@ -1534,6 +1577,7 @@ .page_size = 4096, .tested = TEST_OK_PREW, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_49f002, .read = read_memmapped, @@ -1549,6 +1593,7 @@ .page_size = 4096, .tested = TEST_OK_PREW, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_49f002, .read = read_memmapped, @@ -1564,6 +1609,7 @@ .page_size = 4096, .tested = TEST_OK_PREW, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_49f002, .read = read_memmapped, @@ -1579,6 +1625,7 @@ .page_size = 4096, .tested = TEST_OK_PREW, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_49f002, .read = read_memmapped, @@ -1594,6 +1641,7 @@ .page_size = 4096, .tested = TEST_OK_PROBE, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_49f002, .read = read_memmapped, @@ -1609,6 +1657,7 @@ .page_size = 4096, .tested = TEST_UNTESTED, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_49f002, .read = read_memmapped, @@ -1624,6 +1673,7 @@ .page_size = 16 * 1024, .tested = TEST_OK_PREW, .probe = probe_sst_fwhub, + .probe_timing = TIMING_FIXME, /* routine is wrapper to probe_jedec (sst_fwhub.c) */ .erase = erase_sst_fwhub, .write = write_sst_fwhub, .read = read_memmapped, @@ -1639,6 +1689,7 @@ .page_size = 64 * 1024, .tested = TEST_UNTESTED, .probe = probe_sst_fwhub, + .probe_timing = TIMING_FIXME, /* routine is wrapper to probe_jedec (sst_fwhub.c) */ .erase = erase_sst_fwhub, .write = write_sst_fwhub, .read = read_memmapped, @@ -1654,6 +1705,7 @@ .page_size = 64 * 1024, .tested = TEST_OK_PREW, .probe = probe_sst_fwhub, + .probe_timing = TIMING_FIXME, /* routine is wrapper to probe_jedec (sst_fwhub.c) */ .erase = erase_sst_fwhub, .write = write_sst_fwhub, .read = read_memmapped, @@ -1669,6 +1721,7 @@ .page_size = 4 * 1024, .tested = TEST_UNTESTED, .probe = probe_49lfxxxc, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (sst49lfxxxc.c) */ .erase = erase_49lfxxxc, .write = write_49lfxxxc, .read = read_memmapped, @@ -1684,6 +1737,7 @@ .page_size = 64 * 1024, .tested = TEST_OK_PREW, .probe = probe_sst_fwhub, + .probe_timing = TIMING_FIXME, /* routine is wrapper to probe_jedec (sst_fwhub.c) */ .erase = erase_sst_fwhub, .write = write_sst_fwhub, .read = read_memmapped, @@ -1699,6 +1753,7 @@ .page_size = 4 * 1024, .tested = TEST_UNTESTED, .probe = probe_49lfxxxc, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (sst49lfxxxc.c) */ .erase = erase_49lfxxxc, .write = write_49lfxxxc, .read = read_memmapped, @@ -1714,6 +1769,7 @@ .page_size = 4 * 1024, .tested = TEST_OK_PREW, .probe = probe_49lfxxxc, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (sst49lfxxxc.c) */ .erase = erase_49lfxxxc, .write = write_49lfxxxc, .read = read_memmapped, @@ -1729,6 +1785,7 @@ .page_size = 16 * 1024, .tested = TEST_OK_PR, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_49lf040, .write = write_49lf040, .read = read_memmapped, @@ -1744,6 +1801,7 @@ .page_size = 16 * 1024, .tested = TEST_UNTESTED, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_49lf040, .write = write_49lf040, .read = read_memmapped, @@ -1759,6 +1817,7 @@ .page_size = 4096, .tested = TEST_OK_PREW, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_49lf040, .write = write_49lf040, .read = read_memmapped, @@ -1774,6 +1833,7 @@ .page_size = 64 * 1024, .tested = TEST_OK_PREW, .probe = probe_sst_fwhub, + .probe_timing = TIMING_FIXME, /* routine is wrapper to probe_jedec (sst_fwhub.c) */ .erase = erase_sst_fwhub, .write = write_sst_fwhub, .read = read_memmapped, @@ -1789,6 +1849,7 @@ .page_size = 4096, .tested = TEST_OK_PREW, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_49lf040, .write = write_49lf040, .read = read_memmapped, @@ -1804,6 +1865,7 @@ .page_size = 4 * 1024, .tested = TEST_OK_PREW, .probe = probe_49lfxxxc, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (sst49lfxxxc.c) */ .erase = erase_49lfxxxc, .write = write_49lfxxxc, .read = read_memmapped, @@ -1969,6 +2031,7 @@ .page_size = 64 * 1024, .tested = TEST_UNTESTED, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_m29f002, .write = write_m29f002b, .read = read_memmapped, @@ -1984,6 +2047,7 @@ .page_size = 64 * 1024, .tested = TEST_OK_PREW, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_m29f002, .write = write_m29f002t, .read = read_memmapped, @@ -1999,6 +2063,7 @@ .page_size = 64 * 1024, .tested = TEST_OK_PREW, .probe = probe_29f040b, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (am29f040b.c) */ .erase = erase_29f040b, .write = write_29f040b, .read = read_memmapped, @@ -2014,6 +2079,7 @@ .page_size = 64 * 1024, .tested = TEST_UNTESTED, .probe = probe_m29f400bt, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (m29f400bt.c) */ .erase = erase_m29f400bt, .write = write_coreboot_m29f400bt, .read = read_memmapped, @@ -2029,6 +2095,7 @@ .page_size = 16 * 1024, .tested = TEST_UNTESTED, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_jedec, .read = read_memmapped, @@ -2044,6 +2111,7 @@ .page_size = 64 * 1024, .tested = TEST_UNTESTED, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_jedec, .read = read_memmapped, @@ -2059,6 +2127,7 @@ .page_size = 64 * 1024, .tested = TEST_UNTESTED, .probe = probe_stm50flw0x0x, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (stm50flw0x0x.c) */ .erase = erase_stm50flw0x0x, .write = write_stm50flw0x0x, .read = read_memmapped, @@ -2074,6 +2143,7 @@ .page_size = 64 * 1024, .tested = TEST_UNTESTED, .probe = probe_stm50flw0x0x, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (stm50flw0x0x.c) */ .erase = erase_stm50flw0x0x, .write = write_stm50flw0x0x, .read = read_memmapped, @@ -2089,6 +2159,7 @@ .page_size = 64 * 1024, .tested = TEST_OK_PREW, .probe = probe_stm50flw0x0x, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (stm50flw0x0x.c) */ .erase = erase_stm50flw0x0x, .write = write_stm50flw0x0x, .read = read_memmapped, @@ -2104,6 +2175,7 @@ .page_size = 64 * 1024, .tested = TEST_UNTESTED, .probe = probe_stm50flw0x0x, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (stm50flw0x0x.c) */ .erase = erase_stm50flw0x0x, .write = write_stm50flw0x0x, .read = read_memmapped, @@ -2119,6 +2191,7 @@ .page_size = 64 * 1024, .tested = TEST_UNTESTED, .probe = probe_49lfxxxc, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (sst49lfxxxc.c) */ .erase = NULL, .write = NULL, .read = read_memmapped, @@ -2134,6 +2207,7 @@ .page_size = 64 * 1024, .tested = TEST_UNTESTED, .probe = probe_82802ab, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (82802ab.c) */ .erase = erase_82802ab, .write = write_82802ab, .read = read_memmapped, @@ -2149,6 +2223,7 @@ .page_size = 64 * 1024, .tested = TEST_OK_PREW, .probe = probe_82802ab, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (82802ab.c) */ .erase = erase_82802ab, .write = write_82802ab, .read = read_memmapped, @@ -2164,6 +2239,7 @@ .page_size = 64 * 1024, .tested = TEST_OK_PREW, .probe = probe_82802ab, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (82802ab.c) */ .erase = erase_82802ab, .write = write_82802ab, .read = read_memmapped, @@ -2179,6 +2255,7 @@ .page_size = 64 * 1024, .tested = TEST_UNTESTED, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_jedec, .read = read_memmapped, @@ -2194,6 +2271,7 @@ .page_size = 128, .tested = TEST_UNTESTED, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_49f002, .read = read_memmapped, @@ -2209,6 +2287,7 @@ .page_size = 128, .tested = TEST_UNTESTED, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_49f002, .read = read_memmapped, @@ -2224,6 +2303,7 @@ .page_size = 128, .tested = TEST_OK_PREW, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_49f002, .read = read_memmapped, @@ -2239,6 +2319,7 @@ .page_size = 128, .tested = TEST_UNTESTED, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_49f002, .read = read_memmapped, @@ -2254,6 +2335,7 @@ .page_size = 16384, /* Non-uniform sectors */ .tested = TEST_UNTESTED, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = NULL, .write = NULL, .read = read_memmapped, @@ -2269,6 +2351,7 @@ .page_size = 16384, /* Non-uniform sectors */ .tested = TEST_UNTESTED, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = NULL, .write = NULL, .read = read_memmapped, @@ -2344,6 +2427,7 @@ .page_size = 128, .tested = TEST_OK_PREW, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_jedec, .read = read_memmapped, @@ -2359,6 +2443,7 @@ .page_size = 128, .tested = TEST_OK_PREW, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_jedec, .read = read_memmapped, @@ -2374,6 +2459,7 @@ .page_size = 256, .tested = TEST_UNTESTED, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_jedec, .read = read_memmapped, @@ -2389,6 +2475,7 @@ .page_size = 128, .tested = TEST_OK_PREW, .probe = probe_w29ee011, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (w29ee011.c) */ .erase = erase_chip_jedec, .write = write_jedec, .read = read_memmapped, @@ -2404,6 +2491,7 @@ .page_size = 64*1024, .tested = TEST_OK_PREW, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_49f002, .read = read_memmapped, @@ -2419,6 +2507,7 @@ .page_size = 64*1024, .tested = TEST_OK_PREW, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_49f002, .read = read_memmapped, @@ -2434,6 +2523,7 @@ .page_size = 64*1024, .tested = TEST_OK_PREW, .probe = probe_w39v040c, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (w39v040c.c) */ .erase = erase_w39v040c, .write = write_w39v040c, .read = read_memmapped, @@ -2449,6 +2539,7 @@ .page_size = 64*1024, .tested = TEST_OK_PREW, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_49f002, .read = read_memmapped, @@ -2464,6 +2555,7 @@ .page_size = 64*1024, .tested = TEST_OK_PREW, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_49f002, .read = read_memmapped, @@ -2479,6 +2571,7 @@ .page_size = 128, .tested = TEST_OK_PREW, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_49f002, .read = read_memmapped, @@ -2494,6 +2587,7 @@ .page_size = 128, .tested = TEST_OK_PREW, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_49f002, .read = read_memmapped, @@ -2509,6 +2603,7 @@ .page_size = 128, .tested = TEST_UNTESTED, .probe = probe_jedec, + .probe_timing = TIMING_FIXME, .erase = erase_chip_jedec, .write = write_49f002, .read = read_memmapped, @@ -2524,6 +2619,7 @@ .page_size = 64*1024, .tested = TEST_OK_PREW, .probe = probe_winbond_fwhub, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (w39v080fa.c) */ .erase = erase_winbond_fwhub, .write = write_winbond_fwhub, .read = read_memmapped, @@ -2539,6 +2635,7 @@ .page_size = 64*1024, .tested = TEST_UNTESTED, .probe = probe_winbond_fwhub, + .probe_timing = TIMING_IGNORED, /* routine don't use probe_timing (w39v080fa.c) */ .erase = erase_winbond_fwhub, .write = write_winbond_fwhub, .read = read_memmapped,
Modified: trunk/jedec.c =================================================================== --- trunk/jedec.c 2009-06-03 07:50:39 UTC (rev 568) +++ trunk/jedec.c 2009-06-03 14:46:22 UTC (rev 569) @@ -91,7 +91,23 @@ uint8_t id1, id2; uint32_t largeid1, largeid2; uint32_t flashcontent1, flashcontent2; + int probe_timing_enter, probe_timing_exit;
+ if (flash->probe_timing > 0) + probe_timing_enter = probe_timing_exit = flash->probe_timing; + else if (flash->probe_timing == TIMING_ZERO) { /* No delay. */ + probe_timing_enter = probe_timing_exit = 0; + } else if (flash->probe_timing == TIMING_FIXME) { /* == _IGNORED */ + printf_debug("Chip lacks correct probe timing information, " + "using default 10mS/40uS\n"); + probe_timing_enter = 10000; + probe_timing_exit = 40; + } else { + printf("Chip has negative value in probe_timing, failing " + "without chip access\n"); + return 0; + } + /* Issue JEDEC Product ID Entry command */ chip_writeb(0xAA, bios + 0x5555); myusec_delay(10); @@ -101,7 +117,7 @@ /* Older chips may need up to 100 us to respond. The ATMEL 29C020 * needs 10 ms according to the data sheet. */ - myusec_delay(10000); + myusec_delay(probe_timing_enter);
/* Read product ID */ id1 = chip_readb(bios); @@ -127,7 +143,7 @@ chip_writeb(0x55, bios + 0x2AAA); myusec_delay(10); chip_writeb(0xF0, bios + 0x5555); - myusec_delay(40); + myusec_delay(probe_timing_exit);
printf_debug("%s: id1 0x%02x, id2 0x%02x", __FUNCTION__, largeid1, largeid2); if (!oddparity(id1))