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 SPI driver support for Renesas RZ/G3S #83773

Open
wants to merge 6 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
2 changes: 2 additions & 0 deletions boards/renesas/rzg3s_smarc/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ and the following hardware features:
+-----------+------------+-------------------------------------+
| UART | on-chip | serial |
+-----------+------------+-------------------------------------+
| SPI | on-chip | spi |
+-----------+------------+-------------------------------------+

Other hardware features are currently not supported by the port.

Expand Down
9 changes: 9 additions & 0 deletions boards/renesas/rzg3s_smarc/rzg3s_smarc-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,13 @@
<RZG_PINMUX(PORT_15, 2, 6)>; /* TXD */
};
};

/omit-if-no-ref/ spi0_pins: spi0 {
spi0-pinmux {
pinmux = <RZG_PINMUX(PORT_15, 0, 1)>, /* CK */
<RZG_PINMUX(PORT_15, 1, 1)>, /* MOSI */
<RZG_PINMUX(PORT_15, 2, 1)>, /* MISO */
<RZG_PINMUX(PORT_15, 3, 1)>; /* SSL */
};
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,9 @@
&gpio18{
status = "okay";
};

&spi0{
pinctrl-0 = <&spi0_pins>;
pinctrl-names = "default";
status = "okay";
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ toolchain:
supported:
- uart
- gpio
- spi
1 change: 1 addition & 0 deletions drivers/spi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ zephyr_library_sources_ifdef(CONFIG_SPI_PSOC6 spi_psoc6.c)
zephyr_library_sources_ifdef(CONFIG_SPI_PW spi_pw.c)
zephyr_library_sources_ifdef(CONFIG_SPI_RENESAS_RA spi_renesas_ra.c)
zephyr_library_sources_ifdef(CONFIG_SPI_RENESAS_RA8 spi_b_renesas_ra8.c)
zephyr_library_sources_ifdef(CONFIG_SPI_RENESAS_RZ_RSPI spi_renesas_rz_rspi.c)
zephyr_library_sources_ifdef(CONFIG_SPI_RPI_PICO_PIO spi_rpi_pico_pio.c)
zephyr_library_sources_ifdef(CONFIG_SPI_RV32M1_LPSPI spi_rv32m1_lpspi.c)
zephyr_library_sources_ifdef(CONFIG_SPI_SAM spi_sam.c)
Expand Down
1 change: 1 addition & 0 deletions drivers/spi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ source "drivers/spi/Kconfig.psoc6"
source "drivers/spi/Kconfig.pw"
source "drivers/spi/Kconfig.renesas_ra"
source "drivers/spi/Kconfig.renesas_ra8"
source "drivers/spi/Kconfig.renesas_rz"
source "drivers/spi/Kconfig.rpi_pico"
source "drivers/spi/Kconfig.rv32m1_lpspi"
source "drivers/spi/Kconfig.sam"
Expand Down
30 changes: 30 additions & 0 deletions drivers/spi/Kconfig.renesas_rz
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright (c) 2024 Renesas Electronics Corporation
# SPDX-License-Identifier: Apache-2.0

config SPI_RENESAS_RZ_RSPI
bool "Renesas RZ RSPI SPI"
default y
depends on DT_HAS_RENESAS_RZ_RSPI_SPI_ENABLED
select USE_RZ_FSP_RSPI_SPI
select PINCTRL
select USE_RZ_FSP_DMA if SPI_ASYNC
help
Enable Renesas RZ RSPI SPI Driver.

if SPI_RTIO
config SPI_RENESAS_RZ_RTIO_SQ_SIZE
int "Number of available submission queue entries"
default 8 # Sensible default that covers most common spi transactions
help
When RTIO is use with SPI each driver holds a context with which blocking
API calls use to perform SPI transactions. This queue needs to be as deep
as the longest set of spi_buf_sets used, where normal SPI operations are
used (equal length buffers). It may need to be slightly deeper where the
spi buffer sets for transmit/receive are not always matched equally in
length as these are transformed into normal transceives.

config SPI_RENESAS_RZ_RTIO_CQ_SIZE
int "Number of available completion queue entries"
default 8 # Sensible default that covers most common spi transactions

endif # SPI_RTIO
Loading
Loading