@@ -104,6 +104,39 @@ static void SOC_RdcInit(void)
104
104
/* Set access to I2C-4 for M4 core */
105
105
RDC_SetPdapAccess (RDC , rdcPdapI2c4 , RDC_DT_VAL (i2c4 ), false, false);
106
106
#endif
107
+
108
+ #if DT_NODE_HAS_STATUS (DT_NODELABEL (pwm1 ), okay )
109
+ /* Set access to PWM-1 for M4 core */
110
+ RDC_SetPdapAccess (RDC , rdcPdapPwm1 , RDC_DT_VAL (pwm1 ), false, false);
111
+ #endif
112
+ #if DT_NODE_HAS_STATUS (DT_NODELABEL (pwm2 ), okay )
113
+ /* Set access to PWM-2 for M4 core */
114
+ RDC_SetPdapAccess (RDC , rdcPdapPwm2 , RDC_DT_VAL (pwm2 ), false, false);
115
+ #endif
116
+ #if DT_NODE_HAS_STATUS (DT_NODELABEL (pwm3 ), okay )
117
+ /* Set access to PWM-3 for M4 core */
118
+ RDC_SetPdapAccess (RDC , rdcPdapPwm3 , RDC_DT_VAL (pwm3 ), false, false);
119
+ #endif
120
+ #if DT_NODE_HAS_STATUS (DT_NODELABEL (pwm4 ), okay )
121
+ /* Set access to PWM-4 for M4 core */
122
+ RDC_SetPdapAccess (RDC , rdcPdapPwm4 , RDC_DT_VAL (pwm4 ), false, false);
123
+ #endif
124
+ #if DT_NODE_HAS_STATUS (DT_NODELABEL (pwm5 ), okay )
125
+ /* Set access to PWM-5 for M4 core */
126
+ RDC_SetPdapAccess (RDC , rdcPdapPwm5 , RDC_DT_VAL (pwm5 ), false, false);
127
+ #endif
128
+ #if DT_NODE_HAS_STATUS (DT_NODELABEL (pwm6 ), okay )
129
+ /* Set access to PWM-6 for M4 core */
130
+ RDC_SetPdapAccess (RDC , rdcPdapPwm6 , RDC_DT_VAL (pwm6 ), false, false);
131
+ #endif
132
+ #if DT_NODE_HAS_STATUS (DT_NODELABEL (pwm7 ), okay )
133
+ /* Set access to PWM-7 for M4 core */
134
+ RDC_SetPdapAccess (RDC , rdcPdapPwm7 , RDC_DT_VAL (pwm7 ), false, false);
135
+ #endif
136
+ #if DT_NODE_HAS_STATUS (DT_NODELABEL (pwm8 ), okay )
137
+ /* Set access to PWM-8 for M4 core */
138
+ RDC_SetPdapAccess (RDC , rdcPdapPwm8 , RDC_DT_VAL (pwm8 ), false, false);
139
+ #endif
107
140
}
108
141
109
142
/* Initialize cache. */
@@ -196,7 +229,41 @@ static void SOC_ClockInit(void)
196
229
#if DT_NODE_HAS_STATUS (DT_NODELABEL (i2c4 ), okay )
197
230
CCM_ControlGate (CCM , ccmCcgrGateI2c4Serialclk , ccmClockNeededAll );
198
231
#endif
232
+ #endif /* CONFIG_I2C_IMX */
233
+
234
+ #ifdef CONFIG_PWM_IMX
235
+ /* Select PWM clock is derived from OSC (24M) */
236
+ CCM_SetRootMux (CCM , ccmRootPerclkClkSel , ccmRootmuxPerclkClkOsc24m );
237
+
238
+ /* Set relevant divider = 1. */
239
+ CCM_SetRootDivider (CCM , ccmRootPerclkPodf , 0 );
240
+
241
+ /* Enable PWM clock */
242
+ #if DT_NODE_HAS_STATUS (DT_NODELABEL (pwm1 ), okay )
243
+ CCM_ControlGate (CCM , ccmCcgrGatePwm1Clk , ccmClockNeededAll );
244
+ #endif
245
+ #if DT_NODE_HAS_STATUS (DT_NODELABEL (pwm2 ), okay )
246
+ CCM_ControlGate (CCM , ccmCcgrGatePwm2Clk , ccmClockNeededAll );
247
+ #endif
248
+ #if DT_NODE_HAS_STATUS (DT_NODELABEL (pwm3 ), okay )
249
+ CCM_ControlGate (CCM , ccmCcgrGatePwm3Clk , ccmClockNeededAll );
250
+ #endif
251
+ #if DT_NODE_HAS_STATUS (DT_NODELABEL (pwm4 ), okay )
252
+ CCM_ControlGate (CCM , ccmCcgrGatePwm4Clk , ccmClockNeededAll );
253
+ #endif
254
+ #if DT_NODE_HAS_STATUS (DT_NODELABEL (pwm5 ), okay )
255
+ CCM_ControlGate (CCM , ccmCcgrGatePwm5Clk , ccmClockNeededAll );
256
+ #endif
257
+ #if DT_NODE_HAS_STATUS (DT_NODELABEL (pwm6 ), okay )
258
+ CCM_ControlGate (CCM , ccmCcgrGatePwm6Clk , ccmClockNeededAll );
259
+ #endif
260
+ #if DT_NODE_HAS_STATUS (DT_NODELABEL (pwm7 ), okay )
261
+ CCM_ControlGate (CCM , ccmCcgrGatePwm7Clk , ccmClockNeededAll );
262
+ #endif
263
+ #if DT_NODE_HAS_STATUS (DT_NODELABEL (pwm8 ), okay )
264
+ CCM_ControlGate (CCM , ccmCcgrGatePwm8Clk , ccmClockNeededAll );
199
265
#endif
266
+ #endif /* CONFIG_PWM_IMX */
200
267
}
201
268
202
269
/**
0 commit comments