drivers/wifi: Remove unnecessary data structure copy
[coreboot2.git] / src / soc / samsung / exynos5250 / power.c
blob88805132a6a88195a9479daa6693247688536003
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 <reset.h>
8 #include <soc/dmc.h>
9 #include <soc/power.h>
10 #include <soc/setup.h>
12 /* Set the PS-Hold drive value */
13 static void ps_hold_setup(void)
15 /* Set PS-Hold high */
16 setbits32(&exynos_power->ps_hold_ctrl,
17 POWER_PS_HOLD_CONTROL_DATA_HIGH);
20 void power_reset(void)
22 /* Clear inform1 so there's no change we think we've got a wake reset */
23 exynos_power->inform1 = 0;
25 setbits32(&exynos_power->sw_reset, 1);
28 void do_board_reset(void)
30 power_reset();
33 /* This function never returns */
34 void power_shutdown(void)
36 clrbits32(&exynos_power->ps_hold_ctrl,
37 POWER_PS_HOLD_CONTROL_DATA_HIGH);
39 halt();
42 void power_enable_dp_phy(void)
44 setbits32(&exynos_power->dptx_phy_control, EXYNOS_DP_PHY_ENABLE);
47 void power_enable_hw_thermal_trip(void)
49 /* Enable HW thermal trip */
50 setbits32(&exynos_power->ps_hold_ctrl, POWER_ENABLE_HW_TRIP);
53 uint32_t power_read_reset_status(void)
55 return exynos_power->inform1;
58 void power_exit_wakeup(void)
60 typedef void (*resume_func)(void);
62 ((resume_func)exynos_power->inform0)();
65 int power_init(void)
67 ps_hold_setup();
68 return 0;
71 void power_enable_xclkout(void)
73 /* use xxti for xclk out */
74 clrsetbits32(&exynos_power->pmu_debug, PMU_DEBUG_CLKOUT_SEL_MASK,
75 PMU_DEBUG_XXTI);
78 void power_release_uart_retention(void)
80 write32(&exynos_power->padret_uart_opt, 1 << 28);