mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 15:12:36 +02:00
Add dedicated chip erase function for SST49LF040
Corresponding to flashrom svn r31 and coreboot v2 svn r1852.
This commit is contained in:
parent
efa28589b1
commit
a1439cfdee
@ -66,7 +66,7 @@ struct flashchip flashchips[] = {
|
|||||||
{"SST39VF020", SST_ID, SST_39VF020, NULL, 256, 4096,
|
{"SST39VF020", SST_ID, SST_39VF020, NULL, 256, 4096,
|
||||||
probe_jedec, erase_chip_jedec, write_39sf020,NULL},
|
probe_jedec, erase_chip_jedec, write_39sf020,NULL},
|
||||||
{"SST49LF040", SST_ID, SST_49LF040, NULL, 512, 4096,
|
{"SST49LF040", SST_ID, SST_49LF040, NULL, 512, 4096,
|
||||||
probe_jedec, erase_chip_jedec, write_49lf040,NULL},
|
probe_jedec, erase_49lf040, write_49lf040,NULL},
|
||||||
{"SST49LF080A", SST_ID, SST_49LF080A, NULL, 1024, 4096,
|
{"SST49LF080A", SST_ID, SST_49LF080A, NULL, 1024, 4096,
|
||||||
probe_jedec, erase_chip_jedec, write_49lf040,NULL},
|
probe_jedec, erase_chip_jedec, write_49lf040,NULL},
|
||||||
{"SST49LF002A/B", SST_ID, SST_49LF002A, NULL, 256, 16 * 1024,
|
{"SST49LF002A/B", SST_ID, SST_49LF002A, NULL, 256, 16 * 1024,
|
||||||
|
19
sst49lf040.c
19
sst49lf040.c
@ -30,6 +30,21 @@
|
|||||||
#include "jedec.h"
|
#include "jedec.h"
|
||||||
#include "sst49lf040.h"
|
#include "sst49lf040.h"
|
||||||
|
|
||||||
|
int erase_49lf040(struct flashchip *flash)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
int total_size = flash->total_size * 1024;
|
||||||
|
int page_size = flash->page_size;
|
||||||
|
volatile char *bios = flash->virt_addr;
|
||||||
|
|
||||||
|
for (i = 0; i < total_size / page_size; i++) {
|
||||||
|
/* Chip erase only works in parallel programming mode
|
||||||
|
* for the 49lf040. Use sector-erase instead */
|
||||||
|
erase_sector_jedec(bios, i * page_size);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int write_49lf040(struct flashchip *flash, unsigned char *buf)
|
int write_49lf040(struct flashchip *flash, unsigned char *buf)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -40,8 +55,8 @@ int write_49lf040(struct flashchip *flash, unsigned char *buf)
|
|||||||
printf("Programming Page: ");
|
printf("Programming Page: ");
|
||||||
for (i = 0; i < total_size / page_size; i++) {
|
for (i = 0; i < total_size / page_size; i++) {
|
||||||
/* erase the page before programming
|
/* erase the page before programming
|
||||||
* Chip erase only works in parallel programming mode for the 49lf040.
|
* Chip erase only works in parallel programming mode
|
||||||
* Use sector-erase instead */
|
* for the 49lf040. Use sector-erase instead */
|
||||||
erase_sector_jedec(bios, i * page_size);
|
erase_sector_jedec(bios, i * page_size);
|
||||||
|
|
||||||
/* write to the sector */
|
/* write to the sector */
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#ifndef __SST49LF040_H__
|
#ifndef __SST49LF040_H__
|
||||||
#define __SST49LF040_H__ 1
|
#define __SST49LF040_H__ 1
|
||||||
|
|
||||||
|
extern int erase_49lf040(struct flashchip *flash);
|
||||||
extern int write_49lf040(struct flashchip *flash, unsigned char *buf);
|
extern int write_49lf040(struct flashchip *flash, unsigned char *buf);
|
||||||
|
|
||||||
#endif /* !__SST49LF040_H__ */
|
#endif /* !__SST49LF040_H__ */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user