All "unknown xy SPI chip" entries claim to have status UNTESTED for probe/read/erase/write. That is incorrect.
A bit of confusion comes from how the #defines are named. We call them TEST_BAD_*, but the message printed by flashrom says: "This flash part has status NOT WORKING for operations:"
Something that is unimplemented is definitely not working.
Neither of the chip entries mentioned above has erase or write functions implemented, so erase and write are not working. Since their size is unknown, we can't read them in. That means read is not working as well. Probing is a different matter. If a chip-specific probe function had matched, we wouldn't have to handle the chip with the "unknown xy SPI chip" fallback. I'm tempted to call that "not working" as well, but I'm open to discussion on this point.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: flashrom-generic_is_bad/flash.h =================================================================== --- flashrom-generic_is_bad/flash.h (Revision 3780) +++ flashrom-generic_is_bad/flash.h (Arbeitskopie) @@ -110,6 +110,7 @@ * SPI parts have 16-bit device IDs if they support RDID. */
+#define GENERIC_MANUF_ID 0xffff /* Check if there is a vendor ID */ #define GENERIC_DEVICE_ID 0xffff /* Only match the vendor ID */
#define ALLIANCE_ID 0x52 /* Alliance Semiconductor */ Index: flashrom-generic_is_bad/flashchips.c =================================================================== --- flashrom-generic_is_bad/flashchips.c (Revision 3779) +++ flashrom-generic_is_bad/flashchips.c (Arbeitskopie) @@ -184,12 +184,13 @@ {"Winbond", "W39V080FA", WINBOND_ID, W_39V080FA, 1024, 64*1024, TEST_OK_PREW, probe_winbond_fwhub, erase_winbond_fwhub, write_winbond_fwhub}, {"Winbond", "W39V080FA (dual mode)",WINBOND_ID, W_39V080FA_DM, 512, 64*1024, TEST_UNTESTED, probe_winbond_fwhub, erase_winbond_fwhub, write_winbond_fwhub},
- {"Atmel", "unknown Atmel SPI chip",ATMEL_ID, GENERIC_DEVICE_ID, 0, 256, TEST_UNTESTED, probe_spi_rdid, NULL, NULL}, - {"EON", "unknown EON SPI chip", EON_ID_NOPREFIX,GENERIC_DEVICE_ID, 0, 256, TEST_UNTESTED, probe_spi_rdid, NULL, NULL}, - {"Macronix", "unknown Macronix SPI chip", MX_ID, GENERIC_DEVICE_ID, 0, 256, TEST_UNTESTED, probe_spi_rdid, NULL, NULL}, - {"PMC", "unknown PMC SPI chip", PMC_ID, GENERIC_DEVICE_ID, 0, 256, TEST_UNTESTED, probe_spi_rdid, NULL, NULL}, - {"SST", "unknown SST SPI chip", SST_ID, GENERIC_DEVICE_ID, 0, 256, TEST_UNTESTED, probe_spi_rdid, NULL, NULL}, - {"ST", "unknown ST SPI chip", ST_ID, GENERIC_DEVICE_ID, 0, 256, TEST_UNTESTED, probe_spi_rdid, NULL, NULL}, + {"Atmel", "unknown Atmel SPI chip",ATMEL_ID, GENERIC_DEVICE_ID, 0, 256, TEST_BAD_PREW, probe_spi_rdid, NULL, NULL}, + {"EON", "unknown EON SPI chip", EON_ID_NOPREFIX,GENERIC_DEVICE_ID, 0, 256, TEST_BAD_PREW, probe_spi_rdid, NULL, NULL}, + {"Macronix", "unknown Macronix SPI chip", MX_ID, GENERIC_DEVICE_ID, 0, 256, TEST_BAD_PREW, probe_spi_rdid, NULL, NULL}, + {"PMC", "unknown PMC SPI chip", PMC_ID, GENERIC_DEVICE_ID, 0, 256, TEST_BAD_PREW, probe_spi_rdid, NULL, NULL}, + {"SST", "unknown SST SPI chip", SST_ID, GENERIC_DEVICE_ID, 0, 256, TEST_BAD_PREW, probe_spi_rdid, NULL, NULL}, + {"ST", "unknown ST SPI chip", ST_ID, GENERIC_DEVICE_ID, 0, 256, TEST_BAD_PREW, probe_spi_rdid, NULL, NULL}, + {"Generic", "unknown SPI chip (RDID)",GENERIC_MANUF_ID,GENERIC_DEVICE_ID, 0, 256, TEST_BAD_PREW, probe_spi_rdid, NULL, NULL},
{NULL,} }; Index: flashrom-generic_is_bad/spi.c =================================================================== --- flashrom-generic_is_bad/spi.c (Revision 3779) +++ flashrom-generic_is_bad/spi.c (Arbeitskopie) @@ -143,6 +143,11 @@ GENERIC_DEVICE_ID == flash->model_id) return 1;
+ /* Test if there is any vendor ID. */ + if (GENERIC_MANUF_ID == flash->manufacture_id && + manuf_id != 0xff) + return 1; + return 0; }