summaryrefslogtreecommitdiffstats
path: root/spi25.c
diff options
context:
space:
mode:
authorStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2013-04-19 01:58:33 +0000
committerStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2013-04-19 01:58:33 +0000
commit3f5e35db4b22d36918adc7ee28b0d77ee50af568 (patch)
tree22d04b8a8c66a4f8be377c54b759215f12faf1bf /spi25.c
parente33c40eb7db5dc16763cd7c245578a968306a757 (diff)
downloadast2050-flashrom-3f5e35db4b22d36918adc7ee28b0d77ee50af568.zip
ast2050-flashrom-3f5e35db4b22d36918adc7ee28b0d77ee50af568.tar.gz
Refine PMC Pm25LV series
- Add missing bits and resort chips - Refine Pm25LV512(A) and Pm25LV010 Due to manufacturer ID continuation this one needs a new probing function: probe_spi_res3() which should be refactored in the future. The datasheet describes a very weird order of ID bytes: Vendor byte, model byte, vendor continuation byte. Let's pretend we did not read that or the datasheet is bogus (although the datasheet of the successor series describes the same but luckily additionally to RDID). - Add Pm25LV010A This was tested by Chi Zhang: http://paste.flashrom.org/view.php?id=1573 Corresponding to flashrom svn r1670. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Diffstat (limited to 'spi25.c')
-rw-r--r--spi25.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/spi25.c b/spi25.c
index 911dc4e..a818630 100644
--- a/spi25.c
+++ b/spi25.c
@@ -279,6 +279,26 @@ int probe_spi_res2(struct flashctx *flash)
return 1;
}
+int probe_spi_res3(struct flashctx *flash)
+{
+ unsigned char readarr[3];
+ uint32_t id1, id2;
+
+ if (spi_res(flash, readarr, 3)) {
+ return 0;
+ }
+
+ id1 = (readarr[0] << 8) | readarr[1];
+ id2 = readarr[2];
+
+ msg_cdbg("%s: id1 0x%x, id2 0x%x\n", __func__, id1, id2);
+
+ if (id1 != flash->chip->manufacture_id || id2 != flash->chip->model_id)
+ return 0;
+
+ return 1;
+}
+
/* Only used for some Atmel chips. */
int probe_spi_at25f(struct flashctx *flash)
{
OpenPOWER on IntegriCloud