xref: /freebsd/sys/contrib/device-tree/Bindings/mfd/google,cros-ec.yaml (revision fac71e4e09885bb2afa3d984a0c239a52e1a7418)
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:
238bab661aSEmmanuel Vadot          For implementations of the EC connected through I2C.
24c66ec88fSEmmanuel Vadot        const: google,cros-ec-i2c
25c66ec88fSEmmanuel Vadot      - description:
268bab661aSEmmanuel Vadot          For implementations of the EC connected through SPI.
27c66ec88fSEmmanuel Vadot        const: google,cros-ec-spi
28c66ec88fSEmmanuel Vadot      - description:
298bab661aSEmmanuel Vadot          For implementations of the FPMCU connected through SPI.
308bab661aSEmmanuel Vadot        items:
318bab661aSEmmanuel Vadot          - const: google,cros-ec-fp
328bab661aSEmmanuel Vadot          - const: google,cros-ec-spi
338bab661aSEmmanuel Vadot      - description:
348bab661aSEmmanuel Vadot          For implementations of the EC connected through RPMSG.
35c66ec88fSEmmanuel Vadot        const: google,cros-ec-rpmsg
36cb7aa33aSEmmanuel Vadot      - description:
37cb7aa33aSEmmanuel Vadot          For implementations of the EC connected through UART.
38cb7aa33aSEmmanuel Vadot        const: google,cros-ec-uart
39c66ec88fSEmmanuel Vadot
408bab661aSEmmanuel Vadot  controller-data: true
416be33864SEmmanuel Vadot
42c66ec88fSEmmanuel Vadot  google,cros-ec-spi-pre-delay:
43c66ec88fSEmmanuel Vadot    description:
44c66ec88fSEmmanuel Vadot      This property specifies the delay in usecs between the
45c66ec88fSEmmanuel Vadot      assertion of the CS and the first clock pulse.
46c9ccf3a3SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
47c9ccf3a3SEmmanuel Vadot    default: 0
48c66ec88fSEmmanuel Vadot
49c66ec88fSEmmanuel Vadot  google,cros-ec-spi-msg-delay:
50c66ec88fSEmmanuel Vadot    description:
51c66ec88fSEmmanuel Vadot      This property specifies the delay in usecs between messages.
52c9ccf3a3SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
53c9ccf3a3SEmmanuel Vadot    default: 0
54c66ec88fSEmmanuel Vadot
55c66ec88fSEmmanuel Vadot  google,has-vbc-nvram:
56c66ec88fSEmmanuel Vadot    description:
57c66ec88fSEmmanuel Vadot      Some implementations of the EC include a small nvram space used to
58c66ec88fSEmmanuel Vadot      store verified boot context data. This boolean flag is used to specify
59c66ec88fSEmmanuel Vadot      whether this nvram is present or not.
60c66ec88fSEmmanuel Vadot    type: boolean
61c66ec88fSEmmanuel Vadot
62e67e8565SEmmanuel Vadot  mediatek,rpmsg-name:
636be33864SEmmanuel Vadot    description:
646be33864SEmmanuel Vadot      Must be defined if the cros-ec is a rpmsg device for a Mediatek
65d5b0e70fSEmmanuel Vadot      ARM Cortex M4 Co-processor. Contains the name of the rpmsg
666be33864SEmmanuel Vadot      device. Used to match the subnode to the rpmsg device announced by
676be33864SEmmanuel Vadot      the SCP.
68*fac71e4eSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/string
696be33864SEmmanuel Vadot
708bab661aSEmmanuel Vadot  spi-max-frequency: true
71c66ec88fSEmmanuel Vadot
72c66ec88fSEmmanuel Vadot  reg:
73c66ec88fSEmmanuel Vadot    maxItems: 1
74c66ec88fSEmmanuel Vadot
75c66ec88fSEmmanuel Vadot  interrupts:
76c66ec88fSEmmanuel Vadot    maxItems: 1
77c66ec88fSEmmanuel Vadot
788bab661aSEmmanuel Vadot  reset-gpios:
798bab661aSEmmanuel Vadot    maxItems: 1
808bab661aSEmmanuel Vadot
818bab661aSEmmanuel Vadot  boot0-gpios:
828bab661aSEmmanuel Vadot    maxItems: 1
838bab661aSEmmanuel Vadot    description: Assert for bootloader mode.
848bab661aSEmmanuel Vadot
858bab661aSEmmanuel Vadot  vdd-supply: true
868bab661aSEmmanuel Vadot
876be33864SEmmanuel Vadot  wakeup-source:
886be33864SEmmanuel Vadot    description: Button can wake-up the system.
896be33864SEmmanuel Vadot
906be33864SEmmanuel Vadot  '#address-cells':
916be33864SEmmanuel Vadot    const: 1
926be33864SEmmanuel Vadot
936be33864SEmmanuel Vadot  '#size-cells':
946be33864SEmmanuel Vadot    const: 0
956be33864SEmmanuel Vadot
966be33864SEmmanuel Vadot  typec:
97*fac71e4eSEmmanuel Vadot    $ref: /schemas/chrome/google,cros-ec-typec.yaml#
986be33864SEmmanuel Vadot
996be33864SEmmanuel Vadot  ec-pwm:
100*fac71e4eSEmmanuel Vadot    $ref: /schemas/pwm/google,cros-ec-pwm.yaml#
101c9ccf3a3SEmmanuel Vadot    deprecated: true
102c9ccf3a3SEmmanuel Vadot
103c9ccf3a3SEmmanuel Vadot  pwm:
104*fac71e4eSEmmanuel Vadot    $ref: /schemas/pwm/google,cros-ec-pwm.yaml#
1056be33864SEmmanuel Vadot
106b97ee269SEmmanuel Vadot  kbd-led-backlight:
107*fac71e4eSEmmanuel Vadot    $ref: /schemas/chrome/google,cros-kbd-led-backlight.yaml#
108b97ee269SEmmanuel Vadot
1096be33864SEmmanuel Vadot  keyboard-controller:
110*fac71e4eSEmmanuel Vadot    $ref: /schemas/input/google,cros-ec-keyb.yaml#
1116be33864SEmmanuel Vadot
1122eb4d8dcSEmmanuel Vadot  proximity:
113*fac71e4eSEmmanuel Vadot    $ref: /schemas/iio/proximity/google,cros-ec-mkbp-proximity.yaml#
1142eb4d8dcSEmmanuel Vadot
1156be33864SEmmanuel Vadot  codecs:
1166be33864SEmmanuel Vadot    type: object
1176be33864SEmmanuel Vadot    additionalProperties: false
1186be33864SEmmanuel Vadot
1196be33864SEmmanuel Vadot    properties:
1206be33864SEmmanuel Vadot      '#address-cells':
1216be33864SEmmanuel Vadot        const: 2
1226be33864SEmmanuel Vadot
1236be33864SEmmanuel Vadot      '#size-cells':
1246be33864SEmmanuel Vadot        const: 1
1256be33864SEmmanuel Vadot
1266be33864SEmmanuel Vadot    patternProperties:
1276be33864SEmmanuel Vadot      "^ec-codec@[a-f0-9]+$":
1286be33864SEmmanuel Vadot        type: object
129*fac71e4eSEmmanuel Vadot        $ref: /schemas/sound/google,cros-ec-codec.yaml#
1306be33864SEmmanuel Vadot
1316be33864SEmmanuel Vadot    required:
1326be33864SEmmanuel Vadot      - "#address-cells"
1336be33864SEmmanuel Vadot      - "#size-cells"
1346be33864SEmmanuel Vadot
1355956d97fSEmmanuel Vadot  cbas:
1365956d97fSEmmanuel Vadot    type: object
1375956d97fSEmmanuel Vadot
1385956d97fSEmmanuel Vadot    description:
1395956d97fSEmmanuel Vadot      This device is used to signal when a detachable base is attached
1405956d97fSEmmanuel Vadot      to a Chrome OS tablet. This device cannot be detected at runtime.
1415956d97fSEmmanuel Vadot
1425956d97fSEmmanuel Vadot    properties:
1435956d97fSEmmanuel Vadot      compatible:
1445956d97fSEmmanuel Vadot        const: google,cros-cbas
1455956d97fSEmmanuel Vadot
1465956d97fSEmmanuel Vadot    required:
1475956d97fSEmmanuel Vadot      - compatible
1485956d97fSEmmanuel Vadot
1495956d97fSEmmanuel Vadot    additionalProperties: false
1505956d97fSEmmanuel Vadot
1516be33864SEmmanuel VadotpatternProperties:
1526be33864SEmmanuel Vadot  "^i2c-tunnel[0-9]*$":
1536be33864SEmmanuel Vadot    type: object
154*fac71e4eSEmmanuel Vadot    $ref: /schemas/i2c/google,cros-ec-i2c-tunnel.yaml#
1556be33864SEmmanuel Vadot
1566be33864SEmmanuel Vadot  "^regulator@[0-9]+$":
1576be33864SEmmanuel Vadot    type: object
158*fac71e4eSEmmanuel Vadot    $ref: /schemas/regulator/google,cros-ec-regulator.yaml#
1596be33864SEmmanuel Vadot
1606be33864SEmmanuel Vadot  "^extcon[0-9]*$":
1616be33864SEmmanuel Vadot    type: object
162*fac71e4eSEmmanuel Vadot    $ref: /schemas/extcon/extcon-usbc-cros-ec.yaml#
1636be33864SEmmanuel Vadot
164c66ec88fSEmmanuel Vadotrequired:
165c66ec88fSEmmanuel Vadot  - compatible
166c66ec88fSEmmanuel Vadot
167c9ccf3a3SEmmanuel VadotallOf:
168c9ccf3a3SEmmanuel Vadot  - if:
169c66ec88fSEmmanuel Vadot      properties:
170c66ec88fSEmmanuel Vadot        compatible:
1718bab661aSEmmanuel Vadot          not:
172c66ec88fSEmmanuel Vadot            contains:
1738bab661aSEmmanuel Vadot              const: google,cros-ec-spi
174c66ec88fSEmmanuel Vadot    then:
175c66ec88fSEmmanuel Vadot      properties:
1768bab661aSEmmanuel Vadot        controller-data: false
177c66ec88fSEmmanuel Vadot        google,cros-ec-spi-pre-delay: false
178c66ec88fSEmmanuel Vadot        google,cros-ec-spi-msg-delay: false
179c66ec88fSEmmanuel Vadot        spi-max-frequency: false
180c9ccf3a3SEmmanuel Vadot    else:
181c9ccf3a3SEmmanuel Vadot      $ref: /schemas/spi/spi-peripheral-props.yaml
182c66ec88fSEmmanuel Vadot
1838bab661aSEmmanuel Vadot  - if:
1848bab661aSEmmanuel Vadot      properties:
1858bab661aSEmmanuel Vadot        compatible:
1868bab661aSEmmanuel Vadot          not:
1878bab661aSEmmanuel Vadot            contains:
1888bab661aSEmmanuel Vadot              const: google,cros-ec-rpmsg
1898bab661aSEmmanuel Vadot    then:
1908bab661aSEmmanuel Vadot      properties:
1918bab661aSEmmanuel Vadot        mediatek,rpmsg-name: false
1928bab661aSEmmanuel Vadot
193cb7aa33aSEmmanuel Vadot  - if:
194cb7aa33aSEmmanuel Vadot      properties:
195cb7aa33aSEmmanuel Vadot        compatible:
196cb7aa33aSEmmanuel Vadot          not:
197cb7aa33aSEmmanuel Vadot            contains:
198cb7aa33aSEmmanuel Vadot              enum:
199cb7aa33aSEmmanuel Vadot                - google,cros-ec-rpmsg
200cb7aa33aSEmmanuel Vadot                - google,cros-ec-uart
201cb7aa33aSEmmanuel Vadot    then:
2028bab661aSEmmanuel Vadot      required:
2038bab661aSEmmanuel Vadot        - reg
2048bab661aSEmmanuel Vadot        - interrupts
2058bab661aSEmmanuel Vadot
2068bab661aSEmmanuel Vadot  - if:
2078bab661aSEmmanuel Vadot      properties:
2088bab661aSEmmanuel Vadot        compatible:
2098bab661aSEmmanuel Vadot          contains:
2108bab661aSEmmanuel Vadot            const: google,cros-ec-fp
2118bab661aSEmmanuel Vadot    then:
2128bab661aSEmmanuel Vadot      properties:
2138bab661aSEmmanuel Vadot        '#address-cells': false
2148bab661aSEmmanuel Vadot        '#size-cells': false
2158bab661aSEmmanuel Vadot        typec: false
2168bab661aSEmmanuel Vadot        ec-pwm: false
2178bab661aSEmmanuel Vadot        kbd-led-backlight: false
2188bab661aSEmmanuel Vadot        keyboard-controller: false
2198bab661aSEmmanuel Vadot        proximity: false
2208bab661aSEmmanuel Vadot        codecs: false
2218bab661aSEmmanuel Vadot        cbas: false
2228bab661aSEmmanuel Vadot
2238bab661aSEmmanuel Vadot      patternProperties:
2248bab661aSEmmanuel Vadot        "^i2c-tunnel[0-9]*$": false
2258bab661aSEmmanuel Vadot        "^regulator@[0-9]+$": false
2268bab661aSEmmanuel Vadot        "^extcon[0-9]*$": false
2278bab661aSEmmanuel Vadot
2288bab661aSEmmanuel Vadot      # Using additionalProperties: false here and
2298bab661aSEmmanuel Vadot      # listing true properties doesn't work
2308bab661aSEmmanuel Vadot
2318bab661aSEmmanuel Vadot      required:
2328bab661aSEmmanuel Vadot        - reset-gpios
2338bab661aSEmmanuel Vadot        - boot0-gpios
2348bab661aSEmmanuel Vadot        - vdd-supply
2358bab661aSEmmanuel Vadot    else:
2368bab661aSEmmanuel Vadot      properties:
2378bab661aSEmmanuel Vadot        reset-gpios: false
2388bab661aSEmmanuel Vadot        boot0-gpios: false
2398bab661aSEmmanuel Vadot        vdd-supply: false
2408bab661aSEmmanuel Vadot
241c66ec88fSEmmanuel VadotadditionalProperties: false
242c66ec88fSEmmanuel Vadot
243c66ec88fSEmmanuel Vadotexamples:
244c66ec88fSEmmanuel Vadot  # Example for I2C
245c66ec88fSEmmanuel Vadot  - |
246c66ec88fSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
247c66ec88fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
248c66ec88fSEmmanuel Vadot
249*fac71e4eSEmmanuel Vadot    i2c {
250c66ec88fSEmmanuel Vadot        #address-cells = <1>;
251c66ec88fSEmmanuel Vadot        #size-cells = <0>;
252c66ec88fSEmmanuel Vadot
253c66ec88fSEmmanuel Vadot        cros-ec@1e {
254c66ec88fSEmmanuel Vadot            compatible = "google,cros-ec-i2c";
255c66ec88fSEmmanuel Vadot            reg = <0x1e>;
256c66ec88fSEmmanuel Vadot            interrupts = <6 0>;
257c66ec88fSEmmanuel Vadot            interrupt-parent = <&gpio0>;
258c66ec88fSEmmanuel Vadot        };
259c66ec88fSEmmanuel Vadot    };
260c66ec88fSEmmanuel Vadot
261c66ec88fSEmmanuel Vadot  # Example for SPI
262c66ec88fSEmmanuel Vadot  - |
263c66ec88fSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
264c66ec88fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
265c66ec88fSEmmanuel Vadot
266*fac71e4eSEmmanuel Vadot    spi {
267c66ec88fSEmmanuel Vadot        #address-cells = <1>;
268c66ec88fSEmmanuel Vadot        #size-cells = <0>;
269c66ec88fSEmmanuel Vadot
270c66ec88fSEmmanuel Vadot        cros-ec@0 {
271c66ec88fSEmmanuel Vadot            compatible = "google,cros-ec-spi";
272c66ec88fSEmmanuel Vadot            reg = <0x0>;
273c66ec88fSEmmanuel Vadot            google,cros-ec-spi-msg-delay = <30>;
274c66ec88fSEmmanuel Vadot            google,cros-ec-spi-pre-delay = <10>;
275c66ec88fSEmmanuel Vadot            interrupts = <99 0>;
276c66ec88fSEmmanuel Vadot            interrupt-parent = <&gpio7>;
277c66ec88fSEmmanuel Vadot            spi-max-frequency = <5000000>;
2782eb4d8dcSEmmanuel Vadot
2792eb4d8dcSEmmanuel Vadot            proximity {
2802eb4d8dcSEmmanuel Vadot                compatible = "google,cros-ec-mkbp-proximity";
2812eb4d8dcSEmmanuel Vadot            };
2825956d97fSEmmanuel Vadot
2835956d97fSEmmanuel Vadot            cbas {
2845956d97fSEmmanuel Vadot                compatible = "google,cros-cbas";
2855956d97fSEmmanuel Vadot            };
286c66ec88fSEmmanuel Vadot        };
287c66ec88fSEmmanuel Vadot    };
288c66ec88fSEmmanuel Vadot
289c66ec88fSEmmanuel Vadot  # Example for RPMSG
290c66ec88fSEmmanuel Vadot  - |
291c66ec88fSEmmanuel Vadot    scp0 {
292c66ec88fSEmmanuel Vadot        cros-ec {
293c66ec88fSEmmanuel Vadot            compatible = "google,cros-ec-rpmsg";
294c66ec88fSEmmanuel Vadot        };
295c66ec88fSEmmanuel Vadot    };
2968bab661aSEmmanuel Vadot
2978bab661aSEmmanuel Vadot  # Example for FPMCU
2988bab661aSEmmanuel Vadot  - |
299*fac71e4eSEmmanuel Vadot    spi {
3008bab661aSEmmanuel Vadot      #address-cells = <0x1>;
3018bab661aSEmmanuel Vadot      #size-cells = <0x0>;
3028bab661aSEmmanuel Vadot
3038bab661aSEmmanuel Vadot      ec@0 {
3048bab661aSEmmanuel Vadot        compatible = "google,cros-ec-fp", "google,cros-ec-spi";
3058bab661aSEmmanuel Vadot        reg = <0x0>;
3068bab661aSEmmanuel Vadot        interrupt-parent = <&gpio_controller>;
3078bab661aSEmmanuel Vadot        interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
3088bab661aSEmmanuel Vadot        spi-max-frequency = <3000000>;
3098bab661aSEmmanuel Vadot        reset-gpios = <&gpio_controller 5 GPIO_ACTIVE_LOW>;
3108bab661aSEmmanuel Vadot        boot0-gpios = <&gpio_controller 10 GPIO_ACTIVE_HIGH>;
3118bab661aSEmmanuel Vadot        vdd-supply = <&pp3300_fp_mcu>;
3128bab661aSEmmanuel Vadot      };
3138bab661aSEmmanuel Vadot    };
314cb7aa33aSEmmanuel Vadot
315cb7aa33aSEmmanuel Vadot  # Example for UART
316cb7aa33aSEmmanuel Vadot  - |
317cb7aa33aSEmmanuel Vadot    serial {
318cb7aa33aSEmmanuel Vadot        cros-ec {
319cb7aa33aSEmmanuel Vadot            compatible = "google,cros-ec-uart";
320cb7aa33aSEmmanuel Vadot        };
321cb7aa33aSEmmanuel Vadot    };
322c66ec88fSEmmanuel Vadot...
323