Skip to content

Commit 3baedf4

Browse files
soc: nxp: imxrt: allow configuring system pll on iMXRT10xx series
Allow configuration of the system pll on the iMXRT10xx series parts, via a fractional pll node under the CCM module. Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
1 parent 5033399 commit 3baedf4

File tree

4 files changed

+64
-0
lines changed

4 files changed

+64
-0
lines changed

dts/arm/nxp/nxp_rt10xx.dtsi

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,15 @@
297297
#clock-cells = <0>;
298298
};
299299

300+
sys-pll {
301+
compatible = "nxp,imx-ccm-fnpll";
302+
loop-div = <22>;
303+
numerator = <0>;
304+
denominator = <1>;
305+
src = <0>;
306+
#clock-cells = <0>;
307+
};
308+
300309
#clock-cells = <3>;
301310
};
302311

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright 2024 NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: |
5+
i.MX CCM Fractional PLL. Output frequency is given by the following
6+
formula: Fout = Fin * (loop-div + (numerator/denominator)
7+
8+
compatible: "nxp,imx-ccm-fnpll"
9+
10+
include: [clock-controller.yaml, base.yaml]
11+
12+
properties:
13+
"#clock-cells":
14+
const: 0
15+
16+
loop-div:
17+
type: int
18+
required: true
19+
description: |
20+
Loop divider. Divides PLL feedback loop (effectively multiplying output
21+
frequency)
22+
23+
numerator:
24+
type: int
25+
required: true
26+
description: |
27+
Numerator of PLL multiplier fraction
28+
29+
denominator:
30+
type: int
31+
required: true
32+
description: |
33+
Denominator of PLL multiplier fraction
34+
35+
src:
36+
type: int
37+
required: true
38+
description: Sets source for PLL input. SOC specific.

soc/nxp/imxrt/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ config INIT_ENET_PLL
184184
MIMXRT1021 - see commit 17f4d6bec7 ("soc: nxp_imx: fix ENET_PLL selection
185185
for MIMXRT1021").
186186

187+
config INIT_SYS_PLL
188+
bool "Initialize System PLL"
189+
187190
endif # SOC_SERIES_IMXRT10XX || SOC_SERIES_IMXRT11XX
188191

189192
endif # SOC_FAMILY_NXP_IMXRT

soc/nxp/imxrt/imxrt10xx/soc.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ const clock_arm_pll_config_t armPllConfig = {
4040
};
4141
#endif
4242

43+
#if CONFIG_INIT_SYS_PLL
44+
/* Configure System PLL */
45+
const clock_sys_pll_config_t sysPllConfig = {
46+
.loopDivider = (DT_PROP(DT_CHILD(CCM_NODE, sys_pll), loop_div) - 20) / 2,
47+
.numerator = DT_PROP(DT_CHILD(CCM_NODE, sys_pll), numerator),
48+
.denominator = DT_PROP(DT_CHILD(CCM_NODE, sys_pll), denominator),
49+
.src = DT_PROP(DT_CHILD(CCM_NODE, sys_pll), src),
50+
};
51+
#endif
52+
4353
#if CONFIG_USB_DC_NXP_EHCI
4454
/* USB PHY condfiguration */
4555
#define BOARD_USB_PHY_D_CAL (0x0CU)
@@ -160,6 +170,10 @@ static ALWAYS_INLINE void clock_init(void)
160170
CLOCK_InitVideoPll(&videoPllConfig);
161171
#endif
162172

173+
#if CONFIG_INIT_SYS_PLL
174+
CLOCK_InitSysPll(&sysPllConfig);
175+
#endif
176+
163177
#if DT_NODE_EXISTS(DT_CHILD(CCM_NODE, arm_podf))
164178
/* Set ARM PODF */
165179
BUILD_ASSERT_PODF_IN_RANGE(arm_podf, 1, 8);

0 commit comments

Comments
 (0)