xref: /freebsd/sys/contrib/device-tree/Bindings/gpio/socionext,uniphier-gpio.yaml (revision 2eb4d8dc723da3cf7d735a3226ae49da4c8c5dbc)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/gpio/socionext,uniphier-gpio.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
7c66ec88fSEmmanuel Vadottitle: UniPhier GPIO controller
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotmaintainers:
10c66ec88fSEmmanuel Vadot  - Masahiro Yamada <yamada.masahiro@socionext.com>
11c66ec88fSEmmanuel Vadot
12c66ec88fSEmmanuel Vadotproperties:
13c66ec88fSEmmanuel Vadot  $nodename:
14c66ec88fSEmmanuel Vadot    pattern: "^gpio@[0-9a-f]+$"
15c66ec88fSEmmanuel Vadot
16c66ec88fSEmmanuel Vadot  compatible:
17c66ec88fSEmmanuel Vadot    const: socionext,uniphier-gpio
18c66ec88fSEmmanuel Vadot
19c66ec88fSEmmanuel Vadot  reg:
20c66ec88fSEmmanuel Vadot    maxItems: 1
21c66ec88fSEmmanuel Vadot
22c66ec88fSEmmanuel Vadot  gpio-controller: true
23c66ec88fSEmmanuel Vadot
24c66ec88fSEmmanuel Vadot  "#gpio-cells":
25c66ec88fSEmmanuel Vadot    const: 2
26c66ec88fSEmmanuel Vadot
27c66ec88fSEmmanuel Vadot  interrupt-controller: true
28c66ec88fSEmmanuel Vadot
29c66ec88fSEmmanuel Vadot  "#interrupt-cells":
30c66ec88fSEmmanuel Vadot    description: |
31c66ec88fSEmmanuel Vadot      The first cell defines the interrupt number.
32c66ec88fSEmmanuel Vadot      The second cell bits[3:0] is used to specify trigger type as follows:
33c66ec88fSEmmanuel Vadot        1 = low-to-high edge triggered
34c66ec88fSEmmanuel Vadot        2 = high-to-low edge triggered
35c66ec88fSEmmanuel Vadot        4 = active high level-sensitive
36c66ec88fSEmmanuel Vadot        8 = active low level-sensitive
37c66ec88fSEmmanuel Vadot      Valid combinations are 1, 2, 3, 4, 8.
38c66ec88fSEmmanuel Vadot    const: 2
39c66ec88fSEmmanuel Vadot
40c66ec88fSEmmanuel Vadot  ngpios:
41c66ec88fSEmmanuel Vadot    minimum: 0
42c66ec88fSEmmanuel Vadot    maximum: 512
43c66ec88fSEmmanuel Vadot
44c66ec88fSEmmanuel Vadot  gpio-ranges: true
45c66ec88fSEmmanuel Vadot
46*2eb4d8dcSEmmanuel Vadot  gpio-ranges-group-names: true
47c66ec88fSEmmanuel Vadot
48c66ec88fSEmmanuel Vadot  socionext,interrupt-ranges:
49c66ec88fSEmmanuel Vadot    description: |
50c66ec88fSEmmanuel Vadot      Specifies an interrupt number mapping between this GPIO controller and
51c66ec88fSEmmanuel Vadot      its interrupt parent, in the form of arbitrary number of
52c66ec88fSEmmanuel Vadot      <child-interrupt-base parent-interrupt-base length> triplets.
53c66ec88fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32-matrix
54c66ec88fSEmmanuel Vadot
55c66ec88fSEmmanuel Vadotrequired:
56c66ec88fSEmmanuel Vadot  - compatible
57c66ec88fSEmmanuel Vadot  - reg
58c66ec88fSEmmanuel Vadot  - gpio-controller
59c66ec88fSEmmanuel Vadot  - "#gpio-cells"
60c66ec88fSEmmanuel Vadot  - interrupt-controller
61c66ec88fSEmmanuel Vadot  - "#interrupt-cells"
62c66ec88fSEmmanuel Vadot  - ngpios
63c66ec88fSEmmanuel Vadot  - gpio-ranges
64c66ec88fSEmmanuel Vadot  - socionext,interrupt-ranges
65c66ec88fSEmmanuel Vadot
666be33864SEmmanuel VadotadditionalProperties: false
676be33864SEmmanuel Vadot
68c66ec88fSEmmanuel Vadotexamples:
69c66ec88fSEmmanuel Vadot  - |
70c66ec88fSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
71c66ec88fSEmmanuel Vadot    #include <dt-bindings/gpio/uniphier-gpio.h>
72c66ec88fSEmmanuel Vadot
73c66ec88fSEmmanuel Vadot    gpio: gpio@55000000 {
74c66ec88fSEmmanuel Vadot        compatible = "socionext,uniphier-gpio";
75c66ec88fSEmmanuel Vadot        reg = <0x55000000 0x200>;
76c66ec88fSEmmanuel Vadot        interrupt-parent = <&aidet>;
77c66ec88fSEmmanuel Vadot        interrupt-controller;
78c66ec88fSEmmanuel Vadot        #interrupt-cells = <2>;
79c66ec88fSEmmanuel Vadot        gpio-controller;
80c66ec88fSEmmanuel Vadot        #gpio-cells = <2>;
81c66ec88fSEmmanuel Vadot        gpio-ranges = <&pinctrl 0 0 0>;
82c66ec88fSEmmanuel Vadot        gpio-ranges-group-names = "gpio_range";
83c66ec88fSEmmanuel Vadot        ngpios = <248>;
84c66ec88fSEmmanuel Vadot        socionext,interrupt-ranges = <0 48 16>, <16 154 5>, <21 217 3>;
85c66ec88fSEmmanuel Vadot    };
86c66ec88fSEmmanuel Vadot
87c66ec88fSEmmanuel Vadot    // Consumer:
88c66ec88fSEmmanuel Vadot    // Please note UNIPHIER_GPIO_PORT(29, 4) represents PORT294 in the SoC
89c66ec88fSEmmanuel Vadot    // document. Unfortunately, only the one's place is octal in the port
90c66ec88fSEmmanuel Vadot    // numbering. (That is, PORT 8, 9, 18, 19, 28, 29, ... do not exist.)
91c66ec88fSEmmanuel Vadot    // UNIPHIER_GPIO_PORT() is a helper macro to calculate 29 * 8 + 4.
92c66ec88fSEmmanuel Vadot    sdhci0_pwrseq {
93c66ec88fSEmmanuel Vadot        compatible = "mmc-pwrseq-emmc";
94c66ec88fSEmmanuel Vadot        reset-gpios = <&gpio UNIPHIER_GPIO_PORT(29, 4) GPIO_ACTIVE_LOW>;
95c66ec88fSEmmanuel Vadot    };
96