From 406373d848e158813c91848e8c13c035b1ae1878 Mon Sep 17 00:00:00 2001 From: Jakub Duchniewicz Date: Wed, 22 Oct 2025 16:18:49 +1100 Subject: [PATCH 1/6] Initial support for rock3b Signed-off-by: Jakub Duchniewicz --- build_sdk.py | 9 +++++++++ loader/src/loader.c | 1 + loader/src/uart.c | 12 ++++++++++++ 3 files changed, 22 insertions(+) diff --git a/build_sdk.py b/build_sdk.py index f1c9f0a2c..c34d8dd3e 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, # TODO: double check + kernel_options={ + "KernelPlatform": "rk3568", + } | DEFAULT_KERNEL_OPTIONS_AARCH64, + ), BoardInfo( name="hifive_p550", arch=KernelArch.RISCV64, diff --git a/loader/src/loader.c b/loader/src/loader.c index 7780278b2..a8b5fce5c 100644 --- a/loader/src/loader.c +++ b/loader/src/loader.c @@ -195,3 +195,4 @@ int main(void) for (;;) { } } + diff --git a/loader/src/uart.c b/loader/src/uart.c index fa3bbad9d..94d63550f 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(BOARD_rock3b) +#define UART_BASE 0xfe660000 +#define UTHR 0x0 +#define ULSR 0x14 +#define ULSR_THRE (1 << 5) +void uart_init() {} + +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" From d250eb893580221c874228e24ebd29907272acd6 Mon Sep 17 00:00:00 2001 From: Jakub Duchniewicz Date: Thu, 13 Nov 2025 12:15:18 +1100 Subject: [PATCH 2/6] Fix memory region for rock3b Signed-off-by: Jakub Duchniewicz --- build_sdk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_sdk.py b/build_sdk.py index c34d8dd3e..de3cc6ddb 100644 --- a/build_sdk.py +++ b/build_sdk.py @@ -321,7 +321,7 @@ class ConfigInfo: name="rock3b", arch=KernelArch.AARCH64, gcc_cpu="cortex-a55", - loader_link_address=0x30000000, # TODO: double check + loader_link_address=0x30000000, kernel_options={ "KernelPlatform": "rk3568", } | DEFAULT_KERNEL_OPTIONS_AARCH64, From 43486ba430dcd703dd7c7aff78e5211693d30e70 Mon Sep 17 00:00:00 2001 From: Jakub Duchniewicz Date: Thu, 13 Nov 2025 12:19:13 +1100 Subject: [PATCH 3/6] Address review comments Signed-off-by: Jakub Duchniewicz --- loader/src/uart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loader/src/uart.c b/loader/src/uart.c index 94d63550f..6f4b4c810 100644 --- a/loader/src/uart.c +++ b/loader/src/uart.c @@ -175,7 +175,7 @@ void putc(uint8_t ch) #define ULSR 0x14 #define ULSR_THRE (1 << 5) -void uart_init() {} +void uart_init(void) {} void putc(uint8_t ch) { From 8aa5444a9cfc5b4d85c048a7ff660e2c10af4738 Mon Sep 17 00:00:00 2001 From: Jakub Duchniewicz Date: Mon, 17 Nov 2025 16:36:59 +1100 Subject: [PATCH 4/6] Fixup the wrong define Signed-off-by: Jakub Duchniewicz --- loader/src/uart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loader/src/uart.c b/loader/src/uart.c index 6f4b4c810..c2964fb04 100644 --- a/loader/src/uart.c +++ b/loader/src/uart.c @@ -169,7 +169,7 @@ void putc(uint8_t ch) while ((*UART_REG(ULSR) & ULSR_THRE) == 0); *UART_REG(UTHR) = ch; } -#elif defined(BOARD_rock3b) +#elif defined(CONFIG_PLAT_RK3568) #define UART_BASE 0xfe660000 #define UTHR 0x0 #define ULSR 0x14 From 91a5f09bf921f1a406e6cf8df25a6efb928a6dab Mon Sep 17 00:00:00 2001 From: Jakub Duchniewicz Date: Mon, 24 Nov 2025 11:00:37 +1100 Subject: [PATCH 5/6] Remove unnecessary newline Signed-off-by: Jakub Duchniewicz --- loader/src/loader.c | 1 - 1 file changed, 1 deletion(-) diff --git a/loader/src/loader.c b/loader/src/loader.c index a8b5fce5c..7780278b2 100644 --- a/loader/src/loader.c +++ b/loader/src/loader.c @@ -195,4 +195,3 @@ int main(void) for (;;) { } } - From 4cb39b3df846d1880ce02da4dc89d9eeb9639264 Mon Sep 17 00:00:00 2001 From: Jakub Duchniewicz Date: Thu, 18 Dec 2025 13:22:33 +1100 Subject: [PATCH 6/6] Fill in the docs Signed-off-by: Jakub Duchniewicz --- docs/manual.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/manual.md b/docs/manual.md index d50e1f6d2..8e6aec16c 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