Skip to content

Add realtek rts5817 soc #91486

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
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
13 changes: 13 additions & 0 deletions MAINTAINERS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4169,6 +4169,19 @@ OpenTitan Platforms:
description: >-
OpenTitan boards, SOCs, dts files and related drivers.

Realtek Fingerprint Platforms:
status: maintained
maintainers:
- RtkFP
files:
- boards/realtek/rts5817_maa_evb/
- drivers/*/*rts5817*
- dts/bindings/*/*rts5817*
- dts/arm/realtek/fingerprint/
- soc/realtek/fingerprint/
labels:
- "platform: Realtek Fingerprint"

Realtek EC Platforms:
status: maintained
maintainers:
Expand Down
5 changes: 5 additions & 0 deletions boards/realtek/rts5817_maa_evb/Kconfig.rts5817_maa_evb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2024 Realtek Semiconductor, Inc.
# SPDX-License-Identifier: Apache-2.0

config BOARD_RTS5817_MAA_EVB
select SOC_RTS5817
7 changes: 7 additions & 0 deletions boards/realtek/rts5817_maa_evb/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright (c) 2024 Realtek Semiconductor, Inc.
# SPDX-License-Identifier: Apache-2.0
set_property(TARGET runners_yaml_props_target PROPERTY bin_file zephyr.rts5817.bin)

board_set_flasher_ifnset(rtsflash)
board_runner_args(rtsflash "--pid=0bda:5817" "--alt=0")
board_finalize_runner_args(rtsflash)
8 changes: 8 additions & 0 deletions boards/realtek/rts5817_maa_evb/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) 2024 Realtek Semiconductor, Inc.
# SPDX-License-Identifier: Apache-2.0

board:
name: rts5817_maa_evb
vendor: realtek
socs:
- name: rts5817
Binary file not shown.
63 changes: 63 additions & 0 deletions boards/realtek/rts5817_maa_evb/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
.. zephyr:board:: rts5817_maa_evb

Overview
********

rts5817 is a high-performance MCU based on Realtek Real-M300 ARMv8-M architecture with Cortex-M33 instruction set compatible.

.. figure:: img/rts5817_maa_evb.webp
:width: 400px
:align: center
:alt: rts5817_maa_evb

Hardware
********

- 240MHz single-core 32-bit CPU with I-cache 32KB, D-cache 16KB
- 48KB boot ROM
- 256KB on-chip SRAM
- 1KB PUFrt OTP
- 2MB Flash
- USB2.0 full speed/high speed device
- Up to 11 GPIO
- 2 x UART
- 2 x Timer
- 2 x SPI, one can support slave mode
- Watchdog
- DMA
- Temperature sensor
- Cryptographic hardware acceleration (RNG, SHA, AES)
- Fingerprint mataching hardware acceleration (MAC, popcount, convolution, etc.)
- SWD for debug

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

.. zephyr:board-supported-hw::

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

Building
========

#. Build :zephyr:code-sample:`hello_world` application as you would normally do.

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

Flashing
========

#. Short the two pins of ``J6`` to enter force rom mode (see `RTS5817MAA_EVB_User_Guide`_).
#. Connect the board to your host computer using USB.
#. Use ``west flash`` command to flash the image.
#. Disconnect the two pins of ``J6`` and reboot, The :zephyr:code-sample:`hello_world` application is running.

References
**********

.. target-notes::

.. _RTS5817MAA_EVB_User_Guide:
https://github.com/RtkFP/Doc/blob/main/RTS5817MAA_EVB%20User%20Guide_V1.0.pdf
37 changes: 37 additions & 0 deletions boards/realtek/rts5817_maa_evb/rts5817_maa_evb-pinctrl.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright (c) 2024 Realtek Semiconductor, Inc.
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/pinctrl/rts5817_pinctrl.h>

&pinctrl {
uart0_default: uart0_default {
group0 {
pinmux = <P_SCL0_F_UART0_RX>, <P_SDA0_F_UART0_TX>;
};
};

/omit-if-no-ref/ sensor_spi_default: sensor_spi_default {
group0 {
pinmux = <P_SNR_MISO_F_SNR_MISO>, <P_SNR_MOSI_F_SNR_MOSI>,
<P_SNR_CLK_F_SNR_CLK>;
power-source = <IO_POWER_1V8>;
bias-pull-down;
};

group1 {
pinmux = <P_SNR_CS_F_SNR_CS>, <P_SNR_RST_F_SNR_RST>;
power-source = <IO_POWER_1V8>;
bias-pull-up;
};
};

/omit-if-no-ref/ ssi_master_default: ssi_master_default {
group0 {
pinmux = <P_SSI_M_MISO_F_SSI_M_MISO>, <P_SSI_M_MOSI_F_SSI_M_MOSI>,
<P_SSI_M_CS_F_SSI_M_CS>, <P_SSI_M_SCK_F_SSI_M_CLK>;
bias-pull-down;
};
};
};
43 changes: 43 additions & 0 deletions boards/realtek/rts5817_maa_evb/rts5817_maa_evb.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Copyright (c) 2024 Realtek Semiconductor, Inc.
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;
#include <realtek/fingerprint/rts5817/rts5817.dtsi>
#include "rts5817_maa_evb-pinctrl.dtsi"

/ {
model = "Realtek rts5817_maa_evb";
compatible = "realtek,rts5817_maa_evb";
#address-cells = <1>;
#size-cells = <1>;

chosen {
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
};
};

&clks {
status = "okay";
};

&reset {
status = "okay";
};

&watchdog {
status = "okay";
};

&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_default>;
current-speed = <57600>;
status = "okay";
};

&uart1 {
status = "disabled";
};
15 changes: 15 additions & 0 deletions boards/realtek/rts5817_maa_evb/rts5817_maa_evb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (c) 2024 Realtek Semiconductor, Inc.
# SPDX-License-Identifier: Apache-2.0

identifier: rts5817_maa_evb
name: RTS5817 Platform for fingerprint
type: mcu
arch: arm
ram: 256
flash: 2048
toolchain:
- zephyr
- gnuarmemb
testing:
default: true
vendor: realtek
17 changes: 17 additions & 0 deletions boards/realtek/rts5817_maa_evb/rts5817_maa_evb_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) 2024 Realtek Semiconductor, Inc.
# SPDX-License-Identifier: Apache-2.0

# Enable clocks
CONFIG_CLOCK_CONTROL=y

# Enable reset
CONFIG_RESET=y

# Enable serial console
CONFIG_SERIAL=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

# Enable watchdog
CONFIG_WATCHDOG=y
CONFIG_WDT_DISABLE_AT_BOOT=y
2 changes: 2 additions & 0 deletions drivers/clock_control/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,5 @@ endif()
zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_AST10X0 clock_control_ast10x0.c)
zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_MAX32 clock_control_max32.c)
zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_WCH_RCC clock_control_wch_rcc.c)

zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_RTS5817 clock_control_rts5817.c)
2 changes: 2 additions & 0 deletions drivers/clock_control/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,6 @@ source "drivers/clock_control/Kconfig.wch_rcc"

source "drivers/clock_control/Kconfig.it51xxx"

source "drivers/clock_control/Kconfig.rts5817"

endif # CLOCK_CONTROL
9 changes: 9 additions & 0 deletions drivers/clock_control/Kconfig.rts5817
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2024 Realtek Semiconductor, Inc.
# SPDX-License-Identifier: Apache-2.0

config CLOCK_CONTROL_RTS5817
bool "RTS5817 clock control"
depends on DT_HAS_REALTEK_RTS5817_CLOCK_ENABLED
default y
help
Enable driver for RTS5817 Clock Control.
Loading