diff --git a/build_sdk.py b/build_sdk.py index f1c9f0a2..de3cc6dd 100644 --- a/build_sdk.py +++ b/build_sdk.py @@ -317,6 +317,15 @@ class ConfigInfo: "KernelPlatform": "rockpro64", } | DEFAULT_KERNEL_OPTIONS_AARCH64, ), + BoardInfo( + name="rock3b", + arch=KernelArch.AARCH64, + gcc_cpu="cortex-a55", + loader_link_address=0x30000000, + kernel_options={ + "KernelPlatform": "rk3568", + } | DEFAULT_KERNEL_OPTIONS_AARCH64, + ), BoardInfo( name="hifive_p550", arch=KernelArch.RISCV64, diff --git a/docs/manual.md b/docs/manual.md index d50e1f6d..8e6aec16 100644 --- a/docs/manual.md +++ b/docs/manual.md @@ -1140,6 +1140,7 @@ The currently supported platforms are: * qemu_virt_aarch64 * qemu_virt_riscv64 * rockpro64 +* rock3b * rpi4b_1gb * rpi4b_2gb * rpi4b_4gb @@ -1379,6 +1380,19 @@ Microkit will produce a raw binary file by default, so when using U-Boot run the => go 0x30000000 +## Radxa Rock3b {#rock3b} + +Support is available for the Radxa Rock3b platform which is based on the Rockchip rk3568 SoC. + +Since the platform relies on some closed-source binary blobs for first stage bootloader and then ARM's TrustZone A, we need to compile the U-Boot including these images. Detailed instructions on how to do that are avalilable [here](https://docs.sel4.systems/Hardware/rock3b.html). + +Once the proper U-Boot image is in place, you can simply load the `loader.img` on the board and run it like that (this is assuming you have the TFTP server set up): + + => tftp 0x02000000 loader.img + => go 0x02000000 + +For more booting options, please refer to the seL4 [board setup guide](https://docs.sel4.systems/Hardware/rock3b.html). + ## Pine64 Star64 {#star64} Support is available for the Pine64 Star64 platform which is based on the diff --git a/loader/src/uart.c b/loader/src/uart.c index fa3bbad9..c2964fb0 100644 --- a/loader/src/uart.c +++ b/loader/src/uart.c @@ -169,7 +169,19 @@ void putc(uint8_t ch) while ((*UART_REG(ULSR) & ULSR_THRE) == 0); *UART_REG(UTHR) = ch; } +#elif defined(CONFIG_PLAT_RK3568) +#define UART_BASE 0xfe660000 +#define UTHR 0x0 +#define ULSR 0x14 +#define ULSR_THRE (1 << 5) + +void uart_init(void) {} +void putc(uint8_t ch) +{ + while ((*UART_REG(ULSR) & ULSR_THRE) == 0); + *UART_REG(UTHR) = ch; +} #elif defined(CONFIG_ARCH_RISCV64) #include "riscv/sbi.h"