I have a Starfive Visionfive V1 board and try to configure an image with mender-core and u-boot.
I use Yocto kirkstone branch with
- GitHub - mendersoftware/meta-mender: Yocto Project meta layer for the Mender client branch=master-next
- GitHub - starfive-tech/u-boot branch=JH7100_upstream
- GitHub - limingle/meta-starfive-bsp: OE/Yocto layer for Starfive VisionFive V1 board branch=kirkstone
I make the setup depending on the manual-u-boot-integration Manual U-Boot integration | Mender documentation
Yocto bitbake my image without error and I get a sdimg.
I change the file starfive-jh7100.h and some other files and get a patch:
diff --git a/configs/starfive_jh7100_visionfive_smode_defconfig b/configs/starfive_jh7100_visionfive_smode_defconfig
index 4d49db8990..c73de1552f 100644
--- a/configs/starfive_jh7100_visionfive_smode_defconfig
+++ b/configs/starfive_jh7100_visionfive_smode_defconfig
@@ -4,7 +4,6 @@ CONFIG_SYS_MALLOC_F_LEN=0x3000
CONFIG_NR_DRAM_BANKS=1
CONFIG_SYS_MEMTEST_START=0x80000000
CONFIG_SYS_MEMTEST_END=0x200000000
-CONFIG_ENV_SIZE=0x1f000
CONFIG_ENV_SECT_SIZE=0x1000
# CONFIG_DM_GPIO is not set
CONFIG_DEFAULT_DEVICE_TREE="jh7100-visionfive"
@@ -109,7 +108,6 @@ CONFIG_CMD_FS_UUID=y
CONFIG_CMD_DIAG=y
CONFIG_CMD_LOG=y
CONFIG_ENV_OVERWRITE=y
-CONFIG_ENV_IS_IN_SPI_FLASH=y
CONFIG_ENV_SECT_SIZE_AUTO=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
CONFIG_VERSION_VARIABLE=y
@@ -161,3 +159,39 @@ CONFIG_FS_CRAMFS=y
CONFIG_ERRNO_STR=y
# CONFIG_GENERATE_SMBIOS_TABLE is not set
CONFIG_UNIT_TEST=y
+CONFIG_BMP_24BPP=y
+CONFIG_DM_VIDEO=y
+CONFIG_ENV_SIZE=0x20000
+CONFIG_ENV_OFFSET=0x800000
+CONFIG_ENV_OFFSET_REDUND=0x1000000
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
+CONFIG_MMC=y
+CONFIG_SYS_MMC_ENV_DEV=0
+CONFIG_SYS_MMC_ENV_PART=0
+# CONFIG_ENV_IS_NOWHERE is not set
+# CONFIG_ENV_IS_IN_EEPROM is not set
+# CONFIG_ENV_IS_IN_FAT is not set
+# CONFIG_ENV_IS_IN_EXT4 is not set
+# CONFIG_ENV_IS_IN_FLASH is not set
+# CONFIG_ENV_IS_IN_NAND is not set
+# CONFIG_ENV_IS_IN_NVRAM is not set
+# CONFIG_ENV_IS_IN_ONENAND is not set
+# CONFIG_ENV_IS_IN_REMOTE is not set
+# CONFIG_ENV_IS_IN_SPI_FLASH is not set
+# CONFIG_ENV_IS_IN_UBI is not set
+CONFIG_ENV_IS_IN_MMC=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_FS_GENERIC=y
+# CONFIG_BOOTCOUNT_BOOTLIMIT is not set
+# CONFIG_BOOTCOUNT_GENERIC is not set
+# CONFIG_BOOTCOUNT_EXT is not set
+# CONFIG_BOOTCOUNT_AM33XX is not set
+# CONFIG_BOOTCOUNT_AM33XX_NVMEM is not set
+# CONFIG_BOOTCOUNT_RAM is not set
+# CONFIG_BOOTCOUNT_I2C is not set
+# CONFIG_BOOTCOUNT_AT91 is not set
+# CONFIG_BOOTCOUNT_MEM is not set
+# CONFIG_BOOTCOUNT_ALEN is not set
+CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_ENV=y
+# CONFIG_BOOTCOMMAND is not set
diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index 3f724aa10f..ac47d91dc5 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -499,7 +499,6 @@
"done\0"
#ifndef CONFIG_BOOTCOMMAND
-#define CONFIG_BOOTCOMMAND "run distro_bootcmd"
#endif
#endif /* _CONFIG_CMD_DISTRO_BOOTCMD_H */
diff --git a/include/configs/starfive-jh7100.h b/include/configs/starfive-jh7100.h
index 44ac15b9e5..582d5ce799 100644
--- a/include/configs/starfive-jh7100.h
+++ b/include/configs/starfive-jh7100.h
@@ -57,30 +57,22 @@
#define STARLIGHT_FEDORA_BOOTENV \
"bootdir=/boot\0" \
- "bootenv=uEnv.txt\0" \
- "mmcdev=0\0" \
- "mmcpart=3\0"
-
-#define STARLIGHT_TEST_BOOTENV \
- "testpart=0:1\0" \
- "testenv=u74_uEnv.txt\0" \
- "mmcsetup=mmc part\0" \
- "fdtsetup=fdt addr ${fdtcontroladdr}\0" \
- "fatenv=fatload mmc ${testpart} ${loadaddr} ${testenv};" \
- "env import -t ${loadaddr} ${filesize}\0"
+ "bootenv=uEnv.txt\0"
#define CONFIG_EXTRA_ENV_SETTINGS \
+ MENDER_ENV_SETTINGS \
STARLIGHT_FEDORA_BOOTENV \
- "loadaddr=0xa0000000\0" \
- STARLIGHT_TEST_BOOTENV \
- "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
- "ext4bootenv=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootenv}\0" \
- "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \
+ "kernel_addr_r=0xa0000000\0" \
+ "loadbootenv=fatload ${mender_uboot_boot} ${loadaddr} ${bootenv}\0" \
+ "ext4bootenv=ext4load ${mender_uboot_root} ${loadaddr} ${bootdir}/${bootenv}\0" \
+ "loadfdt=ext4load ${mender_uboot_root} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
+ "importbootenv=echo Importing environment from mmc mender_uboot_dev ${mender_uboot_dev} ...; " \
"env import -t ${loadaddr} ${filesize}\0" \
- "mmcbootenv=setenv bootpart ${mmcdev}:${mmcpart}; " \
- "mmc dev ${mmcdev}; " \
+ "mmcbootenv=setenv bootpart ${mender_uboot_root}; " \
+ "mmc dev ${mender_uboot_dev}; " \
+ "setenv devnum ${mender_uboot_dev}; " \
"if mmc rescan; then " \
- "run loadbootenv && run importbootenv; " \
+ "run loadbootenv && run importbootenv && run loadfdt; " \
"run ext4bootenv && run importbootenv; " \
"if test -n $uenvcmd; then " \
"echo Running uenvcmd ...; " \
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index b9c1c61e13..657ca09a73 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -1205,6 +1205,13 @@ CONFIG_SRIO_PCIE_BOOT_UCODE_ENV_SIZE
CONFIG_SSE2
CONFIG_STACKBASE
CONFIG_STANDALONE_LOAD_ADDR
+CONFIG_STARFIVE_EEPROM_ATOM1_PSTR
+CONFIG_STARFIVE_EEPROM_ATOM1_PSTR_SIZE
+CONFIG_STARFIVE_EEPROM_ATOM1_SN_OFFSET
+CONFIG_STARFIVE_EEPROM_ATOM1_VSTR
+CONFIG_STARFIVE_EEPROM_ATOM1_VSTR_SIZE
+CONFIG_STARFIVE_EEPROM_HATS_SIZE_MAX
+CONFIG_STARFIVE_EEPROM_WP_OFFSET
CONFIG_STATIC_BOARD_REV
CONFIG_STD_DEVICES_SETTINGS
CONFIG_SXNI855T
If I boot the board from the SDCard I get the following error:
U-Boot 2022.01-rc4-VisionFive-g0c08d335c5 (Dec 30 2021 - 08:30:15 +0800)StarFive
CPU: rv64imafdc
Model: StarFive VisionFive V1
DRAM: 8 GiB
MMC: mmc@10000000: 0, mmc@10010000: 1
Loading Environment from SPIFlash... cadence_spi spi@11860000: Can't get reset: -524
SF: Detected gd25lq128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment
StarFive EEPROM format v1
--------EEPROM INFO--------
Vendor : StarFive Technology Co., Ltd.
Product full SN: VF7100A1-2204-D008E000-000000F7
data version: 0x1
PCB revision: 0x1
BOM revision: A
Ethernet MAC address: 6c:cf:39:00:00:f6
--------EEPROM INFO--------
In: serial@12440000
Out: serial@12440000
Err: serial@12440000
Net: dwmac.10020000
MMC CD is 0x0, force to True.
MMC CD is 0x0, force to True.
switch to partitions #0, OK
mmc0 is current device
MMC CD is 0x0, force to True.
MMC CD is 0x0, force to True.
654 bytes read in 20 ms (31.3 KiB/s)
Importing environment from mmc0 ...
Failed to load '/boot/uEnv.txt'
Autoboot in 2 seconds
** Bad device specification 0x84000000 boot/Image **
Couldn't find partition 0x84000000 boot/Image.gz
Can't set block device
** Bad device specification 0x88000000 boot/jh7100-starfive-visionfive-v1 **
Couldn't find partition 0x88000000 boot/jh7100-starfive-visionfive-v1.dtb
Can't set block device
Bad Linux RISCV Image magic!
Can someone give me any hints to solve the problem?