From 4793e00ae803ae6b7948e4c110f7ceef11821ef5 Mon Sep 17 00:00:00 2001 From: Quy Tran Date: Fri, 6 Sep 2024 04:47:16 +0000 Subject: [PATCH] boards: renesas: Add configurations to support pwm on EK-RA8D1 Add support for PWM driver on EK-RA8D1 Signed-off-by: Quy Tran --- boards/renesas/ek_ra8d1/doc/index.rst | 2 + boards/renesas/ek_ra8d1/ek_ra8d1-pinctrl.dtsi | 11 ++++++ boards/renesas/ek_ra8d1/ek_ra8d1.dts | 8 ++++ .../pwm/pwm_loopback/boards/ek_ra8d1.overlay | 37 +++++++++++++++++++ 4 files changed, 58 insertions(+) create mode 100644 tests/drivers/pwm/pwm_loopback/boards/ek_ra8d1.overlay diff --git a/boards/renesas/ek_ra8d1/doc/index.rst b/boards/renesas/ek_ra8d1/doc/index.rst index 79a5dde2d90587..6b8f83272349f8 100644 --- a/boards/renesas/ek_ra8d1/doc/index.rst +++ b/boards/renesas/ek_ra8d1/doc/index.rst @@ -104,6 +104,8 @@ The below features are currently supported on Zephyr OS for EK-RA8D1 board: +--------------+------------+------------------+ | FLASH | on-chip | flash | +--------------+------------+------------------+ +| PWM | on-chip | pwm | ++--------------+------------+------------------+ Other hardware features are currently not supported by the port. diff --git a/boards/renesas/ek_ra8d1/ek_ra8d1-pinctrl.dtsi b/boards/renesas/ek_ra8d1/ek_ra8d1-pinctrl.dtsi index 57a0e064fbadb2..7dd8b9676f9a24 100644 --- a/boards/renesas/ek_ra8d1/ek_ra8d1-pinctrl.dtsi +++ b/boards/renesas/ek_ra8d1/ek_ra8d1-pinctrl.dtsi @@ -25,4 +25,15 @@ ; }; }; + + pwm7_default: pwm7_default { + group1 { + /* GTIOC7A */ + psels = ; + }; + group2 { + /* GTIOC7B */ + psels = ; + }; + }; }; diff --git a/boards/renesas/ek_ra8d1/ek_ra8d1.dts b/boards/renesas/ek_ra8d1/ek_ra8d1.dts index 4449e566c2dc28..1acd074322090c 100644 --- a/boards/renesas/ek_ra8d1/ek_ra8d1.dts +++ b/boards/renesas/ek_ra8d1/ek_ra8d1.dts @@ -124,3 +124,11 @@ }; }; }; + +&pwm7 { + pinctrl-0 = <&pwm7_default>; + interrupts = <40 1>, <41 1>; + interrupt-names = "gtioca", "overflow"; + pinctrl-names = "default"; + status = "okay"; +}; diff --git a/tests/drivers/pwm/pwm_loopback/boards/ek_ra8d1.overlay b/tests/drivers/pwm/pwm_loopback/boards/ek_ra8d1.overlay new file mode 100644 index 00000000000000..6f4d6ea9660b35 --- /dev/null +++ b/tests/drivers/pwm/pwm_loopback/boards/ek_ra8d1.overlay @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2024 Renesas Electronics Corporation + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +/ { + pwm_loopback_0 { + compatible = "test-pwm-loopback"; + /* first index must be a 32-Bit timer */ + pwms = <&pwm7 0 0 PWM_POLARITY_NORMAL>, + <&pwm9 0 0 PWM_POLARITY_NORMAL>; + }; +}; + +&pinctrl { + pwm9_default: pwm9_default { + group1 { + /* GTIOC9A */ + psels = ; + }; + group2 { + /* GTIOC9B */ + psels = ; + }; + }; +}; + +&pwm9 { + pinctrl-0 = <&pwm9_default>; + pinctrl-names = "default"; + interrupts = <50 1>, <51 1>; + interrupt-names = "gtioca", "overflow"; + status = "okay"; +};