T60: remove redundant usbdebug_init call()
[coreboot.git] / src / mainboard / lenovo / t60 / romstage.c
index b659aa8025cb44b62f9afb31a745a297093e77c0..13faee2d240432df9c6257cd2007829c0c646850 100644 (file)
@@ -210,7 +210,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,22 +223,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 */
        }
 
-#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 */
@@ -333,9 +335,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);
 }