Debian Codegraph @

src/soc/mediatek/mt8196/pwrsel.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only OR MIT */
2
3 #include <console/console.h>
4 #include <device/mmio.h>
5 #include <soc/pwrsel.h>
6
7 static void cpu_pwrsel_init(void)
8 {
9 write32p(MCUSYS_BASE + OFFSET_PWRSEL, VAL_PWRSEL);
10 write32p(MCUSYS_BASE + OFFSET_PWRSEL_AUTO_MODE_CFG, VAL_PWRSEL_AUTO_MODE);
11 }
12
13 static void gpu_pwrsel_init(void)
14 {
15 write32p(MFG_VCORE_AO_RPC_PWRSEL_CONFIG, GENMASK(14, 0));
16 }
17
18 void pwrsel_init(void)
19 {
20 cpu_pwrsel_init();
21 gpu_pwrsel_init();
22
23 /* PWR_SEL must be 0x0 */
24 printk(BIOS_DEBUG, "PWR_SEL = %#x\n", read32p(MCUSYS_BASE + OFFSET_PWRSEL));
25 /* PWRSEL_CONFIG must be 0x7fff */
26 printk(BIOS_DEBUG, "PWRSEL_CONFIG = %#x\n", read32p(MFG_VCORE_AO_RPC_PWRSEL_CONFIG));
27 }