1 /* 2 * Copyright (c) 2025, MediaTek Inc. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #include <common/debug.h> 8 #include <lib/mmio.h> 9 #include <lib/mtk_init/mtk_init.h> 10 #include <mtk_dcm_utils.h> 11 dcm_infra(bool on)12static void dcm_infra(bool on) 13 { 14 dcm_bcrm_apinfra_io_ctrl_ao_infra_bus_dcm(on); 15 dcm_bcrm_apinfra_io_noc_ao_infra_bus_dcm(on); 16 dcm_bcrm_apinfra_mem_ctrl_ao_infra_bus_dcm(on); 17 dcm_bcrm_apinfra_mem_intf_noc_ao_infra_bus_dcm(on); 18 } 19 dcm_mcusys(bool on)20static void dcm_mcusys(bool on) 21 { 22 dcm_mcusys_par_wrap_mcu_misc_dcm(on); 23 } 24 dcm_mcusys_acp(bool on)25static void dcm_mcusys_acp(bool on) 26 { 27 dcm_mcusys_par_wrap_mcu_acp_dcm(on); 28 } 29 dcm_mcusys_adb(bool on)30static void dcm_mcusys_adb(bool on) 31 { 32 dcm_mcusys_par_wrap_mcu_adb_dcm(on); 33 } 34 dcm_mcusys_apb(bool on)35static void dcm_mcusys_apb(bool on) 36 { 37 dcm_mcusys_par_wrap_mcu_apb_dcm(on); 38 } 39 dcm_mcusys_bus(bool on)40static void dcm_mcusys_bus(bool on) 41 { 42 dcm_mcusys_par_wrap_mcu_bus_qdcm(on); 43 } 44 dcm_mcusys_cbip(bool on)45static void dcm_mcusys_cbip(bool on) 46 { 47 dcm_mcusys_par_wrap_mcu_cbip_dcm(on); 48 } 49 dcm_mcusys_chi_mon(bool on)50static void dcm_mcusys_chi_mon(bool on) 51 { 52 dcm_mcusys_par_wrap_mcu_chi_mon_dcm(on); 53 } 54 dcm_mcusys_core(bool on)55static void dcm_mcusys_core(bool on) 56 { 57 dcm_mcusys_par_wrap_mcu_core_qdcm(on); 58 } 59 dcm_mcusys_dsu_acp(bool on)60static void dcm_mcusys_dsu_acp(bool on) 61 { 62 dcm_mcusys_par_wrap_mcu_dsu_acp_dcm(on); 63 } 64 dcm_mcusys_ebg(bool on)65static void dcm_mcusys_ebg(bool on) 66 { 67 dcm_mcusys_par_wrap_mcu_ebg_dcm(on); 68 } 69 dcm_mcusys_gic_spi(bool on)70static void dcm_mcusys_gic_spi(bool on) 71 { 72 dcm_mcusys_par_wrap_mcu_gic_spi_dcm(on); 73 } 74 dcm_mcusys_io(bool on)75static void dcm_mcusys_io(bool on) 76 { 77 dcm_mcusys_par_wrap_mcu_io_dcm(on); 78 } 79 dcm_mcusys_l3c(bool on)80static void dcm_mcusys_l3c(bool on) 81 { 82 dcm_mcusys_par_wrap_mcu_l3c_dcm(on); 83 } 84 dcm_mcusys_stall(bool on)85static void dcm_mcusys_stall(bool on) 86 { 87 dcm_mcusys_par_wrap_mcu_stalldcm(on); 88 } 89 dcm_vlp(bool on)90static void dcm_vlp(bool on) 91 { 92 dcm_vlp_ao_bcrm_vlp_bus_dcm(on); 93 } 94 mtk_dcm_init(void)95int mtk_dcm_init(void) 96 { 97 dcm_infra(true); 98 dcm_mcusys(true); 99 dcm_mcusys_acp(true); 100 dcm_mcusys_adb(true); 101 dcm_mcusys_apb(true); 102 dcm_mcusys_bus(true); 103 dcm_mcusys_cbip(true); 104 dcm_mcusys_chi_mon(true); 105 dcm_mcusys_core(true); 106 dcm_mcusys_dsu_acp(true); 107 dcm_mcusys_ebg(true); 108 dcm_mcusys_gic_spi(true); 109 dcm_mcusys_io(true); 110 dcm_mcusys_l3c(true); 111 dcm_mcusys_stall(true); 112 dcm_vlp(true); 113 114 return 0; 115 } 116 117 MTK_PLAT_SETUP_0_INIT(mtk_dcm_init); 118