Skip to contentSkip to conversation

GTOD: add-scx200-hrt-clocksource.diff

PATCH In review Jim Cromie 2 participants 2 messages Jun 25, 2006 – Jun 26, 2006

Subsystems (2)
lore
Share & tools
lore

Jim Cromie

author maintainer
#0 lore raw

PATCH 1/1 GTOD: add-scx200-hrt-clocksource.diff

this is a resend of:
http://marc.theaimsgroup.com/?l=linux-kernel&m=114800999113687&w=2

---

This patch adds a GTOD clocksource driver based on the Geode SCx200's Hi-Res Timer.

---

$ diffstat add-scx200-hrt-clocksource.diff
arch/i386/Kconfig                |   24 ++++++---
drivers/clocksource/Makefile     |    5 +
drivers/clocksource/scx200_hrt.c |  101 +++++++++++++++++++++++++++++++++++++++
3 files changed, 121 insertions(+), 9 deletions(-)

---

arch/i386/Kconfig +0 -0
diff -ruNp -X dontdiff -X exclude-diffs linux-2.6.17-mm2/arch/i386/Kconfig linux-2.6.17-mm2-hrt-sk/arch/i386/Kconfig
@@ -1073,13 +1073,23 @@ config SCx200

tristate "NatSemi SCx200 support"
depends on !X86_VOYAGER
help
- This provides basic support for the National Semiconductor SCx200
- processor. Right now this is just a driver for the GPIO pins.
-
- If you don't know what to do here, say N.
-

-	  This support is also available as a module.  If compiled as a
-	  module, it will be called scx200.
+	  This provides basic support for National Semiconductor's
+	  (now AMD's) Geode processors.  The driver probes for the
+	  PCI-IDs of several on-chip devices, so its a good dependency
+	  for other scx200_* drivers.

+
+ If compiled as a module, the driver is named scx200.
+
+config SCx200HR_TIMER
+ tristate "NatSemi SCx200 27MHz High-Resolution Timer Support"
+ depends on SCx200 && GENERIC_TIME
+ default y
+ help

+	  This driver provides a clocksource built upon the on-chip
+	  27MHz high-resolution timer.  Its also a workaround for
+	  NSC Geode SC-1100's buggy TSC, which loses time when the
+	  processor goes idle (as is done by the scheduler).  The
+	  other workaround is idle=poll boot option.

config K8_NB
def_bool y

drivers/clocksource/Makefile +3 -2
diff -ruNp -X dontdiff -X exclude-diffs linux-2.6.17-mm2/drivers/clocksource/Makefile linux-2.6.17-mm2-hrt-sk/drivers/clocksource/Makefile
@@ -1,2 +1,3 @@
-obj-$(CONFIG_X86_CYCLONE_TIMER) += cyclone.o
-obj-$(CONFIG_X86_PM_TIMER) += acpi_pm.o
+obj-$(CONFIG_X86_CYCLONE_TIMER)	+= cyclone.o
+obj-$(CONFIG_X86_PM_TIMER)	+= acpi_pm.o
+obj-$(CONFIG_SCx200HR_TIMER)	+= scx200_hrt.o
drivers/clocksource/scx200_hrt.c +101 -0

101 lines not on this page · raw message

#1 lore raw
Quoted 15 lines · On Sun, 25 Jun 2006 16:01:40 -0600 Jim Cromie wrote:
$ diffstat add-scx200-hrt-clocksource.diff
 arch/i386/Kconfig                |   24 ++++++---
 drivers/clocksource/Makefile     |    5 +
 drivers/clocksource/scx200_hrt.c |  101 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 121 insertions(+), 9 deletions(-)

---

diff -ruNp -X dontdiff -X exclude-diffs linux-2.6.17-mm2/arch/i386/Kconfig linux-2.6.17-mm2-hrt-sk/arch/i386/Kconfig

arch/i386/Kconfig +0 -0
@@ -1073,13 +1073,23 @@ config SCx200
 	tristate "NatSemi SCx200 support"
 	depends on !X86_VOYAGER
 	help

arch/i386/Kconfig config SCx200 · line 1078

Quoted 10 lines
arch/i386/Kconfig +3 -7
-	  This provides basic support for the National Semiconductor SCx200
-	  processor.  Right now this is just a driver for the GPIO pins.
-
-	  If you don't know what to do here, say N.
-
-	  This support is also available as a module.  If compiled as a
-	  module, it will be called scx200.
+	  This provides basic support for National Semiconductor's
+	  (now AMD's) Geode processors.  The driver probes for the
+	  PCI-IDs of several on-chip devices, so its a good dependency

it's

arch/i386/Kconfig config SCx200 · line 1089

Quoted 11 lines
arch/i386/Kconfig +11 -0
+	  for other scx200_* drivers.
+
+	  If compiled as a module, the driver is named scx200.
+
+config SCx200HR_TIMER
+	tristate "NatSemi SCx200 27MHz High-Resolution Timer Support"
+	depends on SCx200 && GENERIC_TIME
+	default y
+	help
+	  This driver provides a clocksource built upon the on-chip
+	  27MHz high-resolution timer.  Its also a workaround for

It's

Quoted 11 lines
arch/i386/Kconfig +3 -0
+	  NSC Geode SC-1100's buggy TSC, which loses time when the
+	  processor goes idle (as is done by the scheduler).  The
+	  other workaround is idle=poll boot option.
 
 config K8_NB
 	def_bool y

diff -ruNp -X dontdiff -X exclude-diffs linux-2.6.17-mm2/drivers/clocksource/scx200_hrt.c linux-2.6.17-mm2-hrt-sk/drivers/clocksource/scx200_hrt.c

drivers/clocksource/scx200_hrt.c line 7

Quoted 7 lines
drivers/clocksource/scx200_hrt.c +7 -0
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2006 Jim Cromie
+ *
+
+static int mhz27;
+module_param(mhz27, int, 0);	/* load time only */
+MODULE_PARM_DESC(mhz27, "count at 27.0 MHz (default is 1.0 MHz)\n");

Don't need the newline. Please drop it.

drivers/clocksource/scx200_hrt.c line 33

Quoted 3 lines
drivers/clocksource/scx200_hrt.c +3 -0
+static int ppm;
+module_param(ppm, int, 0);	/* load time only */
+MODULE_PARM_DESC(ppm, "+-adjust to actual XO freq (ppm)\n");

Ditto.

drivers/clocksource/scx200_hrt.c line 66

Quoted 3 lines
drivers/clocksource/scx200_hrt.c +3 -0
+static int __init init_hrt_clocksource(void)
+{
+	/* Make sure scx200 has initd the configuration block */

I expect some people won't know what "initd" is.
Please write it for other people to read.

drivers/clocksource/scx200_hrt.c line 15

Quoted 2 lines
drivers/clocksource/scx200_hrt.c +2 -0
+	if (!scx200_cb_present())
+		return -ENODEV;

---
~Randy