xref: /freebsd/sys/contrib/device-tree/Bindings/pinctrl/canaan,k210-fpioa.yaml (revision aa1a8ff2d6dbc51ef058f46f3db5a8bb77967145)
15def4c47SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
25def4c47SEmmanuel Vadot%YAML 1.2
35def4c47SEmmanuel Vadot---
45def4c47SEmmanuel Vadot$id: http://devicetree.org/schemas/pinctrl/canaan,k210-fpioa.yaml#
55def4c47SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
65def4c47SEmmanuel Vadot
77ef62cebSEmmanuel Vadottitle: Canaan Kendryte K210 FPIOA
85def4c47SEmmanuel Vadot
95def4c47SEmmanuel Vadotmaintainers:
10fac71e4eSEmmanuel Vadot  - Damien Le Moal <dlemoal@kernel.org>
115def4c47SEmmanuel Vadot
125def4c47SEmmanuel Vadotdescription:
135def4c47SEmmanuel Vadot  The Canaan Kendryte K210 SoC Fully Programmable IO Array (FPIOA)
14*aa1a8ff2SEmmanuel Vadot  controller allows assigning any of 256 possible functions to any of
155def4c47SEmmanuel Vadot  48 IO pins of the SoC. Pin function configuration is performed on
165def4c47SEmmanuel Vadot  a per-pin basis.
175def4c47SEmmanuel Vadot
185def4c47SEmmanuel Vadotproperties:
195def4c47SEmmanuel Vadot  compatible:
205def4c47SEmmanuel Vadot    const: canaan,k210-fpioa
215def4c47SEmmanuel Vadot
225def4c47SEmmanuel Vadot  reg:
235def4c47SEmmanuel Vadot    maxItems: 1
245def4c47SEmmanuel Vadot    description:
255def4c47SEmmanuel Vadot      Address and length of the register set for the FPIOA controller.
265def4c47SEmmanuel Vadot
275def4c47SEmmanuel Vadot  clocks:
285def4c47SEmmanuel Vadot    items:
295def4c47SEmmanuel Vadot      - description: Controller reference clock source
305def4c47SEmmanuel Vadot      - description: APB interface clock source
315def4c47SEmmanuel Vadot
325def4c47SEmmanuel Vadot  clock-names:
335def4c47SEmmanuel Vadot    items:
345def4c47SEmmanuel Vadot      - const: ref
355def4c47SEmmanuel Vadot      - const: pclk
365def4c47SEmmanuel Vadot
375def4c47SEmmanuel Vadot  resets:
385def4c47SEmmanuel Vadot    maxItems: 1
395def4c47SEmmanuel Vadot
405def4c47SEmmanuel Vadot  canaan,k210-sysctl-power:
415def4c47SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/phandle-array
42c9ccf3a3SEmmanuel Vadot    items:
43c9ccf3a3SEmmanuel Vadot      - items:
44c9ccf3a3SEmmanuel Vadot          - description: phandle of the K210 system controller node
45c9ccf3a3SEmmanuel Vadot          - description: offset of its power domain control register
465def4c47SEmmanuel Vadot    description: |
475def4c47SEmmanuel Vadot      phandle of the K210 system controller node and offset of its
485def4c47SEmmanuel Vadot      power domain control register.
495def4c47SEmmanuel Vadot
505def4c47SEmmanuel VadotpatternProperties:
515def4c47SEmmanuel Vadot  '-pinmux$':
525def4c47SEmmanuel Vadot    type: object
535def4c47SEmmanuel Vadot    $ref: /schemas/pinctrl/pinmux-node.yaml
545def4c47SEmmanuel Vadot    description:
555def4c47SEmmanuel Vadot      FPIOA client devices use sub-nodes to define the desired pin
565def4c47SEmmanuel Vadot      configuration. Client device sub-nodes use the pinux property
575def4c47SEmmanuel Vadot      below.
585def4c47SEmmanuel Vadot
595def4c47SEmmanuel Vadot    properties:
605def4c47SEmmanuel Vadot      pinmux:
615def4c47SEmmanuel Vadot        description:
625def4c47SEmmanuel Vadot          List of IO pins alternate functions. The values for each IO
635def4c47SEmmanuel Vadot          pin is a combination of an IO pin number (0 to 47) with the
645def4c47SEmmanuel Vadot          desired function for the IO pin. Functions are defined as
655def4c47SEmmanuel Vadot          macros in include/dt-bindings/pinctrl/k210-fpioa.h.
665def4c47SEmmanuel Vadot          The K210_FPIOA(IO pin, function) macro is provided to
675def4c47SEmmanuel Vadot          facilitate the combination of IO pin numbers and functions.
685def4c47SEmmanuel Vadot
695def4c47SEmmanuel Vadot    required:
705def4c47SEmmanuel Vadot      - pinmux
715def4c47SEmmanuel Vadot
725def4c47SEmmanuel Vadot    additionalProperties: false
735def4c47SEmmanuel Vadot
745def4c47SEmmanuel Vadot  '-pins$':
755def4c47SEmmanuel Vadot    type: object
765def4c47SEmmanuel Vadot    $ref: /schemas/pinctrl/pincfg-node.yaml
775def4c47SEmmanuel Vadot    description:
785def4c47SEmmanuel Vadot      FPIOA client devices use sub-nodes to define the desired
795def4c47SEmmanuel Vadot      configuration of pins. Client device sub-nodes use the
805def4c47SEmmanuel Vadot      properties below.
815def4c47SEmmanuel Vadot
825def4c47SEmmanuel Vadot    properties:
835def4c47SEmmanuel Vadot      pins:
845def4c47SEmmanuel Vadot        description:
855def4c47SEmmanuel Vadot          List of IO pins affected by the properties specified in this
865def4c47SEmmanuel Vadot          subnode. IO pins are identified using the pin names "IO_xx".
875def4c47SEmmanuel Vadot          Pin configuration nodes can also define the power domain to
885def4c47SEmmanuel Vadot          be used for the SoC pin groups A0 (IO pins 0-5),
895def4c47SEmmanuel Vadot          A1 (IO pins 6-11), A2 (IO pins 12-17), B0 (IO pins 18-23),
905def4c47SEmmanuel Vadot          B1 (IO pins 24-29), B2 (IO pins 30-35), B3 (IO pins 30-35),
915def4c47SEmmanuel Vadot          C0 (IO pins 36-41) and C1 (IO pins 42-47) using the
925def4c47SEmmanuel Vadot          power-source property.
935def4c47SEmmanuel Vadot        items:
945def4c47SEmmanuel Vadot          anyOf:
955def4c47SEmmanuel Vadot            - pattern: "^(IO_([0-9]*))|(A[0-2])|(B[3-5])|(C[6-7])$"
965def4c47SEmmanuel Vadot            - enum: [ IO_0, IO_1, IO_2, IO_3, IO_4, IO_5, IO_6, IO_7,
975def4c47SEmmanuel Vadot                      IO_8, IO_9, IO_10, IO_11, IO_12, IO_13, IO_14,
985def4c47SEmmanuel Vadot                      IO_15, IO_16, IO_17, IO_18, IO_19, IO_20, IO_21,
995def4c47SEmmanuel Vadot                      IO_22, IO_23, IO_24, IO_25, IO_26, IO_27, IO_28,
1005def4c47SEmmanuel Vadot                      IO_29, IO_30, IO_31, IO_32, IO_33, IO_34, IO_35,
1015def4c47SEmmanuel Vadot                      IO_36, IO_37, IO_38, IO_39, IO_40, IO_41, IO_42,
1025def4c47SEmmanuel Vadot                      IO_43, IO_44, IO_45, IO_46, IO_47,
1035def4c47SEmmanuel Vadot                      A0, A1, A2, B3, B4, B5, C6, C7 ]
1045def4c47SEmmanuel Vadot      bias-disable: true
1055def4c47SEmmanuel Vadot
1065def4c47SEmmanuel Vadot      bias-pull-down: true
1075def4c47SEmmanuel Vadot
1085def4c47SEmmanuel Vadot      bias-pull-up: true
1095def4c47SEmmanuel Vadot
1105def4c47SEmmanuel Vadot      drive-strength: true
1115def4c47SEmmanuel Vadot
1125def4c47SEmmanuel Vadot      drive-strength-microamp: true
1135def4c47SEmmanuel Vadot
1145def4c47SEmmanuel Vadot      input-enable: true
1155def4c47SEmmanuel Vadot
1165def4c47SEmmanuel Vadot      input-disable: true
1175def4c47SEmmanuel Vadot
1185def4c47SEmmanuel Vadot      input-schmitt-enable: true
1195def4c47SEmmanuel Vadot
1205def4c47SEmmanuel Vadot      input-schmitt-disable: true
1215def4c47SEmmanuel Vadot
1225def4c47SEmmanuel Vadot      input-polarity-invert:
123d5b0e70fSEmmanuel Vadot        type: boolean
1245def4c47SEmmanuel Vadot        description:
1255def4c47SEmmanuel Vadot          Enable or disable pin input polarity inversion.
1265def4c47SEmmanuel Vadot
1275def4c47SEmmanuel Vadot      output-enable: true
1285def4c47SEmmanuel Vadot
1295def4c47SEmmanuel Vadot      output-disable: true
1305def4c47SEmmanuel Vadot
1315def4c47SEmmanuel Vadot      output-high: true
1325def4c47SEmmanuel Vadot
1335def4c47SEmmanuel Vadot      output-low: true
1345def4c47SEmmanuel Vadot
1355def4c47SEmmanuel Vadot      output-polarity-invert:
136d5b0e70fSEmmanuel Vadot        type: boolean
1375def4c47SEmmanuel Vadot        description:
1385def4c47SEmmanuel Vadot          Enable or disable pin output polarity inversion.
1395def4c47SEmmanuel Vadot
1405def4c47SEmmanuel Vadot      slew-rate: true
1415def4c47SEmmanuel Vadot
1425def4c47SEmmanuel Vadot      power-source: true
1435def4c47SEmmanuel Vadot
1445def4c47SEmmanuel Vadot    additionalProperties: false
1455def4c47SEmmanuel Vadot
146e67e8565SEmmanuel VadotallOf:
147fac71e4eSEmmanuel Vadot  - $ref: pinctrl.yaml#
148e67e8565SEmmanuel Vadot
1495def4c47SEmmanuel Vadotrequired:
1505def4c47SEmmanuel Vadot  - compatible
1515def4c47SEmmanuel Vadot  - reg
1525def4c47SEmmanuel Vadot  - clocks
1535def4c47SEmmanuel Vadot  - canaan,k210-sysctl-power
1545def4c47SEmmanuel Vadot
1555def4c47SEmmanuel VadotadditionalProperties: false
1565def4c47SEmmanuel Vadot
1575def4c47SEmmanuel Vadotexamples:
1585def4c47SEmmanuel Vadot  - |
1595def4c47SEmmanuel Vadot    #include <dt-bindings/pinctrl/k210-fpioa.h>
1605def4c47SEmmanuel Vadot    #include <dt-bindings/clock/k210-clk.h>
1615def4c47SEmmanuel Vadot    #include <dt-bindings/reset/k210-rst.h>
1625def4c47SEmmanuel Vadot
163e67e8565SEmmanuel Vadot    fpioa: pinmux@502b0000 {
1645def4c47SEmmanuel Vadot      compatible = "canaan,k210-fpioa";
165e67e8565SEmmanuel Vadot      reg = <0x502b0000 0x100>;
1665def4c47SEmmanuel Vadot      clocks = <&sysclk K210_CLK_FPIOA>,
1675def4c47SEmmanuel Vadot               <&sysclk K210_CLK_APB0>;
1685def4c47SEmmanuel Vadot      clock-names = "ref", "pclk";
1695def4c47SEmmanuel Vadot      resets = <&sysrst K210_RST_FPIOA>;
1705def4c47SEmmanuel Vadot      canaan,k210-sysctl-power = <&sysctl 108>;
1715def4c47SEmmanuel Vadot      pinctrl-0 = <&jtag_pinctrl>;
1725def4c47SEmmanuel Vadot      pinctrl-names = "default";
1735def4c47SEmmanuel Vadot
1745def4c47SEmmanuel Vadot      jtag_pinctrl: jtag-pinmux {
1755def4c47SEmmanuel Vadot        pinmux = <K210_FPIOA(0, K210_PCF_JTAG_TCLK)>,
1765def4c47SEmmanuel Vadot                 <K210_FPIOA(1, K210_PCF_JTAG_TDI)>,
1775def4c47SEmmanuel Vadot                 <K210_FPIOA(2, K210_PCF_JTAG_TMS)>,
1785def4c47SEmmanuel Vadot                 <K210_FPIOA(3, K210_PCF_JTAG_TDO)>;
1795def4c47SEmmanuel Vadot      };
1805def4c47SEmmanuel Vadot    };
181