See patch. We should also rename w49f002u.c in another patch to something more generic, that code is in no way specific to the w49f002u. Maybe even put the only function in that file (byte-wise JEDEC writes of one page/sector) into jedec.c?
Uwe. -- http://www.hermann-uwe.de | http://www.holsham-traders.de http://www.crazy-hacks.org | http://www.unmaintained-free-software.org
The write_39sf020() and write_49f002() functions are identical except for whitespace differences, so drop one of them. Signed-off-by: Uwe Hermann <[email protected]> Index: sst39sf020.c =================================================================== --- sst39sf020.c (Revision 496) +++ sst39sf020.c (Arbeitskopie) @@ -1,46 +0,0 @@ -/* - * This file is part of the flashrom project. - * - * Copyright (C) 2000 Silicon Integrated System Corporation - * - * 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 <stdio.h> -#include <stdint.h> -#include "flash.h" - -int write_39sf020(struct flashchip *flash, uint8_t *buf) -{ - int i; - int total_size = flash->total_size * 1024; - int page_size = flash->page_size; - volatile uint8_t *bios = flash->virtual_memory; - - erase_chip_jedec(flash); - - printf("Programming page: "); - for (i = 0; i < total_size / page_size; i++) { - /* write to the sector */ - printf("%04d at address: 0x%08x", i, i * page_size); - write_sector_jedec(bios, buf + i * page_size, - bios + i * page_size, page_size); - printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"); - fflush(stdout); - } - printf("\n"); - - return 0; -} Index: flashchips.c =================================================================== --- flashchips.c (Revision 496) +++ flashchips.c (Arbeitskopie) @@ -1322,7 +1322,7 @@ .tested = TEST_OK_PREW, .probe = probe_jedec, .erase = erase_chip_jedec, - .write = write_39sf020, + .write = write_49f002, .read = read_memmapped, }, @@ -1336,7 +1336,7 @@ .tested = TEST_OK_PREW, .probe = probe_jedec, .erase = erase_chip_jedec, - .write = write_39sf020, + .write = write_49f002, .read = read_memmapped, }, @@ -1350,7 +1350,7 @@ .tested = TEST_OK_PREW, .probe = probe_jedec, .erase = erase_chip_jedec, - .write = write_39sf020, + .write = write_49f002, .read = read_memmapped, }, @@ -1364,7 +1364,7 @@ .tested = TEST_UNTESTED, .probe = probe_jedec, .erase = erase_chip_jedec, - .write = write_39sf020, + .write = write_49f002, .read = read_memmapped, }, @@ -1378,7 +1378,7 @@ .tested = TEST_UNTESTED, .probe = probe_jedec, .erase = erase_chip_jedec, - .write = write_39sf020, + .write = write_49f002, .read = read_memmapped, }, @@ -1392,7 +1392,7 @@ .tested = TEST_OK_PREW, .probe = probe_jedec, .erase = erase_chip_jedec, - .write = write_39sf020, + .write = write_49f002, .read = read_memmapped, }, @@ -1406,7 +1406,7 @@ .tested = TEST_OK_PROBE, .probe = probe_jedec, .erase = erase_chip_jedec, - .write = write_39sf020, + .write = write_49f002, .read = read_memmapped, }, @@ -1420,7 +1420,7 @@ .tested = TEST_UNTESTED, .probe = probe_jedec, .erase = erase_chip_jedec, - .write = write_39sf020, + .write = write_49f002, .read = read_memmapped, }, @@ -2134,7 +2134,7 @@ .tested = TEST_UNTESTED, .probe = probe_jedec, .erase = erase_chip_jedec, - .write = write_39sf020, + .write = write_49f002, .read = read_memmapped, }, @@ -2148,7 +2148,7 @@ .tested = TEST_OK_PREW, .probe = probe_jedec, .erase = erase_chip_jedec, - .write = write_39sf020, + .write = write_49f002, .read = read_memmapped, }, @@ -2176,7 +2176,7 @@ .tested = TEST_OK_PREW, .probe = probe_jedec, .erase = erase_chip_jedec, - .write = write_39sf020, + .write = write_49f002, .read = read_memmapped, }, @@ -2190,7 +2190,7 @@ .tested = TEST_OK_PREW, .probe = probe_jedec, .erase = erase_chip_jedec, - .write = write_39sf020, + .write = write_49f002, .read = read_memmapped, }, Index: Makefile =================================================================== --- Makefile (Revision 496) +++ Makefile (Arbeitskopie) @@ -30,7 +30,7 @@ LDFLAGS += -lpci -lz OBJS = chipset_enable.o board_enable.o udelay.o jedec.o stm50flw0x0x.o \ - sst28sf040.o am29f040b.o mx29f002.o sst39sf020.o m29f400bt.o \ + sst28sf040.o am29f040b.o mx29f002.o m29f400bt.o \ 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 \ Index: w49f002u.c =================================================================== --- w49f002u.c (Revision 496) +++ w49f002u.c (Arbeitskopie) @@ -32,8 +32,8 @@ printf("Programming page: "); for (i = 0; i < total_size / page_size; i++) { - /* write to the sector */ printf("%04d at address: 0x%08x ", i, i * page_size); + /* Byte-wise writing of 'page_size' bytes. */ write_sector_jedec(bios, buf + i * page_size, bios + i * page_size, page_size); printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
-- coreboot mailing list: [email protected] http://www.coreboot.org/mailman/listinfo/coreboot

