xref: /linux/Documentation/devicetree/bindings/pwm/pwm-sifive.yaml (revision a4eb44a6435d6d8f9e642407a4a06f65eb90ca04)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2# Copyright (C) 2020 SiFive, Inc.
3%YAML 1.2
4---
5$id: http://devicetree.org/schemas/pwm/pwm-sifive.yaml#
6$schema: http://devicetree.org/meta-schemas/core.yaml#
7
8title: SiFive PWM controller
9
10maintainers:
11  - Sagar Kadam <sagar.kadam@sifive.com>
12  - Paul Walmsley <paul.walmsley@sifive.com>
13
14description:
15  Unlike most other PWM controllers, the SiFive PWM controller currently
16  only supports one period for all channels in the PWM. All PWMs need to
17  run at the same period. The period also has significant restrictions on
18  the values it can achieve, which the driver rounds to the nearest
19  achievable period. PWM RTL that corresponds to the IP block version
20  numbers can be found here -
21
22  https://github.com/sifive/sifive-blocks/tree/master/src/main/scala/devices/pwm
23
24properties:
25  compatible:
26    items:
27      - enum:
28          - sifive,fu540-c000-pwm
29          - sifive,fu740-c000-pwm
30      - const: sifive,pwm0
31    description:
32      Should be "sifive,<chip>-pwm" and "sifive,pwm<version>". Supported
33      compatible strings are "sifive,fu540-c000-pwm" and
34      "sifive,fu740-c000-pwm" for the SiFive PWM v0 as integrated onto the
35      SiFive FU540 and FU740 chip respectively, and "sifive,pwm0" for the
36      SiFive PWM v0 IP block with no chip integration tweaks.
37      Please refer to sifive-blocks-ip-versioning.txt for details.
38
39  reg:
40    maxItems: 1
41
42  clocks:
43    maxItems: 1
44
45  "#pwm-cells":
46    const: 3
47
48  interrupts:
49    maxItems: 4
50    description:
51      Each PWM instance in FU540-C000 has 4 comparators. One interrupt per comparator.
52
53required:
54  - compatible
55  - reg
56  - clocks
57  - "#pwm-cells"
58  - interrupts
59
60additionalProperties: false
61
62examples:
63  - |
64    pwm:  pwm@10020000 {
65      compatible = "sifive,fu540-c000-pwm", "sifive,pwm0";
66      reg = <0x10020000 0x1000>;
67      clocks = <&tlclk>;
68      interrupt-parent = <&plic>;
69      interrupts = <42>, <43>, <44>, <45>;
70      #pwm-cells = <3>;
71    };
72