brintos

brintos / linux-shallow public Read only

0
0
Text · 7.5 KiB · aac8819 Raw
330 lines · yaml
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)2%YAML 1.23---4$id: http://devicetree.org/schemas/mfd/google,cros-ec.yaml#5$schema: http://devicetree.org/meta-schemas/core.yaml#6 7title: ChromeOS Embedded Controller8 9maintainers:10  - Benson Leung <bleung@chromium.org>11  - Guenter Roeck <groeck@chromium.org>12 13description:14  Google's ChromeOS EC is a microcontroller which talks to the AP and15  implements various functions such as keyboard and battery charging.16  The EC can be connected through various interfaces (I2C, SPI, and others)17  and the compatible string specifies which interface is being used.18 19properties:20  compatible:21    oneOf:22      - description:23          For implementations of the EC connected through I2C.24        const: google,cros-ec-i2c25      - description:26          For implementations of the EC connected through SPI.27        const: google,cros-ec-spi28      - description:29          For implementations of the FPMCU connected through SPI.30        items:31          - const: google,cros-ec-fp32          - const: google,cros-ec-spi33      - description:34          For implementations of the EC connected through RPMSG.35        const: google,cros-ec-rpmsg36      - description:37          For implementations of the EC connected through UART.38        const: google,cros-ec-uart39 40  controller-data: true41 42  google,cros-ec-spi-pre-delay:43    description:44      This property specifies the delay in usecs between the45      assertion of the CS and the first clock pulse.46    $ref: /schemas/types.yaml#/definitions/uint3247    default: 048 49  google,cros-ec-spi-msg-delay:50    description:51      This property specifies the delay in usecs between messages.52    $ref: /schemas/types.yaml#/definitions/uint3253    default: 054 55  google,has-vbc-nvram:56    description:57      Some implementations of the EC include a small nvram space used to58      store verified boot context data. This boolean flag is used to specify59      whether this nvram is present or not.60    type: boolean61 62  mediatek,rpmsg-name:63    description:64      Must be defined if the cros-ec is a rpmsg device for a Mediatek65      ARM Cortex M4 Co-processor. Contains the name of the rpmsg66      device. Used to match the subnode to the rpmsg device announced by67      the SCP.68    $ref: /schemas/types.yaml#/definitions/string69 70  spi-max-frequency: true71 72  reg:73    maxItems: 174 75  interrupts:76    maxItems: 177 78  reset-gpios:79    maxItems: 180 81  boot0-gpios:82    maxItems: 183    description: Assert for bootloader mode.84 85  vdd-supply: true86 87  wakeup-source:88    description: Button can wake-up the system.89 90  '#address-cells':91    const: 192 93  '#size-cells':94    const: 095 96  '#gpio-cells':97    const: 298 99  gpio-controller: true100 101  typec:102    $ref: /schemas/chrome/google,cros-ec-typec.yaml#103 104  ec-pwm:105    $ref: /schemas/pwm/google,cros-ec-pwm.yaml#106    deprecated: true107 108  pwm:109    $ref: /schemas/pwm/google,cros-ec-pwm.yaml#110 111  kbd-led-backlight:112    $ref: /schemas/chrome/google,cros-kbd-led-backlight.yaml#113 114  keyboard-controller:115    $ref: /schemas/input/google,cros-ec-keyb.yaml#116 117  proximity:118    $ref: /schemas/iio/proximity/google,cros-ec-mkbp-proximity.yaml#119 120  codecs:121    type: object122    additionalProperties: false123 124    properties:125      '#address-cells':126        const: 2127 128      '#size-cells':129        const: 1130 131    patternProperties:132      "^ec-codec@[a-f0-9]+$":133        type: object134        $ref: /schemas/sound/google,cros-ec-codec.yaml#135 136    required:137      - "#address-cells"138      - "#size-cells"139 140  cbas:141    type: object142 143    description:144      This device is used to signal when a detachable base is attached145      to a Chrome OS tablet. This device cannot be detected at runtime.146 147    properties:148      compatible:149        const: google,cros-cbas150 151    required:152      - compatible153 154    additionalProperties: false155 156patternProperties:157  "^i2c-tunnel[0-9]*$":158    type: object159    $ref: /schemas/i2c/google,cros-ec-i2c-tunnel.yaml#160 161  "^regulator@[0-9]+$":162    type: object163    $ref: /schemas/regulator/google,cros-ec-regulator.yaml#164 165  "^extcon[0-9]*$":166    type: object167    $ref: /schemas/extcon/extcon-usbc-cros-ec.yaml#168 169required:170  - compatible171 172allOf:173  - if:174      properties:175        compatible:176          not:177            contains:178              const: google,cros-ec-spi179    then:180      properties:181        controller-data: false182        google,cros-ec-spi-pre-delay: false183        google,cros-ec-spi-msg-delay: false184        spi-max-frequency: false185    else:186      $ref: /schemas/spi/spi-peripheral-props.yaml187 188  - if:189      properties:190        compatible:191          not:192            contains:193              const: google,cros-ec-rpmsg194    then:195      properties:196        mediatek,rpmsg-name: false197 198  - if:199      properties:200        compatible:201          not:202            contains:203              enum:204                - google,cros-ec-rpmsg205                - google,cros-ec-uart206    then:207      required:208        - reg209        - interrupts210 211  - if:212      properties:213        compatible:214          contains:215            const: google,cros-ec-fp216    then:217      properties:218        '#address-cells': false219        '#size-cells': false220        typec: false221        ec-pwm: false222        kbd-led-backlight: false223        keyboard-controller: false224        proximity: false225        codecs: false226        cbas: false227 228      patternProperties:229        "^i2c-tunnel[0-9]*$": false230        "^regulator@[0-9]+$": false231        "^extcon[0-9]*$": false232 233      # Using additionalProperties: false here and234      # listing true properties doesn't work235 236      required:237        - reset-gpios238        - boot0-gpios239        - vdd-supply240    else:241      properties:242        reset-gpios: false243        boot0-gpios: false244        vdd-supply: false245 246additionalProperties: false247 248examples:249  # Example for I2C250  - |251    #include <dt-bindings/gpio/gpio.h>252    #include <dt-bindings/interrupt-controller/irq.h>253 254    i2c {255        #address-cells = <1>;256        #size-cells = <0>;257 258        cros-ec@1e {259            compatible = "google,cros-ec-i2c";260            reg = <0x1e>;261            interrupts = <6 0>;262            interrupt-parent = <&gpio0>;263        };264    };265 266  # Example for SPI267  - |268    #include <dt-bindings/gpio/gpio.h>269    #include <dt-bindings/interrupt-controller/irq.h>270 271    spi {272        #address-cells = <1>;273        #size-cells = <0>;274 275        cros-ec@0 {276            compatible = "google,cros-ec-spi";277            reg = <0x0>;278            google,cros-ec-spi-msg-delay = <30>;279            google,cros-ec-spi-pre-delay = <10>;280            interrupts = <99 0>;281            interrupt-parent = <&gpio7>;282            spi-max-frequency = <5000000>;283            #gpio-cells = <2>;284            gpio-controller;285 286            proximity {287                compatible = "google,cros-ec-mkbp-proximity";288            };289 290            cbas {291                compatible = "google,cros-cbas";292            };293        };294    };295 296  # Example for RPMSG297  - |298    scp0 {299        cros-ec {300            compatible = "google,cros-ec-rpmsg";301        };302    };303 304  # Example for FPMCU305  - |306    spi {307      #address-cells = <0x1>;308      #size-cells = <0x0>;309 310      ec@0 {311        compatible = "google,cros-ec-fp", "google,cros-ec-spi";312        reg = <0x0>;313        interrupt-parent = <&gpio_controller>;314        interrupts = <4 IRQ_TYPE_LEVEL_LOW>;315        spi-max-frequency = <3000000>;316        reset-gpios = <&gpio_controller 5 GPIO_ACTIVE_LOW>;317        boot0-gpios = <&gpio_controller 10 GPIO_ACTIVE_HIGH>;318        vdd-supply = <&pp3300_fp_mcu>;319      };320    };321 322  # Example for UART323  - |324    serial {325        cros-ec {326            compatible = "google,cros-ec-uart";327        };328    };329...330