diff mbox

[U-Boot,18/57] x86: ivybridge: Move GPIO init to the LPC init() method

Message ID 1449545956-2772-19-git-send-email-sjg@chromium.org
State Accepted
Commit 9fd11c7a8ce8745fcfee4b86e6b9217f738d3ff4
Delegated to: Bin Meng
Headers show

Commit Message

Simon Glass Dec. 8, 2015, 3:38 a.m. UTC
This init can happen in the driver also. Move it.

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

 arch/x86/cpu/ivybridge/cpu.c | 4 ----
 arch/x86/cpu/ivybridge/lpc.c | 3 +++
 2 files changed, 3 insertions(+), 4 deletions(-)

Comments

Bin Meng Dec. 13, 2015, 12:53 p.m. UTC | #1
On Tue, Dec 8, 2015 at 11:38 AM, Simon Glass <sjg@chromium.org> wrote:
> This init can happen in the driver also. Move it.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
diff mbox

Patch

diff --git a/arch/x86/cpu/ivybridge/cpu.c b/arch/x86/cpu/ivybridge/cpu.c
index 8827c2c..849b058 100644
--- a/arch/x86/cpu/ivybridge/cpu.c
+++ b/arch/x86/cpu/ivybridge/cpu.c
@@ -300,10 +300,6 @@  int print_cpuinfo(void)
 
 	gd->arch.pei_boot_mode = boot_mode;
 
-	/* TODO: Move this to the board or driver */
-	x86_pci_write_config32(PCH_LPC_DEV, GPIO_BASE, DEFAULT_GPIOBASE | 1);
-	x86_pci_write_config32(PCH_LPC_DEV, GPIO_CNTL, 0x10);
-
 	/* Print processor name */
 	name = cpu_get_name(processor_name);
 	printf("CPU:   %s\n", name);
diff --git a/arch/x86/cpu/ivybridge/lpc.c b/arch/x86/cpu/ivybridge/lpc.c
index a445b03..d24aac6 100644
--- a/arch/x86/cpu/ivybridge/lpc.c
+++ b/arch/x86/cpu/ivybridge/lpc.c
@@ -633,6 +633,9 @@  static int bd82x6x_lpc_init(struct udevice *dev)
 	setbits_le32(RCB_REG(GCS), 1 >> 5);	/* No reset */
 	outw(1 << 11, DEFAULT_PMBASE | 0x60 | 0x08);	/* halt timer */
 
+	dm_pci_write_config32(dev->parent, GPIO_BASE, DEFAULT_GPIOBASE | 1);
+	dm_pci_write_config32(dev->parent, GPIO_CNTL, 0x10);
+
 	return 0;
 }