Add clocksource for Intel IXP4xx platforms. This fixes time on NSLU2.

svn path=/dists/trunk/linux-2.6/; revision=7658
This commit is contained in:
Martin Michlmayr 2006-10-29 11:38:36 +00:00
parent de74c6f31f
commit 872fc68697
6 changed files with 210 additions and 0 deletions

View File

@ -1,4 +1,5 @@
CONFIG_ARM=y
# CONFIG_GENERIC_TIME is not set
# CONFIG_CIFS_EXPERIMENTAL is not set
CONFIG_SLIP_SMART=y
CONFIG_SUNRPC_GSS=m

View File

@ -1,3 +1,4 @@
CONFIG_GENERIC_TIME=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y

1
debian/changelog vendored
View File

@ -22,6 +22,7 @@ linux-2.6 (2.6.18-4) UNRELEASED; urgency=low
[ Martin Michlmayr ]
* arm/iop32x: Fix the interrupt of the 2nd Ethernet slot on N2100.
* arm/iop32x: Allow USB and serial to co-exist on N2100.
* arm/ixp4xx: Add clocksource for Intel IXP4xx platforms.
[ maximilian attems ]
* Add netpoll leak fix.

View File

@ -0,0 +1,84 @@
Backported from 2.6.19-rc3, needed for ixp4xx-clocksource.patch
Index: linux-2.6.18/arch/arm/Kconfig
===================================================================
--- linux-2.6.18.orig/arch/arm/Kconfig 2006-09-19 20:42:06.000000000 -0700
+++ linux-2.6.18/arch/arm/Kconfig 2006-10-29 01:59:14.000000000 -0700
@@ -17,6 +17,10 @@
Europe. There is an ARM Linux project with a web page at
<http://www.arm.linux.org.uk/>.
+config GENERIC_TIME
+ bool
+ default n
+
config MMU
bool
default y
Index: linux-2.6.18/arch/arm/kernel/time.c
===================================================================
--- linux-2.6.18.orig/arch/arm/kernel/time.c 2006-09-19 20:42:06.000000000 -0700
+++ linux-2.6.18/arch/arm/kernel/time.c 2006-10-29 01:59:14.000000000 -0700
@@ -69,10 +69,12 @@
*/
int (*set_rtc)(void);
+#ifndef CONFIG_GENERIC_TIME
static unsigned long dummy_gettimeoffset(void)
{
return 0;
}
+#endif
/*
* Scheduler clock - returns current time in nanosec units.
@@ -230,6 +232,7 @@
#define do_leds()
#endif
+#ifndef CONFIG_GENERIC_TIME
void do_gettimeofday(struct timeval *tv)
{
unsigned long flags;
@@ -291,6 +294,7 @@
}
EXPORT_SYMBOL(do_settimeofday);
+#endif /* !CONFIG_GENERIC_TIME */
/**
* save_time_delta - Save the offset between system time and RTC time
@@ -500,8 +504,10 @@
void __init time_init(void)
{
+#ifndef CONFIG_GENERIC_TIME
if (system_timer->offset == NULL)
system_timer->offset = dummy_gettimeoffset;
+#endif
system_timer->init();
#ifdef CONFIG_NO_IDLE_HZ
Index: linux-2.6.18/include/asm-arm/mach/time.h
===================================================================
--- linux-2.6.18.orig/include/asm-arm/mach/time.h 2006-09-19 20:42:06.000000000 -0700
+++ linux-2.6.18/include/asm-arm/mach/time.h 2006-10-29 01:59:14.000000000 -0700
@@ -38,7 +38,9 @@
void (*init)(void);
void (*suspend)(void);
void (*resume)(void);
+#ifndef CONFIG_GENERIC_TIME
unsigned long (*offset)(void);
+#endif
#ifdef CONFIG_NO_IDLE_HZ
struct dyn_tick_timer *dyn_tick;
Index: linux-2.6.18/include/asm-arm/timeofday.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.18/include/asm-arm/timeofday.h 2006-10-29 01:59:14.000000000 -0700
@@ -0,0 +1,4 @@
+#ifndef _ASM_ARM_TIMEOFDAY_H
+#define _ASM_ARM_TIMEOFDAY_H
+#include <asm-generic/timeofday.h>
+#endif

View File

@ -0,0 +1,121 @@
From: Kevin Hilman <khilman@mvista.com>
Date: Thu, 21 Sep 2006 23:58:57 +0000 (+0100)
Subject: [ARM] 3856/1: Add clocksource for Intel IXP4xx platforms
X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=84904d0ead0a8c419abd45c7b2ac8d76d50a0d48
[ARM] 3856/1: Add clocksource for Intel IXP4xx platforms
Enables the ixp4xx platforms to use Generic time-of-day.
Signed-off-by: Kevin Hilman <khilman@mvista.com>
Acked-by: John Stultz <johnstul@us.ibm.com>
Signed-off-by: Deepak Saxena <dsaxena@plexity.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Index: linux-2.6.18/arch/arm/Kconfig
===================================================================
--- linux-2.6.18.orig/arch/arm/Kconfig 2006-10-29 01:59:14.000000000 -0700
+++ linux-2.6.18/arch/arm/Kconfig 2006-10-29 01:59:38.000000000 -0700
@@ -212,6 +212,7 @@
config ARCH_IXP4XX
bool "IXP4xx-based"
depends on MMU
+ select GENERIC_TIME
help
Support for Intel's IXP4XX (XScale) family of processors.
Index: linux-2.6.18/arch/arm/mach-ixp4xx/common.c
===================================================================
--- linux-2.6.18.orig/arch/arm/mach-ixp4xx/common.c 2006-09-19 20:42:06.000000000 -0700
+++ linux-2.6.18/arch/arm/mach-ixp4xx/common.c 2006-10-29 01:00:08.000000000 -0800
@@ -26,6 +26,7 @@
#include <linux/bitops.h>
#include <linux/time.h>
#include <linux/timex.h>
+#include <linux/clocksource.h>
#include <asm/hardware.h>
#include <asm/uaccess.h>
@@ -255,16 +256,6 @@
#define CLOCK_TICKS_PER_USEC ((CLOCK_TICK_RATE + USEC_PER_SEC/2) / USEC_PER_SEC)
-/* IRQs are disabled before entering here from do_gettimeofday() */
-static unsigned long ixp4xx_gettimeoffset(void)
-{
- u32 elapsed;
-
- elapsed = *IXP4XX_OSTS - last_jiffy_time;
-
- return elapsed / CLOCK_TICKS_PER_USEC;
-}
-
static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
write_seqlock(&xtime_lock);
@@ -309,7 +300,6 @@
struct sys_timer ixp4xx_timer = {
.init = ixp4xx_timer_init,
- .offset = ixp4xx_gettimeoffset,
};
static struct resource ixp46x_i2c_resources[] = {
@@ -365,3 +355,29 @@
ixp4xx_exp_bus_size >> 20);
}
+cycle_t ixp4xx_get_cycles(void)
+{
+ return *IXP4XX_OSTS;
+}
+
+static struct clocksource clocksource_ixp4xx = {
+ .name = "OSTS",
+ .rating = 200,
+ .read = ixp4xx_get_cycles,
+ .mask = CLOCKSOURCE_MASK(32),
+ .shift = 20,
+ .is_continuous = 1,
+};
+
+unsigned long ixp4xx_timer_freq = FREQ;
+static int __init ixp4xx_clocksource_init(void)
+{
+ clocksource_ixp4xx.mult =
+ clocksource_hz2mult(ixp4xx_timer_freq,
+ clocksource_ixp4xx.shift);
+ clocksource_register(&clocksource_ixp4xx);
+
+ return 0;
+}
+
+device_initcall(ixp4xx_clocksource_init);
Index: linux-2.6.18/arch/arm/mach-ixp4xx/nslu2-setup.c
===================================================================
--- linux-2.6.18.orig/arch/arm/mach-ixp4xx/nslu2-setup.c 2006-09-19 20:42:06.000000000 -0700
+++ linux-2.6.18/arch/arm/mach-ixp4xx/nslu2-setup.c 2006-10-29 01:00:08.000000000 -0800
@@ -159,6 +159,8 @@
static void __init nslu2_init(void)
{
+ ixp4xx_timer_freq = NSLU2_FREQ;
+
ixp4xx_sys_init();
nslu2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
Index: linux-2.6.18/include/asm-arm/arch-ixp4xx/platform.h
===================================================================
--- linux-2.6.18.orig/include/asm-arm/arch-ixp4xx/platform.h 2006-09-19 20:42:06.000000000 -0700
+++ linux-2.6.18/include/asm-arm/arch-ixp4xx/platform.h 2006-10-29 01:00:08.000000000 -0800
@@ -90,6 +90,11 @@
struct sys_timer;
/*
+ * Frequency of clock used for primary clocksource
+ */
+extern unsigned long ixp4xx_timer_freq;
+
+/*
* Functions used by platform-level setup code
*/
extern void ixp4xx_map_io(void);

View File

@ -10,3 +10,5 @@
+ bugfix/net-r8169-mmio8167.patch
+ features/net-r8169-pci_id-corega.patch
+ bugfix/net-r8169-hotplug_loop.patch
+ bugfix/arm/arm-generic-time.patch
+ bugfix/arm/ixp4xx-clocksource.patch