Skip to content

Commit 9c34b18

Browse files
CharlesDiasjhedberg
authored andcommitted
dts: bindings: mipi-dsi: extend STM32 MIPI DSI support
These additions enhance the flexibility of the MIPI DSI host configuration for STM32U5 series, enabling finer control over the DSI PLL and PHY settings. Signed-off-by: Charles Dias <[email protected]>
1 parent 7f670c0 commit 9c34b18

File tree

3 files changed

+137
-2
lines changed

3 files changed

+137
-2
lines changed

drivers/clock_control/clock_stm32_ll_u5.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ int enabled_clock(uint32_t src_clk)
145145
((src_clk == STM32_SRC_PLL2_R) && IS_ENABLED(STM32_PLL2_R_ENABLED)) ||
146146
((src_clk == STM32_SRC_PLL3_P) && IS_ENABLED(STM32_PLL3_P_ENABLED)) ||
147147
((src_clk == STM32_SRC_PLL3_Q) && IS_ENABLED(STM32_PLL3_Q_ENABLED)) ||
148-
((src_clk == STM32_SRC_PLL3_R) && IS_ENABLED(STM32_PLL3_R_ENABLED))) {
148+
((src_clk == STM32_SRC_PLL3_R) && IS_ENABLED(STM32_PLL3_R_ENABLED)) ||
149+
(src_clk == STM32_SRC_DSIPHY)) {
149150
return 0;
150151
}
151152

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
#
2+
# Copyright (c) 2025 Charles Dias
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
description: |
8+
STM32U5 series MIPI DSI controller.
9+
10+
compatible: "st,stm32u5-mipi-dsi"
11+
12+
include:
13+
- name: st,stm32-mipi-dsi.yaml
14+
property-blocklist:
15+
- clock-names
16+
17+
properties:
18+
clock-names:
19+
type: string-array
20+
required: true
21+
description: |
22+
"dsiclk" DSI clock enable.
23+
"dsisrc" DSI clock source.
24+
"refclk" External crystal or oscillator clock.
25+
"pixelclk" LTDC pixel clock.
26+
"refclk" and "pixelclk" are only used to retrieve the frequency for timing calculation.
27+
28+
phy-freq-range:
29+
required: true
30+
type: int
31+
enum:
32+
- 0x0
33+
- 0x1
34+
- 0x2
35+
- 0x3
36+
- 0x4
37+
- 0x5
38+
- 0x6
39+
- 0x7
40+
- 0x8
41+
description: |
42+
D-PHY PLL input frequency range. This is used to select the appropriate
43+
frequency range for the D-PHY PLL operation.
44+
0x0 : DSI_DPHY_FRANGE_80MHZ_100MHZ
45+
0x1 : DSI_DPHY_FRANGE_100MHZ_120MHZ
46+
0x2 : DSI_DPHY_FRANGE_120MHZ_160MHZ
47+
0x3 : DSI_DPHY_FRANGE_160MHZ_200MHZ
48+
0x4 : DSI_DPHY_FRANGE_200MHZ_240MHZ
49+
0x5 : DSI_DPHY_FRANGE_240MHZ_320MHZ
50+
0x6 : DSI_DPHY_FRANGE_320MHZ_390MHZ
51+
0x7 : DSI_DPHY_FRANGE_390MHZ_450MHZ
52+
0x8 : DSI_DPHY_FRANGE_450MHZ_510MHZ
53+
54+
phy-low-power-offset:
55+
required: true
56+
type: int
57+
enum:
58+
- 0x0
59+
- 0x1
60+
- 0x2
61+
- 0x3
62+
- 0x4
63+
- 0x5
64+
- 0x6
65+
- 0x7
66+
- 0x8
67+
- 0x9
68+
- 0xA
69+
- 0xB
70+
- 0xC
71+
- 0xD
72+
- 0xE
73+
- 0xF
74+
description: |
75+
D-PHY low power offset configuration specific to STM32U5 series.
76+
0x0 : PHY_LP_OFFSSET_0_CLKP (0 CLKP)
77+
0x1 : PHY_LP_OFFSSET_1_CLKP (+1 CLKP)
78+
0x2 : PHY_LP_OFFSSET_2_CLKP (+2 CLKP)
79+
0x3 : PHY_LP_OFFSSET_3_CLKP (+3 CLKP)
80+
0x4 : PHY_LP_OFFSSET_4_CLKP (+4 CLKP)
81+
0x5 : PHY_LP_OFFSSET_5_CLKP (+5 CLKP)
82+
0x6 : PHY_LP_OFFSSET_6_CLKP (+6 CLKP)
83+
0x7 : PHY_LP_OFFSSET_7_CLKP (+7 CLKP)
84+
0x8 : PHY_LP_OFFSSET_MINUS_1_CLKP (-1 CLKP)
85+
0x9 : PHY_LP_OFFSSET_MINUS_2_CLKP (-2 CLKP)
86+
0xA : PHY_LP_OFFSSET_MINUS_3_CLKP (-3 CLKP)
87+
0xB : PHY_LP_OFFSSET_MINUS_4_CLKP (-4 CLKP)
88+
0xC : PHY_LP_OFFSSET_MINUS_5_CLKP (-5 CLKP)
89+
0xD : PHY_LP_OFFSSET_MINUS_6_CLKP (-6 CLKP)
90+
0xE : PHY_LP_OFFSSET_MINUS_7_CLKP (-7 CLKP)
91+
0xF : PHY_LP_OFFSSET_MINUS_8_CLKP (-8 CLKP)
92+
93+
pll-vco-range:
94+
required: true
95+
type: int
96+
enum:
97+
- 0x0
98+
- 0x1
99+
description: |
100+
PLL VCO frequency range configuration for STM32U5 D-PHY.
101+
0x0 : DSI_DPHY_VCO_FRANGE_500MHZ_800MHZ
102+
0x1 : DSI_DPHY_VCO_FRANGE_800MHZ_1GHZ
103+
104+
pll-charge-pump:
105+
required: true
106+
type: int
107+
enum:
108+
- 0x0
109+
- 0x1
110+
- 0x2
111+
- 0x3
112+
description: |
113+
PLL charge pump configuration for STM32U5 D-PHY.
114+
Valid values:
115+
0x0 : DSI_PLL_CHARGE_PUMP_2000HZ_4400HZ
116+
0x1 : DSI_PLL_CHARGE_PUMP_4400HZ_14100HZ
117+
0x0 : DSI_PLL_CHARGE_PUMP_14100HZ_30900HZ
118+
0x3 : DSI_PLL_CHARGE_PUMP_30900HZ_45700HZ
119+
0x2 : DSI_PLL_CHARGE_PUMP_45700HZ_50000HZ
120+
121+
pll-tuning:
122+
required: true
123+
type: int
124+
enum:
125+
- 0x0
126+
- 0x1
127+
- 0x2
128+
description: |
129+
PLL tuning parameter (loop filter) for STM32U5 D-PHY.
130+
0x0 : DSI_PLL_LOOP_FILTER_2000HZ_4400HZ
131+
0x1 : DSI_PLL_LOOP_FILTER_4400HZ_30900HZ
132+
0x2 : DSI_PLL_LOOP_FILTER_30900HZ_50000HZ

include/zephyr/dt-bindings/clock/stm32u5_clock.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
#define STM32_SRC_PLL3_P (STM32_SRC_PLL2_R + 1)
3939
#define STM32_SRC_PLL3_Q (STM32_SRC_PLL3_P + 1)
4040
#define STM32_SRC_PLL3_R (STM32_SRC_PLL3_Q + 1)
41+
/** DSI PHY clock */
42+
#define STM32_SRC_DSIPHY (STM32_SRC_PLL3_R + 1)
4143
/** Clock muxes */
4244
/* #define STM32_SRC_ICLK TBD */
4345

@@ -89,7 +91,7 @@
8991
#define SAE_SEL(val) STM32_DT_CLOCK_SELECT((val), 1, 11, CCIPR2_REG)
9092
#define RNG_SEL(val) STM32_DT_CLOCK_SELECT((val), 3, 12, CCIPR2_REG)
9193
#define SDMMC_SEL(val) STM32_DT_CLOCK_SELECT((val), 1, 14, CCIPR2_REG)
92-
#define DSIHOST_SEL(val) STM32_DT_CLOCK_SELECT((val), 1, 15, CCIPR2_REG)
94+
#define DSI_SEL(val) STM32_DT_CLOCK_SELECT((val), 1, 15, CCIPR2_REG)
9395
#define USART6_SEL(val) STM32_DT_CLOCK_SELECT((val), 1, 16, CCIPR2_REG)
9496
#define LTDC_SEL(val) STM32_DT_CLOCK_SELECT((val), 1, 18, CCIPR2_REG)
9597
#define OCTOSPI_SEL(val) STM32_DT_CLOCK_SELECT((val), 3, 20, CCIPR2_REG)

0 commit comments

Comments
 (0)