From fd9546c59ff278cf43b1b7886740e048dfa82045 Mon Sep 17 00:00:00 2001 From: Ivan Velickovic Date: Tue, 10 Mar 2026 15:06:23 +1100 Subject: [PATCH 1/3] loader: pass -DBOARD again We removed this f37bb59c4eb4582264498be1a27b99d46bed0f39 but there are some cases where the Microkit board is more specific than the seL4 platform. One example of this is where it is the same exact SoC but say the default UART is different for one board is different to another. Until the loader is more generic (e.g parsing the DTB) we have to do something like this. Signed-off-by: Ivan Velickovic --- loader/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loader/Makefile b/loader/Makefile index dbc52df38..c08c18bd9 100644 --- a/loader/Makefile +++ b/loader/Makefile @@ -48,7 +48,7 @@ else ifeq ($(ARCH),riscv64) endif CFLAGS := -std=gnu11 -g -O3 -nostdlib -ffreestanding \ - -MP -MD $(CFLAGS_ARCH) -I$(SEL4_SDK)/include \ + -MP -MD $(CFLAGS_ARCH) -DBOARD_$(BOARD) -I$(SEL4_SDK)/include \ -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \ -Wundef -Wno-nonnull -Wnested-externs From b2f40d2882128c72e374f9696ea423192a1db8c2 Mon Sep 17 00:00:00 2001 From: Ivan Velickovic Date: Thu, 12 Mar 2026 14:14:40 +1100 Subject: [PATCH 2/3] build_sdk.py: handle paths relative to kernel A bit annoying since when we refer to the kernel path we don't know exactly where the kernel is since it's a user-supplied argument Signed-off-by: Ivan Velickovic --- build_sdk.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/build_sdk.py b/build_sdk.py index c6781ad85..d55146df0 100644 --- a/build_sdk.py +++ b/build_sdk.py @@ -140,6 +140,16 @@ class ConfigInfo: kernel_options_arch: KERNEL_OPTIONS_ARCH +# There are some references to paths we need to make that are relative +# to the kernel source, since the kernel source is supplied by the user, +# we can't hard-code it. +# This is necessary for particular kernel options such as, KernelCustomDTS +# and KernelCustomDTSOverlay. +@dataclass +class KernelPath: + path: str + + SUPPORTED_BOARDS = ( BoardInfo( name="tqma8xqp1gb", @@ -210,8 +220,8 @@ class ConfigInfo: smp_cores=4, kernel_options={ "KernelPlatform": "imx8mp-evk", - "KernelCustomDTS": "custom_dts/iot-gate.dts", - "KernelCustomDTSOverlay": "src/plat/imx8m-evk/overlay-imx8mp-evk.dts", + "KernelCustomDTS": Path("custom_dts/iot-gate.dts"), + "KernelCustomDTSOverlay": KernelPath(path="src/plat/imx8m-evk/overlay-imx8mp-evk.dts"), } | DEFAULT_KERNEL_OPTIONS_AARCH64, ), BoardInfo( @@ -577,8 +587,10 @@ def build_sel4( for arg, val in sorted(config_args): if isinstance(val, bool): str_val = "ON" if val else "OFF" - elif arg == "KernelCustomDTSOverlay": - str_val = f"{sel4_dir.absolute()}/{val}" + elif isinstance(val, KernelPath): + str_val = f"{sel4_dir.absolute()}/{val.path}" + elif isinstance(val, Path): + str_val = Path(__file__).parent / val else: str_val = str(val) s = f"-D{arg}={str_val}" From dc307e63ec42a9b815ba7adccfb855439253a422 Mon Sep 17 00:00:00 2001 From: SeedRizvi Date: Thu, 5 Mar 2026 16:11:52 +1100 Subject: [PATCH 3/3] Add support for Kria K26 Signed-off-by: SeedRizvi Signed-off-by: Ivan Velickovic --- build_sdk.py | 11 +++++++++++ custom_dts/overlay-zynqmp-kria-k26.dts | 20 ++++++++++++++++++++ docs/manual.md | 17 +++++++++++++++++ loader/src/aarch64/init.c | 2 +- loader/src/uart.c | 6 ++++++ platforms.yml | 3 +++ 6 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 custom_dts/overlay-zynqmp-kria-k26.dts diff --git a/build_sdk.py b/build_sdk.py index d55146df0..ac8cd1b77 100644 --- a/build_sdk.py +++ b/build_sdk.py @@ -151,6 +151,17 @@ class KernelPath: SUPPORTED_BOARDS = ( + BoardInfo( + name="kria_k26", + arch=KernelArch.AARCH64, + gcc_cpu="cortex-a53", + loader_link_address=0x40000000, + kernel_options={ + "KernelPlatform": "zynqmp", + "KernelARMPlatform": "zcu102", + "KernelCustomDTSOverlay": Path("custom_dts/overlay-zynqmp-kria-k26.dts"), + } | DEFAULT_KERNEL_OPTIONS_AARCH64, + ), BoardInfo( name="tqma8xqp1gb", arch=KernelArch.AARCH64, diff --git a/custom_dts/overlay-zynqmp-kria-k26.dts b/custom_dts/overlay-zynqmp-kria-k26.dts new file mode 100644 index 000000000..08a42231a --- /dev/null +++ b/custom_dts/overlay-zynqmp-kria-k26.dts @@ -0,0 +1,20 @@ +/* + * Copyright 2026, Skykraft + * + * SPDX-License-Identifier: GPL-2.0-only + */ + +/ { + memory@0 { + device_type = "memory"; + reg = <0x00 0x00 0x00 0x7ff00000 0x08 0x00 0x00 0x80000000>; + }; + + chosen { + seL4,kernel-devices = + "serial1", + &{/amba_apu@0/interrupt-controller@f9010000}, + &{/timer}, + &{/amba/smmu@fd800000}; + }; +}; diff --git a/docs/manual.md b/docs/manual.md index 3b4dbb5b2..91d8af800 100644 --- a/docs/manual.md +++ b/docs/manual.md @@ -1135,6 +1135,7 @@ The currently supported platforms are: * imx8mp_evk * imx8mp_iotgate * imx8mq_evk +* kria_k26 * maaxboard * odroidc2 * odroidc4 @@ -1239,6 +1240,22 @@ Microkit will produce a raw binary file by default, so when using U-Boot run the => go 0x41000000 +## Kria K26 {#kria_k26} + +The [Kria K26](https://www.amd.com/en/products/system-on-modules/kria/k26.html) is highly similar +to the ZCU102, with slight differences in memory regions and the base UART controller. + +To run the built image on the board, you have to use properly patched U-Boot - please see the [section for ZCU102](#zcu102), for the details. + +You have to load the binary file into memory and run it: +``` +ZynqMP> tftpboot 0x40000000 loader.img +... +ZynqMP> go 0x40000000 +``` + +A QEMU emulator is not available for the Kria K26 at this stage. + ## MaaXBoard {#maaxboard} The MaaXBoard is a low-cost ARM SBC based on the NXP i.MX8MQ system-on-chip. diff --git a/loader/src/aarch64/init.c b/loader/src/aarch64/init.c index 143f324ba..568bfba15 100644 --- a/loader/src/aarch64/init.c +++ b/loader/src/aarch64/init.c @@ -106,7 +106,7 @@ void arch_init(void) } // TODO: handle non-PSCI platforms better, see https://github.com/seL4/microkit/issues/401. -#if !defined(CONFIG_PLAT_BCM2711) +#if !defined(CONFIG_PLAT_BCM2711) && !defined(BOARD_kria_k26) uint32_t ret = arm_smc32_call(PSCI_FUNCTION_VERSION, /* unused */ 0, 0, 0); /* the return value has no error codes, but if we get it wrong this is what we will get */ if (ret == PSCI_RETURN_NOT_SUPPORTED) { diff --git a/loader/src/uart.c b/loader/src/uart.c index c2964fb04..54b182100 100644 --- a/loader/src/uart.c +++ b/loader/src/uart.c @@ -42,7 +42,13 @@ void putc(uint8_t ch) *UART_REG(TRANSMIT) = ch; } #elif defined(CONFIG_PLAT_ZYNQMP_ZCU102) + +#if defined(BOARD_kria_k26) +#define UART_BASE 0xff010000 +#else #define UART_BASE 0xff000000 +#endif + #define UART_CHANNEL_STS_TXEMPTY 0x8 #define UART_CHANNEL_STS 0x2C #define UART_TX_RX_FIFO 0x30 diff --git a/platforms.yml b/platforms.yml index f72f69566..8a8303816 100644 --- a/platforms.yml +++ b/platforms.yml @@ -14,6 +14,9 @@ # This list is ordered based on the order in what the platforms were added # in. platforms: + - name: kria_k26 + cmake_plat: zcu102 + since: dev - name: rock3b cmake_plat: rk3568 since: dev