summaryrefslogtreecommitdiff
path: root/bsp/sifive-hifive-unleashed
diff options
context:
space:
mode:
authorNathaniel Graff <nathaniel.graff@sifive.com>2019-06-21 13:56:00 -0700
committerNathaniel Graff <nathaniel.graff@sifive.com>2019-06-21 14:00:24 -0700
commit9b807f144969bed818e1f14d0cfdcfc277f492c5 (patch)
tree36ded917b89e0dcf3727a62acd68b758d2e756cb /bsp/sifive-hifive-unleashed
parent3624375a5d3beaa0ae95b71dff739cdab9cb9ccd (diff)
Update targets
Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
Diffstat (limited to 'bsp/sifive-hifive-unleashed')
-rw-r--r--bsp/sifive-hifive-unleashed/metal-inline.h6
-rw-r--r--bsp/sifive-hifive-unleashed/metal-platform.h6
-rw-r--r--bsp/sifive-hifive-unleashed/metal.default.lds6
-rw-r--r--bsp/sifive-hifive-unleashed/metal.h12
-rw-r--r--bsp/sifive-hifive-unleashed/metal.ramrodata.lds6
-rw-r--r--bsp/sifive-hifive-unleashed/metal.scratchpad.lds6
-rw-r--r--bsp/sifive-hifive-unleashed/openocd.cfg30
7 files changed, 39 insertions, 33 deletions
diff --git a/bsp/sifive-hifive-unleashed/metal-inline.h b/bsp/sifive-hifive-unleashed/metal-inline.h
index 35f523a..5911a7d 100644
--- a/bsp/sifive-hifive-unleashed/metal-inline.h
+++ b/bsp/sifive-hifive-unleashed/metal-inline.h
@@ -5,8 +5,8 @@
#ifndef ASSEMBLY
-#ifndef SIFIVE_HIFIVE_UNLEASHED__METAL_INLINE_H
-#define SIFIVE_HIFIVE_UNLEASHED__METAL_INLINE_H
+#ifndef SIFIVE_HIFIVE_UNLEASHED____METAL_INLINE_H
+#define SIFIVE_HIFIVE_UNLEASHED____METAL_INLINE_H
#include <metal/machine.h>
@@ -337,5 +337,5 @@ struct __metal_driver_sifive_fu540_c000_l2 __metal_dt_cache_controller_2010000 =
};
-#endif /* SIFIVE_HIFIVE_UNLEASHED__METAL_INLINE_H*/
+#endif /* SIFIVE_HIFIVE_UNLEASHED____METAL_INLINE_H*/
#endif /* ! ASSEMBLY */
diff --git a/bsp/sifive-hifive-unleashed/metal-platform.h b/bsp/sifive-hifive-unleashed/metal-platform.h
index 282a92a..8b4ed50 100644
--- a/bsp/sifive-hifive-unleashed/metal-platform.h
+++ b/bsp/sifive-hifive-unleashed/metal-platform.h
@@ -3,8 +3,8 @@
/* ----------------------------------- */
/* ----------------------------------- */
-#ifndef SIFIVE_HIFIVE_UNLEASHED__METAL_PLATFORM_H
-#define SIFIVE_HIFIVE_UNLEASHED__METAL_PLATFORM_H
+#ifndef SIFIVE_HIFIVE_UNLEASHED____METAL_PLATFORM_H
+#define SIFIVE_HIFIVE_UNLEASHED____METAL_PLATFORM_H
/* From refclk */
#define METAL_FIXED_CLOCK__CLOCK_FREQUENCY 33333333UL
@@ -182,4 +182,4 @@
#define METAL_SIFIVE_UART0_IP 20UL
#define METAL_SIFIVE_UART0_DIV 24UL
-#endif /* SIFIVE_HIFIVE_UNLEASHED__METAL_PLATFORM_H*/
+#endif /* SIFIVE_HIFIVE_UNLEASHED____METAL_PLATFORM_H*/
diff --git a/bsp/sifive-hifive-unleashed/metal.default.lds b/bsp/sifive-hifive-unleashed/metal.default.lds
index d2f011e..15e837f 100644
--- a/bsp/sifive-hifive-unleashed/metal.default.lds
+++ b/bsp/sifive-hifive-unleashed/metal.default.lds
@@ -94,12 +94,12 @@ SECTIONS
} >flash AT>flash :flash
- .finit_array :
+ .fini_array :
{
- PROVIDE_HIDDEN (__finit_array_start = .);
+ PROVIDE_HIDDEN (__fini_array_start = .);
KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
- PROVIDE_HIDDEN (__finit_array_end = .);
+ PROVIDE_HIDDEN (__fini_array_end = .);
} >flash AT>flash :flash
diff --git a/bsp/sifive-hifive-unleashed/metal.h b/bsp/sifive-hifive-unleashed/metal.h
index 1cd2e0c..8d63c92 100644
--- a/bsp/sifive-hifive-unleashed/metal.h
+++ b/bsp/sifive-hifive-unleashed/metal.h
@@ -9,8 +9,8 @@
#ifdef __METAL_MACHINE_MACROS
-#ifndef MACROS_IF_SIFIVE_HIFIVE_UNLEASHED__METAL_H
-#define MACROS_IF_SIFIVE_HIFIVE_UNLEASHED__METAL_H
+#ifndef MACROS_IF_SIFIVE_HIFIVE_UNLEASHED____METAL_H
+#define MACROS_IF_SIFIVE_HIFIVE_UNLEASHED____METAL_H
#define __METAL_CLINT_NUM_PARENTS 10
@@ -31,12 +31,12 @@
#define __METAL_CLIC_SUBINTERRUPTS 0
#endif
-#endif /* MACROS_IF_SIFIVE_HIFIVE_UNLEASHED__METAL_H*/
+#endif /* MACROS_IF_SIFIVE_HIFIVE_UNLEASHED____METAL_H*/
#else /* ! __METAL_MACHINE_MACROS */
-#ifndef MACROS_ELSE_SIFIVE_HIFIVE_UNLEASHED__METAL_H
-#define MACROS_ELSE_SIFIVE_HIFIVE_UNLEASHED__METAL_H
+#ifndef MACROS_ELSE_SIFIVE_HIFIVE_UNLEASHED____METAL_H
+#define MACROS_ELSE_SIFIVE_HIFIVE_UNLEASHED____METAL_H
#define __METAL_CLINT_2000000_INTERRUPTS 10
@@ -861,7 +861,7 @@ struct __metal_driver_sifive_spi0 *__metal_spi_table[] = {
#define __METAL_DT_CACHE_CONTROLLER_2010000_HANDLE (&__metal_dt_cache_controller_2010000)
-#endif /* MACROS_ELSE_SIFIVE_HIFIVE_UNLEASHED__METAL_H*/
+#endif /* MACROS_ELSE_SIFIVE_HIFIVE_UNLEASHED____METAL_H*/
#endif /* ! __METAL_MACHINE_MACROS */
diff --git a/bsp/sifive-hifive-unleashed/metal.ramrodata.lds b/bsp/sifive-hifive-unleashed/metal.ramrodata.lds
index 241ff9e..3f686f0 100644
--- a/bsp/sifive-hifive-unleashed/metal.ramrodata.lds
+++ b/bsp/sifive-hifive-unleashed/metal.ramrodata.lds
@@ -75,12 +75,12 @@ SECTIONS
} >flash AT>flash :flash
- .finit_array :
+ .fini_array :
{
- PROVIDE_HIDDEN (__finit_array_start = .);
+ PROVIDE_HIDDEN (__fini_array_start = .);
KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
- PROVIDE_HIDDEN (__finit_array_end = .);
+ PROVIDE_HIDDEN (__fini_array_end = .);
} >flash AT>flash :flash
diff --git a/bsp/sifive-hifive-unleashed/metal.scratchpad.lds b/bsp/sifive-hifive-unleashed/metal.scratchpad.lds
index 200c127..72d5164 100644
--- a/bsp/sifive-hifive-unleashed/metal.scratchpad.lds
+++ b/bsp/sifive-hifive-unleashed/metal.scratchpad.lds
@@ -94,12 +94,12 @@ SECTIONS
} >ram AT>ram :ram
- .finit_array :
+ .fini_array :
{
- PROVIDE_HIDDEN (__finit_array_start = .);
+ PROVIDE_HIDDEN (__fini_array_start = .);
KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
- PROVIDE_HIDDEN (__finit_array_end = .);
+ PROVIDE_HIDDEN (__fini_array_end = .);
} >ram AT>ram :ram
diff --git a/bsp/sifive-hifive-unleashed/openocd.cfg b/bsp/sifive-hifive-unleashed/openocd.cfg
index 7589897..cfebf1c 100644
--- a/bsp/sifive-hifive-unleashed/openocd.cfg
+++ b/bsp/sifive-hifive-unleashed/openocd.cfg
@@ -1,24 +1,30 @@
+#write_config_file
+# JTAG adapter setup
adapter_khz 10000
interface ftdi
-ftdi_device_desc "Dual RS232-HS"
-ftdi_vid_pid 0x0403 0x6010
+ftdi_device_desc "Olimex OpenOCD JTAG ARM-USB-TINY-H"
+ftdi_vid_pid 0x15ba 0x002a
-ftdi_layout_init 0x0008 0x001b
-ftdi_layout_signal nSRST -oe 0x0020 -data 0x0020
+ftdi_layout_init 0x0808 0x0a1b
+ftdi_layout_signal nSRST -oe 0x0200
+ftdi_layout_signal LED -data 0x0800
set _CHIPNAME riscv
jtag newtap $_CHIPNAME cpu -irlen 5
set _TARGETNAME $_CHIPNAME.cpu
-target create $_TARGETNAME riscv -chain-position $_TARGETNAME -rtos riscv
-$_TARGETNAME configure -work-area-phys 0x80000000 -work-area-size 10000 -work-area-backup 1
+target create $_TARGETNAME.0 riscv -chain-position $_TARGETNAME
+$_TARGETNAME.0 configure -work-area-phys 0x80000000 -work-area-size 10000 -work-area-backup 1
-flash bank onboard_spi_flash fespi 0x20000000 0 0 0 $_TARGETNAME 0x10040000
-init
+flash bank spi0 fespi 0x20000000 0 0 0 $_TARGETNAME.0 0x10040000
+init
+if {[ info exists pulse_srst]} {
+ ftdi_set_signal nSRST 0
+ ftdi_set_signal nSRST z
+sleep 1500
+}
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
+flash protect 0 64 last off
+echo "Ready for Remote Connections"