xref: /freebsd/sys/contrib/device-tree/Bindings/gpio/nuvoton,sgpio.yaml (revision 8d13bc63c0e1d50bc9e47ac1f26329c999bfecf0)
1*8d13bc63SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*8d13bc63SEmmanuel Vadot%YAML 1.2
3*8d13bc63SEmmanuel Vadot---
4*8d13bc63SEmmanuel Vadot$id: http://devicetree.org/schemas/gpio/nuvoton,sgpio.yaml#
5*8d13bc63SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*8d13bc63SEmmanuel Vadot
7*8d13bc63SEmmanuel Vadottitle: Nuvoton SGPIO controller
8*8d13bc63SEmmanuel Vadot
9*8d13bc63SEmmanuel Vadotmaintainers:
10*8d13bc63SEmmanuel Vadot  - Jim LIU <JJLIU0@nuvoton.com>
11*8d13bc63SEmmanuel Vadot
12*8d13bc63SEmmanuel Vadotdescription: |
13*8d13bc63SEmmanuel Vadot  This SGPIO controller is for NUVOTON NPCM7xx and NPCM8xx SoC and detailed
14*8d13bc63SEmmanuel Vadot  information is in the NPCM7XX/8XX SERIAL I/O EXPANSION INTERFACE section.
15*8d13bc63SEmmanuel Vadot  Nuvoton NPCM7xx SGPIO module is combines a serial to parallel IC (HC595)
16*8d13bc63SEmmanuel Vadot  and a parallel to serial IC (HC165).
17*8d13bc63SEmmanuel Vadot  Clock is a division of the APB3 clock.
18*8d13bc63SEmmanuel Vadot  This interface has 4 pins (D_out , D_in, S_CLK, LDSH).
19*8d13bc63SEmmanuel Vadot  NPCM7xx/NPCM8xx have two sgpio modules. Each module can support up
20*8d13bc63SEmmanuel Vadot  to 64 output pins, and up to 64 input pins, the pin is only for GPI or GPO.
21*8d13bc63SEmmanuel Vadot  GPIO pins can be programmed to support the following options
22*8d13bc63SEmmanuel Vadot  - Support interrupt option for each input port and various interrupt
23*8d13bc63SEmmanuel Vadot    sensitivity options (level-high, level-low, edge-high, edge-low)
24*8d13bc63SEmmanuel Vadot  - ngpios is number of nuvoton,input-ngpios GPIO lines and nuvoton,output-ngpios GPIO lines.
25*8d13bc63SEmmanuel Vadot    nuvoton,input-ngpios GPIO lines is only for GPI.
26*8d13bc63SEmmanuel Vadot    nuvoton,output-ngpios GPIO lines is only for GPO.
27*8d13bc63SEmmanuel Vadot
28*8d13bc63SEmmanuel Vadotproperties:
29*8d13bc63SEmmanuel Vadot  compatible:
30*8d13bc63SEmmanuel Vadot    enum:
31*8d13bc63SEmmanuel Vadot      - nuvoton,npcm750-sgpio
32*8d13bc63SEmmanuel Vadot      - nuvoton,npcm845-sgpio
33*8d13bc63SEmmanuel Vadot
34*8d13bc63SEmmanuel Vadot  reg:
35*8d13bc63SEmmanuel Vadot    maxItems: 1
36*8d13bc63SEmmanuel Vadot
37*8d13bc63SEmmanuel Vadot  gpio-controller: true
38*8d13bc63SEmmanuel Vadot
39*8d13bc63SEmmanuel Vadot  '#gpio-cells':
40*8d13bc63SEmmanuel Vadot    const: 2
41*8d13bc63SEmmanuel Vadot
42*8d13bc63SEmmanuel Vadot  interrupts:
43*8d13bc63SEmmanuel Vadot    maxItems: 1
44*8d13bc63SEmmanuel Vadot
45*8d13bc63SEmmanuel Vadot  clocks:
46*8d13bc63SEmmanuel Vadot    maxItems: 1
47*8d13bc63SEmmanuel Vadot
48*8d13bc63SEmmanuel Vadot  nuvoton,input-ngpios:
49*8d13bc63SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
50*8d13bc63SEmmanuel Vadot    description:
51*8d13bc63SEmmanuel Vadot      The numbers of GPIO's exposed. GPIO lines are only for GPI.
52*8d13bc63SEmmanuel Vadot    minimum: 0
53*8d13bc63SEmmanuel Vadot    maximum: 64
54*8d13bc63SEmmanuel Vadot
55*8d13bc63SEmmanuel Vadot  nuvoton,output-ngpios:
56*8d13bc63SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
57*8d13bc63SEmmanuel Vadot    description:
58*8d13bc63SEmmanuel Vadot      The numbers of GPIO's exposed. GPIO lines are only for GPO.
59*8d13bc63SEmmanuel Vadot    minimum: 0
60*8d13bc63SEmmanuel Vadot    maximum: 64
61*8d13bc63SEmmanuel Vadot
62*8d13bc63SEmmanuel Vadotrequired:
63*8d13bc63SEmmanuel Vadot  - compatible
64*8d13bc63SEmmanuel Vadot  - reg
65*8d13bc63SEmmanuel Vadot  - gpio-controller
66*8d13bc63SEmmanuel Vadot  - '#gpio-cells'
67*8d13bc63SEmmanuel Vadot  - interrupts
68*8d13bc63SEmmanuel Vadot  - nuvoton,input-ngpios
69*8d13bc63SEmmanuel Vadot  - nuvoton,output-ngpios
70*8d13bc63SEmmanuel Vadot  - clocks
71*8d13bc63SEmmanuel Vadot
72*8d13bc63SEmmanuel VadotadditionalProperties: false
73*8d13bc63SEmmanuel Vadot
74*8d13bc63SEmmanuel Vadotexamples:
75*8d13bc63SEmmanuel Vadot  - |
76*8d13bc63SEmmanuel Vadot    #include <dt-bindings/clock/nuvoton,npcm7xx-clock.h>
77*8d13bc63SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
78*8d13bc63SEmmanuel Vadot    gpio8: gpio@101000 {
79*8d13bc63SEmmanuel Vadot        compatible = "nuvoton,npcm750-sgpio";
80*8d13bc63SEmmanuel Vadot        reg = <0x101000 0x200>;
81*8d13bc63SEmmanuel Vadot        clocks = <&clk NPCM7XX_CLK_APB3>;
82*8d13bc63SEmmanuel Vadot        interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
83*8d13bc63SEmmanuel Vadot        gpio-controller;
84*8d13bc63SEmmanuel Vadot        #gpio-cells = <2>;
85*8d13bc63SEmmanuel Vadot        nuvoton,input-ngpios = <64>;
86*8d13bc63SEmmanuel Vadot        nuvoton,output-ngpios = <64>;
87*8d13bc63SEmmanuel Vadot    };
88