kiddin9 2 年之前
父节点
当前提交
1a40893b84

+ 3 - 3
.github/workflows/Openwrt-AutoBuild.yml

@@ -69,7 +69,7 @@ jobs:
         elif [ ${{matrix.target}} == "x86_generic" ]; then
             echo "ARCH=linux/amd32" >> $GITHUB_ENV
             echo "MTARGET=x86_generic" >> $GITHUB_ENV
-        elif [[ ${{matrix.target}} =~ (armvirt_64|ipq807x|mediatek_mt7622|mediatek_mt7981|mediatek_gl_mt7981|mediatek_filogic|bcm27xx_bcm2710|ipq60xx_generic|ipq807x_ipq60xx|bcm4908_generic|sunxi_cortexa53) ]]; then
+        elif [[ ${{matrix.target}} =~ (armvirt_64|ipq807x|mediatek_mt7622|mediatek_mt7981|mediatek_mt7981|mediatek_gl_mt7986|mediatek_filogic|bcm27xx_bcm2710|ipq60xx_generic|ipq807x_ipq60xx|bcm4908_generic|sunxi_cortexa53) ]]; then
             echo "MTARGET=aarch64_cortex-a53" >> $GITHUB_ENV
         elif [[ ${{matrix.target}} =~ (ramips_mt7621|ramips_mt7620|ramips_mt76x8) ]]; then
             echo "MTARGET=mipsel_24kc" >> $GITHUB_ENV
@@ -158,6 +158,7 @@ jobs:
            git clone $REPO_URL -b $REPO_BRANCH openwrt
         else
             git clone $REPO_URL -b ${{ env.REPO_BRANCH }} openwrt
+            echo "git clone $REPO_URL -b ${{ env.REPO_BRANCH }} openwrt"
         fi
     
     - name: Free up disk space
@@ -264,8 +265,7 @@ jobs:
         cp $GITHUB_WORKSPACE/openwrt/.config ${{matrix.target}}.config || true
         cp $GITHUB_WORKSPACE/openwrt/build_dir/target-*/linux-*/linux-*/.config ${{matrix.target}}_kernel.config || true
         mv -f packages $kernel_v
-        mkdir packages
-        cp -rf kernel_v/Packages* packages/
+        ln -sf $kernel_v packages
         cd -
         rename -v "s/openwrt-/${{ env.VERSION }}-openwrt-/" ./firmware/*/* || true
         rename -v "s/friendlyarm_//" ./firmware/*/*gz || true

+ 4 - 0
.github/workflows/repo-dispatcher.yml

@@ -118,6 +118,10 @@ jobs:
           -H "Accept: application/vnd.github.everest-preview+json" \
           -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
           -d '{"event_type": "mediatek_mt7981 ${{ github.event.inputs.param }}", "client_payload": {"target": "mediatek_mt7981"}}'
+          -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
+          -H "Accept: application/vnd.github.everest-preview+json" \
+          -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
+          -d '{"event_type": "mediatek_mt7986 ${{ github.event.inputs.param }}", "client_payload": {"target": "mediatek_mt7986"}}'
           curl \
           -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
           -H "Accept: application/vnd.github.everest-preview+json" \

+ 2 - 0
devices/common/kernel_5.15.sh

@@ -12,6 +12,8 @@ cd new
 cp -rf --parents tools target/linux package/kernel package/boot package/firmware/linux-firmware include/{kernel-*,netfilter.mk} ../
 cd -
 
+sed -i "s/^.*vermagic$/\techo '1' > \$(LINUX_DIR)\/.vermagic/" include/kernel-defaults.mk
+
 curl -sfL https://raw.githubusercontent.com/openwrt/openwrt/master/include/image-commands.mk -o include/image-commands.mk
 sed -i "s/\$(STAGING_DIR_HOST)\/bin\/gzip/gzip/" include/image-commands.mk
 svn export --force https://github.com/openwrt/packages/trunk/kernel feeds/packages/kernel

+ 1 - 1
devices/common/patches/imagebuilder.patch

@@ -39,7 +39,7 @@
  	echo
  	rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG)
  	mkdir -p $(TARGET_DIR) $(BIN_DIR) $(TMP_DIR) $(DL_DIR)
-+	if [[ "$(USER_PROFILE)" =~ (DEVICE_phicomm_k2p|DEVICE_asus_rt-n56u-b1|DEVICE_thunder_timecloud|DEVICE_youku_yk-l2|DEVICE_youhua_wr1200js|DEVICE_oraybox_x3a|DEVICE_netgear_wndr3700-v5|DEVICE_xiaomi_mi-router-4a-gigabit|DEVICE_xiaomi_mi-router-3g-v2|DEVICE_jcg_y2|DEVICE_glinet_gl-mt300a|DEVICE_glinet_gl-mt750|DEVICE_hiwifi_hc5661|DEVICE_hiwifi_hc5761|DEVICE_hiwifi_hc5861|DEVICE_lenovo_newifi-y1|DEVICE_lenovo_newifi-y1s|DEVICE_xiaomi_miwifi-mini|DEVICE_youku_yk-l1c|DEVICE_jdcloud_luban) || "$(TARGETID)" == "ramips/mt76x8" ]]; then \
++	if [[ "$(USER_PROFILE)" =~ (DEVICE_phicomm_k2p|DEVICE_asus_rt-n56u-b1|DEVICE_thunder_timecloud|DEVICE_youku_yk-l2|DEVICE_youhua_wr1200js|DEVICE_oraybox_x3a|DEVICE_netgear_wndr3700-v5|DEVICE_xiaomi_mi-router-4a-gigabit|DEVICE_xiaomi_mi-router-3g-v2|DEVICE_jcg_y2|DEVICE_glinet_gl-mt300a|DEVICE_glinet_gl-mt750|DEVICE_hiwifi_hc5661|DEVICE_hiwifi_hc5761|DEVICE_hiwifi_hc5861|DEVICE_lenovo_newifi-y1|DEVICE_lenovo_newifi-y1s|DEVICE_xiaomi_miwifi-mini|DEVICE_youku_yk-l1c|DEVICE_jdcloud_luban|DEVICE_zte_e8820v2) || "$(TARGETID)" == "ramips/mt76x8" ]]; then \
 +		echo "src/gz openwrt_smflash https://op.supes.top/packages/mipsel_24kc/small_flash" >>$(TOPDIR)/repositories.conf; \
 +	else \
 +		sed -i "/smflash/d" $(TOPDIR)/repositories.conf; \

+ 4 - 27
devices/ipq807x/diy.sh

@@ -3,38 +3,15 @@ shopt -s extglob
 
 SHELL_FOLDER=$(dirname $(readlink -f "$0"))
 
-bash $SHELL_FOLDER/../common/kernel_5.15.sh
-
-rm -rf package/boot/uboot-envtools package/firmware/ipq-wifi package/firmware/ath11k* package/kernel/mac80211 target/linux/generic package/kernel/ath10k-ct
-svn export --force https://github.com/robimarko/openwrt/branches/ipq807x-5.15-pr/package/boot/uboot-envtools package/boot/uboot-envtools
-svn export --force https://github.com/robimarko/openwrt/branches/ipq807x-5.15-pr/package/firmware/ipq-wifi package/firmware/ipq-wifi
-svn export --force https://github.com/robimarko/openwrt/branches/ipq807x-5.15-pr/package/firmware/ath11k-firmware package/firmware/ath11k-firmware
-svn export --force https://github.com/robimarko/openwrt/branches/ipq807x-5.15-pr/package/kernel/mac80211 package/kernel/mac80211
-svn export --force https://github.com/robimarko/openwrt/branches/ipq807x-5.15-pr/package/kernel/qca-nss-dp package/kernel/qca-nss-dp
-svn export --force https://github.com/robimarko/openwrt/branches/ipq807x-5.15-pr/package/kernel/qca-ssdk package/kernel/qca-ssdk
-svn export --force https://github.com/robimarko/openwrt/branches/ipq807x-5.15-pr/package/kernel/ath10k-ct package/kernel/ath10k-ct
-
-svn co https://github.com/robimarko/openwrt/branches/ipq807x-5.15-pr/target/linux/generic target/linux/generic
-rm -rf target/linux/generic/.svn
-svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/generic/hack-5.15 target/linux/generic/hack-5.15
-
-svn co https://github.com/robimarko/openwrt/branches/ipq807x-5.15-pr/target/linux/ipq807x target/linux/ipq807x
-
-git clone https://github.com/robimarko/nss-packages --depth 1 package/nss-packages
-
-rm -rf package/network feeds/kiddin9/{rtl8821cu,rtl88x2bu}
-
-svn co https://github.com/robimarko/openwrt/branches/ipq807x-5.15-pr/package/network package/network
-
-curl -sfL https://raw.githubusercontent.com/robimarko/openwrt/ipq807x-5.15-pr/include/kernel-5.15 -o include/kernel-5.15
-
-curl -sfL https://raw.githubusercontent.com/robimarko/openwrt/ipq807x-5.15-pr/package/kernel/linux/modules/netsupport.mk -o package/kernel/linux/modules/netsupport.mk
+#bash $SHELL_FOLDER/../common/kernel_5.15.sh
 
+svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/generic/hack-5.15 target/linux/generic/hack-5.15
 
-rm -rf package/kernel/mt76
+rm -rf feeds/kiddin9/{rtl8821cu,rtl88x2bu} package/kernel/mt76
 
 sed -i "s/tty\(0\|1\)::askfirst/tty\1::respawn/g" target/linux/*/base-files/etc/inittab
 
+
 sed -i '$a  \
 CONFIG_CPU_FREQ_GOV_POWERSAVE=y \
 CONFIG_CPU_FREQ_GOV_USERSPACE=y \

+ 5 - 6
devices/ipq807x/patches/default_packages.patch

@@ -12,7 +12,7 @@
 
 --- a/target/linux/ipq807x/image/generic.mk
 +++ b/target/linux/ipq807x/image/generic.mk
-@@ -84,7 +84,7 @@ define Device/qnap_301w
+@@ -74,7 +74,7 @@ define Device/qnap_301w
  	IMAGES += factory.bin sysupgrade.bin
  	IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k
  	IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to 64k | sysupgrade-tar rootfs=$$$$@ | append-metadata
@@ -21,12 +21,11 @@
  endef
  TARGET_DEVICES += qnap_301w
  
-@@ -127,7 +127,7 @@ define Device/xiaomi_ax9000
+@@ -109,6 +109,6 @@ define Device/xiaomi_ax9000
+ 	DEVICE_DTS_CONFIG := config@hk14
  	SOC := ipq8072
- 	KERNEL_SIZE := 57344k
  	DEVICE_PACKAGES := ipq-wifi-xiaomi_ax9000 kmod-ath11k-pci ath11k-firmware-qcn9074 \
 -	kmod-ath10k-ct ath10k-firmware-qca9887-ct
 +	kmod-ath10k-ct ath10k-firmware-qca9887-ct kmod-usb3 kmod-usb-dwc3 kmod-usb-dwc3-qcom
- ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
- 	ARTIFACTS := initramfs-factory.ubi
- 	ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-uImage.itb | ubinize-kernel
+ endef
+ TARGET_DEVICES += xiaomi_ax9000

+ 2 - 0
devices/ipq807x/settings.ini

@@ -0,0 +1,2 @@
+REPO_URL="https://github.com/robimarko/openwrt"
+REPO_BRANCH="ipq807x-2023-01-03-1333"

+ 0 - 3
devices/ipq807x_ipq60xx/.config

@@ -31,13 +31,10 @@ CONFIG_PACKAGE_kmod-qca-nss-drv-pvxlanmgr=n
 CONFIG_PACKAGE_kmod-qca-nss-drv-tun6rd=n
 CONFIG_PACKAGE_kmod-qca-nss-drv-tunipip6=n
 CONFIG_PACKAGE_kmod-qca-nss-drv-vxlanmgr=n
-CONFIG_PACKAGE_kmod-qca-nss-drv-wifi-meshmgr=n
 CONFIG_PACKAGE_kmod-qca-nss-drv-igs=n
 CONFIG_PACKAGE_kmod-qca-nss-drv-mirror=n
 CONFIG_PACKAGE_kmod-qca-nss-drv-qdisc=n
 
-CONFIG_PACKAGE_kmod-batman-adv=n
-
 CONFIG_PACKAGE_kmod-bpf-test=n
 CONFIG_PACKAGE_kmod-rtc-pt7c4338=n
 CONFIG_PACKAGE_kmod-video-pwc=n

+ 4 - 4
devices/ipq807x_ipq60xx/diy.sh

@@ -4,8 +4,10 @@ shopt -s extglob
 
 SHELL_FOLDER=$(dirname $(readlink -f "$0"))
 
+rm -rf target/linux/ipq807x
 mv -f ../feeds/ipq807x/ipq807x target/linux/
 ./scripts/feeds install -a -p wifi_ax -f
+./scripts/feeds install -a
 
 rm -rf package/feeds/wifi_ax/hostapd
 
@@ -15,10 +17,8 @@ sed -i "/wifi_ax/d" feeds.conf
 
 rm -rf package/feeds/kiddin9/{firewall,rtl*,base-files,netifd,nft-fullcone,mbedtls,oaf,shortcut-fe,simulated-driver,fast-classifier,fullconenat}
 
-rm -rf package/kernel/{nat46,ath10k-ct,mt76,rtl8812au-ct}
-rm -rf feeds/packages/net/xtables-addons package/feeds/packages/openvswitch
-
-sed -i "s/PKG_HASH:=.*/PKG_HASH:=skip/" package/feeds/wifi_ax/mac80211/Makefile
+rm -rf package/kernel/{ath10k-ct,mt76,rtl8812au-ct}
+rm -rf feeds/packages/net/xtables-addons package/feeds/packages/openvswitch package/feeds/routing/batman-adv
 
 rm -rf devices/common/patches/{glinet,imagebuilder.patch,iptables.patch,targets.patch,kernel-defaults.patch,disable_flock.patch}
 

+ 2 - 2
devices/ipq807x_ipq60xx/patches/0999-depends.patch

@@ -4,14 +4,14 @@
    SUPPORTED_DEVICES := glinet,ax1800
    DEVICE_DTS_CONFIG := config@cp03-c1
 -  DEVICE_PACKAGES := ath11k-wifi-gl-ax1800 -kmod-usb-dwc3-of-simple kmod-usb-dwc3-qcom kmod-usb3
-+  DEVICE_PACKAGES := ath11k-wifi-gl-ax1800 -kmod-usb-dwc3-of-simple kmod-usb-dwc3-qcom kmod-usb3 kmod-hwmon-pwmfan wireless-regdb kmod-sched-cake ath11k-fwtest ftm
++  DEVICE_PACKAGES := ath11k-wifi-gl-ax1800 -kmod-usb-dwc3-of-simple kmod-usb-dwc3-qcom kmod-usb3 wireless-regdb kmod-wireguard-backport
    IMAGE/sysupgrade.tar := sysupgrade-tar | append-gl-metadata
  endef
 @@ -78,5 +78,5 @@
    SUPPORTED_DEVICES := glinet,axt1800
    DEVICE_DTS_CONFIG := config@cp03-c1
 -  DEVICE_PACKAGES := ath11k-wifi-gl-axt1800 -kmod-usb-dwc3-of-simple kmod-usb-dwc3-qcom kmod-usb3
-+  DEVICE_PACKAGES := ath11k-wifi-gl-axt1800 -kmod-usb-dwc3-of-simple kmod-usb-dwc3-qcom kmod-usb3 kmod-hwmon-pwmfan wireless-regdb kmod-sched-cake ath11k-fwtest ftm
++  DEVICE_PACKAGES := ath11k-wifi-gl-axt1800 -kmod-usb-dwc3-of-simple kmod-usb-dwc3-qcom kmod-usb3 wireless-regdb kmod-hwmon-pwmfan kmod-gl-sdk4-fan kmod-wireguard-backport
    IMAGE/sysupgrade.tar := sysupgrade-tar | append-gl-metadata
  endef
 

+ 0 - 2
devices/mediatek_filogic/.config

@@ -3,7 +3,5 @@ CONFIG_TARGET_mediatek=y
 CONFIG_TARGET_mediatek_filogic=y
 CONFIG_TARGET_MULTI_PROFILE=y
 #CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_bananapi_bpi-r3=y
-CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_xiaomi_redmi-router-ax6000-stock=y
-CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_xiaomi_redmi-router-ax6000-ubootmod=y
 
 CONFIG_PACKAGE_luci-ssl=y # uhttpd服务

+ 0 - 20
devices/mediatek_filogic/patches/AX6000.patch

@@ -1,20 +0,0 @@
---- a/target/linux/mediatek/image/filogic.mk
-+++ b/target/linux/mediatek/image/filogic.mk
-@@ -127,7 +127,7 @@ TARGET_DEVICES += mediatek_mt7986b-rfb
- 
- define Device/xiaomi_redmi-router-ax6000-stock
-   DEVICE_VENDOR := Xiaomi
--  DEVICE_MODEL := Redmi Router AX6000 (stock layout)
-+  DEVICE_MODEL := Redmi Router AX6000 (原厂布局)
-   DEVICE_DTS := mt7986a-xiaomi-redmi-router-ax6000-stock
-   DEVICE_DTS_DIR := ../dts
-   DEVICE_PACKAGES := kmod-leds-ws2812b
-@@ -145,7 +145,7 @@ TARGET_DEVICES += xiaomi_redmi-router-ax6000-stock
- 
- define Device/xiaomi_redmi-router-ax6000-ubootmod
-   DEVICE_VENDOR := Xiaomi
--  DEVICE_MODEL := Redmi Router AX6000 (OpenWrt U-Boot layout)
-+  DEVICE_MODEL := Redmi Router AX6000 (U-boot mod layout)
-   DEVICE_DTS := mt7986a-xiaomi-redmi-router-ax6000-ubootmod
-   DEVICE_DTS_DIR := ../dts
-   DEVICE_PACKAGES := kmod-leds-ws2812b

+ 24 - 7
devices/mediatek_mt7981/patches/targets.patch

@@ -1,14 +1,22 @@
 --- a/include/target.mk
 +++ b/include/target.mk
-@@ -44,29 +44,33 @@ DEFAULT_PACKAGES.nas:=\
- # For router targets
- DEFAULT_PACKAGES.router:=\
+@@ -10,7 +10,7 @@ __target_inc=1
+ DEVICE_TYPE?=router
+ 
+ # Default packages - the really basic set
+-DEFAULT_PACKAGES:=\
++DEFAULT_PACKAGES:=luci-app-advanced luci-app-firewall luci-app-gpsysupgrade luci-app-opkg luci-app-upnp luci-app-autoreboot luci-app-wizard luci-base luci-compat luci-lib-ipkg luci-lib-fs coremark wget-ssl curl htop nano zram-swap kmod-lib-zstd kmod-tcp-bbr bash openssh-sftp-server block-mount resolveip ds-lite swconfig \
+ 	base-files \
+ 	ca-bundle \
+ 	dropbear \
+@@ -46,28 +46,31 @@ DEFAULT_PACKAGES.router:=\
  	dnsmasq-full \
-+	kmod-ipt-nat \
-+	kmod-ipt-nat6 \
  	firewall \
-+	ip6tables \
  	iptables \
+-	ipv6helper \
++	ip6tables \
++	kmod-ipt-nat \
++	kmod-ipt-nat6 \
 +	kmod-ipt-offload \
 +	odhcp6c \
 +	odhcpd-ipv6only \
@@ -47,4 +55,13 @@
 +
  target_conf=$(subst .,_,$(subst -,_,$(subst /,_,$(1))))
  ifeq ($(DUMP),)
-   PLATFORM_DIR:=$(TOPDIR)/target/linux/$(BOARD)
+   PLATFORM_DIR:=$(TOPDIR)/target/linux/$(BOARD)
+@@ -205,7 +208,7 @@ LINUX_RECONF_DIFF = $(SCRIPT_DIR)/kconfig.pl - '>' $(call __linux_confcmd,$(filt
+ ifeq ($(DUMP),1)
+   BuildTarget=$(BuildTargets/DumpCurrent)
+ 
+-  CPU_CFLAGS = -Os -pipe
++  CPU_CFLAGS = -O2 -pipe
+   ifneq ($(findstring mips,$(ARCH)),)
+     ifneq ($(findstring mips64,$(ARCH)),)
+       CPU_TYPE ?= mips64

+ 127 - 0
devices/mediatek_mt7986/.config

@@ -0,0 +1,127 @@
+
+CONFIG_TARGET_mediatek=y
+CONFIG_TARGET_mediatek_mt7986=y
+CONFIG_TARGET_MULTI_PROFILE=y
+CONFIG_TARGET_DEVICE_mediatek_mt7986_DEVICE_xiaomi_redmi-router-ax6000=y
+CONFIG_TARGET_DEVICE_mediatek_mt7986_DEVICE_xiaomi_redmi-router-ax6000-stock=y
+
+CONFIG_VERSION_DIST="OpenWrt"
+CONFIG_PACKAGE_kmod-nft-fullcone=n
+CONFIG_PACKAGE_kmod-ax25=n
+CONFIG_PACKAGE_kmod-fast-classifier=n
+CONFIG_PACKAGE_kmod-shortcut-fe=n
+CONFIG_PACKAGE_kmod-shortcut-fe-cm=n
+CONFIG_PACKAGE_kmod-mpls=n
+CONFIG_PACKAGE_kmod-netem=n
+CONFIG_PACKAGE_kmod-sched=n
+CONFIG_PACKAGE_kmod-sched-act-vlan=n
+CONFIG_PACKAGE_kmod-sched-bpf=n
+CONFIG_PACKAGE_kmod-sched-cake=n
+CONFIG_PACKAGE_kmod-sched-connmark=n
+CONFIG_PACKAGE_kmod-sched-core=n
+CONFIG_PACKAGE_kmod-sched-ctinfo=n
+CONFIG_PACKAGE_kmod-sched-flower=n
+CONFIG_PACKAGE_kmod-sched-ipset=n
+CONFIG_PACKAGE_kmod-sched-mqprio=n
+CONFIG_PACKAGE_dockerd=n
+
+CONFIG_PACKAGE_kmod-i40e-vendor=n
+
+CONFIG_MTK_ACK_CTS_TIMEOUT_SUPPORT=y
+CONFIG_MTK_AIR_MONITOR=y
+CONFIG_MTK_AMPDU_CONF_SUPPORT=y
+CONFIG_MTK_ANTENNA_CONTROL_SUPPORT=y
+CONFIG_MTK_APCLI_SUPPORT=y
+CONFIG_MTK_ATE_SUPPORT=y
+CONFIG_MTK_BACKGROUND_SCAN_SUPPORT=y
+CONFIG_MTK_CAL_BIN_FILE_SUPPORT=y
+CONFIG_MTK_CFG_SUPPORT_FALCON_MURU=y
+CONFIG_MTK_CFG_SUPPORT_FALCON_PP=y
+CONFIG_MTK_CFG_SUPPORT_FALCON_SR=y
+CONFIG_MTK_CFG_SUPPORT_FALCON_TXCMD_DBG=y
+CONFIG_MTK_CHIP_MT7986=y
+CONFIG_MTK_CONNINFRA_APSOC=y
+CONFIG_MTK_CONNINFRA_APSOC_MT7986=y
+CONFIG_MTK_CON_WPS_SUPPORT=y
+CONFIG_MTK_DBDC_MODE=y
+CONFIG_MTK_DOT11K_RRM_SUPPORT=y
+CONFIG_MTK_DOT11R_FT_SUPPORT=y
+CONFIG_MTK_DOT11W_PMF_SUPPORT=y
+CONFIG_MTK_DOT11_HE_AX=y
+CONFIG_MTK_DOT11_N_SUPPORT=y
+CONFIG_MTK_DOT11_VHT_AC=y
+CONFIG_MTK_FAST_NAT_SUPPORT=y
+CONFIG_MTK_FIRST_IF_EEPROM_FLASH=y
+CONFIG_MTK_FIRST_IF_IPAILNA=y
+CONFIG_MTK_FIRST_IF_MT7986=y
+CONFIG_MTK_GREENAP_SUPPORT=y
+CONFIG_MTK_G_BAND_256QAM_SUPPORT=y
+CONFIG_MTK_HDR_TRANS_RX_SUPPORT=y
+CONFIG_MTK_HDR_TRANS_TX_SUPPORT=y
+CONFIG_MTK_ICAP_SUPPORT=y
+CONFIG_MTK_IGMP_SNOOP_SUPPORT=y
+CONFIG_MTK_INTERWORKING=y
+CONFIG_MTK_MAP_R2_VER_SUPPORT=y
+CONFIG_MTK_MAP_R3_VER_SUPPORT=y
+CONFIG_MTK_MAP_SUPPORT=y
+CONFIG_MTK_MBSS_DTIM_SUPPORT=y
+CONFIG_MTK_MBSS_SUPPORT=y
+CONFIG_MTK_MCAST_RATE_SPECIFIC=y
+CONFIG_MTK_MEMORY_SHRINK=y
+CONFIG_MTK_MGMT_TXPWR_CTRL=y
+CONFIG_MTK_MLME_MULTI_QUEUE_SUPPORT=y
+CONFIG_MTK_MT_AP_SUPPORT=m
+CONFIG_MTK_MT_DFS_SUPPORT=y
+CONFIG_MTK_MT_MAC=y
+CONFIG_MTK_MT_WIFI=m
+CONFIG_MTK_MT_WIFI_PATH="mt_wifi"
+CONFIG_MTK_MUMIMO_SUPPORT=y
+CONFIG_MTK_MU_RA_SUPPORT=y
+CONFIG_MTK_OFFCHANNEL_SCAN_FEATURE=y
+CONFIG_MTK_OWE_SUPPORT=y
+CONFIG_MTK_QOS_R1_SUPPORT=y
+CONFIG_MTK_RA_PHY_RATE_SUPPORT=y
+CONFIG_MTK_RED_SUPPORT=y
+CONFIG_MTK_RTMP_FLASH_SUPPORT=y
+CONFIG_MTK_RT_FIRST_CARD_EEPROM="flash"
+CONFIG_MTK_RT_FIRST_IF_RF_OFFSET=0xc0000
+CONFIG_MTK_SCS_FW_OFFLOAD=y
+CONFIG_MTK_SECOND_IF_NONE=y
+CONFIG_MTK_SMART_CARRIER_SENSE_SUPPORT=y
+CONFIG_MTK_SPECTRUM_SUPPORT=y
+CONFIG_MTK_SUPPORT_OPENWRT=y
+CONFIG_MTK_THIRD_IF_NONE=y
+CONFIG_MTK_TPC_SUPPORT=y
+CONFIG_MTK_TXBF_SUPPORT=y
+CONFIG_MTK_UAPSD=y
+CONFIG_MTK_VLAN_SUPPORT=y
+CONFIG_MTK_VOW_SUPPORT=y
+CONFIG_MTK_WARP_V2=y
+CONFIG_MTK_WDS_SUPPORT=y
+CONFIG_MTK_WHNAT_SUPPORT=m
+CONFIG_MTK_WIFI_BASIC_FUNC=y
+CONFIG_MTK_WIFI_DRIVER=y
+CONFIG_MTK_WIFI_EAP_FEATURE=y
+CONFIG_MTK_WIFI_FW_BIN_LOAD=y
+CONFIG_MTK_WIFI_MODE_AP=m
+CONFIG_MTK_WIFI_MT_MAC=y
+CONFIG_MTK_WIFI_TWT_SUPPORT=y
+CONFIG_MTK_WLAN_HOOK=y
+CONFIG_MTK_WLAN_SERVICE=y
+CONFIG_MTK_WNM_SUPPORT=y
+CONFIG_MTK_WPA3_SUPPORT=y
+CONFIG_MTK_WSC_INCLUDED=y
+CONFIG_MTK_WSC_V2_SUPPORT=y
+
+CONFIG_CONNINFRA_AUTO_UP=y
+CONFIG_CONNINFRA_EMI_SUPPORT=y
+
+CONFIG_WARP_CHIPSET="mt7986"
+CONFIG_WARP_VERSION=2
+CONFIG_WED_HW_RRO_SUPPORT=y
+CONFIG_first_card_name="MT7986"
+
+CONFIG_PACKAGE_luci-ssl=y # uhttpd服务
+
+
+

+ 13 - 0
devices/mediatek_mt7986/diy.sh

@@ -0,0 +1,13 @@
+#!/bin/bash
+
+shopt -s extglob
+
+SHELL_FOLDER=$(dirname $(readlink -f "$0"))
+
+rm -rf package/feeds/kiddin9/rtl*
+
+rm -rf devices/common/patches/{glinet,imagebuilder.patch,iptables.patch,kernel-defaults.patch,targets.patch}
+
+rm -rf toolchain/musl
+
+svn co https://github.com/openwrt/openwrt/branches/openwrt-22.03/toolchain/musl toolchain/musl

+ 4 - 0
devices/mediatek_mt7986/feeds.conf

@@ -0,0 +1,4 @@
+src-git packages https://git.openwrt.org/feed/packages.git;openwrt-21.02
+src-git luci https://git.openwrt.org/project/luci.git;openwrt-21.02
+src-git routing https://git.openwrt.org/feed/routing.git;openwrt-21.02
+src-git kiddin9 https://github.com/kiddin9/openwrt-packages.git;master

+ 22 - 0
devices/mediatek_mt7986/patches/base-files.patch

@@ -0,0 +1,22 @@
+--- a/package/feeds/kiddin9/base-files/Makefile
++++ b/package/feeds/kiddin9/base-files/Makefile
+@@ -205,6 +205,9 @@ define Package/base-files/install
+ 
+ 	$(if $(CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE), \
+ 		rm -f $(1)/etc/banner.failsafe,)
++
++	$(if $(CONFIG_PACKAGE_wifi-profile), \
++		rm -f $(1)/sbin/wifi)
+ endef
+ 
+ ifneq ($(DUMP),1)
+
+--- a/package/feeds/kiddin9/base-files/files/etc/hotplug.d/net/00-sysctl
++++ b/package/feeds/kiddin9/base-files/files/etc/hotplug.d/net/00-sysctl
+@@ -6,4 +6,6 @@ if [ "$ACTION" = add ]; then
+ 		sed -ne "/^[[:space:]]*net\..*\.$DEVICENAME\./p" "$CONF" | \
+ 			sysctl -e -p - | logger -t sysctl
+ 	done
++
++	[ -f /sbin/smp.sh ] && /sbin/smp.sh
+ fi

+ 28 - 0
devices/mediatek_mt7986/patches/depends.patch

@@ -0,0 +1,28 @@
+--- a/target/linux/mediatek/image/mt7986.mk
++++ b/target/linux/mediatek/image/mt7986.mk
+@@ -356,10 +356,11 @@ TARGET_DEVICES += mediatek_mt7986-fpga-ubi
+ 
+ define Device/xiaomi_redmi-router-ax6000
+   DEVICE_VENDOR := Xiaomi
+-  DEVICE_MODEL := Redmi Router AX6000
++  DEVICE_MODEL := Redmi Router AX6000 (Uboot专用)
+   DEVICE_DTS := mt7986a-xiaomi-redmi-router-ax6000
+   DEVICE_DTS_DIR := $(DTS_DIR)/mediatek
+   DEVICE_PACKAGES := kmod-leds-ws2812b
++  DEVICE_PACKAGES := luci-app-mtk mii_mgr wifi-profile switch regs kmod-warp kmod-mt_wifi kmod-mediatek_hnat kmod-conninfra datconf-lua
+   SUPPORTED_DEVICES := xiaomi,redmi-router-ax6000
+   UBINIZE_OPTS := -E 5
+   BLOCKSIZE := 128k
+@@ -374,10 +375,11 @@ TARGET_DEVICES += xiaomi_redmi-router-ax6000
+ 
+ define Device/xiaomi_redmi-router-ax6000-stock
+   DEVICE_VENDOR := Xiaomi
+-  DEVICE_MODEL := Redmi Router AX6000 (stock layout)
++  DEVICE_MODEL := Redmi Router AX6000 (原厂布局)
+   DEVICE_DTS := mt7986a-xiaomi-redmi-router-ax6000-stock
+   DEVICE_DTS_DIR := $(DTS_DIR)/mediatek
+   DEVICE_PACKAGES := kmod-leds-ws2812b
++  DEVICE_PACKAGES := luci-app-mtk mii_mgr wifi-profile switch regs kmod-warp kmod-mt_wifi kmod-mediatek_hnat kmod-conninfra datconf-lua
+   SUPPORTED_DEVICES := xiaomi,redmi-router-ax6000-stock
+   UBINIZE_OPTS := -E 5
+   BLOCKSIZE := 128k

+ 122 - 0
devices/mediatek_mt7986/patches/imagebuilder.patch

@@ -0,0 +1,122 @@
+--- a/target/imagebuilder/Makefile
++++ b/target/imagebuilder/Makefile
+@@ -38,13 +38,15 @@ $(BIN_DIR)/$(IB_NAME).tar.xz: clean
+ 		./files/repositories.conf \
+ 		$(TMP_DIR)/.targetinfo \
+ 		$(TMP_DIR)/.packageinfo \
+-		$(PKG_BUILD_DIR)/
++		$(TOPDIR)/files \
++		$(PKG_BUILD_DIR)/ || true
+ 
+-ifeq ($(CONFIG_IB_STANDALONE),)
+ 	echo '## Remote package repositories' >> $(PKG_BUILD_DIR)/repositories.conf
+ 	$(call FeedSourcesAppend,$(PKG_BUILD_DIR)/repositories.conf)
+ 	$(VERSION_SED_SCRIPT) $(PKG_BUILD_DIR)/repositories.conf
+-endif
++	$(SED) 's/^src\/gz \(.*\) https.*top\/\(packages.*\)/src \1 file:\/\/www\/wwwroot\/op.supes.top\/\2/' $(PKG_BUILD_DIR)/repositories.conf
++	$(SED) 's/^src\/gz \(.*\) https.*top\/\(targets.*\)/src \1 file:\/\/www\/wwwroot\/op.supes.top\/releases\/\2/' $(PKG_BUILD_DIR)/repositories.conf
++	$(SED) 's/\/kiddin9//' $(PKG_BUILD_DIR)/repositories.conf
+ 
+ 	$(INSTALL_DIR) $(PKG_BUILD_DIR)/packages
+ 	# create an empty package index so `opkg` doesn't report an error
+
+--- a/target/imagebuilder/files/Makefile
++++ b/target/imagebuilder/files/Makefile
+@@ -115,17 +115,32 @@ BUILD_PACKAGES:=$(filter-out $(filter -%,$(BUILD_PACKAGES)) $(patsubst -%,%,$(fi
+ PACKAGES:=
+ 
+ _call_image: staging_dir/host/.prereq-build
++	[ "$(DATE)" ] && DATE="$(DATE)" || DATE="`date +'%m.%d.%Y'`"; \
++	mkdir -p $(USER_FILES)/etc/uci-defaults || true; \
++	echo -e " \
++	sed -i \"s/[0-9]\+.[0-9]\+.[0-9]\{4\}/$$DATE/\" /etc/openwrt_release \n \
++	sed -i \"s/DISTRIB_ID=.*/DISTRIB_ID='$(PARTSIZE)'/\" /etc/openwrt_release \n \
++	sed -i \"s/OpenWrt .* by/OpenWrt $$DATE by/\" /etc/banner \n \
++	echo \"$$DATE\" >/etc/openwrt_version \n \
++	"> $(USER_FILES)/etc/uci-defaults/99-version; \
+ 	echo 'Building images for $(BOARD)$(if $($(USER_PROFILE)_NAME), - $($(USER_PROFILE)_NAME))'
+ 	echo 'Packages: $(BUILD_PACKAGES)'
+ 	echo
+ 	rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG)
+ 	mkdir -p $(TARGET_DIR) $(BIN_DIR) $(TMP_DIR) $(DL_DIR)
++	if [[ "$(USER_PROFILE)" =~ (DEVICE_phicomm_k2p|DEVICE_asus_rt-n56u-b1|DEVICE_thunder_timecloud|DEVICE_youku_yk-l2|DEVICE_youhua_wr1200js|DEVICE_oraybox_x3a|DEVICE_netgear_wndr3700-v5|DEVICE_xiaomi_mi-router-4a-gigabit|DEVICE_xiaomi_mi-router-3g-v2|DEVICE_jcg_y2|DEVICE_glinet_gl-mt300a|DEVICE_glinet_gl-mt750|DEVICE_hiwifi_hc5661|DEVICE_hiwifi_hc5761|DEVICE_hiwifi_hc5861|DEVICE_lenovo_newifi-y1|DEVICE_lenovo_newifi-y1s|DEVICE_xiaomi_miwifi-mini|DEVICE_youku_yk-l1c|DEVICE_jdcloud_luban) || "$(TARGETID)" == "ramips/mt76x8" ]]; then \
++		echo "src/gz openwrt_smflash https://op.supes.top/packages/mipsel_24kc/small_flash" >>$(TOPDIR)/repositories.conf; \
++	else \
++		sed -i "/smflash/d" $(TOPDIR)/repositories.conf; \
++	fi
+ 	$(MAKE) package_reload
+ 	$(MAKE) package_install
+ 	$(MAKE) -s prepare_rootfs
+ 	$(MAKE) -s build_image
+ 	$(MAKE) -s json_overview_image_info
+ 	$(MAKE) -s checksum
++	rm -rf $(KERNEL_BUILD_DIR)/tmp
++	rm -rf $(KERNEL_BUILD_DIR)/root.*
+ 
+ _call_manifest: FORCE
+ 	rm -rf $(TARGET_DIR)
+@@ -166,7 +181,14 @@ package_install: FORCE
+ 	@echo Installing packages...
+ 	$(OPKG) install $(firstword $(wildcard $(LINUX_DIR)/libc_*.ipk $(PACKAGE_DIR)/libc_*.ipk))
+ 	$(OPKG) install $(firstword $(wildcard $(LINUX_DIR)/kernel_*.ipk $(PACKAGE_DIR)/kernel_*.ipk))
+-	$(OPKG) install $(BUILD_PACKAGES)
++	for p in $(BUILD_PACKAGES); do \
++		if [[ $$p == luci-app-* && "`$(OPKG) list | grep luci-i18n-\`echo $$p | cut -d - -f 3-\`-zh-cn`" ]]; then \
++			packages+="luci-i18n-`echo $$p | cut -d - -f 3-`-zh-cn "; \
++		fi \
++	done; \
++	$(OPKG) install --force-overwrite --force-checksum --force-depends $(BUILD_PACKAGES) luci-i18n-base-zh-cn luci-i18n-base-en; \
++	$(OPKG) install $$packages || true
++	$(OPKG) install --force-overwrite --force-checksum --force-depends --force-maintainer --force-reinstall my-default-settings
+ 
+ prepare_rootfs: FORCE
+ 	@echo
+@@ -180,12 +202,15 @@ prepare_rootfs: FORCE
+ 		) \
+ 	)
+ 	$(call prepare_rootfs,$(TARGET_DIR),$(USER_FILES),$(DISABLED_SERVICES))
++	if [[ "$(USER_PROFILE)" =~ (DEVICE_phicomm_k2p|DEVICE_asus_rt-n56u-b1|DEVICE_thunder_timecloud|DEVICE_youku_yk-l2|DEVICE_youhua_wr1200js|DEVICE_oraybox_x3a|DEVICE_netgear_wndr3700-v5|DEVICE_xiaomi_mi-router-4a-gigabit|DEVICE_xiaomi_mi-router-3g-v2|DEVICE_jcg_y2|DEVICE_glinet_gl-mt300a|DEVICE_glinet_gl-mt750|DEVICE_hiwifi_hc5661|DEVICE_hiwifi_hc5761|DEVICE_hiwifi_hc5861|DEVICE_lenovo_newifi-y1|DEVICE_lenovo_newifi-y1s|DEVICE_xiaomi_miwifi-mini|DEVICE_youku_yk-l1c|DEVICE_jdcloud_luban) || "$(TARGETID)" == "ramips/mt76x8" ]]; then \
++		echo "src/gz openwrt_smflash https://op.supes.top/packages/mipsel_24kc/small_flash" >>$(BUILD_DIR)/root-ramips/etc/opkg/distfeeds.conf; \
++	fi
+ 
+ build_image: FORCE
+ 	@echo
+ 	@echo Building images...
+ 	rm -rf $(BUILD_DIR)/json_info_files/
+-	$(NO_TRACE_MAKE) -C target/linux/$(BOARD)/image install TARGET_BUILD=1 IB=1 EXTRA_IMAGE_NAME="$(EXTRA_IMAGE_NAME)" \
++	nice -n 19 $(NO_TRACE_MAKE) -C target/linux/$(BOARD)/image install TARGET_BUILD=1 IB=1 EXTRA_IMAGE_NAME="$(EXTRA_IMAGE_NAME)" \
+ 		$(if $(USER_PROFILE),PROFILE="$(USER_PROFILE)")
+ 
+ $(BIN_DIR)/profiles.json: FORCE
+
+--- a/scripts/json_overview_image_info.py
++++ b/scripts/json_overview_image_info.py
+@@ -47,7 +47,7 @@ def get_initial_output(image_info):
+ 
+ 
+ if output:
+-    default_packages, output["arch_packages"] = run(
++    default_packages, output["arch_packages"], output["kernel_version"], output["initramfs"] = run(
+         [
+             "make",
+             "--no-print-directory",
+@@ -55,6 +55,8 @@ def get_initial_output(image_info):
+             "target/linux/",
+             "val.DEFAULT_PACKAGES",
+             "val.ARCH_PACKAGES",
++            "val.LINUX_VERSION",
++            "val.KERNEL_INITRAMFS",
+         ],
+         stdout=PIPE,
+         stderr=PIPE,
+
+--- a/rules.mk
++++ b/rules.mk
+@@ -59,6 +59,7 @@ _SINGLE=export MAKEFLAGS=$(space);
+ CFLAGS:=
+ ARCH:=$(subst i486,i386,$(subst i586,i386,$(subst i686,i386,$(call qstrip,$(CONFIG_ARCH)))))
+ ARCH_PACKAGES:=$(call qstrip,$(CONFIG_TARGET_ARCH_PACKAGES))
++KERNEL_INITRAMFS:=$(call qstrip,$(CONFIG_TARGET_ROOTFS_INITRAMFS))
+ BOARD:=$(call qstrip,$(CONFIG_TARGET_BOARD))
+ SUBTARGET:=$(call qstrip,$(CONFIG_TARGET_SUBTARGET))
+ TARGET_OPTIMIZATION:=$(call qstrip,$(CONFIG_TARGET_OPTIMIZATION))

+ 36 - 0
devices/mediatek_mt7986/patches/netifd.patch

@@ -0,0 +1,36 @@
+--- a/package/feeds/kiddin9/netifd/files/etc/init.d/network
++++ b/package/feeds/kiddin9/netifd/files/etc/init.d/network
+@@ -30,7 +30,7 @@ reload_service() {
+ 
+ 	init_switch
+ 	ubus call network reload || rv=1
+-	/sbin/wifi reload_legacy
++	/sbin/wifi up
+ 	return $rv
+ }
+ 
+@@ -40,6 +40,14 @@ stop_service() {
+ 	sleep 1
+ }
+ 
++
++
++
++service_running() {
++        ubus -t 120 wait_for network.interface.lan
++        /sbin/wifi reload_legacy
++}
++
+ validate_atm_bridge_section()
+ {
+ 	uci_validate_section network "atm-bridge" "${1}" \
+@@ -139,6 +147,7 @@ service_triggers()
+ }
+ 
+ shutdown() {
+-	ifdown -a
+-	sleep 1
++        /sbin/wifi down
++        ifdown -a
++        sleep 1
+ }

+ 67 - 0
devices/mediatek_mt7986/patches/targets.patch

@@ -0,0 +1,67 @@
+--- a/include/target.mk
++++ b/include/target.mk
+@@ -10,7 +10,7 @@ __target_inc=1
+ DEVICE_TYPE?=router
+ 
+ # Default packages - the really basic set
+-DEFAULT_PACKAGES:=\
++DEFAULT_PACKAGES:=luci-app-advanced luci-app-firewall luci-app-gpsysupgrade luci-app-opkg luci-app-upnp luci-app-autoreboot luci-app-wizard luci-base luci-compat luci-lib-ipkg luci-lib-fs coremark wget-ssl curl htop nano zram-swap kmod-lib-zstd kmod-tcp-bbr bash openssh-sftp-server block-mount resolveip ds-lite swconfig \
+ 	base-files \
+ 	ca-bundle \
+ 	dropbear \
+@@ -46,28 +46,31 @@ DEFAULT_PACKAGES.router:=\
+ 	dnsmasq-full \
+ 	firewall \
+ 	iptables \
+-	ipv6helper \
++	ip6tables \
++	kmod-ipt-nat \
++	kmod-ipt-nat6 \
++	kmod-ipt-offload \
++	odhcp6c \
++	odhcpd-ipv6only \
+ 	ppp \
+ 	ppp-mod-pppoe
+-# For easy usage
+-DEFAULT_PACKAGES.tweak:=\
+-	block-mount \
+-	default-settings-chn \
+-	kmod-ipt-raw \
+-	kmod-nf-nathelper \
+-	kmod-nf-nathelper-extra \
+-	luci \
+-	luci-app-filetransfer \
+-	luci-app-turboacc \
+-	luci-compat \
+-	luci-lib-base \
+-	luci-lib-fs \
+-	luci-lib-ipkg
+ 
+ ifneq ($(DUMP),)
+   all: dumpinfo
+ endif
+ 
++ifeq ($(ARCH),arm)
++  DEFAULT_PACKAGES+=autocore-arm luci-app-cpufreq
++endif
++
++ifeq ($(ARCH),aarch64)
++  DEFAULT_PACKAGES+=autocore-arm luci-app-cpufreq
++endif
++
++ifneq ($(CONFIG_USB_SUPPORT),)
++  DEFAULT_PACKAGES+=automount
++endif
++
+ target_conf=$(subst .,_,$(subst -,_,$(subst /,_,$(1))))
+ ifeq ($(DUMP),)
+   PLATFORM_DIR:=$(TOPDIR)/target/linux/$(BOARD)
+@@ -205,7 +208,7 @@ LINUX_RECONF_DIFF = $(SCRIPT_DIR)/kconfig.pl - '>' $(call __linux_confcmd,$(filt
+ ifeq ($(DUMP),1)
+   BuildTarget=$(BuildTargets/DumpCurrent)
+ 
+-  CPU_CFLAGS = -Os -pipe
++  CPU_CFLAGS = -O2 -pipe
+   ifneq ($(findstring mips,$(ARCH)),)
+     ifneq ($(findstring mips64,$(ARCH)),)
+       CPU_TYPE ?= mips64

+ 2 - 0
devices/mediatek_mt7986/settings.ini

@@ -0,0 +1,2 @@
+REPO_URL="https://github.com/hanwckf/immortalwrt-mt798x"
+REPO_BRANCH="openwrt-21.02"

+ 1 - 0
devices/ramips_mt7621/.config

@@ -40,6 +40,7 @@ CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_asus_rt-n56u-b1=y
 CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_gehua_ghl-r-001=y
 CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_raisecom_msg1500-x-00=y
 CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_zte_e8820s=y
+CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_zte_e8820v2=y
 CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_linksys_ea7500-v2=y
 CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_linksys_ea8100-v1=y
 CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_linksys_ea8100-v2=y

+ 1 - 1
devices/ramips_mt7621/patches/cr660x.patch

@@ -128,7 +128,7 @@ index bdaeac2cb16e..72fbd3930a80 100644
 +  IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
  	check-size
    DEVICE_PACKAGES += kmod-mt7915e uboot-envtools
-+  DEVICE_MODEL := Mi Router CR6606 / CR6608 / CR6609
++  DEVICE_MODEL := Mi Router CR660X / TR60X
  endef
 -
 -define Device/xiaomi_mi-router-cr6606

+ 281 - 84
devices/ramips_mt7621/patches/zte_e8820s.patch

@@ -1,23 +1,9 @@
-From a3c941d1267229a71da2a5cde5055698eadc0fd0 Mon Sep 17 00:00:00 2001
-From: coolsnowwolf <[email protected]>
-Date: Sat, 4 Sep 2021 15:23:48 +0800
-Subject: [PATCH] ramips: add ZTE e8820s support
-
----
- target/linux/ramips/dts/mt7621_zte_e8820s.dts | 197 ++++++++++++++++++
- target/linux/ramips/image/mt7621.mk           |  18 ++
- .../mt7621/base-files/etc/board.d/01_leds     |   6 +
- 3 files changed, 221 insertions(+)
- create mode 100644 target/linux/ramips/dts/mt7621_zte_e8820s.dts
-
 diff --git a/target/linux/ramips/dts/mt7621_zte_e8820s.dts b/target/linux/ramips/dts/mt7621_zte_e8820s.dts
 new file mode 100644
 index 000000000000..5a0012441509
 --- /dev/null
 +++ b/target/linux/ramips/dts/mt7621_zte_e8820s.dts
-@@ -0,0 +1,197 @@
-+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
-+
+@@ -0,0 +1,188 @@
 +#include "mt7621.dtsi"
 +
 +#include <dt-bindings/gpio/gpio.h>
@@ -30,37 +16,18 @@ index 000000000000..5a0012441509
 +	aliases {
 +		led-boot = &led_sys;
 +		led-failsafe = &led_sys;
-+		led-running = &led_power;
-+		led-upgrade = &led_power;
-+		label-mac-device = &gmac0;
-+	};
-+
-+	chosen {
-+		bootargs = "console=ttyS0,115200";
++		led-running = &led_sys;
++		led-upgrade = &led_sys;
 +	};
 +
 +	leds {
 +		compatible = "gpio-leds";
 +
-+		led_power: power {
-+			label = "white:power";
-+			gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
-+		};
-+
 +		led_sys: sys {
 +			label = "white:sys";
-+			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
-+		};
-+
-+		wlan2g {
-+			label = "white:wlan2g";
-+			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
++			gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
 +		};
 +
-+		wlan5g {
-+			label = "white:wlan5g";
-+			gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
-+		};
 +	};
 +
 +	keys {
@@ -68,7 +35,7 @@ index 000000000000..5a0012441509
 +
 +		reset {
 +			label = "reset";
-+			gpios = <&gpio 18 GPIO_ACTIVE_HIGH>;
++			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
 +			linux,code = <KEY_RESTART>;
 +		};
 +
@@ -84,22 +51,6 @@ index 000000000000..5a0012441509
 +			linux,code = <KEY_RFKILL>;
 +		};
 +	};
-+
-+	ubi-concat {
-+		compatible = "mtd-concat";
-+		devices = <&ubipart0 &ubipart1>;
-+
-+		partitions {
-+			compatible = "fixed-partitions";
-+			#address-cells = <1>;
-+			#size-cells = <1>;
-+
-+			ubi@0 {
-+				label = "ubi";
-+				reg = <0x0 0x79c0000>;
-+			};
-+		};
-+	};
 +};
 +
 +&nand {
@@ -117,7 +68,7 @@ index 000000000000..5a0012441509
 +		};
 +
 +		partition@80000 {
-+			label = "debug";
++			label = "u-boot-env";
 +			reg = <0x80000 0x80000>;
 +			read-only;
 +		};
@@ -133,48 +84,248 @@ index 000000000000..5a0012441509
 +			reg = <0x140000 0x400000>;
 +		};
 +
-+		ubipart0: partition@540000 {
-+			label = "ubipart0";
-+			reg = <0x540000 0x1c80000>;
++		partition@540000 {
++			label = "ubi";
++			reg = <0x540000 0x7A00000>;
 +		};
++	};
++};
 +
-+		partition@21c0000 {
-+			label = "bdinfo";
-+			reg = <0x21c0000 0x80000>;
-+			read-only;
++&pcie {
++	status = "okay";
++	reset-gpios = <&gpio 19 GPIO_ACTIVE_LOW>,
++				  <&gpio 4 GPIO_ACTIVE_LOW>;
++};
++
++&pcie0 {
++	wifi@0,0 {
++		compatible = "mediatek,mt76";
++		reg = <0x0000 0 0 0 0>;
++		mediatek,mtd-eeprom = <&factory 0x0000>;
++		nvmem-cells = <&macaddr_factory_e000>;
++		nvmem-cell-names = "mac-address";
++
++		led {
++			led-active-low;
++		};
++	};
++};
++
++&pcie1 {
++	wifi@0,0 {
++		compatible = "mediatek,mt76";
++		reg = <0x0000 0 0 0 0>;
++		mediatek,mtd-eeprom = <&factory 0x8000>;
++		nvmem-cells = <&macaddr_factory_e006>;
++		nvmem-cell-names = "mac-address";
++		ieee80211-freq-limit = <5000000 6000000>;
++
++		led {
++			led-sources = <2>;
++			led-active-low;
++		};
++	};
++};
++
++&gmac0 {
++	nvmem-cells = <&macaddr_factory_e000>;
++	nvmem-cell-names = "mac-address";
++};
++
++&gmac1 {
++	status = "okay";
++	label = "wan";
++	phy-handle = <&ethphy4>;
++
++	nvmem-cells = <&macaddr_factory_e000>;
++	nvmem-cell-names = "mac-address";
++	mac-address-increment = <1>;
++};
++
++&mdio {
++	ethphy4: ethernet-phy@4 {
++		reg = <4>;
++	};
++};
++
++&switch0 {
++	ports {
++		port@0 {
++			status = "okay";
++			label = "lan1";
 +		};
 +
-+		ubipart1: partition@2240000 {
-+			label = "ubipart1";
-+			reg = <0x2240000 0x5d40000>;
++		port@1 {
++			status = "okay";
++			label = "lan2";
++		};
++
++		port@2 {
++			status = "okay";
++			label = "lan3";
++		};
++
++		port@3 {
++			status = "okay";
++			label = "lan4";
++		};
++	};
++};
++
++&state_default {
++	gpio {
++		groups = "i2c", "jtag", "uart2", "uart3", "wdt";
++		function = "gpio";
++	};
++};
++
++&factory {
++	compatible = "nvmem-cells";
++	#address-cells = <1>;
++	#size-cells = <1>;
++
++	macaddr_factory_e000: macaddr@e000 {
++		reg = <0xe000 0x6>;
++	};
++
++	macaddr_factory_e006: macaddr@e006 {
++		reg = <0xe006 0x6>;
++	};
++};
+diff --git a/target/linux/ramips/dts/mt7621_zte_e8820v2.dts b/target/linux/ramips/dts/mt7621_zte_e8820v2.dts
+new file mode 100644
+index 000000000000..5a0012441509
+--- /dev/null
++++ b/target/linux/ramips/dts/mt7621_zte_e8820v2.dts
+@@ -0,0 +1,181 @@
++#include "mt7621.dtsi"
++
++#include <dt-bindings/gpio/gpio.h>
++#include <dt-bindings/input/input.h>
++
++/ {
++	compatible = "zte,e8820v2", "mediatek,mt7621-soc";
++	model = "ZTE E8820V2";
++
++	aliases {
++		led-boot = &led_sys;
++		led-failsafe = &led_sys;
++		led-running = &led_sys;
++		led-upgrade = &led_sys;
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		led_sys: sys {
++			label = "white:sys";
++			gpios = <&gpio 29 GPIO_ACTIVE_LOW>;
++		};
++
++		led_power: power {
++			label = "white:power";
++			gpios = <&gpio 31 GPIO_ACTIVE_LOW>;
++		};
++	};
++
++	keys {
++		compatible = "gpio-keys";
++
++		reset {
++			label = "reset";
++			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
++			linux,code = <KEY_RESTART>;
++		};
++
++		wps {
++			label = "wps";
++			gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
++			linux,code = <KEY_WPS_BUTTON>;
++		};
++	};
++};
++
++&spi0 {
++	status = "okay";
++
++	flash@0 {
++		compatible = "jedec,spi-nor";
++		reg = <0>;
++		spi-max-frequency = <10000000>;
++		broken-flash-reset;
++
++		partitions {
++			compatible = "fixed-partitions";
++			#address-cells = <1>;
++			#size-cells = <1>;
++
++			partition@0 {
++				label = "u-boot";
++				reg = <0x0 0x30000>;
++				read-only;
++			};
++
++			partition@30000 {
++				label = "u-boot-env";
++				reg = <0x30000 0x10000>;
++				read-only;
++			};
++
++			factory: partition@40000 {
++				label = "factory";
++				reg = <0x40000 0x10000>;
++				read-only;
++			};
++
++			partition@50000 {
++				compatible = "denx,uimage";
++				label = "firmware";
++				reg = <0x50000 0xfb0000>;
++			};
 +		};
 +	};
 +};
 +
 +&pcie {
 +	status = "okay";
++	reset-gpios = <&gpio 19 GPIO_ACTIVE_LOW>,
++				  <&gpio 4 GPIO_ACTIVE_LOW>;
 +};
 +
 +&pcie0 {
 +	wifi@0,0 {
-+		compatible = "pci14c3,7603";
++		compatible = "mediatek,mt76";
 +		reg = <0x0000 0 0 0 0>;
 +		mediatek,mtd-eeprom = <&factory 0x0000>;
-+		ieee80211-freq-limit = <2400000 2500000>;
++		nvmem-cells = <&macaddr_factory_e000>;
++		nvmem-cell-names = "mac-address";
++
++		led {
++			led-active-low;
++		};
 +	};
 +};
 +
 +&pcie1 {
 +	wifi@0,0 {
-+		compatible = "pci14c3,7662";
++		compatible = "mediatek,mt76";
 +		reg = <0x0000 0 0 0 0>;
 +		mediatek,mtd-eeprom = <&factory 0x8000>;
++		nvmem-cells = <&macaddr_factory_e006>;
++		nvmem-cell-names = "mac-address";
++
 +		ieee80211-freq-limit = <5000000 6000000>;
++		led {
++			led-sources = <2>;
++			led-active-low;
++		};
 +	};
 +};
 +
++
 +&gmac0 {
-+	mtd-mac-address = <&factory 0xe006>;
++	nvmem-cells = <&macaddr_factory_e000>;
++	nvmem-cell-names = "mac-address";
 +};
 +
 +&switch0 {
@@ -202,26 +353,40 @@ index 000000000000..5a0012441509
 +		port@4 {
 +			status = "okay";
 +			label = "wan";
-+			mtd-mac-address = <&factory 0xe000>;
++			nvmem-cells = <&macaddr_factory_e006>;
++			nvmem-cell-names = "mac-address";
 +		};
 +	};
 +};
 +
 +&state_default {
 +	gpio {
-+		groups = "jtag", "uart2", "uart3", "wdt";
++		groups = "i2c", "uart2", "uart3", "wdt";
 +		function = "gpio";
 +	};
 +};
++
++&factory {
++	compatible = "nvmem-cells";
++	#address-cells = <1>;
++	#size-cells = <1>;
++
++	macaddr_factory_e000: macaddr@e000 {
++		reg = <0xe000 0x6>;
++	};
++
++	macaddr_factory_e006: macaddr@e006 {
++		reg = <0xe006 0x6>;
++	};
++};
 diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
-index f563ebd28899..6a48655b0054 100644
+index 961f8a3b7514a..266ecd57ec8d5 100644
 --- a/target/linux/ramips/image/mt7621.mk
 +++ b/target/linux/ramips/image/mt7621.mk
-@@ -1726,3 +1726,22 @@ define Device/zyxel_wap6805
-   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+@@ -2205,6 +2205,35 @@ define Device/zio_freezio
  endef
- TARGET_DEVICES += zyxel_wap6805
-+
+ TARGET_DEVICES += zio_freezio
+ 
 +define Device/zte_e8820s
 +  $(Device/dsa-migration)
 +  $(Device/uimage-lzma-loader)
@@ -229,29 +394,61 @@ index f563ebd28899..6a48655b0054 100644
 +  PAGESIZE := 2048
 +  KERNEL_SIZE := 4096k
 +  UBINIZE_OPTS := -E 5
-+  IMAGE_SIZE := 32768k
++  IMAGE_SIZE := 130304k
 +  IMAGES += factory.bin
 +  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
 +  IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
 +	check-size
 +  DEVICE_VENDOR := ZTE
 +  DEVICE_MODEL := E8820S
-+  DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
-+	kmod-usb-ledtrig-usbport
++  DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 uboot-envtools
 +endef
 +TARGET_DEVICES += zte_e8820s
++
++define Device/zte_e8820v2
++  $(Device/dsa-migration)
++  $(Device/uimage-lzma-loader)
++  IMAGE_SIZE := 16064k
++  DEVICE_VENDOR := ZTE
++  DEVICE_MODEL := E8820V2
++  DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb2 \
++	  kmod-usb-ledtrig-usbport wpad-mini -wpad-basic-wolfssl -coremark -htop -bash -openssh-sftp-server
++endef
++TARGET_DEVICES += zte_e8820v2
++
+ define Device/zyxel_nr7101
+   $(Device/dsa-migration)
+   BLOCKSIZE := 128k
 diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
-index ad15b6401eb9..6fe6327dd324 100644
+index aad2e32b36210..a6a4707fc295d 100644
 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
 +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
-@@ -125,6 +125,10 @@ xiaomi,redmi-router-ac2100)
- youhua,wr1200js)
- 	ucidef_set_led_netdev "internet" "INTERNET" "green:wan" "wan"
+@@ -157,6 +157,16 @@ zbtlink,zbt-wg1608-16m)
+ 	ucidef_set_led_netdev "lan4" "LAN4" "green:lan-4" "lan4"
+ 	ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan"
  	;;
 +zte,e8820s)
++	ucidef_set_led_netdev "sys" "SYS_LED" "white:sys" "eth0" "tx rx"
++	ucidef_set_led_timer "power" "POWER_LED" "white:sys" "100" "8000"
 +	ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "white:wlan2g" "ra0"
 +	ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "white:wlan5g" "rai0"
-+	;;	
++	;;
++zte,e8820v2)
++	ucidef_set_led_netdev "sys" "SYS_LED" "white:sys" "eth0" "tx rx"
++	ucidef_set_led_timer "power" "POWER_LED" "white:power" "100" "8000"
++	;;
  esac
  
  board_config_flush
+diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
+index 6cfc852c11c25..0a73fed98927b 100755
+--- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
++++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
+@@ -96,6 +96,7 @@ platform_do_upgrade() {
+ 	xiaomi,mi-router-cr6608|\
+ 	xiaomi,mi-router-cr6609|\
+ 	xiaomi,redmi-router-ac2100|\
++	zte,e8820s|\
+ 	zyxel,nwa50ax|\
+ 	zyxel,nwa55axe)
+ 		nand_do_upgrade "$1"

+ 0 - 1
devices/rockchip_armv8/.config

@@ -3,7 +3,6 @@ CONFIG_TARGET_rockchip=y
 CONFIG_TARGET_rockchip_armv8=y
 CONFIG_TARGET_MULTI_PROFILE=y
 CONFIG_TARGET_ALL_PROFILES=y
-CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_xunlong_orangepi-r1-plus-lts=n
 
 CONFIG_PACKAGE_kmod-rtl8821cu=m
 CONFIG_PACKAGE_kmod-rtl88x2bu=m

+ 1 - 0
devices/x86_64/diy.sh

@@ -10,6 +10,7 @@ svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/x86/patches-5.15
 rm -rf target/linux/x86/patches-5.15/.svn
 
 curl -sfL https://raw.githubusercontent.com/coolsnowwolf/lede/master/package/kernel/linux/modules/video.mk -o package/kernel/linux/modules/video.mk
+curl -sfL https://raw.githubusercontent.com/coolsnowwolf/lede/master/target/linux/x86/base-files/etc/board.d/02_network -o target/linux/x86/base-files/etc/board.d/02_network
 
 sed -i "s/ +PACKAGE_kmod-backlight:kmod-backlight//" package/kernel/linux/modules/video.mk