Skip to content

Commit 44885cb

Browse files
DerekSnellcarlescufi
authored andcommitted
boards: mimxrt595: add CONFIG_MIPI_DPHY_CLK_SRC
Give option in soc.c to initialize the MIPI DPHY clock from the default AUX1_PLL, or from the FRO using CONFIG_MIPI_DPHY_CLK_SRC_FRO. Signed-off-by: Derek Snell <[email protected]>
1 parent 3f2ded3 commit 44885cb

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

soc/arm/nxp_imx/rt5xx/Kconfig.soc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,16 @@ config FLEXCOMM0_CLK_SRC_FRO
141141

142142
endchoice
143143

144+
choice MIPI_DPHY_CLK_SRC
145+
prompt "Clock source for MIPI DPHY"
146+
default MIPI_DPHY_CLK_SRC_AUX1_PLL
147+
148+
config MIPI_DPHY_CLK_SRC_AUX1_PLL
149+
bool "AUX1_PLL is source of MIPI_DPHY clock"
150+
151+
config MIPI_DPHY_CLK_SRC_FRO
152+
bool "FRO 192/96M is source of MIPI_DPHY clock"
153+
154+
endchoice
155+
144156
endif # SOC_SERIES_IMX_RT5XX

soc/arm/nxp_imx/rt5xx/soc.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,12 +462,21 @@ void __weak imxrt_pre_init_display_interface(void)
462462
* We set the divider of the PFD3 output of the SYSPLL, which has a
463463
* fixed multiplied of 18, and use this output frequency for the DPHY.
464464
*/
465+
466+
#ifdef CONFIG_MIPI_DPHY_CLK_SRC_AUX1_PLL
467+
/* Note: AUX1 PLL clock is system pll clock * 18 / pfd.
468+
* system pll clock is configured at 528MHz by default.
469+
*/
465470
CLOCK_AttachClk(kAUX1_PLL_to_MIPI_DPHY_CLK);
466471
CLOCK_InitSysPfd(kCLOCK_Pfd3,
467472
((CLOCK_GetSysPllFreq() * 18ull) /
468473
((unsigned long long)(DT_PROP(DT_NODELABEL(mipi_dsi), phy_clock)))));
469474
CLOCK_SetClkDiv(kCLOCK_DivDphyClk, 1);
470-
475+
#elif defined(CONFIG_MIPI_DPHY_CLK_SRC_FRO)
476+
CLOCK_AttachClk(kFRO_DIV1_to_MIPI_DPHY_CLK);
477+
CLOCK_SetClkDiv(kCLOCK_DivDphyClk,
478+
(CLK_FRO_CLK / DT_PROP(DT_NODELABEL(mipi_dsi), phy_clock)));
479+
#endif
471480
/* Clear DSI control reset (Note that DPHY reset is cleared later)*/
472481
RESET_ClearPeripheralReset(kMIPI_DSI_CTRL_RST_SHIFT_RSTn);
473482
}

0 commit comments

Comments
 (0)