1 From e7510d24cab4741f72489b9d67c2d42b18fe5374 Mon Sep 17 00:00:00 2001
2 From: Chukun Pan <amadeus@jmu.edu.cn>
3 Date: Sun, 10 Oct 2021 21:36:57 +0800
4 Subject: [PATCH] sunxi: Add support for FriendlyARM NanoPi R1S H5
6 This adds support for the NanoPi R1S H5 board.
10 10/100/1000M Ethernet x 2
11 RTL8189ETV WiFi 802.11b/g/n
18 Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
20 arch/arm/dts/Makefile | 1 +
21 arch/arm/dts/sun50i-h5-nanopi-r1s-h5.dts | 195 +++++++++++++++++++++++
22 board/sunxi/MAINTAINERS | 5 +
23 configs/nanopi_r1s_h5_defconfig | 14 ++
24 4 files changed, 215 insertions(+)
25 create mode 100644 arch/arm/dts/sun50i-h5-nanopi-r1s-h5.dts
26 create mode 100644 configs/nanopi_r1s_h5_defconfig
28 diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
29 index b8a382d1539..ed3d360bb10 100644
30 --- a/arch/arm/dts/Makefile
31 +++ b/arch/arm/dts/Makefile
32 @@ -555,6 +555,7 @@ dtb-$(CONFIG_MACH_SUN50I_H5) += \
33 sun50i-h5-libretech-all-h5-cc.dtb \
34 sun50i-h5-nanopi-neo2.dtb \
35 sun50i-h5-nanopi-neo-plus2.dtb \
36 + sun50i-h5-nanopi-r1s-h5.dtb \
37 sun50i-h5-orangepi-zero-plus.dtb \
38 sun50i-h5-orangepi-pc2.dtb \
39 sun50i-h5-orangepi-prime.dtb \
40 diff --git a/arch/arm/dts/sun50i-h5-nanopi-r1s-h5.dts b/arch/arm/dts/sun50i-h5-nanopi-r1s-h5.dts
42 index 00000000000..55bcdf8d1a0
44 +++ b/arch/arm/dts/sun50i-h5-nanopi-r1s-h5.dts
46 +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
48 + * Copyright (C) 2021 Chukun Pan <amadeus@jmu.edu.cn>
50 + * Based on sun50i-h5-nanopi-neo-plus2.dts, which is:
51 + * Copyright (C) 2017 Antony Antony <antony@phenome.org>
52 + * Copyright (C) 2016 ARM Ltd.
56 +#include "sun50i-h5.dtsi"
58 +#include <dt-bindings/gpio/gpio.h>
59 +#include <dt-bindings/input/input.h>
62 + model = "FriendlyARM NanoPi R1S H5";
63 + compatible = "friendlyarm,nanopi-r1s-h5", "allwinner,sun50i-h5";
67 + ethernet1 = &rtl8189etv;
72 + stdout-path = "serial0:115200n8";
76 + compatible = "gpio-leds";
79 + label = "nanopi:red:sys";
80 + gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>;
81 + linux,default-trigger = "heartbeat";
85 + label = "nanopi:green:lan";
86 + gpios = <&pio 0 9 GPIO_ACTIVE_HIGH>;
90 + label = "nanopi:green:wan";
91 + gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>;
96 + compatible = "gpio-keys";
100 + linux,code = <KEY_RESTART>;
101 + gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
105 + reg_gmac_3v3: gmac-3v3 {
106 + compatible = "regulator-fixed";
107 + regulator-name = "gmac-3v3";
108 + regulator-min-microvolt = <3300000>;
109 + regulator-max-microvolt = <3300000>;
110 + startup-delay-us = <100000>;
111 + enable-active-high;
112 + gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
115 + reg_vcc3v3: vcc3v3 {
116 + compatible = "regulator-fixed";
117 + regulator-name = "vcc3v3";
118 + regulator-min-microvolt = <3300000>;
119 + regulator-max-microvolt = <3300000>;
122 + reg_usb0_vbus: usb0-vbus {
123 + compatible = "regulator-fixed";
124 + regulator-name = "usb0-vbus";
125 + regulator-min-microvolt = <5000000>;
126 + regulator-max-microvolt = <5000000>;
127 + enable-active-high;
128 + gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
132 + vdd_cpux: gpio-regulator {
133 + compatible = "regulator-gpio";
134 + regulator-name = "vdd-cpux";
135 + regulator-type = "voltage";
137 + regulator-always-on;
138 + regulator-min-microvolt = <1100000>;
139 + regulator-max-microvolt = <1300000>;
140 + regulator-ramp-delay = <50>; /* 4ms */
141 + gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>;
142 + gpios-states = <0x1>;
143 + states = <1100000 0x0>, <1300000 0x1>;
146 + wifi_pwrseq: wifi_pwrseq {
147 + compatible = "mmc-pwrseq-simple";
148 + reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
149 + post-power-on-delay-ms = <200>;
154 + cpu-supply = <&vdd_cpux>;
166 + pinctrl-names = "default";
167 + pinctrl-0 = <&emac_rgmii_pins>;
168 + phy-supply = <®_gmac_3v3>;
169 + phy-handle = <&ext_rgmii_phy>;
170 + phy-mode = "rgmii-id";
175 + ext_rgmii_phy: ethernet-phy@7 {
176 + compatible = "ethernet-phy-ieee802.3-c22";
185 + compatible = "microchip,24c02";
192 + vmmc-supply = <®_vcc3v3>;
194 + cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
199 + vmmc-supply = <®_vcc3v3>;
200 + vqmmc-supply = <®_vcc3v3>;
201 + mmc-pwrseq = <&wifi_pwrseq>;
206 + rtl8189etv: sdio_wifi@1 {
220 + pinctrl-names = "default";
221 + pinctrl-0 = <&uart0_pa_pins>;
226 + dr_mode = "peripheral";
231 + /* USB Type-A port's VBUS is always on */
232 + usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
233 + usb0_vbus-supply = <®_usb0_vbus>;
236 diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS
237 index 2543c94de79..56a0ee3689b 100644
238 --- a/board/sunxi/MAINTAINERS
239 +++ b/board/sunxi/MAINTAINERS
240 @@ -358,6 +358,11 @@ M: Jelle van der Waa <jelle@vdwaa.nl>
242 F: configs/nanopi_neo_air_defconfig
245 +M: Chukun Pan <amadeus@jmu.edu.cn>
247 +F: configs/nanopi_r1s_h5_defconfig
250 M: Jagan Teki <jagan@amarulasolutions.com>
252 diff --git a/configs/nanopi_r1s_h5_defconfig b/configs/nanopi_r1s_h5_defconfig
254 index 00000000000..27cf172d72a
256 +++ b/configs/nanopi_r1s_h5_defconfig
261 +CONFIG_MACH_SUN50I_H5=y
263 +CONFIG_DRAM_ZQ=3881977
264 +# CONFIG_DRAM_ODT_EN is not set
266 +CONFIG_MMC_SUNXI_SLOT_EXTRA=2
267 +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
268 +CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-nanopi-r1s-h5"
270 +CONFIG_USB_EHCI_HCD=y
271 +CONFIG_USB_OHCI_HCD=y