diff options
author | Nathaniel Graff <nathaniel.graff@sifive.com> | 2019-06-21 21:05:11 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-21 21:05:11 +0000 |
commit | 543c5f1122f39fc5791a31bc3c8d714108acf8d1 (patch) | |
tree | e810c8fe1496b26a55cb9de24a4d78cbecafd850 | |
parent | e126922df3d5ac193d34b9a3b8bcb88625adec4a (diff) | |
parent | 9b807f144969bed818e1f14d0cfdcfc277f492c5 (diff) |
Merge pull request #293 from sifive/update-targets
Update BSPs
40 files changed, 178 insertions, 176 deletions
diff --git a/bsp/freedom-e310-arty/metal-inline.h b/bsp/freedom-e310-arty/metal-inline.h index 5dbb494..9210e60 100644 --- a/bsp/freedom-e310-arty/metal-inline.h +++ b/bsp/freedom-e310-arty/metal-inline.h @@ -5,8 +5,8 @@ #ifndef ASSEMBLY -#ifndef FREEDOM_E310_ARTY__METAL_INLINE_H -#define FREEDOM_E310_ARTY__METAL_INLINE_H +#ifndef FREEDOM_E310_ARTY____METAL_INLINE_H +#define FREEDOM_E310_ARTY____METAL_INLINE_H #include <metal/machine.h> @@ -192,5 +192,5 @@ struct __metal_driver_sifive_uart0 __metal_dt_serial_10013000 = { }; -#endif /* FREEDOM_E310_ARTY__METAL_INLINE_H*/ +#endif /* FREEDOM_E310_ARTY____METAL_INLINE_H*/ #endif /* ! ASSEMBLY */ diff --git a/bsp/freedom-e310-arty/metal-platform.h b/bsp/freedom-e310-arty/metal-platform.h index 74de271..c7b3539 100644 --- a/bsp/freedom-e310-arty/metal-platform.h +++ b/bsp/freedom-e310-arty/metal-platform.h @@ -3,8 +3,8 @@ /* ----------------------------------- */ /* ----------------------------------- */ -#ifndef FREEDOM_E310_ARTY__METAL_PLATFORM_H -#define FREEDOM_E310_ARTY__METAL_PLATFORM_H +#ifndef FREEDOM_E310_ARTY____METAL_PLATFORM_H +#define FREEDOM_E310_ARTY____METAL_PLATFORM_H /* From clock@0 */ #define METAL_FIXED_CLOCK_0_CLOCK_FREQUENCY 65000000UL @@ -122,4 +122,4 @@ #define METAL_SIFIVE_UART0_IP 20UL #define METAL_SIFIVE_UART0_DIV 24UL -#endif /* FREEDOM_E310_ARTY__METAL_PLATFORM_H*/ +#endif /* FREEDOM_E310_ARTY____METAL_PLATFORM_H*/ diff --git a/bsp/freedom-e310-arty/metal.default.lds b/bsp/freedom-e310-arty/metal.default.lds index 453fd8f..e7e2bb3 100644 --- a/bsp/freedom-e310-arty/metal.default.lds +++ b/bsp/freedom-e310-arty/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/freedom-e310-arty/metal.h b/bsp/freedom-e310-arty/metal.h index 1c54535..dbf2faf 100644 --- a/bsp/freedom-e310-arty/metal.h +++ b/bsp/freedom-e310-arty/metal.h @@ -9,8 +9,8 @@ #ifdef __METAL_MACHINE_MACROS -#ifndef MACROS_IF_FREEDOM_E310_ARTY__METAL_H -#define MACROS_IF_FREEDOM_E310_ARTY__METAL_H +#ifndef MACROS_IF_FREEDOM_E310_ARTY____METAL_H +#define MACROS_IF_FREEDOM_E310_ARTY____METAL_H #define __METAL_CLINT_NUM_PARENTS 2 @@ -31,12 +31,12 @@ #define __METAL_CLIC_SUBINTERRUPTS 0 #endif -#endif /* MACROS_IF_FREEDOM_E310_ARTY__METAL_H*/ +#endif /* MACROS_IF_FREEDOM_E310_ARTY____METAL_H*/ #else /* ! __METAL_MACHINE_MACROS */ -#ifndef MACROS_ELSE_FREEDOM_E310_ARTY__METAL_H -#define MACROS_ELSE_FREEDOM_E310_ARTY__METAL_H +#ifndef MACROS_ELSE_FREEDOM_E310_ARTY____METAL_H +#define MACROS_ELSE_FREEDOM_E310_ARTY____METAL_H #define __METAL_CLINT_2000000_INTERRUPTS 2 @@ -685,7 +685,7 @@ asm (".weak __metal_spi_table"); struct __metal_driver_sifive_spi0 *__metal_spi_table[] = { &__metal_dt_spi_10014000}; -#endif /* MACROS_ELSE_FREEDOM_E310_ARTY__METAL_H*/ +#endif /* MACROS_ELSE_FREEDOM_E310_ARTY____METAL_H*/ #endif /* ! __METAL_MACHINE_MACROS */ diff --git a/bsp/freedom-e310-arty/metal.ramrodata.lds b/bsp/freedom-e310-arty/metal.ramrodata.lds index b9d006b..dc1a78d 100644 --- a/bsp/freedom-e310-arty/metal.ramrodata.lds +++ b/bsp/freedom-e310-arty/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/freedom-e310-arty/metal.scratchpad.lds b/bsp/freedom-e310-arty/metal.scratchpad.lds index 3907de9..00e577c 100644 --- a/bsp/freedom-e310-arty/metal.scratchpad.lds +++ b/bsp/freedom-e310-arty/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/freedom-e310-arty/openocd.cfg b/bsp/freedom-e310-arty/openocd.cfg index ba13207..0a20b89 100644 --- a/bsp/freedom-e310-arty/openocd.cfg +++ b/bsp/freedom-e310-arty/openocd.cfg @@ -1,30 +1,30 @@ +#write_config_file +# JTAG adapter setup adapter_khz 10000 -#source [find interface/ftdi/olimex-arm-usb-tiny-h.cfg] - interface ftdi ftdi_device_desc "Olimex OpenOCD JTAG ARM-USB-TINY-H" ftdi_vid_pid 0x15ba 0x002a ftdi_layout_init 0x0808 0x0a1b ftdi_layout_signal nSRST -oe 0x0200 -ftdi_layout_signal nTRST -data 0x0100 -oe 0x0100 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 -$_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 my_first_flash fespi 0x20000000 0 0 0 $_TARGETNAME 0x10014000 +flash bank spi0 fespi 0x20000000 0 0 0 $_TARGETNAME.0 0x10014000 init -#reset if {[ info exists pulse_srst]} { - ftdi_set_signal nSRST 0 - ftdi_set_signal nSRST z + 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" diff --git a/bsp/qemu-sifive-e31/metal-inline.h b/bsp/qemu-sifive-e31/metal-inline.h index 3f2f6bc..61601c7 100644 --- a/bsp/qemu-sifive-e31/metal-inline.h +++ b/bsp/qemu-sifive-e31/metal-inline.h @@ -5,8 +5,8 @@ #ifndef ASSEMBLY -#ifndef QEMU_SIFIVE_E31__METAL_INLINE_H -#define QEMU_SIFIVE_E31__METAL_INLINE_H +#ifndef QEMU_SIFIVE_E31____METAL_INLINE_H +#define QEMU_SIFIVE_E31____METAL_INLINE_H #include <metal/machine.h> @@ -245,5 +245,5 @@ struct __metal_driver_sifive_fe310_g000_prci __metal_dt_prci_10008000 = { }; -#endif /* QEMU_SIFIVE_E31__METAL_INLINE_H*/ +#endif /* QEMU_SIFIVE_E31____METAL_INLINE_H*/ #endif /* ! ASSEMBLY */ diff --git a/bsp/qemu-sifive-e31/metal-platform.h b/bsp/qemu-sifive-e31/metal-platform.h index 6582722..aebc717 100644 --- a/bsp/qemu-sifive-e31/metal-platform.h +++ b/bsp/qemu-sifive-e31/metal-platform.h @@ -3,8 +3,8 @@ /* ----------------------------------- */ /* ----------------------------------- */ -#ifndef QEMU_SIFIVE_E31__METAL_PLATFORM_H -#define QEMU_SIFIVE_E31__METAL_PLATFORM_H +#ifndef QEMU_SIFIVE_E31____METAL_PLATFORM_H +#define QEMU_SIFIVE_E31____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 /* QEMU_SIFIVE_E31__METAL_PLATFORM_H*/ +#endif /* QEMU_SIFIVE_E31____METAL_PLATFORM_H*/ diff --git a/bsp/qemu-sifive-e31/metal.default.lds b/bsp/qemu-sifive-e31/metal.default.lds index 6bd988b..1f14be5 100644 --- a/bsp/qemu-sifive-e31/metal.default.lds +++ b/bsp/qemu-sifive-e31/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/qemu-sifive-e31/metal.h b/bsp/qemu-sifive-e31/metal.h index b15ce54..1ec4b0b 100644 --- a/bsp/qemu-sifive-e31/metal.h +++ b/bsp/qemu-sifive-e31/metal.h @@ -9,8 +9,8 @@ #ifdef __METAL_MACHINE_MACROS -#ifndef MACROS_IF_QEMU_SIFIVE_E31__METAL_H -#define MACROS_IF_QEMU_SIFIVE_E31__METAL_H +#ifndef MACROS_IF_QEMU_SIFIVE_E31____METAL_H +#define MACROS_IF_QEMU_SIFIVE_E31____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_QEMU_SIFIVE_E31____METAL_H*/ #else /* ! __METAL_MACHINE_MACROS */ -#ifndef MACROS_ELSE_SIFIVE_HIFIVE1__METAL_H -#define MACROS_ELSE_SIFIVE_HIFIVE1__METAL_H +#ifndef MACROS_ELSE_QEMU_SIFIVE_E31____METAL_H +#define MACROS_ELSE_QEMU_SIFIVE_E31____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_QEMU_SIFIVE_E31__METAL_H*/ +#endif /* MACROS_ELSE_QEMU_SIFIVE_E31____METAL_H*/ #endif /* ! __METAL_MACHINE_MACROS */ diff --git a/bsp/qemu-sifive-e31/metal.ramrodata.lds b/bsp/qemu-sifive-e31/metal.ramrodata.lds index 3322e4a..9f25258 100644 --- a/bsp/qemu-sifive-e31/metal.ramrodata.lds +++ b/bsp/qemu-sifive-e31/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/qemu-sifive-e31/metal.scratchpad.lds b/bsp/qemu-sifive-e31/metal.scratchpad.lds index 14e64ea..6eceaaf 100644 --- a/bsp/qemu-sifive-e31/metal.scratchpad.lds +++ b/bsp/qemu-sifive-e31/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/qemu-sifive-s51/design.dts b/bsp/qemu-sifive-s51/design.dts index 083653e..fce4a4a 100644 --- a/bsp/qemu-sifive-s51/design.dts +++ b/bsp/qemu-sifive-s51/design.dts @@ -50,7 +50,7 @@ clock-frequency = <16000000>; }; hfxoscout: clock@1 { - compatible = "sifive,fs510-g000,hfxosc"; + compatible = "sifive,fe310-g000,hfxosc"; clocks = <&hfxoscin>; reg = <&prci 0x4>; reg-names = "config"; @@ -61,13 +61,13 @@ clock-frequency = <72000000>; }; hfroscout: clock@3 { - compatible = "sifive,fs510-g000,hfrosc"; + compatible = "sifive,fe310-g000,hfrosc"; clocks = <&hfroscin>; reg = <&prci 0x0>; reg-names = "config"; }; hfclk: clock@4 { - compatible = "sifive,fs510-g000,pll"; + compatible = "sifive,fe310-g000,pll"; clocks = <&hfxoscout &hfroscout>; clock-names = "pllref", "pllsel0"; reg = <&prci 0x8 &prci 0xc>; @@ -81,7 +81,7 @@ clock-frequency = <32000000>; }; lfclk: clock@6 { - compatible = "sifive,fs510-g000,lfrosc"; + compatible = "sifive,fe310-g000,lfrosc"; clocks = <&lfroscin>; reg = <&aon 0x70>; reg-names = "config"; @@ -94,7 +94,7 @@ }; prci: prci@10008000 { - compatible = "sifive,fs510-g000,prci"; + compatible = "sifive,fe310-g000,prci"; reg = <0x10008000 0x8000>; reg-names = "mem"; }; diff --git a/bsp/qemu-sifive-s51/metal-inline.h b/bsp/qemu-sifive-s51/metal-inline.h index eafd455..6ef4db2 100644 --- a/bsp/qemu-sifive-s51/metal-inline.h +++ b/bsp/qemu-sifive-s51/metal-inline.h @@ -5,8 +5,8 @@ #ifndef ASSEMBLY -#ifndef QEMU_SIFIVE_S51__METAL_INLINE_H -#define QEMU_SIFIVE_S51__METAL_INLINE_H +#ifndef QEMU_SIFIVE_S51____METAL_INLINE_H +#define QEMU_SIFIVE_S51____METAL_INLINE_H #include <metal/machine.h> @@ -245,5 +245,5 @@ struct __metal_driver_sifive_fe310_g000_prci __metal_dt_prci_10008000 = { }; -#endif /* QEMU_SIFIVE_S51__METAL_INLINE_H*/ +#endif /* QEMU_SIFIVE_S51____METAL_INLINE_H*/ #endif /* ! ASSEMBLY */ diff --git a/bsp/qemu-sifive-s51/metal-platform.h b/bsp/qemu-sifive-s51/metal-platform.h index 650fdbd..fae3cf9 100644 --- a/bsp/qemu-sifive-s51/metal-platform.h +++ b/bsp/qemu-sifive-s51/metal-platform.h @@ -3,8 +3,8 @@ /* ----------------------------------- */ /* ----------------------------------- */ -#ifndef QEMU_SIFIVE_S51__METAL_PLATFORM_H -#define QEMU_SIFIVE_S51__METAL_PLATFORM_H +#ifndef QEMU_SIFIVE_S51____METAL_PLATFORM_H +#define QEMU_SIFIVE_S51____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 /* QEMU_SIFIVE_S51__METAL_PLATFORM_H*/ +#endif /* QEMU_SIFIVE_S51____METAL_PLATFORM_H*/ diff --git a/bsp/qemu-sifive-s51/metal.default.lds b/bsp/qemu-sifive-s51/metal.default.lds index 6bd988b..1f14be5 100644 --- a/bsp/qemu-sifive-s51/metal.default.lds +++ b/bsp/qemu-sifive-s51/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/qemu-sifive-s51/metal.h b/bsp/qemu-sifive-s51/metal.h index 3d3df92..e61ca6e 100644 --- a/bsp/qemu-sifive-s51/metal.h +++ b/bsp/qemu-sifive-s51/metal.h @@ -9,8 +9,8 @@ #ifdef __METAL_MACHINE_MACROS -#ifndef MACROS_IF_QEMU_SIFIVE_S51__METAL_H -#define MACROS_IF_QEMU_SIFIVE_S51__METAL_H +#ifndef MACROS_IF_QEMU_SIFIVE_S51____METAL_H +#define MACROS_IF_QEMU_SIFIVE_S51____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_QEMU_SIFIVE_S51____METAL_H*/ #else /* ! __METAL_MACHINE_MACROS */ -#ifndef MACROS_ELSE_SIFIVE_HIFIVE1__METAL_H -#define MACROS_ELSE_SIFIVE_HIFIVE1__METAL_H +#ifndef MACROS_ELSE_QEMU_SIFIVE_S51____METAL_H +#define MACROS_ELSE_QEMU_SIFIVE_S51____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_QEMU_SIFIVE_S51__METAL_H*/ +#endif /* MACROS_ELSE_QEMU_SIFIVE_S51____METAL_H*/ #endif /* ! __METAL_MACHINE_MACROS */ diff --git a/bsp/qemu-sifive-s51/metal.ramrodata.lds b/bsp/qemu-sifive-s51/metal.ramrodata.lds index 3322e4a..9f25258 100644 --- a/bsp/qemu-sifive-s51/metal.ramrodata.lds +++ b/bsp/qemu-sifive-s51/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/qemu-sifive-s51/metal.scratchpad.lds b/bsp/qemu-sifive-s51/metal.scratchpad.lds index 14e64ea..6eceaaf 100644 --- a/bsp/qemu-sifive-s51/metal.scratchpad.lds +++ b/bsp/qemu-sifive-s51/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/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" diff --git a/bsp/sifive-hifive1-revb/metal-inline.h b/bsp/sifive-hifive1-revb/metal-inline.h index 7f3f0b3..f8f03d0 100644 --- a/bsp/sifive-hifive1-revb/metal-inline.h +++ b/bsp/sifive-hifive1-revb/metal-inline.h @@ -5,8 +5,8 @@ #ifndef ASSEMBLY -#ifndef SIFIVE_HIFIVE1_REVB__METAL_INLINE_H -#define SIFIVE_HIFIVE1_REVB__METAL_INLINE_H +#ifndef SIFIVE_HIFIVE1_REVB____METAL_INLINE_H +#define SIFIVE_HIFIVE1_REVB____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_REVB__METAL_INLINE_H*/ +#endif /* SIFIVE_HIFIVE1_REVB____METAL_INLINE_H*/ #endif /* ! ASSEMBLY */ diff --git a/bsp/sifive-hifive1-revb/metal-platform.h b/bsp/sifive-hifive1-revb/metal-platform.h index e655c4f..4ecd3e3 100644 --- a/bsp/sifive-hifive1-revb/metal-platform.h +++ b/bsp/sifive-hifive1-revb/metal-platform.h @@ -3,8 +3,8 @@ /* ----------------------------------- */ /* ----------------------------------- */ -#ifndef SIFIVE_HIFIVE1_REVB__METAL_PLATFORM_H -#define SIFIVE_HIFIVE1_REVB__METAL_PLATFORM_H +#ifndef SIFIVE_HIFIVE1_REVB____METAL_PLATFORM_H +#define SIFIVE_HIFIVE1_REVB____METAL_PLATFORM_H /* From clock@0 */ #define METAL_FIXED_CLOCK_0_CLOCK_FREQUENCY 16000000UL @@ -234,4 +234,4 @@ #define METAL_SIFIVE_UART0_IP 20UL #define METAL_SIFIVE_UART0_DIV 24UL -#endif /* SIFIVE_HIFIVE1_REVB__METAL_PLATFORM_H*/ +#endif /* SIFIVE_HIFIVE1_REVB____METAL_PLATFORM_H*/ diff --git a/bsp/sifive-hifive1-revb/metal.default.lds b/bsp/sifive-hifive1-revb/metal.default.lds index 436d900..a283078 100644 --- a/bsp/sifive-hifive1-revb/metal.default.lds +++ b/bsp/sifive-hifive1-revb/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-revb/metal.h b/bsp/sifive-hifive1-revb/metal.h index 2aae566..de9f454 100644 --- a/bsp/sifive-hifive1-revb/metal.h +++ b/bsp/sifive-hifive1-revb/metal.h @@ -9,8 +9,8 @@ #ifdef __METAL_MACHINE_MACROS -#ifndef MACROS_IF_SIFIVE_HIFIVE1_REVB__METAL_H -#define MACROS_IF_SIFIVE_HIFIVE1_REVB__METAL_H +#ifndef MACROS_IF_SIFIVE_HIFIVE1_REVB____METAL_H +#define MACROS_IF_SIFIVE_HIFIVE1_REVB____METAL_H #define __METAL_CLINT_NUM_PARENTS 2 @@ -31,12 +31,12 @@ #define __METAL_CLIC_SUBINTERRUPTS 0 #endif -#endif /* MACROS_IF_SIFIVE_HIFIVE1_REVB__METAL_H*/ +#endif /* MACROS_IF_SIFIVE_HIFIVE1_REVB____METAL_H*/ #else /* ! __METAL_MACHINE_MACROS */ -#ifndef MACROS_ELSE_SIFIVE_HIFIVE1_REVB__METAL_H -#define MACROS_ELSE_SIFIVE_HIFIVE1_REVB__METAL_H +#ifndef MACROS_ELSE_SIFIVE_HIFIVE1_REVB____METAL_H +#define MACROS_ELSE_SIFIVE_HIFIVE1_REVB____METAL_H #define __METAL_CLINT_2000000_INTERRUPTS 2 @@ -865,7 +865,7 @@ struct __metal_driver_sifive_spi0 *__metal_spi_table[] = { #define __METAL_DT_CLOCK_4_HANDLE (&__metal_dt_clock_4) -#endif /* MACROS_ELSE_SIFIVE_HIFIVE1_REVB__METAL_H*/ +#endif /* MACROS_ELSE_SIFIVE_HIFIVE1_REVB____METAL_H*/ #endif /* ! __METAL_MACHINE_MACROS */ diff --git a/bsp/sifive-hifive1-revb/metal.ramrodata.lds b/bsp/sifive-hifive1-revb/metal.ramrodata.lds index 7c7e684..dab49ee 100644 --- a/bsp/sifive-hifive1-revb/metal.ramrodata.lds +++ b/bsp/sifive-hifive1-revb/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-revb/metal.scratchpad.lds b/bsp/sifive-hifive1-revb/metal.scratchpad.lds index 84ba106..44a1c71 100644 --- a/bsp/sifive-hifive1-revb/metal.scratchpad.lds +++ b/bsp/sifive-hifive1-revb/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/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" |