Skip to content

Commit

Permalink
boards: realtek: Add rts5912_evb board
Browse files Browse the repository at this point in the history
Add support for Realtek rts5912_evb board

Signed-off-by: Lin Yu-Cheng <[email protected]>
  • Loading branch information
JasonLin-RealTek committed Jul 8, 2024
1 parent 9129590 commit 2a3274a
Show file tree
Hide file tree
Showing 11 changed files with 234 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
/soc/riscv/riscv-privileged/gd32vf103/ @soburi
/soc/starfive/jh71xx/ @pfarwsi
/soc/riscv/riscv-privileged/niosv/ @sweeaun
/soc/realtek/ec/ @JasonLin-RealTek
/boards/ene/ @ene-steven
/boards/arm/96b_argonkey/ @avisconti
/boards/arm/96b_avenger96/ @Mani-Sadhasivam
Expand Down Expand Up @@ -132,6 +133,7 @@
/boards/arm64/intel_socfpga_agilex_socdk/ @siclim @ngboonkhai
/boards/arm64/intel_socfpga_agilex5_socdk/ @teikheng @gdengi
/boards/arm64/rcar_*/ @lorc @xakep-amatop
/boards/realtek/ @JasonLin-RealTek
# All cmake related files
/doc/develop/tools/coccinelle.rst @himanshujha199640 @JuliaLawall
/doc/services/device_mgmt/smp_protocol.rst @de-nordic @nordicjm
Expand Down Expand Up @@ -169,6 +171,7 @@
/drivers/clock_control/*nrf* @nordic-krch
/drivers/clock_control/*esp32* @extremegtx @sylvioalves
/drivers/clock_control/*cpg_mssr* @aaillet
/drivers/clock_control/*rts5912* @JasonLin-RealTek
/drivers/console/ipm_console.c @finikorg
/drivers/console/semihost_console.c @luozhongyao
/drivers/console/jailhouse_debug_console.c @MrVan
Expand Down Expand Up @@ -232,6 +235,7 @@
/drivers/gpio/*kb1200* @ene-steven
/drivers/gpio/gpio_altera_pio.c @shilinte
/drivers/gpio/gpio_ad559x.c @bbilas
/drivers/gpio/*rts5912* @JasonLin-RealTek
/drivers/i2c/i2c_common.c @sjg20
/drivers/i2c/i2c_emul.c @sjg20
/drivers/i2c/i2c_ite_enhance.c @GTLin08
Expand Down Expand Up @@ -281,6 +285,7 @@
/drivers/pinctrl/*esp32* @sylvioalves
/drivers/pinctrl/*it8xxx2* @ite
/drivers/pinctrl/*kb1200* @ene-steven
/drivers/pinctrl/*rts5912* @JasonLin-RealTek
/drivers/pm_cpu_ops/psci_shell.c @nbalabak @gdengi
/drivers/power_domain/ @ceolin
/drivers/ps2/*xec* @franciscomunoz @sjvasanth1
Expand Down Expand Up @@ -346,6 +351,7 @@
/drivers/serial/uart_ite_it8xxx2.c @GTLin08
/drivers/serial/*intel_lw* @shilinte
/drivers/serial/*kb1200* @ene-steven
/drivers/serial/*rts5912* @JasonLin-RealTek
/drivers/disk/sdmmc_stm32.c @anthonybrandon
/drivers/ptp_clock/ @tbursztyka @jukkar
/drivers/spi/*b91* @andy-liu-telink
Expand All @@ -372,6 +378,7 @@
/drivers/timer/*rv32m1_lptmr* @mbolivar
/drivers/timer/*nrf_rtc* @anangl
/drivers/timer/*hpet* @dcpleung
/drivers/timer/*rts5912* @JasonLin-RealTek
/drivers/usb/device/usb_dc_stm32.c @ydamigos @loicpoulain
/drivers/i2c/*b91* @andy-liu-telink
/drivers/i2c/i2c_ll_stm32* @ydamigos
Expand Down
10 changes: 10 additions & 0 deletions boards/realtek/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _boards-realtek:

Realtek
#######

.. toctree::
:maxdepth: 1
:glob:

**/*
21 changes: 21 additions & 0 deletions boards/realtek/rts5912_evb/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (c) 2024 Realtek Semiconductor Corporation, SIBG-SD7
#

if BOARD_RTS5912_EVB

if REALTEK_RTS5912_RTMR

config PM
default y

config SYS_CLOCK_HW_CYCLES_PER_SEC
default 32768

config SYS_CLOCK_TICKS_PER_SEC
default 32768

endif # REALTEK_RTS5912_RTMR

endif # BOARD_RTS5912_EVB
7 changes: 7 additions & 0 deletions boards/realtek/rts5912_evb/Kconfig.rts5912_evb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (c) 2024 Realtek Semiconductor Corporation, SIBG-SD7
#

config BOARD_RTS5912_EVB
select SOC_RTS5912
6 changes: 6 additions & 0 deletions boards/realtek/rts5912_evb/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (c) 2024 Realtek Semiconductor Corporation, SIBG-SD7
#

include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
5 changes: 5 additions & 0 deletions boards/realtek/rts5912_evb/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
board:
name: rts5912_evb
vendor: realtek
socs:
- name: rts5912
91 changes: 91 additions & 0 deletions boards/realtek/rts5912_evb/doc/rts5912_evb.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
.. _rts5912_evb:

Realtek RTS5912 Evaluation Board
################################

Overview
********
The RTS5912 EVB is a development platform to evaluate the Realtek RTS5912 embedded controller.

.. figure:: rts5912evb.webp
:width: 800px
:align: center
:alt: RTS5912-GR EVB

Hardware
********
- Realtek-M300 Processor (compatible to Cortex-M33)
- Memory:

- 384KB SRAM
- 64KB ROM
- 512KB Flash(MCM)
- 256B Battery SRAM
- PECI interface 3.1
- FAN, PWM and TACHO pins
- 6x I2C instances
- eSPI header
- 1x PS/2 ports
- Keyboard interface headers

For more information about the evb board please see `RTS5912_EVB_Schematics`_ and `RTS5912_DATASHEET`_

The board is powered through the +5V USB Type-C connector or adaptor.


Supported Features
==================
The RTS5912 EVB supports the following hardware features:

+-----------+------------+-------------------------------------+
| Interface | Controller | Driver/Component |
+===========+============+=====================================+
| NVIC | on-chip | nested vector interrupt controller |
+-----------+------------+-------------------------------------+
| UART | on-chip | serial |
+-----------+------------+-------------------------------------+
| GPIO | on-chip | gpio |
+-----------+------------+-------------------------------------+
| PINCTRL | on-chip | pinctrl |
+-----------+------------+-------------------------------------+
| SCCON | on-chip | clock_control |
+-----------+------------+-------------------------------------+
| RTMR | on-chip | timer |
+-----------+------------+-------------------------------------+


Other hardware features are not currently supported by Zephyr.

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

Building
========

#. Build :ref:`hello_world` application as you would normally do.

#. The file ``zephyr.rts5912.bin`` will be created if the build system can build successfully.
This binary image can be found under file "build/zephyr/".

Flashing
========
#. Connect Dediprog into header ``J81`` and ``J82``.
#. Use Dediprog SF600 programmer to write the binary into the external flash ``U10`` at the address 0x0.
#. Power off the board.
#. Set the strap pin ``GPIO108`` to high and power on the board.

Debugging
=========

Using SWD or JTAG with ULINPRO.

References
**********

.. target-notes::

.. _RTS5912_EVB_Schematics:
https://github.com/JasonLin-RealTek/Realtek_EC/blob/main/RTS5912_EVB_Schematic_Ver%201.1_20240701_1407.pdf

.. _RTS5912_DATASHEET:
https://github.com/JasonLin-RealTek/Realtek_EC/blob/main/RTS5912_datasheet_brief.pdf
Binary file added boards/realtek/rts5912_evb/doc/rts5912evb.webp
Binary file not shown.
47 changes: 47 additions & 0 deletions boards/realtek/rts5912_evb/rts5912_evb.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright (c) 2024 Realtek Semiconductor Corporation, SIBG-SD7
*
*/

/dts-v1/;
#include <realtek/ec/rts5912.dtsi>
#include <realtek/ec/rts5912-pinctrl.dtsi>
#include <zephyr/dt-bindings/gpio/gpio.h>
/ {
model = "Realtek RTS5912 Evaluation Board";
compatible = "realtek,rts5912-evb";

chosen {
zephyr,sram = &sram0;
zephyr,console = &uart0;
zephyr,flash = &flash0;
};

power-states {
idle: idle {
compatible = "zephyr,power-state";
power-state-name = "suspend-to-idle";
min-residency-us = <10000>;
};

suspend_to_ram: suspend_to_ram {
compatible = "zephyr,power-state";
power-state-name = "suspend-to-ram";
min-residency-us = <250000>;
};
};
};

&cpu0 {
cpu-power-states = <&idle &suspend_to_ram>;
};

&uart0 {
status = "okay";
current-speed = <115200>;
pinctrl-0 = <&uart_rx_gpio113
&uart_tx_gpio114>;
pinctrl-names = "default";
};
19 changes: 19 additions & 0 deletions boards/realtek/rts5912_evb/rts5912_evb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (c) 2024 Realtek Semiconductor Corporation, SIBG-SD7
#

identifier: rts5912_evb
name: RTS5912-EVB
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
ram: 64
flash: 320
supported:
- gpio
- pinmux
vendor: realtek
21 changes: 21 additions & 0 deletions boards/realtek/rts5912_evb/rts5912_evb_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (c) 2024 Realtek Semiconductor Corporation, SIBG-SD7
#

# Enable RTS5912 image tool
CONFIG_REALTEK_RTS5912_IMG_HEADER=y
CONFIG_REALTEK_RTS5912_HEADER_COMBINE=y
CONFIG_REALTEK_RTS5912_IMG_HEADER_SPI_FREQ_MHZ_DIV8=y
CONFIG_REALTEK_RTS5912_IMG_HEADER_SPI_READ_CMD_NORMAL=y

# Serial Driver
CONFIG_SERIAL=y

# Console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

# Clock support
CONFIG_CLOCK_CONTROL=y
CONFIG_TICKLESS_KERNEL=y

0 comments on commit 2a3274a

Please sign in to comment.