X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fflash%2Fnor%2Fcore.h;h=98763b7bcf645922fe6bcda23c3eba304aa4069a;hb=f10ed95a5ce6be416bcb2ec20826c6e508e4b622;hp=c1e26cd24890cc5c2b039fc6598cf84e058306e7;hpb=ae6374e25dae7b02636e440549b87040d03cc5aa;p=openocd.git diff --git a/src/flash/nor/core.h b/src/flash/nor/core.h index c1e26cd248..98763b7bcf 100644 --- a/src/flash/nor/core.h +++ b/src/flash/nor/core.h @@ -24,6 +24,11 @@ #include +/** + * @file + * Upper level NOR flash interfaces. + */ + struct image; #define FLASH_MAX_ERROR_STR (128) @@ -97,10 +102,14 @@ 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 @@ -113,6 +122,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.