Skip to content

Commit f5ab199

Browse files
mmahadevan108kartben
authored andcommitted
soc: nxp_rw6xx: Do not enable unused clocks
Update the clock init code to gate off unused clocks. Signed-off-by: Mahesh Mahadevan <[email protected]>
1 parent 1e492e8 commit f5ab199

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

soc/nxp/rw/soc.c

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,6 @@ __imx_boot_ivt_section void (*const image_vector_table[])(void) = {
6767
};
6868
#endif /* CONFIG_NXP_RW6XX_BOOT_HEADER */
6969

70-
const clock_avpll_config_t avpll_config = {
71-
.ch1Freq = kCLOCK_AvPllChFreq12p288m,
72-
.ch2Freq = kCLOCK_AvPllChFreq64m,
73-
.enableCali = true
74-
};
75-
7670
/**
7771
* @brief Initialize the system clocks and peripheral clocks
7872
*
@@ -95,8 +89,6 @@ __weak __ramfunc void clock_init(void)
9589

9690
/* Initialize T3 clocks and t3pll_mci_48_60m_irc configured to 48.3MHz */
9791
CLOCK_InitT3RefClk(kCLOCK_T3MciIrc48m);
98-
/* Enable FFRO */
99-
CLOCK_EnableClock(kCLOCK_T3PllMciIrcClk);
10092
/* Enable T3 256M clock and SFRO */
10193
CLOCK_EnableClock(kCLOCK_T3PllMci256mClk);
10294

@@ -114,17 +106,9 @@ __weak __ramfunc void clock_init(void)
114106
/* Enable tcpu_mci_clk 260MHz. Keep tcpu_mci_flexspi_clk gated. */
115107
CLOCK_EnableClock(kCLOCK_TcpuMciClk);
116108

117-
/* tddr_mci_flexspi_clk 320MHz */
118-
CLOCK_InitTddrRefClk(kCLOCK_TddrFlexspiDiv10);
119-
CLOCK_EnableClock(kCLOCK_TddrMciFlexspiClk); /* 320MHz */
120-
121109
/* Enable AUX0 PLL to 260 MHz */
122110
CLOCK_SetClkDiv(kCLOCK_DivAux0PllClk, 1U);
123111

124-
/* Init AVPLL and enable both channels */
125-
CLOCK_InitAvPll(&avpll_config);
126-
CLOCK_SetClkDiv(kCLOCK_DivAudioPllClk, 1U);
127-
128112
/* Configure MainPll to 260MHz, then let CM33 run on Main PLL. */
129113
CLOCK_SetClkDiv(kCLOCK_DivSysCpuAhbClk, 1U);
130114
CLOCK_SetClkDiv(kCLOCK_DivMainPllClk, 1U);
@@ -229,7 +213,17 @@ __weak __ramfunc void clock_init(void)
229213
#endif
230214
#endif /* CONFIG_SPI */
231215

232-
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(dmic0)) && CONFIG_AUDIO_DMIC_MCUX
216+
#if (DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(dmic0)) && CONFIG_AUDIO_DMIC_MCUX) || CONFIG_I2S
217+
const clock_avpll_config_t avpll_config = {
218+
.ch1Freq = kCLOCK_AvPllChFreq12p288m,
219+
.ch2Freq = kCLOCK_AvPllChFreq64m,
220+
.enableCali = true
221+
};
222+
223+
/* Init AVPLL and enable both channels */
224+
CLOCK_InitAvPll(&avpll_config);
225+
CLOCK_SetClkDiv(kCLOCK_DivAudioPllClk, 1U);
226+
233227
/* Clock DMIC from Audio PLL. PLL output is sourced from AVPLL
234228
* channel 1, which is clocked at 12.288 MHz. We can divide this
235229
* by 4 to achieve the desired DMIC bit clk of 3.072 MHz

0 commit comments

Comments
 (0)