diff options
author | Tarek BOCHKATI <tarek.bouchkati@gmail.com> | 2020-08-11 12:34:50 +0100 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2020-09-27 17:39:59 +0100 |
commit | 35e580373a77438f2832974b1f0dc36863dc3f03 (patch) | |
tree | aaa8e04ccbf3f776aae2aa796fb5735ef19e4108 /src/flash | |
parent | 67008e1bea2dd1a89d77802b892d3390e8a55455 (diff) | |
download | riscv-openocd-35e580373a77438f2832974b1f0dc36863dc3f03.zip riscv-openocd-35e580373a77438f2832974b1f0dc36863dc3f03.tar.gz riscv-openocd-35e580373a77438f2832974b1f0dc36863dc3f03.tar.bz2 |
Add support of STM32H72x/73x 1M (0x483)
STM32H72x/73x flash is similar to STM32H74x/75x,
except STM32H72x/73x devices have only one single flash bank.
Change-Id: I3d3422dc60234f8273172924f426200210f388cc
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/5792
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src/flash')
-rw-r--r-- | src/flash/nor/stm32h7x.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/flash/nor/stm32h7x.c b/src/flash/nor/stm32h7x.c index ac7d759..52e3e0e 100644 --- a/src/flash/nor/stm32h7x.c +++ b/src/flash/nor/stm32h7x.c @@ -147,7 +147,11 @@ static const struct stm32h7x_rev stm32_480_revs[] = { { 0x1000, "A"}, }; -static uint32_t stm32x_compute_flash_cr_450(uint32_t cmd, int snb) +static const struct stm32h7x_rev stm32_483_revs[] = { + { 0x1000, "A" }, { 0x1001, "Z" }, +}; + +static uint32_t stm32x_compute_flash_cr_450_483(uint32_t cmd, int snb) { return cmd | (snb << 8); } @@ -177,7 +181,7 @@ static const struct stm32h7x_part_info stm32h7x_parts[] = { .fsize_addr = 0x1FF1E880, .wps_group_size = 1, .wps_mask = 0xFF, - .compute_flash_cr = stm32x_compute_flash_cr_450, + .compute_flash_cr = stm32x_compute_flash_cr_450_483, }, { .id = 0x480, @@ -194,6 +198,21 @@ static const struct stm32h7x_part_info stm32h7x_parts[] = { .wps_mask = 0xFFFFFFFF, .compute_flash_cr = stm32x_compute_flash_cr_480, }, + { + .id = 0x483, + .revs = stm32_483_revs, + .num_revs = ARRAY_SIZE(stm32_483_revs), + .device_str = "STM32H72x/73x", + .page_size_kb = 128, + .block_size = 32, + .max_flash_size_kb = 1024, + .max_bank_size_kb = 1024, + .has_dual_bank = false, + .fsize_addr = 0x1FF1E880, + .wps_group_size = 1, + .wps_mask = 0xFF, + .compute_flash_cr = stm32x_compute_flash_cr_450_483, + }, }; /* flash bank stm32x <base> <size> 0 0 <target#> */ @@ -804,6 +823,8 @@ static int stm32x_probe(struct flash_bank *bank) /* flash size is 2M or 1M */ flash_size_in_kb /= 2; break; + case 0x483: + break; default: LOG_ERROR("unsupported device"); return ERROR_FAIL; |