Skip to content

Commit 3f2ded3

Browse files
DerekSnellcarlescufi
authored andcommitted
soc: arm: nxp_imx: r5xx: add Kconfig to clock FC0 from FRO
Flexcomm0 has option to clock from FRO. Signed-off-by: Derek Snell <[email protected]>
1 parent b2626fa commit 3f2ded3

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

soc/arm/nxp_imx/rt5xx/Kconfig.soc

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# i.MX RT5XX Series
22

3-
# Copyright (c) 2022, NXP
3+
# Copyright 2022-2023, NXP
44
# SPDX-License-Identifier: Apache-2.0
55

66
choice
@@ -129,4 +129,16 @@ config IMXRT5XX_CODE_CACHE
129129
Enable code cache for FlexSPI region at boot. If this Kconfig is
130130
cleared, the CACHE64 controller will be disabled during SOC init
131131

132+
choice FLEXCOMM0_CLK_SRC
133+
prompt "Clock source for Flexcomm0"
134+
default FLEXCOMM0_CLK_SRC_FRG
135+
136+
config FLEXCOMM0_CLK_SRC_FRG
137+
bool "FRG is source of Flexcomm0 clock"
138+
139+
config FLEXCOMM0_CLK_SRC_FRO
140+
bool "FRO_DIV4 is source of Flexcomm0 clock"
141+
142+
endchoice
143+
132144
endif # SOC_SERIES_IMX_RT5XX

soc/arm/nxp_imx/rt5xx/soc.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,12 @@ void __weak rt5xx_clock_init(void)
281281
/* Switch SYSTICK_CLK to MAIN_CLK_DIV */
282282
CLOCK_AttachClk(kMAIN_CLK_DIV_to_SYSTICK_CLK);
283283
#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(flexcomm0), nxp_lpc_usart, okay)
284-
/* Switch FLEXCOMM0 to FRG */
285-
CLOCK_AttachClk(kFRG_to_FLEXCOMM0);
284+
#ifdef CONFIG_FLEXCOMM0_CLK_SRC_FRG
285+
/* Switch FLEXCOMM0 to FRG */
286+
CLOCK_AttachClk(kFRG_to_FLEXCOMM0);
287+
#elif defined(CONFIG_FLEXCOMM0_CLK_SRC_FRO)
288+
CLOCK_AttachClk(kFRO_DIV4_to_FLEXCOMM0);
289+
#endif
286290
#endif
287291
#if CONFIG_USB_DC_NXP_LPCIP3511
288292
usb_device_clock_init();

0 commit comments

Comments
 (0)