Skip to content

Commit 7b0f95f

Browse files
committed
Merge tag 'timers-v6.3-rc1' of https://git.linaro.org/people/daniel.lezcano/linux into timers/core
Pull clocksource/event changes from Daniel Lezcano: - Add rktimer for rv1126 Rockchip based board (Jagan Teki) - Initialize hrtimer based broadcast clock event device on RISC-V before C3STOP can be used (Conor Dooley) - Add DT binding for RISC-V timer and add the C3STOP flag if the DT tells the timer can not wake up the CPU (Anup Patel) - Increase the RISC-V timer rating as it is more efficient than mmio timers (Samuel Holland) - Drop obsolete dependency on COMPILE_TEST on microchip-pit64b as the OF is already depending on it (Jean Delvare) - Mark sh_cmt, sh_tmu, em_sti drivers as non-removable (Uwe Kleine-König) - Add binding description for mediatek,mt8365-systimer (Bernhard Rosenkränzer) - Add compatibles for T-Head's C9xx (Icenowy Zheng) - Restrict the microchip-pit64b compilation to the ARM architecture and add the delay timer (Claudiu Beznea) - Set the static key to select the SBI or Sstc timer sooner to prevent the first call to use the SBI while Sstc must be used (Matt Evans) - Add the CLOCK_EVT_FEAT_DYNIRQ flag to optimize the timer wake up on the sun4i platform (Yangtao Li) Link: https://lore.kernel/org/r/[email protected]
2 parents 5b268d8 + 5ccb51b commit 7b0f95f

File tree

13 files changed

+103
-35
lines changed

13 files changed

+103
-35
lines changed

Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Required properties:
3333

3434
For those SoCs that use CPUX
3535
* "mediatek,mt6795-systimer" for MT6795 compatible timers (CPUX)
36+
* "mediatek,mt8365-systimer" for MT8365 compatible timers (CPUX)
3637

3738
- reg: Should contain location and length for timer register.
3839
- clocks: Should contain system clock.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/timer/riscv,timer.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: RISC-V timer
8+
9+
maintainers:
10+
- Anup Patel <[email protected]>
11+
12+
description: |+
13+
RISC-V platforms always have a RISC-V timer device for the supervisor-mode
14+
based on the time CSR defined by the RISC-V privileged specification. The
15+
timer interrupts of this device are configured using the RISC-V SBI Time
16+
extension or the RISC-V Sstc extension.
17+
18+
The clock frequency of RISC-V timer device is specified via the
19+
"timebase-frequency" DT property of "/cpus" DT node which is described
20+
in Documentation/devicetree/bindings/riscv/cpus.yaml
21+
22+
properties:
23+
compatible:
24+
enum:
25+
- riscv,timer
26+
27+
interrupts-extended:
28+
minItems: 1
29+
maxItems: 4096 # Should be enough?
30+
31+
riscv,timer-cannot-wake-cpu:
32+
type: boolean
33+
description:
34+
If present, the timer interrupt cannot wake up the CPU from one or
35+
more suspend/idle states.
36+
37+
additionalProperties: false
38+
39+
required:
40+
- compatible
41+
- interrupts-extended
42+
43+
examples:
44+
- |
45+
timer {
46+
compatible = "riscv,timer";
47+
interrupts-extended = <&cpu1intc 5>,
48+
<&cpu2intc 5>,
49+
<&cpu3intc 5>,
50+
<&cpu4intc 5>;
51+
};
52+
...

Documentation/devicetree/bindings/timer/rockchip,rk-timer.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ properties:
1717
- items:
1818
- enum:
1919
- rockchip,rv1108-timer
20+
- rockchip,rv1126-timer
2021
- rockchip,rk3036-timer
2122
- rockchip,rk3128-timer
2223
- rockchip,rk3188-timer

Documentation/devicetree/bindings/timer/sifive,clint.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ description:
2020
property of "/cpus" DT node. The "timebase-frequency" DT property is
2121
described in Documentation/devicetree/bindings/riscv/cpus.yaml
2222

23+
T-Head C906/C910 CPU cores include an implementation of CLINT too, however
24+
their implementation lacks a memory-mapped MTIME register, thus not
25+
compatible with SiFive ones.
26+
2327
properties:
2428
compatible:
2529
oneOf:
@@ -29,6 +33,10 @@ properties:
2933
- starfive,jh7100-clint
3034
- canaan,k210-clint
3135
- const: sifive,clint0
36+
- items:
37+
- enum:
38+
- allwinner,sun20i-d1-clint
39+
- const: thead,c900-clint
3240
- items:
3341
- const: sifive,clint0
3442
- const: riscv,clint0

arch/riscv/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ config 32BIT
1212

1313
config RISCV
1414
def_bool y
15-
select ARCH_CLOCKSOURCE_INIT
1615
select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION
1716
select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2
1817
select ARCH_HAS_BINFMT_FLAT

arch/riscv/kernel/time.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
#include <linux/of_clk.h>
8+
#include <linux/clockchips.h>
89
#include <linux/clocksource.h>
910
#include <linux/delay.h>
1011
#include <asm/sbi.h>
@@ -29,13 +30,6 @@ void __init time_init(void)
2930

3031
of_clk_init(NULL);
3132
timer_probe();
32-
}
3333

34-
void clocksource_arch_init(struct clocksource *cs)
35-
{
36-
#ifdef CONFIG_GENERIC_GETTIMEOFDAY
37-
cs->vdso_clock_mode = VDSO_CLOCKMODE_ARCHTIMER;
38-
#else
39-
cs->vdso_clock_mode = VDSO_CLOCKMODE_NONE;
40-
#endif
34+
tick_setup_hrtimer_broadcast();
4135
}

drivers/clocksource/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ config INGENIC_OST
706706

707707
config MICROCHIP_PIT64B
708708
bool "Microchip PIT64B support"
709-
depends on OF || COMPILE_TEST
709+
depends on OF && ARM
710710
select TIMER_OF
711711
help
712712
This option enables Microchip PIT64B timer for Atmel

drivers/clocksource/em_sti.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,6 @@ static int em_sti_probe(struct platform_device *pdev)
333333
return 0;
334334
}
335335

336-
static int em_sti_remove(struct platform_device *pdev)
337-
{
338-
return -EBUSY; /* cannot unregister clockevent and clocksource */
339-
}
340-
341336
static const struct of_device_id em_sti_dt_ids[] = {
342337
{ .compatible = "renesas,em-sti", },
343338
{},
@@ -346,10 +341,10 @@ MODULE_DEVICE_TABLE(of, em_sti_dt_ids);
346341

347342
static struct platform_driver em_sti_device_driver = {
348343
.probe = em_sti_probe,
349-
.remove = em_sti_remove,
350344
.driver = {
351345
.name = "em_sti",
352346
.of_match_table = em_sti_dt_ids,
347+
.suppress_bind_attrs = true,
353348
}
354349
};
355350

drivers/clocksource/sh_cmt.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,17 +1145,12 @@ static int sh_cmt_probe(struct platform_device *pdev)
11451145
return 0;
11461146
}
11471147

1148-
static int sh_cmt_remove(struct platform_device *pdev)
1149-
{
1150-
return -EBUSY; /* cannot unregister clockevent and clocksource */
1151-
}
1152-
11531148
static struct platform_driver sh_cmt_device_driver = {
11541149
.probe = sh_cmt_probe,
1155-
.remove = sh_cmt_remove,
11561150
.driver = {
11571151
.name = "sh_cmt",
11581152
.of_match_table = of_match_ptr(sh_cmt_of_table),
1153+
.suppress_bind_attrs = true,
11591154
},
11601155
.id_table = sh_cmt_id_table,
11611156
};

drivers/clocksource/sh_tmu.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -632,11 +632,6 @@ static int sh_tmu_probe(struct platform_device *pdev)
632632
return 0;
633633
}
634634

635-
static int sh_tmu_remove(struct platform_device *pdev)
636-
{
637-
return -EBUSY; /* cannot unregister clockevent and clocksource */
638-
}
639-
640635
static const struct platform_device_id sh_tmu_id_table[] = {
641636
{ "sh-tmu", SH_TMU },
642637
{ "sh-tmu-sh3", SH_TMU_SH3 },
@@ -652,10 +647,10 @@ MODULE_DEVICE_TABLE(of, sh_tmu_of_table);
652647

653648
static struct platform_driver sh_tmu_device_driver = {
654649
.probe = sh_tmu_probe,
655-
.remove = sh_tmu_remove,
656650
.driver = {
657651
.name = "sh_tmu",
658652
.of_match_table = of_match_ptr(sh_tmu_of_table),
653+
.suppress_bind_attrs = true,
659654
},
660655
.id_table = sh_tmu_id_table,
661656
};

0 commit comments

Comments
 (0)