kendryte,k210-fpioa.txt 3.4 KB

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