aboutsummaryrefslogtreecommitdiff
path: root/tcl
diff options
context:
space:
mode:
authorluca vinci <luca.vinci@st.com>2019-11-05 08:45:04 +0100
committerTomas Vanek <vanekt@fbl.cz>2020-03-07 15:31:02 +0000
commit6bc0a77a6e1a1146c44785812595250857fc7307 (patch)
tree0cdb4b492c07559343c8fa271b18ee871c7030df /tcl
parenta2e822834df52efef5e1bbcb91a6eb1afbf102db (diff)
downloadriscv-openocd-6bc0a77a6e1a1146c44785812595250857fc7307.zip
riscv-openocd-6bc0a77a6e1a1146c44785812595250857fc7307.tar.gz
riscv-openocd-6bc0a77a6e1a1146c44785812595250857fc7307.tar.bz2
bluenrg-x: added support for BlueNRG-LP device
Extended bluenrg-x flash driver with BlueNRG-LP flash controller. Changes include: - register set for the flash controller - made software structure prone to support more easily future devices - updated target config file Change-Id: I2e2dc70db32cf98c62e3a43f2e44a4600a25ac5b Signed-off-by: luca vinci <luca.vinci@st.com> Reviewed-on: http://openocd.zylin.com/5343 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Diffstat (limited to 'tcl')
-rw-r--r--tcl/board/steval-idb011v1.cfg3
-rw-r--r--tcl/target/bluenrg-x.cfg40
2 files changed, 26 insertions, 17 deletions
diff --git a/tcl/board/steval-idb011v1.cfg b/tcl/board/steval-idb011v1.cfg
new file mode 100644
index 0000000..5988c63
--- /dev/null
+++ b/tcl/board/steval-idb011v1.cfg
@@ -0,0 +1,3 @@
+# This is an evaluation board with a single BlueNRG-LP chip.
+set CHIPNAME bluenrg-lp
+source [find target/bluenrg-x.cfg]
diff --git a/tcl/target/bluenrg-x.cfg b/tcl/target/bluenrg-x.cfg
index 109db17..691bbbf 100644
--- a/tcl/target/bluenrg-x.cfg
+++ b/tcl/target/bluenrg-x.cfg
@@ -1,8 +1,9 @@
#
-# bluenrg-1/2 devices support only SWD transports.
+# bluenrg-1/2 and bluenrg-lp devices support only SWD transports.
#
source [find target/swj-dp.tcl]
+source [find mem_helper.tcl]
if { [info exists CHIPNAME] } {
set _CHIPNAME $CHIPNAME
@@ -53,22 +54,27 @@ if {![using_hla]} {
}
$_TARGETNAME configure -event halted {
- global WDOG_VALUE
- global WDOG_VALUE_SET
- # Stop watchdog during halt, if enabled
- mem2array value 32 0x40700008 1
- set WDOG_VALUE [expr ($value(0))]
- if [expr ($value(0) & (1 << 1))] {
- set WDOG_VALUE_SET 1
- mww 0x40700008 [expr ($value(0) & 0xFFFFFFFD)]
- }
+ global WDOG_VALUE
+ global WDOG_VALUE_SET
+ set _JTAG_IDCODE [mrw 0x40000004]
+ if {$_JTAG_IDCODE != 0x0201E041} {
+ # Stop watchdog during halt, if enabled. Only Bluenrg-1/2
+ set WDOG_VALUE [mrw 0x40700008]
+ if [expr ($WDOG_VALUE & (1 << 1))] {
+ set WDOG_VALUE_SET 1
+ mww 0x40700008 [expr ($WDOG_VALUE & 0xFFFFFFFD)]
+ }
+ }
}
$_TARGETNAME configure -event resumed {
- global WDOG_VALUE
- global WDOG_VALUE_SET
- if [expr $WDOG_VALUE_SET] {
- # Restore watchdog enable value after resume
- mww 0x40700008 $WDOG_VALUE
- set WDOG_VALUE_SET 0
- }
+ global WDOG_VALUE
+ global WDOG_VALUE_SET
+ set _JTAG_IDCODE [mrw 0x40000004]
+ if {$_JTAG_IDCODE != 0x0201E041} {
+ if [expr $WDOG_VALUE_SET] {
+ # Restore watchdog enable value after resume. Only Bluenrg-1/2
+ mww 0x40700008 $WDOG_VALUE
+ set WDOG_VALUE_SET 0
+ }
+ }
}