diff --git a/bsp/freedom-e310-arty/README.md b/bsp/freedom-e310-arty/README.md new file mode 100644 index 000000000..281e24dcb --- /dev/null +++ b/bsp/freedom-e310-arty/README.md @@ -0,0 +1,14 @@ +The [Freedom E310 Arty](https://github.com/sifive/freedom) is a completely open-source +implementation of RISC-V using the Rocket Chip Generator, designed for use with +the [Digilent Arty FPGA Evaluation Kit](https://www.xilinx.com/products/boards-and-kits/arty.html). + +This target is ideal for getting familiarize with RISC-V ISA instructions set and +freedom-metal libraries. It supports: + +- 1 hart with RV32IMAC core +- 4 hardware breakpoints +- 16 local interrupts signal that can be connected to off core complex devices +- Up to 26 PLIC interrupt signals that can be connected to off core complex devices, with 7 priority levels +- GPIO with 16 interrupt lines +- SPI memory with 1 interrupt line +- Serial port with 1 interrupt line diff --git a/bsp/freedom-e310-arty/metal-inline.h b/bsp/freedom-e310-arty/metal-inline.h index 6801113d4..124848065 100644 --- a/bsp/freedom-e310-arty/metal-inline.h +++ b/bsp/freedom-e310-arty/metal-inline.h @@ -40,6 +40,7 @@ extern __inline__ int __metal_driver_sifive_plic0_num_interrupts(struct metal_in extern __inline__ int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller); extern __inline__ struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx); extern __inline__ int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx); +extern __inline__ int __metal_driver_sifive_plic0_context_ids(int hartid); /* --------------------- sifive_clic0 ------------ */ @@ -85,6 +86,8 @@ extern __inline__ unsigned long __metal_driver_sifive_spi0_pinmux_source_selecto /* --------------------- sifive_test0 ------------ */ +/* --------------------- sifive_trace ------------ */ + /* --------------------- sifive_uart0 ------------ */ extern __inline__ unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart); extern __inline__ unsigned long __metal_driver_sifive_uart0_control_size(struct metal_uart *uart); diff --git a/bsp/freedom-e310-arty/metal-platform.h b/bsp/freedom-e310-arty/metal-platform.h index c7b353995..d0b8aeff3 100644 --- a/bsp/freedom-e310-arty/metal-platform.h +++ b/bsp/freedom-e310-arty/metal-platform.h @@ -36,8 +36,11 @@ #define METAL_RISCV_PLIC0_PRIORITY_BASE 0UL #define METAL_RISCV_PLIC0_PENDING_BASE 4096UL #define METAL_RISCV_PLIC0_ENABLE_BASE 8192UL -#define METAL_RISCV_PLIC0_THRESHOLD 2097152UL -#define METAL_RISCV_PLIC0_CLAIM 2097156UL +#define METAL_RISCV_PLIC0_ENABLE_PER_HART 128UL +#define METAL_RISCV_PLIC0_CONTEXT_BASE 2097152UL +#define METAL_RISCV_PLIC0_CONTEXT_PER_HART 4096UL +#define METAL_RISCV_PLIC0_CONTEXT_THRESHOLD 0UL +#define METAL_RISCV_PLIC0_CONTEXT_CLAIM 4UL /* From gpio@10012000 */ #define METAL_SIFIVE_GPIO0_10012000_BASE_ADDRESS 268509184UL diff --git a/bsp/freedom-e310-arty/metal.default.lds b/bsp/freedom-e310-arty/metal.default.lds index 5c8a1e64f..647548fa1 100644 --- a/bsp/freedom-e310-arty/metal.default.lds +++ b/bsp/freedom-e310-arty/metal.default.lds @@ -23,7 +23,7 @@ SECTIONS __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; + __heap_size = DEFINED(__heap_size) ? __heap_size : 0x800; PROVIDE(__metal_boot_hart = 0); PROVIDE(__metal_chicken_bit = 0); @@ -79,6 +79,10 @@ SECTIONS KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) PROVIDE_HIDDEN (__init_array_end = .); + PROVIDE_HIDDEN ( metal_constructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.init_array.*))); + KEEP (*(.metal.init_array)); + PROVIDE_HIDDEN ( metal_constructors_end = .); } >flash AT>flash :flash .fini_array : { @@ -86,6 +90,10 @@ SECTIONS 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 (__fini_array_end = .); + PROVIDE_HIDDEN ( metal_destructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.fini_array.*))); + KEEP (*(.metal.fini_array)); + PROVIDE_HIDDEN ( metal_destructors_end = .); } >flash AT>flash :flash .ctors : { @@ -94,6 +102,7 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) + KEEP (*(.metal.ctors metal.ctors.*)); } >flash AT>flash :flash .dtors : { @@ -102,39 +111,21 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) + KEEP (*(.metal.dtors metal.dtors.*)); } >flash AT>flash :flash - .litimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - .ditimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - .itim_section : { + .itim : ALIGN(8) { *(.itim .itim.*) } >itim AT>flash :itim_init - PROVIDE( metal_segment_itim_target_end = . ); - + PROVIDE( metal_segment_itim_source_start = LOADADDR(.itim) ); + PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); + PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); - .lalign : { - . = ALIGN(8); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - .dalign : { - . = ALIGN(8); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - .data : { + .data : ALIGN(8) { *(.data .data.*) *(.gnu.linkonce.d.*) . = ALIGN(8); @@ -147,31 +138,30 @@ SECTIONS *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*) + . = ALIGN(8); + *(.rdata) + *(.rodata .rodata.*) + *(.gnu.linkonce.r.*) } >ram AT>flash :ram_init - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); + PROVIDE( metal_segment_data_source_start = LOADADDR(.data) ); + PROVIDE( metal_segment_data_target_start = ADDR(.data) ); + PROVIDE( metal_segment_data_target_end = ADDR(.data) + SIZEOF(.data) ); - . = ALIGN(8); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - .bss : { + .bss : ALIGN(8) { *(.sbss*) *(.gnu.linkonce.sb.*) *(.bss .bss.*) *(.gnu.linkonce.b.*) *(COMMON) } >ram AT>ram :ram - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); + PROVIDE( metal_segment_bss_target_start = ADDR(.bss) ); + PROVIDE( metal_segment_bss_target_end = ADDR(.bss) + SIZEOF(.bss) ); .stack : { PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; + . += __stack_size; PROVIDE( _sp = . ); PROVIDE(metal_segment_stack_end = .); } >ram AT>ram :ram diff --git a/bsp/freedom-e310-arty/metal.h b/bsp/freedom-e310-arty/metal.h index 615eb3028..d1f055526 100644 --- a/bsp/freedom-e310-arty/metal.h +++ b/bsp/freedom-e310-arty/metal.h @@ -294,6 +294,16 @@ static __inline__ int __metal_driver_sifive_plic0_interrupt_lines(struct metal_i } } +static __inline__ int __metal_driver_sifive_plic0_context_ids(int hartid) +{ + if (hartid == 0) { + return 0; + } + else { + return -1; + } +} + /* --------------------- sifive_clic0 ------------ */ @@ -554,6 +564,8 @@ static __inline__ unsigned long __metal_driver_sifive_spi0_pinmux_source_selecto /* --------------------- sifive_test0 ------------ */ +/* --------------------- sifive_trace ------------ */ + /* --------------------- sifive_uart0 ------------ */ static __inline__ unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart) { diff --git a/bsp/freedom-e310-arty/metal.ramrodata.lds b/bsp/freedom-e310-arty/metal.ramrodata.lds index 8a6d3c4b3..a384dae46 100644 --- a/bsp/freedom-e310-arty/metal.ramrodata.lds +++ b/bsp/freedom-e310-arty/metal.ramrodata.lds @@ -23,7 +23,7 @@ SECTIONS __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; + __heap_size = DEFINED(__heap_size) ? __heap_size : 0x800; PROVIDE(__metal_boot_hart = 0); PROVIDE(__metal_chicken_bit = 0); @@ -65,6 +65,10 @@ SECTIONS KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) PROVIDE_HIDDEN (__init_array_end = .); + PROVIDE_HIDDEN ( metal_constructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.init_array.*))); + KEEP (*(.metal.init_array)); + PROVIDE_HIDDEN ( metal_constructors_end = .); } >flash AT>flash :flash .fini_array : { @@ -72,6 +76,10 @@ SECTIONS 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 (__fini_array_end = .); + PROVIDE_HIDDEN ( metal_destructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.fini_array.*))); + KEEP (*(.metal.fini_array)); + PROVIDE_HIDDEN ( metal_destructors_end = .); } >flash AT>flash :flash .ctors : { @@ -80,6 +88,7 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) + KEEP (*(.metal.ctors metal.ctors.*)); } >flash AT>flash :flash .dtors : { @@ -88,39 +97,21 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) + KEEP (*(.metal.dtors metal.dtors.*)); } >flash AT>flash :flash - .litimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - .ditimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - .itim_section : { + .itim : ALIGN(8) { *(.itim .itim.*) } >itim AT>flash :itim_init - PROVIDE( metal_segment_itim_target_end = . ); - + PROVIDE( metal_segment_itim_source_start = LOADADDR(.itim) ); + PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); + PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); - .lalign : { - . = ALIGN(8); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - .dalign : { - . = ALIGN(8); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - .data : { + .data : ALIGN(8) { *(.data .data.*) *(.gnu.linkonce.d.*) . = ALIGN(8); @@ -133,31 +124,30 @@ SECTIONS *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*) + . = ALIGN(8); + *(.rdata) + *(.rodata .rodata.*) + *(.gnu.linkonce.r.*) } >ram AT>flash :ram_init - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); + PROVIDE( metal_segment_data_source_start = LOADADDR(.data) ); + PROVIDE( metal_segment_data_target_start = ADDR(.data) ); + PROVIDE( metal_segment_data_target_end = ADDR(.data) + SIZEOF(.data) ); - . = ALIGN(8); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - .bss : { + .bss : ALIGN(8) { *(.sbss*) *(.gnu.linkonce.sb.*) *(.bss .bss.*) *(.gnu.linkonce.b.*) *(COMMON) } >ram AT>ram :ram - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); + PROVIDE( metal_segment_bss_target_start = ADDR(.bss) ); + PROVIDE( metal_segment_bss_target_end = ADDR(.bss) + SIZEOF(.bss) ); .stack : { PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; + . += __stack_size; PROVIDE( _sp = . ); PROVIDE(metal_segment_stack_end = .); } >ram AT>ram :ram diff --git a/bsp/freedom-e310-arty/metal.scratchpad.lds b/bsp/freedom-e310-arty/metal.scratchpad.lds index 4ee5461eb..d3e1ecb8e 100644 --- a/bsp/freedom-e310-arty/metal.scratchpad.lds +++ b/bsp/freedom-e310-arty/metal.scratchpad.lds @@ -21,7 +21,7 @@ SECTIONS __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; + __heap_size = DEFINED(__heap_size) ? __heap_size : 0x800; PROVIDE(__metal_boot_hart = 0); PROVIDE(__metal_chicken_bit = 0); @@ -77,6 +77,10 @@ SECTIONS KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) PROVIDE_HIDDEN (__init_array_end = .); + PROVIDE_HIDDEN ( metal_constructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.init_array.*))); + KEEP (*(.metal.init_array)); + PROVIDE_HIDDEN ( metal_constructors_end = .); } >ram AT>ram :ram .fini_array : { @@ -84,6 +88,10 @@ SECTIONS 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 (__fini_array_end = .); + PROVIDE_HIDDEN ( metal_destructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.fini_array.*))); + KEEP (*(.metal.fini_array)); + PROVIDE_HIDDEN ( metal_destructors_end = .); } >ram AT>ram :ram .ctors : { @@ -92,6 +100,7 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) + KEEP (*(.metal.ctors metal.ctors.*)); } >ram AT>ram :ram .dtors : { @@ -100,39 +109,21 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) + KEEP (*(.metal.dtors metal.dtors.*)); } >ram AT>ram :ram - .litimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - .ditimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>ram :itim_init - - .itim_section : { + .itim : ALIGN(8) { *(.itim .itim.*) } >itim AT>ram :itim_init - PROVIDE( metal_segment_itim_target_end = . ); - + PROVIDE( metal_segment_itim_source_start = LOADADDR(.itim) ); + PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); + PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); - .lalign : { - . = ALIGN(8); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - .dalign : { - . = ALIGN(8); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - .data : { + .data : ALIGN(8) { *(.data .data.*) *(.gnu.linkonce.d.*) . = ALIGN(8); @@ -145,31 +136,30 @@ SECTIONS *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*) + . = ALIGN(8); + *(.rdata) + *(.rodata .rodata.*) + *(.gnu.linkonce.r.*) } >ram AT>ram :ram_init - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); + PROVIDE( metal_segment_data_source_start = LOADADDR(.data) ); + PROVIDE( metal_segment_data_target_start = ADDR(.data) ); + PROVIDE( metal_segment_data_target_end = ADDR(.data) + SIZEOF(.data) ); - . = ALIGN(8); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - .bss : { + .bss : ALIGN(8) { *(.sbss*) *(.gnu.linkonce.sb.*) *(.bss .bss.*) *(.gnu.linkonce.b.*) *(COMMON) } >ram AT>ram :ram - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); + PROVIDE( metal_segment_bss_target_start = ADDR(.bss) ); + PROVIDE( metal_segment_bss_target_end = ADDR(.bss) + SIZEOF(.bss) ); .stack : { PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; + . += __stack_size; PROVIDE( _sp = . ); PROVIDE(metal_segment_stack_end = .); } >ram AT>ram :ram diff --git a/bsp/qemu-sifive-e31/metal-inline.h b/bsp/qemu-sifive-e31/metal-inline.h index 47d4446ca..f857900a6 100644 --- a/bsp/qemu-sifive-e31/metal-inline.h +++ b/bsp/qemu-sifive-e31/metal-inline.h @@ -40,6 +40,7 @@ extern __inline__ int __metal_driver_sifive_plic0_num_interrupts(struct metal_in extern __inline__ int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller); extern __inline__ struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx); extern __inline__ int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx); +extern __inline__ int __metal_driver_sifive_plic0_context_ids(int hartid); /* --------------------- sifive_clic0 ------------ */ @@ -93,6 +94,8 @@ extern __inline__ unsigned long __metal_driver_sifive_spi0_pinmux_source_selecto /* --------------------- sifive_test0 ------------ */ +/* --------------------- sifive_trace ------------ */ + /* --------------------- sifive_uart0 ------------ */ extern __inline__ unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart); extern __inline__ unsigned long __metal_driver_sifive_uart0_control_size(struct metal_uart *uart); diff --git a/bsp/qemu-sifive-e31/metal-platform.h b/bsp/qemu-sifive-e31/metal-platform.h index 53a83c2fd..0424fc598 100644 --- a/bsp/qemu-sifive-e31/metal-platform.h +++ b/bsp/qemu-sifive-e31/metal-platform.h @@ -42,8 +42,11 @@ #define METAL_RISCV_PLIC0_PRIORITY_BASE 0UL #define METAL_RISCV_PLIC0_PENDING_BASE 4096UL #define METAL_RISCV_PLIC0_ENABLE_BASE 8192UL -#define METAL_RISCV_PLIC0_THRESHOLD 2097152UL -#define METAL_RISCV_PLIC0_CLAIM 2097156UL +#define METAL_RISCV_PLIC0_ENABLE_PER_HART 128UL +#define METAL_RISCV_PLIC0_CONTEXT_BASE 2097152UL +#define METAL_RISCV_PLIC0_CONTEXT_PER_HART 4096UL +#define METAL_RISCV_PLIC0_CONTEXT_THRESHOLD 0UL +#define METAL_RISCV_PLIC0_CONTEXT_CLAIM 4UL /* From aon@10000000 */ #define METAL_SIFIVE_AON0_10000000_BASE_ADDRESS 268435456UL diff --git a/bsp/qemu-sifive-e31/metal.default.lds b/bsp/qemu-sifive-e31/metal.default.lds index c113e982b..f5089e03d 100644 --- a/bsp/qemu-sifive-e31/metal.default.lds +++ b/bsp/qemu-sifive-e31/metal.default.lds @@ -22,7 +22,7 @@ SECTIONS __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; + __heap_size = DEFINED(__heap_size) ? __heap_size : 0x800; PROVIDE(__metal_boot_hart = 0); PROVIDE(__metal_chicken_bit = 0); @@ -78,6 +78,10 @@ SECTIONS KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) PROVIDE_HIDDEN (__init_array_end = .); + PROVIDE_HIDDEN ( metal_constructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.init_array.*))); + KEEP (*(.metal.init_array)); + PROVIDE_HIDDEN ( metal_constructors_end = .); } >flash AT>flash :flash .fini_array : { @@ -85,6 +89,10 @@ SECTIONS 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 (__fini_array_end = .); + PROVIDE_HIDDEN ( metal_destructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.fini_array.*))); + KEEP (*(.metal.fini_array)); + PROVIDE_HIDDEN ( metal_destructors_end = .); } >flash AT>flash :flash .ctors : { @@ -93,6 +101,7 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) + KEEP (*(.metal.ctors metal.ctors.*)); } >flash AT>flash :flash .dtors : { @@ -101,39 +110,21 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) + KEEP (*(.metal.dtors metal.dtors.*)); } >flash AT>flash :flash - .litimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - .ditimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>flash :itim_init - - .itim_section : { + .itim : ALIGN(8) { *(.itim .itim.*) } >ram AT>flash :itim_init - PROVIDE( metal_segment_itim_target_end = . ); - + PROVIDE( metal_segment_itim_source_start = LOADADDR(.itim) ); + PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); + PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); - .lalign : { - . = ALIGN(8); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - .dalign : { - . = ALIGN(8); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - .data : { + .data : ALIGN(8) { *(.data .data.*) *(.gnu.linkonce.d.*) . = ALIGN(8); @@ -146,31 +137,30 @@ SECTIONS *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*) + . = ALIGN(8); + *(.rdata) + *(.rodata .rodata.*) + *(.gnu.linkonce.r.*) } >ram AT>flash :ram_init - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); + PROVIDE( metal_segment_data_source_start = LOADADDR(.data) ); + PROVIDE( metal_segment_data_target_start = ADDR(.data) ); + PROVIDE( metal_segment_data_target_end = ADDR(.data) + SIZEOF(.data) ); - . = ALIGN(8); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - .bss : { + .bss : ALIGN(8) { *(.sbss*) *(.gnu.linkonce.sb.*) *(.bss .bss.*) *(.gnu.linkonce.b.*) *(COMMON) } >ram AT>ram :ram - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); + PROVIDE( metal_segment_bss_target_start = ADDR(.bss) ); + PROVIDE( metal_segment_bss_target_end = ADDR(.bss) + SIZEOF(.bss) ); .stack : { PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; + . += __stack_size; PROVIDE( _sp = . ); PROVIDE(metal_segment_stack_end = .); } >ram AT>ram :ram diff --git a/bsp/qemu-sifive-e31/metal.h b/bsp/qemu-sifive-e31/metal.h index 0811caa15..87a3f1ddb 100644 --- a/bsp/qemu-sifive-e31/metal.h +++ b/bsp/qemu-sifive-e31/metal.h @@ -342,6 +342,16 @@ static __inline__ int __metal_driver_sifive_plic0_interrupt_lines(struct metal_i } } +static __inline__ int __metal_driver_sifive_plic0_context_ids(int hartid) +{ + if (hartid == 0) { + return 0; + } + else { + return -1; + } +} + /* --------------------- sifive_clic0 ------------ */ @@ -700,6 +710,8 @@ static __inline__ unsigned long __metal_driver_sifive_spi0_pinmux_source_selecto /* --------------------- sifive_test0 ------------ */ +/* --------------------- sifive_trace ------------ */ + /* --------------------- sifive_uart0 ------------ */ static __inline__ unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart) { diff --git a/bsp/qemu-sifive-e31/metal.ramrodata.lds b/bsp/qemu-sifive-e31/metal.ramrodata.lds index c7713f47f..fbdfe8381 100644 --- a/bsp/qemu-sifive-e31/metal.ramrodata.lds +++ b/bsp/qemu-sifive-e31/metal.ramrodata.lds @@ -22,7 +22,7 @@ SECTIONS __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; + __heap_size = DEFINED(__heap_size) ? __heap_size : 0x800; PROVIDE(__metal_boot_hart = 0); PROVIDE(__metal_chicken_bit = 0); @@ -64,6 +64,10 @@ SECTIONS KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) PROVIDE_HIDDEN (__init_array_end = .); + PROVIDE_HIDDEN ( metal_constructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.init_array.*))); + KEEP (*(.metal.init_array)); + PROVIDE_HIDDEN ( metal_constructors_end = .); } >flash AT>flash :flash .fini_array : { @@ -71,6 +75,10 @@ SECTIONS 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 (__fini_array_end = .); + PROVIDE_HIDDEN ( metal_destructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.fini_array.*))); + KEEP (*(.metal.fini_array)); + PROVIDE_HIDDEN ( metal_destructors_end = .); } >flash AT>flash :flash .ctors : { @@ -79,6 +87,7 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) + KEEP (*(.metal.ctors metal.ctors.*)); } >flash AT>flash :flash .dtors : { @@ -87,39 +96,21 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) + KEEP (*(.metal.dtors metal.dtors.*)); } >flash AT>flash :flash - .litimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - .ditimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>flash :itim_init - - .itim_section : { + .itim : ALIGN(8) { *(.itim .itim.*) } >ram AT>flash :itim_init - PROVIDE( metal_segment_itim_target_end = . ); - + PROVIDE( metal_segment_itim_source_start = LOADADDR(.itim) ); + PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); + PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); - .lalign : { - . = ALIGN(8); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - .dalign : { - . = ALIGN(8); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - .data : { + .data : ALIGN(8) { *(.data .data.*) *(.gnu.linkonce.d.*) . = ALIGN(8); @@ -132,31 +123,30 @@ SECTIONS *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*) + . = ALIGN(8); + *(.rdata) + *(.rodata .rodata.*) + *(.gnu.linkonce.r.*) } >ram AT>flash :ram_init - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); + PROVIDE( metal_segment_data_source_start = LOADADDR(.data) ); + PROVIDE( metal_segment_data_target_start = ADDR(.data) ); + PROVIDE( metal_segment_data_target_end = ADDR(.data) + SIZEOF(.data) ); - . = ALIGN(8); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - .bss : { + .bss : ALIGN(8) { *(.sbss*) *(.gnu.linkonce.sb.*) *(.bss .bss.*) *(.gnu.linkonce.b.*) *(COMMON) } >ram AT>ram :ram - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); + PROVIDE( metal_segment_bss_target_start = ADDR(.bss) ); + PROVIDE( metal_segment_bss_target_end = ADDR(.bss) + SIZEOF(.bss) ); .stack : { PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; + . += __stack_size; PROVIDE( _sp = . ); PROVIDE(metal_segment_stack_end = .); } >ram AT>ram :ram diff --git a/bsp/qemu-sifive-e31/metal.scratchpad.lds b/bsp/qemu-sifive-e31/metal.scratchpad.lds index 5667a12d6..fc0aea8f3 100644 --- a/bsp/qemu-sifive-e31/metal.scratchpad.lds +++ b/bsp/qemu-sifive-e31/metal.scratchpad.lds @@ -20,7 +20,7 @@ SECTIONS __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; + __heap_size = DEFINED(__heap_size) ? __heap_size : 0x800; PROVIDE(__metal_boot_hart = 0); PROVIDE(__metal_chicken_bit = 0); @@ -76,6 +76,10 @@ SECTIONS KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) PROVIDE_HIDDEN (__init_array_end = .); + PROVIDE_HIDDEN ( metal_constructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.init_array.*))); + KEEP (*(.metal.init_array)); + PROVIDE_HIDDEN ( metal_constructors_end = .); } >ram AT>ram :ram .fini_array : { @@ -83,6 +87,10 @@ SECTIONS 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 (__fini_array_end = .); + PROVIDE_HIDDEN ( metal_destructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.fini_array.*))); + KEEP (*(.metal.fini_array)); + PROVIDE_HIDDEN ( metal_destructors_end = .); } >ram AT>ram :ram .ctors : { @@ -91,6 +99,7 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) + KEEP (*(.metal.ctors metal.ctors.*)); } >ram AT>ram :ram .dtors : { @@ -99,39 +108,21 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) + KEEP (*(.metal.dtors metal.dtors.*)); } >ram AT>ram :ram - .litimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - .ditimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>ram :itim_init - - .itim_section : { + .itim : ALIGN(8) { *(.itim .itim.*) } >ram AT>ram :itim_init - PROVIDE( metal_segment_itim_target_end = . ); - + PROVIDE( metal_segment_itim_source_start = LOADADDR(.itim) ); + PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); + PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); - .lalign : { - . = ALIGN(8); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - .dalign : { - . = ALIGN(8); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - .data : { + .data : ALIGN(8) { *(.data .data.*) *(.gnu.linkonce.d.*) . = ALIGN(8); @@ -144,31 +135,30 @@ SECTIONS *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*) + . = ALIGN(8); + *(.rdata) + *(.rodata .rodata.*) + *(.gnu.linkonce.r.*) } >ram AT>ram :ram_init - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); + PROVIDE( metal_segment_data_source_start = LOADADDR(.data) ); + PROVIDE( metal_segment_data_target_start = ADDR(.data) ); + PROVIDE( metal_segment_data_target_end = ADDR(.data) + SIZEOF(.data) ); - . = ALIGN(8); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - .bss : { + .bss : ALIGN(8) { *(.sbss*) *(.gnu.linkonce.sb.*) *(.bss .bss.*) *(.gnu.linkonce.b.*) *(COMMON) } >ram AT>ram :ram - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); + PROVIDE( metal_segment_bss_target_start = ADDR(.bss) ); + PROVIDE( metal_segment_bss_target_end = ADDR(.bss) + SIZEOF(.bss) ); .stack : { PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; + . += __stack_size; PROVIDE( _sp = . ); PROVIDE(metal_segment_stack_end = .); } >ram AT>ram :ram diff --git a/bsp/qemu-sifive-s51/metal-inline.h b/bsp/qemu-sifive-s51/metal-inline.h index 8cc902999..3a56477c0 100644 --- a/bsp/qemu-sifive-s51/metal-inline.h +++ b/bsp/qemu-sifive-s51/metal-inline.h @@ -40,6 +40,7 @@ extern __inline__ int __metal_driver_sifive_plic0_num_interrupts(struct metal_in extern __inline__ int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller); extern __inline__ struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx); extern __inline__ int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx); +extern __inline__ int __metal_driver_sifive_plic0_context_ids(int hartid); /* --------------------- sifive_clic0 ------------ */ @@ -93,6 +94,8 @@ extern __inline__ unsigned long __metal_driver_sifive_spi0_pinmux_source_selecto /* --------------------- sifive_test0 ------------ */ +/* --------------------- sifive_trace ------------ */ + /* --------------------- sifive_uart0 ------------ */ extern __inline__ unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart); extern __inline__ unsigned long __metal_driver_sifive_uart0_control_size(struct metal_uart *uart); diff --git a/bsp/qemu-sifive-s51/metal-platform.h b/bsp/qemu-sifive-s51/metal-platform.h index ab227075b..f26163a0d 100644 --- a/bsp/qemu-sifive-s51/metal-platform.h +++ b/bsp/qemu-sifive-s51/metal-platform.h @@ -42,8 +42,11 @@ #define METAL_RISCV_PLIC0_PRIORITY_BASE 0UL #define METAL_RISCV_PLIC0_PENDING_BASE 4096UL #define METAL_RISCV_PLIC0_ENABLE_BASE 8192UL -#define METAL_RISCV_PLIC0_THRESHOLD 2097152UL -#define METAL_RISCV_PLIC0_CLAIM 2097156UL +#define METAL_RISCV_PLIC0_ENABLE_PER_HART 128UL +#define METAL_RISCV_PLIC0_CONTEXT_BASE 2097152UL +#define METAL_RISCV_PLIC0_CONTEXT_PER_HART 4096UL +#define METAL_RISCV_PLIC0_CONTEXT_THRESHOLD 0UL +#define METAL_RISCV_PLIC0_CONTEXT_CLAIM 4UL /* From aon@10000000 */ #define METAL_SIFIVE_AON0_10000000_BASE_ADDRESS 268435456UL diff --git a/bsp/qemu-sifive-s51/metal.default.lds b/bsp/qemu-sifive-s51/metal.default.lds index c113e982b..f5089e03d 100644 --- a/bsp/qemu-sifive-s51/metal.default.lds +++ b/bsp/qemu-sifive-s51/metal.default.lds @@ -22,7 +22,7 @@ SECTIONS __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; + __heap_size = DEFINED(__heap_size) ? __heap_size : 0x800; PROVIDE(__metal_boot_hart = 0); PROVIDE(__metal_chicken_bit = 0); @@ -78,6 +78,10 @@ SECTIONS KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) PROVIDE_HIDDEN (__init_array_end = .); + PROVIDE_HIDDEN ( metal_constructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.init_array.*))); + KEEP (*(.metal.init_array)); + PROVIDE_HIDDEN ( metal_constructors_end = .); } >flash AT>flash :flash .fini_array : { @@ -85,6 +89,10 @@ SECTIONS 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 (__fini_array_end = .); + PROVIDE_HIDDEN ( metal_destructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.fini_array.*))); + KEEP (*(.metal.fini_array)); + PROVIDE_HIDDEN ( metal_destructors_end = .); } >flash AT>flash :flash .ctors : { @@ -93,6 +101,7 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) + KEEP (*(.metal.ctors metal.ctors.*)); } >flash AT>flash :flash .dtors : { @@ -101,39 +110,21 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) + KEEP (*(.metal.dtors metal.dtors.*)); } >flash AT>flash :flash - .litimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - .ditimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>flash :itim_init - - .itim_section : { + .itim : ALIGN(8) { *(.itim .itim.*) } >ram AT>flash :itim_init - PROVIDE( metal_segment_itim_target_end = . ); - + PROVIDE( metal_segment_itim_source_start = LOADADDR(.itim) ); + PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); + PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); - .lalign : { - . = ALIGN(8); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - .dalign : { - . = ALIGN(8); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - .data : { + .data : ALIGN(8) { *(.data .data.*) *(.gnu.linkonce.d.*) . = ALIGN(8); @@ -146,31 +137,30 @@ SECTIONS *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*) + . = ALIGN(8); + *(.rdata) + *(.rodata .rodata.*) + *(.gnu.linkonce.r.*) } >ram AT>flash :ram_init - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); + PROVIDE( metal_segment_data_source_start = LOADADDR(.data) ); + PROVIDE( metal_segment_data_target_start = ADDR(.data) ); + PROVIDE( metal_segment_data_target_end = ADDR(.data) + SIZEOF(.data) ); - . = ALIGN(8); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - .bss : { + .bss : ALIGN(8) { *(.sbss*) *(.gnu.linkonce.sb.*) *(.bss .bss.*) *(.gnu.linkonce.b.*) *(COMMON) } >ram AT>ram :ram - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); + PROVIDE( metal_segment_bss_target_start = ADDR(.bss) ); + PROVIDE( metal_segment_bss_target_end = ADDR(.bss) + SIZEOF(.bss) ); .stack : { PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; + . += __stack_size; PROVIDE( _sp = . ); PROVIDE(metal_segment_stack_end = .); } >ram AT>ram :ram diff --git a/bsp/qemu-sifive-s51/metal.h b/bsp/qemu-sifive-s51/metal.h index f9618554a..84cd31afe 100644 --- a/bsp/qemu-sifive-s51/metal.h +++ b/bsp/qemu-sifive-s51/metal.h @@ -342,6 +342,16 @@ static __inline__ int __metal_driver_sifive_plic0_interrupt_lines(struct metal_i } } +static __inline__ int __metal_driver_sifive_plic0_context_ids(int hartid) +{ + if (hartid == 0) { + return 0; + } + else { + return -1; + } +} + /* --------------------- sifive_clic0 ------------ */ @@ -700,6 +710,8 @@ static __inline__ unsigned long __metal_driver_sifive_spi0_pinmux_source_selecto /* --------------------- sifive_test0 ------------ */ +/* --------------------- sifive_trace ------------ */ + /* --------------------- sifive_uart0 ------------ */ static __inline__ unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart) { diff --git a/bsp/qemu-sifive-s51/metal.ramrodata.lds b/bsp/qemu-sifive-s51/metal.ramrodata.lds index c7713f47f..fbdfe8381 100644 --- a/bsp/qemu-sifive-s51/metal.ramrodata.lds +++ b/bsp/qemu-sifive-s51/metal.ramrodata.lds @@ -22,7 +22,7 @@ SECTIONS __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; + __heap_size = DEFINED(__heap_size) ? __heap_size : 0x800; PROVIDE(__metal_boot_hart = 0); PROVIDE(__metal_chicken_bit = 0); @@ -64,6 +64,10 @@ SECTIONS KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) PROVIDE_HIDDEN (__init_array_end = .); + PROVIDE_HIDDEN ( metal_constructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.init_array.*))); + KEEP (*(.metal.init_array)); + PROVIDE_HIDDEN ( metal_constructors_end = .); } >flash AT>flash :flash .fini_array : { @@ -71,6 +75,10 @@ SECTIONS 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 (__fini_array_end = .); + PROVIDE_HIDDEN ( metal_destructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.fini_array.*))); + KEEP (*(.metal.fini_array)); + PROVIDE_HIDDEN ( metal_destructors_end = .); } >flash AT>flash :flash .ctors : { @@ -79,6 +87,7 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) + KEEP (*(.metal.ctors metal.ctors.*)); } >flash AT>flash :flash .dtors : { @@ -87,39 +96,21 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) + KEEP (*(.metal.dtors metal.dtors.*)); } >flash AT>flash :flash - .litimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - .ditimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>flash :itim_init - - .itim_section : { + .itim : ALIGN(8) { *(.itim .itim.*) } >ram AT>flash :itim_init - PROVIDE( metal_segment_itim_target_end = . ); - + PROVIDE( metal_segment_itim_source_start = LOADADDR(.itim) ); + PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); + PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); - .lalign : { - . = ALIGN(8); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - .dalign : { - . = ALIGN(8); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - .data : { + .data : ALIGN(8) { *(.data .data.*) *(.gnu.linkonce.d.*) . = ALIGN(8); @@ -132,31 +123,30 @@ SECTIONS *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*) + . = ALIGN(8); + *(.rdata) + *(.rodata .rodata.*) + *(.gnu.linkonce.r.*) } >ram AT>flash :ram_init - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); + PROVIDE( metal_segment_data_source_start = LOADADDR(.data) ); + PROVIDE( metal_segment_data_target_start = ADDR(.data) ); + PROVIDE( metal_segment_data_target_end = ADDR(.data) + SIZEOF(.data) ); - . = ALIGN(8); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - .bss : { + .bss : ALIGN(8) { *(.sbss*) *(.gnu.linkonce.sb.*) *(.bss .bss.*) *(.gnu.linkonce.b.*) *(COMMON) } >ram AT>ram :ram - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); + PROVIDE( metal_segment_bss_target_start = ADDR(.bss) ); + PROVIDE( metal_segment_bss_target_end = ADDR(.bss) + SIZEOF(.bss) ); .stack : { PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; + . += __stack_size; PROVIDE( _sp = . ); PROVIDE(metal_segment_stack_end = .); } >ram AT>ram :ram diff --git a/bsp/qemu-sifive-s51/metal.scratchpad.lds b/bsp/qemu-sifive-s51/metal.scratchpad.lds index 5667a12d6..fc0aea8f3 100644 --- a/bsp/qemu-sifive-s51/metal.scratchpad.lds +++ b/bsp/qemu-sifive-s51/metal.scratchpad.lds @@ -20,7 +20,7 @@ SECTIONS __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; + __heap_size = DEFINED(__heap_size) ? __heap_size : 0x800; PROVIDE(__metal_boot_hart = 0); PROVIDE(__metal_chicken_bit = 0); @@ -76,6 +76,10 @@ SECTIONS KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) PROVIDE_HIDDEN (__init_array_end = .); + PROVIDE_HIDDEN ( metal_constructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.init_array.*))); + KEEP (*(.metal.init_array)); + PROVIDE_HIDDEN ( metal_constructors_end = .); } >ram AT>ram :ram .fini_array : { @@ -83,6 +87,10 @@ SECTIONS 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 (__fini_array_end = .); + PROVIDE_HIDDEN ( metal_destructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.fini_array.*))); + KEEP (*(.metal.fini_array)); + PROVIDE_HIDDEN ( metal_destructors_end = .); } >ram AT>ram :ram .ctors : { @@ -91,6 +99,7 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) + KEEP (*(.metal.ctors metal.ctors.*)); } >ram AT>ram :ram .dtors : { @@ -99,39 +108,21 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) + KEEP (*(.metal.dtors metal.dtors.*)); } >ram AT>ram :ram - .litimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - .ditimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>ram :itim_init - - .itim_section : { + .itim : ALIGN(8) { *(.itim .itim.*) } >ram AT>ram :itim_init - PROVIDE( metal_segment_itim_target_end = . ); - + PROVIDE( metal_segment_itim_source_start = LOADADDR(.itim) ); + PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); + PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); - .lalign : { - . = ALIGN(8); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - .dalign : { - . = ALIGN(8); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - .data : { + .data : ALIGN(8) { *(.data .data.*) *(.gnu.linkonce.d.*) . = ALIGN(8); @@ -144,31 +135,30 @@ SECTIONS *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*) + . = ALIGN(8); + *(.rdata) + *(.rodata .rodata.*) + *(.gnu.linkonce.r.*) } >ram AT>ram :ram_init - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); + PROVIDE( metal_segment_data_source_start = LOADADDR(.data) ); + PROVIDE( metal_segment_data_target_start = ADDR(.data) ); + PROVIDE( metal_segment_data_target_end = ADDR(.data) + SIZEOF(.data) ); - . = ALIGN(8); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - .bss : { + .bss : ALIGN(8) { *(.sbss*) *(.gnu.linkonce.sb.*) *(.bss .bss.*) *(.gnu.linkonce.b.*) *(COMMON) } >ram AT>ram :ram - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); + PROVIDE( metal_segment_bss_target_start = ADDR(.bss) ); + PROVIDE( metal_segment_bss_target_end = ADDR(.bss) + SIZEOF(.bss) ); .stack : { PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; + . += __stack_size; PROVIDE( _sp = . ); PROVIDE(metal_segment_stack_end = .); } >ram AT>ram :ram diff --git a/bsp/qemu-sifive-u54/metal-inline.h b/bsp/qemu-sifive-u54/metal-inline.h index 8afa77ec2..ae672fe61 100644 --- a/bsp/qemu-sifive-u54/metal-inline.h +++ b/bsp/qemu-sifive-u54/metal-inline.h @@ -39,6 +39,7 @@ extern __inline__ int __metal_driver_sifive_plic0_num_interrupts(struct metal_in extern __inline__ int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller); extern __inline__ struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx); extern __inline__ int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx); +extern __inline__ int __metal_driver_sifive_plic0_context_ids(int hartid); /* --------------------- sifive_clic0 ------------ */ @@ -71,6 +72,8 @@ extern __inline__ int __metal_driver_sifive_plic0_interrupt_lines(struct metal_i /* --------------------- sifive_test0 ------------ */ +/* --------------------- sifive_trace ------------ */ + /* --------------------- sifive_uart0 ------------ */ extern __inline__ unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart); extern __inline__ unsigned long __metal_driver_sifive_uart0_control_size(struct metal_uart *uart); diff --git a/bsp/qemu-sifive-u54/metal-platform.h b/bsp/qemu-sifive-u54/metal-platform.h index 35aff1d73..10d480b54 100644 --- a/bsp/qemu-sifive-u54/metal-platform.h +++ b/bsp/qemu-sifive-u54/metal-platform.h @@ -31,8 +31,11 @@ #define METAL_RISCV_PLIC0_PRIORITY_BASE 0UL #define METAL_RISCV_PLIC0_PENDING_BASE 4096UL #define METAL_RISCV_PLIC0_ENABLE_BASE 8192UL -#define METAL_RISCV_PLIC0_THRESHOLD 2097152UL -#define METAL_RISCV_PLIC0_CLAIM 2097156UL +#define METAL_RISCV_PLIC0_ENABLE_PER_HART 128UL +#define METAL_RISCV_PLIC0_CONTEXT_BASE 2097152UL +#define METAL_RISCV_PLIC0_CONTEXT_PER_HART 4096UL +#define METAL_RISCV_PLIC0_CONTEXT_THRESHOLD 0UL +#define METAL_RISCV_PLIC0_CONTEXT_CLAIM 4UL /* From test@100000 */ #define METAL_SIFIVE_TEST0_100000_BASE_ADDRESS 1048576UL diff --git a/bsp/qemu-sifive-u54/metal.default.lds b/bsp/qemu-sifive-u54/metal.default.lds index 2ee459d00..45bcdbe8c 100644 --- a/bsp/qemu-sifive-u54/metal.default.lds +++ b/bsp/qemu-sifive-u54/metal.default.lds @@ -22,7 +22,7 @@ SECTIONS __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; + __heap_size = DEFINED(__heap_size) ? __heap_size : 0x800; PROVIDE(__metal_boot_hart = 0); PROVIDE(__metal_chicken_bit = 0); @@ -78,6 +78,10 @@ SECTIONS KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) PROVIDE_HIDDEN (__init_array_end = .); + PROVIDE_HIDDEN ( metal_constructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.init_array.*))); + KEEP (*(.metal.init_array)); + PROVIDE_HIDDEN ( metal_constructors_end = .); } >rom AT>rom :flash .fini_array : { @@ -85,6 +89,10 @@ SECTIONS 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 (__fini_array_end = .); + PROVIDE_HIDDEN ( metal_destructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.fini_array.*))); + KEEP (*(.metal.fini_array)); + PROVIDE_HIDDEN ( metal_destructors_end = .); } >rom AT>rom :flash .ctors : { @@ -93,6 +101,7 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) + KEEP (*(.metal.ctors metal.ctors.*)); } >rom AT>rom :flash .dtors : { @@ -101,39 +110,21 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) + KEEP (*(.metal.dtors metal.dtors.*)); } >rom AT>rom :flash - .litimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_source_start = . ); - } >rom AT>rom :flash - - .ditimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_start = . ); - } >rom AT>rom :itim_init - - .itim_section : { + .itim : ALIGN(8) { *(.itim .itim.*) } >rom AT>rom :itim_init - PROVIDE( metal_segment_itim_target_end = . ); - + PROVIDE( metal_segment_itim_source_start = LOADADDR(.itim) ); + PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); + PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); - .lalign : { - . = ALIGN(8); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >rom AT>rom :flash - .dalign : { - . = ALIGN(8); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>rom :ram_init - - .data : { + .data : ALIGN(8) { *(.data .data.*) *(.gnu.linkonce.d.*) . = ALIGN(8); @@ -146,31 +137,30 @@ SECTIONS *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*) + . = ALIGN(8); + *(.rdata) + *(.rodata .rodata.*) + *(.gnu.linkonce.r.*) } >ram AT>rom :ram_init - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); + PROVIDE( metal_segment_data_source_start = LOADADDR(.data) ); + PROVIDE( metal_segment_data_target_start = ADDR(.data) ); + PROVIDE( metal_segment_data_target_end = ADDR(.data) + SIZEOF(.data) ); - . = ALIGN(8); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - .bss : { + .bss : ALIGN(8) { *(.sbss*) *(.gnu.linkonce.sb.*) *(.bss .bss.*) *(.gnu.linkonce.b.*) *(COMMON) } >ram AT>ram :ram - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); + PROVIDE( metal_segment_bss_target_start = ADDR(.bss) ); + PROVIDE( metal_segment_bss_target_end = ADDR(.bss) + SIZEOF(.bss) ); .stack : { PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; + . += __stack_size; PROVIDE( _sp = . ); PROVIDE(metal_segment_stack_end = .); } >ram AT>ram :ram diff --git a/bsp/qemu-sifive-u54/metal.h b/bsp/qemu-sifive-u54/metal.h index ad1f45c50..445572079 100644 --- a/bsp/qemu-sifive-u54/metal.h +++ b/bsp/qemu-sifive-u54/metal.h @@ -275,6 +275,16 @@ static __inline__ int __metal_driver_sifive_plic0_interrupt_lines(struct metal_i } } +static __inline__ int __metal_driver_sifive_plic0_context_ids(int hartid) +{ + if (hartid == 0) { + return 0; + } + else { + return -1; + } +} + /* --------------------- sifive_clic0 ------------ */ @@ -325,6 +335,8 @@ static __inline__ unsigned long __metal_driver_sifive_test0_size(const struct __ +/* --------------------- sifive_trace ------------ */ + /* --------------------- sifive_uart0 ------------ */ static __inline__ unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart) { diff --git a/bsp/qemu-sifive-u54/metal.ramrodata.lds b/bsp/qemu-sifive-u54/metal.ramrodata.lds index 06ecb2e67..15cd1616d 100644 --- a/bsp/qemu-sifive-u54/metal.ramrodata.lds +++ b/bsp/qemu-sifive-u54/metal.ramrodata.lds @@ -22,7 +22,7 @@ SECTIONS __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; + __heap_size = DEFINED(__heap_size) ? __heap_size : 0x800; PROVIDE(__metal_boot_hart = 0); PROVIDE(__metal_chicken_bit = 0); @@ -55,6 +55,10 @@ SECTIONS KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) PROVIDE_HIDDEN (__init_array_end = .); + PROVIDE_HIDDEN ( metal_constructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.init_array.*))); + KEEP (*(.metal.init_array)); + PROVIDE_HIDDEN ( metal_constructors_end = .); } >rom AT>rom :flash .fini_array : { @@ -62,6 +66,10 @@ SECTIONS 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 (__fini_array_end = .); + PROVIDE_HIDDEN ( metal_destructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.fini_array.*))); + KEEP (*(.metal.fini_array)); + PROVIDE_HIDDEN ( metal_destructors_end = .); } >rom AT>rom :flash .ctors : { @@ -70,6 +78,7 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) + KEEP (*(.metal.ctors metal.ctors.*)); } >rom AT>rom :flash .dtors : { @@ -78,46 +87,25 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) + KEEP (*(.metal.dtors metal.dtors.*)); } >rom AT>rom :flash - .litimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_source_start = . ); - } >rom AT>rom :flash - - .ditimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_start = . ); - } >rom AT>rom :itim_init - - .text : { + .itim : ALIGN(8) { *(.text.unlikely .text.unlikely.*) *(.text.startup .text.startup.*) *(.text .text.*) *(.gnu.linkonce.t.*) - } >rom AT>rom :itim_init - - .itim_section : { *(.itim .itim.*) } >rom AT>rom :itim_init - PROVIDE( metal_segment_itim_target_end = . ); + PROVIDE( metal_segment_itim_source_start = LOADADDR(.itim) ); + PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); + PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); - .lalign : { - . = ALIGN(8); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >rom AT>rom :flash - - .dalign : { - . = ALIGN(8); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>rom :ram_init - - .data : { + .data : ALIGN(8) { *(.data .data.*) *(.gnu.linkonce.d.*) . = ALIGN(8); @@ -130,31 +118,30 @@ SECTIONS *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*) + . = ALIGN(8); + *(.rdata) + *(.rodata .rodata.*) + *(.gnu.linkonce.r.*) } >ram AT>rom :ram_init - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); + PROVIDE( metal_segment_data_source_start = LOADADDR(.data) ); + PROVIDE( metal_segment_data_target_start = ADDR(.data) ); + PROVIDE( metal_segment_data_target_end = ADDR(.data) + SIZEOF(.data) ); - . = ALIGN(8); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - .bss : { + .bss : ALIGN(8) { *(.sbss*) *(.gnu.linkonce.sb.*) *(.bss .bss.*) *(.gnu.linkonce.b.*) *(COMMON) } >ram AT>ram :ram - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); + PROVIDE( metal_segment_bss_target_start = ADDR(.bss) ); + PROVIDE( metal_segment_bss_target_end = ADDR(.bss) + SIZEOF(.bss) ); .stack : { PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; + . += __stack_size; PROVIDE( _sp = . ); PROVIDE(metal_segment_stack_end = .); } >ram AT>ram :ram diff --git a/bsp/qemu-sifive-u54/metal.scratchpad.lds b/bsp/qemu-sifive-u54/metal.scratchpad.lds index 8f3c674f8..b9bbe18d8 100644 --- a/bsp/qemu-sifive-u54/metal.scratchpad.lds +++ b/bsp/qemu-sifive-u54/metal.scratchpad.lds @@ -20,7 +20,7 @@ SECTIONS __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; + __heap_size = DEFINED(__heap_size) ? __heap_size : 0x800; PROVIDE(__metal_boot_hart = 0); PROVIDE(__metal_chicken_bit = 0); @@ -76,6 +76,10 @@ SECTIONS KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) PROVIDE_HIDDEN (__init_array_end = .); + PROVIDE_HIDDEN ( metal_constructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.init_array.*))); + KEEP (*(.metal.init_array)); + PROVIDE_HIDDEN ( metal_constructors_end = .); } >ram AT>ram :ram .fini_array : { @@ -83,6 +87,10 @@ SECTIONS 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 (__fini_array_end = .); + PROVIDE_HIDDEN ( metal_destructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.fini_array.*))); + KEEP (*(.metal.fini_array)); + PROVIDE_HIDDEN ( metal_destructors_end = .); } >ram AT>ram :ram .ctors : { @@ -91,6 +99,7 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) + KEEP (*(.metal.ctors metal.ctors.*)); } >ram AT>ram :ram .dtors : { @@ -99,39 +108,21 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) + KEEP (*(.metal.dtors metal.dtors.*)); } >ram AT>ram :ram - .litimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - .ditimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>ram :itim_init - - .itim_section : { + .itim : ALIGN(8) { *(.itim .itim.*) } >ram AT>ram :itim_init - PROVIDE( metal_segment_itim_target_end = . ); - + PROVIDE( metal_segment_itim_source_start = LOADADDR(.itim) ); + PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); + PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); - .lalign : { - . = ALIGN(8); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - .dalign : { - . = ALIGN(8); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - .data : { + .data : ALIGN(8) { *(.data .data.*) *(.gnu.linkonce.d.*) . = ALIGN(8); @@ -144,31 +135,30 @@ SECTIONS *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*) + . = ALIGN(8); + *(.rdata) + *(.rodata .rodata.*) + *(.gnu.linkonce.r.*) } >ram AT>ram :ram_init - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); + PROVIDE( metal_segment_data_source_start = LOADADDR(.data) ); + PROVIDE( metal_segment_data_target_start = ADDR(.data) ); + PROVIDE( metal_segment_data_target_end = ADDR(.data) + SIZEOF(.data) ); - . = ALIGN(8); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - .bss : { + .bss : ALIGN(8) { *(.sbss*) *(.gnu.linkonce.sb.*) *(.bss .bss.*) *(.gnu.linkonce.b.*) *(COMMON) } >ram AT>ram :ram - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); + PROVIDE( metal_segment_bss_target_start = ADDR(.bss) ); + PROVIDE( metal_segment_bss_target_end = ADDR(.bss) + SIZEOF(.bss) ); .stack : { PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; + . += __stack_size; PROVIDE( _sp = . ); PROVIDE(metal_segment_stack_end = .); } >ram AT>ram :ram diff --git a/bsp/sifive-hifive-unleashed/metal-inline.h b/bsp/sifive-hifive-unleashed/metal-inline.h index fbe4cfafc..2de211507 100644 --- a/bsp/sifive-hifive-unleashed/metal-inline.h +++ b/bsp/sifive-hifive-unleashed/metal-inline.h @@ -43,6 +43,7 @@ extern __inline__ int __metal_driver_sifive_plic0_num_interrupts(struct metal_in extern __inline__ int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller); extern __inline__ struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx); extern __inline__ int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx); +extern __inline__ int __metal_driver_sifive_plic0_context_ids(int hartid); /* --------------------- sifive_clic0 ------------ */ @@ -87,6 +88,8 @@ extern __inline__ unsigned long __metal_driver_sifive_test0_base(const struct __ extern __inline__ unsigned long __metal_driver_sifive_test0_size(const struct __metal_shutdown *sd); +/* --------------------- sifive_trace ------------ */ + /* --------------------- sifive_uart0 ------------ */ extern __inline__ unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart); extern __inline__ unsigned long __metal_driver_sifive_uart0_control_size(struct metal_uart *uart); diff --git a/bsp/sifive-hifive-unleashed/metal-platform.h b/bsp/sifive-hifive-unleashed/metal-platform.h index 8b4ed509c..98eb65078 100644 --- a/bsp/sifive-hifive-unleashed/metal-platform.h +++ b/bsp/sifive-hifive-unleashed/metal-platform.h @@ -42,8 +42,11 @@ #define METAL_RISCV_PLIC0_PRIORITY_BASE 0UL #define METAL_RISCV_PLIC0_PENDING_BASE 4096UL #define METAL_RISCV_PLIC0_ENABLE_BASE 8192UL -#define METAL_RISCV_PLIC0_THRESHOLD 2097152UL -#define METAL_RISCV_PLIC0_CLAIM 2097156UL +#define METAL_RISCV_PLIC0_ENABLE_PER_HART 128UL +#define METAL_RISCV_PLIC0_CONTEXT_BASE 2097152UL +#define METAL_RISCV_PLIC0_CONTEXT_PER_HART 4096UL +#define METAL_RISCV_PLIC0_CONTEXT_THRESHOLD 0UL +#define METAL_RISCV_PLIC0_CONTEXT_CLAIM 4UL /* From cache_controller@2010000 */ #define METAL_SIFIVE_FU540_C000_L2_2010000_BASE_ADDRESS 33619968UL diff --git a/bsp/sifive-hifive-unleashed/metal.default.lds b/bsp/sifive-hifive-unleashed/metal.default.lds index b24fc51d0..3a9c21402 100644 --- a/bsp/sifive-hifive-unleashed/metal.default.lds +++ b/bsp/sifive-hifive-unleashed/metal.default.lds @@ -23,7 +23,7 @@ SECTIONS __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; + __heap_size = DEFINED(__heap_size) ? __heap_size : 0x800; PROVIDE(__metal_boot_hart = 0); PROVIDE(__metal_chicken_bit = 0); @@ -79,6 +79,10 @@ SECTIONS KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) PROVIDE_HIDDEN (__init_array_end = .); + PROVIDE_HIDDEN ( metal_constructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.init_array.*))); + KEEP (*(.metal.init_array)); + PROVIDE_HIDDEN ( metal_constructors_end = .); } >flash AT>flash :flash .fini_array : { @@ -86,6 +90,10 @@ SECTIONS 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 (__fini_array_end = .); + PROVIDE_HIDDEN ( metal_destructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.fini_array.*))); + KEEP (*(.metal.fini_array)); + PROVIDE_HIDDEN ( metal_destructors_end = .); } >flash AT>flash :flash .ctors : { @@ -94,6 +102,7 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) + KEEP (*(.metal.ctors metal.ctors.*)); } >flash AT>flash :flash .dtors : { @@ -102,39 +111,21 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) + KEEP (*(.metal.dtors metal.dtors.*)); } >flash AT>flash :flash - .litimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - .ditimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - .itim_section : { + .itim : ALIGN(8) { *(.itim .itim.*) } >itim AT>flash :itim_init - PROVIDE( metal_segment_itim_target_end = . ); - + PROVIDE( metal_segment_itim_source_start = LOADADDR(.itim) ); + PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); + PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); - .lalign : { - . = ALIGN(8); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - .dalign : { - . = ALIGN(8); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - .data : { + .data : ALIGN(8) { *(.data .data.*) *(.gnu.linkonce.d.*) . = ALIGN(8); @@ -147,36 +138,35 @@ SECTIONS *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*) + . = ALIGN(8); + *(.rdata) + *(.rodata .rodata.*) + *(.gnu.linkonce.r.*) } >ram AT>flash :ram_init - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); + PROVIDE( metal_segment_data_source_start = LOADADDR(.data) ); + PROVIDE( metal_segment_data_target_start = ADDR(.data) ); + PROVIDE( metal_segment_data_target_end = ADDR(.data) + SIZEOF(.data) ); - . = ALIGN(8); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - .bss : { + .bss : ALIGN(8) { *(.sbss*) *(.gnu.linkonce.sb.*) *(.bss .bss.*) *(.gnu.linkonce.b.*) *(COMMON) } >ram AT>ram :ram - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); + PROVIDE( metal_segment_bss_target_start = ADDR(.bss) ); + PROVIDE( metal_segment_bss_target_end = ADDR(.bss) + SIZEOF(.bss) ); .stack : { PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; + . += __stack_size; PROVIDE( _sp = . ); - . = __stack_size; - . = __stack_size; - . = __stack_size; - . = __stack_size; + . += __stack_size; + . += __stack_size; + . += __stack_size; + . += __stack_size; PROVIDE(metal_segment_stack_end = .); } >ram AT>ram :ram diff --git a/bsp/sifive-hifive-unleashed/metal.h b/bsp/sifive-hifive-unleashed/metal.h index 8d6e1c7c7..cf8faa56b 100644 --- a/bsp/sifive-hifive-unleashed/metal.h +++ b/bsp/sifive-hifive-unleashed/metal.h @@ -521,6 +521,28 @@ static __inline__ int __metal_driver_sifive_plic0_interrupt_lines(struct metal_i } } +static __inline__ int __metal_driver_sifive_plic0_context_ids(int hartid) +{ + if (hartid == 0) { + return 0; + } + else if (hartid == 1) { + return 1; + } + else if (hartid == 2) { + return 3; + } + else if (hartid == 3) { + return 5; + } + else if (hartid == 4) { + return 7; + } + else { + return -1; + } +} + /* --------------------- sifive_clic0 ------------ */ @@ -762,6 +784,8 @@ static __inline__ unsigned long __metal_driver_sifive_test0_size(const struct __ +/* --------------------- sifive_trace ------------ */ + /* --------------------- sifive_uart0 ------------ */ static __inline__ unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart) { diff --git a/bsp/sifive-hifive-unleashed/metal.ramrodata.lds b/bsp/sifive-hifive-unleashed/metal.ramrodata.lds index 68251df1e..bd7f92250 100644 --- a/bsp/sifive-hifive-unleashed/metal.ramrodata.lds +++ b/bsp/sifive-hifive-unleashed/metal.ramrodata.lds @@ -23,7 +23,7 @@ SECTIONS __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; + __heap_size = DEFINED(__heap_size) ? __heap_size : 0x800; PROVIDE(__metal_boot_hart = 0); PROVIDE(__metal_chicken_bit = 0); @@ -65,6 +65,10 @@ SECTIONS KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) PROVIDE_HIDDEN (__init_array_end = .); + PROVIDE_HIDDEN ( metal_constructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.init_array.*))); + KEEP (*(.metal.init_array)); + PROVIDE_HIDDEN ( metal_constructors_end = .); } >flash AT>flash :flash .fini_array : { @@ -72,6 +76,10 @@ SECTIONS 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 (__fini_array_end = .); + PROVIDE_HIDDEN ( metal_destructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.fini_array.*))); + KEEP (*(.metal.fini_array)); + PROVIDE_HIDDEN ( metal_destructors_end = .); } >flash AT>flash :flash .ctors : { @@ -80,6 +88,7 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) + KEEP (*(.metal.ctors metal.ctors.*)); } >flash AT>flash :flash .dtors : { @@ -88,39 +97,21 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) + KEEP (*(.metal.dtors metal.dtors.*)); } >flash AT>flash :flash - .litimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - .ditimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - .itim_section : { + .itim : ALIGN(8) { *(.itim .itim.*) } >itim AT>flash :itim_init - PROVIDE( metal_segment_itim_target_end = . ); - + PROVIDE( metal_segment_itim_source_start = LOADADDR(.itim) ); + PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); + PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); - .lalign : { - . = ALIGN(8); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - .dalign : { - . = ALIGN(8); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - .data : { + .data : ALIGN(8) { *(.data .data.*) *(.gnu.linkonce.d.*) . = ALIGN(8); @@ -133,36 +124,35 @@ SECTIONS *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*) + . = ALIGN(8); + *(.rdata) + *(.rodata .rodata.*) + *(.gnu.linkonce.r.*) } >ram AT>flash :ram_init - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); + PROVIDE( metal_segment_data_source_start = LOADADDR(.data) ); + PROVIDE( metal_segment_data_target_start = ADDR(.data) ); + PROVIDE( metal_segment_data_target_end = ADDR(.data) + SIZEOF(.data) ); - . = ALIGN(8); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - .bss : { + .bss : ALIGN(8) { *(.sbss*) *(.gnu.linkonce.sb.*) *(.bss .bss.*) *(.gnu.linkonce.b.*) *(COMMON) } >ram AT>ram :ram - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); + PROVIDE( metal_segment_bss_target_start = ADDR(.bss) ); + PROVIDE( metal_segment_bss_target_end = ADDR(.bss) + SIZEOF(.bss) ); .stack : { PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; + . += __stack_size; PROVIDE( _sp = . ); - . = __stack_size; - . = __stack_size; - . = __stack_size; - . = __stack_size; + . += __stack_size; + . += __stack_size; + . += __stack_size; + . += __stack_size; PROVIDE(metal_segment_stack_end = .); } >ram AT>ram :ram diff --git a/bsp/sifive-hifive-unleashed/metal.scratchpad.lds b/bsp/sifive-hifive-unleashed/metal.scratchpad.lds index dc85b845e..1a720dd3d 100644 --- a/bsp/sifive-hifive-unleashed/metal.scratchpad.lds +++ b/bsp/sifive-hifive-unleashed/metal.scratchpad.lds @@ -21,7 +21,7 @@ SECTIONS __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; + __heap_size = DEFINED(__heap_size) ? __heap_size : 0x800; PROVIDE(__metal_boot_hart = 0); PROVIDE(__metal_chicken_bit = 0); @@ -77,6 +77,10 @@ SECTIONS KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) PROVIDE_HIDDEN (__init_array_end = .); + PROVIDE_HIDDEN ( metal_constructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.init_array.*))); + KEEP (*(.metal.init_array)); + PROVIDE_HIDDEN ( metal_constructors_end = .); } >ram AT>ram :ram .fini_array : { @@ -84,6 +88,10 @@ SECTIONS 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 (__fini_array_end = .); + PROVIDE_HIDDEN ( metal_destructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.fini_array.*))); + KEEP (*(.metal.fini_array)); + PROVIDE_HIDDEN ( metal_destructors_end = .); } >ram AT>ram :ram .ctors : { @@ -92,6 +100,7 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) + KEEP (*(.metal.ctors metal.ctors.*)); } >ram AT>ram :ram .dtors : { @@ -100,39 +109,21 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) + KEEP (*(.metal.dtors metal.dtors.*)); } >ram AT>ram :ram - .litimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - .ditimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>ram :itim_init - - .itim_section : { + .itim : ALIGN(8) { *(.itim .itim.*) } >itim AT>ram :itim_init - PROVIDE( metal_segment_itim_target_end = . ); - + PROVIDE( metal_segment_itim_source_start = LOADADDR(.itim) ); + PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); + PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); - .lalign : { - . = ALIGN(8); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - .dalign : { - . = ALIGN(8); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - .data : { + .data : ALIGN(8) { *(.data .data.*) *(.gnu.linkonce.d.*) . = ALIGN(8); @@ -145,36 +136,35 @@ SECTIONS *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*) + . = ALIGN(8); + *(.rdata) + *(.rodata .rodata.*) + *(.gnu.linkonce.r.*) } >ram AT>ram :ram_init - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); + PROVIDE( metal_segment_data_source_start = LOADADDR(.data) ); + PROVIDE( metal_segment_data_target_start = ADDR(.data) ); + PROVIDE( metal_segment_data_target_end = ADDR(.data) + SIZEOF(.data) ); - . = ALIGN(8); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - .bss : { + .bss : ALIGN(8) { *(.sbss*) *(.gnu.linkonce.sb.*) *(.bss .bss.*) *(.gnu.linkonce.b.*) *(COMMON) } >ram AT>ram :ram - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); + PROVIDE( metal_segment_bss_target_start = ADDR(.bss) ); + PROVIDE( metal_segment_bss_target_end = ADDR(.bss) + SIZEOF(.bss) ); .stack : { PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; + . += __stack_size; PROVIDE( _sp = . ); - . = __stack_size; - . = __stack_size; - . = __stack_size; - . = __stack_size; + . += __stack_size; + . += __stack_size; + . += __stack_size; + . += __stack_size; PROVIDE(metal_segment_stack_end = .); } >ram AT>ram :ram diff --git a/bsp/sifive-hifive1-revb/metal-inline.h b/bsp/sifive-hifive1-revb/metal-inline.h index bf1437b45..8ad610a0f 100644 --- a/bsp/sifive-hifive1-revb/metal-inline.h +++ b/bsp/sifive-hifive1-revb/metal-inline.h @@ -40,6 +40,7 @@ extern __inline__ int __metal_driver_sifive_plic0_num_interrupts(struct metal_in extern __inline__ int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller); extern __inline__ struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx); extern __inline__ int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx); +extern __inline__ int __metal_driver_sifive_plic0_context_ids(int hartid); /* --------------------- sifive_clic0 ------------ */ @@ -90,6 +91,8 @@ extern __inline__ unsigned long __metal_driver_sifive_spi0_pinmux_source_selecto /* --------------------- sifive_test0 ------------ */ +/* --------------------- sifive_trace ------------ */ + /* --------------------- sifive_uart0 ------------ */ extern __inline__ unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart); extern __inline__ unsigned long __metal_driver_sifive_uart0_control_size(struct metal_uart *uart); diff --git a/bsp/sifive-hifive1-revb/metal-platform.h b/bsp/sifive-hifive1-revb/metal-platform.h index 6ae46b33f..cef980115 100644 --- a/bsp/sifive-hifive1-revb/metal-platform.h +++ b/bsp/sifive-hifive1-revb/metal-platform.h @@ -45,8 +45,11 @@ #define METAL_RISCV_PLIC0_PRIORITY_BASE 0UL #define METAL_RISCV_PLIC0_PENDING_BASE 4096UL #define METAL_RISCV_PLIC0_ENABLE_BASE 8192UL -#define METAL_RISCV_PLIC0_THRESHOLD 2097152UL -#define METAL_RISCV_PLIC0_CLAIM 2097156UL +#define METAL_RISCV_PLIC0_ENABLE_PER_HART 128UL +#define METAL_RISCV_PLIC0_CONTEXT_BASE 2097152UL +#define METAL_RISCV_PLIC0_CONTEXT_PER_HART 4096UL +#define METAL_RISCV_PLIC0_CONTEXT_THRESHOLD 0UL +#define METAL_RISCV_PLIC0_CONTEXT_CLAIM 4UL /* From aon@10000000 */ #define METAL_SIFIVE_AON0_10000000_BASE_ADDRESS 268435456UL diff --git a/bsp/sifive-hifive1-revb/metal.default.lds b/bsp/sifive-hifive1-revb/metal.default.lds index 441c0b8ba..928574e36 100644 --- a/bsp/sifive-hifive1-revb/metal.default.lds +++ b/bsp/sifive-hifive1-revb/metal.default.lds @@ -23,7 +23,7 @@ SECTIONS __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; + __heap_size = DEFINED(__heap_size) ? __heap_size : 0x800; PROVIDE(__metal_boot_hart = 0); PROVIDE(__metal_chicken_bit = 0); @@ -79,6 +79,10 @@ SECTIONS KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) PROVIDE_HIDDEN (__init_array_end = .); + PROVIDE_HIDDEN ( metal_constructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.init_array.*))); + KEEP (*(.metal.init_array)); + PROVIDE_HIDDEN ( metal_constructors_end = .); } >flash AT>flash :flash .fini_array : { @@ -86,6 +90,10 @@ SECTIONS 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 (__fini_array_end = .); + PROVIDE_HIDDEN ( metal_destructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.fini_array.*))); + KEEP (*(.metal.fini_array)); + PROVIDE_HIDDEN ( metal_destructors_end = .); } >flash AT>flash :flash .ctors : { @@ -94,6 +102,7 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) + KEEP (*(.metal.ctors metal.ctors.*)); } >flash AT>flash :flash .dtors : { @@ -102,39 +111,21 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) + KEEP (*(.metal.dtors metal.dtors.*)); } >flash AT>flash :flash - .litimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - .ditimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - .itim_section : { + .itim : ALIGN(8) { *(.itim .itim.*) } >itim AT>flash :itim_init - PROVIDE( metal_segment_itim_target_end = . ); - + PROVIDE( metal_segment_itim_source_start = LOADADDR(.itim) ); + PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); + PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); - .lalign : { - . = ALIGN(8); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - .dalign : { - . = ALIGN(8); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - .data : { + .data : ALIGN(8) { *(.data .data.*) *(.gnu.linkonce.d.*) . = ALIGN(8); @@ -147,31 +138,30 @@ SECTIONS *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*) + . = ALIGN(8); + *(.rdata) + *(.rodata .rodata.*) + *(.gnu.linkonce.r.*) } >ram AT>flash :ram_init - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); + PROVIDE( metal_segment_data_source_start = LOADADDR(.data) ); + PROVIDE( metal_segment_data_target_start = ADDR(.data) ); + PROVIDE( metal_segment_data_target_end = ADDR(.data) + SIZEOF(.data) ); - . = ALIGN(8); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - .bss : { + .bss : ALIGN(8) { *(.sbss*) *(.gnu.linkonce.sb.*) *(.bss .bss.*) *(.gnu.linkonce.b.*) *(COMMON) } >ram AT>ram :ram - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); + PROVIDE( metal_segment_bss_target_start = ADDR(.bss) ); + PROVIDE( metal_segment_bss_target_end = ADDR(.bss) + SIZEOF(.bss) ); .stack : { PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; + . += __stack_size; PROVIDE( _sp = . ); PROVIDE(metal_segment_stack_end = .); } >ram AT>ram :ram diff --git a/bsp/sifive-hifive1-revb/metal.h b/bsp/sifive-hifive1-revb/metal.h index 368b2d5e9..e3e4d2a18 100644 --- a/bsp/sifive-hifive1-revb/metal.h +++ b/bsp/sifive-hifive1-revb/metal.h @@ -361,6 +361,16 @@ static __inline__ int __metal_driver_sifive_plic0_interrupt_lines(struct metal_i } } +static __inline__ int __metal_driver_sifive_plic0_context_ids(int hartid) +{ + if (hartid == 0) { + return 0; + } + else { + return -1; + } +} + /* --------------------- sifive_clic0 ------------ */ @@ -728,6 +738,8 @@ static __inline__ unsigned long __metal_driver_sifive_spi0_pinmux_source_selecto /* --------------------- sifive_test0 ------------ */ +/* --------------------- sifive_trace ------------ */ + /* --------------------- sifive_uart0 ------------ */ static __inline__ unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart) { diff --git a/bsp/sifive-hifive1-revb/metal.ramrodata.lds b/bsp/sifive-hifive1-revb/metal.ramrodata.lds index c37f03d0f..49bb102ae 100644 --- a/bsp/sifive-hifive1-revb/metal.ramrodata.lds +++ b/bsp/sifive-hifive1-revb/metal.ramrodata.lds @@ -23,7 +23,7 @@ SECTIONS __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; + __heap_size = DEFINED(__heap_size) ? __heap_size : 0x800; PROVIDE(__metal_boot_hart = 0); PROVIDE(__metal_chicken_bit = 0); @@ -65,6 +65,10 @@ SECTIONS KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) PROVIDE_HIDDEN (__init_array_end = .); + PROVIDE_HIDDEN ( metal_constructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.init_array.*))); + KEEP (*(.metal.init_array)); + PROVIDE_HIDDEN ( metal_constructors_end = .); } >flash AT>flash :flash .fini_array : { @@ -72,6 +76,10 @@ SECTIONS 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 (__fini_array_end = .); + PROVIDE_HIDDEN ( metal_destructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.fini_array.*))); + KEEP (*(.metal.fini_array)); + PROVIDE_HIDDEN ( metal_destructors_end = .); } >flash AT>flash :flash .ctors : { @@ -80,6 +88,7 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) + KEEP (*(.metal.ctors metal.ctors.*)); } >flash AT>flash :flash .dtors : { @@ -88,39 +97,21 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) + KEEP (*(.metal.dtors metal.dtors.*)); } >flash AT>flash :flash - .litimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - .ditimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>flash :itim_init - - .itim_section : { + .itim : ALIGN(8) { *(.itim .itim.*) } >itim AT>flash :itim_init - PROVIDE( metal_segment_itim_target_end = . ); - + PROVIDE( metal_segment_itim_source_start = LOADADDR(.itim) ); + PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); + PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); - .lalign : { - . = ALIGN(8); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - .dalign : { - . = ALIGN(8); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - .data : { + .data : ALIGN(8) { *(.data .data.*) *(.gnu.linkonce.d.*) . = ALIGN(8); @@ -133,31 +124,30 @@ SECTIONS *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*) + . = ALIGN(8); + *(.rdata) + *(.rodata .rodata.*) + *(.gnu.linkonce.r.*) } >ram AT>flash :ram_init - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); + PROVIDE( metal_segment_data_source_start = LOADADDR(.data) ); + PROVIDE( metal_segment_data_target_start = ADDR(.data) ); + PROVIDE( metal_segment_data_target_end = ADDR(.data) + SIZEOF(.data) ); - . = ALIGN(8); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - .bss : { + .bss : ALIGN(8) { *(.sbss*) *(.gnu.linkonce.sb.*) *(.bss .bss.*) *(.gnu.linkonce.b.*) *(COMMON) } >ram AT>ram :ram - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); + PROVIDE( metal_segment_bss_target_start = ADDR(.bss) ); + PROVIDE( metal_segment_bss_target_end = ADDR(.bss) + SIZEOF(.bss) ); .stack : { PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; + . += __stack_size; PROVIDE( _sp = . ); PROVIDE(metal_segment_stack_end = .); } >ram AT>ram :ram diff --git a/bsp/sifive-hifive1-revb/metal.scratchpad.lds b/bsp/sifive-hifive1-revb/metal.scratchpad.lds index bc44fdcd5..5f155240e 100644 --- a/bsp/sifive-hifive1-revb/metal.scratchpad.lds +++ b/bsp/sifive-hifive1-revb/metal.scratchpad.lds @@ -21,7 +21,7 @@ SECTIONS __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; + __heap_size = DEFINED(__heap_size) ? __heap_size : 0x800; PROVIDE(__metal_boot_hart = 0); PROVIDE(__metal_chicken_bit = 0); @@ -77,6 +77,10 @@ SECTIONS KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) PROVIDE_HIDDEN (__init_array_end = .); + PROVIDE_HIDDEN ( metal_constructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.init_array.*))); + KEEP (*(.metal.init_array)); + PROVIDE_HIDDEN ( metal_constructors_end = .); } >ram AT>ram :ram .fini_array : { @@ -84,6 +88,10 @@ SECTIONS 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 (__fini_array_end = .); + PROVIDE_HIDDEN ( metal_destructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.fini_array.*))); + KEEP (*(.metal.fini_array)); + PROVIDE_HIDDEN ( metal_destructors_end = .); } >ram AT>ram :ram .ctors : { @@ -92,6 +100,7 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) + KEEP (*(.metal.ctors metal.ctors.*)); } >ram AT>ram :ram .dtors : { @@ -100,39 +109,21 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) + KEEP (*(.metal.dtors metal.dtors.*)); } >ram AT>ram :ram - .litimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - .ditimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_start = . ); - } >itim AT>ram :itim_init - - .itim_section : { + .itim : ALIGN(8) { *(.itim .itim.*) } >itim AT>ram :itim_init - PROVIDE( metal_segment_itim_target_end = . ); - + PROVIDE( metal_segment_itim_source_start = LOADADDR(.itim) ); + PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); + PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); - .lalign : { - . = ALIGN(8); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - .dalign : { - . = ALIGN(8); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - .data : { + .data : ALIGN(8) { *(.data .data.*) *(.gnu.linkonce.d.*) . = ALIGN(8); @@ -145,31 +136,30 @@ SECTIONS *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*) + . = ALIGN(8); + *(.rdata) + *(.rodata .rodata.*) + *(.gnu.linkonce.r.*) } >ram AT>ram :ram_init - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); + PROVIDE( metal_segment_data_source_start = LOADADDR(.data) ); + PROVIDE( metal_segment_data_target_start = ADDR(.data) ); + PROVIDE( metal_segment_data_target_end = ADDR(.data) + SIZEOF(.data) ); - . = ALIGN(8); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - .bss : { + .bss : ALIGN(8) { *(.sbss*) *(.gnu.linkonce.sb.*) *(.bss .bss.*) *(.gnu.linkonce.b.*) *(COMMON) } >ram AT>ram :ram - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); + PROVIDE( metal_segment_bss_target_start = ADDR(.bss) ); + PROVIDE( metal_segment_bss_target_end = ADDR(.bss) + SIZEOF(.bss) ); .stack : { PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; + . += __stack_size; PROVIDE( _sp = . ); PROVIDE(metal_segment_stack_end = .); } >ram AT>ram :ram diff --git a/bsp/sifive-hifive1/metal-inline.h b/bsp/sifive-hifive1/metal-inline.h index 7ecb641cf..2e6bef7c8 100644 --- a/bsp/sifive-hifive1/metal-inline.h +++ b/bsp/sifive-hifive1/metal-inline.h @@ -40,6 +40,7 @@ extern __inline__ int __metal_driver_sifive_plic0_num_interrupts(struct metal_in extern __inline__ int __metal_driver_sifive_plic0_max_priority(struct metal_interrupt *controller); extern __inline__ struct metal_interrupt * __metal_driver_sifive_plic0_interrupt_parents(struct metal_interrupt *controller, int idx); extern __inline__ int __metal_driver_sifive_plic0_interrupt_lines(struct metal_interrupt *controller, int idx); +extern __inline__ int __metal_driver_sifive_plic0_context_ids(int hartid); /* --------------------- sifive_clic0 ------------ */ @@ -93,6 +94,8 @@ extern __inline__ unsigned long __metal_driver_sifive_spi0_pinmux_source_selecto /* --------------------- sifive_test0 ------------ */ +/* --------------------- sifive_trace ------------ */ + /* --------------------- sifive_uart0 ------------ */ extern __inline__ unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart); extern __inline__ unsigned long __metal_driver_sifive_uart0_control_size(struct metal_uart *uart); diff --git a/bsp/sifive-hifive1/metal-platform.h b/bsp/sifive-hifive1/metal-platform.h index 4c5d1c982..f665b8ae3 100644 --- a/bsp/sifive-hifive1/metal-platform.h +++ b/bsp/sifive-hifive1/metal-platform.h @@ -42,8 +42,11 @@ #define METAL_RISCV_PLIC0_PRIORITY_BASE 0UL #define METAL_RISCV_PLIC0_PENDING_BASE 4096UL #define METAL_RISCV_PLIC0_ENABLE_BASE 8192UL -#define METAL_RISCV_PLIC0_THRESHOLD 2097152UL -#define METAL_RISCV_PLIC0_CLAIM 2097156UL +#define METAL_RISCV_PLIC0_ENABLE_PER_HART 128UL +#define METAL_RISCV_PLIC0_CONTEXT_BASE 2097152UL +#define METAL_RISCV_PLIC0_CONTEXT_PER_HART 4096UL +#define METAL_RISCV_PLIC0_CONTEXT_THRESHOLD 0UL +#define METAL_RISCV_PLIC0_CONTEXT_CLAIM 4UL /* From aon@10000000 */ #define METAL_SIFIVE_AON0_10000000_BASE_ADDRESS 268435456UL diff --git a/bsp/sifive-hifive1/metal.default.lds b/bsp/sifive-hifive1/metal.default.lds index c113e982b..f5089e03d 100644 --- a/bsp/sifive-hifive1/metal.default.lds +++ b/bsp/sifive-hifive1/metal.default.lds @@ -22,7 +22,7 @@ SECTIONS __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; + __heap_size = DEFINED(__heap_size) ? __heap_size : 0x800; PROVIDE(__metal_boot_hart = 0); PROVIDE(__metal_chicken_bit = 0); @@ -78,6 +78,10 @@ SECTIONS KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) PROVIDE_HIDDEN (__init_array_end = .); + PROVIDE_HIDDEN ( metal_constructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.init_array.*))); + KEEP (*(.metal.init_array)); + PROVIDE_HIDDEN ( metal_constructors_end = .); } >flash AT>flash :flash .fini_array : { @@ -85,6 +89,10 @@ SECTIONS 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 (__fini_array_end = .); + PROVIDE_HIDDEN ( metal_destructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.fini_array.*))); + KEEP (*(.metal.fini_array)); + PROVIDE_HIDDEN ( metal_destructors_end = .); } >flash AT>flash :flash .ctors : { @@ -93,6 +101,7 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) + KEEP (*(.metal.ctors metal.ctors.*)); } >flash AT>flash :flash .dtors : { @@ -101,39 +110,21 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) + KEEP (*(.metal.dtors metal.dtors.*)); } >flash AT>flash :flash - .litimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - .ditimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>flash :itim_init - - .itim_section : { + .itim : ALIGN(8) { *(.itim .itim.*) } >ram AT>flash :itim_init - PROVIDE( metal_segment_itim_target_end = . ); - + PROVIDE( metal_segment_itim_source_start = LOADADDR(.itim) ); + PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); + PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); - .lalign : { - . = ALIGN(8); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - .dalign : { - . = ALIGN(8); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - .data : { + .data : ALIGN(8) { *(.data .data.*) *(.gnu.linkonce.d.*) . = ALIGN(8); @@ -146,31 +137,30 @@ SECTIONS *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*) + . = ALIGN(8); + *(.rdata) + *(.rodata .rodata.*) + *(.gnu.linkonce.r.*) } >ram AT>flash :ram_init - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); + PROVIDE( metal_segment_data_source_start = LOADADDR(.data) ); + PROVIDE( metal_segment_data_target_start = ADDR(.data) ); + PROVIDE( metal_segment_data_target_end = ADDR(.data) + SIZEOF(.data) ); - . = ALIGN(8); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - .bss : { + .bss : ALIGN(8) { *(.sbss*) *(.gnu.linkonce.sb.*) *(.bss .bss.*) *(.gnu.linkonce.b.*) *(COMMON) } >ram AT>ram :ram - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); + PROVIDE( metal_segment_bss_target_start = ADDR(.bss) ); + PROVIDE( metal_segment_bss_target_end = ADDR(.bss) + SIZEOF(.bss) ); .stack : { PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; + . += __stack_size; PROVIDE( _sp = . ); PROVIDE(metal_segment_stack_end = .); } >ram AT>ram :ram diff --git a/bsp/sifive-hifive1/metal.h b/bsp/sifive-hifive1/metal.h index 89163d9f7..85b794840 100644 --- a/bsp/sifive-hifive1/metal.h +++ b/bsp/sifive-hifive1/metal.h @@ -342,6 +342,16 @@ static __inline__ int __metal_driver_sifive_plic0_interrupt_lines(struct metal_i } } +static __inline__ int __metal_driver_sifive_plic0_context_ids(int hartid) +{ + if (hartid == 0) { + return 0; + } + else { + return -1; + } +} + /* --------------------- sifive_clic0 ------------ */ @@ -700,6 +710,8 @@ static __inline__ unsigned long __metal_driver_sifive_spi0_pinmux_source_selecto /* --------------------- sifive_test0 ------------ */ +/* --------------------- sifive_trace ------------ */ + /* --------------------- sifive_uart0 ------------ */ static __inline__ unsigned long __metal_driver_sifive_uart0_control_base(struct metal_uart *uart) { diff --git a/bsp/sifive-hifive1/metal.ramrodata.lds b/bsp/sifive-hifive1/metal.ramrodata.lds index c7713f47f..fbdfe8381 100644 --- a/bsp/sifive-hifive1/metal.ramrodata.lds +++ b/bsp/sifive-hifive1/metal.ramrodata.lds @@ -22,7 +22,7 @@ SECTIONS __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; + __heap_size = DEFINED(__heap_size) ? __heap_size : 0x800; PROVIDE(__metal_boot_hart = 0); PROVIDE(__metal_chicken_bit = 0); @@ -64,6 +64,10 @@ SECTIONS KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) PROVIDE_HIDDEN (__init_array_end = .); + PROVIDE_HIDDEN ( metal_constructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.init_array.*))); + KEEP (*(.metal.init_array)); + PROVIDE_HIDDEN ( metal_constructors_end = .); } >flash AT>flash :flash .fini_array : { @@ -71,6 +75,10 @@ SECTIONS 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 (__fini_array_end = .); + PROVIDE_HIDDEN ( metal_destructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.fini_array.*))); + KEEP (*(.metal.fini_array)); + PROVIDE_HIDDEN ( metal_destructors_end = .); } >flash AT>flash :flash .ctors : { @@ -79,6 +87,7 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) + KEEP (*(.metal.ctors metal.ctors.*)); } >flash AT>flash :flash .dtors : { @@ -87,39 +96,21 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) + KEEP (*(.metal.dtors metal.dtors.*)); } >flash AT>flash :flash - .litimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_source_start = . ); - } >flash AT>flash :flash - - .ditimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>flash :itim_init - - .itim_section : { + .itim : ALIGN(8) { *(.itim .itim.*) } >ram AT>flash :itim_init - PROVIDE( metal_segment_itim_target_end = . ); - + PROVIDE( metal_segment_itim_source_start = LOADADDR(.itim) ); + PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); + PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); - .lalign : { - . = ALIGN(8); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >flash AT>flash :flash - .dalign : { - . = ALIGN(8); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>flash :ram_init - - .data : { + .data : ALIGN(8) { *(.data .data.*) *(.gnu.linkonce.d.*) . = ALIGN(8); @@ -132,31 +123,30 @@ SECTIONS *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*) + . = ALIGN(8); + *(.rdata) + *(.rodata .rodata.*) + *(.gnu.linkonce.r.*) } >ram AT>flash :ram_init - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); + PROVIDE( metal_segment_data_source_start = LOADADDR(.data) ); + PROVIDE( metal_segment_data_target_start = ADDR(.data) ); + PROVIDE( metal_segment_data_target_end = ADDR(.data) + SIZEOF(.data) ); - . = ALIGN(8); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - .bss : { + .bss : ALIGN(8) { *(.sbss*) *(.gnu.linkonce.sb.*) *(.bss .bss.*) *(.gnu.linkonce.b.*) *(COMMON) } >ram AT>ram :ram - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); + PROVIDE( metal_segment_bss_target_start = ADDR(.bss) ); + PROVIDE( metal_segment_bss_target_end = ADDR(.bss) + SIZEOF(.bss) ); .stack : { PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; + . += __stack_size; PROVIDE( _sp = . ); PROVIDE(metal_segment_stack_end = .); } >ram AT>ram :ram diff --git a/bsp/sifive-hifive1/metal.scratchpad.lds b/bsp/sifive-hifive1/metal.scratchpad.lds index 5667a12d6..fc0aea8f3 100644 --- a/bsp/sifive-hifive1/metal.scratchpad.lds +++ b/bsp/sifive-hifive1/metal.scratchpad.lds @@ -20,7 +20,7 @@ SECTIONS __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400; PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x400; + __heap_size = DEFINED(__heap_size) ? __heap_size : 0x800; PROVIDE(__metal_boot_hart = 0); PROVIDE(__metal_chicken_bit = 0); @@ -76,6 +76,10 @@ SECTIONS KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) PROVIDE_HIDDEN (__init_array_end = .); + PROVIDE_HIDDEN ( metal_constructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.init_array.*))); + KEEP (*(.metal.init_array)); + PROVIDE_HIDDEN ( metal_constructors_end = .); } >ram AT>ram :ram .fini_array : { @@ -83,6 +87,10 @@ SECTIONS 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 (__fini_array_end = .); + PROVIDE_HIDDEN ( metal_destructors_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.metal.fini_array.*))); + KEEP (*(.metal.fini_array)); + PROVIDE_HIDDEN ( metal_destructors_end = .); } >ram AT>ram :ram .ctors : { @@ -91,6 +99,7 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) + KEEP (*(.metal.ctors metal.ctors.*)); } >ram AT>ram :ram .dtors : { @@ -99,39 +108,21 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) + KEEP (*(.metal.dtors metal.dtors.*)); } >ram AT>ram :ram - .litimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_source_start = . ); - } >ram AT>ram :ram - - .ditimalign : { - . = ALIGN(8); - PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>ram :itim_init - - .itim_section : { + .itim : ALIGN(8) { *(.itim .itim.*) } >ram AT>ram :itim_init - PROVIDE( metal_segment_itim_target_end = . ); - + PROVIDE( metal_segment_itim_source_start = LOADADDR(.itim) ); + PROVIDE( metal_segment_itim_target_start = ADDR(.itim) ); + PROVIDE( metal_segment_itim_target_end = ADDR(.itim) + SIZEOF(.itim) ); - .lalign : { - . = ALIGN(8); - PROVIDE( _data_lma = . ); - PROVIDE( metal_segment_data_source_start = . ); - } >ram AT>ram :ram - .dalign : { - . = ALIGN(8); - PROVIDE( metal_segment_data_target_start = . ); - } >ram AT>ram :ram_init - - .data : { + .data : ALIGN(8) { *(.data .data.*) *(.gnu.linkonce.d.*) . = ALIGN(8); @@ -144,31 +135,30 @@ SECTIONS *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*) + . = ALIGN(8); + *(.rdata) + *(.rodata .rodata.*) + *(.gnu.linkonce.r.*) } >ram AT>ram :ram_init - PROVIDE( _edata = . ); - PROVIDE( edata = . ); - PROVIDE( metal_segment_data_target_end = . ); + PROVIDE( metal_segment_data_source_start = LOADADDR(.data) ); + PROVIDE( metal_segment_data_target_start = ADDR(.data) ); + PROVIDE( metal_segment_data_target_end = ADDR(.data) + SIZEOF(.data) ); - . = ALIGN(8); - PROVIDE( _fbss = . ); - PROVIDE( __bss_start = . ); - PROVIDE( metal_segment_bss_target_start = . ); - .bss : { + .bss : ALIGN(8) { *(.sbss*) *(.gnu.linkonce.sb.*) *(.bss .bss.*) *(.gnu.linkonce.b.*) *(COMMON) } >ram AT>ram :ram - PROVIDE( _end = . ); - PROVIDE( end = . ); - PROVIDE( metal_segment_bss_target_end = . ); + PROVIDE( metal_segment_bss_target_start = ADDR(.bss) ); + PROVIDE( metal_segment_bss_target_end = ADDR(.bss) + SIZEOF(.bss) ); .stack : { PROVIDE(metal_segment_stack_begin = .); - . = __stack_size; + . += __stack_size; PROVIDE( _sp = . ); PROVIDE(metal_segment_stack_end = .); } >ram AT>ram :ram diff --git a/freedom-devicetree-tools b/freedom-devicetree-tools index 1aba35de0..ca581da22 160000 --- a/freedom-devicetree-tools +++ b/freedom-devicetree-tools @@ -1 +1 @@ -Subproject commit 1aba35de05e54683369d2cecbf467d90413f2bd0 +Subproject commit ca581da22b0267b4f146b7eb522b76ad8450718d diff --git a/freedom-metal b/freedom-metal index 2444567a1..d4f013a58 160000 --- a/freedom-metal +++ b/freedom-metal @@ -1 +1 @@ -Subproject commit 2444567a1a932770969641e539bb9fb743e61170 +Subproject commit d4f013a58410ac973481186aadc78ab2e2a1f96b diff --git a/scripts/all-targets-build b/scripts/all-targets-build index 17c9d4ee5..34b4b8f81 100755 --- a/scripts/all-targets-build +++ b/scripts/all-targets-build @@ -17,14 +17,8 @@ for target in ${targets[@]} do for program in "${programs[@]}" do - # Dhrystone doesn't fit in the QEMU S51 DTIM - if [ "${target}" == "qemu-sifive-s51" -a "${program}" == "dhrystone" ] ; then - continue - fi - - # We don't have a hope of building dhrystone with strict warnings and errors - echo $RISCV_CFLAGS - if [ "${program}" == "dhrystone" -a `echo ${RISCV_CFLAGS} | grep -c "\-Werror"` -ne 0 ] ; then + # Coremark and Dhrystone don't fit + if [ "${program}" == "dhrystone" -o "${program}" == "coremark" ] ; then continue fi diff --git a/scripts/fixup-dts b/scripts/fixup-dts index e1f7d5773..edb55e4ae 100755 --- a/scripts/fixup-dts +++ b/scripts/fixup-dts @@ -84,6 +84,21 @@ if [ `grep -c 'stdout-path' ${dts}` -eq 0 ]; then fi fi +# Multicore configs have a monitor core for hart 0, so to get the right benchmark +# scores we should request boot from hart 1 + +if [ `grep -c 'cpu@1' ${dts}` -ne 0 ]; then + if [ `grep -c 'metal,boothart' ${dts}` -eq 0 ]; then + + if [ `grep -c 'chosen' ${dts}` -eq 0 ]; then + ${SED} -i "/cpus/i chosen {\n};" ${dts} + fi + + label=`grep "cpu@1" ${dts} | ${SED} -E "s/^\s+(\S+):.*$/\1/g"` + + ${SED} -i "/chosen/a metal,boothart = <&${label}>;" ${dts} + fi +fi # FPGA targets need a 0x400000 byte offset into their SPI flash diff --git a/software/coremark b/software/coremark index cc9baedc0..2bf740775 160000 --- a/software/coremark +++ b/software/coremark @@ -1 +1 @@ -Subproject commit cc9baedc061ae27b13a89c349dde9d674084f1a8 +Subproject commit 2bf740775c8601ff06af027a33b099b84b0240f9 diff --git a/software/dhrystone b/software/dhrystone index 8ff0ab1db..e3e7e91d4 160000 --- a/software/dhrystone +++ b/software/dhrystone @@ -1 +1 @@ -Subproject commit 8ff0ab1db77b134b56815905bf694eb8a767285b +Subproject commit e3e7e91d48ae15f4a8e395cf998b0abbf5b70542 diff --git a/software/example-pmp b/software/example-pmp index 57e15fee6..e784710af 160000 --- a/software/example-pmp +++ b/software/example-pmp @@ -1 +1 @@ -Subproject commit 57e15fee6a1dbbb06f0f615892488090a0b05d26 +Subproject commit e784710af0994e76a9b41402c1d5bceeaa25a415 diff --git a/software/example-user-mode b/software/example-user-mode index dbe0ff207..00f22ac35 160000 --- a/software/example-user-mode +++ b/software/example-user-mode @@ -1 +1 @@ -Subproject commit dbe0ff2074e77fc251e2fad811d1c5c3e339614b +Subproject commit 00f22ac352fe540e7061fdb01a6ecfee88afc2c2 diff --git a/software/example-user-syscall b/software/example-user-syscall index 9cacb154e..dde4f8537 160000 --- a/software/example-user-syscall +++ b/software/example-user-syscall @@ -1 +1 @@ -Subproject commit 9cacb154e213d9f695bb5162197227bc7a7a67d7 +Subproject commit dde4f8537d4cf26a2ed4b6667829cbab7bcc05b9 diff --git a/wit-manifest.json b/wit-manifest.json index a0fe46bdc..ed03f7cfd 100644 --- a/wit-manifest.json +++ b/wit-manifest.json @@ -1,11 +1,11 @@ [ { - "commit": "1aba35de05e54683369d2cecbf467d90413f2bd0", + "commit": "ca581da22b0267b4f146b7eb522b76ad8450718d", "name": "freedom-devicetree-tools", "source": "git@github.com:sifive/freedom-devicetree-tools.git" }, { - "commit": "2444567a1a932770969641e539bb9fb743e61170", + "commit": "d4f013a58410ac973481186aadc78ab2e2a1f96b", "name": "freedom-metal", "source": "git@github.com:sifive/freedom-metal.git" }, @@ -15,12 +15,12 @@ "source": "git@github.com:sifive/elf2hex.git" }, { - "commit": "8ff0ab1db77b134b56815905bf694eb8a767285b", + "commit": "e3e7e91d48ae15f4a8e395cf998b0abbf5b70542", "name": "benchmark-dhrystone", "source": "git@github.com:sifive/benchmark-dhrystone.git" }, { - "commit": "cc9baedc061ae27b13a89c349dde9d674084f1a8", + "commit": "2bf740775c8601ff06af027a33b099b84b0240f9", "name": "benchmark-coremark", "source": "git@github.com:sifive/benchmark-coremark.git" }, @@ -60,7 +60,7 @@ "source": "git@github.com:sifive/example-itim.git" }, { - "commit": "57e15fee6a1dbbb06f0f615892488090a0b05d26", + "commit": "e784710af0994e76a9b41402c1d5bceeaa25a415", "name": "example-pmp", "source": "git@github.com:sifive/example-pmp.git" }, @@ -80,12 +80,12 @@ "source": "git@github.com:sifive/example-watchdog.git" }, { - "commit": "dbe0ff2074e77fc251e2fad811d1c5c3e339614b", + "commit": "00f22ac352fe540e7061fdb01a6ecfee88afc2c2", "name": "example-user-mode", "source": "git@github.com:sifive/example-user-mode.git" }, { - "commit": "9cacb154e213d9f695bb5162197227bc7a7a67d7", + "commit": "dde4f8537d4cf26a2ed4b6667829cbab7bcc05b9", "name": "example-user-syscall", "source": "git@github.com:sifive/example-user-syscall.git" },