162-2-dt-sun7i-add-ahci-nodes.patch 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. From 4ce1f4c3ab04a697e9861b77582077b905b3f8a0 Mon Sep 17 00:00:00 2001
  2. From: Hans de Goede <[email protected]>
  3. Date: Fri, 3 Jan 2014 10:27:51 +0100
  4. Subject: [PATCH] ARM: sun7i: dts: Add ahci / sata support
  5. This patch adds sunxi sata support to A20 boards that have such a connector.
  6. Some boards also feature a regulator via a GPIO and support for this is also
  7. added.
  8. Signed-off-by: Olliver Schinagl <[email protected]>
  9. Signed-off-by: Hans de Goede <[email protected]>
  10. ---
  11. arch/arm/boot/dts/sun7i-a20-cubieboard2.dts | 27 +++++++++++++++++++++++++
  12. arch/arm/boot/dts/sun7i-a20-cubietruck.dts | 27 +++++++++++++++++++++++++
  13. arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts | 26 ++++++++++++++++++++++++
  14. arch/arm/boot/dts/sun7i-a20.dtsi | 9 +++++++++
  15. 4 files changed, 89 insertions(+)
  16. --- a/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
  17. +++ b/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
  18. @@ -43,7 +43,19 @@
  19. status = "okay";
  20. };
  21. + sata: ahci@01c18000 {
  22. + pwr-supply = <&reg_ahci_5v>;
  23. + status = "okay";
  24. + };
  25. +
  26. pinctrl@01c20800 {
  27. + ahci_pwr_pin_cubieboard2: ahci_pwr_pin@0 {
  28. + allwinner,pins = "PB8";
  29. + allwinner,function = "gpio_out";
  30. + allwinner,drive = <0>;
  31. + allwinner,pull = <0>;
  32. + };
  33. +
  34. mmc0_cd_pin_cubieboard2: mmc0_cd_pin@0 {
  35. allwinner,pins = "PH1";
  36. allwinner,function = "gpio_in";
  37. @@ -93,4 +105,19 @@
  38. gpios = <&pio 7 20 0>;
  39. };
  40. };
  41. +
  42. + regulators {
  43. + compatible = "simple-bus";
  44. + pinctrl-names = "default";
  45. +
  46. + reg_ahci_5v: ahci-5v {
  47. + compatible = "regulator-fixed";
  48. + regulator-name = "ahci-5v";
  49. + regulator-min-microvolt = <5000000>;
  50. + regulator-max-microvolt = <5000000>;
  51. + pinctrl-0 = <&ahci_pwr_pin_cubieboard2>;
  52. + gpio = <&pio 1 8 0>;
  53. + enable-active-high;
  54. + };
  55. + };
  56. };
  57. --- a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
  58. +++ b/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
  59. @@ -43,6 +43,11 @@
  60. status = "okay";
  61. };
  62. + sata: ahci@01c18000 {
  63. + pwr-supply = <&reg_ahci_5v>;
  64. + status = "okay";
  65. + };
  66. +
  67. pinctrl@01c20800 {
  68. mmc0_cd_pin_cubietruck: mmc0_cd_pin@0 {
  69. allwinner,pins = "PH1";
  70. @@ -58,6 +63,13 @@
  71. allwinner,pull = <0>;
  72. };
  73. + ahci_pwr_pin_cubietruck: ahci_pwr_pin@0 {
  74. + allwinner,pins = "PH12";
  75. + allwinner,function = "gpio_out";
  76. + allwinner,drive = <0>;
  77. + allwinner,pull = <0>;
  78. + };
  79. +
  80. led_pins_cubietruck: led_pins@0 {
  81. allwinner,pins = "PH7", "PH11", "PH20", "PH21";
  82. allwinner,function = "gpio_out";
  83. @@ -149,4 +161,19 @@
  84. gpio = <&pio 7 3 0>;
  85. };
  86. };
  87. +
  88. + regulators {
  89. + compatible = "simple-bus";
  90. + pinctrl-names = "default";
  91. +
  92. + reg_ahci_5v: ahci-5v {
  93. + compatible = "regulator-fixed";
  94. + regulator-name = "ahci-5v";
  95. + regulator-min-microvolt = <5000000>;
  96. + regulator-max-microvolt = <5000000>;
  97. + pinctrl-0 = <&ahci_pwr_pin_cubietruck>;
  98. + gpio = <&pio 7 12 0>;
  99. + enable-active-high;
  100. + };
  101. + };
  102. };
  103. --- a/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
  104. +++ b/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
  105. @@ -52,7 +52,19 @@
  106. status = "okay";
  107. };
  108. + sata: ahci@01c18000 {
  109. + pwr-supply = <&reg_ahci_5v>;
  110. + status = "okay";
  111. + };
  112. +
  113. pinctrl@01c20800 {
  114. + ahci_pwr_pin_olinuxinom: ahci_pwr_pin@0 {
  115. + allwinner,pins = "PB8";
  116. + allwinner,function = "gpio_out";
  117. + allwinner,drive = <0>;
  118. + allwinner,pull = <0>;
  119. + };
  120. +
  121. mmc0_cd_pin_olinuxinom: mmc0_cd_pin@0 {
  122. allwinner,pins = "PH1";
  123. allwinner,function = "gpio_in";
  124. @@ -123,4 +135,18 @@
  125. default-state = "on";
  126. };
  127. };
  128. +
  129. + regulators {
  130. + compatible = "simple-bus";
  131. +
  132. + reg_ahci_5v: ahci-5v {
  133. + compatible = "regulator-fixed";
  134. + regulator-name = "ahci-5v";
  135. + regulator-min-microvolt = <5000000>;
  136. + regulator-max-microvolt = <5000000>;
  137. + pinctrl-0 = <&ahci_pwr_pin_olinuxinom>;
  138. + gpio = <&pio 1 8 0>;
  139. + enable-active-high;
  140. + };
  141. + };
  142. };
  143. --- a/arch/arm/boot/dts/sun7i-a20.dtsi
  144. +++ b/arch/arm/boot/dts/sun7i-a20.dtsi
  145. @@ -433,6 +433,15 @@
  146. };
  147. };
  148. + sata: ahci@01c18000 {
  149. + compatible = "allwinner,sun4i-a10-ahci";
  150. + reg = <0x01c18000 0x1000>;
  151. + interrupts = <0 56 1>;
  152. + clocks = <&ahb_gates 25>, <&pll6 0>;
  153. + clock-names = "ahb_sata", "pll6_sata";
  154. + status = "disabled";
  155. + };
  156. +
  157. timer@01c20c00 {
  158. compatible = "allwinner,sun4i-timer";
  159. reg = <0x01c20c00 0x90>;