Skip to content

Commit 09dde38

Browse files
committed
boards: renesas: Add flash support for RZ/A3UL, N2L, T2M
Add flash support for RZ/A3UL, N2L, T2M Signed-off-by: Tien Nguyen <[email protected]>
1 parent ec6bf37 commit 09dde38

File tree

7 files changed

+101
-26
lines changed

7 files changed

+101
-26
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2025 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config FLASH_LOAD_OFFSET
5+
default $(dt_nodelabel_reg_addr_hex,header)

boards/renesas/rza3ul_smarc/rza3ul_smarc.dts

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
chosen {
2020
zephyr,sram = &ddr;
21-
zephyr,flash = &spi_flash;
21+
zephyr,flash = &at25ql128a;
2222
zephyr,console = &scif0;
2323
zephyr,shell-uart = &scif0;
2424
zephyr,code-partition = &slot0_partition;
@@ -40,28 +40,6 @@
4040
zephyr,memory-region = "SRAM";
4141
};
4242

43-
spi_flash: memory@20020000 {
44-
compatible = "mmio-sram";
45-
reg = <0x20020000 (DT_SIZE_M(16) - 0x20000)>;
46-
47-
partitions {
48-
compatible = "fixed-partitions";
49-
#address-cells = <1>;
50-
#size-cells = <1>;
51-
52-
header: partition@0 {
53-
label = "header";
54-
reg = <0x00000000 0x200>;
55-
read-only;
56-
};
57-
58-
slot0_partition: partition@200 {
59-
label = "image-0";
60-
reg = <0x00000200 (DT_SIZE_M(16) - 0x20200)>;
61-
read-only;
62-
};
63-
};
64-
};
6543
};
6644

6745
&scif0 {
@@ -84,3 +62,38 @@
8462
&wdt0 {
8563
status = "okay";
8664
};
65+
66+
&spibsc {
67+
status = "okay";
68+
69+
at25ql128a: qspi-nor-flash@20000000 {
70+
compatible = "renesas,rz-qspi-spibsc";
71+
reg = <0x20000000 DT_SIZE_M(16)>; /* 128 Mbits */
72+
write-block-size = <1>;
73+
erase-block-size = <4096>;
74+
status = "okay";
75+
76+
partitions {
77+
compatible = "fixed-partitions";
78+
#address-cells = <1>;
79+
#size-cells = <1>;
80+
81+
reserved: partition@0 {
82+
reg = <0x00000000 0x20000>;
83+
read-only;
84+
};
85+
86+
header: partition@20000 {
87+
label = "header";
88+
reg = <0x00020000 0x200>;
89+
read-only;
90+
};
91+
92+
slot0_partition: partition@20200 {
93+
label = "image-0";
94+
reg = <0x00020200 (DT_SIZE_M(16) - 0x20200)>;
95+
read-only;
96+
};
97+
};
98+
};
99+
};

boards/renesas/rzn2l_rsk/rzn2l_rsk-pinctrl.dtsi

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,18 @@
4848
<RZN_PINMUX(PORT_05, 3, 9)>; /* SDA */
4949
};
5050
};
51+
52+
/omit-if-no-ref/ xspi0_default: xspi0_default {
53+
xspi0-pinmux {
54+
pinmux = <RZN_PINMUX(PORT_14, 6, 0)>, /* XSPI0_CKP */
55+
<RZN_PINMUX(PORT_14, 5, 0)>, /* XSPI0_CKN */
56+
<RZN_PINMUX(PORT_15, 7, 0)>, /* XSPI0_CS0 */
57+
<RZN_PINMUX(PORT_14, 7, 0)>, /* XSPI0_IO0 */
58+
<RZN_PINMUX(PORT_15, 0, 0)>, /* XSPI0_IO1 */
59+
<RZN_PINMUX(PORT_15, 1, 0)>, /* XSPI0_IO2 */
60+
<RZN_PINMUX(PORT_15, 2, 0)>, /* XSPI0_IO3 */
61+
<RZN_PINMUX(PORT_16, 1, 0)>, /* XSPI0_RESET0 */
62+
<RZN_PINMUX(PORT_16, 3, 1)>; /* XSPI0_RSTO0 */
63+
};
64+
};
5165
};

boards/renesas/rzn2l_rsk/rzn2l_rsk.dts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
chosen {
1616
zephyr,sram = &atcm;
17-
zephyr,flash = &xspi0_cs0;
17+
zephyr,flash = &mx25u51245g;
1818
zephyr,code-partition = &slot0_partition;
1919
zephyr,console = &uart0;
2020
zephyr,shell-uart = &uart0;
@@ -128,3 +128,17 @@
128128
&wdt0 {
129129
status = "okay";
130130
};
131+
132+
&xspi0 {
133+
pinctrl-0 = <&xspi0_default>;
134+
pinctrl-names = "default";
135+
status = "okay";
136+
137+
mx25u51245g: qspi-nor-flash@60000000 {
138+
compatible = "renesas,rz-qspi-xspi";
139+
reg = <0x60000000 DT_SIZE_M(64)>; /* 512 Mbits */
140+
write-block-size = <1>;
141+
erase-block-size = <4096>;
142+
status = "okay";
143+
};
144+
};

boards/renesas/rzt2m_rsk/rzt2m_rsk-pinctrl.dtsi

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,19 @@
4040
<RZT_PINMUX(PORT_22, 7, 2)>; /* SDA */
4141
};
4242
};
43+
44+
/omit-if-no-ref/ xspi0_default: xspi0_default {
45+
xspi0-pinmux {
46+
pinmux = <RZT_PINMUX(PORT_14, 6, 0)>, /* XSPI0_CKP */
47+
<RZT_PINMUX(PORT_14, 5, 0)>, /* XSPI0_CKN */
48+
<RZT_PINMUX(PORT_15, 7, 0)>, /* XSPI0_CS0 */
49+
<RZT_PINMUX(PORT_14, 7, 0)>, /* XSPI0_IO0 */
50+
<RZT_PINMUX(PORT_15, 0, 0)>, /* XSPI0_IO1 */
51+
<RZT_PINMUX(PORT_15, 1, 0)>, /* XSPI0_IO2 */
52+
<RZT_PINMUX(PORT_15, 2, 0)>, /* XSPI0_IO3 */
53+
<RZT_PINMUX(PORT_16, 1, 0)>, /* XSPI0_RESET0 */
54+
<RZT_PINMUX(PORT_16, 3, 1)>; /* XSPI0_RSTO0 */
55+
};
56+
};
57+
4358
};

boards/renesas/rzt2m_rsk/rzt2m_rsk_r9a07g075m24gbg_cr520.dts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
chosen {
1818
zephyr,sram = &cpu0_atcm;
19-
zephyr,flash = &xspi0_cs0;
19+
zephyr,flash = &mx25u51245g;
2020
zephyr,code-partition = &slot0_partition;
2121
zephyr,console = &uart0;
2222
zephyr,shell-uart = &uart0;
@@ -125,3 +125,17 @@
125125
&wdt0 {
126126
status = "okay";
127127
};
128+
129+
&xspi0 {
130+
pinctrl-0 = <&xspi0_default>;
131+
pinctrl-names = "default";
132+
status = "okay";
133+
134+
mx25u51245g: qspi-nor-flash@60000000 {
135+
compatible = "renesas,rz-qspi-xspi";
136+
reg = <0x60000000 DT_SIZE_M(64)>; /* 512 Mbits */
137+
write-block-size = <1>;
138+
erase-block-size = <4096>;
139+
status = "okay";
140+
};
141+
};

soc/renesas/rz/rza3ul/sections.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
SECTION_PROLOGUE(.header, CONFIG_FLASH_BASE_ADDRESS,)
7+
SECTION_PROLOGUE(.header, CONFIG_FLASH_BASE_ADDRESS + CONFIG_FLASH_LOAD_OFFSET,)
88
{
99
QUAD(__start)
1010
QUAD(0xFFFFFFFFFFFFFFFF-__start)

0 commit comments

Comments
 (0)