boards: hifive_unmatched: add support for S7 and U74 targets

Add `hifive_unmatched//s7` (earlier selected by default, using
`hifive_unmatched`) and `hifive_unmatched//u74` targets.

Define work-area for other 4 cores in openocd.cfg

Update twister platform white/black lists, to support new targets

Signed-off-by: Jakub Wasilewski <jwasilewski@internships.antmicro.com>
Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
This commit is contained in:
Jakub Wasilewski 2024-05-28 10:51:38 +02:00 committed by Fabio Baltieri
commit 8e881959a4
29 changed files with 270 additions and 30 deletions

View file

@ -2,4 +2,5 @@
# SPDX-License-Identifier: Apache-2.0
config BOARD_HIFIVE_UNMATCHED
select SOC_SIFIVE_FREEDOM_FU740
select SOC_SIFIVE_FREEDOM_FU740_S7 if BOARD_HIFIVE_UNMATCHED_FU740_S7
select SOC_SIFIVE_FREEDOM_FU740_U74 if BOARD_HIFIVE_UNMATCHED_FU740_U74

View file

@ -15,8 +15,20 @@ Building
Applications for the ``hifive_unmatched`` board configuration can be built as
usual (see :ref:`build_an_application`) using the corresponding board name:
.. zephyr-app-commands::
:board: hifive_unmatched
.. tabs::
.. group-tab:: S7
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: hifive_unmatched/fu740/s7
:goals: build
.. group-tab:: U74
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: hifive_unmatched/fu740/u74
:goals: build
Flashing

View file

@ -0,0 +1,29 @@
/*
* Copyright (c) 2024 Antmicro <www.antmicro.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include "hifive_unmatched.dtsi"
/ {
cpus {
cpu@1 {
status = "disabled";
};
cpu@2 {
status = "disabled";
};
cpu@3 {
status = "disabled";
};
cpu@4 {
status = "disabled";
};
};
};

View file

@ -1,5 +1,5 @@
identifier: hifive_unmatched
name: SiFive HiFive Unmatched
identifier: hifive_unmatched/fu740/s7
name: SiFive HiFive Unmatched (S7)
type: mcu
arch: riscv
toolchain:
@ -8,6 +8,7 @@ ram: 3840
simulation: renode
simulation_exec: renode
testing:
timeout_multiplier: 6
ignore_tags:
- net
- bluetooth

View file

@ -0,0 +1,17 @@
/*
* Copyright (c) 2024 Antmicro <www.antmicro.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include "hifive_unmatched.dtsi"
/ {
cpus {
cpu@0 {
status = "disabled";
};
};
};

View file

@ -0,0 +1,21 @@
identifier: hifive_unmatched/fu740/u74
name: SiFive HiFive Unmatched (U74)
type: mcu
arch: riscv
toolchain:
- zephyr
ram: 3840
simulation: renode
simulation_exec: renode
testing:
timeout_multiplier: 6
ignore_tags:
- net
- bluetooth
renode:
uart: sysbus.uart0
resc: boards/sifive/hifive_unmatched/support/hifive_unmatched.resc
supported:
- spi
- memc
vendor: sifive

View file

@ -0,0 +1,9 @@
# SPDX-License-Identifier: Apache-2.0
CONFIG_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UART_SIFIVE_PORT_0=y
CONFIG_UART_CONSOLE=y
CONFIG_XIP=n
CONFIG_RV_BOOT_HART=1
CONFIG_FLOAT_HARD=y

View file

@ -18,5 +18,9 @@ target create $_TARGETNAME.3 riscv -chain-position $_TARGETNAME -coreid 3
target create $_TARGETNAME.4 riscv -chain-position $_TARGETNAME -coreid 4
target smp $_TARGETNAME.0 $_TARGETNAME.1 $_TARGETNAME.2 $_TARGETNAME.3 $_TARGETNAME.4
$_TARGETNAME.0 configure -work-area-phys 0x80000000 -work-area-size 0x4000 -work-area-backup 1
$_TARGETNAME.1 configure -work-area-phys 0x80000000 -work-area-size 0x4000 -work-area-backup 1
$_TARGETNAME.2 configure -work-area-phys 0x80000000 -work-area-size 0x4000 -work-area-backup 1
$_TARGETNAME.3 configure -work-area-phys 0x80000000 -work-area-size 0x4000 -work-area-backup 1
$_TARGETNAME.4 configure -work-area-phys 0x80000000 -work-area-size 0x4000 -work-area-backup 1
flash bank onboard_spi_flash0 fespi 0x20000000 0 0 0 $_TARGETNAME.0 0x10040000

View file

@ -38,7 +38,7 @@
riscv,isa = "rv64imac_zicsr_zifencei";
status = "okay";
hlic: interrupt-controller {
hlic0: interrupt-controller {
compatible = "riscv,cpu-intc";
#address-cells = <0>;
#interrupt-cells = <1>;
@ -52,8 +52,9 @@
reg = <0x1>;
riscv,isa = "rv64gc";
cpu1_intc: interrupt-controller {
hlic1: interrupt-controller {
compatible = "riscv,cpu-intc";
#address-cells = <0>;
#interrupt-cells = <1>;
interrupt-controller;
};
@ -65,8 +66,9 @@
reg = <0x2>;
riscv,isa = "rv64gc";
cpu2_intc: interrupt-controller {
hlic2: interrupt-controller {
compatible = "riscv,cpu-intc";
#address-cells = <0>;
#interrupt-cells = <1>;
interrupt-controller;
};
@ -78,8 +80,9 @@
reg = <0x3>;
riscv,isa = "rv64gc";
cpu3_intc: interrupt-controller {
hlic3: interrupt-controller {
compatible = "riscv,cpu-intc";
#address-cells = <0>;
#interrupt-cells = <1>;
interrupt-controller;
};
@ -91,8 +94,9 @@
reg = <0x4>;
riscv,isa = "rv64gc";
cpu4_intc: interrupt-controller {
hlic4: interrupt-controller {
compatible = "riscv,cpu-intc";
#address-cells = <0>;
#interrupt-cells = <1>;
interrupt-controller;
};
@ -125,7 +129,11 @@
clint: clint@2000000 {
compatible = "sifive,clint0";
interrupts-extended = <&hlic 3 &hlic 7>;
interrupts-extended = <&hlic0 3 &hlic0 7
&hlic1 3 &hlic1 7
&hlic2 3 &hlic2 7
&hlic3 3 &hlic3 7
&hlic4 3 &hlic4 7>;
reg = <0x0 0x2000000 0x0 0x10000>;
};
@ -141,7 +149,11 @@
#address-cells = <0>;
#interrupt-cells = <2>;
interrupt-controller;
interrupts-extended = <&hlic 11>;
interrupts-extended = <&hlic0 11
&hlic1 11
&hlic2 11
&hlic3 11
&hlic4 11>;
reg = <0x0 0x0c000000 0x0 0x04000000>;
riscv,max-priority = <7>;
riscv,ndev = <52>;

View file

@ -17,7 +17,8 @@ tests:
- hifive1
- hifive_unleashed/fu540/e51
- hifive_unleashed/fu540/u54
- hifive_unmatched
- hifive_unmatched/fu740/s7
- hifive_unmatched/fu740/u74
- mimxrt1170_evk/mimxrt1176/cm7
- mimxrt1170_evk/mimxrt1176/cm4
filter: dt_compat_enabled("jedec,spi-nor")

View file

@ -5,7 +5,7 @@ tests:
tags:
- mspi
filter: dt_compat_enabled("mspi-aps6404l")
platform_exclude: hifive_unmatched
platform_exclude: hifive_unmatched/fu740/s7 hifive_unmatched/fu740/u74
harness: console
harness_config:
type: multi_line

View file

@ -6,7 +6,7 @@ tests:
- mspi
- flash
filter: dt_compat_enabled("jedec,spi-nor") or dt_compat_enabled("mspi-atxp032")
platform_exclude: hifive_unmatched
platform_exclude: hifive_unmatched/fu740/s7 hifive_unmatched/fu740/u74
harness: console
harness_config:
type: multi_line

View file

@ -8,7 +8,7 @@ tests:
filter: dt_compat_enabled("jedec,spi-nor") or dt_compat_enabled("st,stm32-qspi-nor")
or dt_compat_enabled("st,stm32-ospi-nor") or dt_compat_enabled("st,stm32-xspi-nor")
or (dt_compat_enabled("nordic,qspi-nor") and CONFIG_NORDIC_QSPI_NOR)
platform_exclude: hifive_unmatched
platform_exclude: hifive_unmatched/fu740/s7 hifive_unmatched/fu740/u74
harness: console
harness_config:
type: multi_line

View file

@ -73,13 +73,13 @@ sample lists them out on the debug serial output.
Building and Running EXT2 samples
*********************************
Ext2 sample can be built for ``hifive_unmatched`` or ``bl5340_dvk/nrf5340/cpuapp``. Because
Ext2 sample can be built for ``hifive_unmatched/fu740/s7`` or ``bl5340_dvk/nrf5340/cpuapp``. Because
FAT is default file system for this sample, additional flags must be passed to build
the sample.
.. zephyr-app-commands::
:zephyr-app: samples/subsys/fs/fs_sample
:board: hifive_unmatched
:board: hifive_unmatched/fu740/s7 hifive_unmatched/fu740/u74
:gen-args: -DCONF_FILE=prj_ext.conf
:goals: build
:compact:

View file

@ -73,7 +73,7 @@ tests:
simulation_exclude:
- renode
extra_args: CONF_FILE="prj_ext.conf"
platform_allow: hifive_unmatched bl5340_dvk/nrf5340/cpuapp
platform_allow: hifive_unmatched/fu740/s7 bl5340_dvk/nrf5340/cpuapp
sample.filesystem.fat_fs.stm32h747i_disco_m7_sdmmc:
build_only: true
platform_allow: stm32h747i_disco/stm32h747xx/m7

View file

@ -22,3 +22,8 @@ config SOC_SERIES_SIFIVE_FREEDOM_FU700
select SOC_EARLY_INIT_HOOK
select INCLUDE_RESET_VECTOR
imply XIP
config SOC_SIFIVE_FREEDOM_FU740_U74
bool
select RISCV_ISA_EXT_G
select CPU_HAS_FPU_DOUBLE_PRECISION

View file

@ -1,4 +1,5 @@
# Copyright (c) 2017 Jean-Paul Etienne <fractalclone@gmail.com>
# Copyright (c) 2024 Antmicro <www.antmicro.com>
# SPDX-License-Identifier: Apache-2.0
if SOC_SERIES_SIFIVE_FREEDOM_FU700
@ -24,4 +25,10 @@ config MAX_IRQ_PER_AGGREGATOR
config NUM_IRQS
default 64
config FPU
default y if CPU_HAS_FPU
config RISCV_IMPRECISE_FPU_STATE_TRACKING
default y if FPU
endif # SOC_SERIES_SIFIVE_FREEDOM_FU700

View file

@ -5,12 +5,20 @@ config SOC_SERIES_SIFIVE_FREEDOM_FU700
bool
select SOC_FAMILY_SIFIVE_FREEDOM
config SOC_SERIES
default "fu700" if SOC_SERIES_SIFIVE_FREEDOM_FU700
config SOC_SIFIVE_FREEDOM_FU740
bool
select SOC_SERIES_SIFIVE_FREEDOM_FU700
config SOC_SIFIVE_FREEDOM_FU740_S7
bool
select SOC_SIFIVE_FREEDOM_FU740
config SOC_SIFIVE_FREEDOM_FU740_U74
bool
select SOC_SIFIVE_FREEDOM_FU740
config SOC_SERIES
default "fu700" if SOC_SERIES_SIFIVE_FREEDOM_FU700
config SOC
default "fu740" if SOC_SIFIVE_FREEDOM_FU740
default "fu740" if SOC_SIFIVE_FREEDOM_FU740_S7 || SOC_SIFIVE_FREEDOM_FU740_U74

View file

@ -13,3 +13,6 @@ family:
- name: fu700
socs:
- name: fu740
cpuclusters:
- name: s7
- name: u74

View file

@ -18,7 +18,8 @@ tests:
- qemu_kvm_arm64
- xenvm
- xenvm/xenvm/gicv3
- hifive_unmatched
- hifive_unmatched/fu740/s7
- hifive_unmatched/fu740/u74
- rcar_h3ulcb/r8a77951/a57
- rcar_salvator_xs
- numaker_pfm_m467

View file

@ -11,7 +11,8 @@ tests:
- CONF_FILE="prj.conf;boards/emulated_board.conf"
- DTC_OVERLAY_FILE="boards/emulated_board.overlay"
platform_exclude:
- hifive_unmatched
- hifive_unmatched/fu740/s7
- hifive_unmatched/fu740/u74
- qemu_cortex_a53
- qemu_cortex_a53/qemu_cortex_a53/smp
- qemu_kvm_arm64
@ -30,7 +31,7 @@ tests:
- simulation
filter: dt_compat_enabled("sbs,sbs-gauge-new-api")
platform_allow:
- hifive_unmatched
- hifive_unmatched/fu740/s7
- qemu_cortex_a53
- qemu_cortex_a53/qemu_cortex_a53/smp
- qemu_kvm_arm64

View file

@ -26,4 +26,4 @@ tests:
tags:
- drivers
- memc
platform_allow: hifive_unmatched
platform_allow: hifive_unmatched/fu740/s7

View file

@ -0,0 +1,85 @@
/*
* Copyright (c) 2020 Nordic Semiconductor ASA
* Copyright (c) 2020 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*
* Application overlay for creating a fake device instance we
* can use to test DEVICE_MMIO APIs, which get raw data about
* memory ranges from DTS instances.
*
* Names in this file should be chosen in a way that won't conflict
* with real-world devicetree nodes, to allow these tests to run on
* (and be extended to test) real hardware.
*/
/ {
fakedriver@E0000000 {
compatible = "fakedriver";
reg = <0x0 0xE0000000 0x0 0x2000>;
status = "okay";
};
fakedriver@E1000000 {
compatible = "fakedriver";
reg = <0x0 0xE1000000 0x0 0x2000>;
status = "okay";
};
fakedriver@E2000000 {
compatible = "fakedriver";
reg = <0x0 0xE2000000 0x0 0x2000>;
status = "okay";
};
fakedriver@E3000000 {
compatible = "fakedriver";
reg = <0x0 0xE3000000 0x0 0x2000>;
status = "okay";
};
fakedriver@E4000000 {
compatible = "fakedriver";
reg = <0x0 0xE4000000 0x0 0x2000>;
status = "okay";
};
fakedriver_multireg@E5000000 {
compatible = "fakedriver_multireg";
reg = <0x0 0xE5000000 0x0 0x1000>,
<0x0 0xE6000000 0x0 0x1000>;
reg-names = "chip",
"dale";
status = "okay";
};
fakedeferdriver@E7000000 {
compatible = "fakedeferdriver";
reg = <0x0 0xE7000000 0x0 0x2000>;
status = "okay";
zephyr,deferred-init;
};
fakedeferdriver@E8000000 {
compatible = "fakedeferdriver";
reg = <0x0 0xE8000000 0x0 0x2000>;
status = "okay";
zephyr,deferred-init;
};
fakedomain_0: fakedomain_0 {
compatible = "fakedomain";
status = "okay";
#power-domain-cells = <0>;
power-domains = <&fakedomain_2>;
};
fakedomain_1: fakedomain_1 {
compatible = "fakedomain";
status = "okay";
#power-domain-cells = <0>;
power-domains = <&fakedomain_0>;
};
fakedomain_2: fakedomain_2 {
compatible = "fakedomain";
status = "okay";
#power-domain-cells = <0>;
};
};

View file

@ -0,0 +1,21 @@
/*
* Copyright (c) 2023 Antmicro
*
* SPDX-License-Identifier: Apache-2.0
*/
&spi2 {
status = "okay";
sdhc0: sdhc@0 {
compatible = "zephyr,sdhc-spi-slot";
reg = <0>;
status = "okay";
mmc {
compatible = "zephyr,sdmmc-disk";
disk-name = "SD";
status = "okay";
};
spi-max-frequency = <20000000>;
};
};

View file

@ -5,7 +5,8 @@ tests:
platform_allow:
- native_sim
- native_sim/native/64
- hifive_unmatched
- hifive_unmatched/fu740/s7
- hifive_unmatched/fu740/u74
- bl5340_dvk/nrf5340/cpuapp
extra_args:
- EXTRA_DTC_OVERLAY_FILE="ramdisk_small.overlay"
@ -22,7 +23,8 @@ tests:
simulation_exclude:
- renode
platform_allow:
- hifive_unmatched
- hifive_unmatched/fu740/s7
- hifive_unmatched/fu740/u74
- bl5340_dvk/nrf5340/cpuapp
extra_args: CONF_FILE=prj_sdcard.conf