This commit is contained in:
coolsnowwolf 2020-07-20 13:46:06 +08:00
commit 7fdf770ca0
44 changed files with 1264 additions and 217 deletions

3
.gitignore vendored
View File

@ -25,4 +25,5 @@ key-build*
.emacs.desktop*
TAGS*~
git-src
.git-credentials
.git-credentials
/*.log

View File

@ -310,6 +310,13 @@ define Build/openmesh-image
"$(call param_get_default,rootfs,$(1),$@)" "rootfs"
endef
define Build/qsdk-ipq-factory-mmc
$(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh \
$@.its kernel $(IMAGE_KERNEL) rootfs $(IMAGE_ROOTFS)
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
@mv $@.new $@
endef
define Build/qsdk-ipq-factory-nand
$(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh \
$@.its ubi $@

View File

@ -21,8 +21,8 @@ config openvpn 'myvpn'
option verb '3'
option status '/var/log/openvpn_status.log'
option log '/tmp/openvpn.log'
list push 'route 192.168.0.0 255.255.255.0'
list push 'route 192.168.1.0 255.255.255.0'
list push 'comp-lzo adaptive'
list push 'redirect-gateway def1 bypass-dhcp'
list push 'dhcp-option DNS 192.168.0.1'
list push 'dhcp-option DNS 192.168.1.1'

View File

@ -2,7 +2,7 @@
ddns=`uci get openvpn.myvpn.ddns`
port=`uci get openvpn.myvpn.port`
proto=`uci get openvpn.myvpn.proto`
proto=`uci get openvpn.myvpn.proto|sed -e 's/server/client/g'`
cat > /tmp/my.ovpn <<EOF
client
@ -13,7 +13,7 @@ resolv-retry infinite
nobind
persist-key
persist-tun
verb 3"
verb 3
EOF
echo '<ca>' >> /tmp/my.ovpn
cat /etc/openvpn/ca.crt >> /tmp/my.ovpn

View File

@ -1,9 +1 @@
http-proxy-option EXT1 "POST http://rd.go.10086.cn"
http-proxy-option EXT1 "GET http://rd.go.10086.cn"
http-proxy-option EXT1 "X-Online-Host: rd.go.10086.cn"
http-proxy-option EXT1 "POST http://rd.go.10086.cn"
http-proxy-option EXT1 "X-Online-Host: rd.go.10086.cn"
http-proxy-option EXT1 "POST http://rd.go.10086.cn"
http-proxy-option EXT1 "Host: rd.go.10086.cn"
http-proxy-option EXT1 "GET http://rd.go.10086.cn"
http-proxy-option EXT1 "Host: rd.go.10086.cn"
comp-lzo

View File

@ -1,5 +1,8 @@
#!/bin/sh
openvpn_port="$(uci -q get openvpn.myvpn.port)"
[ -z "$openvpn_port" ] && openvpn_port=1194
uci -q batch <<-EOF >/dev/null
delete network.vpn0
set network.vpn0=interface
@ -14,7 +17,7 @@ uci -q batch <<-EOF >/dev/null
set firewall.openvpn.target='ACCEPT'
set firewall.openvpn.src='wan'
set firewall.openvpn.proto='tcp udp'
set firewall.openvpn.dest_port='1194'
set firewall.openvpn.dest_port="$openvpn_port"
delete firewall.vpn
set firewall.vpn=zone

View File

@ -192,7 +192,7 @@ start()
else
kill -9 $(busybox ps -w | grep 'sleep 60m' | grep -v grep | awk '{print $1}') >/dev/null 2>&1
/usr/bin/UnblockNeteaseMusicCloud >/dev/null 2>&1 &
echo "$(date -R) # UnblockNeteaseMusic Cloud Version - Server: $cloudip (http:$cloudhttp, https:$cloudhttp)" >>/tmp/unblockmusic.log
echo "$(date -R) # UnblockNeteaseMusic Cloud Version - Server: $cloudip (http:$cloudhttp, https:$cloudhttps)" >>/tmp/unblockmusic.log
fi
set_firewall

108
package/lean/wget/Makefile Normal file
View File

@ -0,0 +1,108 @@
#
# Copyright (C) 2007-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=wget
PKG_VERSION:=1.20.3
PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
PKG_HASH:=31cccfc6630528db1c8e3a06f6decf2a370060b982841cfab2b8677400a5092e
PKG_MAINTAINER:=Peter Wagner <tripolar@gmx.at>
PKG_LICENSE:=GPL-3.0-or-later
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:gnu:wget
include $(INCLUDE_DIR)/package.mk
define Package/wget/Default
SECTION:=net
CATEGORY:=Network
DEPENDS:=+libpcre +zlib
SUBMENU:=File Transfer
TITLE:=Non-interactive network downloader
URL:=https://www.gnu.org/software/wget/index.html
PROVIDES:=gnu-wget
endef
define Package/wget/Default/description
Wget is a network utility to retrieve files from the Web using http
and ftp, the two most widely used Internet protocols. It works
non-interactively, so it will work in the background, after having
logged off. The program supports recursive retrieval of web-authoring
pages as well as ftp sites -- you can use wget to make mirrors of
archives and home pages or to travel the Web like a WWW robot.
endef
define Package/wget
$(call Package/wget/Default)
DEPENDS+= +libopenssl +librt
TITLE+= (with SSL support)
VARIANT:=ssl
PROVIDES+=wget-ssl
ALTERNATIVES:=300:/usr/bin/wget:/usr/bin/wget-ssl
endef
define Package/wget/description
$(call Package/wget/Default/description)
This package is built with SSL support.
endef
define Package/wget-nossl
$(call Package/wget/Default)
TITLE+= (without SSL support)
VARIANT:=nossl
PROVIDES+=wget
ALTERNATIVES:=300:/usr/bin/wget:/usr/bin/wget-nossl
endef
define Package/wget-nossl/description
$(call Package/wget/Default/description)
This package is built without SSL support.
endef
CONFIGURE_ARGS+= \
--disable-rpath \
--disable-iri \
--disable-pcre2 \
--with-included-libunistring \
--without-libuuid \
--without-libpsl
CONFIGURE_VARS += \
ac_cv_header_uuid_uuid_h=no
ifeq ($(BUILD_VARIANT),ssl)
CONFIGURE_ARGS+= \
--with-ssl=openssl \
--with-libssl-prefix="$(STAGING_DIR)/usr"
CONFIGURE_VARS += \
ac_cv_libssl=yes
endif
ifeq ($(BUILD_VARIANT),nossl)
CONFIGURE_ARGS+= \
--disable-ntlm \
--without-ssl
endif
define Package/wget/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/wget $(1)/usr/bin/wget-ssl
endef
define Package/wget-nossl/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/wget $(1)/usr/bin/wget-nossl
endef
$(eval $(call BuildPackage,wget))
$(eval $(call BuildPackage,wget-nossl))

View File

@ -0,0 +1,11 @@
--- a/src/init.c 2020-07-11 21:55:28.055428530 +0800
+++ b/src/init.c 2020-07-11 21:58:08.698565761 +0800
@@ -412,7 +412,7 @@ defaults (void)
tmp = getenv ("no_proxy");
if (tmp)
opt.no_proxy = sepstring (tmp);
- opt.prefer_family = prefer_none;
+ opt.prefer_family = prefer_ipv4;
opt.allow_cache = true;
opt.if_modified_since = true;

View File

@ -11,12 +11,12 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=wireguard
PKG_VERSION:=1.0.20200623
PKG_VERSION:=1.0.20200712
PKG_RELEASE:=1
PKG_SOURCE:=wireguard-linux-compat-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://git.zx2c4.com/wireguard-linux-compat/snapshot/
PKG_HASH:=130937724515799edf05ff8216bc837df8acda879428f3a7f96a3287758f9445
PKG_HASH:=e15b3d4eb2cf186920a6ed13685187d6b846e59eb383c291913628682965ac95
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING

View File

@ -156,7 +156,7 @@
+
+config SHORTCUT_FE
+ bool "Enables kernel network stack path for Shortcut Forwarding Engine
+ default y
+
--- a/net/netfilter/nf_conntrack_proto_tcp.c 2020-06-23 11:43:45.404018000 -0700
+++ b/net/netfilter/nf_conntrack_proto_tcp.c 2020-06-27 18:28:24.610214943 -0700

View File

@ -20,7 +20,7 @@ DEFAULT_PACKAGES += \
kmod-ata-ahci kmod-ata-ahci-platform \
kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \
kmod-usb-phy-qcom-dwc3 kmod-usb3 kmod-usb-dwc3-qcom \
kmod-ath10k-ct wpad-basic \
kmod-ath10k-ct wpad-openssl \
uboot-envtools
$(eval $(call BuildTarget))

View File

@ -48,6 +48,13 @@ qcom,ipq8064-db149)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "6u@eth1" "5:wan" "0u@eth0"
;;
ruijie,rg-mtfi-m520)
hw_mac_addr=$(mtd_get_mac_ascii PRODUCTINFO ethaddr)
ucidef_add_switch "switch0" \
"1:lan" "6@eth1" "5:wan" "0@eth0"
ucidef_set_interface_macaddr "wan" "$hw_mac_addr"
ucidef_set_interface_macaddr "lan" "$(macaddr_add $hw_mac_addr 1)"
;;
zyxel,nbg6817)
hw_mac_addr=$(mtd_get_mac_ascii 0:APPSBLENV ethaddr)
ucidef_add_switch "switch0" \

View File

@ -7,6 +7,22 @@
board=$(board_name)
case "$FIRMWARE" in
"ath10k/cal-pci-0000:01:00.0.bin")
case "$board" in
ruijie,rg-mtfi-m520)
caldata_extract "ART" 0x1000 0x844
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii PRODUCTINFO ethaddr) +2)
;;
esac
;;
"ath10k/cal-pci-0001:01:00.0.bin")
case "$board" in
ruijie,rg-mtfi-m520)
caldata_extract "ART" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii PRODUCTINFO ethaddr) +3)
;;
esac
;;
"ath10k/pre-cal-pci-0000:01:00.0.bin")
case $board in
buffalo,wxr-2533dhp)

View File

@ -0,0 +1,15 @@
#!/bin/sh
. /lib/functions.sh
preinit_set_mac_address() {
case $(board_name) in
ruijie,rg-mtfi-m520)
base_mac=$(mtd_get_mac_ascii PRODUCTINFO ethaddr)
ip link set dev eth0 address $(macaddr_add "$base_mac" +1)
ip link set dev eth1 address $(macaddr_add "$base_mac" +2)
;;
esac
}
boot_hook_add preinit_main preinit_set_mac_address

View File

@ -30,6 +30,9 @@ platform_do_upgrade() {
linksys,ea8500)
platform_do_upgrade_linksys "$1"
;;
ruijie,rg-mtfi-m520)
ruijie_do_upgrade "$1"
;;
tplink,c2600)
PART_NAME="os-image:rootfs"
MTD_CONFIG_ARGS="-s 0x200000"

View File

@ -0,0 +1,54 @@
#
# Copyright (C) 2016 lede-project.org
#
ruijie_do_flash() {
local tar_file=$1
local kernel=$2
local rootfs=$3
# keep sure its unbound
losetup --detach-all || {
echo Failed to detach all loop devices. Skip this try.
reboot -f
}
# use the first found directory in the tar archive
local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$')
board_dir=${board_dir%/}
echo "flashing kernel to $kernel"
tar xf $tar_file ${board_dir}/kernel -O > $kernel
echo "flashing rootfs to $rootfs"
tar xf $tar_file ${board_dir}/root -O > $rootfs
# Cleanup
losetup -d /dev/loop0 >/dev/null 2>&1
sync
umount -a
reboot -f
}
ruijie_do_upgrade() {
local tar_file="$1"
local board=$(board_name)
local kernel=
local rootfs=
case "$board" in
ruijie,rg-mtfi-m520)
kernel="/dev/mmcblk0p2"
rootfs="/dev/mmcblk0p3"
;;
*)
return 1
;;
esac
ruijie_do_flash $tar_file $kernel $rootfs
nand_do_upgrade "$1"
return 0
}

View File

@ -0,0 +1,388 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qcom-ipq8064-v2.0.dtsi"
#include <dt-bindings/input/input.h>
/ {
model = "Ruijie RG-MTFi-M520";
compatible = "ruijie,rg-mtfi-m520", "qcom,ipq8064";
memory@0 {
reg = <0x42000000 0x7e000000>;
device_type = "memory";
};
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;
rsvd@41200000 {
reg = <0x41200000 0x300000>;
no-map;
};
};
aliases {
serial0 = &gsbi4_serial;
mdio-gpio0 = &mdio0;
sdcc1 = &sdcc1;
};
chosen {
bootargs = "root=/dev/mmcblk0p3 rootfstype=squashfs,ext4 rootwait noinitrd";
stdout-path = "serial0:115200n8";
};
cpus {
idle-states {
CPU_SPC: spc {
status = "disabled";
};
};
};
soc {
pinmux@800000 {
button_pins: button_pins {
mux {
pins = "gpio54";
function = "gpio";
drive-strength = <2>;
bias-pull-up;
};
};
i2c4_pins: i2c4_pinmux {
mux {
pins = "gpio12", "gpio13";
function = "gsbi4";
drive-strength = <12>;
bias-disable;
};
};
led_pins: led_pins {
mux {
pins = "gpio7", "gpio8", "gpio9", "gpio53";
function = "gpio";
drive-strength = <2>;
bias-pull-down;
};
};
mdio0_pins: mdio0_pins {
mux {
pins = "gpio0", "gpio1";
function = "gpio";
drive-strength = <8>;
bias-disable;
};
clk {
pins = "gpio1";
input-disable;
};
};
rgmii2_pins: rgmii2_pins {
mux {
pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32",
"gpio51", "gpio52", "gpio59", "gpio60", "gpio61", "gpio62";
function = "rgmii2";
drive-strength = <8>;
bias-disable;
};
tx {
pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32";
input-disable;
};
};
sdcc1_pins: sdcc1_pinmux {
mux {
pins = "gpio38", "gpio39", "gpio40", "gpio41", "gpio42",
"gpio43", "gpio44", "gpio45", "gpio46", "gpio47";
function = "sdc1";
};
cmd {
pins = "gpio45";
drive-strength = <10>;
bias-pull-up;
};
data {
pins = "gpio38", "gpio39", "gpio40", "gpio41",
"gpio43", "gpio44", "gpio46", "gpio47";
drive-strength = <10>;
bias-pull-up;
};
clk {
pins = "gpio42";
drive-strength = <16>;
bias-disable;
};
};
spi_pins: spi_pins {
mux {
pins = "gpio18", "gpio19", "gpio21";
function = "gsbi5";
drive-strength = <10>;
bias-none;
};
cs {
pins = "gpio20";
drive-strength = <12>;
};
};
};
gsbi2: gsbi@12480000 {
qcom,mode = <GSBI_PROT_I2C_UART>;
status = "okay";
i2c@124a0000 {
status = "okay";
lm75@48 {
status = "okay";
compatible = "lm75";
reg = <0x48>;
};
pcf8563: rtc@51 {
status = "okay";
compatible = "nxp,pcf8563";
reg = <0x51>;
};
tca9539@74 {
status = "okay";
compatible = "ti,tca9539";
reg = <0x74>;
};
};
};
gsbi@16300000 {
qcom,mode = <GSBI_PROT_I2C_UART>;
status = "okay";
serial@16340000 {
status = "okay";
};
/*
* The i2c device on gsbi4 should not be enabled.
* On ipq806x designs gsbi4 i2c is meant for exclusive
* RPM usage. Turning this on in kernel manifests as
* i2c failure for the RPM.
*/
};
gsbi5: gsbi@1a200000 {
qcom,mode = <GSBI_PROT_SPI>;
status = "okay";
spi4: spi@1a280000 {
status = "okay";
pinctrl-0 = <&spi_pins>;
pinctrl-names = "default";
cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
flash: m25p80@0 {
compatible = "s25fl256s1";
#address-cells = <1>;
#size-cells = <1>;
spi-max-frequency = <50000000>;
reg = <0>;
SBL1@0 {
label = "SBL1";
reg = <0x0 0x10000>;
read-only;
};
MIBIB@10000 {
label = "MIBIB";
reg = <0x10000 0x10000>;
read-only;
};
SBL2@20000 {
label = "SBL2";
reg = <0x20000 0x20000>;
read-only;
};
SBL3@40000 {
label = "SBL3";
reg = <0x40000 0x30000>;
read-only;
};
DDRCONFIG@70000 {
label = "DDRCONFIG";
reg = <0x70000 0x10000>;
read-only;
};
PRODUCTINFO@80000 {
label = "PRODUCTINFO";
reg = <0x80000 0x10000>;
read-only;
};
TZ@90000 {
label = "TZ";
reg = <0x90000 0x30000>;
read-only;
};
RPM@c0000 {
label = "RPM";
reg = <0xc0000 0x20000>;
read-only;
};
APPSBL@e0000 {
label = "APPSBL";
reg = <0xe0000 0x80000>;
read-only;
};
APPSBLENV@160000 {
label = "APPSBLENV";
reg = <0x160000 0x10000>;
read-only;
};
BOOTCONFIG@170000 {
label = "BOOTCONFIG";
reg = <0x170000 0x10000>;
read-only;
};
ART@180000 {
label = "ART";
reg = <0x180000 0x40000>;
read-only;
};
};
};
};
sata-phy@1b400000 {
status = "okay";
};
sata@29000000 {
ports-implemented = <0x1>;
status = "okay";
};
usb3_0: usb3@110f8800 {
status = "okay";
};
usb3_1: usb3@100f8800 {
status = "okay";
};
pcie0: pci@1b500000 {
status = "okay";
reset-gpio = <&qcom_pinmux 3 GPIO_ACTIVE_LOW>;
pinctrl-0 = <&pcie0_pins>;
pinctrl-names = "default";
};
pcie1: pci@1b700000 {
status = "okay";
reset-gpio = <&qcom_pinmux 48 GPIO_ACTIVE_LOW>;
pinctrl-0 = <&pcie1_pins>;
pinctrl-names = "default";
force_gen1 = <1>;
};
mdio0: mdio {
compatible = "virtual,mdio-gpio";
#address-cells = <1>;
#size-cells = <0>;
gpios = <&qcom_pinmux 1 GPIO_ACTIVE_HIGH>,
<&qcom_pinmux 0 GPIO_ACTIVE_HIGH>;
pinctrl-0 = <&mdio0_pins>;
pinctrl-names = "default";
phy0: ethernet-phy@0 {
reg = <0>;
qca,ar8327-initvals = <
0x00004 0x7600000 /* PAD0_MODE */
0x00008 0x1000000 /* PAD5_MODE */
0x0000c 0x80 /* PAD6_MODE */
0x000e4 0x6a545 /* MAC_POWER_SEL */
0x000e0 0xc74164de /* SGMII_CTRL */
0x0007c 0x4e /* PORT0_STATUS */
0x00094 0x4e /* PORT6_STATUS */
>;
};
phy4: ethernet-phy@4 {
reg = <4>;
};
};
gmac1: ethernet@37200000 {
status = "okay";
phy-mode = "rgmii";
qcom,id = <1>;
pinctrl-0 = <&rgmii2_pins>;
pinctrl-names = "default";
fixed-link {
speed = <1000>;
full-duplex;
};
};
gmac2: ethernet@37400000 {
status = "okay";
phy-mode = "sgmii";
qcom,id = <2>;
fixed-link {
speed = <1000>;
full-duplex;
};
};
amba {
sdcc1: sdcc@12400000 {
status = "okay";
pinctrl-0 = <&sdcc1_pins>;
pinctrl-names = "default";
};
};
};
keys {
compatible = "gpio-keys";
pinctrl-0 = <&button_pins>;
pinctrl-names = "default";
reset {
label = "reset";
gpios = <&qcom_pinmux 54 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
};
&adm_dma {
status = "okay";
};

View File

@ -0,0 +1,382 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qcom-ipq8064-v2.0.dtsi"
#include <dt-bindings/input/input.h>
/ {
model = "Ruijie RG-MTFi-M520";
compatible = "ruijie,rg-mtfi-m520", "qcom,ipq8064";
memory@0 {
reg = <0x42000000 0x7e000000>;
device_type = "memory";
};
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;
rsvd@41200000 {
reg = <0x41200000 0x300000>;
no-map;
};
};
aliases {
serial0 = &gsbi4_serial;
mdio-gpio0 = &mdio0;
sdcc1 = &sdcc1;
};
chosen {
bootargs = "root=/dev/mmcblk0p3 rootfstype=squashfs,ext4 rootwait noinitrd";
stdout-path = "serial0:115200n8";
};
cpus {
idle-states {
CPU_SPC: spc {
status = "disabled";
};
};
};
keys {
compatible = "gpio-keys";
pinctrl-0 = <&button_pins>;
pinctrl-names = "default";
reset {
label = "reset";
gpios = <&qcom_pinmux 54 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
};
&qcom_pinmux {
button_pins: button_pins {
mux {
pins = "gpio54";
function = "gpio";
drive-strength = <2>;
bias-pull-up;
};
};
i2c4_pins: i2c4_pinmux {
mux {
pins = "gpio12", "gpio13";
function = "gsbi4";
drive-strength = <12>;
bias-disable;
};
};
led_pins: led_pins {
mux {
pins = "gpio7", "gpio8", "gpio9", "gpio53";
function = "gpio";
drive-strength = <2>;
bias-pull-down;
};
};
mdio0_pins: mdio0_pins {
mux {
pins = "gpio0", "gpio1";
function = "mdio";
drive-strength = <8>;
bias-disable;
};
clk {
pins = "gpio1";
input-disable;
};
};
rgmii2_pins: rgmii2_pins {
mux {
pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32",
"gpio51", "gpio52", "gpio59", "gpio60", "gpio61", "gpio62";
function = "rgmii2";
drive-strength = <8>;
bias-disable;
};
tx {
pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32";
input-disable;
};
};
sdcc1_pins: sdcc1_pinmux {
mux {
pins = "gpio38", "gpio39", "gpio40", "gpio41", "gpio42",
"gpio43", "gpio44", "gpio45", "gpio46", "gpio47";
function = "sdc1";
};
cmd {
pins = "gpio45";
drive-strength = <10>;
bias-pull-up;
};
data {
pins = "gpio38", "gpio39", "gpio40", "gpio41",
"gpio43", "gpio44", "gpio46", "gpio47";
drive-strength = <10>;
bias-pull-up;
};
clk {
pins = "gpio42";
drive-strength = <16>;
bias-disable;
};
};
spi_pins: spi_pins {
mux {
pins = "gpio18", "gpio19", "gpio21";
function = "gsbi5";
drive-strength = <10>;
bias-none;
};
cs {
pins = "gpio20";
drive-strength = <12>;
};
};
};
&gsbi2 {
qcom,mode = <GSBI_PROT_I2C_UART>;
status = "okay";
i2c@124a0000 {
status = "okay";
lm75@48 {
status = "okay";
compatible = "lm75";
reg = <0x48>;
};
pcf8563: rtc@51 {
status = "okay";
compatible = "nxp,pcf8563";
reg = <0x51>;
};
tca9539@74 {
status = "okay";
compatible = "ti,tca9539";
reg = <0x74>;
};
};
};
&gsbi4 {
qcom,mode = <GSBI_PROT_I2C_UART>;
status = "okay";
serial@16340000 {
status = "okay";
};
/*
* The i2c device on gsbi4 should not be enabled.
* On ipq806x designs gsbi4 i2c is meant for exclusive
* RPM usage. Turning this on in kernel manifests as
* i2c failure for the RPM.
*/
};
&gsbi5 {
qcom,mode = <GSBI_PROT_SPI>;
status = "okay";
spi4: spi@1a280000 {
status = "okay";
pinctrl-0 = <&spi_pins>;
pinctrl-names = "default";
cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
m25p80@0 {
compatible = "s25fl256s1";
#address-cells = <1>;
#size-cells = <1>;
spi-max-frequency = <50000000>;
reg = <0>;
SBL1@0 {
label = "SBL1";
reg = <0x0 0x10000>;
read-only;
};
MIBIB@10000 {
label = "MIBIB";
reg = <0x10000 0x10000>;
read-only;
};
SBL2@20000 {
label = "SBL2";
reg = <0x20000 0x20000>;
read-only;
};
SBL3@40000 {
label = "SBL3";
reg = <0x40000 0x30000>;
read-only;
};
DDRCONFIG@70000 {
label = "DDRCONFIG";
reg = <0x70000 0x10000>;
read-only;
};
PRODUCTINFO@80000 {
label = "PRODUCTINFO";
reg = <0x80000 0x10000>;
read-only;
};
TZ@90000 {
label = "TZ";
reg = <0x90000 0x30000>;
read-only;
};
RPM@c0000 {
label = "RPM";
reg = <0xc0000 0x20000>;
read-only;
};
APPSBL@e0000 {
label = "APPSBL";
reg = <0xe0000 0x80000>;
read-only;
};
APPSBLENV@160000 {
label = "APPSBLENV";
reg = <0x160000 0x10000>;
read-only;
};
BOOTCONFIG@170000 {
label = "BOOTCONFIG";
reg = <0x170000 0x10000>;
read-only;
};
ART@180000 {
label = "ART";
reg = <0x180000 0x40000>;
read-only;
};
};
};
};
&sata_phy {
status = "okay";
};
&sata {
ports-implemented = <0x1>;
status = "okay";
};
&usb3_0 {
status = "okay";
};
&usb3_1 {
status = "okay";
};
&pcie0 {
status = "okay";
reset-gpio = <&qcom_pinmux 3 GPIO_ACTIVE_HIGH>;
/delete-property/ perst-gpios;
};
&pcie1 {
status = "okay";
reset-gpio = <&qcom_pinmux 48 GPIO_ACTIVE_HIGH>;
/delete-property/ perst-gpios;
};
&mdio0 {
status = "okay";
pinctrl-0 = <&mdio0_pins>;
pinctrl-names = "default";
phy0: ethernet-phy@0 {
reg = <0>;
qca,ar8327-initvals = <
0x00004 0x7600000 /* PAD0_MODE */
0x00008 0x1000000 /* PAD5_MODE */
0x0000c 0x80 /* PAD6_MODE */
0x000e4 0x6a545 /* MAC_POWER_SEL */
0x000e0 0xc74164de /* SGMII_CTRL */
0x0007c 0x4e /* PORT0_STATUS */
0x00094 0x4e /* PORT6_STATUS */
>;
};
phy4: ethernet-phy@4 {
reg = <4>;
};
};
&gmac1 {
status = "okay";
phy-mode = "rgmii";
qcom,id = <1>;
pinctrl-0 = <&rgmii2_pins>;
pinctrl-names = "default";
fixed-link {
speed = <1000>;
full-duplex;
};
};
&gmac2 {
status = "okay";
phy-mode = "sgmii";
qcom,id = <2>;
fixed-link {
speed = <1000>;
full-duplex;
};
};
&amba {
sdcc1: sdcc@12400000 {
status = "okay";
pinctrl-0 = <&sdcc1_pins>;
pinctrl-names = "default";
};
};
&adm_dma {
status = "okay";
};

View File

@ -265,6 +265,26 @@ define Device/qcom_ipq8064-db149
endef
TARGET_DEVICES += qcom_ipq8064-db149
define Device/ruijie_rg-mtfi-m520
DEVICE_VENDOR := Ruijie
DEVICE_MODEL := RG-MTFi-M520
SOC := qcom-ipq8064
KERNEL_SIZE := 4096k
BLOCKSIZE := 64k
BOARD_NAME := rg-mtfi-m520
KERNEL_SUFFIX := -uImage
KERNEL = kernel-bin | append-dtb | uImage none | pad-to $${KERNEL_SIZE}
KERNEL_NAME := zImage
IMAGES := factory.bin sysupgrade.bin mmcblk0p2-kernel.bin mmcblk0p3-rootfs.bin
IMAGE/factory.bin := qsdk-ipq-factory-mmc
IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to $$$${BLOCKSIZE} | sysupgrade-tar rootfs=$$$$@ | append-metadata
IMAGE/mmcblk0p2-kernel.bin := append-kernel | pad-to $$$${KERNEL_SIZE}
IMAGE/mmcblk0p3-rootfs.bin := append-rootfs | pad-rootfs
DEVICE_PACKAGES := ath10k-firmware-qca988x-ct e2fsprogs f2fs-tools \
kmod-gpio-pca953x kmod-hwmon-lm75 kmod-fs-ext4 kmod-fs-f2fs kmod-rtc-pcf8563 losetup
endef
TARGET_DEVICES += ruijie_rg-mtfi-m520
define Device/tplink_c2600
$(call Device/TpSafeImage)
DEVICE_VENDOR := TP-Link

View File

@ -10,7 +10,7 @@ Signed-off-by: John Crispin <john@phrozen.org>
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -791,6 +791,18 @@ dtb-$(CONFIG_ARCH_QCOM) += \
@@ -791,6 +791,19 @@ dtb-$(CONFIG_ARCH_QCOM) += \
qcom-ipq4019-ap.dk07.1-c1.dtb \
qcom-ipq4019-ap.dk07.1-c2.dtb \
qcom-ipq8064-ap148.dtb \
@ -21,6 +21,7 @@ Signed-off-by: John Crispin <john@phrozen.org>
+ qcom-ipq8064-ea8500.dtb \
+ qcom-ipq8064-r7500.dtb \
+ qcom-ipq8064-r7500v2.dtb \
+ qcom-ipq8064-rg-mtfi-m520.dtb \
+ qcom-ipq8064-wg2600hp.dtb \
+ qcom-ipq8064-wpq864.dtb \
+ qcom-ipq8064-wxr-2533dhp.dtb \

View File

@ -10,7 +10,7 @@ Signed-off-by: John Crispin <john@phrozen.org>
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -843,6 +843,18 @@ dtb-$(CONFIG_ARCH_QCOM) += \
@@ -843,6 +843,19 @@ dtb-$(CONFIG_ARCH_QCOM) += \
qcom-ipq4019-ap.dk07.1-c1.dtb \
qcom-ipq4019-ap.dk07.1-c2.dtb \
qcom-ipq8064-ap148.dtb \
@ -21,6 +21,7 @@ Signed-off-by: John Crispin <john@phrozen.org>
+ qcom-ipq8064-ea8500.dtb \
+ qcom-ipq8064-r7500.dtb \
+ qcom-ipq8064-r7500v2.dtb \
+ qcom-ipq8064-rg-mtfi-m520.dtb \
+ qcom-ipq8064-wg2600hp.dtb \
+ qcom-ipq8064-wpq864.dtb \
+ qcom-ipq8064-wxr-2533dhp.dtb \

View File

@ -20,6 +20,6 @@ define Target/Description
endef
include $(INCLUDE_DIR)/target.mk
DEFAULT_PACKAGES += kmod-leds-gpio kmod-gpio-button-hotplug
DEFAULT_PACKAGES += kmod-leds-gpio kmod-gpio-button-hotplug -luci-app-sfe luci-app-flowoffload
$(eval $(call BuildTarget))

View File

@ -458,6 +458,9 @@
mediatek,ethsys = <&ethsys>;
pinctrl-names = "default";
pinctrl-0 = <&rgmii1_pins &mdio_pins>;
gmac0: mac@0 {
compatible = "mediatek,eth-mac";
reg = <0>;

View File

@ -14,7 +14,7 @@
led-failsafe = &led_power_blue;
led-running = &led_power_blue;
led-upgrade = &led_power_blue;
label-mac-device = &gmac0;
label-mac-device = &ethernet;
};
chosen {
@ -150,38 +150,19 @@
};
};
&gmac0 {
&ethernet {
compatible = "mediatek,ralink-mt7621-eth";
mediatek,switch = <&gsw>;
mtd-mac-address = <&factory 0xe000>;
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "lan4";
};
/delete-property/ compatible;
phy-mode = "rgmii";
};
port@1 {
status = "okay";
label = "lan3";
};
port@2 {
status = "okay";
label = "lan2";
};
port@3 {
status = "okay";
label = "lan1";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
};
};
&gsw {
compatible = "mediatek,ralink-mt7621-gsw";
};
&state_default {

View File

@ -0,0 +1,40 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "mt7621_dlink_dir-8xx-a1.dtsi"
/ {
compatible = "dlink,dir-867-a1", "mediatek,mt7621-soc";
model = "D-Link DIR-867 A1";
aliases {
led-boot = &led_power_orange;
led-failsafe = &led_power_green;
led-running = &led_power_green;
led-upgrade = &led_net_orange;
};
leds {
compatible = "gpio-leds";
led_power_orange: power_orange {
label = "dir-867-a1:orange:power";
gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
};
led_power_green: power_green {
label = "dir-867-a1:green:power";
gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
};
led_net_orange: net_orange {
label = "dir-867-a1:orange:net";
gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
};
net_green {
label = "dir-867-a1:green:net";
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
};
};
};

View File

@ -1,14 +1,18 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "mt7621_dlink_dir.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include "mt7621_dlink_dir-8xx-a1.dtsi"
/ {
compatible = "dlink,dlink-dir878-a1", "mediatek,mt7621-soc";
model = "D-Link DIR878 A1";
compatible = "dlink,dir-878-a1", "mediatek,mt7621-soc";
model = "D-Link DIR-878 A1";
aliases {
led-boot = &led_power_orange;
led-failsafe = &led_power_green;
led-running = &led_power_green;
led-upgrade = &led_net_orange;
};
leds {
compatible = "gpio-leds";

View File

@ -1,14 +1,18 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "mt7621_dlink_dir.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include "mt7621_dlink_dir-8xx-a1.dtsi"
/ {
compatible = "dlink,dlink-dir882-a1", "mediatek,mt7621-soc";
model = "D-Link DIR882 A1";
compatible = "dlink,dir-882-a1", "mediatek,mt7621-soc";
model = "D-Link DIR-882 A1";
aliases {
led-boot = &led_power_orange;
led-failsafe = &led_power_green;
led-running = &led_power_green;
led-upgrade = &led_net_orange;
};
leds {
compatible = "gpio-leds";
@ -33,10 +37,17 @@
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
};
usb {
label = "dir-882-a1:green:usb";
usb2 {
label = "dir-882-a1:green:usb2";
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
trigger-sources = <&ehci_port2>;
linux,default-trigger = "usbport";
};
usb3 {
label = "dir-882-a1:green:usb3";
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>;
trigger-sources = <&xhci_ehci_port1>;
linux,default-trigger = "usbport";
};
};

View File

@ -1,5 +1,4 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "mt7621.dtsi"
@ -8,10 +7,6 @@
/ {
aliases {
led-boot = &led_power_orange;
led-failsafe = &led_power_orange;
led-running = &led_power_green;
led-upgrade = &led_power_green;
label-mac-device = &gmac0;
};
@ -48,7 +43,7 @@
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <10000000>;
spi-max-frequency = <50000000>;
partitions {
compatible = "fixed-partitions";

View File

@ -10,6 +10,10 @@
compatible = "gehua,ghl-r-001", "mediatek,mt7621-soc";
model = "GeHua GHL-R-001";
aliases {
label-mac-device = &ethernet;
};
chosen {
bootargs = "console=ttyS0,57600";
};
@ -111,34 +115,19 @@
};
};
&gmac0 {
&ethernet {
compatible = "mediatek,ralink-mt7621-eth";
mediatek,switch = <&gsw>;
mtd-mac-address = <&factory 0xe000>;
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "lan1";
};
/delete-property/ compatible;
phy-mode = "rgmii";
};
port@1 {
status = "okay";
label = "lan2";
};
port@2 {
status = "okay";
label = "lan3";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
};
};
&gsw {
compatible = "mediatek,ralink-mt7621-gsw";
};
&state_default {

View File

@ -1,15 +1,19 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "mt7621_dlink_dir.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include "mt7621_dlink_dir-8xx-a1.dtsi"
/ {
compatible = "motorola,motorola-mr2600", "mediatek,mt7621-soc";
model = "Motorola MR2600";
aliases {
led-boot = &led_power_orange;
led-failsafe = &led_power_green;
led-running = &led_power_green;
led-upgrade = &led_net_orange;
};
leds {
compatible = "gpio-leds";

View File

@ -107,38 +107,19 @@
};
};
&gmac0 {
&ethernet {
compatible = "mediatek,ralink-mt7621-eth";
mediatek,switch = <&gsw>;
mtd-mac-address = <&factory 0xe000>;
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "lan1";
};
/delete-property/ compatible;
phy-mode = "rgmii";
};
port@1 {
status = "okay";
label = "lan2";
};
port@2 {
status = "okay";
label = "lan3";
};
port@3 {
status = "okay";
label = "lan4";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
};
};
&gsw {
compatible = "mediatek,ralink-mt7621-gsw";
};
&state_default {

View File

@ -12,7 +12,7 @@
led-failsafe = &led_status_yellow;
led-running = &led_status_blue;
led-upgrade = &led_status_blue;
label-mac-device = &gmac0;
label-mac-device = &ethernet;
};
leds {

View File

@ -14,7 +14,7 @@
led-failsafe = &led_status_red;
led-running = &led_status_blue;
led-upgrade = &led_status_yellow;
label-mac-device = &gmac0;
label-mac-device = &ethernet;
};
chosen {
@ -190,28 +190,19 @@
};
};
&gmac0 {
&ethernet {
compatible = "mediatek,ralink-mt7621-eth";
mediatek,switch = <&gsw>;
mtd-mac-address = <&factory 0xe006>;
};
&switch0 {
ports {
port@1 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe000>;
};
/delete-property/ compatible;
phy-mode = "rgmii";
};
port@2 {
status = "okay";
label = "lan2";
};
port@3 {
status = "okay";
label = "lan1";
};
};
&gsw {
compatible = "mediatek,ralink-mt7621-gsw";
};
&state_default {

View File

@ -12,7 +12,7 @@
led-failsafe = &led_status_amber;
led-running = &led_status_white;
led-upgrade = &led_status_white;
label-mac-device = &gmac0;
label-mac-device = &ethernet;
};
leds {

View File

@ -6,7 +6,6 @@
#include <dt-bindings/input/input.h>
/ {
chosen {
bootargs = "console=ttyS0,115200n8";
};
@ -33,7 +32,6 @@
partition@0 {
label = "Bootloader";
reg = <0x0 0x80000>;
read-only;
};
partition@80000 {
@ -109,33 +107,19 @@
};
};
&gmac0 {
mtd-mac-address = <&factory 0xe000>;
&ethernet {
compatible = "mediatek,ralink-mt7621-eth";
mediatek,switch = <&gsw>;
mtd-mac-address = <&factory 0xe006>;
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
};
/delete-property/ compatible;
phy-mode = "rgmii";
};
port@2 {
status = "okay";
label = "lan1";
};
port@3 {
status = "okay";
label = "lan2";
};
port@4 {
status = "okay";
label = "lan3";
};
};
&gsw {
compatible = "mediatek,ralink-mt7621-gsw";
};
&state_default {

View File

@ -195,7 +195,7 @@ static void mt7621_hw_init(struct mt7620_gsw *gsw, struct device_node *np)
}
static const struct of_device_id mediatek_gsw_match[] = {
{ .compatible = "mediatek,mt7621-gsw" },
{ .compatible = "mediatek,ralink-mt7621-gsw" },
{},
};
MODULE_DEVICE_TABLE(of, mediatek_gsw_match);
@ -261,7 +261,7 @@ static struct platform_driver gsw_driver = {
.probe = mt7621_gsw_probe,
.remove = mt7621_gsw_remove,
.driver = {
.name = "mt7621-gsw",
.name = "ralink-mt7621-gsw",
.owner = THIS_MODULE,
.of_match_table = mediatek_gsw_match,
},

View File

@ -1732,7 +1732,7 @@ static struct platform_driver fe_driver = {
.probe = fe_probe,
.remove = fe_remove,
.driver = {
.name = "mtk_soc_eth",
.name = "ralink_soc_eth",
.owner = THIS_MODULE,
.of_match_table = of_fe_match,
},

View File

@ -180,7 +180,7 @@ static struct fe_soc_data mt7621_data = {
};
const struct of_device_id of_fe_match[] = {
{ .compatible = "mediatek,mt7621-eth", .data = &mt7621_data },
{ .compatible = "mediatek,ralink-mt7621-eth", .data = &mt7621_data },
{},
};

View File

@ -212,6 +212,12 @@ define Device/buffalo_wsr-600dhp
endef
TARGET_DEVICES += buffalo_wsr-600dhp
define Device/dlink_dir-8xx-a1
IMAGE_SIZE := 16000k
DEVICE_VENDOR := D-Link
DEVICE_PACKAGES := kmod-mt7615d luci-app-mtwifi uboot-envtools
endef
define Device/dlink_dir-860l-b1
$(Device/seama)
BLOCKSIZE := 64k
@ -228,22 +234,25 @@ define Device/dlink_dir-860l-b1
endef
TARGET_DEVICES += dlink_dir-860l-b1
define Device/dlink_dir-867-a1
$(Device/dlink_dir-8xx-a1)
DEVICE_MODEL := DIR-867
DEVICE_VARIANT := A1
endef
TARGET_DEVICES += dlink_dir-867-a1
define Device/dlink_dir-878-a1
IMAGE_SIZE := 16064k
DEVICE_VENDOR := D-Link
$(Device/dlink_dir-8xx-a1)
DEVICE_MODEL := DIR-878
DEVICE_VARIANT := A1
DEVICE_PACKAGES := kmod-mt7615d luci-app-mtwifi uboot-envtools
endef
TARGET_DEVICES += dlink_dir-878-a1
define Device/dlink_dir-882-a1
IMAGE_SIZE := 16064k
DEVICE_VENDOR := D-Link
$(Device/dlink_dir-8xx-a1)
DEVICE_MODEL := DIR-882
DEVICE_VARIANT := A1
DEVICE_PACKAGES := kmod-mt7615d kmod-usb3 kmod-usb-ledtrig-usbport \
luci-app-mtwifi uboot-envtools
DEVICE_PACKAGES += kmod-usb3 kmod-usb-ledtrig-usbport
endef
TARGET_DEVICES += dlink_dir-882-a1
@ -351,8 +360,8 @@ define Device/gehua_ghl-r-001
IMAGE_SIZE := 32448k
DEVICE_VENDOR := GeHua
DEVICE_MODEL := GHL-R-001
DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
kmod-usb-ledtrig-usbport wpad-openssl
DEVICE_PACKAGES := kmod-mt7603e kmod-mt76x2e kmod-usb3 \
kmod-usb-ledtrig-usbport luci-app-mtwifi
endef
TARGET_DEVICES += gehua_ghl-r-001
@ -1032,23 +1041,8 @@ define Device/xiaomi_mir4
endef
TARGET_DEVICES += xiaomi_mir4
define Device/xiaomi_mi-router-ac2100
BLOCKSIZE := 128k
PAGESIZE := 2048
KERNEL_SIZE := 4096k
IMAGE_SIZE := 120320k
UBINIZE_OPTS := -E 5
IMAGES += kernel1.bin rootfs0.bin
IMAGE/kernel1.bin := append-kernel
IMAGE/rootfs0.bin := append-ubi | check-size
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
DEVICE_VENDOR := Xiaomi
DEVICE_MODEL := Mi Router AC2100
DEVICE_PACKAGES := kmod-mt7603e kmod-mt7615d luci-app-mtwifi uboot-envtools
endef
TARGET_DEVICES += xiaomi_mi-router-ac2100
define Device/xiaomi_redmi-router-ac2100
define Device/xiaomi-ac2100
$(Device/uimage-lzma-loader)
BLOCKSIZE := 128k
PAGESIZE := 2048
KERNEL_SIZE := 4096k
@ -1058,11 +1052,21 @@ define Device/xiaomi_redmi-router-ac2100
IMAGE/kernel1.bin := append-kernel
IMAGE/rootfs0.bin := append-ubi | check-size
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | check-size $$$$(IMAGE_SIZE)
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | check-size
DEVICE_VENDOR := Xiaomi
DEVICE_MODEL := Redmi Router AC2100
DEVICE_PACKAGES := kmod-mt7603e kmod-mt7615d luci-app-mtwifi uboot-envtools
endef
define Device/xiaomi_mi-router-ac2100
$(Device/xiaomi-ac2100)
DEVICE_MODEL := Mi Router AC2100
endef
TARGET_DEVICES += xiaomi_mi-router-ac2100
define Device/xiaomi_redmi-router-ac2100
$(Device/xiaomi-ac2100)
DEVICE_MODEL := Redmi Router AC2100
endef
TARGET_DEVICES += xiaomi_redmi-router-ac2100
define Device/xiaoyu_xy-c5

View File

@ -18,17 +18,17 @@ led_wlan="$(get_dt_led wlan)"
case $board in
d-team,newifi-d2)
ucidef_set_led_netdev "internet" "internet" "$boardname:amber:internet" "wan"
ucidef_set_led_switch "internet" "internet" "$boardname:amber:internet" "switch0" "0x10"
ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "$boardname:blue:wlan2g" "ra0"
ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "$boardname:blue:wlan5g" "rai0"
;;
d-team,pbr-m1|\
gehua,ghl-r-001)
d-team,pbr-m1)
ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "wan"
;;
dlink,dir-860l-b1)
ucidef_set_led_netdev "wan" "wan" "$boardname:green:net" "wan"
;;
dlink,dir-867-a1|\
dlink,dir-878-a1|\
dlink,dir-882-a1|\
motorola,mr2600)
@ -36,6 +36,9 @@ motorola,mr2600)
ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "$boardname:green:wlan2g" "ra0"
ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "$boardname:green:wlan5g" "rai0"
;;
gehua,ghl-r-001)
ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x10"
;;
gnubee,gb-pc1|\
gnubee,gb-pc2)
ucidef_set_led_netdev "lan1" "lan1" "$boardname:green:lan1" "lan1"
@ -82,14 +85,19 @@ tplink,re650-v1)
ucidef_set_led_netdev "eth_act" "LAN act" "$boardname:green:eth_act" "lan" "tx rx"
ucidef_set_led_netdev "eth_link" "LAN link" "$boardname:green:eth_link" "lan" "link"
;;
xzwifi,creativebox-v1)
ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "wan"
xiaomi,mir3g)
ucidef_set_led_switch "wan-amber" "WAN (amber)" "$boardname:amber:wan" "switch0" "0x02" "0x08"
ucidef_set_led_switch "lan1-amber" "LAN1 (amber)" "$boardname:amber:lan1" "switch0" "0x08" "0x08"
ucidef_set_led_switch "lan2-amber" "LAN2 (amber)" "$boardname:amber:lan2" "switch0" "0x04" "0x08"
;;
xiaomi,mi-router-ac2100)
ucidef_set_led_netdev "wan" "wan" "$boardname:blue:wan" "wan"
ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x1"
;;
xiaomi,redmi-router-ac2100)
ucidef_set_led_netdev "wan" "wan" "$boardname:white:wan" "wan"
ucidef_set_led_switch "wan" "wan" "$boardname:white:wan" "switch0" "0x1"
;;
xzwifi,creativebox-v1)
ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "wan"
;;
youhua,wr1200js)
ucidef_set_led_netdev "internet" "INTERNET" "$boardname:green:wan" "wan"

View File

@ -21,15 +21,19 @@ ramips_setup_interfaces()
ucidef_set_interfaces_lan_wan "lan1 lan2" "wan"
;;
d-team,newifi-d2)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 ra0 rai0" "wan"
ucidef_add_switch "switch0" \
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan:5" "6@eth0"
ucidef_set_interface_lan "eth0.1 ra0 rai0 apcli0 apclii0"
;;
gehua,ghl-r-001|\
hiwifi,hc5962|\
xiaomi,mir3p|\
xiaomi,mi-router-ac2100|\
xiaomi,redmi-router-ac2100)
xiaomi,mir3p)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 ra0 rai0" "wan"
;;
gehua,ghl-r-001)
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "4:wan" "6@eth0"
ucidef_set_interface_lan "eth0.1 ra0 rai0 apcli0 apclii0"
;;
gnubee,gb-pc1|\
gnubee,gb-pc2)
ucidef_set_interface_lan "lan1 lan2"
@ -50,13 +54,16 @@ ramips_setup_interfaces()
ucidef_set_interfaces_lan_wan "lan2 lan3 lan4 lan5" "wan"
;;
netgear,r6850|\
dlink,dir-867-a1|\
dlink,dir-878-a1|\
dlink,dir-882-a1|\
motorola,mr2600)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 ra0 rai0" "wan"
;;
phicomm,k2p)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 ra0 rax0" "wan"
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0"
ucidef_set_interface_lan "eth0.1 ra0 rax0 apcli0 apclix0"
;;
ubnt,edgerouter-x)
ucidef_set_interface_lan_wan "eth1 eth2 eth3 eth4" "eth0"
@ -64,6 +71,16 @@ ramips_setup_interfaces()
ubnt,edgerouter-x-sfp)
ucidef_set_interface_lan_wan "eth1 eth2 eth3 eth4 eth5" "eth0"
;;
xiaomi,mir3g)
ucidef_add_switch "switch0" \
"2:lan:2" "3:lan:1" "1:wan" "6t@eth0"
;;
xiaomi,mi-router-ac2100|\
xiaomi,redmi-router-ac2100)
ucidef_add_switch "switch0" \
"0:wan" "2:lan:1" "3:lan:2" "4:lan:3" "6@eth0"
ucidef_set_interface_lan "eth0.2 ra0 rai0 apcli0 apclii0"
;;
*)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
;;
@ -88,6 +105,10 @@ ramips_setup_macs()
wan_mac="$(grep -m1 mac= "/dev/mtd${index}" | cut -d= -f2)"
lan_mac=$wan_mac
;;
d-team,newifi-d2)
lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(mtd_get_mac_binary factory 0xe006)
;;
dlink,dir-860l-b1)
lan_mac=$(mtd_get_mac_ascii factory lanmac)
wan_mac=$(mtd_get_mac_ascii factory wanmac)
@ -97,6 +118,10 @@ ramips_setup_macs()
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
;;
gehua,ghl-r-001)
lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(macaddr_add "$lan_mac" 1)
;;
hiwifi,hc5962)
lan_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ")
label_mac=$lan_mac
@ -119,6 +144,15 @@ ramips_setup_macs()
wan_mac=$label_mac
lan_mac=$(macaddr_add $label_mac 1)
;;
phicomm,k2p)
wan_mac=$(mtd_get_mac_binary factory 0xe006)
;;
xiaomi,mir3g|\
xiaomi,mi-router-ac2100|\
xiaomi,redmi-router-ac2100)
lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(mtd_get_mac_binary factory 0xe000)
;;
zbtlink,zbt-we1326|\
zbtlink,zbt-wg3526-16m|\
zbtlink,zbt-wg3526-32m)

View File

@ -230,9 +230,15 @@ CONFIG_NET_DSA_MT7530=y
CONFIG_NET_DSA_TAG_MTK=y
CONFIG_NET_FLOW_LIMIT=y
CONFIG_NET_MEDIATEK_SOC=y
CONFIG_NET_RALINK_GSW_MT7621=y
CONFIG_NET_RALINK_MDIO=y
CONFIG_NET_RALINK_MDIO_MT7620=y
CONFIG_NET_RALINK_MT7621=y
CONFIG_NET_RALINK_OFFLOAD=y
CONFIG_NET_RALINK_SOC=y
CONFIG_NET_SWITCHDEV=y
CONFIG_NET_VENDOR_MEDIATEK=y
# CONFIG_NET_VENDOR_RALINK is not set
CONFIG_NET_VENDOR_RALINK=y
CONFIG_NR_CPUS=4
CONFIG_OF=y
CONFIG_OF_ADDRESS=y
@ -301,6 +307,8 @@ CONFIG_SPI_MEM=y
CONFIG_SPI_MT7621=y
# CONFIG_SPI_RT2880 is not set
CONFIG_SRCU=y
CONFIG_SWCONFIG=y
CONFIG_SWCONFIG_LEDS=y
CONFIG_SWPHY=y
CONFIG_SYNC_R4K=y
CONFIG_SYSCTL_EXCEPTION_TRACE=y

View File

@ -8,6 +8,7 @@ FEATURES+=nand ramdisk rtc usb minor
CPU_TYPE:=24kc
KERNEL_PATCHVER:=5.4
DEFAULT_PACKAGES += swconfig
define Target/Description
Build firmware images for Ralink MT7621 based boards.