boards: arm: Add support for R-Car H3 Salvator-X board

Add initial support for the Salvator-X development board.

This work is strongly based on the H3ULCB board, but compared to it:
- device tree was enhanced
   - adding all available push buttons and LEDs
   - setting proper names according to the refdes used on the schematic and
     PCB silkscreen
- documentation was adapted to this board

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
This commit is contained in:
Valerio Setti 2022-03-09 15:38:36 +01:00 committed by Carles Cufí
commit eb94345e3b
12 changed files with 442 additions and 0 deletions

View file

@ -0,0 +1,6 @@
# Copyright (c) 2022 BayLibre, SAS
# SPDX-License-Identifier: Apache-2.0
config BOARD_RCAR_H3_SALVATORX_CR7
bool "Cortex-R7 for Renesas H3 Salvator-X"
depends on SOC_R8A77951

View file

@ -0,0 +1,7 @@
# Copyright (c) 2022 BayLibre, SAS
# SPDX-License-Identifier: Apache-2.0
if BOARD_RCAR_H3_SALVATORX_CR7
config BOARD
default "rcar_h3_salvatorx_cr7"
endif # BOARD_RCAR_H3_SALVATORX_CR7

View file

@ -0,0 +1,3 @@
# SPDX-License-Identifier: Apache-2.0
board_runner_args(openocd "--use-elf")
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View file

@ -0,0 +1,187 @@
.. _rcar_h3_salvatorx_boards:
Renesas R-Car H3 Salvator-X
###########################
Overview
********
- The H3 Salvator-X board is designed for evaluating the features and performance
of the R-CAR H3 device from Renesas Electronics and it is also used for developing
and evaluating application software for these R-CAR H3.
- The H3 Salvator-X, based on the R-CAR H3 SIP, comes with LPDDR4 @4GB in 2-channel,
each 64-bit wide+Hyperflash @64MB, CSI2 interfaces and several communication interfaces
like USB, Ethernet, HDMI and can work standalone or can be adapted to other boards,
via 440pin connector on bottom side.
.. figure:: img/rcar_h3_salvatorx.jpg
:width: 460px
:align: center
:height: 288px
:alt: R-Car Salvator-X kit
More information about the board can be found at `Renesas R-Car Development Support website`_.
Hardware
********
Hardware capabilities for the H3 Salvator-X for can be found on the `eLinux H3 Salvator-X page`_
of the board.
.. figure:: img/rcar_h3_features.jpg
:width: 286px
:align: center
:height: 280px
:alt: R-Car Salvator-X features
.. note:: Zephyr will be booted on the CR7 processor provided for RTOS purpose.
More information about the SoC that equips the board can be found here:
- `Renesas R-Car H3 chip`_
Supported Features
==================
Here is the current supported features when running Zephyr Project on the R-Car Salvator-X CR7:
+-----------+------------------------------+--------------------------------+
| Interface | Driver/components | Support level |
+===========+==============================+================================+
| PINCTRL | pinctrl | |
+-----------+------------------------------+--------------------------------+
| CLOCK | clock_control | |
+-----------+------------------------------+--------------------------------+
| GPIO | gpio | |
+-----------+------------------------------+--------------------------------+
| UART | uart | serial port-polling |
+ + + +
| | FT232RQ / CP2102 | serial port-interrupt |
+-----------+------------------------------+--------------------------------+
| CAN | can | normal mode |
+ + + +
| | TCAN332GDCNT | loopback mode |
+-----------+------------------------------+--------------------------------+
| I2C | i2c | interrupt driven |
+-----------+------------------------------+--------------------------------+
It's also currently possible to write on the ram console.
Connections and IOs
===================
.. figure:: img/r-car-h3-salvator-x-connections.jpg
:align: center
:alt: R-Car Salvator-X connections
GPIO
----
By running Zephyr on H3 Salvator-X, the software readable push buttons 'SW20',
'SW21', 'SW22' can be used as input, and the software contollable LEDs 'LED4',
'LED5', 'LED6' can be used as output.
UART
----
Salvator-X board is providing two serial ports:
- one is for A53/A57 processors
- the other one is for CR7
Both ports are converted to USB through CP2102 converters and they are exposed
as follows:
+-----------+-----------+
| Connector | Processor |
+===========+===========+
| CN25 | A53/A57 |
+-----------+-----------+
| CN26 | CR7 |
+-----------+-----------+
Programming and Debugging
*************************
Build and flash applications as usual (see :ref:`build_an_application` and
:ref:`application_run` for more details).
Supported Debug Probe
=====================
The "Olimex ARM-USB-OCD-H" probe is the only officially supported probe. This
probe is supported by OpenOCD that is shipped with the Zephyr SDK.
The "Olimex ARM-USB-OCD-H" probe needs to be connected to CN1 on Salvator-X.
Configuring a Console
=====================
Connect a USB cable from your PC to CN25 and/or CN26 then use the following
settings with your serial terminal of choice (minicom, putty,
etc.):
- Speed: 115200
- Data: 8 bits
- Parity: None
- Stop bits: 1
Flashing
========
First of all, open your serial terminal.
Applications for the ``rcar_h3_salvatorx_cr7`` board configuration can be built
in the usual way (see :ref:`build_an_application` for more details).
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: rcar_h3_salvatorx_cr7
:goals: flash
You should see the following message in the terminal:
.. code-block:: console
*** Booting Zephyr OS build v2.6.0-rc1 ***
Hello World! rcar_h3_salvatorx_cr7
Debugging
=========
First of all, open your serial terminal.
Here is an example for the :ref:`hello_world` application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: rcar_h3_salvatorx_cr7
:goals: debug
You will then get access to a GDB session for debug.
By continuing the app, you should see the following message in the terminal:
.. code-block:: console
*** Booting Zephyr OS build v2.6.0-rc1 ***
Hello World! rcar_h3_salvatorx_cr7
References
**********
- `Renesas R-Car H3 chip`_
- `Renesas R-Car Development Support website`_
- `eLinux H3 Salvator-X page`_
.. _Renesas R-Car H3 chip:
https://www.renesas.com/eu/en/products/automotive-products/automotive-system-chips-socs/r-car-h3-high-end-automotive-system-chip-soc-vehicle-infotainment-and-driving-safety-support
.. _Renesas R-Car Development Support website:
https://www.renesas.com/us/en/support/partners/r-car-consortium/r-car-development-support
.. _eLinux H3 Salvator-X page:
https://elinux.org/R-Car/Boards/Salvator-X
.. _Install a toolchain:
https://docs.zephyrproject.org/latest/getting_started/index.html#install-a-toolchain

View file

@ -0,0 +1,33 @@
/*
* Copyright (c) 2022 BayLibre, SAS
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <dt-bindings/pinctrl/renesas/pinctrl-r8a77951.h>
&pfc {
can0_data_a_tx_default: can0_data_a_tx_default {
pin = <PIN_RD FUNC_CAN0_TX_A>;
};
can0_data_a_rx_default: can0_data_a_rx_default {
pin = <PIN_RD_WR FUNC_CAN0_RX_A>;
};
scif1_data_a_tx_default: scif1_data_a_tx_default {
pin = <PIN_TX1_A FUNC_TX1_A>;
};
scif1_data_a_rx_default: scif1_data_a_rx_default {
pin = <PIN_RX1_A FUNC_RX1_A>;
};
scif2_data_a_tx_default: scif2_data_a_tx_default {
pin = <PIN_TX2_A FUNC_TX2_A>;
};
scif2_data_a_rx_default: scif2_data_a_rx_default {
pin = <PIN_RX2_A FUNC_RX2_A>;
};
};

View file

@ -0,0 +1,89 @@
/*
* Copyright (c) 2022 BayLibre, SAS
*
* SPDX-License-Identifier: Apache-2.0
*
*/
/dts-v1/;
#include <arm/renesas/gen3/r8a77951.dtsi>
#include "rcar_h3_salvatorx_cr7-pinctrl.dtsi"
/ {
model = "Renesas h3 Salvator-X board";
compatible = "renesas,h3-salvatorx-cr7";
chosen {
zephyr,sram = &sram0;
zephyr,console = &scif1;
zephyr,shell-uart = &scif1;
zephyr,canbus = &can0;
};
leds {
compatible = "gpio-leds";
user_led_0: led_4 {
gpios = <&gpio6 11 GPIO_ACTIVE_HIGH>;
label = "led4";
};
user_led_1: led_5 {
gpios = <&gpio6 12 GPIO_ACTIVE_HIGH>;
label = "led5";
};
user_led_2: led_6 {
gpios = <&gpio6 13 GPIO_ACTIVE_HIGH>;
label = "led6";
};
};
gpio_keys {
compatible = "gpio-keys";
user_button_0: sw20 {
gpios = <&gpio6 11 GPIO_ACTIVE_LOW>;
label = "sw20";
};
user_button_1: sw21 {
gpios = <&gpio6 12 GPIO_ACTIVE_LOW>;
label = "sw21";
};
user_button_2: sw22 {
gpios = <&gpio6 13 GPIO_ACTIVE_LOW>;
label = "sw22";
};
};
aliases {
led0 = &user_led_1;
sw0 = &user_button_0;
};
};
&cmt0 {
status = "okay";
clock-frequency = <32000>;
};
&gpio6 {
status = "okay";
};
&can0 {
pinctrl-0 = <&can0_data_a_tx_default &can0_data_a_rx_default>;
pinctrl-names = "default";
status = "okay";
bus-speed = <125000>;
};
&scif1 {
pinctrl-0 = <&scif1_data_a_tx_default &scif1_data_a_rx_default>;
pinctrl-names = "default";
status = "okay";
};
&i2c2 {
status = "okay";
};
&i2c4 {
status = "okay";
};

View file

@ -0,0 +1,15 @@
identifier: rcar_h3_salvatorx_cr7
name: Cortex r7 for Renesas H3 Salvator-X
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
supported:
- i2c
- gpio
- clock_control
- uart
testing:
ignore_tags:
- isotp

View file

@ -0,0 +1,14 @@
CONFIG_SOC_R8A77951=y
CONFIG_SOC_SERIES_RCAR_GEN3=y
CONFIG_BOARD_RCAR_H3_SALVATORX_CR7=y
CONFIG_CLOCK_CONTROL=y
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=32000
CONFIG_RCAR_CMT_TIMER=y
CONFIG_CONSOLE=y
CONFIG_RAM_CONSOLE=y
CONFIG_FLASH_SIZE=0
CONFIG_FLASH_BASE_ADDRESS=0
CONFIG_GPIO=y
CONFIG_SERIAL=y
CONFIG_UART_CONSOLE=y
CONFIG_UART_INTERRUPT_DRIVEN=y

View file

@ -0,0 +1,88 @@
# Renesas R-Car Gen3 H3 Salvator-X Cortex-R7 Board Config
source [find interface/ftdi/olimex-arm-usb-ocd-h.cfg]
source [find target/renesas_rcar_reset_common.cfg]
set _CHIPNAME r8a77951
set DAP_TAPID 0x5ba00477
set CA57_0_DBGBASE 0x80410000
set CA57_0_CTIBASE 0x80420000
set CR7_DBGBASE 0x80910000
set CR7_CTIBASE 0x80918000
adapter srst delay 1000
adapter speed 20000
global $_CHIPNAME
transport select jtag
jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x01 -irmask 0x0f -expected-id $DAP_TAPID
dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
cti create $_CHIPNAME.r7.cti -dap $_CHIPNAME.dap -ap-num 1 -baseaddr $CR7_CTIBASE
target create $_CHIPNAME.r7 cortex_r4 -dap $_CHIPNAME.dap -ap-num 1 -dbgbase $CR7_DBGBASE -defer-examine
$_CHIPNAME.r7 configure -rtos auto
cti create $_CHIPNAME.a57.0.cti -dap $_CHIPNAME.dap -ap-num 1 -baseaddr $CA57_0_CTIBASE
target create $_CHIPNAME.a57.0 aarch64 -dap $_CHIPNAME.dap -ap-num 1 -dbgbase $CA57_0_DBGBASE -cti $_CHIPNAME.a57.0.cti
proc reset_cr7 { assert } {
global _CHIPNAME
if { $assert == 1 } {
# Software Reset Register 2 Bit(22) Arm Realtime core
$_CHIPNAME.a57.0 mww 0xe61500b0 0x00400000
} else {
# Software Reset Clearing Register 2 Bit(22) Arm Realtime core
$_CHIPNAME.a57.0 mww 0xe6150948 0x00400000
}
}
# This function make use of A5x processor to:
# - Power on the CR7 (PWRONCR7)
# - Set the boot address (CR7BAR)
# - Halt the processor
# - Deassert the CR7 reset
proc start_cr7 { args } {
global _CHIPNAME
targets $_CHIPNAME.a57.0
$_CHIPNAME.a57.0 arp_halt
# CR7BAR RBAR [31:18] BAREN bit(4)
$_CHIPNAME.a57.0 mww 0xe6160070 0x40040010
# PWRONCR7
$_CHIPNAME.a57.0 mww 0xe618024c 1
# Wait until power is on. Also possible to
# poll PWRSR7 and CR7PSTR register.
sleep 100
$_CHIPNAME.r7 arp_examine
catch { $_CHIPNAME.r7 arp_halt }
reset_cr7 0
# resume a5x processor or cmt timer will not run
resume
# set CR7 processor as default target for future commands
targets $_CHIPNAME.r7
}
$_CHIPNAME.r7 configure -event reset-end {
global _CHIPNAME
targets $_CHIPNAME.a57.0
# Resume the A57 processor and gives
# enough time to A57 bootloaders to set-up dram
# clocks, power management, security groups
resume
sleep 500
$_CHIPNAME.a57.0 arp_halt
$_CHIPNAME.a57.0 arp_poll
start_cr7
}
$_CHIPNAME.a57.0 configure -event examine-end {
start_cr7
}
$_CHIPNAME.r7 configure -event gdb-attach {
reset halt
}