Install FreeBSD as USB boot in ROCK64 SBC rev3

#Rock64 rev3 Dont have an SPI flash, so we cannot enable boot from USB. we need to create uboot flash to SD card and then enable boot from USB

  1. Create a u-boot for Rock64
  2. Flash u-boot to sd card
  3. Create USB drive with FreeBSD
  4. Boot from USB

1. Create u-boot for Rock64 SB

or You can download uboot for rock64 from u-boot-rock64.bin and flsh to sd card #step 3 TF-A is required when building ARM64 Rockchip SoCs images.

build TF-A:

git clone --depth 1 https://github.com/TrustedFirmware-A/trusted-firmware-a.git
cd trusted-firmware-a
make realclean
make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3328
cd ..

#it will create bl31.elf in /trusted-firmware-a/build/px30/release/bl31/bl31.elf we need to pass that while creating the u-boot

build U-boot

git clone --depth 1 https://source.denx.de/u-boot/u-boot.git
cd u-boot
#for rock64
export BL31=../trusted-firmware-a/build/px30/release/bl31/bl31.elf
make rock64-rk3328_defconfig
make CROSS_COMPILE=aarch64-linux-gnu-

#it will create u-boot-rockchip.bin

2. Flash u-boot-rockchip.bin flash it to an sd card

sudo dd if=u-boot-rockchip.bin of=/dev/sdc seek=64
sync

3. Create USB drive with FreeBSD

  1. Download FreeBSD from www.freebsd.org FreeBSD 14.1
  2. Flash the Image to USB drive using etcher or dd command
  3. sudo dd if=/path/to/image.iso of=/dev/sdb bs=4M status=progress
    sync
    

4. Boot from USB

  1. insert SD card to SD card slot of ROCK64
  2. Connect USB drive to USB port
  3. if Everything is correct the device first boot from SD card and then boot from USB
  4. you should be able to connect via ssh username:freebsd pwd:freebsd

ref: https://github.com/u-boot/u-boot/blob/master/doc/board/rockchip/rockchip.rst