diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2019-08-10 15:51:59 +0300 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2019-08-13 13:59:34 +0000 |
commit | c4fdb7b923f82e31a687fc01f7176ad05ab51689 (patch) | |
tree | f7ee32bd81fe70378fae542570d4f674b1e31f71 | |
parent | e31ec299decd5a07e14fbd680eb88d34561c646d (diff) |
cpu/x86: Move some SMM function declarations
Change-Id: I9a4e57f8fd032f2824eab0e5b59d635710e3e24b
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34822
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r-- | src/arch/x86/acpi_s3.c | 1 | ||||
-rw-r--r-- | src/arch/x86/include/arch/cpu.h | 6 | ||||
-rw-r--r-- | src/cpu/amd/smm/smm_init.c | 1 | ||||
-rw-r--r-- | src/cpu/x86/lapic/lapic_cpu_init.c | 12 | ||||
-rw-r--r-- | src/include/cpu/x86/smi_deprecated.h | 12 | ||||
-rw-r--r-- | src/include/cpu/x86/smm.h | 5 | ||||
-rw-r--r-- | src/soc/amd/picasso/smi.c | 1 | ||||
-rw-r--r-- | src/soc/amd/stoneyridge/smi.c | 1 | ||||
-rw-r--r-- | src/southbridge/amd/agesa/hudson/smi.c | 5 | ||||
-rw-r--r-- | src/southbridge/amd/pi/hudson/smi.c | 5 | ||||
-rw-r--r-- | src/southbridge/intel/fsp_rangeley/lpc.c | 1 | ||||
-rw-r--r-- | src/southbridge/intel/i82801dx/smi.c | 1 | ||||
-rw-r--r-- | src/southbridge/intel/i82801ix/smi.c | 1 |
13 files changed, 28 insertions, 24 deletions
diff --git a/src/arch/x86/acpi_s3.c b/src/arch/x86/acpi_s3.c index 049fb12e75..98c53d1585 100644 --- a/src/arch/x86/acpi_s3.c +++ b/src/arch/x86/acpi_s3.c @@ -24,6 +24,7 @@ #include <program_loading.h> #include <romstage_handoff.h> #include <symbols.h> +#include <cpu/x86/smm.h> #if ENV_RAMSTAGE || ENV_POSTCAR diff --git a/src/arch/x86/include/arch/cpu.h b/src/arch/x86/include/arch/cpu.h index 293ca02158..606202197e 100644 --- a/src/arch/x86/include/arch/cpu.h +++ b/src/arch/x86/include/arch/cpu.h @@ -203,12 +203,6 @@ static inline unsigned int cpuid_edx(unsigned int op) unsigned int cpu_cpuid_extended_level(void); int cpu_have_cpuid(void); -/* Only with !PARALLEL_MP. */ -void smm_init(void); -void smm_init_completion(void); - -void smm_setup_structures(void *gnvs, void *tcg, void *smi1); - static inline bool cpu_is_amd(void) { return CONFIG(CPU_AMD_AGESA) || CONFIG(CPU_AMD_PI) diff --git a/src/cpu/amd/smm/smm_init.c b/src/cpu/amd/smm/smm_init.c index 60e506c4e5..002dad5b7d 100644 --- a/src/cpu/amd/smm/smm_init.c +++ b/src/cpu/amd/smm/smm_init.c @@ -21,6 +21,7 @@ #include <cpu/amd/msr.h> #include <cpu/x86/cache.h> #include <cpu/x86/smm.h> +#include <cpu/x86/smi_deprecated.h> #include <string.h> void smm_init(void) diff --git a/src/cpu/x86/lapic/lapic_cpu_init.c b/src/cpu/x86/lapic/lapic_cpu_init.c index cbbc10df31..94f006dc85 100644 --- a/src/cpu/x86/lapic/lapic_cpu_init.c +++ b/src/cpu/x86/lapic/lapic_cpu_init.c @@ -21,6 +21,7 @@ #include <cpu/x86/cr.h> #include <cpu/x86/gdt.h> #include <cpu/x86/lapic.h> +#include <cpu/x86/smi_deprecated.h> #include <arch/acpi.h> #include <delay.h> #include <halt.h> @@ -590,14 +591,3 @@ void initialize_cpus(struct bus *cpu_bus) if (is_smp_boot()) recover_lowest_1M(); } - -#if !CONFIG(HAVE_SMI_HANDLER) -/* Empty stubs for platforms without SMI handlers. */ -void smm_init(void) -{ -} - -void smm_init_completion(void) -{ -} -#endif diff --git a/src/include/cpu/x86/smi_deprecated.h b/src/include/cpu/x86/smi_deprecated.h index 3eed0fdda5..b5d69dd266 100644 --- a/src/include/cpu/x86/smi_deprecated.h +++ b/src/include/cpu/x86/smi_deprecated.h @@ -43,4 +43,16 @@ void northbridge_smi_handler(unsigned int node, smm_state_save_area_t *state_sav void southbridge_smi_handler(unsigned int node, smm_state_save_area_t *state_save); #endif +#if CONFIG(PARALLEL_MP) || !CONFIG(HAVE_SMI_HANDLER) +/* Empty stubs for platforms without SMI handlers. */ +static inline void smm_init(void) { } +static inline void smm_init_completion(void) { } +#else +void smm_init(void); +void smm_init_completion(void); +#endif + +/* Entry from smmhandler.S. */ +void smi_handler(u32 smm_revision); + #endif diff --git a/src/include/cpu/x86/smm.h b/src/include/cpu/x86/smm.h index a9d1ad4d1e..ebe6f76da4 100644 --- a/src/include/cpu/x86/smm.h +++ b/src/include/cpu/x86/smm.h @@ -41,9 +41,6 @@ #define APM_CNT_ELOG_GSMI 0xef #define APM_STS 0xb3 -/* SMI handler function prototypes */ -void smi_handler(u32 smm_revision); - void io_trap_handler(int smif); int southbridge_io_trap_handler(int smif); int mainboard_io_trap_handler(int smif); @@ -56,6 +53,8 @@ void northbridge_smi_handler(void); void southbridge_smi_handler(void); #endif +void smm_setup_structures(void *gnvs, void *tcg, void *smi1); + void mainboard_smi_gpi(u32 gpi_sts); int mainboard_smi_apmc(u8 data); void mainboard_smi_sleep(u8 slp_typ); diff --git a/src/soc/amd/picasso/smi.c b/src/soc/amd/picasso/smi.c index 4a0d833c7b..b11eda6360 100644 --- a/src/soc/amd/picasso/smi.c +++ b/src/soc/amd/picasso/smi.c @@ -19,6 +19,7 @@ */ #include <console/console.h> +#include <cpu/x86/smm.h> #include <amdblocks/acpimmio.h> #include <soc/southbridge.h> #include <soc/smi.h> diff --git a/src/soc/amd/stoneyridge/smi.c b/src/soc/amd/stoneyridge/smi.c index 4a0d833c7b..b11eda6360 100644 --- a/src/soc/amd/stoneyridge/smi.c +++ b/src/soc/amd/stoneyridge/smi.c @@ -19,6 +19,7 @@ */ #include <console/console.h> +#include <cpu/x86/smm.h> #include <amdblocks/acpimmio.h> #include <soc/southbridge.h> #include <soc/smi.h> diff --git a/src/southbridge/amd/agesa/hudson/smi.c b/src/southbridge/amd/agesa/hudson/smi.c index 4180795a73..f8196b4e65 100644 --- a/src/southbridge/amd/agesa/hudson/smi.c +++ b/src/southbridge/amd/agesa/hudson/smi.c @@ -18,9 +18,10 @@ * Utilities for SMM setup */ -#include "smi.h" - #include <console/console.h> +#include <cpu/x86/smm.h> + +#include "smi.h" void smm_setup_structures(void *gnvs, void *tcg, void *smi1) { diff --git a/src/southbridge/amd/pi/hudson/smi.c b/src/southbridge/amd/pi/hudson/smi.c index 4180795a73..f8196b4e65 100644 --- a/src/southbridge/amd/pi/hudson/smi.c +++ b/src/southbridge/amd/pi/hudson/smi.c @@ -18,9 +18,10 @@ * Utilities for SMM setup */ -#include "smi.h" - #include <console/console.h> +#include <cpu/x86/smm.h> + +#include "smi.h" void smm_setup_structures(void *gnvs, void *tcg, void *smi1) { diff --git a/src/southbridge/intel/fsp_rangeley/lpc.c b/src/southbridge/intel/fsp_rangeley/lpc.c index af2e411584..d7ae8f6a11 100644 --- a/src/southbridge/intel/fsp_rangeley/lpc.c +++ b/src/southbridge/intel/fsp_rangeley/lpc.c @@ -28,6 +28,7 @@ #include <arch/ioapic.h> #include <arch/acpi.h> #include <arch/cpu.h> +#include <cpu/x86/smm.h> #include <elog.h> #include <string.h> #include <cbmem.h> diff --git a/src/southbridge/intel/i82801dx/smi.c b/src/southbridge/intel/i82801dx/smi.c index 7dfed9d946..521b98db04 100644 --- a/src/southbridge/intel/i82801dx/smi.c +++ b/src/southbridge/intel/i82801dx/smi.c @@ -23,6 +23,7 @@ #include <device/pci_ops.h> #include <cpu/x86/cache.h> #include <cpu/x86/smm.h> +#include <cpu/x86/smi_deprecated.h> #include <string.h> #include "i82801dx.h" diff --git a/src/southbridge/intel/i82801ix/smi.c b/src/southbridge/intel/i82801ix/smi.c index 5d898cc3c6..0a80dd2ccf 100644 --- a/src/southbridge/intel/i82801ix/smi.c +++ b/src/southbridge/intel/i82801ix/smi.c @@ -24,6 +24,7 @@ #include <arch/acpi.h> #include <cpu/x86/cache.h> #include <cpu/x86/smm.h> +#include <cpu/x86/smi_deprecated.h> #include <string.h> #include <southbridge/intel/common/pmutil.h> #include "i82801ix.h" |