ACPICA: S3 wakeup support for hardware reduced model
Subsystems (2)
cover ACPICA: S3 wakeup support for hardware reduced model
S3 wakeup requires waking vector in FACS table, which is typically set by OS. This patchset enables FACS table support and allows setting waking vector in "Hardware-reduced ACPI support only" builds (CONFIG_ACPI_REDUCED_HARDWARE_ONLY=y).
Jiaqing Zhao (2):
ACPICA: Detect FACS in reduced hardware model
ACPICA: Allow setting waking vector in reduced hardware model
drivers/acpi/acpica/acglobal.h | 6 +----- drivers/acpi/acpica/hwxfsleep.c | 21 ++++++--------------- drivers/acpi/acpica/tbutils.c | 5 +---- drivers/acpi/acpica/utxfinit.c | 24 ++++++++++++------------ include/acpi/acconfig.h | 1 - include/acpi/acpixf.h | 8 ++++---- 6 files changed, 24 insertions(+), 41 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/2 ACPICA: Detect FACS in reduced hardware model
According to Section 5.2.10 of ACPI Specification, FACS is optional in reduced hardware model. Enable the detection for "Hardware-reduced ACPI support only" build (CONFIG_ACPI_REDUCED_HARDWARE_ONLY=y) also.
--- drivers/acpi/acpica/acglobal.h | 6 +----- drivers/acpi/acpica/tbutils.c | 5 +---- drivers/acpi/acpica/utxfinit.c | 24 ++++++++++++------------ include/acpi/acconfig.h | 1 - 4 files changed, 14 insertions(+), 22 deletions(-)
drivers/acpi/acpica/acglobal.h +1 -5
@@ -29,11 +29,7 @@ ACPI_INIT_GLOBAL(u32, acpi_gbl_dsdt_index, ACPI_INVALID_TABLE_INDEX);ACPI_INIT_GLOBAL (u32, acpi_gbl_facs_index,ACPI_INVALID_TABLE_INDEX );ACPI_INIT_GLOBAL (u32, acpi_gbl_xfacs_index,ACPI_INVALID_TABLE_INDEX );ACPI_INIT_GLOBAL (u32, acpi_gbl_fadt_index,ACPI_INVALID_TABLE_INDEX ); - -#if (!ACPI_REDUCED_HARDWARE ) -ACPI_GLOBAL(struct acpi_table_facs *, acpi_gbl_FACS); - -#endif /* !ACPI_REDUCED_HARDWARE */ +ACPI_INIT_GLOBAL(struct acpi_table_facs *, acpi_gbl_FACS, NULL);/* These addresses are calculated from the FADT Event Block addresses */
drivers/acpi/acpica/tbutils.c +1 -4
@@ -18,7 +18,6 @@ ACPI_MODULE_NAME("tbutils")static acpi_physical_address acpi_tb_get_root_table_entry (u8 *table_entry,u32 table_entry_size); -#if (!ACPI_REDUCED_HARDWARE )/******************************************************************************* * * FUNCTION: acpi_tb_initialize_facs
@@ -37,8 +36,7 @@ acpi_status acpi_tb_initialize_facs(void)struct acpi_table_facs *facs;if (acpi_gbl_FADT.Xfacs && - (!acpi_gbl_FADT.facs - || !acpi_gbl_use32_bit_facs_addresses)) { + (!acpi_gbl_FADT.facs || !acpi_gbl_use32_bit_facs_addresses)) { (void)acpi_get_table_by_index(acpi_gbl_xfacs_index, ACPI_CAST_INDIRECT_PTR(struct acpi_table_header,
@@ -56,7 +54,6 @@ acpi_status acpi_tb_initialize_facs(void)return (AE_OK ); } -#endif /* !ACPI_REDUCED_HARDWARE */ /******************************************************************************* *
drivers/acpi/acpica/utxfinit.c +12 -12
@@ -120,6 +120,18 @@ acpi_status ACPI_INIT_FUNCTION acpi_enable_subsystem(u32 flags)*/ acpi_gbl_early_initialization = FALSE; +/* +* Obtain a permanent mapping for the FACS. This is required for the +* Global Lock and the Firmware Waking Vector +*/ +if (!(flags &ACPI_NO_FACS_INIT )) { + status =acpi_tb_initialize_facs (); +if (ACPI_FAILURE (status)) { +ACPI_WARNING ((AE_INFO ,"Could not map the FACS table" )); +return_ACPI_STATUS (status); + } + } +#if (!ACPI_REDUCED_HARDWARE )/* Enable ACPI mode */
@@ -137,18 +149,6 @@ acpi_status ACPI_INIT_FUNCTION acpi_enable_subsystem(u32 flags) } } -/* -* Obtain a permanent mapping for the FACS. This is required for the -* Global Lock and the Firmware Waking Vector -*/ -if (!(flags &ACPI_NO_FACS_INIT )) { - status =acpi_tb_initialize_facs (); -if (ACPI_FAILURE (status)) { -ACPI_WARNING ((AE_INFO ,"Could not map the FACS table" )); -return_ACPI_STATUS (status); - } - } -/* * Initialize ACPI Event handling (Fixed and General Purpose) *
include/acpi/acconfig.h +0 -1
@@ -67,7 +67,6 @@* General Purpose Events (GPEs) * Global Lock * ACPI PM timer -* FACS table (Waking vectors and Global Lock) */ #ifndef ACPI_REDUCED_HARDWARE #define ACPI_REDUCED_HARDWARE FALSE
Signature · 1 line
2.43.0
PATCH 2/2 ACPICA: Allow setting waking vector in reduced hardware model
In reply to Jiaqing ZhaoAllow setting waking vector in FACS table on hardware-reduced platforms to support S3 wakeup on such platform.
--- drivers/acpi/acpica/hwxfsleep.c | 21 ++++++--------------- include/acpi/acpixf.h | 8 ++++---- 2 files changed, 10 insertions(+), 19 deletions(-)
drivers/acpi/acpica/hwxfsleep.c +6 -15
@@ -15,21 +15,6 @@#define _COMPONENT ACPI_HARDWAREACPI_MODULE_NAME ("hwxfsleep" ) -/* Local prototypes */ -#if (!ACPI_REDUCED_HARDWARE ) -static acpi_status -acpi_hw_set_firmware_waking_vector (struct acpi_table_facs *facs, -acpi_physical_address physical_address, -acpi_physical_address physical_address64); -#endif - -/* -* These functions are removed for the ACPI_REDUCED_HARDWARE case: -* acpi_set_firmware_waking_vector -* acpi_enter_sleep_state_s4bios -*/ - -#if (!ACPI_REDUCED_HARDWARE )/******************************************************************************* * * FUNCTION: acpi_hw_set_firmware_waking_vector
@@ -115,6 +100,12 @@ acpi_set_firmware_waking_vector(acpi_physical_address physical_address,ACPI_EXPORT_SYMBOL (acpi_set_firmware_waking_vector) +/* +* These functions are removed for the ACPI_REDUCED_HARDWARE case: +* acpi_enter_sleep_state_s4bios + */ + +#if (!ACPI_REDUCED_HARDWARE )/******************************************************************************* * * FUNCTION: acpi_enter_sleep_state_s4bios
include/acpi/acpixf.h +4 -4
@@ -881,10 +881,10 @@ ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_leave_sleep_state_prep(u8 sleep_state)) ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_leave_sleep_state(u8 sleep_state)) -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_set_firmware_waking_vector - (acpi_physical_address physical_address, - acpi_physical_address physical_address64)) +ACPI_EXTERNAL_RETURN_STATUS(acpi_status + acpi_set_firmware_waking_vector + (acpi_physical_address physical_address, + acpi_physical_address physical_address64))/* * ACPI Timer interfaces */
Signature · 1 line
2.43.0