151-dt-sun7i-add-ahci.patch 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. From cf454a47b64ef78ff85b097c8cb404120c14e6a5 Mon Sep 17 00:00:00 2001
  2. From: Hans de Goede <hdegoede@redhat.com>
  3. Date: Fri, 3 Jan 2014 10:27:51 +0100
  4. Subject: [PATCH] ARM: sun7i: dt: 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 <oliver@schinagl.nl>
  9. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
  10. ---
  11. arch/arm/boot/dts/sun7i-a20-cubieboard2.dts | 10 ++++++++++
  12. arch/arm/boot/dts/sun7i-a20-cubietruck.dts | 19 +++++++++++++++++++
  13. arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts | 10 ++++++++++
  14. arch/arm/boot/dts/sun7i-a20.dtsi | 8 ++++++++
  15. 4 files changed, 47 insertions(+)
  16. --- a/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
  17. +++ b/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
  18. @@ -13,12 +13,18 @@
  19. /dts-v1/;
  20. /include/ "sun7i-a20.dtsi"
  21. +/include/ "sunxi-common-regulators.dtsi"
  22. / {
  23. model = "Cubietech Cubieboard2";
  24. compatible = "cubietech,cubieboard2", "allwinner,sun7i-a20";
  25. soc@01c00000 {
  26. + ahci: sata@01c18000 {
  27. + target-supply = <&reg_ahci_5v>;
  28. + status = "okay";
  29. + };
  30. +
  31. pinctrl@01c20800 {
  32. led_pins_cubieboard2: led_pins@0 {
  33. allwinner,pins = "PH20", "PH21";
  34. @@ -74,4 +80,8 @@
  35. gpios = <&pio 7 20 0>;
  36. };
  37. };
  38. +
  39. + reg_ahci_5v: ahci-5v {
  40. + status = "okay";
  41. + };
  42. };
  43. --- a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
  44. +++ b/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
  45. @@ -13,13 +13,26 @@
  46. /dts-v1/;
  47. /include/ "sun7i-a20.dtsi"
  48. +/include/ "sunxi-common-regulators.dtsi"
  49. / {
  50. model = "Cubietech Cubietruck";
  51. compatible = "cubietech,cubietruck", "allwinner,sun7i-a20";
  52. soc@01c00000 {
  53. + ahci: sata@01c18000 {
  54. + target-supply = <&reg_ahci_5v>;
  55. + status = "okay";
  56. + };
  57. +
  58. pinctrl@01c20800 {
  59. + ahci_pwr_pin_cubietruck: ahci_pwr_pin@1 {
  60. + allwinner,pins = "PH12";
  61. + allwinner,function = "gpio_out";
  62. + allwinner,drive = <0>;
  63. + allwinner,pull = <0>;
  64. + };
  65. +
  66. led_pins_cubietruck: led_pins@0 {
  67. allwinner,pins = "PH7", "PH11", "PH20", "PH21";
  68. allwinner,function = "gpio_out";
  69. @@ -104,4 +117,10 @@
  70. gpios = <&pio 7 7 0>;
  71. };
  72. };
  73. +
  74. + reg_ahci_5v: ahci-5v {
  75. + pinctrl-0 = <&ahci_pwr_pin_cubietruck>;
  76. + gpio = <&pio 7 12 0>;
  77. + status = "okay";
  78. + };
  79. };
  80. --- a/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
  81. +++ b/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
  82. @@ -13,6 +13,7 @@
  83. /dts-v1/;
  84. /include/ "sun7i-a20.dtsi"
  85. +/include/ "sunxi-common-regulators.dtsi"
  86. / {
  87. model = "Olimex A20-Olinuxino Micro";
  88. @@ -36,6 +37,11 @@
  89. status = "okay";
  90. };
  91. + ahci: sata@01c18000 {
  92. + target-supply = <&reg_ahci_5v>;
  93. + status = "okay";
  94. + };
  95. +
  96. pinctrl@01c20800 {
  97. led_pins_olinuxino: led_pins@0 {
  98. allwinner,pins = "PH2";
  99. @@ -105,4 +111,8 @@
  100. default-state = "on";
  101. };
  102. };
  103. +
  104. + reg_ahci_5v: ahci-5v {
  105. + status = "okay";
  106. + };
  107. };
  108. --- a/arch/arm/boot/dts/sun7i-a20.dtsi
  109. +++ b/arch/arm/boot/dts/sun7i-a20.dtsi
  110. @@ -450,6 +450,14 @@
  111. #size-cells = <0>;
  112. };
  113. + ahci: sata@01c18000 {
  114. + compatible = "allwinner,sun4i-a10-ahci";
  115. + reg = <0x01c18000 0x1000>;
  116. + interrupts = <0 56 4>;
  117. + clocks = <&pll6 0>, <&ahb_gates 25>;
  118. + status = "disabled";
  119. + };
  120. +
  121. spi3: spi@01c1f000 {
  122. compatible = "allwinner,sun4i-a10-spi";
  123. reg = <0x01c1f000 0x1000>;