SMM for AMD K8 Part 1/2

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>




git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6201 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Stefan Reinauer
2010-12-18 23:29:37 +00:00
committed by Stefan Reinauer
parent 405721d45c
commit cadc545838
26 changed files with 563 additions and 29 deletions

View File

@@ -38,18 +38,16 @@
#ifndef __ACPI__
#define DEBUG_PERIODIC_SMIS 0
#if !defined(ASSEMBLY)
#if !defined(ASSEMBLY) && !defined(__ROMCC__)
#if !defined(__PRE_RAM__)
#include "chip.h"
extern void i82801gx_enable(device_t dev);
#endif
void i82801gx_enable_usbdebug(unsigned int port);
#endif
#if defined(__PRE_RAM__) && !defined(__ROMCC__) && !defined(ASSEMBLY)
#else
void enable_smbus(void);
int smbus_read_byte(unsigned device, unsigned address);
#endif
void i82801gx_enable_usbdebug(unsigned int port);
#endif
#define MAINBOARD_POWER_OFF 0
#define MAINBOARD_POWER_ON 1

View File

@@ -27,6 +27,7 @@
#include <pc80/i8259.h>
#include <arch/io.h>
#include <arch/ioapic.h>
#include <cpu/cpu.h>
#include "i82801gx.h"
#define NMI_OFF 0
@@ -335,7 +336,6 @@ static void enable_clock_gating(void)
#if CONFIG_HAVE_SMI_HANDLER
static void i82801gx_lock_smm(struct device *dev)
{
void smm_lock(void);
#if TEST_SMM_FLASH_LOCKDOWN
u8 reg8;
#endif

View File

@@ -318,8 +318,17 @@ static void smm_relocate(void)
outb(0x00, 0xb2);
}
static int smm_handler_copied = 0;
static void smm_install(void)
{
/* The first CPU running this gets to copy the SMM handler. But not all
* of them.
*/
if (smm_handler_copied)
return;
smm_handler_copied = 1;
/* enable the SMM memory window */
pci_write_config8(dev_find_slot(0, PCI_DEVFN(0, 0)), SMRAM,
D_OPEN | G_SMRAME | C_BASE_SEG);