diff options
author | Joel Stanley <joel@jms.id.au> | 2016-11-03 12:21:24 +1030 |
---|---|---|
committer | Joel Stanley <joel@jms.id.au> | 2016-11-04 11:08:15 +1030 |
commit | 6677705616fbfbbb58da18384f48db498494b64f (patch) | |
tree | 04058e68d0d1bc377ef098880321a1f0d5b1a9b5 /op-flasher | |
parent | 3881231a01b1cbe9332fb3d0c064975f357d59a2 (diff) | |
download | talos-skeleton-6677705616fbfbbb58da18384f48db498494b64f.tar.gz talos-skeleton-6677705616fbfbbb58da18384f48db498494b64f.zip |
flasher: Remove relocking of flash
When using MTD the libflash backend does not perform any locking of the
flash, so this is a noop.
Change-Id: I7cbac6a9e5c3382652fe1f3ada7b208df4af6b3e
Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'op-flasher')
-rw-r--r-- | op-flasher/flasher_obj.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/op-flasher/flasher_obj.c b/op-flasher/flasher_obj.c index 874d21b..25182b1 100644 --- a/op-flasher/flasher_obj.c +++ b/op-flasher/flasher_obj.c @@ -43,8 +43,6 @@ static GDBusObjectManagerServer *manager = NULL; #define __aligned(x) __attribute__((aligned(x))) -static bool need_relock; - #define FILE_BUF_SIZE 0x10000 static uint8_t file_buf[FILE_BUF_SIZE] __aligned(0x1000); @@ -168,7 +166,7 @@ flash_access_cleanup_bmc(void) } static int -flash_access_setup_bmc(bool need_write) +flash_access_setup_bmc(void) { int rc; printf("Setting up BMC flash\n"); @@ -186,15 +184,11 @@ flash_access_setup_bmc(bool need_write) static void flash_access_cleanup_pnor(void) { - /* Re-lock flash */ - if(need_relock) - arch_flash_set_wrprotect(bl, 1); - flash_access_cleanup_bmc(); } static int -flash_access_setup_pnor(bool need_write) +flash_access_setup_pnor(void) { int rc; printf("Setting up BIOS flash\n"); @@ -208,10 +202,6 @@ flash_access_setup_pnor(bool need_write) return FLASH_SETUP_ERROR; } - /* Unlock flash (PNOR only) */ - if(need_write) - need_relock = arch_flash_set_wrprotect(bl, 0); - /* Setup cleanup function */ atexit(flash_access_cleanup_pnor); return FLASH_OK; @@ -220,19 +210,17 @@ flash_access_setup_pnor(bool need_write) uint8_t flash(FlashControl* flash_control,bool bmc_flash, uint32_t address, char* write_file, char* obj_path) { - bool erase = true, program = true; - int rc; printf("flasher: %s, BMC = %d, address = 0x%x\n",write_file,bmc_flash,address); /* Prepare for access */ if(bmc_flash) { - rc = flash_access_setup_bmc(erase || program); + rc = flash_access_setup_bmc(); if(rc) { return FLASH_SETUP_ERROR; } } else { - rc = flash_access_setup_pnor(erase || program); + rc = flash_access_setup_pnor(); if(rc) { return FLASH_SETUP_ERROR; } |