From 39234b7491c05e98f84d981f1c7bb6aea005ab30 Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Mon, 2 Dec 2019 11:53:37 -0800 Subject: 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. --- debug/targets/SiFive/HiFiveUnleashed-flash.lds | 2 +- debug/targets/SiFive/HiFiveUnleashed.cfg | 18 +++++++++--------- debug/targets/SiFive/HiFiveUnleashed_setup.bin | Bin 0 -> 25296 bytes 3 files changed, 10 insertions(+), 10 deletions(-) create mode 100755 debug/targets/SiFive/HiFiveUnleashed_setup.bin 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 Binary files /dev/null and b/debug/targets/SiFive/HiFiveUnleashed_setup.bin differ -- cgit v1.1