diff --git a/target/linux/sunxi/patches-4.14/036-SWC-add-nanopi-r1-and-duo2.patch b/package/boot/uboot-sunxi/patches/035-SWC-add-nanopi-r1-and-duo2.patch similarity index 93% rename from target/linux/sunxi/patches-4.14/036-SWC-add-nanopi-r1-and-duo2.patch rename to package/boot/uboot-sunxi/patches/035-SWC-add-nanopi-r1-and-duo2.patch index aa8d11beb7..84d6e06f0a 100644 --- a/target/linux/sunxi/patches-4.14/036-SWC-add-nanopi-r1-and-duo2.patch +++ b/package/boot/uboot-sunxi/patches/035-SWC-add-nanopi-r1-and-duo2.patch @@ -1,13 +1,13 @@ -diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile -index d17045a..9e1be8b 100644 ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -924,2 +924,4 @@ + +diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile +--- a/arch/arm/dts/Makefile 2019-11-05 02:12:02.183543000 +0800 ++++ a/arch/arm/dts/Makefile 2019-11-05 10:48:17.483563700 +0800 +@@ -365,2 +365,4 @@ sun8i-h3-nanopi-neo.dtb \ + sun8i-h3-nanopi-duo2.dtb \ + sun8i-h3-nanopi-r1.dtb \ - sun8i-h3-nanopi-neo-air.dtb \ -diff --git a/arch/arm/boot/dts/sun8i-h3-nanopi-r1.dts b/arch/arm/boot/dts/sun8i-h3-nanopi-r1.dts + sun8i-h3-nanopi-neo-air.dtb +diff --git a/arch/arm/dts/sun8i-h3-nanopi-r1.dts b/arch/arm/dts/sun8i-h3-nanopi-r1.dts new file mode 100644 index 0000000..9f33f6f --- /dev/null @@ -148,7 +148,7 @@ new file mode 100644 index 0000000..1e51018 --- /dev/null +++ b/configs/nanopi_duo2_defconfig -@@ -0,0 +1,21 @@ @@ -0,0 +1,126 @@ +@@ -0,0 +1,21 @@ +CONFIG_ARM=y +CONFIG_ARCH_SUNXI=y +CONFIG_SYS_TEXT_BASE=0x4a000000 @@ -158,7 +158,7 @@ index 0000000..1e51018 +CONFIG_DRAM_ZQ=3881979 +CONFIG_DRAM_ODT_EN=y +# CONFIG_VIDEO_DE2 is not set -+CONFIG_DEVEL=y ++CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-nanopi-duo2" +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set +CONFIG_CONSOLE_MUX=y +CONFIG_SPL=y @@ -170,11 +170,11 @@ index 0000000..1e51018 +CONFIG_SUN8I_EMAC=y +CONFIG_USB_EHCI_HCD=y +CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y -diff --git a/arch/arm/boot/dts/sun8i-h3-nanopi-duo2.dts b/arch/arm/boot/dts/sun8i-h3-nanopi-duo2.dts +diff --git a/arch/arm/dts/sun8i-h3-nanopi-duo2.dts b/arch/arm/dts/sun8i-h3-nanopi-duo2.dts new file mode 100644 index 0000000..b6afe20 --- /dev/null -+++ b/arch/arm/boot/dts/sun8i-h3-nanopi-duo2.dts ++++ b/arch/arm/dts/sun8i-h3-nanopi-duo2.dts @@ -0,0 +1,98 @@ +/* + * adapted by Igor Pecovnik igor@armbian.com diff --git a/package/boot/uboot-sunxi/patches/310-sunxi-h3-Sync-OTG-and-HCI-nodes-from-Linux-DT.patch b/package/boot/uboot-sunxi/patches/310-sunxi-h3-Sync-OTG-and-HCI-nodes-from-Linux-DT.patch new file mode 100644 index 0000000000..97aad78796 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/310-sunxi-h3-Sync-OTG-and-HCI-nodes-from-Linux-DT.patch @@ -0,0 +1,63 @@ +From 96c04aab58e351fa9ed7e95783018d6dbf60768f Mon Sep 17 00:00:00 2001 +From: Jun Nie +Date: Mon, 7 May 2018 13:03:40 +0530 +Subject: sunxi: h3: Sync OTG and HCI nodes from Linux DT + +Allwinner H3 have a dual-routed USB PHY0 -- routed to either OHCI/EHCI +or MUSB controller. + +Signed-off-by: Jun Nie +Reviewed-by: Jagan Teki +Acked-by: Jun Nie +--- + arch/arm/dts/sun8i-h3.dtsi | 32 ++++++++++++++++++++++++++++++++ + 1 file changed, 32 insertions(+) + +--- a/arch/arm/dts/sun8i-h3.dtsi ++++ b/arch/arm/dts/sun8i-h3.dtsi +@@ -219,6 +219,19 @@ + #size-cells = <0>; + }; + ++ usb_otg: usb@1c19000 { ++ compatible = "allwinner,sun8i-h3-musb"; ++ reg = <0x01c19000 0x400>; ++ clocks = <&ccu CLK_BUS_OTG>; ++ resets = <&ccu RST_BUS_OTG>; ++ interrupts = ; ++ interrupt-names = "mc"; ++ phys = <&usbphy 0>; ++ phy-names = "usb"; ++ extcon = <&usbphy 0>; ++ status = "disabled"; ++ }; ++ + usbphy: phy@01c19400 { + compatible = "allwinner,sun8i-h3-usb-phy"; + reg = <0x01c19400 0x2c>, +@@ -251,6 +264,25 @@ + #phy-cells = <1>; + }; + ++ ehci0: usb@1c1a000 { ++ compatible = "allwinner,sun8i-h3-ehci", "generic-ehci"; ++ reg = <0x01c1a000 0x100>; ++ interrupts = ; ++ clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>; ++ resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>; ++ status = "disabled"; ++ }; ++ ++ ohci0: usb@1c1a400 { ++ compatible = "allwinner,sun8i-h3-ohci", "generic-ohci"; ++ reg = <0x01c1a400 0x100>; ++ interrupts = ; ++ clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>, ++ <&ccu CLK_USB_OHCI0>; ++ resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>; ++ status = "disabled"; ++ }; ++ + ehci1: usb@01c1b000 { + compatible = "allwinner,sun8i-h3-ehci", "generic-ehci"; + reg = <0x01c1b000 0x100>; diff --git a/package/boot/uboot-sunxi/patches/320-sunxi-Add-support-for-Orange-Pi-R1.patch b/package/boot/uboot-sunxi/patches/320-sunxi-Add-support-for-Orange-Pi-R1.patch new file mode 100644 index 0000000000..97c4769468 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/320-sunxi-Add-support-for-Orange-Pi-R1.patch @@ -0,0 +1,179 @@ +From fd3736abbe57a819312c8df96d14ec396b074581 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Tue, 26 Sep 2017 22:16:59 +0200 +Subject: sun8i: h2: Add initial Orange Pi R1 + +Orange Pi R1 is an open-source single-board computer using the +Allwinner H2+ SOC. + +H2+ Orange Pi R1 has + - Quad-core Cortex-A7 + - 256MB DDR3 + - micrSD slot + - 128MBit SPI Nor flash + - Debug TTL UART + - 100MBit/s Ethernet (H2+) + - 100MBit/s Ethernet (RTL8152B) + - Wifi (RTL8189ETV) + - USB 2.0 OTG + power supply +This board is very similar to the Orange Pi Zero. + +The device tree file is copied from the Linux kernel 4.18. + +Signed-off-by: Hauke Mehrtens +--- + arch/arm/dts/Makefile | 1 + + arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts | 101 +++++++++++++++++++++++++++++ + board/sunxi/MAINTAINERS | 5 ++ + configs/orangepi_r1_defconfig | 16 +++++ + 4 files changed, 123 insertions(+) + create mode 100644 arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts + create mode 100644 configs/orangepi_r1_defconfig + +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -350,6 +350,7 @@ dtb-$(CONFIG_MACH_SUN8I_A83T) += \ + sun8i-a83t-cubietruck-plus.dtb \ + sun8i-a83t-tbs-a711.dts + dtb-$(CONFIG_MACH_SUN8I_H3) += \ ++ sun8i-h2-plus-orangepi-r1.dtb \ + sun8i-h2-plus-orangepi-zero.dtb \ + sun8i-h3-bananapi-m2-plus.dtb \ + sun8i-h3-libretech-all-h3-cc.dtb \ +--- /dev/null ++++ b/arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts +@@ -0,0 +1,101 @@ ++/* ++ * Copyright (C) 2017 Icenowy Zheng ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This file is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/* Orange Pi R1 is based on Orange Pi Zero design */ ++#include "sun8i-h2-plus-orangepi-zero.dts" ++ ++/ { ++ model = "Xunlong Orange Pi R1"; ++ compatible = "xunlong,orangepi-r1", "allwinner,sun8i-h2-plus"; ++ ++ /delete-node/ reg_vcc_wifi; ++ ++ /* ++ * Ths pin of this regulator is the same with the Wi-Fi extra ++ * regulator on the original Zero. However it's used for USB ++ * Ethernet rather than the Wi-Fi now. ++ */ ++ reg_vcc_usb_eth: reg-vcc-usb-ethernet { ++ compatible = "regulator-fixed"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc-usb-ethernet"; ++ enable-active-high; ++ gpio = <&pio 0 20 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ aliases { ++ ethernet1 = &rtl8189etv; ++ }; ++}; ++ ++/* ++&spi0 { ++ status = "okay"; ++ ++ flash@0 { ++ compatible = "mxicy,mx25l12805d", "jedec,spi-nor"; ++ }; ++}; ++*/ ++ ++&ohci1 { ++ /* ++ * RTL8152B USB-Ethernet adapter is connected to USB1, ++ * and it's a USB 2.0 device. So the OHCI1 controller ++ * can be left disabled. ++ */ ++ status = "disabled"; ++}; ++ ++&mmc1 { ++ vmmc-supply = <®_vcc3v3>; ++ vqmmc-supply = <®_vcc3v3>; ++ ++ rtl8189etv: sdio_wifi@1 { ++ reg = <1>; ++ }; ++}; ++ ++&usbphy { ++ usb1_vbus-supply = <®_vcc_usb_eth>; ++}; +--- a/board/sunxi/MAINTAINERS ++++ b/board/sunxi/MAINTAINERS +@@ -342,6 +342,11 @@ M: Jagan Teki ++S: Maintained ++F: configs/orangepi_r1_defconfig ++ + PINE64 BOARDS + M: Andre Przywara + S: Maintained +--- /dev/null ++++ b/configs/orangepi_r1_defconfig +@@ -0,0 +1,16 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_SUNXI=y ++CONFIG_SPL=y ++CONFIG_MACH_SUN8I_H3=y ++CONFIG_DRAM_CLK=624 ++CONFIG_DRAM_ZQ=3881979 ++CONFIG_DRAM_ODT_EN=y ++# CONFIG_VIDEO_DE2 is not set ++CONFIG_SPL_SPI_SUNXI=y ++CONFIG_DEFAULT_DEVICE_TREE="sun8i-h2-plus-orangepi-r1" ++# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set ++CONFIG_CONSOLE_MUX=y ++# CONFIG_CMD_FLASH is not set ++CONFIG_SUN8I_EMAC=y ++CONFIG_USB_EHCI_HCD=y ++CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y diff --git a/package/boot/uboot-sunxi/patches/400-ARM-dts-orange-pi-zero-plus.patch b/package/boot/uboot-sunxi/patches/400-ARM-dts-orange-pi-zero-plus.patch new file mode 100644 index 0000000000..e1e16d6f34 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/400-ARM-dts-orange-pi-zero-plus.patch @@ -0,0 +1,222 @@ +From fd576a3c594ee2356b50a0738403e5cef094935a Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Sat, 9 Jun 2018 15:16:42 +0200 +Subject: sun50i: h5: Add initial Orange Pi Zero Plus support + +Orange Pi Zero Plus is an open-source single-board computer +using the Allwinner H5 SOC. + +H5 Orangepi Zero Plus has + - Quad-core Cortex-A53 + - 512MB DDR3 + - micrSD slot + - 16MBit SPI Nor flash + - Debug TTL UART + - 1GBit/s Ethernet (RTL8211E) + - Wifi (RTL8189FTV) + - USB 2.0 Host + - USB 2.0 OTG + power supply + +The device tree file is copied from the Linux kernel 4.18. + +Signed-off-by: Hauke Mehrtens +--- + arch/arm/dts/Makefile | 1 + + arch/arm/dts/sun50i-h5-orangepi-zero-plus.dts | 145 ++++++++++++++++++++++++++ + board/sunxi/MAINTAINERS | 5 + + configs/orangepi_zero_plus_defconfig | 16 +++ + 4 files changed, 167 insertions(+) + create mode 100644 arch/arm/dts/sun50i-h5-orangepi-zero-plus.dts + create mode 100644 configs/orangepi_zero_plus_defconfig + +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -372,6 +372,7 @@ dtb-$(CONFIG_MACH_SUN8I_V3S) += \ + dtb-$(CONFIG_MACH_SUN50I_H5) += \ + sun50i-h5-nanopi-neo2.dtb \ + sun50i-h5-nanopi-neo-plus2.dtb \ ++ sun50i-h5-orangepi-zero-plus.dtb \ + sun50i-h5-orangepi-pc2.dtb \ + sun50i-h5-orangepi-prime.dtb \ + sun50i-h5-orangepi-zero-plus2.dtb +--- /dev/null ++++ b/arch/arm/dts/sun50i-h5-orangepi-zero-plus.dts +@@ -0,0 +1,145 @@ ++/* ++ * Copyright (C) 2016 ARM Ltd. ++ * Copyright (C) 2018 Hauke Mehrtens ++ * ++ * SPDX-License-Identifier: (GPL-2.0+ OR X11) ++ */ ++ ++/dts-v1/; ++#include "sun50i-h5.dtsi" ++ ++#include ++#include ++#include ++ ++/ { ++ model = "Xunlong Orange Pi Zero Plus"; ++ compatible = "xunlong,orangepi-zero-plus", "allwinner,sun50i-h5"; ++ ++ reg_vcc3v3: vcc3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ }; ++ ++ aliases { ++ ethernet0 = &emac; ++ ethernet1 = &rtl8189ftv; ++ serial0 = &uart0; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ pwr { ++ label = "orangepi:green:pwr"; ++ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PA10 */ ++ default-state = "on"; ++ }; ++ ++ status { ++ label = "orangepi:red:status"; ++ gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>; /* PA17 */ ++ }; ++ }; ++ ++ 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>; /* PD6 */ ++ }; ++}; ++ ++&ehci0 { ++ status = "okay"; ++}; ++ ++&ehci1 { ++ status = "okay"; ++}; ++ ++&emac { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&emac_rgmii_pins>; ++ phy-supply = <®_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 = <1>; ++ }; ++}; ++ ++&mmc0 { ++ vmmc-supply = <®_vcc3v3>; ++ bus-width = <4>; ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ ++ status = "okay"; ++}; ++ ++&mmc1 { ++ vmmc-supply = <®_vcc3v3>; ++ bus-width = <4>; ++ non-removable; ++ status = "okay"; ++ ++ /* ++ * Explicitly define the sdio device, so that we can add an ethernet ++ * alias for it (which e.g. makes u-boot set a mac-address). ++ */ ++ rtl8189ftv: sdio_wifi@1 { ++ reg = <1>; ++ }; ++}; ++ ++/* ++&spi0 { ++ status = "okay"; ++ ++ flash@0 { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ compatible = "mxicy,mx25l1606e", "winbond,w25q128"; ++ reg = <0>; ++ spi-max-frequency = <40000000>; ++ }; ++}; ++*/ ++ ++&ohci0 { ++ status = "okay"; ++}; ++ ++&ohci1 { ++ status = "okay"; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pins_a>; ++ status = "okay"; ++}; ++ ++&usb_otg { ++ dr_mode = "peripheral"; ++ status = "okay"; ++}; ++ ++&usbphy { ++ /* USB Type-A ports' VBUS is always on */ ++ usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */ ++ status = "okay"; ++}; +--- a/board/sunxi/MAINTAINERS ++++ b/board/sunxi/MAINTAINERS +@@ -327,6 +327,11 @@ M: Icenowy Zheng + S: Maintained + F: configs/orangepi_zero_defconfig + ++ORANGEPI ZERO PLUS BOARD ++M: Hauke Mehrtens ++S: Maintained ++F: configs/orangepi_zero_plus_defconfig ++ + ORANGEPI ZERO PLUS 2 BOARD + M: Jagan Teki + S: Maintained +--- /dev/null ++++ b/configs/orangepi_zero_plus_defconfig +@@ -0,0 +1,16 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_SUNXI=y ++CONFIG_SPL=y ++CONFIG_MACH_SUN50I_H5=y ++CONFIG_DRAM_CLK=624 ++CONFIG_DRAM_ZQ=3881977 ++CONFIG_MMC0_CD_PIN="PH13" ++CONFIG_MMC_SUNXI_SLOT_EXTRA=2 ++CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-orangepi-zero-plus" ++# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set ++# CONFIG_CMD_FLASH is not set ++# CONFIG_SPL_DOS_PARTITION is not set ++# CONFIG_SPL_EFI_PARTITION is not set ++CONFIG_SUN8I_EMAC=y ++CONFIG_USB_EHCI_HCD=y ++CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y diff --git a/package/boot/uboot-sunxi/patches/401-add-r1s-h5.patch b/package/boot/uboot-sunxi/patches/401-add-r1s-h5.patch new file mode 100644 index 0000000000..c618cb72aa --- /dev/null +++ b/package/boot/uboot-sunxi/patches/401-add-r1s-h5.patch @@ -0,0 +1,140 @@ +From ceca46d683970cc002c8842f350410bda3e4125b Mon Sep 17 00:00:00 2001 +From: jerrykuku +Date: Sun, 22 Dec 2019 15:09:12 +0800 +Subject: [PATCH] add r1s h5 + +--- + arch/arm/dts/Makefile | 1 + + arch/arm/dts/sun50i-h5-nanopi-r1s.dts | 86 +++++++++++++++++++++++++++ + configs/nanopi_r1s_defconfig | 14 +++++ + 3 files changed, 101 insertions(+) + create mode 100644 arch/arm/dts/sun50i-h5-nanopi-r1s.dts + create mode 100644 configs/nanopi_r1s_defconfig + +diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile +index 5b6a43b..7c83422 100644 +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -372,6 +372,7 @@ dtb-$(CONFIG_MACH_SUN8I_V3S) += \ + dtb-$(CONFIG_MACH_SUN50I_H5) += \ + sun50i-h5-nanopi-neo2.dtb \ + sun50i-h5-nanopi-neo-plus2.dtb \ ++ sun50i-h5-nanopi-r1s.dtb \ + sun50i-h5-orangepi-zero-plus.dtb \ + sun50i-h5-orangepi-pc2.dtb \ + sun50i-h5-orangepi-prime.dtb \ +diff --git a/arch/arm/dts/sun50i-h5-nanopi-r1s.dts b/arch/arm/dts/sun50i-h5-nanopi-r1s.dts +new file mode 100644 +index 0000000..4992ef5 +--- /dev/null ++++ b/arch/arm/dts/sun50i-h5-nanopi-r1s.dts +@@ -0,0 +1,86 @@ ++/* ++ * Copyright (C) 2017 Icenowy Zheng ++ * Copyright (C) 2017 Jagan Teki ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/dts-v1/; ++ ++#include "sun50i-h5.dtsi" ++ ++#include ++ ++/ { ++ model = "FriendlyElec NanoPi-R1S-H5"; ++ compatible = "friendlyelec,nanopi-r1s-h5", "allwinner,sun50i-h5"; ++ ++ aliases { ++ serial0 = &uart0; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ reg_vcc3v3: vcc3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ }; ++}; ++ ++&mmc0 { ++ compatible = "allwinner,sun50i-h5-mmc", ++ "allwinner,sun50i-a64-mmc", ++ "allwinner,sun5i-a13-mmc"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>; ++ vmmc-supply = <®_vcc3v3>; ++ bus-width = <4>; ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ ++ status = "okay"; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pins_a>; ++ status = "okay"; ++}; +diff --git a/configs/nanopi_r1s_defconfig b/configs/nanopi_r1s_defconfig +new file mode 100644 +index 0000000..3f6ff4d +--- /dev/null ++++ b/configs/nanopi_r1s_defconfig +@@ -0,0 +1,14 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_SUNXI=y ++CONFIG_SPL=y ++CONFIG_MACH_SUN50I_H5=y ++CONFIG_DRAM_CLK=672 ++CONFIG_DRAM_ZQ=3881977 ++CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-nanopi-r1s" ++# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set ++# CONFIG_CMD_FLASH is not set ++# CONFIG_SPL_DOS_PARTITION is not set ++# CONFIG_SPL_EFI_PARTITION is not set ++CONFIG_SUN8I_EMAC=y ++CONFIG_USB_EHCI_HCD=y ++CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y +-- +2.21.0.windows.1 + diff --git a/target/linux/sunxi/base-files/etc/board.d/01_leds b/target/linux/sunxi/base-files/etc/board.d/01_leds deleted file mode 100755 index 9c534ea50b..0000000000 --- a/target/linux/sunxi/base-files/etc/board.d/01_leds +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -. /lib/functions/uci-defaults.sh - -board_config_update - -case "$(board_name)" in -"friendlyelec,nanopi-r1" \ -|"friendlyelec,nanopi-r1s-h3" \ -|"friendlyelec,nanopi-r1s-h5") - ucidef_set_led_netdev "wan_link" "led2-wan" "LED2" "eth0" "link" - ucidef_set_led_netdev "lan_link" "led3-lan" "LED3" "eth1" "link" - ;; -*) - ;; -esac - -board_config_flush - -exit 0 diff --git a/target/linux/sunxi/base-files/root/setup.sh b/target/linux/sunxi/base-files/root/setup.sh deleted file mode 100755 index 575cfc1f5a..0000000000 --- a/target/linux/sunxi/base-files/root/setup.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/sh - -# THIS SCIPRT ONLY RUN ONCE. Base on /etc/firstboot_${board} - -setup_ssid() -{ - local r=$1 - local chip - - if ! uci show wireless.${r} >/dev/null 2>&1; then - return - fi - - logger "${TAG}: setup $1's ssid" - wlan_path=/sys/devices/`uci get wireless.${r}.path` - wlan_path=`find ${wlan_path} -name wlan* | tail -n 1` - local mac=`cat ${wlan_path}/address` - - local dev_path=/sys/devices/`uci get wireless.${r}.path` - - if [ -e "${dev_path}/../idVendor" -a -e "${dev_path}/../idProduct" ]; then - idVendor=`cat ${dev_path}/../idVendor` - idProduct=`cat ${dev_path}/../idProduct` - if [ "x${idVendor}:${idProduct}" = "x0bda:c811" ]; then - chip="rtl8821cu" - touch ${FE_DIR}/first_insert_${chip} # for /etc/hotplug.d/usb/31-usb_wifi - fi - fi - - if [ -e "${dev_path}/vendor" -a -e "${dev_path}/device" ]; then - idVendor=`cat ${dev_path}/vendor` - idProduct=`cat ${dev_path}/device` - - # enable 5g wifi-ap (t4) - if [ "x${idVendor}:${idProduct}" = "x0x02d0:0x4356" ]; then - uci set wireless.${r}.hwmode='11a' - uci set wireless.${r}.channel='153' - fi - - # r2 - if [ "x${idVendor}:${idProduct}" = "x0x02d0:0xa9bf" ]; then - uci set wireless.${r}.hwmode='11a' - uci set wireless.${r}.channel='153' - fi - fi - - uci set wireless.${r}.disabled=0 - if [ -n "${chip}" ];then - uci set wireless.default_${r}.ssid=${chip}-${mac} - else - uci set wireless.default_${r}.ssid=FriendlyWrt-${mac} - fi - uci set wireless.default_${r}.encryption=psk2 - uci set wireless.default_${r}.key=password - uci commit -} - -FE_DIR=/root/.friendlyelec/ -mkdir -p ${FE_DIR} -TAG=friendlyelec -logger "${TAG}: /root/setup.sh running" - -VENDOR=$(cat /tmp/sysinfo/board_name | cut -d , -f1) -BOARD=$(cat /tmp/sysinfo/board_name | cut -d , -f2) -if [ x${VENDOR} != x"friendlyelec" ]; then - if [ x${VENDOR} != x"friendlyarm" ]; then - logger "only support friendlyelec boards. exiting..." - exit 0 - fi -fi - -if [ -f /sys/class/sunxi_info/sys_info ]; then - SUNXI_BOARD=`grep "board_name" /sys/class/sunxi_info/sys_info` - SUNXI_BOARD=${SUNXI_BOARD#*FriendlyElec } - - logger "${TAG}: init for ${SUNXI_BOARD}" - if ls /root/board/${SUNXI_BOARD}/* >/dev/null 2>&1; then - cp -rf /root/board/${SUNXI_BOARD}/* / - fi -fi - -WIFI_NUM=`find /sys/class/net/ -name wlan* | wc -l` -if [ ${WIFI_NUM} -gt 0 ]; then - # update /etc/config/wireless - for i in `seq 0 ${WIFI_NUM}`; do - setup_ssid radio${i} - done -fi - -/etc/init.d/led restart -/etc/init.d/network restart -/etc/init.d/dnsmasq restart - -logger "done" diff --git a/target/linux/sunxi/patches-4.14/230-ARM-dts-friendlyelec-nanopi-r1s-h5.patch b/target/linux/sunxi/patches-4.14/230-ARM-dts-friendlyelec-nanopi-r1s-h5.patch deleted file mode 100644 index 981a01a601..0000000000 --- a/target/linux/sunxi/patches-4.14/230-ARM-dts-friendlyelec-nanopi-r1s-h5.patch +++ /dev/null @@ -1,245 +0,0 @@ ---- a/arch/arm64/boot/dts/allwinner/Makefile 2019-12-22 13:59:07.075152708 +0800 -+++ b/arch/arm64/boot/dts/allwinner/Makefile 2019-12-22 14:03:57.208779217 +0800 -@@ -11,6 +11,7 @@ - dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus2.dtb - dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo2.dtb - dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo-plus2.dtb -+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-r1s.dtb - - always := $(dtb-y) - subdir-y := $(dts-dirs) ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s.dts 2019-12-22 14:04:36.978610138 +0800 -@@ -0,0 +1,232 @@ -+/* -+ * Copyright (C) 2017 Icenowy Zheng -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/dts-v1/; -+#include "sun50i-h5.dtsi" -+ -+#include -+#include -+#include -+#include -+/ { -+ model = "FriendlyElec NanoPi-R1S-H5"; -+ compatible = "friendlyelec,nanopi-r1s-h5", "allwinner,sun50i-h5"; -+ -+ aliases { -+ ethernet0 = &emac; -+ serial0 = &uart0; -+ }; -+ -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+ -+ wifi_pwrseq: wifi_pwrseq { -+ compatible = "mmc-pwrseq-simple"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&wifi_en_npi>; -+ reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */ -+ post-power-on-delay-ms = <200>; -+ }; -+ -+ r-gpio-keys { -+ compatible = "gpio-keys"; -+ -+ k1@0 { -+ label = "k1"; -+ linux,code = ; -+ gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ -+ status { -+ label = "status_led"; -+ gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>; -+ linux,default-trigger = "heartbeat"; -+ }; -+ -+ led2 { -+ label = "LED2"; -+ gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; -+ default-state = "off"; -+ linux,default-trigger = "netdev"; -+ }; -+ -+ led3 { -+ label = "LED3"; -+ gpios = <&pio 0 9 GPIO_ACTIVE_HIGH>; -+ default-state = "off"; -+ linux,default-trigger = "netdev"; -+ }; -+ }; -+ -+ 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>; -+ }; -+ -+ reg_vcc3v3: vcc3v3 { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc3v3"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ }; -+ -+ reg_usb0_vbus: usb0-vbus { -+ compatible = "regulator-fixed"; -+ regulator-name = "usb0-vbus"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ enable-active-high; -+ gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */ -+ status = "okay"; -+ }; -+}; -+ -+ -+ -+ -+&ehci0 { -+ status = "okay"; -+}; -+ -+&ohci0 { -+ status = "okay"; -+}; -+ -+&ehci1 { -+ status = "okay"; -+}; -+ -+&ohci1 { -+ status = "okay"; -+}; -+ -+&ehci2 { -+ status = "okay"; -+}; -+ -+&ohci2 { -+ status = "okay"; -+}; -+ -+&ehci3 { -+ status = "okay"; -+}; -+ -+&ohci3 { -+ status = "okay"; -+}; -+ -+&emac { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&emac_rgmii_pins>; -+ phy-supply = <®_gmac_3v3>; -+ phy-handle = <&ext_rgmii_phy>; -+ phy-mode = "rgmii"; -+ status = "okay"; -+}; -+ -+&external_mdio { -+ ext_rgmii_phy: ethernet-phy@7 { -+ compatible = "ethernet-phy-ieee802.3-c22"; -+ reg = <7>; -+ }; -+}; -+ -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>; -+ vmmc-supply = <®_vcc3v3>; -+ bus-width = <4>; -+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ -+ status = "okay"; -+}; -+ -+&mmc1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc1_pins_a>; -+ vmmc-supply = <®_vcc3v3>; -+ vqmmc-supply = <®_vcc3v3>; -+ mmc-pwrseq = <&wifi_pwrseq>; -+ bus-width = <4>; -+ non-removable; -+ status = "okay"; -+}; -+&r_pio { -+ wifi_en_npi: wifi_en_pin { -+ pins = "PL7"; -+ function = "gpio_out"; -+ }; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "okay"; -+}; -+ -+&usb_otg { -+ dr_mode = "peripheral"; -+ status = "okay"; -+}; -+®_usb0_vbus { -+ gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */ -+ status = "okay"; -+}; -+ -+&usbphy { -+ /* USB Type-A port's VBUS is always on */ -+ usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */ -+ usb0_vbus-supply = <®_usb0_vbus>; -+ status = "okay"; -+}; -+