diff options
author | Øyvind Harboe <oyvind.harboe@zylin.com> | 2010-05-05 15:08:34 +0200 |
---|---|---|
committer | Øyvind Harboe <oyvind.harboe@zylin.com> | 2010-05-05 15:24:25 +0200 |
commit | 737c9b6258c6e68714ae264ff36126eb5d382d6a (patch) | |
tree | 508ba9ecd384a3f4d2fda13231d5fe53161e8c78 /src/flash/nor/core.h | |
parent | f7e0f3c285e9b1578184da886792e02d253ea687 (diff) |
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>
Diffstat (limited to 'src/flash/nor/core.h')
-rw-r--r-- | src/flash/nor/core.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/flash/nor/core.h b/src/flash/nor/core.h index b1526774..1dfd721b 100644 --- a/src/flash/nor/core.h +++ b/src/flash/nor/core.h @@ -53,6 +53,10 @@ struct flash_sector * Indication of protection status: 0 = unprotected/unlocked, * 1 = protected/locked, other = unknown. Set by * @c flash_driver_s::protect_check. + * + * This information must be considered stale immediately. + * A million things could make it stale: power cycle, + * reset of target, code running on target, etc. */ int is_protected; }; @@ -124,9 +128,6 @@ int flash_unlock_address_range(struct target *target, uint32_t addr, int flash_write(struct target *target, struct image *image, uint32_t *written, int erase); -/* invalidate cached state (targets may modify their own flash) */ -void nor_resume(struct target *target); - /** * Forces targets to re-examine their erase/protection state. * This routine must be called when the system may modify the status. |