Add support for the Winbond W29EE011.
authorMarkus Boas <ryven@ryven.de>
Thu, 30 Aug 2007 10:17:50 +0000 (10:17 +0000)
committerUwe Hermann <uwe@hermann-uwe.de>
Thu, 30 Aug 2007 10:17:50 +0000 (10:17 +0000)
Signed-off-by: Markus Boas <ryven@ryven.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2753 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

util/flashrom/Makefile
util/flashrom/README
util/flashrom/flash.h
util/flashrom/flashchips.c
util/flashrom/w29ee011.c [new file with mode: 0644]

index fbae239799531487cbd4df3d3cede76ab214aae3..c6d810842c103aed82374105d06e7467d8c73cdc 100644 (file)
@@ -24,7 +24,7 @@ OBJS = chipset_enable.o board_enable.o udelay.o jedec.o sst28sf040.o \
        am29f040b.o mx29f002.o sst39sf020.o m29f400bt.o w49f002u.o \
        82802ab.o msys_doc.o pm49fl004.o sst49lf040.o sst49lfxxxc.o \
        sst_fwhub.o layout.o lbtable.o flashchips.o flashrom.o \
-       sharplhf00l04.o
+       sharplhf00l04.o w29ee011.o
 
 all: pciutils dep $(PROGRAM)
 
index 06b58032e3a0dbb043e196dda4d2b9d1f1519458..7e44d28759dd547fb2881813380d94fab7d4833b 100644 (file)
@@ -150,6 +150,7 @@ SyncMOS S29C31004T
 Winbond W29C011
 Winbond W29C020C
 Winbond W29C040P
+Winbond W29EE011
 Winbond W49F002U
 Winbond W49V002A
 Winbond W49V002FA
index 850bf33a2f9e8d32121a0f5a7ded0486653cac1f..6acbb434d69eba3a81a1b7a1802b84b8494606e9 100644 (file)
@@ -102,6 +102,7 @@ extern struct flashchip flashchips[];
 #define W_29C011               0xC1
 #define W_29C020C              0x45
 #define W_29C040P              0x46
+#define W_29EE011              0xC1
 #define W_39V040FA             0x34
 #define W_39V040A              0x3D
 #define W_39V040B              0x54
@@ -260,6 +261,9 @@ extern int probe_sst_fwhub(struct flashchip *flash);
 extern int erase_sst_fwhub(struct flashchip *flash);
 extern int write_sst_fwhub(struct flashchip *flash, uint8_t *buf);
 
+/* w29ee011.c */
+extern int probe_w29ee011(struct flashchip *flash);
+
 /* w49f002u.c */
 extern int write_49f002(struct flashchip *flash, uint8_t *buf);
 
index 291530794e19d45a6350a638b3812e678d2cda53..dba8774b32ddeba6fa5b5990fdab69e80d712abb 100644 (file)
@@ -86,6 +86,8 @@ struct flashchip flashchips[] = {
         probe_jedec,   erase_chip_jedec, write_jedec},
        {"W29C020C",    WINBOND_ID,     W_29C020C,      256, 128,
         probe_jedec,   erase_chip_jedec, write_jedec},
+       {"W29EE011",    WINBOND_ID,     W_29C011,       128, 128,
+        probe_w29ee011,erase_chip_jedec, write_jedec},
        {"W49F002U",    WINBOND_ID,     W_49F002U,      256, 128,
         probe_jedec,   erase_chip_jedec, write_49f002},
        {"W49V002A",    WINBOND_ID,     W_49V002A,      256, 128,
diff --git a/util/flashrom/w29ee011.c b/util/flashrom/w29ee011.c
new file mode 100644 (file)
index 0000000..88a7a8a
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * This file is part of the flashrom project.
+ *
+ * Copyright (C) 2007 Markus Boas <ryven@ryven.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+#include "flash.h"
+
+int probe_w29ee011(struct flashchip *flash)
+{
+       volatile uint8_t *bios = flash->virtual_memory;
+       uint8_t id1, id2;
+
+       /* Issue JEDEC Product ID Entry command */
+       *(volatile uint8_t *)(bios + 0x5555) = 0xAA;
+       myusec_delay(10);
+       *(volatile uint8_t *)(bios + 0x2AAA) = 0x55;
+       myusec_delay(10);
+       *(volatile uint8_t *)(bios + 0x5555) = 0x80;
+       myusec_delay(10);
+       *(volatile uint8_t *)(bios + 0x5555) = 0xAA;
+       myusec_delay(10);
+       *(volatile uint8_t *)(bios + 0x2AAA) = 0x55;
+       myusec_delay(10);
+       *(volatile uint8_t *)(bios + 0x5555) = 0x60;
+       myusec_delay(10);
+
+       /* Read product ID */
+       id1 = *(volatile uint8_t *)bios;
+       id2 = *(volatile uint8_t *)(bios + 0x01);
+
+       /* Issue JEDEC Product ID Exit command */
+       *(volatile uint8_t *)(bios + 0x5555) = 0xAA;
+       myusec_delay(10);
+       *(volatile uint8_t *)(bios + 0x2AAA) = 0x55;
+       myusec_delay(10);
+       *(volatile uint8_t *)(bios + 0x5555) = 0xF0;
+       myusec_delay(10);
+
+       printf_debug("%s: id1 0x%x, id2 0x%x\n", __FUNCTION__, id1, id2);
+
+       if (id1 == flash->manufacture_id && id2 == flash->model_id)
+               return 1;
+
+       return 0;
+}