Mainline U-Boot with SPI, NVMe and SATA boot support
(04-01-2023, 09:04 AM)runyor Wrote: I have an AHCI adapter with two SSDs mounted on it. Eventually I want to set them in RAID1.
Debian installation was flawless, installed on sda, sdb was available as well.
After rebooting post installation, when u-boot starts I get this output and an infinite boot loop:

[Image: A6-CD5-E49-0-D38-479-F-A94-D-46062-DEDAD30.png]

Any idea what is going on? Thanks!

I encountered this issue using the SATA adapter ASMedia Technology Inc. Device 1064 (rev 02) on a ROCKPRO64. However, it seems that compiling the latest version of u-boot fixed this issue (specifically, it worked in version 2023.04).
It is fairly easy to compile this on Manjaro ARM on the ROCKPRO64 itself (because I believe all dependencies are in the official repos). On Arch Linux ARM, you will have to compile arm-none-eabi-gcc and arm-none-eabi-newlib on your own, which is not very easy, but is possible (let me know if you want instructions on this).

1. So, to compile on Manjaro, install the following packages:

Code:
sudo pacman -S bc git arm-none-eabi-gcc arm-none-eabi-newlib python-setuptools swig dtc python-pyelftools


2. Download and compile the ARM Trusted Firmware (start in some known folder, like your home directory):

Code:
wget https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/snapshot/trusted-firmware-a-lts-v2.8.6.tar.gz
tar -xvf trusted-firmware-a-lts-v2.8.6.tar.gz
cd trusted-firmware-a-lts-v2.8.6
make distclean
make -j6 PLAT=rk3399 bl31

3. Download and compile u-boot (start in the same known folder, like your home directory):
Code:
wget https://ftp.denx.de/pub/u-boot/u-boot-2023.04.tar.bz2
tar -xvf u-boot-2023.04.tar.bz2
# Copy over the bl31 file from the ARM Trusted Firmware and rename to atf-bl31 since that is what u-boot looks for.
cp trusted-firmware-a-ltx-v2.8.6/build/rk3399/release/bl31/bl31.elf u-boot-2023.04/atf-bl31
cd u-boot-2023.04
make distclean

# set some custom config options in u-boot
make rockpro64-rk3399_defconfig

# For Arch Linux ARM, but you can set a custom string if you want.
echo 'CONFIG_IDENT_STRING=" Arch Linux ARM"' >> .config

# Enable support for device tree overlay files. You can skip this if you don't use device tree overlays.
echo 'CONFIG_OF_LIBFDT_OVERLAY=y' >> .config

# Enable SATA support (specifically the 'sata' command in the u-boot command line).
echo 'CONFIG_CMD_SATA=y' >> .config

# Test flags - I enabled these during build because they seemed interesting, but I don't think they do anything useful here.
echo 'CONFIG_SATA_BOOT=y' >> .config
#echo 'CONFIG_SPL_SATA=y' >> .config
echo 'CONFIG_SYS_SATA_MAX_DEVICE=10' >> .config

make -j6 EXTRAVERSION=-1


4. Install u-boot to your ROCKPRO64. In the code below, I copy u-boot to the emmc module. This will overwrite the existing version on the emmc module. You can restore it later by reflashing an OS (from another PC) to the emmc module or Micro SD card (if you are using one) or just be re-copying the original u-boot.itb and idbloader.img to the emmc module and Micro SD card. The following commands assume you start out in the same known folder, which could be your home directory.
Code:
cd u-boot-2023.04

# These require root permission because you are directly writing to blocks on the emmc module.
sudo dd if=idbloader.img of=/dev/mmcblk2 seek=64 conv=notrunc
sudo dd if=u-boot.itb of=/dev/mmcblk2 seek=16384 conv=notrunc

Note that if you are using a Micro SD card, then I assume the 'of=' part would be 'of=/dev/mmcblk1'. You can check what is currently available by running 'lsblk'.

5. Now, reboot your ROCKPRO64. Keep pressing keys on your keyboard until you get a u-boot command line prompt. Run the 'pci' command to initialize the pci interface. Now, run the 'scsi scan' command to list scsi devices. The system should now not crash. If your SATA drive shows up, then you are good to continue booting (run the 'boot' command to continue booting as normal - you don't need to normally run these commands but it can be helpful when debugging).
  Reply


Messages In This Thread
RE: Mainline U-Boot with SPI, NVMe and SATA boot support - by i3master - 05-07-2023, 09:19 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  enble boot after power loss/restore dkebler 18 9,455 12-04-2023, 12:14 PM
Last Post: ok38
Bug Broken boot: What am I missing? mkosarek 1 671 09-08-2023, 08:14 AM
Last Post: wdt
  Unable to boot Armbian on new RockPro64 mooseball 5 4,267 07-14-2023, 08:59 AM
Last Post: rockjonn
  no boot white led flashing moserwi 7 4,332 05-18-2023, 10:46 AM
Last Post: wdt
  u-boot locked on pine64pro ljones 1 1,555 09-06-2022, 10:32 AM
Last Post: ljones
  Cannot get my board to boot deutschlmao 11 8,227 09-05-2022, 04:23 PM
Last Post: ljones
  U-BOOT Tutorial hazz 0 1,154 07-19-2022, 10:48 PM
Last Post: hazz
  Installation Debian on emmc: which U-Boot and where? vongillus 3 2,808 07-02-2022, 09:24 AM
Last Post: dkebler
  ROCKPRO64 PCI SSD SD-boot Install pspgarret 0 1,166 06-09-2022, 10:56 AM
Last Post: pspgarret
  Support says "regulator" on the SBC burned out; how to fix? dmos 0 917 06-02-2022, 02:20 AM
Last Post: dmos

Forum Jump:


Users browsing this thread: 4 Guest(s)