[coreboot-gerrit] Patch set updated for coreboot: 049ce59 lenovo/x201: Move mainboard init to mainboard_init.

Vladimir Serbinenko (phcoder@gmail.com) gerrit at coreboot.org
Tue Jan 28 04:00:59 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/4840

-gerrit

commit 049ce59a457b6f9ac3c38238632c93ac59f74397
Author: Vladimir Serbinenko <phcoder at gmail.com>
Date:   Tue Jan 28 00:05:29 2014 +0100

    lenovo/x201: Move mainboard init to mainboard_init.
    
    Rather than having it inside mainboard_enable.
    
    Change-Id: Ie8bd25eb49b919b4e25c4628e3557fc66b2ba4d9
    Signed-off-by: Vladimir Serbinenko <phcoder at gmail.com>
---
 src/mainboard/lenovo/x201/mainboard.c | 37 ++++++++++++++++++++---------------
 1 file changed, 21 insertions(+), 16 deletions(-)

diff --git a/src/mainboard/lenovo/x201/mainboard.c b/src/mainboard/lenovo/x201/mainboard.c
index c16c3a4..cf42a9b 100644
--- a/src/mainboard/lenovo/x201/mainboard.c
+++ b/src/mainboard/lenovo/x201/mainboard.c
@@ -104,11 +104,8 @@ static void verb_setup(void)
 	cim_verb_data_size = sizeof(mainboard_cim_verb_data);
 }
 
-static void mainboard_enable(device_t dev)
+static void mainboard_init(device_t dev)
 {
-	device_t dev0;
-	u16 pmbase;
-
 	printk(BIOS_SPEW, "starting SPI configuration\n");
 
 	/* Configure SPI.  */
@@ -134,6 +131,26 @@ static void mainboard_enable(device_t dev)
 	RCBA32(0x3804) = 0x3f04e008;
 
 	printk(BIOS_SPEW, "SPI configured\n");
+	/* This sneaked in here, because X201 SuperIO chip isn't really
+	   connected to anything and hence we don't init it.
+	 */
+	pc_keyboard_init(0);
+
+	/* Enable expresscard hotplug events.  */
+	pci_write_config32(dev_find_slot(0, PCI_DEVFN(0x1c, 3)),
+			   0xd8,
+			   pci_read_config32(dev_find_slot(0, PCI_DEVFN(0x1c, 3)), 0xd8)
+			   | (1 << 30));
+	pci_write_config16(dev_find_slot(0, PCI_DEVFN(0x1c, 3)),
+			   0x42, 0x142);
+}
+
+static void mainboard_enable(device_t dev)
+{
+	device_t dev0;
+	u16 pmbase;
+
+	dev->ops->init = mainboard_init;
 
 	pmbase = pci_read_config32(dev_find_slot(0, PCI_DEVFN(0x1f, 0)),
 				   PMBASE) & 0xff80;
@@ -158,19 +175,7 @@ static void mainboard_enable(device_t dev)
 	mainboard_interrupt_handlers(0x15, &int15_handler);
 #endif
 
-	/* This sneaked in here, because X201 SuperIO chip isn't really
-	   connected to anything and hence we don't init it.
-	 */
-	pc_keyboard_init(0);
 	verb_setup();
-
-	/* Enable expresscard hotplug events.  */
-	pci_write_config32(dev_find_slot(0, PCI_DEVFN(0x1c, 3)),
-			   0xd8,
-			   pci_read_config32(dev_find_slot(0, PCI_DEVFN(0x1c, 3)), 0xd8)
-			   | (1 << 30));
-	pci_write_config16(dev_find_slot(0, PCI_DEVFN(0x1c, 3)),
-			   0x42, 0x142);
 }
 
 struct chip_operations mainboard_ops = {



More information about the coreboot-gerrit mailing list