From c8f9a06f6ca4171e137f35de5734be32eacf1f51 Mon Sep 17 00:00:00 2001 From: stefanct Date: Sun, 3 Aug 2014 13:05:34 +0000 Subject: Refactor unlocking of many chips with locking at register space address +2. This includes PMC Pm49*, SST 49LF00*, ST M50* and Winbond W39* families. The erase and write test status bits of all affected chips have been reset. Signed-off-by: Carl-Daniel Hailfinger Signed-off-by: Stefan Tauner Acked-by: Stefan Tauner git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1833 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- sst49lfxxxc.c | 39 --------------------------------------- 1 file changed, 39 deletions(-) (limited to 'sst49lfxxxc.c') diff --git a/sst49lfxxxc.c b/sst49lfxxxc.c index 3d17b5b..d6c85c8 100644 --- a/sst49lfxxxc.c +++ b/sst49lfxxxc.c @@ -23,45 +23,6 @@ #include "flash.h" #include "chipdrivers.h" -static int write_lockbits_block_49lfxxxc(struct flashctx *flash, - unsigned long address, - unsigned char bits) -{ - unsigned long lock = flash->virtual_registers + address + 2; - msg_cdbg("lockbits at address=0x%08lx is 0x%01x\n", lock, - chip_readb(flash, lock)); - chip_writeb(flash, bits, lock); - - return 0; -} - -static int write_lockbits_49lfxxxc(struct flashctx *flash, unsigned char bits) -{ - chipaddr registers = flash->virtual_registers; - unsigned int i, left = flash->chip->total_size * 1024; - unsigned long address; - - msg_cdbg("\nbios=0x%08" PRIxPTR "\n", registers); - for (i = 0; left > 65536; i++, left -= 65536) { - write_lockbits_block_49lfxxxc(flash, i * 65536, bits); - } - address = i * 65536; - write_lockbits_block_49lfxxxc(flash, address, bits); - address += 32768; - write_lockbits_block_49lfxxxc(flash, address, bits); - address += 8192; - write_lockbits_block_49lfxxxc(flash, address, bits); - address += 8192; - write_lockbits_block_49lfxxxc(flash, address, bits); - - return 0; -} - -int unlock_49lfxxxc(struct flashctx *flash) -{ - return write_lockbits_49lfxxxc(flash, 0); -} - int erase_sector_49lfxxxc(struct flashctx *flash, unsigned int address, unsigned int sector_size) { -- cgit v1.2.1