1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-03-09 15:40:20 +00:00

Merge branch 'develop'

This commit is contained in:
suyuan 2022-08-26 22:48:45 +08:00
commit ccee924685
15 changed files with 4001 additions and 392 deletions

15
build.sh Executable file → Normal file
View file

@ -1,7 +1,7 @@
#!/bin/sh
#
# Copyright (C) 2017 OVH OverTheBox
# Copyright (C) 2017-2020 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter project
# Copyright (C) 2017-2022 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter project
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
@ -132,7 +132,7 @@ if [ "$OMR_KEEPBIN" = "no" ]; then
fi
rm -rf "$OMR_TARGET/${OMR_KERNEL}/source/files" "$OMR_TARGET/${OMR_KERNEL}/source/tmp"
#rm -rf "$OMR_TARGET/${OMR_KERNEL}/source/target/linux/mediatek/patches-4.14"
rm -rf "$OMR_TARGET/${OMR_KERNEL}/source/target/linux/mediatek/patches-5.4"
#rm -rf "$OMR_TARGET/${OMR_KERNEL}/source/target/linux/mediatek/patches-5.4"
rm -rf "$OMR_TARGET/${OMR_KERNEL}/source/package/boot/uboot-mediatek"
rm -rf "$OMR_TARGET/${OMR_KERNEL}/source/package/boot/arm-trusted-firmware-mediatek"
rm -rf "$OMR_TARGET/${OMR_KERNEL}/source/tools/firmware-utils"
@ -365,7 +365,7 @@ echo "Done"
#echo "Done"
# Add BBR2 patch, only working on 64bits images for now
if [ "$OMR_KERNEL" = "5.4" ] && ([ "$OMR_TARGET" = "x86_64" ] || [ "$OMR_TARGET" = "bpi-r64" ] || [ "$OMR_TARGET" = "rpi4" ] || [ "$OMR_TARGET" = "espressobin" ] || [ "$OMR_TARGET" = "r2s" ] || [ "$OMR_TARGET" = "r4s" ] || [ "$OMR_TARGET" = "rpi3" ]); then
if ([ "$OMR_KERNEL" = "5.4" ] || [ "$OMR_KERNEL" = "5.4" ]) && ([ "$OMR_TARGET" = "x86_64" ] || [ "$OMR_TARGET" = "bpi-r64" ] || [ "$OMR_TARGET" = "rpi4" ] || [ "$OMR_TARGET" = "espressobin" ] || [ "$OMR_TARGET" = "r2s" ] || [ "$OMR_TARGET" = "r4s" ] || [ "$OMR_TARGET" = "rpi3" ]); then
echo "Checking if BBRv2 patch is set or not"
if ! patch -Rf -N -p1 -s --dry-run < ../../../patches/bbr2.patch; then
echo "apply..."
@ -373,6 +373,11 @@ if [ "$OMR_KERNEL" = "5.4" ] && ([ "$OMR_TARGET" = "x86_64" ] || [ "$OMR_TARGET"
fi
echo "Done"
fi
if [ "$OMR_KERNEL" = "5.15" ] && ([ "$OMR_TARGET" = "x86_64" ] || [ "$OMR_TARGET" = "bpi-r64" ] || [ "$OMR_TARGET" = "rpi4" ] || [ "$OMR_TARGET" = "espressobin" ] || [ "$OMR_TARGET" = "r2s" ] || [ "$OMR_TARGET" = "r4s" ] || [ "$OMR_TARGET" = "rpi3" ]); then
echo "Checking if BBRv2 patch is set or not"
cp ../../../patches/bbr2-5.15.patch target/linux/generic/hack-5.15/693-tcp_bbr2.patch
echo "Done"
fi
echo "Checking if smsc75xx patch is set or not"
if ! patch -Rf -N -p1 -s --dry-run < ../../../patches/smsc75xx.patch; then
@ -478,6 +483,10 @@ fi
#if [ -f target/linux/generic/pending-5.4/770-16-net-ethernet-mediatek-mtk_eth_soc-add-flow-offloadin.patch ]; then
# rm -f target/linux/generic/pending-5.4/770-16-net-ethernet-mediatek-mtk_eth_soc-add-flow-offloadin.patch
#fi
#if [ -f target/linux/generic/pending-5.15/850-0023-PCI-aardvark-Make-main-irq_chip-structure-a-static-d.patch ]; then
# rm -f target/linux/generic/pending-5.15/850-0023-PCI-aardvark-Make-main-irq_chip-structure-a-static-d.patch
#fi
if [ "$OMR_KERNEL" = "5.4" ]; then
echo "Set to kernel 5.4 for rpi arch"

3408
patches/bbr2-5.15.patch Normal file

File diff suppressed because it is too large Load diff

View file

@ -9,7 +9,7 @@ endif
LINUX_VERSION-5.4 = .194
LINUX_VERSION-5.10 = .64
LINUX_VERSION-5.14 = .6
LINUX_VERSION-5.15 = .36
LINUX_VERSION-5.15 = .50
LINUX_KERNEL_HASH-5.4.132 = 8466adbfb3579e751ede683496df7bb20f258b5f882250f3dd82be63736d00ef
LINUX_KERNEL_HASH-5.4.182 = b2f1201f64f010e9e3c85d6f303a559a7944a80a0244a86b8f5035bd23f1f40d
@ -22,6 +22,7 @@ LINUX_KERNEL_HASH-5.15.15 = 1d3c57cf8071af174933df3e5d77da801e240a59da3c5e8406f7
LINUX_KERNEL_HASH-5.15.17 = 2787f5c0cc59984902fd97916dc604f39718c73817497c25f963141bfb70abde
LINUX_KERNEL_HASH-5.15.29 = 5905e684602c47ae95746d4003cb834335e5451aca4ac7c3013f15dd49ed876e
LINUX_KERNEL_HASH-5.15.36 = 36345db17a937c197c72ca9c7f34c262b3a12f927c237ff7770193014e29c690
LINUX_KERNEL_HASH-5.15.50 = 554d507d37a23810fe8c83912761e4a4f73c40794bc685ff7ca98042fe1bd70f
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))

View file

@ -57,7 +57,7 @@ DEFAULT_PACKAGES.router:=\
firewall \
ip6tables \
iptables \
kmod-ipt-offload \
kmod-nft-offload \
odhcp6c \
odhcpd-ipv6only \
ppp \

View file

@ -5208,6 +5208,7 @@ CONFIG_SELECT_MEMORY_MODEL=y
# CONFIG_SENSORS_DS620 is not set
# CONFIG_SENSORS_EMC1403 is not set
# CONFIG_SENSORS_EMC2103 is not set
# CONFIG_SENSORS_EMC2305 is not set
# CONFIG_SENSORS_EMC6W201 is not set
# CONFIG_SENSORS_F71805F is not set
# CONFIG_SENSORS_F71882FG is not set
@ -6142,6 +6143,7 @@ CONFIG_SYSVIPC_SYSCTL=y
# CONFIG_TCIC is not set
CONFIG_TCP_CONG_ADVANCED=y
# CONFIG_TCP_CONG_BBR is not set
# CONFIG_TCP_CONG_BBR2 is not set
# CONFIG_TCP_CONG_BIC is not set
# CONFIG_TCP_CONG_CDG is not set
CONFIG_TCP_CONG_CUBIC=y

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,100 @@
Index: linux-5.4.179/drivers/usb/serial/option.c
===================================================================
--- linux-5.4.179.orig/drivers/usb/serial/option.c
+++ linux-5.4.179/drivers/usb/serial/option.c
@@ -566,6 +566,17 @@ static void option_instat_callback(struc
#define WETELECOM_PRODUCT_WMD300 0x6803
+//david add Fibocom products
+#define FIBOCOM_VENDOR_ID 0x2cb7
+#define FIBOCOM_PRODUCT_L71X 0x0001
+#define FIBOCOM_USB_VENDOR_AND_INTERFACE_INFO(vend, cl, sc, pr) \
+.match_flags = USB_DEVICE_ID_MATCH_INT_INFO \
+| USB_DEVICE_ID_MATCH_VENDOR, \
+.idVendor = (vend), \
+.bInterfaceClass = (cl), \
+.bInterfaceSubClass = (sc), \
+.bInterfaceProtocol = (pr)
+
/* Device flags */
/* Highest interface number which can be used with NCTRL() and RSVD() */
@@ -585,6 +596,77 @@ static void option_instat_callback(struc
static const struct usb_device_id option_ids[] = {
+ { USB_DEVICE(0x2ecc, 0x3010) },/* td-tech 909s */
+//fibocom L610
+ { USB_DEVICE(0x1782, 0x4d11) , .driver_info = RSVD(4) },
+ { USB_DEVICE(0x1782, 0x4d10) },
+ {USB_DEVICE(0x2949, 0x7401), .driver_info = RSVD(1) },
+ {USB_DEVICE(0x2949, 0x7402), .driver_info = RSVD(0) },
+//add 5g quectel rm500q, foxconn T99W240T00, meige srm815
+ { USB_DEVICE(0x2C7C, 0x0800) }, /* Quectel RG500Q/RM500Q/RG510Q/RM510Q */
+ { USB_DEVICE(0x2C7C, 0x0900) }, /* Quectel RG500U RG200U */
+ { USB_DEVICE(0x05C6, 0x90DB), .driver_info = RSVD(2)|RSVD(3)|RSVD(4)|RSVD(5) },
+ { USB_DEVICE(0x05C6, 0x90D5), .driver_info = RSVD(2)|RSVD(3) },
+ { USB_DEVICE(0x2dee, 0x4d22), .driver_info = RSVD(4)|RSVD(5) },
+//add simcom a7600e
+ { USB_DEVICE(0x1e0e, 0x9011), .driver_info = RSVD(0)|RSVD(1) },
+//add U9300
+ { USB_DEVICE(0x1c9e, 0x9b3c), .driver_info = RSVD(4)|RSVD(5) },
+//add ucloud m2
+ { USB_DEVICE_AND_INTERFACE_INFO(0x1782, 0x5d22, 0xff, 0x00, 0x00), .driver_info = RSVD(3) },
+//add yuge clm920
+ { USB_DEVICE(0x1286, 0x4e3c), .driver_info = RSVD(0)|RSVD(1) },
+//add nodecom nl660
+ { USB_DEVICE(0x1508, 0x1001), .driver_info = RSVD(4)|RSVD(5) },
+//add quectel product
+ { USB_DEVICE(0x05C6, 0x9090), .driver_info = RSVD(4)|RSVD(5) },
+ { USB_DEVICE(0x05C6, 0x9003), .driver_info = RSVD(4)|RSVD(5) },
+ { USB_DEVICE(0x05C6, 0X9215), .driver_info = RSVD(4)|RSVD(5) },
+ { USB_DEVICE(0x2c7c, 0x0125), .driver_info = RSVD(4)|RSVD(5) },
+ { USB_DEVICE(0x2c7c, 0x0121), .driver_info = RSVD(4)|RSVD(5) },
+//add xin feng wei ye
+ { USB_DEVICE(0x5c6, 0x5012), .driver_info = RSVD(4)|RSVD(5) },
+ { USB_DEVICE(0x5c6, 0x5013), .driver_info = RSVD(4)|RSVD(5) },//gobinet id
+//add em8000
+ { USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0x0532, 0xff, 0xff, 0xff), .driver_info = RSVD(6)|RSVD(7) },
+//add end
+//add fibocom L71x
+ { FIBOCOM_USB_VENDOR_AND_INTERFACE_INFO(0x2cb7, 0xff, 0xff, 0xff) },
+ { FIBOCOM_USB_VENDOR_AND_INTERFACE_INFO(0x2cb7, 0x0a, 0x00, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0x0256, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0x0579, 0xff, 0xff, 0xff), .driver_info = RSVD(0)|RSVD(1)|RSVD(5)|RSVD(6) },
+//add end
+//add mu709s
+ { USB_DEVICE(0x12d1, 0x1c25) },
+//add forege 630b
+ { USB_DEVICE(0x05c6, 0x9025) },
+//add kuanyi BM806U
+ //{ USB_DEVICE(0x2020, 0x2033) },
+ { USB_DEVICE_INTERFACE_CLASS(0x2020, 0x2033, 0xff), .driver_info = RSVD(4) },
+//add forege 730
+ { USB_DEVICE(0x05c6, 0xf601), .driver_info = RSVD(4)|RSVD(5) },
+//add Meig slm790
+ { USB_DEVICE(0x2dee,0x4d20), .driver_info = RSVD(0) },
+ { USB_DEVICE(0x2dee,0x4d57), .driver_info = RSVD(0) |RSVD(1)},
+//add end
+//add Quectel EC200T
+ { USB_DEVICE(0x2c7c, 0x6026) },
+//add end
+//add Luat air720,air724
+ { USB_DEVICE(0x1286,0x4e3d) },
+ { USB_DEVICE(0x1782,0x4e00) },
+//add end
+//add N720 and N720V5
+ { USB_DEVICE(0x2949,0x8247), .driver_info = RSVD(4)|RSVD(5) },
+ { USB_DEVICE(0x2949,0x8241), .driver_info = RSVD(0)},
+ { USB_DEVICE(0x2949,0x8242), .driver_info = RSVD(0)},
+ { USB_DEVICE(0x2949,0x8243), .driver_info = RSVD(0)},
+ { USB_DEVICE(0x2949,0x8700) },
+//add end
+//david add em7355 em7455(DELL 3P10Y)
+ { USB_DEVICE_INTERFACE_CLASS(0x1199, 0x9041, 0xff), .driver_info = RSVD(8)|RSVD(10)|RSVD(11) }, /* MC7305/MC7355 */
+ { USB_DEVICE_INTERFACE_CLASS(0x413c, 0x81b6, 0xff), .driver_info = RSVD(8)|RSVD(10)|RSVD(11) }, /* EM7455 */
+//add end
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_LIGHT) },

View file

@ -1,7 +0,0 @@
#!/bin/sh
[ -f /lib/adjust_network.sh ] && {
. /lib/adjust_network.sh
adjust_eth_queue
}

View file

@ -1,19 +0,0 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2011 OpenWrt.org
START=11
STOP=98
adjust_smp_affinity() {
test -f /lib/adjust_network.sh && {
. /lib/adjust_network.sh
adjust_eth_queue
adjust_edma_smp_affinity
adjust_radio_smp_affinity
}
}
boot() {
adjust_smp_affinity
}

View file

@ -1,89 +0,0 @@
#!/bin/sh
# this scripts is used for adjust cpu's choice of interrupts.
#
################################################
# Adjust smp_affinity of edma
# Globals:
# None
# Arguments:
# None
# Returns:
# None
# Remark:
# execute only once on start-up.
################################################
adjust_edma_smp_affinity() {
grep -q edma_eth_ /proc/interrupts || return 0
local nr=`cat /proc/cpuinfo | grep processor | wc -l`
local cpu=0
local tx_irq_num
for tx_num in `seq 0 1 15` ; do
cpu=`printf "%x" $((1<<((tx_num/4+0)%nr)))`
tx_irq_num=`grep -m1 edma_eth_tx$tx_num /proc/interrupts | cut -d ':' -f 1 | tail -n1 | tr -d ' '`
[ -n "$tx_irq_num" ] && echo $cpu > /proc/irq/$tx_irq_num/smp_affinity
done
for rx_num in `seq 0 1 7` ; do
cpu=`printf "%x" $((1<<((rx_num/2)%nr)))`
rx_irq_num=`grep -m1 edma_eth_rx$rx_num /proc/interrupts | cut -d ':' -f 1 | tail -n1 | tr -d ' '`
[ -n "$rx_irq_num" ] && echo $cpu > /proc/irq/$rx_irq_num/smp_affinity
done
}
################################################
# Adjust smp_affinity of ath10k for 2G and 5G
# Globals:
# None
# Arguments:
# None
# Returns:
# None
# Remark:
# execute only once on start-up.
################################################
adjust_radio_smp_affinity() {
local irqs="`grep -E 'ath10k' /proc/interrupts | cut -d ':' -f 1 | tr -d ' '`"
local nr=`cat /proc/cpuinfo | grep processor | wc -l`
local idx=2
for irq in $irqs; do
cpu=`printf "%x" $((1<<((idx)%nr)))`
echo $cpu > /proc/irq/$irq/smp_affinity
idx=$((idx+1))
done
}
################################################
# Adjust queue of eth
# Globals:
# None
# Arguments:
# None
# Returns:
# None
# Remark:
# Each network reboot needs to be executed.
################################################
adjust_eth_queue() {
local nr=`cat /proc/cpuinfo | grep processor | wc -l`
local idx=0
for epath in /sys/class/net/eth[0-9]*; do
test -e $epath || break
echo $epath | grep -q "\." && continue
eth=`basename $epath`
idx=0
for exps in /sys/class/net/$eth/queues/rx-[0-9]*/rps_cpus; do
test -e $exps || break
cpu=`printf "%x" $((1<<((idx+1)%nr)))`
idx=$((idx+1))
echo $cpu > $exps
echo 256 > `dirname $exps`/rps_flow_cnt
done
which ethtool >/dev/null 2>&1 && ethtool -K $eth gro off
done
echo 1024 > /proc/sys/net/core/rps_sock_flow_entries
}

View file

@ -480,4 +480,4 @@ CONFIG_ZBOOT_ROM_TEXT=0
CONFIG_ZLIB_DEFLATE=y
CONFIG_ZLIB_INFLATE=y
CONFIG_ZSTD_COMPRESS=y
CONFIG_ZSTD_DECOMPRESS=y
CONFIG_ZSTD_DECOMPRESS=y

View file

@ -137,6 +137,21 @@
label = "nhx:xnet";
gpio = <&tlmm 0 GPIO_ACTIVE_HIGH>;
};
5g1pwr {
label = "green:5g1pwr ";
gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>;
};
5g2pwr {
label = "green:5g2pwr ";
gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>;
};
5g3pwr {
label = "green:5g3pwr";
gpios = <&tlmm 46 GPIO_ACTIVE_HIGH>;
};
};
keys {

View file

@ -0,0 +1,17 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk
define Device/Default
PROFILES := Default
KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
KERNEL_LOADADDR := 0x80208000
DEVICE_DTS = $$(SOC)-$(lastword $(subst _, ,$(1)))
DEVICE_DTS_CONFIG := config@1
IMAGES := sysupgrade.bin
IMAGE/sysupgrade.bin = sysupgrade-tar | append-metadata
IMAGE/sysupgrade.bin/squashfs :=
endef
include $(SUBTARGET).mk
$(eval $(call BuildImage))

View file

@ -841,6 +841,5 @@ define Device/nhx_nhx4019
SOC := qcom-ipq4019
BLOCKSIZE := 128k
PAGESIZE := 2048
DEVICE_PACKAGES := uboot-envtools
endef
TARGET_DEVICES += nhx_nhx4019

View file

@ -1,34 +0,0 @@
Certain SFP modules (most notably Nokia GPON ones) first check
connectivity on 1000base-x, and switch to 2500base-x afterwards. This
is considered a quirk so the phylink switches the interface to
2500base-x as well.
However, after power-cycling the uDPU device, network interface/SFP module
will not work correctly until the module is re-seated. This patch
resolves this issue by forcing the interface to be brought up in
2500base-x mode by default.
Signed-off-by: Jakov Petrina <jakov.petrina@sartura.hr>
Signed-off-by: Vladimir Vid <vladimir.vid@sartura.hr>
Cc: Luka Perkov <luka.perkov@sartura.hr>
--- a/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts
+++ b/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts
@@ -162,7 +162,7 @@
};
&eth0 {
- phy-mode = "sgmii";
+ phy-mode = "2500base-x";
status = "okay";
managed = "in-band-status";
phys = <&comphy1 0>;
@@ -170,7 +170,7 @@
};
&eth1 {
- phy-mode = "sgmii";
+ phy-mode = "2500base-x";
status = "okay";
managed = "in-band-status";
phys = <&comphy0 1>;