CI: https://source.denx.de/u-boot/custodians/u-boot-riscv/-/pipelines/28051

- riscv: dts: starfive: cherry-pick jh7110 updates from v6.18-rc1-dts
- riscv: Add upstream boards Milk-V Mars CM and Mars CM Lite
- timer: sifive_clint: Add GHRTv2 compaible string
This commit is contained in:
Tom Rini
2025-10-29 07:40:40 -06:00
14 changed files with 288 additions and 73 deletions

View File

@@ -3,74 +3,6 @@
* Copyright (C) 2022 StarFive Technology Co., Ltd.
*/
// BEGIN "riscv: dts: starfive: jh7110: bootph-pre-ram hinting needed by boot loader"
// From upstream Linux conor/riscv-dt-for-next commit 8181cc2f3f21
#include <dt-bindings/reset/starfive,jh7110-crg.h>
&clint {
bootph-pre-ram;
};
&cpu0_intc {
bootph-pre-ram;
};
&cpu1_intc {
bootph-pre-ram;
};
&cpu2_intc {
bootph-pre-ram;
};
&cpu3_intc {
bootph-pre-ram;
};
&cpu4_intc {
bootph-pre-ram;
};
&osc {
bootph-pre-ram;
};
&gmac1_rgmii_rxin {
bootph-pre-ram;
};
&gmac1_rmii_refin {
bootph-pre-ram;
};
/ {
soc {
memory-controller@15700000 {
compatible = "starfive,jh7110-dmc";
reg = <0x0 0x15700000 0x0 0x10000>,
<0x0 0x13000000 0x0 0x10000>;
bootph-pre-ram;
clocks = <&syscrg JH7110_PLLCLK_PLL1_OUT>;
clock-names = "pll";
resets = <&syscrg JH7110_SYSRST_DDR_AXI>,
<&syscrg JH7110_SYSRST_DDR_OSC>,
<&syscrg JH7110_SYSRST_DDR_APB>;
reset-names = "axi", "osc", "apb";
};
};
};
&syscrg {
bootph-pre-ram;
};
&pllclk {
bootph-pre-ram;
};
// END "riscv: dts: starfive: jh7110: bootph-pre-ram hinting needed by boot loader"
/ {
soc {
memory-controller@15700000 {

View File

@@ -123,6 +123,14 @@ int board_fit_config_name_match(const char *name)
} else if (!strcmp(name, "starfive/jh7110-milkv-mars") &&
!strncmp(get_product_id_from_eeprom(), "MARS", 4)) {
return 0;
} else if (!strcmp(name, "starfive/jh7110-milkv-marscm-emmc") &&
!strncmp(get_product_id_from_eeprom(), "MARC", 4) &&
get_mmc_size_from_eeprom()) {
return 0;
} else if (!strcmp(name, "starfive/jh7110-milkv-marscm-lite") &&
!strncmp(get_product_id_from_eeprom(), "MARC", 4) &&
!get_mmc_size_from_eeprom()) {
return 0;
} else if (!strcmp(name, "starfive/jh7110-pine64-star64") &&
!strncmp(get_product_id_from_eeprom(), "STAR64", 6)) {
return 0;

View File

@@ -57,6 +57,12 @@ static void set_fdtfile(void)
fdtfile = "starfive/jh7110-deepcomputing-fml13v01.dtb";
} else if (!strncmp(get_product_id_from_eeprom(), "MARS", 4)) {
fdtfile = "starfive/jh7110-milkv-mars.dtb";
} else if (!strncmp(get_product_id_from_eeprom(), "MARC", 4)) {
if (get_mmc_size_from_eeprom()) {
fdtfile = "starfive/jh7110-milkv-marscm-emmc.dtb";
} else {
fdtfile = "starfive/jh7110-milkv-marscm-lite.dtb";
}
} else if (!strncmp(get_product_id_from_eeprom(), "STAR64", 6)) {
fdtfile = "starfive/jh7110-pine64-star64.dtb";
} else if (!strncmp(get_product_id_from_eeprom(), "VF7110A", 7)) {

View File

@@ -79,7 +79,7 @@ CONFIG_CMD_WGET=y
CONFIG_CMD_BOOTSTAGE=y
CONFIG_OF_BOARD=y
CONFIG_DEVICE_TREE_INCLUDES="starfive-visionfive2-u-boot.dtsi"
CONFIG_OF_LIST="starfive/jh7110-deepcomputing-fml13v01 starfive/jh7110-milkv-mars starfive/jh7110-pine64-star64 starfive/jh7110-starfive-visionfive-2-v1.2a starfive/jh7110-starfive-visionfive-2-v1.3b"
CONFIG_OF_LIST="starfive/jh7110-deepcomputing-fml13v01 starfive/jh7110-milkv-mars starfive/jh7110-milkv-marscm-emmc starfive/jh7110-milkv-marscm-lite starfive/jh7110-pine64-star64 starfive/jh7110-starfive-visionfive-2-v1.2a starfive/jh7110-starfive-visionfive-2-v1.3b"
CONFIG_MULTI_DTB_FIT=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_SPI_FLASH=y

View File

@@ -8,5 +8,7 @@ StarFive
deepcomputing_fml13v01
milk-v_mars
milkv_marscm_emmc
milkv_marscm_lite
pine64_star64
visionfive2

View File

@@ -0,0 +1,24 @@
.. SPDX-License-Identifier: GPL-2.0+
Milk-V Mars CM (eMMC)
=====================
U-Boot for the Mars CM uses the same U-Boot binaries as the VisionFive 2 board.
Devicetree selection is made in U-Boot SPL at runtime, dependent on the content
of EEPROM.
Device-tree selection
---------------------
U-Boot will set variable $fdtfile to starfive/jh7110-milkv-marscm-emmc.dtb
dependent on the content of EEPROM.
To overrule this selection the variable can be set manually and saved in the
environment
::
env set fdtfile my_device-tree.dtb
env save
.. include:: jh7110_common.rst

View File

@@ -0,0 +1,24 @@
.. SPDX-License-Identifier: GPL-2.0+
Mars CM Lite (SD Card)
======================
U-Boot for the Mars CM Lite uses the same U-Boot binaries as the VisionFive 2
board. Devicetree selection is made in U-Boot SPL at runtime, dependent on the
content of EEPROM.
Device-tree selection
---------------------
U-Boot will set variable $fdtfile to starfive/jh7110-milkv-marscm-lite.dtb
dependent on the content of EEPROM.
To overrule this selection the variable can be set manually and saved in the
environment
::
env set fdtfile my_device-tree.dtb
env save
.. include:: jh7110_common.rst

View File

@@ -83,6 +83,7 @@ static int riscv_aclint_timer_probe(struct udevice *dev)
static const struct udevice_id riscv_aclint_timer_ids[] = {
{ .compatible = "riscv,clint0", .data = CLINT_MTIME_OFFSET },
{ .compatible = "sifive,clint0", .data = CLINT_MTIME_OFFSET },
{ .compatible = "sifive,clint2", .data = CLINT_MTIME_OFFSET },
{ .compatible = "riscv,aclint-mtimer", .data = ACLINT_MTIME_OFFSET },
{ }
};

View File

@@ -28,6 +28,8 @@ properties:
- enum:
- deepcomputing,fml13v01
- milkv,mars
- milkv,marscm-emmc
- milkv,marscm-lite
- pine64,star64
- starfive,visionfive-2-v1.2a
- starfive,visionfive-2-v1.3b

View File

@@ -285,7 +285,6 @@
mmc-ddr-1_8v;
mmc-hs200-1_8v;
cap-mmc-hw-reset;
post-power-on-delay-ms = <200>;
pinctrl-names = "default";
pinctrl-0 = <&mmc0_pins>;
vmmc-supply = <&vcc_3v3>;
@@ -299,12 +298,9 @@
assigned-clock-rates = <50000000>;
bus-width = <4>;
bootph-pre-ram;
no-sdio;
no-mmc;
cd-gpios = <&sysgpio 41 GPIO_ACTIVE_LOW>;
disable-wp;
cap-sd-highspeed;
post-power-on-delay-ms = <200>;
pinctrl-names = "default";
pinctrl-0 = <&mmc1_pins>;
status = "okay";

View File

@@ -0,0 +1,12 @@
// SPDX-License-Identifier: GPL-2.0 OR MIT
/*
* Copyright (C) 2025 E Shattow <e@freeshell.de>
*/
/dts-v1/;
#include "jh7110-milkv-marscm.dtsi"
/ {
model = "Milk-V Mars CM";
compatible = "milkv,marscm-emmc", "starfive,jh7110";
};

View File

@@ -0,0 +1,25 @@
// SPDX-License-Identifier: GPL-2.0 OR MIT
/*
* Copyright (C) 2025 E Shattow <e@freeshell.de>
*/
/dts-v1/;
#include "jh7110-milkv-marscm.dtsi"
/ {
model = "Milk-V Mars CM Lite";
compatible = "milkv,marscm-lite", "starfive,jh7110";
};
&mmc0 {
bus-width = <4>;
cd-gpios = <&sysgpio 41 GPIO_ACTIVE_LOW>;
};
&mmc0_pins {
pwren-pins {
pinmux = <GPIOMUX(22, GPOUT_HIGH,
GPOEN_ENABLE,
GPI_NONE)>;
};
};

View File

@@ -0,0 +1,159 @@
// SPDX-License-Identifier: GPL-2.0 OR MIT
/*
* Copyright (C) 2025 E Shattow <e@freeshell.de>
*/
/dts-v1/;
#include <dt-bindings/interrupt-controller/irq.h>
#include "jh7110-common.dtsi"
/ {
aliases {
i2c1 = &i2c1;
i2c3 = &i2c3;
i2c4 = &i2c4;
serial3 = &uart3;
};
sdio_pwrseq: sdio-pwrseq {
compatible = "mmc-pwrseq-simple";
reset-gpios = <&sysgpio 33 GPIO_ACTIVE_LOW>;
};
};
&gmac0 {
assigned-clocks = <&aoncrg JH7110_AONCLK_GMAC0_TX>;
assigned-clock-parents = <&aoncrg JH7110_AONCLK_GMAC0_RMII_RTX>;
starfive,tx-use-rgmii-clk;
status = "okay";
};
&i2c0 {
status = "okay";
};
&i2c2 {
status = "disabled";
};
&i2c6 {
status = "disabled";
};
&mmc1 {
#address-cells = <1>;
#size-cells = <0>;
mmc-pwrseq = <&sdio_pwrseq>;
non-removable;
status = "okay";
ap6256: wifi@1 {
compatible = "brcm,bcm43456-fmac", "brcm,bcm4329-fmac";
reg = <1>;
interrupt-parent = <&sysgpio>;
interrupts = <34 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "host-wake";
pinctrl-0 = <&wifi_host_wake_irq>;
pinctrl-names = "default";
};
};
&pcie0 {
status = "okay";
};
&phy0 {
rx-internal-delay-ps = <1500>;
tx-internal-delay-ps = <1500>;
motorcomm,rx-clk-drv-microamp = <3970>;
motorcomm,rx-data-drv-microamp = <2910>;
motorcomm,tx-clk-10-inverted;
motorcomm,tx-clk-100-inverted;
motorcomm,tx-clk-1000-inverted;
motorcomm,tx-clk-adj-enabled;
};
&pwm {
status = "okay";
};
&spi0 {
status = "okay";
};
&sysgpio {
uart1_pins: uart1-0 {
tx-pins {
pinmux = <GPIOMUX(16, GPOUT_SYS_UART1_TX,
GPOEN_ENABLE,
GPI_NONE)>;
bias-disable;
drive-strength = <12>;
input-disable;
input-schmitt-disable;
};
rx-pins {
pinmux = <GPIOMUX(17, GPOUT_LOW,
GPOEN_DISABLE,
GPI_SYS_UART1_RX)>;
bias-pull-up;
input-enable;
input-schmitt-enable;
};
cts-pins {
pinmux = <GPIOMUX(3, GPOUT_LOW,
GPOEN_DISABLE,
GPI_SYS_UART1_CTS)>;
bias-disable;
input-enable;
input-schmitt-enable;
};
rts-pins {
pinmux = <GPIOMUX(2, GPOUT_SYS_UART1_RTS,
GPOEN_ENABLE,
GPI_NONE)>;
bias-disable;
input-disable;
input-schmitt-disable;
};
};
usb0_pins: usb0-0 {
vbus-pins {
pinmux = <GPIOMUX(25, GPOUT_SYS_USB_DRIVE_VBUS,
GPOEN_ENABLE,
GPI_NONE)>;
bias-disable;
input-disable;
input-schmitt-disable;
slew-rate = <0>;
};
};
wifi_host_wake_irq: wifi-host-wake-irq-0 {
wake-pins {
pinmux = <GPIOMUX(34, GPOUT_LOW,
GPOEN_DISABLE,
GPI_NONE)>;
input-enable;
};
};
};
&uart1 {
uart-has-rtscts;
pinctrl-0 = <&uart1_pins>;
pinctrl-names = "default";
status = "okay";
};
&usb0 {
dr_mode = "host";
pinctrl-names = "default";
pinctrl-0 = <&usb0_pins>;
status = "okay";
};

View File

@@ -35,6 +35,7 @@
cpu0_intc: interrupt-controller {
compatible = "riscv,cpu-intc";
bootph-pre-ram;
interrupt-controller;
#interrupt-cells = <1>;
};
@@ -68,6 +69,7 @@
cpu1_intc: interrupt-controller {
compatible = "riscv,cpu-intc";
bootph-pre-ram;
interrupt-controller;
#interrupt-cells = <1>;
};
@@ -101,6 +103,7 @@
cpu2_intc: interrupt-controller {
compatible = "riscv,cpu-intc";
bootph-pre-ram;
interrupt-controller;
#interrupt-cells = <1>;
};
@@ -134,6 +137,7 @@
cpu3_intc: interrupt-controller {
compatible = "riscv,cpu-intc";
bootph-pre-ram;
interrupt-controller;
#interrupt-cells = <1>;
};
@@ -167,6 +171,7 @@
cpu4_intc: interrupt-controller {
compatible = "riscv,cpu-intc";
bootph-pre-ram;
interrupt-controller;
#interrupt-cells = <1>;
};
@@ -273,12 +278,14 @@
gmac1_rgmii_rxin: gmac1-rgmii-rxin-clock {
compatible = "fixed-clock";
bootph-pre-ram;
clock-output-names = "gmac1_rgmii_rxin";
#clock-cells = <0>;
};
gmac1_rmii_refin: gmac1-rmii-refin-clock {
compatible = "fixed-clock";
bootph-pre-ram;
clock-output-names = "gmac1_rmii_refin";
#clock-cells = <0>;
};
@@ -321,6 +328,7 @@
osc: oscillator {
compatible = "fixed-clock";
bootph-pre-ram;
clock-output-names = "osc";
#clock-cells = <0>;
};
@@ -354,6 +362,7 @@
clint: timer@2000000 {
compatible = "starfive,jh7110-clint", "sifive,clint0";
reg = <0x0 0x2000000 0x0 0x10000>;
bootph-pre-ram;
interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>,
<&cpu1_intc 3>, <&cpu1_intc 7>,
<&cpu2_intc 3>, <&cpu2_intc 7>,
@@ -880,6 +889,7 @@
syscrg: clock-controller@13020000 {
compatible = "starfive,jh7110-syscrg";
reg = <0x0 0x13020000 0x0 0x10000>;
bootph-pre-ram;
clocks = <&osc>, <&gmac1_rmii_refin>,
<&gmac1_rgmii_rxin>,
<&i2stx_bclk_ext>, <&i2stx_lrck_ext>,
@@ -904,6 +914,7 @@
pllclk: clock-controller {
compatible = "starfive,jh7110-pll";
bootph-pre-ram;
clocks = <&osc>;
#clock-cells = <1>;
};
@@ -931,6 +942,19 @@
<&syscrg JH7110_SYSRST_WDT_CORE>;
};
memory-controller@15700000 {
compatible = "starfive,jh7110-dmc";
reg = <0x0 0x15700000 0x0 0x10000>,
<0x0 0x13000000 0x0 0x10000>;
bootph-pre-ram;
clocks = <&syscrg JH7110_PLLCLK_PLL1_OUT>;
clock-names = "pll";
resets = <&syscrg JH7110_SYSRST_DDR_AXI>,
<&syscrg JH7110_SYSRST_DDR_OSC>,
<&syscrg JH7110_SYSRST_DDR_APB>;
reset-names = "axi", "osc", "apb";
};
crypto: crypto@16000000 {
compatible = "starfive,jh7110-crypto";
reg = <0x0 0x16000000 0x0 0x4000>;