1 From 9962cb9be2db877c232aaf00db40125c0d7bf4bc Mon Sep 17 00:00:00 2001
2 From: Chukun Pan <amadeus@jmu.edu.cn>
3 Date: Mon, 17 May 2021 00:35:22 +0800
4 Subject: [PATCH] arm64: dts: allwinner: h5: Add NanoPi R1S H5 support
6 The NanoPi R1S H5 is a open source board made by FriendlyElec.
7 It has the following features:
9 - Allwinner H5, Quad-core Cortex-A53
11 - 10/100/1000M Ethernet x 2
12 - RTL8189ETV WiFi 802.11b/g/n
13 - USB 2.0 host port (A)
16 - 5V 2A DC power-supply
18 Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
19 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
20 Link: https://lore.kernel.org/r/20210516163523.9484-2-amadeus@jmu.edu.cn
22 arch/arm64/boot/dts/allwinner/Makefile | 1 +
23 .../dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts | 195 ++++++++++++++++++
24 2 files changed, 196 insertions(+)
25 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts
27 --- a/arch/arm64/boot/dts/allwinner/Makefile
28 +++ b/arch/arm64/boot/dts/allwinner/Makefile
29 @@ -24,6 +24,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-li
30 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-libretech-all-h5-cc.dtb
31 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo2.dtb
32 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo-plus2.dtb
33 +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-r1s-h5.dtb
34 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb
35 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-prime.dtb
36 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus.dtb
38 +++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts
40 +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
42 + * Copyright (C) 2021 Chukun Pan <amadeus@jmu.edu.cn>
44 + * Based on sun50i-h5-nanopi-neo-plus2.dts, which is:
45 + * Copyright (C) 2017 Antony Antony <antony@phenome.org>
46 + * Copyright (C) 2016 ARM Ltd.
50 +#include "sun50i-h5.dtsi"
51 +#include "sun50i-h5-cpu-opp.dtsi"
53 +#include <dt-bindings/gpio/gpio.h>
54 +#include <dt-bindings/input/input.h>
57 + model = "FriendlyARM NanoPi R1S H5";
58 + compatible = "friendlyarm,nanopi-r1s-h5", "allwinner,sun50i-h5";
62 + ethernet1 = &rtl8189etv;
67 + stdout-path = "serial0:115200n8";
71 + compatible = "gpio-leds";
74 + label = "nanopi:red:sys";
75 + gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>;
76 + linux,default-trigger = "heartbeat";
80 + label = "nanopi:green:lan";
81 + gpios = <&pio 0 9 GPIO_ACTIVE_HIGH>;
85 + label = "nanopi:green:wan";
86 + gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>;
91 + compatible = "gpio-keys";
95 + linux,code = <KEY_RESTART>;
96 + gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
100 + reg_gmac_3v3: gmac-3v3 {
101 + compatible = "regulator-fixed";
102 + regulator-name = "gmac-3v3";
103 + regulator-min-microvolt = <3300000>;
104 + regulator-max-microvolt = <3300000>;
105 + startup-delay-us = <100000>;
106 + enable-active-high;
107 + gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
110 + reg_vcc3v3: vcc3v3 {
111 + compatible = "regulator-fixed";
112 + regulator-name = "vcc3v3";
113 + regulator-min-microvolt = <3300000>;
114 + regulator-max-microvolt = <3300000>;
117 + reg_usb0_vbus: usb0-vbus {
118 + compatible = "regulator-fixed";
119 + regulator-name = "usb0-vbus";
120 + regulator-min-microvolt = <5000000>;
121 + regulator-max-microvolt = <5000000>;
122 + enable-active-high;
123 + gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
127 + vdd_cpux: gpio-regulator {
128 + compatible = "regulator-gpio";
129 + regulator-name = "vdd-cpux";
130 + regulator-type = "voltage";
132 + regulator-always-on;
133 + regulator-min-microvolt = <1100000>;
134 + regulator-max-microvolt = <1300000>;
135 + regulator-ramp-delay = <50>; /* 4ms */
136 + gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>;
137 + gpios-states = <0x1>;
138 + states = <1100000 0x0>, <1300000 0x1>;
141 + wifi_pwrseq: wifi_pwrseq {
142 + compatible = "mmc-pwrseq-simple";
143 + reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
144 + post-power-on-delay-ms = <200>;
149 + cpu-supply = <&vdd_cpux>;
161 + pinctrl-names = "default";
162 + pinctrl-0 = <&emac_rgmii_pins>;
163 + phy-supply = <®_gmac_3v3>;
164 + phy-handle = <&ext_rgmii_phy>;
165 + phy-mode = "rgmii-id";
170 + ext_rgmii_phy: ethernet-phy@7 {
171 + compatible = "ethernet-phy-ieee802.3-c22";
180 + compatible = "microchip,24c02";
187 + vmmc-supply = <®_vcc3v3>;
189 + cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
194 + vmmc-supply = <®_vcc3v3>;
195 + vqmmc-supply = <®_vcc3v3>;
196 + mmc-pwrseq = <&wifi_pwrseq>;
201 + rtl8189etv: sdio_wifi@1 {
215 + pinctrl-names = "default";
216 + pinctrl-0 = <&uart0_pa_pins>;
221 + dr_mode = "peripheral";
226 + /* USB Type-A port's VBUS is always on */
227 + usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
228 + usb0_vbus-supply = <®_usb0_vbus>;