kiddin9 3 лет назад
Родитель
Сommit
aa9df48a60

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

@@ -68,7 +68,7 @@ jobs:
             echo "MTARGET=x86_64" >> $GITHUB_ENV
         elif [[ ${{matrix.target}} =~ (armvirt_64|ipq807x|mediatek_mt7622|bcm27xx_bcm2710) ]]; then
             echo "MTARGET=aarch64_cortex-a53" >> $GITHUB_ENV
-        elif [[ ${{matrix.target}} =~ (ramips_mt7621|ramips_mt76x8) ]]; then
+        elif [[ ${{matrix.target}} =~ (ramips_mt7621|ramips_mt7620|ramips_mt76x8) ]]; then
             echo "MTARGET=mipsel_24kc" >> $GITHUB_ENV
         elif [[ ${{matrix.target}} =~ (ipq40xx_generic|bcm27xx_bcm2709) ]]; then
             echo "MTARGET=arm_cortex-a7_neon-vfpv4" >> $GITHUB_ENV

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

@@ -95,6 +95,11 @@ jobs:
           -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": "ramips_mt7620", "client_payload": {"target": "ramips_mt7620"}}'
+          curl \
+          -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": "ramips_mt76x8", "client_payload": {"target": "ramips_mt76x8"}}'
           curl \
           -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \

+ 21 - 0
devices/ramips_mt7620/.config

@@ -0,0 +1,21 @@
+
+CONFIG_TARGET_ramips=y
+CONFIG_TARGET_ramips_mt7620=y
+CONFIG_TARGET_MULTI_PROFILE=y
+CONFIG_TARGET_DEVICE_ramips_mt7620_DEVICE_glinet_gl-mt300a=y
+CONFIG_TARGET_DEVICE_ramips_mt7620_DEVICE_glinet_gl-mt750=y
+CONFIG_TARGET_DEVICE_ramips_mt7620_DEVICE_hiwifi_hc5661=y
+CONFIG_TARGET_DEVICE_ramips_mt7620_DEVICE_hiwifi_hc5761=y
+CONFIG_TARGET_DEVICE_ramips_mt7620_DEVICE_hiwifi_hc5861=y
+CONFIG_TARGET_DEVICE_ramips_mt7620_DEVICE_lenovo_newifi-y1=y
+CONFIG_TARGET_DEVICE_ramips_mt7620_DEVICE_lenovo_newifi-y1s=y
+CONFIG_TARGET_DEVICE_ramips_mt7620_DEVICE_xiaomi_miwifi-mini=y
+CONFIG_TARGET_DEVICE_ramips_mt7620_DEVICE_youku_yk-l1=y
+CONFIG_TARGET_DEVICE_ramips_mt7620_DEVICE_youku_yk-l1c=y
+
+CONFIG_PACKAGE_luci-ssl=y # uhttpd服务
+
+CONFIG_PACKAGE_kmod-shortcut-fe=n
+CONFIG_PACKAGE_kmod-shortcut-fe-cm=n
+
+CONFIG_PACKAGE_kmod-fs-ntfs3-oot=n

+ 6 - 0
devices/ramips_mt7620/diy.sh

@@ -0,0 +1,6 @@
+#!/bin/bash
+
+shopt -s extglob
+
+
+

+ 402 - 0
devices/ramips_mt7620/patches/cr660x.patch

@@ -0,0 +1,402 @@
+From 593d238ebf777c36c9ee819a1e20f59da5adc361 Mon Sep 17 00:00:00 2001
+From: kiddin9 <[email protected]>
+Date: Tue, 5 Jul 2022 17:54:53 +0800
+Subject: [PATCH] Update mt7621.mk
+
+Signed-off-by: kiddin9 <[email protected]>
+---
+ target/linux/ramips/image/mt7621.mk | 46 +++++++++--------------------
+ 1 file changed, 14 insertions(+), 32 deletions(-)
+
+diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
+index bdaeac2cb16e..72fbd3930a80 100644
+--- a/target/linux/ramips/image/mt7621.mk
++++ b/target/linux/ramips/image/mt7621.mk
+@@ -223,7 +223,7 @@ define Device/asus_rt-n56u-b1
+   DEVICE_VARIANT := B1
+   IMAGE_SIZE := 16064k
+   DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
+-	kmod-usb-ledtrig-usbport
++	kmod-usb-ledtrig-usbport wpad-mini -wpad-basic-wolfssl -coremark -htop -bash -openssh-sftp-server
+ endef
+ TARGET_DEVICES += asus_rt-n56u-b1
+ 
+@@ -984,7 +984,7 @@ define Device/jcg_y2
+   JCG_MAXSIZE := 16064k
+   DEVICE_VENDOR := JCG
+   DEVICE_MODEL := Y2
+-  DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware kmod-usb3
++  DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware kmod-usb3 wpad-mini -wpad-basic-wolfssl -coremark -htop -bash -openssh-sftp-server
+ endef
+ TARGET_DEVICES += jcg_y2
+ 
+@@ -1000,6 +1000,16 @@ define Device/lenovo_newifi-d1
+ endef
+ TARGET_DEVICES += lenovo_newifi-d1
+ 
++define Device/jdcloud_re-sp-01b
++  $(Device/dsa-migration)
++  $(Device/uimage-lzma-loader)
++  IMAGE_SIZE := 32448k
++  DEVICE_VENDOR := JDCloud
++  DEVICE_MODEL := RE-SP-01B
++  DEVICE_PACKAGES := kmod-fs-ext4 kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware kmod-sdhci-mt7620 kmod-usb3
++ endef
++  TARGET_DEVICES += jdcloud_re-sp-01b
++
+ define Device/linksys_e5600
+   $(Device/dsa-migration)
+   $(Device/uimage-lzma-loader)
+@@ -1369,7 +1379,7 @@ define Device/netgear_wndr3700-v5
+   SERCOMM_SWVER := 0x1054
+   SERCOMM_PAD := 320k
+   DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
+-	kmod-usb-ledtrig-usbport
++	kmod-usb-ledtrig-usbport wpad-mini -wpad-basic-wolfssl -coremark -htop -bash -openssh-sftp-server
+   SUPPORTED_DEVICES += wndr3700v5
+ endef
+ TARGET_DEVICES += netgear_wndr3700-v5
+@@ -1400,7 +1410,7 @@ define Device/oraybox_x3a
+   IMAGE_SIZE := 15360k
+   DEVICE_VENDOR := OrayBox
+   DEVICE_MODEL := X3A
+-  DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware
++  DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware wpad-mini -wpad-basic-wolfssl -coremark -htop -bash -openssh-sftp-server
+ endef
+ TARGET_DEVICES += oraybox_x3a
+ 
+@@ -1412,7 +1422,7 @@ define Device/phicomm_k2p
+   DEVICE_ALT0_VENDOR := Phicomm
+   DEVICE_ALT0_MODEL := KE 2P
+   SUPPORTED_DEVICES += k2p
+-  DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware
++  DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware wpad-mini -wpad-basic-wolfssl -coremark -htop -bash -openssh-sftp-server
+ endef
+ TARGET_DEVICES += phicomm_k2p
+ 
+@@ -1533,7 +1543,7 @@ define Device/thunder_timecloud
+   IMAGE_SIZE := 16064k
+   DEVICE_VENDOR := Thunder
+   DEVICE_MODEL := Timecloud
+-  DEVICE_PACKAGES := kmod-usb3 -wpad-basic-wolfssl
++  DEVICE_PACKAGES := kmod-usb3 -wpad-basic-wolfssl -bash -openssh-sftp-server -coremark -htop
+   SUPPORTED_DEVICES += timecloud
+ endef
+ TARGET_DEVICES += thunder_timecloud
+@@ -1843,7 +1853,6 @@ define Device/xiaomi_nand_separate
+   PAGESIZE := 2048
+   KERNEL_SIZE := 4096k
+   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
+@@ -1866,7 +1875,7 @@ define Device/xiaomi_mi-router-3g-v2
+   DEVICE_VENDOR := Xiaomi
+   DEVICE_MODEL := Mi Router 3G
+   DEVICE_VARIANT := v2
+-  DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2
++  DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-mini -wpad-basic-wolfssl -coremark -htop -bash -openssh-sftp-server
+   SUPPORTED_DEVICES += xiaomi,mir3g-v2
+ endef
+ TARGET_DEVICES += xiaomi_mi-router-3g-v2
+@@ -1881,7 +1890,6 @@ define Device/xiaomi_mi-router-3-pro
+   IMAGE_SIZE := 255488k
+   DEVICE_VENDOR := Xiaomi
+   DEVICE_MODEL := Mi Router 3 Pro
+-  IMAGES += factory.bin
+   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+   IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
+ 	check-size
+@@ -1906,7 +1914,7 @@ define Device/xiaomi_mi-router-4a-gigabit
+   DEVICE_VENDOR := Xiaomi
+   DEVICE_MODEL := Mi Router 4A
+   DEVICE_VARIANT := Gigabit Edition
+-  DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2
++  DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-mini -wpad-basic-wolfssl -coremark -htop -bash -openssh-sftp-server
+ endef
+ TARGET_DEVICES += xiaomi_mi-router-4a-gigabit
+ 
+@@ -1927,30 +1935,14 @@ define Device/xiaomi_mi-router-cr660x
+   KERNEL_SIZE := 4096k
+   UBINIZE_OPTS := -E 5
+   IMAGE_SIZE := 128512k
+-  IMAGES += firmware.bin
++  IMAGES += factory.bin
+   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+-  IMAGE/firmware.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
++  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
+ endef
+-
+-define Device/xiaomi_mi-router-cr6606
+-  $(Device/xiaomi_mi-router-cr660x)
+-  DEVICE_MODEL := Mi Router CR6606
+-endef
+-TARGET_DEVICES += xiaomi_mi-router-cr6606
+-
+-define Device/xiaomi_mi-router-cr6608
+-  $(Device/xiaomi_mi-router-cr660x)
+-  DEVICE_MODEL := Mi Router CR6608
+-endef
+-TARGET_DEVICES += xiaomi_mi-router-cr6608
+-
+-define Device/xiaomi_mi-router-cr6609
+-  $(Device/xiaomi_mi-router-cr660x)
+-  DEVICE_MODEL := Mi Router CR6609
+-endef
+-TARGET_DEVICES += xiaomi_mi-router-cr6609
++TARGET_DEVICES += xiaomi_mi-router-cr660x
+ 
+ define Device/xiaomi_redmi-router-ac2100
+   $(Device/xiaomi_nand_separate)
+@@ -1985,7 +1977,7 @@ define Device/youhua_wr1200js
+   DEVICE_VENDOR := YouHua
+   DEVICE_MODEL := WR1200JS
+   DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
+-	kmod-usb-ledtrig-usbport
++	kmod-usb-ledtrig-usbport wpad-mini -wpad-basic-wolfssl -coremark -htop -bash -openssh-sftp-server
+ endef
+ TARGET_DEVICES += youhua_wr1200js
+ 
+@@ -1995,7 +1987,7 @@ define Device/youku_yk-l2
+   DEVICE_VENDOR := Youku
+   DEVICE_MODEL := YK-L2
+   DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
+-	kmod-usb-ledtrig-usbport
++	kmod-usb-ledtrig-usbport wpad-mini -wpad-basic-wolfssl -coremark -htop -bash -openssh-sftp-server
+ endef
+ TARGET_DEVICES += youku_yk-l2
+ 
+
+--- /dev/null
++++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-cr660x.dts
+@@ -0,0 +1,8 @@
++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
++
++#include "mt7621_xiaomi_mi-router-cr660x.dtsi"
++
++/ {
++	compatible = "xiaomi,mi-router-cr660x", "mediatek,mt7621-soc";
++	model = "Xiaomi Mi Router CR6606 / CR6608 / CR6609";
++};
+
+--- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
++++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
+@@ -131,9 +131,7 @@ tplink,tl-wpa8631p-v3)
+ xiaomi,mi-router-ac2100)
+ 	ucidef_set_led_netdev "wan-blue" "WAN (blue)" "blue:wan" "wan"
+ 	;;
+-xiaomi,mi-router-cr6606|\
+-xiaomi,mi-router-cr6608|\
+-xiaomi,mi-router-cr6609)
++xiaomi,mi-router-cr660x)
+ 	ucidef_set_led_netdev "internet" "Internet" "blue:net" "wan"
+ 	;;
+ xiaomi,redmi-router-ac2100)
+
+--- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
++++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
+@@ -28,9 +28,7 @@ ramips_setup_interfaces()
+ 	hiwifi,hc5962|\
+ 	xiaomi,mi-router-3-pro|\
+ 	xiaomi,mi-router-ac2100|\
+-	xiaomi,mi-router-cr6606|\
+-	xiaomi,mi-router-cr6608|\
+-	xiaomi,mi-router-cr6609|\
++	xiaomi,mi-router-cr660x|\
+ 	xiaomi,redmi-router-ac2100)
+ 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
+ 		;;
+@@ -45,6 +43,7 @@ ramips_setup_interfaces()
+ 	iptime,a3002mesh|\
+ 	jcg,q20|\
+ 	lenovo,newifi-d1|\
++	jdcloud,re-sp-01b|\
+ 	mikrotik,routerboard-m33g|\
+ 	oraybox,x3a|\
+ 	renkforce,ws-wn530hp3-a|\
+
+--- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
++++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
+@@ -88,9 +88,7 @@ platform_do_upgrade() {
+ 	xiaomi,mi-router-3-pro|\
+ 	xiaomi,mi-router-4|\
+ 	xiaomi,mi-router-ac2100|\
+-	xiaomi,mi-router-cr6606|\
+-	xiaomi,mi-router-cr6608|\
+-	xiaomi,mi-router-cr6609|\
++	xiaomi,mi-router-cr660x|\
+ 	xiaomi,redmi-router-ac2100)
+ 		nand_do_upgrade "$1"
+ 		;;
+
+--- a/package/boot/uboot-envtools/files/ramips
++++ b/package/boot/uboot-envtools/files/ramips
+@@ -73,9 +73,7 @@ zyxel,nr7101)
+ 		ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
+ 	;;
+ bolt,arion|\
+-xiaomi,mi-router-cr6606|\
+-xiaomi,mi-router-cr6608|\
+-xiaomi,mi-router-cr6609)
++xiaomi,mi-router-cr660x)
+ 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
+ 	;;
+ esac
+
+--- /dev/null
++++ b/target/linux/ramips/dts/mt7621_jdcloud_re-sp-01b.dts
+@@ -0,0 +1,150 @@
++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
++
++#include "mt7621.dtsi"
++
++#include <dt-bindings/gpio/gpio.h>
++#include <dt-bindings/input/input.h>
++
++/ {
++	compatible = "jdcloud,re-sp-01b", "mediatek,mt7621-soc";
++	model = "JDCloud RE-SP-01B";
++
++	aliases {
++		led-boot = &led_red;
++		led-failsafe = &led_red;
++		led-running = &led_green;
++		led-upgrade = &led_blue;
++		label-mac-device = &gmac0;
++	};
++
++	chosen {
++		bootargs = "console=ttyS0,115200";
++	};
++
++	keys {
++		compatible = "gpio-keys";
++
++		reset {
++			label = "reset";
++			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
++			linux,code = <KEY_RESTART>;
++		};
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		led_red: red {
++			label = "red:sys";
++			gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
++			panic-indicator;
++		};
++
++		led_green: green {
++			label = "green:sys";
++			gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
++		};
++
++		led_blue: blue {
++			label = "blue:sys";
++			gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
++		};
++	};
++};
++
++&sdhci {
++	status = "okay";
++};
++
++&spi0 {
++	status = "okay";
++
++	flash@0 {
++		compatible = "jedec,spi-nor";
++		reg = <0>;
++		spi-max-frequency = <50000000>;
++
++		partitions {
++			compatible = "fixed-partitions";
++			#address-cells = <1>;
++			#size-cells = <1>;
++
++			partition@0 {
++				label = "u-boot";
++				reg = <0x0 0x30000>;
++				read-only;
++			};
++
++			config: partition@30000 {
++				label = "config";
++				reg = <0x30000 0x10000>;
++				read-only;
++			};
++
++			factory: partition@40000 {
++				label = "factory";
++				reg = <0x40000 0x10000>;
++				read-only;
++			};
++
++			partition@50000 {
++				compatible = "denx,uimage";
++				label = "firmware";
++				reg = <0x50000 0x1fb0000>;
++			};
++		};
++	};
++};
++
++&gmac0 {
++	mtd-mac-address-ascii = <&config 0x4429>;
++};
++
++&switch0 {
++	ports {
++		port@0 {
++			status = "okay";
++			label = "wan";
++		};
++
++		port@1 {
++			status = "okay";
++			label = "lan1";
++		};
++
++		port@2 {
++			status = "okay";
++			label = "lan2";
++		};
++	};
++};
++
++&pcie {
++	status = "okay";
++};
++
++&pcie0 {
++	wifi@0,0 {
++		reg = <0x0000 0 0 0 0>;
++		mtd-mac-address-ascii = <&config 0x4429>;
++		mediatek,mtd-eeprom = <&factory 0x0>;
++	};
++};
++
++&pcie1 {
++	wifi@0,0 {
++		reg = <0x0000 0 0 0 0>;
++		mtd-mac-address-ascii = <&config 0x4429>;
++		mtd-mac-address-increment = <0x80>;
++		mtd-mac-address-increment-byte = <3>;
++		mediatek,mtd-eeprom = <&factory 0x8000>;
++		ieee80211-freq-limit = <5000000 6000000>;
++	};
++};
++
++&state_default {
++	gpio {
++		groups = "uart2", "uart3", "wdt";
++		function = "gpio";
++	};
++};

+ 19 - 0
devices/ramips_mt7620/patches/tblsection.patch

@@ -0,0 +1,19 @@
+--- a/package/feeds/luci/luci-compat/luasrc/view/cbi/tblsection.htm
++++ b/package/feeds/luci/luci-compat/luasrc/view/cbi/tblsection.htm
+@@ -123,6 +123,7 @@ <h3><%=self.title%></h3>
+ 
+ 			local isempty, section, i, k = true, nil, nil
+ 		    for i, k in ipairs(self:cfgsections()) do
++		    	if i <= 100 then
+ 				isempty = false
+ 				section = k
+ 
+@@ -165,6 +166,8 @@ <h3><%=self.title%></h3>
+ 				</td>
+ 			<%- end -%>
+ 		</tr>
++			<%- i=i+1 -%>
++			<%- end -%>
+ 		<%- end -%>
+ 
+ 		<%- if isempty then -%>