summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--82802ab.c1
-rw-r--r--flash.h3
-rw-r--r--jedec.c26
-rw-r--r--m29f400bt.c11
-rw-r--r--sharplhf00l04.c1
-rw-r--r--stm50flw0x0x.c12
6 files changed, 4 insertions, 50 deletions
diff --git a/82802ab.c b/82802ab.c
index b274d56c0..58d346732 100644
--- a/82802ab.c
+++ b/82802ab.c
@@ -190,7 +190,6 @@ int write_82802ab(struct flashchip *flash, uint8_t *buf)
bios + i * page_size, page_size);
}
printf("\n");
- protect_jedec(bios);
free(tmpbuf);
return 0;
diff --git a/flash.h b/flash.h
index 008af2840..1a1d8f851 100644
--- a/flash.h
+++ b/flash.h
@@ -647,8 +647,7 @@ extern uint8_t *sb600_spibar;
uint8_t oddparity(uint8_t val);
void toggle_ready_jedec(chipaddr dst);
void data_polling_jedec(chipaddr dst, uint8_t data);
-void unprotect_jedec(chipaddr bios);
-void protect_jedec(chipaddr bios);
+void start_program_jedec(chipaddr bios);
int write_byte_program_jedec(chipaddr bios, uint8_t *src,
chipaddr dst);
int probe_jedec(struct flashchip *flash);
diff --git a/jedec.c b/jedec.c
index f352c6be0..0a5eda0ca 100644
--- a/jedec.c
+++ b/jedec.c
@@ -64,25 +64,11 @@ void data_polling_jedec(chipaddr dst, uint8_t data)
}
}
-void unprotect_jedec(chipaddr bios)
-{
- chip_writeb(0xAA, bios + 0x5555);
- chip_writeb(0x55, bios + 0x2AAA);
- chip_writeb(0x80, bios + 0x5555);
- chip_writeb(0xAA, bios + 0x5555);
- chip_writeb(0x55, bios + 0x2AAA);
- chip_writeb(0x20, bios + 0x5555);
-
- programmer_delay(200);
-}
-
-void protect_jedec(chipaddr bios)
+void start_program_jedec(chipaddr bios)
{
chip_writeb(0xAA, bios + 0x5555);
chip_writeb(0x55, bios + 0x2AAA);
chip_writeb(0xA0, bios + 0x5555);
-
- programmer_delay(200);
}
int probe_jedec(struct flashchip *flash)
@@ -270,9 +256,7 @@ int write_page_write_jedec(struct flashchip *flash, uint8_t *src,
retry:
/* Issue JEDEC Data Unprotect comand */
- chip_writeb(0xAA, bios + 0x5555);
- chip_writeb(0x55, bios + 0x2AAA);
- chip_writeb(0xA0, bios + 0x5555);
+ start_program_jedec(bios);
/* transfer data from source to destination */
for (i = 0; i < page_size; i++) {
@@ -312,9 +296,7 @@ int write_byte_program_jedec(chipaddr bios, uint8_t *src,
retry:
/* Issue JEDEC Byte Program command */
- chip_writeb(0xAA, bios + 0x5555);
- chip_writeb(0x55, bios + 0x2AAA);
- chip_writeb(0xA0, bios + 0x5555);
+ start_program_jedec(bios);
/* transfer data from source to destination */
chip_writeb(*src, dst);
@@ -353,7 +335,6 @@ int write_jedec(struct flashchip *flash, uint8_t *buf)
int i, failed = 0;
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");
@@ -369,7 +350,6 @@ int write_jedec(struct flashchip *flash, uint8_t *buf)
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");
}
printf("\n");
- protect_jedec(bios);
return failed;
}
diff --git a/m29f400bt.c b/m29f400bt.c
index 28e5da451..5c36db967 100644
--- a/m29f400bt.c
+++ b/m29f400bt.c
@@ -20,15 +20,6 @@
#include "flash.h"
-void protect_m29f400bt(chipaddr bios)
-{
- chip_writeb(0xAA, bios + 0xAAA);
- chip_writeb(0x55, bios + 0x555);
- chip_writeb(0xA0, bios + 0xAAA);
-
- programmer_delay(200);
-}
-
void write_page_m29f400bt(chipaddr bios, uint8_t *src,
chipaddr dst, int page_size)
{
@@ -194,7 +185,6 @@ int write_m29f400bt(struct flashchip *flash, uint8_t *buf)
write_page_m29f400bt(bios, buf + 0x7c000, bios + 0x7c000, 16 * 1024);
printf("\n");
- //protect_m29f400bt (bios);
return 0;
}
@@ -248,7 +238,6 @@ int write_coreboot_m29f400bt(struct flashchip *flash, uint8_t *buf)
write_page_m29f400bt(bios, buf + 0x30000, bios + 0x30000, 64 * 1024);
printf("\n");
- //protect_m29f400bt (bios);
return 0;
}
diff --git a/sharplhf00l04.c b/sharplhf00l04.c
index c4c0f03e8..1234ae4fd 100644
--- a/sharplhf00l04.c
+++ b/sharplhf00l04.c
@@ -179,7 +179,6 @@ int write_lhf00l04(struct flashchip *flash, uint8_t *buf)
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");
}
printf("\n");
- protect_jedec(bios);
return 0;
}
diff --git a/stm50flw0x0x.c b/stm50flw0x0x.c
index 44819e5e5..0ae6eb814 100644
--- a/stm50flw0x0x.c
+++ b/stm50flw0x0x.c
@@ -31,15 +31,6 @@
#include "flash.h"
#include "flashchips.h"
-void protect_stm50flw0x0x(chipaddr bios)
-{
- chip_writeb(0xAA, bios + 0x5555);
- chip_writeb(0x55, bios + 0x2AAA);
- chip_writeb(0xA0, bios + 0x5555);
-
- programmer_delay(200);
-}
-
int probe_stm50flw0x0x(struct flashchip *flash)
{
int result = probe_jedec(flash);
@@ -189,7 +180,6 @@ int erase_stm50flw0x0x(struct flashchip *flash)
int i;
int total_size = flash->total_size * 1024;
int page_size = flash->page_size;
- chipaddr bios = flash->virtual_memory;
printf("Erasing page:\n");
for (i = 0; i < total_size / page_size; i++) {
@@ -206,7 +196,6 @@ int erase_stm50flw0x0x(struct flashchip *flash)
}
}
printf("\n");
- protect_stm50flw0x0x(bios);
return 0;
}
@@ -250,7 +239,6 @@ int write_stm50flw0x0x(struct flashchip *flash, uint8_t * buf)
bios + i * page_size, page_size);
}
printf("\n");
- protect_stm50flw0x0x(bios);
free(tmpbuf);
return rc;