xref: /freebsd/sys/contrib/device-tree/Bindings/embedded-controller/google,cros-ec.yaml (revision 1537cf73828a2db2a67622ccfff77383c7db6f07)
1*1537cf73SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*1537cf73SEmmanuel Vadot%YAML 1.2
3*1537cf73SEmmanuel Vadot---
4*1537cf73SEmmanuel Vadot$id: http://devicetree.org/schemas/embedded-controller/google,cros-ec.yaml#
5*1537cf73SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*1537cf73SEmmanuel Vadot
7*1537cf73SEmmanuel Vadottitle: ChromeOS Embedded Controller
8*1537cf73SEmmanuel Vadot
9*1537cf73SEmmanuel Vadotmaintainers:
10*1537cf73SEmmanuel Vadot  - Benson Leung <bleung@chromium.org>
11*1537cf73SEmmanuel Vadot  - Guenter Roeck <groeck@chromium.org>
12*1537cf73SEmmanuel Vadot
13*1537cf73SEmmanuel Vadotdescription:
14*1537cf73SEmmanuel Vadot  Google's ChromeOS EC is a microcontroller which talks to the AP and
15*1537cf73SEmmanuel Vadot  implements various functions such as keyboard and battery charging.
16*1537cf73SEmmanuel Vadot  The EC can be connected through various interfaces (I2C, SPI, and others)
17*1537cf73SEmmanuel Vadot  and the compatible string specifies which interface is being used.
18*1537cf73SEmmanuel Vadot
19*1537cf73SEmmanuel Vadotproperties:
20*1537cf73SEmmanuel Vadot  compatible:
21*1537cf73SEmmanuel Vadot    oneOf:
22*1537cf73SEmmanuel Vadot      - description:
23*1537cf73SEmmanuel Vadot          For implementations of the EC connected through I2C.
24*1537cf73SEmmanuel Vadot        const: google,cros-ec-i2c
25*1537cf73SEmmanuel Vadot      - description:
26*1537cf73SEmmanuel Vadot          For implementations of the EC connected through SPI.
27*1537cf73SEmmanuel Vadot        const: google,cros-ec-spi
28*1537cf73SEmmanuel Vadot      - description:
29*1537cf73SEmmanuel Vadot          For implementations of the FPMCU connected through SPI.
30*1537cf73SEmmanuel Vadot        items:
31*1537cf73SEmmanuel Vadot          - const: google,cros-ec-fp
32*1537cf73SEmmanuel Vadot          - const: google,cros-ec-spi
33*1537cf73SEmmanuel Vadot      - description:
34*1537cf73SEmmanuel Vadot          For implementations of the EC connected through RPMSG.
35*1537cf73SEmmanuel Vadot        const: google,cros-ec-rpmsg
36*1537cf73SEmmanuel Vadot      - description:
37*1537cf73SEmmanuel Vadot          For implementations of the EC connected through UART.
38*1537cf73SEmmanuel Vadot        const: google,cros-ec-uart
39*1537cf73SEmmanuel Vadot
40*1537cf73SEmmanuel Vadot  controller-data: true
41*1537cf73SEmmanuel Vadot
42*1537cf73SEmmanuel Vadot  google,cros-ec-spi-pre-delay:
43*1537cf73SEmmanuel Vadot    description:
44*1537cf73SEmmanuel Vadot      This property specifies the delay in usecs between the
45*1537cf73SEmmanuel Vadot      assertion of the CS and the first clock pulse.
46*1537cf73SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
47*1537cf73SEmmanuel Vadot    default: 0
48*1537cf73SEmmanuel Vadot
49*1537cf73SEmmanuel Vadot  google,cros-ec-spi-msg-delay:
50*1537cf73SEmmanuel Vadot    description:
51*1537cf73SEmmanuel Vadot      This property specifies the delay in usecs between messages.
52*1537cf73SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
53*1537cf73SEmmanuel Vadot    default: 0
54*1537cf73SEmmanuel Vadot
55*1537cf73SEmmanuel Vadot  google,has-vbc-nvram:
56*1537cf73SEmmanuel Vadot    description:
57*1537cf73SEmmanuel Vadot      Some implementations of the EC include a small nvram space used to
58*1537cf73SEmmanuel Vadot      store verified boot context data. This boolean flag is used to specify
59*1537cf73SEmmanuel Vadot      whether this nvram is present or not.
60*1537cf73SEmmanuel Vadot    type: boolean
61*1537cf73SEmmanuel Vadot
62*1537cf73SEmmanuel Vadot  mediatek,rpmsg-name:
63*1537cf73SEmmanuel Vadot    description:
64*1537cf73SEmmanuel Vadot      Must be defined if the cros-ec is a rpmsg device for a Mediatek
65*1537cf73SEmmanuel Vadot      ARM Cortex M4 Co-processor. Contains the name of the rpmsg
66*1537cf73SEmmanuel Vadot      device. Used to match the subnode to the rpmsg device announced by
67*1537cf73SEmmanuel Vadot      the SCP.
68*1537cf73SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/string
69*1537cf73SEmmanuel Vadot
70*1537cf73SEmmanuel Vadot  spi-max-frequency: true
71*1537cf73SEmmanuel Vadot
72*1537cf73SEmmanuel Vadot  reg:
73*1537cf73SEmmanuel Vadot    maxItems: 1
74*1537cf73SEmmanuel Vadot
75*1537cf73SEmmanuel Vadot  interrupts:
76*1537cf73SEmmanuel Vadot    maxItems: 1
77*1537cf73SEmmanuel Vadot
78*1537cf73SEmmanuel Vadot  reset-gpios:
79*1537cf73SEmmanuel Vadot    maxItems: 1
80*1537cf73SEmmanuel Vadot
81*1537cf73SEmmanuel Vadot  boot0-gpios:
82*1537cf73SEmmanuel Vadot    maxItems: 1
83*1537cf73SEmmanuel Vadot    description: Assert for bootloader mode.
84*1537cf73SEmmanuel Vadot
85*1537cf73SEmmanuel Vadot  vdd-supply: true
86*1537cf73SEmmanuel Vadot
87*1537cf73SEmmanuel Vadot  wakeup-source:
88*1537cf73SEmmanuel Vadot    description: Button can wake-up the system.
89*1537cf73SEmmanuel Vadot
90*1537cf73SEmmanuel Vadot  '#address-cells':
91*1537cf73SEmmanuel Vadot    const: 1
92*1537cf73SEmmanuel Vadot
93*1537cf73SEmmanuel Vadot  '#size-cells':
94*1537cf73SEmmanuel Vadot    const: 0
95*1537cf73SEmmanuel Vadot
96*1537cf73SEmmanuel Vadot  '#gpio-cells':
97*1537cf73SEmmanuel Vadot    const: 2
98*1537cf73SEmmanuel Vadot
99*1537cf73SEmmanuel Vadot  gpio-controller: true
100*1537cf73SEmmanuel Vadot
101*1537cf73SEmmanuel Vadot  typec:
102*1537cf73SEmmanuel Vadot    $ref: /schemas/chrome/google,cros-ec-typec.yaml#
103*1537cf73SEmmanuel Vadot
104*1537cf73SEmmanuel Vadot  ec-pwm:
105*1537cf73SEmmanuel Vadot    $ref: /schemas/pwm/google,cros-ec-pwm.yaml#
106*1537cf73SEmmanuel Vadot    deprecated: true
107*1537cf73SEmmanuel Vadot
108*1537cf73SEmmanuel Vadot  pwm:
109*1537cf73SEmmanuel Vadot    $ref: /schemas/pwm/google,cros-ec-pwm.yaml#
110*1537cf73SEmmanuel Vadot
111*1537cf73SEmmanuel Vadot  keyboard-controller:
112*1537cf73SEmmanuel Vadot    $ref: /schemas/input/google,cros-ec-keyb.yaml#
113*1537cf73SEmmanuel Vadot
114*1537cf73SEmmanuel Vadot  proximity:
115*1537cf73SEmmanuel Vadot    $ref: /schemas/iio/proximity/google,cros-ec-mkbp-proximity.yaml#
116*1537cf73SEmmanuel Vadot
117*1537cf73SEmmanuel Vadot  codecs:
118*1537cf73SEmmanuel Vadot    type: object
119*1537cf73SEmmanuel Vadot    additionalProperties: false
120*1537cf73SEmmanuel Vadot
121*1537cf73SEmmanuel Vadot    properties:
122*1537cf73SEmmanuel Vadot      '#address-cells':
123*1537cf73SEmmanuel Vadot        const: 2
124*1537cf73SEmmanuel Vadot
125*1537cf73SEmmanuel Vadot      '#size-cells':
126*1537cf73SEmmanuel Vadot        const: 1
127*1537cf73SEmmanuel Vadot
128*1537cf73SEmmanuel Vadot    patternProperties:
129*1537cf73SEmmanuel Vadot      "^ec-codec@[a-f0-9]+$":
130*1537cf73SEmmanuel Vadot        type: object
131*1537cf73SEmmanuel Vadot        $ref: /schemas/sound/google,cros-ec-codec.yaml#
132*1537cf73SEmmanuel Vadot
133*1537cf73SEmmanuel Vadot    required:
134*1537cf73SEmmanuel Vadot      - "#address-cells"
135*1537cf73SEmmanuel Vadot      - "#size-cells"
136*1537cf73SEmmanuel Vadot
137*1537cf73SEmmanuel Vadot  cbas:
138*1537cf73SEmmanuel Vadot    type: object
139*1537cf73SEmmanuel Vadot
140*1537cf73SEmmanuel Vadot    description:
141*1537cf73SEmmanuel Vadot      This device is used to signal when a detachable base is attached
142*1537cf73SEmmanuel Vadot      to a Chrome OS tablet. This device cannot be detected at runtime.
143*1537cf73SEmmanuel Vadot
144*1537cf73SEmmanuel Vadot    properties:
145*1537cf73SEmmanuel Vadot      compatible:
146*1537cf73SEmmanuel Vadot        const: google,cros-cbas
147*1537cf73SEmmanuel Vadot
148*1537cf73SEmmanuel Vadot    required:
149*1537cf73SEmmanuel Vadot      - compatible
150*1537cf73SEmmanuel Vadot
151*1537cf73SEmmanuel Vadot    additionalProperties: false
152*1537cf73SEmmanuel Vadot
153*1537cf73SEmmanuel VadotpatternProperties:
154*1537cf73SEmmanuel Vadot  "^i2c-tunnel[0-9]*$":
155*1537cf73SEmmanuel Vadot    type: object
156*1537cf73SEmmanuel Vadot    $ref: /schemas/i2c/google,cros-ec-i2c-tunnel.yaml#
157*1537cf73SEmmanuel Vadot
158*1537cf73SEmmanuel Vadot  "^regulator@[0-9]+$":
159*1537cf73SEmmanuel Vadot    type: object
160*1537cf73SEmmanuel Vadot    $ref: /schemas/regulator/google,cros-ec-regulator.yaml#
161*1537cf73SEmmanuel Vadot
162*1537cf73SEmmanuel Vadot  "^extcon[0-9]*$":
163*1537cf73SEmmanuel Vadot    type: object
164*1537cf73SEmmanuel Vadot    $ref: /schemas/extcon/extcon-usbc-cros-ec.yaml#
165*1537cf73SEmmanuel Vadot
166*1537cf73SEmmanuel Vadotrequired:
167*1537cf73SEmmanuel Vadot  - compatible
168*1537cf73SEmmanuel Vadot
169*1537cf73SEmmanuel VadotallOf:
170*1537cf73SEmmanuel Vadot  - if:
171*1537cf73SEmmanuel Vadot      properties:
172*1537cf73SEmmanuel Vadot        compatible:
173*1537cf73SEmmanuel Vadot          not:
174*1537cf73SEmmanuel Vadot            contains:
175*1537cf73SEmmanuel Vadot              const: google,cros-ec-spi
176*1537cf73SEmmanuel Vadot    then:
177*1537cf73SEmmanuel Vadot      properties:
178*1537cf73SEmmanuel Vadot        controller-data: false
179*1537cf73SEmmanuel Vadot        google,cros-ec-spi-pre-delay: false
180*1537cf73SEmmanuel Vadot        google,cros-ec-spi-msg-delay: false
181*1537cf73SEmmanuel Vadot        spi-max-frequency: false
182*1537cf73SEmmanuel Vadot    else:
183*1537cf73SEmmanuel Vadot      $ref: /schemas/spi/spi-peripheral-props.yaml
184*1537cf73SEmmanuel Vadot
185*1537cf73SEmmanuel Vadot  - if:
186*1537cf73SEmmanuel Vadot      properties:
187*1537cf73SEmmanuel Vadot        compatible:
188*1537cf73SEmmanuel Vadot          not:
189*1537cf73SEmmanuel Vadot            contains:
190*1537cf73SEmmanuel Vadot              const: google,cros-ec-rpmsg
191*1537cf73SEmmanuel Vadot    then:
192*1537cf73SEmmanuel Vadot      properties:
193*1537cf73SEmmanuel Vadot        mediatek,rpmsg-name: false
194*1537cf73SEmmanuel Vadot
195*1537cf73SEmmanuel Vadot  - if:
196*1537cf73SEmmanuel Vadot      properties:
197*1537cf73SEmmanuel Vadot        compatible:
198*1537cf73SEmmanuel Vadot          not:
199*1537cf73SEmmanuel Vadot            contains:
200*1537cf73SEmmanuel Vadot              enum:
201*1537cf73SEmmanuel Vadot                - google,cros-ec-rpmsg
202*1537cf73SEmmanuel Vadot                - google,cros-ec-uart
203*1537cf73SEmmanuel Vadot    then:
204*1537cf73SEmmanuel Vadot      required:
205*1537cf73SEmmanuel Vadot        - reg
206*1537cf73SEmmanuel Vadot        - interrupts
207*1537cf73SEmmanuel Vadot
208*1537cf73SEmmanuel Vadot  - if:
209*1537cf73SEmmanuel Vadot      properties:
210*1537cf73SEmmanuel Vadot        compatible:
211*1537cf73SEmmanuel Vadot          contains:
212*1537cf73SEmmanuel Vadot            const: google,cros-ec-fp
213*1537cf73SEmmanuel Vadot    then:
214*1537cf73SEmmanuel Vadot      properties:
215*1537cf73SEmmanuel Vadot        '#address-cells': false
216*1537cf73SEmmanuel Vadot        '#size-cells': false
217*1537cf73SEmmanuel Vadot        typec: false
218*1537cf73SEmmanuel Vadot        ec-pwm: false
219*1537cf73SEmmanuel Vadot        kbd-led-backlight: false
220*1537cf73SEmmanuel Vadot        keyboard-controller: false
221*1537cf73SEmmanuel Vadot        proximity: false
222*1537cf73SEmmanuel Vadot        codecs: false
223*1537cf73SEmmanuel Vadot        cbas: false
224*1537cf73SEmmanuel Vadot
225*1537cf73SEmmanuel Vadot      patternProperties:
226*1537cf73SEmmanuel Vadot        "^i2c-tunnel[0-9]*$": false
227*1537cf73SEmmanuel Vadot        "^regulator@[0-9]+$": false
228*1537cf73SEmmanuel Vadot        "^extcon[0-9]*$": false
229*1537cf73SEmmanuel Vadot
230*1537cf73SEmmanuel Vadot      # Using additionalProperties: false here and
231*1537cf73SEmmanuel Vadot      # listing true properties doesn't work
232*1537cf73SEmmanuel Vadot
233*1537cf73SEmmanuel Vadot      required:
234*1537cf73SEmmanuel Vadot        - reset-gpios
235*1537cf73SEmmanuel Vadot        - boot0-gpios
236*1537cf73SEmmanuel Vadot        - vdd-supply
237*1537cf73SEmmanuel Vadot    else:
238*1537cf73SEmmanuel Vadot      properties:
239*1537cf73SEmmanuel Vadot        reset-gpios: false
240*1537cf73SEmmanuel Vadot        boot0-gpios: false
241*1537cf73SEmmanuel Vadot        vdd-supply: false
242*1537cf73SEmmanuel Vadot
243*1537cf73SEmmanuel VadotadditionalProperties: false
244*1537cf73SEmmanuel Vadot
245*1537cf73SEmmanuel Vadotexamples:
246*1537cf73SEmmanuel Vadot  # Example for I2C
247*1537cf73SEmmanuel Vadot  - |
248*1537cf73SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
249*1537cf73SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
250*1537cf73SEmmanuel Vadot
251*1537cf73SEmmanuel Vadot    i2c {
252*1537cf73SEmmanuel Vadot        #address-cells = <1>;
253*1537cf73SEmmanuel Vadot        #size-cells = <0>;
254*1537cf73SEmmanuel Vadot
255*1537cf73SEmmanuel Vadot        cros-ec@1e {
256*1537cf73SEmmanuel Vadot            compatible = "google,cros-ec-i2c";
257*1537cf73SEmmanuel Vadot            reg = <0x1e>;
258*1537cf73SEmmanuel Vadot            interrupts = <6 0>;
259*1537cf73SEmmanuel Vadot            interrupt-parent = <&gpio0>;
260*1537cf73SEmmanuel Vadot        };
261*1537cf73SEmmanuel Vadot    };
262*1537cf73SEmmanuel Vadot
263*1537cf73SEmmanuel Vadot  # Example for SPI
264*1537cf73SEmmanuel Vadot  - |
265*1537cf73SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
266*1537cf73SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
267*1537cf73SEmmanuel Vadot
268*1537cf73SEmmanuel Vadot    spi {
269*1537cf73SEmmanuel Vadot        #address-cells = <1>;
270*1537cf73SEmmanuel Vadot        #size-cells = <0>;
271*1537cf73SEmmanuel Vadot
272*1537cf73SEmmanuel Vadot        cros-ec@0 {
273*1537cf73SEmmanuel Vadot            compatible = "google,cros-ec-spi";
274*1537cf73SEmmanuel Vadot            reg = <0x0>;
275*1537cf73SEmmanuel Vadot            google,cros-ec-spi-msg-delay = <30>;
276*1537cf73SEmmanuel Vadot            google,cros-ec-spi-pre-delay = <10>;
277*1537cf73SEmmanuel Vadot            interrupts = <99 0>;
278*1537cf73SEmmanuel Vadot            interrupt-parent = <&gpio7>;
279*1537cf73SEmmanuel Vadot            spi-max-frequency = <5000000>;
280*1537cf73SEmmanuel Vadot            #gpio-cells = <2>;
281*1537cf73SEmmanuel Vadot            gpio-controller;
282*1537cf73SEmmanuel Vadot
283*1537cf73SEmmanuel Vadot            proximity {
284*1537cf73SEmmanuel Vadot                compatible = "google,cros-ec-mkbp-proximity";
285*1537cf73SEmmanuel Vadot            };
286*1537cf73SEmmanuel Vadot
287*1537cf73SEmmanuel Vadot            cbas {
288*1537cf73SEmmanuel Vadot                compatible = "google,cros-cbas";
289*1537cf73SEmmanuel Vadot            };
290*1537cf73SEmmanuel Vadot        };
291*1537cf73SEmmanuel Vadot    };
292*1537cf73SEmmanuel Vadot
293*1537cf73SEmmanuel Vadot  # Example for RPMSG
294*1537cf73SEmmanuel Vadot  - |
295*1537cf73SEmmanuel Vadot    scp0 {
296*1537cf73SEmmanuel Vadot        cros-ec {
297*1537cf73SEmmanuel Vadot            compatible = "google,cros-ec-rpmsg";
298*1537cf73SEmmanuel Vadot        };
299*1537cf73SEmmanuel Vadot    };
300*1537cf73SEmmanuel Vadot
301*1537cf73SEmmanuel Vadot  # Example for FPMCU
302*1537cf73SEmmanuel Vadot  - |
303*1537cf73SEmmanuel Vadot    spi {
304*1537cf73SEmmanuel Vadot      #address-cells = <0x1>;
305*1537cf73SEmmanuel Vadot      #size-cells = <0x0>;
306*1537cf73SEmmanuel Vadot
307*1537cf73SEmmanuel Vadot      ec@0 {
308*1537cf73SEmmanuel Vadot        compatible = "google,cros-ec-fp", "google,cros-ec-spi";
309*1537cf73SEmmanuel Vadot        reg = <0x0>;
310*1537cf73SEmmanuel Vadot        interrupt-parent = <&gpio_controller>;
311*1537cf73SEmmanuel Vadot        interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
312*1537cf73SEmmanuel Vadot        spi-max-frequency = <3000000>;
313*1537cf73SEmmanuel Vadot        reset-gpios = <&gpio_controller 5 GPIO_ACTIVE_LOW>;
314*1537cf73SEmmanuel Vadot        boot0-gpios = <&gpio_controller 10 GPIO_ACTIVE_HIGH>;
315*1537cf73SEmmanuel Vadot        vdd-supply = <&pp3300_fp_mcu>;
316*1537cf73SEmmanuel Vadot      };
317*1537cf73SEmmanuel Vadot    };
318*1537cf73SEmmanuel Vadot
319*1537cf73SEmmanuel Vadot  # Example for UART
320*1537cf73SEmmanuel Vadot  - |
321*1537cf73SEmmanuel Vadot    serial {
322*1537cf73SEmmanuel Vadot        cros-ec {
323*1537cf73SEmmanuel Vadot            compatible = "google,cros-ec-uart";
324*1537cf73SEmmanuel Vadot        };
325*1537cf73SEmmanuel Vadot    };
326*1537cf73SEmmanuel Vadot...
327