[U-Boot] [PATCH 37/57] x86: ivybridge: Move LPC init into LPC init() method

Simon Glass sjg at chromium.org
Tue Dec 8 04:38:56 CET 2015


Drop the lpc_init_extra() function and just use the post-relocation LPC
init instead.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 arch/x86/cpu/ivybridge/bd82x6x.c          |  4 ----
 arch/x86/cpu/ivybridge/lpc.c              | 27 ++++++++++++++++++---------
 arch/x86/include/asm/arch-ivybridge/pch.h |  2 --
 3 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/arch/x86/cpu/ivybridge/bd82x6x.c b/arch/x86/cpu/ivybridge/bd82x6x.c
index 926edc1..94c41ef 100644
--- a/arch/x86/cpu/ivybridge/bd82x6x.c
+++ b/arch/x86/cpu/ivybridge/bd82x6x.c
@@ -20,16 +20,12 @@
 static int bd82x6x_probe(struct udevice *dev)
 {
 	const void *blob = gd->fdt_blob;
-	struct pci_controller *hose;
 	int gma_node;
 	int ret;
 
 	if (!(gd->flags & GD_FLG_RELOC))
 		return 0;
 
-	hose = pci_bus_to_hose(0);
-	lpc_init_extra(hose, PCH_LPC_DEV);
-
 	/* Cause the SATA device to do its init */
 	uclass_first_device(UCLASS_AHCI, &dev);
 
diff --git a/arch/x86/cpu/ivybridge/lpc.c b/arch/x86/cpu/ivybridge/lpc.c
index 92377d5..b94d9f7 100644
--- a/arch/x86/cpu/ivybridge/lpc.c
+++ b/arch/x86/cpu/ivybridge/lpc.c
@@ -548,7 +548,7 @@ static int lpc_early_init(struct udevice *dev)
 	return 0;
 }
 
-int lpc_init_extra(struct pci_controller *hose, pci_dev_t dev)
+static int lpc_init_extra(struct pci_controller *hose, pci_dev_t dev)
 {
 	const void *blob = gd->fdt_blob;
 	int node;
@@ -612,7 +612,7 @@ int lpc_init_extra(struct pci_controller *hose, pci_dev_t dev)
 	return 0;
 }
 
-static int bd82x6x_lpc_init(struct udevice *dev)
+static int bd82x6x_lpc_early_init(struct udevice *dev)
 {
 	/* Setting up Southbridge. In the northbridge code. */
 	debug("Setting up static southbridge registers\n");
@@ -632,20 +632,29 @@ static int bd82x6x_lpc_init(struct udevice *dev)
 	return 0;
 }
 
+static int bd82x6x_lpc_init(struct udevice *dev)
+{
+	if (!(gd->flags & GD_FLG_RELOC))
+		return bd82x6x_lpc_early_init(dev);
+
+	return 0;
+}
+
 static int bd82x6x_lpc_probe(struct udevice *dev)
 {
 	int ret;
 
-	if (gd->flags & GD_FLG_RELOC)
-		return 0;
+	if (!(gd->flags & GD_FLG_RELOC)) {
+		ret = lpc_early_init(dev);
+		if (ret) {
+			debug("%s: lpc_early_init() failed\n", __func__);
+			return ret;
+		}
 
-	ret = lpc_early_init(dev);
-	if (ret) {
-		debug("%s: lpc_early_init() failed\n", __func__);
-		return ret;
+		return 0;
 	}
 
-	return 0;
+	return lpc_init_extra(pci_bus_to_hose(0), PCH_LPC_DEV);
 }
 
 static struct lpc_ops bd82x6x_lpc_ops = {
diff --git a/arch/x86/include/asm/arch-ivybridge/pch.h b/arch/x86/include/asm/arch-ivybridge/pch.h
index 455dca0..f5def1c 100644
--- a/arch/x86/include/asm/arch-ivybridge/pch.h
+++ b/arch/x86/include/asm/arch-ivybridge/pch.h
@@ -460,6 +460,4 @@ void pch_iobp_update(u32 address, u32 andvalue, u32 orvalue);
 #define   DMISCI_STS	(1 << 9)
 #define TCO2_STS	0x66
 
-int lpc_init_extra(struct pci_controller *hose, pci_dev_t dev);
-
 #endif
-- 
2.6.0.rc2.230.g3dd15c0



More information about the U-Boot mailing list