device.hpp: add (un)protect flash methods

This commit is contained in:
Gwenhael Goavec-Merou 2021-12-22 19:03:57 +01:00
parent de2917428e
commit 7e91d97828
1 changed files with 11 additions and 4 deletions

View File

@ -36,11 +36,18 @@ class Device {
Device(Jtag *jtag, std::string filename, const std::string &file_type,
bool verify, int8_t verbose = false);
virtual ~Device();
virtual void program(unsigned int offset = 0) = 0;
virtual bool dumpFlash(const std::string &filename,
uint32_t base_addr, uint32_t len) {
(void)filename; (void) base_addr; (void) len;
virtual void program(unsigned int offset,
bool unprotect_flash) = 0;
/**********************/
/* flash access */
/**********************/
virtual bool dumpFlash(uint32_t base_addr, uint32_t len) {
(void) base_addr; (void) len;
printError("dump flash not supported"); return false;}
virtual bool protect_flash(uint32_t len) = 0;
virtual bool unprotect_flash() = 0;
virtual int idCode() = 0;
virtual void reset();