nehalem: Simplify smi.c by using __SIMPLE_DEVICE__

Change-Id: Ib5bac45ee7aa5492c10fa97cd75b828b6192250d
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/4604
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
This commit is contained in:
Vladimir Serbinenko 2014-01-02 10:12:21 +01:00
parent 98dda06e7a
commit 00ea28ecf9
1 changed files with 5 additions and 4 deletions

View File

@ -19,6 +19,7 @@
* MA 02110-1301 USA
*/
#define __SIMPLE_DEVICE__
#include <device/device.h>
#include <device/pci.h>
@ -246,8 +247,8 @@ static void smm_relocate(void)
printk(BIOS_DEBUG, "Initializing SMM handler...");
pmbase = pci_read_config32(dev_find_slot(0, PCI_DEVFN(0x1f, 0)),
PMBASE) & 0xff80;
pmbase = pci_read_config32(PCI_DEV(0, 0x1f, 0),
PMBASE) & 0xff80;
printk(BIOS_SPEW, " ... pmbase = 0x%04x\n", pmbase);
@ -332,7 +333,7 @@ static int smm_handler_copied = 0;
static void smm_install(void)
{
device_t dev = dev_find_slot(0, PCI_DEVFN(0, 0));
device_t dev = PCI_DEV(0, 0, 0);
u32 smm_base = 0xa0000;
struct ied_header ied = {
.signature = "INTEL RSVD",
@ -397,7 +398,7 @@ void smm_lock(void)
* make the SMM registers writable again.
*/
printk(BIOS_DEBUG, "Locking SMM.\n");
pci_write_config8(dev_find_slot(0, PCI_DEVFN(0, 0)), SMRAM,
pci_write_config8(PCI_DEV(0, 0, 0), SMRAM,
D_LCK | G_SMRAME | C_BASE_SEG);
}