Rock3b
| Platform | Rock3b |
| Architecture | ARMv8A, AArch64 |
| System-on-chip | RK3568 quad-core |
| CPU | Cortex-A55 Quad 2.0 GHz |
| seL4 virtualisation support | |
| seL4 SMMU support | – |
| Proofs | |
| Proof configs | AARCH64 |
| seL4 CMake platform name | rk3568 |
| Contributed by | UNSW |
| Maintained by | UNSW |
Obtaining TPL
Since some parts of the board are proprietary and need custom binaries, Rockchip provides the binaries that you need to download and include in both the TF-A and U-Boot builds. To obtain them simply execute:
git clone --depth 1 https://github.com/rockchip-linux/rkbin
Compiling TF-A
ARM Trusted Firmware-A is necessary for the board to boot up properly. It is responsible for setting up all secure peripherals and pieces of the system that the regular user won’t have access to. To build it execute:
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=rk3358
cd ..
Compiling U-Boot
In order to build U-Boot for the Rock3b, we need to first download or build the run the following commands:
git clone https://github.com/u-boot/u-boot.git u-boot
cd u-boot
make CROSS_COMPILE=aarch64-linux-gnu- rock-3b-rk3568_defconfig
make CROSS_COMPILE=aarch64-linux-gnu- BL31=../trusted-firmware-a/build/rk3568/release/bl31/bl31.elf ROCKCHIP_TPL=../rkbin/bin/rk35/rk3568_ddr_1560MHz_v1.13.bin
In the u-boot directory you should now see the U-Boot image u-boot.bin indicating that U-Boot has successfully compiled.
More information regarding U-Boot support for the Rock3b can be found here.
Flashing the U-Boot on the SD-card
To write an image that boots from a SD card (check your device path!):
sudo dd if=u-boot.bin of=/dev/<device_path> seek=64
sync
Flashing the U-Boot on the SPI Flash
If you want to boot from SPI Flash, you have to put the U-Boot image there first.
Preparation of the SD-card
Prepare the SD-card by plugging it into your PC and running:
DEV=/dev/<your device name>
sudo wipefs -a "$DEV"
# Partition table + partitions (start at 16MiB to avoid overlapping bootloader areas)
sudo parted -s "$DEV" mklabel gpt
sudo parted -s "$DEV" mkpart BOOT fat32 16MiB 256MiB
sudo parted -s "$DEV" mkpart ROOT ext4 256MiB 100%
# Format
sudo mkfs.vfat -F 32 -n BOOT ${DEV}p1
sudo mkfs.ext4 -F -L ROOT ${DEV}p2
# Flash the non-SPI image onto SD-card
sudo dd if=u-boot-rockchip.bin of=/dev/sda seek=64
# Copy the SPI image onto the ext4 partition
sudo mkdir -p sd/
sudo mount ${DEV}p2 sd/
sudo cp u-boot-rockchip-spi.bin sd/
sync
sudo umount sd/
Then insert the SD-card into the Rock3b and run following there:
mmc list
# ensure you can see you SD-card here
sf probe
# ensure you can see the flash registering itself here
ls mmc 1:2
# ensure you can see the u-boot-rockchip-spi.bin here
load mmc 1:2 $kernel_addr_r u-boot-rockchip-spi.bin
sf update $fileaddr 0 $filesize
Poweroff the board, eject the SD-card and observe the board booting from flash.
Building seL4test
Checkout the sel4test project using repo as per seL4Test
repo init -u https://github.com/seL4/sel4test-manifest.git
repo sync
mkdir cbuild
cd cbuild
../init-build.sh -DPLATFORM=rk3568 -DAARCH64=1
# The default cmake wrapper sets up a default configuration for the target platform.
# To change individual settings, run `ccmake .` and change the configuration
# parameters to suit your needs.
ninja
Generated binaries can be found in the images/ directory.
Running seL4test
You have two options of running the seL4test, either run it from the SD-card’s partition or using TFTP. Here the option of running it via TFTP is described.
This assumes the Ethernet cable connected to the board and having a DHCP and TFTP servers running. When the board boots, enter its console and simply type dhcp to establish the connection and then copy over your image from the TFTP server by running:
tftp 0x02000000 sel4test-driver-image-arm-rk3568
go 0x02000000
This will launch seL4tests.