Skip to content

Add support for Versal Net APU (Cortex a78 processor) #92902

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions arch/arm64/core/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ config CPU_CORTEX_A76_A55
help
This option signifies the use of a Cortex-A76 and A55 big little CPU cluster

config CPU_CORTEX_A78
bool
select CPU_CORTEX_A
select ARMV8_A
help
This option signifies the use of a Cortex-A78 CPU

config CPU_CORTEX_R82
bool
select CPU_AARCH64_CORTEX_R
Expand Down
19 changes: 19 additions & 0 deletions boards/amd/versalnet_apu/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (c) 2025 Advanced Micro Devices, Inc.
#

find_package(Dtc 1.4.6 REQUIRED)

# Check if the board-specific qemu.dts file exists
if(EXISTS "${BOARD_DIR}/${BOARD}-qemu.dts")
# Ensure DTC executable is available
if(DTC_FOUND)
set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
COMMAND ${DTC} -I dts -O dtb -q "${BOARD_DIR}/${BOARD}-qemu.dts" -o "${PROJECT_BINARY_DIR}/${BOARD}-qemu.dtb"
)
else()
message(FATAL_ERROR "DTC not found, but required for compiling ${BOARD}-qemu.dts")
endif()
endif()
8 changes: 8 additions & 0 deletions boards/amd/versalnet_apu/Kconfig.versalnet_apu
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# Copyright (c) 2025 Advanced Micro Devices, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#

config BOARD_VERSALNET_APU
select SOC_AMD_VERSALNET_APU
22 changes: 22 additions & 0 deletions boards/amd/versalnet_apu/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# Copyright (c) 2025 Advanced Micro Devices, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#

include(${ZEPHYR_BASE}/boards/common/xsdb.board.cmake)
set(SUPPORTED_EMU_PLATFORMS qemu)
set(QEMU_ARCH xilinx-aarch64)
set(QEMU_CPU_TYPE_${ARCH} cortexa78)

set(QEMU_FLAGS_${ARCH}
-machine arm-generic-fdt
-hw-dtb ${PROJECT_BINARY_DIR}/${BOARD}-qemu.dtb
-device loader,addr=0xEC200300,data=0x3EE,data-len=4 -device loader,addr=0xEC200300,data=0x3DD,data-len=4
-nographic
-m 2g
)

set(QEMU_KERNEL_OPTION
-device loader,cpu-num=0,file=\$<TARGET_FILE:\${logical_target_for_zephyr_elf}>
)
5 changes: 5 additions & 0 deletions boards/amd/versalnet_apu/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
board:
name: versalnet_apu
vendor: amd
socs:
- name: amd_versalnet_apu
74 changes: 74 additions & 0 deletions boards/amd/versalnet_apu/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
.. zephyr:board:: versalnet_apu

Overview
********
This configuration provides support for the APU(A78), ARM processing unit on AMD
Versal Net SOC, it can operate as following:

* Four independent A78 clusters each having 4 A78 cores

This processing unit is based on an ARM Cortex-A78 CPU, it also enables the following devices:

* ARM GIC v3 Interrupt Controller
* Global Timer Counter
* SBSA UART

Hardware
********
Supported Features
==================

.. zephyr:board-supported-hw::

Devices
=======
System Timer
------------

This board configuration uses a system timer tick frequency of 100 MHz.

Serial Port
-----------

This board configuration uses a single serial communication channel with the
on-chip UART0.

Memories
--------

Although Flash, DDR and OCM memory regions are defined in the DTS file,
all the code plus data of the application will be loaded in the sram0 region,
which points to the DDR memory. The ocm0 memory area is currently available
for usage, although nothing is placed there by default.

Known Problems or Limitations
=============================

The following platform features are unsupported:

* Only the first cpu in the first cluster of the A78 subsystem is supported.

Programming and Debugging
*************************

.. zephyr:board-supported-runners::

Build and flash in the usual way. Here is an example for the :zephyr:code-sample:`hello_world` application.

.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: versalnet_apu
:goals: build flash

You should see the following message on the console:

.. code-block:: console

Hello World! versalnet_apu/amd_versalnet_apu


References
**********

1. ARMv8‑A Architecture Reference Manual (ARM DDI 0487)
2. Arm Cortex‑A78 Core Technical Reference Manual (Doc ID 101430)
28 changes: 28 additions & 0 deletions boards/amd/versalnet_apu/support/xsdb.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright (c) 2025 Advanced Micro Devices, Inc.
#
# SPDX-License-Identifier: Apache-2.0

proc load_image args {
set elf_file [lindex $args 0]
set pdi_file [lindex $args 1]
set bl31_file [lindex $args 2]

if { [info exists ::env(HW_SERVER_URL)] } {
connect -url $::env(HW_SERVER_URL)
} else {
connect
}

device program $pdi_file
targets -set -nocase -filter {name =~ "Versal*"}
after 100
targets -set -filter {name =~ "Cortex-A78AE*0.0"}
rst -proc
after 100
dow -force $elf_file
dow -force $bl31_file
con
exit
}

load_image {*}$argv
Loading