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: |
Damien Le Moal | 6e5a8b7 | 2022-03-01 10:35:39 +0000 | [diff] [blame] | 8 | - compatible: should be "canaan,k210-fpioa" |
Sean Anderson | 087dfce | 2020-09-14 11:01:58 -0400 | [diff] [blame] | 9 | - reg: address and length of the FPIOA registers |
Damien Le Moal | 6e5a8b7 | 2022-03-01 10:35:39 +0000 | [diff] [blame] | 10 | - canaan,sysctl: phandle to the "sysctl" register map node |
| 11 | - canaan,k210-power-offset: offset in the register map of the power bank control |
Sean Anderson | 087dfce | 2020-09-14 11:01:58 -0400 | [diff] [blame] | 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 { |
Damien Le Moal | 6e5a8b7 | 2022-03-01 10:35:39 +0000 | [diff] [blame] | 57 | compatible = "canaan,k210-fpioa"; |
Sean Anderson | 087dfce | 2020-09-14 11:01:58 -0400 | [diff] [blame] | 58 | reg = <0x502B0000 0x100>; |
Damien Le Moal | 6e5a8b7 | 2022-03-01 10:35:39 +0000 | [diff] [blame] | 59 | canaan,k210-sysctl = <&sysctl>; |
| 60 | canaan,k210-power-offset = <K210_SYSCTL_POWER_SEL>; |
Sean Anderson | 087dfce | 2020-09-14 11:01:58 -0400 | [diff] [blame] | 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 | }; |