blob: deca0cfab76c55735cd7eccf19fe23d16a8b591b [file] [log] [blame]
Sean Anderson087dfce2020-09-14 11:01:58 -04001Kendryte K210 FPIOA
2
3This binding describes the Fully-Programmable Input/Output Array (FPIOA) found
4in Kendryte K210 SoCs. Any of the 256 functions can be mapped to any of the 48
5pins.
6
7Required properties:
Damien Le Moal6e5a8b72022-03-01 10:35:39 +00008- compatible: should be "canaan,k210-fpioa"
Sean Anderson087dfce2020-09-14 11:01:58 -04009- reg: address and length of the FPIOA registers
Damien Le Moal6e5a8b72022-03-01 10:35:39 +000010- 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 Anderson087dfce2020-09-14 11:01:58 -040012 register (in bytes)
13
14Configuration nodes
15
16Pin configuration nodes are documented in pinctrl-bindings.txt
17
18Required 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 Anderson8656f582020-11-13 08:43:40 -050021 A0, A1, A2, B3, B4, B5, C6, C7
Sean Anderson087dfce2020-09-14 11:01:58 -040022 (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
37Optional 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
43Optional properties for "groups" nodes are:
44 power-source
45
46Notes 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
55Example:
56fpioa: pinmux@502B0000 {
Damien Le Moal6e5a8b72022-03-01 10:35:39 +000057 compatible = "canaan,k210-fpioa";
Sean Anderson087dfce2020-09-14 11:01:58 -040058 reg = <0x502B0000 0x100>;
Damien Le Moal6e5a8b72022-03-01 10:35:39 +000059 canaan,k210-sysctl = <&sysctl>;
60 canaan,k210-power-offset = <K210_SYSCTL_POWER_SEL>;
Sean Anderson087dfce2020-09-14 11:01:58 -040061
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};