]> xenbits.xensource.com Git - seabios.git/commitdiff
Don't pass khz to pmtimer_setup - it's always PM_TIMER_FREQUENCY.
authorKevin O'Connor <kevin@koconnor.net>
Sat, 20 Jul 2013 15:06:51 +0000 (11:06 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 20 Jul 2013 23:29:52 +0000 (19:29 -0400)
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/acpi.c
src/pciinit.c
src/pit.h
src/timer.c
src/util.h

index 3699898c2525a9d5b2d5242c780c014d11c78f4b..365cc466beaff64f93ecb0e59867aeb1d80d3f64 100644 (file)
@@ -732,7 +732,7 @@ find_acpi_features(void)
     u32 pm_tmr = le32_to_cpu(fadt->pm_tmr_blk);
     dprintf(4, "pm_tmr_blk=%x\n", pm_tmr);
     if (pm_tmr)
-        pmtimer_setup(pm_tmr, 3579);
+        pmtimer_setup(pm_tmr);
 
     // Theoretically we should check the 'reset_reg_sup' flag, but Windows
     // doesn't and thus nobody seems to *set* it. If the table is large enough
index 8370b960e7384d574a64ba3e87546e23e7e9f779..6d7f8faf50f4cdbf53d3826ce3fcd9e51a7ca3a8 100644 (file)
@@ -16,9 +16,6 @@
 #include "dev-q35.h" // Q35_HOST_BRIDGE_PCIEXBAR_ADDR
 #include "list.h" // struct hlist_node
 
-/* PM Timer ticks per second (HZ) */
-#define PM_TIMER_FREQUENCY  3579545
-
 #define PCI_DEVICE_MEM_MIN     0x1000
 #define PCI_BRIDGE_IO_MIN      0x1000
 #define PCI_BRIDGE_MEM_MIN   0x100000
@@ -194,7 +191,7 @@ void mch_isa_bridge_setup(struct pci_device *dev, void *arg)
     /* acpi enable, SCI: IRQ9 000b = irq9*/
     pci_config_writeb(bdf, ICH9_LPC_ACPI_CTRL, ICH9_LPC_ACPI_CTRL_ACPI_EN);
 
-    pmtimer_setup(PORT_ACPI_PM_BASE + 0x08, PM_TIMER_FREQUENCY / 1000);
+    pmtimer_setup(PORT_ACPI_PM_BASE + 0x08);
 }
 
 static void storage_ide_setup(struct pci_device *pci, void *arg)
@@ -238,7 +235,7 @@ static void piix4_pm_setup(struct pci_device *pci, void *arg)
     pci_config_writel(bdf, 0x90, PORT_SMB_BASE | 1);
     pci_config_writeb(bdf, 0xd2, 0x09); /* enable SMBus io space */
 
-    pmtimer_setup(PORT_ACPI_PM_BASE + 0x08, PM_TIMER_FREQUENCY / 1000);
+    pmtimer_setup(PORT_ACPI_PM_BASE + 0x08);
 }
 
 /* ICH9 SMBUS */
index 6d588956e17b649f54c44a4a39d23c250f00765f..7b5e5e8d42501254ac9f67b83f286455a573a6c9 100644 (file)
--- a/src/pit.h
+++ b/src/pit.h
@@ -2,6 +2,9 @@
 #ifndef __PIT_H
 #define __PIT_H
 
+/* PM Timer ticks per second (HZ) */
+#define PM_TIMER_FREQUENCY  3579545
+
 #define PIT_TICK_RATE 1193180   // Underlying HZ of PIT
 #define PIT_TICK_INTERVAL 65536 // Default interval for 18.2Hz timer
 #define TICKS_PER_DAY (u32)((u64)60*60*24*PIT_TICK_RATE / PIT_TICK_INTERVAL)
index a491ef6a16bb539c3e225ebe9c498dc57796c6f7..87df97b13ac0dd3264d797558b7af89d809f825b 100644 (file)
@@ -99,10 +99,11 @@ emulate_tsc(void)
     return ret;
 }
 
-void pmtimer_setup(u16 ioport, u32 khz)
+void pmtimer_setup(u16 ioport)
 {
     if (!CONFIG_PMTIMER)
         return;
+    u32 khz = PM_TIMER_FREQUENCY / 1000;
     dprintf(1, "Using pmtimer, ioport 0x%x, freq %d kHz\n", ioport, khz);
     SET_GLOBAL(pmtimer_ioport, ioport);
     SET_GLOBAL(cpu_khz, khz);
index 19733cda7728ca92e2489101393db14c99e0c7af..15982e25d44ec025a8e26f2f1475c63e12010ebf 100644 (file)
@@ -282,7 +282,7 @@ void useRTC(void);
 void releaseRTC(void);
 
 // timer.c
-void pmtimer_setup(u16 ioport, u32 khz);
+void pmtimer_setup(u16 ioport);
 int check_tsc(u64 end);
 void timer_setup(void);
 void ndelay(u32 count);