Skip to content

Commit 68d0aae

Browse files
rahul-arasikerefabiobaltieri
authored andcommitted
boards: arduino: portenta_h7: Add support for external QSPI Flash.
Enabled the QuadSPI node and necessary pin muxing to enable interfacing with the external flash chip on the Portenta H7 board. The jedec data was validated with the samples/drivers/jesd216 project to extract the JEDEC data. Additionally added `flash` to the list of ignored tags as the flash driver should not be built on the M4 CPU domain. Signed-off-by: Rahul Arasikere <[email protected]>
1 parent e98b058 commit 68d0aae

File tree

3 files changed

+65
-18
lines changed

3 files changed

+65
-18
lines changed

boards/arduino/portenta_h7/arduino_portenta_h7-common.dtsi

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
#include <mem.h>
8+
79
/ {
810
leds {
911
compatible = "gpio-leds";
@@ -166,3 +168,43 @@ zephyr_udc0: &usbotg_fs {
166168
};
167169
};
168170
};
171+
172+
&quadspi {
173+
pinctrl-0 = < &quadspi_bk1_io0_pd11
174+
&quadspi_bk1_io1_pd12
175+
&quadspi_bk1_io2_pf7
176+
&quadspi_bk1_io3_pd13
177+
&quadspi_bk1_ncs_pg6
178+
&quadspi_clk_pf10 >;
179+
pinctrl-names = "default";
180+
status = "okay";
181+
182+
mx25l12833f: qspi-nor-flash@90000000 {
183+
compatible = "st,stm32-qspi-nor";
184+
reg = < 0x90000000 DT_SIZE_M(16) >; /* 128 MBits */
185+
qspi-max-frequency = < 40000000 >;
186+
sfdp-bfp = [ e5 20 f1 ff ff ff ff 07 44 eb 08 6b 08 3b 04 bb
187+
fe ff ff ff ff ff 00 ff ff ff 44 eb 0c 20 0f 52
188+
10 d8 00 ff 82 41 bd 00 81 e5 7b c6 44 03 67 38
189+
30 b0 30 b0 f7 bd d5 5c 4a be 29 ff e1 d0 ff ff ];
190+
jedec-id = [ 66 66 20 ];
191+
spi-bus-width = <4>;
192+
status = "okay";
193+
194+
partitions {
195+
compatible = "fixed-partitions";
196+
#address-cells = < 1 >;
197+
#size-cells = < 1 >;
198+
199+
storage_partition: partition@0 {
200+
label = "storage";
201+
reg=< 0x0 DT_SIZE_K(15872) >;
202+
};
203+
204+
wifi_firmware: partition@f80000 {
205+
label = "wifi-firmware";
206+
reg = < 0xf80000 DT_SIZE_K(512) >;
207+
};
208+
};
209+
};
210+
};

boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m4.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ testing:
1414
ignore_tags:
1515
- mpu
1616
- nfc
17+
- flash
1718
vendor: arduino

boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7.dts

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
zephyr,shell-uart = &usart1;
2020
zephyr,sram = &sram0;
2121
zephyr,flash = &flash0;
22-
zephyr,code-partition = &code_partition;
22+
zephyr,code-partition = &slot0_partition;
2323
};
2424

2525
oscen: oscen {
@@ -91,27 +91,31 @@
9191
#size-cells = <1>;
9292

9393
boot_partition: partition@0 {
94-
label = "bootloader";
95-
reg = <0x0 0x00040000>;
94+
label = "mcuboot";
95+
reg = <0x00000000 0x00010000>;
9696
read-only;
9797
};
98-
99-
code_partition: partition@40000 {
100-
label = "code";
101-
reg = <0x40000 0x000c0000>;
102-
read-only;
103-
};
104-
10598
/*
106-
* The flash starting at 0x000f8000 and ending at
107-
* 0x000fffff is reserved for use by the application.
108-
*
109-
* Storage partition will be used by FCB/LittleFS/NVS
110-
* if enabled.
99+
* The flash starting at 0x00010000 and ending at
100+
* 0x0001ffff (sectors 16-31) is reserved for use
101+
* by the application.
111102
*/
112-
storage_partition: partition@f8000 {
113-
label = "storage";
114-
reg = <0x000f8000 0x00008000>;
103+
scratch_partition: partition@10000 {
104+
label = "image-scratch";
105+
reg = <0x00010000 0x00030000>;
106+
};
107+
/* The arduino default bootloader occupies the address space 0x0 - 0x40000.
108+
* This way regardless of the user's choice to use the mcuboot bootloader,
109+
* applications will be located at 0x40000 which will be loaded by the
110+
* arduino bootloader.
111+
*/
112+
slot0_partition: partition@40000 {
113+
label = "image-0";
114+
reg = <0x00040000 0x00060000>;
115+
};
116+
slot1_partition: partition@A0000 {
117+
label = "image-1";
118+
reg = <0x000A0000 0x00060000>;
115119
};
116120
};
117121
};

0 commit comments

Comments
 (0)