Skip to content

Commit 279699a

Browse files
committed
boards: arm: stm32 disco kit for XiP on external quadflash
Define the Device tree of the stm32l496g_disco board or stm32h750b disco kit to access the external NOR quad-flash in MemoryMapped mode for XiP Signed-off-by: Francois Ramu <[email protected]>
1 parent c57cff6 commit 279699a

File tree

3 files changed

+88
-23
lines changed

3 files changed

+88
-23
lines changed

boards/arm/stm32h747i_disco/stm32h747i_disco_m7.dts

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,16 @@
111111
#address-cells = <1>;
112112
#size-cells = <1>;
113113

114+
boot_partition: partition@0 {
115+
label = "mcuboot";
116+
reg = <0x00000000 DT_SIZE_K(64)>;
117+
};
118+
119+
slot0_partition: partition@10000 {
120+
label = "image-0";
121+
reg = <0x00010000 DT_SIZE_K(416)>;
122+
};
123+
114124
/* Set 2KB of storage at the end of first 1MB flash */
115125
storage_partition: partition@ff800 {
116126
label = "storage";
@@ -232,11 +242,10 @@ zephyr_udc0: &usbotg_hs {
232242
pinctrl-names = "default";
233243
status = "okay";
234244

235-
mt25ql512ab1: qspi-nor-flash-1@0 {
245+
mt25ql512ab1: qspi-nor-flash-1@90000000 {
236246
compatible = "st,stm32-qspi-nor";
237-
reg = <0>;
247+
reg = <0x90000000 DT_SIZE_M(64)>; /* 512 Mbits */
238248
qspi-max-frequency = <72000000>;
239-
size = <DT_SIZE_M(512)>; /* 64 MBytes */
240249
spi-bus-width = <4>;
241250
status = "okay";
242251

@@ -245,17 +254,18 @@ zephyr_udc0: &usbotg_hs {
245254
#address-cells = <1>;
246255
#size-cells = <1>;
247256

248-
partition@0 {
249-
reg = <0x0 DT_SIZE_M(64)>;
250-
};
257+
/* put image at offset 0 in slot1 */
258+
slot1_partition:partition@0 {
259+
label = "image-1";
260+
reg = <0x00000000 DT_SIZE_K(416)>;
261+
};
251262
};
252263
};
253264

254-
mt25ql512ab2: qspi-nor-flash-2@0 {
265+
mt25ql512ab2: qspi-nor-flash-2@90000000 {
255266
compatible = "st,stm32-qspi-nor";
256-
reg = <0>;
267+
reg = <0x90000000 DT_SIZE_M(64)>; /* 512 Mbits */
257268
qspi-max-frequency = <72000000>;
258-
size = <DT_SIZE_M(512)>; /* 64 MBytes */
259269
status = "okay";
260270
};
261271
};

boards/arm/stm32h750b_dk/stm32h750b_dk.dts

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
zephyr,shell-uart = &usart3;
1919
zephyr,sram = &sram0;
2020
zephyr,flash = &flash0;
21-
zephyr,flash-controller = &mt25ql512ab1;
2221
};
2322

2423
sdram2: sdram@d0000000 {
@@ -85,6 +84,30 @@
8584
d3ppre = <2>;
8685
};
8786

87+
&flash0 {
88+
partitions {
89+
compatible = "fixed-partitions";
90+
#address-cells = <1>;
91+
#size-cells = <1>;
92+
93+
boot_partition: partition@0 {
94+
label = "mcuboot";
95+
reg = <0x00000000 DT_SIZE_K(64)>;
96+
};
97+
98+
slot0_partition: partition@10000 {
99+
label = "image-0";
100+
reg = <0x00010000 DT_SIZE_K(416)>;
101+
};
102+
103+
/* Set 2KB of storage at the end of first 1MB flash */
104+
storage_partition: partition@ff800 {
105+
label = "storage";
106+
reg = <0x000ff800 DT_SIZE_K(2)>;
107+
};
108+
};
109+
};
110+
88111
&usart3 {
89112
pinctrl-0 = <&usart3_tx_pb10 &usart3_rx_pb11>;
90113
pinctrl-names = "default";
@@ -99,14 +122,12 @@
99122
&quadspi_bk1_io2_pf7 &quadspi_bk1_io3_pf6
100123
&quadspi_bk2_io0_ph2 &quadspi_bk2_io1_ph3
101124
&quadspi_bk2_io2_pg9 &quadspi_bk2_io3_pg14>;
102-
flash-id = <1>;
103125
status = "okay";
104126

105-
mt25ql512ab1: qspi-nor-flash-1@0 {
127+
mt25ql512ab1: qspi-nor-flash-1@90000000 {
106128
compatible = "st,stm32-qspi-nor";
107-
reg = <0>;
129+
reg = <0x90000000 DT_SIZE_M(64)>; /* 512 Mbits */
108130
qspi-max-frequency = <72000000>;
109-
size = <DT_SIZE_M(512)>; /* 64 MBytes */
110131
spi-bus-width = <4>;
111132
status = "okay";
112133

@@ -115,17 +136,18 @@
115136
#address-cells = <1>;
116137
#size-cells = <1>;
117138

118-
partition@0 {
119-
reg = <0x0 DT_SIZE_M(64)>;
120-
};
139+
/* put image at offset 0 in slot1 */
140+
slot1_partition:partition@0 {
141+
label = "image-1";
142+
reg = <0x00000000 DT_SIZE_K(416)>;
143+
};
121144
};
122145
};
123146

124-
mt25ql512ab2: qspi-nor-flash-2@1 {
147+
mt25ql512ab2: qspi-nor-flash-2@90000000 {
125148
compatible = "st,stm32-qspi-nor";
126-
reg = <1>;
149+
reg = <0x90000000 DT_SIZE_M(64)>; /* 512 Mbits */
127150
qspi-max-frequency = <72000000>;
128-
size = <DT_SIZE_M(512)>; /* 64 MBytes */
129151
status = "okay";
130152
};
131153
};

boards/arm/stm32l496g_disco/stm32l496g_disco.dts

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,28 @@
103103
apb2-prescaler = <1>;
104104
};
105105

106+
&flash0 {
107+
partitions {
108+
compatible = "fixed-partitions";
109+
#address-cells = <1>;
110+
#size-cells = <1>;
111+
112+
boot_partition: partition@0 {
113+
label = "mcuboot";
114+
reg = <0x00000000 DT_SIZE_K(64)>;
115+
};
116+
slot0_partition: partition@10000 {
117+
label = "image-0";
118+
reg = <0x00010000 DT_SIZE_K(416)>;
119+
};
120+
/* Set 2KB of storage at the end of first 1MB flash */
121+
storage_partition: partition@ff800 {
122+
label = "storage";
123+
reg = <0x000ff800 DT_SIZE_K(2)>;
124+
};
125+
};
126+
};
127+
106128
&usart1 {
107129
pinctrl-0 = <&usart1_tx_pb6 &usart1_rx_pg10>;
108130
pinctrl-names = "default";
@@ -201,13 +223,24 @@ zephyr_udc0: &usbotg_fs {
201223
flash-id = <1>;
202224
status = "okay";
203225

204-
mx25r6435: qspi-nor-flash@0 {
226+
mx25r6435: qspi-nor-flash@90000000 {
205227
compatible = "st,stm32-qspi-nor";
206-
reg = <0>;
228+
reg = <0x90000000 DT_SIZE_M(8)>;
207229
qspi-max-frequency = <8000000>;
208-
size = <DT_SIZE_M(64)>; /* 8 MBytes */
209230
status = "okay";
210231
spi-bus-width = <4>;
211232
writeoc = "PP_1_4_4";
233+
234+
partitions {
235+
compatible = "fixed-partitions";
236+
#address-cells = <1>;
237+
#size-cells = <1>;
238+
239+
/* put image at offset 0 in slot1 */
240+
slot1_partition:partition@0 {
241+
label = "image-1";
242+
reg = <0x00000000 DT_SIZE_K(416)>;
243+
};
244+
};
212245
};
213246
};

0 commit comments

Comments
 (0)