Skip to content

Commit b33aaf5

Browse files
fancerdlezcano
authored andcommitted
dt-bindings: rtc: Convert snps,dw-apb-timer to DT schema
Modern device tree bindings are supposed to be created as YAML-files in accordance with DT schema. This commit replaces Synopsys DW Timer legacy bare text binding with YAML file. As before the binding file states that the corresponding dts node is supposed to be compatible with generic DW APB Timer indicated by the "snps,dw-apb-timer" compatible string and to provide a mandatory registers memory range, one timer interrupt, either reference clock source or a fixed clock rate value. It may also have an optional APB bus reference clock phandle specified. Signed-off-by: Serge Semin <[email protected]> Reviewed-by: Rob Herring <[email protected]> Cc: Alexey Malahov <[email protected]> Cc: Thomas Bogendoerfer <[email protected]> Cc: Paul Burton <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Daniel Lezcano <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: [email protected] Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 264418e commit b33aaf5

File tree

2 files changed

+88
-32
lines changed

2 files changed

+88
-32
lines changed

Documentation/devicetree/bindings/rtc/dw-apb.txt

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/rtc/snps,dw-apb-timer.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Synopsys DesignWare APB Timer
8+
9+
maintainers:
10+
- Daniel Lezcano <[email protected]>
11+
12+
properties:
13+
compatible:
14+
oneOf:
15+
- const: snps,dw-apb-timer
16+
- enum:
17+
- snps,dw-apb-timer-sp
18+
- snps,dw-apb-timer-osc
19+
deprecated: true
20+
21+
reg:
22+
maxItems: 1
23+
24+
interrupts:
25+
maxItems: 1
26+
27+
clocks:
28+
minItems: 1
29+
items:
30+
- description: Timer ticks reference clock source
31+
- description: APB interface clock source
32+
33+
clock-names:
34+
minItems: 1
35+
items:
36+
- const: timer
37+
- const: pclk
38+
39+
clock-frequency: true
40+
41+
clock-freq:
42+
$ref: "/schemas/types.yaml#/definitions/uint32"
43+
description: |
44+
Has the same meaning as the 'clock-frequency' property - timer clock
45+
frequency in HZ, but is defined only for the backwards compatibility
46+
with the picoxcell platform.
47+
48+
unevaluatedProperties: false
49+
50+
required:
51+
- compatible
52+
- reg
53+
- interrupts
54+
55+
oneOf:
56+
- required:
57+
- clocks
58+
- clock-names
59+
- required:
60+
- clock-frequency
61+
- required:
62+
- clock-freq
63+
64+
examples:
65+
- |
66+
timer@ffe00000 {
67+
compatible = "snps,dw-apb-timer";
68+
interrupts = <0 170 4>;
69+
reg = <0xffe00000 0x1000>;
70+
clocks = <&timer_clk>, <&timer_pclk>;
71+
clock-names = "timer", "pclk";
72+
};
73+
- |
74+
timer@ffe00000 {
75+
compatible = "snps,dw-apb-timer";
76+
interrupts = <0 170 4>;
77+
reg = <0xffe00000 0x1000>;
78+
clocks = <&timer_clk>;
79+
clock-names = "timer";
80+
};
81+
- |
82+
timer@ffe00000 {
83+
compatible = "snps,dw-apb-timer";
84+
interrupts = <0 170 4>;
85+
reg = <0xffe00000 0x1000>;
86+
clock-frequency = <25000000>;
87+
};
88+
...

0 commit comments

Comments
 (0)