xref: /freebsd-src/sys/contrib/device-tree/Bindings/pwm/microchip,corepwm.yaml (revision 8bab661a3316d8bd9b9fbd11a3b4371b91507bd2)
1c9ccf3a3SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2c9ccf3a3SEmmanuel Vadot
3c9ccf3a3SEmmanuel Vadot%YAML 1.2
4c9ccf3a3SEmmanuel Vadot---
5c9ccf3a3SEmmanuel Vadot$id: http://devicetree.org/schemas/pwm/microchip,corepwm.yaml#
6c9ccf3a3SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
7c9ccf3a3SEmmanuel Vadot
8*8bab661aSEmmanuel Vadottitle: Microchip IP corePWM controller
9c9ccf3a3SEmmanuel Vadot
10c9ccf3a3SEmmanuel Vadotmaintainers:
11c9ccf3a3SEmmanuel Vadot  - Conor Dooley <conor.dooley@microchip.com>
12c9ccf3a3SEmmanuel Vadot
13c9ccf3a3SEmmanuel Vadotdescription: |
14c9ccf3a3SEmmanuel Vadot  corePWM is an 16 channel pulse width modulator FPGA IP
15c9ccf3a3SEmmanuel Vadot
16c9ccf3a3SEmmanuel Vadot  https://www.microsemi.com/existing-parts/parts/152118
17c9ccf3a3SEmmanuel Vadot
18c9ccf3a3SEmmanuel VadotallOf:
19c9ccf3a3SEmmanuel Vadot  - $ref: pwm.yaml#
20c9ccf3a3SEmmanuel Vadot
21c9ccf3a3SEmmanuel Vadotproperties:
22c9ccf3a3SEmmanuel Vadot  compatible:
23c9ccf3a3SEmmanuel Vadot    items:
24c9ccf3a3SEmmanuel Vadot      - const: microchip,corepwm-rtl-v4
25c9ccf3a3SEmmanuel Vadot
26c9ccf3a3SEmmanuel Vadot  reg:
27c9ccf3a3SEmmanuel Vadot    maxItems: 1
28c9ccf3a3SEmmanuel Vadot
29c9ccf3a3SEmmanuel Vadot  clocks:
30c9ccf3a3SEmmanuel Vadot    maxItems: 1
31c9ccf3a3SEmmanuel Vadot
32c9ccf3a3SEmmanuel Vadot  "#pwm-cells":
33*8bab661aSEmmanuel Vadot    enum: [2, 3]
34*8bab661aSEmmanuel Vadot    description:
35*8bab661aSEmmanuel Vadot      The only flag supported by the controller is PWM_POLARITY_INVERTED.
36c9ccf3a3SEmmanuel Vadot
37c9ccf3a3SEmmanuel Vadot  microchip,sync-update-mask:
38c9ccf3a3SEmmanuel Vadot    description: |
39c9ccf3a3SEmmanuel Vadot      Depending on how the IP is instantiated, there are two modes of operation.
40c9ccf3a3SEmmanuel Vadot      In synchronous mode, all channels are updated at the beginning of the PWM period,
41c9ccf3a3SEmmanuel Vadot      and in asynchronous mode updates happen as the control registers are written.
42c9ccf3a3SEmmanuel Vadot      A 16 bit wide "SHADOW_REG_EN" parameter of the IP core controls whether synchronous
43c9ccf3a3SEmmanuel Vadot      mode is possible for each channel, and is set by the bitstream programmed to the
44c9ccf3a3SEmmanuel Vadot      FPGA. If the IP core is instantiated with SHADOW_REG_ENx=1, both registers that
45c9ccf3a3SEmmanuel Vadot      control the duty cycle for channel x have a second "shadow"/buffer reg synthesised.
46c9ccf3a3SEmmanuel Vadot      At runtime a bit wide register exposed to APB can be used to toggle on/off
47c9ccf3a3SEmmanuel Vadot      synchronised mode for all channels it has been synthesised for.
48c9ccf3a3SEmmanuel Vadot      Each bit of "microchip,sync-update-mask" corresponds to a PWM channel & represents
49c9ccf3a3SEmmanuel Vadot      whether synchronous mode is possible for the PWM channel.
50c9ccf3a3SEmmanuel Vadot
51c9ccf3a3SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
52c9ccf3a3SEmmanuel Vadot    default: 0
53c9ccf3a3SEmmanuel Vadot
54c9ccf3a3SEmmanuel Vadot  microchip,dac-mode-mask:
55c9ccf3a3SEmmanuel Vadot    description: |
56c9ccf3a3SEmmanuel Vadot      Optional, per-channel Low Ripple DAC mode is possible on this IP core. It creates
57c9ccf3a3SEmmanuel Vadot      a minimum period pulse train whose High/Low average is that of the chosen duty
58c9ccf3a3SEmmanuel Vadot      cycle. This "DAC" will have far better bandwidth and ripple performance than the
59c9ccf3a3SEmmanuel Vadot      standard PWM algorithm can achieve. A 16 bit DAC_MODE module parameter of the IP
60c9ccf3a3SEmmanuel Vadot      core, set at instantiation and by the bitstream programmed to the FPGA, determines
61c9ccf3a3SEmmanuel Vadot      whether a given channel operates in regular PWM or DAC mode.
62c9ccf3a3SEmmanuel Vadot      Each bit corresponds to a PWM channel & represents whether DAC mode is enabled
63c9ccf3a3SEmmanuel Vadot      for that channel.
64c9ccf3a3SEmmanuel Vadot
65c9ccf3a3SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
66c9ccf3a3SEmmanuel Vadot    default: 0
67c9ccf3a3SEmmanuel Vadot
68c9ccf3a3SEmmanuel Vadotrequired:
69c9ccf3a3SEmmanuel Vadot  - compatible
70c9ccf3a3SEmmanuel Vadot  - reg
71c9ccf3a3SEmmanuel Vadot  - clocks
72c9ccf3a3SEmmanuel Vadot
73c9ccf3a3SEmmanuel VadotadditionalProperties: false
74c9ccf3a3SEmmanuel Vadot
75c9ccf3a3SEmmanuel Vadotexamples:
76c9ccf3a3SEmmanuel Vadot  - |
77c9ccf3a3SEmmanuel Vadot    pwm@41000000 {
78c9ccf3a3SEmmanuel Vadot      compatible = "microchip,corepwm-rtl-v4";
79c9ccf3a3SEmmanuel Vadot      microchip,sync-update-mask = /bits/ 32 <0>;
80c9ccf3a3SEmmanuel Vadot      clocks = <&clkcfg 30>;
81c9ccf3a3SEmmanuel Vadot      reg = <0x41000000 0xF0>;
82c9ccf3a3SEmmanuel Vadot      #pwm-cells = <2>;
83c9ccf3a3SEmmanuel Vadot    };
84