Hi, I have an espressobin v5 1GB - 1ct with old u-boot, booting from sd card. It seems that the card has started degrading, and I am willing to upgrade-flash newer u-boot to spi and try booting directly from ssd.
My plan is to replicate my current system using firmware selector and my current config files.
I am wondering how should I go about installing the squashfs sd card image to ssd. So far, it seems to me that I need to use dd to write the image to the ssd, and then change boot.scr on the first partition.
Q1: Is this a correct procedure for squashfs SD card image?
Ideally, I will try to change bootscript (and compile it with mkimage) to be able to boot from ssd and in case of any error from sdcard.
The current bootscript for u-boot 2023.07.02 has mmc hard-coded.
Not sure how to modify boot.scr to boot from ssd and fallback to mmc.
I am thinking of borrowing some code from bootscript for turris omnia but I would need ssd boot first.
Q2: Does it matter if the code for ssd boot preceeds the code for mmc in boot.scr
like below? If, for some reason, the ssd boot code needs to be placed after the mmc code, would it be sufficient to use boot_targets (setenv boot_targets "sci mmc0 mmc1 usb pxe
")? Do I need to include scsi scan
command to detect the ssd with u-boot 2023.07.02?
# Bootscript for Globalscale ESPRESSOBin Board
# Set distro variables if necessary for compability with downstream firmware
if test -z "${kernel_addr_r}"; then
setenv kernel_addr_r 0x7000000
fi
if test -z "${fdt_add_r}"; then
setenv fdt_addr_r 0x6f00000
fi
# New for ssd boot
if test -z "${devtype}"; then
setenv devtype scsi
fi
# Boot from the first disk (issues may arise with usb sticks)
if test -z "${devnum}"; then
setenv devnum 0
fi
if test -z "${devtype}"; then
setenv devtype mmc
fi
if test -z "${devnum}"; then
if mmc dev 0; then
setenv devnum 0
elif mmc dev 1; then
setenv devnum 1
fi
fi
# figure out partition uuid to pass to the kernel as root=
part uuid ${devtype} ${devnum}:2 uuid
setenv console "console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000"
setenv bootargs "root=PARTUUID=${uuid} rw rootwait ${console}"
echo "Booting Linux from ${devtype} ${devnum} with args: ${bootargs}"
load ${devtype} ${devnum}:1 ${fdt_addr_r} @DTB@.dtb
load ${devtype} ${devnum}:1 ${kernel_addr_r} Image
booti ${kernel_addr_r} - ${fdt_addr_r}
Q3: In case that booting directly from ssd works no matter the order used in boot.scr
, I expect that I need to copy the new boot.scr
to the sdcard also. Correct?
Thank you