]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
board: starfive: visionfive2: Add Milk-V Mars CM and Mars CM Lite selection by product_id
authorE Shattow <e@freeshell.de>
Tue, 21 Oct 2025 23:09:58 +0000 (16:09 -0700)
committerLeo Yu-Chi Liang <ycliang@andestech.com>
Tue, 28 Oct 2025 11:30:56 +0000 (19:30 +0800)
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>
board/starfive/visionfive2/spl.c
board/starfive/visionfive2/starfive_visionfive2.c

index 48b034af305a80ac6cc11eaa71ea19e5bcf9ff0a..2d9431d297695af3e91bfc89746d78af25f68c7a 100644 (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;
index 6271974b9c76fa773ec4e2e31e5741c0fcb50168..6c39fd4af35f33e55083c3eba1db2190784da393 100644 (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)) {