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  - Enric Balletbo i Serra <enric.balletbo@collabora.com>
1246b57806SIkjoon Jang  - Guenter Roeck <groeck@chromium.org>
1346b57806SIkjoon Jang
1446b57806SIkjoon Jangdescription:
1546b57806SIkjoon Jang  Google's ChromeOS EC is a microcontroller which talks to the AP and
1646b57806SIkjoon Jang  implements various functions such as keyboard and battery charging.
1746b57806SIkjoon Jang  The EC can be connected through various interfaces (I2C, SPI, and others)
1846b57806SIkjoon Jang  and the compatible string specifies which interface is being used.
1946b57806SIkjoon Jang
2046b57806SIkjoon Jangproperties:
2146b57806SIkjoon Jang  compatible:
2246b57806SIkjoon Jang    oneOf:
2346b57806SIkjoon Jang      - description:
2446b57806SIkjoon Jang          For implementations of the EC is connected through I2C.
2546b57806SIkjoon Jang        const: google,cros-ec-i2c
2646b57806SIkjoon Jang      - description:
2746b57806SIkjoon Jang          For implementations of the EC is connected through SPI.
2846b57806SIkjoon Jang        const: google,cros-ec-spi
2946b57806SIkjoon Jang      - description:
3046b57806SIkjoon Jang          For implementations of the EC is connected through RPMSG.
3146b57806SIkjoon Jang        const: google,cros-ec-rpmsg
3246b57806SIkjoon Jang
335d7fb8b8SKrzysztof Kozlowski  controller-data:
345d7fb8b8SKrzysztof Kozlowski    description:
355d7fb8b8SKrzysztof Kozlowski      SPI controller data, see bindings/spi/spi-samsung.txt
365d7fb8b8SKrzysztof Kozlowski    type: object
375d7fb8b8SKrzysztof Kozlowski
3846b57806SIkjoon Jang  google,cros-ec-spi-pre-delay:
3946b57806SIkjoon Jang    description:
4046b57806SIkjoon Jang      This property specifies the delay in usecs between the
4146b57806SIkjoon Jang      assertion of the CS and the first clock pulse.
4246b57806SIkjoon Jang    allOf:
4346b57806SIkjoon Jang      - $ref: /schemas/types.yaml#/definitions/uint32
4446b57806SIkjoon Jang      - default: 0
4546b57806SIkjoon Jang      - minimum: 0
4646b57806SIkjoon Jang
4746b57806SIkjoon Jang  google,cros-ec-spi-msg-delay:
4846b57806SIkjoon Jang    description:
4946b57806SIkjoon Jang      This property specifies the delay in usecs between messages.
5046b57806SIkjoon Jang    allOf:
5146b57806SIkjoon Jang      - $ref: /schemas/types.yaml#/definitions/uint32
5246b57806SIkjoon Jang      - default: 0
5346b57806SIkjoon Jang      - minimum: 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
6246b57806SIkjoon Jang  spi-max-frequency:
6346b57806SIkjoon Jang    description: Maximum SPI frequency of the device in Hz.
6446b57806SIkjoon Jang
6546b57806SIkjoon Jang  reg:
6646b57806SIkjoon Jang    maxItems: 1
6746b57806SIkjoon Jang
6846b57806SIkjoon Jang  interrupts:
6946b57806SIkjoon Jang    maxItems: 1
7046b57806SIkjoon Jang
715d7fb8b8SKrzysztof Kozlowski  wakeup-source:
725d7fb8b8SKrzysztof Kozlowski    description: Button can wake-up the system.
735d7fb8b8SKrzysztof Kozlowski
7446b57806SIkjoon Jangrequired:
7546b57806SIkjoon Jang  - compatible
7646b57806SIkjoon Jang
7746b57806SIkjoon Jangif:
7846b57806SIkjoon Jang  properties:
7946b57806SIkjoon Jang    compatible:
8046b57806SIkjoon Jang      contains:
8146b57806SIkjoon Jang        enum:
8246b57806SIkjoon Jang          - google,cros-ec-i2c
8346b57806SIkjoon Jang          - google,cros-ec-rpmsg
8446b57806SIkjoon Jangthen:
8546b57806SIkjoon Jang  properties:
8646b57806SIkjoon Jang    google,cros-ec-spi-pre-delay: false
8746b57806SIkjoon Jang    google,cros-ec-spi-msg-delay: false
8846b57806SIkjoon Jang    spi-max-frequency: false
8946b57806SIkjoon Jang
9046b57806SIkjoon JangadditionalProperties: false
9146b57806SIkjoon Jang
9246b57806SIkjoon Jangexamples:
9346b57806SIkjoon Jang  # Example for I2C
9446b57806SIkjoon Jang  - |
9546b57806SIkjoon Jang    #include <dt-bindings/gpio/gpio.h>
9646b57806SIkjoon Jang    #include <dt-bindings/interrupt-controller/irq.h>
9746b57806SIkjoon Jang
9846b57806SIkjoon Jang    i2c0 {
9946b57806SIkjoon Jang        #address-cells = <1>;
10046b57806SIkjoon Jang        #size-cells = <0>;
10146b57806SIkjoon Jang
10246b57806SIkjoon Jang        cros-ec@1e {
10346b57806SIkjoon Jang            compatible = "google,cros-ec-i2c";
10446b57806SIkjoon Jang            reg = <0x1e>;
10546b57806SIkjoon Jang            interrupts = <6 0>;
10646b57806SIkjoon Jang            interrupt-parent = <&gpio0>;
10746b57806SIkjoon Jang        };
10846b57806SIkjoon Jang    };
10946b57806SIkjoon Jang
11046b57806SIkjoon Jang  # Example for SPI
11146b57806SIkjoon Jang  - |
11246b57806SIkjoon Jang    #include <dt-bindings/gpio/gpio.h>
11346b57806SIkjoon Jang    #include <dt-bindings/interrupt-controller/irq.h>
11446b57806SIkjoon Jang
11546b57806SIkjoon Jang    spi0 {
11646b57806SIkjoon Jang        #address-cells = <1>;
11746b57806SIkjoon Jang        #size-cells = <0>;
11846b57806SIkjoon Jang
11946b57806SIkjoon Jang        cros-ec@0 {
12046b57806SIkjoon Jang            compatible = "google,cros-ec-spi";
12146b57806SIkjoon Jang            reg = <0x0>;
12246b57806SIkjoon Jang            google,cros-ec-spi-msg-delay = <30>;
12346b57806SIkjoon Jang            google,cros-ec-spi-pre-delay = <10>;
12446b57806SIkjoon Jang            interrupts = <99 0>;
12546b57806SIkjoon Jang            interrupt-parent = <&gpio7>;
12646b57806SIkjoon Jang            spi-max-frequency = <5000000>;
12746b57806SIkjoon Jang        };
12846b57806SIkjoon Jang    };
12946b57806SIkjoon Jang
13046b57806SIkjoon Jang  # Example for RPMSG
13146b57806SIkjoon Jang  - |
13246b57806SIkjoon Jang    scp0 {
13346b57806SIkjoon Jang        cros-ec {
13446b57806SIkjoon Jang            compatible = "google,cros-ec-rpmsg";
13546b57806SIkjoon Jang        };
13646b57806SIkjoon Jang    };
13746b57806SIkjoon Jang...
138