Skip to content

Commit 54a4ed8

Browse files
ExaltZephyrExaltZephyr
authored andcommitted
dts: bindings: mspi: Add MSPI configuration for STM32
This commit adds the main DTS configurations required to enable MSPI/OSPI/QSPI support on STM32. Signed-off-by: Sara Touqan <[email protected]> Signed-off-by: Sarah Younis <[email protected]> Signed-off-by: Mohammad Odeh <[email protected]>
1 parent 0589958 commit 54a4ed8

File tree

3 files changed

+291
-0
lines changed

3 files changed

+291
-0
lines changed
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
# Copyright (c) 2024 STMicroelectronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: |
5+
STM32 OSPI controller representation. Enabling a stm32 ospi node in a board
6+
description would typically requires this: (pinning depends on the stm32 mcu)
7+
8+
&ospi {
9+
pinctrl-0 = <&octospi_clk_pe9 &octospi_ncs_pe10 &octospi_dqs_pe11
10+
&octospi_io0_pe12 &octospi_io1_pe13
11+
&octospi_io2_pe14 &octospi_io3_pe15
12+
&octospi_io4_pe16 &octospi_io5_pe17
13+
&octospi_io6_pe18 &octospi_io7_pe19>;
14+
15+
pinctrl-names = "default";
16+
17+
status = "okay";
18+
};
19+
20+
compatible: "st,stm32-ospi-controller"
21+
22+
include: [base.yaml, pinctrl-device.yaml, mspi-controller.yaml]
23+
24+
25+
properties:
26+
reg:
27+
required: true
28+
29+
interrupts:
30+
required: true
31+
32+
pinctrl-0:
33+
required: true
34+
35+
pinctrl-names:
36+
required: true
37+
38+
clock-names:
39+
required: true
40+
41+
clocks:
42+
required: true
43+
44+
dmas:
45+
description: |
46+
Optional DMA channel specifier, required for DMA transactions.
47+
48+
For example dmas for TX/RX on MSPI
49+
dmas = <&dma1 5 41 0x10000>;
50+
51+
dma-names:
52+
description: |
53+
DMA channel name. If DMA should be used, expected value is "tx_rx".
54+
55+
For example
56+
dma-names = "tx_rx";
57+
58+
st,dlyb-bypass:
59+
type: boolean
60+
description: |
61+
Enables Delay Block (DLYB) Bypass.
62+
63+
ssht-enable:
64+
type: boolean
65+
description: |
66+
Enables Sample Shifting half-cycle.
67+
68+
It is recommended to be enabled in STR mode and disabled in DTR mode.
69+
70+
io-low-port:
71+
type: string
72+
enum:
73+
- "IOPORT_NONE"
74+
- "IOPORT_1_LOW"
75+
- "IOPORT_1_HIGH"
76+
- "IOPORT_2_LOW"
77+
- "IOPORT_2_HIGH"
78+
description: |
79+
Specifies which port of the OCTOSPI IO Manager is used for the IO[3:0] pins.
80+
81+
If absent, then `IOPORT_<n>_LOW` is used where `n` is the OSPI
82+
instance number.
83+
84+
Note: You might need to enable the OCTOSPI I/O manager clock to use the
85+
property. Please refer to Reference Manual.
86+
The clock can be enabled in the devicetree.
87+
88+
io-high-port:
89+
type: string
90+
enum:
91+
- "IOPORT_NONE"
92+
- "IOPORT_1_LOW"
93+
- "IOPORT_1_HIGH"
94+
- "IOPORT_2_LOW"
95+
- "IOPORT_2_HIGH"
96+
description: |
97+
Specifies which port of the OCTOSPI IO Manager is used for the IO[7:4] pins.
98+
99+
If absent, then `IOPORT_<n>_HIGH` is used where `n` is the OSPI
100+
instance number.
101+
102+
Can be set to `IOPORT_NONE` for Single SPI, Dual SPI and Quad SPI.
103+
104+
Note: You might need to enable the OCTOSPI I/O manager clock to use the
105+
property. Please refer to Reference Manual.
106+
The clock can be enabled in the devicetree.
107+
108+
clk-port:
109+
type: int
110+
enum:
111+
- 1
112+
- 2
113+
description: |
114+
Specifies which port of the OCTOSPI IO Manager is used for the clk pin.
115+
116+
If absent, then n is used where `n` is the OSPI
117+
instance number.
118+
119+
Note: You might need to enable the OCTOSPI I/O manager clock to use the
120+
property. Please refer to Reference Manual.
121+
The clock can be enabled in the devicetree.
122+
123+
dqs-port:
124+
type: int
125+
enum:
126+
- 1
127+
- 2
128+
description: |
129+
Specifies which port of the OCTOSPI IO Manager is used for the dqs pin.
130+
131+
If absent, then n is used where `n` is the OSPI
132+
instance number.
133+
134+
Note: You might need to enable the OCTOSPI I/O manager clock to use the
135+
property. Please refer to Reference Manual.
136+
The clock can be enabled in the devicetree.
137+
138+
ncs-port:
139+
type: int
140+
enum:
141+
- 1
142+
- 2
143+
description: |
144+
Specifies which port of the OCTOSPI IO Manager is used for the ncs pin.
145+
146+
If absent, then n is used where `n` is the OSPI
147+
instance number.
148+
149+
Note: You might need to enable the OCTOSPI I/O manager clock to use the
150+
property. Please refer to Reference Manual.
151+
The clock can be enabled in the devicetree.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Copyright (c) 2025 EXALT Technologies.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: |
5+
STM32 QSPI controller
6+
Enabling a stm32 qspi node in a board description would
7+
typically require this: (pinning depends on the stm32 mcu)
8+
9+
&qspi {
10+
pinctrl-0 = <&quadspi_clk_pe10 &quadspi_ncs_pe11
11+
&quadspi_io0_pe12 &quadspi_io1_pe13
12+
&quadspi_io2_pe14 &quadspi_io3_pe15>;
13+
14+
dmas = <&dma1 5 41 0x10000>;
15+
dma-names = "tx_rx";
16+
17+
status = "okay";
18+
};
19+
20+
compatible: "st,stm32-qspi-controller"
21+
22+
include: [base.yaml, pinctrl-device.yaml, mspi-controller.yaml]
23+
24+
properties:
25+
reg:
26+
required: true
27+
28+
interrupts:
29+
required: true
30+
31+
pinctrl-0:
32+
required: true
33+
34+
pinctrl-names:
35+
required: true
36+
37+
clock-names:
38+
required: true
39+
40+
clocks:
41+
required: true
42+
43+
dmas:
44+
description: |
45+
Optional DMA channel specifier, required for DMA transactions.
46+
For example dmas for TX/RX on QSPI
47+
dmas = <&dma1 5 41 0x10000>;
48+
49+
dma-names:
50+
description: |
51+
DMA channel name. If DMA should be used, expected value is "tx_rx".
52+
53+
For example
54+
dma-names = "tx_rx";
55+
56+
ssht-enable:
57+
type: boolean
58+
description: |
59+
Enables Sample Shifting half-cycle.
60+
61+
It is recommended to be enabled in STR mode and disabled in DTR mode.
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Copyright (c) 2025 EXALT Technologies.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: |
5+
STM32 XSPI controller
6+
Enabling a stm32 xspi node in a board
7+
description would typically requires this: (pinning depends on the stm32 mcu)
8+
9+
&xspi {
10+
pinctrl-0 = <&octospi_clk_pe9 &octospi_ncs_pe10 &octospi_dqs_pe11
11+
&octospi_io0_pe12 &octospi_io1_pe13
12+
&octospi_io2_pe14 &octospi_io3_pe15
13+
&octospi_io4_pe16 &octospi_io5_pe17
14+
&octospi_io6_pe18 &octospi_io7_pe19>;
15+
16+
pinctrl-names = "default";
17+
18+
status = "okay";
19+
};
20+
21+
compatible: "st,stm32-xspi-controller"
22+
23+
include: [base.yaml, pinctrl-device.yaml, mspi-controller.yaml]
24+
25+
properties:
26+
reg:
27+
required: true
28+
29+
interrupts:
30+
required: true
31+
32+
pinctrl-0:
33+
required: true
34+
35+
pinctrl-names:
36+
required: true
37+
38+
clocks:
39+
required: true
40+
41+
clock-names:
42+
required: true
43+
44+
dmas:
45+
description: |
46+
Optional DMA channel specifier, required for DMA transactions.
47+
For example dmas for TX/RX on xspi
48+
dmas = <&dma1 5 41 0x10000>;
49+
50+
With, in each cell of the dmas specifier:
51+
- &dma1: dma controller phandle
52+
- 5: channel number (0 to Max-Channel minus 1). From 0 to 15 on stm32u5x.
53+
- 41: slot number (request which could be given by the DMAMUX)
54+
- 0x10000: channel configuration (only for srce/dest data size, priority)
55+
56+
Notes:
57+
- On series supporting DMAMUX, the DMA phandle should be provided
58+
but DMAMUX node should also be enabled in the DTS.
59+
- For channel configuration, only the config bits priority and
60+
periph/mem datasize are used. The periph/mem datasize must be equal,
61+
0 is a correct value.
62+
- There is no Fifo used by this DMA peripheral.
63+
64+
For example dmas for TX/RX on xspi
65+
dmas = <&dma1 5 41 0x10000>;
66+
67+
dma-names:
68+
description: |
69+
DMA channel name. If DMA should be used, expected value is "tx_rx".
70+
71+
For example
72+
dma-names = "tx_rx";
73+
74+
ssht-enable:
75+
type: boolean
76+
description: |
77+
Enables Sample Shifting half-cycle.
78+
79+
It is recommended to be enabled in STR mode and disabled in DTR mode.

0 commit comments

Comments
 (0)