flash: at91samd: Add SAML21 variant B device support and fix SAMC20/SAMC21
authorAndreas Loehre <alohre@gmail.com>
Thu, 6 Aug 2015 17:41:10 +0000 (19:41 +0200)
committerSpencer Oliver <spen@spen-soft.co.uk>
Fri, 20 Nov 2015 18:26:47 +0000 (18:26 +0000)
commitb5fa1e4d7779ca3a7f3de7d5cd3f0732ec8a11ff
treefa00f07eaec658350428c0f1bc6fa6924bf4d5d5
parent72c3464be42088dc75245cf2fcc8f5c6e6959b4b
flash: at91samd: Add SAML21 variant B device support and fix SAMC20/SAMC21

This adds support for the Atmel SAML21 variant B parts.
There is minimal change between the two variants, but in
variant B the automatic page write which the at91samd flash
driver relies on to be enabled is disabled by default.
With this patch the write row function will now issue a page write
command after each of the four pages in the row if the MANW (manual
write) bit is set. This also fixes flash write for the SAMC20/SAMC21
devices which have the MANW bit set by default as well.

I have also moved the device ID (DID) register bitfield extraction
from the find_part into helper macros. These can be used in the future
if there are more workarounds for specific devices.

Tested (programming) on:
ATSAML21-XPRO
ATSAML21-XPRO-B
SAMC21 Xplained Pro
SAMD21 Xplained Pro
SAMD20 Xplained Pro

Change-Id: I401a8aa1efd64730840c0d62cf49a1e880ea5900
Signed-off-by: Andreas Loehre <alohre@gmail.com>
Reviewed-on: http://openocd.zylin.com/2903
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
src/flash/nor/at91samd.c