Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/gpio/sifive,gpio.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006 
0007 title: SiFive GPIO controller
0008 
0009 maintainers:
0010   - Paul Walmsley <paul.walmsley@sifive.com>
0011 
0012 properties:
0013   compatible:
0014     items:
0015       - enum:
0016           - sifive,fu540-c000-gpio
0017           - sifive,fu740-c000-gpio
0018           - canaan,k210-gpiohs
0019       - const: sifive,gpio0
0020 
0021   reg:
0022     maxItems: 1
0023 
0024   interrupts:
0025     description:
0026       Interrupt mapping, one per GPIO. Maximum 32 GPIOs.
0027     minItems: 1
0028     maxItems: 32
0029 
0030   interrupt-controller: true
0031 
0032   "#interrupt-cells":
0033     const: 2
0034 
0035   clocks:
0036     maxItems: 1
0037 
0038   "#gpio-cells":
0039     const: 2
0040 
0041   ngpios:
0042     description:
0043       The number of GPIOs available on the controller implementation.
0044       It is 16 for the SiFive SoCs and 32 for the Canaan K210.
0045     minimum: 1
0046     maximum: 32
0047     default: 16
0048 
0049   gpio-line-names:
0050     minItems: 1
0051     maxItems: 32
0052 
0053   gpio-controller: true
0054 
0055 required:
0056   - compatible
0057   - reg
0058   - interrupts
0059   - interrupt-controller
0060   - "#interrupt-cells"
0061   - "#gpio-cells"
0062   - gpio-controller
0063 
0064 if:
0065   properties:
0066     compatible:
0067       contains:
0068         enum:
0069           - sifive,fu540-c000-gpio
0070           - sifive,fu740-c000-gpio
0071 then:
0072   required:
0073     - clocks
0074 
0075 additionalProperties: false
0076 
0077 examples:
0078   - |
0079       #include <dt-bindings/clock/sifive-fu540-prci.h>
0080       gpio@10060000 {
0081         compatible = "sifive,fu540-c000-gpio", "sifive,gpio0";
0082         interrupt-parent = <&plic>;
0083         interrupts = <7>, <8>, <9>, <10>, <11>, <12>, <13>, <14>, <15>, <16>,
0084                      <17>, <18>, <19>, <20>, <21>, <22>;
0085         reg = <0x10060000 0x1000>;
0086         clocks = <&tlclk FU540_PRCI_CLK_TLCLK>;
0087         gpio-controller;
0088         #gpio-cells = <2>;
0089         interrupt-controller;
0090         #interrupt-cells = <2>;
0091       };
0092 
0093 ...