diff mbox

[U-Boot,v2,35/55] x86: ivybridge: Move LPC init into the LPC probe() method

Message ID 1453072320-24298-36-git-send-email-sjg@chromium.org
State Accepted
Commit 4e1907290720cac9c13422f1821a36254575fd73
Delegated to: Bin Meng
Headers show

Commit Message

Simon Glass Jan. 17, 2016, 11:11 p.m. UTC
Drop the lpc_init_extra() function and just use the post-relocation LPC
probe() instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
---

Changes in v2:
- Update to use LPC probe() method instead of init()

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

Comments

Bin Meng Jan. 21, 2016, 8:01 a.m. UTC | #1
On Mon, Jan 18, 2016 at 7:11 AM, Simon Glass <sjg@chromium.org> wrote:
> Drop the lpc_init_extra() function and just use the post-relocation LPC
> probe() instead.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
> Changes in v2:
> - Update to use LPC probe() method instead of init()
>
>  arch/x86/cpu/ivybridge/bd82x6x.c          |  4 ----
>  arch/x86/cpu/ivybridge/lpc.c              | 17 +++++++++--------
>  arch/x86/include/asm/arch-ivybridge/pch.h |  2 --
>  3 files changed, 9 insertions(+), 14 deletions(-)
>

applied to u-boot-x86/master, thanks!
diff mbox

Patch

diff --git a/arch/x86/cpu/ivybridge/bd82x6x.c b/arch/x86/cpu/ivybridge/bd82x6x.c
index 9e7e30a..5cb4152 100644
--- a/arch/x86/cpu/ivybridge/bd82x6x.c
+++ b/arch/x86/cpu/ivybridge/bd82x6x.c
@@ -21,16 +21,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_DISK, &dev);
 
diff --git a/arch/x86/cpu/ivybridge/lpc.c b/arch/x86/cpu/ivybridge/lpc.c
index 44c4825..79224d9 100644
--- a/arch/x86/cpu/ivybridge/lpc.c
+++ b/arch/x86/cpu/ivybridge/lpc.c
@@ -538,7 +538,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;
@@ -626,16 +626,17 @@  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 bd82x6x_lpc_early_init(dev);
 	}
 
-	return bd82x6x_lpc_early_init(dev);
+	return lpc_init_extra(pci_bus_to_hose(0), PCH_LPC_DEV);
 }
 
 static const struct udevice_id bd82x6x_lpc_ids[] = {
diff --git a/arch/x86/include/asm/arch-ivybridge/pch.h b/arch/x86/include/asm/arch-ivybridge/pch.h
index 682a557..629a144 100644
--- a/arch/x86/include/asm/arch-ivybridge/pch.h
+++ b/arch/x86/include/asm/arch-ivybridge/pch.h
@@ -470,6 +470,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