xref: /freebsd/sys/contrib/device-tree/Bindings/mfd/google,cros-ec.yaml (revision 8bab661a3316d8bd9b9fbd11a3b4371b91507bd2)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/mfd/google,cros-ec.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
7c66ec88fSEmmanuel Vadottitle: ChromeOS Embedded Controller
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotmaintainers:
10c66ec88fSEmmanuel Vadot  - Benson Leung <bleung@chromium.org>
11c66ec88fSEmmanuel Vadot  - Guenter Roeck <groeck@chromium.org>
12c66ec88fSEmmanuel Vadot
13c66ec88fSEmmanuel Vadotdescription:
14c66ec88fSEmmanuel Vadot  Google's ChromeOS EC is a microcontroller which talks to the AP and
15c66ec88fSEmmanuel Vadot  implements various functions such as keyboard and battery charging.
16c66ec88fSEmmanuel Vadot  The EC can be connected through various interfaces (I2C, SPI, and others)
17c66ec88fSEmmanuel Vadot  and the compatible string specifies which interface is being used.
18c66ec88fSEmmanuel Vadot
19c66ec88fSEmmanuel Vadotproperties:
20c66ec88fSEmmanuel Vadot  compatible:
21c66ec88fSEmmanuel Vadot    oneOf:
22c66ec88fSEmmanuel Vadot      - description:
23*8bab661aSEmmanuel Vadot          For implementations of the EC connected through I2C.
24c66ec88fSEmmanuel Vadot        const: google,cros-ec-i2c
25c66ec88fSEmmanuel Vadot      - description:
26*8bab661aSEmmanuel Vadot          For implementations of the EC connected through SPI.
27c66ec88fSEmmanuel Vadot        const: google,cros-ec-spi
28c66ec88fSEmmanuel Vadot      - description:
29*8bab661aSEmmanuel Vadot          For implementations of the FPMCU connected through SPI.
30*8bab661aSEmmanuel Vadot        items:
31*8bab661aSEmmanuel Vadot          - const: google,cros-ec-fp
32*8bab661aSEmmanuel Vadot          - const: google,cros-ec-spi
33*8bab661aSEmmanuel Vadot      - description:
34*8bab661aSEmmanuel Vadot          For implementations of the EC connected through RPMSG.
35c66ec88fSEmmanuel Vadot        const: google,cros-ec-rpmsg
36c66ec88fSEmmanuel Vadot
37*8bab661aSEmmanuel Vadot  controller-data: true
386be33864SEmmanuel Vadot
39c66ec88fSEmmanuel Vadot  google,cros-ec-spi-pre-delay:
40c66ec88fSEmmanuel Vadot    description:
41c66ec88fSEmmanuel Vadot      This property specifies the delay in usecs between the
42c66ec88fSEmmanuel Vadot      assertion of the CS and the first clock pulse.
43c9ccf3a3SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
44c9ccf3a3SEmmanuel Vadot    default: 0
45c66ec88fSEmmanuel Vadot
46c66ec88fSEmmanuel Vadot  google,cros-ec-spi-msg-delay:
47c66ec88fSEmmanuel Vadot    description:
48c66ec88fSEmmanuel Vadot      This property specifies the delay in usecs between messages.
49c9ccf3a3SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
50c9ccf3a3SEmmanuel Vadot    default: 0
51c66ec88fSEmmanuel Vadot
52c66ec88fSEmmanuel Vadot  google,has-vbc-nvram:
53c66ec88fSEmmanuel Vadot    description:
54c66ec88fSEmmanuel Vadot      Some implementations of the EC include a small nvram space used to
55c66ec88fSEmmanuel Vadot      store verified boot context data. This boolean flag is used to specify
56c66ec88fSEmmanuel Vadot      whether this nvram is present or not.
57c66ec88fSEmmanuel Vadot    type: boolean
58c66ec88fSEmmanuel Vadot
59e67e8565SEmmanuel Vadot  mediatek,rpmsg-name:
606be33864SEmmanuel Vadot    description:
616be33864SEmmanuel Vadot      Must be defined if the cros-ec is a rpmsg device for a Mediatek
62d5b0e70fSEmmanuel Vadot      ARM Cortex M4 Co-processor. Contains the name of the rpmsg
636be33864SEmmanuel Vadot      device. Used to match the subnode to the rpmsg device announced by
646be33864SEmmanuel Vadot      the SCP.
656be33864SEmmanuel Vadot    $ref: "/schemas/types.yaml#/definitions/string"
666be33864SEmmanuel Vadot
67*8bab661aSEmmanuel Vadot  spi-max-frequency: true
68c66ec88fSEmmanuel Vadot
69c66ec88fSEmmanuel Vadot  reg:
70c66ec88fSEmmanuel Vadot    maxItems: 1
71c66ec88fSEmmanuel Vadot
72c66ec88fSEmmanuel Vadot  interrupts:
73c66ec88fSEmmanuel Vadot    maxItems: 1
74c66ec88fSEmmanuel Vadot
75*8bab661aSEmmanuel Vadot  reset-gpios:
76*8bab661aSEmmanuel Vadot    maxItems: 1
77*8bab661aSEmmanuel Vadot
78*8bab661aSEmmanuel Vadot  boot0-gpios:
79*8bab661aSEmmanuel Vadot    maxItems: 1
80*8bab661aSEmmanuel Vadot    description: Assert for bootloader mode.
81*8bab661aSEmmanuel Vadot
82*8bab661aSEmmanuel Vadot  vdd-supply: true
83*8bab661aSEmmanuel Vadot
846be33864SEmmanuel Vadot  wakeup-source:
856be33864SEmmanuel Vadot    description: Button can wake-up the system.
866be33864SEmmanuel Vadot
876be33864SEmmanuel Vadot  '#address-cells':
886be33864SEmmanuel Vadot    const: 1
896be33864SEmmanuel Vadot
906be33864SEmmanuel Vadot  '#size-cells':
916be33864SEmmanuel Vadot    const: 0
926be33864SEmmanuel Vadot
936be33864SEmmanuel Vadot  typec:
946be33864SEmmanuel Vadot    $ref: "/schemas/chrome/google,cros-ec-typec.yaml#"
956be33864SEmmanuel Vadot
966be33864SEmmanuel Vadot  ec-pwm:
976be33864SEmmanuel Vadot    $ref: "/schemas/pwm/google,cros-ec-pwm.yaml#"
98c9ccf3a3SEmmanuel Vadot    deprecated: true
99c9ccf3a3SEmmanuel Vadot
100c9ccf3a3SEmmanuel Vadot  pwm:
101c9ccf3a3SEmmanuel Vadot    $ref: "/schemas/pwm/google,cros-ec-pwm.yaml#"
1026be33864SEmmanuel Vadot
103b97ee269SEmmanuel Vadot  kbd-led-backlight:
104b97ee269SEmmanuel Vadot    $ref: "/schemas/chrome/google,cros-kbd-led-backlight.yaml#"
105b97ee269SEmmanuel Vadot
1066be33864SEmmanuel Vadot  keyboard-controller:
1076be33864SEmmanuel Vadot    $ref: "/schemas/input/google,cros-ec-keyb.yaml#"
1086be33864SEmmanuel Vadot
1092eb4d8dcSEmmanuel Vadot  proximity:
1102eb4d8dcSEmmanuel Vadot    $ref: "/schemas/iio/proximity/google,cros-ec-mkbp-proximity.yaml#"
1112eb4d8dcSEmmanuel Vadot
1126be33864SEmmanuel Vadot  codecs:
1136be33864SEmmanuel Vadot    type: object
1146be33864SEmmanuel Vadot    additionalProperties: false
1156be33864SEmmanuel Vadot
1166be33864SEmmanuel Vadot    properties:
1176be33864SEmmanuel Vadot      '#address-cells':
1186be33864SEmmanuel Vadot        const: 2
1196be33864SEmmanuel Vadot
1206be33864SEmmanuel Vadot      '#size-cells':
1216be33864SEmmanuel Vadot        const: 1
1226be33864SEmmanuel Vadot
1236be33864SEmmanuel Vadot    patternProperties:
1246be33864SEmmanuel Vadot      "^ec-codec@[a-f0-9]+$":
1256be33864SEmmanuel Vadot        type: object
1266be33864SEmmanuel Vadot        $ref: "/schemas/sound/google,cros-ec-codec.yaml#"
1276be33864SEmmanuel Vadot
1286be33864SEmmanuel Vadot    required:
1296be33864SEmmanuel Vadot      - "#address-cells"
1306be33864SEmmanuel Vadot      - "#size-cells"
1316be33864SEmmanuel Vadot
1325956d97fSEmmanuel Vadot  cbas:
1335956d97fSEmmanuel Vadot    type: object
1345956d97fSEmmanuel Vadot
1355956d97fSEmmanuel Vadot    description:
1365956d97fSEmmanuel Vadot      This device is used to signal when a detachable base is attached
1375956d97fSEmmanuel Vadot      to a Chrome OS tablet. This device cannot be detected at runtime.
1385956d97fSEmmanuel Vadot
1395956d97fSEmmanuel Vadot    properties:
1405956d97fSEmmanuel Vadot      compatible:
1415956d97fSEmmanuel Vadot        const: google,cros-cbas
1425956d97fSEmmanuel Vadot
1435956d97fSEmmanuel Vadot    required:
1445956d97fSEmmanuel Vadot      - compatible
1455956d97fSEmmanuel Vadot
1465956d97fSEmmanuel Vadot    additionalProperties: false
1475956d97fSEmmanuel Vadot
1486be33864SEmmanuel VadotpatternProperties:
1496be33864SEmmanuel Vadot  "^i2c-tunnel[0-9]*$":
1506be33864SEmmanuel Vadot    type: object
1516be33864SEmmanuel Vadot    $ref: "/schemas/i2c/google,cros-ec-i2c-tunnel.yaml#"
1526be33864SEmmanuel Vadot
1536be33864SEmmanuel Vadot  "^regulator@[0-9]+$":
1546be33864SEmmanuel Vadot    type: object
1556be33864SEmmanuel Vadot    $ref: "/schemas/regulator/google,cros-ec-regulator.yaml#"
1566be33864SEmmanuel Vadot
1576be33864SEmmanuel Vadot  "^extcon[0-9]*$":
1586be33864SEmmanuel Vadot    type: object
1596be33864SEmmanuel Vadot    $ref: "/schemas/extcon/extcon-usbc-cros-ec.yaml#"
1606be33864SEmmanuel Vadot
161c66ec88fSEmmanuel Vadotrequired:
162c66ec88fSEmmanuel Vadot  - compatible
163c66ec88fSEmmanuel Vadot
164c9ccf3a3SEmmanuel VadotallOf:
165c9ccf3a3SEmmanuel Vadot  - if:
166c66ec88fSEmmanuel Vadot      properties:
167c66ec88fSEmmanuel Vadot        compatible:
168*8bab661aSEmmanuel Vadot          not:
169c66ec88fSEmmanuel Vadot            contains:
170*8bab661aSEmmanuel Vadot              const: google,cros-ec-spi
171c66ec88fSEmmanuel Vadot    then:
172c66ec88fSEmmanuel Vadot      properties:
173*8bab661aSEmmanuel Vadot        controller-data: false
174c66ec88fSEmmanuel Vadot        google,cros-ec-spi-pre-delay: false
175c66ec88fSEmmanuel Vadot        google,cros-ec-spi-msg-delay: false
176c66ec88fSEmmanuel Vadot        spi-max-frequency: false
177c9ccf3a3SEmmanuel Vadot    else:
178c9ccf3a3SEmmanuel Vadot      $ref: /schemas/spi/spi-peripheral-props.yaml
179c66ec88fSEmmanuel Vadot
180*8bab661aSEmmanuel Vadot  - if:
181*8bab661aSEmmanuel Vadot      properties:
182*8bab661aSEmmanuel Vadot        compatible:
183*8bab661aSEmmanuel Vadot          not:
184*8bab661aSEmmanuel Vadot            contains:
185*8bab661aSEmmanuel Vadot              const: google,cros-ec-rpmsg
186*8bab661aSEmmanuel Vadot    then:
187*8bab661aSEmmanuel Vadot      properties:
188*8bab661aSEmmanuel Vadot        mediatek,rpmsg-name: false
189*8bab661aSEmmanuel Vadot
190*8bab661aSEmmanuel Vadot      required:
191*8bab661aSEmmanuel Vadot        - reg
192*8bab661aSEmmanuel Vadot        - interrupts
193*8bab661aSEmmanuel Vadot
194*8bab661aSEmmanuel Vadot  - if:
195*8bab661aSEmmanuel Vadot      properties:
196*8bab661aSEmmanuel Vadot        compatible:
197*8bab661aSEmmanuel Vadot          contains:
198*8bab661aSEmmanuel Vadot            const: google,cros-ec-fp
199*8bab661aSEmmanuel Vadot    then:
200*8bab661aSEmmanuel Vadot      properties:
201*8bab661aSEmmanuel Vadot        '#address-cells': false
202*8bab661aSEmmanuel Vadot        '#size-cells': false
203*8bab661aSEmmanuel Vadot        typec: false
204*8bab661aSEmmanuel Vadot        ec-pwm: false
205*8bab661aSEmmanuel Vadot        kbd-led-backlight: false
206*8bab661aSEmmanuel Vadot        keyboard-controller: false
207*8bab661aSEmmanuel Vadot        proximity: false
208*8bab661aSEmmanuel Vadot        codecs: false
209*8bab661aSEmmanuel Vadot        cbas: false
210*8bab661aSEmmanuel Vadot
211*8bab661aSEmmanuel Vadot      patternProperties:
212*8bab661aSEmmanuel Vadot        "^i2c-tunnel[0-9]*$": false
213*8bab661aSEmmanuel Vadot        "^regulator@[0-9]+$": false
214*8bab661aSEmmanuel Vadot        "^extcon[0-9]*$": false
215*8bab661aSEmmanuel Vadot
216*8bab661aSEmmanuel Vadot      # Using additionalProperties: false here and
217*8bab661aSEmmanuel Vadot      # listing true properties doesn't work
218*8bab661aSEmmanuel Vadot
219*8bab661aSEmmanuel Vadot      required:
220*8bab661aSEmmanuel Vadot        - reset-gpios
221*8bab661aSEmmanuel Vadot        - boot0-gpios
222*8bab661aSEmmanuel Vadot        - vdd-supply
223*8bab661aSEmmanuel Vadot    else:
224*8bab661aSEmmanuel Vadot      properties:
225*8bab661aSEmmanuel Vadot        reset-gpios: false
226*8bab661aSEmmanuel Vadot        boot0-gpios: false
227*8bab661aSEmmanuel Vadot        vdd-supply: false
228*8bab661aSEmmanuel Vadot
229c66ec88fSEmmanuel VadotadditionalProperties: false
230c66ec88fSEmmanuel Vadot
231c66ec88fSEmmanuel Vadotexamples:
232c66ec88fSEmmanuel Vadot  # Example for I2C
233c66ec88fSEmmanuel Vadot  - |
234c66ec88fSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
235c66ec88fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
236c66ec88fSEmmanuel Vadot
237c66ec88fSEmmanuel Vadot    i2c0 {
238c66ec88fSEmmanuel Vadot        #address-cells = <1>;
239c66ec88fSEmmanuel Vadot        #size-cells = <0>;
240c66ec88fSEmmanuel Vadot
241c66ec88fSEmmanuel Vadot        cros-ec@1e {
242c66ec88fSEmmanuel Vadot            compatible = "google,cros-ec-i2c";
243c66ec88fSEmmanuel Vadot            reg = <0x1e>;
244c66ec88fSEmmanuel Vadot            interrupts = <6 0>;
245c66ec88fSEmmanuel Vadot            interrupt-parent = <&gpio0>;
246c66ec88fSEmmanuel Vadot        };
247c66ec88fSEmmanuel Vadot    };
248c66ec88fSEmmanuel Vadot
249c66ec88fSEmmanuel Vadot  # Example for SPI
250c66ec88fSEmmanuel Vadot  - |
251c66ec88fSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
252c66ec88fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
253c66ec88fSEmmanuel Vadot
254c66ec88fSEmmanuel Vadot    spi0 {
255c66ec88fSEmmanuel Vadot        #address-cells = <1>;
256c66ec88fSEmmanuel Vadot        #size-cells = <0>;
257c66ec88fSEmmanuel Vadot
258c66ec88fSEmmanuel Vadot        cros-ec@0 {
259c66ec88fSEmmanuel Vadot            compatible = "google,cros-ec-spi";
260c66ec88fSEmmanuel Vadot            reg = <0x0>;
261c66ec88fSEmmanuel Vadot            google,cros-ec-spi-msg-delay = <30>;
262c66ec88fSEmmanuel Vadot            google,cros-ec-spi-pre-delay = <10>;
263c66ec88fSEmmanuel Vadot            interrupts = <99 0>;
264c66ec88fSEmmanuel Vadot            interrupt-parent = <&gpio7>;
265c66ec88fSEmmanuel Vadot            spi-max-frequency = <5000000>;
2662eb4d8dcSEmmanuel Vadot
2672eb4d8dcSEmmanuel Vadot            proximity {
2682eb4d8dcSEmmanuel Vadot                compatible = "google,cros-ec-mkbp-proximity";
2692eb4d8dcSEmmanuel Vadot            };
2705956d97fSEmmanuel Vadot
2715956d97fSEmmanuel Vadot            cbas {
2725956d97fSEmmanuel Vadot                compatible = "google,cros-cbas";
2735956d97fSEmmanuel Vadot            };
274c66ec88fSEmmanuel Vadot        };
275c66ec88fSEmmanuel Vadot    };
276c66ec88fSEmmanuel Vadot
277c66ec88fSEmmanuel Vadot  # Example for RPMSG
278c66ec88fSEmmanuel Vadot  - |
279c66ec88fSEmmanuel Vadot    scp0 {
280c66ec88fSEmmanuel Vadot        cros-ec {
281c66ec88fSEmmanuel Vadot            compatible = "google,cros-ec-rpmsg";
282c66ec88fSEmmanuel Vadot        };
283c66ec88fSEmmanuel Vadot    };
284*8bab661aSEmmanuel Vadot
285*8bab661aSEmmanuel Vadot  # Example for FPMCU
286*8bab661aSEmmanuel Vadot  - |
287*8bab661aSEmmanuel Vadot    spi0 {
288*8bab661aSEmmanuel Vadot      #address-cells = <0x1>;
289*8bab661aSEmmanuel Vadot      #size-cells = <0x0>;
290*8bab661aSEmmanuel Vadot
291*8bab661aSEmmanuel Vadot      ec@0 {
292*8bab661aSEmmanuel Vadot        compatible = "google,cros-ec-fp", "google,cros-ec-spi";
293*8bab661aSEmmanuel Vadot        reg = <0x0>;
294*8bab661aSEmmanuel Vadot        interrupt-parent = <&gpio_controller>;
295*8bab661aSEmmanuel Vadot        interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
296*8bab661aSEmmanuel Vadot        spi-max-frequency = <3000000>;
297*8bab661aSEmmanuel Vadot        reset-gpios = <&gpio_controller 5 GPIO_ACTIVE_LOW>;
298*8bab661aSEmmanuel Vadot        boot0-gpios = <&gpio_controller 10 GPIO_ACTIVE_HIGH>;
299*8bab661aSEmmanuel Vadot        vdd-supply = <&pp3300_fp_mcu>;
300*8bab661aSEmmanuel Vadot      };
301*8bab661aSEmmanuel Vadot    };
302c66ec88fSEmmanuel Vadot...
303