**NOTE** I haven't yet tested direct boot through Raspberry's
         proprietary bootloader.

Booting Yggdrasil on Raspberry Pi 4B with u-boot:

1. Clone u-boot sources and build with rpi_4_defconfig

**NOTE** I assume you have all the bootloader parts in the boot partition already.
         If not, clone raspberry fw repo and copy the following files to the boot partition:
            * bootcode.bin
            * start4.elf
            * all the .dtb files (a bcm2711-rpi-4-b.dtb should be enough though)

2. Copy u-boot.bin into the Pi's boot partition and edit the config.txt:
enable_uart=1
arm64_bit=1
kernel=u-boot.bin

3. Compile the OS with `cargo xtask --arch=aarch64 --board=raspi4b --release`
4. Copy the following files into some directory:
    * target/aarch64-unknown-raspi4b/release/kernel.bin
    * userspace/target/aarch64-unknown-yggdrasil/release/initrd.tar
5. cd into that directory and start a TFTP server of your choice. I used `uftpd`.

6. Connect an ethernet and serial to the Pi and run the following commands in u-boot shell:

### If using DHCP
$ dhcp
### If not using DHCP
$ env set ipaddr <RASPBERRY-IP-ADDR>
$ env set fdt_addr_r 0x11000000
$ env set initrd_addr_r 0x04000000
$ tftpboot ${initrd_addr_r} <BUILD-MACHINE-IP-ADDR>:initrd.tar
$ tftpboot ${loadaddr} <BUILD-MACHINE-IP-ADDR>:kernel.bin
$ load mmc 0:1 ${fdt_addr_r} bcm2711-rpi-4-b.dtb
$ fdt addr ${fdt_addr_r}
$ fdt resize
$ fdt memory 0x0 0x3C000000
$ booti ${loadaddr} ${initrd_addr_r}:<SIZE-PRINTED-WHEN-LOADING-INITRD> ${fdt_addr_r}

###### Assuming BUILD-MACHINE-IP-ADDR is 13.0.0.1 and RASPBERRY-IP-ADDR is 13.0.0.2, here's
###### a quick command for a development boot
###### (FIXME when initrd gets larger than 64MiB)

env set ipaddr 13.0.0.2; env set fdt_addr_r 0x11000000; env set initrd_addr_r 0x04000000; tftpboot ${initrd_addr_r} 13.0.0.1:initrd.tar; tftpboot ${loadaddr} 13.0.0.1:kernel.bin; load mmc 0:1 ${fdt_addr_r} bcm2711-rpi-4-b.dtb; fdt addr ${fdt_addr_r}; fdt resize; fdt memory 0x0 0x3C000000; booti ${loadaddr} ${initrd_addr_r}:67108864 ${fdt_addr_r}
