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. */
12
power_exit_wakeup
();
13
/* Should never return. If we do, reset. */
14
power_reset
();
15
}
16
17
int
get_wakeup_state
(
void
)
18
{
19
uint32_t
status =
power_read_reset_status
();
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
)
29
return
WAKEUP_NEED_CLOCK_RESET
;
30
31
return
IS_NOT_WAKEUP
;
32
}
33
34
void
wakeup_enable_uart
(
void
)
35
{
36
power_release_uart_retention
();
37
}
wakeup_need_reset
int wakeup_need_reset(void)
Definition:
wakeup.c:6
power_exit_wakeup
void power_exit_wakeup(void)
Definition:
power.c:58
power_release_uart_retention
void power_release_uart_retention(void)
Definition:
power.c:78
power_read_reset_status
uint32_t power_read_reset_status(void)
Definition:
power.c:53
power_reset
void power_reset(void)
Perform a software reset.
Definition:
power.c:20
power_init
int power_init(void)
Definition:
power.c:65
get_wakeup_state
int get_wakeup_state(void)
Definition:
wakeup.c:17
wakeup_enable_uart
void wakeup_enable_uart(void)
Definition:
wakeup.c:34
wakeup
void wakeup(void)
Definition:
wakeup.c:6
uint32_t
unsigned int uint32_t
Definition:
stdint.h:14
wakeup.h
S5P_CHECK_DIDLE
#define S5P_CHECK_DIDLE
Definition:
wakeup.h:8
S5P_CHECK_SLEEP
#define S5P_CHECK_SLEEP
Definition:
wakeup.h:7
WAKEUP_DIRECT
@ WAKEUP_DIRECT
Definition:
wakeup.h:15
WAKEUP_NEED_CLOCK_RESET
@ WAKEUP_NEED_CLOCK_RESET
Definition:
wakeup.h:18
IS_NOT_WAKEUP
@ IS_NOT_WAKEUP
Definition:
wakeup.h:13
S5P_CHECK_LPA
#define S5P_CHECK_LPA
Definition:
wakeup.h:9
src
soc
samsung
exynos5250
wakeup.c
Generated by
1.9.1