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 <arch/cache.h>
4
#include <soc/power.h>
5
#include <
soc/wakeup.h
>
6
7
void
wakeup
(
void
)
8
{
9
if
(
wakeup_need_reset
())
10
power_reset
();
11
12
power_init
();
/* Ensure ps_hold_setup() for early wakeup. */
13
dcache_mmu_disable
();
14
power_exit_wakeup
();
15
/* Should never return. If we do, reset. */
16
power_reset
();
17
}
18
19
int
get_wakeup_state
(
void
)
20
{
21
uint32_t
status =
power_read_reset_status
();
22
23
/* DIDLE/LPA can be resumed without clock reset (ex, bootblock),
24
* and SLEEP requires resetting clock (should be done in ROM stage).
25
*/
26
27
if
(status ==
S5P_CHECK_DIDLE
|| status ==
S5P_CHECK_LPA
)
28
return
WAKEUP_DIRECT
;
29
30
if
(status ==
S5P_CHECK_SLEEP
)
31
return
WAKEUP_NEED_CLOCK_RESET
;
32
33
return
IS_NOT_WAKEUP
;
34
}
35
36
void
wakeup_enable_uart
(
void
)
37
{
38
power_release_uart_retention
();
39
}
dcache_mmu_disable
void dcache_mmu_disable(void)
Definition:
cache.c:49
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
exynos5420
wakeup.c
Generated by
1.9.1