Skip to content

Commit

Permalink
drivers: flash: Initial support QSPI Flash driver for Renesas RA6
Browse files Browse the repository at this point in the history
Add support for QSPI Flash driver running on Renesas EK_RA6M5,
EK_RA6M4, EK_RA6M3 and EK_RA6E2.

Signed-off-by: Tri Nguyen <tri.nguyen.wj@bp.renesas.com>
Signed-off-by: Thao Luong <thao.luong.uw@renesas.com>
  • Loading branch information
Tri Nguyen authored and thaoluonguw committed Oct 11, 2024
1 parent 9472f84 commit 90297b6
Show file tree
Hide file tree
Showing 26 changed files with 793 additions and 4 deletions.
2 changes: 2 additions & 0 deletions boards/renesas/ek_ra6e2/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ The below features are currently supported on Zephyr OS for EK-RA6E2 board:
+-----------+------------+----------------------+
| CLOCK | on-chip | clock control |
+-----------+------------+----------------------+
| QSPI | on-chip | qspi flash |
+-----------+------------+----------------------+

Other hardware features are currently not supported by the port.

Expand Down
12 changes: 12 additions & 0 deletions boards/renesas/ek_ra6e2/ek_ra6e2-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,16 @@
<RA_PSEL(RA_PSEL_SCI_0, 4, 10)>;
};
};

qspi_default: qspi_default {
group1 {
/* QSPICLK QSSL QIO0 QIO1 QIO2 QIO3 */
psels = <RA_PSEL(RA_PSEL_QSPI, 1, 0)>,
<RA_PSEL(RA_PSEL_QSPI, 1, 12)>,
<RA_PSEL(RA_PSEL_QSPI, 1, 2)>,
<RA_PSEL(RA_PSEL_QSPI, 1, 1)>,
<RA_PSEL(RA_PSEL_QSPI, 1, 4)>,
<RA_PSEL(RA_PSEL_QSPI, 1, 3)>;
};
};
};
14 changes: 14 additions & 0 deletions boards/renesas/ek_ra6e2/ek_ra6e2.dts
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,17 @@
mul = <10 0>;
status = "okay";
};

&qspi0 {
pinctrl-0 = <&qspi_default>;
pinctrl-names = "default";
status = "okay";
at25sf128a: ra-qspi-nor@60000000 {
compatible = "renesas,ra-qspi-nor";
reg = <0x60000000 DT_SIZE_M(16)>;
size = <DT_SIZE_M(16)>;
status = "okay";
write-block-size = <1>;
erase-block-size = <4096>;
};
};
2 changes: 2 additions & 0 deletions boards/renesas/ek_ra6m3/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ The below features are currently supported on Zephyr OS for EK-RA6M3 board:
+-----------+------------+----------------------+
| CLOCK | on-chip | clock control |
+-----------+------------+----------------------+
| QSPI | on-chip | qspi flash |
+-----------+------------+----------------------+

Other hardware features are currently not supported by the port.

Expand Down
12 changes: 12 additions & 0 deletions boards/renesas/ek_ra6m3/ek_ra6m3-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,16 @@
<RA_PSEL(RA_PSEL_SCI_8, 1, 4)>;
};
};

qspi_default: qspi_default {
group1 {
/* QSPICLK QSSL QIO0 QIO1 QIO2 QIO3 */
psels = <RA_PSEL(RA_PSEL_QSPI, 3, 5)>,
<RA_PSEL(RA_PSEL_QSPI, 3, 6)>,
<RA_PSEL(RA_PSEL_QSPI, 3, 7)>,
<RA_PSEL(RA_PSEL_QSPI, 3, 8)>,
<RA_PSEL(RA_PSEL_QSPI, 3, 9)>,
<RA_PSEL(RA_PSEL_QSPI, 3, 10)>;
};
};
};
14 changes: 14 additions & 0 deletions boards/renesas/ek_ra6m3/ek_ra6m3.dts
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,17 @@
mul = <20 0>;
status = "okay";
};

&qspi0 {
pinctrl-0 = <&qspi_default>;
pinctrl-names = "default";
status = "okay";
mx25l25645g: ra-qspi-nor@60000000 {
compatible = "renesas,ra-qspi-nor";
reg = <0x60000000 DT_SIZE_M(32)>;
size = <DT_SIZE_M(32)>;
status = "okay";
write-block-size = <1>;
erase-block-size = <4096>;
};
};
2 changes: 2 additions & 0 deletions boards/renesas/ek_ra6m4/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ The below features are currently supported on Zephyr OS for EK-RA6M4 board:
+-----------+------------+----------------------+
| CLOCK | on-chip | clock control |
+-----------+------------+----------------------+
| QSPI | on-chip | qspi flash |
+-----------+------------+----------------------+

Other hardware features are currently not supported by the port.

Expand Down
12 changes: 12 additions & 0 deletions boards/renesas/ek_ra6m4/ek_ra6m4-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,16 @@
<RA_PSEL(RA_PSEL_SCI_0, 4, 10)>;
};
};

qspi_default: qspi_default {
group1 {
/* QSPICLK QSSL QIO0 QIO1 QIO2 QIO3 */
psels = <RA_PSEL(RA_PSEL_QSPI, 3, 5)>,
<RA_PSEL(RA_PSEL_QSPI, 3, 6)>,
<RA_PSEL(RA_PSEL_QSPI, 3, 7)>,
<RA_PSEL(RA_PSEL_QSPI, 3, 8)>,
<RA_PSEL(RA_PSEL_QSPI, 3, 9)>,
<RA_PSEL(RA_PSEL_QSPI, 3, 10)>;
};
};
};
14 changes: 14 additions & 0 deletions boards/renesas/ek_ra6m4/ek_ra6m4.dts
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,17 @@
div = <2>;
status = "okay";
};

&qspi0 {
pinctrl-0 = <&qspi_default>;
pinctrl-names = "default";
status = "okay";
mx25l25645g: ra-qspi-nor@60000000 {
compatible = "renesas,ra-qspi-nor";
reg = <0x60000000 DT_SIZE_M(32)>;
size = <DT_SIZE_M(32)>;
status = "okay";
write-block-size = <1>;
erase-block-size = <4096>;
};
};
2 changes: 2 additions & 0 deletions boards/renesas/ek_ra6m5/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ The below features are currently supported on Zephyr OS for EK-RA6M5 board:
+-----------+------------+----------------------+
| CLOCK | on-chip | clock control |
+-----------+------------+----------------------+
| QSPI | on-chip | qspi flash |
+-----------+------------+----------------------+

Other hardware features are currently not supported by the port.

Expand Down
12 changes: 12 additions & 0 deletions boards/renesas/ek_ra6m5/ek_ra6m5-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,16 @@
<RA_PSEL(RA_PSEL_SCI_0, 4, 10)>;
};
};

qspi_default: qspi_default {
group1 {
/* QSPICLK QSSL QIO0 QIO1 QIO2 QIO3 */
psels = <RA_PSEL(RA_PSEL_QSPI, 3, 5)>,
<RA_PSEL(RA_PSEL_QSPI, 3, 6)>,
<RA_PSEL(RA_PSEL_QSPI, 3, 7)>,
<RA_PSEL(RA_PSEL_QSPI, 3, 8)>,
<RA_PSEL(RA_PSEL_QSPI, 3, 9)>,
<RA_PSEL(RA_PSEL_QSPI, 3, 10)>;
};
};
};
14 changes: 14 additions & 0 deletions boards/renesas/ek_ra6m5/ek_ra6m5.dts
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,17 @@
mul = <25 0>;
status = "okay";
};

&qspi0 {
pinctrl-0 = <&qspi_default>;
pinctrl-names = "default";
status = "okay";
mx25l25645g: ra-qspi-nor@60000000 {
compatible = "renesas,ra-qspi-nor";
reg = <0x60000000 DT_SIZE_M(32)>;
size = <DT_SIZE_M(32)>;
status = "okay";
write-block-size = <1>;
erase-block-size = <4096>;
};
};
1 change: 1 addition & 0 deletions drivers/flash/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ zephyr_library_include_directories_ifdef(
${ZEPHYR_BASE}/drivers/memc
)

zephyr_library_sources_ifdef(CONFIG_FLASH_QSPI_RENESAS_RA flash_qspi_renesas_ra.c)
if(CONFIG_RA_FLASH_HP)
zephyr_library_sources(flash_hp_ra.c)
zephyr_library_sources_ifdef(CONFIG_FLASH_EX_OP_ENABLED flash_hp_ra_ex_op.c)
Expand Down
2 changes: 2 additions & 0 deletions drivers/flash/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ source "drivers/flash/Kconfig.stm32_xspi"
source "drivers/flash/Kconfig.xmc4xxx"
# zephyr-keep-sorted-stop

source "drivers/flash/Kconfig.renesas_ra_flash_qspi"

module = FLASH
module-str = flash
source "subsys/logging/Kconfig.template.log_config"
Expand Down
17 changes: 17 additions & 0 deletions drivers/flash/Kconfig.renesas_ra_flash_qspi
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Renesas RA Family

# Copyright (c) 2024 Renesas Electronics Corporation
# SPDX-License-Identifier: Apache-2.0

config FLASH_QSPI_RENESAS_RA
bool "RA Quad-SPI driver"
default y
depends on DT_HAS_RENESAS_RA_QSPI_NOR_ENABLED
select FLASH_HAS_DRIVER_ENABLED
select FLASH_HAS_PAGE_LAYOUT
select FLASH_HAS_EXPLICIT_ERASE
select USE_RA_FSP_QSPI_NOR_FLASH
select FLASH_HAS_EX_OP
select FLASH_JESD216
help
Enable Quad-SPI Nor flash driver for RA series
Loading

0 comments on commit 90297b6

Please sign in to comment.