xref: /linux/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml (revision 1260ed77798502de9c98020040d2995008de10cc)
146b57806SIkjoon Jang# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
246b57806SIkjoon Jang%YAML 1.2
346b57806SIkjoon Jang---
446b57806SIkjoon Jang$id: http://devicetree.org/schemas/mfd/google,cros-ec.yaml#
546b57806SIkjoon Jang$schema: http://devicetree.org/meta-schemas/core.yaml#
646b57806SIkjoon Jang
746b57806SIkjoon Jangtitle: ChromeOS Embedded Controller
846b57806SIkjoon Jang
946b57806SIkjoon Jangmaintainers:
1046b57806SIkjoon Jang  - Benson Leung <bleung@chromium.org>
1146b57806SIkjoon Jang  - Guenter Roeck <groeck@chromium.org>
1246b57806SIkjoon Jang
1346b57806SIkjoon Jangdescription:
1446b57806SIkjoon Jang  Google's ChromeOS EC is a microcontroller which talks to the AP and
1546b57806SIkjoon Jang  implements various functions such as keyboard and battery charging.
1646b57806SIkjoon Jang  The EC can be connected through various interfaces (I2C, SPI, and others)
1746b57806SIkjoon Jang  and the compatible string specifies which interface is being used.
1846b57806SIkjoon Jang
1946b57806SIkjoon Jangproperties:
2046b57806SIkjoon Jang  compatible:
2146b57806SIkjoon Jang    oneOf:
2246b57806SIkjoon Jang      - description:
237a2f3682SStephen Boyd          For implementations of the EC connected through I2C.
2446b57806SIkjoon Jang        const: google,cros-ec-i2c
2546b57806SIkjoon Jang      - description:
267a2f3682SStephen Boyd          For implementations of the EC connected through SPI.
2746b57806SIkjoon Jang        const: google,cros-ec-spi
2846b57806SIkjoon Jang      - description:
29e068bc0bSStephen Boyd          For implementations of the FPMCU connected through SPI.
30e068bc0bSStephen Boyd        items:
31e068bc0bSStephen Boyd          - const: google,cros-ec-fp
32e068bc0bSStephen Boyd          - const: google,cros-ec-spi
33e068bc0bSStephen Boyd      - description:
347a2f3682SStephen Boyd          For implementations of the EC connected through RPMSG.
3546b57806SIkjoon Jang        const: google,cros-ec-rpmsg
360c8884feSBhanu Prakash Maiya      - description:
370c8884feSBhanu Prakash Maiya          For implementations of the EC connected through UART.
380c8884feSBhanu Prakash Maiya        const: google,cros-ec-uart
3946b57806SIkjoon Jang
407a2f3682SStephen Boyd  controller-data: true
415d7fb8b8SKrzysztof Kozlowski
4246b57806SIkjoon Jang  google,cros-ec-spi-pre-delay:
4346b57806SIkjoon Jang    description:
4446b57806SIkjoon Jang      This property specifies the delay in usecs between the
4546b57806SIkjoon Jang      assertion of the CS and the first clock pulse.
46dca66935SRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
47dca66935SRob Herring    default: 0
4846b57806SIkjoon Jang
4946b57806SIkjoon Jang  google,cros-ec-spi-msg-delay:
5046b57806SIkjoon Jang    description:
5146b57806SIkjoon Jang      This property specifies the delay in usecs between messages.
52dca66935SRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
53dca66935SRob Herring    default: 0
5446b57806SIkjoon Jang
5546b57806SIkjoon Jang  google,has-vbc-nvram:
5646b57806SIkjoon Jang    description:
5746b57806SIkjoon Jang      Some implementations of the EC include a small nvram space used to
5846b57806SIkjoon Jang      store verified boot context data. This boolean flag is used to specify
5946b57806SIkjoon Jang      whether this nvram is present or not.
6046b57806SIkjoon Jang    type: boolean
6146b57806SIkjoon Jang
62e565615cSMatthias Brugger  mediatek,rpmsg-name:
635c024e68SRicardo Cañuelo    description:
645c024e68SRicardo Cañuelo      Must be defined if the cros-ec is a rpmsg device for a Mediatek
65f93afd8eSStephen Boyd      ARM Cortex M4 Co-processor. Contains the name of the rpmsg
665c024e68SRicardo Cañuelo      device. Used to match the subnode to the rpmsg device announced by
675c024e68SRicardo Cañuelo      the SCP.
689896a19cSRob Herring    $ref: /schemas/types.yaml#/definitions/string
695c024e68SRicardo Cañuelo
707a2f3682SStephen Boyd  spi-max-frequency: true
7146b57806SIkjoon Jang
7246b57806SIkjoon Jang  reg:
7346b57806SIkjoon Jang    maxItems: 1
7446b57806SIkjoon Jang
7546b57806SIkjoon Jang  interrupts:
7646b57806SIkjoon Jang    maxItems: 1
7746b57806SIkjoon Jang
78e068bc0bSStephen Boyd  reset-gpios:
79e068bc0bSStephen Boyd    maxItems: 1
80e068bc0bSStephen Boyd
81e068bc0bSStephen Boyd  boot0-gpios:
82e068bc0bSStephen Boyd    maxItems: 1
83e068bc0bSStephen Boyd    description: Assert for bootloader mode.
84e068bc0bSStephen Boyd
85e068bc0bSStephen Boyd  vdd-supply: true
86e068bc0bSStephen Boyd
875d7fb8b8SKrzysztof Kozlowski  wakeup-source:
885d7fb8b8SKrzysztof Kozlowski    description: Button can wake-up the system.
895d7fb8b8SKrzysztof Kozlowski
905c024e68SRicardo Cañuelo  '#address-cells':
915c024e68SRicardo Cañuelo    const: 1
925c024e68SRicardo Cañuelo
935c024e68SRicardo Cañuelo  '#size-cells':
945c024e68SRicardo Cañuelo    const: 0
955c024e68SRicardo Cañuelo
967b79740dSStephen Boyd  '#gpio-cells':
977b79740dSStephen Boyd    const: 2
987b79740dSStephen Boyd
997b79740dSStephen Boyd  gpio-controller: true
1007b79740dSStephen Boyd
1015c024e68SRicardo Cañuelo  typec:
1029896a19cSRob Herring    $ref: /schemas/chrome/google,cros-ec-typec.yaml#
1035c024e68SRicardo Cañuelo
1045c024e68SRicardo Cañuelo  ec-pwm:
1059896a19cSRob Herring    $ref: /schemas/pwm/google,cros-ec-pwm.yaml#
1066b94ee66SKrzysztof Kozlowski    deprecated: true
1076b94ee66SKrzysztof Kozlowski
1086b94ee66SKrzysztof Kozlowski  pwm:
1099896a19cSRob Herring    $ref: /schemas/pwm/google,cros-ec-pwm.yaml#
1105c024e68SRicardo Cañuelo
11150d68feeSRicardo Cañuelo  keyboard-controller:
1129896a19cSRob Herring    $ref: /schemas/input/google,cros-ec-keyb.yaml#
11350d68feeSRicardo Cañuelo
11419ad93bcSStephen Boyd  proximity:
1159896a19cSRob Herring    $ref: /schemas/iio/proximity/google,cros-ec-mkbp-proximity.yaml#
11619ad93bcSStephen Boyd
1175c024e68SRicardo Cañuelo  codecs:
1185c024e68SRicardo Cañuelo    type: object
1195c024e68SRicardo Cañuelo    additionalProperties: false
1205c024e68SRicardo Cañuelo
1215c024e68SRicardo Cañuelo    properties:
1225c024e68SRicardo Cañuelo      '#address-cells':
1235c024e68SRicardo Cañuelo        const: 2
1245c024e68SRicardo Cañuelo
1255c024e68SRicardo Cañuelo      '#size-cells':
1265c024e68SRicardo Cañuelo        const: 1
1275c024e68SRicardo Cañuelo
1285c024e68SRicardo Cañuelo    patternProperties:
1295c024e68SRicardo Cañuelo      "^ec-codec@[a-f0-9]+$":
1305c024e68SRicardo Cañuelo        type: object
1319896a19cSRob Herring        $ref: /schemas/sound/google,cros-ec-codec.yaml#
1325c024e68SRicardo Cañuelo
1335c024e68SRicardo Cañuelo    required:
1345c024e68SRicardo Cañuelo      - "#address-cells"
1355c024e68SRicardo Cañuelo      - "#size-cells"
1365c024e68SRicardo Cañuelo
13780cf16deSIkjoon Jang  cbas:
13880cf16deSIkjoon Jang    type: object
13980cf16deSIkjoon Jang
14080cf16deSIkjoon Jang    description:
14180cf16deSIkjoon Jang      This device is used to signal when a detachable base is attached
14280cf16deSIkjoon Jang      to a Chrome OS tablet. This device cannot be detected at runtime.
14380cf16deSIkjoon Jang
14480cf16deSIkjoon Jang    properties:
14580cf16deSIkjoon Jang      compatible:
14680cf16deSIkjoon Jang        const: google,cros-cbas
14780cf16deSIkjoon Jang
14880cf16deSIkjoon Jang    required:
14980cf16deSIkjoon Jang      - compatible
15080cf16deSIkjoon Jang
15180cf16deSIkjoon Jang    additionalProperties: false
15280cf16deSIkjoon Jang
1531acd4577SRicardo CañuelopatternProperties:
1541acd4577SRicardo Cañuelo  "^i2c-tunnel[0-9]*$":
1551acd4577SRicardo Cañuelo    type: object
1569896a19cSRob Herring    $ref: /schemas/i2c/google,cros-ec-i2c-tunnel.yaml#
1571acd4577SRicardo Cañuelo
1585c024e68SRicardo Cañuelo  "^regulator@[0-9]+$":
1595c024e68SRicardo Cañuelo    type: object
1609896a19cSRob Herring    $ref: /schemas/regulator/google,cros-ec-regulator.yaml#
1615c024e68SRicardo Cañuelo
1625c024e68SRicardo Cañuelo  "^extcon[0-9]*$":
1635c024e68SRicardo Cañuelo    type: object
1649896a19cSRob Herring    $ref: /schemas/extcon/extcon-usbc-cros-ec.yaml#
1655c024e68SRicardo Cañuelo
16646b57806SIkjoon Jangrequired:
16746b57806SIkjoon Jang  - compatible
16846b57806SIkjoon Jang
169f412fe11SKrzysztof KozlowskiallOf:
170f412fe11SKrzysztof Kozlowski  - if:
17146b57806SIkjoon Jang      properties:
17246b57806SIkjoon Jang        compatible:
1737a2f3682SStephen Boyd          not:
17446b57806SIkjoon Jang            contains:
1757a2f3682SStephen Boyd              const: google,cros-ec-spi
17646b57806SIkjoon Jang    then:
17746b57806SIkjoon Jang      properties:
1787a2f3682SStephen Boyd        controller-data: false
17946b57806SIkjoon Jang        google,cros-ec-spi-pre-delay: false
18046b57806SIkjoon Jang        google,cros-ec-spi-msg-delay: false
18146b57806SIkjoon Jang        spi-max-frequency: false
182f412fe11SKrzysztof Kozlowski    else:
183f412fe11SKrzysztof Kozlowski      $ref: /schemas/spi/spi-peripheral-props.yaml
18446b57806SIkjoon Jang
1857a2f3682SStephen Boyd  - if:
1867a2f3682SStephen Boyd      properties:
1877a2f3682SStephen Boyd        compatible:
1887a2f3682SStephen Boyd          not:
1897a2f3682SStephen Boyd            contains:
1907a2f3682SStephen Boyd              const: google,cros-ec-rpmsg
1917a2f3682SStephen Boyd    then:
1927a2f3682SStephen Boyd      properties:
1937a2f3682SStephen Boyd        mediatek,rpmsg-name: false
1947a2f3682SStephen Boyd
1950c8884feSBhanu Prakash Maiya  - if:
1960c8884feSBhanu Prakash Maiya      properties:
1970c8884feSBhanu Prakash Maiya        compatible:
1980c8884feSBhanu Prakash Maiya          not:
1990c8884feSBhanu Prakash Maiya            contains:
2000c8884feSBhanu Prakash Maiya              enum:
2010c8884feSBhanu Prakash Maiya                - google,cros-ec-rpmsg
2020c8884feSBhanu Prakash Maiya                - google,cros-ec-uart
2030c8884feSBhanu Prakash Maiya    then:
2047a2f3682SStephen Boyd      required:
2057a2f3682SStephen Boyd        - reg
2067a2f3682SStephen Boyd        - interrupts
2077a2f3682SStephen Boyd
208e068bc0bSStephen Boyd  - if:
209e068bc0bSStephen Boyd      properties:
210e068bc0bSStephen Boyd        compatible:
211e068bc0bSStephen Boyd          contains:
212e068bc0bSStephen Boyd            const: google,cros-ec-fp
213e068bc0bSStephen Boyd    then:
214e068bc0bSStephen Boyd      properties:
215e068bc0bSStephen Boyd        '#address-cells': false
216e068bc0bSStephen Boyd        '#size-cells': false
217e068bc0bSStephen Boyd        typec: false
218e068bc0bSStephen Boyd        ec-pwm: false
219e068bc0bSStephen Boyd        kbd-led-backlight: false
220e068bc0bSStephen Boyd        keyboard-controller: false
221e068bc0bSStephen Boyd        proximity: false
222e068bc0bSStephen Boyd        codecs: false
223e068bc0bSStephen Boyd        cbas: false
224e068bc0bSStephen Boyd
225e068bc0bSStephen Boyd      patternProperties:
226e068bc0bSStephen Boyd        "^i2c-tunnel[0-9]*$": false
227e068bc0bSStephen Boyd        "^regulator@[0-9]+$": false
228e068bc0bSStephen Boyd        "^extcon[0-9]*$": false
229e068bc0bSStephen Boyd
230e068bc0bSStephen Boyd      # Using additionalProperties: false here and
231e068bc0bSStephen Boyd      # listing true properties doesn't work
232e068bc0bSStephen Boyd
233e068bc0bSStephen Boyd      required:
234e068bc0bSStephen Boyd        - reset-gpios
235e068bc0bSStephen Boyd        - boot0-gpios
236e068bc0bSStephen Boyd        - vdd-supply
237e068bc0bSStephen Boyd    else:
238e068bc0bSStephen Boyd      properties:
239e068bc0bSStephen Boyd        reset-gpios: false
240e068bc0bSStephen Boyd        boot0-gpios: false
241e068bc0bSStephen Boyd        vdd-supply: false
242e068bc0bSStephen Boyd
24346b57806SIkjoon JangadditionalProperties: false
24446b57806SIkjoon Jang
24546b57806SIkjoon Jangexamples:
24646b57806SIkjoon Jang  # Example for I2C
24746b57806SIkjoon Jang  - |
24846b57806SIkjoon Jang    #include <dt-bindings/gpio/gpio.h>
24946b57806SIkjoon Jang    #include <dt-bindings/interrupt-controller/irq.h>
25046b57806SIkjoon Jang
25120a72af1SRob Herring    i2c {
25246b57806SIkjoon Jang        #address-cells = <1>;
25346b57806SIkjoon Jang        #size-cells = <0>;
25446b57806SIkjoon Jang
25546b57806SIkjoon Jang        cros-ec@1e {
25646b57806SIkjoon Jang            compatible = "google,cros-ec-i2c";
25746b57806SIkjoon Jang            reg = <0x1e>;
25846b57806SIkjoon Jang            interrupts = <6 0>;
25946b57806SIkjoon Jang            interrupt-parent = <&gpio0>;
26046b57806SIkjoon Jang        };
26146b57806SIkjoon Jang    };
26246b57806SIkjoon Jang
26346b57806SIkjoon Jang  # Example for SPI
26446b57806SIkjoon Jang  - |
26546b57806SIkjoon Jang    #include <dt-bindings/gpio/gpio.h>
26646b57806SIkjoon Jang    #include <dt-bindings/interrupt-controller/irq.h>
26746b57806SIkjoon Jang
26820a72af1SRob Herring    spi {
26946b57806SIkjoon Jang        #address-cells = <1>;
27046b57806SIkjoon Jang        #size-cells = <0>;
27146b57806SIkjoon Jang
27246b57806SIkjoon Jang        cros-ec@0 {
27346b57806SIkjoon Jang            compatible = "google,cros-ec-spi";
27446b57806SIkjoon Jang            reg = <0x0>;
27546b57806SIkjoon Jang            google,cros-ec-spi-msg-delay = <30>;
27646b57806SIkjoon Jang            google,cros-ec-spi-pre-delay = <10>;
27746b57806SIkjoon Jang            interrupts = <99 0>;
27846b57806SIkjoon Jang            interrupt-parent = <&gpio7>;
27946b57806SIkjoon Jang            spi-max-frequency = <5000000>;
2807b79740dSStephen Boyd            #gpio-cells = <2>;
2817b79740dSStephen Boyd            gpio-controller;
28219ad93bcSStephen Boyd
28319ad93bcSStephen Boyd            proximity {
28419ad93bcSStephen Boyd                compatible = "google,cros-ec-mkbp-proximity";
28519ad93bcSStephen Boyd            };
28680cf16deSIkjoon Jang
28780cf16deSIkjoon Jang            cbas {
28880cf16deSIkjoon Jang                compatible = "google,cros-cbas";
28980cf16deSIkjoon Jang            };
29046b57806SIkjoon Jang        };
29146b57806SIkjoon Jang    };
29246b57806SIkjoon Jang
29346b57806SIkjoon Jang  # Example for RPMSG
29446b57806SIkjoon Jang  - |
29546b57806SIkjoon Jang    scp0 {
29646b57806SIkjoon Jang        cros-ec {
29746b57806SIkjoon Jang            compatible = "google,cros-ec-rpmsg";
29846b57806SIkjoon Jang        };
29946b57806SIkjoon Jang    };
300e068bc0bSStephen Boyd
301e068bc0bSStephen Boyd  # Example for FPMCU
302e068bc0bSStephen Boyd  - |
30320a72af1SRob Herring    spi {
304e068bc0bSStephen Boyd      #address-cells = <0x1>;
305e068bc0bSStephen Boyd      #size-cells = <0x0>;
306e068bc0bSStephen Boyd
307e068bc0bSStephen Boyd      ec@0 {
308e068bc0bSStephen Boyd        compatible = "google,cros-ec-fp", "google,cros-ec-spi";
309e068bc0bSStephen Boyd        reg = <0x0>;
310e068bc0bSStephen Boyd        interrupt-parent = <&gpio_controller>;
311e068bc0bSStephen Boyd        interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
312e068bc0bSStephen Boyd        spi-max-frequency = <3000000>;
313e068bc0bSStephen Boyd        reset-gpios = <&gpio_controller 5 GPIO_ACTIVE_LOW>;
314e068bc0bSStephen Boyd        boot0-gpios = <&gpio_controller 10 GPIO_ACTIVE_HIGH>;
315e068bc0bSStephen Boyd        vdd-supply = <&pp3300_fp_mcu>;
316e068bc0bSStephen Boyd      };
317e068bc0bSStephen Boyd    };
3180c8884feSBhanu Prakash Maiya
3190c8884feSBhanu Prakash Maiya  # Example for UART
3200c8884feSBhanu Prakash Maiya  - |
3210c8884feSBhanu Prakash Maiya    serial {
3220c8884feSBhanu Prakash Maiya        cros-ec {
3230c8884feSBhanu Prakash Maiya            compatible = "google,cros-ec-uart";
3240c8884feSBhanu Prakash Maiya        };
3250c8884feSBhanu Prakash Maiya    };
32646b57806SIkjoon Jang...
327