flash/nor/stm32h7x: remove options cache and some driver enhancements
authorTarek BOCHKATI <tarek.bouchkati@gmail.com>
Mon, 9 Sep 2019 18:38:10 +0000 (20:38 +0200)
committerTomas Vanek <vanekt@fbl.cz>
Wed, 27 Nov 2019 06:16:51 +0000 (06:16 +0000)
commit9c196b0b2b6f3ef28a646b1f17411a36ed9643a5
treed8c2766be229ac37c53744da52870b99b35a4916
parent8d8c6df557ab1976c6df39cf712b6ef23ce8a27e
flash/nor/stm32h7x: remove options cache and some driver enhancements

functions managing option bytes cache (stm32x_read/write_options)
have bee removed, and a new functions to modify a single option byte
have been introduced (stm32x_write/modify_option).

by the way, some helpers have been introduced to access flash registers:
  - stm32x_read_flash_reg(bank, offset, *value): int
  - stm32x_write_flash_reg(bank, offset, value): int

and a new commands to read and write a single flash option register:
  - stm32h7x option_read <bank> <option_reg offset>
  - stm32h7x option_write <bank> <option_reg offset> <value> [mask]

also lock and unlock handlers' have been reduced by using the same routine
(stm32x_set_rdp) and have been optimized to not write options unless
there is a change in RDP level.

finally, several functions have been fixed to lock flash / options in case
of failure.

Change-Id: I75057949ab9f5b4e0f602bafb76f9f80d53a522b
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/5293
Tested-by: jenkins
Reviewed-by: Christopher Head <chead@zaber.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
doc/openocd.texi
src/flash/nor/stm32h7x.c