Skip to content

Commit 42524b7

Browse files
author
Appana Durga Kedareswara rao
committed
boards: versalnet_apu: Add QEMU support via west and Twister
Add support for running the APU ELF on QEMU using the `west build -t run_qemu` target. QEMU integration is now wired through west and Twister for the `versalnet_apu` board. Signed-off-by: Appana Durga Kedareswara rao <appana.durga.kedareswara.rao@amd.com>
1 parent 54ca74b commit 42524b7

File tree

5 files changed

+5464
-0
lines changed

5 files changed

+5464
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
# Copyright (c) 2025 Advanced Micro Devices, Inc.
5+
#
6+
7+
find_package(Dtc 1.4.6 REQUIRED)
8+
9+
# Check if the board-specific qemu.dts file exists
10+
if(EXISTS "${BOARD_DIR}/${BOARD}-qemu.dts")
11+
# Ensure DTC executable is available
12+
if(DTC_FOUND)
13+
set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
14+
COMMAND ${DTC} -I dts -O dtb -q "${BOARD_DIR}/${BOARD}-qemu.dts" -o "${PROJECT_BINARY_DIR}/${BOARD}-qemu.dtb"
15+
)
16+
else()
17+
message(FATAL_ERROR "DTC not found, but required for compiling ${BOARD}-qemu.dts")
18+
endif()
19+
endif()

boards/amd/versalnet_apu/board.cmake

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,18 @@
55
#
66

77
include(${ZEPHYR_BASE}/boards/common/xsdb.board.cmake)
8+
set(SUPPORTED_EMU_PLATFORMS qemu)
9+
set(QEMU_ARCH xilinx-aarch64)
10+
set(QEMU_CPU_TYPE_${ARCH} cortexa78)
11+
12+
set(QEMU_FLAGS_${ARCH}
13+
-machine arm-generic-fdt
14+
-hw-dtb ${PROJECT_BINARY_DIR}/${BOARD}-qemu.dtb
15+
-device loader,addr=0xEC200300,data=0x3EE,data-len=4 -device loader,addr=0xEC200300,data=0x3DD,data-len=4
16+
-nographic
17+
-m 2g
18+
)
19+
20+
set(QEMU_KERNEL_OPTION
21+
-device loader,cpu-num=0,file=\$<TARGET_FILE:\${logical_target_for_zephyr_elf}>
22+
)

0 commit comments

Comments
 (0)