From 972cec282c061dadd3c501221d20d8b6437057e7 Mon Sep 17 00:00:00 2001 From: Michael Karcher Date: Thu, 26 Nov 2009 14:50:52 +0000 Subject: Refine support for the JEDEC Software Data Protection This patch removes the extremely dangerous unprotect_jedec function which is not used at all within flashrom code, and renames the misleadingly named protect_jedec function to start_program_jedec. Calls to protect_jedec after flashing are removed, because a) on LPC chips, the command sent by protoct_jedec is not even in the datasheet and b) on parallel chips, the block write command issued before already contained the software protection sequence, so software protection is definitely enabled. This patch also removes two clones of protect_jedec Background: JEDEC Software Data Protection started as an optional feature, which was disabled on the first single-voltage-flash chips. The software data protection is the need to prefix a write with a magic "write enable" command, while without write protection every write access into the chip's address space modifies flash content. This magic write enable command also tells the flash chip that the programmer obviously support sending write-enable commands and turns off the "any write modifies flash content" mode. There also exist a two-command (6 writes) sequence that disables Software Data Protection completey, which should only ever be used to prepare updating with a device that can't handle software data protection. Corresponding to flashrom svn r783. Signed-off-by: Michael Karcher Acked-by: Sean Nelson Acked-by: Carl-Daniel Hailfinger --- stm50flw0x0x.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'stm50flw0x0x.c') diff --git a/stm50flw0x0x.c b/stm50flw0x0x.c index 44819e5..0ae6eb8 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; -- cgit v1.1