xref: /freebsd/sys/contrib/device-tree/Bindings/pinctrl/mediatek,mt8189-pinctrl.yaml (revision 833e5d42ab135b0238e61c5b3c19b8619677cbfa)
1*833e5d42SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*833e5d42SEmmanuel Vadot%YAML 1.2
3*833e5d42SEmmanuel Vadot---
4*833e5d42SEmmanuel Vadot$id: http://devicetree.org/schemas/pinctrl/mediatek,mt8189-pinctrl.yaml#
5*833e5d42SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*833e5d42SEmmanuel Vadot
7*833e5d42SEmmanuel Vadottitle: MediaTek MT8189 Pin Controller
8*833e5d42SEmmanuel Vadot
9*833e5d42SEmmanuel Vadotmaintainers:
10*833e5d42SEmmanuel Vadot  - Lei Xue <lei.xue@mediatek.com>
11*833e5d42SEmmanuel Vadot  - Cathy Xu <ot_cathy.xu@mediatek.com>
12*833e5d42SEmmanuel Vadot
13*833e5d42SEmmanuel Vadotdescription:
14*833e5d42SEmmanuel Vadot  The MediaTek's MT8189 Pin controller is used to control SoC pins.
15*833e5d42SEmmanuel Vadot
16*833e5d42SEmmanuel Vadotproperties:
17*833e5d42SEmmanuel Vadot  compatible:
18*833e5d42SEmmanuel Vadot    const: mediatek,mt8189-pinctrl
19*833e5d42SEmmanuel Vadot
20*833e5d42SEmmanuel Vadot  reg:
21*833e5d42SEmmanuel Vadot    items:
22*833e5d42SEmmanuel Vadot      - description: gpio base
23*833e5d42SEmmanuel Vadot      - description: lm group IO
24*833e5d42SEmmanuel Vadot      - description: rb0 group IO
25*833e5d42SEmmanuel Vadot      - description: rb1 group IO
26*833e5d42SEmmanuel Vadot      - description: bm0 group IO
27*833e5d42SEmmanuel Vadot      - description: bm1 group IO
28*833e5d42SEmmanuel Vadot      - description: bm2 group IO
29*833e5d42SEmmanuel Vadot      - description: lt0 group IO
30*833e5d42SEmmanuel Vadot      - description: lt1 group IO
31*833e5d42SEmmanuel Vadot      - description: rt group IO
32*833e5d42SEmmanuel Vadot      - description: eint0 group IO
33*833e5d42SEmmanuel Vadot      - description: eint1 group IO
34*833e5d42SEmmanuel Vadot      - description: eint2 group IO
35*833e5d42SEmmanuel Vadot      - description: eint3 group IO
36*833e5d42SEmmanuel Vadot      - description: eint4 group IO
37*833e5d42SEmmanuel Vadot
38*833e5d42SEmmanuel Vadot  reg-names:
39*833e5d42SEmmanuel Vadot    items:
40*833e5d42SEmmanuel Vadot      - const: base
41*833e5d42SEmmanuel Vadot      - const: lm
42*833e5d42SEmmanuel Vadot      - const: rb0
43*833e5d42SEmmanuel Vadot      - const: rb1
44*833e5d42SEmmanuel Vadot      - const: bm0
45*833e5d42SEmmanuel Vadot      - const: bm1
46*833e5d42SEmmanuel Vadot      - const: bm2
47*833e5d42SEmmanuel Vadot      - const: lt0
48*833e5d42SEmmanuel Vadot      - const: lt1
49*833e5d42SEmmanuel Vadot      - const: rt
50*833e5d42SEmmanuel Vadot      - const: eint0
51*833e5d42SEmmanuel Vadot      - const: eint1
52*833e5d42SEmmanuel Vadot      - const: eint2
53*833e5d42SEmmanuel Vadot      - const: eint3
54*833e5d42SEmmanuel Vadot      - const: eint4
55*833e5d42SEmmanuel Vadot
56*833e5d42SEmmanuel Vadot  interrupts:
57*833e5d42SEmmanuel Vadot    maxItems: 1
58*833e5d42SEmmanuel Vadot
59*833e5d42SEmmanuel Vadot  interrupt-controller: true
60*833e5d42SEmmanuel Vadot
61*833e5d42SEmmanuel Vadot  '#interrupt-cells':
62*833e5d42SEmmanuel Vadot    const: 2
63*833e5d42SEmmanuel Vadot
64*833e5d42SEmmanuel Vadot  gpio-controller: true
65*833e5d42SEmmanuel Vadot
66*833e5d42SEmmanuel Vadot  '#gpio-cells':
67*833e5d42SEmmanuel Vadot    const: 2
68*833e5d42SEmmanuel Vadot
69*833e5d42SEmmanuel Vadot  gpio-ranges:
70*833e5d42SEmmanuel Vadot    maxItems: 1
71*833e5d42SEmmanuel Vadot
72*833e5d42SEmmanuel Vadot  gpio-line-names: true
73*833e5d42SEmmanuel Vadot
74*833e5d42SEmmanuel Vadot# PIN CONFIGURATION NODES
75*833e5d42SEmmanuel VadotpatternProperties:
76*833e5d42SEmmanuel Vadot  '-pins$':
77*833e5d42SEmmanuel Vadot    type: object
78*833e5d42SEmmanuel Vadot    additionalProperties: false
79*833e5d42SEmmanuel Vadot
80*833e5d42SEmmanuel Vadot    patternProperties:
81*833e5d42SEmmanuel Vadot      '^pins':
82*833e5d42SEmmanuel Vadot        type: object
83*833e5d42SEmmanuel Vadot        $ref: /schemas/pinctrl/pincfg-node.yaml
84*833e5d42SEmmanuel Vadot        additionalProperties: false
85*833e5d42SEmmanuel Vadot        description:
86*833e5d42SEmmanuel Vadot          A pinctrl node should contain at least one subnode representing the
87*833e5d42SEmmanuel Vadot          pinctrl groups available on the machine. Each subnode will list the
88*833e5d42SEmmanuel Vadot          pins it needs, and how they should be configured, with regard to muxer
89*833e5d42SEmmanuel Vadot          configuration, pullups, drive strength, input enable/disable and input
90*833e5d42SEmmanuel Vadot          schmitt.
91*833e5d42SEmmanuel Vadot
92*833e5d42SEmmanuel Vadot        properties:
93*833e5d42SEmmanuel Vadot          pinmux:
94*833e5d42SEmmanuel Vadot            description:
95*833e5d42SEmmanuel Vadot              Integer array, represents gpio pin number and mux setting.
96*833e5d42SEmmanuel Vadot              Supported pin number and mux varies for different SoCs, and are
97*833e5d42SEmmanuel Vadot              defined as macros in arch/arm64/boot/dts/mediatek/mt8189-pinfunc.h
98*833e5d42SEmmanuel Vadot              directly, for this SoC.
99*833e5d42SEmmanuel Vadot
100*833e5d42SEmmanuel Vadot          drive-strength:
101*833e5d42SEmmanuel Vadot            enum: [2, 4, 6, 8, 10, 12, 14, 16]
102*833e5d42SEmmanuel Vadot
103*833e5d42SEmmanuel Vadot          bias-pull-down:
104*833e5d42SEmmanuel Vadot            oneOf:
105*833e5d42SEmmanuel Vadot              - type: boolean
106*833e5d42SEmmanuel Vadot              - enum: [100, 101, 102, 103]
107*833e5d42SEmmanuel Vadot                description: mt8189 pull down PUPD/R0/R1 type define value.
108*833e5d42SEmmanuel Vadot              - enum: [75000, 5000]
109*833e5d42SEmmanuel Vadot                description: mt8189 pull down RSEL type si unit value(ohm).
110*833e5d42SEmmanuel Vadot            description: |
111*833e5d42SEmmanuel Vadot              For pull down type is normal, it doesn't need add R1R0 define
112*833e5d42SEmmanuel Vadot              and resistance value.
113*833e5d42SEmmanuel Vadot
114*833e5d42SEmmanuel Vadot              For pull down type is PUPD/R0/R1 type, it can add R1R0 define to
115*833e5d42SEmmanuel Vadot              set different resistance. It can support "MTK_PUPD_SET_R1R0_00" &
116*833e5d42SEmmanuel Vadot              "MTK_PUPD_SET_R1R0_01" & "MTK_PUPD_SET_R1R0_10" &
117*833e5d42SEmmanuel Vadot              "MTK_PUPD_SET_R1R0_11" define in mt8189.
118*833e5d42SEmmanuel Vadot
119*833e5d42SEmmanuel Vadot              For pull down type is PD/RSEL, it can add resistance value(ohm)
120*833e5d42SEmmanuel Vadot              to set different resistance by identifying property
121*833e5d42SEmmanuel Vadot              "mediatek,rsel-resistance-in-si-unit".
122*833e5d42SEmmanuel Vadot
123*833e5d42SEmmanuel Vadot          bias-pull-up:
124*833e5d42SEmmanuel Vadot            oneOf:
125*833e5d42SEmmanuel Vadot              - type: boolean
126*833e5d42SEmmanuel Vadot              - enum: [100, 101, 102, 103]
127*833e5d42SEmmanuel Vadot                description: mt8189 pull up PUPD/R0/R1 type define value.
128*833e5d42SEmmanuel Vadot              - enum: [1000, 1500, 2000, 3000, 4000, 5000, 75000]
129*833e5d42SEmmanuel Vadot                description: mt8189 pull up RSEL type si unit value(ohm).
130*833e5d42SEmmanuel Vadot            description: |
131*833e5d42SEmmanuel Vadot              For pull up type is normal, it don't need add R1R0 define
132*833e5d42SEmmanuel Vadot              and resistance value.
133*833e5d42SEmmanuel Vadot
134*833e5d42SEmmanuel Vadot              For pull up type is PUPD/R0/R1 type, it can add R1R0 define to
135*833e5d42SEmmanuel Vadot              set different resistance. It can support "MTK_PUPD_SET_R1R0_00" &
136*833e5d42SEmmanuel Vadot              "MTK_PUPD_SET_R1R0_01" & "MTK_PUPD_SET_R1R0_10" &
137*833e5d42SEmmanuel Vadot              "MTK_PUPD_SET_R1R0_11" define in mt8189.
138*833e5d42SEmmanuel Vadot
139*833e5d42SEmmanuel Vadot              For pull up type is PU/RSEL, it can add resistance value(ohm)
140*833e5d42SEmmanuel Vadot              to set different resistance by identifying property
141*833e5d42SEmmanuel Vadot              "mediatek,rsel-resistance-in-si-unit".
142*833e5d42SEmmanuel Vadot
143*833e5d42SEmmanuel Vadot          bias-disable: true
144*833e5d42SEmmanuel Vadot
145*833e5d42SEmmanuel Vadot          output-high: true
146*833e5d42SEmmanuel Vadot
147*833e5d42SEmmanuel Vadot          output-low: true
148*833e5d42SEmmanuel Vadot
149*833e5d42SEmmanuel Vadot          input-enable: true
150*833e5d42SEmmanuel Vadot
151*833e5d42SEmmanuel Vadot          input-disable: true
152*833e5d42SEmmanuel Vadot
153*833e5d42SEmmanuel Vadot          input-schmitt-enable: true
154*833e5d42SEmmanuel Vadot
155*833e5d42SEmmanuel Vadot          input-schmitt-disable: true
156*833e5d42SEmmanuel Vadot
157*833e5d42SEmmanuel Vadot        required:
158*833e5d42SEmmanuel Vadot          - pinmux
159*833e5d42SEmmanuel Vadot
160*833e5d42SEmmanuel Vadotrequired:
161*833e5d42SEmmanuel Vadot  - compatible
162*833e5d42SEmmanuel Vadot  - reg
163*833e5d42SEmmanuel Vadot  - interrupts
164*833e5d42SEmmanuel Vadot  - interrupt-controller
165*833e5d42SEmmanuel Vadot  - '#interrupt-cells'
166*833e5d42SEmmanuel Vadot  - gpio-controller
167*833e5d42SEmmanuel Vadot  - '#gpio-cells'
168*833e5d42SEmmanuel Vadot  - gpio-ranges
169*833e5d42SEmmanuel Vadot
170*833e5d42SEmmanuel VadotadditionalProperties: false
171*833e5d42SEmmanuel Vadot
172*833e5d42SEmmanuel Vadotexamples:
173*833e5d42SEmmanuel Vadot  - |
174*833e5d42SEmmanuel Vadot    #include <dt-bindings/pinctrl/mt65xx.h>
175*833e5d42SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
176*833e5d42SEmmanuel Vadot    #define PINMUX_GPIO51__FUNC_SCL0 (MTK_PIN_NO(51) | 2)
177*833e5d42SEmmanuel Vadot    #define PINMUX_GPIO52__FUNC_SDA0 (MTK_PIN_NO(52) | 2)
178*833e5d42SEmmanuel Vadot
179*833e5d42SEmmanuel Vadot    pio: pinctrl@10005000 {
180*833e5d42SEmmanuel Vadot        compatible = "mediatek,mt8189-pinctrl";
181*833e5d42SEmmanuel Vadot        reg = <0x10005000 0x1000>,
182*833e5d42SEmmanuel Vadot              <0x11b50000 0x1000>,
183*833e5d42SEmmanuel Vadot              <0x11c50000 0x1000>,
184*833e5d42SEmmanuel Vadot              <0x11c60000 0x1000>,
185*833e5d42SEmmanuel Vadot              <0x11d20000 0x1000>,
186*833e5d42SEmmanuel Vadot              <0x11d30000 0x1000>,
187*833e5d42SEmmanuel Vadot              <0x11d40000 0x1000>,
188*833e5d42SEmmanuel Vadot              <0x11e20000 0x1000>,
189*833e5d42SEmmanuel Vadot              <0x11e30000 0x1000>,
190*833e5d42SEmmanuel Vadot              <0x11f20000 0x1000>,
191*833e5d42SEmmanuel Vadot              <0x11ce0000 0x1000>,
192*833e5d42SEmmanuel Vadot              <0x11de0000 0x1000>,
193*833e5d42SEmmanuel Vadot              <0x11e60000 0x1000>,
194*833e5d42SEmmanuel Vadot              <0x1c01e000 0x1000>,
195*833e5d42SEmmanuel Vadot              <0x11f00000 0x1000>;
196*833e5d42SEmmanuel Vadot        reg-names = "base", "lm", "rb0", "rb1", "bm0" , "bm1",
197*833e5d42SEmmanuel Vadot                    "bm2", "lt0", "lt1", "rt", "eint0", "eint1",
198*833e5d42SEmmanuel Vadot                    "eint2", "eint3", "eint4";
199*833e5d42SEmmanuel Vadot        gpio-controller;
200*833e5d42SEmmanuel Vadot        #gpio-cells = <2>;
201*833e5d42SEmmanuel Vadot        gpio-ranges = <&pio 0 0 182>;
202*833e5d42SEmmanuel Vadot        interrupt-controller;
203*833e5d42SEmmanuel Vadot        interrupts = <GIC_SPI 239 IRQ_TYPE_LEVEL_HIGH 0>;
204*833e5d42SEmmanuel Vadot        #interrupt-cells = <2>;
205*833e5d42SEmmanuel Vadot
206*833e5d42SEmmanuel Vadot        i2c0-pins {
207*833e5d42SEmmanuel Vadot            pins {
208*833e5d42SEmmanuel Vadot                pinmux = <PINMUX_GPIO51__FUNC_SCL0>,
209*833e5d42SEmmanuel Vadot                         <PINMUX_GPIO52__FUNC_SDA0>;
210*833e5d42SEmmanuel Vadot                bias-disable;
211*833e5d42SEmmanuel Vadot            };
212*833e5d42SEmmanuel Vadot        };
213*833e5d42SEmmanuel Vadot    };
214