1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-03-09 15:40:20 +00:00
This commit is contained in:
suyuan168 2021-12-30 16:05:20 +08:00
parent fbfc43bae6
commit 0876af94a5
64 changed files with 191 additions and 5911 deletions

0
CLA-entity.md Executable file → Normal file
View file

0
CLA-individual.md Executable file → Normal file
View file

0
CODE_OF_CONDUCT.md Executable file → Normal file
View file

0
CONTRIBUTING.md Executable file → Normal file
View file

0
LICENSE Executable file → Normal file
View file

0
README.md Executable file → Normal file
View file

0
config-4018 Executable file → Normal file
View file

0
config-bpi-r1 Executable file → Normal file
View file

0
config-bpi-r2 Executable file → Normal file
View file

0
config-bpi-r64 Executable file → Normal file
View file

5854
config-cm520-79f Executable file → Normal file

File diff suppressed because it is too large Load diff

0
config-espressobin Executable file → Normal file
View file

0
config-espressobin1 Executable file → Normal file
View file

0
config-nanopi_neo Executable file → Normal file
View file

0
config-p2w_r619ac Executable file → Normal file
View file

0
config-r2s Executable file → Normal file
View file

0
config-r4s Executable file → Normal file
View file

1
config-rpi2 Executable file → Normal file
View file

@ -6,4 +6,3 @@ CONFIG_PACKAGE_kmod-ath9k=y
CONFIG_PACKAGE_bcm27xx-eeprom=y
CONFIG_PACKAGE_bcm27xx-userland=y
CONFIG_KERNEL_ARM_MODULE_PLTS=y
CONFIG_KERNEL_TCP_CONG_BBR=y

0
config-rpi3 Executable file → Normal file
View file

0
config-rpi4 Executable file → Normal file
View file

0
config-ubnt-erx Executable file → Normal file
View file

0
config-wrt3200acm Executable file → Normal file
View file

0
config-wrt32x Executable file → Normal file
View file

0
config-x86 Executable file → Normal file
View file

0
config-x86_64 Executable file → Normal file
View file

0
contributors/example.md Executable file → Normal file
View file

0
deploy_rsa.enc Executable file → Normal file
View file

0
patches/bbr2.patch Executable file → Normal file
View file

0
patches/check-rsync.patch Executable file → Normal file
View file

0
patches/download-ipv4.patch Executable file → Normal file
View file

0
patches/gtime.patch Executable file → Normal file
View file

0
patches/images.patch Executable file → Normal file
View file

0
patches/ipt-nat6.patch Executable file → Normal file
View file

0
patches/luci-occitan.patch Executable file → Normal file
View file

0
patches/nanqinlang.patch Executable file → Normal file
View file

0
patches/nocheck.patch Executable file → Normal file
View file

0
patches/package-too-long.patch Executable file → Normal file
View file

0
patches/remove_abi.patch Executable file → Normal file
View file

0
patches/smsc75xx.patch Executable file → Normal file
View file

0
patches/uefi.patch Executable file → Normal file
View file

View file

@ -384,4 +384,4 @@ IPT_BUILTIN += $(EBTABLES_IP4-y)
IPT_BUILTIN += $(EBTABLES_IP6-y)
IPT_BUILTIN += $(EBTABLES_WATCHERS-y)
endif # __inc_netfilter
endif # __inc_netfilter

View file

@ -7,25 +7,58 @@ CFG=/etc/board.json
[ -s $CFG ] || /bin/board_detect || exit 1
[ -s /etc/config/network -a -s /etc/config/system ] && exit 0
generate_bridge() {
local name=$1
local macaddr=$2
uci -q batch <<-EOF
set network.$name=device
set network.$name.name=$name
set network.$name.type=bridge
EOF
if [ -n "$macaddr" ]; then
uci -q batch <<-EOF
set network.$name.macaddr=$macaddr
EOF
fi
}
bridge_vlan_id=0
generate_bridge_vlan() {
local name=$1_vlan
local device=$2
local ports="$3"
local vlan="$4"
uci -q batch <<-EOF
set network.$name=bridge-vlan
set network.$name.device='$device'
set network.$name.vlan='$vlan'
set network.$name.ports='$ports'
EOF
}
generate_static_network() {
uci -q batch <<-EOF
delete network.loopback
set network.loopback='interface'
set network.loopback.ifname='lo'
set network.loopback.device='lo'
set network.loopback.proto='static'
set network.loopback.ipaddr='127.0.0.1'
set network.loopback.netmask='255.0.0.0'
delete network.globals
set network.globals='globals'
set network.globals.ula_prefix='auto'
EOF
[ -e /proc/sys/net/ipv6 ] && {
uci -q batch <<-EOF
delete network.globals
set network.globals='globals'
set network.globals.ula_prefix='auto'
EOF
}
if json_is_a dsl object; then
json_select dsl
if json_is_a atmbridge object; then
json_select atmbridge
local vpi vci encaps payload
json_get_vars vpi vci encaps payload
local vpi vci encaps payload nameprefix
json_get_vars vpi vci encaps payload nameprefix
uci -q batch <<-EOF
delete network.atm
set network.atm='atm-bridge'
@ -33,6 +66,7 @@ generate_static_network() {
set network.atm.vci='$vci'
set network.atm.encaps='$encaps'
set network.atm.payload='$payload'
set network.atm.nameprefix='$nameprefix'
EOF
json_select ..
fi
@ -57,41 +91,69 @@ generate_static_network() {
addr_offset=2
generate_network() {
local ifname macaddr protocol type ipaddr netmask
local ports device macaddr protocol type ipaddr netmask vlan
local bridge=$2
json_select network
json_select "$1"
json_get_vars ifname macaddr protocol ipaddr netmask
json_get_vars device macaddr protocol ipaddr netmask vlan
json_get_values ports ports
json_select ..
json_select ..
[ -n "$ifname" ] || return
[ -n "$device" -o -n "$ports" ] || return
case "$1" in
# hack (see /etc/board.d/02_network)
none) return ;;
lan*) proto=${proto:-static} ;;
wan*) proto=${proto:-dhcp} ;;
esac
# Force bridge for "lan" as it may have other devices (e.g. wireless)
# bridged
[ "$1" = "lan" -a -z "$ports" ] && {
ports="$device"
}
[ -n "$ports" -a -z "$bridge" ] && {
uci -q batch <<-EOF
add network device
set network.@device[-1].name='br-$1'
set network.@device[-1].type='bridge'
EOF
for port in $ports; do uci add_list network.@device[-1].ports="$port"; done
[ -n "$macaddr" ] && {
for port in $ports; do
uci -q batch <<-EOF
add network device
set network.@device[-1].name='$port'
set network.@device[-1].macaddr='$macaddr'
EOF
done
}
device=br-$1
type=
macaddr=""
}
[ -n "$bridge" ] && {
[ -z "$ports" ] && ports="$device"
if [ -z "$vlan" ]; then
bridge_vlan_id=$((bridge_vlan_id + 1))
vlan=$bridge_vlan_id
fi
generate_bridge_vlan $1 $bridge "$ports" $vlan
device=$bridge.$vlan
type=""
}
if [ -n "$macaddr" ]; then
type=macvlan # useless, only for legacy
uci -q batch <<-EOF
delete network.${1}_dev
set network.${1}_dev='device'
set network.${1}_dev.name='$1'
set network.${1}_dev.type='$type'
set network.${1}_dev.ifname='$ifname'
set network.${1}_dev.macaddr='$macaddr'
add network device
set network.@device[-1].name='$device'
set network.@device[-1].macaddr='$macaddr'
EOF
ifname=$1
fi
uci -q batch <<-EOF
delete network.$1
set network.$1='interface'
set network.$1.type='$type'
set network.$1.ifname='$ifname'
set network.$1.device='$device'
set network.$1.proto='none'
EOF
@ -109,17 +171,23 @@ generate_network() {
set network.$1.proto='static'
set network.$1.ipaddr='$ipad'
set network.$1.netmask='$netm'
set network.$1.ip6assign='60'
EOF
[ -e /proc/sys/net/ipv6 ] && uci set network.$1.ip6assign='60'
;;
dhcp)
# fixup IPv6 slave interface if parent is a bridge
[ "$type" = "bridge" ] && ifname="br-$1"
[ "$type" = "bridge" ] && device="br-$1"
uci -q batch <<-EOF
set network.$1.proto='dhcp'
EOF
uci set network.$1.proto='dhcp'
[ -e /proc/sys/net/ipv6 ] && {
uci -q batch <<-EOF
delete network.${1}6
set network.${1}6='interface'
set network.${1}6.device='$device'
set network.${1}6.proto='dhcpv6'
EOF
}
;;
pppoe)
@ -127,12 +195,16 @@ generate_network() {
set network.$1.proto='pppoe'
set network.$1.username='username'
set network.$1.password='password'
set network.$1.ipv6='1'
delete network.${1}6
set network.${1}6='interface'
set network.${1}6.ifname='@${1}'
set network.${1}6.proto='dhcpv6'
EOF
[ -e /proc/sys/net/ipv6 ] && {
uci -q batch <<-EOF
set network.$1.ipv6='1'
delete network.${1}6
set network.${1}6='interface'
set network.${1}6.device='@${1}'
set network.${1}6.proto='dhcpv6'
EOF
}
;;
esac
}
@ -206,7 +278,8 @@ generate_switch() {
json_select switch
json_select "$key"
json_get_vars enable reset blinkrate cpu_port
json_get_vars enable reset blinkrate cpu_port \
ar8xxx_mib_type ar8xxx_mib_poll_interval
uci -q batch <<-EOF
add network switch
@ -214,6 +287,8 @@ generate_switch() {
set network.@switch[-1].reset='$reset'
set network.@switch[-1].enable_vlan='$enable'
set network.@switch[-1].blinkrate='$blinkrate'
set network.@switch[-1].ar8xxx_mib_type='$ar8xxx_mib_type'
set network.@switch[-1].ar8xxx_mib_poll_interval='$ar8xxx_mib_poll_interval'
EOF
generate_switch_vlans_ports "$1"
@ -222,12 +297,11 @@ generate_switch() {
json_select ..
}
generate_static_system() {
uci -q batch <<-EOF
delete system.@system[0]
add system system
set system.@system[-1].hostname='OpenMPTCProuter'
set system.@system[-1].hostname='antrouter'
set system.@system[-1].timezone='UTC'
set system.@system[-1].ttylogin='0'
set system.@system[-1].log_size='64'
@ -250,6 +324,13 @@ generate_static_system() {
uci -q set "system.@system[-1].hostname=$hostname"
fi
local compat_version
if json_get_var compat_version compat_version; then
uci -q set "system.@system[-1].compat_version=$compat_version"
else
uci -q set "system.@system[-1].compat_version=1.0"
fi
if json_is_a ntpserver array; then
local keys key
json_get_keys keys ntpserver
@ -359,11 +440,12 @@ generate_led() {
;;
switch)
local port_mask speed_mask
json_get_vars port_mask speed_mask
local port_mask speed_mask mode
json_get_vars port_mask speed_mask mode
uci -q batch <<-EOF
set system.$cfg.port_mask='$port_mask'
set system.$cfg.speed_mask='$speed_mask'
set system.$cfg.mode='$mode'
EOF
;;
@ -411,12 +493,24 @@ generate_gpioswitch() {
json_init
json_load "$(cat ${CFG})"
umask 077
if [ ! -s /etc/config/network ]; then
bridge_name=""
touch /etc/config/network
generate_static_network
json_get_vars bridge
[ -n "$bridge" ] && {
json_select bridge
json_get_vars name macaddr
generate_bridge "$name" "$macaddr"
json_select ..
bridge_name=$name
}
json_get_keys keys network
for key in $keys; do generate_network $key; done
for key in $keys; do generate_network $key $bridge_name; done
json_get_keys keys switch
for key in $keys; do generate_switch $key; done

View file

@ -1,16 +0,0 @@
#!/bin/sh
#
# Copyright (C) 2013-2015 OpenWrt.org
#
. /lib/functions/uci-defaults.sh
board_config_update
json_is_a network object && exit 0
ucidef_set_interface_lan 'eth0'
board_config_flush
exit 0

View file

0
root/package/network/ipv6/6in4/Makefile Normal file → Executable file
View file

0
root/target/linux/bcm27xx/bcm2711/config-5.14 Executable file → Normal file
View file

0
root/target/linux/bcm27xx/bcm2711/config-5.4 Executable file → Normal file
View file

0
root/target/linux/generic/config-4.14 Normal file → Executable file
View file

0
root/target/linux/generic/config-4.19 Normal file → Executable file
View file

0
root/target/linux/generic/config-4.9 Normal file → Executable file
View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

View file

@ -119,4 +119,4 @@ platform_do_upgrade_linksys() {
get_image "$1" | mtd write - "$part_label"
fi
}
}
}

View file

@ -0,0 +1,53 @@
From: William <gw826943555@qq.com>
Subject: [PATCH] ipq40xx: improve CPU clock
Date: Tue, 15 Dec 2020 15:26:35 +0800
This patch will match the clock-latency-ns values in the device tree
for those found inside the OEM device tree and kernel source code and
unlock 896Mhz CPU operating points.
Signed-off-by: William <gw826943555@qq.com>
---
--- a/arch/arm/boot/dts/qcom-ipq4019.dtsi
+++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi
@@ -114,20 +114,24 @@
opp-48000000 {
opp-hz = /bits/ 64 <48000000>;
- clock-latency-ns = <256000>;
+ clock-latency-ns = <100000>;
};
opp-200000000 {
opp-hz = /bits/ 64 <200000000>;
- clock-latency-ns = <256000>;
+ clock-latency-ns = <100000>;
};
opp-500000000 {
opp-hz = /bits/ 64 <500000000>;
- clock-latency-ns = <256000>;
+ clock-latency-ns = <100000>;
};
opp-716000000 {
opp-hz = /bits/ 64 <716000000>;
- clock-latency-ns = <256000>;
+ clock-latency-ns = <100000>;
};
+ opp-896000000 {
+ opp-hz = /bits/ 64 <896000000>;
+ clock-latency-ns = <100000>;
+ };
};
memory {
--- a/drivers/clk/qcom/gcc-ipq4019.c
+++ b/drivers/clk/qcom/gcc-ipq4019.c
@@ -579,6 +579,9 @@ static const struct freq_tbl ftbl_gcc_ap
F(632000000, P_DDRPLLAPSS, 1, 0, 0),
F(672000000, P_DDRPLLAPSS, 1, 0, 0),
F(716000000, P_DDRPLLAPSS, 1, 0, 0),
+ F(768000000, P_DDRPLLAPSS, 1, 0, 0),
+ F(823000000, P_DDRPLLAPSS, 1, 0, 0),
+ F(896000000, P_DDRPLLAPSS, 1, 0, 0),
{ }
};