1 From 0e8043aff1aae95d1f7b7422b91b57d9569860d3 Mon Sep 17 00:00:00 2001
2 From: Jayantajit Gogoi <jayanta.gogoi525@gmail.com>
3 Date: Mon, 12 Oct 2020 18:39:53 +0000
4 Subject: [PATCH] sunxi: add support for FriendlyARM NanoPi R1
6 Signed-off-by: Jayantajit Gogoi <jayanta.gogoi525@gmail.com>
8 arch/arm/dts/Makefile | 1 +
9 arch/arm/dts/sun8i-h3-nanopi-r1.dts | 146 ++++++++++++++++++++++++++++
10 configs/nanopi_r1_defconfig | 22 +++++
11 3 files changed, 169 insertions(+)
12 create mode 100644 arch/arm/dts/sun8i-h3-nanopi-r1.dts
13 create mode 100644 configs/nanopi_r1_defconfig
15 --- a/arch/arm/dts/Makefile
16 +++ b/arch/arm/dts/Makefile
17 @@ -551,6 +551,7 @@ dtb-$(CONFIG_MACH_SUN8I_H3) += \
18 sun8i-h3-nanopi-m1-plus.dtb \
19 sun8i-h3-nanopi-neo.dtb \
20 sun8i-h3-nanopi-neo-air.dtb \
21 + sun8i-h3-nanopi-r1.dtb \
22 sun8i-h3-orangepi-2.dtb \
23 sun8i-h3-orangepi-lite.dtb \
24 sun8i-h3-orangepi-one.dtb \
26 +++ b/arch/arm/dts/sun8i-h3-nanopi-r1.dts
28 +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
30 + * Copyright (C) 2019 Igor Pecovnik <igor@armbian.com>
31 + * Copyright (C) 2020 Jayantajit Gogoi <jayanta.gogoi525@gmail.com>
34 +/* NanoPi R1 is based on the NanoPi-H3 design from FriendlyARM */
35 +#include "sun8i-h3-nanopi.dtsi"
38 + model = "FriendlyARM NanoPi R1";
39 + compatible = "friendlyarm,nanopi-r1", "allwinner,sun8i-h3";
41 + reg_gmac_3v3: gmac-3v3 {
42 + compatible = "regulator-fixed";
43 + regulator-name = "gmac-3v3";
44 + regulator-min-microvolt = <3300000>;
45 + regulator-max-microvolt = <3300000>;
46 + startup-delay-us = <100000>;
48 + gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
51 + vdd_cpux: gpio-regulator {
52 + compatible = "regulator-gpio";
53 + pinctrl-names = "default";
54 + regulator-name = "vdd-cpux";
55 + regulator-type = "voltage";
57 + regulator-always-on;
58 + regulator-min-microvolt = <1100000>;
59 + regulator-max-microvolt = <1300000>;
60 + regulator-ramp-delay = <50>;
61 + gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>;
62 + gpios-states = <0x1>;
63 + states = <1100000 0x0
67 + wifi_pwrseq: wifi_pwrseq {
68 + compatible = "mmc-pwrseq-simple";
69 + pinctrl-names = "default";
70 + reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>;
76 + label = "nanopi:red:status";
77 + gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>;
78 + linux,default-trigger = "heartbeat";
82 + label = "nanopi:green:wan";
83 + gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>;
87 + label = "nanopi:green:lan";
88 + gpios = <&pio 0 9 GPIO_ACTIVE_HIGH>;
93 + pinctrl-names = "default";
94 + pinctrl-0 = <&sw_r_npi>;
99 + linux,code = <KEY_RESTART>;
100 + gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
106 + cpu-supply = <&vdd_cpux>;
118 + pinctrl-names = "default";
119 + pinctrl-0 = <&emac_rgmii_pins>;
120 + phy-supply = <®_gmac_3v3>;
121 + phy-handle = <&ext_rgmii_phy>;
122 + phy-mode = "rgmii";
127 + ext_rgmii_phy: ethernet-phy@1 {
128 + compatible = "ethernet-phy-ieee802.3-c22";
134 + vmmc-supply = <®_vcc3v3>;
135 + vqmmc-supply = <®_vcc3v3>;
136 + mmc-pwrseq = <&wifi_pwrseq>;
141 + sdio_wifi: sdio_wifi@1 {
143 + compatible = "brcm,bcm4329-fmac";
144 + interrupt-parent = <&pio>;
145 + interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>;
146 + interrupt-names = "host-wake";
151 + pinctrl-names = "default";
152 + pinctrl-0 = <&mmc2_8bit_pins>;
153 + vmmc-supply = <®_vcc3v3>;
154 + vqmmc-supply = <®_vcc3v3>;
169 + sw_r_npi: key_pins {
171 + function = "gpio_in";
175 +++ b/configs/nanopi_r1_defconfig
180 +CONFIG_MACH_SUN8I_H3=y
182 +CONFIG_DRAM_ZQ=3881979
183 +CONFIG_DRAM_ODT_EN=y
185 +# CONFIG_VIDEO_DE2 is not set
186 +CONFIG_NR_DRAM_BANKS=1
187 +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
188 +CONFIG_CONSOLE_MUX=y
189 +# CONFIG_CMD_FLASH is not set
190 +# CONFIG_SPL_DOS_PARTITION is not set
191 +# CONFIG_SPL_EFI_PARTITION is not set
192 +CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-nanopi-r1"
194 +CONFIG_USB_EHCI_HCD=y
195 +CONFIG_USB_OHCI_HCD=y
196 +CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
197 +CONFIG_MMC_SUNXI_SLOT_EXTRA=2