coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
wakeup.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <soc/power.h>
4 #include <soc/wakeup.h>
5 
6 void wakeup(void)
7 {
8  if (wakeup_need_reset())
9  power_reset();
10 
11  power_init(); /* Ensure ps_hold_setup() for early wakeup. */
13  /* Should never return. If we do, reset. */
14  power_reset();
15 }
16 
18 {
20 
21  /* DIDLE/LPA can be resumed without clock reset (ex, bootblock),
22  * and SLEEP requires resetting clock (should be done in ROM stage).
23  */
24 
25  if (status == S5P_CHECK_DIDLE || status == S5P_CHECK_LPA)
26  return WAKEUP_DIRECT;
27 
28  if (status == S5P_CHECK_SLEEP)
30 
31  return IS_NOT_WAKEUP;
32 }
33 
35 {
37 }
int wakeup_need_reset(void)
Definition: wakeup.c:6
void power_exit_wakeup(void)
Definition: power.c:58
void power_release_uart_retention(void)
Definition: power.c:78
uint32_t power_read_reset_status(void)
Definition: power.c:53
void power_reset(void)
Perform a software reset.
Definition: power.c:20
int power_init(void)
Definition: power.c:65
int get_wakeup_state(void)
Definition: wakeup.c:17
void wakeup_enable_uart(void)
Definition: wakeup.c:34
void wakeup(void)
Definition: wakeup.c:6
unsigned int uint32_t
Definition: stdint.h:14
#define S5P_CHECK_DIDLE
Definition: wakeup.h:8
#define S5P_CHECK_SLEEP
Definition: wakeup.h:7
@ WAKEUP_DIRECT
Definition: wakeup.h:15
@ WAKEUP_NEED_CLOCK_RESET
Definition: wakeup.h:18
@ IS_NOT_WAKEUP
Definition: wakeup.h:13
#define S5P_CHECK_LPA
Definition: wakeup.h:9