From 737c9b6258c6e68714ae264ff36126eb5d382d6a Mon Sep 17 00:00:00 2001 From: Øyvind Harboe Date: Wed, 5 May 2010 15:08:34 +0200 Subject: flash: stop caching protection state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/flash/nor/core.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/flash/nor/core.h') 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. -- cgit v1.2.3