qoriq: drop unused kernel config
[openwrt/staging/stintel.git] / target / linux / sunxi / patches-5.10 / 100-sunxi-h3-add-support-for-nanopi-r1.patch
1 From 5aee0b1272cd5b42933ef629d66b677669e2e8d2 Mon Sep 17 00:00:00 2001
2 From: Jayantajit Gogoi <jayanta.gogoi525@gmail.com>
3 Date: Mon, 12 Oct 2020 05:24:51 +0000
4 Subject: [PATCH] sunxi: add support for friendlyarm nanopi r1
5
6 Signed-off-by: Jayantajit Gogoi <jayanta.gogoi525@gmail.com>
7 ---
8 .../devicetree/bindings/arm/sunxi.yaml | 5 +
9 arch/arm/boot/dts/Makefile | 1 +
10 arch/arm/boot/dts/sun8i-h3-nanopi-r1.dts | 146 ++++++++++++++++++
11 3 files changed, 152 insertions(+)
12 create mode 100644 arch/arm/boot/dts/sun8i-h3-nanopi-r1.dts
13
14 --- a/Documentation/devicetree/bindings/arm/sunxi.yaml
15 +++ b/Documentation/devicetree/bindings/arm/sunxi.yaml
16 @@ -251,6 +251,11 @@ properties:
17 - const: friendlyarm,nanopi-neo-plus2
18 - const: allwinner,sun50i-h5
19
20 + - description: FriendlyARM NanoPi R1
21 + items:
22 + - const: friendlyarm,nanopi-r1
23 + - const: allwinner,sun8i-h3
24 +
25 - description: Gemei G9 Tablet
26 items:
27 - const: gemei,g9
28 --- a/arch/arm/boot/dts/Makefile
29 +++ b/arch/arm/boot/dts/Makefile
30 @@ -1194,6 +1194,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \
31 sun8i-h3-nanopi-m1-plus.dtb \
32 sun8i-h3-nanopi-neo.dtb \
33 sun8i-h3-nanopi-neo-air.dtb \
34 + sun8i-h3-nanopi-r1.dtb \
35 sun8i-h3-orangepi-2.dtb \
36 sun8i-h3-orangepi-lite.dtb \
37 sun8i-h3-orangepi-one.dtb \
38 --- /dev/null
39 +++ b/arch/arm/boot/dts/sun8i-h3-nanopi-r1.dts
40 @@ -0,0 +1,146 @@
41 +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
42 +/*
43 + * Copyright (C) 2019 Igor Pecovnik <igor@armbian.com>
44 + * Copyright (C) 2020 Jayantajit Gogoi <jayanta.gogoi525@gmail.com>
45 + */
46 +
47 +/* NanoPi R1 is based on the NanoPi-H3 design from FriendlyARM */
48 +#include "sun8i-h3-nanopi.dtsi"
49 +
50 +/ {
51 + model = "FriendlyARM NanoPi R1";
52 + compatible = "friendlyarm,nanopi-r1", "allwinner,sun8i-h3";
53 +
54 + reg_gmac_3v3: gmac-3v3 {
55 + compatible = "regulator-fixed";
56 + regulator-name = "gmac-3v3";
57 + regulator-min-microvolt = <3300000>;
58 + regulator-max-microvolt = <3300000>;
59 + startup-delay-us = <100000>;
60 + enable-active-high;
61 + gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
62 + };
63 +
64 + vdd_cpux: gpio-regulator {
65 + compatible = "regulator-gpio";
66 + pinctrl-names = "default";
67 + regulator-name = "vdd-cpux";
68 + regulator-type = "voltage";
69 + regulator-boot-on;
70 + regulator-always-on;
71 + regulator-min-microvolt = <1100000>;
72 + regulator-max-microvolt = <1300000>;
73 + regulator-ramp-delay = <50>;
74 + gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>;
75 + gpios-states = <0x1>;
76 + states = <1100000 0x0
77 + 1300000 0x1>;
78 + };
79 +
80 + wifi_pwrseq: wifi_pwrseq {
81 + compatible = "mmc-pwrseq-simple";
82 + pinctrl-names = "default";
83 + reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>;
84 + };
85 +
86 + leds {
87 + /delete-node/ pwr;
88 + status {
89 + label = "nanopi:red:status";
90 + gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>;
91 + linux,default-trigger = "heartbeat";
92 + };
93 +
94 + wan {
95 + label = "nanopi:green:wan";
96 + gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>;
97 + };
98 +
99 + lan {
100 + label = "nanopi:green:lan";
101 + gpios = <&pio 0 9 GPIO_ACTIVE_HIGH>;
102 + };
103 + };
104 +
105 + r_gpio_keys {
106 + pinctrl-names = "default";
107 + pinctrl-0 = <&sw_r_npi>;
108 +
109 + /delete-node/ k1;
110 + reset {
111 + label = "reset";
112 + linux,code = <KEY_RESTART>;
113 + gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
114 + };
115 + };
116 +};
117 +
118 +&cpu0 {
119 + cpu-supply = <&vdd_cpux>;
120 +};
121 +
122 +&ehci1 {
123 + status = "okay";
124 +};
125 +
126 +&ehci2 {
127 + status = "okay";
128 +};
129 +
130 +&emac {
131 + pinctrl-names = "default";
132 + pinctrl-0 = <&emac_rgmii_pins>;
133 + phy-supply = <&reg_gmac_3v3>;
134 + phy-handle = <&ext_rgmii_phy>;
135 + phy-mode = "rgmii";
136 + status = "okay";
137 +};
138 +
139 +&external_mdio {
140 + ext_rgmii_phy: ethernet-phy@1 {
141 + compatible = "ethernet-phy-ieee802.3-c22";
142 + reg = <7>;
143 + };
144 +};
145 +
146 +&mmc1 {
147 + vmmc-supply = <&reg_vcc3v3>;
148 + vqmmc-supply = <&reg_vcc3v3>;
149 + mmc-pwrseq = <&wifi_pwrseq>;
150 + bus-width = <4>;
151 + non-removable;
152 + status = "okay";
153 +
154 + sdio_wifi: sdio_wifi@1 {
155 + reg = <1>;
156 + compatible = "brcm,bcm4329-fmac";
157 + interrupt-parent = <&pio>;
158 + interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>;
159 + interrupt-names = "host-wake";
160 + };
161 +};
162 +
163 +&mmc2 {
164 + pinctrl-names = "default";
165 + pinctrl-0 = <&mmc2_8bit_pins>;
166 + vmmc-supply = <&reg_vcc3v3>;
167 + vqmmc-supply = <&reg_vcc3v3>;
168 + bus-width = <8>;
169 + non-removable;
170 + status = "okay";
171 +};
172 +
173 +&ohci1 {
174 + status = "okay";
175 +};
176 +
177 +&ohci2 {
178 + status = "okay";
179 +};
180 +
181 +&r_pio {
182 + sw_r_npi: key_pins {
183 + pins = "PL3";
184 + function = "gpio_in";
185 + };
186 +};