i945 GMA: restore tft brightness from cmos
[coreboot.git] / src / mainboard / lenovo / x60 / romstage.c
index bdc2200b55b425e47658a0a591ed5b4bb7012136..2aa506f78cebf079ff0828a49e7cad31ccbd8090 100644 (file)
@@ -101,25 +101,20 @@ static void ich7_enable_lpc(void)
        pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x8e, 0x001c);
 }
 
-static void pnp_write_register(device_t dev, int reg, int val)
-{
-       unsigned int port = dev >> 8;
-       outb(reg, port);
-       outb(val, port+1);
-}
-
 static void early_superio_config(void)
 {
-       device_t dev;
+       int timeout = 100000;
+       device_t dev = PNP_DEV(0x2e, 3);
 
-       dev=PNP_DEV(0x2e, 0x00);
-       pnp_write_register(dev, 0x29, 0x06);
+       pnp_write_config(dev, 0x29, 0x06);
+
+       while(!(pnp_read_config(dev, 0x29) & 0x08) && timeout--)
+               udelay(1000);
 
        /* Enable COM1 */
-       pnp_write_register(dev, 0x07, 0x03);
-       pnp_write_register(dev, 0x60, 0x03);
-       pnp_write_register(dev, 0x61, 0xf8);
-       pnp_write_register(dev, 0x30, 0x01);
+       pnp_set_logical_device(dev);
+       pnp_set_iobase(dev, PNP_IDX_IO0, 0x3f8);
+       pnp_set_enable(dev, 1);
 }
 
 static void rcba_config(void)
@@ -244,14 +239,8 @@ void main(unsigned long bist)
                dock_connect();
                early_superio_config();
                /* Set up the console */
-               uart_init();
        }
 
-#if CONFIG_USBDEBUG
-       i82801gx_enable_usbdebug(1);
-       early_usbdebug_init();
-#endif
-
        console_init();
 
        /* Halt if there was a built in self test failure */
@@ -346,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);
 }