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

E Shattow
2025-10-21T23:11:46Z

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

Signed-off-by: E Shattow <e@freeshell.de>
---
board/starfive/visionfive2/spl.c | 8 ++++++++
board/starfive/visionfive2/starfive_visionfive2.c | 6 ++++++
2 files changed, 14 insertions(+)

diff --git a/board/starfive/visionfive2/spl.c b/board/starfive/visionfive2/spl.c
index 420a8cf8d91..5047292a0fa 100644
--- a/board/starfive/visionfive2/spl.c
+++ b/board/starfive/visionfive2/spl.c
@@ -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;
diff --git a/board/starfive/visionfive2/starfive_visionfive2.c b/board/starfive/visionfive2/starfive_visionfive2.c
index 6271974b9c7..6c39fd4af35 100644
--- a/board/starfive/visionfive2/starfive_visionfive2.c
+++ b/board/starfive/visionfive2/starfive_visionfive2.c
@@ -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