sunxi: add support for Olimex A20-OLinuXino-LIME
[15.05/openwrt.git] / target / linux / sunxi / patches-3.14 / 310-dt-sun7i-add-a20-olinuxino-lime.patch
1 From a71b4438af8242f383906071205db95a8b8e7b6d Mon Sep 17 00:00:00 2001
2 From: FUKAUMI Naoki <naobsd@gmail.com>
3 Date: Wed, 20 Aug 2014 14:25:03 +0900
4 Subject: ARM: sun7i: Add support for Olimex A20-OLinuXino-LIME
5
6 This patch adds support for Olimex A20-OLinuXino-LIME board.
7
8 Signed-off-by: FUKAUMI Naoki <naobsd@gmail.com>
9 Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
10
11 --- a/arch/arm/boot/dts/Makefile
12 +++ b/arch/arm/boot/dts/Makefile
13 @@ -293,6 +293,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += \
14         sun7i-a20-bananapi.dtb \
15         sun7i-a20-cubieboard2.dtb \
16         sun7i-a20-cubietruck.dtb \
17 +       sun7i-a20-olinuxino-lime.dtb \
18         sun7i-a20-olinuxino-micro.dtb \
19         sun7i-a20-pcduino3.dtb
20  dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \
21 --- /dev/null
22 +++ b/arch/arm/boot/dts/sun7i-a20-olinuxino-lime.dts
23 @@ -0,0 +1,136 @@
24 +/*
25 + * This is based on sun4i-a10-olinuxino-lime.dts
26 + *
27 + * Copyright 2014 - Hans de Goede <hdegoede@redhat.com>
28 + * Copyright (c) 2014 FUKAUMI Naoki <naobsd@gmail.com>
29 + *
30 + * The code contained herein is licensed under the GNU General Public
31 + * License. You may obtain a copy of the GNU General Public License
32 + * Version 2 or later at the following locations:
33 + *
34 + * http://www.opensource.org/licenses/gpl-license.html
35 + * http://www.gnu.org/copyleft/gpl.html
36 + */
37 +
38 +/dts-v1/;
39 +/include/ "sun7i-a20.dtsi"
40 +/include/ "sunxi-common-regulators.dtsi"
41 +
42 +/ {
43 +       model = "Olimex A20-OLinuXino-LIME";
44 +       compatible = "olimex,a20-olinuxino-lime", "allwinner,sun7i-a20";
45 +
46 +       soc@01c00000 {
47 +               mmc0: mmc@01c0f000 {
48 +                       pinctrl-names = "default", "default";
49 +                       pinctrl-0 = <&mmc0_pins_a>;
50 +                       pinctrl-1 = <&mmc0_cd_pin_reference_design>;
51 +                       cd-gpios = <&pio 7 1 0>; /* PH1 */
52 +                       cd-mode = <1>;
53 +                       status = "okay";
54 +               };
55 +
56 +               usbphy: phy@01c13400 {
57 +                       usb1_vbus-supply = <&reg_usb1_vbus>;
58 +                       usb2_vbus-supply = <&reg_usb2_vbus>;
59 +                       status = "okay";
60 +               };
61 +
62 +               ehci0: usb@01c14000 {
63 +                       status = "okay";
64 +               };
65 +
66 +               ohci0: usb@01c14400 {
67 +                       status = "okay";
68 +               };
69 +
70 +               ahci: sata@01c18000 {
71 +                       target-supply = <&reg_ahci_5v>;
72 +                       status = "okay";
73 +               };
74 +
75 +               ehci1: usb@01c1c000 {
76 +                       status = "okay";
77 +               };
78 +
79 +               ohci1: usb@01c1c400 {
80 +                       status = "okay";
81 +               };
82 +
83 +               pinctrl@01c20800 {
84 +                       ahci_pwr_pin_olinuxinolime: ahci_pwr_pin@1 {
85 +                               allwinner,pins = "PC3";
86 +                               allwinner,function = "gpio_out";
87 +                               allwinner,drive = <0>;
88 +                               allwinner,pull = <0>;
89 +                       };
90 +
91 +                       led_pins_olinuxinolime: led_pins@0 {
92 +                               allwinner,pins = "PH2";
93 +                               allwinner,function = "gpio_out";
94 +                               allwinner,drive = <1>;
95 +                               allwinner,pull = <0>;
96 +                       };
97 +               };
98 +
99 +               uart0: serial@01c28000 {
100 +                       pinctrl-names = "default";
101 +                       pinctrl-0 = <&uart0_pins_a>;
102 +                       status = "okay";
103 +               };
104 +
105 +               i2c0: i2c@01c2ac00 {
106 +                       pinctrl-names = "default";
107 +                       pinctrl-0 = <&i2c0_pins_a>;
108 +                       status = "okay";
109 +
110 +                       axp: axp20x@34 {
111 +                               reg = <0x34>;
112 +                               interrupt-parent = <&nmi_intc>;
113 +                               interrupts = <0 8>;
114 +
115 +                               axp,system-power-controller;
116 +
117 +                               /include/ "x-powers-axp209.dtsi"
118 +                       };
119 +               };
120 +
121 +               gmac: ethernet@01c50000 {
122 +                       pinctrl-names = "default";
123 +                       pinctrl-0 = <&gmac_pins_mii_a>;
124 +                       phy = <&phy1>;
125 +                       phy-mode = "mii";
126 +                       status = "okay";
127 +
128 +                       phy1: ethernet-phy@1 {
129 +                               reg = <1>;
130 +                       };
131 +               };
132 +       };
133 +
134 +       leds {
135 +               compatible = "gpio-leds";
136 +               pinctrl-names = "default";
137 +               pinctrl-0 = <&led_pins_olinuxinolime>;
138 +
139 +               green {
140 +                       label = "a20-olinuxino-lime:green:usr";
141 +                       gpios = <&pio 7 2 0>;
142 +                       default-state = "on";
143 +               };
144 +       };
145 +
146 +       reg_ahci_5v: ahci-5v {
147 +               pinctrl-0 = <&ahci_pwr_pin_olinuxinolime>;
148 +               gpio = <&pio 2 3 0>;
149 +               status = "okay";
150 +       };
151 +
152 +       reg_usb1_vbus: usb1-vbus {
153 +               status = "okay";
154 +       };
155 +
156 +       reg_usb2_vbus: usb2-vbus {
157 +               status = "okay";
158 +       };
159 +};