diff --git a/.github/workflows/Openwrt-AutoBuild.yml b/.github/workflows/Openwrt-AutoBuild.yml index ff2807d8e123..f554fc007faf 100644 --- a/.github/workflows/Openwrt-AutoBuild.yml +++ b/.github/workflows/Openwrt-AutoBuild.yml @@ -116,11 +116,11 @@ jobs: DEBIAN_FRONTEND: noninteractive run: | sudo -E apt-get -qq update - sudo -E apt-get -qq install build-essential clang flex g++ gawk gcc-multilib gettext \ + sudo -E apt-get -qq install build-essential clang llvm flex g++ gawk gcc-multilib gettext \ git libncurses5-dev libssl-dev python3-distutils python3-pyelftools python3-setuptools \ libpython3-dev rsync unzip zlib1g-dev swig aria2 jq subversion qemu-utils ccache rename \ libelf-dev device-tree-compiler libgnutls28-dev coccinelle libgmp3-dev libmpc-dev - sudo -E apt-get -qq purge azure-cli ghc* zulu* llvm* firefox powershell openjdk* dotnet* google* mysql* php* android* + sudo -E apt-get -qq purge azure-cli ghc* zulu* firefox powershell openjdk* dotnet* google* mysql* php* android* sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc sudo -E apt-get -qq autoremove --purge sudo -E apt-get -qq clean @@ -247,10 +247,11 @@ jobs: shopt -s extglob cd openwrt echo -e "$(($(nproc)+1)) thread compile" - make -j$(($(nproc)+1)) || make V=s &>build.log || (tail -50 build.log; curl -k --data chat_id="${{ env.TELEGRAM_CHAT_ID }}" --data "text=❌ OpenWrt ${{ env.VERSION }} ${{matrix.target}} 编译失败 😂" "https://api.telegram.org/bot${{ env.TELEGRAM_TOKEN }}/sendMessage";exit 1) + make -j$(($(nproc)+1)) || make V=s &>build.log || (tail -50 build.log; curl -k --data chat_id="${{ env.TELEGRAM_CHAT_ID }}" --data "text=❌ OpenWrt ${{ env.VERSION }} ${{matrix.target}} 编译失败 😂" "https://api.telegram.org/bot${{ env.TELEGRAM_TOKEN }}/sendMessage";df -hT;exit 1) sed -i "s/# CONFIG_IB is not set/CONFIG_IB=y/" .config rm -rf staging_dir/toolchain-*/bin/*openwrt-linux-musl-lto-dump rm -rf staging_dir/toolchain-*/initial + df -hT - name: Organize files id: organize @@ -287,7 +288,7 @@ jobs: REMOTE_HOST: ${{ secrets.SERVER_HOST }} REMOTE_PORT: ${{ secrets.SERVER_PORT }} REMOTE_USER: root - TARGET: "/www/wwwroot/op.supes.top/releases/tmp/" + TARGET: "/www/wwwroot/dl.openwrt.ai/releases/tmp/" - name: Upload firmware for artifact uses: actions/upload-artifact@main @@ -323,7 +324,7 @@ jobs: continue-on-error: true run: | echo -e "墙内加速下载 🚀:\n" >> release.txt - echo -e "[腾讯云] (https://op.supes.top/firmware/${{matrix.target}}/ ☁)\n" >> release.txt + echo -e "[腾讯云] (https://dl.openwrt.ai/firmware/${{matrix.target}}/ ☁)\n" >> release.txt [ ${{ env.WETRANS }} ] && echo -e "[WeTransfer] (${{ env.WETRANS }} 🗽)\n" >> release.txt [ ${{ env.COWURL }} ] && echo -e "[奶牛上传] (${{ env.COWURL }} 🐮)\n" >> release.txt [ ${{ env.NOTICE }} ] && echo -e "${{ env.NOTICE }}" >> release.txt || true @@ -374,7 +375,7 @@ jobs: if: env.TELEGRAM_TOKEN && ! contains(github.event.action, 'notg') continue-on-error: true run: | - curl -k --data chat_id="${{ env.TELEGRAM_CHAT_ID }}" --data "text=🎉 OpenWrt ${{ env.VERSION }} ${{matrix.target}} 编译成功 😋 https://op.supes.top/firmware/${{matrix.target}}/ ${{ env.COWURL }} ${{ env.WETRANS }} 🚀" "https://api.telegram.org/bot${{ env.TELEGRAM_TOKEN }}/sendMessage" + curl -k --data chat_id="${{ env.TELEGRAM_CHAT_ID }}" --data "text=🎉 OpenWrt ${{ env.VERSION }} ${{matrix.target}} 编译成功 😋 https://dl.openwrt.ai/firmware/${{matrix.target}}/ ${{ env.COWURL }} ${{ env.WETRANS }} 🚀" "https://api.telegram.org/bot${{ env.TELEGRAM_TOKEN }}/sendMessage" - name: Delete workflow runs uses: GitRML/delete-workflow-runs@main diff --git a/devices/common/.config b/devices/common/.config index b70e2c395fdf..6cc90e7faf67 100644 --- a/devices/common/.config +++ b/devices/common/.config @@ -5,7 +5,6 @@ CONFIG_TARGET_ROOTFS_EXT4FS=n CONFIG_TARGET_ROOTFS_CPIOGZ=n CONFIG_LUCI_CSSTIDY=n -CONFIG_GRUB_CONSOLE=n CONFIG_SIGNED_PACKAGES=n CONFIG_SIGNATURE_CHECK=n diff --git a/devices/common/diy.sh b/devices/common/diy.sh index 6398fd3b9a2d..cde18d9ac70c 100644 --- a/devices/common/diy.sh +++ b/devices/common/diy.sh @@ -37,11 +37,11 @@ mv -f feeds/kiddin9/r81* tmp/ sed -i "s/192.168.1/10.0.0/" package/feeds/kiddin9/base-files/files/bin/config_generate sed -i "s/192.168.1/10.0.0/" package/base-files/files/bin/config_generate -( -svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/generic/hack-5.15 target/linux/generic/hack-5.15 +#sed -i "/call Build\/check-size,\$\$(KERNEL_SIZE)/d" include/image.mk + +svn checkout https://github.com/coolsnowwolf/lede/trunk/target/linux/generic/hack-5.15 target/linux/generic/hack-5.15 curl -sfL https://raw.githubusercontent.com/coolsnowwolf/lede/master/target/linux/generic/pending-5.15/613-netfilter_optional_tcp_window_check.patch -o target/linux/generic/pending-5.15/613-netfilter_optional_tcp_window_check.patch sed -i "s/CONFIG_WERROR=y/CONFIG_WERROR=n/" target/linux/generic/config-5.15 -) & grep -q "23.05" include/version.mk && [ -d package/kernel/mt76 ] && { mkdir package/kernel/mt76/patches @@ -50,7 +50,7 @@ curl -sfL https://raw.githubusercontent.com/immortalwrt/immortalwrt/master/packa grep -q "1.8.8" package/network/utils/iptables/Makefile && { rm -rf package/network/utils/iptables -svn co https://github.com/openwrt/openwrt/branches/openwrt-22.03/package/network/utils/iptables package/network/utils/iptables +svn export https://github.com/openwrt/openwrt/branches/openwrt-22.03/package/network/utils/iptables package/network/utils/iptables } grep -q 'PKG_RELEASE:=9' package/libs/openssl/Makefile && { diff --git a/devices/common/patches/fix.patch b/devices/common/patches/fix.patch index c21654add9fd..33b006041ba8 100644 --- a/devices/common/patches/fix.patch +++ b/devices/common/patches/fix.patch @@ -110,3 +110,15 @@ "images": [ { "type": getenv("FILE_TYPE"), + +--- a/package/system/procd/files/procd.sh ++++ b/package/system/procd/files/procd.sh +@@ -260,7 +260,7 @@ _procd_set_param() { + reload_signal) + json_add_int "$type" $(kill -l "$1") + ;; +- pidfile|user|group|seccomp|capabilities|facility|\ ++ pidfile|user|group|capabilities|facility|\ + extroot|overlaydir|tmpoverlaysize) + json_add_string "$type" "$1" + ;; diff --git a/devices/common/patches/imagebuilder.patch b/devices/common/patches/imagebuilder.patch index 0438379ca530..39b25ff95921 100644 --- a/devices/common/patches/imagebuilder.patch +++ b/devices/common/patches/imagebuilder.patch @@ -13,8 +13,8 @@ $(call FeedSourcesAppend,$(PKG_BUILD_DIR)/repositories.conf) $(VERSION_SED_SCRIPT) $(PKG_BUILD_DIR)/repositories.conf -endif -+ $(SED) 's/^src\/gz \(.*\) https.*ai\/\(.*packages.*\)/src \1 file:\/\/www\/wwwroot\/op.supes.top\/\2/' $(PKG_BUILD_DIR)/repositories.conf -+ $(SED) 's/^src\/gz \(.*\) https.*ai\/\(.*targets.*\)/src \1 file:\/\/www\/wwwroot\/op.supes.top\/\2/' $(PKG_BUILD_DIR)/repositories.conf ++ $(SED) 's/^src\/gz \(.*\) https.*ai\/\(.*packages.*\)/src \1 file:\/\/www\/wwwroot\/dl.openwrt.ai\/\2/' $(PKG_BUILD_DIR)/repositories.conf ++ $(SED) 's/^src\/gz \(.*\) https.*ai\/\(.*targets.*\)/src \1 file:\/\/www\/wwwroot\/dl.openwrt.ai\/\2/' $(PKG_BUILD_DIR)/repositories.conf + $(SED) '/openwrt_core/d' $(PKG_BUILD_DIR)/repositories.conf $(INSTALL_DIR) $(PKG_BUILD_DIR)/packages diff --git a/devices/ipq50xx_arm/patches/cr880x.patch b/devices/ipq50xx_arm/patches/cr880x.patch deleted file mode 100644 index de6ed84c2d72..000000000000 --- a/devices/ipq50xx_arm/patches/cr880x.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/target/linux/ipq50xx/image/Makefile -+++ b/target/linux/ipq50xx/image/Makefile -@@ -35,6 +35,8 @@ define Device/redmi_ax3000 - SOC := ipq5000 - DEVICE_VENDOR := Redmi - DEVICE_MODEL := AX3000 -+ DEVICE_ALT0_VENDOR := Xiaomi -+ DEVICE_ALT0_MODEL := CR880X - BLOCKSIZE := 128k - PAGESIZE := 2048 - DEVICE_DTS_CONFIG := config@mp02.1 \ No newline at end of file diff --git a/devices/mediatek_filogic/.config b/devices/mediatek_filogic/.config index fe4bc9d295b7..e8865da9aad6 100644 --- a/devices/mediatek_filogic/.config +++ b/devices/mediatek_filogic/.config @@ -12,4 +12,7 @@ CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_h3c_magic-nx30-pro=y CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_xiaomi_mi-router-wr30u-112m-nmbm=y CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_xiaomi_redmi-router-ax6000=y CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_qihoo_360t7=y +CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_xiaomi_mi-router-ax3000t=y +CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_jcg_q30-pro=y +CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_glinet_gl-mt6000=y CONFIG_PACKAGE_luci-ssl=y # uhttpd服务 diff --git a/devices/mediatek_filogic/patches/360t7.patch b/devices/mediatek_filogic/patches/1-360t7.patch similarity index 100% rename from devices/mediatek_filogic/patches/360t7.patch rename to devices/mediatek_filogic/patches/1-360t7.patch diff --git a/devices/mediatek_filogic/patches/ax6000.patch b/devices/mediatek_filogic/patches/2-ax6000.patch similarity index 100% rename from devices/mediatek_filogic/patches/ax6000.patch rename to devices/mediatek_filogic/patches/2-ax6000.patch diff --git a/devices/mediatek_filogic/patches/nx30.patch b/devices/mediatek_filogic/patches/3-nx30.patch similarity index 100% rename from devices/mediatek_filogic/patches/nx30.patch rename to devices/mediatek_filogic/patches/3-nx30.patch diff --git a/devices/mediatek_filogic/patches/4-ax3000t.patch b/devices/mediatek_filogic/patches/4-ax3000t.patch new file mode 100644 index 000000000000..699ca30da96d --- /dev/null +++ b/devices/mediatek_filogic/patches/4-ax3000t.patch @@ -0,0 +1,375 @@ +From 02b57804f8602ff95f298be332d471283759e27c Mon Sep 17 00:00:00 2001 +From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> +Date: Fri, 15 Sep 2023 23:06:10 +0800 +Subject: [PATCH] mediatek: add Xiaomi AX3000T support + +--- + .../uboot-envtools/files/mediatek_filogic | 1 + + .../mediatek/dts/mt7981b-xiaomi-ax3000t.dts | 49 ++++ + .../dts/mt7981b-xiaomi_mi-router.dtsi | 241 ++++++++++++++++ + .../filogic/base-files/etc/board.d/02_network | 4 +- + target/linux/mediatek/image/filogic.mk | 14 + + 7 files changed, 325 insertions(+), 248 deletions(-) + create mode 100644 target/linux/mediatek/dts/mt7981b-xiaomi-ax3000t.dts + create mode 100644 target/linux/mediatek/dts/mt7981b-xiaomi_mi-router.dtsi + +diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic +index a8def1d00b764..3ad8f80c750e0 100644 +--- a/package/boot/uboot-envtools/files/mediatek_filogic ++++ b/package/boot/uboot-envtools/files/mediatek_filogic +@@ -62,6 +62,7 @@ + tplink,tl-xdr4288|\ + tplink,tl-xdr6086|\ + tplink,tl-xdr6088|\ ++xiaomi,mi-router-ax3000t|\ + xiaomi,mi-router-wr30u-ubootmod|\ + xiaomi,redmi-router-ax6000-ubootmod) + . /lib/upgrade/nand.sh + +diff --git a/target/linux/mediatek/dts/mt7981b-xiaomi-ax3000t.dts b/target/linux/mediatek/dts/mt7981b-xiaomi-ax3000t.dts +new file mode 100644 +index 0000000000000..96f7680ef23a8 +--- /dev/null ++++ b/target/linux/mediatek/dts/mt7981b-xiaomi-ax3000t.dts +@@ -0,0 +1,49 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++/dts-v1/; ++ ++#include "mt7981b-xiaomi_mi-router.dtsi" ++ ++/ { ++ model = "Xiaomi Mi Router AX3000T"; ++ compatible = "xiaomi,mi-router-ax3000t", "mediatek,mt7981"; ++}; ++ ++&gmac0 { ++ nvmem-cells = <&macaddr_factory_4>; ++ nvmem-cell-names = "mac-address"; ++ mac-address-increment = <(-2)>; ++}; ++ ++&i2c0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c_pins>; ++ status = "okay"; ++ ++ nfc@57 { ++ compatible = "nt082c"; ++ reg = <0x57>; ++ }; ++}; ++ ++&partitions { ++ partition@600000 { ++ label = "ubi"; ++ reg = <0x0600000 0x6400000>; ++ }; ++ ++ partition@6a00000 { ++ label = "data"; ++ reg = <0x6a00000 0x0c00000>; ++ read-only; ++ }; ++}; ++ ++&pio { ++ i2c_pins: i2c-pins { ++ mux { ++ function = "i2c"; ++ groups = "i2c0_1"; ++ }; ++ }; ++}; +diff --git a/target/linux/mediatek/dts/mt7981b-xiaomi_mi-router.dtsi b/target/linux/mediatek/dts/mt7981b-xiaomi_mi-router.dtsi +new file mode 100644 +index 0000000000000..3b0e158a0b812 +--- /dev/null ++++ b/target/linux/mediatek/dts/mt7981b-xiaomi_mi-router.dtsi +@@ -0,0 +1,241 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++#include ++#include ++ ++#include "mt7981.dtsi" ++ ++/ { ++ aliases { ++ serial0 = &uart0; ++ led-boot = &led_system_orange; ++ led-failsafe = &led_system_blue; ++ led-running = &led_system_blue; ++ led-upgrade = &led_system_orange; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ memory { ++ reg = <0 0x40000000 0 0x10000000>; ++ }; ++ ++ gpio-keys { ++ compatible = "gpio-keys"; ++ ++ reset { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&pio 1 GPIO_ACTIVE_LOW>; ++ }; ++ ++ mesh { ++ label = "mesh"; ++ linux,code = ; ++ linux,input-type = ; ++ gpios = <&pio 0 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ leds: leds { ++ compatible = "gpio-leds"; ++ ++ led_system_blue: system_blue { ++ label = "blue:system"; ++ gpios = <&pio 9 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led_system_orange: system_orange { ++ label = "orange:system"; ++ gpios = <&pio 10 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++ð { ++ status = "okay"; ++ ++ gmac0: mac@0 { ++ compatible = "mediatek,eth-mac"; ++ reg = <0>; ++ phy-mode = "2500base-x"; ++ ++ fixed-link { ++ speed = <2500>; ++ full-duplex; ++ pause; ++ }; ++ }; ++}; ++ ++&mdio_bus { ++ switch: switch@0 { ++ compatible = "mediatek,mt7531"; ++ reg = <31>; ++ reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; ++ interrupt-controller; ++ #interrupt-cells = <1>; ++ interrupt-parent = <&pio>; ++ interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; ++ }; ++}; ++ ++&spi0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spi0_flash_pins>; ++ status = "okay"; ++ ++ spi_nand@0 { ++ compatible = "spi-nand"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ reg = <0>; ++ ++ spi-max-frequency = <52000000>; ++ spi-tx-bus-width = <4>; ++ spi-rx-bus-width = <4>; ++ ++ mediatek,nmbm; ++ mediatek,bmt-max-ratio = <1>; ++ mediatek,bmt-max-reserved-blocks = <64>; ++ ++ partitions: partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "BL2"; ++ reg = <0x0000000 0x0100000>; ++ read-only; ++ }; ++ ++ partition@100000 { ++ label = "Nvram"; ++ reg = <0x0100000 0x0040000>; ++ read-only; ++ }; ++ ++ partition@140000 { ++ label = "Bdata"; ++ reg = <0x0140000 0x0040000>; ++ read-only; ++ }; ++ ++ factory: partition@180000 { ++ label = "Factory"; ++ reg = <0x0180000 0x0200000>; ++ read-only; ++ ++ compatible = "nvmem-cells"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ macaddr_factory_4: macaddr@4 { ++ reg = <0x4 0x6>; ++ }; ++ }; ++ ++ partition@380000 { ++ label = "FIP"; ++ reg = <0x0380000 0x0200000>; ++ read-only; ++ }; ++ ++ partition@580000 { ++ label = "crash"; ++ reg = <0x0580000 0x0040000>; ++ read-only; ++ }; ++ ++ partition@5c0000 { ++ label = "crash_log"; ++ reg = <0x05c0000 0x0040000>; ++ read-only; ++ }; ++ ++ partition@7600000 { ++ label = "KF"; ++ reg = <0x7600000 0x0040000>; ++ read-only; ++ }; ++ }; ++ }; ++}; ++ ++&switch { ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@6 { ++ reg = <6>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ phy-mode = "2500base-x"; ++ ++ fixed-link { ++ speed = <2500>; ++ full-duplex; ++ pause; ++ }; ++ }; ++ }; ++}; ++ ++&pio { ++ spi0_flash_pins: spi0-pins { ++ mux { ++ function = "spi"; ++ groups = "spi0", "spi0_wp_hold"; ++ }; ++ ++ conf-pu { ++ pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP"; ++ drive-strength = <8>; ++ mediatek,pull-up-adv = <0>; /* bias-disable */ ++ }; ++ ++ conf-pd { ++ pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; ++ drive-strength = <8>; ++ mediatek,pull-up-adv = <0>; /* bias-disable */ ++ }; ++ }; ++}; ++ ++&uart0 { ++ status = "okay"; ++}; ++ ++&watchdog { ++ status = "okay"; ++}; ++ ++&wifi { ++ status = "okay"; ++ ++ mediatek,mtd-eeprom = <&factory 0x0>; ++}; +diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +index f760b23dc417b..9e0d53912912e 100644 +--- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network ++++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +@@ -52,6 +52,7 @@ + tplink,tl-xdr6086) + ucidef_set_interfaces_lan_wan "lan1 lan2" eth1 + ;; ++ xiaomi,mi-router-ax3000t|\ + xiaomi,mi-router-wr30u-112m-nmbm|\ + xiaomi,mi-router-wr30u-stock|\ + xiaomi,mi-router-wr30u-ubootmod|\ +@@ -101,6 +102,7 @@ + wan_mac=$(macaddr_add "$lan_mac" 1) + label_mac=$wan_mac + ;; ++ xiaomi,mi-router-ax3000t|\ + xiaomi,mi-router-wr30u-112m-nmbm|\ + xiaomi,mi-router-wr30u-stock|\ + xiaomi,mi-router-wr30u-ubootmod|\ +diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk +index 282054886b56e..413860a1a672c 100644 +--- a/target/linux/mediatek/image/filogic.mk ++++ b/target/linux/mediatek/image/filogic.mk +@@ -417,6 +417,20 @@ + endef + TARGET_DEVICES += tplink_tl-xdr6088 + ++define Device/xiaomi_mi-router-ax3000t ++ DEVICE_VENDOR := Xiaomi ++ DEVICE_MODEL := Mi Router AX3000T ++ DEVICE_DTS := mt7981b-xiaomi-ax3000t ++ DEVICE_DTS_DIR := ../dts ++ UBINIZE_OPTS := -E 5 ++ BLOCKSIZE := 128k ++ PAGESIZE := 2048 ++ KERNEL_IN_UBI := 1 ++ DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware ++ IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata ++endef ++TARGET_DEVICES += xiaomi_mi-router-ax3000t ++ + define Device/xiaomi_mi-router-wr30u-112m-nmbm + DEVICE_VENDOR := Xiaomi + DEVICE_MODEL := Mi Router WR30U (112M UBI with NMBM-Enabled layout) diff --git a/devices/mediatek_filogic/patches/5-gl-mt6000.patch b/devices/mediatek_filogic/patches/5-gl-mt6000.patch new file mode 100644 index 000000000000..a340c58f3e0b --- /dev/null +++ b/devices/mediatek_filogic/patches/5-gl-mt6000.patch @@ -0,0 +1,791 @@ +From fe10f9743935d6986e80e7cb082469e6bc5a03f0 Mon Sep 17 00:00:00 2001 +From: Jianhui Zhao +Date: Sun, 24 Sep 2023 22:34:12 +0800 +Subject: [PATCH] filogic: add support for GL.iNet GL-MT6000 + +Hardware specification: +* SoC: MediaTek MT7986A 4x A53 +* Flash: 8GB EMMC +* RAM: 1GB DDR4 +* Ethernet: + * 2x2.5G RJ45 port (RTL8221B) + * 4x1G RJ45 ports (MT7531AE) +* WLAN: + * 2.4GHz: MT7976GN 4T4R + * 5GHz: MT7976AN 4T4R +* Button: Reset +* LED: 1 x dual color LED +* USB: 1 x USB 3.0 +* Power: DC 12V 4A +* UART: 3V3 115200 8N1 (Pinout: GND TX RX VCC) +* JTAG: 9 PIN + +If you want to use u-boot from OpenWrt, you can upgrade it safely. +* bl2: openwrt-mediatek-filogic-glinet_gl-mt6000-preloader.bin +* fip: openwrt-mediatek-filogic-glinet_gl-mt6000-bl31-uboot.fip + +`openwrt-mediatek-filogic-glinet_gl-mt6000-squashfs-factory.bin` is used in OpenWrt's u-boot. + +Signed-off-by: Jianhui Zhao +--- + .../uboot-envtools/files/mediatek_filogic | 4 + + package/boot/uboot-mediatek/Makefile | 13 + + .../patches/436-add-glinet-mt6000.patch | 274 ++++++++++++++++ + .../mediatek/dts/mt7986a-glinet-gl-mt6000.dts | 306 ++++++++++++++++++ + .../filogic/base-files/etc/board.d/02_network | 6 + + .../etc/hotplug.d/firmware/11-mt76-caldata | 7 + + .../etc/hotplug.d/ieee80211/11_fix_wifi_mac | 5 + + .../base-files/lib/upgrade/platform.sh | 6 + + target/linux/mediatek/image/filogic.mk | 15 + + 9 files changed, 636 insertions(+) + create mode 100644 package/boot/uboot-mediatek/patches/436-add-glinet-mt6000.patch + create mode 100644 target/linux/mediatek/dts/mt7986a-glinet-gl-mt6000.dts + +diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic +index 803800ce1c751..4b8fe6b80126e 100644 +--- a/package/boot/uboot-envtools/files/mediatek_filogic ++++ b/package/boot/uboot-envtools/files/mediatek_filogic +@@ -40,6 +40,10 @@ bananapi,bpi-r3) + glinet,gl-mt3000) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x20000" + ;; ++glinet,gl-mt6000) ++ local envdev=$(find_mmc_part "u-boot-env") ++ ubootenv_add_uci_config "$envdev" "0x0" "0x80000" ++ ;; + mercusys,mr90x-v1) + local envdev=/dev/mtd$(find_mtd_index "u-boot-env") + ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x20000" "1" +diff --git a/package/boot/uboot-mediatek/Makefile b/package/boot/uboot-mediatek/Makefile +index 62199871e6b33..1a97570031c43 100644 +--- a/package/boot/uboot-mediatek/Makefile ++++ b/package/boot/uboot-mediatek/Makefile +@@ -357,6 +357,18 @@ define U-Boot/mt7986_bananapi_bpi-r3-nor + FIP_COMPRESS:=1 + endef + ++define U-Boot/mt7986_glinet_gl-mt6000 ++ NAME:=GL.iNet GL-MT6000 ++ BUILD_SUBTARGET:=filogic ++ BUILD_DEVICES:=glinet_gl-mt6000 ++ UBOOT_CONFIG:=mt7986a_glinet_gl-mt6000 ++ UBOOT_IMAGE:=u-boot.fip ++ BL2_BOOTDEV:=emmc ++ BL2_SOC:=mt7986 ++ BL2_DDRTYPE:=ddr4 ++ DEPENDS:=+trusted-firmware-a-mt7986-emmc-ddr4 ++endef ++ + define U-Boot/mt7986_tplink_tl-xdr4288 + NAME:=TP-LINK TL-XDR4288 + BUILD_SUBTARGET:=filogic +@@ -496,6 +508,7 @@ UBOOT_TARGETS := \ + mt7986_bananapi_bpi-r3-sdmmc \ + mt7986_bananapi_bpi-r3-snand \ + mt7986_bananapi_bpi-r3-nor \ ++ mt7986_glinet_gl-mt6000 \ + mt7986_tplink_tl-xdr4288 \ + mt7986_tplink_tl-xdr6086 \ + mt7986_tplink_tl-xdr6088 \ +diff --git a/package/boot/uboot-mediatek/patches/436-add-glinet-mt6000.patch b/package/boot/uboot-mediatek/patches/436-add-glinet-mt6000.patch +new file mode 100644 +index 0000000000000..ad138acfd921d +--- /dev/null ++++ b/package/boot/uboot-mediatek/patches/436-add-glinet-mt6000.patch +@@ -0,0 +1,274 @@ ++--- /dev/null +++++ b/arch/arm/dts/mt7986a-glinet-gl-mt6000.dts ++@@ -0,0 +1,135 @@ +++// SPDX-License-Identifier: GPL-2.0 +++ +++/dts-v1/; +++#include +++#include +++ +++#include "mt7986.dtsi" +++ +++/ { +++ model = "GL.iNet GL-MT6000"; +++ compatible = "glinet,gl-mt6000", "mediatek,mt7986-emmc-rfb", "mediatek,mt7986"; +++ +++ chosen { +++ stdout-path = &uart0; +++ tick-timer = &timer0; +++ }; +++ +++ memory@40000000 { +++ device_type = "memory"; +++ reg = <0x40000000 0x40000000>; +++ }; +++ +++ reg_1p8v: regulator-1p8v { +++ compatible = "regulator-fixed"; +++ regulator-name = "fixed-1.8V"; +++ regulator-min-microvolt = <1800000>; +++ regulator-max-microvolt = <1800000>; +++ regulator-boot-on; +++ regulator-always-on; +++ }; +++ +++ reg_3p3v: regulator-3p3v { +++ compatible = "regulator-fixed"; +++ regulator-name = "fixed-3.3V"; +++ regulator-min-microvolt = <3300000>; +++ regulator-max-microvolt = <3300000>; +++ regulator-boot-on; +++ regulator-always-on; +++ }; +++ +++ keys { +++ compatible = "gpio-keys"; +++ +++ wps { +++ label = "reset"; +++ gpios = <&gpio 9 GPIO_ACTIVE_LOW>; +++ linux,code = ; +++ }; +++ }; +++ +++ leds { +++ compatible = "gpio-leds"; +++ +++ led_status_blue: green { +++ label = "blue:status"; +++ gpios = <&gpio 28 GPIO_ACTIVE_LOW>; +++ }; +++ +++ led_status_white: blue { +++ label = "white:status"; +++ gpios = <&gpio 27 GPIO_ACTIVE_LOW>; +++ }; +++ }; +++ +++}; +++ +++&uart0 { +++ mediatek,force-highspeed; +++ status = "okay"; +++}; +++ +++ð { +++ status = "okay"; +++ mediatek,gmac-id = <0>; +++ phy-mode = "2500base-x"; +++ mediatek,switch = "mt7531"; +++ reset-gpios = <&gpio 18 GPIO_ACTIVE_HIGH>; +++ +++ fixed-link { +++ speed = <2500>; +++ full-duplex; +++ }; +++}; +++ +++&pinctrl { +++ mmc0_pins_default: mmc0default { +++ mux { +++ function = "flash"; +++ groups = "emmc_51"; +++ }; +++ +++ conf-cmd-dat { +++ pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2", +++ "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5", +++ "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD"; +++ input-enable; +++ drive-strength = ; +++ bias-pull-up = ; +++ }; +++ +++ conf-clk { +++ pins = "EMMC_CK"; +++ drive-strength = ; +++ bias-pull-down = ; +++ }; +++ +++ conf-dsl { +++ pins = "EMMC_DSL"; +++ bias-pull-down = ; +++ }; +++ +++ conf-rst { +++ pins = "EMMC_RSTB"; +++ drive-strength = ; +++ bias-pull-up = ; +++ }; +++ }; +++}; +++ +++&mmc0 { +++ pinctrl-names = "default"; +++ pinctrl-0 = <&mmc0_pins_default>; +++ bus-width = <8>; +++ max-frequency = <200000000>; +++ cap-mmc-highspeed; +++ cap-mmc-hw-reset; +++ vmmc-supply = <®_3p3v>; +++ vqmmc-supply = <®_1p8v>; +++ non-removable; +++ status = "okay"; +++}; +++ +++&wmcpu_emi { +++ status = "disabled"; +++}; ++--- /dev/null +++++ b/configs/mt7986a_glinet_gl-mt6000_defconfig ++@@ -0,0 +1,105 @@ +++CONFIG_ARM=y +++CONFIG_SYS_HAS_NONCACHED_MEMORY=y +++CONFIG_POSITION_INDEPENDENT=y +++CONFIG_ARCH_MEDIATEK=y +++CONFIG_TEXT_BASE=0x41e00000 +++CONFIG_SYS_MALLOC_F_LEN=0x4000 +++CONFIG_NR_DRAM_BANKS=1 +++CONFIG_ENV_SIZE=0x80000 +++CONFIG_ENV_OFFSET=0x400000 +++CONFIG_DEFAULT_DEVICE_TREE="mt7986a-glinet-gl-mt6000" +++CONFIG_SYS_PROMPT="MT7986> " +++CONFIG_OF_LIBFDT_OVERLAY=y +++CONFIG_TARGET_MT7986=y +++CONFIG_PRE_CON_BUF_ADDR=0x4007EF00 +++CONFIG_DEBUG_UART_BASE=0x11002000 +++CONFIG_DEBUG_UART_CLOCK=40000000 +++CONFIG_SYS_LOAD_ADDR=0x46000000 +++CONFIG_DEBUG_UART=y +++CONFIG_AHCI=y +++CONFIG_FIT=y +++CONFIG_AUTOBOOT_KEYED=y +++CONFIG_AUTOBOOT_MENU_SHOW=y +++CONFIG_DEFAULT_FDT_FILE="mediatek/mt7986a-glinet-gl-mt6000.dtb" +++CONFIG_LOGLEVEL=7 +++CONFIG_PRE_CONSOLE_BUFFER=y +++CONFIG_LOG=y +++CONFIG_BOARD_LATE_INIT=y +++CONFIG_HUSH_PARSER=y +++CONFIG_CMD_CPU=y +++CONFIG_CMD_LICENSE=y +++CONFIG_CMD_BOOTMENU=y +++CONFIG_CMD_ASKENV=y +++CONFIG_CMD_ERASEENV=y +++CONFIG_CMD_ENV_FLAGS=y +++CONFIG_CMD_STRINGS=y +++CONFIG_CMD_DM=y +++CONFIG_CMD_GPIO=y +++CONFIG_CMD_PWM=y +++CONFIG_CMD_GPT=y +++CONFIG_CMD_MMC=y +++CONFIG_CMD_PART=y +++CONFIG_CMD_USB=y +++CONFIG_CMD_DHCP=y +++CONFIG_CMD_TFTPSRV=y +++CONFIG_CMD_RARP=y +++CONFIG_CMD_PING=y +++CONFIG_CMD_CDP=y +++CONFIG_CMD_SNTP=y +++CONFIG_CMD_DNS=y +++CONFIG_CMD_LINK_LOCAL=y +++CONFIG_CMD_CACHE=y +++CONFIG_CMD_PSTORE=y +++CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000 +++CONFIG_CMD_UUID=y +++CONFIG_CMD_HASH=y +++CONFIG_CMD_SMC=y +++CONFIG_OF_EMBED=y +++CONFIG_ENV_OVERWRITE=y +++CONFIG_ENV_IS_IN_MMC=y +++CONFIG_SYS_RELOC_GD_ENV_ADDR=y +++CONFIG_USE_DEFAULT_ENV_FILE=y +++CONFIG_DEFAULT_ENV_FILE="glinet_gl-mt6000_env" +++CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +++CONFIG_VERSION_VARIABLE=y +++CONFIG_NET_RANDOM_ETHADDR=y +++CONFIG_NETCONSOLE=y +++CONFIG_USE_IPADDR=y +++CONFIG_IPADDR="192.168.1.1" +++CONFIG_USE_SERVERIP=y +++CONFIG_SERVERIP="192.168.1.254" +++CONFIG_REGMAP=y +++CONFIG_SYSCON=y +++CONFIG_BUTTON=y +++CONFIG_BUTTON_GPIO=y +++CONFIG_CLK=y +++CONFIG_GPIO_HOG=y +++CONFIG_LED=y +++CONFIG_LED_BLINK=y +++CONFIG_LED_GPIO=y +++CONFIG_SUPPORT_EMMC_BOOT=y +++CONFIG_MMC_HS200_SUPPORT=y +++CONFIG_MMC_MTK=y +++CONFIG_PHY_FIXED=y +++CONFIG_MEDIATEK_ETH=y +++CONFIG_PHY=y +++CONFIG_PHY_MTK_TPHY=y +++CONFIG_PINCTRL=y +++CONFIG_PINCONF=y +++CONFIG_PINCTRL_MT7986=y +++CONFIG_POWER_DOMAIN=y +++CONFIG_MTK_POWER_DOMAIN=y +++CONFIG_DM_REGULATOR=y +++CONFIG_DM_REGULATOR_FIXED=y +++CONFIG_DM_REGULATOR_GPIO=y +++CONFIG_DM_PWM=y +++CONFIG_PWM_MTK=y +++CONFIG_RAM=y +++CONFIG_DM_SERIAL=y +++CONFIG_MTK_SERIAL=y +++CONFIG_USB=y +++CONFIG_USB_XHCI_HCD=y +++CONFIG_USB_XHCI_MTK=y +++CONFIG_USB_STORAGE=y +++CONFIG_HEXDUMP=y +++CONFIG_LMB_MAX_REGIONS=64 ++--- /dev/null +++++ b/glinet_gl-mt6000_env ++@@ -0,0 +1,25 @@ +++ipaddr=192.168.1.1 +++serverip=192.168.1.254 +++loadaddr=0x46000000 +++bootdelay=3 +++bootfile_bl2=openwrt-mediatek-filogic-glinet_gl-mt6000-preloader.bin +++bootfile_fip=openwrt-mediatek-filogic-glinet_gl-mt6000-bl31-uboot.fip +++bootfile_firmware=openwrt-mediatek-filogic-glinet_gl-mt6000-squashfs-factory.bin +++bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60 +++bootmenu_title= *** U-Boot Boot Menu for GL-iNet GL-MT6000 *** +++bootmenu_0=Startup system (Default).=run boot_system +++bootmenu_1=Load Firmware via TFTP then write to eMMC.=run boot_tftp_firmware ; run bootmenu_confirm_return +++bootmenu_2=Load BL31+U-Boot FIP via TFTP then write to eMMC.=run boot_tftp_write_fip ; run bootmenu_confirm_return +++bootmenu_3=mLoad BL2 preloader via TFTP then write to eMMC.=run boot_tftp_write_bl2 ; run bootmenu_confirm_return +++bootmenu_4=Reboot.=reset +++bootmenu_5=Reset all settings to factory defaults.=run reset_factory ; reset +++filesize_to_blk=setexpr cnt $filesize + 0x1ff && setexpr cnt $cnt / 0x200 +++mmc_read_kernel=mmc read $loadaddr $part_addr 0x100 && imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc read $loadaddr $part_addr $image_size +++boot_system=part start mmc 0 kernel part_addr && part size mmc 0 kernel part_size && run mmc_read_kernel && bootm +++boot_tftp_firmware=tftpboot $loadaddr $bootfile_firmware && run emmc_write_firmware +++boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run emmc_write_fip +++boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run emmc_write_bl2 +++emmc_write_firmware=part start mmc 0 kernel part_addr && run filesize_to_blk && mmc write $loadaddr $part_addr $cnt +++emmc_write_bl2=run filesize_to_blk && test 0x$cnt -le 0x800 && mmc partconf 0 1 1 1 && && mmc write $loadaddr 0x0 0x800 ; mmc partconf 0 1 1 0 +++emmc_write_fip=part start mmc 0 fip part_addr && part size mmc 0 fip part_size && run filesize_to_blk && test 0x$cnt -le 0x$part_size && mmc write $loadaddr $part_addr $cnt +++reset_factory=eraseenv && reset +diff --git a/target/linux/mediatek/dts/mt7986a-glinet-gl-mt6000.dts b/target/linux/mediatek/dts/mt7986a-glinet-gl-mt6000.dts +new file mode 100644 +index 0000000000000..2be1907f632f1 +--- /dev/null ++++ b/target/linux/mediatek/dts/mt7986a-glinet-gl-mt6000.dts +@@ -0,0 +1,306 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++/dts-v1/; ++#include ++#include ++#include ++ ++#include "mt7986a.dtsi" ++ ++/ { ++ model = "GL.iNet GL-MT6000"; ++ compatible = "glinet,gl-mt6000", "mediatek,mt7986a"; ++ ++ aliases { ++ serial0 = &uart0; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ bootargs-append = " root=PARTLABEL=rootfs rootwait"; ++ }; ++ ++ reg_1p8v: regulator-1p8v { ++ compatible = "regulator-fixed"; ++ regulator-name = "1.8vd"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-boot-on; ++ regulator-always-on; ++ }; ++ ++ reg_3p3v: regulator-3p3v { ++ compatible = "regulator-fixed"; ++ regulator-name = "fixed-3.3V"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-boot-on; ++ regulator-always-on; ++ }; ++ ++ keys { ++ compatible = "gpio-keys"; ++ ++ reset { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&pio 9 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led_run: led@0 { ++ label = "blue:run"; ++ gpios = <&pio 38 GPIO_ACTIVE_LOW>; ++ default-state = "on"; ++ }; ++ ++ led@1 { ++ label = "white:system"; ++ gpios = <&pio 37 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ usb_vbus: regulator-usb-vbus { ++ compatible = "regulator-fixed"; ++ regulator-name = "usb_vbus"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ gpios = <&pio 24 GPIO_ACTIVE_HIGH>; ++ enable-active-high; ++ regulator-boot-on; ++ }; ++}; ++ ++ð { ++ status = "okay"; ++ ++ gmac0: mac@0 { ++ compatible = "mediatek,eth-mac"; ++ reg = <0>; ++ phy-mode = "2500base-x"; ++ ++ fixed-link { ++ speed = <2500>; ++ full-duplex; ++ pause; ++ }; ++ }; ++ ++ gmac1: mac@1 { ++ compatible = "mediatek,eth-mac"; ++ reg = <1>; ++ phy-mode = "2500base-x"; ++ phy-handle = <&phy1>; ++ }; ++ ++ mdio: mdio-bus { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ phy1: phy@1 { ++ compatible = "ethernet-phy-ieee802.3-c45"; ++ reg = <1>; ++ reset-assert-us = <100000>; ++ reset-deassert-us = <100000>; ++ reset-gpios = <&pio 10 GPIO_ACTIVE_LOW>; ++ interrupt-parent = <&pio>; ++ interrupts = <46 IRQ_TYPE_LEVEL_LOW>; ++ realtek,aldps-enable; ++ }; ++ ++ phy7: ethernet-phy@7 { ++ compatible = "ethernet-phy-ieee802.3-c45"; ++ reg = <7>; ++ reset-assert-us = <100000>; ++ reset-deassert-us = <100000>; ++ reset-gpios = <&pio 19 GPIO_ACTIVE_LOW>; ++ interrupt-parent = <&pio>; ++ interrupts = <47 IRQ_TYPE_LEVEL_LOW>; ++ realtek,aldps-enable; ++ }; ++ ++ switch: switch@31 { ++ compatible = "mediatek,mt7531"; ++ reg = <31>; ++ reset-gpios = <&pio 18 GPIO_ACTIVE_HIGH>; ++ interrupt-controller; ++ #interrupt-cells = <1>; ++ interrupt-parent = <&pio>; ++ interrupts = <66 IRQ_TYPE_LEVEL_HIGH>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ label = "lan2"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan3"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan4"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan5"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "lan1"; ++ phy-handle = <&phy7>; ++ phy-mode = "2500base-x"; ++ }; ++ ++ port@6 { ++ reg = <6>; ++ ethernet = <&gmac0>; ++ phy-mode = "2500base-x"; ++ ++ fixed-link { ++ speed = <2500>; ++ full-duplex; ++ pause; ++ }; ++ }; ++ }; ++ }; ++ }; ++}; ++ ++&pio { ++ wf_2g_5g_pins: wf_2g_5g-pins { ++ mux { ++ function = "wifi"; ++ groups = "wf_2g", "wf_5g"; ++ }; ++ conf { ++ pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", ++ "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", ++ "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", ++ "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1", ++ "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0", ++ "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8", ++ "WF1_TOP_CLK", "WF1_TOP_DATA"; ++ drive-strength = <4>; ++ }; ++ }; ++ ++ mmc0_pins_default: mmc0-pins { ++ mux { ++ function = "emmc"; ++ groups = "emmc_51"; ++ }; ++ conf-cmd-dat { ++ pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2", ++ "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5", ++ "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD"; ++ input-enable; ++ drive-strength = <4>; ++ mediatek,pull-up-adv = <1>; /* pull-up 10K */ ++ }; ++ conf-clk { ++ pins = "EMMC_CK"; ++ drive-strength = <6>; ++ mediatek,pull-down-adv = <2>; /* pull-down 50K */ ++ }; ++ conf-ds { ++ pins = "EMMC_DSL"; ++ mediatek,pull-down-adv = <2>; /* pull-down 50K */ ++ }; ++ conf-rst { ++ pins = "EMMC_RSTB"; ++ drive-strength = <4>; ++ mediatek,pull-up-adv = <1>; /* pull-up 10K */ ++ }; ++ }; ++ ++ mmc0_pins_uhs: mmc0-uhs-pins { ++ mux { ++ function = "emmc"; ++ groups = "emmc_51"; ++ }; ++ conf-cmd-dat { ++ pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2", ++ "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5", ++ "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD"; ++ input-enable; ++ drive-strength = <4>; ++ mediatek,pull-up-adv = <1>; /* pull-up 10K */ ++ }; ++ conf-clk { ++ pins = "EMMC_CK"; ++ drive-strength = <6>; ++ mediatek,pull-down-adv = <2>; /* pull-down 50K */ ++ }; ++ conf-ds { ++ pins = "EMMC_DSL"; ++ mediatek,pull-down-adv = <2>; /* pull-down 50K */ ++ }; ++ conf-rst { ++ pins = "EMMC_RSTB"; ++ drive-strength = <4>; ++ mediatek,pull-up-adv = <1>; /* pull-up 10K */ ++ }; ++ }; ++}; ++ ++&crypto { ++ status = "okay"; ++}; ++ ++&ssusb { ++ vusb33-supply = <®_3p3v>; ++ vbus-supply = <&usb_vbus>; ++ status = "okay"; ++}; ++ ++&trng { ++ status = "okay"; ++}; ++ ++&uart0 { ++ status = "okay"; ++}; ++ ++&usb_phy { ++ status = "okay"; ++}; ++ ++&watchdog { ++ status = "okay"; ++}; ++ ++&wifi { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&wf_2g_5g_pins>; ++ status = "okay"; ++}; ++ ++&mmc0 { ++ pinctrl-names = "default", "state_uhs"; ++ pinctrl-0 = <&mmc0_pins_default>; ++ pinctrl-1 = <&mmc0_pins_uhs>; ++ bus-width = <8>; ++ max-frequency = <200000000>; ++ cap-mmc-highspeed; ++ mmc-hs200-1_8v; ++ mmc-hs400-1_8v; ++ hs400-ds-delay = <0x14014>; ++ vmmc-supply = <®_3p3v>; ++ vqmmc-supply = <®_1p8v>; ++ non-removable; ++ no-sd; ++ no-sdio; ++ status = "okay"; ++}; +diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +index 42490cf8b3a0d..590c1fb2a6648 100644 +--- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network ++++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +@@ -48,6 +48,7 @@ mediatek_setup_interfaces() + qihoo,360t7) + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" wan + ;; ++ glinet,gl-mt6000|\ + tplink,tl-xdr4288|\ + tplink,tl-xdr6088) + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5" eth1 +@@ -90,6 +91,11 @@ mediatek_setup_macs() + wan_mac=$(macaddr_add "$lan_mac" 3) + label_mac=$lan_mac + ;; ++ glinet,gl-mt6000) ++ label_mac=$(mmc_get_mac_binary factory 0x0a) ++ wan_mac=$label_mac ++ lan_mac=$(macaddr_add "$label_mac" 2) ++ ;; + h3c,magic-nx30-pro) + wan_mac=$(mtd_get_mac_ascii pdt_data_1 ethaddr) + lan_mac=$(macaddr_add "$wan_mac" 1) +diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata +index f6f18272cc3d0..e4d33879c6d14 100644 +--- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata ++++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata +@@ -36,6 +36,13 @@ case "$FIRMWARE" in + ;; + esac + ;; ++"mediatek/mt7986_eeprom_mt7976_dual.bin") ++ case "$board" in ++ glinet,gl-mt6000) ++ caldata_extract_mmc "factory" 0x0 0x1000 ++ ;; ++ esac ++ ;; + *) + exit 1 + ;; +diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +index 0fc90bd41b107..115ff2201ece6 100644 +--- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac ++++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +@@ -43,6 +43,11 @@ case "$board" in + [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "1" ] && macaddr_setbit_la $(macaddr_add $addr 1) > /sys${DEVPATH}/macaddress + ;; ++ glinet,gl-mt6000) ++ addr=$(mmc_get_mac_binary factory 0x04) ++ [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress ++ [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress ++ ;; + h3c,magic-nx30-pro) + addr=$(mtd_get_mac_ascii pdt_data_1 ethaddr) + [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress +diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +index 6155ddab72687..42156aefb4d66 100755 +--- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh ++++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +@@ -100,6 +100,11 @@ + CI_UBIPART="ubi0" + nand_do_upgrade "$1" + ;; ++ glinet,gl-mt6000) ++ CI_KERNPART="kernel" ++ CI_ROOTPART="rootfs" ++ emmc_do_upgrade "$1" ++ ;; + h3c,magic-nx30-pro|\ + mediatek,mt7981-rfb|\ + qihoo,360t7|\ +@@ -161,6 +166,9 @@ + ;; + esac + ;; ++ glinet,gl-mt6000) ++ emmc_copy_config ++ ;; + esac + } + +diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk +index c9cf30b1cea1c..6082cf5f47ebd 100644 +--- a/target/linux/mediatek/image/filogic.mk ++++ b/target/linux/mediatek/image/filogic.mk +@@ -239,6 +239,21 @@ define Device/glinet_gl-mt3000 + endef + TARGET_DEVICES += glinet_gl-mt3000 + ++define Device/glinet_gl-mt6000 ++ DEVICE_VENDOR := GL.iNet ++ DEVICE_MODEL := GL-MT6000 ++ DEVICE_DTS := mt7986a-glinet-gl-mt6000 ++ DEVICE_DTS_DIR := ../dts ++ DEVICE_PACKAGES := kmod-usb2 kmod-usb3 kmod-mt7986-firmware mt7986-wo-firmware e2fsprogs f2fsck mkf2fs ++ IMAGES += factory.bin ++ IMAGE/factory.bin := append-kernel | pad-to 32M | append-rootfs ++ IMAGE/sysupgrade.bin := sysupgrade-tar | append-gl-metadata ++ ARTIFACTS := preloader.bin bl31-uboot.fip ++ ARTIFACT/preloader.bin := mt7986-bl2 emmc-ddr4 ++ ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot glinet_gl-mt6000 ++endef ++TARGET_DEVICES += glinet_gl-mt6000 ++ + define Device/h3c_magic-nx30-pro + DEVICE_VENDOR := H3C + DEVICE_MODEL := Magic NX30 Pro diff --git a/devices/mediatek_filogic/patches/6-jcg_q30-pro.patch b/devices/mediatek_filogic/patches/6-jcg_q30-pro.patch new file mode 100644 index 000000000000..04cb4427ca03 --- /dev/null +++ b/devices/mediatek_filogic/patches/6-jcg_q30-pro.patch @@ -0,0 +1,819 @@ +From 626344c9926dcf2db2e10681c19aab0328fee160 Mon Sep 17 00:00:00 2001 +From: Chukun Pan +Date: Fri, 16 Jun 2023 23:16:30 +0800 +Subject: [PATCH] mediatek: filogic: add JCG Q30 PRO support + +Hardware specification: + SoC: MediaTek MT7981B 2x A53 + Flash: Winbond 128MB + RAM: DDR3 256MB + Ethernet: 4x 10/100/1000 Mbps + Switch: MediaTek MT7531AE + WiFi: MediaTek MT7976C + Button: Reset + Power: DC 12V 1A + +Flash instructions: + 1. Connect to your PC via the Gigabit port of the router, + set a static ip on the ethernet interface of your PC. + (ip 192.168.1.254, gateway 192.168.1.1) + 2. Attach UART, pause at u-boot menu. + 3. Select "Upgrade ATF BL2", then use preloader.bin + 4. Select "Upgrade ATF FIP", then use bl31-uboot.fip + 5. Download the initramfs image, and type "reset", + waiting for tftp recovery to complete. + 6. After openwrt boots up, perform sysupgrade. + +Note: + 1. Since NMBM is disabled, we must back up all partitions. + 2. Although we can upgrade new firmware in the stock firmware, + we need the special fit image signature of MediaTek and + dual boot (hack kernel) to make u-boot boot it. So just + abandon these hacks and flash it via the serial port. + +Signed-off-by: Chukun Pan +--- + .../mediatek/dts/mt7981b-jcg-q30-pro.dts | 225 ++++++++++++++++++ + .../filogic/base-files/etc/board.d/02_network | 1 + + .../etc/hotplug.d/ieee80211/11_fix_wifi_mac | 5 + + .../base-files/lib/upgrade/platform.sh | 1 + + target/linux/mediatek/image/filogic.mk | 24 ++ + 5 files changed, 256 insertions(+) + create mode 100644 target/linux/mediatek/dts/mt7981b-jcg-q30-pro.dts + +diff --git a/target/linux/mediatek/dts/mt7981b-jcg-q30-pro.dts b/target/linux/mediatek/dts/mt7981b-jcg-q30-pro.dts +new file mode 100644 +index 0000000000000..adb86d9ebd06f +--- /dev/null ++++ b/target/linux/mediatek/dts/mt7981b-jcg-q30-pro.dts +@@ -0,0 +1,225 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++/dts-v1/; ++#include ++#include ++ ++#include "mt7981.dtsi" ++ ++/ { ++ model = "JCG Q30 PRO"; ++ compatible = "jcg,q30-pro", "mediatek,mt7981"; ++ ++ aliases { ++ serial0 = &uart0; ++ label-mac-device = &gmac0; ++ led-boot = &led_status_red; ++ led-failsafe = &led_status_red; ++ led-running = &led_status_blue; ++ led-upgrade = &led_status_blue; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ memory { ++ reg = <0 0x40000000 0 0x10000000>; ++ }; ++ ++ gpio-keys { ++ compatible = "gpio-keys"; ++ ++ reset { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&pio 1 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led_status_red: red { ++ label = "red:status"; ++ gpios = <&pio 8 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ led_status_blue: blue { ++ label = "blue:status"; ++ gpios = <&pio 13 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++ð { ++ status = "okay"; ++ ++ gmac0: mac@0 { ++ compatible = "mediatek,eth-mac"; ++ reg = <0>; ++ phy-mode = "2500base-x"; ++ ++ nvmem-cells = <&macaddr_lan>; ++ nvmem-cell-names = "mac-address"; ++ ++ fixed-link { ++ speed = <2500>; ++ full-duplex; ++ pause; ++ }; ++ }; ++}; ++ ++&mdio_bus { ++ switch: switch@0 { ++ compatible = "mediatek,mt7531"; ++ reg = <31>; ++ reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; ++ interrupt-controller; ++ #interrupt-cells = <1>; ++ interrupt-parent = <&pio>; ++ interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; ++ }; ++}; ++ ++&spi0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spi0_flash_pins>; ++ status = "okay"; ++ ++ spi_nand@0 { ++ compatible = "spi-nand"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ reg = <0>; ++ ++ spi-max-frequency = <52000000>; ++ spi-tx-bus-width = <4>; ++ spi-rx-bus-width = <4>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "bl2"; ++ reg = <0x0000000 0x0100000>; ++ read-only; ++ }; ++ ++ partition@100000 { ++ label = "u-boot-env"; ++ reg = <0x0100000 0x0080000>; ++ }; ++ ++ factory: partition@180000 { ++ label = "Factory"; ++ reg = <0x0180000 0x0200000>; ++ read-only; ++ }; ++ ++ partition@380000 { ++ label = "fip"; ++ reg = <0x0380000 0x0200000>; ++ read-only; ++ }; ++ ++ partition@580000 { ++ label = "ubi"; ++ reg = <0x0580000 0x7000000>; ++ }; ++ }; ++ }; ++}; ++ ++&switch { ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ nvmem-cells = <&macaddr_wan>; ++ nvmem-cell-names = "mac-address"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan3"; ++ }; ++ ++ port@6 { ++ reg = <6>; ++ ethernet = <&gmac0>; ++ phy-mode = "2500base-x"; ++ ++ fixed-link { ++ speed = <2500>; ++ full-duplex; ++ pause; ++ }; ++ }; ++ }; ++}; ++ ++&pio { ++ spi0_flash_pins: spi0-pins { ++ mux { ++ function = "spi"; ++ groups = "spi0", "spi0_wp_hold"; ++ }; ++ ++ conf-pu { ++ pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP"; ++ drive-strength = <8>; ++ mediatek,pull-up-adv = <0>; /* bias-disable */ ++ }; ++ ++ conf-pd { ++ pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; ++ drive-strength = <8>; ++ mediatek,pull-up-adv = <0>; /* bias-disable */ ++ }; ++ }; ++}; ++ ++&uart0 { ++ status = "okay"; ++}; ++ ++&watchdog { ++ status = "okay"; ++}; ++ ++&wifi { ++ status = "okay"; ++ ++ mediatek,mtd-eeprom = <&factory 0x0>; ++}; ++ ++&factory { ++ compatible = "nvmem-cells"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ macaddr_wan: macaddr@a0024 { ++ reg = <0xa0024 0x6>; ++ }; ++ ++ macaddr_lan: macaddr@a002a { ++ reg = <0xa002a 0x6>; ++ }; ++}; +diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +index aad1d67ff6fde..0760d17a8e276 100644 +--- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network ++++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +@@ -44,6 +44,7 @@ + mercusys,mr90x-v1) + ucidef_set_interfaces_lan_wan "lan0 lan1 lan2" eth1 + ;; ++ jcg,q30-pro|\ + qihoo,360t7) + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" wan + ;; +diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +index 395cc0f2dc546..a9de563a4bf09 100644 +--- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac ++++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +@@ -65,6 +65,11 @@ case "$board" in + [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress + ;; ++ jcg,q30-pro) ++ # Originally, phy1 is phy0 mac with LA bit set. However, this would conflict ++ # addresses on multiple VIFs with the other radio. Use label mac to set LA bit. ++ [ "$PHYNBR" = "1" ] && macaddr_setbit_la $(get_mac_label) > /sys${DEVPATH}/macaddress ++ ;; + mercusys,mr90x-v1) + addr=$(get_mac_binary "/tmp/tp_data/default-mac" 0) + [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress +diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +index b7b9d65993256..cef1131ddb107 100755 +--- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh ++++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +@@ -112,6 +112,7 @@ platform_do_upgrade() { + emmc_do_upgrade "$1" + ;; + h3c,magic-nx30-pro|\ ++ jcg,q30-pro|\ + mediatek,mt7981-rfb|\ + qihoo,360t7|\ + tplink,tl-xdr4288|\ +diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk +index 0ef3e94575689..4d4f3b62a2e85 100644 +--- a/target/linux/mediatek/image/filogic.mk ++++ b/target/linux/mediatek/image/filogic.mk +@@ -330,6 +330,30 @@ define Device/h3c_magic-nx30-pro + endef + TARGET_DEVICES += h3c_magic-nx30-pro + ++define Device/jcg_q30-pro ++ DEVICE_VENDOR := JCG ++ DEVICE_MODEL := Q30 PRO ++ DEVICE_DTS := mt7981b-jcg-q30-pro ++ DEVICE_DTS_DIR := ../dts ++ UBINIZE_OPTS := -E 5 ++ BLOCKSIZE := 128k ++ PAGESIZE := 2048 ++ KERNEL_IN_UBI := 1 ++ UBOOTENV_IN_UBI := 1 ++ IMAGES := sysupgrade.itb ++ KERNEL_INITRAMFS_SUFFIX := -recovery.itb ++ KERNEL := kernel-bin | gzip ++ KERNEL_INITRAMFS := kernel-bin | lzma | \ ++ fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k ++ IMAGE/sysupgrade.itb := append-kernel | \ ++ fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata ++ DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware ++ ARTIFACTS := preloader.bin bl31-uboot.fip ++ ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3 ++ ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot jcg_q30-pro ++endef ++TARGET_DEVICES += jcg_q30-pro ++ + define Device/netgear_wax220 + DEVICE_VENDOR := NETGEAR + DEVICE_MODEL := WAX220 + +diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic +index d4d0969b7af3a..5cd63a46e612f 100644 +--- a/package/boot/uboot-envtools/files/mediatek_filogic ++++ b/package/boot/uboot-envtools/files/mediatek_filogic +@@ -80,6 +80,7 @@ + h3c,magic-nx30-pro) + ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x80000" "0x20000" "4" + ;; ++jcg,q30-pro|\ + tplink,tl-xdr4288|\ + tplink,tl-xdr6086|\ + tplink,tl-xdr6088|\ +diff --git a/package/boot/uboot-mediatek/Makefile b/package/boot/uboot-mediatek/Makefile +index ad25d051fed90..a06d323bae81d 100644 +--- a/package/boot/uboot-mediatek/Makefile ++++ b/package/boot/uboot-mediatek/Makefile +@@ -236,6 +236,18 @@ define U-Boot/mt7981_h3c_magic-nx30-pro + DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3 + endef + ++define U-Boot/mt7981_jcg_q30-pro ++ NAME:=JCG Q30 PRO ++ BUILD_SUBTARGET:=filogic ++ BUILD_DEVICES:=jcg_q30-pro ++ UBOOT_CONFIG:=mt7981_jcg_q30-pro ++ UBOOT_IMAGE:=u-boot.fip ++ BL2_BOOTDEV:=spim-nand ++ BL2_SOC:=mt7981 ++ BL2_DDRTYPE:=ddr3 ++ DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3 ++endef ++ + define U-Boot/mt7981_rfb-spim-nand + NAME:=MT7981 Reference Board + BUILD_SUBTARGET:=filogic +@@ -522,6 +534,7 @@ + mt7629_rfb \ + mt7981_cmcc_rax3000m-emmc \ + mt7981_cmcc_rax3000m-nand \ ++ mt7981_jcg_q30-pro \ + mt7981_rfb-spim-nand \ + mt7981_rfb-emmc \ + mt7981_rfb-nor \ +diff --git a/package/boot/uboot-mediatek/patches/438-add-jcg_q30-pro.patch b/package/boot/uboot-mediatek/patches/438-add-jcg_q30-pro.patch +new file mode 100644 +index 0000000000000..639cae174e752 +--- /dev/null ++++ b/package/boot/uboot-mediatek/patches/438-add-jcg_q30-pro.patch +@@ -0,0 +1,420 @@ ++--- /dev/null +++++ b/configs/mt7981_jcg_q30-pro_defconfig ++@@ -0,0 +1,175 @@ +++CONFIG_ARM=y +++CONFIG_POSITION_INDEPENDENT=y +++CONFIG_ARCH_MEDIATEK=y +++CONFIG_TARGET_MT7981=y +++CONFIG_TEXT_BASE=0x41e00000 +++CONFIG_SYS_MALLOC_F_LEN=0x4000 +++CONFIG_SYS_HAS_NONCACHED_MEMORY=y +++CONFIG_NR_DRAM_BANKS=1 +++CONFIG_DEFAULT_DEVICE_TREE="mt7981_jcg_q30-pro" +++CONFIG_DEFAULT_ENV_FILE="jcg_q30-pro_env" +++CONFIG_DEFAULT_FDT_FILE="mediatek/mt7981_jcg_q30-pro.dtb" +++CONFIG_OF_LIBFDT_OVERLAY=y +++CONFIG_DEBUG_UART_BASE=0x11002000 +++CONFIG_DEBUG_UART_CLOCK=40000000 +++CONFIG_DEBUG_UART=y +++CONFIG_SYS_LOAD_ADDR=0x46000000 +++CONFIG_SMBIOS_PRODUCT_NAME="" +++CONFIG_AUTOBOOT_KEYED=y +++CONFIG_BOOTDELAY=30 +++CONFIG_AUTOBOOT_MENU_SHOW=y +++CONFIG_CFB_CONSOLE_ANSI=y +++CONFIG_BOARD_LATE_INIT=y +++CONFIG_BUTTON=y +++CONFIG_BUTTON_GPIO=y +++CONFIG_GPIO_HOG=y +++CONFIG_CMD_ENV_FLAGS=y +++CONFIG_FIT=y +++CONFIG_FIT_ENABLE_SHA256_SUPPORT=y +++CONFIG_LED=y +++CONFIG_LED_BLINK=y +++CONFIG_LED_GPIO=y +++CONFIG_LOGLEVEL=7 +++CONFIG_LOG=y +++CONFIG_SYS_PROMPT="MT7981> " +++CONFIG_CMD_BOOTMENU=y +++CONFIG_CMD_BOOTP=y +++CONFIG_CMD_BUTTON=y +++CONFIG_CMD_CACHE=y +++CONFIG_CMD_CDP=y +++CONFIG_CMD_CPU=y +++CONFIG_CMD_DHCP=y +++CONFIG_CMD_DM=y +++CONFIG_CMD_DNS=y +++CONFIG_CMD_ECHO=y +++CONFIG_CMD_ENV_READMEM=y +++CONFIG_CMD_ERASEENV=y +++CONFIG_CMD_EXT4=y +++CONFIG_CMD_FAT=y +++CONFIG_CMD_FDT=y +++CONFIG_CMD_FS_GENERIC=y +++CONFIG_CMD_FS_UUID=y +++CONFIG_CMD_GPIO=y +++CONFIG_CMD_GPT=y +++CONFIG_CMD_HASH=y +++CONFIG_CMD_ITEST=y +++CONFIG_CMD_LED=y +++CONFIG_CMD_LICENSE=y +++CONFIG_CMD_LINK_LOCAL=y +++# CONFIG_CMD_MBR is not set +++CONFIG_CMD_PCI=y +++CONFIG_CMD_PSTORE=y +++CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000 +++CONFIG_CMD_SF_TEST=y +++CONFIG_CMD_PING=y +++CONFIG_CMD_PXE=y +++CONFIG_CMD_PWM=y +++CONFIG_CMD_SMC=y +++CONFIG_CMD_TFTPBOOT=y +++CONFIG_CMD_TFTPSRV=y +++CONFIG_CMD_UBI=y +++CONFIG_CMD_UBI_RENAME=y +++CONFIG_CMD_UBIFS=y +++CONFIG_CMD_ASKENV=y +++CONFIG_CMD_PART=y +++CONFIG_CMD_RARP=y +++CONFIG_CMD_SETEXPR=y +++CONFIG_CMD_SLEEP=y +++CONFIG_CMD_SNTP=y +++CONFIG_CMD_SOURCE=y +++CONFIG_CMD_STRINGS=y +++CONFIG_CMD_UUID=y +++CONFIG_DISPLAY_CPUINFO=y +++CONFIG_DM_MTD=y +++CONFIG_DM_REGULATOR=y +++CONFIG_DM_REGULATOR_FIXED=y +++CONFIG_DM_REGULATOR_GPIO=y +++CONFIG_DM_PWM=y +++CONFIG_PWM_MTK=y +++CONFIG_HUSH_PARSER=y +++CONFIG_SYS_REDUNDAND_ENVIRONMENT=y +++CONFIG_SYS_RELOC_GD_ENV_ADDR=y +++CONFIG_VERSION_VARIABLE=y +++CONFIG_PARTITION_UUIDS=y +++CONFIG_NETCONSOLE=y +++CONFIG_REGMAP=y +++CONFIG_SYSCON=y +++CONFIG_CLK=y +++CONFIG_DM_GPIO=y +++CONFIG_DM_SCSI=y +++CONFIG_AHCI=y +++CONFIG_AHCI_PCI=y +++CONFIG_SCSI_AHCI=y +++CONFIG_SCSI=y +++CONFIG_CMD_SCSI=y +++CONFIG_PHY=y +++CONFIG_PHY_MTK_TPHY=y +++CONFIG_PHY_FIXED=y +++CONFIG_MTK_AHCI=y +++CONFIG_DM_ETH=y +++CONFIG_MEDIATEK_ETH=y +++CONFIG_PCI=y +++# CONFIG_MMC is not set +++# CONFIG_DM_MMC is not set +++CONFIG_MTD=y +++CONFIG_MTD_UBI_FASTMAP=y +++CONFIG_DM_PCI=y +++CONFIG_PCIE_MEDIATEK=y +++CONFIG_PINCTRL=y +++CONFIG_PINCONF=y +++CONFIG_PINCTRL_MT7622=y +++CONFIG_POWER_DOMAIN=y +++CONFIG_PRE_CONSOLE_BUFFER=y +++CONFIG_PRE_CON_BUF_ADDR=0x4007EF00 +++CONFIG_MTK_POWER_DOMAIN=y +++CONFIG_RAM=y +++CONFIG_DM_SERIAL=y +++CONFIG_MTK_SERIAL=y +++CONFIG_SPI=y +++CONFIG_DM_SPI=y +++CONFIG_MTK_SPI_NAND=y +++CONFIG_MTK_SPI_NAND_MTD=y +++CONFIG_SYSRESET_WATCHDOG=y +++CONFIG_WDT_MTK=y +++CONFIG_LZO=y +++CONFIG_ZSTD=y +++CONFIG_HEXDUMP=y +++CONFIG_RANDOM_UUID=y +++CONFIG_REGEX=y +++CONFIG_OF_EMBED=y +++CONFIG_ENV_OVERWRITE=y +++CONFIG_ENV_IS_IN_UBI=y +++CONFIG_ENV_UBI_PART="ubi" +++CONFIG_ENV_SIZE=0x1f000 +++CONFIG_ENV_SIZE_REDUND=0x1f000 +++CONFIG_ENV_UBI_VOLUME="ubootenv" +++CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2" +++CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +++CONFIG_NET_RANDOM_ETHADDR=y +++CONFIG_REGMAP=y +++CONFIG_SYSCON=y +++CONFIG_CLK=y +++CONFIG_PHY_FIXED=y +++CONFIG_DM_ETH=y +++CONFIG_MEDIATEK_ETH=y +++CONFIG_PINCTRL=y +++CONFIG_PINCONF=y +++CONFIG_PINCTRL_MT7981=y +++CONFIG_POWER_DOMAIN=y +++CONFIG_MTK_POWER_DOMAIN=y +++CONFIG_DM_REGULATOR=y +++CONFIG_DM_REGULATOR_FIXED=y +++CONFIG_DM_SERIAL=y +++CONFIG_MTK_SERIAL=y +++CONFIG_HEXDUMP=y +++CONFIG_USE_DEFAULT_ENV_FILE=y +++CONFIG_MTD_SPI_NAND=y +++CONFIG_MTK_SPIM=y +++CONFIG_CMD_MTD=y +++CONFIG_CMD_NAND=y +++CONFIG_CMD_NAND_TRIMFFS=y +++CONFIG_LMB_MAX_REGIONS=64 +++CONFIG_USE_IPADDR=y +++CONFIG_IPADDR="192.168.1.1" +++CONFIG_USE_SERVERIP=y +++CONFIG_SERVERIP="192.168.1.254" ++--- /dev/null +++++ b/arch/arm/dts/mt7981_jcg_q30-pro.dts ++@@ -0,0 +1,179 @@ +++// SPDX-License-Identifier: GPL-2.0 +++/* +++ * Copyright (c) 2022 MediaTek Inc. +++ * Author: Sam Shih +++ */ +++ +++/dts-v1/; +++#include "mt7981.dtsi" +++#include +++#include +++ +++/ { +++ #address-cells = <1>; +++ #size-cells = <1>; +++ model = "JCG Q30 PRO"; +++ compatible = "mediatek,mt7981", "mediatek,mt7981-rfb"; +++ +++ chosen { +++ stdout-path = &uart0; +++ tick-timer = &timer0; +++ }; +++ +++ memory@40000000 { +++ device_type = "memory"; +++ reg = <0x40000000 0x10000000>; +++ }; +++ +++ keys { +++ compatible = "gpio-keys"; +++ +++ factory { +++ label = "reset"; +++ linux,code = ; +++ gpios = <&gpio 1 GPIO_ACTIVE_LOW>; +++ }; +++ }; +++ +++ leds { +++ compatible = "gpio-leds"; +++ +++ status_red { +++ label = "red:status"; +++ gpios = <&gpio 8 GPIO_ACTIVE_HIGH>; +++ }; +++ +++ status_blue { +++ label = "blue:status"; +++ gpios = <&gpio 13 GPIO_ACTIVE_LOW>; +++ }; +++ }; +++}; +++ +++&uart0 { +++ mediatek,force-highspeed; +++ status = "okay"; +++}; +++ +++&uart1 { +++ pinctrl-names = "default"; +++ pinctrl-0 = <&uart1_pins>; +++ status = "disabled"; +++}; +++ +++ð { +++ status = "okay"; +++ mediatek,gmac-id = <0>; +++ phy-mode = "2500base-x"; +++ mediatek,switch = "mt7531"; +++ reset-gpios = <&gpio 39 GPIO_ACTIVE_HIGH>; +++ +++ fixed-link { +++ speed = <2500>; +++ full-duplex; +++ }; +++}; +++ +++&pinctrl { +++ spi_flash_pins: spi0-pins-func-1 { +++ mux { +++ function = "flash"; +++ groups = "spi0", "spi0_wp_hold"; +++ }; +++ +++ conf-pu { +++ pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP"; +++ drive-strength = ; +++ bias-pull-up = ; +++ }; +++ +++ conf-pd { +++ pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; +++ drive-strength = ; +++ bias-pull-down = ; +++ }; +++ }; +++ +++ spic_pins: spi1-pins-func-1 { +++ mux { +++ function = "spi"; +++ groups = "spi1_1"; +++ }; +++ }; +++ +++ uart1_pins: spi1-pins-func-3 { +++ mux { +++ function = "uart"; +++ groups = "uart1_2"; +++ }; +++ }; +++ +++ pwm_pins: pwm0-pins-func-1 { +++ mux { +++ function = "pwm"; +++ groups = "pwm0_1", "pwm1_0"; +++ }; +++ }; +++}; +++ +++&pwm { +++ pinctrl-names = "default"; +++ pinctrl-0 = <&pwm_pins>; +++ status = "okay"; +++}; +++ +++&spi0 { +++ #address-cells = <1>; +++ #size-cells = <0>; +++ pinctrl-names = "default"; +++ pinctrl-0 = <&spi_flash_pins>; +++ status = "okay"; +++ must_tx; +++ enhance_timing; +++ dma_ext; +++ ipm_design; +++ support_quad; +++ tick_dly = <2>; +++ sample_sel = <0>; +++ +++ spi_nand@0 { +++ compatible = "spi-nand"; +++ reg = <0>; +++ spi-max-frequency = <52000000>; +++ +++ partitions { +++ compatible = "fixed-partitions"; +++ #address-cells = <1>; +++ #size-cells = <1>; +++ +++ partition@0 { +++ label = "bl2"; +++ reg = <0x0 0x100000>; +++ }; +++ +++ partition@100000 { +++ label = "orig-env"; +++ reg = <0x100000 0x80000>; +++ }; +++ +++ partition@160000 { +++ label = "factory"; +++ reg = <0x180000 0x200000>; +++ }; +++ +++ partition@380000 { +++ label = "fip"; +++ reg = <0x380000 0x200000>; +++ }; +++ +++ partition@580000 { +++ label = "ubi"; +++ reg = <0x580000 0x7000000>; +++ }; +++ }; +++ }; +++}; +++ +++&watchdog { +++ status = "disabled"; +++}; ++--- /dev/null +++++ b/jcg_q30-pro_env ++@@ -0,0 +1,57 @@ +++ipaddr=192.168.1.1 +++serverip=192.168.1.254 +++loadaddr=0x46000000 +++console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0 +++bootcmd=if pstore check ; then run boot_recovery ; else run boot_ubi ; fi +++bootconf=config-1 +++bootdelay=0 +++bootfile=openwrt-mediatek-filogic-jcg_q30-pro-initramfs-recovery.itb +++bootfile_bl2=openwrt-mediatek-filogic-jcg_q30-pro-preloader.bin +++bootfile_fip=openwrt-mediatek-filogic-jcg_q30-pro-bl31-uboot.fip +++bootfile_upg=openwrt-mediatek-filogic-jcg_q30-pro-squashfs-sysupgrade.itb +++bootled_pwr=blue:status +++bootled_rec=red:status +++bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60 +++bootmenu_default=0 +++bootmenu_delay=0 +++bootmenu_title= ( ( ( OpenWrt ) ) ) +++bootmenu_0=Initialize environment.=run _firstboot +++bootmenu_0d=Run default boot command.=run boot_default +++bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return +++bootmenu_2=Boot production system from NAND.=run boot_production ; run bootmenu_confirm_return +++bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return +++bootmenu_4=Load production system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return +++bootmenu_5=Load recovery system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return +++bootmenu_6=Load BL31+U-Boot FIP via TFTP then write to NAND.=run boot_tftp_write_fip ; run bootmenu_confirm_return +++bootmenu_7=Load BL2 preloader via TFTP then write to NAND.=run boot_tftp_write_bl2 ; run bootmenu_confirm_return +++bootmenu_8=Reboot.=reset +++bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset +++boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu +++boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever +++boot_production=led $bootled_pwr on ; run ubi_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off +++boot_recovery=led $bootled_rec on ; run ubi_read_recovery && bootm $loadaddr#$bootconf ; led $bootled_rec off +++boot_ubi=run boot_production ; run boot_recovery ; run boot_tftp_forever +++boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp_recovery ; sleep 1 ; done +++boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run ubi_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi +++boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run ubi_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi +++boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf +++boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run mtd_write_fip && run reset_factory +++boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run mtd_write_bl2 +++part_default=production +++part_recovery=recovery +++reset_factory=ubi part ubi ; mw $loadaddr 0x0 0x800 ; ubi write $loadaddr ubootenv 0x800 ; ubi write $loadaddr ubootenv2 0x800 +++mtd_write_fip=mtd erase fip && mtd write fip $loadaddr +++mtd_write_bl2=mtd erase bl2 && mtd write bl2 $loadaddr +++ubi_create_env=ubi check ubootenv || ubi create ubootenv 0x100000 dynamic 0 || run ubi_format ; ubi check ubootenv2 || ubi create ubootenv2 0x100000 dynamic 1 || run ubi_format +++ubi_format=ubi detach ; mtd erase ubi && ubi part ubi ; reset +++ubi_prepare_rootfs=if ubi check rootfs_data ; then else if env exists rootfs_data_max ; then ubi create rootfs_data $rootfs_data_max dynamic || ubi create rootfs_data - dynamic ; else ubi create rootfs_data - dynamic ; fi ; fi +++ubi_read_production=ubi read $loadaddr fit && iminfo $loadaddr && run ubi_prepare_rootfs +++ubi_read_recovery=ubi check recovery && ubi read $loadaddr recovery +++ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data +++ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic 2 && ubi write $loadaddr fit $filesize +++ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic 3 && ubi write $loadaddr recovery $filesize +++ethaddr_factory=mtd read factory 0x40080000 0xa0000 0x800 && env readmem -b ethaddr 0x4008002a 0x6 ; setenv ethaddr_factory +++_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv +++_firstboot=setenv _firstboot ; run ethaddr_factory ; run _switch_to_menu ; run _init_env ; run boot_first +++_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title +++_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title $ver" diff --git a/devices/mediatek_mt7981/.config b/devices/mediatek_mt7981/.config index b7a11a288471..67aea2f4320e 100644 --- a/devices/mediatek_mt7981/.config +++ b/devices/mediatek_mt7981/.config @@ -14,6 +14,9 @@ CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_cmcc_rax3000m=y CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_cmcc_rax3000m-emmc=y CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_abt_asr3000=y CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_cmcc_a10=y +CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_nradio_wt9103=y +CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_nradio_wt9103_512m=y +CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_xiaomi_mi-router-ax3000t=y CONFIG_VERSION_DIST="OpenWrt" diff --git a/devices/mediatek_mt7981/diy.sh b/devices/mediatek_mt7981/diy.sh index 43c8d93a9e6a..de267ced2553 100644 --- a/devices/mediatek_mt7981/diy.sh +++ b/devices/mediatek_mt7981/diy.sh @@ -11,10 +11,10 @@ rm -rf devices/common/patches/{fix.patch,iptables.patch,kernel-defaults.patch,ta #sed -i "/KernelPackage,sound-soc-core/d" package/kernel/linux/modules/sound.mk #sed -i "/KernelPackage,multimedia-input/d" package/kernel/linux/modules/video.mk -svn co https://github.com/openwrt/openwrt/branches/openwrt-23.05/toolchain/musl toolchain/musl -svn co https://github.com/openwrt/openwrt/branches/openwrt-23.05/package/utils/e2fsprogs package/utils/e2fsprogs -svn co https://github.com/openwrt/openwrt/branches/openwrt-23.05/package/utils/ucode package/utils/ucode -svn co https://github.com/openwrt/openwrt/branches/openwrt-23.05/package/libs/libselinux package/libs/libselinux +svn export https://github.com/openwrt/openwrt/branches/openwrt-23.05/toolchain/musl toolchain/musl +svn export https://github.com/openwrt/openwrt/branches/openwrt-23.05/package/utils/e2fsprogs package/utils/e2fsprogs +svn export https://github.com/openwrt/openwrt/branches/openwrt-23.05/package/utils/ucode package/utils/ucode +svn export https://github.com/openwrt/openwrt/branches/openwrt-23.05/package/libs/libselinux package/libs/libselinux #ln -sf $(pwd)/feeds/luci/modules/luci-base package/feeds/kiddin9/ sed -i "s/PKG_SOURCE_DATE:=.*/PKG_SOURCE_DATE:=2099-12-06/" package/network/config/netifd/Makefile diff --git a/devices/mediatek_mt7986/diy.sh b/devices/mediatek_mt7986/diy.sh index 23ce6edefd6f..1cfaedf19b10 100644 --- a/devices/mediatek_mt7986/diy.sh +++ b/devices/mediatek_mt7986/diy.sh @@ -13,10 +13,10 @@ sed -i "s/PKG_SOURCE_DATE:=.*/PKG_SOURCE_DATE:=2099-12-06/" package/network/conf #sed -i "/KernelPackage,sound-soc-core/d" package/kernel/linux/modules/sound.mk #sed -i "/KernelPackage,multimedia-input/d" package/kernel/linux/modules/video.mk -svn co https://github.com/openwrt/openwrt/branches/openwrt-23.05/toolchain/musl toolchain/musl -svn co https://github.com/openwrt/openwrt/branches/openwrt-23.05/package/utils/e2fsprogs package/utils/e2fsprogs -svn co https://github.com/openwrt/openwrt/branches/openwrt-23.05/package/utils/ucode package/utils/ucode -svn co https://github.com/openwrt/openwrt/branches/openwrt-23.05/package/libs/libselinux package/libs/libselinux +svn export https://github.com/openwrt/openwrt/branches/openwrt-23.05/toolchain/musl toolchain/musl +svn export https://github.com/openwrt/openwrt/branches/openwrt-23.05/package/utils/e2fsprogs package/utils/e2fsprogs +svn export https://github.com/openwrt/openwrt/branches/openwrt-23.05/package/utils/ucode package/utils/ucode +svn export https://github.com/openwrt/openwrt/branches/openwrt-23.05/package/libs/libselinux package/libs/libselinux #ln -sf $(pwd)/feeds/luci/modules/luci-base package/feeds/kiddin9/ sed -i "s/DEFAULT_PACKAGES +=/DEFAULT_PACKAGES += luci-app-mtk mii_mgr wifi-profile mkf2fs mtkhqos_util wireless-regdb switch regs kmod-warp kmod-mt_wifi kmod-mediatek_hnat kmod-conninfra datconf-lua mmc-utils/" target/linux/mediatek/Makefile diff --git a/devices/meson_meson8b/diy.sh b/devices/meson_meson8b/diy.sh index 1b068e123c21..9af572c0201e 100644 --- a/devices/meson_meson8b/diy.sh +++ b/devices/meson_meson8b/diy.sh @@ -4,9 +4,9 @@ shopt -s extglob SHELL_FOLDER=$(dirname $(readlink -f "$0")) -svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/generic/hack-6.1 target/linux/generic/hack-6.1 +svn checkout https://github.com/coolsnowwolf/lede/trunk/target/linux/generic/hack-6.1 target/linux/generic/hack-6.1 -svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/meson target/linux/meson +svn export https://github.com/coolsnowwolf/lede/trunk/target/linux/meson target/linux/meson rm -rf package/feeds/kiddin9/quectel_Gobinet diff --git a/devices/meson_meson8b/patches/onecloud.patch b/devices/meson_meson8b/patches/onecloud.patch index ddb292cb01b9..a5a7c1e8bf4e 100644 --- a/devices/meson_meson8b/patches/onecloud.patch +++ b/devices/meson_meson8b/patches/onecloud.patch @@ -1,6 +1,6 @@ --- a/target/linux/meson/image/Makefile +++ b/target/linux/meson/image/Makefile -@@ -112,7 +112,8 @@ endif +@@ -46,7 +46,8 @@ endef define Device/thunder-onecloud DEVICE_DTS := meson8b-onecloud @@ -8,18 +8,16 @@ + DEVICE_TITLE := OneCloud 玩客云 + DEVICE_PACKAGES += kmod-usb-net-rtl8152 KERNEL_LOADADDR := 0x00208000 + IMAGE/emmc.img := boot-script onecloud | emmc-common $$(DEVICE_NAME) endef - ifeq ($(SUBTARGET),meson8b) - ---- a/package/kernel/linux/modules/netsupport.mk -+++ b/package/kernel/linux/modules/netsupport.mk -@@ -93,7 +93,8 @@ define KernelPackage/vxlan - +IPV6:kmod-udptunnel6 - KCONFIG:=CONFIG_VXLAN - FILES:= \ -- $(LINUX_DIR)/drivers/net/vxlan/vxlan.ko -+ $(LINUX_DIR)/drivers/net/vxlan.ko@lt5.5 \ -+ $(LINUX_DIR)/drivers/net/vxlan/vxlan.ko@ge5.6 - AUTOLOAD:=$(call AutoLoad,13,vxlan) - endef - \ No newline at end of file +@@ -54,4 +55,10 @@ ifeq ($(SUBTARGET),meson8b) + TARGET_DEVICES += thunder-onecloud + endif + ++define Image/Build ++ export BIN_DIR=$(BIN_DIR); \ ++ cd /data/packit/openwrt-onecloud || true; \ ++ . ~/packit/packit_onecloud1.sh || true; ++endef ++ + $(eval $(call BuildImage)) diff --git a/devices/qualcommax_ipq60xx/diy/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6018-upstreamable.dtsi b/devices/qualcommax_ipq60xx/diy/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6018-upstreamable.dtsi new file mode 100644 index 000000000000..06093989294f --- /dev/null +++ b/devices/qualcommax_ipq60xx/diy/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6018-upstreamable.dtsi @@ -0,0 +1,22 @@ +/ { + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + nss@40000000 { + reg = <0x00 0x40000000 0x00 0x1000000>; + no-map; + }; + + uboot@4a100000 { + reg = <0x00 0x4a100000 0x00 0x400000>; + no-map; + }; + + sbl@4a500000 { + reg = <0x00 0x4a500000 0x00 0x100000>; + no-map; + }; + }; +}; diff --git a/devices/ramips_mt7621/.config b/devices/ramips_mt7621/.config index e7407756458a..744070ef00da 100644 --- a/devices/ramips_mt7621/.config +++ b/devices/ramips_mt7621/.config @@ -56,5 +56,6 @@ CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_h3c_tx1806=y CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_zbtlink_zbt-wg3526-32m=y CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_ht-jsh_0211=y CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_c-life_xg1=y +CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_hatlab_gateboard-one=y CONFIG_PACKAGE_luci-ssl=y # uhttpd服务 diff --git a/devices/ramips_mt7621/patches/gateboard-one.patch b/devices/ramips_mt7621/patches/gateboard-one.patch new file mode 100644 index 000000000000..fd079e6814a3 --- /dev/null +++ b/devices/ramips_mt7621/patches/gateboard-one.patch @@ -0,0 +1,628 @@ +From ccd59cbd78b54e13efeb573863405bab72851912 Mon Sep 17 00:00:00 2001 +From: kiddin9 <48883331+kiddin9@users.noreply.github.com> +Date: Thu, 30 Nov 2023 12:03:50 +0800 +Subject: [PATCH] update + +--- + .../kernel/8563-watchdog/8563-watchdog.init | 29 ++ + .../kernel/8563-watchdog/files/8563-watchdog | 17 + + .../8563-watchdog/files/8563-watchdog.init | 18 + + scripts/gen-rddependencies.sh | 13 + + target/linux/ramips/Makefile | 2 +- + .../dts/mt7621_hatlab_gateboard-one.dts | 372 ++++++++++++++++++ + target/linux/ramips/image/mt7621.mk | 36 ++ + .../mt7621/base-files/etc/board.d/02_network | 3 + + .../mt7621/base-files/lib/upgrade/platform.sh | 6 + + .../mt7621/base-files/sbin/fixup-mac-address | 4 + + target/linux/ramips/mt7621/config-5.15 | 1 + + 11 files changed, 500 insertions(+), 1 deletion(-) + create mode 100644 package/kernel/8563-watchdog/8563-watchdog.init + create mode 100644 package/kernel/8563-watchdog/files/8563-watchdog + create mode 100644 package/kernel/8563-watchdog/files/8563-watchdog.init + create mode 100755 scripts/gen-rddependencies.sh + create mode 100644 target/linux/ramips/dts/mt7621_hatlab_gateboard-one.dts + +diff --git a/package/kernel/8563-watchdog/8563-watchdog.init b/package/kernel/8563-watchdog/8563-watchdog.init +new file mode 100644 +index 0000000000000..81956a100e0df +--- /dev/null ++++ b/package/kernel/8563-watchdog/8563-watchdog.init +@@ -0,0 +1,29 @@ ++include $(TOPDIR)/rules.mk ++ ++PKG_NAME:=8563-watchdog ++PKG_RELEASE:=1 ++ ++include $(INCLUDE_DIR)/package.mk ++ ++define Package/8563-watchdog ++ SECTION:=base ++ CATEGORY:=Base system ++ TITLE:=8563 watchdog ++ URL:= ++endef ++ ++define Package/8563-watchdog/description ++ This package contains the hw watchdog script for PCF8563 timer interrupt. ++endef ++ ++define Build/Compile ++endef ++ ++define Package/8563-watchdog/install ++ $(INSTALL_DIR) $(1)/etc/init.d/ ++ $(INSTALL_DIR) $(1)/sbin/ ++ $(INSTALL_BIN) ./files/8563-watchdog.init $(1)/etc/init.d/8563-watchdog ++ $(INSTALL_BIN) ./files/8563-watchdog $(1)/sbin/8563-watchdog ++endef ++ ++$(eval $(call BuildPackage,8563-watchdog)) +diff --git a/package/kernel/8563-watchdog/files/8563-watchdog b/package/kernel/8563-watchdog/files/8563-watchdog +new file mode 100644 +index 0000000000000..193dde2c9f32f +--- /dev/null ++++ b/package/kernel/8563-watchdog/files/8563-watchdog +@@ -0,0 +1,17 @@ ++#!/bin/sh ++ ++BUS="0" ++ADDR="0x51" ++TIMEOUT="0x78" # 120 seconds ++let TICK="5" ++ ++trap "" INT HUP ++ ++i2cset -y -f ${BUS} ${ADDR} 0x0F ${TIMEOUT} # reset Timer ++i2cset -y -f ${BUS} ${ADDR} 0x0E 0x82 # enable Timer countdown ++i2cset -y -f ${BUS} ${ADDR} 0x01 0x11 # enable Timer interrupt ++ ++while true; do ++ i2cset -y -f ${BUS} ${ADDR} 0x0F ${TIMEOUT} # reset Timer ++ sleep ${TICK} ++done +diff --git a/package/kernel/8563-watchdog/files/8563-watchdog.init b/package/kernel/8563-watchdog/files/8563-watchdog.init +new file mode 100644 +index 0000000000000..a2edc7ab81429 +--- /dev/null ++++ b/package/kernel/8563-watchdog/files/8563-watchdog.init +@@ -0,0 +1,18 @@ ++#!/bin/sh /etc/rc.common ++# ++# Copyright (C) 2011 OpenWrt.org ++# ++ ++START=11 ++STOP=11 ++ ++USE_PROCD=1 ++NAME=8563-watchdog ++PROG=/sbin/8563-watchdog ++ ++start_service() { ++ procd_open_instance ++ procd_set_param command "${PROG}" "${gpio}" ++ procd_set_param respawn ++ procd_close_instance ++} +diff --git a/scripts/gen-rddependencies.sh b/scripts/gen-rddependencies.sh +new file mode 100755 +index 0000000000000..509d6a4fa67e4 +--- /dev/null ++++ b/scripts/gen-rddependencies.sh +@@ -0,0 +1,13 @@ ++#!/bin/sh ++ ++TARGETS=$* ++READELF="${READELF:-readelf}" ++XARGS="${XARGS:-xargs -r}" ++ ++find $TARGETS -type f -a -exec file {} \; | \ ++ sed -n -e 's/^\(.*\):.*ELF.*\(executable\|shared object\).*,.*/\1/p' | \ ++ $XARGS -n1 $READELF -l | grep 'Requesting' | cut -d':' -f2 | tr -d ' ]' | \ ++ $XARGS basename ++ ++cd `dirname ${0}` ++./gen-dependencies.sh ${TARGETS} +diff --git a/target/linux/ramips/Makefile b/target/linux/ramips/Makefile +index 77b82d5334c22..caf5099d1a116 100644 +--- a/target/linux/ramips/Makefile ++++ b/target/linux/ramips/Makefile +@@ -8,7 +8,7 @@ ARCH:=mipsel + BOARD:=ramips + BOARDNAME:=MediaTek Ralink MIPS + SUBTARGETS:=mt7620 mt7621 mt76x8 rt288x rt305x rt3883 +-FEATURES:=squashfs gpio ++FEATURES:=squashfs gpio boot-part rootfs-part + + KERNEL_PATCHVER:=5.15 + +diff --git a/target/linux/ramips/dts/mt7621_hatlab_gateboard-one.dts b/target/linux/ramips/dts/mt7621_hatlab_gateboard-one.dts +new file mode 100644 +index 0000000000000..f6a53541f56a4 +--- /dev/null ++++ b/target/linux/ramips/dts/mt7621_hatlab_gateboard-one.dts +@@ -0,0 +1,372 @@ ++#include "mt7621.dtsi" ++ ++#include ++#include ++#include ++ ++/ { ++ compatible = "hatlab,gateboard-one", "mediatek,mt7621-soc"; ++ model = "HATLab GateBoard-One"; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200"; ++ }; ++ ++ 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 = "green:sys"; ++ gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ usb { ++ label = "blue:usb"; ++ gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; ++ trigger-sources = <&xhci_ehci_port1>; ++ linux,default-trigger = "usbport"; ++ }; ++ }; ++ ++ keys { ++ compatible = "gpio-keys"; ++ ++ reset { ++ label = "reset"; ++ gpios = <&gpio 17 GPIO_ACTIVE_HIGH>; ++ linux,code = ; ++ }; ++ }; ++ ++ gpio_export { ++ compatible = "gpio-export"; ++ #size-cells = <0>; ++ ++ power_peripheral { ++ gpio-export,name = "power_peripheral"; ++ gpio-export,output = <0>; ++ gpios = <&gpio 18 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ cpu_fan: cpu_fan { ++ compatible = "gpio-fan"; ++ gpios = <&gpio 13 GPIO_ACTIVE_HIGH ++ &gpio 14 GPIO_ACTIVE_HIGH>; ++ gpio-fan,speed-map = < 0 0 ++ 2000 1 ++ 4000 2 ++ 6000 3>; ++ #cooling-cells = <2>; ++ }; ++ ++ thermal-zones { ++ cpu-thermal { ++ polling-delay = <1000>; ++ polling-delay-passive = <250>; ++ ++ thermal-sensors = <&cpu_sensor>; ++ ++ trips { ++ cpu_warm: cpu-warm { ++ temperature = <26000>; ++ hysteresis = <2000>; ++ type = "passive"; ++ }; ++ ++ cpu_hot: cpu-hot { ++ temperature = <37000>; ++ hysteresis = <2000>; ++ type = "active"; ++ }; ++ ++ cpu_alert: cpu-alert { ++ temperature = <75000>; ++ hysteresis = <2000>; ++ type = "hot"; ++ }; ++ }; ++ ++ cooling-maps { ++ map0 { ++ trip = <&cpu_warm>; ++ cooling-device = <&cpu_fan THERMAL_NO_LIMIT 2>; ++ }; ++ ++ map1 { ++ trip = <&cpu_hot>; ++ cooling-device = <&cpu_fan 3 THERMAL_NO_LIMIT>; ++ }; ++ }; ++ }; ++ }; ++ ++ crypto: crypto@1e004000 { ++ status = "okay"; ++ ++ compatible = "mediatek,mtk-eip93"; ++ reg = <0x1e004000 0x1000>; ++ ++ interrupt-parent = <&gic>; ++ interrupts = ; ++ }; ++ ++ i2c_gpio: i2c-gpio { ++ compatible = "i2c-gpio"; ++ ++ sda-gpios = <&gpio 3 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; ++ scl-gpios = <&gpio 4 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; ++ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ status = "disabled"; ++ }; ++ ++ i2c_sfp: i2c-sfp { ++ compatible = "i2c-gpio"; ++ ++ sda-gpios = <&expender0 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; ++ scl-gpios = <&expender0 2 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; ++ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ }; ++ ++ i2c_sfp_alias_0: i2c-sfp-alias-0 { ++ compatible = "i2c-gpio"; ++ ++ sda-gpios = <&expender0_alias_0 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; ++ scl-gpios = <&expender0_alias_0 2 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; ++ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ }; ++ ++ sfp: sfp { ++ compatible = "sff,sfp"; ++ i2c-bus = <&i2c_sfp>; ++ ++ maximum-power-milliwatt = <5000>; ++ ++ mod-def0-gpios = <&expender0 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; ++ ++ // los-gpios = <&expender0 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; ++ // rate-select0-gpios = <&expender0 4 GPIO_ACTIVE_HIGH>; ++ // tx-disable-gpios = <&expender0 6 GPIO_ACTIVE_HIGH>; ++ // tx-fault-gpios = <&expender0 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; ++ }; ++ ++ sfp_alias_0: sfp-alias-0 { ++ compatible = "sff,sfp"; ++ i2c-bus = <&i2c_sfp_alias_0>; ++ ++ maximum-power-milliwatt = <5000>; ++ ++ mod-def0-gpios = <&expender0_alias_0 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; ++ ++ // los-gpios = <&expender0_alias_0 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; ++ // rate-select0-gpios = <&expender0_alias_0 4 GPIO_ACTIVE_HIGH>; ++ // tx-disable-gpios = <&expender0_alias_0 6 GPIO_ACTIVE_HIGH>; ++ // tx-fault-gpios = <&expender0_alias_0 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; ++ }; ++}; ++ ++&spi0 { ++ status = "okay"; ++ ++ spi-nor@0 { ++ compatible = "jedec,spi-nor"; ++ reg = <0>; ++ spi-max-frequency = <30000000>; ++ ++ partitions@0 { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "u-boot"; ++ reg = <0x0 0x70000>; ++ read-only; ++ }; ++ ++ partition@70000 { ++ label = "u-boot-env"; ++ reg = <0x70000 0x8000>; ++ }; ++ ++ factory: partition@75000 { ++ label = "factory"; ++ reg = <0x78000 0x8000>; ++ }; ++ }; ++ }; ++ ++ spi-nand@1 { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ compatible = "spi-nand"; ++ reg = <1>; ++ spi-max-frequency = <30000000>; ++ ++ partition@0 { ++ label = "nand0-ubi"; ++ reg = <0x0 0x0>; ++ }; ++ }; ++}; ++ ++&uartlite2 { ++ status = "okay"; ++}; ++ ++&uartlite3 { ++ status = "okay"; ++}; ++ ++&state_default { ++ gpio { ++ groups = "wdt", "jtag", "i2c"; ++ function = "gpio"; ++ }; ++}; ++ ++&pcie { ++ status = "okay"; ++}; ++ ++&pcie0 { ++ mt76@0,0 { ++ reg = <0x0000 0 0 0 0>; ++ mediatek,eeprom-file = "mt76.pcie0.eeprom"; ++ }; ++}; ++ ++&pcie1 { ++ mt76@0,0 { ++ reg = <0x0000 0 0 0 0>; ++ mediatek,eeprom-file = "mt76.pcie1.eeprom"; ++ }; ++}; ++ ++&pcie2 { ++ mt76@0,0 { ++ reg = <0x0000 0 0 0 0>; ++ mediatek,eeprom-file = "mt76.pcie2.eeprom"; ++ }; ++}; ++ ++&sdhci { ++ status = "okay"; ++ max-frequency = <20000000>; ++}; ++ ++&mdio { ++ ephy7: ethernet-phy@7 { ++ reg = <7>; ++ eee-broken-1000t; ++ eee-broken-100tx; ++ realtek,autotxid; ++ }; ++}; ++ ++&gmac0 { ++ label = "dsa0"; ++ mtd-mac-address = <&factory 0x0>; ++ phy-mode = "trgmii"; ++}; ++ ++&gmac1 { ++ status = "okay"; ++ label = "eth5"; ++ ++ mtd-mac-address = <&factory 0x0>; ++ mtd-mac-address-increment = <6>; ++ ++ phy-handle = <&ephy7>; ++ phy-mode = "rgmii-rxid"; ++}; ++ ++&switch0 { ++ ports { ++ port@0 { ++ status = "okay"; ++ label = "eth0"; ++ mtd-mac-address = <&factory 0x0>; ++ mtd-mac-address-increment = <1>; ++ }; ++ ++ port@1 { ++ status = "okay"; ++ label = "eth1"; ++ mtd-mac-address = <&factory 0x0>; ++ mtd-mac-address-increment = <2>; ++ }; ++ ++ port@2 { ++ status = "okay"; ++ label = "eth2"; ++ mtd-mac-address = <&factory 0x0>; ++ mtd-mac-address-increment = <3>; ++ }; ++ ++ port@3 { ++ status = "okay"; ++ label = "eth3"; ++ mtd-mac-address = <&factory 0x0>; ++ mtd-mac-address-increment = <4>; ++ }; ++ ++ port@4 { ++ status = "okay"; ++ label = "eth4"; ++ mtd-mac-address = <&factory 0x0>; ++ mtd-mac-address-increment = <5>; ++ }; ++ }; ++}; ++ ++&i2c_gpio { ++ status = "okay"; ++ ++ expender0: pcf8574a@38 { ++ compatible = "nxp,pcf8574a"; ++ reg = <0x38>; ++ interrupt-parent = <&gpio>; ++ interrupts = <15 IRQ_TYPE_EDGE_FALLING>; ++ gpio-controller; ++ #gpio-cells = <2>; ++ interrupt-controller; ++ #interrupt-cells = <2>; ++ }; ++ ++ expender0_alias_0: pcf8574@20 { ++ compatible = "nxp,pcf8574"; ++ reg = <0x20>; ++ interrupt-parent = <&gpio>; ++ interrupts = <15 IRQ_TYPE_EDGE_FALLING>; ++ gpio-controller; ++ #gpio-cells = <2>; ++ interrupt-controller; ++ #interrupt-cells = <2>; ++ }; ++ ++ rtc0: pcf8563@51 { ++ compatible = "nxp,pcf8563"; ++ reg = <0x51>; ++ }; ++ ++ cpu_sensor: lm75@4f { ++ compatible = "national,lm75"; ++ reg = <0x4f>; ++ #thermal-sensor-cells = <0>; ++ }; ++}; +diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk +index d456176a0178e..0de36ae7c86cf 100644 +--- a/target/linux/ramips/image/mt7621.mk ++++ b/target/linux/ramips/image/mt7621.mk +@@ -42,6 +42,20 @@ define Build/haier-sim_wr1800k-factory + rm -rf "$@.tmp" "$@.tmp.tgz" + endef + ++define Build/hatlab-gateboard-combined ++ rm -fR $@.bootfs.img ++ ++ mkfs.fat $@.bootfs.img -C 16384 ++ mcopy -i $@.bootfs.img $(IMAGE_KERNEL) ::vmlinux.itb ++ ++ PADDING="1" SIGNATURE="$(IMG_PART_SIGNATURE)" \ ++ GUID="$(IMG_PART_DISKGUID)" $(SCRIPT_DIR)/gen_image_generic.sh \ ++ $@ \ ++ $(CONFIG_TARGET_KERNEL_PARTSIZE) $@.bootfs.img \ ++ $(CONFIG_TARGET_ROOTFS_PARTSIZE) $(IMAGE_ROOTFS) \ ++ 256 ++endef ++ + define Build/iodata-mstc-header + ( \ + data_size_crc="$$(dd if=$@ ibs=64 skip=1 2>/dev/null | gzip -c | \ +@@ -1123,6 +1137,28 @@ define Device/haier_har-20s2u1 + endef + TARGET_DEVICES += haier_har-20s2u1 + ++define Device/hatlab_gateboard-one ++ $(Device/dsa-migration) ++ DEVICE_VENDOR := HATLab ++ DEVICE_MODEL := GateBoard-One ++ DEVICE_PACKAGES := 8563-watchdog kmod-i2c-gpio kmod-gpio-pcf857x kmod-sdhci-mt7620 kmod-usb3 kmod-usb-storage kmod-usb-ledtrig-usbport kmod-fs-ext4 kmod-hwmon-lm75 kmod-thermal kmod-hwmon-gpiofan kmod-rtc-pcf8563 kmod-phy-realtek kmod-sfp ++ MKUBIFS_OPTS := -m 2048 -e 124KiB -c 1024 ++ KERNEL := kernel-bin | gzip | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb ++ IMAGE/kernel.itb := append-kernel ++ IMAGE/rootfs.img := append-rootfs ++ IMAGE/rootfs.img.gz := append-rootfs | gzip ++ IMAGE/combined.img := hatlab-gateboard-combined | append-metadata ++ IMAGE/combined.img.gz := hatlab-gateboard-combined | gzip | append-metadata ++ IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata ++ IMAGES := kernel.itb sysupgrade.bin ++ ifeq ($(CONFIG_TARGET_IMAGES_GZIP),y) ++ IMAGES += rootfs.img.gz combined.img.gz ++ else ++ IMAGES += rootfs.img combined.img ++ endif ++endef ++TARGET_DEVICES += hatlab_gateboard-one ++ + define Device/hilink_hlk-7621a-evb + $(Device/dsa-migration) + $(Device/uimage-lzma-loader) +diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +index 4b23afc1cf291..dca281172348f 100644 +--- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network ++++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +@@ -150,6 +150,9 @@ ramips_setup_interfaces() + meig,slt866) + ucidef_set_interfaces_lan_wan "lan" "wan" + ;; ++ hatlab,gateboard-one) ++ ucidef_set_interfaces_lan_wan "eth0 eth1 eth2 eth3 eth4" "eth5" ++ ;; + *) + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan" + ;; +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 5d8305b788cce..b38fe16145ad9 100755 +--- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh ++++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +@@ -160,6 +160,12 @@ platform_do_upgrade() { + ;; + zyxel,wsm20) + zyxel_mstc_upgrade_prepare ++ nand_do_upgrade "$1" ++ ;; ++ hatlab,gateboard-one) ++ CI_KERNPART="vmlinux.itb" ++ CI_UBIPART="nand0-ubi" ++ + nand_do_upgrade "$1" + ;; + *) +diff --git a/target/linux/ramips/mt7621/base-files/sbin/fixup-mac-address b/target/linux/ramips/mt7621/base-files/sbin/fixup-mac-address +index dad15c584216d..375db51647b70 100755 +--- a/target/linux/ramips/mt7621/base-files/sbin/fixup-mac-address ++++ b/target/linux/ramips/mt7621/base-files/sbin/fixup-mac-address +@@ -13,6 +13,10 @@ case $board in + partname=factory + offset=$((0xe000)) + ;; ++ hatlab,gateboard-one) ++ partname=factory ++ offset=$((0x0)) ++ ;; + *) + echo "Unsupported board" + exit 1 +diff --git a/target/linux/ramips/mt7621/config-5.15 b/target/linux/ramips/mt7621/config-5.15 +index 05e4c1ce87799..b93159ed079ef 100644 +--- a/target/linux/ramips/mt7621/config-5.15 ++++ b/target/linux/ramips/mt7621/config-5.15 +@@ -156,6 +156,7 @@ CONFIG_MTD_PHYSMAP=y + CONFIG_MTD_RAW_NAND=y + CONFIG_MTD_ROUTERBOOT_PARTS=y + CONFIG_MTD_SERCOMM_PARTS=y ++CONFIG_MTD_SPI_NAND=y + CONFIG_MTD_SPI_NOR=y + CONFIG_MTD_SPI_NOR_USE_VARIABLE_ERASE=y + CONFIG_MTD_SPLIT_FIT_FW=y diff --git a/devices/rockchip_armv8/.config b/devices/rockchip_armv8/.config index 6848246c163b..72c5f4b6b6d0 100644 --- a/devices/rockchip_armv8/.config +++ b/devices/rockchip_armv8/.config @@ -4,6 +4,19 @@ CONFIG_TARGET_rockchip_armv8=y CONFIG_TARGET_MULTI_PROFILE=y CONFIG_TARGET_ALL_PROFILES=y +CONFIG_TARGET_KERNEL_PARTSIZE=32 + +# daed +CONFIG_DEVEL=y +CONFIG_BPF_TOOLCHAIN_HOST=y +# CONFIG_BPF_TOOLCHAIN_NONE is not set +CONFIG_KERNEL_BPF_EVENTS=y +CONFIG_KERNEL_CGROUP_BPF=y +CONFIG_KERNEL_DEBUG_INFO=y +CONFIG_KERNEL_DEBUG_INFO_BTF=y +# CONFIG_KERNEL_DEBUG_INFO_REDUCED is not set +CONFIG_KERNEL_XDP_SOCKETS=y + CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_radxa_rock-pi-4=n CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_pine64_rockpro64=n diff --git a/devices/rockchip_armv8/diy.sh b/devices/rockchip_armv8/diy.sh index 7a6f26c2a8bf..24080eff544c 100644 --- a/devices/rockchip_armv8/diy.sh +++ b/devices/rockchip_armv8/diy.sh @@ -3,14 +3,16 @@ shopt -s extglob SHELL_FOLDER=$(dirname $(readlink -f "$0")) +rm -rf package/devel/kselftests-bpf package/network/utils/xdp-tools + rm -rf package/boot/uboot-rockchip svn export --force https://github.com/coolsnowwolf/lede/trunk/package/boot/uboot-rockchip package/boot/uboot-rockchip svn export --force https://github.com/coolsnowwolf/lede/trunk/package/boot/arm-trusted-firmware-rockchip-vendor package/boot/arm-trusted-firmware-rockchip-vendor rm -rf target/linux/generic target/linux/rockchip/!(Makefile) -svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/generic target/linux/generic -svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/rockchip target/linux/rockchip +svn export https://github.com/coolsnowwolf/lede/trunk/target/linux/generic target/linux/generic +svn checkout https://github.com/coolsnowwolf/lede/trunk/target/linux/rockchip target/linux/rockchip curl -sfL https://raw.githubusercontent.com/coolsnowwolf/lede/master/include/kernel-5.15 -o include/kernel-5.15 diff --git a/devices/rockchip_rk3588_bsp/.config b/devices/rockchip_rk3588_bsp/.config index 604b93e91723..8bafaaa11559 100644 --- a/devices/rockchip_rk3588_bsp/.config +++ b/devices/rockchip_rk3588_bsp/.config @@ -3,6 +3,19 @@ CONFIG_TARGET_rockchip=y CONFIG_TARGET_rockchip_rk3588_bsp=y CONFIG_TARGET_MULTI_PROFILE=y +CONFIG_TARGET_KERNEL_PARTSIZE=32 + +# daed +CONFIG_DEVEL=y +CONFIG_BPF_TOOLCHAIN_HOST=y +# CONFIG_BPF_TOOLCHAIN_NONE is not set +CONFIG_KERNEL_BPF_EVENTS=y +CONFIG_KERNEL_CGROUP_BPF=y +CONFIG_KERNEL_DEBUG_INFO=y +CONFIG_KERNEL_DEBUG_INFO_BTF=y +# CONFIG_KERNEL_DEBUG_INFO_REDUCED is not set +CONFIG_KERNEL_XDP_SOCKETS=y + CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_friendlyelec_nanopi-r6c=y CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_friendlyelec_nanopi-r6c-plus=y CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_friendlyelec_nanopi-r6s=y @@ -10,6 +23,11 @@ CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_friendlyelec_nanopc-t6=y CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_xunlong_orangepi-5=y CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_xunlong_orangepi-5-plus=y CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_rockchip_bpi-r2-pro=y +CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_firefly_roc-rk3328-cc=y +CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_pine64_quartz64-a=y +CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_radxa_rock-3a=y +CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_pine64_rockpro64=y +CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_radxa_rock-pi-4=y CONFIG_PACKAGE_kmod-rtl8821cu=m CONFIG_PACKAGE_kmod-rtl88x2bu=m diff --git a/devices/rockchip_rk3588_bsp/diy.sh b/devices/rockchip_rk3588_bsp/diy.sh index 85b8f94b5562..8d3e9cbe8f88 100644 --- a/devices/rockchip_rk3588_bsp/diy.sh +++ b/devices/rockchip_rk3588_bsp/diy.sh @@ -9,6 +9,8 @@ sed -i -e 's,kmod-r8168,kmod-r8169,g' target/linux/rockchip/image/armv8.mk sed -i 's/DEFAULT_PACKAGES +=/DEFAULT_PACKAGES += fdisk lsblk kmod-drm-rockchip/' target/linux/rockchip/Makefile +rm -rf package/network/utils/xdp-tools package/devel/kselftests-bpf + echo ' CONFIG_SENSORS_PWM_FAN=y ' >> ./target/linux/rockchip/armv8/config-6.1 diff --git a/devices/x86_64/.config b/devices/x86_64/.config index 8d35cdaafed6..43adf8c4e6f7 100644 --- a/devices/x86_64/.config +++ b/devices/x86_64/.config @@ -8,6 +8,17 @@ CONFIG_GRUB_IMAGES=y CONFIG_GRUB_EFI_IMAGES=y CONFIG_VMDK_IMAGES=n +# daed +CONFIG_DEVEL=y +CONFIG_BPF_TOOLCHAIN_HOST=y +# CONFIG_BPF_TOOLCHAIN_NONE is not set +CONFIG_KERNEL_BPF_EVENTS=y +CONFIG_KERNEL_CGROUP_BPF=y +CONFIG_KERNEL_DEBUG_INFO=y +CONFIG_KERNEL_DEBUG_INFO_BTF=y +# CONFIG_KERNEL_DEBUG_INFO_REDUCED is not set +CONFIG_KERNEL_XDP_SOCKETS=y + # 其他需要安装的软件包: CONFIG_PACKAGE_luci-ssl=n # uhttpd服务 CONFIG_PACKAGE_luci-ssl-nginx=y # nginx diff --git a/devices/x86_64/diy.sh b/devices/x86_64/diy.sh index e90e1fef5876..3e9e8b638d86 100644 --- a/devices/x86_64/diy.sh +++ b/devices/x86_64/diy.sh @@ -2,10 +2,10 @@ SHELL_FOLDER=$(dirname $(readlink -f "$0")) -svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/x86/files target/linux/x86/files +svn checkout https://github.com/coolsnowwolf/lede/trunk/target/linux/x86/files target/linux/x86/files rm -rf target/linux/x86/files/.svn -svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/x86/patches-5.15 target/linux/x86/patches-5.15 +svn checkout https://github.com/coolsnowwolf/lede/trunk/target/linux/x86/patches-5.15 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 diff --git a/devices/x86_generic/.config b/devices/x86_generic/.config index 8016c0bf1b42..c856640df039 100644 --- a/devices/x86_generic/.config +++ b/devices/x86_generic/.config @@ -8,6 +8,17 @@ CONFIG_GRUB_IMAGES=y CONFIG_GRUB_EFI_IMAGES=y CONFIG_VMDK_IMAGES=n +# daed +CONFIG_DEVEL=y +CONFIG_BPF_TOOLCHAIN_HOST=y +# CONFIG_BPF_TOOLCHAIN_NONE is not set +CONFIG_KERNEL_BPF_EVENTS=y +CONFIG_KERNEL_CGROUP_BPF=y +CONFIG_KERNEL_DEBUG_INFO=y +CONFIG_KERNEL_DEBUG_INFO_BTF=y +# CONFIG_KERNEL_DEBUG_INFO_REDUCED is not set +CONFIG_KERNEL_XDP_SOCKETS=y + # 其他需要安装的软件包: CONFIG_PACKAGE_luci-ssl=n # uhttpd服务 CONFIG_PACKAGE_luci-ssl-nginx=y # nginx diff --git a/devices/x86_generic/diy.sh b/devices/x86_generic/diy.sh index a10b1775014e..d3325244be50 100644 --- a/devices/x86_generic/diy.sh +++ b/devices/x86_generic/diy.sh @@ -2,10 +2,10 @@ SHELL_FOLDER=$(dirname $(readlink -f "$0")) -svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/x86/files target/linux/x86/files +svn checkout https://github.com/coolsnowwolf/lede/trunk/target/linux/x86/files target/linux/x86/files rm -rf target/linux/x86/files/.svn -svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/x86/patches-5.15 target/linux/x86/patches-5.15 +svn checkout https://github.com/coolsnowwolf/lede/trunk/target/linux/x86/patches-5.15 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