xref: /freebsd/sys/contrib/device-tree/Bindings/pinctrl/sophgo,sg2042-pinctrl.yaml (revision 8ccc0d235c226d84112561d453c49904398d085c)
1*8ccc0d23SEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2*8ccc0d23SEmmanuel Vadot%YAML 1.2
3*8ccc0d23SEmmanuel Vadot---
4*8ccc0d23SEmmanuel Vadot$id: http://devicetree.org/schemas/pinctrl/sophgo,sg2042-pinctrl.yaml#
5*8ccc0d23SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*8ccc0d23SEmmanuel Vadot
7*8ccc0d23SEmmanuel Vadottitle: Sophgo SG2042 Pin Controller
8*8ccc0d23SEmmanuel Vadot
9*8ccc0d23SEmmanuel Vadotmaintainers:
10*8ccc0d23SEmmanuel Vadot  - Inochi Amaoto <inochiama@outlook.com>
11*8ccc0d23SEmmanuel Vadot
12*8ccc0d23SEmmanuel Vadotproperties:
13*8ccc0d23SEmmanuel Vadot  compatible:
14*8ccc0d23SEmmanuel Vadot    enum:
15*8ccc0d23SEmmanuel Vadot      - sophgo,sg2042-pinctrl
16*8ccc0d23SEmmanuel Vadot      - sophgo,sg2044-pinctrl
17*8ccc0d23SEmmanuel Vadot
18*8ccc0d23SEmmanuel Vadot  reg:
19*8ccc0d23SEmmanuel Vadot    maxItems: 1
20*8ccc0d23SEmmanuel Vadot
21*8ccc0d23SEmmanuel VadotpatternProperties:
22*8ccc0d23SEmmanuel Vadot  '-cfg$':
23*8ccc0d23SEmmanuel Vadot    type: object
24*8ccc0d23SEmmanuel Vadot    description:
25*8ccc0d23SEmmanuel Vadot      A pinctrl node should contain at least one subnode representing the
26*8ccc0d23SEmmanuel Vadot      pinctrl groups available on the machine.
27*8ccc0d23SEmmanuel Vadot
28*8ccc0d23SEmmanuel Vadot    additionalProperties: false
29*8ccc0d23SEmmanuel Vadot
30*8ccc0d23SEmmanuel Vadot    patternProperties:
31*8ccc0d23SEmmanuel Vadot      '-pins$':
32*8ccc0d23SEmmanuel Vadot        type: object
33*8ccc0d23SEmmanuel Vadot        description: |
34*8ccc0d23SEmmanuel Vadot          Each subnode will list the pins it needs, and how they should
35*8ccc0d23SEmmanuel Vadot          be configured, with regard to muxer configuration, bias input
36*8ccc0d23SEmmanuel Vadot          enable/disable, input schmitt trigger enable, drive strength
37*8ccc0d23SEmmanuel Vadot          output enable/disable state. For configuration detail,
38*8ccc0d23SEmmanuel Vadot          refer to https://github.com/sophgo/sophgo-doc/.
39*8ccc0d23SEmmanuel Vadot
40*8ccc0d23SEmmanuel Vadot        allOf:
41*8ccc0d23SEmmanuel Vadot          - $ref: pincfg-node.yaml#
42*8ccc0d23SEmmanuel Vadot          - $ref: pinmux-node.yaml#
43*8ccc0d23SEmmanuel Vadot
44*8ccc0d23SEmmanuel Vadot        properties:
45*8ccc0d23SEmmanuel Vadot          pinmux:
46*8ccc0d23SEmmanuel Vadot            description: |
47*8ccc0d23SEmmanuel Vadot              The list of GPIOs and their mux settings that properties in the
48*8ccc0d23SEmmanuel Vadot              node apply to. This should be set using the PINMUX macro.
49*8ccc0d23SEmmanuel Vadot
50*8ccc0d23SEmmanuel Vadot          bias-disable: true
51*8ccc0d23SEmmanuel Vadot
52*8ccc0d23SEmmanuel Vadot          bias-pull-up:
53*8ccc0d23SEmmanuel Vadot            type: boolean
54*8ccc0d23SEmmanuel Vadot
55*8ccc0d23SEmmanuel Vadot          bias-pull-down:
56*8ccc0d23SEmmanuel Vadot            type: boolean
57*8ccc0d23SEmmanuel Vadot
58*8ccc0d23SEmmanuel Vadot          drive-strength-microamp:
59*8ccc0d23SEmmanuel Vadot            description: typical current when output low level.
60*8ccc0d23SEmmanuel Vadot
61*8ccc0d23SEmmanuel Vadot          input-schmitt-enable: true
62*8ccc0d23SEmmanuel Vadot
63*8ccc0d23SEmmanuel Vadot          input-schmitt-disable: true
64*8ccc0d23SEmmanuel Vadot
65*8ccc0d23SEmmanuel Vadot        required:
66*8ccc0d23SEmmanuel Vadot          - pinmux
67*8ccc0d23SEmmanuel Vadot
68*8ccc0d23SEmmanuel Vadot        additionalProperties: false
69*8ccc0d23SEmmanuel Vadot
70*8ccc0d23SEmmanuel Vadotrequired:
71*8ccc0d23SEmmanuel Vadot  - compatible
72*8ccc0d23SEmmanuel Vadot  - reg
73*8ccc0d23SEmmanuel Vadot
74*8ccc0d23SEmmanuel VadotallOf:
75*8ccc0d23SEmmanuel Vadot  - if:
76*8ccc0d23SEmmanuel Vadot      properties:
77*8ccc0d23SEmmanuel Vadot        compatible:
78*8ccc0d23SEmmanuel Vadot          contains:
79*8ccc0d23SEmmanuel Vadot            const: sophgo,sg2042-pinctrl
80*8ccc0d23SEmmanuel Vadot    then:
81*8ccc0d23SEmmanuel Vadot      patternProperties:
82*8ccc0d23SEmmanuel Vadot        '-cfg$':
83*8ccc0d23SEmmanuel Vadot          patternProperties:
84*8ccc0d23SEmmanuel Vadot            '-pins$':
85*8ccc0d23SEmmanuel Vadot              properties:
86*8ccc0d23SEmmanuel Vadot                drive-strength-microamp:
87*8ccc0d23SEmmanuel Vadot                  enum: [ 5400, 8100, 10700, 13400,
88*8ccc0d23SEmmanuel Vadot                          16100, 18800, 21400, 24100,
89*8ccc0d23SEmmanuel Vadot                          26800, 29400, 32100, 34800,
90*8ccc0d23SEmmanuel Vadot                          37400, 40100, 42800, 45400 ]
91*8ccc0d23SEmmanuel Vadot
92*8ccc0d23SEmmanuel Vadot  - if:
93*8ccc0d23SEmmanuel Vadot      properties:
94*8ccc0d23SEmmanuel Vadot        compatible:
95*8ccc0d23SEmmanuel Vadot          contains:
96*8ccc0d23SEmmanuel Vadot            const: sophgo,sg2044-pinctrl
97*8ccc0d23SEmmanuel Vadot    then:
98*8ccc0d23SEmmanuel Vadot      patternProperties:
99*8ccc0d23SEmmanuel Vadot        '-cfg$':
100*8ccc0d23SEmmanuel Vadot          patternProperties:
101*8ccc0d23SEmmanuel Vadot            '-pins$':
102*8ccc0d23SEmmanuel Vadot              properties:
103*8ccc0d23SEmmanuel Vadot                drive-strength-microamp:
104*8ccc0d23SEmmanuel Vadot                  enum: [ 3200, 6400, 9600, 12700,
105*8ccc0d23SEmmanuel Vadot                          15900, 19100, 22200, 25300,
106*8ccc0d23SEmmanuel Vadot                          29500, 32700, 35900, 39000,
107*8ccc0d23SEmmanuel Vadot                          42000, 45200, 48300, 51400]
108*8ccc0d23SEmmanuel Vadot
109*8ccc0d23SEmmanuel VadotadditionalProperties: false
110*8ccc0d23SEmmanuel Vadot
111*8ccc0d23SEmmanuel Vadotexamples:
112*8ccc0d23SEmmanuel Vadot  - |
113*8ccc0d23SEmmanuel Vadot    #include <dt-bindings/pinctrl/pinctrl-sg2042.h>
114*8ccc0d23SEmmanuel Vadot
115*8ccc0d23SEmmanuel Vadot    pinctrl@30011000 {
116*8ccc0d23SEmmanuel Vadot        compatible = "sophgo,sg2042-pinctrl";
117*8ccc0d23SEmmanuel Vadot        reg = <30011000 0x1000>;
118*8ccc0d23SEmmanuel Vadot
119*8ccc0d23SEmmanuel Vadot        uart0_cfg: uart0-cfg {
120*8ccc0d23SEmmanuel Vadot            uart0-pins {
121*8ccc0d23SEmmanuel Vadot                pinmux = <PINMUX(PIN_UART0_TX, 0)>,
122*8ccc0d23SEmmanuel Vadot                         <PINMUX(PIN_UART0_RX, 0)>;
123*8ccc0d23SEmmanuel Vadot                bias-pull-up;
124*8ccc0d23SEmmanuel Vadot                drive-strength-microamp = <13400>;
125*8ccc0d23SEmmanuel Vadot            };
126*8ccc0d23SEmmanuel Vadot        };
127*8ccc0d23SEmmanuel Vadot    };
128*8ccc0d23SEmmanuel Vadot
129*8ccc0d23SEmmanuel Vadot...
130