Sean Anderson | 087dfce | 2020-09-14 11:01:58 -0400 | [diff] [blame] | 1 | Kendryte K210 FPIOA |
| 2 | |
| 3 | This binding describes the Fully-Programmable Input/Output Array (FPIOA) found |
| 4 | in Kendryte K210 SoCs. Any of the 256 functions can be mapped to any of the 48 |
| 5 | pins. |
| 6 | |
| 7 | Required properties: |
| 8 | - compatible: should be "kendryte,k210-fpioa" |
| 9 | - reg: address and length of the FPIOA registers |
| 10 | - kendryte,sysctl: phandle to the "sysctl" register map node |
| 11 | - kendryte,power-offset: offset in the register map of the power bank control |
| 12 | register (in bytes) |
| 13 | |
| 14 | Configuration nodes |
| 15 | |
| 16 | Pin configuration nodes are documented in pinctrl-bindings.txt |
| 17 | |
| 18 | Required properties for pin-configuration nodes or sub-nodes are: |
| 19 | - groups: list of power groups to which the configuration applies. Valid groups |
| 20 | are: |
Sean Anderson | 8656f58 | 2020-11-13 08:43:40 -0500 | [diff] [blame] | 21 | A0, A1, A2, B3, B4, B5, C6, C7 |
Sean Anderson | 087dfce | 2020-09-14 11:01:58 -0400 | [diff] [blame] | 22 | (either this or "pinmux" must be specified) |
| 23 | - pinmux: integer array representing pin multiplexing configuration. In addition |
| 24 | to the 256 standard functions, each pin can also output the direction |
| 25 | indicator (DO) of any function. This signal is high whenever the function |
| 26 | would normally drive the output. Helper macros to ease assembling the "pinmux" |
| 27 | arguments from the pin and function are provided by the FPIOA header file at: |
| 28 | <dt-bindings/pinctrl/k210-pinctrl.h> |
| 29 | Integer values in the "pinmux" argument list are assembled as: |
| 30 | ((PIN << 16) | (DO << 8) | (FUNC)) |
| 31 | Valid values for PIN are numbers 0 through 47. |
| 32 | Valid values for DO are 0 or 1. |
| 33 | Valid values for FUNC are numbers 0 through 255. For a complete list of |
| 34 | acceptable functions, consult the FPIOA header file. |
| 35 | (either this or "groups" must be specified) |
| 36 | |
| 37 | Optional properties for "pinmux" nodes are: |
| 38 | bias-disable, bias-pull-down, bias-pull-up, drive-strength, |
| 39 | drive-strength-ua, input-enable, input-disable, input-schmitt-enable, |
| 40 | input-schmitt-disable, output-low, output-high, output-enable, |
| 41 | output-disable, slew-rate, output-polarity-invert, input-polarity-invert |
| 42 | |
| 43 | Optional properties for "groups" nodes are: |
| 44 | power-source |
| 45 | |
| 46 | Notes on specific properties include: |
| 47 | - bias-pull-up, -down, and -pin-default: The pull strength cannot be configured. |
| 48 | - drive-strength: There are 8 drive strength settings between 11 and 50 mA. |
| 49 | - input- and output-polarity-invert: Invert the polarity of either the input or |
| 50 | the output, respectively. |
| 51 | - power-source: Controls the output voltage of a bank of pins. Either |
| 52 | K210_PC_POWER_1V8 or K210_PC_POWER_3V3 may be specified. |
| 53 | - slew-rate: Specifying this property reduces the slew rate. |
| 54 | |
| 55 | Example: |
| 56 | fpioa: pinmux@502B0000 { |
| 57 | compatible = "kendryte,k210-fpioa"; |
| 58 | reg = <0x502B0000 0x100>; |
| 59 | kendryte,sysctl = <&sysctl>; |
| 60 | kendryte,power-offset = <K210_SYSCTL_POWER_SEL>; |
| 61 | |
| 62 | /* JTAG running at 3.3V and driven at 11 mA */ |
| 63 | fpioa_jtag: jtag { |
| 64 | voltage { |
| 65 | group = "A0"; |
| 66 | power-source = <K210_PC_POWER_3V3>; |
| 67 | }; |
| 68 | |
| 69 | jtag { |
| 70 | pinmux = <K210_FPIOA(0, K210_PCF_JTAG_TCK)>, |
| 71 | <K210_FPIOA(1, K210_PCF_JTAG_TDI)>, |
| 72 | <K210_FPIOA(2, K210_PCF_JTAG_TMS)>, |
| 73 | <K210_FPIOA(3, K210_PCF_JTAG_TDO)>; |
| 74 | drive-strength = <11>; |
| 75 | } |
| 76 | }; |
| 77 | |
| 78 | /* I2C configured for use with a TCA9800 level shifter */ |
| 79 | fpioa_i2c: i2c { |
| 80 | i2c { |
| 81 | pinmux = <K210_FPIOA(6, K210_PCF_I2C0_SCLK)>, |
| 82 | <K210_FPIOA(7, K210_PCF_I2C0_SDA)>; |
| 83 | }; |
| 84 | |
| 85 | direction { |
| 86 | pinmux = <K210_FPIOA_DO(8, K210_PCF_I2C0_SDA)>; |
| 87 | output-polarity-invert; |
| 88 | }; |
| 89 | }; |
| 90 | |
| 91 | /* UART with an active-high TX status LED */ |
| 92 | fpioa_uart1: uart1 { |
| 93 | uart { |
| 94 | pinmux = <K210_FPIOA(9, K210_PCF_UART1_TX)>, |
| 95 | <K210_FPIOA(10, K210_PCF_UART1_RX)>; |
| 96 | }; |
| 97 | |
| 98 | status { |
| 99 | pinmux = <K210_FPIOA_DO(11, K210_PCF_UART1_TX)>; |
| 100 | }; |
| 101 | }; |
| 102 | }; |