Skip to content

Commit bc30658

Browse files
committed
Merge branch 'clockevents/4.14' of http://git.linaro.org/people/daniel.lezcano/linux into timers/core
Pull clockevent updates from Daniel Lezcano: - Add the new imx-tpm driver (Dong Aisheng) - Remove DT deprecated binding for Renesas (Magnus Damm) - Remove error message on memory allocation (Markus Elfring) - Convert clocksource drivers to use %pOF
2 parents 4e2a809 + 469869d commit bc30658

File tree

10 files changed

+321
-57
lines changed

10 files changed

+321
-57
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
NXP Low Power Timer/Pulse Width Modulation Module (TPM)
2+
3+
The Timer/PWM Module (TPM) supports input capture, output compare,
4+
and the generation of PWM signals to control electric motor and power
5+
management applications. The counter, compare and capture registers
6+
are clocked by an asynchronous clock that can remain enabled in low
7+
power modes. TPM can support global counter bus where one TPM drives
8+
the counter bus for the others, provided bit width is the same.
9+
10+
Required properties:
11+
12+
- compatible : should be "fsl,imx7ulp-tpm"
13+
- reg : Specifies base physical address and size of the register sets
14+
for the clock event device and clock source device.
15+
- interrupts : Should be the clock event device interrupt.
16+
- clocks : The clocks provided by the SoC to drive the timer, must contain
17+
an entry for each entry in clock-names.
18+
- clock-names : Must include the following entries: "igp" and "per".
19+
20+
Example:
21+
tpm5: tpm@40260000 {
22+
compatible = "fsl,imx7ulp-tpm";
23+
reg = <0x40260000 0x1000>;
24+
interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
25+
clocks = <&clks IMX7ULP_CLK_NIC1_BUS_DIV>,
26+
<&clks IMX7ULP_CLK_LPTPM5>;
27+
clock-names = "ipg", "per";
28+
};

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

Lines changed: 32 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -12,68 +12,59 @@ datasheets.
1212
Required Properties:
1313

1414
- compatible: must contain one or more of the following:
15-
- "renesas,cmt-32-r8a7740" for the r8a7740 32-bit CMT
16-
(CMT0)
17-
- "renesas,cmt-32-sh7372" for the sh7372 32-bit CMT
18-
(CMT0)
19-
- "renesas,cmt-32-sh73a0" for the sh73a0 32-bit CMT
20-
(CMT0)
21-
- "renesas,cmt-32" for all 32-bit CMT without fast clock support
22-
(CMT0 on sh7372, sh73a0 and r8a7740)
23-
This is a fallback for the above renesas,cmt-32-* entries.
24-
25-
- "renesas,cmt-32-fast-r8a7740" for the r8a7740 32-bit CMT with fast
26-
clock support (CMT[234])
27-
- "renesas,cmt-32-fast-sh7372" for the sh7372 32-bit CMT with fast
28-
clock support (CMT[234])
29-
- "renesas,cmt-32-fast-sh73a0" for the sh73A0 32-bit CMT with fast
30-
clock support (CMT[234])
31-
- "renesas,cmt-32-fast" for all 32-bit CMT with fast clock support
32-
(CMT[234] on sh7372, sh73a0 and r8a7740)
33-
This is a fallback for the above renesas,cmt-32-fast-* entries.
34-
35-
- "renesas,cmt-48-sh7372" for the sh7372 48-bit CMT
36-
(CMT1)
3715
- "renesas,cmt-48-sh73a0" for the sh73A0 48-bit CMT
3816
(CMT1)
3917
- "renesas,cmt-48-r8a7740" for the r8a7740 48-bit CMT
4018
(CMT1)
4119
- "renesas,cmt-48" for all non-second generation 48-bit CMT
42-
(CMT1 on sh7372, sh73a0 and r8a7740)
20+
(CMT1 on sh73a0 and r8a7740)
4321
This is a fallback for the above renesas,cmt-48-* entries.
4422

45-
- "renesas,cmt-48-r8a73a4" for the r8a73a4 48-bit CMT
46-
(CMT[01])
47-
- "renesas,cmt-48-r8a7790" for the r8a7790 48-bit CMT
48-
(CMT[01])
49-
- "renesas,cmt-48-r8a7791" for the r8a7791 48-bit CMT
50-
(CMT[01])
51-
- "renesas,cmt-48-gen2" for all second generation 48-bit CMT
52-
(CMT[01] on r8a73a4, r8a7790 and r8a7791)
53-
This is a fallback for the renesas,cmt-48-r8a73a4,
54-
renesas,cmt-48-r8a7790 and renesas,cmt-48-r8a7791 entries.
23+
- "renesas,cmt0-r8a73a4" for the 32-bit CMT0 device included in r8a73a4.
24+
- "renesas,cmt1-r8a73a4" for the 48-bit CMT1 device included in r8a73a4.
25+
- "renesas,cmt0-r8a7790" for the 32-bit CMT0 device included in r8a7790.
26+
- "renesas,cmt1-r8a7790" for the 48-bit CMT1 device included in r8a7790.
27+
- "renesas,cmt0-r8a7791" for the 32-bit CMT0 device included in r8a7791.
28+
- "renesas,cmt1-r8a7791" for the 48-bit CMT1 device included in r8a7791.
29+
- "renesas,cmt0-r8a7793" for the 32-bit CMT0 device included in r8a7793.
30+
- "renesas,cmt1-r8a7793" for the 48-bit CMT1 device included in r8a7793.
31+
- "renesas,cmt0-r8a7794" for the 32-bit CMT0 device included in r8a7794.
32+
- "renesas,cmt1-r8a7794" for the 48-bit CMT1 device included in r8a7794.
33+
34+
- "renesas,rcar-gen2-cmt0" for 32-bit CMT0 devices included in R-Car Gen2.
35+
- "renesas,rcar-gen2-cmt1" for 48-bit CMT1 devices included in R-Car Gen2.
36+
These are fallbacks for r8a73a4 and all the R-Car Gen2
37+
entries listed above.
5538

5639
- reg: base address and length of the registers block for the timer module.
5740
- interrupts: interrupt-specifier for the timer, one per channel.
5841
- clocks: a list of phandle + clock-specifier pairs, one for each entry
5942
in clock-names.
6043
- clock-names: must contain "fck" for the functional clock.
6144

62-
- renesas,channels-mask: bitmask of the available channels.
6345

64-
65-
Example: R8A7790 (R-Car H2) CMT0 node
66-
67-
CMT0 on R8A7790 implements hardware channels 5 and 6 only and names
68-
them channels 0 and 1 in the documentation.
46+
Example: R8A7790 (R-Car H2) CMT0 and CMT1 nodes
6947

7048
cmt0: timer@ffca0000 {
71-
compatible = "renesas,cmt-48-r8a7790", "renesas,cmt-48-gen2";
49+
compatible = "renesas,cmt0-r8a7790", "renesas,rcar-gen2-cmt0";
7250
reg = <0 0xffca0000 0 0x1004>;
7351
interrupts = <0 142 IRQ_TYPE_LEVEL_HIGH>,
7452
<0 142 IRQ_TYPE_LEVEL_HIGH>;
7553
clocks = <&mstp1_clks R8A7790_CLK_CMT0>;
7654
clock-names = "fck";
55+
};
7756

78-
renesas,channels-mask = <0x60>;
57+
cmt1: timer@e6130000 {
58+
compatible = "renesas,cmt1-r8a7790", "renesas,rcar-gen2-cmt1";
59+
reg = <0 0xe6130000 0 0x1004>;
60+
interrupts = <0 120 IRQ_TYPE_LEVEL_HIGH>,
61+
<0 121 IRQ_TYPE_LEVEL_HIGH>,
62+
<0 122 IRQ_TYPE_LEVEL_HIGH>,
63+
<0 123 IRQ_TYPE_LEVEL_HIGH>,
64+
<0 124 IRQ_TYPE_LEVEL_HIGH>,
65+
<0 125 IRQ_TYPE_LEVEL_HIGH>,
66+
<0 126 IRQ_TYPE_LEVEL_HIGH>,
67+
<0 127 IRQ_TYPE_LEVEL_HIGH>;
68+
clocks = <&mstp3_clks R8A7790_CLK_CMT1>;
69+
clock-names = "fck";
7970
};

drivers/clocksource/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,14 @@ config CLKSRC_IMX_GPT
598598
depends on ARM && CLKDEV_LOOKUP
599599
select CLKSRC_MMIO
600600

601+
config CLKSRC_IMX_TPM
602+
bool "Clocksource using i.MX TPM" if COMPILE_TEST
603+
depends on ARM && CLKDEV_LOOKUP && GENERIC_CLOCKEVENTS
604+
select CLKSRC_MMIO
605+
help
606+
Enable this option to use IMX Timer/PWM Module (TPM) timer as
607+
clocksource.
608+
601609
config CLKSRC_ST_LPC
602610
bool "Low power clocksource found in the LPC" if COMPILE_TEST
603611
select TIMER_OF if OF

drivers/clocksource/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ obj-$(CONFIG_CLKSRC_VERSATILE) += versatile.o
6767
obj-$(CONFIG_CLKSRC_MIPS_GIC) += mips-gic-timer.o
6868
obj-$(CONFIG_CLKSRC_TANGO_XTAL) += tango_xtal.o
6969
obj-$(CONFIG_CLKSRC_IMX_GPT) += timer-imx-gpt.o
70+
obj-$(CONFIG_CLKSRC_IMX_TPM) += timer-imx-tpm.o
7071
obj-$(CONFIG_ASM9260_TIMER) += asm9260_timer.o
7172
obj-$(CONFIG_H8300_TMR8) += h8300_timer8.o
7273
obj-$(CONFIG_H8300_TMR16) += h8300_timer16.o

drivers/clocksource/bcm2835_timer.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ static int __init bcm2835_timer_init(struct device_node *node)
114114

115115
timer = kzalloc(sizeof(*timer), GFP_KERNEL);
116116
if (!timer) {
117-
pr_err("Can't allocate timer struct\n");
118117
ret = -ENOMEM;
119118
goto err_iounmap;
120119
}

drivers/clocksource/tango_xtal.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ static int __init tango_clocksource_init(struct device_node *np)
2626

2727
xtal_in_cnt = of_iomap(np, 0);
2828
if (xtal_in_cnt == NULL) {
29-
pr_err("%s: invalid address\n", np->full_name);
29+
pr_err("%pOF: invalid address\n", np);
3030
return -ENXIO;
3131
}
3232

3333
clk = of_clk_get(np, 0);
3434
if (IS_ERR(clk)) {
35-
pr_err("%s: invalid clock\n", np->full_name);
35+
pr_err("%pOF: invalid clock\n", np);
3636
return PTR_ERR(clk);
3737
}
3838

@@ -43,7 +43,7 @@ static int __init tango_clocksource_init(struct device_node *np)
4343
ret = clocksource_mmio_init(xtal_in_cnt, "tango-xtal", xtal_freq, 350,
4444
32, clocksource_mmio_readl_up);
4545
if (ret) {
46-
pr_err("%s: registration failed\n", np->full_name);
46+
pr_err("%pOF: registration failed\n", np);
4747
return ret;
4848
}
4949

0 commit comments

Comments
 (0)