Documentation / devicetree / bindings / pinctrl / spacemit,k1-pinctrl.yaml


Based on kernel version 6.13. Page generated on 2025-01-21 08:20 EST.

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
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/spacemit,k1-pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: SpacemiT K1 SoC Pin Controller

maintainers:
  - Yixun Lan <dlan@gentoo.org>

properties:
  compatible:
    const: spacemit,k1-pinctrl

  reg:
    items:
      - description: pinctrl io memory base

patternProperties:
  '-cfg$':
    type: object
    additionalProperties: false

    description:
      A pinctrl node should contain at least one subnode representing the
      pinctrl groups available on the machine.

    patternProperties:
      '-pins$':
        type: object
        additionalProperties: false

        description:
          Each subnode will list the pins it needs, and how they should
          be configured, with regard to muxer configuration, bias pull,
          drive strength, input schmitt trigger, slew rate, power source.

        allOf:
          - $ref: pincfg-node.yaml#
          - $ref: pinmux-node.yaml#

        properties:
          pinmux:
            description:
              The list of GPIOs and their mux settings that properties in the
              node apply to. This should be set using the K1_PADCONF macro to
              construct the value.

          bias-disable: true

          bias-pull-down: true

          bias-pull-up:
            description: |
              typical value for selecting bias pull up or strong pull up.
              0: normal bias pull up
              1: strong bias pull up
            enum: [ 0, 1 ]

          drive-strength:
            description: |
              typical current when output high level.
              1.8V output: 11, 21, 32, 42 (mA)
              3.3V output: 7, 10, 13, 16, 19, 23, 26, 29 (mA)

          input-schmitt:
            description: |
              typical threshold for schmitt trigger.
              0: buffer mode
              1: trigger mode
              2, 3: trigger mode
            $ref: /schemas/types.yaml#/definitions/uint32
            enum: [ 0, 1, 2, 3 ]

          power-source:
            description: external power supplies at 1.8v or 3.3v.
            enum: [ 1800, 3300 ]

          slew-rate:
            description: |
              slew rate for output buffer.
              0: disable it
              1: enable it (via bundled value from drive strength)
              2: slow speed 0
              3: slow speed 1
              4: medium speed
              5: fast speed
            enum: [ 0, 1, 2, 3, 4, 5 ]

        required:
          - pinmux

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    #define K1_PADCONF(pin, func) (((pin) << 16) | (func))
 
    soc {
        #address-cells = <2>;
        #size-cells = <2>;
 
        pinctrl@d401e000 {
            compatible = "spacemit,k1-pinctrl";
            reg = <0x0 0xd401e000 0x0 0x400>;
 
            uart0_2_cfg: uart0-2-cfg {
                uart0-2-pins {
                    pinmux = <K1_PADCONF(68, 2)>,
                             <K1_PADCONF(69, 2)>;
 
                    bias-pull-up = <0>;
                    drive-strength = <32>;
                };
            };
        };
    };

...