Path: blob/master/Documentation/devicetree/bindings/embedded-controller/google,cros-ec.yaml
29285 views
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)1%YAML 1.22---3$id: http://devicetree.org/schemas/embedded-controller/google,cros-ec.yaml#4$schema: http://devicetree.org/meta-schemas/core.yaml#56title: ChromeOS Embedded Controller78maintainers:9- Benson Leung <bleung@chromium.org>10- Guenter Roeck <groeck@chromium.org>1112description:13Google's ChromeOS EC is a microcontroller which talks to the AP and14implements various functions such as keyboard and battery charging.15The EC can be connected through various interfaces (I2C, SPI, and others)16and the compatible string specifies which interface is being used.1718properties:19compatible:20oneOf:21- description:22For implementations of the EC connected through I2C.23const: google,cros-ec-i2c24- description:25For implementations of the EC connected through SPI.26const: google,cros-ec-spi27- description:28For implementations of the FPMCU connected through SPI.29items:30- const: google,cros-ec-fp31- const: google,cros-ec-spi32- description:33For implementations of the EC connected through RPMSG.34const: google,cros-ec-rpmsg35- description:36For implementations of the EC connected through UART.37const: google,cros-ec-uart3839controller-data: true4041google,cros-ec-spi-pre-delay:42description:43This property specifies the delay in usecs between the44assertion of the CS and the first clock pulse.45$ref: /schemas/types.yaml#/definitions/uint3246default: 04748google,cros-ec-spi-msg-delay:49description:50This property specifies the delay in usecs between messages.51$ref: /schemas/types.yaml#/definitions/uint3252default: 05354google,has-vbc-nvram:55description:56Some implementations of the EC include a small nvram space used to57store verified boot context data. This boolean flag is used to specify58whether this nvram is present or not.59type: boolean6061mediatek,rpmsg-name:62description:63Must be defined if the cros-ec is a rpmsg device for a Mediatek64ARM Cortex M4 Co-processor. Contains the name of the rpmsg65device. Used to match the subnode to the rpmsg device announced by66the SCP.67$ref: /schemas/types.yaml#/definitions/string6869spi-max-frequency: true7071reg:72maxItems: 17374interrupts:75maxItems: 17677reset-gpios:78maxItems: 17980boot0-gpios:81maxItems: 182description: Assert for bootloader mode.8384vdd-supply: true8586wakeup-source:87description: Button can wake-up the system.8889'#address-cells':90const: 19192'#size-cells':93const: 09495'#gpio-cells':96const: 29798gpio-controller: true99100typec:101$ref: /schemas/chrome/google,cros-ec-typec.yaml#102103ec-pwm:104$ref: /schemas/pwm/google,cros-ec-pwm.yaml#105deprecated: true106107pwm:108$ref: /schemas/pwm/google,cros-ec-pwm.yaml#109110keyboard-controller:111$ref: /schemas/input/google,cros-ec-keyb.yaml#112113proximity:114$ref: /schemas/iio/proximity/google,cros-ec-mkbp-proximity.yaml#115116codecs:117type: object118additionalProperties: false119120properties:121'#address-cells':122const: 2123124'#size-cells':125const: 1126127patternProperties:128"^ec-codec@[a-f0-9]+$":129type: object130$ref: /schemas/sound/google,cros-ec-codec.yaml#131132required:133- "#address-cells"134- "#size-cells"135136cbas:137type: object138139description:140This device is used to signal when a detachable base is attached141to a Chrome OS tablet. This device cannot be detected at runtime.142143properties:144compatible:145const: google,cros-cbas146147required:148- compatible149150additionalProperties: false151152patternProperties:153"^i2c-tunnel[0-9]*$":154type: object155$ref: /schemas/i2c/google,cros-ec-i2c-tunnel.yaml#156157"^regulator@[0-9]+$":158type: object159$ref: /schemas/regulator/google,cros-ec-regulator.yaml#160161"^extcon[0-9]*$":162type: object163$ref: /schemas/extcon/extcon-usbc-cros-ec.yaml#164165required:166- compatible167168allOf:169- if:170properties:171compatible:172not:173contains:174const: google,cros-ec-spi175then:176properties:177controller-data: false178google,cros-ec-spi-pre-delay: false179google,cros-ec-spi-msg-delay: false180spi-max-frequency: false181else:182$ref: /schemas/spi/spi-peripheral-props.yaml183184- if:185properties:186compatible:187not:188contains:189const: google,cros-ec-rpmsg190then:191properties:192mediatek,rpmsg-name: false193194- if:195properties:196compatible:197not:198contains:199enum:200- google,cros-ec-rpmsg201- google,cros-ec-uart202then:203required:204- reg205- interrupts206207- if:208properties:209compatible:210contains:211const: google,cros-ec-fp212then:213properties:214'#address-cells': false215'#size-cells': false216typec: false217ec-pwm: false218kbd-led-backlight: false219keyboard-controller: false220proximity: false221codecs: false222cbas: false223224patternProperties:225"^i2c-tunnel[0-9]*$": false226"^regulator@[0-9]+$": false227"^extcon[0-9]*$": false228229# Using additionalProperties: false here and230# listing true properties doesn't work231232required:233- reset-gpios234- boot0-gpios235- vdd-supply236else:237properties:238reset-gpios: false239boot0-gpios: false240vdd-supply: false241242additionalProperties: false243244examples:245# Example for I2C246- |247#include <dt-bindings/gpio/gpio.h>248#include <dt-bindings/interrupt-controller/irq.h>249250i2c {251#address-cells = <1>;252#size-cells = <0>;253254cros-ec@1e {255compatible = "google,cros-ec-i2c";256reg = <0x1e>;257interrupts = <6 0>;258interrupt-parent = <&gpio0>;259};260};261262# Example for SPI263- |264#include <dt-bindings/gpio/gpio.h>265#include <dt-bindings/interrupt-controller/irq.h>266267spi {268#address-cells = <1>;269#size-cells = <0>;270271cros-ec@0 {272compatible = "google,cros-ec-spi";273reg = <0x0>;274google,cros-ec-spi-msg-delay = <30>;275google,cros-ec-spi-pre-delay = <10>;276interrupts = <99 0>;277interrupt-parent = <&gpio7>;278spi-max-frequency = <5000000>;279#gpio-cells = <2>;280gpio-controller;281282proximity {283compatible = "google,cros-ec-mkbp-proximity";284};285286cbas {287compatible = "google,cros-cbas";288};289};290};291292# Example for RPMSG293- |294scp0 {295cros-ec {296compatible = "google,cros-ec-rpmsg";297};298};299300# Example for FPMCU301- |302spi {303#address-cells = <0x1>;304#size-cells = <0x0>;305306ec@0 {307compatible = "google,cros-ec-fp", "google,cros-ec-spi";308reg = <0x0>;309interrupt-parent = <&gpio_controller>;310interrupts = <4 IRQ_TYPE_LEVEL_LOW>;311spi-max-frequency = <3000000>;312reset-gpios = <&gpio_controller 5 GPIO_ACTIVE_LOW>;313boot0-gpios = <&gpio_controller 10 GPIO_ACTIVE_HIGH>;314vdd-supply = <&pp3300_fp_mcu>;315};316};317318# Example for UART319- |320serial {321cros-ec {322compatible = "google,cros-ec-uart";323};324};325...326327328