xref: /freebsd/sys/contrib/device-tree/Bindings/pinctrl/thead,th1520-pinctrl.yaml (revision 5f62a964e9f8abc6a05d8338273fadd154f0a206)
1*5f62a964SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*5f62a964SEmmanuel Vadot%YAML 1.2
3*5f62a964SEmmanuel Vadot---
4*5f62a964SEmmanuel Vadot$id: http://devicetree.org/schemas/pinctrl/thead,th1520-pinctrl.yaml#
5*5f62a964SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*5f62a964SEmmanuel Vadot
7*5f62a964SEmmanuel Vadottitle: T-Head TH1520 SoC pin controller
8*5f62a964SEmmanuel Vadot
9*5f62a964SEmmanuel Vadotmaintainers:
10*5f62a964SEmmanuel Vadot  - Emil Renner Berthing <emil.renner.berthing@canonical.com>
11*5f62a964SEmmanuel Vadot
12*5f62a964SEmmanuel Vadotdescription: |
13*5f62a964SEmmanuel Vadot  Pinmux and pinconf controller in the T-Head TH1520 RISC-V SoC.
14*5f62a964SEmmanuel Vadot
15*5f62a964SEmmanuel Vadot  The TH1520 has 3 groups of pads each controlled from different memory ranges.
16*5f62a964SEmmanuel Vadot  Confusingly the memory ranges are named
17*5f62a964SEmmanuel Vadot    PADCTRL_AOSYS  -> PAD Group 1
18*5f62a964SEmmanuel Vadot    PADCTRL1_APSYS -> PAD Group 2
19*5f62a964SEmmanuel Vadot    PADCTRL0_APSYS -> PAD Group 3
20*5f62a964SEmmanuel Vadot
21*5f62a964SEmmanuel Vadot  Each pad can be muxed individually to up to 6 different functions. For most
22*5f62a964SEmmanuel Vadot  pads only a few of those 6 configurations are valid though, and a few pads in
23*5f62a964SEmmanuel Vadot  group 1 does not support muxing at all.
24*5f62a964SEmmanuel Vadot
25*5f62a964SEmmanuel Vadot  Pinconf is fairly regular except for a few pads in group 1 that either can't
26*5f62a964SEmmanuel Vadot  be configured or has some special functions. The rest have configurable drive
27*5f62a964SEmmanuel Vadot  strength, input enable, schmitt trigger, slew rate, pull-up and pull-down in
28*5f62a964SEmmanuel Vadot  addition to a special strong pull up.
29*5f62a964SEmmanuel Vadot
30*5f62a964SEmmanuel Vadot  Certain pads in group 1 can be muxed to AUDIO_PA0 - AUDIO_PA30 functions and
31*5f62a964SEmmanuel Vadot  are then meant to be used by the audio co-processor. Each such pad can then
32*5f62a964SEmmanuel Vadot  be further muxed to either audio GPIO or one of 4 functions such as UART, I2C
33*5f62a964SEmmanuel Vadot  and I2S. If the audio pad is muxed to one of the 4 functions then pinconf is
34*5f62a964SEmmanuel Vadot  also configured in different registers. All of this is done from a different
35*5f62a964SEmmanuel Vadot  AUDIO_IOCTRL memory range and is left to the audio co-processor for now.
36*5f62a964SEmmanuel Vadot
37*5f62a964SEmmanuel Vadotproperties:
38*5f62a964SEmmanuel Vadot  compatible:
39*5f62a964SEmmanuel Vadot    enum:
40*5f62a964SEmmanuel Vadot      - thead,th1520-pinctrl
41*5f62a964SEmmanuel Vadot  reg:
42*5f62a964SEmmanuel Vadot    maxItems: 1
43*5f62a964SEmmanuel Vadot
44*5f62a964SEmmanuel Vadot  clocks:
45*5f62a964SEmmanuel Vadot    maxItems: 1
46*5f62a964SEmmanuel Vadot
47*5f62a964SEmmanuel Vadot  thead,pad-group:
48*5f62a964SEmmanuel Vadot    description: |
49*5f62a964SEmmanuel Vadot      Select the pad group that is associated with the pin controller instance.
50*5f62a964SEmmanuel Vadot
51*5f62a964SEmmanuel Vadot        Base Address   Name           Group
52*5f62a964SEmmanuel Vadot        0xFF_FFF4_A000 PADCTRL_AOSYS  1
53*5f62a964SEmmanuel Vadot        0xFF_E7F3_C000 PADCTRL1_APSYS 2
54*5f62a964SEmmanuel Vadot        0xFF_EC00_7000 PADCTRL0_APSYS 3
55*5f62a964SEmmanuel Vadot
56*5f62a964SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
57*5f62a964SEmmanuel Vadot    enum: [1, 2, 3]
58*5f62a964SEmmanuel Vadot
59*5f62a964SEmmanuel Vadotrequired:
60*5f62a964SEmmanuel Vadot  - compatible
61*5f62a964SEmmanuel Vadot  - reg
62*5f62a964SEmmanuel Vadot  - clocks
63*5f62a964SEmmanuel Vadot
64*5f62a964SEmmanuel VadotpatternProperties:
65*5f62a964SEmmanuel Vadot  '-[0-9]+$':
66*5f62a964SEmmanuel Vadot    type: object
67*5f62a964SEmmanuel Vadot    additionalProperties: false
68*5f62a964SEmmanuel Vadot
69*5f62a964SEmmanuel Vadot    patternProperties:
70*5f62a964SEmmanuel Vadot      '-pins$':
71*5f62a964SEmmanuel Vadot        type: object
72*5f62a964SEmmanuel Vadot        allOf:
73*5f62a964SEmmanuel Vadot          - $ref: /schemas/pinctrl/pincfg-node.yaml#
74*5f62a964SEmmanuel Vadot          - $ref: /schemas/pinctrl/pinmux-node.yaml#
75*5f62a964SEmmanuel Vadot
76*5f62a964SEmmanuel Vadot        additionalProperties: false
77*5f62a964SEmmanuel Vadot
78*5f62a964SEmmanuel Vadot        description:
79*5f62a964SEmmanuel Vadot          A pinctrl node should contain at least one subnode describing one
80*5f62a964SEmmanuel Vadot          or more pads and their associated pinmux and pinconf settings.
81*5f62a964SEmmanuel Vadot
82*5f62a964SEmmanuel Vadot        properties:
83*5f62a964SEmmanuel Vadot          pins:
84*5f62a964SEmmanuel Vadot            description: List of pads that properties in the node apply to.
85*5f62a964SEmmanuel Vadot
86*5f62a964SEmmanuel Vadot          function:
87*5f62a964SEmmanuel Vadot            enum: [ gpio, pwm, uart, ir, i2c, spi, qspi, sdio, audio, i2s,
88*5f62a964SEmmanuel Vadot                    gmac0, gmac1, dpu0, dpu1, isp, hdmi, bootsel, debug,
89*5f62a964SEmmanuel Vadot                    clock, jtag, iso7816, efuse, reset ]
90*5f62a964SEmmanuel Vadot            description: The mux function to select for the given pins.
91*5f62a964SEmmanuel Vadot
92*5f62a964SEmmanuel Vadot          bias-disable: true
93*5f62a964SEmmanuel Vadot
94*5f62a964SEmmanuel Vadot          bias-pull-up:
95*5f62a964SEmmanuel Vadot            oneOf:
96*5f62a964SEmmanuel Vadot              - type: boolean
97*5f62a964SEmmanuel Vadot                description: Enable the regular 48kOhm pull-up
98*5f62a964SEmmanuel Vadot              - enum: [ 2100, 48000 ]
99*5f62a964SEmmanuel Vadot                description: Enable the strong 2.1kOhm pull-up or regular 48kOhm pull-up
100*5f62a964SEmmanuel Vadot
101*5f62a964SEmmanuel Vadot          bias-pull-down:
102*5f62a964SEmmanuel Vadot            oneOf:
103*5f62a964SEmmanuel Vadot              - type: boolean
104*5f62a964SEmmanuel Vadot              - const: 44000
105*5f62a964SEmmanuel Vadot            description: Enable the regular 44kOhm pull-down
106*5f62a964SEmmanuel Vadot
107*5f62a964SEmmanuel Vadot          drive-strength:
108*5f62a964SEmmanuel Vadot            enum: [ 1, 2, 3, 5, 7, 8, 10, 12, 13, 15, 16, 18, 20, 21, 23, 25 ]
109*5f62a964SEmmanuel Vadot            description: Drive strength in mA
110*5f62a964SEmmanuel Vadot
111*5f62a964SEmmanuel Vadot          input-enable: true
112*5f62a964SEmmanuel Vadot
113*5f62a964SEmmanuel Vadot          input-disable: true
114*5f62a964SEmmanuel Vadot
115*5f62a964SEmmanuel Vadot          input-schmitt-enable: true
116*5f62a964SEmmanuel Vadot
117*5f62a964SEmmanuel Vadot          input-schmitt-disable: true
118*5f62a964SEmmanuel Vadot
119*5f62a964SEmmanuel Vadot          slew-rate:
120*5f62a964SEmmanuel Vadot            maximum: 1
121*5f62a964SEmmanuel Vadot
122*5f62a964SEmmanuel Vadot        required:
123*5f62a964SEmmanuel Vadot          - pins
124*5f62a964SEmmanuel Vadot
125*5f62a964SEmmanuel VadotadditionalProperties: false
126*5f62a964SEmmanuel Vadot
127*5f62a964SEmmanuel Vadotexamples:
128*5f62a964SEmmanuel Vadot  - |
129*5f62a964SEmmanuel Vadot    padctrl0_apsys: pinctrl@ec007000 {
130*5f62a964SEmmanuel Vadot        compatible = "thead,th1520-pinctrl";
131*5f62a964SEmmanuel Vadot        reg = <0xec007000 0x1000>;
132*5f62a964SEmmanuel Vadot        clocks = <&apb_clk>;
133*5f62a964SEmmanuel Vadot        thead,pad-group = <3>;
134*5f62a964SEmmanuel Vadot
135*5f62a964SEmmanuel Vadot        uart0_pins: uart0-0 {
136*5f62a964SEmmanuel Vadot            tx-pins {
137*5f62a964SEmmanuel Vadot                pins = "UART0_TXD";
138*5f62a964SEmmanuel Vadot                function = "uart";
139*5f62a964SEmmanuel Vadot                bias-disable;
140*5f62a964SEmmanuel Vadot                drive-strength = <3>;
141*5f62a964SEmmanuel Vadot                input-disable;
142*5f62a964SEmmanuel Vadot                input-schmitt-disable;
143*5f62a964SEmmanuel Vadot                slew-rate = <0>;
144*5f62a964SEmmanuel Vadot            };
145*5f62a964SEmmanuel Vadot
146*5f62a964SEmmanuel Vadot            rx-pins {
147*5f62a964SEmmanuel Vadot                pins = "UART0_RXD";
148*5f62a964SEmmanuel Vadot                function = "uart";
149*5f62a964SEmmanuel Vadot                bias-disable;
150*5f62a964SEmmanuel Vadot                drive-strength = <1>;
151*5f62a964SEmmanuel Vadot                input-enable;
152*5f62a964SEmmanuel Vadot                input-schmitt-enable;
153*5f62a964SEmmanuel Vadot                slew-rate = <0>;
154*5f62a964SEmmanuel Vadot            };
155*5f62a964SEmmanuel Vadot        };
156*5f62a964SEmmanuel Vadot    };
157*5f62a964SEmmanuel Vadot
158*5f62a964SEmmanuel Vadot    padctrl1_apsys: pinctrl@e7f3c000 {
159*5f62a964SEmmanuel Vadot        compatible = "thead,th1520-pinctrl";
160*5f62a964SEmmanuel Vadot        reg = <0xe7f3c000 0x1000>;
161*5f62a964SEmmanuel Vadot        clocks = <&apb_clk>;
162*5f62a964SEmmanuel Vadot        thead,pad-group = <2>;
163*5f62a964SEmmanuel Vadot
164*5f62a964SEmmanuel Vadot        i2c5_pins: i2c5-0 {
165*5f62a964SEmmanuel Vadot            i2c-pins {
166*5f62a964SEmmanuel Vadot                pins = "QSPI1_CSN0",    /* I2C5_SCL */
167*5f62a964SEmmanuel Vadot                       "QSPI1_D0_MOSI"; /* I2C5_SDA */
168*5f62a964SEmmanuel Vadot                function = "i2c";
169*5f62a964SEmmanuel Vadot                bias-pull-up = <2100>;
170*5f62a964SEmmanuel Vadot                drive-strength = <7>;
171*5f62a964SEmmanuel Vadot                input-enable;
172*5f62a964SEmmanuel Vadot                input-schmitt-enable;
173*5f62a964SEmmanuel Vadot                slew-rate = <0>;
174*5f62a964SEmmanuel Vadot            };
175*5f62a964SEmmanuel Vadot        };
176*5f62a964SEmmanuel Vadot    };
177