We define IO_APIC_ADDR in <arch/ioapic.h>, let's use it.
[coreboot.git] / src / southbridge / via / vt8237r / vt8237r_lpc.c
index f47c8c8dffa4b84341e7b395263dbbffa8beca3e..2de64f03ce1dd0e1598a37954bd1ab5169d18a4f 100644 (file)
@@ -65,7 +65,6 @@ static void pci_routing_fixup(struct device *dev)
 {
 #if CONFIG_EPIA_VT8237R_INIT
        device_t pdev;
-       u8 reg;
 #endif
 
        /* PCI PNP Interrupt Routing INTE/F - disable */
@@ -188,7 +187,7 @@ static void setup_pm(device_t dev)
         * 6 = SUSST# Deasserted Before PWRGD for STD
         * 5 = Keyboard/Mouse Swap
         * 4 = PWRGOOD reset on VT8237A/S
-        * 3 = GPO26/GPO27 is GPO 
+        * 3 = GPO26/GPO27 is GPO
         * 2 = Disable Alert on Lan
         * 1 = SUSCLK/GPO4
         * 0 = USB Wakeup
@@ -248,7 +247,7 @@ static void setup_pm(device_t dev)
 static void vt8237r_init(struct device *dev)
 {
        u8 enables;
-       
+
 #if CONFIG_EPIA_VT8237R_INIT
        printk(BIOS_SPEW, "Entering vt8237r_init, for EPIA.\n");
        /*
@@ -261,9 +260,9 @@ static void vt8237r_init(struct device *dev)
        enables = pci_read_config8(dev, 0xe5);
        enables |= 0x23;
        pci_write_config8(dev, 0xe5, enables);
-       
-       /* 
-        * Enable Flash Write Access. 
+
+       /*
+        * Enable Flash Write Access.
         * Note EPIA-N Does not use REQ5 or PCISTP#(Hang)
         */
        enables = pci_read_config8(dev, 0xe4);
@@ -275,14 +274,14 @@ static void vt8237r_init(struct device *dev)
        enables |= 0x80;
        pci_write_config8(dev, 0x4E, enables);
 
-#else 
+#else
        printk(BIOS_SPEW, "Entering vt8237r_init.\n");
        /*
         * Enable SATA LED, disable special CPU Frequency Change -
         * GPIO28 GPIO22 GPIO29 GPIO23 are GPIOs.
         */
        pci_write_config8(dev, 0xe5, 0x09);
-       
+
        /* REQ5 as PCI request input - should be together with INTE-INTH. */
        pci_write_config8(dev, 0xe4, 0x4);
 #endif
@@ -330,7 +329,7 @@ static void vt8237s_init(struct device *dev)
                           (VT8237S_SPI_MEM_BASE >> 8) | (tmp & 0xFF000000));
 
        /*
-        * REQ5 as PCI request input - should be together with INTE-INTH. 
+        * REQ5 as PCI request input - should be together with INTE-INTH.
         */
        pci_write_config8(dev, 0xe4, 0x04);
 
@@ -491,7 +490,7 @@ static void vt8237r_read_resources(device_t dev)
 
        /* Fixed APIC resource */
        res = new_resource(dev, 0x44);
-       res->base = VT8237R_APIC_BASE;
+       res->base = IO_APIC_ADDR;
        res->size = 256;
        res->limit = 0xffffffffUL;
        res->align = 8;
@@ -506,17 +505,6 @@ static void vt8237r_read_resources(device_t dev)
        res->flags = IORESOURCE_IO | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
 }
 
-/**
- * The VT8237R is not a PCI bridge and has no resources of its own (other
- * than standard PC I/O addresses), however it does control the ISA bus
- * and so we need to manually call enable childrens resources on that bus.
- */
-static void vt8237r_enable_resources(device_t dev)
-{
-       pci_dev_enable_resources(dev);
-       enable_childrens_resources(dev);
-}
-
 static void init_keyboard(struct device *dev)
 {
        u8 regval = pci_read_config8(dev, 0x51);
@@ -528,7 +516,7 @@ static void southbridge_init_common(struct device *dev)
 {
        vt8237_common_init(dev);
        pci_routing_fixup(dev);
-       setup_ioapic(VT8237R_APIC_BASE, VT8237R_APIC_ID);
+       setup_ioapic(IO_APIC_ADDR, VT8237R_APIC_ID);
        setup_i8259();
        init_keyboard(dev);
 }
@@ -536,16 +524,16 @@ static void southbridge_init_common(struct device *dev)
 static const struct device_operations vt8237r_lpc_ops_s = {
        .read_resources         = vt8237r_read_resources,
        .set_resources          = pci_dev_set_resources,
-       .enable_resources       = vt8237r_enable_resources,
-       .init                   = &vt8237s_init,
+       .enable_resources       = pci_dev_enable_resources,
+       .init                   = vt8237s_init,
        .scan_bus               = scan_static_bus,
 };
 
 static const struct device_operations vt8237r_lpc_ops_r = {
        .read_resources         = vt8237r_read_resources,
        .set_resources          = pci_dev_set_resources,
-       .enable_resources       = vt8237r_enable_resources,
-       .init                   = &vt8237r_init,
+       .enable_resources       = pci_dev_enable_resources,
+       .init                   = vt8237r_init,
        .scan_bus               = scan_static_bus,
 };