at91samd: add erase/secure commands, minor fix
authorAndrey Yurovsky <yurovsky@gmail.com>
Wed, 6 Aug 2014 21:28:37 +0000 (14:28 -0700)
committerSpencer Oliver <spen@spen-soft.co.uk>
Mon, 6 Oct 2014 11:56:27 +0000 (11:56 +0000)
commit592d0d514d6602ae9c91cda7e4271c28222a25f6
treef411653e99384f01917554a1c0578f2148bbc506
parentec9ccaa288491a5ec09da96e07d7cba3aee981c9
at91samd: add erase/secure commands, minor fix

Reference code for the SAMD2x disables caching in the NVM controller when
issuing NVM commands.  Let's do this as well to be consistent and safer.

Add a "chip-erase" for the Atmel SAMD targets that issues a complete Chip Erase
via the Device Service Unit (DSU).  This can be used to "unlock" or otherwise
unbrick a chip that can't be halted or inspected, allowing the user to reflash
with new firmware.

Add a "set-security" command which issues an SSB.  Once that's done and the
device is power-cycled, the flash cannot be written to until a "chip-erase" is
issued.  The chip-erase cannot be issued by openocd at this time because
the device will not respond to a request for the DAP IDCODE.

Change-Id: I80122f0bbf7e3aedffe052c1e77d69dc2dba25ed
Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com>
Reviewed-on: http://openocd.zylin.com/2239
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
doc/openocd.texi
src/flash/nor/at91samd.c