forked from auracaster/openocd
flash: stop caching protection state
There are a million reasons why cached protection state might be stale: power cycling of target, reset, code executing on the target, etc. The "flash protect_check" command is now gone. This is *always* executed when running a "flash info". As a bonus for more a more robust approach, lots of code could be deleted. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
This commit is contained in:
@@ -852,6 +852,17 @@ static int cfi_intel_protect(struct flash_bank *bank, int set, int first, int la
|
||||
*/
|
||||
if ((!set) && (!(pri_ext->feature_support & 0x20)))
|
||||
{
|
||||
/* FIX!!! this code path is broken!!!
|
||||
*
|
||||
* The correct approach is:
|
||||
*
|
||||
* 1. read out current protection status
|
||||
*
|
||||
* 2. override read out protection status w/unprotected.
|
||||
*
|
||||
* 3. re-protect what should be protected.
|
||||
*
|
||||
*/
|
||||
for (i = 0; i < bank->num_sectors; i++)
|
||||
{
|
||||
if (bank->sectors[i].is_protected == 1)
|
||||
|
||||
Reference in New Issue
Block a user