aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/asm-x86/hpet.h
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-03-20 12:33:55 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-03-20 12:33:55 +0000
commit3ba523ff957c0478665541faf061962ca3c2b82f (patch)
tree0177c3a0d01763db23880540d5b07af1122cc2b5 /xen/include/asm-x86/hpet.h
parent5534b7d9866f754c269ba33c7602d93cc4ff9ecd (diff)
downloadxen-3ba523ff957c0478665541faf061962ca3c2b82f.tar.gz
xen-3ba523ff957c0478665541faf061962ca3c2b82f.tar.bz2
xen-3ba523ff957c0478665541faf061962ca3c2b82f.zip
CPUIDLE: enable MSI capable HPET for timer broadcast
The HPET broadcast was default not enabled because the old code use HPET channel 0 in legacy replacing mode which will hide both PIT & RTC irqs and cause issues if RTC is needed in some cases. The upstream default broadcast timer is PIT, which is in periodic mode (100HZ) and would be expensive to be used as oneshot. MSI capable HPET is coming into being. It is capable to deliver interrupt through FSB directly, and has no side effect. This patch extends support for MSI HPET based on original legacy HPET code. The broadcast timer selection logic becomes: 1. if MSI capable HPET available, use multiple HPET channels (no more than possible cpu num) in MSI mode; 2. else if legacy replacing mode available for HPET & 'hpetbroadcast' option is given in cmd line, use HPET channel 0 in legacy mode; 3 else use PIT. While entering broadcast, it gets a hpet channel (look for a spare one first, if failing allocate a shared one), attach to current cpu, setup the irq affinity & broadcast cpumask. While exiting broadcast, it detach the used hpet channel and try to change the owner if the broadcast mask is not empty. Some optimizations(static affinity) were done for (MSI HPET channels >= possible cpu num) case. A new hw_interrupt_controller 'HPET_MSI' is created for HPET MSI interrupt handling. Signed-off-by: Wei Gang <gang.wei@intel.com>=
Diffstat (limited to 'xen/include/asm-x86/hpet.h')
-rw-r--r--xen/include/asm-x86/hpet.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/xen/include/asm-x86/hpet.h b/xen/include/asm-x86/hpet.h
index 82c08bc3c5..f962ab7948 100644
--- a/xen/include/asm-x86/hpet.h
+++ b/xen/include/asm-x86/hpet.h
@@ -47,6 +47,11 @@
#define HPET_TN_PERIODIC_CAP 0x010
#define HPET_TN_SETVAL 0x040
#define HPET_TN_32BIT 0x100
+#define HPET_TN_ROUTE 0x3e00
+#define HPET_TN_FSB 0x4000
+#define HPET_TN_FSB_CAP 0x8000
+#define HPET_TN_ROUTE_SHIFT 9
+
#define hpet_read32(x) \
(*(volatile u32 *)(fix_to_virt(FIX_HPET_BASE) + (x)))