Skip to content

Commit 30a0b50

Browse files
committed
boards: avnet: add zub1cg_r5 board definition
Add board definition for the Avnet ZUBoarcd 1CG development board. This board is based on the Zynq Ultrascale+ MPSoC. As with other boards based on this platform, currently only the first R5 core is supported. Signed-off-by: Michael Estes <michael.estes@byteserv.io>
1 parent 0837ad5 commit 30a0b50

File tree

9 files changed

+349
-0
lines changed

9 files changed

+349
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright The Zephyr Project Contributors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if BOARD_ZUB1CG_R5
5+
6+
config BUILD_OUTPUT_BIN
7+
default y
8+
9+
if USERSPACE
10+
11+
config COMPILER_ISA_THUMB2
12+
default n
13+
14+
endif
15+
16+
endif # BOARD_ZUB1CG_R5
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright The Zephyr Project Contributors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_ZUB1CG_R5
5+
select SOC_XILINX_ZYNQMP_RPU

boards/avnet/zub1cg_r5/board.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright The Zephyr Project Contributors
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
include(${ZEPHYR_BASE}/boards/common/xsdb.board.cmake)

boards/avnet/zub1cg_r5/board.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
board:
2+
name: zub1cg_r5
3+
full_name: ZUBoard 1CG Development Board RPU Cortex-R5
4+
vendor: avnet
5+
socs:
6+
- name: zynqmp_rpu

boards/avnet/zub1cg_r5/doc/index.rst

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
.. zephyr:board:: zub1cg_r5
2+
3+
Overview
4+
********
5+
This configuration provides support for the real-time processing unit (RPU) on the Avnet
6+
ZUBoard 1CG development board. It can operate as follows:
7+
8+
* Two independent R5 cores with their own TCMs (tightly coupled memories)
9+
* Or, as a single dual lock step unit with double the TCM size.
10+
11+
This processing unit is based on an ARM Cortex-R5 CPU, it also enables the following devices:
12+
13+
* ARM PL-390 Generic Interrupt Controller
14+
* Xilinx Zynq TTC (Cadence TTC)
15+
* Xilinx Zynq UART
16+
* Xilinx Zynq I2C (Cadence I2C)
17+
18+
Hardware
19+
********
20+
Supported Features
21+
==================
22+
23+
.. zephyr:board-supported-hw::
24+
25+
Devices
26+
========
27+
System Timer
28+
------------
29+
30+
This board configuration uses a system timer tick frequency of 1000 Hz.
31+
32+
Serial Port
33+
-----------
34+
35+
This board configuration uses a single serial communication channel with the
36+
on-chip UART1.
37+
38+
Memories
39+
--------
40+
41+
Flash, DDR and OCM memory regions are defined in the DTS file.
42+
Vectors are placed in the ATCM region, while all other code plus
43+
data of the application will be loaded in the sram1 region,
44+
which points to the DDR memory. The sram1 region is defined to
45+
match the Petalinux rproc_0_reserved region so the Zephyr application
46+
can be launched from Petalinux using Remoteproc. The ocm0 memory
47+
area is currently available for usage, although nothing is placed
48+
there by default.
49+
50+
Known Problems or Limitations
51+
==============================
52+
53+
The following platform features are unsupported:
54+
55+
* Dual-redundant Core Lock-step (DCLS) execution is not supported yet.
56+
* Only the first core of the R5 subsystem is supported.
57+
* Xilinx Zynq TTC driver does not support tickless mode operation.
58+
* The Cortex-R5 and the Cortex-A53 shares the same UART controller, more details below.
59+
60+
Programming and Debugging
61+
*************************
62+
63+
Currently the best way to run this sample is by loading it through remoteproc
64+
from the APU, running Linux, to the RPU, assuming the target board has a compatible
65+
Linux kernel. Users can make use of Avnet's pre-built Petalinux BSP as a starting
66+
point to enable remoteproc support, it is based around 6.6 Xilinx maintained kernel.
67+
Building Petalinux is outside the scope of this document, see the `Avnet ZUBoard 1CG
68+
Product Page`_ for more details.
69+
70+
After getting the Linux image running on the target board, build a Zephyr application,
71+
such as the hello world sample shown below:
72+
73+
.. zephyr-app-commands::
74+
:zephyr-app: samples/hello_world
75+
:host-os: unix
76+
:board: zub1cg_r5
77+
:goals: build
78+
79+
Due to a hardware limitation, both Linux and Zephyr share the same UART
80+
controller, meaning when the Zephyr application is started it will takeover the
81+
console from Linux.
82+
83+
To avoid this limitation when accessing the Linux shell, the best approach is to
84+
connect to the board using ``ssh`` over the network (not using the FTDI
85+
USB interface on the board), with the dev board and the host computer
86+
connected to the same network.
87+
88+
Alternatively, it is possible to use the other PS UART controller for either Linux
89+
or Zephyr, but it must be enabled in Vivado and routed via MIO/EMIO to accessible
90+
pins on the board.
91+
92+
Assuming you are using the default ``petalinux`` user from the Xilinx
93+
reference image , open a terminal on the host machine and ssh into the
94+
development board with the board's IP address (found via ``ifconfig``):
95+
96+
.. code-block:: console
97+
98+
$ ssh petalinux@<board-ip-address>
99+
100+
The initial password should be ``petalinux``. On another terminal deploy
101+
the Zephyr application ``.elf`` file using utility like the ``scp`` or ``rsync``,
102+
for example:
103+
104+
.. code-block:: console
105+
106+
$ scp /path/to/zephyr_app_elf_file petalinux@<board-ip-address>:/home/petalinux
107+
108+
After that move the file to ``/lib/firmware`` directory, then you be able to start the firmware
109+
on the desired RPU via remoteproc with:
110+
111+
.. code-block:: console
112+
113+
$ sudo -i # You need to operate the remoteproc as root
114+
$ echo zephyr.elf > /sys/class/remoteproc/remoteproc0/firmware
115+
$ echo start > /sys/class/remoteproc/remoteproc0/state
116+
117+
With another terminal connected to UART1 on the host machine
118+
(available via one of the tty ports with the on-board FTDI chip),
119+
you should see the Zephyr application running:
120+
121+
.. code-block:: console
122+
123+
*** Booting Zephyr OS build v4.1.0-5065-gc3ec37aa2e47 ***
124+
Hello World! zub1cg_r5/zynqmp_rpu
125+
126+
It is also possible to program and debug this program via AMD's Vitis development platform.
127+
Create a new platform project based on your hardware XSA file (from Vivado), import a new
128+
empty application template, and in the debug configuration point the application to the
129+
zephyr.elf binary.
130+
131+
References
132+
**********
133+
134+
.. target-notes::
135+
136+
.. _Avnet ZUBoard 1CG Product Page:
137+
https://www.avnet.com/americas/products/avnet-boards/avnet-board-families/zuboard-1cg/
33.9 KB
Binary file not shown.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (c) 2024 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+
set fsblelf_file [lindex $args 1]
8+
connect -url 127.0.0.1:3121
9+
after 2000
10+
targets -set -nocase -filter {name =~ "*R5*#0"}
11+
rst -proc
12+
dow $fsblelf_file
13+
after 1000
14+
con
15+
after 1000
16+
stop
17+
targets -set -nocase -filter {name =~ "*R5*#0"}
18+
after 2000
19+
dow $elf_file
20+
con
21+
exit
22+
}
23+
24+
load_image {*}$argv

boards/avnet/zub1cg_r5/zub1cg_r5.dts

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
/*
2+
* Copyright The Zephyr Project Contributors
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
#include <arm/xilinx/zynqmp_rpu.dtsi>
9+
#include <freq.h>
10+
#include <zephyr/dt-bindings/gpio/gpio.h>
11+
#include <zephyr/dt-bindings/i2c/i2c.h>
12+
#include <zephyr/dt-bindings/memory-attr/memory-attr-arm.h>
13+
14+
/ {
15+
model = "ZUBoard 1CG Cortex-R5";
16+
compatible = "xlnx,zynqmp-r5";
17+
18+
chosen {
19+
zephyr,sram = &sram1;
20+
zephyr,flash = &flash0;
21+
zephyr,console = &uart0;
22+
zephyr,shell-uart = &uart0;
23+
zephyr,ocm = &ocm;
24+
};
25+
26+
aliases {
27+
led0 = &red_led_0;
28+
sw0 = &mio_push_btn;
29+
eeprom-0 = &eeprom0;
30+
};
31+
32+
leds: leds{
33+
compatible = "gpio-leds";
34+
35+
red_led_0: d6 {
36+
gpios = <&psgpio_bank1 7 GPIO_ACTIVE_HIGH>;
37+
label = "D6";
38+
};
39+
40+
red_led_1: d7 {
41+
gpios = <&psgpio_bank0 25 GPIO_ACTIVE_HIGH>;
42+
label = "D7";
43+
};
44+
45+
red_led_2: d8 {
46+
gpios = <&psgpio_bank0 24 GPIO_ACTIVE_HIGH>;
47+
label = "D8";
48+
};
49+
50+
red_led_3: d9 {
51+
gpios = <&psgpio_bank0 7 GPIO_ACTIVE_HIGH>;
52+
label = "D9";
53+
};
54+
};
55+
56+
keys {
57+
compatible = "gpio-keys";
58+
59+
mio_push_btn: mio_push_btn {
60+
gpios = <&psgpio_bank1 6 GPIO_ACTIVE_LOW>;
61+
label = "MIO Push Button";
62+
};
63+
64+
user_switch_1: sw1 {
65+
gpios = <&psgpio_bank1 18 GPIO_ACTIVE_HIGH>;
66+
label = "User Switch 1";
67+
};
68+
69+
user_switch_2: sw2 {
70+
gpios = <&psgpio_bank1 14 GPIO_ACTIVE_HIGH>;
71+
label = "User Switch 2";
72+
};
73+
74+
user_switch_3: sw3 {
75+
gpios = <&psgpio_bank1 13 GPIO_ACTIVE_HIGH>;
76+
label = "User Switch 3";
77+
};
78+
79+
user_switch_4: sw4 {
80+
gpios = <&psgpio_bank1 5 GPIO_ACTIVE_HIGH>;
81+
label = "User Switch 4";
82+
};
83+
};
84+
85+
i2c_ref_clk: i2c_ref_clk {
86+
compatible = "fixed-clock";
87+
clock-frequency = <100000000>;
88+
#clock-cells = <0>;
89+
};
90+
91+
soc {
92+
/* rproc_0_reserved in Petalinux zynqmp_openamp.dtsi */
93+
sram1: memory@3ed00000 {
94+
compatible = "zephyr,memory-region", "mmio-sram";
95+
reg = <0x3ed00000 DT_SIZE_K(256)>;
96+
zephyr,memory-region = "SRAM1";
97+
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_RAM) )>;
98+
};
99+
};
100+
};
101+
102+
&ttc0 {
103+
status = "okay";
104+
clock-frequency = <100000000>;
105+
};
106+
107+
&psgpio {
108+
status = "okay";
109+
};
110+
111+
&i2c1 {
112+
status = "okay";
113+
clocks = <&i2c_ref_clk>;
114+
clock-frequency = <400000>;
115+
116+
eeprom0: eeprom@50 {
117+
compatible = "atmel,at24";
118+
reg = <0x50>;
119+
size = <256>;
120+
pagesize = <16>;
121+
address-width = <8>;
122+
timeout = <5>;
123+
};
124+
125+
mac_eeprom: mac-eeprom@58 {
126+
compatible = "atmel,at24mac402";
127+
reg = <0x58>;
128+
#address-cells = <1>;
129+
#size-cells = <1>;
130+
131+
mac_address: mac-address@9a {
132+
reg = <0x9a 0x06>;
133+
};
134+
};
135+
};
136+
137+
&uart0 {
138+
status = "okay";
139+
current-speed = <115200>;
140+
clock-frequency = <DT_FREQ_M(100)>;
141+
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
CONFIG_XIP=n
2+
3+
CONFIG_SERIAL=y
4+
5+
CONFIG_GPIO=y
6+
7+
CONFIG_CONSOLE=y
8+
CONFIG_UART_CONSOLE=y
9+
10+
CONFIG_UART_XLNX_PS=y
11+
12+
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=100000000
13+
CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000
14+
CONFIG_ARM_MPU=y
15+
16+
CONFIG_ROMSTART_RELOCATION_ROM=y

0 commit comments

Comments
 (0)