summaryrefslogtreecommitdiffstats
path: root/flashrom.c
diff options
context:
space:
mode:
authorStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2012-02-17 14:51:04 +0000
committerStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2012-02-17 14:51:04 +0000
commitac1b4c8bd707c07e9636bedbd823ed5cb46f89ad (patch)
tree5553eec8f0f86f363220a979342d59e3c55eae58 /flashrom.c
parentac427b22c4fa45936fe94af31a5e0422dd95c152 (diff)
downloadast2050-flashrom-ac1b4c8bd707c07e9636bedbd823ed5cb46f89ad.zip
ast2050-flashrom-ac1b4c8bd707c07e9636bedbd823ed5cb46f89ad.tar.gz
Add support for SFDP (JESD216)
Similar to modules using the opaque programmer framework (e.g. ICH Hardware Sequencing) this uses a template struct flashchip element in flashchips.c with a special probe function that fills the obtained values into that struct. This allows yet unknown SPI chips to be supported (read, erase, write) almost as if it was already added to flashchips.c. Documentation used: http://www.jedec.org/standards-documents/docs/jesd216 (2011-04) W25Q32BV data sheet Revision F (2011-04-01) EN25QH16 data sheet Revision F (2011-06-01) MX25L6436E data sheet Revision 1.8 (2011-12-26) Tested-by: David Hendricks <dhendrix@google.com> on W25Q64CV + dediprog Tested-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> on a 2010 MX25L6436E with preliminary (i.e. incorrect) SFDP implementation + serprog Thanks also to Michael Karcher for his comments and preliminary review! Corresponding to flashrom svn r1500. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Diffstat (limited to 'flashrom.c')
-rw-r--r--flashrom.c37
1 files changed, 31 insertions, 6 deletions
diff --git a/flashrom.c b/flashrom.c
index a378e51..cad043b 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -980,13 +980,38 @@ int probe_flash(struct registered_programmer *pgm, int startchip,
/* If this is the first chip found, accept it.
* If this is not the first chip found, accept it only if it is
- * a non-generic match.
- * We could either make chipcount global or provide it as
- * parameter, or we assume that startchip==0 means this call to
- * probe_flash() is the first one and thus no chip has been
- * found before.
+ * a non-generic match. SFDP and CFI are generic matches.
+ * startchip==0 means this call to probe_flash() is the first
+ * one for this programmer interface and thus no other chip has
+ * been found on this interface.
*/
- if (startchip == 0 || fill_flash->model_id != GENERIC_DEVICE_ID)
+ if (startchip == 0 && fill_flash->model_id == SFDP_DEVICE_ID) {
+ msg_cinfo("===\n"
+ "SFDP has autodetected a flash chip which is "
+ "not natively supported by flashrom yet.\n");
+ if (count_usable_erasers(fill_flash) == 0)
+ msg_cinfo("The standard operations read and "
+ "verify should work, but to support "
+ "erase, write and all other "
+ "possible features");
+ else
+ msg_cinfo("All standard operations (read, "
+ "verify, erase and write) should "
+ "work, but to support all possible "
+ "features");
+
+ msg_cinfo(" we need to add them manually.\nYou "
+ "can help us by mailing us the output of "
+ "the following command to flashrom@flashrom."
+ "org: \n'flashrom -VV [plus the "
+ "-p/--programmer parameter (if needed)]"
+ "'\nThanks for your help!\n"
+ "===\n");
+ }
+
+ if (startchip == 0 ||
+ ((fill_flash->model_id != GENERIC_DEVICE_ID) &&
+ (fill_flash->model_id != SFDP_DEVICE_ID)))
break;
notfound:
OpenPOWER on IntegriCloud