]> git.ipfire.org Git - people/arne_f/kernel.git/blame - arch/arm/boot/dts/sun8i-h3-nanopi-r1.dts
dts: nanopi-r1: add second uart
[people/arne_f/kernel.git] / arch / arm / boot / dts / sun8i-h3-nanopi-r1.dts
CommitLineData
6832c5d8
AF
1/*
2 * Copyright (C) 2017 Jagan Teki <jteki@openedev.com>
3 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPL or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This file is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This file is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,
25 * copy, modify, merge, publish, distribute, sublicense, and/or
26 * sell copies of the Software, and to permit persons to whom the
27 * Software is furnished to do so, subject to the following
28 * conditions:
29 *
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 * OTHER DEALINGS IN THE SOFTWARE.
41 */
42
43#include "sun8i-h3-nanopi.dtsi"
44
45/ {
46 model = "FriendlyElec NanoPi-R1";
47 compatible = "friendlyarm,nanopi-r1", "allwinner,sun8i-h3";
48
a0d0862f
AF
49 aliases {
50 ethernet0 = &emac;
51 ethernet1 = &usbr8152;
52 ethernet2 = &brcmf;
53 serial0 = &uart0;
857469bc 54 serial1 = &uart1;
a0d0862f
AF
55 };
56
6832c5d8
AF
57 wifi_pwrseq: wifi_pwrseq {
58 compatible = "mmc-pwrseq-simple";
59 pinctrl-names = "default";
60 pinctrl-0 = <&wifi_en_npi>;
61 reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
62 post-power-on-delay-ms = <200>;
63 };
64
65 reg_gmac_3v3: gmac-3v3 {
66 compatible = "regulator-fixed";
67 pinctrl-names = "default";
68 pinctrl-0 = <&gmac_power_pin_nanopi>;
69 regulator-name = "gmac-3v3";
70 regulator-min-microvolt = <3300000>;
71 regulator-max-microvolt = <3300000>;
72 startup-delay-us = <100000>;
73 enable-active-high;
74 gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
75 };
76
77 rfkill_bt {
78 compatible = "rfkill-gpio";
79 pinctrl-names = "default";
80 pinctrl-0 = <&bt_pwr_pin>;
81 reset-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */
82 clocks = <&osc32k>;
83 clock-frequency = <32768>;
84 rfkill-name = "sunxi-bt";
85 rfkill-type = "bluetooth";
86 };
87
88 leds {
89 /delete-node/ status;
90 /delete-node/ pwr;
91 led1 {
91259a48 92 label = "nanopi-r1:red:status";
6832c5d8
AF
93 gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>;
94 linux,default-trigger = "heartbeat";
95 };
96
97 led2 {
91259a48 98 label = "nanopi-r1:green:wan";
6832c5d8
AF
99 gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>;
100 default-state = "off";
101 linux,default-trigger = "netdev";
102 };
103
104 led3 {
91259a48 105 label = "nanopi-r1:green:lan";
6832c5d8
AF
106 gpios = <&pio 0 9 GPIO_ACTIVE_HIGH>;
107 default-state = "off";
108 linux,default-trigger = "netdev";
109 };
110 };
111
112 r_gpio_keys {
113 compatible = "gpio-keys";
114 input-name = "k1";
115 pinctrl-names = "default";
116 pinctrl-0 = <&sw_r_npi>;
117
118 /delete-node/ k1;
119 reset {
120 label = "reset";
121 linux,code = <BTN_1>;
122 gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
123 };
124 };
125};
126
127&pio {
128 gmac_power_pin_nanopi: gmac_power_pin@0 {
129 pins = "PD6";
130 function = "gpio_out";
131 };
132 bt_pwr_pin: bt_pwr_pin@0 {
133 pins = "PG13";
134 function = "gpio_out";
135 };
136};
137
138&r_pio {
139 wifi_en_npi: wifi_en_pin {
140 pins = "PL7";
141 function = "gpio_out";
142 };
143};
144
145&mdio {
146 ext_rgmii_phy: ethernet-phy@1 {
147 reg = <7>;
148 };
149};
150
151&emac {
152 pinctrl-names = "default";
153 pinctrl-0 = <&emac_rgmii_pins>;
154 phy-supply = <&reg_gmac_3v3>;
155 phy-handle = <&ext_rgmii_phy>;
156 phy-mode = "rgmii";
157
158 allwinner,leds-active-low;
159 status = "okay";
160};
161
a0d0862f
AF
162&ehci1 {
163 status = "okay";
164 #address-cells = <1>;
165 #size-cells = <0>;
166 usbr8152: usbether@1 {
167 compatible = "usb0bda,8152";
168 reg = <1>;
169 };
170};
171
172&ohci1 {
173 status = "disabled";
174};
175
857469bc
AF
176&uart1 {
177 pinctrl-names = "default";
178 pinctrl-0 = <&uart1_pins>;
179 status = "okay";
180};
181
6832c5d8
AF
182&mmc1 {
183 pinctrl-names = "default";
184 pinctrl-0 = <&mmc1_pins_a>;
185 vmmc-supply = <&reg_vcc3v3>;
186 vqmmc-supply = <&reg_vcc3v3>;
187 mmc-pwrseq = <&wifi_pwrseq>;
188 bus-width = <4>;
189 non-removable;
190 status = "okay";
191
192 brcmf: bcrmf@1 {
193 reg = <1>;
194 compatible = "brcm,bcm4329-fmac";
195 interrupt-parent = <&pio>;
196 interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */
197 interrupt-names = "host-wake";
198 };
199};
200
201&mmc2 {
202 pinctrl-names = "default";
203 pinctrl-0 = <&mmc2_8bit_pins>;
204 vmmc-supply = <&reg_vcc3v3>;
205 bus-width = <8>;
206 non-removable;
207 cap-mmc-hw-reset;
208 status = "okay";
209};
210
211&mmc2_8bit_pins {
212 /* Increase drive strength for DDR modes */
213 drive-strength = <40>;
214 /* eMMC is missing pull-ups */
215 bias-pull-up;
216};