xref: /freebsd/sys/contrib/device-tree/Bindings/pinctrl/mediatek,mt8188-pinctrl.yaml (revision fac71e4e09885bb2afa3d984a0c239a52e1a7418)
17ef62cebSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
27ef62cebSEmmanuel Vadot%YAML 1.2
37ef62cebSEmmanuel Vadot---
47ef62cebSEmmanuel Vadot$id: http://devicetree.org/schemas/pinctrl/mediatek,mt8188-pinctrl.yaml#
57ef62cebSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
67ef62cebSEmmanuel Vadot
77ef62cebSEmmanuel Vadottitle: MediaTek MT8188 Pin Controller
87ef62cebSEmmanuel Vadot
97ef62cebSEmmanuel Vadotmaintainers:
107ef62cebSEmmanuel Vadot  - Hui Liu <hui.liu@mediatek.com>
117ef62cebSEmmanuel Vadot
12*fac71e4eSEmmanuel Vadotdescription:
137ef62cebSEmmanuel Vadot  The MediaTek's MT8188 Pin controller is used to control SoC pins.
147ef62cebSEmmanuel Vadot
157ef62cebSEmmanuel Vadotproperties:
167ef62cebSEmmanuel Vadot  compatible:
177ef62cebSEmmanuel Vadot    const: mediatek,mt8188-pinctrl
187ef62cebSEmmanuel Vadot
197ef62cebSEmmanuel Vadot  gpio-controller: true
207ef62cebSEmmanuel Vadot
217ef62cebSEmmanuel Vadot  '#gpio-cells':
22*fac71e4eSEmmanuel Vadot    description:
23*fac71e4eSEmmanuel Vadot      Number of cells in GPIO specifier, should be two. The first cell is the
24*fac71e4eSEmmanuel Vadot      pin number, the second cell is used to specify optional parameters which
25*fac71e4eSEmmanuel Vadot      are defined in <dt-bindings/gpio/gpio.h>.
267ef62cebSEmmanuel Vadot    const: 2
277ef62cebSEmmanuel Vadot
287ef62cebSEmmanuel Vadot  gpio-ranges:
297ef62cebSEmmanuel Vadot    maxItems: 1
307ef62cebSEmmanuel Vadot
317ef62cebSEmmanuel Vadot  gpio-line-names: true
327ef62cebSEmmanuel Vadot
337ef62cebSEmmanuel Vadot  reg:
347ef62cebSEmmanuel Vadot    items:
357ef62cebSEmmanuel Vadot      - description: gpio registers base address
367ef62cebSEmmanuel Vadot      - description: rm group io configuration registers base address
377ef62cebSEmmanuel Vadot      - description: lt group io configuration registers base address
387ef62cebSEmmanuel Vadot      - description: lm group io configuration registers base address
397ef62cebSEmmanuel Vadot      - description: rt group io configuration registers base address
407ef62cebSEmmanuel Vadot      - description: eint registers base address
417ef62cebSEmmanuel Vadot
427ef62cebSEmmanuel Vadot  reg-names:
437ef62cebSEmmanuel Vadot    items:
447ef62cebSEmmanuel Vadot      - const: iocfg0
457ef62cebSEmmanuel Vadot      - const: iocfg_rm
467ef62cebSEmmanuel Vadot      - const: iocfg_lt
477ef62cebSEmmanuel Vadot      - const: iocfg_lm
487ef62cebSEmmanuel Vadot      - const: iocfg_rt
497ef62cebSEmmanuel Vadot      - const: eint
507ef62cebSEmmanuel Vadot
517ef62cebSEmmanuel Vadot  interrupt-controller: true
527ef62cebSEmmanuel Vadot
537ef62cebSEmmanuel Vadot  '#interrupt-cells':
547ef62cebSEmmanuel Vadot    const: 2
557ef62cebSEmmanuel Vadot
567ef62cebSEmmanuel Vadot  interrupts:
577ef62cebSEmmanuel Vadot    description: The interrupt outputs to sysirq.
587ef62cebSEmmanuel Vadot    maxItems: 1
597ef62cebSEmmanuel Vadot
607ef62cebSEmmanuel Vadot  mediatek,rsel-resistance-in-si-unit:
617ef62cebSEmmanuel Vadot    type: boolean
62*fac71e4eSEmmanuel Vadot    description:
63*fac71e4eSEmmanuel Vadot      We provide two methods to select the resistance for I2C when pull up or
64*fac71e4eSEmmanuel Vadot      pull down. The first is by RSEL definition value, another one is by
65*fac71e4eSEmmanuel Vadot      resistance value(ohm). This flag is used to identify if the method is
66*fac71e4eSEmmanuel Vadot      resistance(si unit) value.
677ef62cebSEmmanuel Vadot
687ef62cebSEmmanuel Vadot# PIN CONFIGURATION NODES
697ef62cebSEmmanuel VadotpatternProperties:
707ef62cebSEmmanuel Vadot  '-pins$':
717ef62cebSEmmanuel Vadot    type: object
727ef62cebSEmmanuel Vadot    additionalProperties: false
737ef62cebSEmmanuel Vadot
747ef62cebSEmmanuel Vadot    patternProperties:
757ef62cebSEmmanuel Vadot      '^pins':
767ef62cebSEmmanuel Vadot        type: object
77*fac71e4eSEmmanuel Vadot        $ref: /schemas/pinctrl/pincfg-node.yaml
787ef62cebSEmmanuel Vadot        additionalProperties: false
79*fac71e4eSEmmanuel Vadot        description:
807ef62cebSEmmanuel Vadot          A pinctrl node should contain at least one subnode representing the
817ef62cebSEmmanuel Vadot          pinctrl groups available on the machine. Each subnode will list the
827ef62cebSEmmanuel Vadot          pins it needs, and how they should be configured, with regard to muxer
83*fac71e4eSEmmanuel Vadot          configuration, pullups, drive strength, input enable/disable and input
84*fac71e4eSEmmanuel Vadot          schmitt.
857ef62cebSEmmanuel Vadot
867ef62cebSEmmanuel Vadot        properties:
877ef62cebSEmmanuel Vadot          pinmux:
88*fac71e4eSEmmanuel Vadot            description:
897ef62cebSEmmanuel Vadot              Integer array, represents gpio pin number and mux setting.
907ef62cebSEmmanuel Vadot              Supported pin number and mux varies for different SoCs, and are
91*fac71e4eSEmmanuel Vadot              defined as macros in dt-bindings/pinctrl/mediatek,mt8188-pinfunc.h
92*fac71e4eSEmmanuel Vadot              directly, for this SoC.
937ef62cebSEmmanuel Vadot
947ef62cebSEmmanuel Vadot          drive-strength:
957ef62cebSEmmanuel Vadot            enum: [2, 4, 6, 8, 10, 12, 14, 16]
967ef62cebSEmmanuel Vadot
977ef62cebSEmmanuel Vadot          drive-strength-microamp:
987ef62cebSEmmanuel Vadot            enum: [125, 250, 500, 1000]
997ef62cebSEmmanuel Vadot
1007ef62cebSEmmanuel Vadot          bias-pull-down:
1017ef62cebSEmmanuel Vadot            oneOf:
1027ef62cebSEmmanuel Vadot              - type: boolean
1037ef62cebSEmmanuel Vadot              - enum: [100, 101, 102, 103]
1047ef62cebSEmmanuel Vadot                description: mt8188 pull down PUPD/R0/R1 type define value.
1057ef62cebSEmmanuel Vadot              - enum: [200, 201, 202, 203, 204, 205, 206, 207]
1067ef62cebSEmmanuel Vadot                description: mt8188 pull down RSEL type define value.
1077ef62cebSEmmanuel Vadot              - enum: [75000, 5000]
1087ef62cebSEmmanuel Vadot                description: mt8188 pull down RSEL type si unit value(ohm).
1097ef62cebSEmmanuel Vadot            description: |
110*fac71e4eSEmmanuel Vadot              For pull down type is normal, it doesn't need add RSEL & R1R0
111*fac71e4eSEmmanuel Vadot              define and resistance value.
1127ef62cebSEmmanuel Vadot              For pull down type is PUPD/R0/R1 type, it can add R1R0 define to
1137ef62cebSEmmanuel Vadot              set different resistance. It can support "MTK_PUPD_SET_R1R0_00" &
114*fac71e4eSEmmanuel Vadot              "MTK_PUPD_SET_R1R0_01" & "MTK_PUPD_SET_R1R0_10" &
115*fac71e4eSEmmanuel Vadot              "MTK_PUPD_SET_R1R0_11" define in mt8188.
116*fac71e4eSEmmanuel Vadot              For pull down type is RSEL, it can add RSEL define & resistance
117*fac71e4eSEmmanuel Vadot              value(ohm) to set different resistance by identifying property
118*fac71e4eSEmmanuel Vadot              "mediatek,rsel-resistance-in-si-unit". It can support
119*fac71e4eSEmmanuel Vadot              "MTK_PULL_SET_RSEL_000" & "MTK_PULL_SET_RSEL_001" &
120*fac71e4eSEmmanuel Vadot              "MTK_PULL_SET_RSEL_010" & "MTK_PULL_SET_RSEL_011" &
121*fac71e4eSEmmanuel Vadot              "MTK_PULL_SET_RSEL_100" & "MTK_PULL_SET_RSEL_101" &
122*fac71e4eSEmmanuel Vadot              "MTK_PULL_SET_RSEL_110" & "MTK_PULL_SET_RSEL_111" define in
123*fac71e4eSEmmanuel Vadot              mt8188. It can also support resistance value(ohm) "75000" & "5000"
124*fac71e4eSEmmanuel Vadot              in mt8188.
1257ef62cebSEmmanuel Vadot
1267ef62cebSEmmanuel Vadot          bias-pull-up:
1277ef62cebSEmmanuel Vadot            oneOf:
1287ef62cebSEmmanuel Vadot              - type: boolean
1297ef62cebSEmmanuel Vadot              - enum: [100, 101, 102, 103]
1307ef62cebSEmmanuel Vadot                description: mt8188 pull up PUPD/R0/R1 type define value.
1317ef62cebSEmmanuel Vadot              - enum: [200, 201, 202, 203, 204, 205, 206, 207]
1327ef62cebSEmmanuel Vadot                description: mt8188 pull up RSEL type define value.
1337ef62cebSEmmanuel Vadot              - enum: [1000, 1500, 2000, 3000, 4000, 5000, 10000, 75000]
1347ef62cebSEmmanuel Vadot                description: mt8188 pull up RSEL type si unit value(ohm).
1357ef62cebSEmmanuel Vadot            description: |
1367ef62cebSEmmanuel Vadot              For pull up type is normal, it don't need add RSEL & R1R0 define
1377ef62cebSEmmanuel Vadot              and resistance value.
138*fac71e4eSEmmanuel Vadot              For pull up type is PUPD/R0/R1 type, it can add R1R0 define to set
139*fac71e4eSEmmanuel Vadot              different resistance. It can support "MTK_PUPD_SET_R1R0_00" &
140*fac71e4eSEmmanuel Vadot              "MTK_PUPD_SET_R1R0_01" & "MTK_PUPD_SET_R1R0_10" &
141*fac71e4eSEmmanuel Vadot              "MTK_PUPD_SET_R1R0_11" define in mt8188.
142*fac71e4eSEmmanuel Vadot              For pull up type is RSEL, it can add RSEL define & resistance
143*fac71e4eSEmmanuel Vadot              value(ohm) to set different resistance by identifying property
144*fac71e4eSEmmanuel Vadot              "mediatek,rsel-resistance-in-si-unit". It can support
145*fac71e4eSEmmanuel Vadot              "MTK_PULL_SET_RSEL_000" & "MTK_PULL_SET_RSEL_001" &
146*fac71e4eSEmmanuel Vadot              "MTK_PULL_SET_RSEL_010" & "MTK_PULL_SET_RSEL_011" &
147*fac71e4eSEmmanuel Vadot              "MTK_PULL_SET_RSEL_100" & "MTK_PULL_SET_RSEL_101" &
148*fac71e4eSEmmanuel Vadot              "MTK_PULL_SET_RSEL_110" & "MTK_PULL_SET_RSEL_111" define in
149*fac71e4eSEmmanuel Vadot              mt8188. It can also support resistance value(ohm) "1000" & "1500"
150*fac71e4eSEmmanuel Vadot              & "2000" & "3000" & "4000" & "5000" & "10000" & "75000" in mt8188.
1517ef62cebSEmmanuel Vadot
1527ef62cebSEmmanuel Vadot          bias-disable: true
1537ef62cebSEmmanuel Vadot
1547ef62cebSEmmanuel Vadot          output-high: true
1557ef62cebSEmmanuel Vadot
1567ef62cebSEmmanuel Vadot          output-low: true
1577ef62cebSEmmanuel Vadot
1587ef62cebSEmmanuel Vadot          input-enable: true
1597ef62cebSEmmanuel Vadot
1607ef62cebSEmmanuel Vadot          input-disable: true
1617ef62cebSEmmanuel Vadot
1627ef62cebSEmmanuel Vadot          input-schmitt-enable: true
1637ef62cebSEmmanuel Vadot
1647ef62cebSEmmanuel Vadot          input-schmitt-disable: true
1657ef62cebSEmmanuel Vadot
1667ef62cebSEmmanuel Vadot        required:
1677ef62cebSEmmanuel Vadot          - pinmux
1687ef62cebSEmmanuel Vadot
1697ef62cebSEmmanuel Vadotrequired:
1707ef62cebSEmmanuel Vadot  - compatible
1717ef62cebSEmmanuel Vadot  - reg
1727ef62cebSEmmanuel Vadot  - interrupts
1737ef62cebSEmmanuel Vadot  - interrupt-controller
1747ef62cebSEmmanuel Vadot  - '#interrupt-cells'
1757ef62cebSEmmanuel Vadot  - gpio-controller
1767ef62cebSEmmanuel Vadot  - '#gpio-cells'
1777ef62cebSEmmanuel Vadot  - gpio-ranges
1787ef62cebSEmmanuel Vadot
1797ef62cebSEmmanuel VadotadditionalProperties: false
1807ef62cebSEmmanuel Vadot
1817ef62cebSEmmanuel Vadotexamples:
1827ef62cebSEmmanuel Vadot  - |
1837ef62cebSEmmanuel Vadot    #include <dt-bindings/pinctrl/mediatek,mt8188-pinfunc.h>
1847ef62cebSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
1857ef62cebSEmmanuel Vadot
1867ef62cebSEmmanuel Vadot    pio: pinctrl@10005000 {
1877ef62cebSEmmanuel Vadot        compatible = "mediatek,mt8188-pinctrl";
1887ef62cebSEmmanuel Vadot        reg = <0x10005000 0x1000>,
1897ef62cebSEmmanuel Vadot              <0x11c00000 0x1000>,
1907ef62cebSEmmanuel Vadot              <0x11e10000 0x1000>,
1917ef62cebSEmmanuel Vadot              <0x11e20000 0x1000>,
1927ef62cebSEmmanuel Vadot              <0x11ea0000 0x1000>,
1937ef62cebSEmmanuel Vadot              <0x1000b000 0x1000>;
1947ef62cebSEmmanuel Vadot        reg-names = "iocfg0", "iocfg_rm",
1957ef62cebSEmmanuel Vadot                    "iocfg_lt", "iocfg_lm", "iocfg_rt",
1967ef62cebSEmmanuel Vadot                    "eint";
1977ef62cebSEmmanuel Vadot        gpio-controller;
1987ef62cebSEmmanuel Vadot        #gpio-cells = <2>;
1997ef62cebSEmmanuel Vadot        gpio-ranges = <&pio 0 0 176>;
2007ef62cebSEmmanuel Vadot        interrupt-controller;
2017ef62cebSEmmanuel Vadot        interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH 0>;
2027ef62cebSEmmanuel Vadot        #interrupt-cells = <2>;
2037ef62cebSEmmanuel Vadot
2047ef62cebSEmmanuel Vadot        pio-pins {
2057ef62cebSEmmanuel Vadot            pins {
2067ef62cebSEmmanuel Vadot                pinmux = <PINMUX_GPIO0__FUNC_B_GPIO0>;
2077ef62cebSEmmanuel Vadot                output-low;
2087ef62cebSEmmanuel Vadot            };
2097ef62cebSEmmanuel Vadot        };
2107ef62cebSEmmanuel Vadot
2117ef62cebSEmmanuel Vadot        spi0-pins {
2127ef62cebSEmmanuel Vadot            pins-spi {
2137ef62cebSEmmanuel Vadot                pinmux = <PINMUX_GPIO75__FUNC_O_SPIM1_CSB>,
2147ef62cebSEmmanuel Vadot                         <PINMUX_GPIO76__FUNC_O_SPIM1_CLK>,
2157ef62cebSEmmanuel Vadot                         <PINMUX_GPIO77__FUNC_B0_SPIM1_MOSI>;
2167ef62cebSEmmanuel Vadot                drive-strength = <6>;
2177ef62cebSEmmanuel Vadot            };
2187ef62cebSEmmanuel Vadot            pins-spi-mi {
2197ef62cebSEmmanuel Vadot                pinmux = <PINMUX_GPIO78__FUNC_B0_SPIM1_MISO>;
2207ef62cebSEmmanuel Vadot                bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
2217ef62cebSEmmanuel Vadot            };
2227ef62cebSEmmanuel Vadot        };
2237ef62cebSEmmanuel Vadot
2247ef62cebSEmmanuel Vadot        i2c0-pins {
2257ef62cebSEmmanuel Vadot            pins {
2267ef62cebSEmmanuel Vadot                pinmux = <PINMUX_GPIO55__FUNC_B1_SCL0>,
2277ef62cebSEmmanuel Vadot                         <PINMUX_GPIO56__FUNC_B1_SDA0>;
2287ef62cebSEmmanuel Vadot                bias-disable;
2297ef62cebSEmmanuel Vadot                drive-strength-microamp = <1000>;
2307ef62cebSEmmanuel Vadot            };
2317ef62cebSEmmanuel Vadot        };
2327ef62cebSEmmanuel Vadot    };
233