mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-07 01:53:34 +08:00
mediatek: add mtk-smp package to exec smp.sh
mtk-smp: add usb smp settings
This commit is contained in:
parent
f289bbe415
commit
b0c2ac27a3
@ -6,6 +6,4 @@ if [ "$ACTION" = add ]; then
|
|||||||
sed -ne "/^[[:space:]]*net\..*\.$DEVICENAME\./p" "$CONF" | \
|
sed -ne "/^[[:space:]]*net\..*\.$DEVICENAME\./p" "$CONF" | \
|
||||||
sysctl -e -p - | logger -t sysctl
|
sysctl -e -p - | logger -t sysctl
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -f /sbin/smp.sh ] && /sbin/smp.sh
|
|
||||||
fi
|
fi
|
||||||
|
30
package/mtk/applications/mtk-smp/Makefile
Normal file
30
package/mtk/applications/mtk-smp/Makefile
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#
|
||||||
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
|
#
|
||||||
|
|
||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
PKG_NAME:=mtk-smp
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
PKG_LICENSE:=GPL-2.0
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
define Package/mtk-smp
|
||||||
|
SECTION:=MTK Properties
|
||||||
|
CATEGORY:=MTK Properties
|
||||||
|
TITLE:=Setup mtk smp settings
|
||||||
|
SUBMENU:=Applications
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Compile
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/mtk-smp/install
|
||||||
|
$(INSTALL_DIR) $(1)/sbin
|
||||||
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
|
$(INSTALL_BIN) ./files/smp.sh $(1)/sbin/
|
||||||
|
$(INSTALL_BIN) ./files/mtk_smp.init $(1)/etc/init.d/mtk_smp
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call BuildPackage,mtk-smp))
|
8
package/mtk/applications/mtk-smp/files/mtk_smp.init
Normal file
8
package/mtk/applications/mtk-smp/files/mtk_smp.init
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh /etc/rc.common
|
||||||
|
|
||||||
|
START=99
|
||||||
|
USE_PROCD=1
|
||||||
|
|
||||||
|
start_service() {
|
||||||
|
/sbin/smp.sh
|
||||||
|
}
|
@ -34,6 +34,7 @@ MT7986_whnat()
|
|||||||
PCIe0=
|
PCIe0=
|
||||||
eth_tx=229
|
eth_tx=229
|
||||||
eth_rx0=230
|
eth_rx0=230
|
||||||
|
usb=205
|
||||||
if [ -d "/proc/warp_ctrl/warp0" ]; then
|
if [ -d "/proc/warp_ctrl/warp0" ]; then
|
||||||
wifi1_irq=237
|
wifi1_irq=237
|
||||||
wifi2_irq=237
|
wifi2_irq=237
|
||||||
@ -51,7 +52,7 @@ MT7986_whnat()
|
|||||||
if [ "$num_of_wifi" = "0" ]; then
|
if [ "$num_of_wifi" = "0" ]; then
|
||||||
CPU0_AFFINITY="$eth_rx0"
|
CPU0_AFFINITY="$eth_rx0"
|
||||||
CPU1_AFFINITY="$eth_tx"
|
CPU1_AFFINITY="$eth_tx"
|
||||||
CPU2_AFFINITY=""
|
CPU2_AFFINITY="$usb"
|
||||||
CPU3_AFFINITY=""
|
CPU3_AFFINITY=""
|
||||||
|
|
||||||
CPU0_RPS=""
|
CPU0_RPS=""
|
||||||
@ -61,7 +62,7 @@ MT7986_whnat()
|
|||||||
elif [ "$num_of_wifi" = "1" ]; then
|
elif [ "$num_of_wifi" = "1" ]; then
|
||||||
CPU0_AFFINITY="$eth_rx0"
|
CPU0_AFFINITY="$eth_rx0"
|
||||||
CPU1_AFFINITY="$eth_tx"
|
CPU1_AFFINITY="$eth_tx"
|
||||||
CPU2_AFFINITY=""
|
CPU2_AFFINITY="$usb"
|
||||||
CPU3_AFFINITY="$wifi1_irq"
|
CPU3_AFFINITY="$wifi1_irq"
|
||||||
|
|
||||||
CPU0_RPS=" $wifi1 $wifi1_apcli0"
|
CPU0_RPS=" $wifi1 $wifi1_apcli0"
|
||||||
@ -71,7 +72,7 @@ MT7986_whnat()
|
|||||||
elif [ "$num_of_wifi" = "2" ]; then
|
elif [ "$num_of_wifi" = "2" ]; then
|
||||||
CPU0_AFFINITY="$eth_rx0"
|
CPU0_AFFINITY="$eth_rx0"
|
||||||
CPU1_AFFINITY="$eth_tx"
|
CPU1_AFFINITY="$eth_tx"
|
||||||
CPU2_AFFINITY=""
|
CPU2_AFFINITY="$usb"
|
||||||
CPU3_AFFINITY="$wifi1_irq $wifi2_irq"
|
CPU3_AFFINITY="$wifi1_irq $wifi2_irq"
|
||||||
|
|
||||||
CPU0_RPS=" $wifi1 $wifi2 $wifi1_apcli0 $wifi2_apcli0"
|
CPU0_RPS=" $wifi1 $wifi2 $wifi1_apcli0 $wifi2_apcli0"
|
||||||
@ -81,7 +82,7 @@ MT7986_whnat()
|
|||||||
elif [ "$num_of_wifi" = "3" ]; then
|
elif [ "$num_of_wifi" = "3" ]; then
|
||||||
CPU0_AFFINITY="$eth_tx $eth_rx0"
|
CPU0_AFFINITY="$eth_tx $eth_rx0"
|
||||||
CPU1_AFFINITY="$wifi1_irq $wifi2_irq"
|
CPU1_AFFINITY="$wifi1_irq $wifi2_irq"
|
||||||
CPU2_AFFINITY="$PCIe0 $wifi3_irq"
|
CPU2_AFFINITY="$PCIe0 $wifi3_irq $usb"
|
||||||
CPU3_AFFINITY=""
|
CPU3_AFFINITY=""
|
||||||
|
|
||||||
CPU0_RPS=""
|
CPU0_RPS=""
|
||||||
@ -210,6 +211,7 @@ MT7981_whnat()
|
|||||||
PCIe0=
|
PCIe0=
|
||||||
eth_tx=229
|
eth_tx=229
|
||||||
eth_rx0=230
|
eth_rx0=230
|
||||||
|
usb=205
|
||||||
if [ -d "/proc/warp_ctrl/warp0" ]; then
|
if [ -d "/proc/warp_ctrl/warp0" ]; then
|
||||||
wifi1_irq=237
|
wifi1_irq=237
|
||||||
wifi2_irq=237
|
wifi2_irq=237
|
||||||
@ -226,25 +228,25 @@ MT7981_whnat()
|
|||||||
dbg "[MT7981_whnat]"
|
dbg "[MT7981_whnat]"
|
||||||
if [ "$num_of_wifi" = "0" ]; then
|
if [ "$num_of_wifi" = "0" ]; then
|
||||||
CPU0_AFFINITY="$eth_rx0"
|
CPU0_AFFINITY="$eth_rx0"
|
||||||
CPU1_AFFINITY="$eth_tx"
|
CPU1_AFFINITY="$eth_tx $usb"
|
||||||
|
|
||||||
CPU0_RPS=""
|
CPU0_RPS=""
|
||||||
CPU1_RPS="$ethif1 $ethif2"
|
CPU1_RPS="$ethif1 $ethif2"
|
||||||
elif [ "$num_of_wifi" = "1" ]; then
|
elif [ "$num_of_wifi" = "1" ]; then
|
||||||
CPU0_AFFINITY="$eth_tx $eth_rx0"
|
CPU0_AFFINITY="$eth_tx $eth_rx0"
|
||||||
CPU1_AFFINITY="$wifi1_irq"
|
CPU1_AFFINITY="$wifi1_irq $usb"
|
||||||
|
|
||||||
CPU0_RPS="$ethif1 $ethif2 $wifi1 $wifi1_apcli0"
|
CPU0_RPS="$ethif1 $ethif2 $wifi1 $wifi1_apcli0"
|
||||||
CPU1_RPS=" $wifi1 $wifi1_apcli0"
|
CPU1_RPS=" $wifi1 $wifi1_apcli0"
|
||||||
elif [ "$num_of_wifi" = "2" ]; then
|
elif [ "$num_of_wifi" = "2" ]; then
|
||||||
CPU0_AFFINITY="$eth_tx $eth_rx0"
|
CPU0_AFFINITY="$eth_tx $eth_rx0"
|
||||||
CPU1_AFFINITY="$wifi1_irq $wifi2_irq"
|
CPU1_AFFINITY="$wifi1_irq $wifi2_irq $usb"
|
||||||
|
|
||||||
CPU0_RPS="$ethif1 $ethif2 $wifi1 $wifi2 $wifi1_apcli0 $wifi2_apcli0"
|
CPU0_RPS="$ethif1 $ethif2 $wifi1 $wifi2 $wifi1_apcli0 $wifi2_apcli0"
|
||||||
CPU1_RPS=" $wifi1 $wifi2 $wifi1_apcli0 $wifi2_apcli0"
|
CPU1_RPS=" $wifi1 $wifi2 $wifi1_apcli0 $wifi2_apcli0"
|
||||||
elif [ "$num_of_wifi" = "3" ]; then
|
elif [ "$num_of_wifi" = "3" ]; then
|
||||||
CPU0_AFFINITY="$eth_tx $eth_rx0"
|
CPU0_AFFINITY="$eth_tx $eth_rx0"
|
||||||
CPU1_AFFINITY="$PCIe0 $wifi1_irq $wifi2_irq $wifi3_irq"
|
CPU1_AFFINITY="$PCIe0 $wifi1_irq $wifi2_irq $wifi3_irq $usb"
|
||||||
|
|
||||||
CPU0_RPS="$ethif1 $ethif2 $wifi1 $wifi2 $wifi3 $wifi1_apcli0 $wifi2_apcli0 $wifi3_apcli0"
|
CPU0_RPS="$ethif1 $ethif2 $wifi1 $wifi2 $wifi3 $wifi1_apcli0 $wifi2_apcli0 $wifi3_apcli0"
|
||||||
CPU1_RPS=" $wifi1 $wifi2 $wifi3 $wifi1_apcli0 $wifi2_apcli0 $wifi3_apcli0"
|
CPU1_RPS=" $wifi1 $wifi2 $wifi3 $wifi1_apcli0 $wifi2_apcli0 $wifi3_apcli0"
|
||||||
@ -708,6 +710,8 @@ setup_model()
|
|||||||
num_of_wifi=$(get_wifi_num)
|
num_of_wifi=$(get_wifi_num)
|
||||||
mt_whnat_en=$(module_exist "mt_whnat")
|
mt_whnat_en=$(module_exist "mt_whnat")
|
||||||
|
|
||||||
|
logger -t "mtk_smp" "board=${board}, wifi_num=${num_of_wifi}, cpu_num=${NUM_OF_CPU}"
|
||||||
|
|
||||||
case $board in
|
case $board in
|
||||||
xiaomi,redmi-router-ax6000* |\
|
xiaomi,redmi-router-ax6000* |\
|
||||||
bananapi,bpi-r3mini* |\
|
bananapi,bpi-r3mini* |\
|
@ -14,6 +14,6 @@ KERNEL_TESTING_PATCHVER:=5.4
|
|||||||
include $(INCLUDE_DIR)/target.mk
|
include $(INCLUDE_DIR)/target.mk
|
||||||
DEFAULT_PACKAGES += \
|
DEFAULT_PACKAGES += \
|
||||||
kmod-leds-gpio kmod-gpio-button-hotplug \
|
kmod-leds-gpio kmod-gpio-button-hotplug \
|
||||||
autocore-arm uboot-envtools
|
autocore-arm uboot-envtools mtk-smp
|
||||||
|
|
||||||
$(eval $(call BuildTarget))
|
$(eval $(call BuildTarget))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user