xref: /freebsd/sys/contrib/device-tree/Bindings/gpio/sifive,gpio.yaml (revision b97ee269eae3cbaf35c18f51a459aea581c2a7dc)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/gpio/sifive,gpio.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
7c66ec88fSEmmanuel Vadottitle: SiFive GPIO controller
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotmaintainers:
10c66ec88fSEmmanuel Vadot  - Paul Walmsley <paul.walmsley@sifive.com>
11c66ec88fSEmmanuel Vadot
12c66ec88fSEmmanuel Vadotproperties:
13c66ec88fSEmmanuel Vadot  compatible:
14c66ec88fSEmmanuel Vadot    items:
155def4c47SEmmanuel Vadot      - enum:
165def4c47SEmmanuel Vadot          - sifive,fu540-c000-gpio
175def4c47SEmmanuel Vadot          - sifive,fu740-c000-gpio
185def4c47SEmmanuel Vadot          - canaan,k210-gpiohs
19c66ec88fSEmmanuel Vadot      - const: sifive,gpio0
20c66ec88fSEmmanuel Vadot
21c66ec88fSEmmanuel Vadot  reg:
22c66ec88fSEmmanuel Vadot    maxItems: 1
23c66ec88fSEmmanuel Vadot
24c66ec88fSEmmanuel Vadot  interrupts:
25c66ec88fSEmmanuel Vadot    description:
265def4c47SEmmanuel Vadot      Interrupt mapping, one per GPIO. Maximum 32 GPIOs.
27c66ec88fSEmmanuel Vadot    minItems: 1
285def4c47SEmmanuel Vadot    maxItems: 32
29c66ec88fSEmmanuel Vadot
30c66ec88fSEmmanuel Vadot  interrupt-controller: true
31c66ec88fSEmmanuel Vadot
32c66ec88fSEmmanuel Vadot  "#interrupt-cells":
33c66ec88fSEmmanuel Vadot    const: 2
34c66ec88fSEmmanuel Vadot
35c66ec88fSEmmanuel Vadot  clocks:
36c66ec88fSEmmanuel Vadot    maxItems: 1
37c66ec88fSEmmanuel Vadot
38c66ec88fSEmmanuel Vadot  "#gpio-cells":
39c66ec88fSEmmanuel Vadot    const: 2
40c66ec88fSEmmanuel Vadot
415def4c47SEmmanuel Vadot  ngpios:
425def4c47SEmmanuel Vadot    description:
435def4c47SEmmanuel Vadot      The number of GPIOs available on the controller implementation.
445def4c47SEmmanuel Vadot      It is 16 for the SiFive SoCs and 32 for the Canaan K210.
455def4c47SEmmanuel Vadot    minimum: 1
465def4c47SEmmanuel Vadot    maximum: 32
475def4c47SEmmanuel Vadot    default: 16
485def4c47SEmmanuel Vadot
49*b97ee269SEmmanuel Vadot  gpio-line-names:
50*b97ee269SEmmanuel Vadot    minItems: 1
51*b97ee269SEmmanuel Vadot    maxItems: 32
52*b97ee269SEmmanuel Vadot
53c66ec88fSEmmanuel Vadot  gpio-controller: true
54c66ec88fSEmmanuel Vadot
55c66ec88fSEmmanuel Vadotrequired:
56c66ec88fSEmmanuel Vadot  - compatible
57c66ec88fSEmmanuel Vadot  - reg
58c66ec88fSEmmanuel Vadot  - interrupts
59c66ec88fSEmmanuel Vadot  - interrupt-controller
60c66ec88fSEmmanuel Vadot  - "#interrupt-cells"
61c66ec88fSEmmanuel Vadot  - "#gpio-cells"
62c66ec88fSEmmanuel Vadot  - gpio-controller
63c66ec88fSEmmanuel Vadot
645def4c47SEmmanuel Vadotif:
655def4c47SEmmanuel Vadot  properties:
665def4c47SEmmanuel Vadot    compatible:
675def4c47SEmmanuel Vadot      contains:
685def4c47SEmmanuel Vadot        enum:
695def4c47SEmmanuel Vadot          - sifive,fu540-c000-gpio
705def4c47SEmmanuel Vadot          - sifive,fu740-c000-gpio
715def4c47SEmmanuel Vadotthen:
725def4c47SEmmanuel Vadot  required:
735def4c47SEmmanuel Vadot    - clocks
745def4c47SEmmanuel Vadot
75c66ec88fSEmmanuel VadotadditionalProperties: false
76c66ec88fSEmmanuel Vadot
77c66ec88fSEmmanuel Vadotexamples:
78c66ec88fSEmmanuel Vadot  - |
79c66ec88fSEmmanuel Vadot      #include <dt-bindings/clock/sifive-fu540-prci.h>
80c66ec88fSEmmanuel Vadot      gpio@10060000 {
81c66ec88fSEmmanuel Vadot        compatible = "sifive,fu540-c000-gpio", "sifive,gpio0";
82c66ec88fSEmmanuel Vadot        interrupt-parent = <&plic>;
83e67e8565SEmmanuel Vadot        interrupts = <7>, <8>, <9>, <10>, <11>, <12>, <13>, <14>, <15>, <16>,
84e67e8565SEmmanuel Vadot                     <17>, <18>, <19>, <20>, <21>, <22>;
85c66ec88fSEmmanuel Vadot        reg = <0x10060000 0x1000>;
86c9ccf3a3SEmmanuel Vadot        clocks = <&tlclk FU540_PRCI_CLK_TLCLK>;
87c66ec88fSEmmanuel Vadot        gpio-controller;
88c66ec88fSEmmanuel Vadot        #gpio-cells = <2>;
89c66ec88fSEmmanuel Vadot        interrupt-controller;
90c66ec88fSEmmanuel Vadot        #interrupt-cells = <2>;
91c66ec88fSEmmanuel Vadot      };
92c66ec88fSEmmanuel Vadot
93c66ec88fSEmmanuel Vadot...
94