From 9e68fe93db58bc42d0d314b8028d3eac26a772c7 Mon Sep 17 00:00:00 2001 From: Alexey Firago Date: Tue, 7 Mar 2023 20:48:49 +0000 Subject: [PATCH] u-boot-starfive: vf2: Update uEnv.txt Align uEnv.txt with the Starfive SDK to boot from SD card. uEnv sets required variables to read the fitImage from the partition 3 on the SD card and rootfs is expected on the partition 4. Signed-off-by: Alexey Firago --- .../u-boot-starfive/uEnv-visionfive2.txt | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/recipes-bsp/u-boot/u-boot-starfive/uEnv-visionfive2.txt b/recipes-bsp/u-boot/u-boot-starfive/uEnv-visionfive2.txt index 42c5b50f..7a23adc1 100644 --- a/recipes-bsp/u-boot/u-boot-starfive/uEnv-visionfive2.txt +++ b/recipes-bsp/u-boot/u-boot-starfive/uEnv-visionfive2.txt @@ -1,14 +1,22 @@ -fdt_high=0xffffffffffffffff -initrd_high=0xffffffffffffffff -kernel_addr_r=0x44000000 -kernel_comp_addr_r=0x90000000 -kernel_comp_size=0x10000000 -fdt_addr_r=0x48000000 -ramdisk_addr_r=0x48100000 -# Move distro to first boot to speed up booting -boot_targets=distro mmc0 dhcp -# Fix wrong fdtfile name -fdtfile=starfive/jh7110-visionfive-v2.dtb -# Fix missing bootcmd -bootcmd=run bootcmd_distro -bootargs=root=/dev/mmcblk1p2 rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0 +# This is the sample jh7110_uEnv.txt file for starfive visionfive U-boot +# The current convention (SUBJECT TO CHANGE) is that this file +# will be loaded from the third partition on the +# MMC card. +#devnum=1 +partnum=3 + +# The FIT file to boot from +fitfile=fitImage + +# for debugging boot +bootargs_ext=if test ${devnum} = 0; then setenv bootargs "earlyprintk console=ttyS0,115200 debug rootwait earlycon=sbi root=/dev/mmcblk0p4"; else setenv bootargs "earlyprintk console=ttyS0,115200 debug rootwait earlycon=sbi root=/dev/mmcblk1p4"; fi; + +# for addr info +fileaddr=0xa0000000 +fdtaddr=0x46000000 +# boot Linux flat or compressed 'Image' stored at 'kernel_addr_r' +kernel_addr_r=0x40200000 + +bootwait=setenv _delay ${bootdelay}; echo ${_delay}; while test ${_delay} > 0; do sleep 1; setexpr _delay ${_delay} - 1; echo ${_delay}; done + +boot2=run bootargs_ext; mmc dev ${devnum}; fatload mmc ${devnum}:${partnum} ${fileaddr} ${fitfile}; bootm ${fileaddr} \ No newline at end of file