diff options
author | Sven Schnelle <svens@stackframe.org> | 2011-06-05 11:33:41 +0200 |
---|---|---|
committer | Sven Schnelle <svens@stackframe.org> | 2011-06-07 22:01:29 +0200 |
commit | f4dc1a73e440766bbc12b738462ae9467f6030fe (patch) | |
tree | 467073c23cc2f42ebf56c9101f11c12d2a224a12 /src/mainboard/lenovo | |
parent | bb60528e73ed611553befba2ea1bdf8c690a26e5 (diff) |
SMM: add defines for APM_CNT register
in the current code, the defines for the APM_CNT (0xb2) register
are duplicated in almost every place where it is used. define those
values in cpu/x86/smm.h, and only include this file.
And while at it, fixup whitespace.
Change-Id: Iae712aff53322acd51e89986c2abf4c794e25484
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/4
Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/mainboard/lenovo')
-rw-r--r-- | src/mainboard/lenovo/t60/fadt.c | 15 | ||||
-rw-r--r-- | src/mainboard/lenovo/x60/fadt.c | 15 | ||||
-rw-r--r-- | src/mainboard/lenovo/x60/mainboard_smi.c | 1 |
3 files changed, 10 insertions, 21 deletions
diff --git a/src/mainboard/lenovo/t60/fadt.c b/src/mainboard/lenovo/t60/fadt.c index e45db8a351..9f73f9cb4b 100644 --- a/src/mainboard/lenovo/t60/fadt.c +++ b/src/mainboard/lenovo/t60/fadt.c @@ -22,17 +22,12 @@ #include <string.h> #include <device/pci.h> #include <arch/acpi.h> +#include <cpu/x86/smm.h> /* FIXME: This needs to go into a separate .h file * to be included by the ich7 smi handler, ich7 smi init * code and the mainboard fadt. */ -#define APM_CNT 0xb2 -#define CST_CONTROL 0x85 -#define PST_CONTROL 0x80 -#define ACPI_DISABLE 0x1e -#define ACPI_ENABLE 0xe1 -#define GNVS_UPDATE 0xea void acpi_create_fadt(acpi_fadt_t * fadt, acpi_facs_t * facs, void *dsdt) { @@ -54,10 +49,10 @@ void acpi_create_fadt(acpi_fadt_t * fadt, acpi_facs_t * facs, void *dsdt) fadt->preferred_pm_profile = PM_MOBILE; fadt->sci_int = 0x9; fadt->smi_cmd = APM_CNT; - fadt->acpi_enable = ACPI_ENABLE; - fadt->acpi_disable = ACPI_DISABLE; + fadt->acpi_enable = APM_CNT_ACPI_ENABLE; + fadt->acpi_disable = APM_CNT_ACPI_DISABLE; fadt->s4bios_req = 0x0; - fadt->pstate_cnt = PST_CONTROL; + fadt->pstate_cnt = APM_CNT_PST_CONTROL; fadt->pm1a_evt_blk = pmbase; fadt->pm1b_evt_blk = 0x0; @@ -75,7 +70,7 @@ void acpi_create_fadt(acpi_fadt_t * fadt, acpi_facs_t * facs, void *dsdt) fadt->gpe0_blk_len = 8; fadt->gpe1_blk_len = 0; fadt->gpe1_base = 0; - fadt->cst_cnt = CST_CONTROL; + fadt->cst_cnt = APM_CNT_CST_CONTROL; fadt->p_lvl2_lat = 1; fadt->p_lvl3_lat = 0x23; fadt->flush_size = 0; diff --git a/src/mainboard/lenovo/x60/fadt.c b/src/mainboard/lenovo/x60/fadt.c index e45db8a351..9f73f9cb4b 100644 --- a/src/mainboard/lenovo/x60/fadt.c +++ b/src/mainboard/lenovo/x60/fadt.c @@ -22,17 +22,12 @@ #include <string.h> #include <device/pci.h> #include <arch/acpi.h> +#include <cpu/x86/smm.h> /* FIXME: This needs to go into a separate .h file * to be included by the ich7 smi handler, ich7 smi init * code and the mainboard fadt. */ -#define APM_CNT 0xb2 -#define CST_CONTROL 0x85 -#define PST_CONTROL 0x80 -#define ACPI_DISABLE 0x1e -#define ACPI_ENABLE 0xe1 -#define GNVS_UPDATE 0xea void acpi_create_fadt(acpi_fadt_t * fadt, acpi_facs_t * facs, void *dsdt) { @@ -54,10 +49,10 @@ void acpi_create_fadt(acpi_fadt_t * fadt, acpi_facs_t * facs, void *dsdt) fadt->preferred_pm_profile = PM_MOBILE; fadt->sci_int = 0x9; fadt->smi_cmd = APM_CNT; - fadt->acpi_enable = ACPI_ENABLE; - fadt->acpi_disable = ACPI_DISABLE; + fadt->acpi_enable = APM_CNT_ACPI_ENABLE; + fadt->acpi_disable = APM_CNT_ACPI_DISABLE; fadt->s4bios_req = 0x0; - fadt->pstate_cnt = PST_CONTROL; + fadt->pstate_cnt = APM_CNT_PST_CONTROL; fadt->pm1a_evt_blk = pmbase; fadt->pm1b_evt_blk = 0x0; @@ -75,7 +70,7 @@ void acpi_create_fadt(acpi_fadt_t * fadt, acpi_facs_t * facs, void *dsdt) fadt->gpe0_blk_len = 8; fadt->gpe1_blk_len = 0; fadt->gpe1_base = 0; - fadt->cst_cnt = CST_CONTROL; + fadt->cst_cnt = APM_CNT_CST_CONTROL; fadt->p_lvl2_lat = 1; fadt->p_lvl3_lat = 0x23; fadt->flush_size = 0; diff --git a/src/mainboard/lenovo/x60/mainboard_smi.c b/src/mainboard/lenovo/x60/mainboard_smi.c index 5e0f6a98b0..78f7f2a4f6 100644 --- a/src/mainboard/lenovo/x60/mainboard_smi.c +++ b/src/mainboard/lenovo/x60/mainboard_smi.c @@ -75,4 +75,3 @@ int mainboard_io_trap_handler(int smif) * On failure, the IO Trap Handler returns a value != 0 */ return 0; } - |