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>
This commit is contained in:
Daniel DeGrasse 2024-04-29 18:52:53 -05:00 committed by Anas Nashif
commit 9668b35ce7
4 changed files with 64 additions and 0 deletions

View file

@ -297,6 +297,15 @@
#clock-cells = <0>; #clock-cells = <0>;
}; };
sys-pll {
compatible = "nxp,imx-ccm-fnpll";
loop-div = <22>;
numerator = <0>;
denominator = <1>;
src = <0>;
#clock-cells = <0>;
};
#clock-cells = <3>; #clock-cells = <3>;
}; };

View file

@ -0,0 +1,38 @@
# Copyright 2024 NXP
# SPDX-License-Identifier: Apache-2.0
description: |
i.MX CCM Fractional PLL. Output frequency is given by the following
formula: Fout = Fin * (loop-div + (numerator/denominator)
compatible: "nxp,imx-ccm-fnpll"
include: [clock-controller.yaml, base.yaml]
properties:
"#clock-cells":
const: 0
loop-div:
type: int
required: true
description: |
Loop divider. Divides PLL feedback loop (effectively multiplying output
frequency)
numerator:
type: int
required: true
description: |
Numerator of PLL multiplier fraction
denominator:
type: int
required: true
description: |
Denominator of PLL multiplier fraction
src:
type: int
required: true
description: Sets source for PLL input. SOC specific.

View file

@ -184,6 +184,9 @@ config INIT_ENET_PLL
MIMXRT1021 - see commit 17f4d6bec7 ("soc: nxp_imx: fix ENET_PLL selection MIMXRT1021 - see commit 17f4d6bec7 ("soc: nxp_imx: fix ENET_PLL selection
for MIMXRT1021"). for MIMXRT1021").
config INIT_SYS_PLL
bool "Initialize System PLL"
endif # SOC_SERIES_IMXRT10XX || SOC_SERIES_IMXRT11XX endif # SOC_SERIES_IMXRT10XX || SOC_SERIES_IMXRT11XX
endif # SOC_FAMILY_NXP_IMXRT endif # SOC_FAMILY_NXP_IMXRT

View file

@ -40,6 +40,16 @@ const clock_arm_pll_config_t armPllConfig = {
}; };
#endif #endif
#if CONFIG_INIT_SYS_PLL
/* Configure System PLL */
const clock_sys_pll_config_t sysPllConfig = {
.loopDivider = (DT_PROP(DT_CHILD(CCM_NODE, sys_pll), loop_div) - 20) / 2,
.numerator = DT_PROP(DT_CHILD(CCM_NODE, sys_pll), numerator),
.denominator = DT_PROP(DT_CHILD(CCM_NODE, sys_pll), denominator),
.src = DT_PROP(DT_CHILD(CCM_NODE, sys_pll), src),
};
#endif
#if CONFIG_USB_DC_NXP_EHCI #if CONFIG_USB_DC_NXP_EHCI
/* USB PHY condfiguration */ /* USB PHY condfiguration */
#define BOARD_USB_PHY_D_CAL (0x0CU) #define BOARD_USB_PHY_D_CAL (0x0CU)
@ -160,6 +170,10 @@ static ALWAYS_INLINE void clock_init(void)
CLOCK_InitVideoPll(&videoPllConfig); CLOCK_InitVideoPll(&videoPllConfig);
#endif #endif
#if CONFIG_INIT_SYS_PLL
CLOCK_InitSysPll(&sysPllConfig);
#endif
#if DT_NODE_EXISTS(DT_CHILD(CCM_NODE, arm_podf)) #if DT_NODE_EXISTS(DT_CHILD(CCM_NODE, arm_podf))
/* Set ARM PODF */ /* Set ARM PODF */
BUILD_ASSERT_PODF_IN_RANGE(arm_podf, 1, 8); BUILD_ASSERT_PODF_IN_RANGE(arm_podf, 1, 8);