xref: /freebsd/sys/contrib/device-tree/Bindings/pinctrl/mediatek,mt6893-pinctrl.yaml (revision ae5de77ed78ae54d86cead5604869212e8008e6b)
1*ae5de77eSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*ae5de77eSEmmanuel Vadot%YAML 1.2
3*ae5de77eSEmmanuel Vadot---
4*ae5de77eSEmmanuel Vadot$id: http://devicetree.org/schemas/pinctrl/mediatek,mt6893-pinctrl.yaml#
5*ae5de77eSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*ae5de77eSEmmanuel Vadot
7*ae5de77eSEmmanuel Vadottitle: MediaTek MT6893 Pin Controller
8*ae5de77eSEmmanuel Vadot
9*ae5de77eSEmmanuel Vadotmaintainers:
10*ae5de77eSEmmanuel Vadot  - AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
11*ae5de77eSEmmanuel Vadot
12*ae5de77eSEmmanuel Vadotdescription:
13*ae5de77eSEmmanuel Vadot  The MediaTek's MT6893 Pin controller is used to control SoC pins.
14*ae5de77eSEmmanuel Vadot
15*ae5de77eSEmmanuel Vadotproperties:
16*ae5de77eSEmmanuel Vadot  compatible:
17*ae5de77eSEmmanuel Vadot    const: mediatek,mt6893-pinctrl
18*ae5de77eSEmmanuel Vadot
19*ae5de77eSEmmanuel Vadot  reg:
20*ae5de77eSEmmanuel Vadot    items:
21*ae5de77eSEmmanuel Vadot      - description: pin controller base
22*ae5de77eSEmmanuel Vadot      - description: rm group IO
23*ae5de77eSEmmanuel Vadot      - description: bm group IO
24*ae5de77eSEmmanuel Vadot      - description: lm group IO
25*ae5de77eSEmmanuel Vadot      - description: lb group IO
26*ae5de77eSEmmanuel Vadot      - description: rt group IO
27*ae5de77eSEmmanuel Vadot      - description: lt group IO
28*ae5de77eSEmmanuel Vadot      - description: tm group IO
29*ae5de77eSEmmanuel Vadot      - description: External Interrupt (EINT) controller base
30*ae5de77eSEmmanuel Vadot
31*ae5de77eSEmmanuel Vadot  reg-names:
32*ae5de77eSEmmanuel Vadot    items:
33*ae5de77eSEmmanuel Vadot      - const: base
34*ae5de77eSEmmanuel Vadot      - const: rm
35*ae5de77eSEmmanuel Vadot      - const: bm
36*ae5de77eSEmmanuel Vadot      - const: lm
37*ae5de77eSEmmanuel Vadot      - const: lb
38*ae5de77eSEmmanuel Vadot      - const: rt
39*ae5de77eSEmmanuel Vadot      - const: lt
40*ae5de77eSEmmanuel Vadot      - const: tm
41*ae5de77eSEmmanuel Vadot      - const: eint
42*ae5de77eSEmmanuel Vadot
43*ae5de77eSEmmanuel Vadot  gpio-controller: true
44*ae5de77eSEmmanuel Vadot
45*ae5de77eSEmmanuel Vadot  '#gpio-cells':
46*ae5de77eSEmmanuel Vadot    description:
47*ae5de77eSEmmanuel Vadot      Number of cells in GPIO specifier. Since the generic GPIO binding is used,
48*ae5de77eSEmmanuel Vadot      the amount of cells must be specified as 2. See the below mentioned gpio
49*ae5de77eSEmmanuel Vadot      binding representation for description of particular cells.
50*ae5de77eSEmmanuel Vadot    const: 2
51*ae5de77eSEmmanuel Vadot
52*ae5de77eSEmmanuel Vadot  gpio-ranges:
53*ae5de77eSEmmanuel Vadot    maxItems: 1
54*ae5de77eSEmmanuel Vadot
55*ae5de77eSEmmanuel Vadot  gpio-line-names: true
56*ae5de77eSEmmanuel Vadot
57*ae5de77eSEmmanuel Vadot  interrupts:
58*ae5de77eSEmmanuel Vadot    description: The interrupt outputs to sysirq
59*ae5de77eSEmmanuel Vadot    maxItems: 1
60*ae5de77eSEmmanuel Vadot
61*ae5de77eSEmmanuel Vadot  interrupt-controller: true
62*ae5de77eSEmmanuel Vadot
63*ae5de77eSEmmanuel Vadot  '#interrupt-cells':
64*ae5de77eSEmmanuel Vadot    const: 2
65*ae5de77eSEmmanuel Vadot
66*ae5de77eSEmmanuel Vadot# PIN CONFIGURATION NODES
67*ae5de77eSEmmanuel VadotpatternProperties:
68*ae5de77eSEmmanuel Vadot  '-pins$':
69*ae5de77eSEmmanuel Vadot    type: object
70*ae5de77eSEmmanuel Vadot    additionalProperties: false
71*ae5de77eSEmmanuel Vadot
72*ae5de77eSEmmanuel Vadot    patternProperties:
73*ae5de77eSEmmanuel Vadot      '^pins':
74*ae5de77eSEmmanuel Vadot        type: object
75*ae5de77eSEmmanuel Vadot        allOf:
76*ae5de77eSEmmanuel Vadot          - $ref: /schemas/pinctrl/pincfg-node.yaml
77*ae5de77eSEmmanuel Vadot          - $ref: /schemas/pinctrl/pinmux-node.yaml
78*ae5de77eSEmmanuel Vadot        description:
79*ae5de77eSEmmanuel Vadot          A pinctrl node should contain at least one subnodes representing the
80*ae5de77eSEmmanuel Vadot          pinctrl groups available on the machine. Each subnode will list the
81*ae5de77eSEmmanuel Vadot          pins it needs, and how they should be configured, with regard to muxer
82*ae5de77eSEmmanuel Vadot          configuration, pullups, drive strength, input enable/disable and input
83*ae5de77eSEmmanuel Vadot          schmitt.
84*ae5de77eSEmmanuel Vadot
85*ae5de77eSEmmanuel Vadot        properties:
86*ae5de77eSEmmanuel Vadot          pinmux:
87*ae5de77eSEmmanuel Vadot            description:
88*ae5de77eSEmmanuel Vadot              Integer array, represents gpio pin number and mux setting.
89*ae5de77eSEmmanuel Vadot              Supported pin number and mux are defined as macros in
90*ae5de77eSEmmanuel Vadot              arch/arm64/boot/dts/mediatek/mt8196-pinfunc.h for this SoC.
91*ae5de77eSEmmanuel Vadot
92*ae5de77eSEmmanuel Vadot          drive-strength:
93*ae5de77eSEmmanuel Vadot            enum: [2, 4, 6, 8, 10, 12, 14, 16]
94*ae5de77eSEmmanuel Vadot
95*ae5de77eSEmmanuel Vadot          drive-strength-microamp:
96*ae5de77eSEmmanuel Vadot            enum: [125, 250, 500, 1000]
97*ae5de77eSEmmanuel Vadot
98*ae5de77eSEmmanuel Vadot          bias-pull-down:
99*ae5de77eSEmmanuel Vadot            oneOf:
100*ae5de77eSEmmanuel Vadot              - type: boolean
101*ae5de77eSEmmanuel Vadot              - enum: [75000, 5000]
102*ae5de77eSEmmanuel Vadot                description: Pull down RSEL type resistance values (in ohms)
103*ae5de77eSEmmanuel Vadot            description:
104*ae5de77eSEmmanuel Vadot              For normal pull down type there is no need to specify a resistance
105*ae5de77eSEmmanuel Vadot              value, hence this can be specified as a boolean property.
106*ae5de77eSEmmanuel Vadot              For RSEL pull down type a resistance value (in ohms) can be added.
107*ae5de77eSEmmanuel Vadot
108*ae5de77eSEmmanuel Vadot          bias-pull-up:
109*ae5de77eSEmmanuel Vadot            oneOf:
110*ae5de77eSEmmanuel Vadot              - type: boolean
111*ae5de77eSEmmanuel Vadot              - enum: [10000, 5000, 4000, 3000]
112*ae5de77eSEmmanuel Vadot                description: Pull up RSEL type resistance values (in ohms)
113*ae5de77eSEmmanuel Vadot            description:
114*ae5de77eSEmmanuel Vadot              For normal pull up type there is no need to specify a resistance
115*ae5de77eSEmmanuel Vadot              value, hence this can be specified as a boolean property.
116*ae5de77eSEmmanuel Vadot              For RSEL pull up type a resistance value (in ohms) can be added.
117*ae5de77eSEmmanuel Vadot
118*ae5de77eSEmmanuel Vadot          bias-disable: true
119*ae5de77eSEmmanuel Vadot
120*ae5de77eSEmmanuel Vadot          output-high: true
121*ae5de77eSEmmanuel Vadot
122*ae5de77eSEmmanuel Vadot          output-low: true
123*ae5de77eSEmmanuel Vadot
124*ae5de77eSEmmanuel Vadot          input-enable: true
125*ae5de77eSEmmanuel Vadot
126*ae5de77eSEmmanuel Vadot          input-disable: true
127*ae5de77eSEmmanuel Vadot
128*ae5de77eSEmmanuel Vadot          input-schmitt-enable: true
129*ae5de77eSEmmanuel Vadot
130*ae5de77eSEmmanuel Vadot          input-schmitt-disable: true
131*ae5de77eSEmmanuel Vadot
132*ae5de77eSEmmanuel Vadot        required:
133*ae5de77eSEmmanuel Vadot          - pinmux
134*ae5de77eSEmmanuel Vadot
135*ae5de77eSEmmanuel Vadot        additionalProperties: false
136*ae5de77eSEmmanuel Vadot
137*ae5de77eSEmmanuel Vadotrequired:
138*ae5de77eSEmmanuel Vadot  - compatible
139*ae5de77eSEmmanuel Vadot  - reg
140*ae5de77eSEmmanuel Vadot  - interrupts
141*ae5de77eSEmmanuel Vadot  - interrupt-controller
142*ae5de77eSEmmanuel Vadot  - '#interrupt-cells'
143*ae5de77eSEmmanuel Vadot  - gpio-controller
144*ae5de77eSEmmanuel Vadot  - '#gpio-cells'
145*ae5de77eSEmmanuel Vadot  - gpio-ranges
146*ae5de77eSEmmanuel Vadot
147*ae5de77eSEmmanuel VadotadditionalProperties: false
148*ae5de77eSEmmanuel Vadot
149*ae5de77eSEmmanuel Vadotexamples:
150*ae5de77eSEmmanuel Vadot  - |
151*ae5de77eSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
152*ae5de77eSEmmanuel Vadot    #include <dt-bindings/pinctrl/mt65xx.h>
153*ae5de77eSEmmanuel Vadot    #define PINMUX_GPIO0__FUNC_GPIO0 (MTK_PIN_NO(0) | 0)
154*ae5de77eSEmmanuel Vadot    #define PINMUX_GPIO99__FUNC_SCL0 (MTK_PIN_NO(99) | 1)
155*ae5de77eSEmmanuel Vadot    #define PINMUX_GPIO100__FUNC_SDA0 (MTK_PIN_NO(100) | 1)
156*ae5de77eSEmmanuel Vadot
157*ae5de77eSEmmanuel Vadot    pio: pinctrl@10005000 {
158*ae5de77eSEmmanuel Vadot        compatible = "mediatek,mt6893-pinctrl";
159*ae5de77eSEmmanuel Vadot        reg = <0x10005000 0x1000>,
160*ae5de77eSEmmanuel Vadot              <0x11c20000 0x0200>,
161*ae5de77eSEmmanuel Vadot              <0x11d10000 0x0200>,
162*ae5de77eSEmmanuel Vadot              <0x11e20000 0x0200>,
163*ae5de77eSEmmanuel Vadot              <0x11e70000 0x0200>,
164*ae5de77eSEmmanuel Vadot              <0x11ea0000 0x0200>,
165*ae5de77eSEmmanuel Vadot              <0x11f20000 0x0200>,
166*ae5de77eSEmmanuel Vadot              <0x11f30000 0x0200>,
167*ae5de77eSEmmanuel Vadot              <0x1100b000 0x1000>;
168*ae5de77eSEmmanuel Vadot        reg-names = "base", "rm", "bm", "lm", "lb", "rt",
169*ae5de77eSEmmanuel Vadot                    "lt", "tm", "eint";
170*ae5de77eSEmmanuel Vadot        gpio-controller;
171*ae5de77eSEmmanuel Vadot        #gpio-cells = <2>;
172*ae5de77eSEmmanuel Vadot        gpio-ranges = <&pio 0 0 220>;
173*ae5de77eSEmmanuel Vadot        interrupt-controller;
174*ae5de77eSEmmanuel Vadot        interrupts = <GIC_SPI 212 IRQ_TYPE_LEVEL_HIGH 0>;
175*ae5de77eSEmmanuel Vadot        #interrupt-cells = <2>;
176*ae5de77eSEmmanuel Vadot
177*ae5de77eSEmmanuel Vadot        gpio-pins {
178*ae5de77eSEmmanuel Vadot            pins {
179*ae5de77eSEmmanuel Vadot                pinmux = <PINMUX_GPIO0__FUNC_GPIO0>;
180*ae5de77eSEmmanuel Vadot                bias-pull-up = <4000>;
181*ae5de77eSEmmanuel Vadot                drive-strength = <6>;
182*ae5de77eSEmmanuel Vadot            };
183*ae5de77eSEmmanuel Vadot        };
184*ae5de77eSEmmanuel Vadot
185*ae5de77eSEmmanuel Vadot        i2c0-pins {
186*ae5de77eSEmmanuel Vadot            pins-bus {
187*ae5de77eSEmmanuel Vadot                pinmux = <PINMUX_GPIO99__FUNC_SCL0>,
188*ae5de77eSEmmanuel Vadot                         <PINMUX_GPIO100__FUNC_SDA0>;
189*ae5de77eSEmmanuel Vadot                bias-pull-down = <75000>;
190*ae5de77eSEmmanuel Vadot                drive-strength-microamp = <1000>;
191*ae5de77eSEmmanuel Vadot            };
192*ae5de77eSEmmanuel Vadot        };
193*ae5de77eSEmmanuel Vadot    };
194