Skip to content
Merged
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
6 changes: 6 additions & 0 deletions boards/arm/rcar_spider/Kconfig.board
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) 2023 IoT.bzh
# SPDX-License-Identifier: Apache-2.0

config BOARD_RCAR_SPIDER_CR52
bool "Cortex-R52 for Renesas Spider"
depends on SOC_R8A779F0
9 changes: 9 additions & 0 deletions boards/arm/rcar_spider/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2023 IoT.bzh
# SPDX-License-Identifier: Apache-2.0

if BOARD_RCAR_SPIDER_CR52

config BOARD
default "rcar_spider_cr52"

endif # BOARD_RCAR_SPIDER_CR52
3 changes: 3 additions & 0 deletions boards/arm/rcar_spider/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-License-Identifier: Apache-2.0
board_runner_args(openocd "--use-elf")
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
200 changes: 200 additions & 0 deletions boards/arm/rcar_spider/doc/rcar_spider.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
.. _rcar_spider_boards:

Renesas R-Car Spider
####################

Overview
********

| R-Car S4 enables the launch of Car Server/CoGW with high performance, high-speed networking,
| high security and high functional safety levels that are required as E/E architectures
| evolve into domains and zones.

| The R-Car S4 solution allows designers to re-use up to 88 percent of software code developed
| for 3rd generation R-Car SoCs and RH850 MCU applications.\
| The software package supports the real-time cores with various drivers and basic software
| such as Linux BSP and hypervisors.

The Renesas R-Car Spider board is the Renesas R-Car S4 reference board and is designed for
evaluating features and performance of this SoC.

.. figure:: img/rcar_s4_spider_full.jpg
:align: center
:alt: R-Car S4 Spider

More information about the board can be found at `Renesas R-Car S4 Spider`_ website.

Hardware
********

Hardware capabilities for the S4 Spider board can be found on the `eLinux S4 Spider`_ page.

.. figure:: img/rcar_s4_block_diagram.jpg
:align: center
:alt: R-Car S4 Spider block diagram

.. note:: We support Zephyr running on the CR52 processor that is provided for RTOS purpose.

More information about the SoC that equips the board can be found here:

- `Renesas R-Car S4 chip`_

Supported Features
==================

Here are the current supported features when running Zephyr Project on the R-Car S4 Spider CR52:

+-----------+------------------------------+--------------------------------+
| Interface | Driver/components | Support level |
+===========+==============================+================================+
| PINMUX | pinmux | |
+-----------+------------------------------+--------------------------------+
| CLOCK | clock_control | |
+-----------+------------------------------+--------------------------------+
| GPIO | gpio | |
+-----------+------------------------------+--------------------------------+
| UART | uart | serial port-polling |
+ + + +
| | FT232RQ | serial port-interrupt |
+-----------+------------------------------+--------------------------------+
| I2C | i2c | interrupt driven |
+-----------+------------------------------+--------------------------------+
| PWM | pwm | All channels |
+-----------+------------------------------+--------------------------------+

It is also currently possible to write on the ram console.

More features will be supported soon.

Connections and IOs
===================

| The "Spider board" consists of a CPU board and a Breakout board.
| The CPU board is stuck on top of the Breakout board.

Here are the official IOs figures from eLinux for S4 board:

`S4 Spider CPU board IOs`_

`S4 Spider breakout board IOs`_

GPIO
----

By running Zephyr on S4 Spider, the software controllable LED 'LED8' can be used as output.

UART
----

Here is information about both serial ports provided on the S4 Spider board :

+--------------------+----------+--------------------+-------------+------------------------+
| Physical Interface | Location | Software Interface | Converter | Further Information |
+====================+==========+====================+=============+========================+
| CN20 USB Port | CPU Board| SCIF0/HSCIF1 | FT232HQ | Default Zephyr serial |
+--------------------+----------+--------------------+-------------+------------------------+
| CN21 USB Port | CPU Board| SCIF3/HSCIF0 | FT2232H-56Q | Used by U-BOOT & Linux |
+--------------------+----------+--------------------+-------------+------------------------+

.. note::
The Zephyr console output is assigned to SCIF0 (CN20 USB Port) with settings:
115200 8N1 without hardware flow control by default.

I2C
---

I2C is mainly used to manage and power-on some onboard chips on the S4 Spider board.

Embedded I2C devices and I/O expanders are not yet supported.
The current I2C support therefore does not make any devices available to the user at this time.

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 with a "Coresight 20 pins"
adapter to CN1 connector on Spider board.

Configuring a Console
=====================

Connect a USB cable from your PC to CN20 USB port of your Spider board.

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_spider_cr52`` 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_spider_cr52
:goals: flash

You should see the following message in the terminal:

.. code-block:: console

*** Booting Zephyr OS build v3.3.0-rc2 ***
Hello World! rcar_spider_cr52

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_spider_cr52
:goals: debug

You will then get access to a GDB session for debugging.

By continuing the app, you should see the following message in the terminal:

.. code-block:: console

*** Booting Zephyr OS build v3.3.0-rc2 ***
Hello World! rcar_spider_cr52

References
**********

- `Renesas R-Car S4 Spider`_
- `Renesas R-Car S4 chip`_
- `eLinux S4 Spider`_

.. _Renesas R-Car S4 Spider:
https://www.renesas.com/us/en/products/automotive-products/automotive-system-chips-socs/rtp8a779f0askb0sp2s-r-car-s4-reference-boardspider

.. _Renesas R-Car S4 chip:
https://www.renesas.com/us/en/products/automotive-products/automotive-system-chips-socs/r-car-s4-automotive-system-chip-soc-car-servercommunication-gateway

.. _eLinux S4 Spider:
https://elinux.org/R-Car/Boards/Spider

.. _S4 Spider CPU board IOs:
https://elinux.org/images/6/6d/Rcar_s4_spider_cpu_board.jpg

.. _S4 Spider breakout board IOs:
https://elinux.org/images/2/29/Rcar_s4_spider_breakout_board.jpg
25 changes: 25 additions & 0 deletions boards/arm/rcar_spider/rcar_spider_cr52-pinctrl.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (c) 2023 IoT.bzh
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <dt-bindings/pinctrl/renesas/pinctrl-r8a779f0.h>

&pfc {
scif0_data_tx_default: scif0_data_tx_default {
pin = <PIN_RX0 FUNC_RX0>;
};

scif0_data_rx_default: scif0_data_rx_default {
pin = <PIN_TX0 FUNC_TX0>;
};

scif3_data_tx_default: scif3_data_tx_default {
pin = <PIN_HTX0 FUNC_TX3>;
};

scif3_data_rx_default: scif3_data_rx_default {
pin = <PIN_HRX0 FUNC_RX3>;
};
};
58 changes: 58 additions & 0 deletions boards/arm/rcar_spider/rcar_spider_cr52.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Copyright (c) 2023 IoT.bzh
*
* SPDX-License-Identifier: Apache-2.0
*
*/

/dts-v1/;
#include <arm/renesas/rcar/gen4/r8a779f0.dtsi>
#include "rcar_spider_cr52-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>

/ {
model = "Renesas Spider board";
compatible = "renesas,spider-cr52";

chosen {
zephyr,sram = &sram0;
zephyr,console = &scif0;
zephyr,shell-uart = &scif0;
};

leds {
compatible = "gpio-leds";
user_led: led_8 {
gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
label = "User LED";
};
};

gpio_keys {
compatible = "gpio-keys";
user_button: sw10 {
gpios = <&gpio4 13 GPIO_ACTIVE_LOW>;
label = "User switch";
zephyr,code = <INPUT_KEY_0>;
};
};

aliases {
led0 = &user_led;
sw0 = &user_button;
};
};

&scif0 {
pinctrl-0 = <&scif0_data_tx_default &scif0_data_rx_default>;
pinctrl-names = "default";
status = "okay";
};

&gpio0 {
status = "okay";
};

&gpio4 {
status = "okay";
};
11 changes: 11 additions & 0 deletions boards/arm/rcar_spider/rcar_spider_cr52.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
identifier: rcar_spider_cr52
name: Cortex r52 for Renesas Spider
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
supported:
- gpio
- clock_control
- uart
13 changes: 13 additions & 0 deletions boards/arm/rcar_spider/rcar_spider_cr52_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CONFIG_SOC_R8A779F0=y
CONFIG_SOC_SERIES_RCAR_GEN4=y
CONFIG_BOARD_RCAR_SPIDER_CR52=y
CONFIG_CLOCK_CONTROL=y
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=12500000
CONFIG_CONSOLE=y
CONFIG_RAM_CONSOLE=y
CONFIG_FLASH_SIZE=0
CONFIG_FLASH_BASE_ADDRESS=0
CONFIG_SERIAL=y
CONFIG_UART_CONSOLE=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_GPIO=y
27 changes: 27 additions & 0 deletions boards/arm/rcar_spider/support/openocd.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Renesas R-Car Spider S4 Cortex-R52 Board Config

source [find interface/ftdi/olimex-arm-usb-ocd-h.cfg]
source [find target/renesas_rcar_reset_common.cfg]

set _CHIPNAME r8a779f0
set _CORE_NAME r52
set _TARGETNAME $_CHIPNAME.$_CORE_NAME
set _CTINAME $_TARGETNAME.cti
set _DAPNAME $_CHIPNAME.dap
set DAP_TAPID 0x5ba00477

set CR52_DBGBASE 0x80c10000
set CR52_CTIBASE 0x80c20000

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 $_DAPNAME -chain-position $_CHIPNAME.cpu

cti create $_CTINAME -dap $_DAPNAME -ap-num 1 -baseaddr $CR52_CTIBASE
target create $_TARGETNAME armv8r -dap $_DAPNAME -ap-num 1 -dbgbase $CR52_DBGBASE -cti $_CTINAME

$_TARGETNAME configure -rtos auto
1 change: 1 addition & 0 deletions drivers/clock_control/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_AGILEX5 clock_control_agilex5.
if(CONFIG_CLOCK_CONTROL_RCAR_CPG_MSSR)
zephyr_library_sources(clock_control_renesas_cpg_mssr.c)
zephyr_library_sources_ifdef(CONFIG_DT_HAS_RENESAS_R8A7795_CPG_MSSR_ENABLED clock_control_r8a7795_cpg_mssr.c)
zephyr_library_sources_ifdef(CONFIG_DT_HAS_RENESAS_R8A779F0_CPG_MSSR_ENABLED clock_control_r8a779f0_cpg_mssr.c)
endif()

zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_AST10X0 clock_control_ast10x0.c)
4 changes: 2 additions & 2 deletions drivers/clock_control/Kconfig.rcar
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Copyright (c) 2021-2022 IoT.bzh
# Copyright (c) 2021-2023 IoT.bzh
# SPDX-License-Identifier: Apache-2.0

config CLOCK_CONTROL_RCAR_CPG_MSSR
bool "RCar CPG MSSR driver"
default y
depends on DT_HAS_RENESAS_R8A7795_CPG_MSSR_ENABLED
depends on SOC_FAMILY_RCAR
help
Enable support for Renesas RCar CPG MSSR driver.
Loading