[coreboot-gerrit] New patch to review for coreboot: 8fb6a52 nehalem: Simplify smi.c by using __SIMPLE_DEVICE__

Vladimir Serbinenko (phcoder@gmail.com) gerrit at coreboot.org
Thu Jan 2 10:15:39 CET 2014


Vladimir Serbinenko (phcoder at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4604

-gerrit

commit 8fb6a5225287dc41b0e20c7e5ccc7c22aa034ebd
Author: Vladimir Serbinenko <phcoder at gmail.com>
Date:   Thu Jan 2 10:12:21 2014 +0100

    nehalem: Simplify smi.c by using __SIMPLE_DEVICE__
    
    Change-Id: Ib5bac45ee7aa5492c10fa97cd75b828b6192250d
    Signed-off-by: Vladimir Serbinenko <phcoder at gmail.com>
---
 src/southbridge/intel/ibexpeak/smi.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/southbridge/intel/ibexpeak/smi.c b/src/southbridge/intel/ibexpeak/smi.c
index b07d65f..edb35b0 100644
--- a/src/southbridge/intel/ibexpeak/smi.c
+++ b/src/southbridge/intel/ibexpeak/smi.c
@@ -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);
 
@@ -320,7 +321,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",
@@ -385,7 +386,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);
 }
 



More information about the coreboot-gerrit mailing list