diff options
author | Tarek BOCHKATI <tarek.bouchkati@gmail.com> | 2020-01-06 17:19:31 +0100 |
---|---|---|
committer | Tomas Vanek <vanekt@fbl.cz> | 2020-01-16 09:38:52 +0000 |
commit | a6a642bf72a12c9a1fc4b92de2dc46d12cb3b58e (patch) | |
tree | a98bf06b82916871f50dad7a68c9e9b6a7bccc3c /src | |
parent | 8536306b6ebcee8249376734d64db40a07916c9d (diff) |
flash/nor: add support of STM32WB on top STM32L4 flash driver
Change-Id: I9fb6700085d817d35a691f6484193f67939a4e0f
Signed-off-by: Laurent LEMELE <laurent.lemele@st.com>
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/4933
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Diffstat (limited to 'src')
-rw-r--r-- | src/flash/nor/stm32l4x.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/flash/nor/stm32l4x.c b/src/flash/nor/stm32l4x.c index 9057872a..a373f116 100644 --- a/src/flash/nor/stm32l4x.c +++ b/src/flash/nor/stm32l4x.c @@ -169,6 +169,10 @@ static const struct stm32l4_rev stm32_470_revs[] = { { 0x1000, "A" }, { 0x1001, "Z" }, { 0x1003, "Y" }, { 0x100F, "W" }, }; +static const struct stm32l4_rev stm32_495_revs[] = { + { 0x2001, "2.1" }, +}; + static const struct stm32l4_part_info stm32l4_parts[] = { { .id = 0x415, @@ -230,6 +234,16 @@ static const struct stm32l4_part_info stm32l4_parts[] = { .flash_regs_base = 0x40022000, .fsize_addr = 0x1FFF75E0, }, + { + .id = 0x495, + .revs = stm32_495_revs, + .num_revs = ARRAY_SIZE(stm32_495_revs), + .device_str = "STM32WB5x", + .max_flash_size_kb = 1024, + .has_dual_bank = false, + .flash_regs_base = 0x58004000, + .fsize_addr = 0x1FFF75E0, + }, }; /* flash bank stm32l4x <base> <size> 0 0 <target#> */ @@ -714,7 +728,7 @@ static int stm32l4_probe(struct flash_bank *bank) } if (!stm32l4_info->part_info) { - LOG_WARNING("Cannot identify target as an STM32L4 family device."); + LOG_WARNING("Cannot identify target as an STM32 L4 or WB family device."); return ERROR_FAIL; } @@ -804,6 +818,12 @@ static int stm32l4_probe(struct flash_bank *bank) stm32l4_info->bank1_sectors = num_pages / 2; } break; + case 0x495: + /* single bank flash */ + page_size = 4096; + num_pages = flash_size_in_kb / 4; + stm32l4_info->bank1_sectors = num_pages; + break; default: LOG_ERROR("unsupported device"); return ERROR_FAIL; @@ -881,7 +901,7 @@ static int get_stm32l4_info(struct flash_bank *bank, char *buf, int buf_size) part_info->device_str, rev_id); return ERROR_OK; } else { - snprintf(buf, buf_size, "Cannot identify target as a STM32L4x device"); + snprintf(buf, buf_size, "Cannot identify target as an STM32 L4 or WB device"); return ERROR_FAIL; } |