flash Kinetis: Implement flash protection setting
commit0e95629eb1cca652447d9c30514319272af2f337
authorTomas Vanek <vanekt@fbl.cz>
Fri, 22 Jul 2016 10:28:42 +0000 (22 12:28 +0200)
committerAndreas Fritiofson <andreas.fritiofson@gmail.com>
Sun, 14 Aug 2016 10:41:09 +0000 (14 11:41 +0100)
tree00e4a9f77dd74f419cf8e166acfddbd36abf0f1c
parentd856aa97711eb896911683a2991909e17e083a0d
flash Kinetis: Implement flash protection setting

Kinetis family employs strange concept of Flash Configuration Field at
address 0x400 of program flash. Writing incorrect data to FCF may
permanently lock the device.

The change introduces 'kinetis fcf_source protection' mode. In this mode
write of flash image data to FCF is prevented. FCF data build from
protection (set by 'flash protect' command) are written instead.

FCF data are written also just after erase of relevant sector. It
protects device from locking security by reset or power cycle after erase.

prot_blocks array is used as protection blocks have bigger size than sectors.

Alignment and padding programming sections is rewritten to fix
writing with not section boundary aligned begin.

Change-Id: I9fc8bd37d6f627fb8ed7abb7f7560e78a740b195
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/3562
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Tested-by: jenkins
doc/openocd.texi
src/flash/nor/kinetis.c