Skip to content

Commit e14c4f4

Browse files
mmahadevan108nashif
authored andcommitted
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 <[email protected]>
1 parent bf897cf commit e14c4f4

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

soc/nxp/imxrt/imxrt5xx/cm33/soc.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,16 @@ void __weak rt5xx_clock_init(void)
303303
CLOCK_AttachClk(kFRO_DIV4_to_FLEXCOMM4);
304304
#endif
305305
#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(i3c0), nxp_mcux_i3c, okay)
306-
/* Attach main clock to I3C, divider will be set in i3c_mcux.c */
306+
/* Attach main clock to I3C */
307307
CLOCK_AttachClk(kMAIN_CLK_to_I3C_CLK);
308308
CLOCK_AttachClk(kLPOSC_to_I3C_TC_CLK);
309+
310+
CLOCK_SetClkDiv(kCLOCK_DivI3cClk,
311+
DT_PROP(DT_NODELABEL(i3c0), clk_divider));
312+
CLOCK_SetClkDiv(kCLOCK_DivI3cSlowClk,
313+
DT_PROP(DT_NODELABEL(i3c0), clk_divider_slow));
314+
CLOCK_SetClkDiv(kCLOCK_DivI3cTcClk,
315+
DT_PROP(DT_NODELABEL(i3c0), clk_divider_tc));
309316
#endif
310317
#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(hs_spi1), nxp_lpc_spi, okay)
311318
CLOCK_AttachClk(kFRO_DIV4_to_FLEXCOMM16);

soc/nxp/imxrt/imxrt6xx/cm33/soc.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,13 @@ static ALWAYS_INLINE void clock_init(void)
307307
#if (DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(i3c0), nxp_mcux_i3c, okay))
308308
CLOCK_AttachClk(kFFRO_to_I3C_CLK);
309309
CLOCK_AttachClk(kLPOSC_to_I3C_TC_CLK);
310+
311+
CLOCK_SetClkDiv(kCLOCK_DivI3cClk,
312+
DT_PROP(DT_NODELABEL(i3c0), clk_divider));
313+
CLOCK_SetClkDiv(kCLOCK_DivI3cSlowClk,
314+
DT_PROP(DT_NODELABEL(i3c0), clk_divider_slow));
315+
CLOCK_SetClkDiv(kCLOCK_DivI3cTcClk,
316+
DT_PROP(DT_NODELABEL(i3c0), clk_divider_tc));
310317
#endif
311318

312319
#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(lpadc0), nxp_lpc_lpadc, okay)

0 commit comments

Comments
 (0)