flash/nor: implement protection blocks of different size than erase sector

Originally flash/nor infrastructure assumed protection blocks identical
to erase sectors. This assumption is not valid for many flash types.
Driver code fixed the problem either by increasing sector size to
size of protection block or by defining more protection block than
really existed in device. Both cases had drawbacks.

The change retains compatibility with the old driver.
Updated driver can set protection blocks table independent
of sector table.

Change-Id: I27f6d267528ad9ed9fe0a85f05436a8ec17603a4
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/3545
Tested-by: jenkins
Reviewed-by: Steven Stallion <stallion@squareup.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
This commit is contained in:
Tomas Vanek
2016-07-14 20:33:27 +02:00
committed by Andreas Fritiofson
parent 77478eb0f5
commit 77a1c01ccb
4 changed files with 110 additions and 23 deletions

View File

@@ -4746,8 +4746,10 @@ and display that status.
The @var{num} parameter is a value shown by @command{flash banks}.
@end deffn
@deffn Command {flash info} num
Print info about flash bank @var{num}
@deffn Command {flash info} num [sectors]
Print info about flash bank @var{num}, a list of protection blocks
and their status. Use @option{sectors} to show a list of sectors instead.
The @var{num} parameter is a value shown by @command{flash banks}.
This command will first query the hardware, it does not print cached
and possibly stale information.