Skip to content

Add support for Renesas RA CEU (Capture Engine Unit) for RA8M1 and RA8D1 #92146

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 8 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
8 changes: 8 additions & 0 deletions boards/renesas/ek_ra8d1/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@ Supported Features
| OFF | OFF | OFF | OFF | OFF | OFF | OFF | ON |
+-------------+-------------+--------------+------------+------------+------------+-------------+-----------+

- For using the Camera Expansion Port (J59) with the Camera, please set switch SW1 as following configuration:

+-------------+-------------+--------------+------------+------------+------------+-------------+-----------+
| SW1-1 PMOD1 | SW1-2 TRACE | SW1-3 CAMERA | SW1-4 ETHA | SW1-5 ETHB | SW1-6 GLCD | SW1-7 SDRAM | SW1-8 I3C |
+-------------+-------------+--------------+------------+------------+------------+-------------+-----------+
| OFF | OFF | ON | OFF | OFF | OFF | ON | OFF |
+-------------+-------------+--------------+------------+------------+------------+-------------+-----------+

.. warning::

Do not enable SW1-4 and SW1-5 together
Expand Down
31 changes: 31 additions & 0 deletions boards/renesas/ek_ra8d1/ek_ra8d1-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@
};
};

pwm3_default: pwm3_default {
group1 {
/* GTIOC3A */
psels = <RA_PSEL(RA_PSEL_GPT1, 4, 3)>;
drive-strength = "medium";
};
group2 {
/* GTIOC3B */
psels = <RA_PSEL(RA_PSEL_GPT1, 4, 4)>;
drive-strength = "medium";
};
};

pwm7_default: pwm7_default {
group1 {
/* GTIOC7A */
Expand Down Expand Up @@ -297,4 +310,22 @@
drive-strength = "high";
};
};

ceu_default: ceu_default {
group1 {
/* CEU */
psels = <RA_PSEL(RA_PSEL_CEU, 4, 0)>, /* VIO_D0 */
<RA_PSEL(RA_PSEL_CEU, 4, 1)>, /* VIO_D1 */
<RA_PSEL(RA_PSEL_CEU, 4, 5)>, /* VIO_D2 */
<RA_PSEL(RA_PSEL_CEU, 4, 6)>, /* VIO_D3 */
<RA_PSEL(RA_PSEL_CEU, 7, 0)>, /* VIO_D4 */
<RA_PSEL(RA_PSEL_CEU, 7, 1)>, /* VIO_D5 */
<RA_PSEL(RA_PSEL_CEU, 7, 2)>, /* VIO_D6 */
<RA_PSEL(RA_PSEL_CEU, 7, 3)>, /* VIO_D7 */
<RA_PSEL(RA_PSEL_CEU, 7, 8)>, /* VIO_CLK */
<RA_PSEL(RA_PSEL_CEU, 7, 9)>, /* VIO_HD */
<RA_PSEL(RA_PSEL_CEU, 7, 10)>; /* VIO_VD */
drive-strength = "high";
};
};
};
40 changes: 40 additions & 0 deletions boards/renesas/ek_ra8d1/ek_ra8d1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#include <zephyr/dt-bindings/memory-attr/memory-attr-arm.h>
#include <zephyr/dt-bindings/memory-controller/renesas,ra-sdram.h>
#include <zephyr/dt-bindings/adc/adc.h>
#include <zephyr/dt-bindings/gpio/dvp-20pin-connector.h>
#include <zephyr/dt-bindings/pwm/pwm.h>
#include "ek_ra8d1-pinctrl.dtsi"

/ {
Expand Down Expand Up @@ -78,6 +80,15 @@
<18 0 &ioporta 1 0>; /* DISP_RST */
};

dvp_20pin_connector: dvp-20pin-connector {
compatible = "arducam,dvp-20pin-connector";
#gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0x0 0x3f>;
gpio-map = <DVP_20PIN_PEN 0 &ioport7 4 0>,
<DVP_20PIN_PDN 0 &ioport7 5 0>;
};

aliases {
led0 = &led1;
sw0 = &button0;
Expand Down Expand Up @@ -255,6 +266,21 @@
};
};

&pwm3 {
pinctrl-0 = <&pwm3_default>;
pinctrl-names = "default";
interrupts = <51 12>, <52 12>;
interrupt-names = "gtioca", "overflow";

cam_clock: pwmclock {
compatible = "pwm-clock";
status = "disabled";
#clock-cells = <1>;
clock-frequency = <24000000>;
pwms = <&pwm3 0 PWM_KHZ(24000) PWM_POLARITY_NORMAL>;
};
};

&pwm7 {
pinctrl-0 = <&pwm7_default>;
interrupts = <40 1>, <41 1>;
Expand Down Expand Up @@ -358,6 +384,16 @@
};
};

&ceu {
pinctrl-0 = <&ceu_default>;
pinctrl-names = "default";
interrupts = <53 12>;
interrupt-names = "ceui";
clocks = <&pclka MSTPC 16>, <&cam_clock 0>;
clock-names = "pclk", "cam-xclk";
burst-transfer = <256>;
};

zephyr_lcdif: &lcdif {};

zephyr_mipi_dsi: &mipi_dsi {};
Expand All @@ -366,6 +402,10 @@ renesas_mipi_i2c: &iic1 {};

pmod_sd_shield: &sdhc1 {};

dvp_20pin_i2c: &iic1 {};

dvp_20pin_interface: &ceu {};

&usbfs {
pinctrl-0 = <&usbfs_default>;
pinctrl-names = "default";
Expand Down
1 change: 1 addition & 0 deletions boards/renesas/ek_ra8d1/ek_ra8d1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ supported:
- counter
- i2s
- i3c
- video
vendor: renesas
30 changes: 30 additions & 0 deletions boards/shields/dvp_20pin_ov7670/boards/ek_ra8d1.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2025 Renesas Electronics Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/

&pwm3 {
status = "okay";
};

&cam_clock {
status = "okay";
};

&dvp_20pin_i2c {
clock-frequency = <DT_FREQ_K(400)>;
};

&dvp_20pin_interface {
swap-8bits;
swap-16bits;
swap-32bits;

port {
dvp_20pin_ep_in: endpoint {
hsync-sample = <1>;
vsync-sample = <1>;
};
};
};
7 changes: 7 additions & 0 deletions boards/shields/dvp_20pin_ov7670/dvp_20pin_ov7670.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@
};

&dvp_20pin_i2c {
status = "okay";

ov7670: ov7670@21 {
compatible = "ovti,ov7670";
reg = <0x21>;
reset-gpios = <&dvp_20pin_connector DVP_20PIN_PEN GPIO_ACTIVE_HIGH>;
pwdn-gpios = <&dvp_20pin_connector DVP_20PIN_PDN GPIO_ACTIVE_HIGH>;
status = "okay";

port {
ov7670_ep_out: endpoint {
Expand All @@ -32,6 +35,10 @@
port {
dvp_20pin_ep_in: endpoint {
remote-endpoint-label = "ov7670_ep_out";
bus-width = <8>;
hsync-active = <1>;
vsync-active = <1>;
pclk-sample = <1>;
};
};
};
1 change: 1 addition & 0 deletions drivers/video/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ zephyr_library_sources_ifdef(CONFIG_VIDEO_EMUL_RX video_emul_rx.c)
zephyr_library_sources_ifdef(CONFIG_VIDEO_IMX335 imx335.c)
zephyr_library_sources_ifdef(CONFIG_VIDEO_ST_MIPID02 video_st_mipid02.c)
zephyr_library_sources_ifdef(CONFIG_VIDEO_STM32_DCMIPP video_stm32_dcmipp.c)
zephyr_library_sources_ifdef(CONFIG_VIDEO_RENESAS_RA_CEU video_renesas_ra_ceu.c)

zephyr_linker_sources(DATA_SECTIONS video.ld)
2 changes: 2 additions & 0 deletions drivers/video/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,6 @@ source "drivers/video/Kconfig.st_mipid02"

source "drivers/video/Kconfig.stm32_dcmipp"

source "drivers/video/Kconfig.renesas_ra_ceu"

endif # VIDEO
12 changes: 12 additions & 0 deletions drivers/video/Kconfig.renesas_ra_ceu
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright (c) 2025 Renesas Electronics Corporation
# SPDX-License-Identifier: Apache-2.0

config VIDEO_RENESAS_RA_CEU
bool
default y
depends on DT_HAS_RENESAS_RA_CEU_ENABLED
select PINCTRL
select CLOCK_CONTROL_PWM
select USE_RA_FSP_CEU
help
Enable driver for Renesas RA CEU.
Loading
Loading