mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 15:12:36 +02:00
Patch to remove all references to dead chipdrivers
We also need to 'svn rm' the following files: am29f040b.c en29f002a.c m29f002.c mx29f002.c pm29f002.c sst49lf040.c w49f002u.c Corresponding to flashrom svn r909. Signed-off-by: Sean Nelson <audiohacked@gmail.com> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
This commit is contained in:
parent
ddd5c9e147
commit
c351992895
153
am29f040b.c
153
am29f040b.c
@ -1,153 +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 "flash.h"
|
||||
|
||||
/* FIMXE: Use erase_sector_jedec if not? */
|
||||
int erase_sector_29f040b(struct flashchip *flash, unsigned int address, unsigned int blocklen)
|
||||
{
|
||||
chipaddr bios = flash->virtual_memory;
|
||||
|
||||
chip_writeb(0xAA, bios + 0x555);
|
||||
chip_writeb(0x55, bios + 0x2AA);
|
||||
chip_writeb(0x80, bios + 0x555);
|
||||
chip_writeb(0xAA, bios + 0x555);
|
||||
chip_writeb(0x55, bios + 0x2AA);
|
||||
chip_writeb(0x30, bios + address);
|
||||
|
||||
programmer_delay(10);
|
||||
|
||||
/* wait for Toggle bit ready */
|
||||
toggle_ready_jedec(bios + address);
|
||||
|
||||
if (check_erased_range(flash, address, blocklen)) {
|
||||
fprintf(stderr, "ERASE FAILED!\n");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* erase chip with block_erase() prototype */
|
||||
int erase_chip_29f040b(struct flashchip *flash, unsigned int addr, unsigned int blocklen)
|
||||
{
|
||||
if ((addr != 0) || (blocklen != flash->total_size * 1024)) {
|
||||
fprintf(stderr, "%s called with incorrect arguments\n",
|
||||
__func__);
|
||||
return -1;
|
||||
}
|
||||
return erase_29f040b(flash);
|
||||
}
|
||||
|
||||
/* FIXME: use write_sector_jedec? */
|
||||
static int write_sector_29f040b(chipaddr bios, uint8_t *src, chipaddr dst,
|
||||
unsigned int page_size)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < page_size; i++) {
|
||||
if ((i & 0xfff) == 0xfff)
|
||||
printf("0x%08lx", dst - bios);
|
||||
|
||||
chip_writeb(0xAA, bios + 0x555);
|
||||
chip_writeb(0x55, bios + 0x2AA);
|
||||
chip_writeb(0xA0, bios + 0x555);
|
||||
chip_writeb(*src++, dst++);
|
||||
|
||||
/* wait for Toggle bit ready */
|
||||
toggle_ready_jedec(bios);
|
||||
|
||||
if ((i & 0xfff) == 0xfff)
|
||||
printf("\b\b\b\b\b\b\b\b\b\b");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int probe_29f040b(struct flashchip *flash)
|
||||
{
|
||||
chipaddr bios = flash->virtual_memory;
|
||||
uint8_t id1, id2;
|
||||
|
||||
chip_writeb(0xAA, bios + 0x555);
|
||||
chip_writeb(0x55, bios + 0x2AA);
|
||||
chip_writeb(0x90, bios + 0x555);
|
||||
|
||||
id1 = chip_readb(bios);
|
||||
id2 = chip_readb(bios + 0x01);
|
||||
|
||||
chip_writeb(0xF0, bios);
|
||||
|
||||
programmer_delay(10);
|
||||
|
||||
printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __func__, id1, id2);
|
||||
if (id1 == flash->manufacture_id && id2 == flash->model_id)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* FIXME: use erase_chip_jedec? */
|
||||
int erase_29f040b(struct flashchip *flash)
|
||||
{
|
||||
int total_size = flash->total_size * 1024;
|
||||
chipaddr bios = flash->virtual_memory;
|
||||
|
||||
chip_writeb(0xAA, bios + 0x555);
|
||||
chip_writeb(0x55, bios + 0x2AA);
|
||||
chip_writeb(0x80, bios + 0x555);
|
||||
chip_writeb(0xAA, bios + 0x555);
|
||||
chip_writeb(0x55, bios + 0x2AA);
|
||||
chip_writeb(0x10, bios + 0x555);
|
||||
|
||||
programmer_delay(10);
|
||||
toggle_ready_jedec(bios);
|
||||
|
||||
if (check_erased_range(flash, 0, total_size)) {
|
||||
fprintf(stderr, "ERASE FAILED!\n");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int write_29f040b(struct flashchip *flash, uint8_t *buf)
|
||||
{
|
||||
int i;
|
||||
int total_size = flash->total_size * 1024;
|
||||
int page_size = flash->page_size;
|
||||
chipaddr bios = flash->virtual_memory;
|
||||
|
||||
printf("Programming page ");
|
||||
for (i = 0; i < total_size / page_size; i++) {
|
||||
/* erase the page before programming */
|
||||
if (erase_sector_29f040b(flash, i * page_size, page_size)) {
|
||||
fprintf(stderr, "ERASE FAILED!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* write to the sector */
|
||||
printf("%04d at address: ", i);
|
||||
write_sector_29f040b(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");
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
return 0;
|
||||
}
|
@ -60,21 +60,6 @@ int erase_82802ab(struct flashchip *flash);
|
||||
int erase_82802ab_block(struct flashchip *flash, unsigned int page, unsigned int pagesize);
|
||||
int write_82802ab(struct flashchip *flash, uint8_t *buf);
|
||||
|
||||
/* am29f040b.c */
|
||||
int probe_29f040b(struct flashchip *flash);
|
||||
int erase_29f040b(struct flashchip *flash);
|
||||
int erase_sector_29f040b(struct flashchip *flash, unsigned int blockaddr, unsigned int blocksize);
|
||||
int erase_chip_29f040b(struct flashchip *flash, unsigned int blockaddr, unsigned int blocksize);
|
||||
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);
|
||||
int write_en29f002a(struct flashchip *flash, uint8_t *buf);
|
||||
|
||||
/* jedec.c */
|
||||
uint8_t oddparity(uint8_t val);
|
||||
void toggle_ready_jedec(chipaddr dst);
|
||||
@ -90,11 +75,6 @@ int erase_block_jedec(struct flashchip *flash, unsigned int page, unsigned int b
|
||||
int erase_chip_block_jedec(struct flashchip *flash, unsigned int page, unsigned int blocksize);
|
||||
int write_sector_jedec_common(struct flashchip *flash, uint8_t *src, chipaddr dst, unsigned int page_size, unsigned int mask);
|
||||
|
||||
/* m29f002.c */
|
||||
int erase_m29f002(struct flashchip *flash);
|
||||
int write_m29f002t(struct flashchip *flash, uint8_t *buf);
|
||||
int write_m29f002b(struct flashchip *flash, uint8_t *buf);
|
||||
|
||||
/* m29f400bt.c */
|
||||
int probe_m29f400bt(struct flashchip *flash);
|
||||
int erase_m29f400bt(struct flashchip *flash);
|
||||
@ -106,13 +86,6 @@ void protect_m29f400bt(chipaddr bios);
|
||||
void write_page_m29f400bt(chipaddr bios, uint8_t *src,
|
||||
chipaddr dst, int page_size);
|
||||
|
||||
/* mx29f002.c */
|
||||
int probe_29f002(struct flashchip *flash);
|
||||
int erase_29f002(struct flashchip *flash);
|
||||
int erase_chip_29f002(struct flashchip *flash, unsigned int addr, unsigned int blocklen);
|
||||
int erase_sector_29f002(struct flashchip *flash, unsigned int address, unsigned int blocklen);
|
||||
int write_29f002(struct flashchip *flash, uint8_t *buf);
|
||||
|
||||
/* pm49fl00x.c */
|
||||
int probe_49fl00x(struct flashchip *flash);
|
||||
int erase_49fl00x(struct flashchip *flash);
|
||||
@ -131,14 +104,6 @@ int erase_chip_28sf040(struct flashchip *flash, unsigned int addr, unsigned int
|
||||
int erase_sector_28sf040(struct flashchip *flash, unsigned int address, unsigned int sector_size);
|
||||
int write_28sf040(struct flashchip *flash, uint8_t *buf);
|
||||
|
||||
/* sst39sf020.c */
|
||||
int probe_39sf020(struct flashchip *flash);
|
||||
int write_39sf020(struct flashchip *flash, uint8_t *buf);
|
||||
|
||||
/* sst49lf040.c */
|
||||
int erase_49lf040(struct flashchip *flash);
|
||||
int write_49lf040(struct flashchip *flash, uint8_t *buf);
|
||||
|
||||
/* sst49lfxxxc.c */
|
||||
int probe_49lfxxxc(struct flashchip *flash);
|
||||
int erase_49lfxxxc(struct flashchip *flash);
|
||||
@ -170,9 +135,6 @@ int unlock_winbond_fwhub(struct flashchip *flash);
|
||||
/* w29ee011.c */
|
||||
int probe_w29ee011(struct flashchip *flash);
|
||||
|
||||
/* w49f002u.c */
|
||||
int write_49f002(struct flashchip *flash, uint8_t *buf);
|
||||
|
||||
/* stm50flw0x0x.c */
|
||||
int probe_stm50flw0x0x(struct flashchip *flash);
|
||||
int erase_stm50flw0x0x(struct flashchip *flash);
|
||||
|
89
en29f002a.c
89
en29f002a.c
@ -1,89 +0,0 @@
|
||||
/*
|
||||
* This file is part of the flashrom project.
|
||||
*
|
||||
* Copyright (C) 2007 Carl-Daniel Hailfinger
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*
|
||||
* EN29F512 has 1C,21
|
||||
* EN29F010 has 1C,20
|
||||
* EN29F040A has 1C,04
|
||||
* EN29LV010 has 1C,6E and uses short F0 reset sequence
|
||||
* EN29LV040(A) has 1C,4F and uses short F0 reset sequence
|
||||
*/
|
||||
|
||||
#include "flash.h"
|
||||
|
||||
int probe_en29f512(struct flashchip *flash)
|
||||
{
|
||||
chipaddr bios = flash->virtual_memory;
|
||||
uint8_t id1, id2;
|
||||
|
||||
chip_writeb(0xAA, bios + 0x555);
|
||||
chip_writeb(0x55, bios + 0x2AA);
|
||||
chip_writeb(0x90, bios + 0x555);
|
||||
|
||||
programmer_delay(10);
|
||||
|
||||
id1 = chip_readb(bios + 0x100);
|
||||
id2 = chip_readb(bios + 0x101);
|
||||
|
||||
/* exit by writing F0 anywhere? or the code below */
|
||||
chip_writeb(0xAA, bios + 0x555);
|
||||
chip_writeb(0x55, bios + 0x2AA);
|
||||
chip_writeb(0xF0, bios + 0x555);
|
||||
|
||||
printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __func__, id1, id2);
|
||||
|
||||
if (id1 == flash->manufacture_id && id2 == flash->model_id)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* EN29F002AT has 1C,92
|
||||
* EN29F002AB has 1C,97
|
||||
*/
|
||||
|
||||
/* This does not seem to function properly for EN29F002NT. */
|
||||
int probe_en29f002a(struct flashchip *flash)
|
||||
{
|
||||
chipaddr bios = flash->virtual_memory;
|
||||
uint8_t id1, id2;
|
||||
|
||||
chip_writeb(0xAA, bios + 0x555);
|
||||
chip_writeb(0x55, bios + 0xAAA);
|
||||
chip_writeb(0x90, bios + 0x555);
|
||||
|
||||
programmer_delay(10);
|
||||
|
||||
id1 = chip_readb(bios + 0x100);
|
||||
id2 = chip_readb(bios + 0x101);
|
||||
|
||||
/* exit by writing F0 anywhere? or the code below */
|
||||
chip_writeb(0xAA, bios + 0x555);
|
||||
chip_writeb(0x55, bios + 0xAAA);
|
||||
chip_writeb(0xF0, bios + 0x555);
|
||||
|
||||
printf_debug("%s: id1 0x%x, id2 0x%x\n", __func__, id1, id2);
|
||||
|
||||
if (id1 == flash->manufacture_id && id2 == flash->model_id)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
128
m29f002.c
128
m29f002.c
@ -1,128 +0,0 @@
|
||||
/*
|
||||
* This file is part of the flashrom project.
|
||||
*
|
||||
* Copyright (C) 2009 Peter Stuge <peter@stuge.se>
|
||||
*
|
||||
* 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 erase_m29f002(struct flashchip *flash)
|
||||
{
|
||||
chipaddr bios = flash->virtual_memory;
|
||||
chip_writeb(0xaa, bios + 0x555);
|
||||
chip_writeb(0x55, bios + 0xaaa);
|
||||
chip_writeb(0x80, bios + 0x555);
|
||||
chip_writeb(0xaa, bios + 0x555);
|
||||
chip_writeb(0x55, bios + 0xaaa);
|
||||
chip_writeb(0x10, bios + 0x555);
|
||||
programmer_delay(10);
|
||||
toggle_ready_jedec(bios);
|
||||
if (check_erased_range(flash, 0, flash->total_size * 1024)) {
|
||||
fprintf(stderr, "ERASE FAILED!\n");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rewrite_block(struct flashchip *flash, uint8_t *src,
|
||||
unsigned long start, int size)
|
||||
{
|
||||
chipaddr bios = flash->virtual_memory;
|
||||
chipaddr dst = bios + start;
|
||||
|
||||
/* erase */
|
||||
/* FIXME: use erase_sector_jedec? */
|
||||
chip_writeb(0xaa, bios + 0x555);
|
||||
chip_writeb(0x55, bios + 0xaaa);
|
||||
chip_writeb(0x80, bios + 0x555);
|
||||
chip_writeb(0xaa, bios + 0x555);
|
||||
chip_writeb(0x55, bios + 0xaaa);
|
||||
chip_writeb(0x30, dst);
|
||||
programmer_delay(10);
|
||||
toggle_ready_jedec(bios);
|
||||
if (check_erased_range(flash, start, size)) {
|
||||
fprintf(stderr, "ERASE FAILED!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* program */
|
||||
/* FIXME: use write_sector_jedec? */
|
||||
while (size--) {
|
||||
chip_writeb(0xaa, bios + 0x555);
|
||||
chip_writeb(0x55, bios + 0xaaa);
|
||||
chip_writeb(0xa0, bios + 0x555);
|
||||
chip_writeb(*src, dst);
|
||||
toggle_ready_jedec(dst);
|
||||
dst++;
|
||||
src++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int do_block(struct flashchip *flash, uint8_t *src, int i,
|
||||
unsigned long start, int size)
|
||||
{
|
||||
int ret;
|
||||
printf("%d at address: 0x%08lx", i, start);
|
||||
ret = rewrite_block(flash, src + start, start, size);
|
||||
if (ret)
|
||||
return ret;
|
||||
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");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int write_m29f002t(struct flashchip *flash, uint8_t *buf)
|
||||
{
|
||||
int i, page_size = flash->page_size;
|
||||
|
||||
/* M29F002(N)T has 7 blocks. From bottom to top their sizes are:
|
||||
* 64k 64k 64k 32k 8k 8k 16k
|
||||
* flash->page_size is set to 64k in flashchips.c
|
||||
*/
|
||||
|
||||
printf("Programming block: ");
|
||||
for (i = 0; i < 3; i++)
|
||||
do_block(flash, buf, i, i * page_size, page_size);
|
||||
do_block(flash, buf, i++, 0x30000, 32 * 1024);
|
||||
do_block(flash, buf, i++, 0x38000, 8 * 1024);
|
||||
do_block(flash, buf, i++, 0x3a000, 8 * 1024);
|
||||
do_block(flash, buf, i, 0x3c000, 16 * 1024);
|
||||
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int write_m29f002b(struct flashchip *flash, uint8_t *buf)
|
||||
{
|
||||
int i = 0, page_size = flash->page_size;
|
||||
|
||||
/* M29F002B has 7 blocks. From bottom to top their sizes are:
|
||||
* 16k 8k 8k 32k 64k 64k 64k
|
||||
* flash->page_size is set to 64k in flashchips.c
|
||||
*/
|
||||
|
||||
printf("Programming block: ");
|
||||
do_block(flash, buf, i++, 0x00000, 16 * 1024);
|
||||
do_block(flash, buf, i++, 0x04000, 8 * 1024);
|
||||
do_block(flash, buf, i++, 0x06000, 8 * 1024);
|
||||
do_block(flash, buf, i++, 0x08000, 32 * 1024);
|
||||
for (; i < 7; i++)
|
||||
do_block(flash, buf, i, (i - 3) * page_size, page_size);
|
||||
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
102
mx29f002.c
102
mx29f002.c
@ -1,102 +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 "flash.h"
|
||||
|
||||
int probe_29f002(struct flashchip *flash)
|
||||
{
|
||||
chipaddr bios = flash->virtual_memory;
|
||||
uint8_t id1, id2;
|
||||
|
||||
chip_writeb(0xAA, bios + 0x5555);
|
||||
chip_writeb(0x55, bios + 0x2AAA);
|
||||
chip_writeb(0x90, bios + 0x5555);
|
||||
|
||||
id1 = chip_readb(bios);
|
||||
id2 = chip_readb(bios + 0x01);
|
||||
|
||||
chip_writeb(0xF0, bios);
|
||||
|
||||
programmer_delay(10);
|
||||
|
||||
printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __func__, id1, id2);
|
||||
if (id1 == flash->manufacture_id && id2 == flash->model_id)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int erase_sector_29f002(struct flashchip *flash, unsigned int address, unsigned int blocklen)
|
||||
{
|
||||
chipaddr bios = flash->virtual_memory;
|
||||
|
||||
chip_writeb(0xAA, bios + 0x555);
|
||||
chip_writeb(0x55, bios + 0x2AA);
|
||||
chip_writeb(0x80, bios + 0x555);
|
||||
chip_writeb(0xAA, bios + 0x555);
|
||||
chip_writeb(0x55, bios + 0x2AA);
|
||||
chip_writeb(0x30, bios + address);
|
||||
|
||||
programmer_delay(10);
|
||||
|
||||
/* wait for Toggle bit ready */
|
||||
toggle_ready_jedec(bios + address);
|
||||
|
||||
if (check_erased_range(flash, address, blocklen)) {
|
||||
fprintf(stderr, "ERASE FAILED!\n");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int erase_chip_29f002(struct flashchip *flash, unsigned int addr, unsigned int blocklen)
|
||||
{
|
||||
if ((addr != 0) || (blocklen != flash->total_size * 1024)) {
|
||||
fprintf(stderr, "%s called with incorrect arguments\n",
|
||||
__func__);
|
||||
return -1;
|
||||
}
|
||||
return erase_29f002(flash);
|
||||
}
|
||||
|
||||
/* FIXME: Use erase_chip_jedec?
|
||||
* erase_29f002 uses shorter addresses, sends F0 (exit ID mode) and
|
||||
* and has a bigger delay before polling the toggle bit */
|
||||
int erase_29f002(struct flashchip *flash)
|
||||
{
|
||||
chipaddr bios = flash->virtual_memory;
|
||||
|
||||
chip_writeb(0xF0, bios + 0x555);
|
||||
chip_writeb(0xAA, bios + 0x555);
|
||||
chip_writeb(0x55, bios + 0x2AA);
|
||||
chip_writeb(0x80, bios + 0x555);
|
||||
chip_writeb(0xAA, bios + 0x555);
|
||||
chip_writeb(0x55, bios + 0x2AA);
|
||||
chip_writeb(0x10, bios + 0x555);
|
||||
|
||||
programmer_delay(100);
|
||||
toggle_ready_jedec(bios);
|
||||
|
||||
if (check_erased_range(flash, 0, flash->total_size * 1024)) {
|
||||
fprintf(stderr, "ERASE FAILED!\n");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
58
pm29f002.c
58
pm29f002.c
@ -1,58 +0,0 @@
|
||||
/*
|
||||
* This file is part of the flashrom project.
|
||||
*
|
||||
* Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.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"
|
||||
|
||||
/* if write_sector_jedec is used,
|
||||
this is write_jedec_1 */
|
||||
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;
|
||||
|
||||
if (erase_flash(flash)) {
|
||||
fprintf(stderr, "ERASE FAILED!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* FIXME: use write_sector_jedec? */
|
||||
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;
|
||||
}
|
72
sst49lf040.c
72
sst49lf040.c
@ -1,72 +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 "flash.h"
|
||||
|
||||
int erase_49lf040(struct flashchip *flash)
|
||||
{
|
||||
int i;
|
||||
int total_size = flash->total_size * 1024;
|
||||
int page_size = flash->page_size;
|
||||
|
||||
for (i = 0; i < total_size / page_size; i++) {
|
||||
/* Chip erase only works in parallel programming mode
|
||||
* for the 49lf040. Use sector-erase instead */
|
||||
if (erase_sector_jedec(flash, i * page_size, page_size)) {
|
||||
fprintf(stderr, "ERASE FAILED!\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int write_49lf040(struct flashchip *flash, uint8_t *buf)
|
||||
{
|
||||
int i;
|
||||
int total_size = flash->total_size * 1024;
|
||||
int page_size = flash->page_size;
|
||||
chipaddr bios = flash->virtual_memory;
|
||||
|
||||
printf("Programming page: ");
|
||||
for (i = 0; i < total_size / page_size; i++) {
|
||||
/* erase the page before programming
|
||||
* Chip erase only works in parallel programming mode
|
||||
* for the 49lf040. Use sector-erase instead */
|
||||
if (erase_sector_jedec(flash, i * page_size, page_size)) {
|
||||
fprintf(stderr, "ERASE FAILED!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* write to the sector */
|
||||
if (i % 10 == 0)
|
||||
printf("%04d at address: 0x%08x ", i, i * page_size);
|
||||
|
||||
write_sector_jedec_common(flash, buf + i * page_size,
|
||||
bios + i * page_size, page_size, 0xffff);
|
||||
|
||||
if (i % 10 == 0)
|
||||
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");
|
||||
fflush(stdout);
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
return 0;
|
||||
}
|
47
w49f002u.c
47
w49f002u.c
@ -1,47 +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 "flash.h"
|
||||
|
||||
int write_49f002(struct flashchip *flash, uint8_t *buf)
|
||||
{
|
||||
int i;
|
||||
int total_size = flash->total_size * 1024;
|
||||
int page_size = flash->page_size;
|
||||
chipaddr bios = flash->virtual_memory;
|
||||
|
||||
if (erase_chip_jedec(flash)) {
|
||||
fprintf(stderr, "ERASE FAILED!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("Programming page: ");
|
||||
for (i = 0; i < total_size / page_size; i++) {
|
||||
printf("%04d at address: 0x%08x ", i, i * page_size);
|
||||
/* Byte-wise writing of 'page_size' bytes. */
|
||||
write_sector_jedec_common(flash, buf + i * page_size,
|
||||
bios + i * page_size, page_size, 0xffff);
|
||||
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");
|
||||
fflush(stdout);
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user