1# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2%YAML 1.2 3--- 4$id: http://devicetree.org/schemas/pinctrl/canaan,k230-pinctrl.yaml# 5$schema: http://devicetree.org/meta-schemas/core.yaml# 6 7title: Canaan Kendryte K230 Pin Controller 8 9maintainers: 10 - Ze Huang <18771902331@163.com> 11 12description: 13 The Canaan Kendryte K230 platform includes 64 IO pins, each capable of 14 multiplexing up to 5 different functions. Pin function configuration is 15 performed on a per-pin basis. 16 17properties: 18 compatible: 19 const: canaan,k230-pinctrl 20 21 reg: 22 maxItems: 1 23 24patternProperties: 25 '-pins$': 26 type: object 27 additionalProperties: false 28 description: 29 A pinctrl node should contain at least one subnode representing the 30 pinctrl groups available on the machine. 31 32 patternProperties: 33 '-cfg$': 34 type: object 35 allOf: 36 - $ref: /schemas/pinctrl/pincfg-node.yaml 37 - $ref: /schemas/pinctrl/pinmux-node.yaml 38 additionalProperties: false 39 description: 40 Each subnode will list the pins it needs, and how they should 41 be configured, with regard to muxer configuration, bias, input 42 enable/disable, input schmitt trigger, slew-rate enable/disable, 43 slew-rate, drive strength. 44 45 properties: 46 pinmux: 47 description: 48 The list of GPIOs and their mux settings that properties in 49 the node apply to. This should be set with the macro 50 'K230_PINMUX(pin, mode)' 51 52 bias-disable: true 53 54 bias-pull-up: true 55 56 bias-pull-down: true 57 58 drive-strength: 59 minimum: 0 60 maximum: 15 61 62 input-enable: true 63 64 output-enable: true 65 66 input-schmitt-enable: true 67 68 slew-rate: 69 description: | 70 slew rate control enable 71 0: disable 72 1: enable 73 74 enum: [0, 1] 75 76 power-source: 77 description: | 78 Specifies the power source voltage for the IO bank that the 79 pin belongs to. Each bank of IO pins operate at a specific, 80 fixed voltage levels. Incorrect voltage configuration can 81 damage the chip. The defined constants represent the 82 possible voltage configurations: 83 84 - K230_MSC_3V3 (value 0): 3.3V power supply 85 - K230_MSC_1V8 (value 1): 1.8V power supply 86 87 The following banks have the corresponding voltage 88 configurations: 89 90 - bank IO0 to IO1: Fixed at 1.8V 91 - bank IO2 to IO13: Fixed at 1.8V 92 - bank IO14 to IO25: Fixed at 1.8V 93 - bank IO26 to IO37: Fixed at 1.8V 94 - bank IO38 to IO49: Fixed at 1.8V 95 - bank IO50 to IO61: Fixed at 3.3V 96 - bank IO62 to IO63: Fixed at 1.8V 97 98 enum: [0, 1] 99 100 required: 101 - pinmux 102 103required: 104 - compatible 105 - reg 106 107additionalProperties: false 108 109examples: 110 - | 111 pinctrl@91105000 { 112 compatible = "canaan,k230-pinctrl"; 113 reg = <0x91105000 0x100>; 114 115 uart2-pins { 116 uart2-pins-cfg { 117 pinmux = <0x503>, /* uart2 txd */ 118 <0x603>; /* uart2 rxd */ 119 slew-rate = <0>; 120 drive-strength = <4>; 121 power-source = <1>; 122 input-enable; 123 output-enable; 124 bias-disable; 125 }; 126 }; 127 }; 128