Raspberry PI 3 Model B

This is an experimental port and is not guaranteed to work.

Hardware

RPI-3B-V1_2-SCHEMATIC-REDUCED.pdf

Feature Part Datasheet
USB+ETH SMSC LAN9514 9514.pdf
SoC BCM2837  

Running seL4 on the Raspberry Pi 3

Please also find a feature article going on seL4 the Raspberry Pi 3 on our blog (and check out the rest of the blog too!)

Serial connection

Serial TX and RX are located at GPIO pins 14 and 15 respectively (See Hardware schematic above)

Reset

Short the jumper marked “RUN” between the expansion header and USB sockets to perform a soft reset of the CPU.

U-Boot

Right now, the default U-Boot will not successfully boot an seL4 image on the RPi3, because of cache configuration issues in the seL4 ELFLoader. This problem can be remedied by having U-boot disable caches before loading seL4. Unfortunately, the stock upstream U-boot used to disable caches before loading the kernel image, but as of this patch (https://github.com/u-boot/u-boot/commit/995eab8b5b580b67394312b1621c60a71042cd18), U-boot no longer disables caches.

In order to obtain a U-boot binary that disables caching, you can either compile U-Boot from source yourself, or you can use this prebuilt U-Boot binary image which already works.

If you choose to build your own U-boot, then clone U-boot from upstream, then revert commit 995eab8b5b580b67394312b1621c60a71042cd18, and then build it:

git clone https://github.com/u-boot/u-boot.git u-boot
cd u-boot
git revert 995eab8b5b580b67394312b1621c60a71042cd18
make CROSS_COMPILE=arm-linux-gnueabi- rpi_3_32b_defconfig
make CROSS_COMPILE=arm-linux-gnueabi-

This will enable you to get the most up-to-date U-boot which will boot seL4 on the RPi3 successfully.

SD card setup

The PI boots from the first FAT32 partition on the SD card. Where files are specified, they should be located in the root directory of this partition.

Stage Filename Description Source
FSBL - Mounts SD and loads SSBL ROM
SSBL bootcode.bin Loads GPU firmware and boots GPU https://github.com/raspberrypi/firmware/tree/master/boot
GPU firmware start.elf or recovery.elf Loads CPU bootloader and boots CPU https://github.com/raspberrypi/firmware/tree/master/boot
Usually the Linux kernel, but could also be u-boot u-boot.bin u-boot You can either use our prebuilt U-boot which works, or compile your own using the instructions above
  config.txt u-boot parameters Add enable_uart=1 and kernel=u-boot.bin to the bottom of config.txt (Sample: http://codepad.org/ykVYFSyP)
  uboot.env u-boot saved environment Generated by u-boot (default environment) bootcmd copied to bootcmd_orig bootcmd and bootdelay removed

Getting seL4 onto your Raspberry Pi 3

In this section you should find the two most convenient methods of getting a kernel image booted on your RPi3 described. All three methods assume that you have already built a kernel image using one of our projects—such as seL4Test:

Checkout the sel4test project using repo as per seL4Test

repo init -u https://github.com/seL4/sel4test-manifest.git
repo sync
make rpi3_debug_xml_defconfig
# The defconfig provides a set build configuration. You can use `make menuconfig` to customize build settings further if necessary.
make

Generated binaries can be found in the images/ directory.

The two methods described here are using the SD card and TFTP.

Both methods require you to use an SD card to provide the RPi3 firmware with a U-boot bootloader it can load. The RPi3 doesn’t store its bootloader in flash memory, so it looks for the bootloader on the SD card. Please see the section above for how to prepare your SD Card for the base set of requirements; you can glance at the table above to see the files you’ll need and how to obtain them.

SD Card

Get a micro-SD card ready by getting the base files copied onto it (See the previous section).

Following this, copy your seL4 image (such as an seL4test image), onto the SD card in its root directory - that’s it. You can now remove the SD Card from your PC and re-insert it into the RPi3, and power the RPi3 on.

When the RPi3 boots up, be sure to interrupt the boot process and drop into the U-boot command prompt. From the U-boot command prompt, type something the following: fatls mmc 0. If you don’t see your seL4 image file’s name printed out, then you might need to double-check your steps so far to make sure you didn’t forget something along the way. If you see your file listed, then do something like:

fatload mmc 0 0x10000000 sel4test-driver-image-arm-bcm2837
bootelf 0x10000000

TFTP

Be sure you’ve set up the internal SD card with the required files for U-Boot and the RPi3 firmware (consult the table above). Then make certain that you’ve started up a TFTP server with your seL4 image being served by that TFTP server. From there:

usb start
dhcp
tftp 0x10000000 <YOUR_TFTP_SERVER_IP_ADDRESS>:sel4test-driver-image-arm-bcm2837
bootelf 0x10000000