Boot Raspberry Pi 4 from USB

Finally, I was able to boot my Raspberry Pi 4's form USB.

Flash normal method, then update and upgrade:

$ sudo apt update && sudo apt upgrade -y 
$ sudo apt full-upgrade -y
$ sudo rpi-update

View the bootload version:

$ vcgencmd bootloader_version
May 10 2019 19:40:36  
version d2402c53cdeb0f072ff05d52987b1b6b6d474691 (release)  
timestamp 0  

Then reboot:

$ sudo reboot

When we view the version again we can see it changed:

$ vcgencmd bootloader_version
Apr 16 2020 18:11:26  
version a5e1b95f320810c69441557c5f5f0a7f2460dfb8 (release)  
timestamp 1587057086  

We need to configure eeprom to include beta updates:

$ sudo apt install rpi-eeprom -y
$ sudo sed -i 's/critical/beta/g' /etc/default/rpi-eeprom-update

We can get the latest version:

$ ls /lib/firmware/raspberrypi/bootloader/beta/pieeprom-

Patch to the latest update:

$ sudo rpi-eeprom-update -d -f /lib/firmware/raspberrypi/bootloader/beta/pieeprom-2020-06-15.bin
BCM2711 detected  
Dedicated VL805 EEPROM detected  
BOOTFS /boot  
*** INSTALLING /lib/firmware/raspberrypi/bootloader/beta/pieeprom-2020-06-15.bin  ***
BOOTFS /boot  
EEPROM update pending. Please reboot to apply the update.  

View the version:

$ vcgencmd bootloader_version
Apr 16 2020 18:11:26  
version a5e1b95f320810c69441557c5f5f0a7f2460dfb8 (release)  
timestamp 1587057086  

We can view the config:

$ vcgencmd bootloader_config
[all]
BOOT_UART=0  
WAKE_ON_GPIO=1  
POWER_OFF_ON_HALT=0  
DHCP_TIMEOUT=45000  
DHCP_REQ_TIMEOUT=4000  
TFTP_FILE_TIMEOUT=30000  
TFTP_IP=  
TFTP_PREFIX=0  
BOOT_ORDER=0x1  
SD_BOOT_MAX_RETRIES=3  
NET_BOOT_MAX_RETRIES=5  
[none]
FREEZE_VERSION=0  

Then reboot:

$ sudo reboot

View the config again and ensure BOOT_ORDER includes 0xf41:

$ vcgencmd bootloader_config
[all]
BOOT_UART=0  
WAKE_ON_GPIO=1  
POWER_OFF_ON_HALT=0  
DHCP_TIMEOUT=45000  
DHCP_REQ_TIMEOUT=4000  
TFTP_FILE_TIMEOUT=30000  
ENABLE_SELF_UPDATE=1  
DISABLE_HDMI=0  
BOOT_ORDER=0xf41

$ vcgencmd bootloader_version
Jun 15 2020 14:36:19  
version c302dea096cc79f102cec12aeeb51abf392bd781 (release)  
timestamp 1592228179  

Now remove the SDCard and flash a new SDCard with raspbian and insert both into a computer:

$ df -h
Filesystem      Size   Used  Avail Capacity iused      ifree %iused  Mounted on  
/dev/disk2s1   252Mi   54Mi  198Mi    22%       0          0  100%   /Volumes/boot
/dev/disk3s1   252Mi   52Mi  200Mi    21%       0          0  100%   /Volumes/boot 1

Now copy the *.dat and *.elf files from the patched SDCard to the new SDCard:

$ cp /Volumes/boot/*.dat /Volumes/boot\ 1/
$ cp /Volumes/boot/*.elf /Volumes/boot\ 1/

Source:
- https://www.youtube.com/watch?v=zVhYvvrGhMU

Performance tests with USB:

Writes:  
sync; dd if=/dev/zero of=/root/tempfile bs=1M count=512; sync  
512+0 records in  
512+0 records out  
536870912 bytes (537 MB, 512 MiB) copied, 7.73295 s, 69.4 MB/s

Direct Read  
hdparm -t /dev/sda1  
/dev/sda1:
 Timing buffered disk reads: 256 MB in  2.14 seconds = 119.55 MB/sec

Cached Read:  
hdparm -T /dev/sda1  
/dev/sda1:
 Timing cached reads:   1748 MB in  2.00 seconds = 873.86 MB/sec

Performance tests with SDCard:

Writes:  
sync; dd if=/dev/zero of=/root/tempfile bs=1M count=512; sync  
512+0 records in  
512+0 records out  
536870912 bytes (537 MB, 512 MiB) copied, 96.8187 s, 5.5 MB/s

Direct Read:  
hdparm -t /dev/mmcblk0p1  
/dev/mmcblk0p1:
 Timing buffered disk reads: 130 MB in  3.01 seconds =  43.23 MB/sec

Cached Read:  
hdparm -T /dev/mmcblk0p1

/dev/mmcblk0p1:
 Timing cached reads:   1616 MB in  2.00 seconds = 808.21 MB/sec