Skip to content

Commit d96b94c

Browse files
mubinsyed2michalsimek
authored andcommitted
boards: amd: Add support for AMD Versal NET RPU
Add support for the RPU, real-time processing unit on Versal NET SoC. It is based on Cortext-R52 processor. The patch contains initial wiring and configuration for generic board with OCM(1MB) and DDR(2G) memories, cpu, interrupt controller, global timer and UART. versalnet.dtsi contains common peripherals integrated into Versal NET SoC, and versalnet_r52.dtsi has peripherals which are private to Cortex-R52 processor. Signed-off-by: Mubin Sayyed <[email protected]> Message-ID: <[email protected]> Link: zephyrproject-rtos/zephyr#86276 State: waiting
1 parent c88c028 commit d96b94c

File tree

18 files changed

+385
-0
lines changed

18 files changed

+385
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#
2+
# Copyright (c) 2025 Advanced Micro Devices, Inc.
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
CONFIG_ARM_MPU=y
8+
CONFIG_CACHE_MANAGEMENT=y
9+
CONFIG_DCACHE=y
10+
CONFIG_ICACHE=y
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#
2+
# Copyright (c) 2025 Advanced Micro Devices, Inc.
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
config BOARD_VERSALNET_RPU
8+
select SOC_AMD_VERSALNET_RPU
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#
2+
# Copyright (c) 2025 Advanced Micro Devices, Inc.
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
include(${ZEPHYR_BASE}/boards/common/xsdb.board.cmake)

boards/amd/versalnet_rpu/board.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
board:
2+
name: versalnet_rpu
3+
vendor: amd
4+
socs:
5+
- name: versalnet_rpu
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Copyright (c) 2025 Advanced Micro Devices, Inc.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
proc load_image args {
6+
set elf_file [lindex $args 0]
7+
8+
if { [info exists ::env(HW_SERVER_URL)] } {
9+
connect -url $::env(HW_SERVER_URL)
10+
} else {
11+
connect
12+
}
13+
14+
after 100
15+
targets -set -nocase -filter {name =~ "Versal*"}
16+
after 100
17+
rst -system
18+
after 100
19+
20+
if { [info exists ::env(PDI_FILE_PATH)] } {
21+
device program $::env(PDI_FILE_PATH)
22+
} else {
23+
puts "Error: env variable PDI_FILE_PATH is not set"
24+
exit
25+
}
26+
27+
after 100
28+
targets -set -nocase -filter {name =~ "DPC"}
29+
after 100
30+
# Configure timestamp generator to run global timer gracefully
31+
# Ideally these registers should be set from bootloader (cdo)
32+
33+
mwr -force 0xeb5b0020 100000000
34+
mwr -force 0xeb5b0000 0x1
35+
after 100
36+
37+
targets -set -nocase -filter {name =~ "*Cortex-R52 #0.0"}
38+
rst -proc
39+
after 100
40+
dow -force $elf_file
41+
con
42+
exit
43+
}
44+
45+
load_image {*}$argv
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
/*
3+
* (C) Copyright 2025, Advanced Micro Devices, Inc.
4+
*
5+
* Mubin Sayyed <[email protected]>
6+
*/
7+
8+
/dts-v1/;
9+
#include <arm/xilinx/versalnet_r52.dtsi>
10+
11+
/ {
12+
chosen {
13+
zephyr,sram = &sram0;
14+
zephyr,console = &uart0;
15+
zephyr,shell-uart = &uart0;
16+
zephyr,ocm = &ocm;
17+
};
18+
};
19+
20+
&soc {
21+
sram0: memory@0 {
22+
compatible = "mmio-sram";
23+
reg = <0x00000 DT_SIZE_M(2048)>;
24+
};
25+
};
26+
27+
&ocm {
28+
status = "okay";
29+
};
30+
31+
&uart1 {
32+
status = "okay";
33+
current-speed = <115200>;
34+
clock-frequency = <100000000>;
35+
};
36+
37+
&uart0 {
38+
status = "okay";
39+
current-speed = <115200>;
40+
clock-frequency = <100000000>;
41+
};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
identifier: versalnet_rpu
2+
name: AMD Development board for Versal NET RPU
3+
arch: arm
4+
toolchain:
5+
- zephyr
6+
testing:
7+
ignore_tags:
8+
- net
9+
- bluetooth
10+
vendor: amd
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
CONFIG_ISR_STACK_SIZE=1024
2+
CONFIG_THREAD_STACK_INFO=y
3+
4+
# Enable UART driver
5+
CONFIG_SERIAL=y
6+
7+
# Enable console
8+
CONFIG_CONSOLE=y
9+
CONFIG_UART_CONSOLE=y
10+
11+
# Enable serial port
12+
CONFIG_UART_PL011=y
13+
14+
CONFIG_ARM_ARCH_TIMER=y
15+
16+
CONFIG_ARM_MPU=y
17+
CONFIG_CACHE_MANAGEMENT=y
18+
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=100000000

dts/arm/xilinx/versalnet_r52.dtsi

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
/*
3+
* (C) Copyright 2025, Advanced Micro Devices, Inc.
4+
*
5+
* Mubin Sayyed <[email protected]>
6+
*/
7+
8+
/dts-v1/;
9+
10+
#include <mem.h>
11+
#include <arm/armv8-r.dtsi>
12+
#include <zephyr/dt-bindings/interrupt-controller/arm-gic.h>
13+
#include <amd/versalnet.dtsi>
14+
15+
/ {
16+
model = "Versal NET RPU";
17+
18+
cpus {
19+
#address-cells = <1>;
20+
#size-cells = <0>;
21+
22+
cpu0: cpu@0 {
23+
device_type = "cpu";
24+
compatible = "arm,cortex-r52";
25+
reg = <0>;
26+
};
27+
};
28+
29+
arch_timer: timer {
30+
compatible = "arm,armv8-timer";
31+
interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL IRQ_DEFAULT_PRIORITY>,
32+
<GIC_PPI 14 IRQ_TYPE_LEVEL IRQ_DEFAULT_PRIORITY>,
33+
<GIC_PPI 11 IRQ_TYPE_LEVEL IRQ_DEFAULT_PRIORITY>,
34+
<GIC_PPI 10 IRQ_TYPE_LEVEL IRQ_DEFAULT_PRIORITY>;
35+
interrupt-parent = <&gic>;
36+
status = "okay";
37+
};
38+
39+
};
40+
41+
&soc {
42+
interrupt-parent = <&gic>;
43+
44+
gic: interrupt-controller@e2000000 {
45+
compatible = "arm,gic-v3", "arm,gic";
46+
reg = <0xe2000000 0x10000>,
47+
<0xe2100000 0x80000>;
48+
interrupt-controller;
49+
#interrupt-cells = <4>;
50+
status = "okay";
51+
};
52+
53+
};

dts/common/amd/versalnet.dtsi

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
/*
3+
* (C) Copyright 2025, Advanced Micro Devices, Inc.
4+
*
5+
* Mubin Sayyed <[email protected]>
6+
*/
7+
8+
/ {
9+
soc: soc {
10+
ocm: memory@bbf00000 {
11+
compatible = "zephyr,memory-region";
12+
reg = <0xbbf00000 DT_SIZE_M(1)>;
13+
status = "disabled";
14+
zephyr,memory-region = "OCM";
15+
};
16+
17+
uart0: uart@f1920000 {
18+
compatible = "arm,sbsa-uart";
19+
reg = <0xf1920000 0x4c>;
20+
status = "disabled";
21+
interrupt-names = "irq_0";
22+
interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL IRQ_DEFAULT_PRIORITY>;
23+
};
24+
25+
uart1: uart@f1930000 {
26+
compatible = "arm,sbsa-uart";
27+
reg = <0xf1930000 0x1000>;
28+
status = "disabled";
29+
interrupt-names = "irq_1";
30+
interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL IRQ_DEFAULT_PRIORITY>;
31+
};
32+
};
33+
};

0 commit comments

Comments
 (0)