1cb7aa33aSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2cb7aa33aSEmmanuel Vadot# Copyright (C) 2022 SiFive, Inc.
3cb7aa33aSEmmanuel Vadot%YAML 1.2
4cb7aa33aSEmmanuel Vadot---
5cb7aa33aSEmmanuel Vadot$id: http://devicetree.org/schemas/pwm/snps,dw-apb-timers-pwm2.yaml#
6cb7aa33aSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
7cb7aa33aSEmmanuel Vadot
8cb7aa33aSEmmanuel Vadottitle: Synopsys DW-APB timers PWM controller
9cb7aa33aSEmmanuel Vadot
10cb7aa33aSEmmanuel Vadotmaintainers:
11cb7aa33aSEmmanuel Vadot  - Ben Dooks <ben.dooks@sifive.com>
12cb7aa33aSEmmanuel Vadot
13cb7aa33aSEmmanuel Vadotdescription:
14cb7aa33aSEmmanuel Vadot  This describes the DesignWare APB timers module when used in the PWM
15cb7aa33aSEmmanuel Vadot  mode. The IP core can be generated with various options which can
16cb7aa33aSEmmanuel Vadot  control the functionality, the number of PWMs available and other
17cb7aa33aSEmmanuel Vadot  internal controls the designer requires.
18cb7aa33aSEmmanuel Vadot
19cb7aa33aSEmmanuel Vadot  The IP block has a version register so this can be used for detection
20cb7aa33aSEmmanuel Vadot  instead of having to encode the IP version number in the device tree
21*aa1a8ff2SEmmanuel Vadot  compatible.
22cb7aa33aSEmmanuel Vadot
23cb7aa33aSEmmanuel VadotallOf:
24cb7aa33aSEmmanuel Vadot  - $ref: pwm.yaml#
25cb7aa33aSEmmanuel Vadot
26cb7aa33aSEmmanuel Vadotproperties:
27cb7aa33aSEmmanuel Vadot  compatible:
28cb7aa33aSEmmanuel Vadot    const: snps,dw-apb-timers-pwm2
29cb7aa33aSEmmanuel Vadot
30cb7aa33aSEmmanuel Vadot  reg:
31cb7aa33aSEmmanuel Vadot    maxItems: 1
32cb7aa33aSEmmanuel Vadot
33cb7aa33aSEmmanuel Vadot  "#pwm-cells":
34cb7aa33aSEmmanuel Vadot    const: 3
35cb7aa33aSEmmanuel Vadot
36cb7aa33aSEmmanuel Vadot  clocks:
37cb7aa33aSEmmanuel Vadot    items:
38cb7aa33aSEmmanuel Vadot      - description: Interface bus clock
39cb7aa33aSEmmanuel Vadot      - description: PWM reference clock
40cb7aa33aSEmmanuel Vadot
41cb7aa33aSEmmanuel Vadot  clock-names:
42cb7aa33aSEmmanuel Vadot    items:
43cb7aa33aSEmmanuel Vadot      - const: bus
44cb7aa33aSEmmanuel Vadot      - const: timer
45cb7aa33aSEmmanuel Vadot
46cb7aa33aSEmmanuel Vadot  snps,pwm-number:
47cb7aa33aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
48cb7aa33aSEmmanuel Vadot    description: The number of PWM channels configured for this instance
49cb7aa33aSEmmanuel Vadot    enum: [1, 2, 3, 4, 5, 6, 7, 8]
50cb7aa33aSEmmanuel Vadot
51cb7aa33aSEmmanuel Vadotrequired:
52cb7aa33aSEmmanuel Vadot  - compatible
53cb7aa33aSEmmanuel Vadot  - reg
54cb7aa33aSEmmanuel Vadot  - "#pwm-cells"
55cb7aa33aSEmmanuel Vadot  - clocks
56cb7aa33aSEmmanuel Vadot  - clock-names
57cb7aa33aSEmmanuel Vadot
58cb7aa33aSEmmanuel VadotadditionalProperties: false
59cb7aa33aSEmmanuel Vadot
60cb7aa33aSEmmanuel Vadotexamples:
61cb7aa33aSEmmanuel Vadot  - |
62cb7aa33aSEmmanuel Vadot    pwm: pwm@180000 {
63cb7aa33aSEmmanuel Vadot      compatible = "snps,dw-apb-timers-pwm2";
64cb7aa33aSEmmanuel Vadot      reg = <0x180000 0x200>;
65cb7aa33aSEmmanuel Vadot      #pwm-cells = <3>;
66cb7aa33aSEmmanuel Vadot      clocks = <&bus>, <&timer>;
67cb7aa33aSEmmanuel Vadot      clock-names = "bus", "timer";
68cb7aa33aSEmmanuel Vadot    };
69