remove usbdebug.h include from mainboard/romstage code
[coreboot.git] / src / mainboard / lenovo / t60 / romstage.c
index ff266987403ebba4d1173152fdc66ee3bbb963b0..046e354c5f6193f1cdb499dc6711c0c40619f88d 100644 (file)
@@ -32,7 +32,6 @@
 #include <lib.h>
 #include <pc80/mc146818rtc.h>
 #include <console/console.h>
-#include <usbdebug.h>
 #include <cpu/x86/bist.h>
 #include "northbridge/intel/i945/i945.h"
 #include "northbridge/intel/i945/raminit.h"
@@ -210,7 +209,7 @@ static void early_ich7_init(void)
 void main(unsigned long bist)
 {
        u32 reg32;
-       int boot_mode = 0;
+       int boot_mode = 0, dock_err;
        const u8 spd_addrmap[2 * DIMM_SOCKETS] = { 0x50, 0x52, 0x51, 0x53 };
 
        if (bist == 0)
@@ -223,23 +222,24 @@ void main(unsigned long bist)
 
        ich7_enable_lpc();
 
+       /* We want early GPIO setup, to be able to detect legacy I/O module */
+       pci_write_config32(PCI_DEV(0, 0x1f, 0), GPIOBASE, DEFAULT_GPIOBASE | 1);
+       /* Enable GPIOs */
+       pci_write_config8(PCI_DEV(0, 0x1f, 0), 0x4c /* GC */ , 0x10);
+       setup_ich7_gpios();
 
-       /* dock_init initializes the DLPC switch on
-        *  thinpad side, so this is required even
-        *  if we're undocked.
-        */
-       if (!dlpc_init() && dock_present()) {
+       dock_err = dlpc_init();
+
+       /* We prefer Legacy I/O module over docking */
+       if (legacy_io_present()) {
+               legacy_io_init();
+               early_superio_config();
+       } else if (!dock_err && dock_present()) {
                dock_connect();
                early_superio_config();
-               /* Set up the console */
-               uart_init();
        }
 
-#if CONFIG_USBDEBUG
-       i82801gx_enable_usbdebug(1);
-       early_usbdebug_init();
-#endif
-
+       /* Setup the console */
        console_init();
 
        /* Halt if there was a built in self test failure */
@@ -334,9 +334,7 @@ void main(unsigned long bist)
                        memcpy(resume_backup_memory, (void *)CONFIG_RAMBASE, HIGH_MEMORY_SAVE);
 
                /* Magic for S3 resume */
-               pci_write_config32(PCI_DEV(0, 0x00, 0), SKPAD, 0xcafed00d);
+               pci_write_config32(PCI_DEV(0, 0x00, 0), SKPAD, SKPAD_ACPI_S3_MAGIC);
        }
 #endif
-       /* Set legacy Brightness control to full brightness */
-       pci_write_config8(PCI_DEV(0, 2, 1), 0xf4, 0xff);
 }