The HiFive Premier 550 Image Update Procedure seems to state in Chapter 6 that it’s possible to boot Ubuntu 24 from SATA. However after following the all the steps in both Chapter 2 (updating bootchain via u-boot) and Chapter 6, our board is still stopping in u-boot after trying and failing to boot from mmc only.
Any advice on making this work?
Default value of “boot_targets” variable:
=> env print boot_targets
boot_targets=mmc1 usb sata mmc0
So far I have tried:
boot_targets=mmc1 usb sata0 mmc0
boot_targets=mmc1 usb sata0:3 mmc0
“ls sata 0:1” shows an EFI partition.
“ls sata 0:2” appears to show a “CIDATA” partition.
“ls sata 0:3” shows the contents of a standard Ubuntu root file system (/bin, /boot, /etc and so on.)
Try to set the “boot_targets”
boot_targes=sata0 mmc1 usb mmc0
Because the boot mode is bootflow scan, it will search according to the device order of boot_targets. If the current device is found to be bootable, it will enter the device to complete the boot, otherwise it will continue to search.
I tried setting boot_targets to “sata0 mmc1 usb mmc0”, but I’m still getting stuck in u-boot.
I’ll paste my u-boot messages and printenv results below.
U-Boot 2024.01 (Nov 06 2024 - 05:26:46 +0000)
CPU: rv64imafdc_zba_zbb
Model: SiFive HiFive Premier P550
DRAM: 32 GiB (effective 16 GiB)
Core: 113 devices, 30 uclasses, devicetree: separate
Warning: Device tree includes old 'u-boot,dm-' tags: please fix by 2023.07!
MMC: sdhci@50450000: 0, sd@50460000: 1
Loading Environment from SPIFlash... SF: Detected w25q128fw with page size 256 Bytes, erase size 4 KiB, total 16 MiB
OK
eswin_pcie_wait_link_up: error: wait linkup timeout
PCIE-0: Link up (Gen1-x1, Bus0)
[display_init]Eswin UBOOT DRM driver version: v1.0.1
xfer: num: 2, addr: 0x50
can't find valid hdmi mode
[display_init]init failed.
In: serial,usbkbd
Out: vidconsole,serial
Err: vidconsole,serial
Bootspi flash write protection enabled
Get som info from flash
Cpu volatge need boost above 1.6 Ghz!
Could not find "root" partition
Low power features will not be supported!
Net: eth0: ethernet@50400000
Working FDT set to ed51c710
starting USB...
Bus usb1@50490000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus usb1@50490000 for devices... 5 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
AHCI 0001.0301 32 slots 1 ports 6 Gbps 0x1 impl SATA mode
flags: 64bit ncq stag pm led clo only pmp pio slum part
scanning bus for devices...
Rescanning SATA bus for devices...
SATA Device Info:
S/N: 24506J800980
Product model number: WDC WDS100T1R0A-68A4W0
Firmware version: 411010WR
Capacity: 1953525168 sectors
Hit any key to stop autoboot: 0
MMC: no card present
MMC: no card present
MMC: no card present
Hello ESWIN support, I posted more details from the booting board a few days ago. It’s still not booting from SATA. Can you take a look again and see what other settings I might need to change? Does the SATA partition have to be marked bootable, like a PC running MS-DOS or Windows? Thanks!
SATA booting issue is solved … sort of. Here’s what we did to make it work with our board.
Copy files ‘bootloader_ddr5_secboot.bin’ and ‘ubuntu-24.04-preinstalled-server-riscv64.img’ to ext4fs formatted USB hard drive.
Connect USB drive to bottom USB 3.0 port at rear of motherboard.
Connect to USB-C serial console from another computer (we used Putty on a Windows laptop).
Boot the board and stop autoboot in the serial console.
In the serial console, type usb reset
Type ls usb 0 to make sure the two files listed above are shown as available.
Flash the bootchain image with the following commands.
ext4load usb 0 0x90000000 bootloader_ddr5_secboot.bin
es_burn write 0x90000000 flash
Flash the Ubuntu image to the MMC card.
es_fs write usb 0 ubuntu-24.04-preinstalled-server-riscv64.img mmc 0
Flash the Ubuntu image again, this time to the SATA drive.
es_fs write usb 0 ubuntu-24.04-preinstalled-server-riscv64.img sata 0
reset to reboot the board.
At this point mmc0 and sata0 both have three partitions:
p1 /boot/efi
p2 CIDATA
p3 / (root file system with UUID “a8d93d57-5214-430a-8179-efc4f310aef3”
Chapter 6 of the Image Update Procedure warns that there should not be two file systems with the same UUID, and provides instructions for erase, but when we tried those instructions, the whole MMC card was wiped, not just the root file system. So the following is a kind of workaround.
When the board starts up, seems like it will always start with mmc0 partition 0, but then when the kernel loads, it will pick one or the other of the root file systems to mount as /. By good luck, the first time we booted the board it mounted the root file system on /dev/sda3 (third partition on SATA drive). Once Ubuntu was fully loaded to where we could start a terminal, we were able to use parted to remove the duplicate unneeded root file system on /dev/mmcblk0p3 .
After that the board would always start up with the root file system on /dev/sda3.
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 931.5G 0 disk
├─sda1 8:1 0 100M 0 part /boot/efi
├─sda2 8:2 0 4M 0 part
└─sda3 8:3 0 931.4G 0 part /
mmcblk0 179:0 0 116.5G 0 disk
├─mmcblk0p1 179:1 0 100M 0 part
└─mmcblk0p2 179:2 0 4M 0 part
mmcblk0boot0 179:8 0 4M 1 disk
mmcblk0boot1 179:16 0 4M 1 disk
Hope this helps. If anyone has a more elegant way to do this, please do add a reply!
Last followup: by doing a one-time change of the entry for root= in the active kernel boot line in GRUB, I think it will direct the kernel to mount the root filesystem only from the SATA drive partition 3.
i.e. when the board boots and the GRUB menu comes up, hit ‘e’ to edit and then change this line:
linux /boot/vmlinuz-6.6.21-10-premier root=UUID=a8d93d57-5214-430a-8179-efc4f310aef3 ro efi=debug earlycon=sbi
to this:
linux /boot/vmlinuz-6.6.21-10-premier root=/dev/sda3 ro efi=debug earlycon=sbi
I found the grub editor very slow but eventually was able to make this change, and the board then mounted /dev/sda3 as / .