Author: uwe
Date: 2009-06-14 23:53:26 +0200 (Sun, 14 Jun 2009)
New Revision: 590

Added:
   trunk/pm29f002.c
Modified:
   trunk/Makefile
   trunk/flash.h
   trunk/flashchips.c
Log:
Add support for the PMC Pm29F002T/B chips.

I sucessfully tested all operations on a Pm29F002T chip. The Pm29F002B is
untested but I assume it should also work.

Signed-off-by: Uwe Hermann <[email protected]>
Acked-by: Carl-Daniel Hailfinger <[email protected]>



Modified: trunk/Makefile
===================================================================
--- trunk/Makefile      2009-06-13 12:04:03 UTC (rev 589)
+++ trunk/Makefile      2009-06-14 21:53:26 UTC (rev 590)
@@ -43,7 +43,7 @@
 LIBS += -lpci -lz
 
 OBJS = chipset_enable.o board_enable.o udelay.o jedec.o stm50flw0x0x.o \
-       sst28sf040.o am29f040b.o mx29f002.o m29f400bt.o \
+       sst28sf040.o am29f040b.o mx29f002.o m29f400bt.o pm29f002.c \
        w49f002u.o 82802ab.o pm49fl00x.o sst49lf040.o en29f002a.o \
        sst49lfxxxc.o sst_fwhub.o layout.o cbtable.o flashchips.o physmap.o \
        flashrom.o w39v080fa.o sharplhf00l04.o w29ee011.o spi.o it87spi.o \

Modified: trunk/flash.h
===================================================================
--- trunk/flash.h       2009-06-13 12:04:03 UTC (rev 589)
+++ trunk/flash.h       2009-06-14 21:53:26 UTC (rev 590)
@@ -453,6 +453,8 @@
 #define PMC_25LV040            0x7E
 #define PMC_25LV080B           0x13
 #define PMC_25LV016B           0x14
+#define PMC_29F002T            0x1D
+#define PMC_29F002B            0x2D
 #define PMC_39LV512            0x1B
 #define PMC_39F010             0x1C    /* also Pm39LV010 */
 #define PMC_39LV020            0x3D
@@ -783,6 +785,9 @@
 int erase_29f040b(struct flashchip *flash);
 int write_29f040b(struct flashchip *flash, uint8_t *buf);
 
+/* pm29f002.c */
+int write_pm29f002(struct flashchip *flash, uint8_t *buf);
+
 /* en29f002a.c */
 int probe_en29f002a(struct flashchip *flash);
 int erase_en29f002a(struct flashchip *flash);

Modified: trunk/flashchips.c
===================================================================
--- trunk/flashchips.c  2009-06-13 12:04:03 UTC (rev 589)
+++ trunk/flashchips.c  2009-06-14 21:53:26 UTC (rev 590)
@@ -1514,6 +1514,38 @@
 
        {
                .vendor         = "PMC",
+               .name           = "Pm29F0002T",
+               .bustype        = CHIP_BUSTYPE_PARALLEL,
+               .manufacture_id = PMC_ID_NOPREFIX,
+               .model_id       = PMC_29F002T,
+               .total_size     = 256,
+               .page_size      = 8192,
+               .tested         = TEST_OK_PREW,
+               .probe          = probe_29f040b,
+               .probe_timing   = TIMING_FIXME, 
+               .erase          = erase_29f040b,
+               .write          = write_pm29f002,
+               .read           = read_memmapped,
+       },
+
+       {
+               .vendor         = "PMC",
+               .name           = "Pm29F0002B",
+               .bustype        = CHIP_BUSTYPE_PARALLEL,
+               .manufacture_id = PMC_ID_NOPREFIX,
+               .model_id       = PMC_29F002B,
+               .total_size     = 256,
+               .page_size      = 8192,
+               .tested         = TEST_UNTESTED,
+               .probe          = probe_29f040b,
+               .probe_timing   = TIMING_FIXME, 
+               .erase          = erase_29f040b,
+               .write          = write_pm29f002,
+               .read           = read_memmapped,
+       },
+
+       {
+               .vendor         = "PMC",
                .name           = "Pm39LV010",
                .bustype        = CHIP_BUSTYPE_NONSPI,
                .manufacture_id = PMC_ID_NOPREFIX,

Added: trunk/pm29f002.c
===================================================================
--- trunk/pm29f002.c                            (rev 0)
+++ trunk/pm29f002.c    2009-06-14 21:53:26 UTC (rev 590)
@@ -0,0 +1,53 @@
+/*
+ * This file is part of the flashrom project.
+ *
+ * Copyright (C) 2009 Uwe Hermann <[email protected]>
+ *
+ * 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 write_pm29f002(struct flashchip *flash, uint8_t *buf)
+{
+       int i, total_size = flash->total_size * 1024;
+       chipaddr bios = flash->virtual_memory;
+       chipaddr dst = bios;
+
+       /* Pm29F002T/B use the same erase method... */
+       erase_29f040b(flash);
+
+       printf("Programming page: ");
+       for (i = 0; i < total_size; i++) {
+               if ((i & 0xfff) == 0)
+                       printf("address: 0x%08lx", (unsigned long)i);
+
+               /* Pm29F002T/B only support byte-wise programming. */
+               chip_writeb(0xAA, bios + 0x555);
+               chip_writeb(0x55, bios + 0x2AA);
+               chip_writeb(0xA0, bios + 0x555);
+               chip_writeb(*buf++, dst++);
+
+               /* Wait for Toggle bit ready. */
+               toggle_ready_jedec(dst);
+
+               if ((i & 0xfff) == 0)
+                       printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
+       }
+
+       printf("\n");
+
+       return 0;
+}


-- 
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to