Skip to content

Commit 6384096

Browse files
gautierg-stcarlescufi
authored andcommitted
boards: st: stm32n6: add xspi ext flash
Enable XSPI external Flash for STM32N6570-DK and Nucleo N657X0 boards. Signed-off-by: Guillaume Gautier <[email protected]>
1 parent feb4c83 commit 6384096

File tree

4 files changed

+87
-1
lines changed

4 files changed

+87
-1
lines changed

boards/st/nucleo_n657x0_q/doc/index.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,17 @@ Default Zephyr Peripheral Mapping:
9191
- USART_1_RX : PE6
9292
- USART_3_TX : PD8
9393
- USART_3_RX : PD9
94+
- XSPI2_NCS1 : PN1
95+
- XSPI2_DQS0 : PN0
96+
- XSPI2_CLK : PN6
97+
- XSPI2_IO0 : PN2
98+
- XSPI2_IO1 : PN3
99+
- XSPI2_IO2 : PN4
100+
- XSPI2_IO3 : PN5
101+
- XSPI2_IO4 : PN8
102+
- XSPI2_IO5 : PN9
103+
- XSPI2_IO6 : PN10
104+
- XSPI2_IO7 : PN11
94105

95106
System Clock
96107
------------

boards/st/nucleo_n657x0_q/nucleo_n657x0_q_common.dtsi

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

77
#include <st/n6/stm32n657X0.dtsi>
88
#include <st/n6/stm32n657x0hxq-pinctrl.dtsi>
9+
#include <zephyr/dt-bindings/flash_controller/xspi.h>
910
#include <zephyr/dt-bindings/input/input-event-codes.h>
1011
#include "arduino_r3_connector.dtsi"
1112

@@ -15,6 +16,7 @@
1516
zephyr,shell-uart = &usart1;
1617
zephyr,sram = &axisram2;
1718
zephyr,canbus = &fdcan1;
19+
spi-flash0 = &mx25um51245g;
1820
};
1921

2022
leds: leds {
@@ -199,3 +201,33 @@
199201
status = "okay";
200202
};
201203
};
204+
205+
&xspi2 {
206+
pinctrl-0 = <&xspim_p2_ncs1_pn1 &xspim_p2_dqs0_pn0 &xspim_p2_clk_pn6
207+
&xspim_p2_io0_pn2 &xspim_p2_io1_pn3 &xspim_p2_io2_pn4
208+
&xspim_p2_io3_pn5 &xspim_p2_io4_pn8 &xspim_p2_io5_pn9
209+
&xspim_p2_io6_pn10 &xspim_p2_io7_pn11>;
210+
pinctrl-names = "default";
211+
status = "okay";
212+
213+
mx25um51245g: ospi-nor-flash@70000000 {
214+
compatible = "st,stm32-xspi-nor";
215+
reg = <0x70000000 DT_SIZE_M(64)>; /* 512 Mbits */
216+
ospi-max-frequency = <DT_FREQ_M(200)>;
217+
spi-bus-width = <XSPI_OCTO_MODE>;
218+
data-rate = <XSPI_DTR_TRANSFER>;
219+
four-byte-opcodes;
220+
status = "okay";
221+
222+
partitions {
223+
compatible = "fixed-partitions";
224+
#address-cells = <1>;
225+
#size-cells = <1>;
226+
227+
storage_partition: partition@3ff0000 {
228+
label = "storage";
229+
reg = <0x3ff0000 DT_SIZE_K(64)>;
230+
};
231+
};
232+
};
233+
};

boards/st/stm32n6570_dk/doc/index.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,17 @@ Default Zephyr Peripheral Mapping:
9595
- USART_1_RX : PE6
9696
- USART_2_TX : PD5
9797
- USART_2_RX : PF6
98+
- XSPI2_NCS1 : PN1
99+
- XSPI2_DQS0 : PN0
100+
- XSPI2_CLK : PN6
101+
- XSPI2_IO0 : PN2
102+
- XSPI2_IO1 : PN3
103+
- XSPI2_IO2 : PN4
104+
- XSPI2_IO3 : PN5
105+
- XSPI2_IO4 : PN8
106+
- XSPI2_IO5 : PN9
107+
- XSPI2_IO6 : PN10
108+
- XSPI2_IO7 : PN11
98109

99110
System Clock
100111
------------

boards/st/stm32n6570_dk/stm32n6570_dk_common.dtsi

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@
66

77
#include <st/n6/stm32n657X0.dtsi>
88
#include <st/n6/stm32n657x0hxq-pinctrl.dtsi>
9-
#include "arduino_r3_connector.dtsi"
9+
#include <zephyr/dt-bindings/flash_controller/xspi.h>
1010
#include <zephyr/dt-bindings/input/input-event-codes.h>
11+
#include "arduino_r3_connector.dtsi"
1112

1213
/ {
1314
chosen {
1415
zephyr,console = &usart1;
1516
zephyr,shell-uart = &usart1;
1617
zephyr,sram = &axisram2;
1718
zephyr,canbus = &fdcan1;
19+
spi-flash0 = &mx66uw1g45g;
1820
};
1921

2022
aliases {
@@ -156,3 +158,33 @@
156158
current-speed = <115200>;
157159
status = "okay";
158160
};
161+
162+
&xspi2 {
163+
pinctrl-0 = <&xspim_p2_ncs1_pn1 &xspim_p2_dqs0_pn0 &xspim_p2_clk_pn6
164+
&xspim_p2_io0_pn2 &xspim_p2_io1_pn3 &xspim_p2_io2_pn4
165+
&xspim_p2_io3_pn5 &xspim_p2_io4_pn8 &xspim_p2_io5_pn9
166+
&xspim_p2_io6_pn10 &xspim_p2_io7_pn11>;
167+
pinctrl-names = "default";
168+
status = "okay";
169+
170+
mx66uw1g45g: ospi-nor-flash@70000000 {
171+
compatible = "st,stm32-xspi-nor";
172+
reg = <0x70000000 DT_SIZE_M(128)>; /* 1 Gbits */
173+
ospi-max-frequency = <DT_FREQ_M(200)>;
174+
spi-bus-width = <XSPI_OCTO_MODE>;
175+
data-rate = <XSPI_DTR_TRANSFER>;
176+
four-byte-opcodes;
177+
status = "okay";
178+
179+
partitions {
180+
compatible = "fixed-partitions";
181+
#address-cells = <1>;
182+
#size-cells = <1>;
183+
184+
storage_partition: partition@7ff0000 {
185+
label = "storage";
186+
reg = <0x7ff0000 DT_SIZE_K(64)>;
187+
};
188+
};
189+
};
190+
};

0 commit comments

Comments
 (0)