Blame view
include/acpi_s3.h
2.88 KB
83d290c56 SPDX: Convert all... |
1 |
/* SPDX-License-Identifier: GPL-2.0+ */ |
4372c111d x86: acpi: Add Kc... |
2 3 |
/* * Copyright (C) 2017, Bin Meng <bmeng.cn@gmail.com> |
4372c111d x86: acpi: Add Kc... |
4 5 6 7 |
*/ #ifndef __ASM_ACPI_S3_H__ #define __ASM_ACPI_S3_H__ |
2b2d666f9 x86: acpi: Add wa... |
8 |
#define WAKEUP_BASE 0x600 |
4372c111d x86: acpi: Add Kc... |
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
/* PM1_STATUS register */ #define WAK_STS (1 << 15) #define PCIEXPWAK_STS (1 << 14) #define RTC_STS (1 << 10) #define SLPBTN_STS (1 << 9) #define PWRBTN_STS (1 << 8) #define GBL_STS (1 << 5) #define BM_STS (1 << 4) #define TMR_STS (1 << 0) /* PM1_CNT register */ #define SLP_EN (1 << 13) #define SLP_TYP_SHIFT 10 #define SLP_TYP (7 << SLP_TYP_SHIFT) #define SLP_TYP_S0 0 #define SLP_TYP_S1 1 #define SLP_TYP_S3 5 #define SLP_TYP_S4 6 #define SLP_TYP_S5 7 |
5ae5aa931 x86: acpi: Fix Wi... |
28 29 |
/* Memory size reserved for S3 resume */ #define S3_RESERVE_SIZE 0x1000 |
2b2d666f9 x86: acpi: Add wa... |
30 31 32 33 |
#ifndef __ASSEMBLY__ extern char __wakeup[]; extern int __wakeup_size; |
4372c111d x86: acpi: Add Kc... |
34 35 36 37 38 39 40 41 42 43 |
enum acpi_sleep_state { ACPI_S0, ACPI_S1, ACPI_S2, ACPI_S3, ACPI_S4, ACPI_S5, }; /** |
b727961b0 x86: Store and di... |
44 45 46 47 48 49 50 51 52 53 54 55 56 |
* acpi_ss_string() - get ACPI-defined sleep state string * * @pm1_cnt: ACPI-defined sleep state * @return: a pointer to the sleep state string. */ static inline char *acpi_ss_string(enum acpi_sleep_state state) { char *ss_string[] = { "S0", "S1", "S2", "S3", "S4", "S5"}; return ss_string[state]; } /** |
4372c111d x86: acpi: Add Kc... |
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
* acpi_sleep_from_pm1() - get ACPI-defined sleep state from PM1_CNT register * * @pm1_cnt: PM1_CNT register value * @return: ACPI-defined sleep state if given valid PM1_CNT register value, * -EINVAL otherwise. */ static inline enum acpi_sleep_state acpi_sleep_from_pm1(u32 pm1_cnt) { switch ((pm1_cnt & SLP_TYP) >> SLP_TYP_SHIFT) { case SLP_TYP_S0: return ACPI_S0; case SLP_TYP_S1: return ACPI_S1; case SLP_TYP_S3: return ACPI_S3; case SLP_TYP_S4: return ACPI_S4; case SLP_TYP_S5: return ACPI_S5; } return -EINVAL; } |
1206723b6 x86: fsp: acpi: P... |
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
/** * chipset_prev_sleep_state() - Get chipset previous sleep state * * This returns chipset previous sleep state from ACPI registers. * Platform codes must supply this routine in order to support ACPI S3. * * @return ACPI_S0/S1/S2/S3/S4/S5. */ enum acpi_sleep_state chipset_prev_sleep_state(void); /** * chipset_clear_sleep_state() - Clear chipset sleep state * * This clears chipset sleep state in ACPI registers. * Platform codes must supply this routine in order to support ACPI S3. */ void chipset_clear_sleep_state(void); |
0f4e25887 x86: acpi: Refact... |
97 |
struct acpi_fadt; |
3a34cae01 x86: acpi: Resume... |
98 99 100 101 102 |
/** * acpi_resume() - Do ACPI S3 resume * * This calls U-Boot wake up assembly stub and jumps to OS's wake up vector. * |
0f4e25887 x86: acpi: Refact... |
103 |
* @fadt: FADT table pointer in the ACPI table |
3a34cae01 x86: acpi: Resume... |
104 105 |
* @return: Never returns */ |
0f4e25887 x86: acpi: Refact... |
106 |
void acpi_resume(struct acpi_fadt *fadt); |
3a34cae01 x86: acpi: Resume... |
107 |
|
5ae5aa931 x86: acpi: Fix Wi... |
108 109 110 111 112 113 114 115 116 117 118 119 |
/** * acpi_s3_reserve() - Reserve memory for ACPI S3 resume * * This copies memory where real mode interrupt handler stubs reside to the * reserved place on the stack. * * This routine should be called by reserve_arch() before U-Boot is relocated * when ACPI S3 resume is enabled. * * @return: 0 always */ int acpi_s3_reserve(void); |
2b2d666f9 x86: acpi: Add wa... |
120 |
#endif /* __ASSEMBLY__ */ |
4372c111d x86: acpi: Add Kc... |
121 |
#endif /* __ASM_ACPI_S3_H__ */ |