Skip to content

Commit c442fa1

Browse files
quytranpzzkartben
authored andcommitted
boards: renesas: Add boards support for OSPI flash driver on RA8
Add support for OSPI flash driver on EK-RA8D1 and EK-RA8M1 Signed-off-by: Quy Tran <[email protected]>
1 parent 94d5341 commit c442fa1

File tree

4 files changed

+167
-0
lines changed

4 files changed

+167
-0
lines changed

boards/renesas/ek_ra8d1/ek_ra8d1-pinctrl.dtsi

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,4 +270,23 @@
270270
psels = <RA_PSEL(RA_PSEL_ACMPHS_VCOUT, 2, 8)>;
271271
};
272272
};
273+
274+
ospi0_default: ospi0_default {
275+
group1 {
276+
/* sclk dqs sio0-7 */
277+
psels = <RA_PSEL(RA_PSEL_OSPI, 8, 8)>, <RA_PSEL(RA_PSEL_OSPI, 8, 1)>,
278+
<RA_PSEL(RA_PSEL_OSPI, 1, 0)>, <RA_PSEL(RA_PSEL_OSPI, 8, 3)>,
279+
<RA_PSEL(RA_PSEL_OSPI, 1, 3)>, <RA_PSEL(RA_PSEL_OSPI, 1, 1)>,
280+
<RA_PSEL(RA_PSEL_OSPI, 1, 2)>, <RA_PSEL(RA_PSEL_OSPI, 8, 0)>,
281+
<RA_PSEL(RA_PSEL_OSPI, 8, 2)>, <RA_PSEL(RA_PSEL_OSPI, 8, 4)>;
282+
drive-strength = "highspeed-high";
283+
};
284+
285+
group2 {
286+
/* cs1 rst ecsint1 */
287+
psels = <RA_PSEL(RA_PSEL_OSPI, 1, 4)>, <RA_PSEL(RA_PSEL_OSPI, 1, 6)>,
288+
<RA_PSEL(RA_PSEL_OSPI, 1, 5)>;
289+
drive-strength = "high";
290+
};
291+
};
273292
};

boards/renesas/ek_ra8d1/ek_ra8d1.dts

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
/dts-v1/;
77

88
#include <renesas/ra/ra8/r7fa8d1bhecbd.dtsi>
9+
#include <zephyr/dt-bindings/flash_controller/xspi.h>
910
#include <dt-bindings/gpio/gpio.h>
1011
#include <dt-bindings/input/input-event-codes.h>
1112
#include <zephyr/dt-bindings/memory-attr/memory-attr-arm.h>
@@ -114,6 +115,19 @@
114115
};
115116
};
116117

118+
&pll2 {
119+
status = "okay";
120+
clocks = <&xtal>;
121+
div = <2>;
122+
mul = <80 0>;
123+
124+
pll2p {
125+
status = "okay";
126+
freq = <DT_FREQ_M(400)>;
127+
div = <2>;
128+
};
129+
};
130+
117131
&sciclk {
118132
clocks = <&pllp>;
119133
div = <4>;
@@ -132,6 +146,12 @@
132146
status = "okay";
133147
};
134148

149+
&octaspiclk {
150+
clocks = <&pll2p>;
151+
div = <2>;
152+
status = "okay";
153+
};
154+
135155
&uclk {
136156
clocks = <&pllq>;
137157
div = <5>;
@@ -342,3 +362,48 @@ pmod_sd_shield: &sdhc1 {};
342362
status = "okay";
343363
};
344364
};
365+
366+
&ospi0 {
367+
pinctrl-0 = <&ospi0_default>;
368+
pinctrl-names = "default";
369+
status = "okay";
370+
371+
s28hl512t: ospi-nor-flash@90000000 {
372+
compatible = "renesas,ra-ospi-b-nor";
373+
protocol-mode = <XSPI_OCTO_MODE>;
374+
data-rate = <XSPI_DTR_TRANSFER>;
375+
ospi-max-frequency = <DT_FREQ_M(200)>;
376+
reg = <0x90000000 DT_SIZE_M(64)>;
377+
write-block-size = <1>;
378+
status = "okay";
379+
380+
pages_layout: pages_layout {
381+
382+
pages_layout_4k: pages_layout_4k {
383+
pages-count = <32>;
384+
pages-size = <DT_SIZE_K(4)>;
385+
};
386+
387+
pages_layout_128k: pages_layout_128k {
388+
pages-count = <1>;
389+
pages-size = <DT_SIZE_K(128)>;
390+
};
391+
392+
pages_layout_256k: pages_layout_256k {
393+
pages-count = <255>;
394+
pages-size = <DT_SIZE_K(256)>;
395+
};
396+
};
397+
398+
partitions {
399+
compatible = "fixed-partitions";
400+
#address-cells = <1>;
401+
#size-cells = <1>;
402+
403+
partition@0 {
404+
label = "nor";
405+
reg = <0x00000000 DT_SIZE_M(64)>;
406+
};
407+
};
408+
};
409+
};

boards/renesas/ek_ra8m1/ek_ra8m1-pinctrl.dtsi

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,4 +212,23 @@
212212
psels = <RA_PSEL(RA_PSEL_ACMPHS_VCOUT, 2, 8)>;
213213
};
214214
};
215+
216+
ospi0_default: ospi0_default {
217+
group1 {
218+
/* sclk dqs sio0-7 */
219+
psels = <RA_PSEL(RA_PSEL_OSPI, 8, 8)>, <RA_PSEL(RA_PSEL_OSPI, 8, 1)>,
220+
<RA_PSEL(RA_PSEL_OSPI, 1, 0)>, <RA_PSEL(RA_PSEL_OSPI, 8, 3)>,
221+
<RA_PSEL(RA_PSEL_OSPI, 1, 3)>, <RA_PSEL(RA_PSEL_OSPI, 1, 1)>,
222+
<RA_PSEL(RA_PSEL_OSPI, 1, 2)>, <RA_PSEL(RA_PSEL_OSPI, 8, 0)>,
223+
<RA_PSEL(RA_PSEL_OSPI, 8, 2)>, <RA_PSEL(RA_PSEL_OSPI, 8, 4)>;
224+
drive-strength = "highspeed-high";
225+
};
226+
227+
group2 {
228+
/* cs1 rst ecsint1 */
229+
psels = <RA_PSEL(RA_PSEL_OSPI, 1, 4)>, <RA_PSEL(RA_PSEL_OSPI, 1, 6)>,
230+
<RA_PSEL(RA_PSEL_OSPI, 1, 5)>;
231+
drive-strength = "high";
232+
};
233+
};
215234
};

boards/renesas/ek_ra8m1/ek_ra8m1.dts

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <renesas/ra/ra8/r7fa8m1ahecbd.dtsi>
99
#include <dt-bindings/gpio/gpio.h>
10+
#include <zephyr/dt-bindings/flash_controller/xspi.h>
1011
#include <zephyr/dt-bindings/adc/adc.h>
1112
#include <zephyr/dt-bindings/input/input-event-codes.h>
1213
#include "ek_ra8m1-pinctrl.dtsi"
@@ -151,6 +152,18 @@
151152
};
152153
};
153154

155+
&pll2 {
156+
status = "okay";
157+
clocks = <&xtal>;
158+
div = <2>;
159+
mul = <80 0>;
160+
161+
pll2p {
162+
status = "okay";
163+
freq = <DT_FREQ_M(400)>;
164+
div = <2>;
165+
};
166+
};
154167

155168
&sciclk {
156169
clocks = <&pllp>;
@@ -170,6 +183,12 @@
170183
status = "okay";
171184
};
172185

186+
&octaspiclk {
187+
clocks = <&pll2p>;
188+
div = <2>;
189+
status = "okay";
190+
};
191+
173192
&ioport0 {
174193
status = "okay";
175194
};
@@ -401,3 +420,48 @@ pmod_sd_shield: &sdhc0 {};
401420
status = "okay";
402421
};
403422
};
423+
424+
&ospi0 {
425+
pinctrl-0 = <&ospi0_default>;
426+
pinctrl-names = "default";
427+
status = "okay";
428+
429+
s28hl512t: ospi-nor-flash@90000000 {
430+
compatible = "renesas,ra-ospi-b-nor";
431+
protocol-mode = <XSPI_OCTO_MODE>;
432+
data-rate = <XSPI_DTR_TRANSFER>;
433+
ospi-max-frequency = <DT_FREQ_M(200)>;
434+
reg = <0x90000000 DT_SIZE_M(64)>;
435+
write-block-size = <1>;
436+
status = "okay";
437+
438+
pages_layout: pages_layout {
439+
440+
pages_layout_4k: pages_layout_4k {
441+
pages-count = <32>;
442+
pages-size = <DT_SIZE_K(4)>;
443+
};
444+
445+
pages_layout_128k: pages_layout_128k {
446+
pages-count = <1>;
447+
pages-size = <DT_SIZE_K(128)>;
448+
};
449+
450+
pages_layout_256k: pages_layout_256k {
451+
pages-count = <255>;
452+
pages-size = <DT_SIZE_K(256)>;
453+
};
454+
};
455+
456+
partitions {
457+
compatible = "fixed-partitions";
458+
#address-cells = <1>;
459+
#size-cells = <1>;
460+
461+
partition@0 {
462+
label = "nor";
463+
reg = <0x00000000 DT_SIZE_M(64)>;
464+
};
465+
};
466+
};
467+
};

0 commit comments

Comments
 (0)