aboutsummaryrefslogtreecommitdiff
path: root/src/flash/common.h
diff options
context:
space:
mode:
authorTomas Vanek <vanekt@fbl.cz>2016-07-18 22:59:17 +0200
committerPaul Fertser <fercerpav@gmail.com>2016-12-08 12:19:19 +0000
commit4732471b2e122357403fbcaa53fb712db0d8235e (patch)
treeb58055bfdc6148ddaca395e9e33c95c61d7489e0 /src/flash/common.h
parent25d7ba19c9e70cf5b912f660cf6aaa93d9ca120f (diff)
downloadriscv-openocd-4732471b2e122357403fbcaa53fb712db0d8235e.zip
riscv-openocd-4732471b2e122357403fbcaa53fb712db0d8235e.tar.gz
riscv-openocd-4732471b2e122357403fbcaa53fb712db0d8235e.tar.bz2
flash/nor: at91samd protection bits write fix
Flash protection set on a device with MANW=1 was lost after reset. Since #2903 the driver honored MANW bit and issued Write Page command just for main flash write. This change adds similar technique to samd_modify_user_row(). Minor code improvements: samd_check_error() returns error code corresponding to error type instead of bool. samd_check_error() does not clear STATUS register if no error bit is set. Eliminated double error check in call sequence samd_issue_nvmctrl_command() folowed by samd_check_error(). Missing error code ERROR_FLASH_PROTECTED added to src/flash/common.h. Change-Id: Icf59ab8803305d0cb3170c8a5089b8f9828b99f8 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/3550 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Diffstat (limited to 'src/flash/common.h')
-rw-r--r--src/flash/common.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/flash/common.h b/src/flash/common.h
index ce26fcc..4244f13 100644
--- a/src/flash/common.h
+++ b/src/flash/common.h
@@ -44,5 +44,6 @@ bool flash_driver_name_matches(const char *name, const char *expected);
#define ERROR_FLASH_SECTOR_NOT_ERASED (-906)
#define ERROR_FLASH_BANK_NOT_PROBED (-907)
#define ERROR_FLASH_OPER_UNSUPPORTED (-908)
+#define ERROR_FLASH_PROTECTED (-909)
#endif /* OPENOCD_FLASH_COMMON_H */