soc: Remove copyright notices
[coreboot.git] / src / soc / samsung / exynos5250 / wakeup.c
blob4e6b4b846968a9a91d894987dd9ca299c70bcd8b
1 /*
2 * This file is part of the coreboot project.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 2 of the License.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
15 #include <soc/power.h>
16 #include <soc/wakeup.h>
18 void wakeup(void)
20 if (wakeup_need_reset())
21 power_reset();
23 power_init(); /* Ensure ps_hold_setup() for early wakeup. */
24 power_exit_wakeup();
25 /* Should never return. If we do, reset. */
26 power_reset();
29 int get_wakeup_state(void)
31 uint32_t status = power_read_reset_status();
33 /* DIDLE/LPA can be resumed without clock reset (ex, bootblock),
34 * and SLEEP requires resetting clock (should be done in ROM stage).
37 if (status == S5P_CHECK_DIDLE || status == S5P_CHECK_LPA)
38 return WAKEUP_DIRECT;
40 if (status == S5P_CHECK_SLEEP)
41 return WAKEUP_NEED_CLOCK_RESET;
43 return IS_NOT_WAKEUP;
46 void wakeup_enable_uart(void)
48 power_release_uart_retention();