Path: blob/master/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml
29281 views
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)1%YAML 1.22---3$id: http://devicetree.org/schemas/gpio/gpio-mmio.yaml#4$schema: http://devicetree.org/meta-schemas/core.yaml#56title: Generic MMIO GPIO78maintainers:9- Linus Walleij <linus.walleij@linaro.org>10- Bartosz Golaszewski <brgl@bgdev.pl>1112description:13Some simple GPIO controllers may consist of a single data register or a pair14of set/clear-bit registers. Such controllers are common for glue logic in15FPGAs or ASICs. Commonly, these controllers are accessed over memory-mapped16NAND-style parallel busses.1718properties:19compatible:20enum:21- brcm,bcm6345-gpio22- ni,169445-nand-gpio23- wd,mbl-gpio # Western Digital MyBook Live memory-mapped GPIO controller24- intel,ixp4xx-expansion-bus-mmio-gpio2526big-endian: true2728'#gpio-cells':29const: 23031gpio-controller: true3233little-endian: true3435reg:36minItems: 137description:38A list of registers in the controller. The width of each register is39determined by its size. All registers must have the same width. The number40of GPIOs is set by the width, with bit 0 corresponding to GPIO 0, unless41the ngpios property further restricts the number of used lines.42items:43- description:44Register to READ the value of the GPIO lines. If GPIO line is high,45the bit will be set. If the GPIO line is low, the bit will be cleared.46This register may also be used to drive GPIOs if the SET register is47omitted.48- description:49Register to SET the value of the GPIO lines. Setting a bit in this50register will drive the GPIO line high.51- description:52Register to CLEAR the value of the GPIO lines. Setting a bit in this53register will drive the GPIO line low. If this register is omitted,54the SET register will be used to clear the GPIO lines as well, by55actively writing the line with 0.56- description:57Register to set the line as OUTPUT. Setting a bit in this register58will turn that line into an output line. Conversely, clearing a bit59will turn that line into an input.60- description:61Register to set this line as INPUT. Setting a bit in this register62will turn that line into an input line. Conversely, clearing a bit63will turn that line into an output.6465reg-names:66minItems: 167maxItems: 568items:69enum:70- dat71- set72- clr73- dirout74- dirin7576native-endian: true7778ngpios:79minimum: 180maximum: 6381description:82If this property is present the number of usable GPIO lines are restricted83to the first 0 .. ngpios lines. This is useful when the GPIO MMIO register84has 32 bits for GPIO but only the first 12 are actually connected to85real electronics, and then we set ngpios to 12.8687no-output:88$ref: /schemas/types.yaml#/definitions/flag89description:90If this property is present, the controller cannot drive the GPIO lines.9192if:93properties:94compatible:95contains:96const: intel,ixp4xx-expansion-bus-mmio-gpio97then:98$ref: /schemas/memory-controllers/intel,ixp4xx-expansion-peripheral-props.yaml#99100patternProperties:101"^.+-hog(-[0-9]+)?$":102type: object103required:104- gpio-hog105106required:107- compatible108- reg109- reg-names110- '#gpio-cells'111- gpio-controller112113unevaluatedProperties: false114115examples:116- |117gpio@1f300010 {118compatible = "ni,169445-nand-gpio";119reg = <0x1f300010 0x4>;120reg-names = "dat";121gpio-controller;122#gpio-cells = <2>;123};124125gpio@e0100000 {126compatible = "wd,mbl-gpio";127reg-names = "dat";128reg = <0xe0100000 0x1>;129#gpio-cells = <2>;130gpio-controller;131no-output;132};133134gpio@fffe0406 {135compatible = "brcm,bcm6345-gpio";136reg-names = "dirout", "dat";137reg = <0xfffe0406 2>, <0xfffe040a 2>;138ngpios = <15>;139native-endian;140gpio-controller;141#gpio-cells = <2>;142};143144bus@c4000000 {145compatible = "intel,ixp42x-expansion-bus-controller", "syscon";146reg = <0xc4000000 0x30>;147native-endian;148#address-cells = <2>;149#size-cells = <1>;150ranges = <0 0x0 0x50000000 0x01000000>;151dma-ranges = <0 0x0 0x50000000 0x01000000>;152gpio@1,0 {153compatible = "intel,ixp4xx-expansion-bus-mmio-gpio";154gpio-controller;155#gpio-cells = <2>;156big-endian;157reg = <1 0x00000000 0x2>;158reg-names = "dat";159intel,ixp4xx-eb-write-enable = <1>;160};161};162163164