Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Renesas H3ULCB board #31307

Merged
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 CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
/soc/arm/ti_simplelink/cc32xx/ @vanti
/soc/arm/ti_simplelink/msp432p4xx/ @Mani-Sadhasivam
/soc/arm/xilinx_zynqmp/ @stephanosio
/soc/arm/renesas_rcar/ @julien-massot
/soc/xtensa/intel_s1000/ @sathishkuttan @dcpleung
/soc/arm64/ @carlocaione
/soc/arm64/qemu_cortex_a53/ @carlocaione
Expand Down Expand Up @@ -129,6 +130,7 @@
/boards/arm/stm32*_disco/ @erwango @ABOSTM @FRASTM
/boards/arm/stm32f3_disco/ @ydamigos
/boards/arm/stm32*_eval/ @erwango @ABOSTM @FRASTM
/boards/arm/rcar_h3ulcb/ @julien-massot
/boards/common/ @mbolivar-nordic
/boards/deprecated.cmake @tejlmand
/boards/nios2/ @nashif
Expand Down Expand Up @@ -182,6 +184,7 @@
/drivers/can/*mcp2515* @karstenkoenig
/drivers/clock_control/*nrf* @nordic-krch
/drivers/clock_control/*esp32* @extremegtx
/drivers/clock_control/*rcar* @julien-massot
/drivers/counter/ @nordic-krch
/drivers/console/ipm_console.c @finikorg
/drivers/console/semihost_console.c @luozhongyao
Expand Down Expand Up @@ -214,6 +217,7 @@
/drivers/gpio/*lmp90xxx* @henrikbrixandersen
/drivers/gpio/*stm32* @erwango
/drivers/gpio/*eos_s3* @wtatarski @kowalewskijan @kgugala
/drivers/gpio/*rcar* @julien-massot
/drivers/hwinfo/ @alexanderwachter
/drivers/i2s/i2s_ll_stm32* @avisconti
/drivers/i2c/i2c_common.c @sjg20
Expand Down Expand Up @@ -305,6 +309,7 @@
/drivers/timer/cavs_timer.c @dcpleung
/drivers/timer/stm32_lptim_timer.c @FRASTM
/drivers/timer/leon_gptimer.c @martin-aberg
/drivers/timer/rcar_cmt_timer.c @julien-massot
/drivers/usb/ @jfischer-no
/drivers/usb/device/usb_dc_stm32.c @ydamigos @loicpoulain
/drivers/video/ @loicpoulain
Expand Down Expand Up @@ -364,6 +369,7 @@
/dts/arm/armv*m.dtsi @galak @ioannisg
/dts/arm/armv7-r.dtsi @bbolen @stephanosio
/dts/arm/xilinx/ @bbolen @stephanosio
/dts/arm/renesas/ @julien-massot
/dts/x86/ @jhedberg
/dts/xtensa/xtensa.dtsi @ydamigos
/dts/xtensa/intel/ @dcpleung
Expand Down
6 changes: 6 additions & 0 deletions boards/arm/rcar_h3ulcb/Kconfig.board
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) 2021 IoT.bzh
# SPDX-License-Identifier: Apache-2.0

config BOARD_RCAR_H3ULCB_CR7
bool "Cortex-R7 for Renesas H3ULCB"
depends on SOC_R8A77951
7 changes: 7 additions & 0 deletions boards/arm/rcar_h3ulcb/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright (c) 2021 IoT.bzh
# SPDX-License-Identifier: Apache-2.0

if BOARD_RCAR_H3ULCB_CR7
config BOARD
default "rcar_h3ulcb_cr7"
endif # BOARD_RCAR_H3ULCB_CR7
1 change: 1 addition & 0 deletions boards/arm/rcar_h3ulcb/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# SPDX-License-Identifier: Apache-2.0
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.
169 changes: 169 additions & 0 deletions boards/arm/rcar_h3ulcb/doc/rcar_h3ulcb.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
.. _rcar_h3ulcb_boards:

Renesas R-Car H3ULCB
####################

Overview
********
- The H3 Starter Kit 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 Starter Kit, 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.

It is possible to order 2 different types of H3 Starter Kit Boards, one with Ethernet connection onboard and one with Ethernet connection on ComExpress.

.. figure:: img/rcar_h3ulcb_starter_kit.jpg
:width: 460px
:align: center
:height: 288px
:alt: R-Car starter kit

.. Note:: The H3ULCB board can be plugged on a Renesas Kingfisher Infotainment daughter board through COM Express connector in order to physically access more I/O. CAUTION : In this case, power supply is managed by the daughter board.

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

Hardware
********

Hardware capabilities for the H3ULCB for can be found on the `eLinux H3SK page`_ of the board.

.. figure:: img/rcar_h3ulcb_features.jpg
:width: 286px
:align: center
:height: 280px
:alt: R-Car starter kit 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 ULCB CR7:

+-----------+------------------------------+
| Interface | Driver/components |
+===========+==============================+
| CLOCK | clock_control |
+-----------+------------------------------+
| GPIO | gpio |
+-----------+------------------------------+
| GIC | GIC 400 interrupt controller |
+-----------+------------------------------+

It's also currently possible to write on the ram console.

More features will be supported soon.


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

H3ULCB Board :
------------------

Here are official IOs figures from eLinux for H3ULCB board :

`H3SK top view`_

`H3SK bottom view`_

Kingfisher Infotainment daughter board :
----------------------------------------

When connected to Kingfisher Infotainment board through COMExpress connector, the board is exposing much more IOs.

Here are official IOs figures from eLinux for Kingfisher Infotainment board :

`Kingfisher top view`_

`Kingfisher bottom view`_

Programming and Debugging
*************************

The Cortex®-R7 of rcar_h3ulcb board needs to be started by the Cortex®-A cores. Cortex®-A cores are responsible to load the Cortex®-R7 binary application into the RAM, and get the Cortex®-R7 out of reset. The Cortex®-A can currently perform these steps at bootloader level.

Building
========

Applications for the ``rcar_h3ulcb`` 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_h3ulcb
:goals: build

Debugging
=========
You can debug an application using OpenOCD and GDB. The Solution proposed below is using a OpenOCD custom version that support R-Car ULCB boards Cortex®-R7.

Get Renesas ready OpenOCD version
---------------------------------

.. code-block:: bash

git clone --branch renesas https://github.com/iotbzh/openocd.git
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you could consider upstreaming those patches or merging them into our OpenOCD fork, which includes support for Zephyr thread awareness. Otherwise users of this board won't get those extra features.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, Zephyr awareness is included in my own fork, i'm still thinking about either cleaning and contributing to zephyr openocd, or upstream openocd, or finding another tool.

cd openocd
./bootstrap
./configure
make
sudo make install

Start OpenOCD
-------------

.. code-block:: bash

cd openocd
sudo openocd -f tcl/interface/ftdi/olimex-arm-usb-ocd-h.cfg -f tcl/board/renesas_h3ulcb.cfg

In a new terminal session

.. code-block:: bash

telnet 127.0.0.1 4444
r8a77950.r7 arp_examine

Start Debugging
---------------

In a new terminal session

.. code-block:: bash

{ZEPHYR_SDK}/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb {APP_BUILD_DIR}/zephyr/zephyr.elf

References
**********

- `Renesas R-Car Starter Kit website`_
- `Renesas R-Car H3 chip`_
- `eLinux H3SK page`_
- `eLinux Kingfisher page`_

.. _Renesas R-Car Starter Kit website:
https://www.renesas.com/br/en/products/automotive-products/automotive-system-chips-socs/r-car-h3-m3-starter-kit

.. _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

.. _eLinux H3SK page:
https://elinux.org/R-Car/Boards/H3SK

.. _H3SK top view:
https://elinux.org/images/1/1f/R-Car-H3-topview.jpg

.. _H3SK bottom view:
https://elinux.org/images/c/c2/R-Car-H3-bottomview.jpg

.. _eLinux Kingfisher page:
https://elinux.org/R-Car/Boards/Kingfisher

.. _Kingfisher top view:
https://elinux.org/images/0/08/Kfisher_top_specs.png

.. _Kingfisher bottom view:
https://elinux.org/images/0/06/Kfisher_bot_specs.png
48 changes: 48 additions & 0 deletions boards/arm/rcar_h3ulcb/rcar_h3ulcb_cr7.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright (c) 2021 IoT.bzh
*
* SPDX-License-Identifier: Apache-2.0
*
*/

/dts-v1/;
#include <arm/renesas/gen3/r8a77951.dtsi>

/ {
model = "Renesas h3ulcb board";
compatible = "renesas,h3ulcb-cr7";

chosen {
zephyr,sram = &sram0;
};

leds {
compatible = "gpio-leds";
user_led: led_5 {
gpios = <&gpio6 12 GPIO_ACTIVE_HIGH>;
label = "User LED";
};
};

gpio_keys {
compatible = "gpio-keys";
user_button: sw3 {
gpios = <&gpio6 11 GPIO_ACTIVE_LOW>;
label = "User switch";
};
};

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

&cmt0 {
status = "okay";
clock-frequency = <32000>;
};

&gpio6 {
status = "okay";
};
8 changes: 8 additions & 0 deletions boards/arm/rcar_h3ulcb/rcar_h3ulcb_cr7.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
identifier: rcar_h3ulcb_cr7
name: Cortex r7 for Renesas H3ULCB
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
ram: 768
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about flash @julien-massot ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no flash support at the moment. The cortex-r7 is a remote processor of the CA57/CA53, we only use ram area at the moment, the CA57/CA53 processors load the firmware and then start this CR7 processor.

12 changes: 12 additions & 0 deletions boards/arm/rcar_h3ulcb/rcar_h3ulcb_cr7_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CONFIG_SOC_R8A77951=y
CONFIG_SOC_SERIES_RCAR_GEN3=y
CONFIG_BOARD_RCAR_H3ULCB_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_GPIO_RCAR=y
bbolen marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions drivers/clock_control/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ endif()
zephyr_sources_ifdef(CONFIG_CLOCK_CONTROL_RV32M1_PCC clock_control_rv32m1_pcc.c)
zephyr_sources_ifdef(CONFIG_CLOCK_CONTROL_ESP32 clock_control_esp32.c)
zephyr_sources_ifdef(CONFIG_CLOCK_CONTROL_LITEX clock_control_litex.c)
zephyr_sources_ifdef(CONFIG_CLOCK_CONTROL_RCAR_CPG_MSSR clock_control_rcar_cpg_mssr.c)

if(CONFIG_CLOCK_CONTROL_STM32_CUBE)
if(CONFIG_SOC_SERIES_STM32MP1X)
Expand Down
2 changes: 2 additions & 0 deletions drivers/clock_control/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,6 @@ source "drivers/clock_control/Kconfig.esp32"

source "drivers/clock_control/Kconfig.litex"

source "drivers/clock_control/Kconfig.rcar"

endif # CLOCK_CONTROL
10 changes: 10 additions & 0 deletions drivers/clock_control/Kconfig.rcar
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Renesas RCar Gen3

# Copyright (c) 2021 IoT.bzh
# SPDX-License-Identifier: Apache-2.0

config CLOCK_CONTROL_RCAR_CPG_MSSR
bool "RCar CPG MSSR driver"
depends on SOC_SERIES_RCAR_GEN3
help
Enable support for Renesas RCar CPG MSSR driver.
Loading