Add upstream boards Milk-V Mars CM and Mars CM Lite
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
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
@@ -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
@@ -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
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.
Signed-off-by E Shattow <[email protected]>
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@@ -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@@ -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
PATCH v2 2/3 configs: starfive: Add Milk-V Mars CM and Mars CM Lite to visionfive2
In reply to E ShattowAdd 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
@@ -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
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.Signed-off-by E Shattow <[email protected]>
Best regards,
Hal
Quoted 25 lines
--- configs/starfive_visionfive2_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)configs/starfive_visionfive2_defconfig +0
-1@@ -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
PATCH v2 3/3 board: starfive: Add initial Milk-V Mars CM and Mars CM Lite user documentation
In reply to E ShattowAdd 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
@@ -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
@@ -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
@@ -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