]> xenbits.xensource.com Git - seabios.git/commitdiff
acpi: remove PORT_ACPI_PM_BASE constant
authorGerd Hoffmann <kraxel@redhat.com>
Tue, 13 May 2014 12:01:22 +0000 (14:01 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 20 May 2014 10:15:30 +0000 (12:15 +0200)
Use the new acpi_pm_base variable instead.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
src/fw/acpi.c
src/fw/biostables.c
src/fw/paravirt.h
src/fw/pciinit.c
src/fw/smm.c
src/util.h

index 5ad2eec46ef5db33f9738ac3ebe2f15a3885e2bc..733ca4d47b2839a62288ef32704c24a1d3fc6782 100644 (file)
@@ -55,9 +55,9 @@ static void piix4_fadt_setup(struct pci_device *pci, void *arg)
     fadt->smi_cmd = cpu_to_le32(PORT_SMI_CMD);
     fadt->acpi_enable = PIIX4_ACPI_ENABLE;
     fadt->acpi_disable = PIIX4_ACPI_DISABLE;
-    fadt->pm1a_evt_blk = cpu_to_le32(PORT_ACPI_PM_BASE);
-    fadt->pm1a_cnt_blk = cpu_to_le32(PORT_ACPI_PM_BASE + 0x04);
-    fadt->pm_tmr_blk = cpu_to_le32(PORT_ACPI_PM_BASE + 0x08);
+    fadt->pm1a_evt_blk = cpu_to_le32(acpi_pm_base);
+    fadt->pm1a_cnt_blk = cpu_to_le32(acpi_pm_base + 0x04);
+    fadt->pm_tmr_blk = cpu_to_le32(acpi_pm_base + 0x08);
     fadt->gpe0_blk = cpu_to_le32(PIIX4_GPE0_BLK);
     fadt->pm1_evt_len = 4;
     fadt->pm1_cnt_len = 2;
@@ -81,10 +81,10 @@ static void ich9_lpc_fadt_setup(struct pci_device *dev, void *arg)
     fadt->smi_cmd = cpu_to_le32(PORT_SMI_CMD);
     fadt->acpi_enable = ICH9_ACPI_ENABLE;
     fadt->acpi_disable = ICH9_ACPI_DISABLE;
-    fadt->pm1a_evt_blk = cpu_to_le32(PORT_ACPI_PM_BASE);
-    fadt->pm1a_cnt_blk = cpu_to_le32(PORT_ACPI_PM_BASE + 0x04);
-    fadt->pm_tmr_blk = cpu_to_le32(PORT_ACPI_PM_BASE + 0x08);
-    fadt->gpe0_blk = cpu_to_le32(PORT_ACPI_PM_BASE + ICH9_PMIO_GPE0_STS);
+    fadt->pm1a_evt_blk = cpu_to_le32(acpi_pm_base);
+    fadt->pm1a_cnt_blk = cpu_to_le32(acpi_pm_base + 0x04);
+    fadt->pm_tmr_blk = cpu_to_le32(acpi_pm_base + 0x08);
+    fadt->gpe0_blk = cpu_to_le32(acpi_pm_base + ICH9_PMIO_GPE0_STS);
     fadt->pm1_evt_len = 4;
     fadt->pm1_cnt_len = 2;
     fadt->pm_tmr_len = 4;
index 17bee8e0d8bef8e839497b42bb2555b0dd5c13e1..50a891be88782903464494c660f018da0c0a2aef 100644 (file)
@@ -170,6 +170,7 @@ find_resume_vector(void)
 static struct acpi_20_generic_address acpi_reset_reg;
 static u8 acpi_reset_val;
 u32 acpi_pm1a_cnt VARFSEG;
+u16 acpi_pm_base = 0xb000;
 
 #define acpi_ga_to_bdf(addr) pci_to_bdf(0, (addr >> 32) & 0xffff, (addr >> 16) & 0xffff)
 
index 04fb4b96b453308789b9db42401bb2d2bb78562c..95ffb92adae82baebc38c50d64562cfebefa7e71 100644 (file)
@@ -29,8 +29,6 @@ static inline int runningOnKVM(void) {
 #define PORT_SMI_STATUS        0x00b3
 #define PORT_QEMU_CFG_CTL      0x0510
 #define PORT_QEMU_CFG_DATA     0x0511
-#define PORT_ACPI_PM_BASE      0xb000
-#define PORT_SMB_BASE          0xb100
 
 void qemu_preinit(void);
 void qemu_platform_setup(void);
index bbaecd6418f35b46f16ff6580a79c59a0b006369..9ffda4905d4fabeec7746818b06df8f2fe6c567b 100644 (file)
@@ -185,13 +185,13 @@ static void mch_isa_bridge_setup(struct pci_device *dev, void *arg)
 
     /* pm io base */
     pci_config_writel(bdf, ICH9_LPC_PMBASE,
-                      PORT_ACPI_PM_BASE | ICH9_LPC_PMBASE_RTE);
+                      acpi_pm_base | ICH9_LPC_PMBASE_RTE);
 
     /* acpi enable, SCI: IRQ9 000b = irq9*/
     pci_config_writeb(bdf, ICH9_LPC_ACPI_CTRL, ICH9_LPC_ACPI_CTRL_ACPI_EN);
 
-    acpi_pm1a_cnt = PORT_ACPI_PM_BASE + 0x04;
-    pmtimer_setup(PORT_ACPI_PM_BASE + 0x08);
+    acpi_pm1a_cnt = acpi_pm_base + 0x04;
+    pmtimer_setup(acpi_pm_base + 0x08);
 }
 
 static void storage_ide_setup(struct pci_device *pci, void *arg)
@@ -228,9 +228,9 @@ static void piix4_pm_config_setup(u16 bdf)
     // acpi sci is hardwired to 9
     pci_config_writeb(bdf, PCI_INTERRUPT_LINE, 9);
 
-    pci_config_writel(bdf, 0x40, PORT_ACPI_PM_BASE | 1);
+    pci_config_writel(bdf, 0x40, acpi_pm_base | 1);
     pci_config_writeb(bdf, 0x80, 0x01); /* enable PM io space */
-    pci_config_writel(bdf, 0x90, PORT_SMB_BASE | 1);
+    pci_config_writel(bdf, 0x90, (acpi_pm_base + 0x100) | 1);
     pci_config_writeb(bdf, 0xd2, 0x09); /* enable SMBus io space */
 }
 
@@ -242,8 +242,8 @@ static void piix4_pm_setup(struct pci_device *pci, void *arg)
     PiixPmBDF = pci->bdf;
     piix4_pm_config_setup(pci->bdf);
 
-    acpi_pm1a_cnt = PORT_ACPI_PM_BASE + 0x04;
-    pmtimer_setup(PORT_ACPI_PM_BASE + 0x08);
+    acpi_pm1a_cnt = acpi_pm_base + 0x04;
+    pmtimer_setup(acpi_pm_base + 0x08);
 }
 
 /* ICH9 SMBUS */
@@ -253,7 +253,7 @@ static void ich9_smbus_setup(struct pci_device *dev, void *arg)
     u16 bdf = dev->bdf;
     /* map smbus into io space */
     pci_config_writel(bdf, ICH9_SMB_SMB_BASE,
-                      PORT_SMB_BASE | PCI_BASE_ADDRESS_SPACE_IO);
+                      (acpi_pm_base + 0x100) | PCI_BASE_ADDRESS_SPACE_IO);
 
     /* enable SMBus */
     pci_config_writeb(bdf, ICH9_SMB_HOSTC, ICH9_SMB_HOSTC_HST_EN);
index 5ae6f324601c5f75cd3e47109a62a9e019700890..0f59f2074385ae23bb1bc02186da30ce69975c5a 100644 (file)
@@ -116,7 +116,7 @@ static void piix4_apmc_smm_setup(int isabdf, int i440_bdf)
 void ich9_lpc_apmc_smm_setup(int isabdf, int mch_bdf)
 {
     /* check if SMM init is already done */
-    u32 value = inl(PORT_ACPI_PM_BASE + ICH9_PMIO_SMI_EN);
+    u32 value = inl(acpi_pm_base + ICH9_PMIO_SMI_EN);
     if (value & ICH9_PMIO_SMI_EN_APMC_EN)
         return;
 
@@ -127,7 +127,7 @@ void ich9_lpc_apmc_smm_setup(int isabdf, int mch_bdf)
 
     /* enable SMI generation when writing to the APMC register */
     outl(value | ICH9_PMIO_SMI_EN_APMC_EN,
-         PORT_ACPI_PM_BASE + ICH9_PMIO_SMI_EN);
+         acpi_pm_base + ICH9_PMIO_SMI_EN);
 
     smm_relocate_and_restore();
 
index 0cbea485857cd179dcf9534a0f3a1622e5872346..b54271b6c82330de0077344416a55ea7df9f3b68 100644 (file)
@@ -70,6 +70,7 @@ extern struct pir_header *PirAddr;
 void copy_acpi_rsdp(void *pos);
 extern struct rsdp_descriptor *RsdpAddr;
 extern u32 acpi_pm1a_cnt;
+extern u16 acpi_pm_base;
 void *find_acpi_rsdp(void);
 u32 find_resume_vector(void);
 void acpi_reboot(void);