Skip to content

Commit

Permalink
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…linux/kernel/git/tip/tip into next

Pull timer core updates from Thomas Gleixner:
 "This time you get nothing really exciting:
   - A huge update to the sh* clocksource drivers
   - Support for two more ARM SoCs
   - Removal of the deprecated setup_sched_clock() API
   - The usual pile of fixlets all over the place"

* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits)
  clocksource: Add Freescale FlexTimer Module (FTM) timer support
  ARM: dts: vf610: Add Freescale FlexTimer Module timer node.
  clocksource: ftm: Add FlexTimer Module (FTM) Timer devicetree Documentation
  clocksource: sh_tmu: Remove unnecessary OOM messages
  clocksource: sh_mtu2: Remove unnecessary OOM messages
  clocksource: sh_cmt: Remove unnecessary OOM messages
  clocksource: em_sti: Remove unnecessary OOM messages
  clocksource: dw_apb_timer_of: Do not trace read_sched_clock
  clocksource: Fix clocksource_mmio_readX_down
  clocksource: Fix type confusion for clocksource_mmio_readX_Y
  clocksource: sh_tmu: Fix channel IRQ retrieval in legacy case
  clocksource: qcom: Implement read_current_timer for udelay
  ntp: Make is_error_status() use its argument
  ntp: Convert simple_strtol to kstrtol
  timer_stats/doc: Fix /proc/timer_stats documentation
  sched_clock: Remove deprecated setup_sched_clock() API
  ARM: sun6i: a31: Add support for the High Speed Timers
  clocksource: sun5i: Add support for reset controller
  clocksource: efm32: use $vendor,$device scheme for compatible string
  KConfig: Vexpress: build the ARM_GLOBAL_TIMER with vexpress platform
  ...
  • Loading branch information
Linus Torvalds committed Jun 4, 2014
2 parents f1a7cd0 + 331b483 commit 82e627e
Show file tree
Hide file tree
Showing 25 changed files with 496 additions and 50 deletions.
7 changes: 5 additions & 2 deletions Documentation/devicetree/bindings/arm/global_timer.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@

** Timer node required properties:

- compatible : Should be "arm,cortex-a9-global-timer"
Driver supports versions r2p0 and above.
- compatible : should contain
* "arm,cortex-a5-global-timer" for Cortex-A5 global timers.
* "arm,cortex-a9-global-timer" for Cortex-A9 global
timers or any compatible implementation. Note: driver
supports versions r2p0 and above.

- interrupts : One interrupt to each core

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ Required properties:
one)
- clocks: phandle to the source clock (usually the AHB clock)

Optionnal properties:
- resets: phandle to a reset controller asserting the timer

Example:

timer@01c60000 {
Expand All @@ -19,4 +22,5 @@ timer@01c60000 {
<0 53 1>,
<0 54 1>;
clocks = <&ahb1_gates 19>;
resets = <&ahb1rst 19>;
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ channels and can be used as PWM or Quadrature Decoder. Available clock sources
are the cpu's HFPERCLK (with a 10-bit prescaler) or an external pin.

Required properties:
- compatible : Should be efm32,timer
- compatible : Should be "energymicro,efm32-timer"
- reg : Address and length of the register set
- clocks : Should contain a reference to the HFPERCLK

Expand All @@ -16,7 +16,7 @@ Optional properties:
Example:

timer@40010c00 {
compatible = "efm32,timer";
compatible = "energymicro,efm32-timer";
reg = <0x40010c00 0x400>;
interrupts = <14>;
clocks = <&cmu clk_HFPERCLKTIMER3>;
Expand Down
31 changes: 31 additions & 0 deletions Documentation/devicetree/bindings/timer/fsl,ftm-timer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Freescale FlexTimer Module (FTM) Timer

Required properties:

- compatible : should be "fsl,ftm-timer"
- reg : Specifies base physical address and size of the register sets for the
clock event device and clock source device.
- interrupts : Should be the clock event device interrupt.
- clocks : The clocks provided by the SoC to drive the timer, must contain an
entry for each entry in clock-names.
- clock-names : Must include the following entries:
o "ftm-evt"
o "ftm-src"
o "ftm-evt-counter-en"
o "ftm-src-counter-en"
- big-endian: One boolean property, the big endian mode will be in use if it is
present, or the little endian mode will be in use for all the device registers.

Example:
ftm: ftm@400b8000 {
compatible = "fsl,ftm-timer";
reg = <0x400b8000 0x1000 0x400b9000 0x1000>;
interrupts = <0 44 IRQ_TYPE_LEVEL_HIGH>;
clock-names = "ftm-evt", "ftm-src",
"ftm-evt-counter-en", "ftm-src-counter-en";
clocks = <&clks VF610_CLK_FTM2>,
<&clks VF610_CLK_FTM3>,
<&clks VF610_CLK_FTM2_EXT_FIX_EN>,
<&clks VF610_CLK_FTM3_EXT_FIX_EN>;
big-endian;
};
6 changes: 3 additions & 3 deletions Documentation/timers/timer_stats.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ To stop a sample period issue:
The statistics can be retrieved by:
# cat /proc/timer_stats

The readout of /proc/timer_stats automatically disables sampling. The sampled
information is kept until a new sample period is started. This allows multiple
readouts.
While sampling is enabled, each readout from /proc/timer_stats will see
newly updated statistics. Once sampling is disabled, the sampled information
is kept until a new sample period is started. This allows multiple readouts.

Sample output of /proc/timer_stats:

Expand Down
11 changes: 11 additions & 0 deletions arch/arm/boot/dts/sun6i-a31.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,17 @@
status = "disabled";
};

timer@01c60000 {
compatible = "allwinner,sun6i-a31-hstimer", "allwinner,sun7i-a20-hstimer";
reg = <0x01c60000 0x1000>;
interrupts = <0 51 4>,
<0 52 4>,
<0 53 4>,
<0 54 4>;
clocks = <&ahb1_gates 19>;
resets = <&ahb1_rst 19>;
};

spi0: spi@01c68000 {
compatible = "allwinner,sun6i-a31-spi";
reg = <0x01c68000 0x1000>;
Expand Down
10 changes: 9 additions & 1 deletion arch/arm/boot/dts/vexpress-v2p-ca5s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@
interrupts = <1 13 0x304>;
};

timer@2c000200 {
compatible = "arm,cortex-a5-global-timer",
"arm,cortex-a9-global-timer";
reg = <0x2c000200 0x20>;
interrupts = <1 11 0x304>;
clocks = <&oscclk0>;
};

watchdog@2c000620 {
compatible = "arm,cortex-a5-twd-wdt";
reg = <0x2c000620 0x20>;
Expand Down Expand Up @@ -120,7 +128,7 @@
compatible = "arm,vexpress,config-bus";
arm,vexpress,config-bridge = <&v2m_sysreg>;

osc@0 {
oscclk0: osc@0 {
/* CPU and internal AXI reference clock */
compatible = "arm,vexpress-osc";
arm,vexpress-sysreg,func = <1 0>;
Expand Down
13 changes: 13 additions & 0 deletions arch/arm/boot/dts/vf610.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,19 @@
status = "disabled";
};

ftm: ftm@400b8000 {
compatible = "fsl,ftm-timer";
reg = <0x400b8000 0x1000 0x400b9000 0x1000>;
interrupts = <0 44 IRQ_TYPE_LEVEL_HIGH>;
clock-names = "ftm-evt", "ftm-src",
"ftm-evt-counter-en", "ftm-src-counter-en";
clocks = <&clks VF610_CLK_FTM2>,
<&clks VF610_CLK_FTM3>,
<&clks VF610_CLK_FTM2_EXT_FIX_EN>,
<&clks VF610_CLK_FTM3_EXT_FIX_EN>;
status = "disabled";
};

fec0: ethernet@400d0000 {
compatible = "fsl,mvf600-fec";
reg = <0x400d0000 0x1000>;
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-vexpress/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ config ARCH_VEXPRESS
select ARCH_SUPPORTS_BIG_ENDIAN
select ARM_AMBA
select ARM_GIC
select ARM_GLOBAL_TIMER
select ARM_TIMER_SP804
select COMMON_CLK_VERSATILE
select HAVE_ARM_SCU if SMP
Expand Down
5 changes: 5 additions & 0 deletions drivers/clocksource/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ config CLKSRC_SAMSUNG_PWM
for all devicetree enabled platforms. This driver will be
needed only on systems that do not have the Exynos MCT available.

config FSL_FTM_TIMER
bool
help
Support for Freescale FlexTimer Module (FTM) timer.

config VF_PIT_TIMER
bool
help
Expand Down
1 change: 1 addition & 0 deletions drivers/clocksource/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ obj-$(CONFIG_CADENCE_TTC_TIMER) += cadence_ttc_timer.o
obj-$(CONFIG_CLKSRC_EFM32) += time-efm32.o
obj-$(CONFIG_CLKSRC_EXYNOS_MCT) += exynos_mct.o
obj-$(CONFIG_CLKSRC_SAMSUNG_PWM) += samsung_pwm_timer.o
obj-$(CONFIG_FSL_FTM_TIMER) += fsl_ftm_timer.o
obj-$(CONFIG_VF_PIT_TIMER) += vf_pit_timer.o
obj-$(CONFIG_CLKSRC_QCOM) += qcom-timer.o

Expand Down
5 changes: 3 additions & 2 deletions drivers/clocksource/arm_global_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,12 @@ static void __init global_timer_of_register(struct device_node *np)
int err = 0;

/*
* In r2p0 the comparators for each processor with the global timer
* In A9 r2p0 the comparators for each processor with the global timer
* fire when the timer value is greater than or equal to. In previous
* revisions the comparators fired when the timer value was equal to.
*/
if ((read_cpuid_id() & 0xf0000f) < 0x200000) {
if (read_cpuid_part_number() == ARM_CPU_PART_CORTEX_A9
&& (read_cpuid_id() & 0xf0000f) < 0x200000) {
pr_warn("global-timer: non support for this cpu version.\n");
return;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/clocksource/dw_apb_timer_of.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ static void __init add_clocksource(struct device_node *source_timer)
sched_rate = rate;
}

static u64 read_sched_clock(void)
static u64 notrace read_sched_clock(void)
{
return ~__raw_readl(sched_io_base);
}
Expand Down
4 changes: 1 addition & 3 deletions drivers/clocksource/em_sti.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,8 @@ static int em_sti_probe(struct platform_device *pdev)
int irq;

p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL);
if (p == NULL) {
dev_err(&pdev->dev, "failed to allocate driver data\n");
if (p == NULL)
return -ENOMEM;
}

p->pdev = pdev;
platform_set_drvdata(pdev, p);
Expand Down
Loading

0 comments on commit 82e627e

Please sign in to comment.