xref: /freebsd/sys/contrib/device-tree/Bindings/pinctrl/mediatek,mt8183-pinctrl.yaml (revision aa1a8ff2d6dbc51ef058f46f3db5a8bb77967145)
1354d7675SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2354d7675SEmmanuel Vadot%YAML 1.2
3354d7675SEmmanuel Vadot---
4354d7675SEmmanuel Vadot$id: http://devicetree.org/schemas/pinctrl/mediatek,mt8183-pinctrl.yaml#
5354d7675SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6354d7675SEmmanuel Vadot
7fac71e4eSEmmanuel Vadottitle: MediaTek MT8183 Pin Controller
8354d7675SEmmanuel Vadot
9354d7675SEmmanuel Vadotmaintainers:
10354d7675SEmmanuel Vadot  - Sean Wang <sean.wang@kernel.org>
11354d7675SEmmanuel Vadot
12fac71e4eSEmmanuel Vadotdescription:
13354d7675SEmmanuel Vadot  The MediaTek's MT8183 Pin controller is used to control SoC pins.
14354d7675SEmmanuel Vadot
15354d7675SEmmanuel Vadotproperties:
16354d7675SEmmanuel Vadot  compatible:
17354d7675SEmmanuel Vadot    const: mediatek,mt8183-pinctrl
18354d7675SEmmanuel Vadot
19354d7675SEmmanuel Vadot  reg:
20354d7675SEmmanuel Vadot    minItems: 10
21354d7675SEmmanuel Vadot    maxItems: 10
22354d7675SEmmanuel Vadot
23354d7675SEmmanuel Vadot  reg-names:
24354d7675SEmmanuel Vadot    items:
25354d7675SEmmanuel Vadot      - const: iocfg0
26354d7675SEmmanuel Vadot      - const: iocfg1
27354d7675SEmmanuel Vadot      - const: iocfg2
28354d7675SEmmanuel Vadot      - const: iocfg3
29354d7675SEmmanuel Vadot      - const: iocfg4
30354d7675SEmmanuel Vadot      - const: iocfg5
31354d7675SEmmanuel Vadot      - const: iocfg6
32354d7675SEmmanuel Vadot      - const: iocfg7
33354d7675SEmmanuel Vadot      - const: iocfg8
34354d7675SEmmanuel Vadot      - const: eint
35354d7675SEmmanuel Vadot
36354d7675SEmmanuel Vadot  gpio-controller: true
37354d7675SEmmanuel Vadot
38354d7675SEmmanuel Vadot  "#gpio-cells":
39354d7675SEmmanuel Vadot    const: 2
40fac71e4eSEmmanuel Vadot    description:
41fac71e4eSEmmanuel Vadot      Number of cells in GPIO specifier. Since the generic GPIO binding is used,
42fac71e4eSEmmanuel Vadot      the amount of cells must be specified as 2. See the below mentioned gpio
43fac71e4eSEmmanuel Vadot      binding representation for description of particular cells.
44354d7675SEmmanuel Vadot
45354d7675SEmmanuel Vadot  gpio-ranges:
46354d7675SEmmanuel Vadot    minItems: 1
47354d7675SEmmanuel Vadot    maxItems: 5
48fac71e4eSEmmanuel Vadot    description:
49354d7675SEmmanuel Vadot      GPIO valid number range.
50354d7675SEmmanuel Vadot
51354d7675SEmmanuel Vadot  interrupt-controller: true
52354d7675SEmmanuel Vadot
53354d7675SEmmanuel Vadot  interrupts:
54354d7675SEmmanuel Vadot    maxItems: 1
55354d7675SEmmanuel Vadot
56354d7675SEmmanuel Vadot  "#interrupt-cells":
57354d7675SEmmanuel Vadot    const: 2
58354d7675SEmmanuel Vadot
59e67e8565SEmmanuel VadotallOf:
60fac71e4eSEmmanuel Vadot  - $ref: pinctrl.yaml#
61e67e8565SEmmanuel Vadot
62354d7675SEmmanuel Vadotrequired:
63354d7675SEmmanuel Vadot  - compatible
64354d7675SEmmanuel Vadot  - reg
65354d7675SEmmanuel Vadot  - gpio-controller
66354d7675SEmmanuel Vadot  - "#gpio-cells"
67354d7675SEmmanuel Vadot  - gpio-ranges
68354d7675SEmmanuel Vadot
69354d7675SEmmanuel VadotpatternProperties:
70cb7aa33aSEmmanuel Vadot  '-pins(-[a-z]+)?$':
71354d7675SEmmanuel Vadot    type: object
72354d7675SEmmanuel Vadot    additionalProperties: false
73354d7675SEmmanuel Vadot    patternProperties:
74cb7aa33aSEmmanuel Vadot      '^pins':
75354d7675SEmmanuel Vadot        type: object
76354d7675SEmmanuel Vadot        additionalProperties: false
77fac71e4eSEmmanuel Vadot        description:
78354d7675SEmmanuel Vadot          A pinctrl node should contain at least one subnodes representing the
79354d7675SEmmanuel Vadot          pinctrl groups available on the machine. Each subnode will list the
80354d7675SEmmanuel Vadot          pins it needs, and how they should be configured, with regard to muxer
81354d7675SEmmanuel Vadot          configuration, pullups, drive strength, input enable/disable and input
82354d7675SEmmanuel Vadot          schmitt.
83fac71e4eSEmmanuel Vadot        $ref: /schemas/pinctrl/pincfg-node.yaml
84354d7675SEmmanuel Vadot
85354d7675SEmmanuel Vadot        properties:
86354d7675SEmmanuel Vadot          pinmux:
87354d7675SEmmanuel Vadot            description:
88fac71e4eSEmmanuel Vadot              Integer array, represents gpio pin number and mux setting.
89354d7675SEmmanuel Vadot              Supported pin number and mux varies for different SoCs, and are
90354d7675SEmmanuel Vadot              defined as macros in <soc>-pinfunc.h directly.
91354d7675SEmmanuel Vadot
92354d7675SEmmanuel Vadot          bias-disable: true
93354d7675SEmmanuel Vadot
94354d7675SEmmanuel Vadot          bias-pull-up: true
95354d7675SEmmanuel Vadot
96354d7675SEmmanuel Vadot          bias-pull-down: true
97354d7675SEmmanuel Vadot
98354d7675SEmmanuel Vadot          input-enable: true
99354d7675SEmmanuel Vadot
100354d7675SEmmanuel Vadot          input-disable: true
101354d7675SEmmanuel Vadot
102354d7675SEmmanuel Vadot          output-low: true
103354d7675SEmmanuel Vadot
104354d7675SEmmanuel Vadot          output-high: true
105354d7675SEmmanuel Vadot
106354d7675SEmmanuel Vadot          input-schmitt-enable: true
107354d7675SEmmanuel Vadot
108354d7675SEmmanuel Vadot          input-schmitt-disable: true
109354d7675SEmmanuel Vadot
110354d7675SEmmanuel Vadot          drive-strength:
111354d7675SEmmanuel Vadot            enum: [2, 4, 6, 8, 10, 12, 14, 16]
112354d7675SEmmanuel Vadot
113fac71e4eSEmmanuel Vadot          drive-strength-microamp:
114fac71e4eSEmmanuel Vadot            enum: [125, 250, 500, 1000]
115fac71e4eSEmmanuel Vadot
116354d7675SEmmanuel Vadot          mediatek,drive-strength-adv:
117fac71e4eSEmmanuel Vadot            deprecated: true
118354d7675SEmmanuel Vadot            description: |
119fac71e4eSEmmanuel Vadot              DEPRECATED: Please use drive-strength-microamp instead.
120354d7675SEmmanuel Vadot              Describe the specific driving setup property.
121354d7675SEmmanuel Vadot              For I2C pins, the existing generic driving setup can only support
122354d7675SEmmanuel Vadot              2/4/6/8/10/12/14/16mA driving. But in specific driving setup, they
123354d7675SEmmanuel Vadot              can support 0.125/0.25/0.5/1mA adjustment. If we enable specific
124354d7675SEmmanuel Vadot              driving setup, the existing generic setup will be disabled.
125354d7675SEmmanuel Vadot              The specific driving setup is controlled by E1E0EN.
126354d7675SEmmanuel Vadot              When E1=0/E0=0, the strength is 0.125mA.
127354d7675SEmmanuel Vadot              When E1=0/E0=1, the strength is 0.25mA.
128354d7675SEmmanuel Vadot              When E1=1/E0=0, the strength is 0.5mA.
129354d7675SEmmanuel Vadot              When E1=1/E0=1, the strength is 1mA.
130354d7675SEmmanuel Vadot              EN is used to enable or disable the specific driving setup.
131354d7675SEmmanuel Vadot              Valid arguments are described as below:
132354d7675SEmmanuel Vadot              0: (E1, E0, EN) = (0, 0, 0)
133354d7675SEmmanuel Vadot              1: (E1, E0, EN) = (0, 0, 1)
134354d7675SEmmanuel Vadot              2: (E1, E0, EN) = (0, 1, 0)
135354d7675SEmmanuel Vadot              3: (E1, E0, EN) = (0, 1, 1)
136354d7675SEmmanuel Vadot              4: (E1, E0, EN) = (1, 0, 0)
137354d7675SEmmanuel Vadot              5: (E1, E0, EN) = (1, 0, 1)
138354d7675SEmmanuel Vadot              6: (E1, E0, EN) = (1, 1, 0)
139354d7675SEmmanuel Vadot              7: (E1, E0, EN) = (1, 1, 1)
140354d7675SEmmanuel Vadot              So the valid arguments are from 0 to 7.
141354d7675SEmmanuel Vadot            $ref: /schemas/types.yaml#/definitions/uint32
142354d7675SEmmanuel Vadot            enum: [0, 1, 2, 3, 4, 5, 6, 7]
143354d7675SEmmanuel Vadot
144354d7675SEmmanuel Vadot          mediatek,pull-up-adv:
145354d7675SEmmanuel Vadot            description: |
146*aa1a8ff2SEmmanuel Vadot              Pull up settings for 2 pull resistors, R0 and R1. User can
147fac71e4eSEmmanuel Vadot              configure those special pins. Valid arguments are described as
148fac71e4eSEmmanuel Vadot              below:
149354d7675SEmmanuel Vadot              0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled.
150354d7675SEmmanuel Vadot              1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled.
151354d7675SEmmanuel Vadot              2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled.
152354d7675SEmmanuel Vadot              3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled.
153354d7675SEmmanuel Vadot            $ref: /schemas/types.yaml#/definitions/uint32
154354d7675SEmmanuel Vadot            enum: [0, 1, 2, 3]
155354d7675SEmmanuel Vadot
156354d7675SEmmanuel Vadot          mediatek,pull-down-adv:
157354d7675SEmmanuel Vadot            description: |
158354d7675SEmmanuel Vadot              Pull down settings for 2 pull resistors, R0 and R1. User can
159fac71e4eSEmmanuel Vadot              configure those special pins. Valid arguments are described as
160fac71e4eSEmmanuel Vadot              below:
161354d7675SEmmanuel Vadot              0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled.
162354d7675SEmmanuel Vadot              1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled.
163354d7675SEmmanuel Vadot              2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled.
164354d7675SEmmanuel Vadot              3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled.
165354d7675SEmmanuel Vadot            $ref: /schemas/types.yaml#/definitions/uint32
166354d7675SEmmanuel Vadot            enum: [0, 1, 2, 3]
167354d7675SEmmanuel Vadot
168354d7675SEmmanuel Vadot          mediatek,tdsel:
169fac71e4eSEmmanuel Vadot            description:
170354d7675SEmmanuel Vadot              An integer describing the steps for output level shifter duty
171354d7675SEmmanuel Vadot              cycle when asserted (high pulse width adjustment). Valid arguments
172354d7675SEmmanuel Vadot              are from 0 to 15.
173354d7675SEmmanuel Vadot            $ref: /schemas/types.yaml#/definitions/uint32
174354d7675SEmmanuel Vadot
175354d7675SEmmanuel Vadot          mediatek,rdsel:
176fac71e4eSEmmanuel Vadot            description:
177354d7675SEmmanuel Vadot              An integer describing the steps for input level shifter duty cycle
178354d7675SEmmanuel Vadot              when asserted (high pulse width adjustment). Valid arguments are
179354d7675SEmmanuel Vadot              from 0 to 63.
180354d7675SEmmanuel Vadot            $ref: /schemas/types.yaml#/definitions/uint32
181354d7675SEmmanuel Vadot
182354d7675SEmmanuel Vadot        required:
183354d7675SEmmanuel Vadot          - pinmux
184354d7675SEmmanuel Vadot
185354d7675SEmmanuel VadotadditionalProperties: false
186354d7675SEmmanuel Vadot
187354d7675SEmmanuel Vadotexamples:
188354d7675SEmmanuel Vadot  - |
189354d7675SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
190354d7675SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
191354d7675SEmmanuel Vadot    #include <dt-bindings/pinctrl/mt8183-pinfunc.h>
192354d7675SEmmanuel Vadot
193354d7675SEmmanuel Vadot    soc {
194354d7675SEmmanuel Vadot        #address-cells = <2>;
195354d7675SEmmanuel Vadot        #size-cells = <2>;
196354d7675SEmmanuel Vadot
197354d7675SEmmanuel Vadot        pio: pinctrl@10005000 {
198354d7675SEmmanuel Vadot          compatible = "mediatek,mt8183-pinctrl";
199354d7675SEmmanuel Vadot          reg = <0 0x10005000 0 0x1000>,
200354d7675SEmmanuel Vadot                <0 0x11f20000 0 0x1000>,
201354d7675SEmmanuel Vadot                <0 0x11e80000 0 0x1000>,
202354d7675SEmmanuel Vadot                <0 0x11e70000 0 0x1000>,
203354d7675SEmmanuel Vadot                <0 0x11e90000 0 0x1000>,
204354d7675SEmmanuel Vadot                <0 0x11d30000 0 0x1000>,
205354d7675SEmmanuel Vadot                <0 0x11d20000 0 0x1000>,
206354d7675SEmmanuel Vadot                <0 0x11c50000 0 0x1000>,
207354d7675SEmmanuel Vadot                <0 0x11f30000 0 0x1000>,
208354d7675SEmmanuel Vadot                <0 0x1000b000 0 0x1000>;
209354d7675SEmmanuel Vadot          reg-names = "iocfg0", "iocfg1", "iocfg2",
210354d7675SEmmanuel Vadot                "iocfg3", "iocfg4", "iocfg5",
211354d7675SEmmanuel Vadot                "iocfg6", "iocfg7", "iocfg8",
212354d7675SEmmanuel Vadot                "eint";
213354d7675SEmmanuel Vadot          gpio-controller;
214354d7675SEmmanuel Vadot          #gpio-cells = <2>;
215354d7675SEmmanuel Vadot          gpio-ranges = <&pio 0 0 192>;
216354d7675SEmmanuel Vadot          interrupt-controller;
217354d7675SEmmanuel Vadot          interrupts = <GIC_SPI 177 IRQ_TYPE_LEVEL_HIGH>;
218354d7675SEmmanuel Vadot          #interrupt-cells = <2>;
219354d7675SEmmanuel Vadot
220cb7aa33aSEmmanuel Vadot          i2c0_pins_a: i2c0-pins {
221354d7675SEmmanuel Vadot            pins1 {
222354d7675SEmmanuel Vadot              pinmux = <PINMUX_GPIO48__FUNC_SCL5>,
223354d7675SEmmanuel Vadot                <PINMUX_GPIO49__FUNC_SDA5>;
224354d7675SEmmanuel Vadot              mediatek,pull-up-adv = <3>;
225fac71e4eSEmmanuel Vadot              drive-strength-microamp = <1000>;
226354d7675SEmmanuel Vadot            };
227354d7675SEmmanuel Vadot          };
228354d7675SEmmanuel Vadot
229cb7aa33aSEmmanuel Vadot          i2c1_pins_a: i2c1-pins {
230354d7675SEmmanuel Vadot            pins {
231354d7675SEmmanuel Vadot              pinmux = <PINMUX_GPIO50__FUNC_SCL3>,
232354d7675SEmmanuel Vadot                <PINMUX_GPIO51__FUNC_SDA3>;
233354d7675SEmmanuel Vadot              mediatek,pull-down-adv = <2>;
234354d7675SEmmanuel Vadot            };
235354d7675SEmmanuel Vadot          };
236354d7675SEmmanuel Vadot        };
237354d7675SEmmanuel Vadot    };
238