flash/nor: at91samd protection bits write fix 50/3550/2
authorTomas Vanek <vanekt@fbl.cz>
Mon, 18 Jul 2016 20:59:17 +0000 (22:59 +0200)
committerPaul Fertser <fercerpav@gmail.com>
Thu, 8 Dec 2016 12:19:19 +0000 (12:19 +0000)
commit4732471b2e122357403fbcaa53fb712db0d8235e
treeb58055bfdc6148ddaca395e9e33c95c61d7489e0
parent25d7ba19c9e70cf5b912f660cf6aaa93d9ca120f
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>
src/flash/common.h
src/flash/nor/at91samd.c

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)