forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/…
…linux/kernel/git/tip/tip Pull timer updates from Thomas Gleixner: "A rather largish update for everything time and timer related: - Cache footprint optimizations for both hrtimers and timer wheel - Lower the NOHZ impact on systems which have NOHZ or timer migration disabled at runtime. - Optimize run time overhead of hrtimer interrupt by making the clock offset updates smarter - hrtimer cleanups and removal of restrictions to tackle some problems in sched/perf - Some more leap second tweaks - Another round of changes addressing the 2038 problem - First step to change the internals of clock event devices by introducing the necessary infrastructure - Allow constant folding for usecs/msecs_to_jiffies() - The usual pile of clockevent/clocksource driver updates The hrtimer changes contain updates to sched, perf and x86 as they depend on them plus changes all over the tree to cleanup API changes and redundant code, which got copied all over the place. The y2038 changes touch s390 to remove the last non 2038 safe code related to boot/persistant clock" * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (114 commits) clocksource: Increase dependencies of timer-stm32 to limit build wreckage timer: Minimize nohz off overhead timer: Reduce timer migration overhead if disabled timer: Stats: Simplify the flags handling timer: Replace timer base by a cpu index timer: Use hlist for the timer wheel hash buckets timer: Remove FIFO "guarantee" timers: Sanitize catchup_timer_jiffies() usage hrtimer: Allow hrtimer::function() to free the timer seqcount: Introduce raw_write_seqcount_barrier() seqcount: Rename write_seqcount_barrier() hrtimer: Fix hrtimer_is_queued() hole hrtimer: Remove HRTIMER_STATE_MIGRATE selftest: Timers: Avoid signal deadlock in leap-a-day timekeeping: Copy the shadow-timekeeper over the real timekeeper last clockevents: Check state instead of mode in suspend/resume path selftests: timers: Add leap-second timer edge testing to leap-a-day.c ntp: Do leapsecond adjustment in adjtimex read path time: Prevent early expiry of hrtimers[CLOCK_REALTIME] at the leap second edge ntp: Introduce and use SECS_PER_DAY macro instead of 86400 ...
- Loading branch information
Showing
78 changed files
with
2,292 additions
and
1,563 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
* ARMv7M System Timer | ||
|
||
ARMv7-M includes a system timer, known as SysTick. Current driver only | ||
implements the clocksource feature. | ||
|
||
Required properties: | ||
- compatible : Should be "arm,armv7m-systick" | ||
- reg : The address range of the timer | ||
|
||
Required clocking property, have to be one of: | ||
- clocks : The input clock of the timer | ||
- clock-frequency : The rate in HZ in input of the ARM SysTick | ||
|
||
Examples: | ||
|
||
systick: timer@e000e010 { | ||
compatible = "arm,armv7m-systick"; | ||
reg = <0xe000e010 0x10>; | ||
clocks = <&clk_systick>; | ||
}; | ||
|
||
systick: timer@e000e010 { | ||
compatible = "arm,armv7m-systick"; | ||
reg = <0xe000e010 0x10>; | ||
clock-frequency = <90000000>; | ||
}; |
26 changes: 26 additions & 0 deletions
26
Documentation/devicetree/bindings/timer/nxp,lpc3220-timer.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
* NXP LPC3220 timer | ||
|
||
The NXP LPC3220 timer is used on a wide range of NXP SoCs. This | ||
includes LPC32xx, LPC178x, LPC18xx and LPC43xx parts. | ||
|
||
Required properties: | ||
- compatible: | ||
Should be "nxp,lpc3220-timer". | ||
- reg: | ||
Address and length of the register set. | ||
- interrupts: | ||
Reference to the timer interrupt | ||
- clocks: | ||
Should contain a reference to timer clock. | ||
- clock-names: | ||
Should contain "timerclk". | ||
|
||
Example: | ||
|
||
timer1: timer@40085000 { | ||
compatible = "nxp,lpc3220-timer"; | ||
reg = <0x40085000 0x1000>; | ||
interrupts = <13>; | ||
clocks = <&ccu1 CLK_CPU_TIMER1>; | ||
clock-names = "timerclk"; | ||
}; |
22 changes: 22 additions & 0 deletions
22
Documentation/devicetree/bindings/timer/st,stm32-timer.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
. STMicroelectronics STM32 timer | ||
|
||
The STM32 MCUs family has several general-purpose 16 and 32 bits timers. | ||
|
||
Required properties: | ||
- compatible : Should be "st,stm32-timer" | ||
- reg : Address and length of the register set | ||
- clocks : Reference on the timer input clock | ||
- interrupts : Reference to the timer interrupt | ||
|
||
Optional properties: | ||
- resets: Reference to a reset controller asserting the timer | ||
|
||
Example: | ||
|
||
timer5: timer@40000c00 { | ||
compatible = "st,stm32-timer"; | ||
reg = <0x40000c00 0x400>; | ||
interrupts = <50>; | ||
resets = <&rrc 259>; | ||
clocks = <&clk_pmtr1>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* | ||
* Copyright (C) Maxime Coquelin 2015 | ||
* Author: Maxime Coquelin <[email protected]> | ||
* License terms: GNU General Public License (GPL), version 2 | ||
*/ | ||
|
||
#include <linux/kernel.h> | ||
#include <linux/clocksource.h> | ||
#include <linux/clockchips.h> | ||
#include <linux/of.h> | ||
#include <linux/of_address.h> | ||
#include <linux/clk.h> | ||
#include <linux/bitops.h> | ||
|
||
#define SYST_CSR 0x00 | ||
#define SYST_RVR 0x04 | ||
#define SYST_CVR 0x08 | ||
#define SYST_CALIB 0x0c | ||
|
||
#define SYST_CSR_ENABLE BIT(0) | ||
|
||
#define SYSTICK_LOAD_RELOAD_MASK 0x00FFFFFF | ||
|
||
static void __init system_timer_of_register(struct device_node *np) | ||
{ | ||
struct clk *clk = NULL; | ||
void __iomem *base; | ||
u32 rate; | ||
int ret; | ||
|
||
base = of_iomap(np, 0); | ||
if (!base) { | ||
pr_warn("system-timer: invalid base address\n"); | ||
return; | ||
} | ||
|
||
ret = of_property_read_u32(np, "clock-frequency", &rate); | ||
if (ret) { | ||
clk = of_clk_get(np, 0); | ||
if (IS_ERR(clk)) | ||
goto out_unmap; | ||
|
||
ret = clk_prepare_enable(clk); | ||
if (ret) | ||
goto out_clk_put; | ||
|
||
rate = clk_get_rate(clk); | ||
if (!rate) | ||
goto out_clk_disable; | ||
} | ||
|
||
writel_relaxed(SYSTICK_LOAD_RELOAD_MASK, base + SYST_RVR); | ||
writel_relaxed(SYST_CSR_ENABLE, base + SYST_CSR); | ||
|
||
ret = clocksource_mmio_init(base + SYST_CVR, "arm_system_timer", rate, | ||
200, 24, clocksource_mmio_readl_down); | ||
if (ret) { | ||
pr_err("failed to init clocksource (%d)\n", ret); | ||
if (clk) | ||
goto out_clk_disable; | ||
else | ||
goto out_unmap; | ||
} | ||
|
||
pr_info("ARM System timer initialized as clocksource\n"); | ||
|
||
return; | ||
|
||
out_clk_disable: | ||
clk_disable_unprepare(clk); | ||
out_clk_put: | ||
clk_put(clk); | ||
out_unmap: | ||
iounmap(base); | ||
pr_warn("ARM System timer register failed (%d)\n", ret); | ||
} | ||
|
||
CLOCKSOURCE_OF_DECLARE(arm_systick, "arm,armv7m-systick", | ||
system_timer_of_register); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.