Skip to content

Commit ef2271e

Browse files
decsnydanieldegrasse
authored andcommitted
soc: imxrt: Clean up INIT_VIDEO_PLL config
Don't force select the INIT_VIDEO_PLL config so that board level can unset it. Also clean up the code a bit in soc.c files. Signed-off-by: Declan Snyder <[email protected]>
1 parent 79713a5 commit ef2271e

File tree

4 files changed

+39
-40
lines changed

4 files changed

+39
-40
lines changed

soc/nxp/imxrt/imxrt10xx/Kconfig

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ config SOC_MIMXRT1052
7373
select HAS_MCUX_SEMC
7474
select CPU_HAS_FPU_DOUBLE_PRECISION
7575
select CPU_HAS_ARM_MPU
76-
select INIT_VIDEO_PLL if DISPLAY_MCUX_ELCDIF
7776
select HAS_MCUX_USDHC1
7877
select HAS_MCUX_USDHC2
7978
select HAS_MCUX_FLEXCAN
@@ -89,7 +88,6 @@ config SOC_MIMXRT1062
8988
select HAS_MCUX_SNVS
9089
select CPU_HAS_FPU_DOUBLE_PRECISION
9190
select CPU_HAS_ARM_MPU
92-
select INIT_VIDEO_PLL if DISPLAY_MCUX_ELCDIF
9391
select HAS_MCUX_USDHC1
9492
select HAS_MCUX_USDHC2
9593
select HAS_MCUX_FLEXCAN
@@ -107,7 +105,6 @@ config SOC_MIMXRT1064
107105
select HAS_MCUX_SRC
108106
select CPU_HAS_FPU_DOUBLE_PRECISION
109107
select CPU_HAS_ARM_MPU
110-
select INIT_VIDEO_PLL if DISPLAY_MCUX_ELCDIF
111108
select HAS_MCUX_USDHC1
112109
select HAS_MCUX_USDHC2
113110
select HAS_MCUX_FLEXCAN
@@ -132,4 +129,9 @@ config INIT_PLL6_500M
132129
SOC_MIMXRT1021 || SOC_MIMXRT1024
133130
select INIT_ENET_PLL
134131

132+
config INIT_VIDEO_PLL
133+
default y if DISPLAY_MCUX_ELCDIF
134+
depends on !SOC_MIMXRT1011 && !SOC_MIMXRT1015 && \
135+
!SOC_MIMXRT1021 && !SOC_MIMXRT1024
136+
135137
endif # SOC_SERIES_IMXRT10XX

soc/nxp/imxrt/imxrt10xx/soc.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,6 @@ const clock_sys_pll_config_t sysPllConfig = {
5757
};
5858
#endif
5959

60-
#ifdef CONFIG_INIT_VIDEO_PLL
61-
const clock_video_pll_config_t videoPllConfig = {
62-
.loopDivider = 31,
63-
.postDivider = 8,
64-
.numerator = 0,
65-
.denominator = 0,
66-
};
67-
#endif
68-
6960
#ifdef CONFIG_NXP_IMXRT_BOOT_HEADER
7061
const __imx_boot_data_section BOOT_DATA_T boot_data = {
7162
#ifdef CONFIG_XIP
@@ -152,6 +143,12 @@ __weak void clock_init(void)
152143
}
153144

154145
#ifdef CONFIG_INIT_VIDEO_PLL
146+
static const clock_video_pll_config_t videoPllConfig = {
147+
.loopDivider = 31,
148+
.postDivider = 8,
149+
.numerator = 0,
150+
.denominator = 0,
151+
};
155152
CLOCK_InitVideoPll(&videoPllConfig);
156153
#endif
157154

soc/nxp/imxrt/imxrt11xx/Kconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ config SOC_SERIES_IMXRT11XX
2323
select HAS_MCUX_FLEXSPI
2424
select HAS_MCUX_FLEXCAN
2525
select CPU_HAS_ARM_MPU
26-
select INIT_VIDEO_PLL
2726
select HAS_MCUX_EDMA
2827
select CPU_HAS_ICACHE if CPU_CORTEX_M7
2928
select CPU_HAS_DCACHE if CPU_CORTEX_M7
@@ -67,4 +66,7 @@ config ADJUST_LDO
6766
default y
6867
bool "Adjust LDO setting"
6968

69+
config INIT_VIDEO_PLL
70+
default y
71+
7072
endif # SOC_SERIES_IMXRT11XX

soc/nxp/imxrt/imxrt11xx/soc.c

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -65,29 +65,6 @@ static const clock_sys_pll2_config_t sysPll2Config = {
6565
.ssEnable = false,
6666
};
6767

68-
#ifdef CONFIG_INIT_VIDEO_PLL
69-
static const clock_video_pll_config_t videoPllConfig = {
70-
/* PLL Loop divider, valid range for DIV_SELECT divider value: 27 ~ 54. */
71-
.loopDivider = 41,
72-
/* Divider after PLL, should only be 1, 2, 4, 8, 16, 32 */
73-
.postDivider = 0,
74-
/*
75-
* 30 bit numerator of fractional loop divider,
76-
* Fout = Fin * ( loopDivider + numerator / denominator )
77-
*/
78-
.numerator = 1,
79-
/*
80-
* 30 bit denominator of fractional loop divider,
81-
* Fout = Fin * ( loopDivider + numerator / denominator )
82-
*/
83-
.denominator = 960000,
84-
/* Spread spectrum parameter */
85-
.ss = NULL,
86-
/* Enable spread spectrum or not */
87-
.ssEnable = false,
88-
};
89-
#endif
90-
9168
#if CONFIG_USB_DC_NXP_EHCI
9269
usb_phy_config_struct_t usbPhyConfig = {
9370
BOARD_USB_PHY_D_CAL,
@@ -277,10 +254,31 @@ __weak void clock_init(void)
277254
/* Init System Pll3 pfd3. */
278255
CLOCK_InitPfd(kCLOCK_PllSys3, kCLOCK_Pfd3, 22);
279256

280-
#ifdef CONFIG_INIT_VIDEO_PLL
281-
/* Init Video Pll. */
282-
CLOCK_InitVideoPll(&videoPllConfig);
283-
#endif
257+
static const clock_video_pll_config_t videoPllConfig = {
258+
/* PLL Loop divider, valid range for DIV_SELECT divider value: 27 ~ 54. */
259+
.loopDivider = 41,
260+
/* Divider after PLL, should only be 1, 2, 4, 8, 16, 32 */
261+
.postDivider = 0,
262+
/*
263+
* 30 bit numerator of fractional loop divider,
264+
* Fout = Fin * ( loopDivider + numerator / denominator )
265+
*/
266+
.numerator = 1,
267+
/*
268+
* 30 bit denominator of fractional loop divider,
269+
* Fout = Fin * ( loopDivider + numerator / denominator )
270+
*/
271+
.denominator = 960000,
272+
/* Spread spectrum parameter */
273+
.ss = NULL,
274+
/* Enable spread spectrum or not */
275+
.ssEnable = false,
276+
};
277+
278+
if (IS_ENABLED(CONFIG_INIT_VIDEO_PLL)) {
279+
/* Init Video Pll. */
280+
CLOCK_InitVideoPll(&videoPllConfig);
281+
}
284282

285283
/* Module clock root configurations. */
286284
/* Configure M7 using ARM_PLL_CLK */

0 commit comments

Comments
 (0)