From 6139a5c6ad369cebd16cd8a9c800c30121c7873b Mon Sep 17 00:00:00 2001 From: Marshall Dawson Date: Wed, 4 Oct 2017 15:10:00 -0600 Subject: arch/x86: Add common AMD ACPI hardware definitions Match the corresonding Intel definitions for the ACPI register definitions. Change-Id: Ib804f4544d04fe08fefa493d75e0375de7cf9348 Signed-off-by: Marshall Dawson Reviewed-on: https://review.coreboot.org/21883 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin Reviewed-by: Marc Jones --- src/acpi/Kconfig | 8 +++++++- src/arch/x86/include/arch/acpi.h | 32 +++++++++++++++++++++----------- 2 files changed, 28 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/acpi/Kconfig b/src/acpi/Kconfig index 80276f5889..72cfff50c1 100644 --- a/src/acpi/Kconfig +++ b/src/acpi/Kconfig @@ -8,5 +8,11 @@ config ACPI_SATA_GENERATOR config ACPI_INTEL_HARDWARE_SLEEP_VALUES def_bool n help - Provide common definitions for Intel hardware PM1_CNT regiser sleep + Provide common definitions for Intel hardware PM1_CNT register sleep + values. + +config ACPI_AMD_HARDWARE_SLEEP_VALUES + def_bool n + help + Provide common definitions for AMD hardware PM1_CNT register sleep values. diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h index 13e1e9347a..1b239912d7 100644 --- a/src/arch/x86/include/arch/acpi.h +++ b/src/arch/x86/include/arch/acpi.h @@ -28,19 +28,28 @@ #define HIGH_MEMORY_SAVE (CONFIG_RAMTOP - CONFIG_RAMBASE) -#if IS_ENABLED(CONFIG_ACPI_INTEL_HARDWARE_SLEEP_VALUES) /* * The type and enable fields are common in ACPI, but the - * values themselves are hardware implementation idefiend. + * values themselves are hardware implementation defined. */ -#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 +#if IS_ENABLED(CONFIG_ACPI_INTEL_HARDWARE_SLEEP_VALUES) + #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 +#elif IS_ENABLED(CONFIG_ACPI_AMD_HARDWARE_SLEEP_VALUES) + #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 3 + #define SLP_TYP_S4 4 + #define SLP_TYP_S5 5 #endif #if !defined(__ASSEMBLER__) && !defined(__ACPI__) && !defined(__ROMCC__) @@ -700,7 +709,8 @@ enum { ACPI_S5, }; -#if IS_ENABLED(CONFIG_ACPI_INTEL_HARDWARE_SLEEP_VALUES) +#if IS_ENABLED(CONFIG_ACPI_INTEL_HARDWARE_SLEEP_VALUES) \ + || IS_ENABLED(CONFIG_ACPI_AMD_HARDWARE_SLEEP_VALUES) /* Given the provided PM1 control register return the ACPI sleep type. */ static inline int acpi_sleep_from_pm1(uint32_t pm1_cnt) { -- cgit v1.2.3