d4685d93d50b767f1ebc07c94889152648a5186d
[openwrt.git] / target / linux / sunxi / patches-3.14 / 151-dt-sun7i-add-ahci.patch
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
6 This patch adds sunxi sata support to A20 boards that have such a connector.
7 Some boards also feature a regulator via a GPIO and support for this is also
8 added.
9
10 Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
11 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
12 ---
13  arch/arm/boot/dts/sun7i-a20-cubieboard2.dts     | 10 ++++++++++
14  arch/arm/boot/dts/sun7i-a20-cubietruck.dts      | 19 +++++++++++++++++++
15  arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts | 10 ++++++++++
16  arch/arm/boot/dts/sun7i-a20.dtsi                |  8 ++++++++
17  4 files changed, 47 insertions(+)
18
19 diff --git a/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts b/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
20 index 7bf4935..4bed115 100644
21 --- a/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
22 +++ b/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
23 @@ -13,12 +13,18 @@
24  
25  /dts-v1/;
26  /include/ "sun7i-a20.dtsi"
27 +/include/ "sunxi-common-regulators.dtsi"
28  
29  / {
30         model = "Cubietech Cubieboard2";
31         compatible = "cubietech,cubieboard2", "allwinner,sun7i-a20";
32  
33         soc@01c00000 {
34 +               ahci: sata@01c18000 {
35 +                       target-supply = <&reg_ahci_5v>;
36 +                       status = "okay";
37 +               };
38 +
39                 pinctrl@01c20800 {
40                         led_pins_cubieboard2: led_pins@0 {
41                                 allwinner,pins = "PH20", "PH21";
42 @@ -74,4 +80,8 @@
43                         gpios = <&pio 7 20 0>;
44                 };
45         };
46 +
47 +       reg_ahci_5v: ahci-5v {
48 +               status = "okay";
49 +       };
50  };
51 diff --git a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts b/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
52 index 025ce52..ef5fed8 100644
53 --- a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
54 +++ b/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
55 @@ -13,13 +13,26 @@
56  
57  /dts-v1/;
58  /include/ "sun7i-a20.dtsi"
59 +/include/ "sunxi-common-regulators.dtsi"
60  
61  / {
62         model = "Cubietech Cubietruck";
63         compatible = "cubietech,cubietruck", "allwinner,sun7i-a20";
64  
65         soc@01c00000 {
66 +               ahci: sata@01c18000 {
67 +                       target-supply = <&reg_ahci_5v>;
68 +                       status = "okay";
69 +               };
70 +
71                 pinctrl@01c20800 {
72 +                       ahci_pwr_pin_cubietruck: ahci_pwr_pin@1 {
73 +                               allwinner,pins = "PH12";
74 +                               allwinner,function = "gpio_out";
75 +                               allwinner,drive = <0>;
76 +                               allwinner,pull = <0>;
77 +                       };
78 +
79                         led_pins_cubietruck: led_pins@0 {
80                                 allwinner,pins = "PH7", "PH11", "PH20", "PH21";
81                                 allwinner,function = "gpio_out";
82 @@ -90,4 +103,10 @@
83                         gpios = <&pio 7 7 0>;
84                 };
85         };
86 +
87 +       reg_ahci_5v: ahci-5v {
88 +               pinctrl-0 = <&ahci_pwr_pin_cubietruck>;
89 +               gpio = <&pio 7 12 0>;
90 +               status = "okay";
91 +       };
92  };
93 diff --git a/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts b/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
94 index 9d98316..c9b0f37 100644
95 --- a/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
96 +++ b/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
97 @@ -13,6 +13,7 @@
98  
99  /dts-v1/;
100  /include/ "sun7i-a20.dtsi"
101 +/include/ "sunxi-common-regulators.dtsi"
102  
103  / {
104         model = "Olimex A20-Olinuxino Micro";
105 @@ -36,6 +37,11 @@
106                         status = "okay";
107                 };
108  
109 +               ahci: sata@01c18000 {
110 +                       target-supply = <&reg_ahci_5v>;
111 +                       status = "okay";
112 +               };
113 +
114                 pinctrl@01c20800 {
115                         led_pins_olinuxino: led_pins@0 {
116                                 allwinner,pins = "PH2";
117 @@ -105,4 +111,8 @@
118                         default-state = "on";
119                 };
120         };
121 +
122 +       reg_ahci_5v: ahci-5v {
123 +               status = "okay";
124 +       };
125  };
126 diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
127 index 6161fd8..864b7c6 100644
128 --- a/arch/arm/boot/dts/sun7i-a20.dtsi
129 +++ b/arch/arm/boot/dts/sun7i-a20.dtsi
130 @@ -450,6 +450,14 @@
131                         #size-cells = <0>;
132                 };
133  
134 +               ahci: sata@01c18000 {
135 +                       compatible = "allwinner,sun4i-a10-ahci";
136 +                       reg = <0x01c18000 0x1000>;
137 +                       interrupts = <0 56 4>;
138 +                       clocks = <&pll6 0>, <&ahb_gates 25>;
139 +                       status = "disabled";
140 +               };
141 +
142                 spi3: spi@01c1f000 {
143                         compatible = "allwinner,sun4i-a10-spi";
144                         reg = <0x01c1f000 0x1000>;
145 -- 
146 2.0.3
147