From 7e91d97828973b667880a5f22d62887e0405f0fd Mon Sep 17 00:00:00 2001 From: Gwenhael Goavec-Merou Date: Wed, 22 Dec 2021 19:03:57 +0100 Subject: [PATCH] device.hpp: add (un)protect flash methods --- src/device.hpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/device.hpp b/src/device.hpp index 1a5dc8e..68eb19f 100644 --- a/src/device.hpp +++ b/src/device.hpp @@ -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();