summaryrefslogtreecommitdiffstats
path: root/dts/Bindings/pinctrl/canaan,k210-fpioa.yaml
blob: beb769e887c7fe9dc4bbdf334433011d3ece6aa0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/canaan,k210-fpioa.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Canaan Kendryte K210 FPIOA

maintainers:
  - Damien Le Moal <dlemoal@kernel.org>

description:
  The Canaan Kendryte K210 SoC Fully Programmable IO Array (FPIOA)
  controller allows assigning any of 256 possible functions to any of
  48 IO pins of the SoC. Pin function configuration is performed on
  a per-pin basis.

properties:
  compatible:
    const: canaan,k210-fpioa

  reg:
    maxItems: 1
    description:
      Address and length of the register set for the FPIOA controller.

  clocks:
    items:
      - description: Controller reference clock source
      - description: APB interface clock source

  clock-names:
    items:
      - const: ref
      - const: pclk

  resets:
    maxItems: 1

  canaan,k210-sysctl-power:
    $ref: /schemas/types.yaml#/definitions/phandle-array
    items:
      - items:
          - description: phandle of the K210 system controller node
          - description: offset of its power domain control register
    description: |
      phandle of the K210 system controller node and offset of its
      power domain control register.

patternProperties:
  '-pinmux$':
    type: object
    $ref: /schemas/pinctrl/pinmux-node.yaml
    description:
      FPIOA client devices use sub-nodes to define the desired pin
      configuration. Client device sub-nodes use the pinux property
      below.

    properties:
      pinmux:
        description:
          List of IO pins alternate functions. The values for each IO
          pin is a combination of an IO pin number (0 to 47) with the
          desired function for the IO pin. Functions are defined as
          macros in include/dt-bindings/pinctrl/k210-fpioa.h.
          The K210_FPIOA(IO pin, function) macro is provided to
          facilitate the combination of IO pin numbers and functions.

    required:
      - pinmux

    additionalProperties: false

  '-pins$':
    type: object
    $ref: /schemas/pinctrl/pincfg-node.yaml
    description:
      FPIOA client devices use sub-nodes to define the desired
      configuration of pins. Client device sub-nodes use the
      properties below.

    properties:
      pins:
        description:
          List of IO pins affected by the properties specified in this
          subnode. IO pins are identified using the pin names "IO_xx".
          Pin configuration nodes can also define the power domain to
          be used for the SoC pin groups A0 (IO pins 0-5),
          A1 (IO pins 6-11), A2 (IO pins 12-17), B0 (IO pins 18-23),
          B1 (IO pins 24-29), B2 (IO pins 30-35), B3 (IO pins 30-35),
          C0 (IO pins 36-41) and C1 (IO pins 42-47) using the
          power-source property.
        items:
          anyOf:
            - pattern: "^(IO_([0-9]*))|(A[0-2])|(B[3-5])|(C[6-7])$"
            - enum: [ IO_0, IO_1, IO_2, IO_3, IO_4, IO_5, IO_6, IO_7,
                      IO_8, IO_9, IO_10, IO_11, IO_12, IO_13, IO_14,
                      IO_15, IO_16, IO_17, IO_18, IO_19, IO_20, IO_21,
                      IO_22, IO_23, IO_24, IO_25, IO_26, IO_27, IO_28,
                      IO_29, IO_30, IO_31, IO_32, IO_33, IO_34, IO_35,
                      IO_36, IO_37, IO_38, IO_39, IO_40, IO_41, IO_42,
                      IO_43, IO_44, IO_45, IO_46, IO_47,
                      A0, A1, A2, B3, B4, B5, C6, C7 ]
      bias-disable: true

      bias-pull-down: true

      bias-pull-up: true

      drive-strength: true

      drive-strength-microamp: true

      input-enable: true

      input-disable: true

      input-schmitt-enable: true

      input-schmitt-disable: true

      input-polarity-invert:
        type: boolean
        description:
          Enable or disable pin input polarity inversion.

      output-enable: true

      output-disable: true

      output-high: true

      output-low: true

      output-polarity-invert:
        type: boolean
        description:
          Enable or disable pin output polarity inversion.

      slew-rate: true

      power-source: true

    additionalProperties: false

allOf:
  - $ref: pinctrl.yaml#

required:
  - compatible
  - reg
  - clocks
  - canaan,k210-sysctl-power

additionalProperties: false

examples:
  - |
    #include <dt-bindings/pinctrl/k210-fpioa.h>
    #include <dt-bindings/clock/k210-clk.h>
    #include <dt-bindings/reset/k210-rst.h>

    fpioa: pinmux@502b0000 {
      compatible = "canaan,k210-fpioa";
      reg = <0x502b0000 0x100>;
      clocks = <&sysclk K210_CLK_FPIOA>,
               <&sysclk K210_CLK_APB0>;
      clock-names = "ref", "pclk";
      resets = <&sysrst K210_RST_FPIOA>;
      canaan,k210-sysctl-power = <&sysctl 108>;
      pinctrl-0 = <&jtag_pinctrl>;
      pinctrl-names = "default";

      jtag_pinctrl: jtag-pinmux {
        pinmux = <K210_FPIOA(0, K210_PCF_JTAG_TCLK)>,
                 <K210_FPIOA(1, K210_PCF_JTAG_TDI)>,
                 <K210_FPIOA(2, K210_PCF_JTAG_TMS)>,
                 <K210_FPIOA(3, K210_PCF_JTAG_TDO)>;
      };
    };