| 1 |
|
| 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(); |
| 13 |
dcache_mmu_disable(); |
| 14 |
power_exit_wakeup(); |
| 15 |
|
| 16 |
power_reset(); |
| 17 |
} |
| 18 |
|
| 19 |
int get_wakeup_state(void) |
| 20 |
{ |
| 21 |
uint32_t status = power_read_reset_status(); |
| 22 |
|
| 23 |
|
| 24 |
|
| 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 |
} |