1e67e8565SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2e67e8565SEmmanuel Vadot%YAML 1.2
3e67e8565SEmmanuel Vadot---
4e67e8565SEmmanuel Vadot$id: http://devicetree.org/schemas/gpio/brcm,brcmstb-gpio.yaml#
5e67e8565SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6e67e8565SEmmanuel Vadot
7e67e8565SEmmanuel Vadottitle: Broadcom STB "UPG GIO" GPIO controller
8e67e8565SEmmanuel Vadot
9e67e8565SEmmanuel Vadotdescription: >
10e67e8565SEmmanuel Vadot  The controller's registers are organized as sets of eight 32-bit
11e67e8565SEmmanuel Vadot  registers with each set controlling a bank of up to 32 pins.  A single
12e67e8565SEmmanuel Vadot  interrupt is shared for all of the banks handled by the controller.
13e67e8565SEmmanuel Vadot
14e67e8565SEmmanuel Vadotmaintainers:
15e67e8565SEmmanuel Vadot  - Doug Berger <opendmb@gmail.com>
16e67e8565SEmmanuel Vadot  - Florian Fainelli <f.fainelli@gmail.com>
17e67e8565SEmmanuel Vadot
18e67e8565SEmmanuel Vadotproperties:
19e67e8565SEmmanuel Vadot  compatible:
20e67e8565SEmmanuel Vadot    items:
21e67e8565SEmmanuel Vadot      - enum:
22e67e8565SEmmanuel Vadot          - brcm,bcm7445-gpio
23e67e8565SEmmanuel Vadot      - const: brcm,brcmstb-gpio
24e67e8565SEmmanuel Vadot
25e67e8565SEmmanuel Vadot  reg:
26e67e8565SEmmanuel Vadot    maxItems: 1
27e67e8565SEmmanuel Vadot    description: >
28e67e8565SEmmanuel Vadot      Define the base and range of the I/O address space containing
29e67e8565SEmmanuel Vadot      the brcmstb GPIO controller registers
30e67e8565SEmmanuel Vadot
31e67e8565SEmmanuel Vadot  "#gpio-cells":
32e67e8565SEmmanuel Vadot    const: 2
33e67e8565SEmmanuel Vadot    description: >
34e67e8565SEmmanuel Vadot      The first cell is the pin number (within the controller's
35e67e8565SEmmanuel Vadot      pin space), and the second is used for the following:
36e67e8565SEmmanuel Vadot      bit[0]: polarity (0 for active-high, 1 for active-low)
37e67e8565SEmmanuel Vadot
38e67e8565SEmmanuel Vadot  gpio-controller: true
39e67e8565SEmmanuel Vadot
40e67e8565SEmmanuel Vadot  brcm,gpio-bank-widths:
41e67e8565SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32-array
42e67e8565SEmmanuel Vadot    description: >
43e67e8565SEmmanuel Vadot      Number of GPIO lines for each bank.  Number of elements must
44e67e8565SEmmanuel Vadot      correspond to number of banks suggested by the 'reg' property.
45e67e8565SEmmanuel Vadot
46e67e8565SEmmanuel Vadot  interrupts:
47e67e8565SEmmanuel Vadot    maxItems: 1
48e67e8565SEmmanuel Vadot    description: >
49e67e8565SEmmanuel Vadot      The interrupt shared by all GPIO lines for this controller.
50e67e8565SEmmanuel Vadot
51e67e8565SEmmanuel Vadot  "#interrupt-cells":
52e67e8565SEmmanuel Vadot    const: 2
53e67e8565SEmmanuel Vadot    description: |
54e67e8565SEmmanuel Vadot      The first cell is the GPIO number, the second should specify
55e67e8565SEmmanuel Vadot      flags.  The following subset of flags is supported:
56e67e8565SEmmanuel Vadot      - bits[3:0] trigger type and level flags
57e67e8565SEmmanuel Vadot        1 = low-to-high edge triggered
58e67e8565SEmmanuel Vadot        2 = high-to-low edge triggered
59e67e8565SEmmanuel Vadot        4 = active high level-sensitive
60e67e8565SEmmanuel Vadot        8 = active low level-sensitive
61e67e8565SEmmanuel Vadot      Valid combinations are 1, 2, 3, 4, 8.
62e67e8565SEmmanuel Vadot
63e67e8565SEmmanuel Vadot  interrupt-controller: true
64e67e8565SEmmanuel Vadot
65e67e8565SEmmanuel Vadot  wakeup-source:
66e67e8565SEmmanuel Vadot    type: boolean
67e67e8565SEmmanuel Vadot    description: >
68e67e8565SEmmanuel Vadot      GPIOs for this controller can be used as a wakeup source
69e67e8565SEmmanuel Vadot
70e67e8565SEmmanuel Vadotrequired:
71e67e8565SEmmanuel Vadot  - compatible
72e67e8565SEmmanuel Vadot  - reg
73e67e8565SEmmanuel Vadot  - gpio-controller
74e67e8565SEmmanuel Vadot  - "#gpio-cells"
75*8d13bc63SEmmanuel Vadot  - brcm,gpio-bank-widths
76e67e8565SEmmanuel Vadot
77e67e8565SEmmanuel VadotadditionalProperties: false
78e67e8565SEmmanuel Vadot
79e67e8565SEmmanuel Vadotexamples:
80e67e8565SEmmanuel Vadot  - |
81e67e8565SEmmanuel Vadot    upg_gio: gpio@f040a700 {
82e67e8565SEmmanuel Vadot        #gpio-cells = <2>;
83e67e8565SEmmanuel Vadot        #interrupt-cells = <2>;
84e67e8565SEmmanuel Vadot        compatible = "brcm,bcm7445-gpio", "brcm,brcmstb-gpio";
85e67e8565SEmmanuel Vadot        gpio-controller;
86e67e8565SEmmanuel Vadot        interrupt-controller;
87e67e8565SEmmanuel Vadot        reg = <0xf040a700 0x80>;
88e67e8565SEmmanuel Vadot        interrupt-parent = <&irq0_intc>;
89e67e8565SEmmanuel Vadot        interrupts = <0x6>;
90e67e8565SEmmanuel Vadot        brcm,gpio-bank-widths = <32 32 32 24>;
91e67e8565SEmmanuel Vadot    };
92e67e8565SEmmanuel Vadot
93e67e8565SEmmanuel Vadot    upg_gio_aon: gpio@f04172c0 {
94e67e8565SEmmanuel Vadot        #gpio-cells = <2>;
95e67e8565SEmmanuel Vadot        #interrupt-cells = <2>;
96e67e8565SEmmanuel Vadot        compatible = "brcm,bcm7445-gpio", "brcm,brcmstb-gpio";
97e67e8565SEmmanuel Vadot        gpio-controller;
98e67e8565SEmmanuel Vadot        interrupt-controller;
99e67e8565SEmmanuel Vadot        reg = <0xf04172c0 0x40>;
100e67e8565SEmmanuel Vadot        interrupt-parent = <&irq0_aon_intc>;
101e67e8565SEmmanuel Vadot        interrupts = <0x6>;
102e67e8565SEmmanuel Vadot        wakeup-source;
103e67e8565SEmmanuel Vadot        brcm,gpio-bank-widths = <18 4>;
104e67e8565SEmmanuel Vadot    };
105