@@ -324,15 +324,19 @@ static const char * const anc_md32_parents[] = {
324
324
"univpll_d5" ,
325
325
};
326
326
327
+ /*
328
+ * Clock mux ddrphycfg is needed by the DRAM controller. We mark it as
329
+ * critical as otherwise the system will hang after boot.
330
+ */
327
331
static const struct mtk_composite top_muxes [] = {
328
332
MUX (CLK_TOP_MUX_ULPOSC_AXI_CK_MUX_PRE , "ulposc_axi_ck_mux_pre" ,
329
333
ulposc_axi_ck_mux_pre_parents , 0x0040 , 3 , 1 ),
330
334
MUX (CLK_TOP_MUX_ULPOSC_AXI_CK_MUX , "ulposc_axi_ck_mux" ,
331
335
ulposc_axi_ck_mux_parents , 0x0040 , 2 , 1 ),
332
336
MUX (CLK_TOP_MUX_AXI , "axi_sel" , axi_parents ,
333
337
0x0040 , 0 , 2 ),
334
- MUX (CLK_TOP_MUX_DDRPHYCFG , "ddrphycfg_sel" , ddrphycfg_parents ,
335
- 0x0040 , 16 , 2 ),
338
+ MUX_FLAGS (CLK_TOP_MUX_DDRPHYCFG , "ddrphycfg_sel" , ddrphycfg_parents ,
339
+ 0x0040 , 16 , 2 , CLK_IS_CRITICAL | CLK_SET_RATE_PARENT ),
336
340
MUX (CLK_TOP_MUX_MM , "mm_sel" , mm_parents ,
337
341
0x0040 , 24 , 2 ),
338
342
MUX_GATE (CLK_TOP_MUX_PWM , "pwm_sel" , pwm_parents , 0x0050 , 0 , 3 , 7 ),
@@ -424,33 +428,45 @@ static const struct mtk_gate_regs infra2_cg_regs = {
424
428
.sta_ofs = 0x00b0 ,
425
429
};
426
430
427
- #define GATE_ICG0 (_id , _name , _parent , _shift ) { \
428
- .id = _id, \
429
- .name = _name, \
430
- .parent_name = _parent, \
431
- .regs = &infra0_cg_regs, \
432
- .shift = _shift, \
433
- .ops = &mtk_clk_gate_ops_setclr, \
431
+ #define GATE_ICG0 (_id , _name , _parent , _shift ) { \
432
+ .id = _id, \
433
+ .name = _name, \
434
+ .parent_name = _parent, \
435
+ .regs = &infra0_cg_regs, \
436
+ .shift = _shift, \
437
+ .ops = &mtk_clk_gate_ops_setclr, \
434
438
}
435
439
436
- #define GATE_ICG1 (_id , _name , _parent , _shift ) { \
437
- .id = _id, \
438
- .name = _name, \
439
- .parent_name = _parent, \
440
- .regs = &infra1_cg_regs, \
441
- .shift = _shift, \
442
- .ops = &mtk_clk_gate_ops_setclr, \
440
+ #define GATE_ICG1 (_id , _name , _parent , _shift ) \
441
+ GATE_ICG1_FLAGS(_id, _name, _parent, _shift, 0)
442
+
443
+ #define GATE_ICG1_FLAGS (_id , _name , _parent , _shift , _flags ) { \
444
+ .id = _id, \
445
+ .name = _name, \
446
+ .parent_name = _parent, \
447
+ .regs = &infra1_cg_regs, \
448
+ .shift = _shift, \
449
+ .ops = &mtk_clk_gate_ops_setclr, \
450
+ .flags = _flags, \
443
451
}
444
452
445
- #define GATE_ICG2 (_id , _name , _parent , _shift ) { \
446
- .id = _id, \
447
- .name = _name, \
448
- .parent_name = _parent, \
449
- .regs = &infra2_cg_regs, \
450
- .shift = _shift, \
451
- .ops = &mtk_clk_gate_ops_setclr, \
453
+ #define GATE_ICG2 (_id , _name , _parent , _shift ) \
454
+ GATE_ICG2_FLAGS(_id, _name, _parent, _shift, 0)
455
+
456
+ #define GATE_ICG2_FLAGS (_id , _name , _parent , _shift , _flags ) { \
457
+ .id = _id, \
458
+ .name = _name, \
459
+ .parent_name = _parent, \
460
+ .regs = &infra2_cg_regs, \
461
+ .shift = _shift, \
462
+ .ops = &mtk_clk_gate_ops_setclr, \
463
+ .flags = _flags, \
452
464
}
453
465
466
+ /*
467
+ * Clock gates dramc and dramc_b are needed by the DRAM controller.
468
+ * We mark them as critical as otherwise the system will hang after boot.
469
+ */
454
470
static const struct mtk_gate infra_clks [] = {
455
471
GATE_ICG0 (CLK_INFRA_PMIC_TMR , "infra_pmic_tmr" , "ulposc" , 0 ),
456
472
GATE_ICG0 (CLK_INFRA_PMIC_AP , "infra_pmic_ap" , "pmicspi_sel" , 1 ),
@@ -505,7 +521,8 @@ static const struct mtk_gate infra_clks[] = {
505
521
GATE_ICG1 (CLK_INFRA_CCIF_AP , "infra_ccif_ap" , "axi_sel" , 23 ),
506
522
GATE_ICG1 (CLK_INFRA_AUDIO , "infra_audio" , "axi_sel" , 25 ),
507
523
GATE_ICG1 (CLK_INFRA_CCIF_MD , "infra_ccif_md" , "axi_sel" , 26 ),
508
- GATE_ICG1 (CLK_INFRA_DRAMC_F26M , "infra_dramc_f26m" , "clk26m" , 31 ),
524
+ GATE_ICG1_FLAGS (CLK_INFRA_DRAMC_F26M , "infra_dramc_f26m" ,
525
+ "clk26m" , 31 , CLK_IS_CRITICAL ),
509
526
GATE_ICG2 (CLK_INFRA_I2C4 , "infra_i2c4" , "axi_sel" , 0 ),
510
527
GATE_ICG2 (CLK_INFRA_I2C_APPM , "infra_i2c_appm" , "axi_sel" , 1 ),
511
528
GATE_ICG2 (CLK_INFRA_I2C_GPUPM , "infra_i2c_gpupm" , "axi_sel" , 2 ),
@@ -516,7 +533,8 @@ static const struct mtk_gate infra_clks[] = {
516
533
GATE_ICG2 (CLK_INFRA_I2C5 , "infra_i2c5" , "axi_sel" , 7 ),
517
534
GATE_ICG2 (CLK_INFRA_SYS_CIRQ , "infra_sys_cirq" , "axi_sel" , 8 ),
518
535
GATE_ICG2 (CLK_INFRA_SPI1 , "infra_spi1" , "spi_sel" , 10 ),
519
- GATE_ICG2 (CLK_INFRA_DRAMC_B_F26M , "infra_dramc_b_f26m" , "clk26m" , 11 ),
536
+ GATE_ICG2_FLAGS (CLK_INFRA_DRAMC_B_F26M , "infra_dramc_b_f26m" ,
537
+ "clk26m" , 11 , CLK_IS_CRITICAL ),
520
538
GATE_ICG2 (CLK_INFRA_ANC_MD32 , "infra_anc_md32" , "anc_md32_sel" , 12 ),
521
539
GATE_ICG2 (CLK_INFRA_ANC_MD32_32K , "infra_anc_md32_32k" , "clk26m" , 13 ),
522
540
GATE_ICG2 (CLK_INFRA_DVFS_SPM1 , "infra_dvfs_spm1" , "axi_sel" , 15 ),
0 commit comments