summaryrefslogtreecommitdiff
path: root/bsp/sifive-hifive1
diff options
context:
space:
mode:
authorNathaniel Graff <nathaniel.graff@sifive.com>2019-06-21 21:05:11 +0000
committerGitHub <noreply@github.com>2019-06-21 21:05:11 +0000
commit543c5f1122f39fc5791a31bc3c8d714108acf8d1 (patch)
treee810c8fe1496b26a55cb9de24a4d78cbecafd850 /bsp/sifive-hifive1
parente126922df3d5ac193d34b9a3b8bcb88625adec4a (diff)
parent9b807f144969bed818e1f14d0cfdcfc277f492c5 (diff)
Merge pull request #293 from sifive/update-targets
Update BSPs
Diffstat (limited to 'bsp/sifive-hifive1')
-rw-r--r--bsp/sifive-hifive1/metal-inline.h6
-rw-r--r--bsp/sifive-hifive1/metal-platform.h6
-rw-r--r--bsp/sifive-hifive1/metal.default.lds6
-rw-r--r--bsp/sifive-hifive1/metal.h12
-rw-r--r--bsp/sifive-hifive1/metal.ramrodata.lds6
-rw-r--r--bsp/sifive-hifive1/metal.scratchpad.lds6
-rw-r--r--bsp/sifive-hifive1/openocd.cfg40
7 files changed, 39 insertions, 43 deletions
diff --git a/bsp/sifive-hifive1/metal-inline.h b/bsp/sifive-hifive1/metal-inline.h
index 9964a06..0deb10b 100644
--- a/bsp/sifive-hifive1/metal-inline.h
+++ b/bsp/sifive-hifive1/metal-inline.h
@@ -5,8 +5,8 @@
#ifndef ASSEMBLY
-#ifndef SIFIVE_HIFIVE1__METAL_INLINE_H
-#define SIFIVE_HIFIVE1__METAL_INLINE_H
+#ifndef SIFIVE_HIFIVE1____METAL_INLINE_H
+#define SIFIVE_HIFIVE1____METAL_INLINE_H
#include <metal/machine.h>
@@ -245,5 +245,5 @@ struct __metal_driver_sifive_fe310_g000_prci __metal_dt_prci_10008000 = {
};
-#endif /* SIFIVE_HIFIVE1__METAL_INLINE_H*/
+#endif /* SIFIVE_HIFIVE1____METAL_INLINE_H*/
#endif /* ! ASSEMBLY */
diff --git a/bsp/sifive-hifive1/metal-platform.h b/bsp/sifive-hifive1/metal-platform.h
index 2a0ab77..a2517bd 100644
--- a/bsp/sifive-hifive1/metal-platform.h
+++ b/bsp/sifive-hifive1/metal-platform.h
@@ -3,8 +3,8 @@
/* ----------------------------------- */
/* ----------------------------------- */
-#ifndef SIFIVE_HIFIVE1__METAL_PLATFORM_H
-#define SIFIVE_HIFIVE1__METAL_PLATFORM_H
+#ifndef SIFIVE_HIFIVE1____METAL_PLATFORM_H
+#define SIFIVE_HIFIVE1____METAL_PLATFORM_H
/* From clock@0 */
#define METAL_FIXED_CLOCK_0_CLOCK_FREQUENCY 16000000UL
@@ -219,4 +219,4 @@
#define METAL_SIFIVE_UART0_IP 20UL
#define METAL_SIFIVE_UART0_DIV 24UL
-#endif /* SIFIVE_HIFIVE1__METAL_PLATFORM_H*/
+#endif /* SIFIVE_HIFIVE1____METAL_PLATFORM_H*/
diff --git a/bsp/sifive-hifive1/metal.default.lds b/bsp/sifive-hifive1/metal.default.lds
index 6bd988b..1f14be5 100644
--- a/bsp/sifive-hifive1/metal.default.lds
+++ b/bsp/sifive-hifive1/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-hifive1/metal.h b/bsp/sifive-hifive1/metal.h
index 2ca004f..792a88a 100644
--- a/bsp/sifive-hifive1/metal.h
+++ b/bsp/sifive-hifive1/metal.h
@@ -9,8 +9,8 @@
#ifdef __METAL_MACHINE_MACROS
-#ifndef MACROS_IF_SIFIVE_HIFIVE1__METAL_H
-#define MACROS_IF_SIFIVE_HIFIVE1__METAL_H
+#ifndef MACROS_IF_SIFIVE_HIFIVE1____METAL_H
+#define MACROS_IF_SIFIVE_HIFIVE1____METAL_H
#define __METAL_CLINT_NUM_PARENTS 2
@@ -31,12 +31,12 @@
#define __METAL_CLIC_SUBINTERRUPTS 0
#endif
-#endif /* MACROS_IF_SIFIVE_HIFIVE1__METAL_H*/
+#endif /* MACROS_IF_SIFIVE_HIFIVE1____METAL_H*/
#else /* ! __METAL_MACHINE_MACROS */
-#ifndef MACROS_ELSE_SIFIVE_HIFIVE1__METAL_H
-#define MACROS_ELSE_SIFIVE_HIFIVE1__METAL_H
+#ifndef MACROS_ELSE_SIFIVE_HIFIVE1____METAL_H
+#define MACROS_ELSE_SIFIVE_HIFIVE1____METAL_H
#define __METAL_CLINT_2000000_INTERRUPTS 2
@@ -861,7 +861,7 @@ struct __metal_driver_sifive_spi0 *__metal_spi_table[] = {
#define __METAL_DT_CLOCK_4_HANDLE (&__metal_dt_clock_4)
-#endif /* MACROS_ELSE_SIFIVE_HIFIVE1__METAL_H*/
+#endif /* MACROS_ELSE_SIFIVE_HIFIVE1____METAL_H*/
#endif /* ! __METAL_MACHINE_MACROS */
diff --git a/bsp/sifive-hifive1/metal.ramrodata.lds b/bsp/sifive-hifive1/metal.ramrodata.lds
index 3322e4a..9f25258 100644
--- a/bsp/sifive-hifive1/metal.ramrodata.lds
+++ b/bsp/sifive-hifive1/metal.ramrodata.lds
@@ -74,12 +74,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-hifive1/metal.scratchpad.lds b/bsp/sifive-hifive1/metal.scratchpad.lds
index 14e64ea..6eceaaf 100644
--- a/bsp/sifive-hifive1/metal.scratchpad.lds
+++ b/bsp/sifive-hifive1/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-hifive1/openocd.cfg b/bsp/sifive-hifive1/openocd.cfg
index b531e9c..0a20b89 100644
--- a/bsp/sifive-hifive1/openocd.cfg
+++ b/bsp/sifive-hifive1/openocd.cfg
@@ -1,34 +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
-
-#Reset Stretcher logic on FE310 is ~1 second long
-#This doesn't apply if you use
-# ftdi_set_signal, but still good to document
-#adapter_nsrst_delay 1500
+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 -expected-id 0x10e31913
+jtag newtap $_CHIPNAME cpu -irlen 5
set _TARGETNAME $_CHIPNAME.cpu
-target create $_TARGETNAME riscv -chain-position $_TARGETNAME
-$_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
+flash bank spi0 fespi 0x20000000 0 0 0 $_TARGETNAME.0 0x10014000
init
-#reset -- This type of reset is not implemented yet
if {[ info exists pulse_srst]} {
- ftdi_set_signal nSRST 0
- ftdi_set_signal nSRST z
- #Wait for the reset stretcher
- #It will work without this, but
- #will incur lots of delays for later commands.
- sleep 1500
-}
+ ftdi_set_signal nSRST 0
+ ftdi_set_signal nSRST z
+sleep 1500
+}
halt
-#flash protect 0 64 last off
+
+flash protect 0 64 last off
+echo "Ready for Remote Connections"