flash/nor/at91samd: Use 32-bit register writes for ST-Link compat at91samd-stlink master
authorKeith Packard <keithp@keithp.com>
Wed, 28 Sep 2022 21:02:52 +0000 (14:02 -0700)
committerKeith Packard <keithp@keithp.com>
Wed, 28 Sep 2022 22:08:05 +0000 (15:08 -0700)
commitc9a93b2b01d29cdcada09967ab72f2ba52a54129
treeb9e2bd6ea3ebb55fdee61cc2d18deb611bcbffda
parentae937791d35b0820e0bc9bf0ab134c2bebd113e4
flash/nor/at91samd: Use 32-bit register writes for ST-Link compat

ST-Link v2 dongles can be used with many cortex-m parts, but they have
one limitation -- they can only perform 8-bit and 32-bit writes to the
target. 16-bit writes are done using a pair of 8-bit writes. While not
usually an issue, in the case of the at91samd flash driver, the 16-bit
'command' register must have both halves written in the same
operation.

Fortunately, this register has two pad bytes above it in the address
space, making it safe to always access with 32-bit operations.

Change-Id: I44b0db9406982a8db5818c0533d3101618741db2
Signed-off-by: Keith Packard <keithp@keithp.com>
src/flash/nor/at91samd.c