summaryrefslogtreecommitdiff
path: root/src/southbridge/intel/i82801ex
diff options
context:
space:
mode:
Diffstat (limited to 'src/southbridge/intel/i82801ex')
-rw-r--r--src/southbridge/intel/i82801ex/lpc.c65
1 files changed, 45 insertions, 20 deletions
diff --git a/src/southbridge/intel/i82801ex/lpc.c b/src/southbridge/intel/i82801ex/lpc.c
index d0d597871f..fb1586eb12 100644
--- a/src/southbridge/intel/i82801ex/lpc.c
+++ b/src/southbridge/intel/i82801ex/lpc.c
@@ -21,6 +21,45 @@
#define CONFIG_MAINBOARD_POWER_ON_AFTER_POWER_FAIL MAINBOARD_POWER_ON
#endif
+/**
+ * Enable ACPI I/O range.
+ *
+ * @param dev PCI device with ACPI and PM BAR's
+ */
+static void i82801ex_enable_acpi(struct device *dev)
+{
+ u8 gpio_cntl;
+
+ /* Enable ACPI I/O range decode and ACPI power management. */
+ pci_write_config8(dev, ACPI_CNTL, ACPI_EN);
+
+ /* Enable the GPIO bar */
+ gpio_cntl = pci_read_config8(dev, GPIO_CNTL);
+ gpio_cntl |= GPIO_EN;
+ pci_write_config8(dev, GPIO_CNTL, gpio_cntl);
+}
+
+/**
+ * Set miscellanous static southbridge features.
+ *
+ * @param dev PCI device with I/O APIC configuration registers
+ */
+static void i82801ex_general_cntl(struct device *dev)
+{
+ u32 reg32;
+
+ reg32 = pci_read_config32(dev, GEN_CNTL);
+ reg32 |= (3 << 7); /* IOAPIC enable (APIC_EN) */
+ reg32 |= (1 << 1); /* Delayed transaction enable (DTE) */
+ pci_write_config32(dev, GEN_CNTL, reg32);
+ printk(BIOS_DEBUG, "Southbridge GEN_CNTL 0x%08x\n", reg32);
+
+ reg32 = pci_read_config32(dev, GEN_STS);
+ reg32 |= (1<<1);
+ pci_write_config32(dev, GEN_STS, reg32);
+
+}
+
#define SERIRQ_CNTL 0x64
static void i82801ex_enable_serial_irqs(device_t dev)
{
@@ -237,16 +276,11 @@ static void enable_hpet(struct device *dev)
static void lpc_init(struct device *dev)
{
uint8_t byte;
- uint32_t value;
int pwr_on=CONFIG_MAINBOARD_POWER_ON_AFTER_POWER_FAIL;
- /* IO APIC initialization */
- value = pci_read_config32(dev, 0xd0);
- value |= (1 << 8)|(1<<7)|(1<<1);
- pci_write_config32(dev, 0xd0, value);
- value = pci_read_config32(dev, 0xd4);
- value |= (1<<1);
- pci_write_config32(dev, 0xd4, value);
+ i82801ex_general_cntl(dev);
+
+ /* IO APIC initialization. */
setup_ioapic(IO_APIC_ADDR, 0); // Don't rename IO APIC ID.
i82801ex_enable_serial_irqs(dev);
@@ -319,20 +353,11 @@ static void i82801ex_lpc_read_resources(device_t dev)
static void i82801ex_lpc_enable_resources(device_t dev)
{
- uint8_t acpi_cntl, gpio_cntl;
-
- /* Enable the normal pci resources */
+ /* Enable the normal PCI resources. */
pci_dev_enable_resources(dev);
- /* Enable the ACPI bar */
- acpi_cntl = pci_read_config8(dev, 0x44);
- acpi_cntl |= (1 << 4);
- pci_write_config8(dev, 0x44, acpi_cntl);
-
- /* Enable the GPIO bar */
- gpio_cntl = pci_read_config8(dev, 0x5c);
- gpio_cntl |= (1 << 4);
- pci_write_config8(dev, 0x5c, gpio_cntl);
+ /* Enable ACPI and GPIO BARs. */
+ i82801ex_enable_acpi(dev);
}
static struct pci_operations lops_pci = {