mb/google/nissa/var/gothrax: Add probe and GPIO config for HDMI and
[coreboot2.git] / src / soc / samsung / exynos5420 / power.c
blob0a1b02653488a451dd5932832a85721971a58e18
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 /* Power setup code for EXYNOS5 */
5 #include <device/mmio.h>
6 #include <halt.h>
7 #include <soc/dmc.h>
8 #include <soc/power.h>
9 #include <soc/setup.h>
11 /* Set the PS-Hold drive value */
12 static void ps_hold_setup(void)
14 /* Set PS-Hold high */
15 setbits32(&exynos_power->ps_hold_ctrl,
16 POWER_PS_HOLD_CONTROL_DATA_HIGH);
19 void power_reset(void)
21 /* Clear inform1 so there's no change we think we've got a wake reset */
22 exynos_power->inform1 = 0;
24 setbits32(&exynos_power->sw_reset, 1);
27 /* This function never returns */
28 void power_shutdown(void)
30 clrbits32(&exynos_power->ps_hold_ctrl,
31 POWER_PS_HOLD_CONTROL_DATA_HIGH);
33 halt();
36 void power_enable_dp_phy(void)
38 setbits32(&exynos_power->dptx_phy_control, EXYNOS_DP_PHY_ENABLE);
41 void power_enable_hw_thermal_trip(void)
43 /* Enable HW thermal trip */
44 setbits32(&exynos_power->ps_hold_ctrl, POWER_ENABLE_HW_TRIP);
47 uint32_t power_read_reset_status(void)
49 return exynos_power->inform1;
52 void power_exit_wakeup(void)
54 typedef void (*resume_func)(void);
56 ((resume_func)exynos_power->inform0)();
59 int power_init(void)
61 ps_hold_setup();
62 return 0;
65 void power_enable_xclkout(void)
67 /* use xxti for xclk out */
68 clrsetbits32(&exynos_power->pmu_debug, PMU_DEBUG_CLKOUT_SEL_MASK,
69 PMU_DEBUG_XXTI);
72 void power_release_uart_retention(void)
74 write32(&exynos_power->padret_uart_opt, 1 << 28);