]> git.sur5r.net Git - u-boot/blobdiff - arch/x86/cpu/ivybridge/cpu.c
Merge git://git.denx.de/u-boot-net
[u-boot] / arch / x86 / cpu / ivybridge / cpu.c
index e6ef4815a09f85b80f6188c1e4fb13f753363d2b..343bfb4e98e264a7e5fa91f7e9f58c89427f73f3 100644 (file)
@@ -12,6 +12,7 @@
  */
 
 #include <common.h>
+#include <dm.h>
 #include <errno.h>
 #include <fdtdec.h>
 #include <asm/cpu.h>
@@ -91,7 +92,7 @@ static int set_flex_ratio_to_tdp_nominal(void)
 
        /* Issue warm reset, will be "CPU only" due to soft reset data */
        outb(0x0, PORT_RESET);
-       outb(0x6, PORT_RESET);
+       outb(SYS_RST | RST_CPU, PORT_RESET);
        cpu_hlt();
 
        /* Not reached */
@@ -117,7 +118,6 @@ static void set_spi_speed(void)
 int arch_cpu_init(void)
 {
        post_code(POST_CPU_INIT);
-       timer_set_base(rdtsc());
 
        return x86_cpu_init_f();
 }
@@ -126,21 +126,22 @@ int arch_cpu_init_dm(void)
 {
        const void *blob = gd->fdt_blob;
        struct pci_controller *hose;
+       struct udevice *bus;
        int node;
        int ret;
 
-       post_code(POST_CPU_INIT);
-       timer_set_base(rdtsc());
-
-       ret = x86_cpu_init_f();
+       post_code(0x70);
+       ret = uclass_get_device(UCLASS_PCI, 0, &bus);
+       post_code(0x71);
        if (ret)
                return ret;
+       post_code(0x72);
+       hose = dev_get_uclass_priv(bus);
 
-       ret = pci_early_init_hose(&hose);
-       if (ret)
-               return ret;
+       /* TODO(sjg@chromium.org): Get rid of gd->hose */
+       gd->hose = hose;
 
-       node = fdtdec_next_compatible(blob, 0, COMPAT_INTEL_LPC);
+       node = fdtdec_next_compatible(blob, 0, COMPAT_INTEL_PCH);
        if (node < 0)
                return -ENOENT;
        ret = lpc_early_init(gd->fdt_blob, node, PCH_LPC_DEV);
@@ -284,8 +285,7 @@ int print_cpuinfo(void)
 
                /* System is not happy after keyboard reset... */
                debug("Issuing CF9 warm reset\n");
-               outb(0x6, 0xcf9);
-               cpu_hlt();
+               reset_cpu(0);
        }
 
        /* Early chipset init required before RAM init can work */
@@ -298,16 +298,7 @@ int print_cpuinfo(void)
        pm1_cnt = inl(DEFAULT_PMBASE + PM1_CNT);
 
        if ((pm1_sts & WAK_STS) && ((pm1_cnt >> 10) & 7) == 5) {
-#if CONFIG_HAVE_ACPI_RESUME
-               debug("Resume from S3 detected.\n");
-               boot_mode = PEI_BOOT_RESUME;
-               /* Clear SLP_TYPE. This will break stage2 but
-                * we care for that when we get there.
-                */
-               outl(pm1_cnt & ~(7 << 10), DEFAULT_PMBASE + PM1_CNT);
-#else
                debug("Resume from S3 detected, but disabled.\n");
-#endif
        } else {
                /*
                 * TODO: An indication of life might be possible here (e.g.
@@ -339,3 +330,10 @@ int print_cpuinfo(void)
 
        return 0;
 }
+
+void board_debug_uart_init(void)
+{
+       /* This enables the debug UART */
+       pci_x86_write_config(NULL, PCH_LPC_DEV, LPC_EN, COMA_LPC_EN,
+                            PCI_SIZE_16);
+}