Skip to content

Commit d56f5f7

Browse files
bas-archembeddedkartben
authored andcommitted
soc: mimxrt11xx: Allow to override SYS PLL2/3 output divider(s).
To reduce the SEMC clock to a usable speed we had to divide down the output clock of System PLL2 PFD1. To do this I had to override the hardcoded defaults. This commit adds the flexibility to override them in your board files. Signed-off-by: Bas van Loon <[email protected]>
1 parent 70b96f4 commit d56f5f7

File tree

2 files changed

+48
-8
lines changed

2 files changed

+48
-8
lines changed

soc/nxp/imxrt/imxrt11xx/Kconfig

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,44 @@ config ADJUST_LDO
6969
config INIT_VIDEO_PLL
7070
default y
7171

72+
config SYS_PLL2_PFD0_DIV
73+
int "System PLL2 PFD0 divider"
74+
default 27
75+
range 13 35
76+
77+
config SYS_PLL2_PFD1_DIV
78+
int "System PLL2 PFD1 divider"
79+
default 16
80+
range 13 35
81+
82+
config SYS_PLL2_PFD2_DIV
83+
int "System PLL2 PFD2 divider"
84+
default 24
85+
range 13 35
86+
87+
config SYS_PLL2_PFD3_DIV
88+
int "System PLL2 PFD3 divider"
89+
default 32
90+
range 13 35
91+
92+
config SYS_PLL3_PFD0_DIV
93+
int "System PLL3 PFD0 divider"
94+
default 13
95+
range 13 35
96+
97+
config SYS_PLL3_PFD1_DIV
98+
int "System PLL3 PFD1 divider"
99+
default 17
100+
range 13 35
101+
102+
config SYS_PLL3_PFD2_DIV
103+
int "System PLL3 PFD2 divider"
104+
default 32
105+
range 13 35
106+
107+
config SYS_PLL3_PFD3_DIV
108+
int "System PLL3 PFD3 divider"
109+
default 22
110+
range 13 35
111+
72112
endif # SOC_SERIES_IMXRT11XX

soc/nxp/imxrt/imxrt11xx/soc.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -227,31 +227,31 @@ __weak void clock_init(void)
227227
CLOCK_InitSysPll2(&sysPll2Config);
228228

229229
/* Init System Pll2 pfd0. */
230-
CLOCK_InitPfd(kCLOCK_PllSys2, kCLOCK_Pfd0, 27);
230+
CLOCK_InitPfd(kCLOCK_PllSys2, kCLOCK_Pfd0, CONFIG_SYS_PLL2_PFD0_DIV);
231231

232232
/* Init System Pll2 pfd1. */
233-
CLOCK_InitPfd(kCLOCK_PllSys2, kCLOCK_Pfd1, 16);
233+
CLOCK_InitPfd(kCLOCK_PllSys2, kCLOCK_Pfd1, CONFIG_SYS_PLL2_PFD1_DIV);
234234

235235
/* Init System Pll2 pfd2. */
236-
CLOCK_InitPfd(kCLOCK_PllSys2, kCLOCK_Pfd2, 24);
236+
CLOCK_InitPfd(kCLOCK_PllSys2, kCLOCK_Pfd2, CONFIG_SYS_PLL2_PFD2_DIV);
237237

238238
/* Init System Pll2 pfd3. */
239-
CLOCK_InitPfd(kCLOCK_PllSys2, kCLOCK_Pfd3, 32);
239+
CLOCK_InitPfd(kCLOCK_PllSys2, kCLOCK_Pfd3, CONFIG_SYS_PLL2_PFD3_DIV);
240240

241241
/* Init Sys Pll3. */
242242
CLOCK_InitSysPll3();
243243

244244
/* Init System Pll3 pfd0. */
245-
CLOCK_InitPfd(kCLOCK_PllSys3, kCLOCK_Pfd0, 13);
245+
CLOCK_InitPfd(kCLOCK_PllSys3, kCLOCK_Pfd0, CONFIG_SYS_PLL3_PFD0_DIV);
246246

247247
/* Init System Pll3 pfd1. */
248-
CLOCK_InitPfd(kCLOCK_PllSys3, kCLOCK_Pfd1, 17);
248+
CLOCK_InitPfd(kCLOCK_PllSys3, kCLOCK_Pfd1, CONFIG_SYS_PLL3_PFD1_DIV);
249249

250250
/* Init System Pll3 pfd2. */
251-
CLOCK_InitPfd(kCLOCK_PllSys3, kCLOCK_Pfd2, 32);
251+
CLOCK_InitPfd(kCLOCK_PllSys3, kCLOCK_Pfd2, CONFIG_SYS_PLL3_PFD2_DIV);
252252

253253
/* Init System Pll3 pfd3. */
254-
CLOCK_InitPfd(kCLOCK_PllSys3, kCLOCK_Pfd3, 22);
254+
CLOCK_InitPfd(kCLOCK_PllSys3, kCLOCK_Pfd3, CONFIG_SYS_PLL3_PFD3_DIV);
255255

256256
static const clock_video_pll_config_t videoPllConfig = {
257257
/* PLL Loop divider, valid range for DIV_SELECT divider value: 27 ~ 54. */

0 commit comments

Comments
 (0)