flash/nor: add support for Nuvoton NPCX series flash
[fw/openocd] / src / flash / nor / imp.h
index 87475a39c7ca64f77a5a7e9275e98b7fa7fc750a..f66cf032938d583b42251a39cd6a2cb1acbf7485 100644 (file)
@@ -18,6 +18,8 @@
 #ifndef OPENOCD_FLASH_NOR_IMP_H
 #define OPENOCD_FLASH_NOR_IMP_H
 
+#include <stdbool.h>
+
 /* this is an internal header */
 #include "core.h"
 #include "driver.h"
@@ -35,15 +37,19 @@ void flash_bank_add(struct flash_bank *bank);
  */
 struct flash_bank *flash_bank_list(void);
 
-int flash_driver_erase(struct flash_bank *bank, int first, int last);
-int flash_driver_protect(struct flash_bank *bank, int set, int first, int last);
+int flash_driver_erase(struct flash_bank *bank, unsigned int first,
+               unsigned int last);
+int flash_driver_protect(struct flash_bank *bank, int set, unsigned int first,
+               unsigned int last);
 int flash_driver_write(struct flash_bank *bank,
-               uint8_t *buffer, uint32_t offset, uint32_t count);
+               const uint8_t *buffer, uint32_t offset, uint32_t count);
 int flash_driver_read(struct flash_bank *bank,
                uint8_t *buffer, uint32_t offset, uint32_t count);
+int flash_driver_verify(struct flash_bank *bank,
+               const uint8_t *buffer, uint32_t offset, uint32_t count);
 
 /* write (optional verify) an image to flash memory of the given target */
-int flash_write_unlock(struct target *target, struct image *image,
-               uint32_t *written, int erase, bool unlock);
+int flash_write_unlock_verify(struct target *target, struct image *image,
+               uint32_t *written, bool erase, bool unlock, bool write, bool verify);
 
 #endif /* OPENOCD_FLASH_NOR_IMP_H */