aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/sunxi
diff options
context:
space:
mode:
authorJayantajit Gogoi <jayanta.gogoi525@gmail.com>2020-10-12 18:51:34 +0000
committerHauke Mehrtens <hauke@hauke-m.de>2020-10-18 15:46:42 +0200
commite6d9f6fdffc6730cfa2019788afa411828eac816 (patch)
treef3b4127aee433b0373d1490e7a96f121186fe5a2 /target/linux/sunxi
parent4ff7bdfeebd4c974b74df74f779fc10891898f5d (diff)
downloadupstream-e6d9f6fdffc6730cfa2019788afa411828eac816.tar.gz
upstream-e6d9f6fdffc6730cfa2019788afa411828eac816.tar.bz2
upstream-e6d9f6fdffc6730cfa2019788afa411828eac816.zip
sunxi: add support for FriendlyARM NanoPi R1
Specification: - CPU: Allwinner H3, Quad-core Cortex-A7 Up to 1.2GHz - DDR3 RAM: 512MB/1GB - Network: 10/100/1000M Ethernet x 1, 10/100M Ethernet x 1 - WiFi: 802.11b/g/n, with SMA antenna interface - USB Host: Type-A x2 - MicroSD Slot x 1 - MicroUSB: for OTG and power input - Debug Serial Port: 3Pin 2.54mm pitch pin-header - LED: nanopi:red:status nanopi:green:wan nanopi:green:lan - KEY: reset - Power Supply: DC 5V/2A Installation: - Write the image to SD Card with dd - Boot NanoPi from the SD Card Signed-off-by: Jayantajit Gogoi <jayanta.gogoi525@gmail.com>
Diffstat (limited to 'target/linux/sunxi')
-rw-r--r--target/linux/sunxi/base-files/etc/board.d/01_leds20
-rwxr-xr-xtarget/linux/sunxi/base-files/etc/board.d/02_network3
-rw-r--r--target/linux/sunxi/image/cortexa7.mk10
-rw-r--r--target/linux/sunxi/patches-5.4/100-sunxi-h3-add-support-for-nanopi-r1.patch186
4 files changed, 219 insertions, 0 deletions
diff --git a/target/linux/sunxi/base-files/etc/board.d/01_leds b/target/linux/sunxi/base-files/etc/board.d/01_leds
new file mode 100644
index 0000000000..514b8d1796
--- /dev/null
+++ b/target/linux/sunxi/base-files/etc/board.d/01_leds
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+. /lib/functions/leds.sh
+. /lib/functions/uci-defaults.sh
+
+board=$(board_name)
+boardname="${board##*,}"
+
+board_config_update
+
+case $board in
+friendlyarm,nanopi-r1)
+ ucidef_set_led_netdev "wan" "WAN" "nanopi:green:wan" "eth0"
+ ucidef_set_led_netdev "lan" "LAN" "nanopi:green:lan" "eth1"
+ ;;
+esac
+
+board_config_flush
+
+exit 0
diff --git a/target/linux/sunxi/base-files/etc/board.d/02_network b/target/linux/sunxi/base-files/etc/board.d/02_network
index 5cf000cccf..08d31caadc 100755
--- a/target/linux/sunxi/base-files/etc/board.d/02_network
+++ b/target/linux/sunxi/base-files/etc/board.d/02_network
@@ -8,6 +8,9 @@
board_config_update
case $(board_name) in
+friendlyarm,nanopi-r1)
+ ucidef_set_interfaces_lan_wan "eth1" "eth0"
+ ;;
lamobo,lamobo-r1)
ucidef_add_switch "switch0" \
"4:lan:1" "0:lan:2" "1:lan:3" "2:lan:4" "3:wan" "8@eth0"
diff --git a/target/linux/sunxi/image/cortexa7.mk b/target/linux/sunxi/image/cortexa7.mk
index f11b13625c..a87817037d 100644
--- a/target/linux/sunxi/image/cortexa7.mk
+++ b/target/linux/sunxi/image/cortexa7.mk
@@ -47,6 +47,16 @@ define Device/friendlyarm_nanopi-neo-air
endef
TARGET_DEVICES += friendlyarm_nanopi-neo-air
+define Device/friendlyarm_nanopi-r1
+ DEVICE_VENDOR := FriendlyARM
+ DEVICE_MODEL := NanoPi R1
+ DEVICE_PACKAGES := kmod-rtc-sunxi kmod-usb-net-rtl8152 \
+ kmod-brcmfmac kmod-leds-gpio kmod-ledtrig-heartbeat wpad-basic-wolfssl \
+ brcmfmac-firmware-43430-sdio
+ SOC := sun8i-h3
+endef
+TARGET_DEVICES += friendlyarm_nanopi-r1
+
define Device/friendlyarm_zeropi
DEVICE_VENDOR := FriendlyARM
DEVICE_MODEL := ZeroPi
diff --git a/target/linux/sunxi/patches-5.4/100-sunxi-h3-add-support-for-nanopi-r1.patch b/target/linux/sunxi/patches-5.4/100-sunxi-h3-add-support-for-nanopi-r1.patch
new file mode 100644
index 0000000000..834ea153c8
--- /dev/null
+++ b/target/linux/sunxi/patches-5.4/100-sunxi-h3-add-support-for-nanopi-r1.patch
@@ -0,0 +1,186 @@
+From 5aee0b1272cd5b42933ef629d66b677669e2e8d2 Mon Sep 17 00:00:00 2001
+From: Jayantajit Gogoi <jayanta.gogoi525@gmail.com>
+Date: Mon, 12 Oct 2020 05:24:51 +0000
+Subject: [PATCH] sunxi: add support for friendlyarm nanopi r1
+
+Signed-off-by: Jayantajit Gogoi <jayanta.gogoi525@gmail.com>
+---
+ .../devicetree/bindings/arm/sunxi.yaml | 5 +
+ arch/arm/boot/dts/Makefile | 1 +
+ arch/arm/boot/dts/sun8i-h3-nanopi-r1.dts | 146 ++++++++++++++++++
+ 3 files changed, 152 insertions(+)
+ create mode 100644 arch/arm/boot/dts/sun8i-h3-nanopi-r1.dts
+
+--- a/Documentation/devicetree/bindings/arm/sunxi.yaml
++++ b/Documentation/devicetree/bindings/arm/sunxi.yaml
+@@ -241,6 +241,11 @@ properties:
+ - const: friendlyarm,nanopi-neo-plus2
+ - const: allwinner,sun50i-h5
+
++ - description: FriendlyARM NanoPi R1
++ items:
++ - const: friendlyarm,nanopi-r1
++ - const: allwinner,sun8i-h3
++
+ - description: Gemei G9 Tablet
+ items:
+ - const: gemei,g9
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -1109,6 +1109,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \
+ sun8i-h3-nanopi-m1-plus.dtb \
+ sun8i-h3-nanopi-neo.dtb \
+ sun8i-h3-nanopi-neo-air.dtb \
++ sun8i-h3-nanopi-r1.dtb \
+ sun8i-h3-orangepi-2.dtb \
+ sun8i-h3-orangepi-lite.dtb \
+ sun8i-h3-orangepi-one.dtb \
+--- /dev/null
++++ b/arch/arm/boot/dts/sun8i-h3-nanopi-r1.dts
+@@ -0,0 +1,146 @@
++// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
++/*
++ * Copyright (C) 2019 Igor Pecovnik <igor@armbian.com>
++ * Copyright (C) 2020 Jayantajit Gogoi <jayanta.gogoi525@gmail.com>
++ */
++
++/* NanoPi R1 is based on the NanoPi-H3 design from FriendlyARM */
++#include "sun8i-h3-nanopi.dtsi"
++
++/ {
++ model = "FriendlyARM NanoPi R1";
++ compatible = "friendlyarm,nanopi-r1", "allwinner,sun8i-h3";
++
++ reg_gmac_3v3: gmac-3v3 {
++ compatible = "regulator-fixed";
++ regulator-name = "gmac-3v3";
++ regulator-min-microvolt = <3300000>;
++ regulator-max-microvolt = <3300000>;
++ startup-delay-us = <100000>;
++ enable-active-high;
++ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
++ };
++
++ vdd_cpux: gpio-regulator {
++ compatible = "regulator-gpio";
++ pinctrl-names = "default";
++ regulator-name = "vdd-cpux";
++ regulator-type = "voltage";
++ regulator-boot-on;
++ regulator-always-on;
++ regulator-min-microvolt = <1100000>;
++ regulator-max-microvolt = <1300000>;
++ regulator-ramp-delay = <50>;
++ gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>;
++ gpios-states = <0x1>;
++ states = <1100000 0x0
++ 1300000 0x1>;
++ };
++
++ wifi_pwrseq: wifi_pwrseq {
++ compatible = "mmc-pwrseq-simple";
++ pinctrl-names = "default";
++ reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>;
++ };
++
++ leds {
++ /delete-node/ pwr;
++ status {
++ label = "nanopi:red:status";
++ gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>;
++ linux,default-trigger = "heartbeat";
++ };
++
++ wan {
++ label = "nanopi:green:wan";
++ gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>;
++ };
++
++ lan {
++ label = "nanopi:green:lan";
++ gpios = <&pio 0 9 GPIO_ACTIVE_HIGH>;
++ };
++ };
++
++ r_gpio_keys {
++ pinctrl-names = "default";
++ pinctrl-0 = <&sw_r_npi>;
++
++ /delete-node/ k1;
++ reset {
++ label = "reset";
++ linux,code = <KEY_RESTART>;
++ gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
++ };
++ };
++};
++
++&cpu0 {
++ cpu-supply = <&vdd_cpux>;
++};
++
++&ehci1 {
++ status = "okay";
++};
++
++&ehci2 {
++ status = "okay";
++};
++
++&emac {
++ pinctrl-names = "default";
++ pinctrl-0 = <&emac_rgmii_pins>;
++ phy-supply = <&reg_gmac_3v3>;
++ phy-handle = <&ext_rgmii_phy>;
++ phy-mode = "rgmii";
++ status = "okay";
++};
++
++&external_mdio {
++ ext_rgmii_phy: ethernet-phy@1 {
++ compatible = "ethernet-phy-ieee802.3-c22";
++ reg = <7>;
++ };
++};
++
++&mmc1 {
++ vmmc-supply = <&reg_vcc3v3>;
++ vqmmc-supply = <&reg_vcc3v3>;
++ mmc-pwrseq = <&wifi_pwrseq>;
++ bus-width = <4>;
++ non-removable;
++ status = "okay";
++
++ sdio_wifi: sdio_wifi@1 {
++ reg = <1>;
++ compatible = "brcm,bcm4329-fmac";
++ interrupt-parent = <&pio>;
++ interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>;
++ interrupt-names = "host-wake";
++ };
++};
++
++&mmc2 {
++ pinctrl-names = "default";
++ pinctrl-0 = <&mmc2_8bit_pins>;
++ vmmc-supply = <&reg_vcc3v3>;
++ vqmmc-supply = <&reg_vcc3v3>;
++ bus-width = <8>;
++ non-removable;
++ status = "okay";
++};
++
++&ohci1 {
++ status = "okay";
++};
++
++&ohci2 {
++ status = "okay";
++};
++
++&r_pio {
++ sw_r_npi: key_pins {
++ pins = "PL3";
++ function = "gpio_in";
++ };
++};