aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorJeff Ciesielski <jeffciesielski@gmail.com>2015-01-21 18:57:59 -0800
committerFreddie Chopin <freddie.chopin@gmail.com>2015-11-11 12:08:35 +0000
commit33b048d456e24b9944ff2261cf26b05d630bdd41 (patch)
tree595d052232f9a7dc32d8fa0473b06961684931cc /contrib
parent42c24acebd23d758c543c9bf2c2b97bdbd083c35 (diff)
downloadriscv-openocd-33b048d456e24b9944ff2261cf26b05d630bdd41.zip
riscv-openocd-33b048d456e24b9944ff2261cf26b05d630bdd41.tar.gz
riscv-openocd-33b048d456e24b9944ff2261cf26b05d630bdd41.tar.bz2
flash: New driver for XMC4xxx microcontroller family
This is a complete flash driver for the Infineon XMC4xxx family of microcontrollers, based on the TMS570 driver by Andrey Yurovsky. The driver attempts to discover the particular variant of MCU via a combination of the SCU register (to determine if this is indeed an XMC4xxx part) and the FLASH0_ID register (to determine the variant). If this fails, the driver will not load. The driver has been added to the README and documentation. Tests: * Hardware: XMC4500 (XMC4500_relax), XMC4200 (XMC4200 enterprise) * SWD + JTAG * Binary: 144k, 1M Note: * Flash protect only partly tested. These parts only allow the flash protection registers (UCB) to be written 4 times total, and my devkits have run out of uses (more on the way) Future Work: * User 1/2(permalock) locking support via custom command * In-memory flash loader bootstrap (flashing is rather slow...) Change-Id: I1d3345d5255d8de8dc4175cf987eb4a037a8cf7f Signed-off-by: Jeff Ciesielski <jeffciesielski@gmail.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-on: http://openocd.zylin.com/2488 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/loaders/erase_check/armv7m_0_erase_check.s45
1 files changed, 45 insertions, 0 deletions
diff --git a/contrib/loaders/erase_check/armv7m_0_erase_check.s b/contrib/loaders/erase_check/armv7m_0_erase_check.s
new file mode 100644
index 0000000..6b1e92a
--- /dev/null
+++ b/contrib/loaders/erase_check/armv7m_0_erase_check.s
@@ -0,0 +1,45 @@
+/***************************************************************************
+ * Copyright (C) 2014 by Jeff Ciesielski *
+ * jeffciesielski@gmail.com *
+ * *
+ * Based on the armv7m erase checker by: *
+ * Copyright (C) 2010 by Spencer Oliver *
+ * spen@spen-soft.co.uk *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ ***************************************************************************/
+
+/*
+ parameters:
+ r0 - address in
+ r1 - byte count
+ r2 - mask - result out
+*/
+
+ .text
+ .syntax unified
+ .cpu cortex-m0
+ .thumb
+ .thumb_func
+
+ .align 2
+
+loop:
+ ldrb r3, [r0]
+ adds r0, #1
+ orrs r2, r2, r3
+ subs r1, r1, #1
+ bne loop
+end:
+ bkpt #0
+
+ .end