Skip to contentSkip to conversation

Add upstream boards Milk-V Mars CM and Mars CM Lite

PATCH In review E Shattow 2 participants 6 messages Oct 21, 2025 – Oct 22, 2025

lore
Share & tools
lore

E Shattow

author
#0 lore raw

v2 cover Add upstream boards Milk-V Mars CM and Mars CM Lite

Milk-V Mars CM and Mars CM Lite SoM's were formerly supported v2024.07 to v2025.01 and then absent since the OF_UPSTREAM transition of starfive visionfive2 multi-board support. Upstream patches are in for Linux v6.18-rc1 and available through devicetree-rebasing so let's re-introduce support for these boards.

Sorting of OF_LIST is kept consistent with LANG=C sort, and callbacks in SPL for dts selection are ordered the same. Logic for setting fdtfile env variable corresponds with the sorting of OF_LIST and not the representative EEPROM value comparisons.

This series depends on:
"dts: starfive: cherry-pick jh7110 updates from v6.18-rc1-dts"
https://lore.kernel.org/u-boot/[email protected]/

Changes since RFC v1:
- Drop patch 1/4 "riscv: dts: starfive: Add Milk-V Mars CM and Mars CM Lite from upstream Linux for-next"
- Drop patch 3/4 "riscv: dts: Add placeholder files for pending upstream Milk-V Mars CM and Mars CM Lite"
- Add patch for basic documentation stub. This should be expanded in future with a refresh of all the starfive boards' user docs.

E Shattow (3):
board: starfive: visionfive2: Add Milk-V Mars CM and Mars CM Lite
selection by product_id
configs: starfive: Add Milk-V Mars CM and Mars CM Lite to visionfive2
board: starfive: Add initial Milk-V Mars CM and Mars CM Lite user
documentation

 board/starfive/visionfive2/spl.c              |  8 +++++++
 .../visionfive2/starfive_visionfive2.c        |  6 +++++
 configs/starfive_visionfive2_defconfig        |  2 +-
 doc/board/starfive/index.rst                  |  2 ++
 doc/board/starfive/milkv_marscm_emmc.rst      | 24 +++++++++++++++++++
 doc/board/starfive/milkv_marscm_lite.rst      | 24 +++++++++++++++++++
 6 files changed, 65 insertions(+), 1 deletion(-)
 create mode 100644 doc/board/starfive/milkv_marscm_emmc.rst
 create mode 100644 doc/board/starfive/milkv_marscm_lite.rst
Signature · 1 line
2.50.0
author
#1 lore raw

PATCH v2 1/3 board: starfive: visionfive2: Add Milk-V Mars CM and Mars CM Lite selection by product_id

Add identifier for Milk-V Mars CM to dts selection callback in SPL, and to fdtfile environment variable default value selection in payload.

---
 board/starfive/visionfive2/spl.c                  | 8 ++++++++
 board/starfive/visionfive2/starfive_visionfive2.c | 6 ++++++
 2 files changed, 14 insertions(+)
board/starfive/visionfive2/spl.c +8 -0
index 420a8cf8d91..5047292a0fa 100644
@@ -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;
board/starfive/visionfive2/starfive_visionfive2.c +6 -0
index 6271974b9c7..6c39fd4af35 100644
@@ -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)) {
Signature · 1 line
2.50.0
Reviewed-by on v2 1/3
#2 lore raw

RE: [PATCH v2 1/3] board: starfive: visionfive2: Add Milk-V Mars CM and Mars CM Lite selection by product_id

Quoted 6 lines · E Shattow

Add identifier for Milk-V Mars CM to dts selection callback in SPL, and to fdtfile environment variable default value selection in payload.

Best regards,
Hal

Quoted 44 lines
---
 board/starfive/visionfive2/spl.c                  | 8 ++++++++
 board/starfive/visionfive2/starfive_visionfive2.c | 6 ++++++
 2 files changed, 14 insertions(+)
board/starfive/visionfive2/spl.c +8 -0
index 420a8cf8d91..5047292a0fa 100644
@@ -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;
board/starfive/visionfive2/starfive_visionfive2.c +6 -1
index 6271974b9c7..6c39fd4af35 100644
@@ -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)) {
--

2.50.0

author
#3 lore raw

PATCH v2 2/3 configs: starfive: Add Milk-V Mars CM and Mars CM Lite to visionfive2

In reply to E Shattow

Add Milk-V Mars CM and Mars CM Lite to visionfive2.

These boards were previously supported and then removed in the transition to OF_UPSTREAM. The dts have landed in the for-next queue so let's add the boards again.

---
 configs/starfive_visionfive2_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configs/starfive_visionfive2_defconfig +1 -1
index 34ebf3b605b..fa83ecfa10f 100644
@@ -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
Signature · 1 line
2.50.0
Reviewed-by on v2 2/3
#4 lore raw

RE: [PATCH v2 2/3] configs: starfive: Add Milk-V Mars CM and Mars CM Lite to visionfive2

Quoted 9 lines · E Shattow

Add Milk-V Mars CM and Mars CM Lite to visionfive2.

These boards were previously supported and then removed in the transition to OF_UPSTREAM. The dts have landed in the for-next queue so let's add the boards again.

Best regards,
Hal

Quoted 25 lines
---
 configs/starfive_visionfive2_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configs/starfive_visionfive2_defconfig +0 -1
index 34ebf3b605b..fa83ecfa10f 100644
@@ -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
--
2.50.0

author
#5 lore raw

PATCH v2 3/3 board: starfive: Add initial Milk-V Mars CM and Mars CM Lite user documentation

In reply to E Shattow

Add initial board docs for Milk-V Mars CM (eMMC) and Milk-V Mars CM Lite (SD Card) to the visionfive2 board target.

---
 doc/board/starfive/index.rst             |  2 ++
 doc/board/starfive/milkv_marscm_emmc.rst | 24 ++++++++++++++++++++++++
 doc/board/starfive/milkv_marscm_lite.rst | 24 ++++++++++++++++++++++++
 3 files changed, 50 insertions(+)
 create mode 100644 doc/board/starfive/milkv_marscm_emmc.rst
 create mode 100644 doc/board/starfive/milkv_marscm_lite.rst
doc/board/starfive/index.rst +2 -0
index 66abc6f9d98..f85d7376b44 100644
@@ -8,5 +8,7 @@ StarFive
 
    deepcomputing_fml13v01
    milk-v_mars
+   milkv_marscm_emmc
+   milkv_marscm_lite
    pine64_star64
    visionfive2
doc/board/starfive/milkv_marscm_emmc.rst new file +24 -0
new file mode 100644
index 00000000000..6956d3701bd
@@ -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
doc/board/starfive/milkv_marscm_lite.rst new file +24 -0
new file mode 100644
index 00000000000..bea96dac399
@@ -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
Signature · 1 line
2.50.0