Skip to content
Merged
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/rcar_h3ulcb/doc/rcar_h3ulcb_a57.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ hardware features:
+-----------+------------------------------+--------------------------------+
| UART | uart | serial port-polling |
+-----------+------------------------------+--------------------------------+
| MMC | renesas_rcar_mmc | DMA and SCC |
+-----------+------------------------------+--------------------------------+

Other hardware features have not been enabled yet for this board.

Expand Down
44 changes: 44 additions & 0 deletions boards/renesas/rcar_h3ulcb/rcar_h3ulcb_r8a77951_a57-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,48 @@
scif2_data_a_rx_default: scif2_data_a_rx_default {
pin = <PIN_RX2_A FUNC_RX2_A>;
};

emmc2_clk: emmc2_clk {
pin = <PIN_SD2_CLK FUNC_SD2_CLK>;
};

emmc2_cmd: emmc2_cmd {
pin = <PIN_SD2_CMD FUNC_SD2_CMD>;
};

emmc2_data0: emmc2_data0 {
pin = <PIN_SD2_DATA0 FUNC_SD2_DAT0>;
};

emmc2_data1: emmc2_data1 {
pin = <PIN_SD2_DATA1 FUNC_SD2_DAT1>;
};

emmc2_data2: emmc2_data2 {
pin = <PIN_SD2_DATA2 FUNC_SD2_DAT2>;
};

emmc2_data3: emmc2_data3 {
pin = <PIN_SD2_DATA3 FUNC_SD2_DAT3>;
};

emmc2_data4: emmc2_data4 {
pin = <PIN_SD1_DATA0 FUNC_SD2_DAT4>;
};

emmc2_data5: emmc2_data5 {
pin = <PIN_SD1_DATA1 FUNC_SD2_DAT5>;
};

emmc2_data6: emmc2_data6 {
pin = <PIN_SD1_DATA2 FUNC_SD2_DAT6>;
};

emmc2_data7: emmc2_data7 {
pin = <PIN_SD1_DATA3 FUNC_SD2_DAT7>;
};

emmc2_ds: emmc2_ds {
pin = <PIN_SD2_DS FUNC_SD2_DS>;
};
};
23 changes: 23 additions & 0 deletions boards/renesas/rcar_h3ulcb/rcar_h3ulcb_r8a77951_a57.dts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,33 @@
device_type = "mmio-sram";
reg = <0x0 0x48000000 0x0 DT_SIZE_M(512)>;
};

/* These aliases are provided for compatibility with samples */
aliases {
sdhc0 = &emmc2;
};
};

&scif2 {
pinctrl-0 = <&scif2_data_a_tx_default &scif2_data_a_rx_default>;
pinctrl-names = "default";
status = "okay";
};

&emmc2 {
pinctrl-0 = <&emmc2_clk &emmc2_cmd &emmc2_ds
&emmc2_data0 &emmc2_data1 &emmc2_data2 &emmc2_data3
&emmc2_data4 &emmc2_data5 &emmc2_data6 &emmc2_data7>;
pinctrl-1 = <&emmc2_clk &emmc2_cmd &emmc2_ds
&emmc2_data0 &emmc2_data1 &emmc2_data2 &emmc2_data3
&emmc2_data4 &emmc2_data5 &emmc2_data6 &emmc2_data7>;
pinctrl-names = "default", "uhs";
disk {
compatible = "zephyr,mmc-disk";
status = "disabled";
};
bus-width = <8>;
mmc-hs200-1_8v;
mmc-hs400-1_8v;
non-removable;
};
2 changes: 2 additions & 0 deletions boards/renesas/rcar_salvator_xs/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ hardware features:
+-----------+------------------------------+--------------------------------+
| UART | uart | serial port-polling |
+-----------+------------------------------+--------------------------------+
| MMC | renesas_rcar_mmc | DMA and SCC |
+-----------+------------------------------+--------------------------------+

Other hardware features have not been enabled yet for this board.

Expand Down
44 changes: 44 additions & 0 deletions boards/renesas/rcar_salvator_xs/rcar_salvator_xs-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,48 @@
scif2_data_a_rx_default: scif2_data_a_rx_default {
pin = <PIN_RX2_A FUNC_RX2_A>;
};

emmc2_clk: emmc2_clk {
pin = <PIN_SD2_CLK FUNC_SD2_CLK>;
};

emmc2_cmd: emmc2_cmd {
pin = <PIN_SD2_CMD FUNC_SD2_CMD>;
};

emmc2_data0: emmc2_data0 {
pin = <PIN_SD2_DATA0 FUNC_SD2_DAT0>;
};

emmc2_data1: emmc2_data1 {
pin = <PIN_SD2_DATA1 FUNC_SD2_DAT1>;
};

emmc2_data2: emmc2_data2 {
pin = <PIN_SD2_DATA2 FUNC_SD2_DAT2>;
};

emmc2_data3: emmc2_data3 {
pin = <PIN_SD2_DATA3 FUNC_SD2_DAT3>;
};

emmc2_data4: emmc2_data4 {
pin = <PIN_SD1_DATA0 FUNC_SD2_DAT4>;
};

emmc2_data5: emmc2_data5 {
pin = <PIN_SD1_DATA1 FUNC_SD2_DAT5>;
};

emmc2_data6: emmc2_data6 {
pin = <PIN_SD1_DATA2 FUNC_SD2_DAT6>;
};

emmc2_data7: emmc2_data7 {
pin = <PIN_SD1_DATA3 FUNC_SD2_DAT7>;
};

emmc2_ds: emmc2_ds {
pin = <PIN_SD2_DS FUNC_SD2_DS>;
};
};
23 changes: 23 additions & 0 deletions boards/renesas/rcar_salvator_xs/rcar_salvator_xs.dts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
zephyr,shell-uart = &scif2;
};

/* These aliases are provided for compatibility with samples */
aliases {
sdhc0 = &emmc2;
};

ram: memory@48000000 {
device_type = "mmio-sram";
reg = <0x0 0x48000000 0x0 DT_SIZE_M(512)>;
Expand All @@ -30,3 +35,21 @@
pinctrl-names = "default";
status = "okay";
};

&emmc2 {
pinctrl-0 = <&emmc2_clk &emmc2_cmd &emmc2_ds
&emmc2_data0 &emmc2_data1 &emmc2_data2 &emmc2_data3
&emmc2_data4 &emmc2_data5 &emmc2_data6 &emmc2_data7>;
pinctrl-1 = <&emmc2_clk &emmc2_cmd &emmc2_ds
&emmc2_data0 &emmc2_data1 &emmc2_data2 &emmc2_data3
&emmc2_data4 &emmc2_data5 &emmc2_data6 &emmc2_data7>;
pinctrl-names = "default", "uhs";
disk {
compatible = "zephyr,mmc-disk";
status = "disabled";
};
bus-width = <8>;
mmc-hs200-1_8v;
mmc-hs400-1_8v;
non-removable;
};
1 change: 1 addition & 0 deletions drivers/sdhc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ zephyr_library()
zephyr_library_sources_ifdef(CONFIG_IMX_USDHC imx_usdhc.c)
zephyr_library_sources_ifdef(CONFIG_SPI_SDHC sdhc_spi.c)
zephyr_library_sources_ifdef(CONFIG_MCUX_SDIF mcux_sdif.c)
zephyr_library_sources_ifdef(CONFIG_RCAR_MMC rcar_mmc.c)
zephyr_library_sources_ifdef(CONFIG_SAM_HSMCI sam_hsmci.c)
zephyr_library_sources_ifdef(CONFIG_INTEL_EMMC_HOST intel_emmc_host.c)
zephyr_library_sources_ifdef(CONFIG_SDHC_INFINEON_CAT1 ifx_cat1_sdio.c)
Expand Down
1 change: 1 addition & 0 deletions drivers/sdhc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ source "drivers/sdhc/Kconfig.ifx_cat1"
source "drivers/sdhc/Kconfig.imx"
source "drivers/sdhc/Kconfig.spi"
source "drivers/sdhc/Kconfig.mcux_sdif"
source "drivers/sdhc/Kconfig.rcar"
source "drivers/sdhc/Kconfig.sam_hsmci"
source "drivers/sdhc/Kconfig.intel"
source "drivers/sdhc/Kconfig.sdhc_cdns"
Expand Down
42 changes: 42 additions & 0 deletions drivers/sdhc/Kconfig.rcar
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright (c) 2023 EPAM Systems
# SPDX-License-Identifier: Apache-2.0

config RCAR_MMC
bool "Renesas Rcar MMC driver"
default y
depends on DT_HAS_RENESAS_RCAR_MMC_ENABLED
select SDHC_SUPPORTS_NATIVE_MODE
select REGULATOR
select GPIO
select SDHC_SUPPORTS_UHS if SDMMC_STACK
help
Renesas Rcar MMC driver.

if RCAR_MMC

config RCAR_MMC_DMA_SUPPORT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config MMC_RCAR_DMA_SUPPORT

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like better to change MMC_RCAR to RCAR_MMC instead of touching this param

bool "Internal DMA support for Renesas Rcar MMC driver"
select CACHE_MANAGEMENT
select DCACHE
default y
help
Internal DMA support for Renesas Rcar MMC driver.

config RCAR_MMC_SCC_SUPPORT
bool "Support of SCC"
default y
help
Enable support of Sampling Clock Controller for Renesas Rcar MMC driver.
Comment on lines +17 to +29
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can it affect a particular instance of this driver? If so, use devicetree.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are checks in the driver code, if dts node contains some special modes. It extends the size of the driver data structure and the driver has static arrays if this feature is enabled. So, if we want to save as much memory as possible, or if we encounter troubles with this mode, but the device tree is saying that we support modes requiring the feature, it becomes really useful.

moreover, you can apply the same statement for DMA config (each device can have its own DMA controller, for example, or may not have it at all) for other SDHC drivers, but this isn't a way in which it works


if RCAR_MMC_DMA_SUPPORT

config SDHC_BUFFER_ALIGNMENT
default 128

config RCAR_MMC_DMA_IRQ_DRIVEN_SUPPORT
bool "Internal DMA IRQ driven support for Renesas Rcar MMC driver"
default y

endif # RCAR_MMC_DMA_SUPPORT

endif # RCAR_MMC
Loading