Skip to content

Commit 51f1128

Browse files
committed
boards: s32z2xx: enable flash controller QSPI
The on-board S26HS512T 512M-bit HyperFlash memory is connected to the QSPI controller port A1. This board configuration selects it as the default flash controller. Signed-off-by: Cong Nguyen Huu <[email protected]>
1 parent 106e26a commit 51f1128

File tree

6 files changed

+114
-0
lines changed

6 files changed

+114
-0
lines changed

boards/nxp/s32z2xxdc2/doc/index.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ The boards support the following hardware features:
6262
+-----------+------------+-------------------------------------+
6363
| eMIOS | on-chip | pwm |
6464
+-----------+------------+-------------------------------------+
65+
| QSPI | on-chip | flash |
66+
+-----------+------------+-------------------------------------+
6567

6668
Other hardware features are not currently supported by the port.
6769

@@ -172,6 +174,12 @@ EDMA
172174
The EDMA modules feature four EDMA3 instances: Instance 0 with 32 channels,
173175
and instances 1, 4, and 5, each with 16 channels.
174176

177+
External Flash
178+
==============
179+
180+
The on-board S26HS512T 512M-bit HyperFlash memory is connected to the QSPI controller
181+
port A1. This board configuration selects it as the default flash controller.
182+
175183
Programming and Debugging
176184
*************************
177185

boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270.dtsi

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
#include "s32z2xxdc2_s32z270_pinctrl.dtsi"
8+
#include <zephyr/dt-bindings/qspi/nxp-s32-qspi.h>
89

910
&swt0 {
1011
status = "okay";
@@ -58,3 +59,69 @@
5859
&sar_adc1 {
5960
vref-mv = <1800>;
6061
};
62+
63+
&qspi0 {
64+
pinctrl-0 = <&qspi0_default>;
65+
pinctrl-names = "default";
66+
data-rate = "DDR";
67+
column-space = <3>;
68+
word-addressable;
69+
hold-time-2x;
70+
a-dll-freq-enable;
71+
a-dll-ref-counter = <2>;
72+
a-dll-resolution = <2>;
73+
a-dll-coarse-delay = <2>;
74+
a-dll-fine-delay = <2>;
75+
a-dll-mode = "AUTO UPDATE";
76+
a-rx-clock-source = "EXTERNAL DQS";
77+
ahb-buffers-masters = <0 1 2 3>;
78+
ahb-buffers-sizes = <256 256 256 256>;
79+
ahb-buffers-all-masters;
80+
status = "okay";
81+
82+
sfp_mdad {
83+
compatible = "nxp,s32-qspi-sfp-mdad";
84+
85+
mdad_0: mdad_0 {
86+
domain-id = <0>;
87+
secure-attribute = <NXP_S32_QSPI_SECURE>;
88+
};
89+
};
90+
91+
sfp_frad {
92+
compatible = "nxp,s32-qspi-sfp-frad";
93+
#address-cells = <1>;
94+
#size-cells = <1>;
95+
96+
frad_0: frad@0 {
97+
reg = <0x0 DT_SIZE_M(512)>;
98+
master-domain-acp-policy = <NXP_S32_QSPI_SECURE>;
99+
};
100+
};
101+
102+
s26hs512t: s26hs512t@0 {
103+
compatible = "nxp,s32-qspi-hyperflash";
104+
reg = <0>;
105+
jedec-id = [00 34 00 7b 00 1a 00 0f 00 90];
106+
device-id-word-addr = <0x800>;
107+
size = <DT_SIZE_M(512)>;
108+
write-block-size = <2>;
109+
read-latency-cycles = <16>;
110+
max-program-buffer-size = <256>;
111+
vcc-mv = <1800>;
112+
drive-strength-ohm = <27>;
113+
ppw-sectors-addr-mapping = "LOW";
114+
status = "okay";
115+
116+
partitions {
117+
compatible = "fixed-partitions";
118+
#address-cells = <1>;
119+
#size-cells = <1>;
120+
121+
storage_partition: partition@0 {
122+
label = "storage";
123+
reg = <0x0 0x10000>;
124+
};
125+
};
126+
};
127+
};

boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_pinctrl.dtsi

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,25 @@
127127
drive-open-drain;
128128
};
129129
};
130+
131+
qspi0_default: qspi0_default {
132+
group1 {
133+
pinmux = <PI4_QSPI_0_DATA_A_O0>, <PH14_QSPI_0_DATA_A_O1>,
134+
<PI8_QSPI_0_DATA_A_O2>, <PI1_QSPI_0_DATA_A_O3>,
135+
<PI5_QSPI_0_DATA_A_O4>, <PH15_QSPI_0_DATA_A_O5>,
136+
<PI7_QSPI_0_DATA_A_O6>, <PI0_QSPI_0_DATA_A_O7>,
137+
<PI6_QSPI_0_DQS_A_O>;
138+
output-enable;
139+
input-enable;
140+
};
141+
group2 {
142+
pinmux = <PH13_QSPI_0_CS_A0>, <PI9_QSPI_0_CS_A1>,
143+
<PI2_QSPI_0_CK_A_B>, <PI3_QSPI_0_CK_A>;
144+
output-enable;
145+
};
146+
group3 {
147+
pinmux = <PH12_QSPI_0_INTA_B>;
148+
input-enable;
149+
};
150+
};
130151
};

boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu0.dts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
zephyr,sram = &dram0;
1717
zephyr,flash = &cram0;
1818
zephyr,canbus = &canxl0;
19+
zephyr,flash-controller = &s26hs512t;
1920
};
2021

2122
aliases {

boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu1.dts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
zephyr,sram = &dram1;
1717
zephyr,flash = &cram1;
1818
zephyr,canbus = &flexcan0;
19+
zephyr,flash-controller = &s26hs512t;
1920
};
2021

2122
aliases {

dts/arm/nxp/nxp_s32z27x_r52.dtsi

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,5 +1431,21 @@
14311431
status = "disabled";
14321432
};
14331433
};
1434+
1435+
qspi0: qspi@42320000 {
1436+
compatible = "nxp,s32-qspi";
1437+
reg = <0x42320000 0x4000>;
1438+
#address-cells = <1>;
1439+
#size-cells = <0>;
1440+
status = "disabled";
1441+
};
1442+
1443+
qspi1: qspi@42340000 {
1444+
compatible = "nxp,s32-qspi";
1445+
reg = <0x42340000 0x4000>;
1446+
#address-cells = <1>;
1447+
#size-cells = <0>;
1448+
status = "disabled";
1449+
};
14341450
};
14351451
};

0 commit comments

Comments
 (0)