Files
OpenCellular/chip/stm32
Vincent Palatin 730491df20 stm32: add internal flash support for STM32H7 family
The STM32H7 family has 2 banks of flash (with 2 hardware controllers
able to do 2 parallel operations at the same time).
Each bank of flash has 4 or 8 128-kB erase blocks (1MB and 2MB
variants).
The flash can only be written by 256-bit word (with an additional 10-bit
ECC computed by the hardware).

For the flash write-protection, we cannot use our 'classical' PSTATE
scheme as the erase-blocks are too large (128-kB) to dedicate one to
this and the embedded word in the RO partition would not work as the
flash has ECC and triggers bus-fault when the ECC is incorrect (which
includes the case where the 256-bit word is written a second time).
So we will do the following:
- use the RSS1 bit in the option bytes as the Write-Protect enabled bit.
- if the WP GPIO is set, lock at startup the option bytes until next
  reboot.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BRANCH=none
BUG=b:67081508
TEST=run flashinfo/flashwp/flashwrite/flasherase commands on the EC
console.

Change-Id: I823fce3bd42b4df212cf0b8ceceaca84109b78e6
Reviewed-on: https://chromium-review.googlesource.com/901423
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
2018-02-09 05:24:47 -08:00
..
2018-01-31 08:29:46 -08:00
2014-10-07 20:58:52 +00:00
2017-07-28 17:45:13 -07:00
2016-04-25 16:49:02 -07:00
2015-06-18 19:07:00 +00:00
2018-01-08 05:41:23 -08:00
2017-04-26 11:25:57 -07:00
2018-01-08 05:41:23 -08:00
2018-01-08 05:41:23 -08:00
2018-01-08 05:41:23 -08:00
2014-10-07 20:58:52 +00:00
2017-07-28 17:45:13 -07:00
2018-01-12 14:31:07 -08:00
2016-04-25 16:49:01 -07:00
2018-01-30 14:54:17 -08:00
2017-02-23 11:36:21 -08:00
2018-01-08 05:41:23 -08:00
2015-08-24 19:08:35 +00:00
2015-08-24 19:08:30 +00:00
2015-08-24 19:08:30 +00:00
2015-08-24 19:08:30 +00:00
2015-08-24 19:08:30 +00:00
2015-08-24 19:08:30 +00:00
2016-09-02 21:17:22 -07:00
2018-01-31 08:29:46 -08:00
2018-01-31 08:29:46 -08:00
2017-12-18 20:32:58 -08:00