renesas,pfc-pinctrl.txt 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. * Renesas Pin Function Controller (GPIO and Pin Mux/Config)
  2. The Pin Function Controller (PFC) is a Pin Mux/Config controller. On SH7372,
  3. SH73A0, R8A73A4 and R8A7740 it also acts as a GPIO controller.
  4. Pin Control
  5. -----------
  6. Required Properties:
  7. - compatible: should be one of the following.
  8. - "renesas,pfc-r8a73a4": for R8A73A4 (R-Mobile APE6) compatible pin-controller.
  9. - "renesas,pfc-r8a7740": for R8A7740 (R-Mobile A1) compatible pin-controller.
  10. - "renesas,pfc-r8a7778": for R8A7778 (R-Mobile M1) compatible pin-controller.
  11. - "renesas,pfc-r8a7779": for R8A7779 (R-Car H1) compatible pin-controller.
  12. - "renesas,pfc-r8a7790": for R8A7790 (R-Car H2) compatible pin-controller.
  13. - "renesas,pfc-sh7372": for SH7372 (SH-Mobile AP4) compatible pin-controller.
  14. - "renesas,pfc-sh73a0": for SH73A0 (SH-Mobile AG5) compatible pin-controller.
  15. - reg: Base address and length of each memory resource used by the pin
  16. controller hardware module.
  17. Optional properties:
  18. - #gpio-range-cells: Mandatory when the PFC doesn't handle GPIO, forbidden
  19. otherwise. Should be 3.
  20. The PFC node also acts as a container for pin configuration nodes. Please refer
  21. to pinctrl-bindings.txt in this directory for the definition of the term "pin
  22. configuration node" and for the common pinctrl bindings used by client devices.
  23. Each pin configuration node represents a desired configuration for a pin, a
  24. pin group, or a list of pins or pin groups. The configuration can include the
  25. function to select on those pin(s) and pin configuration parameters (such as
  26. pull-up and pull-down).
  27. Pin configuration nodes contain pin configuration properties, either directly
  28. or grouped in child subnodes. Both pin muxing and configuration parameters can
  29. be grouped in that way and referenced as a single pin configuration node by
  30. client devices.
  31. A configuration node or subnode must reference at least one pin (through the
  32. pins or pin groups properties) and contain at least a function or one
  33. configuration parameter. When the function is present only pin groups can be
  34. used to reference pins.
  35. All pin configuration nodes and subnodes names are ignored. All of those nodes
  36. are parsed through phandles and processed purely based on their content.
  37. Pin Configuration Node Properties:
  38. - renesas,pins : An array of strings, each string containing the name of a pin.
  39. - renesas,groups : An array of strings, each string containing the name of a pin
  40. group.
  41. - renesas,function: A string containing the name of the function to mux to the
  42. pin group(s) specified by the renesas,groups property
  43. Valid values for pin, group and function names can be found in the group and
  44. function arrays of the PFC data file corresponding to the SoC
  45. (drivers/pinctrl/sh-pfc/pfc-*.c)
  46. The pin configuration parameters use the generic pinconf bindings defined in
  47. pinctrl-bindings.txt in this directory. The supported parameters are
  48. bias-disable, bias-pull-up and bias-pull-down.
  49. GPIO
  50. ----
  51. On SH7372, SH73A0, R8A73A4 and R8A7740 the PFC node is also a GPIO controller
  52. node.
  53. Required Properties:
  54. - gpio-controller: Marks the device node as a gpio controller.
  55. - #gpio-cells: Should be 2. The first cell is the GPIO number and the second
  56. cell specifies GPIO flags, as defined in <dt-bindings/gpio/gpio.h>. Only the
  57. GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW flags are supported.
  58. The syntax of the gpio specifier used by client nodes should be the following
  59. with values derived from the SoC user manual.
  60. <[phandle of the gpio controller node]
  61. [pin number within the gpio controller]
  62. [flags]>
  63. On other mach-shmobile platforms GPIO is handled by the gpio-rcar driver.
  64. Please refer to Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
  65. for documentation of the GPIO device tree bindings on those platforms.
  66. Examples
  67. --------
  68. Example 1: SH73A0 (SH-Mobile AG5) pin controller node
  69. pfc: pfc@e6050000 {
  70. compatible = "renesas,pfc-sh73a0";
  71. reg = <0xe6050000 0x8000>,
  72. <0xe605801c 0x1c>;
  73. gpio-controller;
  74. #gpio-cells = <2>;
  75. };
  76. Example 2: A GPIO LED node that references a GPIO
  77. #include <dt-bindings/gpio/gpio.h>
  78. leds {
  79. compatible = "gpio-leds";
  80. led1 {
  81. gpios = <&pfc 20 GPIO_ACTIVE_LOW>;
  82. };
  83. };
  84. Example 3: KZM-A9-GT (SH-Mobile AG5) default pin state hog and pin control maps
  85. for the MMCIF and SCIFA4 devices
  86. &pfc {
  87. pinctrl-0 = <&scifa4_pins>;
  88. pinctrl-names = "default";
  89. mmcif_pins: mmcif {
  90. mux {
  91. renesas,groups = "mmc0_data8_0", "mmc0_ctrl_0";
  92. renesas,function = "mmc0";
  93. };
  94. cfg {
  95. renesas,groups = "mmc0_data8_0";
  96. renesas,pins = "PORT279";
  97. bias-pull-up;
  98. };
  99. };
  100. scifa4_pins: scifa4 {
  101. renesas,groups = "scifa4_data", "scifa4_ctrl";
  102. renesas,function = "scifa4";
  103. };
  104. };
  105. Example 4: KZM-A9-GT (SH-Mobile AG5) default pin state for the MMCIF device
  106. &mmcif {
  107. pinctrl-0 = <&mmcif_pins>;
  108. pinctrl-names = "default";
  109. bus-width = <8>;
  110. vmmc-supply = <&reg_1p8v>;
  111. status = "okay";
  112. };