soc: Remove copyright notices
[coreboot.git] / src / soc / samsung / exynos5420 / wakeup.c
blob86615f2516cfedbf3076827d908caee520ee5189
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 <arch/cache.h>
16 #include <soc/power.h>
17 #include <soc/wakeup.h>
19 void wakeup(void)
21 if (wakeup_need_reset())
22 power_reset();
24 power_init(); /* Ensure ps_hold_setup() for early wakeup. */
25 dcache_mmu_disable();
26 power_exit_wakeup();
27 /* Should never return. If we do, reset. */
28 power_reset();
31 int get_wakeup_state(void)
33 uint32_t status = power_read_reset_status();
35 /* DIDLE/LPA can be resumed without clock reset (ex, bootblock),
36 * and SLEEP requires resetting clock (should be done in ROM stage).
39 if (status == S5P_CHECK_DIDLE || status == S5P_CHECK_LPA)
40 return WAKEUP_DIRECT;
42 if (status == S5P_CHECK_SLEEP)
43 return WAKEUP_NEED_CLOCK_RESET;
45 return IS_NOT_WAKEUP;
48 void wakeup_enable_uart(void)
50 power_release_uart_retention();