aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2019-12-02 11:53:37 -0800
committerGitHub <noreply@github.com>2019-12-02 11:53:37 -0800
commit39234b7491c05e98f84d981f1c7bb6aea005ab30 (patch)
treebe2e81376414f1162670fd715ae2f5bfb273af44
parent053c956619ace234de7257f4503d921efd80074e (diff)
downloadriscv-tests-39234b7491c05e98f84d981f1c7bb6aea005ab30.zip
riscv-tests-39234b7491c05e98f84d981f1c7bb6aea005ab30.tar.gz
riscv-tests-39234b7491c05e98f84d981f1c7bb6aea005ab30.tar.bz2
Use a small binary to set up HiFive Unleashed. (#221)
This binary comes from https://github.com/timsifive/freedom-u540-c000-bootloader/tree/board_setup2, which will hopefully be accepted upstream.
-rw-r--r--debug/targets/SiFive/HiFiveUnleashed-flash.lds2
-rw-r--r--debug/targets/SiFive/HiFiveUnleashed.cfg18
-rwxr-xr-xdebug/targets/SiFive/HiFiveUnleashed_setup.binbin0 -> 25296 bytes
3 files changed, 10 insertions, 10 deletions
diff --git a/debug/targets/SiFive/HiFiveUnleashed-flash.lds b/debug/targets/SiFive/HiFiveUnleashed-flash.lds
index b8bf92a..fa30c6a 100644
--- a/debug/targets/SiFive/HiFiveUnleashed-flash.lds
+++ b/debug/targets/SiFive/HiFiveUnleashed-flash.lds
@@ -3,7 +3,7 @@ OUTPUT_ARCH( "riscv" )
SECTIONS
{
. = 0x20000000;
- .text :
+ .text :
{
*(.text.entry)
*(.text)
diff --git a/debug/targets/SiFive/HiFiveUnleashed.cfg b/debug/targets/SiFive/HiFiveUnleashed.cfg
index d883914..3aa5538 100644
--- a/debug/targets/SiFive/HiFiveUnleashed.cfg
+++ b/debug/targets/SiFive/HiFiveUnleashed.cfg
@@ -35,11 +35,6 @@ gdb_report_register_access_error enable
# behavior.
riscv expose_csrs 2288
-#>>>
-reset_config trst_and_srst
-adapter_nsrst_assert_width 100
-#<<<
-
flash bank onboard_spi_flash fespi 0x20000000 0 0 0 $_TARGETNAME_0 0x10040000
init
@@ -53,12 +48,17 @@ foreach t $targets {
$t configure -event gdb-flash-write-end ""
}
-reset
+reset halt
-halt
+# Use a modified bootloader to configure the hardware, especially the DDR controller.
+load_image targets/SiFive/HiFiveUnleashed_setup.bin 0x08000000
+foreach t [target names] {
+ targets $t
+ reg pc 0x08000000
+}
+resume
+wait_halt
# Uncomment this if you want to be able to clobber your SPI Flash, which
# probably you don't since you can do it through Linux
#flash protect 0 0 last off
-
-echo "Ready for Remote Connections"
diff --git a/debug/targets/SiFive/HiFiveUnleashed_setup.bin b/debug/targets/SiFive/HiFiveUnleashed_setup.bin
new file mode 100755
index 0000000..893e574
--- /dev/null
+++ b/debug/targets/SiFive/HiFiveUnleashed_setup.bin
Binary files differ