efm32: correct erase address if bank->base != 0 40/4440/2
authorAndreas Kemnade <andreas@kemnade.info>
Sun, 4 Mar 2018 08:07:23 +0000 (09:07 +0100)
committerTomas Vanek <vanekt@fbl.cz>
Sun, 18 Nov 2018 08:22:18 +0000 (08:22 +0000)
Prepare for additional flash banks not located at address 0

Change-Id: I60b78c917f94fa52bf24df9e3315536f776eec84
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Reviewed-on: http://openocd.zylin.com/4440
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
src/flash/nor/efm32.c

index 1d70bd5..8ff689c 100644 (file)
@@ -429,7 +429,7 @@ static int efm32x_erase_page(struct flash_bank *bank, uint32_t addr)
         */
        int ret = 0;
        uint32_t status = 0;
-
+       addr += bank->base;
        LOG_DEBUG("erasing flash page at 0x%08" PRIx32, addr);
 
        ret = efm32x_write_reg_u32(bank, EFM32_MSC_REG_ADDRB, addr);