3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 as
5 * published by the Free Software Foundation.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
13 #include <device/mmio.h>
14 #include <soc/addressmap.h>
15 #include <soc/infracfg.h>
17 #include <soc/md_ctrl.h>
19 #define TOPCKGEN_CLK_MODE_MD_32K (1 << 8)
20 #define TOPCKGEN_CLK_MODE_MD_26M (1 << 9)
21 #define INFRA_MISC2_SRCCLKENA_RELEASE (0xFF)
23 static void internal_md_power_down(void)
26 setbits32(&mtk_topckgen
->clk_mode
,
27 TOPCKGEN_CLK_MODE_MD_32K
| TOPCKGEN_CLK_MODE_MD_26M
);
28 /* Release SRCCLKENA */
29 clrbits32(&mt8183_infracfg
->infra_misc2
,
30 INFRA_MISC2_SRCCLKENA_RELEASE
);
33 void mtk_md_early_init(void)
35 internal_md_power_down();