1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/mfd/google,cros-ec.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: ChromeOS Embedded Controller
8
9maintainers:
10  - Benson Leung <bleung@chromium.org>
11  - Enric Balletbo i Serra <enric.balletbo@collabora.com>
12  - Guenter Roeck <groeck@chromium.org>
13
14description:
15  Google's ChromeOS EC is a microcontroller which talks to the AP and
16  implements various functions such as keyboard and battery charging.
17  The EC can be connected through various interfaces (I2C, SPI, and others)
18  and the compatible string specifies which interface is being used.
19
20properties:
21  compatible:
22    oneOf:
23      - description:
24          For implementations of the EC is connected through I2C.
25        const: google,cros-ec-i2c
26      - description:
27          For implementations of the EC is connected through SPI.
28        const: google,cros-ec-spi
29      - description:
30          For implementations of the EC is connected through RPMSG.
31        const: google,cros-ec-rpmsg
32
33  controller-data:
34    description:
35      SPI controller data, see bindings/spi/spi-samsung.txt
36    type: object
37
38  google,cros-ec-spi-pre-delay:
39    description:
40      This property specifies the delay in usecs between the
41      assertion of the CS and the first clock pulse.
42    allOf:
43      - $ref: /schemas/types.yaml#/definitions/uint32
44      - default: 0
45      - minimum: 0
46
47  google,cros-ec-spi-msg-delay:
48    description:
49      This property specifies the delay in usecs between messages.
50    allOf:
51      - $ref: /schemas/types.yaml#/definitions/uint32
52      - default: 0
53      - minimum: 0
54
55  google,has-vbc-nvram:
56    description:
57      Some implementations of the EC include a small nvram space used to
58      store verified boot context data. This boolean flag is used to specify
59      whether this nvram is present or not.
60    type: boolean
61
62  spi-max-frequency:
63    description: Maximum SPI frequency of the device in Hz.
64
65  reg:
66    maxItems: 1
67
68  interrupts:
69    maxItems: 1
70
71  wakeup-source:
72    description: Button can wake-up the system.
73
74required:
75  - compatible
76
77if:
78  properties:
79    compatible:
80      contains:
81        enum:
82          - google,cros-ec-i2c
83          - google,cros-ec-rpmsg
84then:
85  properties:
86    google,cros-ec-spi-pre-delay: false
87    google,cros-ec-spi-msg-delay: false
88    spi-max-frequency: false
89
90additionalProperties: false
91
92examples:
93  # Example for I2C
94  - |
95    #include <dt-bindings/gpio/gpio.h>
96    #include <dt-bindings/interrupt-controller/irq.h>
97
98    i2c0 {
99        #address-cells = <1>;
100        #size-cells = <0>;
101
102        cros-ec@1e {
103            compatible = "google,cros-ec-i2c";
104            reg = <0x1e>;
105            interrupts = <6 0>;
106            interrupt-parent = <&gpio0>;
107        };
108    };
109
110  # Example for SPI
111  - |
112    #include <dt-bindings/gpio/gpio.h>
113    #include <dt-bindings/interrupt-controller/irq.h>
114
115    spi0 {
116        #address-cells = <1>;
117        #size-cells = <0>;
118
119        cros-ec@0 {
120            compatible = "google,cros-ec-spi";
121            reg = <0x0>;
122            google,cros-ec-spi-msg-delay = <30>;
123            google,cros-ec-spi-pre-delay = <10>;
124            interrupts = <99 0>;
125            interrupt-parent = <&gpio7>;
126            spi-max-frequency = <5000000>;
127        };
128    };
129
130  # Example for RPMSG
131  - |
132    scp0 {
133        cros-ec {
134            compatible = "google,cros-ec-rpmsg";
135        };
136    };
137...
138