kernel: refresh patches
[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 --- a/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
20 +++ b/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
21 @@ -13,12 +13,18 @@
22  
23  /dts-v1/;
24  /include/ "sun7i-a20.dtsi"
25 +/include/ "sunxi-common-regulators.dtsi"
26  
27  / {
28         model = "Cubietech Cubieboard2";
29         compatible = "cubietech,cubieboard2", "allwinner,sun7i-a20";
30  
31         soc@01c00000 {
32 +               ahci: sata@01c18000 {
33 +                       target-supply = <&reg_ahci_5v>;
34 +                       status = "okay";
35 +               };
36 +
37                 pinctrl@01c20800 {
38                         led_pins_cubieboard2: led_pins@0 {
39                                 allwinner,pins = "PH20", "PH21";
40 @@ -74,4 +80,8 @@
41                         gpios = <&pio 7 20 0>;
42                 };
43         };
44 +
45 +       reg_ahci_5v: ahci-5v {
46 +               status = "okay";
47 +       };
48  };
49 --- a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
50 +++ b/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
51 @@ -13,13 +13,26 @@
52  
53  /dts-v1/;
54  /include/ "sun7i-a20.dtsi"
55 +/include/ "sunxi-common-regulators.dtsi"
56  
57  / {
58         model = "Cubietech Cubietruck";
59         compatible = "cubietech,cubietruck", "allwinner,sun7i-a20";
60  
61         soc@01c00000 {
62 +               ahci: sata@01c18000 {
63 +                       target-supply = <&reg_ahci_5v>;
64 +                       status = "okay";
65 +               };
66 +
67                 pinctrl@01c20800 {
68 +                       ahci_pwr_pin_cubietruck: ahci_pwr_pin@1 {
69 +                               allwinner,pins = "PH12";
70 +                               allwinner,function = "gpio_out";
71 +                               allwinner,drive = <0>;
72 +                               allwinner,pull = <0>;
73 +                       };
74 +
75                         led_pins_cubietruck: led_pins@0 {
76                                 allwinner,pins = "PH7", "PH11", "PH20", "PH21";
77                                 allwinner,function = "gpio_out";
78 @@ -104,4 +117,10 @@
79                         gpios = <&pio 7 7 0>;
80                 };
81         };
82 +
83 +       reg_ahci_5v: ahci-5v {
84 +               pinctrl-0 = <&ahci_pwr_pin_cubietruck>;
85 +               gpio = <&pio 7 12 0>;
86 +               status = "okay";
87 +       };
88  };
89 --- a/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
90 +++ b/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
91 @@ -13,6 +13,7 @@
92  
93  /dts-v1/;
94  /include/ "sun7i-a20.dtsi"
95 +/include/ "sunxi-common-regulators.dtsi"
96  
97  / {
98         model = "Olimex A20-Olinuxino Micro";
99 @@ -36,6 +37,11 @@
100                         status = "okay";
101                 };
102  
103 +               ahci: sata@01c18000 {
104 +                       target-supply = <&reg_ahci_5v>;
105 +                       status = "okay";
106 +               };
107 +
108                 pinctrl@01c20800 {
109                         led_pins_olinuxino: led_pins@0 {
110                                 allwinner,pins = "PH2";
111 @@ -105,4 +111,8 @@
112                         default-state = "on";
113                 };
114         };
115 +
116 +       reg_ahci_5v: ahci-5v {
117 +               status = "okay";
118 +       };
119  };
120 --- a/arch/arm/boot/dts/sun7i-a20.dtsi
121 +++ b/arch/arm/boot/dts/sun7i-a20.dtsi
122 @@ -450,6 +450,14 @@
123                         #size-cells = <0>;
124                 };
125  
126 +               ahci: sata@01c18000 {
127 +                       compatible = "allwinner,sun4i-a10-ahci";
128 +                       reg = <0x01c18000 0x1000>;
129 +                       interrupts = <0 56 4>;
130 +                       clocks = <&pll6 0>, <&ahb_gates 25>;
131 +                       status = "disabled";
132 +               };
133 +
134                 spi3: spi@01c1f000 {
135                         compatible = "allwinner,sun4i-a10-spi";
136                         reg = <0x01c1f000 0x1000>;