sb/intel: Clean up some SMI enables

Change-Id: I191ad709fd3c6f906cd34b0053eeaebdb80d410d
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/42354
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Kyösti Mälkki 2020-06-13 13:45:42 +03:00 committed by Patrick Georgi
parent f3973bd4cf
commit 9446447475
11 changed files with 20 additions and 66 deletions

View File

@ -829,6 +829,10 @@ config DEBUG_SMI
If unsure, say N. If unsure, say N.
config DEBUG_PERIODIC_SMI
bool "Trigger SMI periodically"
depends on DEBUG_SMI
# Only visible if debug level is DEBUG (7) or SPEW (8) as it does additional # Only visible if debug level is DEBUG (7) or SPEW (8) as it does additional
# printk(BIOS_DEBUG, ...) calls. # printk(BIOS_DEBUG, ...) calls.
config DEBUG_MALLOC config DEBUG_MALLOC

View File

@ -231,12 +231,8 @@ static void pch_power_options(struct device *dev)
reg16 = pci_read_config16(dev, GEN_PMCON_1); reg16 = pci_read_config16(dev, GEN_PMCON_1);
reg16 &= ~(3 << 0); // SMI# rate 1 minute reg16 &= ~(3 << 0); // SMI# rate 1 minute
reg16 &= ~(1 << 10); // Disable BIOS_PCI_EXP_EN for native PME reg16 &= ~(1 << 10); // Disable BIOS_PCI_EXP_EN for native PME
#if DEBUG_PERIODIC_SMIS if (CONFIG(DEBUG_PERIODIC_SMI))
/* Set DEBUG_PERIODIC_SMIS in pch.h to debug using reg16 |= (3 << 0); // Periodic SMI every 8s
* periodic SMIs.
*/
reg16 |= (3 << 0); // Periodic SMI every 8s
#endif
pci_write_config16(dev, GEN_PMCON_1, reg16); pci_write_config16(dev, GEN_PMCON_1, reg16);
// Set the board's GPI routing. // Set the board's GPI routing.

View File

@ -40,8 +40,6 @@
#endif #endif
#ifndef __ACPI__ #ifndef __ACPI__
#define DEBUG_PERIODIC_SMIS 0
int pch_silicon_revision(void); int pch_silicon_revision(void);
int pch_silicon_type(void); int pch_silicon_type(void);

View File

@ -12,8 +12,6 @@
#include "pmutil.h" #include "pmutil.h"
#define DEBUG_PERIODIC_SMIS 0
u16 get_pmbase(void) u16 get_pmbase(void)
{ {
return lpc_get_pmbase(); return lpc_get_pmbase();
@ -60,28 +58,16 @@ void smm_southbridge_enable_smi(void)
* - on TCO events * - on TCO events
* - on APMC writes (io 0xb2) * - on APMC writes (io 0xb2)
* - on writes to SLP_EN (sleep states) * - on writes to SLP_EN (sleep states)
* - on writes to GBL_RLS (bios commands)
* No SMIs: * No SMIs:
* - on microcontroller writes (io 0x62/0x66) * - on microcontroller writes (io 0x62/0x66)
*/ */
smi_en = 0; /* reset SMI enables */ smi_en = 0; /* reset SMI enables */
#if 0
smi_en |= LEGACY_USB2_EN | LEGACY_USB_EN;
#endif
smi_en |= TCO_EN; smi_en |= TCO_EN;
smi_en |= APMC_EN; smi_en |= APMC_EN;
#if DEBUG_PERIODIC_SMIS if (CONFIG(DEBUG_PERIODIC_SMI))
/* Set DEBUG_PERIODIC_SMIS in pch.h to debug using smi_en |= PERIODIC_EN;
* periodic SMIs.
*/
smi_en |= PERIODIC_EN;
#endif
smi_en |= SLP_SMI_EN; smi_en |= SLP_SMI_EN;
#if 0
smi_en |= BIOS_EN;
#endif
/* The following need to be on for SMIs to happen */ /* The following need to be on for SMIs to happen */
smi_en |= EOS | GBL_SMI_EN; smi_en |= EOS | GBL_SMI_EN;

View File

@ -261,18 +261,10 @@ static void aseg_smm_relocate(void)
*/ */
smi_en = 0; /* reset SMI enables */ smi_en = 0; /* reset SMI enables */
#if 0
smi_en |= LEGACY_USB2_EN | LEGACY_USB_EN;
#endif
smi_en |= TCO_EN; smi_en |= TCO_EN;
smi_en |= APMC_EN; smi_en |= APMC_EN;
#if DEBUG_PERIODIC_SMIS if (CONFIG(DEBUG_PERIODIC_SMI))
/* Set DEBUG_PERIODIC_SMIS in i82801gx.h to debug using smi_en |= PERIODIC_EN;
* periodic SMIs.
*/
smi_en |= PERIODIC_EN;
#endif
smi_en |= SLP_SMI_EN; smi_en |= SLP_SMI_EN;
smi_en |= BIOS_EN; smi_en |= BIOS_EN;

View File

@ -227,12 +227,8 @@ static void i82801gx_power_options(struct device *dev)
// another laptop wants this? // another laptop wants this?
// reg16 &= ~(1 << 10); // BIOS_PCI_EXP_EN - Desktop/Mobile only // reg16 &= ~(1 << 10); // BIOS_PCI_EXP_EN - Desktop/Mobile only
reg16 |= (1 << 10); // BIOS_PCI_EXP_EN - Desktop/Mobile only reg16 |= (1 << 10); // BIOS_PCI_EXP_EN - Desktop/Mobile only
#if DEBUG_PERIODIC_SMIS if (CONFIG(DEBUG_PERIODIC_SMI))
/* Set DEBUG_PERIODIC_SMIS in i82801gx.h to debug using reg16 |= (3 << 0); // Periodic SMI every 8s
* periodic SMIs.
*/
reg16 |= (3 << 0); // Periodic SMI every 8s
#endif
pci_write_config16(dev, GEN_PMCON_1, reg16); pci_write_config16(dev, GEN_PMCON_1, reg16);
// Set the board's GPI routing. // Set the board's GPI routing.

View File

@ -228,12 +228,8 @@ static void i82801ix_power_options(struct device *dev)
// another laptop wants this? // another laptop wants this?
// reg16 &= ~(1 << 10); // BIOS_PCI_EXP_EN - Desktop/Mobile only // reg16 &= ~(1 << 10); // BIOS_PCI_EXP_EN - Desktop/Mobile only
reg16 |= (1 << 10); // BIOS_PCI_EXP_EN - Desktop/Mobile only reg16 |= (1 << 10); // BIOS_PCI_EXP_EN - Desktop/Mobile only
#if DEBUG_PERIODIC_SMIS if (CONFIG(DEBUG_PERIODIC_SMI))
/* Set DEBUG_PERIODIC_SMIS in i82801ix.h to debug using reg16 |= (3 << 0); // Periodic SMI every 8s
* periodic SMIs.
*/
reg16 |= (3 << 0); // Periodic SMI every 8s
#endif
if (config->c5_enable) if (config->c5_enable)
reg16 |= (1 << 11); /* Enable C5, C6 and PMSYNC# */ reg16 |= (1 << 11); /* Enable C5, C6 and PMSYNC# */
pci_write_config16(dev, D31F0_GEN_PMCON_1, reg16); pci_write_config16(dev, D31F0_GEN_PMCON_1, reg16);

View File

@ -69,15 +69,10 @@ static void aseg_smm_relocate(void)
*/ */
smi_en = 0; /* reset SMI enables */ smi_en = 0; /* reset SMI enables */
smi_en |= TCO_EN; smi_en |= TCO_EN;
smi_en |= APMC_EN; smi_en |= APMC_EN;
#if DEBUG_PERIODIC_SMIS if (CONFIG(DEBUG_PERIODIC_SMI))
/* Set DEBUG_PERIODIC_SMIS in i82801ix.h to debug using smi_en |= PERIODIC_EN;
* periodic SMIs.
*/
smi_en |= PERIODIC_EN;
#endif
smi_en |= BIOS_EN; smi_en |= BIOS_EN;
/* The following need to be on for SMIs to happen */ /* The following need to be on for SMIs to happen */

View File

@ -229,12 +229,8 @@ static void i82801jx_power_options(struct device *dev)
// another laptop wants this? // another laptop wants this?
// reg16 &= ~(1 << 10); // BIOS_PCI_EXP_EN - Desktop/Mobile only // reg16 &= ~(1 << 10); // BIOS_PCI_EXP_EN - Desktop/Mobile only
reg16 |= (1 << 10); // BIOS_PCI_EXP_EN - Desktop/Mobile only reg16 |= (1 << 10); // BIOS_PCI_EXP_EN - Desktop/Mobile only
#if DEBUG_PERIODIC_SMIS if (CONFIG(DEBUG_PERIODIC_SMI))
/* Set DEBUG_PERIODIC_SMIS in i82801jx.h to debug using reg16 |= (3 << 0); // Periodic SMI every 8s
* periodic SMIs.
*/
reg16 |= (3 << 0); // Periodic SMI every 8s
#endif
if (config->c5_enable) if (config->c5_enable)
reg16 |= (1 << 11); /* Enable C5, C6 and PMSYNC# */ reg16 |= (1 << 11); /* Enable C5, C6 and PMSYNC# */
pci_write_config16(dev, D31F0_GEN_PMCON_1, reg16); pci_write_config16(dev, D31F0_GEN_PMCON_1, reg16);

View File

@ -225,12 +225,8 @@ static void pch_power_options(struct device *dev)
reg16 = pci_read_config16(dev, GEN_PMCON_1); reg16 = pci_read_config16(dev, GEN_PMCON_1);
reg16 &= ~(3 << 0); // SMI# rate 1 minute reg16 &= ~(3 << 0); // SMI# rate 1 minute
reg16 &= ~(1 << 10); // Disable BIOS_PCI_EXP_EN for native PME reg16 &= ~(1 << 10); // Disable BIOS_PCI_EXP_EN for native PME
#if DEBUG_PERIODIC_SMIS if (CONFIG(DEBUG_PERIODIC_SMI))
/* Set DEBUG_PERIODIC_SMIS in pch.h to debug using reg16 |= (3 << 0); // Periodic SMI every 8s
* periodic SMIs.
*/
reg16 |= (3 << 0); // Periodic SMI every 8s
#endif
pci_write_config16(dev, GEN_PMCON_1, reg16); pci_write_config16(dev, GEN_PMCON_1, reg16);
// Set the board's GPI routing. // Set the board's GPI routing.

View File

@ -35,7 +35,6 @@
#include <southbridge/intel/common/rcba.h> #include <southbridge/intel/common/rcba.h>
#ifndef __ACPI__ #ifndef __ACPI__
#define DEBUG_PERIODIC_SMIS 0
void pch_iobp_update(u32 address, u32 andvalue, u32 orvalue); void pch_iobp_update(u32 address, u32 andvalue, u32 orvalue);
void enable_usb_bar(void); void enable_usb_bar(void);