Skip to content

Commit f479a23

Browse files
nhutnguyenkckartben
authored andcommitted
boards: renesas: Add minimal support for board RZ/G3S-SMARC
This adds minimal support for board RZ/G3S-SMARC Signed-off-by: Nhut Nguyen <[email protected]> Signed-off-by: Tien Nguyen <[email protected]> Signed-off-by: Binh Nguyen <[email protected]>
1 parent e535f9e commit f479a23

9 files changed

+364
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2024 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_RZG3S_SMARC
5+
select SOC_R9A08G045S33GBG
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2024 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
board_runner_args(jlink "--device=R9A08G045S33_M33_0" "--speed=15000")
5+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

boards/renesas/rzg3s_smarc/board.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
board:
2+
name: rzg3s_smarc
3+
full_name: RZ/G3S SMARC Evaluation Board Kit
4+
vendor: renesas
5+
socs:
6+
- name: r9a08g045s33gbg
Lines changed: 234 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
.. zephyr:board:: rzg3s_smarc
2+
3+
Overview
4+
********
5+
6+
The Renesas RZ/G3S SMARC Evaluation Board Kit (RZ/G3S-EVKIT) consists of a SMARC v2.1 module board and a carrier board.
7+
8+
* Device: RZ/G3S R9A08G045S33GBG
9+
10+
* Cortex-A55 Single, Cortex-M33 x 2
11+
* BGA 359-pin, 14mmSq body, 0.5mm pitch
12+
13+
* SMARC v2.1 Module Board Functions
14+
15+
* LPDDR4 SDRAM: 1GB x 1pc
16+
* QSPI flash memory: 128Mb x 1pc
17+
* eMMC memory: 64GB x 1pc
18+
* PMIC power supply RAA215300A2GNP#HA3 implemented
19+
* microSD card x2
20+
* I3C connector
21+
* JTAG connector
22+
* ADC x8 channels
23+
* Current monitor (USB Micro B)
24+
25+
* Carrier Board Functions
26+
27+
* Gigabit Ethernet x2
28+
* USB2.0 x2ch (OTG x1ch, Host x1ch)
29+
* CAN-FD x2
30+
* microSD card x1
31+
* Mono speaker, Stereo headphone, Mic., and Aux..
32+
* PMOD x2
33+
* USB-Type C for power input
34+
* PCIe Gen2 4-lane slot (G3S supports only 1-lane)
35+
* M.2 Key E
36+
* M.2 Key B and SIM card
37+
* Coin cell battery holder (3.0V support)
38+
39+
Hardware
40+
********
41+
42+
The Renesas RZ/G3S MPU documentation can be found at `RZ/G3S Group Website`_
43+
44+
.. figure:: rzg3s_block_diagram.webp
45+
:width: 600px
46+
:align: center
47+
:alt: RZ/G3S group feature
48+
49+
RZ/G3S block diagram (Credit: Renesas Electronics Corporation)
50+
51+
Supported Features
52+
==================
53+
54+
The ``rzg3s_smarc/r9a08g045s33gbg/cm33`` board target supports the ARM Cortex-M33 System Core without FPU
55+
and the following hardware features:
56+
57+
+-----------+------------+-------------------------------------+
58+
| Interface | Controller | Driver/Component |
59+
+===========+============+=====================================+
60+
| NVIC | on-chip | arch/arm |
61+
+-----------+------------+-------------------------------------+
62+
| SYSTICK | on-chip | arch/arm |
63+
+-----------+------------+-------------------------------------+
64+
| PINCTRL | on-chip | pinctrl |
65+
+-----------+------------+-------------------------------------+
66+
| GPIO | on-chip | gpio |
67+
+-----------+------------+-------------------------------------+
68+
| UART | on-chip | serial |
69+
+-----------+------------+-------------------------------------+
70+
71+
Other hardware features are currently not supported by the port.
72+
73+
Programming and Debugging
74+
*************************
75+
76+
RZ/G3S-EVKIT is designed to start different systems on different cores.
77+
It uses Yocto as the build system to build Linux system and boot loaders
78+
to run BL2 TF-A on Cortex-A55 System Core before starting Zephyr. The minimal steps are described below.
79+
80+
1. Follow ''2.2 Building Images'' of `SMARC EVK of RZ/G3S Linux Start-up Guide`_ to prepare the build environment.
81+
82+
2. Before build, add ``PLAT_M33_BOOT_SUPPORT=1`` to meta-renesas/meta-rzg3s/recipes-bsp/trusted-firmware-a/trusted-firmware-a.bbappend.
83+
84+
.. code-block:: bash
85+
:emphasize-lines: 6
86+
87+
require trusted-firmware-a.inc
88+
COMPATIBLE_MACHINE_rzg3s = "(rzg3s-dev|smarc-rzg3s)"
89+
PLATFORM_rzg3s-dev = "g3s"
90+
EXTRA_FLAGS_rzg3s-dev = "BOARD=dev14_1_lpddr PLAT_SYSTEM_SUSPEND=vbat"
91+
PLATFORM_smarc-rzg3s = "g3s"
92+
EXTRA_FLAGS_smarc-rzg3s = "BOARD=smarc PLAT_SYSTEM_SUSPEND=vbat PLAT_M33_BOOT_SUPPORT=1"
93+
94+
3. Start the build:
95+
96+
.. code-block:: bash
97+
98+
MACHINE=smarc-rzg3s bitbake core-image-minimal
99+
100+
The below necessary artifacts will be located in the build/tmp/deploy/images
101+
102+
+---------------+-----------------------------+
103+
| Artifacts | File name |
104+
+===============+=============================+
105+
| Boot loader | bl2_bp_spi-smarc-rzg3s.srec |
106+
| | |
107+
| | fip-smarc-rzg3s.srec |
108+
+---------------+-----------------------------+
109+
| Flash Writer | FlashWriter-smarc-rzg3s.mot |
110+
+---------------+-----------------------------+
111+
112+
4. Follow ''4.2 Startup Procedure'' of `SMARC EVK of RZ/G3S Linux Start-up Guide`_ for power supply and board setting
113+
at SCIF download (SW_MODE[1:4] = OFF, ON, OFF, ON) and Cortex-A55 cold boot (SW_CONFIG[1:6] = OFF, OFF, ON, OFF, OFF, OFF)
114+
115+
5. Follow ''4.3 Download Flash Writer to RAM'' of `SMARC EVK of RZ/G3S Linux Start-up Guide`_ to download Flash Writer to RAM
116+
117+
6. Follow ''4.4 Write the Bootloader'' of `SMARC EVK of RZ/G3S Linux Start-up Guide`_ to write the boot loader
118+
to the target board by using Flash Writer.
119+
120+
Applications for the ``rzg3s_smarc`` board can be built in the usual way as
121+
documented in :ref:`build_an_application`.
122+
123+
Console
124+
=======
125+
126+
The UART port for Cortex-M33 System Core can be accessed by connecting `Pmod USBUART <https://store.digilentinc.com/pmod-usbuart-usb-to-uart-interface/>`_
127+
to the upper side of ``PMOD1_3A``.
128+
129+
Debugging
130+
=========
131+
132+
It is possible to load and execute a Zephyr application binary on
133+
this board on the Cortex-M33 System Core from
134+
the internal SRAM, using ``JLink`` debugger (:ref:`jlink-debug-host-tools`).
135+
136+
.. note::
137+
138+
Currently it's required Renesas BL2 TF-A to be started on Cortex-A55 System Core
139+
before starting Zephyr as it configures clocks and the Cortex-M33 System Core before starting it.
140+
141+
Here is an example for building and debugging with the :zephyr:code-sample:`hello_world` application.
142+
143+
.. zephyr-app-commands::
144+
:zephyr-app: samples/hello_world
145+
:board: rzg3s_smarc/r9a08g045s33gbg/cm33
146+
:goals: build debug
147+
148+
Flashing
149+
========
150+
151+
Zephyr application can be flashed to QSPI storage and then loaded by
152+
Renesas BL2 TF-A running on the Cortex-A55 System Core and starting binary on the Cortex-M33 System Core.
153+
154+
The Zephyr application binary has to be converted to Motorolla S-record `SREC`_ format
155+
which is generated automatically in Zephyr application build directory with the extension ``s19``.
156+
157+
.. _SREC: https://en.wikipedia.org/wiki/SREC_(file_format)
158+
159+
.. _Flashing on QSPI:
160+
161+
Flashing on QSPI using Flash Writer
162+
---------------------------------------
163+
164+
Zephyr binary has to be converted to **srec** format.
165+
166+
* Download and start **Flash Writer** as described in ''4.3 Download Flash Writer to RAM'' of `SMARC EVK of RZ/G3S Linux Start-up Guide`_
167+
* Use **XLS2** command to flash Zephyr binary
168+
* Input when asked:
169+
170+
.. code-block:: console
171+
172+
===== Please Input Program Top Address ============
173+
Please Input : H'23000
174+
===== Please Input Qspi Save Address ===
175+
Please Input : H'200000
176+
177+
* Then send Zephyr **s19** file from terminal (use ''ascii'' mode)
178+
* Reboot the board in the **QSPI Boot Mode**
179+
180+
.. code-block:: console
181+
182+
-- Load Program to SRAM ---------------
183+
184+
Flash writer for RZ/G3S Series V0.60 Jan.26,2023
185+
Product Code : RZ/G3S
186+
>XLS2
187+
===== Qspi writing of RZ/G2 Board Command =============
188+
Load Program to Spiflash
189+
Writes to any of SPI address.
190+
Program size & Qspi Save Address
191+
===== Please Input Program Top Address ============
192+
Please Input : H'23000
193+
194+
===== Please Input Qspi Save Address ===
195+
Please Input : H'200000
196+
please send ! ('.' & CR stop load)
197+
I Flash memory...
198+
Erase Completed
199+
Write to SPI Flash memory.
200+
======= Qspi Save Information =================
201+
SpiFlashMemory Stat Address : H'00200000
202+
SpiFlashMemory End Address : H'002098E6
203+
===========================================================
204+
205+
Flashing on QSPI using west
206+
---------------------------
207+
208+
Before using ``flash`` command, the board must be set to Cortex-M33 cold boot (SW_CONFIG[1:6] = OFF, OFF, ON, OFF, OFF, ON).
209+
After flashing, it must be set back to Cortex-A55 cold boot to run.
210+
211+
The minimal version of SEGGER JLink SW which can perform flashing of QSPI memory is v7.96.
212+
213+
**Note:** It's verified that we can perform flashing successfully with SEGGER JLink SW v7.98g so please use this or later
214+
version.
215+
216+
.. zephyr-app-commands::
217+
:zephyr-app: samples/hello_world
218+
:board: rzg3s_smarc/r9a08g045s33gbg/cm33
219+
:goals: build flash
220+
:compact:
221+
222+
References
223+
**********
224+
225+
.. target-notes::
226+
227+
.. _RZ/G3S Group Website:
228+
https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rz-mpus/rzg3s-general-purpose-microprocessors-single-core-arm-cortex-a55-11-ghz-cpu-and-dual-core-cortex-m33-250
229+
230+
.. _RZG3S-EVKIT Website:
231+
https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rz-mpus/rzg3s-evkit-evaluation-board-kit-rzg3s-mpu
232+
233+
.. _SMARC EVK of RZ/G3S Linux Start-up Guide:
234+
https://www.renesas.com/us/en/document/gde/smarc-evk-rzg3s-linux-start-guide-rev104
Binary file not shown.
44.2 KB
Binary file not shown.
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/*
2+
* Copyright (c) 2024 EPAM Systems
3+
* Copyright (c) 2024 Renesas Electronics Corporation
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
#include <freq.h>
10+
#include <zephyr/dt-bindings/memory-attr/memory-attr-arm.h>
11+
#include <zephyr/dt-bindings/input/input-event-codes.h>
12+
#include <zephyr/dt-bindings/gpio/renesas-rz-gpio.h>
13+
#include <arm/renesas/rz/rzg/r9a08g045.dtsi>
14+
#include "rzg3s_smarc-pinctrl.dtsi"
15+
16+
/ {
17+
model = "Renesas RZ/G3S SMARC";
18+
compatible = "renesas,rzg3s-smarc";
19+
20+
chosen {
21+
zephyr,sram = &sram_mcpu0;
22+
zephyr,flash = &spi_flash;
23+
zephyr,console = &scif1;
24+
zephyr,shell-uart = &scif1;
25+
};
26+
27+
aliases {
28+
sw0 = &sw_1;
29+
sw1 = &sw_2;
30+
sw2 = &sw_3;
31+
};
32+
33+
buttons {
34+
compatible = "gpio-keys";
35+
36+
sw_1: button_1 {
37+
gpios = <&gpio18 0 GPIO_ACTIVE_LOW>;
38+
label = "SW1";
39+
zephyr,code = <INPUT_KEY_1>;
40+
};
41+
42+
sw_2: button_2 {
43+
gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
44+
label = "SW2";
45+
zephyr,code = <INPUT_KEY_2>;
46+
};
47+
48+
sw_3: button_3 {
49+
gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
50+
label = "SW3";
51+
zephyr,code = <INPUT_KEY_3>;
52+
};
53+
};
54+
55+
ddr: memory@60000000 {
56+
compatible ="zephyr,memory-region", "mmio-sram";
57+
reg = <0x60000000 DT_SIZE_M(16)>;
58+
zephyr,memory-region = "DDR";
59+
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_RAM) )>;
60+
};
61+
62+
sram_mcpu0: memory@23000 {
63+
compatible = "mmio-sram";
64+
reg = <0x23000 DT_SIZE_K(243)>;
65+
};
66+
67+
/*
68+
* This node is defined to enable west flash support.
69+
* The base addr and size depends on ATF-F configuration, which is running on Cortex-A55 and
70+
* loading Zephyr app from xSPI flash.
71+
*/
72+
spi_flash: memory@80200000 {
73+
compatible = "mmio-sram";
74+
reg = <0x80200000 DT_SIZE_K(256)>;
75+
};
76+
77+
};
78+
79+
&scif1 {
80+
current-speed = <115200>;
81+
pinctrl-0 = <&scif1_pins>;
82+
pinctrl-names = "default";
83+
status = "okay";
84+
};
85+
86+
&gpio0{
87+
status = "okay";
88+
};
89+
90+
&gpio18{
91+
status = "okay";
92+
};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
identifier: rzg3s_smarc/r9a08g045s33gbg/cm33
2+
name: Cortex-M33 for Renesas RZ/G3S SMARC
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- zephyr
7+
- gnuarmemb
8+
supported:
9+
- uart
10+
- gpio
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright (c) 2024 EPAM Systems
2+
# Copyright (c) 2024 Renesas Electronics Corporation
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
CONFIG_XIP=n
6+
7+
# Enable UART driver
8+
CONFIG_SERIAL=y
9+
10+
# Enable console
11+
CONFIG_CONSOLE=ys
12+
CONFIG_UART_CONSOLE=y

0 commit comments

Comments
 (0)