From b77c50d7b8c0941c491fd2f8445658d9d79f8e09 Mon Sep 17 00:00:00 2001 From: Maxime Vincent Date: Thu, 7 Nov 2024 09:08:56 +0100 Subject: [PATCH] soc: arm: nxp: lpc55xx flexcomm 3->7 clock init Add clock init for FlexComm 3,4,5,6,7 in case they are enabled in DeviceTree Signed-off-by: Maxime Vincent --- soc/nxp/lpc/lpc55xxx/soc.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/soc/nxp/lpc/lpc55xxx/soc.c b/soc/nxp/lpc/lpc55xxx/soc.c index 1959b525e92..7b7332d0b61 100644 --- a/soc/nxp/lpc/lpc55xxx/soc.c +++ b/soc/nxp/lpc/lpc55xxx/soc.c @@ -184,6 +184,10 @@ static ALWAYS_INLINE void clock_init(void) CLOCK_AttachClk(kFRO12M_to_FLEXCOMM2); #endif +#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(flexcomm3), nxp_lpc_usart, okay) + CLOCK_AttachClk(kFRO_HF_DIV_to_FLEXCOMM3); +#endif + #if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(flexcomm4), nxp_lpc_i2c, okay) #if defined(CONFIG_SOC_LPC55S36) CLOCK_SetClkDiv(kCLOCK_DivFlexcom4Clk, 0U, true); @@ -193,6 +197,22 @@ static ALWAYS_INLINE void clock_init(void) CLOCK_AttachClk(kFRO12M_to_FLEXCOMM4); #endif +#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(flexcomm4), nxp_lpc_usart, okay) + CLOCK_AttachClk(kFRO_HF_DIV_to_FLEXCOMM4); +#endif + +#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(flexcomm5), nxp_lpc_usart, okay) + CLOCK_AttachClk(kFRO_HF_DIV_to_FLEXCOMM5); +#endif + +#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(flexcomm6), nxp_lpc_usart, okay) + CLOCK_AttachClk(kFRO_HF_DIV_to_FLEXCOMM6); +#endif + +#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(flexcomm7), nxp_lpc_usart, okay) + CLOCK_AttachClk(kFRO_HF_DIV_to_FLEXCOMM7); +#endif + #if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(hs_lspi)) /* Attach 12 MHz clock to HSLSPI */ CLOCK_AttachClk(kFRO_HF_DIV_to_HSLSPI);