Skip to content

Commit 9f687dd

Browse files
committed
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer updates from Thomas Gleixner: "The timer department delivers the following christmas presents: Core code: - Use proper seqcount initializer to make lockdep happy - SPDX annotations and cleanup of license boilerplates - Use DEFINE_SHOW_ATTRIBUTE() instead of open coding it - Minor cleanups Driver code: - Add the sched_clock for the arc timer (Alexey Brodkin) - Change the file timer names for riscv, rockchip, tegra20, sun4i and meson6 (Daniel Lezcano) - Add the DT bindings for r8a7796, r8a77470 and r8a774a1 (Biju Das) - Remove the early platform driver registration for timer-ti-dm (Bartosz Golaszewski) - Provide the sched_clock for the riscv timer (Anup Patel) - Add support for ARM64 for the imx-gpt and convert the imx-tpm to the timer-of API (Anson Huang) - Remove useless irq protection for the imx-gpt (Clément Péron) - Remove a duplicate function name for the vt8500 (Dan Carpenter) - Remove obsolete inclusion of <asm/smp_twd.h> for the tegra20 (Geert Uytterhoeven) - Demote the prcmu and the custom sched_clock for the dbx500 and the ux500 (Linus Walleij) - Add a new timer clock for the RDA8810PL (Manivannan Sadhasivam) - Rename the macro to stick to the register name and add the delay timer (Martin Blumenstingl) - Switch the bcm2835 to the SPDX identifier (Stefan Wahren) - Fix the interrupt register access on the fttmr010 (Tao Ren) - Add missing of_node_put in the initialization path on the integrator-ap (Yangtao Li)" * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (39 commits) dt-bindings: timer: Document RDA8810PL SoC timer clocksource/drivers/rda: Add clock driver for RDA8810PL SoC clocksource/drivers/meson6: Change name meson6_timer timer-meson6 clocksource/drivers/sun4i: Change name sun4i_timer to timer-sun4i clocksource/drivers/tegra20: Change name tegra20_timer to timer-tegra20 clocksource/drivers/rockchip: Change name rockchip_timer to timer-rockchip clocksource/drivers/riscv: Change name riscv_timer to timer-riscv clocksource/drivers/riscv_timer: Provide the sched_clock clocksource/drivers/timer-imx-tpm: Specify clock name for timer-of clocksource/drivers/fttmr010: Fix invalid interrupt register access clocksource/drivers/integrator-ap: Add missing of_node_put() clocksource/drivers/bcm2835: Switch to SPDX identifier dt-bindings: timer: renesas, cmt: Document r8a774a1 CMT support clocksource/drivers/timer-imx-tpm: Convert the driver to timer-of clocksource/drivers/arc_timer: Utilize generic sched_clock dt-bindings: timer: renesas, cmt: Document r8a77470 CMT support dt-bindings: timer: renesas, cmt: Document r8a7796 CMT support clocksource/drivers/imx-gpt: Remove unnecessary irq protection clocksource/drivers/imx-gpt: Add support for ARM64 clocksource/drivers/meson6_timer: Implement the ARM delay timer ...
2 parents e4b99d4 + bd2bcaa commit 9f687dd

48 files changed

Lines changed: 673 additions & 602 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
RDA Micro RDA8810PL Timer
2+
3+
Required properties:
4+
- compatible : "rda,8810pl-timer"
5+
- reg : Offset and length of the register set for the device.
6+
- interrupts : Should contain two interrupts.
7+
- interrupt-names : Should be "hwtimer", "ostimer".
8+
9+
Example:
10+
11+
apb@20900000 {
12+
compatible = "simple-bus";
13+
...
14+
timer@10000 {
15+
compatible = "rda,8810pl-timer";
16+
reg = <0x10000 0x1000>;
17+
interrupts = <16 IRQ_TYPE_LEVEL_HIGH>,
18+
<17 IRQ_TYPE_LEVEL_HIGH>;
19+
interrupt-names = "hwtimer", "ostimer";
20+
};

Documentation/devicetree/bindings/timer/renesas,cmt.txt

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ Required Properties:
2828
- "renesas,r8a7744-cmt1" for the 48-bit CMT1 device included in r8a7744.
2929
- "renesas,r8a7745-cmt0" for the 32-bit CMT0 device included in r8a7745.
3030
- "renesas,r8a7745-cmt1" for the 48-bit CMT1 device included in r8a7745.
31+
- "renesas,r8a77470-cmt0" for the 32-bit CMT0 device included in r8a77470.
32+
- "renesas,r8a77470-cmt1" for the 48-bit CMT1 device included in r8a77470.
33+
- "renesas,r8a774a1-cmt0" for the 32-bit CMT0 device included in r8a774a1.
34+
- "renesas,r8a774a1-cmt1" for the 48-bit CMT1 device included in r8a774a1.
3135
- "renesas,r8a7790-cmt0" for the 32-bit CMT0 device included in r8a7790.
3236
- "renesas,r8a7790-cmt1" for the 48-bit CMT1 device included in r8a7790.
3337
- "renesas,r8a7791-cmt0" for the 32-bit CMT0 device included in r8a7791.
@@ -36,6 +40,8 @@ Required Properties:
3640
- "renesas,r8a7793-cmt1" for the 48-bit CMT1 device included in r8a7793.
3741
- "renesas,r8a7794-cmt0" for the 32-bit CMT0 device included in r8a7794.
3842
- "renesas,r8a7794-cmt1" for the 48-bit CMT1 device included in r8a7794.
43+
- "renesas,r8a7796-cmt0" for the 32-bit CMT0 device included in r8a7796.
44+
- "renesas,r8a7796-cmt1" for the 48-bit CMT1 device included in r8a7796.
3945
- "renesas,r8a77970-cmt0" for the 32-bit CMT0 device included in r8a77970.
4046
- "renesas,r8a77970-cmt1" for the 48-bit CMT1 device included in r8a77970.
4147
- "renesas,r8a77980-cmt0" for the 32-bit CMT0 device included in r8a77980.
@@ -47,9 +53,12 @@ Required Properties:
4753
and RZ/G1.
4854
These are fallbacks for r8a73a4, R-Car Gen2 and RZ/G1 entries
4955
listed above.
50-
- "renesas,rcar-gen3-cmt0" for 32-bit CMT0 devices included in R-Car Gen3.
51-
- "renesas,rcar-gen3-cmt1" for 48-bit CMT1 devices included in R-Car Gen3.
52-
These are fallbacks for R-Car Gen3 entries listed above.
56+
- "renesas,rcar-gen3-cmt0" for 32-bit CMT0 devices included in R-Car Gen3
57+
and RZ/G2.
58+
- "renesas,rcar-gen3-cmt1" for 48-bit CMT1 devices included in R-Car Gen3
59+
and RZ/G2.
60+
These are fallbacks for R-Car Gen3 and RZ/G2 entries listed
61+
above.
5362

5463
- reg: base address and length of the registers block for the timer module.
5564
- interrupts: interrupt-specifier for the timer, one per channel.

arch/arc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ config ARC
2626
select GENERIC_IRQ_SHOW
2727
select GENERIC_PCI_IOMAP
2828
select GENERIC_PENDING_IRQ if SMP
29+
select GENERIC_SCHED_CLOCK
2930
select GENERIC_SMP_IDLE_THREAD
3031
select HAVE_ARCH_KGDB
3132
select HAVE_ARCH_TRACEHOOK

drivers/clocksource/Kconfig

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,14 @@ config OWL_TIMER
105105
help
106106
Enables the support for the Actions Semi Owl timer driver.
107107

108+
config RDA_TIMER
109+
bool "RDA timer driver" if COMPILE_TEST
110+
depends on GENERIC_CLOCKEVENTS
111+
select CLKSRC_MMIO
112+
select TIMER_OF
113+
help
114+
Enables the support for the RDA Micro timer driver.
115+
108116
config SUN4I_TIMER
109117
bool "Sun4i timer driver" if COMPILE_TEST
110118
depends on HAS_IOMEM
@@ -163,12 +171,6 @@ config CLKSRC_NOMADIK_MTU
163171
to multiple interrupt generating programmable
164172
32-bit free running decrementing counters.
165173

166-
config CLKSRC_NOMADIK_MTU_SCHED_CLOCK
167-
bool
168-
depends on CLKSRC_NOMADIK_MTU
169-
help
170-
Use the Multi Timer Unit as the sched_clock.
171-
172174
config CLKSRC_DBX500_PRCMU
173175
bool "Clocksource PRCMU Timer" if COMPILE_TEST
174176
depends on HAS_IOMEM
@@ -226,13 +228,6 @@ config INTEGRATOR_AP_TIMER
226228
help
227229
Enables support for the Integrator-ap timer.
228230

229-
config CLKSRC_DBX500_PRCMU_SCHED_CLOCK
230-
bool "Clocksource PRCMU Timer sched_clock"
231-
depends on (CLKSRC_DBX500_PRCMU && !CLKSRC_NOMADIK_MTU_SCHED_CLOCK)
232-
default y
233-
help
234-
Use the always on PRCMU Timer as sched_clock
235-
236231
config CLKSRC_EFM32
237232
bool "Clocksource for Energy Micro's EFM32 SoCs" if !ARCH_EFM32
238233
depends on OF && ARM && (ARCH_EFM32 || COMPILE_TEST)
@@ -290,6 +285,7 @@ config CLKSRC_MPS2
290285

291286
config ARC_TIMERS
292287
bool "Support for 32-bit TIMERn counters in ARC Cores" if COMPILE_TEST
288+
depends on GENERIC_SCHED_CLOCK
293289
select TIMER_OF
294290
help
295291
These are legacy 32-bit TIMER0 and TIMER1 counters found on all ARC cores
@@ -580,7 +576,7 @@ config H8300_TPU
580576

581577
config CLKSRC_IMX_GPT
582578
bool "Clocksource using i.MX GPT" if COMPILE_TEST
583-
depends on ARM && CLKDEV_LOOKUP
579+
depends on (ARM || ARM64) && CLKDEV_LOOKUP
584580
select CLKSRC_MMIO
585581

586582
config CLKSRC_IMX_TPM
@@ -611,7 +607,7 @@ config ATCPIT100_TIMER
611607

612608
config RISCV_TIMER
613609
bool "Timer for the RISC-V platform"
614-
depends on RISCV
610+
depends on GENERIC_SCHED_CLOCK && RISCV
615611
default y
616612
select TIMER_PROBE
617613
select TIMER_OF

drivers/clocksource/Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ obj-$(CONFIG_OMAP_DM_TIMER) += timer-ti-dm.o
2020
obj-$(CONFIG_DW_APB_TIMER) += dw_apb_timer.o
2121
obj-$(CONFIG_DW_APB_TIMER_OF) += dw_apb_timer_of.o
2222
obj-$(CONFIG_FTTMR010_TIMER) += timer-fttmr010.o
23-
obj-$(CONFIG_ROCKCHIP_TIMER) += rockchip_timer.o
23+
obj-$(CONFIG_ROCKCHIP_TIMER) += timer-rockchip.o
2424
obj-$(CONFIG_CLKSRC_NOMADIK_MTU) += nomadik-mtu.o
2525
obj-$(CONFIG_CLKSRC_DBX500_PRCMU) += clksrc-dbx500-prcmu.o
2626
obj-$(CONFIG_ARMADA_370_XP_TIMER) += timer-armada-370-xp.o
@@ -32,10 +32,10 @@ obj-$(CONFIG_MXS_TIMER) += mxs_timer.o
3232
obj-$(CONFIG_CLKSRC_PXA) += pxa_timer.o
3333
obj-$(CONFIG_PRIMA2_TIMER) += timer-prima2.o
3434
obj-$(CONFIG_U300_TIMER) += timer-u300.o
35-
obj-$(CONFIG_SUN4I_TIMER) += sun4i_timer.o
35+
obj-$(CONFIG_SUN4I_TIMER) += timer-sun4i.o
3636
obj-$(CONFIG_SUN5I_HSTIMER) += timer-sun5i.o
37-
obj-$(CONFIG_MESON6_TIMER) += meson6_timer.o
38-
obj-$(CONFIG_TEGRA_TIMER) += tegra20_timer.o
37+
obj-$(CONFIG_MESON6_TIMER) += timer-meson6.o
38+
obj-$(CONFIG_TEGRA_TIMER) += timer-tegra20.o
3939
obj-$(CONFIG_VT8500_TIMER) += timer-vt8500.o
4040
obj-$(CONFIG_NSPIRE_TIMER) += timer-zevio.o
4141
obj-$(CONFIG_BCM_KONA_TIMER) += bcm_kona_timer.o
@@ -57,6 +57,7 @@ obj-$(CONFIG_OXNAS_RPS_TIMER) += timer-oxnas-rps.o
5757
obj-$(CONFIG_OWL_TIMER) += timer-owl.o
5858
obj-$(CONFIG_SPRD_TIMER) += timer-sprd.o
5959
obj-$(CONFIG_NPCM7XX_TIMER) += timer-npcm7xx.o
60+
obj-$(CONFIG_RDA_TIMER) += timer-rda.o
6061

6162
obj-$(CONFIG_ARC_TIMERS) += arc_timer.o
6263
obj-$(CONFIG_ARM_ARCH_TIMER) += arm_arch_timer.o
@@ -78,6 +79,6 @@ obj-$(CONFIG_H8300_TPU) += h8300_tpu.o
7879
obj-$(CONFIG_CLKSRC_ST_LPC) += clksrc_st_lpc.o
7980
obj-$(CONFIG_X86_NUMACHIP) += numachip.o
8081
obj-$(CONFIG_ATCPIT100_TIMER) += timer-atcpit100.o
81-
obj-$(CONFIG_RISCV_TIMER) += riscv_timer.o
82+
obj-$(CONFIG_RISCV_TIMER) += timer-riscv.o
8283
obj-$(CONFIG_CSKY_MP_TIMER) += timer-mp-csky.o
8384
obj-$(CONFIG_GX6605S_TIMER) += timer-gx6605s.o

drivers/clocksource/arc_timer.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <linux/cpu.h>
2424
#include <linux/of.h>
2525
#include <linux/of_irq.h>
26+
#include <linux/sched_clock.h>
2627

2728
#include <soc/arc/timers.h>
2829
#include <soc/arc/mcip.h>
@@ -88,6 +89,11 @@ static u64 arc_read_gfrc(struct clocksource *cs)
8889
return (((u64)h) << 32) | l;
8990
}
9091

92+
static notrace u64 arc_gfrc_clock_read(void)
93+
{
94+
return arc_read_gfrc(NULL);
95+
}
96+
9197
static struct clocksource arc_counter_gfrc = {
9298
.name = "ARConnect GFRC",
9399
.rating = 400,
@@ -111,6 +117,8 @@ static int __init arc_cs_setup_gfrc(struct device_node *node)
111117
if (ret)
112118
return ret;
113119

120+
sched_clock_register(arc_gfrc_clock_read, 64, arc_timer_freq);
121+
114122
return clocksource_register_hz(&arc_counter_gfrc, arc_timer_freq);
115123
}
116124
TIMER_OF_DECLARE(arc_gfrc, "snps,archs-timer-gfrc", arc_cs_setup_gfrc);
@@ -139,6 +147,11 @@ static u64 arc_read_rtc(struct clocksource *cs)
139147
return (((u64)h) << 32) | l;
140148
}
141149

150+
static notrace u64 arc_rtc_clock_read(void)
151+
{
152+
return arc_read_rtc(NULL);
153+
}
154+
142155
static struct clocksource arc_counter_rtc = {
143156
.name = "ARCv2 RTC",
144157
.rating = 350,
@@ -170,6 +183,8 @@ static int __init arc_cs_setup_rtc(struct device_node *node)
170183

171184
write_aux_reg(AUX_RTC_CTRL, 1);
172185

186+
sched_clock_register(arc_rtc_clock_read, 64, arc_timer_freq);
187+
173188
return clocksource_register_hz(&arc_counter_rtc, arc_timer_freq);
174189
}
175190
TIMER_OF_DECLARE(arc_rtc, "snps,archs-timer-rtc", arc_cs_setup_rtc);
@@ -185,6 +200,11 @@ static u64 arc_read_timer1(struct clocksource *cs)
185200
return (u64) read_aux_reg(ARC_REG_TIMER1_CNT);
186201
}
187202

203+
static notrace u64 arc_timer1_clock_read(void)
204+
{
205+
return arc_read_timer1(NULL);
206+
}
207+
188208
static struct clocksource arc_counter_timer1 = {
189209
.name = "ARC Timer1",
190210
.rating = 300,
@@ -209,6 +229,8 @@ static int __init arc_cs_setup_timer1(struct device_node *node)
209229
write_aux_reg(ARC_REG_TIMER1_CNT, 0);
210230
write_aux_reg(ARC_REG_TIMER1_CTRL, TIMER_CTRL_NH);
211231

232+
sched_clock_register(arc_timer1_clock_read, 32, arc_timer_freq);
233+
212234
return clocksource_register_hz(&arc_counter_timer1, arc_timer_freq);
213235
}
214236

drivers/clocksource/bcm2835_timer.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
1+
// SPDX-License-Identifier: GPL-2.0+
12
/*
23
* Copyright 2012 Simon Arlott
3-
*
4-
* This program is free software; you can redistribute it and/or modify
5-
* it under the terms of the GNU General Public License as published by
6-
* the Free Software Foundation; either version 2 of the License, or
7-
* (at your option) any later version.
8-
*
9-
* This program is distributed in the hope that it will be useful,
10-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12-
* GNU General Public License for more details.
13-
*
14-
* You should have received a copy of the GNU General Public License
15-
* along with this program; if not, write to the Free Software
16-
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
174
*/
185

196
#include <linux/bitops.h>

drivers/clocksource/clksrc-dbx500-prcmu.c

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <linux/of.h>
1616
#include <linux/of_address.h>
1717
#include <linux/clockchips.h>
18-
#include <linux/sched_clock.h>
1918

2019
#define RATE_32K 32768
2120

@@ -26,8 +25,6 @@
2625
#define PRCMU_TIMER_DOWNCOUNT 0x4
2726
#define PRCMU_TIMER_MODE 0x8
2827

29-
#define SCHED_CLOCK_MIN_WRAP 131072 /* 2^32 / 32768 */
30-
3128
static void __iomem *clksrc_dbx500_timer_base;
3229

3330
static u64 notrace clksrc_dbx500_prcmu_read(struct clocksource *cs)
@@ -46,24 +43,12 @@ static u64 notrace clksrc_dbx500_prcmu_read(struct clocksource *cs)
4643

4744
static struct clocksource clocksource_dbx500_prcmu = {
4845
.name = "dbx500-prcmu-timer",
49-
.rating = 300,
46+
.rating = 100,
5047
.read = clksrc_dbx500_prcmu_read,
5148
.mask = CLOCKSOURCE_MASK(32),
52-
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
49+
.flags = CLOCK_SOURCE_IS_CONTINUOUS | CLOCK_SOURCE_SUSPEND_NONSTOP,
5350
};
5451

55-
#ifdef CONFIG_CLKSRC_DBX500_PRCMU_SCHED_CLOCK
56-
57-
static u64 notrace dbx500_prcmu_sched_clock_read(void)
58-
{
59-
if (unlikely(!clksrc_dbx500_timer_base))
60-
return 0;
61-
62-
return clksrc_dbx500_prcmu_read(&clocksource_dbx500_prcmu);
63-
}
64-
65-
#endif
66-
6752
static int __init clksrc_dbx500_prcmu_init(struct device_node *node)
6853
{
6954
clksrc_dbx500_timer_base = of_iomap(node, 0);
@@ -81,9 +66,6 @@ static int __init clksrc_dbx500_prcmu_init(struct device_node *node)
8166
writel(TIMER_DOWNCOUNT_VAL,
8267
clksrc_dbx500_timer_base + PRCMU_TIMER_REF);
8368
}
84-
#ifdef CONFIG_CLKSRC_DBX500_PRCMU_SCHED_CLOCK
85-
sched_clock_register(dbx500_prcmu_sched_clock_read, 32, RATE_32K);
86-
#endif
8769
return clocksource_register_hz(&clocksource_dbx500_prcmu, RATE_32K);
8870
}
8971
TIMER_OF_DECLARE(dbx500_prcmu, "stericsson,db8500-prcmu-timer-4",

0 commit comments

Comments
 (0)