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>
21 if (wakeup_need_reset())
24 power_init(); /* Ensure ps_hold_setup() for early wakeup. */
27 /* Should never return. If we do, 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
)
42 if (status
== S5P_CHECK_SLEEP
)
43 return WAKEUP_NEED_CLOCK_RESET
;
48 void wakeup_enable_uart(void)
50 power_release_uart_retention();