Path: blob/master/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml
52653 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 <linusw@kernel.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- intel,ixp4xx-expansion-bus-mmio-gpio23- ni,169445-nand-gpio24- opencores,gpio25- wd,mbl-gpio # Western Digital MyBook Live memory-mapped GPIO controller2627big-endian: true2829'#gpio-cells':30const: 23132gpio-controller: true3334little-endian: true3536reg:37minItems: 138description:39A list of registers in the controller. The width of each register is40determined by its size. All registers must have the same width. The number41of GPIOs is set by the width, with bit 0 corresponding to GPIO 0, unless42the ngpios property further restricts the number of used lines.43items:44- description:45Register to READ the value of the GPIO lines. If GPIO line is high,46the bit will be set. If the GPIO line is low, the bit will be cleared.47This register may also be used to drive GPIOs if the SET register is48omitted.49- description:50Register to SET the value of the GPIO lines. Setting a bit in this51register will drive the GPIO line high.52- description:53Register to CLEAR the value of the GPIO lines. Setting a bit in this54register will drive the GPIO line low. If this register is omitted,55the SET register will be used to clear the GPIO lines as well, by56actively writing the line with 0.57- description:58Register to set the line as OUTPUT. Setting a bit in this register59will turn that line into an output line. Conversely, clearing a bit60will turn that line into an input.61- description:62Register to set this line as INPUT. Setting a bit in this register63will turn that line into an input line. Conversely, clearing a bit64will turn that line into an output.6566reg-names:67minItems: 168maxItems: 569items:70enum:71- dat72- set73- clr74- dirout75- dirin7677native-endian: true7879ngpios:80minimum: 181maximum: 6382description:83If this property is present the number of usable GPIO lines are restricted84to the first 0 .. ngpios lines. This is useful when the GPIO MMIO register85has 32 bits for GPIO but only the first 12 are actually connected to86real electronics, and then we set ngpios to 12.8788no-output:89$ref: /schemas/types.yaml#/definitions/flag90description:91If this property is present, the controller cannot drive the GPIO lines.9293if:94properties:95compatible:96contains:97const: intel,ixp4xx-expansion-bus-mmio-gpio98then:99$ref: /schemas/memory-controllers/intel,ixp4xx-expansion-peripheral-props.yaml#100101patternProperties:102"^.+-hog(-[0-9]+)?$":103type: object104required:105- gpio-hog106107required:108- compatible109- reg110- reg-names111- '#gpio-cells'112- gpio-controller113114unevaluatedProperties: false115116examples:117- |118gpio@1f300010 {119compatible = "ni,169445-nand-gpio";120reg = <0x1f300010 0x4>;121reg-names = "dat";122gpio-controller;123#gpio-cells = <2>;124};125126gpio@e0100000 {127compatible = "wd,mbl-gpio";128reg-names = "dat";129reg = <0xe0100000 0x1>;130#gpio-cells = <2>;131gpio-controller;132no-output;133};134135gpio@fffe0406 {136compatible = "brcm,bcm6345-gpio";137reg-names = "dirout", "dat";138reg = <0xfffe0406 2>, <0xfffe040a 2>;139ngpios = <15>;140native-endian;141gpio-controller;142#gpio-cells = <2>;143};144145bus@c4000000 {146compatible = "intel,ixp42x-expansion-bus-controller", "syscon";147reg = <0xc4000000 0x30>;148native-endian;149#address-cells = <2>;150#size-cells = <1>;151ranges = <0 0x0 0x50000000 0x01000000>;152dma-ranges = <0 0x0 0x50000000 0x01000000>;153gpio@1,0 {154compatible = "intel,ixp4xx-expansion-bus-mmio-gpio";155gpio-controller;156#gpio-cells = <2>;157big-endian;158reg = <1 0x00000000 0x2>;159reg-names = "dat";160intel,ixp4xx-eb-write-enable = <1>;161};162};163164165