* [PATCH v2 0/3] Add upstream boards Milk-V Mars CM and Mars CM Lite
@ 2025-10-21 23:09 E Shattow
2025-10-21 23:09 ` [PATCH v2 1/3] board: starfive: visionfive2: Add Milk-V Mars CM and Mars CM Lite selection by product_id E Shattow
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: E Shattow @ 2025-10-21 23:09 UTC (permalink / raw)
Cc: u-boot, E Shattow
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/20251015102253.48276-1-e@freeshell.de/
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
--
2.50.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/3] board: starfive: visionfive2: Add Milk-V Mars CM and Mars CM Lite selection by product_id
2025-10-21 23:09 [PATCH v2 0/3] Add upstream boards Milk-V Mars CM and Mars CM Lite E Shattow
@ 2025-10-21 23:09 ` E Shattow
2025-10-22 2:11 ` Hal Feng
2025-10-21 23:09 ` [PATCH v2 2/3] configs: starfive: Add Milk-V Mars CM and Mars CM Lite to visionfive2 E Shattow
2025-10-21 23:10 ` [PATCH v2 3/3] board: starfive: Add initial Milk-V Mars CM and Mars CM Lite user documentation E Shattow
2 siblings, 1 reply; 6+ messages in thread
From: E Shattow @ 2025-10-21 23:09 UTC (permalink / raw)
To: Minda Chen, Hal Feng, Tom Rini; +Cc: u-boot, 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.
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/3] configs: starfive: Add Milk-V Mars CM and Mars CM Lite to visionfive2
2025-10-21 23:09 [PATCH v2 0/3] Add upstream boards Milk-V Mars CM and Mars CM Lite E Shattow
2025-10-21 23:09 ` [PATCH v2 1/3] board: starfive: visionfive2: Add Milk-V Mars CM and Mars CM Lite selection by product_id E Shattow
@ 2025-10-21 23:09 ` E Shattow
2025-10-22 2:14 ` Hal Feng
2025-10-21 23:10 ` [PATCH v2 3/3] board: starfive: Add initial Milk-V Mars CM and Mars CM Lite user documentation E Shattow
2 siblings, 1 reply; 6+ messages in thread
From: E Shattow @ 2025-10-21 23:09 UTC (permalink / raw)
To: Minda Chen, Hal Feng, Tom Rini; +Cc: u-boot, 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.
Signed-off-by: E Shattow <e@freeshell.de>
---
configs/starfive_visionfive2_defconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configs/starfive_visionfive2_defconfig b/configs/starfive_visionfive2_defconfig
index 34ebf3b605b..fa83ecfa10f 100644
--- a/configs/starfive_visionfive2_defconfig
+++ b/configs/starfive_visionfive2_defconfig
@@ -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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 3/3] board: starfive: Add initial Milk-V Mars CM and Mars CM Lite user documentation
2025-10-21 23:09 [PATCH v2 0/3] Add upstream boards Milk-V Mars CM and Mars CM Lite E Shattow
2025-10-21 23:09 ` [PATCH v2 1/3] board: starfive: visionfive2: Add Milk-V Mars CM and Mars CM Lite selection by product_id E Shattow
2025-10-21 23:09 ` [PATCH v2 2/3] configs: starfive: Add Milk-V Mars CM and Mars CM Lite to visionfive2 E Shattow
@ 2025-10-21 23:10 ` E Shattow
2 siblings, 0 replies; 6+ messages in thread
From: E Shattow @ 2025-10-21 23:10 UTC (permalink / raw)
To: Tom Rini, Minda Chen, Hal Feng, Peng Fan, Jaehoon Chung; +Cc: u-boot, 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.
Signed-off-by: E Shattow <e@freeshell.de>
---
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
diff --git a/doc/board/starfive/index.rst b/doc/board/starfive/index.rst
index 66abc6f9d98..f85d7376b44 100644
--- a/doc/board/starfive/index.rst
+++ b/doc/board/starfive/index.rst
@@ -8,5 +8,7 @@ StarFive
deepcomputing_fml13v01
milk-v_mars
+ milkv_marscm_emmc
+ milkv_marscm_lite
pine64_star64
visionfive2
diff --git a/doc/board/starfive/milkv_marscm_emmc.rst b/doc/board/starfive/milkv_marscm_emmc.rst
new file mode 100644
index 00000000000..6956d3701bd
--- /dev/null
+++ b/doc/board/starfive/milkv_marscm_emmc.rst
@@ -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
diff --git a/doc/board/starfive/milkv_marscm_lite.rst b/doc/board/starfive/milkv_marscm_lite.rst
new file mode 100644
index 00000000000..bea96dac399
--- /dev/null
+++ b/doc/board/starfive/milkv_marscm_lite.rst
@@ -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
--
2.50.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* RE: [PATCH v2 1/3] board: starfive: visionfive2: Add Milk-V Mars CM and Mars CM Lite selection by product_id
2025-10-21 23:09 ` [PATCH v2 1/3] board: starfive: visionfive2: Add Milk-V Mars CM and Mars CM Lite selection by product_id E Shattow
@ 2025-10-22 2:11 ` Hal Feng
0 siblings, 0 replies; 6+ messages in thread
From: Hal Feng @ 2025-10-22 2:11 UTC (permalink / raw)
To: E Shattow, Tom Rini; +Cc: u-boot@lists.denx.de
> On 22.10.25 07:10, E Shattow wrote:
>
> 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>
Reviewed-by: Hal Feng <hal.feng@starfivetech.com>
Best regards,
Hal
> ---
> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH v2 2/3] configs: starfive: Add Milk-V Mars CM and Mars CM Lite to visionfive2
2025-10-21 23:09 ` [PATCH v2 2/3] configs: starfive: Add Milk-V Mars CM and Mars CM Lite to visionfive2 E Shattow
@ 2025-10-22 2:14 ` Hal Feng
0 siblings, 0 replies; 6+ messages in thread
From: Hal Feng @ 2025-10-22 2:14 UTC (permalink / raw)
To: E Shattow, Tom Rini; +Cc: u-boot@lists.denx.de
> On 22.10.25 07:10, E Shattow wrote:
>
> 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.
>
> Signed-off-by: E Shattow <e@freeshell.de>
Reviewed-by: Hal Feng <hal.feng@starfivetech.com>
Best regards,
Hal
> ---
> configs/starfive_visionfive2_defconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/configs/starfive_visionfive2_defconfig
> b/configs/starfive_visionfive2_defconfig
> index 34ebf3b605b..fa83ecfa10f 100644
> --- a/configs/starfive_visionfive2_defconfig
> +++ b/configs/starfive_visionfive2_defconfig
> @@ -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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-10-22 7:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-21 23:09 [PATCH v2 0/3] Add upstream boards Milk-V Mars CM and Mars CM Lite E Shattow
2025-10-21 23:09 ` [PATCH v2 1/3] board: starfive: visionfive2: Add Milk-V Mars CM and Mars CM Lite selection by product_id E Shattow
2025-10-22 2:11 ` Hal Feng
2025-10-21 23:09 ` [PATCH v2 2/3] configs: starfive: Add Milk-V Mars CM and Mars CM Lite to visionfive2 E Shattow
2025-10-22 2:14 ` Hal Feng
2025-10-21 23:10 ` [PATCH v2 3/3] board: starfive: Add initial Milk-V Mars CM and Mars CM Lite user documentation E Shattow
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox