sunxi: add support for NanoPi M1 Plus board
[openwrt/openwrt.git] / target / linux / sunxi / patches-4.9 / 205-arm-dts-sun8i-add-support-for-nanopi-m1-plus-board.patch
1 From 2ed2388bc0c5b7d04c7b079d673ce61a0333c818 Mon Sep 17 00:00:00 2001
2 From: Jagan Teki <jagan@amarulasolutions.com>
3 Date: Tue, 30 May 2017 17:42:50 +0000
4 Subject: ARM: dts: sun8i: h3: Add initial NanoPi M1 Plus support
5
6 Backported support from kernel 4.13 with the following changes:
7 - Added WiFi node
8 - Added Ethernet node
9 - Added eMMC node
10
11 Original commit message:
12 NanoPi M1 Plus is designed and developed by FriendlyElec
13 for professionals, enterprise users, makers and hobbyists
14 using the Allwinner H3 SOC.
15
16 NanoPi M1 Plus key features
17 - Allwinner H3, Quad-core Cortex-A7@1.2GHz
18 - 1GB DDR3 RAM
19 - 8GB eMMC
20 - microSD slot
21 - 10/100/1000M Ethernet
22 - Serial Debug Port
23 - 5V 2A DC power-supply
24
25 Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
26 Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
27 --- a/arch/arm/boot/dts/Makefile
28 +++ b/arch/arm/boot/dts/Makefile
29 @@ -821,6 +821,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \
30 sun8i-a83t-cubietruck-plus.dtb \
31 sun8i-h2-plus-orangepi-r1.dtb \
32 sun8i-h3-bananapi-m2-plus.dtb \
33 + sun8i-h3-nanopi-m1-plus.dtb \
34 sun8i-h3-nanopi-neo.dtb \
35 sun8i-h3-orangepi-2.dtb \
36 sun8i-h3-orangepi-lite.dtb \
37 --- /dev/null
38 +++ b/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts
39 @@ -0,0 +1,129 @@
40 +/*
41 + * Copyright (C) 2017 Jagan Teki <jteki@openedev.com>
42 + *
43 + * This file is dual-licensed: you can use it either under the terms
44 + * of the GPL or the X11 license, at your option. Note that this dual
45 + * licensing only applies to this file, and not this project as a
46 + * whole.
47 + *
48 + * a) This file is free software; you can redistribute it and/or
49 + * modify it under the terms of the GNU General Public License as
50 + * published by the Free Software Foundation; either version 2 of the
51 + * License, or (at your option) any later version.
52 + *
53 + * This file is distributed in the hope that it will be useful,
54 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
55 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
56 + * GNU General Public License for more details.
57 + *
58 + * Or, alternatively,
59 + *
60 + * b) Permission is hereby granted, free of charge, to any person
61 + * obtaining a copy of this software and associated documentation
62 + * files (the "Software"), to deal in the Software without
63 + * restriction, including without limitation the rights to use,
64 + * copy, modify, merge, publish, distribute, sublicense, and/or
65 + * sell copies of the Software, and to permit persons to whom the
66 + * Software is furnished to do so, subject to the following
67 + * conditions:
68 + *
69 + * The above copyright notice and this permission notice shall be
70 + * included in all copies or substantial portions of the Software.
71 + *
72 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
73 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
74 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
75 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
76 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
77 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
78 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
79 + * OTHER DEALINGS IN THE SOFTWARE.
80 + */
81 +
82 +#include "sun8i-h3-nanopi.dtsi"
83 +
84 +/ {
85 + model = "FriendlyArm NanoPi M1 Plus";
86 + compatible = "friendlyarm,nanopi-m1-plus", "allwinner,sun8i-h3";
87 +
88 + aliases {
89 + ethernet0 = &emac;
90 + };
91 +
92 + pwrseq_wifi: pwrseq0 {
93 + compatible = "mmc-pwrseq-simple";
94 + pinctrl-names = "default";
95 + reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
96 + };
97 +
98 + reg_gmac_3v3: gmac-3v3 {
99 + compatible = "regulator-fixed";
100 + regulator-name = "gmac-3v3";
101 + regulator-min-microvolt = <3300000>;
102 + regulator-max-microvolt = <3300000>;
103 + startup-delay-us = <100000>;
104 + enable-active-high;
105 + gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */
106 + };
107 +};
108 +
109 +&ehci1 {
110 + status = "okay";
111 +};
112 +
113 +&ehci2 {
114 + status = "okay";
115 +};
116 +
117 +&emac {
118 + pinctrl-names = "default";
119 + pinctrl-0 = <&emac_rgmii_pins>;
120 + phy-supply = <&reg_gmac_3v3>;
121 + phy-handle = <&ext_rgmii_phy>;
122 + phy-mode = "rgmii";
123 + status = "okay";
124 +};
125 +
126 +&mdio {
127 + ext_rgmii_phy: ethernet-phy@7 {
128 + compatible = "ethernet-phy-ieee802.3-c22";
129 + reg = <7>;
130 + };
131 +};
132 +
133 +&mmc1 {
134 + pinctrl-names = "default";
135 + pinctrl-0 = <&mmc1_pins_a>;
136 + vmmc-supply = <&reg_vcc3v3>;
137 + vqmmc-supply = <&reg_vcc3v3>;
138 + mmc-pwrseq = <&pwrseq_wifi>;
139 + bus-width = <4>;
140 + non-removable;
141 + status = "okay";
142 +
143 + brcmf: wifi@1 {
144 + reg = <1>;
145 + compatible = "brcm,bcm4329-fmac";
146 + interrupt-parent = <&pio>;
147 + interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */
148 + interrupt-names = "host-wake";
149 + };
150 +};
151 +
152 +&mmc2 {
153 + pinctrl-names = "default";
154 + pinctrl-0 = <&mmc2_8bit_pins>;
155 + vmmc-supply = <&reg_vcc3v3>;
156 + vqmmc-supply = <&reg_vcc3v3>;
157 + bus-width = <8>;
158 + non-removable;
159 + status = "okay";
160 +};
161 +
162 +&ohci1 {
163 + status = "okay";
164 +};
165 +
166 +&ohci2 {
167 + status = "okay";
168 +};