1# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2%YAML 1.2 3--- 4$id: http://devicetree.org/schemas/pinctrl/spacemit,k1-pinctrl.yaml# 5$schema: http://devicetree.org/meta-schemas/core.yaml# 6 7title: SpacemiT K1 SoC Pin Controller 8 9maintainers: 10 - Yixun Lan <dlan@gentoo.org> 11 12properties: 13 compatible: 14 const: spacemit,k1-pinctrl 15 16 reg: 17 items: 18 - description: pinctrl io memory base 19 20 clocks: 21 items: 22 - description: Functional Clock 23 - description: Bus Clock 24 25 clock-names: 26 items: 27 - const: func 28 - const: bus 29 30 resets: 31 maxItems: 1 32 33patternProperties: 34 '-cfg$': 35 type: object 36 additionalProperties: false 37 38 description: 39 A pinctrl node should contain at least one subnode representing the 40 pinctrl groups available on the machine. 41 42 patternProperties: 43 '-pins$': 44 type: object 45 additionalProperties: false 46 47 description: 48 Each subnode will list the pins it needs, and how they should 49 be configured, with regard to muxer configuration, bias pull, 50 drive strength, input schmitt trigger, slew rate, power source. 51 52 allOf: 53 - $ref: pincfg-node.yaml# 54 - $ref: pinmux-node.yaml# 55 56 properties: 57 pinmux: 58 description: 59 The list of GPIOs and their mux settings that properties in the 60 node apply to. This should be set using the K1_PADCONF macro to 61 construct the value. 62 63 bias-disable: true 64 65 bias-pull-down: true 66 67 bias-pull-up: 68 description: | 69 typical value for selecting bias pull up or strong pull up. 70 0: normal bias pull up 71 1: strong bias pull up 72 enum: [ 0, 1 ] 73 74 drive-strength: 75 description: | 76 typical current when output high level. 77 1.8V output: 11, 21, 32, 42 (mA) 78 3.3V output: 7, 10, 13, 16, 19, 23, 26, 29 (mA) 79 80 input-schmitt: 81 description: | 82 typical threshold for schmitt trigger. 83 0: buffer mode 84 1: trigger mode 85 2, 3: trigger mode 86 $ref: /schemas/types.yaml#/definitions/uint32 87 enum: [ 0, 1, 2, 3 ] 88 89 power-source: 90 description: external power supplies at 1.8v or 3.3v. 91 enum: [ 1800, 3300 ] 92 93 slew-rate: 94 description: | 95 slew rate for output buffer. 96 0: disable it 97 1: enable it (via bundled value from drive strength) 98 2: slow speed 0 99 3: slow speed 1 100 4: medium speed 101 5: fast speed 102 enum: [ 0, 1, 2, 3, 4, 5 ] 103 104 required: 105 - pinmux 106 107required: 108 - compatible 109 - reg 110 - clocks 111 - clock-names 112 113additionalProperties: false 114 115examples: 116 - | 117 #define K1_PADCONF(pin, func) (((pin) << 16) | (func)) 118 119 soc { 120 #address-cells = <2>; 121 #size-cells = <2>; 122 123 pinctrl@d401e000 { 124 compatible = "spacemit,k1-pinctrl"; 125 reg = <0x0 0xd401e000 0x0 0x400>; 126 clocks = <&syscon_apbc 42>, 127 <&syscon_apbc 94>; 128 clock-names = "func", "bus"; 129 130 uart0_2_cfg: uart0-2-cfg { 131 uart0-2-pins { 132 pinmux = <K1_PADCONF(68, 2)>, 133 <K1_PADCONF(69, 2)>; 134 135 bias-pull-up = <0>; 136 drive-strength = <32>; 137 }; 138 }; 139 }; 140 }; 141 142... 143