summaryrefslogtreecommitdiff
path: root/util/flash_and_burn/jedec.c
diff options
context:
space:
mode:
authorRonald G. Minnich <rminnich@gmail.com>2004-09-30 16:37:01 +0000
committerRonald G. Minnich <rminnich@gmail.com>2004-09-30 16:37:01 +0000
commit2b763af4ca6541734ff7d36a16173f9606c248c9 (patch)
tree38e06456e1b64284d33a2e48da7ef4a9fc67f40d /util/flash_and_burn/jedec.c
parent1b41f6b480ae3bebbb319d9154aebb140fbbcf62 (diff)
downloadcoreboot-2b763af4ca6541734ff7d36a16173f9606c248c9.tar.xz
support for sst firmware hub
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1651 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/flash_and_burn/jedec.c')
-rw-r--r--util/flash_and_burn/jedec.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/util/flash_and_burn/jedec.c b/util/flash_and_burn/jedec.c
index d99e774be7..19a233b81c 100644
--- a/util/flash_and_burn/jedec.c
+++ b/util/flash_and_burn/jedec.c
@@ -89,6 +89,35 @@ int erase_sector_jedec(volatile unsigned char *bios, unsigned int page)
return (0);
}
+int erase_block_jedec(volatile unsigned char *bios, unsigned int block)
+{
+ volatile unsigned char *Temp;
+
+ /* Issue the Sector Erase command */
+ Temp = bios + 0x5555; /* set up address to be BASE:5555h */
+ *Temp = 0xAA; /* write data 0xAA to the address */
+ myusec_delay(10);
+ Temp = bios + 0x2AAA; /* set up address to be BASE:2AAAh */
+ *Temp = 0x55; /* write data 0x55 to the address */
+ myusec_delay(10);
+ Temp = bios + 0x5555; /* set up address to be BASE:5555h */
+ *Temp = 0x80; /* write data 0x80 to the address */
+ myusec_delay(10);
+ Temp = bios + 0x5555; /* set up address to be BASE:5555h */
+ *Temp = 0xAA; /* write data 0xAA to the address */
+ myusec_delay(10);
+ Temp = bios + 0x2AAA; /* set up address to be BASE:2AAAh */
+ *Temp = 0x55; /* write data 0x55 to the address */
+ myusec_delay(10);
+ Temp = bios + block; /* set up address to be the current sector */
+ *Temp = 0x50; /* write data 0x30 to the address */
+ myusec_delay(10);
+
+ /* wait for Toggle bit ready */
+ toggle_ready_jedec(bios);
+
+ return (0);
+}
int erase_chip_jedec(struct flashchip *flash)
{