Skip to contentSkip to conversation

x86 updates for v2.6.28, phase #8, hpet

GIT PULL Ingo Molnar 1 participant 2 messages Oct 10, 2008

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the latest x86-v28-for-linus-phase8 git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git x86-v28-for-linus-phase8

HPET updates part 1. (part two will be the per-CPU MSI HPET feature)

out-of-topic modifications in x86-v28-for-linus-phase8:
-------------------------------------------------------
drivers/char/hpet.c # f92a789: hpet: /dev/hpet - fixes and clean
# 64a76f6: hpet: /dev/hpet - fixes and clean # 70ef6d5: x86: get irq for hpet timer
include/linux/hpet.h # 64a76f6: hpet: /dev/hpet - fixes and clean
# 70ef6d5: x86: get irq for hpet timer

Thanks,

Ingo

------------------>
Andreas Herrmann (1):
x86: hpet: modify IXP400 quirk to enable interrupts

David Brownell (2):
hpet: /dev/hpet - fixes and cleanup
hpet: /dev/hpet - fixes and cleanup, fix

Joe Buehler (1):
x86: add PCI ID for 6300ESB force hpet

Jordan Crouse (1):
x86, hpet: SB600 - remove HPET resources from PCI device

Kevin Hao (1):
x86: get irq for hpet timer

Krzysztof Oledzki (1):
x86: add another PCI ID for ICH6 force-hpet

Randy Dunlap (1):
documentation: move hpet.txt to timers/ subdirectory

 Documentation/00-INDEX              |    2 -
 Documentation/timers/00-INDEX       |   10 ++
 Documentation/{ => timers}/hpet.txt |   43 +++++-----
 arch/x86/kernel/hpet.c              |    6 +-
 arch/x86/kernel/quirks.c            |   41 +++++++++-
 arch/x86/pci/fixup.c                |   28 ++++++
 drivers/char/hpet.c                 |  155 ++++++++++++++++++++---------------
 include/linux/hpet.h                |   14 +---
 8 files changed, 195 insertions(+), 104 deletions(-)
 create mode 100644 Documentation/timers/00-INDEX
 rename Documentation/{ => timers}/hpet.txt (81%)
Documentation/00-INDEX +0 -2
index 7306081..4382778 100644
@@ -159,8 +159,6 @@ hayes-esp.txt
 	- info on using the Hayes ESP serial driver.
 highuid.txt
 	- notes on the change from 16 bit to 32 bit user/group IDs.
-hpet.txt
-	- High Precision Event Timer Driver for Linux.
 timers/
 	- info on the timer related topics
 hw_random.txt
Documentation/timers/00-INDEX new file +10 -0
new file mode 100644
index 0000000..397dc35
@@ -0,0 +1,10 @@
+00-INDEX
+	- this file
+highres.txt
+	- High resolution timers and dynamic ticks design notes
+hpet.txt
+	- High Precision Event Timer Driver for Linux
+hrtimers.txt
+	- subsystem for high-resolution kernel timers
+timer_stats.txt
+	- timer usage statistics
Documentation/timers/hpet.txt renamed from Documentation/hpet.txt +21 -22

57 lines not on this page · raw message

arch/x86/kernel/hpet.c +5 -1
index 73deaff..acf62fc 100644
@@ -115,13 +115,17 @@ static void hpet_reserve_platform_timers(unsigned long id)
 	hd.hd_phys_address = hpet_address;
 	hd.hd_address = hpet;
 	hd.hd_nirqs = nrtimers;
-	hd.hd_flags = HPET_DATA_PLATFORM;
 	hpet_reserve_timer(&hd, 0);
 
 #ifdef CONFIG_HPET_EMULATE_RTC
 	hpet_reserve_timer(&hd, 1);
 #endif
 
+	/*
+	 * NOTE that hd_irq[] reflects IOAPIC input pins (LEGACY_8254
+	 * is wrong for i8259!) not the output IRQ.  Many BIOS writers
+	 * don't bother configuring *any* comparator interrupts.
+	 */
 	hd.hd_irq[0] = HPET_LEGACY_8254;
 	hd.hd_irq[1] = HPET_LEGACY_RTC;
 
arch/x86/kernel/quirks.c +39 -2

62 lines not on this page · raw message

arch/x86/pci/fixup.c +28 -0
index 4bdaa59..3c27a80 100644
@@ -511,3 +511,31 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1201, fam10h_pci_cfg_space_size);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1202, fam10h_pci_cfg_space_size);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1203, fam10h_pci_cfg_space_size);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1204, fam10h_pci_cfg_space_size);
+
+/*
+ * SB600: Disable BAR1 on device 14.0 to avoid HPET resources from
+ * confusing the PCI engine:
+ */
+static void sb600_disable_hpet_bar(struct pci_dev *dev)
+{
+	u8 val;
+
+	/*
+	 * The SB600 and SB700 both share the same device
+	 * ID, but the PM register 0x55 does something different
+	 * for the SB700, so make sure we are dealing with the
+	 * SB600 before touching the bit:
+	 */
+
+	pci_read_config_byte(dev, 0x08, &val);
+
+	if (val < 0x2F) {
+		outb(0x55, 0xCD6);
+		val = inb(0xCD7);
+
+		/* Set bit 7 in PM register 0x55 */
+		outb(0x55, 0xCD6);
+		outb(val | 0x80, 0xCD7);
+	}
+}
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_ATI, 0x4385, sb600_disable_hpet_bar);
drivers/char/hpet.c +89 -66

233 lines not on this page · raw message

include/linux/hpet.h +3 -11
index 2dc29ce..79f63a2 100644
@@ -37,6 +37,7 @@ struct hpet {
 #define	hpet_compare	_u1._hpet_compare
 
 #define	HPET_MAX_TIMERS	(32)
+#define	HPET_MAX_IRQ	(32)
 
 /*
  * HPET general capabilities register
@@ -64,7 +65,7 @@ struct hpet {
  */
 
 #define	Tn_INT_ROUTE_CAP_MASK		(0xffffffff00000000ULL)
-#define	Tn_INI_ROUTE_CAP_SHIFT		(32UL)
+#define	Tn_INT_ROUTE_CAP_SHIFT		(32UL)
 #define	Tn_FSB_INT_DELCAP_MASK		(0x8000UL)
 #define	Tn_FSB_INT_DELCAP_SHIFT		(15)
 #define	Tn_FSB_EN_CNF_MASK		(0x4000UL)
@@ -91,23 +92,14 @@ struct hpet {
  * exported interfaces
  */
 
-struct hpet_task {
-	void (*ht_func) (void *);
-	void *ht_data;
-	void *ht_opaque;
-};
-
 struct hpet_data {
 	unsigned long hd_phys_address;
 	void __iomem *hd_address;
 	unsigned short hd_nirqs;
-	unsigned short hd_flags;
 	unsigned int hd_state;	/* timer allocated */
 	unsigned int hd_irq[HPET_MAX_TIMERS];
 };
 
-#define	HPET_DATA_PLATFORM	0x0001	/* platform call to hpet_alloc */
-
 static inline void hpet_reserve_timer(struct hpet_data *hd, int timer)
 {
 	hd->hd_state |= (1 << timer);
@@ -125,7 +117,7 @@ struct hpet_info {
 	unsigned short hi_timer;
 };
 
-#define	HPET_INFO_PERIODIC	0x0001	/* timer is periodic */
+#define HPET_INFO_PERIODIC	0x0010	/* periodic-capable comparator */
 
 #define	HPET_IE_ON	_IO('h', 0x01)	/* interrupt on */
 #define	HPET_IE_OFF	_IO('h', 0x02)	/* interrupt off */
#1 lore raw
Quoted 5 lines · Ingo Molnar

Linus,

Please pull the latest x86-v28-for-linus-phase8 git tree from:

HPET updates part 1. (part two will be the per-CPU MSI HPET feature)

please find updated pull request below. Relative to phase-N-1. Updates from today in this topic:

f26ed11: HPET: Remove spurious HPET busy warning message.

Ingo

------------->
Linus,

Please pull the latest x86-v28-for-linus-phase8-B git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git x86-v28-for-linus-phase8-B

out-of-topic modifications in x86-v28-for-linus-phase8-B:
---------------------------------------------------------
drivers/char/hpet.c # f26ed11: HPET: Remove spurious HPET busy w
# f92a789: hpet: /dev/hpet - fixes and clean # 64a76f6: hpet: /dev/hpet - fixes and clean # 70ef6d5: x86: get irq for hpet timer
include/linux/hpet.h # 64a76f6: hpet: /dev/hpet - fixes and clean
# 70ef6d5: x86: get irq for hpet timer

Thanks,

Ingo

------------------>
Andreas Herrmann (1):
x86: hpet: modify IXP400 quirk to enable interrupts

David Brownell (2):
hpet: /dev/hpet - fixes and cleanup
hpet: /dev/hpet - fixes and cleanup, fix

David John (1):
HPET: Remove spurious HPET busy warning message.

Joe Buehler (1):
x86: add PCI ID for 6300ESB force hpet

Jordan Crouse (1):
x86, hpet: SB600 - remove HPET resources from PCI device

Kevin Hao (1):
x86: get irq for hpet timer

Krzysztof Oledzki (1):
x86: add another PCI ID for ICH6 force-hpet

Randy Dunlap (1):
documentation: move hpet.txt to timers/ subdirectory

 Documentation/00-INDEX              |    2 -
 Documentation/timers/00-INDEX       |   10 ++
 Documentation/{ => timers}/hpet.txt |   43 +++++-----
 arch/x86/kernel/hpet.c              |    6 +-
 arch/x86/kernel/quirks.c            |   41 +++++++++-
 arch/x86/pci/fixup.c                |   28 ++++++
 drivers/char/hpet.c                 |  159 +++++++++++++++++++---------------
 include/linux/hpet.h                |   14 +---
 8 files changed, 195 insertions(+), 108 deletions(-)
 create mode 100644 Documentation/timers/00-INDEX
 rename Documentation/{ => timers}/hpet.txt (81%)
Documentation/00-INDEX +0 -2
index 7306081..4382778 100644
@@ -159,8 +159,6 @@ hayes-esp.txt
 	- info on using the Hayes ESP serial driver.
 highuid.txt
 	- notes on the change from 16 bit to 32 bit user/group IDs.
-hpet.txt
-	- High Precision Event Timer Driver for Linux.
 timers/
 	- info on the timer related topics
 hw_random.txt
Documentation/timers/00-INDEX new file +10 -0
new file mode 100644
index 0000000..397dc35
@@ -0,0 +1,10 @@
+00-INDEX
+	- this file
+highres.txt
+	- High resolution timers and dynamic ticks design notes
+hpet.txt
+	- High Precision Event Timer Driver for Linux
+hrtimers.txt
+	- subsystem for high-resolution kernel timers
+timer_stats.txt
+	- timer usage statistics
Documentation/timers/hpet.txt renamed from Documentation/hpet.txt +21 -22

57 lines not on this page · raw message

arch/x86/kernel/hpet.c +5 -1
index 73deaff..acf62fc 100644
@@ -115,13 +115,17 @@ static void hpet_reserve_platform_timers(unsigned long id)
 	hd.hd_phys_address = hpet_address;
 	hd.hd_address = hpet;
 	hd.hd_nirqs = nrtimers;
-	hd.hd_flags = HPET_DATA_PLATFORM;
 	hpet_reserve_timer(&hd, 0);
 
 #ifdef CONFIG_HPET_EMULATE_RTC
 	hpet_reserve_timer(&hd, 1);
 #endif
 
+	/*
+	 * NOTE that hd_irq[] reflects IOAPIC input pins (LEGACY_8254
+	 * is wrong for i8259!) not the output IRQ.  Many BIOS writers
+	 * don't bother configuring *any* comparator interrupts.
+	 */
 	hd.hd_irq[0] = HPET_LEGACY_8254;
 	hd.hd_irq[1] = HPET_LEGACY_RTC;
 
arch/x86/kernel/quirks.c +39 -2

62 lines not on this page · raw message

arch/x86/pci/fixup.c +28 -0
index 4bdaa59..3c27a80 100644
@@ -511,3 +511,31 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1201, fam10h_pci_cfg_space_size);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1202, fam10h_pci_cfg_space_size);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1203, fam10h_pci_cfg_space_size);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1204, fam10h_pci_cfg_space_size);
+
+/*
+ * SB600: Disable BAR1 on device 14.0 to avoid HPET resources from
+ * confusing the PCI engine:
+ */
+static void sb600_disable_hpet_bar(struct pci_dev *dev)
+{
+	u8 val;
+
+	/*
+	 * The SB600 and SB700 both share the same device
+	 * ID, but the PM register 0x55 does something different
+	 * for the SB700, so make sure we are dealing with the
+	 * SB600 before touching the bit:
+	 */
+
+	pci_read_config_byte(dev, 0x08, &val);
+
+	if (val < 0x2F) {
+		outb(0x55, 0xCD6);
+		val = inb(0xCD7);
+
+		/* Set bit 7 in PM register 0x55 */
+		outb(0x55, 0xCD6);
+		outb(val | 0x80, 0xCD7);
+	}
+}
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_ATI, 0x4385, sb600_disable_hpet_bar);
drivers/char/hpet.c +89 -70

249 lines not on this page · raw message

include/linux/hpet.h +3 -11
index 2dc29ce..79f63a2 100644
@@ -37,6 +37,7 @@ struct hpet {
 #define	hpet_compare	_u1._hpet_compare
 
 #define	HPET_MAX_TIMERS	(32)
+#define	HPET_MAX_IRQ	(32)
 
 /*
  * HPET general capabilities register
@@ -64,7 +65,7 @@ struct hpet {
  */
 
 #define	Tn_INT_ROUTE_CAP_MASK		(0xffffffff00000000ULL)
-#define	Tn_INI_ROUTE_CAP_SHIFT		(32UL)
+#define	Tn_INT_ROUTE_CAP_SHIFT		(32UL)
 #define	Tn_FSB_INT_DELCAP_MASK		(0x8000UL)
 #define	Tn_FSB_INT_DELCAP_SHIFT		(15)
 #define	Tn_FSB_EN_CNF_MASK		(0x4000UL)
@@ -91,23 +92,14 @@ struct hpet {
  * exported interfaces
  */
 
-struct hpet_task {
-	void (*ht_func) (void *);
-	void *ht_data;
-	void *ht_opaque;
-};
-
 struct hpet_data {
 	unsigned long hd_phys_address;
 	void __iomem *hd_address;
 	unsigned short hd_nirqs;
-	unsigned short hd_flags;
 	unsigned int hd_state;	/* timer allocated */
 	unsigned int hd_irq[HPET_MAX_TIMERS];
 };
 
-#define	HPET_DATA_PLATFORM	0x0001	/* platform call to hpet_alloc */
-
 static inline void hpet_reserve_timer(struct hpet_data *hd, int timer)
 {
 	hd->hd_state |= (1 << timer);
@@ -125,7 +117,7 @@ struct hpet_info {
 	unsigned short hi_timer;
 };
 
-#define	HPET_INFO_PERIODIC	0x0001	/* timer is periodic */
+#define HPET_INFO_PERIODIC	0x0010	/* periodic-capable comparator */
 
 #define	HPET_IE_ON	_IO('h', 0x01)	/* interrupt on */
 #define	HPET_IE_OFF	_IO('h', 0x02)	/* interrupt off */