X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fflash%2Fnor%2Fcore.h;h=68220afe21e6f1c53d04a00bcac7c48d06b78c2f;hb=0c82bea44acf491164c96efd88c1a831fbf6ce67;hp=36e163dfc085d69bd157f8c65539d2bb8ef1467c;hpb=8c730aaee22a505cf66666be3ff28734ac885418;p=openocd.git diff --git a/src/flash/nor/core.h b/src/flash/nor/core.h index 36e163dfc0..68220afe21 100644 --- a/src/flash/nor/core.h +++ b/src/flash/nor/core.h @@ -97,15 +97,17 @@ struct flash_bank /// Registers the 'flash' subsystem commands int flash_register_commands(struct command_context *cmd_ctx); -/// Initializes the 'flash' subsystem drivers -int flash_init_drivers(struct command_context *cmd_ctx); /** * Erases @a length bytes in the @a target flash, starting at @a addr. + * The range @a addr to @a addr + @a length - 1 must be strictly + * sector aligned, unless @a pad is true. Setting @a pad true extends + * the range, at beginning and/or end, if needed for sector alignment. * @returns ERROR_OK if successful; otherwise, an error code. */ int flash_erase_address_range(struct target *target, - uint32_t addr, uint32_t length); + bool pad, uint32_t addr, uint32_t length); + /** * Writes @a image into the @a target flash. The @a written parameter * will contain the @@ -118,6 +120,10 @@ int flash_erase_address_range(struct target *target, */ 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.