soc: nxp: Add code to set I3C divider

Update RT5xx and RT6xx clock init to add the code
to set the I3C dividers. This code has been moved
from the I3C driver.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
This commit is contained in:
Mahesh Mahadevan 2024-09-10 15:21:28 -05:00 committed by Anas Nashif
commit e14c4f4dc2
2 changed files with 15 additions and 1 deletions

View file

@ -303,9 +303,16 @@ void __weak rt5xx_clock_init(void)
CLOCK_AttachClk(kFRO_DIV4_to_FLEXCOMM4); CLOCK_AttachClk(kFRO_DIV4_to_FLEXCOMM4);
#endif #endif
#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(i3c0), nxp_mcux_i3c, okay) #if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(i3c0), nxp_mcux_i3c, okay)
/* Attach main clock to I3C, divider will be set in i3c_mcux.c */ /* Attach main clock to I3C */
CLOCK_AttachClk(kMAIN_CLK_to_I3C_CLK); CLOCK_AttachClk(kMAIN_CLK_to_I3C_CLK);
CLOCK_AttachClk(kLPOSC_to_I3C_TC_CLK); CLOCK_AttachClk(kLPOSC_to_I3C_TC_CLK);
CLOCK_SetClkDiv(kCLOCK_DivI3cClk,
DT_PROP(DT_NODELABEL(i3c0), clk_divider));
CLOCK_SetClkDiv(kCLOCK_DivI3cSlowClk,
DT_PROP(DT_NODELABEL(i3c0), clk_divider_slow));
CLOCK_SetClkDiv(kCLOCK_DivI3cTcClk,
DT_PROP(DT_NODELABEL(i3c0), clk_divider_tc));
#endif #endif
#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(hs_spi1), nxp_lpc_spi, okay) #if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(hs_spi1), nxp_lpc_spi, okay)
CLOCK_AttachClk(kFRO_DIV4_to_FLEXCOMM16); CLOCK_AttachClk(kFRO_DIV4_to_FLEXCOMM16);

View file

@ -307,6 +307,13 @@ static ALWAYS_INLINE void clock_init(void)
#if (DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(i3c0), nxp_mcux_i3c, okay)) #if (DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(i3c0), nxp_mcux_i3c, okay))
CLOCK_AttachClk(kFFRO_to_I3C_CLK); CLOCK_AttachClk(kFFRO_to_I3C_CLK);
CLOCK_AttachClk(kLPOSC_to_I3C_TC_CLK); CLOCK_AttachClk(kLPOSC_to_I3C_TC_CLK);
CLOCK_SetClkDiv(kCLOCK_DivI3cClk,
DT_PROP(DT_NODELABEL(i3c0), clk_divider));
CLOCK_SetClkDiv(kCLOCK_DivI3cSlowClk,
DT_PROP(DT_NODELABEL(i3c0), clk_divider_slow));
CLOCK_SetClkDiv(kCLOCK_DivI3cTcClk,
DT_PROP(DT_NODELABEL(i3c0), clk_divider_tc));
#endif #endif
#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(lpadc0), nxp_lpc_lpadc, okay) #if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(lpadc0), nxp_lpc_lpadc, okay)