soc,southbridge/intel: Avoid preprocessor with HAVE_SMI_HANDLER

Change-Id: Id375999adad71d95d4968398e90bc3c07f65ea83
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34254
Reviewed-by: Furquan Shaikh <furquan@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Kyösti Mälkki
2019-07-12 08:02:35 +03:00
parent 09e2f6e1ba
commit b4905625eb
5 changed files with 18 additions and 28 deletions

View File

@@ -428,13 +428,11 @@ static void pch_cg_init(struct device *dev)
static void pch_set_acpi_mode(void)
{
#if CONFIG(HAVE_SMI_HANDLER)
if (!acpi_is_wakeup_s3()) {
if (CONFIG(HAVE_SMI_HANDLER) && !acpi_is_wakeup_s3()) {
printk(BIOS_DEBUG, "Disabling ACPI via APMC:\n");
outb(APM_CNT_ACPI_DISABLE, APM_CNT);
printk(BIOS_DEBUG, "done.\n");
}
#endif /* CONFIG_HAVE_SMI_HANDLER */
}
static void lpc_init(struct device *dev)

View File

@@ -141,12 +141,9 @@ asmlinkage void car_stage_entry(void)
struct postcar_frame pcf;
uintptr_t top_of_ram;
#if CONFIG(HAVE_SMI_HANDLER)
void *smm_base;
size_t smm_size;
uintptr_t tseg_base;
#endif
console_init();
@@ -177,7 +174,6 @@ asmlinkage void car_stage_entry(void)
/* Cache the memory-mapped boot media. */
postcar_frame_add_romcache(&pcf, MTRR_TYPE_WRPROT);
#if CONFIG(HAVE_SMI_HANDLER)
/*
* Cache the TSEG region at the top of ram. This region is
* not restricted to SMM mode until SMM has been relocated.
@@ -185,10 +181,11 @@ asmlinkage void car_stage_entry(void)
* when relocating the SMM handler as well as using the TSEG
* region for other purposes.
*/
smm_region(&smm_base, &smm_size);
tseg_base = (uintptr_t)smm_base;
postcar_frame_add_mtrr(&pcf, tseg_base, smm_size, MTRR_TYPE_WRBACK);
#endif
if (CONFIG(HAVE_SMI_HANDLER)) {
smm_region(&smm_base, &smm_size);
tseg_base = (uintptr_t)smm_base;
postcar_frame_add_mtrr(&pcf, tseg_base, smm_size, MTRR_TYPE_WRBACK);
}
run_postcar_phase(&pcf);
}

View File

@@ -487,9 +487,8 @@ static void post_mp_init(void)
smm_southbridge_enable(GBL_EN);
/* Lock down the SMRAM space. */
#if CONFIG(HAVE_SMI_HANDLER)
smm_lock();
#endif
if (CONFIG(HAVE_SMI_HANDLER))
smm_lock();
mp_run_on_all_cpus(vmx_configure, NULL, 2 * USECS_PER_MSEC);