summaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/time.c
Commit message (Collapse)AuthorAgeFilesLines
* sparc64: Add missing null terminating entry to bq4802_match[].David S. Miller2008-10-301-0/+1
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* rtc-m48t59: shift zero year to 1968 on sparc (rev 2)Krzysztof Helt2008-10-291-28/+5
| | | | | | | | | | | Shift the first year to 1968 for Sun SPARC machines. Move this logic from platform specific files to rtc driver as this fixes problems with calculating a century bit. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Tested-by: Alexander Beregalov Signed-off-by: David S. Miller <davem@davemloft.net>
* sparc64: Fix sparse warnings in kernel/time.cDavid S. Miller2008-09-111-11/+11
| | | | | | | | | 1) Using "clock" as a local variable shadows a global variable of the same name declared in linux/clocksource.h 2) rtc_cmos_resource should be static Signed-off-by: David S. Miller <davem@davemloft.net>
* sparc64: Fix return value in update_persistent_clock().David S. Miller2008-09-101-2/+2
| | | | | | Noticed by Stephen Rothwell. Signed-off-by: David S. Miller <davem@davemloft.net>
* sparc64: Add missing rtc_close() in update_persistent_clock()David S. Miller2008-09-081-2/+5
| | | | | | Noticed by David Brownell. Signed-off-by: David S. Miller <davem@davemloft.net>
* sparc64: fix wrong m48t59 RTC yearKrzysztof Helt2008-09-071-2/+4
| | | | | | | | Correctly calculate offset to the year register for Mostek RTC. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
* sparc: Annotate of_device_id arrays with const or __initdata.David S. Miller2008-08-311-3/+3
| | | | | | As suggested by Stephen Rothwell. Signed-off-by: David S. Miller <davem@davemloft.net>
* sparc64: Use generic starfire RTC driver.David S. Miller2008-08-291-285/+8
| | | | | | Also, delete the mini RTC driver, no longer used. Signed-off-by: David S. Miller <davem@davemloft.net>
* sparc64: Use generic sun4v RTC driver.David S. Miller2008-08-291-75/+8
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* sparc64: Use generic BQ4802 RTC driver.David S. Miller2008-08-291-190/+11
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* sparc64: Use generic CMOS driver.David S. Miller2008-08-291-252/+120
| | | | | | Based largely upon a patch by Krzysztof Helt <krzysztof.h1@poczta.fm> Signed-off-by: David S. Miller <davem@davemloft.net>
* sparc64: Convert Mostek rtc to use generic RTC layer driver.David S. Miller2008-08-291-314/+102
| | | | | | Based largely upon a patch by Krzysztof Helt <krzysztof.h1@poczta.fm> Signed-off-by: David S. Miller <davem@davemloft.net>
* sparc64: Check for RTC class device in update_persistent_clock().David S. Miller2008-08-291-0/+5
| | | | | | | | | | | As we convert the various by-hand sparc64 RTC drivers to use the generic RTC framework and drivers, we need to keep the NTP set_rtc_mmss() support via update_persistent_clock() working. In the end, after all the RTC device cases are converted, this local set_rtc_mmss() function will be deleted. Signed-off-by: David S. Miller <davem@davemloft.net>
* sparc: don't use asm/of_device.hStephen Rothwell2008-08-071-1/+1
| | | | | | | Use linux/of_device.h instead. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
* sparc64: Fix cpufreq notifier registry.David S. Miller2008-07-231-5/+10
| | | | | | | | | Based upon a report by Daniel Smolik. We do it too early, which triggers a BUG in cpufreq_register_notifier(). Signed-off-by: David S. Miller <davem@davemloft.net>
* sparc64-rtc: BKL pushdownArnd Bergmann2008-07-021-1/+6
| | | | Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* [SPARC64]: Fix sparse warnings in arch/sparc64/kernel/time.cDavid S. Miller2008-03-261-26/+40
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* read_current_timer() cleanupsAndrew Morton2008-02-061-0/+5
| | | | | | | | | | | | | | | | | | | | - All implementations can be __devinit - The function prototypes were in asm/timex.h but they all must be the same, so create a single declaration in linux/timex.h. - uninline the sparc64 version to match the other architectures - Don't bother #defining ARCH_HAS_READ_CURRENT_TIMER to a particular value. [ezk@cs.sunysb.edu: fix build] Cc: "David S. Miller" <davem@davemloft.net> Cc: Haavard Skinnemoen <hskinnemoen@atmel.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@elte.hu> Cc: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* [SPARC]: Remove duplicate includes.Lucas Woods2007-11-061-2/+0
| | | | | Signed-off-by: Lucas Woods <woodzy@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Fix bogus '&' conditinal in set_rtc_mmss().David S. Miller2007-10-311-1/+1
| | | | | | | | We're using '&' instead of '&&'. Noticed by Roel Kluin. Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC/64]: Move of_platform_driver initialisations: arch/sparc{,64}.Stephen Rothwell2007-10-131-1/+3
| | | | | | | | We no longer initialise the name field of the of_platform_driver, but use the name field of the embedded device_driver's name field instead. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Handle mostek clock type in mini_rtc driver.David S. Miller2007-07-301-0/+75
| | | | | | Now that drivers/sbus/char/rtc.c is sparc32 only, we need this. Signed-off-by: David S. Miller <davem@davemloft.net>
* NTP: move the cmos update code into ntp.cThomas Gleixner2007-07-211-51/+2
| | | | | | | | | | | | | | | | i386 and sparc64 have the identical code to update the cmos clock. Move it into kernel/time/ntp.c as there are other architectures coming along with the same requirements. [akpm@linux-foundation.org: build fixes] Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Chris Wright <chrisw@sous-sol.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: john stultz <johnstul@us.ibm.com> Cc: David Miller <davem@davemloft.net> Cc: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* clockevents: fix resume logicThomas Gleixner2007-07-211-0/+1
| | | | | | | | | | | | | | | | | | | | We need to make sure, that the clockevent devices are resumed, before the tick is resumed. The current resume logic does not guarantee this. Add CLOCK_EVT_MODE_RESUME and call the set mode functions of the clock event devices before resuming the tick / oneshot functionality. Fixup the existing users. Thanks to Nigel Cunningham for tracking down a long standing thinko, which affected the jinxed VAIO. [akpm@linux-foundation.org: xen build fix] Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: john stultz <johnstul@us.ibm.com> Cc: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* [SPARC64]: Stop using drivers/char/rtc.cDavid S. Miller2007-07-201-0/+79
| | | | | | | | | | The existing sparc64 mini_rtc driver can handle CMOS based rtcs trivially with just a few lines of code and the simplifies things tremendously. Tested on SB1500. Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC/64] Rename some functions like PowerPCStephen Rothwell2007-07-201-1/+1
| | | | | | | This is to make the of merge easier. Also rename of_bus_type. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: More sensible udelay implementation.David S. Miller2007-07-161-7/+21
| | | | | | | | | | Take a page from the powerpc folks and just calculate the delay factor directly. Since frequency scaling chips use a system-tick register, the value is going to be the same system-wide. Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Fill holes in hypervisor APIs and fix KTSB registry.David S. Miller2007-05-291-23/+9
| | | | | | | | | | | Several interfaces were missing and others misnumbered or improperly documented. Also, make sure to check the return value when registering the kernel TSBs with the hypervisor. This helped to find the 4MB kernel TSB alignment bug fixed in a previous changeset. Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: arch/sparc64/time.c doesn't compile on Ultra 1 (no PCI)Horst H. von Brand2007-05-291-0/+6
| | | | | | | | | | This is bug 8540 on bugzilla.kernel.org arch/sparc64/time.c contains references to assorted bq4802 stuff if CONFIG_PCI is not set, and compile fails. I #ifdef'ed out everything that looks PCI-ish in that file. Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Use machine description and OBP properly for cpu probing.David S. Miller2007-05-291-6/+3
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Fix sched_clock() et al.David S. Miller2007-05-171-1/+1
| | | | | | SPARC64_NSEC_PER_CYC_SHIFT was set too high. Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Add support for bq4802 TOD chip, as found on ultra45.David S. Miller2007-05-111-20/+210
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: constify of_get_property return: arch/sparc64Stephen Rothwell2007-04-261-2/+2
| | | | | Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Small cleanups time.cTony Breeds2007-04-261-11/+6
| | | | | | | | | - Removes days_in_mo[], as it's almost identical to month_days[] - Use the leapyear() macro - Line length wrapping. Signed-off-by: Tony Breeds <tony@bakeyournoodle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Fix sparc64_next_event() error return.David S. Miller2007-04-261-1/+1
| | | | | | | | It should return an error code not a boolean. Based upon an hpet timer fix by Thomas Gleixner. Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Add clocksource/clockevents support.David S. Miller2007-04-261-190/+218
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I'd like to thank John Stul and others for helping me along the way. A lot of cleanups fell out of this. For example, the get_compare() tick_op was totally unused, so was deleted. And the most often used tick_op members were grouped together for cache-friendlyness. The sparc64 TSC is given to the kernel as a one-shot timer. tick_ops->init_timer() simply turns off the privileged bit in the tick register (when possible), and disables the interrupt by setting bit 63 in the compare register. The ->disable_irq() op also sets this bit. tick_ops->add_compare() is changed to: 1) Add the given delta to "tick" not to "compare" 2) Return a boolean which, if true, means that the tick value read after writing the compare value was found to have incremented past the initial tick value. This mirrors logic used in the HPET driver's ->next_event() method. Each tick_ops implementation also now provides a name string. And we feed this into the clocksource and clockevents layers. Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Unify timer interrupt handler.David S. Miller2007-04-261-25/+18
| | | | | | | | | Things were scattered all over the place, split between SMP and non-SMP. Unify it all so that dyntick support is easier to add. Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Synchronize RTC clock via timer just like x86.David S. Miller2007-04-261-18/+48
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* [PATCH] mark struct file_operations const 2Arjan van de Ven2007-02-121-1/+1
| | | | | | | | | | | | Many struct file_operations in the kernel can be "const". Marking them const moves these to the .rodata section, which avoids false sharing with potential dirty data. In addition it'll catch accidental writes at compile time to these shared resources. [akpm@osdl.org: sparc64 fix] Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* [PATCH] sparc64 irq pt_regs falloutAl Viro2006-10-091-3/+4
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] kill wall_jiffiesAtsushi Nemoto2006-10-011-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With 2.6.18-rc4-mm2, now wall_jiffies will always be the same as jiffies. So we can kill wall_jiffies completely. This is just a cleanup and logically should not change any real behavior except for one thing: RTC updating code in (old) ppc and xtensa use a condition "jiffies - wall_jiffies == 1". This condition is never met so I suppose it is just a bug. I just remove that condition only instead of kill the whole "if" block. [heiko.carstens@de.ibm.com: s390 build fix and cleanup] Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Cc: Andi Kleen <ak@muc.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Ian Molton <spyro@f2s.com> Cc: Mikael Starvik <starvik@axis.com> Cc: David Howells <dhowells@redhat.com> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Cc: Hirokazu Takata <takata.hirokazu@renesas.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Kyle McMartin <kyle@mcmartin.ca> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Kazumoto Kojima <kkojima@rr.iij4u.or.jp> Cc: Richard Curnow <rc@rc0.org.uk> Cc: William Lee Irwin III <wli@holomorphy.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Cc: Miles Bader <uclinux-v850@lsi.nec.co.jp> Cc: Chris Zankel <chris@zankel.net> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] simplify update_times (avoid jiffies/jiffies_64 aliasing problem)Atsushi Nemoto2006-09-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pass ticks to do_timer() and update_times(), and adjust x86_64 and s390 timer interrupt handler with this change. Currently update_times() calculates ticks by "jiffies - wall_jiffies", but callers of do_timer() should know how many ticks to update. Passing ticks get rid of this redundant calculation. Also there are another redundancy pointed out by Martin Schwidefsky. This cleanup make a barrier added by 5aee405c662ca644980c184774277fc6d0769a84 needless. So this patch removes it. As a bonus, this cleanup make wall_jiffies can be removed easily, since now wall_jiffies is always synced with jiffies. (This patch does not really remove wall_jiffies. It would be another cleanup patch) Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@elte.hu> Cc: john stultz <johnstul@us.ibm.com> Cc: Andi Kleen <ak@muc.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Acked-by: Russell King <rmk@arm.linux.org.uk> Cc: Ian Molton <spyro@f2s.com> Cc: Mikael Starvik <starvik@axis.com> Acked-by: David Howells <dhowells@redhat.com> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Cc: Hirokazu Takata <takata.hirokazu@renesas.com> Acked-by: Ralf Baechle <ralf@linux-mips.org> Cc: Kyle McMartin <kyle@mcmartin.ca> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Kazumoto Kojima <kkojima@rr.iij4u.or.jp> Cc: Richard Curnow <rc@rc0.org.uk> Cc: William Lee Irwin III <wli@holomorphy.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Cc: Miles Bader <uclinux-v850@lsi.nec.co.jp> Cc: Chris Zankel <chris@zankel.net> Acked-by: "Luck, Tony" <tony.luck@intel.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [SPARC64]: Fix sched_clock() wrapping every ~17 seconds.David S. Miller2006-09-231-1/+1
| | | | | | | | | | | | | | | Unfortunately, sparc64 doesn't have an easy way to do a "64 X 64 --> 128" bit multiply like PowerPC and IA64 do. We were doing a "64 X 64 --> 64" bit multiple which causes overflow very quickly with a 30-bit quotient shift. So use a quotientshift count of 10 instead of 30, just like x86 and ARM do. This also fixes the wrapping of printk timestamp values every ~17 seconds. Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Make sure IRQs are disabled properly during early boot.David S. Miller2006-07-141-2/+0
| | | | | | Else we trigger the new irqs_disable() assertion in start_kernel(). Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Fix sparc64 build errors when CONFIG_PCI=n.Randy Dunlap2006-07-051-1/+4
| | | | | Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* Remove obsolete #include <linux/config.h>Jörn Engel2006-06-301-1/+0
| | | | | Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de> Signed-off-by: Adrian Bunk <bunk@stusta.de>
* [SPARC64]: time: Kill unnecessary asm/{fhc,sbus,ebus,isa}.h includes.David S. Miller2006-06-291-5/+2
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64]: Fix typo in clock_probe().David S. Miller2006-06-291-2/+2
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC64] clock: Only probe central fhc clock on Enterprise boxes.David S. Miller2006-06-291-0/+7
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* [SPARC]: Convert clock drivers to of_driver framework.David S. Miller2006-06-291-192/+54
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
OpenPOWER on IntegriCloud