Merge Official Source

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2024-12-01 15:33:27 +08:00
commit 524af8a23c
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
73 changed files with 1535 additions and 817 deletions

View File

@ -352,6 +352,15 @@ define Trusted-Firmware-A/mt7986-spim-nand-ddr3
DDR_TYPE:=ddr3
endef
define Trusted-Firmware-A/mt7986-spim-nand-ubi-ddr3
NAME:=MediaTek MT7986 (SPI-NAND via SPIM using UBI, DDR3)
BOOT_DEVICE:=spim-nand
BUILD_SUBTARGET:=filogic
PLAT:=mt7986
DDR_TYPE:=ddr3
USE_UBI:=1
endef
define Trusted-Firmware-A/mt7988-nor-ddr3
NAME:=MediaTek MT7988 (SPI-NOR, DDR3)
BOOT_DEVICE:=nor
@ -531,6 +540,7 @@ TFA_TARGETS:= \
mt7986-sdmmc-ddr3 \
mt7986-snand-ddr3 \
mt7986-spim-nand-ddr3 \
mt7986-spim-nand-ubi-ddr3 \
mt7986-ram-ddr4 \
mt7986-emmc-ddr4 \
mt7986-nor-ddr4 \
@ -570,6 +580,7 @@ TFA_MAKE_FLAGS += \
$(if $(RAM_BOOT_UART_DL),RAM_BOOT_UART_DL=1) \
$(if $(USE_UBI),UBI=1 $(if $(findstring mt7622,$(PLAT)),OVERRIDE_UBI_START_ADDR=0x80000)) \
$(if $(USE_UBI),UBI=1 $(if $(findstring mt7981,$(PLAT)),OVERRIDE_UBI_START_ADDR=0x100000)) \
$(if $(USE_UBI),UBI=1 $(if $(findstring mt7986,$(PLAT)),OVERRIDE_UBI_START_ADDR=0x200000)) \
$(if $(RAM_BOOT_UART_DL),bl2,all)
define Package/trusted-firmware-a-ram/install

View File

@ -40,6 +40,7 @@ h3c,magic-nx30-pro|\
imou,lc-hx3001|\
jcg,q30-pro|\
livinet,zr-3020-ubootmod|\
mercusys,mr90x-v1-ubi|\
netcore,n60|\
nokia,ea0326gmp|\
qihoo,360t7|\

View File

@ -655,6 +655,18 @@ define U-Boot/mt7986_jdcloud_re-cp-03
DEPENDS:=+trusted-firmware-a-mt7986-emmc-ddr4
endef
define U-Boot/mt7986_mercusys_mr90x-v1
NAME:=MERCUSYS MR90X v1
BUILD_SUBTARGET:=filogic
BUILD_DEVICES:=mercusys_mr90x-v1-ubi
UBOOT_CONFIG:=mt7986_mercusys_mr90x-v1
UBOOT_IMAGE:=u-boot.fip
BL2_BOOTDEV:=spim-nand-ubi
BL2_SOC:=mt7986
BL2_DDRTYPE:=ddr3
DEPENDS:=+trusted-firmware-a-mt7986-spim-nand-ubi-ddr3
endef
define U-Boot/mt7986_netcore_n60
NAME:=Netcore N60
BUILD_SUBTARGET:=filogic
@ -939,6 +951,7 @@ UBOOT_TARGETS := \
mt7986_bananapi_bpi-r3-mini-snand \
mt7986_glinet_gl-mt6000 \
mt7986_jdcloud_re-cp-03 \
mt7986_mercusys_mr90x-v1 \
mt7986_netcore_n60 \
mt7986_tplink_tl-xdr4288 \
mt7986_tplink_tl-xdr6086 \

View File

@ -0,0 +1,343 @@
--- /dev/null
+++ b/configs/mt7986_mercusys_mr90x-v1_defconfig
@@ -0,0 +1,107 @@
+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_DEFAULT_DEVICE_TREE="mt7986b-mercusys_mr90x-v1"
+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_FIT=y
+CONFIG_BOOTDELAY=30
+CONFIG_AUTOBOOT_KEYED=y
+CONFIG_AUTOBOOT_MENU_SHOW=y
+CONFIG_DEFAULT_FDT_FILE="mediatek/mt7986b-mercusys_mr90x-v1.dtb"
+CONFIG_LOGLEVEL=7
+CONFIG_PRE_CONSOLE_BUFFER=y
+CONFIG_LOG=y
+CONFIG_BOARD_LATE_INIT=y
+CONFIG_HUSH_PARSER=y
+CONFIG_SYS_PROMPT="MT7986> "
+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_MTD=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_PXE=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_CMD_UBI=y
+CONFIG_CMD_UBI_RENAME=y
+CONFIG_OF_EMBED=y
+CONFIG_ENV_OVERWRITE=y
+CONFIG_ENV_IS_IN_UBI=y
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
+CONFIG_ENV_UBI_PART="ubi"
+CONFIG_ENV_UBI_VOLUME="ubootenv"
+CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2"
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_USE_DEFAULT_ENV_FILE=y
+CONFIG_DEFAULT_ENV_FILE="mercusys_mr90x-v1_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_I2C is not set
+# CONFIG_MMC is not set
+CONFIG_LED=y
+CONFIG_LED_BLINK=y
+CONFIG_LED_GPIO=y
+CONFIG_MTD=y
+CONFIG_DM_MTD=y
+CONFIG_MTD_SPI_NAND=y
+CONFIG_MTD_UBI_FASTMAP=y
+CONFIG_PHY_FIXED=y
+CONFIG_MEDIATEK_ETH=y
+CONFIG_PHY=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_RAM=y
+CONFIG_DM_SERIAL=y
+CONFIG_MTK_SERIAL=y
+CONFIG_SPI=y
+CONFIG_DM_SPI=y
+CONFIG_MTK_SPIM=y
+CONFIG_RANDOM_UUID=y
+CONFIG_ZSTD=y
+CONFIG_HEXDUMP=y
+CONFIG_LMB_MAX_REGIONS=64
--- /dev/null
+++ b/arch/arm/dts/mt7986b-mercusys_mr90x-v1.dts
@@ -0,0 +1,174 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2024
+ * Author: Mikhail Zhilkin <csharper2005@gmail.com>
+ */
+
+/dts-v1/;
+#include "mt7986.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/linux-event-codes.h>
+
+/ {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ model = "MERCUSYS MR90X v1";
+ compatible = "mediatek,mt7986", "mediatek,mt7986-rfb";
+
+ chosen {
+ stdout-path = &uart0;
+ tick-timer = &timer0;
+ };
+
+ memory@40000000 {
+ device_type = "memory";
+ reg = <0x40000000 0x20000000>;
+ };
+
+ keys {
+ compatible = "gpio-keys";
+
+ reset {
+ label = "reset";
+ linux,code = <KEY_RESTART>;
+ gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ led-0 {
+ label = "green:lan2";
+ gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
+ };
+
+ led-1 {
+ label = "green:lan1";
+ gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
+ };
+
+ led-2 {
+ label = "green:lan0";
+ gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+ };
+
+ led-3 {
+ label = "green:wan";
+ gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+ };
+
+ led-4 {
+ label = "amber:status";
+ gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
+ };
+
+ led_status_green: led-5 {
+ label = "green:status";
+ gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
+ };
+ };
+};
+
+&uart0 {
+ status = "okay";
+};
+
+&uart1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart1_pins>;
+ status = "disabled";
+};
+
+&eth {
+ status = "okay";
+ mediatek,gmac-id = <0>;
+ phy-mode = "2500base-x";
+ mediatek,switch = "mt7531";
+ reset-gpios = <&gpio 5 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 = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
+ drive-strength = <MTK_DRIVE_8mA>;
+ bias-pull-up = <MTK_PUPD_SET_R1R0_00>;
+ };
+
+ conf-pd {
+ pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
+ drive-strength = <MTK_DRIVE_8mA>;
+ bias-pull-down = <MTK_PUPD_SET_R1R0_00>;
+ };
+ };
+
+ spic_pins: spi1-pins-func-1 {
+ mux {
+ function = "spi";
+ groups = "spi1_2";
+ };
+ };
+
+ uart1_pins: spi1-pins-func-3 {
+ mux {
+ function = "uart";
+ groups = "uart1_2";
+ };
+ };
+};
+
+&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;
+ tick_dly = <2>;
+ sample_sel = <0>;
+
+ spi_nand@1 {
+ compatible = "spi-nand";
+ reg = <1>;
+ spi-max-frequency = <20000000>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ reg = <0x0 0x100000>;
+ label = "bl2";
+ };
+
+ partition@100000 {
+ reg = <0x100000 0x100000>;
+ label = "factory";
+ };
+
+ partition@200000 {
+ reg = <0x200000 0x7e00000>;
+ label = "ubi";
+ };
+ };
+ };
+};
+
+&watchdog {
+ status = "disabled";
+};
--- /dev/null
+++ b/mercusys_mr90x-v1_env
@@ -0,0 +1,53 @@
+ipaddr=192.168.1.1
+serverip=192.168.1.254
+loadaddr=0x46000000
+console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
+bootargs=console=ttyS0,115200n8 console_msg_format=syslog
+bootcmd=run check_buttons ; run boot_production ; run boot_recovery
+bootconf=config-1
+bootdelay=0
+bootfile=openwrt-mediatek-filogic-mercusys_mr90x-v1-ubi-initramfs-recovery.itb
+bootfile_bl2=openwrt-mediatek-filogic-mercusys_mr90x-v1-ubi-preloader.bin
+bootfile_fip=openwrt-mediatek-filogic-mercusys_mr90x-v1-ubi-bl31-uboot.fip
+bootfile_upg=openwrt-mediatek-filogic-mercusys_mr90x-v1-ubi-squashfs-sysupgrade.itb
+bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
+bootmenu_default=0
+bootmenu_delay=0
+bootmenu_title= ( ( ( OpenWrt ) ) ) [SPI-NAND]
+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.=noboot=1 ; replacevol=1 ; run boot_tftp_production ; noboot= ; replacevol= ; run bootmenu_confirm_return
+bootmenu_5=Load recovery system via TFTP then write to NAND.=noboot=1 ; replacevol=1 ; run boot_tftp_recovery ; noboot= ; 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_default=run led_boot ; run bootcmd ; run boot_recovery ; replacevol=1 ; run boot_tftp_forever
+boot_production=run led_boot ; run ubi_read_production && bootm $loadaddr#$bootconf
+boot_recovery=run led_boot ; run ubi_read_recovery && bootm $loadaddr#$bootconf
+boot_tftp=run led_boot ; tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
+boot_tftp_forever=run led_boot ; while true ; do run boot_tftp ; sleep 1 ; done
+boot_tftp_production=run led_boot ; tftpboot $loadaddr $bootfile_upg && test $replacevol = 1 && iminfo $loadaddr && run ubi_write_production ; if test $noboot = 1 ; then else bootm $loadaddr#$bootconf ; fi
+boot_tftp_recovery=run led_boot ; tftpboot $loadaddr $bootfile && test $replacevol = 1 && iminfo $loadaddr && run ubi_write_recovery ; if test $noboot = 1 ; then else bootm $loadaddr#$bootconf ; fi
+boot_tftp_write_fip=run led_boot ; tftpboot $loadaddr $bootfile_fip && run ubi_write_fip && run reset_factory
+boot_tftp_write_bl2=run led_boot ; tftpboot $loadaddr $bootfile_bl2 && run snand_write_bl2
+check_buttons=if button reset ; then run boot_tftp ; fi
+ethaddr_factory=mtd read factory 0x40080000 0x0 0x20000 && env readmem -b ethaddr 0x40088000 0x6 ; setenv ethaddr_factory
+led_boot=led green:status off ; led amber:status on
+reset_factory=mw $loadaddr 0xff 0x1f000 ; ubi write $loadaddr ubootenv 0x1f000 ; ubi write $loadaddr ubootenv2 0x1f000 ; ubi remove rootfs_data
+snand_write_bl2=mtd erase bl2 && mtd write bl2 $loadaddr 0x0 0x40000
+ubi_create_env=ubi check ubootenv || ubi create ubootenv 0x1f000 dynamic ; ubi check ubootenv2 || ubi create ubootenv2 0x1f000 dynamic
+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_fip=run ubi_remove_rootfs ; ubi check fip && ubi remove fip ; ubi create fip $filesize static && ubi write $loadaddr fip $filesize
+ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic && ubi write $loadaddr fit $filesize
+ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic && ubi write $loadaddr recovery $filesize
+_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv
+_firstboot=setenv _firstboot ; run ethaddr_factory ; run _switch_to_menu ; run _init_env ; bootmenu
+_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"

View File

@ -10,9 +10,11 @@ Package/ath11k-firmware-wcn6750 = $(call Package/firmware-default,WCN6750 ath11k
define Package/ath11k-firmware-wcn6750/install
$(INSTALL_DIR) $(1)/lib/firmware/ath11k/WCN6750/hw1.0
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/ath11k/WCN6750/hw1.0/{Notice.txt,board-2.bin} $(1)/lib/firmware/ath11k/WCN6750/hw1.0/
$(PKG_BUILD_DIR)/ath11k/WCN6750/hw1.0/board-2.bin $(1)/lib/firmware/ath11k/WCN6750/hw1.0/
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/ath11k/WCN6750/hw1.0/sc7280/* $(1)/lib/firmware/ath11k/WCN6750/hw1.0/
$(PKG_BUILD_DIR)/ath11k/WCN6750/hw1.0/Notice.txt $(1)/lib/firmware/ath11k/WCN6750/hw1.0/
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/ath11k/WCN6750/hw1.0/sc7280/wpss.mbn $(1)/lib/firmware/ath11k/WCN6750/hw1.0/
endef
$(eval $(call BuildPackage,ath11k-firmware-wcn6750))

View File

@ -140,14 +140,14 @@ define Package/rtl8761bu-firmware/install
endef
$(eval $(call BuildPackage,rtl8761bu-firmware))
Package/rtl8812a-firmware = $(call Package/firmware-default,RealTek RTL8812A firmware,,LICENCE.rtlwifi_firmware.txt)
Package/rtl8812a-firmware = $(call Package/firmware-default,RealTek RTL8812AU firmware)
define Package/rtl8812a-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/rtw88
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw88/rtw8812a_fw.bin $(1)/lib/firmware/rtw88
endef
$(eval $(call BuildPackage,rtl8812a-firmware))
Package/rtl8821a-firmware = $(call Package/firmware-default,RealTek RTL8821A firmware,,LICENCE.rtlwifi_firmware.txt)
Package/rtl8821a-firmware = $(call Package/firmware-default,RealTek RTL8821AU firmware)
define Package/rtl8821a-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/rtw88
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw88/rtw8821a_fw.bin $(1)/lib/firmware/rtw88

View File

@ -19,7 +19,7 @@ Link: https://patch.msgid.link/20240718070616.42217-1-pkshih@realtek.com
config RTW88_CORE
tristate
depends on m
+ select WANT_DEV_COREDUMP
+ select BPAUTO_WANT_DEV_COREDUMP
config RTW88_PCI
tristate

View File

@ -547,7 +547,7 @@ Link: https://patch.msgid.link/913f1747-38fc-4409-85a4-57bb9cee506b@gmail.com
--- a/drivers/net/wireless/realtek/rtw88/usb.c
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
@@ -571,8 +571,8 @@ static void rtw_usb_rx_handler(struct wo
@@ -570,8 +570,8 @@ static void rtw_usb_rx_handler(struct wo
do {
rx_desc = skb->data;

View File

@ -0,0 +1,70 @@
From 4aefde403da7af30757915e0462d88398c9388c5 Mon Sep 17 00:00:00 2001
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Date: Tue, 8 Oct 2024 21:44:02 +0300
Subject: [PATCH] wifi: rtw88: Fix the RX aggregation in USB 3 mode
RTL8822CU, RTL8822BU, and RTL8821CU don't need BIT_EN_PRE_CALC.
In fact, RTL8822BU in USB 3 mode doesn't pass all the frames to the
driver, resulting in much lower download speed than normal:
$ iperf3 -c 192.168.0.1 -R
Connecting to host 192.168.0.1, port 5201
Reverse mode, remote host 192.168.0.1 is sending
[ 5] local 192.168.0.50 port 43062 connected to 192.168.0.1 port 5201
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.00 sec 26.9 MBytes 225 Mbits/sec
[ 5] 1.00-2.00 sec 7.50 MBytes 62.9 Mbits/sec
[ 5] 2.00-3.00 sec 8.50 MBytes 71.3 Mbits/sec
[ 5] 3.00-4.00 sec 8.38 MBytes 70.3 Mbits/sec
[ 5] 4.00-5.00 sec 7.75 MBytes 65.0 Mbits/sec
[ 5] 5.00-6.00 sec 8.00 MBytes 67.1 Mbits/sec
[ 5] 6.00-7.00 sec 8.00 MBytes 67.1 Mbits/sec
[ 5] 7.00-8.00 sec 7.75 MBytes 65.0 Mbits/sec
[ 5] 8.00-9.00 sec 7.88 MBytes 66.1 Mbits/sec
[ 5] 9.00-10.00 sec 7.88 MBytes 66.1 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.02 sec 102 MBytes 85.1 Mbits/sec 224 sender
[ 5] 0.00-10.00 sec 98.6 MBytes 82.7 Mbits/sec receiver
Don't set BIT_EN_PRE_CALC. Then the speed is much better:
% iperf3 -c 192.168.0.1 -R
Connecting to host 192.168.0.1, port 5201
Reverse mode, remote host 192.168.0.1 is sending
[ 5] local 192.168.0.50 port 39000 connected to 192.168.0.1 port 5201
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.00 sec 52.8 MBytes 442 Mbits/sec
[ 5] 1.00-2.00 sec 71.9 MBytes 603 Mbits/sec
[ 5] 2.00-3.00 sec 74.8 MBytes 627 Mbits/sec
[ 5] 3.00-4.00 sec 75.9 MBytes 636 Mbits/sec
[ 5] 4.00-5.00 sec 76.0 MBytes 638 Mbits/sec
[ 5] 5.00-6.00 sec 74.1 MBytes 622 Mbits/sec
[ 5] 6.00-7.00 sec 74.0 MBytes 621 Mbits/sec
[ 5] 7.00-8.00 sec 76.0 MBytes 638 Mbits/sec
[ 5] 8.00-9.00 sec 74.4 MBytes 624 Mbits/sec
[ 5] 9.00-10.00 sec 63.9 MBytes 536 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 717 MBytes 601 Mbits/sec 24 sender
[ 5] 0.00-10.00 sec 714 MBytes 599 Mbits/sec receiver
Fixes: 002a5db9a52a ("wifi: rtw88: Enable USB RX aggregation for 8822c/8822b/8821c")
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/afb94a82-3d18-459e-97fc-1a217608cdf0@gmail.com
---
drivers/net/wireless/realtek/rtw88/usb.c | 1 -
1 file changed, 1 deletion(-)
--- a/drivers/net/wireless/realtek/rtw88/usb.c
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
@@ -771,7 +771,6 @@ static void rtw_usb_dynamic_rx_agg_v1(st
u8 size, timeout;
u16 val16;
- rtw_write32_set(rtwdev, REG_RXDMA_AGG_PG_TH, BIT_EN_PRE_CALC);
rtw_write8_set(rtwdev, REG_TXDMA_PQ_MAP, BIT_RXDMA_AGG_EN);
rtw_write8_clr(rtwdev, REG_RXDMA_AGG_PG_TH + 3, BIT(7));

View File

@ -1,59 +0,0 @@
From 53bc1b73b67836ac9867f93dee7a443986b4a94f Mon Sep 17 00:00:00 2001
From: Ping-Ke Shih <pkshih@realtek.com>
Date: Thu, 22 Aug 2024 09:42:54 +0800
Subject: [PATCH] wifi: mac80211: export ieee80211_purge_tx_queue() for drivers
Drivers need to purge TX SKB when stopping. Using skb_queue_purge() can't
report TX status to mac80211, causing ieee80211_free_ack_frame() warns
"Have pending ack frames!". Export ieee80211_purge_tx_queue() for drivers
to not have to reimplement it.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20240822014255.10211-1-pkshih@realtek.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
include/net/mac80211.h | 13 +++++++++++++
net/mac80211/ieee80211_i.h | 2 --
net/mac80211/status.c | 1 +
3 files changed, 14 insertions(+), 2 deletions(-)
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3184,6 +3184,19 @@ ieee80211_get_alt_retry_rate(const struc
void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
/**
+ * ieee80211_purge_tx_queue - purge TX skb queue
+ * @hw: the hardware
+ * @skbs: the skbs
+ *
+ * Free a set of transmit skbs. Use this function when device is going to stop
+ * but some transmit skbs without TX status are still queued.
+ * This function does not take the list lock and the caller must hold the
+ * relevant locks to use it.
+ */
+void ieee80211_purge_tx_queue(struct ieee80211_hw *hw,
+ struct sk_buff_head *skbs);
+
+/**
* DOC: Hardware crypto acceleration
*
* mac80211 is capable of taking advantage of many hardware
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -2077,8 +2077,6 @@ void __ieee80211_subif_start_xmit(struct
u32 info_flags,
u32 ctrl_flags,
u64 *cookie);
-void ieee80211_purge_tx_queue(struct ieee80211_hw *hw,
- struct sk_buff_head *skbs);
struct sk_buff *
ieee80211_build_data_template(struct ieee80211_sub_if_data *sdata,
struct sk_buff *skb, u32 info_flags);
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -1305,3 +1305,4 @@ void ieee80211_purge_tx_queue(struct iee
while ((skb = __skb_dequeue(skbs)))
ieee80211_free_txskb(hw, skb);
}
+EXPORT_SYMBOL(ieee80211_purge_tx_queue);

View File

@ -1,116 +0,0 @@
From 3e5e4a801aaf4283390cc34959c6c48f910ca5ea Mon Sep 17 00:00:00 2001
From: Ping-Ke Shih <pkshih@realtek.com>
Date: Thu, 22 Aug 2024 09:42:55 +0800
Subject: [PATCH] wifi: rtw88: use ieee80211_purge_tx_queue() to purge TX skb
When removing kernel modules by:
rmmod rtw88_8723cs rtw88_8703b rtw88_8723x rtw88_sdio rtw88_core
Driver uses skb_queue_purge() to purge TX skb, but not report tx status
causing "Have pending ack frames!" warning. Use ieee80211_purge_tx_queue()
to correct this.
Since ieee80211_purge_tx_queue() doesn't take locks, to prevent racing
between TX work and purge TX queue, flush and destroy TX work in advance.
wlan0: deauthenticating from aa:f5:fd:60:4c:a8 by local
choice (Reason: 3=DEAUTH_LEAVING)
------------[ cut here ]------------
Have pending ack frames!
WARNING: CPU: 3 PID: 9232 at net/mac80211/main.c:1691
ieee80211_free_ack_frame+0x5c/0x90 [mac80211]
CPU: 3 PID: 9232 Comm: rmmod Tainted: G C
6.10.1-200.fc40.aarch64 #1
Hardware name: pine64 Pine64 PinePhone Braveheart
(1.1)/Pine64 PinePhone Braveheart (1.1), BIOS 2024.01 01/01/2024
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : ieee80211_free_ack_frame+0x5c/0x90 [mac80211]
lr : ieee80211_free_ack_frame+0x5c/0x90 [mac80211]
sp : ffff80008c1b37b0
x29: ffff80008c1b37b0 x28: ffff000003be8000 x27: 0000000000000000
x26: 0000000000000000 x25: ffff000003dc14b8 x24: ffff80008c1b37d0
x23: ffff000000ff9f80 x22: 0000000000000000 x21: 000000007fffffff
x20: ffff80007c7e93d8 x19: ffff00006e66f400 x18: 0000000000000000
x17: ffff7ffffd2b3000 x16: ffff800083fc0000 x15: 0000000000000000
x14: 0000000000000000 x13: 2173656d61726620 x12: 6b636120676e6964
x11: 0000000000000000 x10: 000000000000005d x9 : ffff8000802af2b0
x8 : ffff80008c1b3430 x7 : 0000000000000001 x6 : 0000000000000001
x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000000
x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000003be8000
Call trace:
ieee80211_free_ack_frame+0x5c/0x90 [mac80211]
idr_for_each+0x74/0x110
ieee80211_free_hw+0x44/0xe8 [mac80211]
rtw_sdio_remove+0x9c/0xc0 [rtw88_sdio]
sdio_bus_remove+0x44/0x180
device_remove+0x54/0x90
device_release_driver_internal+0x1d4/0x238
driver_detach+0x54/0xc0
bus_remove_driver+0x78/0x108
driver_unregister+0x38/0x78
sdio_unregister_driver+0x2c/0x40
rtw_8723cs_driver_exit+0x18/0x1000 [rtw88_8723cs]
__do_sys_delete_module.isra.0+0x190/0x338
__arm64_sys_delete_module+0x1c/0x30
invoke_syscall+0x74/0x100
el0_svc_common.constprop.0+0x48/0xf0
do_el0_svc+0x24/0x38
el0_svc+0x3c/0x158
el0t_64_sync_handler+0x120/0x138
el0t_64_sync+0x194/0x198
---[ end trace 0000000000000000 ]---
Reported-by: Peter Robinson <pbrobinson@gmail.com>
Closes: https://lore.kernel.org/linux-wireless/CALeDE9OAa56KMzgknaCD3quOgYuEHFx9_hcT=OFgmMAb+8MPyA@mail.gmail.com/
Tested-by: Ping-Ke Shih <pkshih@realtek.com> # 8723DU
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20240822014255.10211-2-pkshih@realtek.com
---
drivers/net/wireless/realtek/rtw88/sdio.c | 6 +++---
drivers/net/wireless/realtek/rtw88/usb.c | 5 +++--
2 files changed, 6 insertions(+), 5 deletions(-)
--- a/drivers/net/wireless/realtek/rtw88/sdio.c
+++ b/drivers/net/wireless/realtek/rtw88/sdio.c
@@ -1297,12 +1297,12 @@ static void rtw_sdio_deinit_tx(struct rt
struct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev->priv;
int i;
- for (i = 0; i < RTK_MAX_TX_QUEUE_NUM; i++)
- skb_queue_purge(&rtwsdio->tx_queue[i]);
-
flush_workqueue(rtwsdio->txwq);
destroy_workqueue(rtwsdio->txwq);
kfree(rtwsdio->tx_handler_data);
+
+ for (i = 0; i < RTK_MAX_TX_QUEUE_NUM; i++)
+ ieee80211_purge_tx_queue(rtwdev->hw, &rtwsdio->tx_queue[i]);
}
int rtw_sdio_probe(struct sdio_func *sdio_func,
--- a/drivers/net/wireless/realtek/rtw88/usb.c
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
@@ -423,10 +423,11 @@ static void rtw_usb_tx_handler(struct wo
static void rtw_usb_tx_queue_purge(struct rtw_usb *rtwusb)
{
+ struct rtw_dev *rtwdev = rtwusb->rtwdev;
int i;
for (i = 0; i < ARRAY_SIZE(rtwusb->tx_queue); i++)
- skb_queue_purge(&rtwusb->tx_queue[i]);
+ ieee80211_purge_tx_queue(rtwdev->hw, &rtwusb->tx_queue[i]);
}
static void rtw_usb_write_port_complete(struct urb *urb)
@@ -889,9 +890,9 @@ static void rtw_usb_deinit_tx(struct rtw
{
struct rtw_usb *rtwusb = rtw_get_usb_priv(rtwdev);
- rtw_usb_tx_queue_purge(rtwusb);
flush_workqueue(rtwusb->txwq);
destroy_workqueue(rtwusb->txwq);
+ rtw_usb_tx_queue_purge(rtwusb);
}
static int rtw_usb_intf_init(struct rtw_dev *rtwdev,

View File

@ -174,7 +174,7 @@ Link: https://patch.msgid.link/2b3e3e6f-541b-4a3b-8ca3-65b267e6a95a@gmail.com
void rtw_tx_rsvd_page_pkt_info_update(struct rtw_dev *rtwdev,
--- a/drivers/net/wireless/realtek/rtw88/usb.c
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
@@ -458,7 +458,7 @@ static int rtw_usb_write_data(struct rtw
@@ -457,7 +457,7 @@ static int rtw_usb_write_data(struct rtw
skb_put_data(skb, buf, size);
skb_push(skb, chip->tx_pkt_desc_sz);
memset(skb->data, 0, chip->tx_pkt_desc_sz);
@ -183,7 +183,7 @@ Link: https://patch.msgid.link/2b3e3e6f-541b-4a3b-8ca3-65b267e6a95a@gmail.com
rtw_tx_fill_txdesc_checksum(rtwdev, pkt_info, skb->data);
ret = rtw_usb_write_port(rtwdev, qsel, skb,
@@ -525,7 +525,7 @@ static int rtw_usb_tx_write(struct rtw_d
@@ -524,7 +524,7 @@ static int rtw_usb_tx_write(struct rtw_d
pkt_desc = skb_push(skb, chip->tx_pkt_desc_sz);
memset(pkt_desc, 0, chip->tx_pkt_desc_sz);
ep = qsel_to_ep(rtwusb, pkt_info->qsel);

View File

@ -17,7 +17,7 @@ Link: https://patch.msgid.link/e443f5d9-4b53-4f64-985c-64313ec80bef@gmail.com
--- a/drivers/net/wireless/realtek/rtw88/usb.c
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
@@ -478,6 +478,7 @@ static int rtw_usb_write_data_rsvd_page(
@@ -477,6 +477,7 @@ static int rtw_usb_write_data_rsvd_page(
pkt_info.tx_pkt_size = size;
pkt_info.qsel = TX_DESC_QSEL_BEACON;
pkt_info.offset = chip->tx_pkt_desc_sz;

View File

@ -37,10 +37,42 @@ Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/0b8e8093-8103-4999-86bf-0055ec52ea64@gmail.com
---
drivers/net/wireless/realtek/rtw88/Kconfig | 33 +++++++++++++++++++++
drivers/net/wireless/realtek/rtw88/Makefile | 15 ++++++++++
2 files changed, 48 insertions(+)
Kconfig.local | 15 ++++++++
drivers/net/wireless/realtek/rtw88/Kconfig | 40 ++++++++++++++++++++-
drivers/net/wireless/realtek/rtw88/Makefile | 15 ++++++++
3 files changed, 69 insertions(+), 1 deletion(-)
--- a/Kconfig.local
+++ b/Kconfig.local
@@ -1144,6 +1144,15 @@ config BACKPORTED_RTW88_8723D
config BACKPORTED_RTW88_8821C
tristate
default RTW88_8821C
+config BACKPORTED_RTW88_88XXA
+ tristate
+ default RTW88_88XXA
+config BACKPORTED_RTW88_8821A
+ tristate
+ default RTW88_8821A
+config BACKPORTED_RTW88_8812A
+ tristate
+ default RTW88_8812A
config BACKPORTED_RTW88_8822BE
tristate
default RTW88_8822BE
@@ -1183,6 +1192,12 @@ config BACKPORTED_RTW88_8821CS
config BACKPORTED_RTW88_8821CU
tristate
default RTW88_8821CU
+config BACKPORTED_RTW88_8821AU
+ tristate
+ default RTW88_8821AU
+config BACKPORTED_RTW88_8812AU
+ tristate
+ default RTW88_8812AU
config BACKPORTED_RTW88_DEBUG
tristate
default RTW88_DEBUG
--- a/drivers/net/wireless/realtek/rtw88/Kconfig
+++ b/drivers/net/wireless/realtek/rtw88/Kconfig
@@ -54,6 +54,20 @@ config RTW88_8821C

View File

@ -1,16 +1,14 @@
From 7b5ce65d90187f0944e70dc5741aa0edfac926f4 Mon Sep 17 00:00:00 2001
From: Larry Finger <Larry.Finger@lwfinger.net>
From ff5a1c94e53c0d24f610c2c30add82f75b728737 Mon Sep 17 00:00:00 2001
From: Larry Finger <Larry.Finger@gmail.com>
Date: Wed, 6 Nov 2024 15:55:31 +0200
Subject: [PATCH] wifi: rtw88: 8821au: Add additional devices to the USB_DEVICE
list
Subject: [PATCH 1/6] wifi: rtw88: 8821au: Add additional devices to the
USB_DEVICE list
These are the entries that Nick Morrow provided. From
https://github.com/morrownr/8821au-20210708
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/da05b866-a9ff-428c-a008-35e8cf200a98@gmail.com
---
.../net/wireless/realtek/rtw88/rtw8821au.c | 52 ++++++++++++++++++-
1 file changed, 51 insertions(+), 1 deletion(-)

View File

@ -1,14 +1,12 @@
From 1ee6ff9ae3c1a9eda9081f9db04f85d3a7352d38 Mon Sep 17 00:00:00 2001
From d21ad2e4edfb64d3f32685607a457576eea3c5cd Mon Sep 17 00:00:00 2001
From: Nick Morrow <usbwifi2024@gmail.com>
Date: Wed, 6 Nov 2024 15:57:10 +0200
Subject: [PATCH] wifi: rtw88: 8812au: Add more device IDs
Subject: [PATCH 2/6] wifi: rtw88: 8812au: Add more device IDs
From https://github.com/morrownr/8812au-20210820.
Signed-off-by: Nick Morrow <usbwifi2024@gmail.com>
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/31b7ee6b-f96d-43e0-a32f-a9eb1174a0c1@gmail.com
---
.../net/wireless/realtek/rtw88/rtw8812au.c | 68 ++++++++++++++++++-
1 file changed, 67 insertions(+), 1 deletion(-)

View File

@ -0,0 +1,69 @@
From 213dfa630285bb0241f3eaeb778db8ff128f10ba Mon Sep 17 00:00:00 2001
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Date: Fri, 8 Nov 2024 01:41:08 +0200
Subject: [PATCH 3/6] wifi: rtw88: usb: Support USB 3 with RTL8812AU
Add the function to automatically switch the RTL8812AU into USB 3 mode.
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
drivers/net/wireless/realtek/rtw88/usb.c | 34 ++++++++++++++++++++++--
1 file changed, 32 insertions(+), 2 deletions(-)
--- a/drivers/net/wireless/realtek/rtw88/usb.c
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
@@ -929,6 +929,32 @@ static void rtw_usb_intf_deinit(struct r
usb_set_intfdata(intf, NULL);
}
+static int rtw_usb_switch_mode_old(struct rtw_dev *rtwdev)
+{
+ struct rtw_usb *rtwusb = rtw_get_usb_priv(rtwdev);
+ enum usb_device_speed cur_speed = rtwusb->udev->speed;
+ u8 hci_opt;
+
+ if (cur_speed == USB_SPEED_HIGH) {
+ hci_opt = rtw_read8(rtwdev, REG_HCI_OPT_CTRL);
+
+ if ((hci_opt & (BIT(2) | BIT(3))) != BIT(3)) {
+ rtw_write8(rtwdev, REG_HCI_OPT_CTRL, 0x8);
+ rtw_write8(rtwdev, REG_SYS_SDIO_CTRL, 0x2);
+ rtw_write8(rtwdev, REG_ACLK_MON, 0x1);
+ rtw_write8(rtwdev, 0x3d, 0x3);
+ /* usb disconnect */
+ rtw_write8(rtwdev, REG_SYS_PW_CTRL + 1, 0x80);
+ return 1;
+ }
+ } else if (cur_speed == USB_SPEED_SUPER) {
+ rtw_write8_clr(rtwdev, REG_SYS_SDIO_CTRL, BIT(1));
+ rtw_write8_clr(rtwdev, REG_ACLK_MON, BIT(0));
+ }
+
+ return 0;
+}
+
static int rtw_usb_switch_mode_new(struct rtw_dev *rtwdev)
{
enum usb_device_speed cur_speed;
@@ -982,7 +1008,8 @@ static int rtw_usb_switch_mode(struct rt
{
u8 id = rtwdev->chip->id;
- if (id != RTW_CHIP_TYPE_8822C && id != RTW_CHIP_TYPE_8822B)
+ if (id != RTW_CHIP_TYPE_8822C && id != RTW_CHIP_TYPE_8822B &&
+ id != RTW_CHIP_TYPE_8812A)
return 0;
if (!rtwdev->efuse.usb_mode_switch) {
@@ -997,7 +1024,10 @@ static int rtw_usb_switch_mode(struct rt
return 0;
}
- return rtw_usb_switch_mode_new(rtwdev);
+ if (id == RTW_CHIP_TYPE_8812A)
+ return rtw_usb_switch_mode_old(rtwdev);
+ else /* RTL8822CU, RTL8822BU */
+ return rtw_usb_switch_mode_new(rtwdev);
}
int rtw_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)

View File

@ -0,0 +1,65 @@
From 2b38362bd3b8e0a3691f0a8e82444a54f702e384 Mon Sep 17 00:00:00 2001
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Date: Fri, 8 Nov 2024 01:43:50 +0200
Subject: [PATCH 4/6] wifi: rtw88: usb: Enable RX aggregation for 8821au/8812au
USB RX aggregation improves the RX speed on certain ARM systems, like
the NanoPi NEO Core2. With RTL8811AU, before: 30 Mbps, after: 224 Mbps.
The out-of-tree driver uses aggregation size of 7 in USB 3 mode, but
that doesn't work here. rtw88 advertises support for receiving AMSDU
in AMPDU, so the AP sends larger frames, up to ~5100 bytes. With a size
of 7 RTL8812AU frequently tries to aggregate more frames than will fit
in 32768 bytes. Use a size of 6 instead.
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
drivers/net/wireless/realtek/rtw88/usb.c | 30 ++++++++++++++++++++++++
1 file changed, 30 insertions(+)
--- a/drivers/net/wireless/realtek/rtw88/usb.c
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
@@ -788,6 +788,32 @@ static void rtw_usb_dynamic_rx_agg_v1(st
rtw_write16(rtwdev, REG_RXDMA_AGG_PG_TH, val16);
}
+static void rtw_usb_dynamic_rx_agg_v2(struct rtw_dev *rtwdev, bool enable)
+{
+ struct rtw_usb *rtwusb = rtw_get_usb_priv(rtwdev);
+ u8 size, timeout;
+ u16 val16;
+
+ if (rtwusb->udev->speed == USB_SPEED_SUPER) {
+ size = 0x6;
+ timeout = 0x1a;
+ } else {
+ size = 0x5;
+ timeout = 0x20;
+ }
+
+ if (!enable) {
+ size = 0x0;
+ timeout = 0x1;
+ }
+
+ val16 = u16_encode_bits(size, BIT_RXDMA_AGG_PG_TH) |
+ u16_encode_bits(timeout, BIT_DMA_AGG_TO_V1);
+
+ rtw_write16(rtwdev, REG_RXDMA_AGG_PG_TH, val16);
+ rtw_write8_set(rtwdev, REG_TXDMA_PQ_MAP, BIT_RXDMA_AGG_EN);
+}
+
static void rtw_usb_dynamic_rx_agg(struct rtw_dev *rtwdev, bool enable)
{
switch (rtwdev->chip->id) {
@@ -796,6 +822,10 @@ static void rtw_usb_dynamic_rx_agg(struc
case RTW_CHIP_TYPE_8821C:
rtw_usb_dynamic_rx_agg_v1(rtwdev, enable);
break;
+ case RTW_CHIP_TYPE_8821A:
+ case RTW_CHIP_TYPE_8812A:
+ rtw_usb_dynamic_rx_agg_v2(rtwdev, enable);
+ break;
case RTW_CHIP_TYPE_8723D:
/* Doesn't like aggregation. */
break;

View File

@ -0,0 +1,32 @@
From 927dcd0ab53f39ee00a2d1f204b5aac77e28fcf9 Mon Sep 17 00:00:00 2001
From: Colin Ian King <colin.i.king@gmail.com>
Date: Wed, 6 Nov 2024 15:46:42 +0000
Subject: [PATCH 5/6] wifi: rtlwifi: rtl8821ae: phy: restore removed code to
fix infinite loop
A previous clean-up fix removed the assignment of v2 inside a while loop
that turned it into an infinite loop. Fix this by restoring the assignment
of v2 from array[] so that v2 is updated inside the loop.
Fixes: cda37445718d ("wifi: rtlwifi: rtl8821ae: phy: remove some useless code")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Tested-by: Ping-Ke Shih <pkshih@realtek.com>
Reviewed-by: Su Hui <suhui@nfschina.com>
---
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
@@ -2033,8 +2033,10 @@ static bool _rtl8821ae_phy_config_bb_wit
if (!_rtl8821ae_check_condition(hw, v1)) {
i += 2; /* skip the pair of expression*/
v2 = array[i+1];
- while (v2 != 0xDEAD)
+ while (v2 != 0xDEAD) {
i += 3;
+ v2 = array[i + 1];
+ }
}
}
}

View File

@ -0,0 +1,31 @@
From acadf3a63b39ad03167a633fa3cea8c0fc2ab87f Mon Sep 17 00:00:00 2001
From: Nick Morrow <usbwifi2024@gmail.com>
Date: Thu, 7 Nov 2024 08:28:46 +0800
Subject: [PATCH 6/6] wifi: rtw88: Add additional USB IDs for RTL8812BU
Add three additional USB IDs found in
https://github.com/morrownr/88x2bu-20210702
to support more RTL8812BU devices.
Signed-off-by: Nick Morrow <usbwifi2024@gmail.com>
Signed-off-by: Zenm Chen <zenmchen@gmail.com>
Signed-off-by: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
---
drivers/net/wireless/realtek/rtw88/rtw8822bu.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/drivers/net/wireless/realtek/rtw88/rtw8822bu.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822bu.c
@@ -67,6 +67,12 @@ static const struct usb_device_id rtw_88
.driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* LiteOn */
{ USB_DEVICE_AND_INTERFACE_INFO(0x20f4, 0x808a, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* TRENDnet TEW-808UBM */
+ { USB_DEVICE_AND_INTERFACE_INFO(0x20f4, 0x805a, 0xff, 0xff, 0xff),
+ .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* TRENDnet TEW-805UBH */
+ { USB_DEVICE_AND_INTERFACE_INFO(0x056e, 0x4011, 0xff, 0xff, 0xff),
+ .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* ELECOM WDB-867DU3S */
+ { USB_DEVICE_AND_INTERFACE_INFO(0x2c4e, 0x0107, 0xff, 0xff, 0xff),
+ .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* Mercusys MA30H */
{},
};
MODULE_DEVICE_TABLE(usb, rtw_8822bu_id_table);

View File

@ -2,10 +2,11 @@ PKG_DRIVERS += \
rtlwifi rtlwifi-pci rtlwifi-btcoexist rtlwifi-usb rtl8192c-common rtl8192d-common \
rtl8192ce rtl8192se rtl8192de rtl8192cu rtl8192du rtl8723-common rtl8723be \
rtl8723bs rtl8821ae rtl8xxxu rtw88 rtw88-pci rtw88-usb rtw88-sdio rtw88-8821c \
rtw88-8822b rtw88-8822c rtw88-88xxa rtw88-8723x rtw88-8723d rtw88-8812au \
rtw88-8821au rtw88-8821ce rtw88-8821cu rtw88-8822be rtw88-8822bu rtw88-8822ce \
rtw88-8822cu rtw88-8723de rtw88-8723ds rtw88-8723du rtw89 rtw89-pci rtw89-8851be \
rtw89-8852ae rtw89-8852b-common rtw89-8852be rtw89-8852ce rtw89-8922ae
rtw88-8822b rtw88-8822c rtw88-8723x rtw88-8723d rtw88-8821ce rtw88-8821cu \
rtw88-8822be rtw88-8822bu rtw88-8822ce rtw88-8822cu rtw88-8723de rtw88-8723ds \
rtw88-88xxa rtw88-8821a rtw88-8812a rtw88-8821au rtw88-8812au \
rtw88-8723du rtw89 rtw89-pci rtw89-8851be rtw89-8852ae rtw89-8852b-common \
rtw89-8852be rtw89-8852ce rtw89-8922ae
config-$(call config_package,rtlwifi) += RTL_CARDS RTLWIFI
config-$(call config_package,rtlwifi-pci) += RTLWIFI_PCI
@ -34,9 +35,6 @@ config-$(call config_package,rtw88) += RTW88 RTW88_CORE
config-$(call config_package,rtw88-pci) += RTW88_PCI
config-$(call config_package,rtw88-usb) += RTW88_USB
config-$(call config_package,rtw88-sdio) += RTW88_SDIO
config-$(call config_package,rtw88-88xxa) += RTW88_88XXA
config-$(call config_package,rtw88-8812au) += RTW88_8812A RTW88_8812AU
config-$(call config_package,rtw88-8821au) += RTW88_8821A RTW88_8821AU
config-$(call config_package,rtw88-8821c) += RTW88_8821C
config-$(call config_package,rtw88-8821ce) += RTW88_8821CE
config-$(call config_package,rtw88-8821cu) += RTW88_8821CU
@ -51,6 +49,11 @@ config-$(call config_package,rtw88-8723d) += RTW88_8723D
config-$(call config_package,rtw88-8723de) += RTW88_8723DE
config-$(call config_package,rtw88-8723ds) += RTW88_8723DS
config-$(call config_package,rtw88-8723du) += RTW88_8723DU
config-$(call config_package,rtw88-88xxa) += RTW88_88XXA
config-$(call config_package,rtw88-8821a) += RTW88_8821A
config-$(call config_package,rtw88-8812a) += RTW88_8812A
config-$(call config_package,rtw88-8821au) += RTW88_8821AU
config-$(call config_package,rtw88-8812au) += RTW88_8812AU
config-$(CONFIG_PACKAGE_RTW88_DEBUG) += RTW88_DEBUG
config-$(CONFIG_PACKAGE_RTW88_DEBUGFS) += RTW88_DEBUGFS
@ -258,6 +261,33 @@ define KernelPackage/rtw88-usb
HIDDEN:=1
endef
define KernelPackage/rtw88-88xxa
$(call KernelPackage/mac80211/Default)
TITLE:=Realtek RTL8812A/RTL8821A family support
DEPENDS+= +@DRIVER_11AC_SUPPORT +kmod-rtw88-usb
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_88xxa.ko
AUTOLOAD:=$(call AutoProbe,rtw88_88xxa)
HIDDEN:=1
endef
define KernelPackage/rtw88-8821a
$(call KernelPackage/mac80211/Default)
TITLE:=Realtek RTL8821A family support
DEPENDS+= +kmod-rtw88-88xxa
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8821a.ko
AUTOLOAD:=$(call AutoProbe,rtw88_8821a)
HIDDEN:=1
endef
define KernelPackage/rtw88-8812a
$(call KernelPackage/mac80211/Default)
TITLE:=Realtek RTL8812A family support
DEPENDS+= +kmod-rtw88-88xxa
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8812a.ko
AUTOLOAD:=$(call AutoProbe,rtw88_8812a)
HIDDEN:=1
endef
define KernelPackage/rtw88-8821c
$(call KernelPackage/mac80211/Default)
TITLE:=Realtek RTL8821C family support
@ -285,15 +315,6 @@ define KernelPackage/rtw88-8822c
HIDDEN:=1
endef
define KernelPackage/rtw88-88xxa
$(call KernelPackage/mac80211/Default)
TITLE:=Realtek RTL88xxA family support
DEPENDS+= +kmod-rtw88-usb +@DRIVER_11AC_SUPPORT
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_88xxa.ko
AUTOLOAD:=$(call AutoProbe,rtw88_88xxa)
HIDDEN:=1
endef
define KernelPackage/rtw88-8723x
$(call KernelPackage/mac80211/Default)
TITLE:=Realtek RTL8723x family support
@ -312,24 +333,20 @@ define KernelPackage/rtw88-8723d
HIDDEN:=1
endef
define KernelPackage/rtw88-8821au
$(call KernelPackage/mac80211/Default)
TITLE:=Realtek RTL8821AU support
DEPENDS+= +kmod-rtw88-8821a +rtl8821a-firmware
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8821au.ko
AUTOLOAD:=$(call AutoProbe,rtw88_8821au)
endef
define KernelPackage/rtw88-8812au
$(call KernelPackage/mac80211/Default)
TITLE:=Realtek RTL8812AU support
DEPENDS+= +kmod-rtw88-88xxa +rtl8812a-firmware
FILES:= \
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8812a.ko \
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8812au.ko
AUTOLOAD:=$(call AutoProbe,rtw88_8812a rtw88_8812au)
endef
define KernelPackage/rtw88-8821au
$(call KernelPackage/mac80211/Default)
TITLE:=Realtek RTL8821AU/RTL8811AU support
DEPENDS+= +kmod-rtw88-88xxa +rtl8821a-firmware
FILES:= \
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8821a.ko \
$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8821au.ko
AUTOLOAD:=$(call AutoProbe,rtw88_8821a rtw88_8821au)
DEPENDS+= +kmod-rtw88-8812a +rtl8812a-firmware
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8812au.ko
AUTOLOAD:=$(call AutoProbe,rtw88_8812au)
endef
define KernelPackage/rtw88-8821ce

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=netifd
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git

View File

@ -30,12 +30,12 @@ reload_service() {
init_switch
ubus call network reload || rv=1
/sbin/wifi reload_legacy
[ -x /sbin/wifi ] && /sbin/wifi reload_legacy
return $rv
}
stop_service() {
/sbin/wifi down
[ -x /sbin/wifi ] && /sbin/wifi down
ifdown -a
sleep 1
}

View File

@ -116,10 +116,6 @@
macaddr_art_0: macaddr@0 {
reg = <0x0 0x6>;
};
macaddr_art_1002: macaddr@1002 {
reg = <0x1002 0x6>;
};
};
};
@ -143,6 +139,6 @@
&wmac {
status = "okay";
nvmem-cells = <&cal_art_1000>, <&macaddr_art_1002>;
nvmem-cell-names = "calibration", "mac-address";
nvmem-cells = <&cal_art_1000>;
nvmem-cell-names = "calibration";
};

View File

@ -154,10 +154,6 @@
macaddr_art_6: macaddr@6 {
reg = <0x6 0x6>;
};
macaddr_art_1002: macaddr@1002 {
reg = <0x1002 0x6>;
};
};
};
@ -173,6 +169,6 @@
&wmac {
status = "okay";
nvmem-cells = <&cal_art_1000>, <&macaddr_art_1002>;
nvmem-cell-names = "calibration", "mac-address";
nvmem-cells = <&cal_art_1000>;
nvmem-cell-names = "calibration";
};

View File

@ -122,8 +122,8 @@
&wmac {
status = "okay";
nvmem-cells = <&macaddr_art_1002 0>, <&calibration_art_1000>;
nvmem-cell-names = "mac-address", "calibration";
nvmem-cells = <&calibration_art_1000>;
nvmem-cell-names = "calibration";
};
&pcie {

View File

@ -140,10 +140,6 @@
macaddr_art_6: macaddr@6 {
reg = <0x6 0x6>;
};
macaddr_art_1002: macaddr@1002 {
reg = <0x1002 0x6>;
};
};
};
};
@ -174,6 +170,6 @@
&wmac {
status = "okay";
nvmem-cells = <&cal_art_1000>, <&macaddr_art_1002>;
nvmem-cell-names = "calibration", "mac-address";
nvmem-cells = <&cal_art_1000>;
nvmem-cell-names = "calibration";
};

View File

@ -124,6 +124,6 @@
&wmac {
status = "okay";
nvmem-cells = <&cal_art_1000>, <&macaddr_art_1002 0>;
nvmem-cell-names = "calibration", "mac-address";
nvmem-cells = <&cal_art_1000>;
nvmem-cell-names = "calibration";
};

View File

@ -1,148 +1,8 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qca955x.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
#include "qca9557_sophos_ap15.dtsi"
/ {
compatible = "sophos,ap15", "qca,qca9557";
model = "Sophos AP15";
aliases {
led-boot = &led_status_green;
led-failsafe = &led_status_yellow;
led-running = &led_status_green;
led-upgrade = &led_status_yellow;
label-mac-device = &eth0;
};
chosen {
bootargs = "console=ttyS0,115200n8";
};
leds {
compatible = "gpio-leds";
led_status_green: status_green {
function = LED_FUNCTION_STATUS;
color = <LED_COLOR_ID_GREEN>;
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
default-state = "on";
};
led_status_yellow: status_yellow {
function = LED_FUNCTION_STATUS;
color = <LED_COLOR_ID_YELLOW>;
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
};
};
};
&spi {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <25000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x000000 0x040000>;
read-only;
};
partition@40000 {
label = "u-boot-env";
reg = <0x040000 0x010000>;
};
partition@50000 {
label = "art";
reg = <0x050000 0x010000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
cal_art_1000: calibration@1000 {
reg = <0x1000 0x440>;
};
};
};
partition@60000 {
label = "config";
reg = <0x060000 0x010000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
macaddr_config_201a: macaddr@201a {
reg = <0x201a 0x6>;
};
};
};
partition@70000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x070000 0xf90000>;
};
};
};
};
&mdio0 {
status = "okay";
phy-mask = <0x10>;
phy4: ethernet-phy@4 {
reg = <4>;
eee-broken-100tx;
eee-broken-1000t;
};
};
&eth0 {
status = "okay";
pll-data = <0xa6000000 0xa0000101 0xa0001313>;
nvmem-cells = <&macaddr_config_201a>;
nvmem-cell-names = "mac-address";
phy-mode = "rgmii-id";
phy-handle = <&phy4>;
gmac_config: gmac-config {
device = <&gmac>;
rgmii-enabled = <1>;
rxdv-delay = <3>;
rxd-delay = <3>;
txen-delay = <3>;
txd-delay = <3>;
};
};
&wmac {
status = "okay";
nvmem-cells = <&cal_art_1000>;
nvmem-cell-names = "calibration";
};

View File

@ -0,0 +1,145 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qca955x.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
/ {
aliases {
led-boot = &led_status_green;
led-failsafe = &led_status_yellow;
led-running = &led_status_green;
led-upgrade = &led_status_yellow;
label-mac-device = &eth0;
};
chosen {
bootargs = "console=ttyS0,115200n8";
};
leds {
compatible = "gpio-leds";
led_status_green: status_green {
function = LED_FUNCTION_STATUS;
color = <LED_COLOR_ID_GREEN>;
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
default-state = "on";
};
led_status_yellow: status_yellow {
function = LED_FUNCTION_STATUS;
color = <LED_COLOR_ID_YELLOW>;
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
};
};
};
&spi {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <25000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x000000 0x040000>;
read-only;
};
partition@40000 {
label = "u-boot-env";
reg = <0x040000 0x010000>;
};
partition@50000 {
label = "art";
reg = <0x050000 0x010000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
cal_art_1000: calibration@1000 {
reg = <0x1000 0x440>;
};
};
};
partition@60000 {
label = "config";
reg = <0x060000 0x010000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
macaddr_config_201a: macaddr@201a {
reg = <0x201a 0x6>;
};
};
};
partition@70000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x070000 0xf90000>;
};
};
};
};
&mdio0 {
status = "okay";
phy-mask = <0x10>;
phy4: ethernet-phy@4 {
reg = <4>;
eee-broken-100tx;
eee-broken-1000t;
};
};
&eth0 {
status = "okay";
pll-data = <0xa6000000 0xa0000101 0xa0001313>;
nvmem-cells = <&macaddr_config_201a>;
nvmem-cell-names = "mac-address";
phy-mode = "rgmii-id";
phy-handle = <&phy4>;
gmac_config: gmac-config {
device = <&gmac>;
rgmii-enabled = <1>;
rxdv-delay = <3>;
rxd-delay = <3>;
txen-delay = <3>;
txd-delay = <3>;
};
};
&wmac {
status = "okay";
nvmem-cells = <&cal_art_1000>;
nvmem-cell-names = "calibration";
};

View File

@ -1,27 +1,11 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qca955x.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
#include "qca9557_sophos_ap15.dtsi"
/ {
compatible = "sophos,ap15c", "qca,qca9557";
model = "Sophos AP15C";
aliases {
led-boot = &led_status_green;
led-failsafe = &led_status_yellow;
led-running = &led_status_green;
led-upgrade = &led_status_yellow;
label-mac-device = &eth0;
};
chosen {
bootargs = "console=ttyS0,115200n8";
};
keys {
compatible = "gpio-keys";
@ -32,128 +16,4 @@
debounce-interval = <60>;
};
};
leds {
compatible = "gpio-leds";
led_status_green: status_green {
function = LED_FUNCTION_STATUS;
color = <LED_COLOR_ID_GREEN>;
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
default-state = "on";
};
led_status_yellow: status_yellow {
function = LED_FUNCTION_STATUS;
color = <LED_COLOR_ID_YELLOW>;
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
};
};
};
&spi {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <25000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x000000 0x040000>;
read-only;
};
partition@40000 {
label = "u-boot-env";
reg = <0x040000 0x010000>;
};
partition@50000 {
label = "art";
reg = <0x050000 0x010000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
cal_art_1000: calibration@1000 {
reg = <0x1000 0x440>;
};
};
};
partition@60000 {
label = "config";
reg = <0x060000 0x010000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
macaddr_config_201a: macaddr@201a {
reg = <0x201a 0x6>;
};
};
};
partition@70000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x070000 0xf90000>;
};
};
};
};
&mdio0 {
status = "okay";
phy-mask = <0x10>;
phy4: ethernet-phy@4 {
reg = <4>;
eee-broken-100tx;
eee-broken-1000t;
};
};
&eth0 {
status = "okay";
pll-data = <0xa6000000 0xa0000101 0xa0001313>;
nvmem-cells = <&macaddr_config_201a>;
nvmem-cell-names = "mac-address";
phy-mode = "rgmii-id";
phy-handle = <&phy4>;
gmac_config: gmac-config {
device = <&gmac>;
rgmii-enabled = <1>;
rxdv-delay = <3>;
rxd-delay = <3>;
txen-delay = <3>;
txd-delay = <3>;
};
};
&wmac {
status = "okay";
nvmem-cells = <&cal_art_1000>;
nvmem-cell-names = "calibration";
};

View File

@ -111,14 +111,6 @@
macaddr_art_0: macaddr@0 {
reg = <0x0 0x6>;
};
macaddr_art_1002: macaddr@1002 {
reg = <0x1002 0x6>;
};
macaddr_art_5006: macaddr@5006 {
reg = <0x5006 0x6>;
};
};
};
@ -182,8 +174,8 @@
compatible = "qcom,ath10k";
reg = <0 0 0 0 0>;
nvmem-cells = <&macaddr_art_5006>, <&calibration_ath10k>;
nvmem-cell-names = "mac-address", "pre-calibration";
nvmem-cells = <&calibration_ath10k>;
nvmem-cell-names = "pre-calibration";
};
};
@ -206,6 +198,6 @@
&wmac {
status = "okay";
nvmem-cells = <&macaddr_art_1002>, <&calibration_ath9k>;
nvmem-cell-names = "mac-address", "calibration";
nvmem-cells = <&calibration_ath9k>;
nvmem-cell-names = "calibration";
};

View File

@ -0,0 +1,178 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qca956x.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
#include <dt-bindings/mtd/partitions/uimage.h>
/ {
model = "KuWFi N650";
compatible = "kuwfi,n650", "qca,qca9563";
aliases {
label-mac-device = &eth0;
led-boot = &led_green;
led-running = &led_green;
led-failsafe = &led_blue;
led-upgrade = &led_blue;
};
virtual_flash {
compatible = "mtd-concat";
devices = <&fwconcat0 &fwconcat1>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
reg = <0x0 0x0>;
label = "firmware";
compatible = "openwrt,uimage", "denx,uimage";
openwrt,ih-magic = <IH_MAGIC_OKLI>;
};
};
};
keys {
compatible = "gpio-keys";
reset {
label = "Reset button";
linux,code = <KEY_RESTART>;
gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
debounce-interval = <60>;
};
};
leds {
compatible = "gpio-leds";
led_blue: blue {
function = LED_FUNCTION_DEBUG;
color = <LED_COLOR_ID_BLUE>;
gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
};
led_green: green {
function = LED_FUNCTION_POWER;
color = <LED_COLOR_ID_GREEN>;
gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
};
};
};
&spi {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <25000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x000000 0x030000>;
read-only;
};
partition@30000 {
label = "u-boot-env";
reg = <0x030000 0x010000>;
};
fwconcat0: partition@40000 {
label = "fwconcat0";
reg = <0x040000 0xd40000>;
};
partition@d80000 {
label = "loader";
reg = <0xd80000 0x10000>;
};
fwconcat1: partition@d90000 {
label = "fwconcat1";
reg = <0xd90000 0x160000>;
};
partition@ef0000 {
label = "log";
reg = <0xef0000 0x0f0000>;
read-only;
};
partition@fe0000 {
label = "nvram";
reg = <0xfe0000 0x010000>;
read-only;
};
partition@ff0000 {
label = "art";
reg = <0xff0000 0x10000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
macaddr_art_0: macaddr@0 {
compatible = "mac-base";
reg = <0x0 0x6>;
#nvmem-cell-cells = <1>;
};
precal_art_5000: pre-calibration@5000 {
reg = <0x5000 0x2f20>;
};
};
};
};
};
};
&mdio0 {
status = "okay";
phy0: ethernet-phy@0 {
reg = <0>;
phy-mode = "sgmii";
reset-gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
qca,mib-poll-interval = <500>;
qca,ar8327-initvals = <
0x04 0x00080080 /* PORT0 PAD MODE CTRL */
0x7c 0x0000007e /* PORT0_STATUS */
>;
};
};
&eth0 {
status = "okay";
nvmem-cells = <&macaddr_art_0 0>;
nvmem-cell-names = "mac-address";
phy-handle = <&phy0>;
phy-mode = "sgmii";
};
&pcie {
status = "okay";
wifi@0,0 {
compatible = "pci168c,0056";
reg = <0x0000 0 0 0 0>;
nvmem-cells = <&precal_art_5000>, <&macaddr_art_0 1>;
nvmem-cell-names = "pre-calibration", "mac-address";
};
};

View File

@ -401,6 +401,10 @@ ath79_setup_interfaces()
ucidef_add_switch "switch0" \
"0@eth0" "1:lan:2" "4:lan:1"
;;
kuwfi,n650)
ucidef_add_switch "switch0" \
"0@eth0" "2:lan:1" "3:lan:2"
;;
letv,lba-047-ch)
ucidef_set_interface_wan "eth0"
ucidef_add_switch "switch0" \

View File

@ -1965,6 +1965,25 @@ define Device/kuwfi_c910
endef
TARGET_DEVICES += kuwfi_c910
define Device/kuwfi_n650
$(Device/loader-okli-uimage)
SOC := qca9563
DEVICE_VENDOR := KuWFi
DEVICE_MODEL := N650
DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca9888-ct
FACTORY_SIZE := 13632k
LOADER_FLASH_OFFS := 0x40000
KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49
IMAGE_SIZE := 15040k
IMAGES += factory.bin
IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
append-rootfs | pad-rootfs | check-size | pad-to 13568k | \
append-loader-okli-uimage $(1) | pad-to 64k | check-size $$$$(FACTORY_SIZE)
ARTIFACTS := loader.bin
ARTIFACT/loader.bin := append-loader-okli-uimage $(1) | pad-to 64k
endef
TARGET_DEVICES += kuwfi_n650
define Device/letv_lba-047-ch
$(Device/loader-okli-uimage)
SOC := qca9531

View File

@ -0,0 +1,252 @@
// SPDX-License-Identifier: (GL-2.0 OR MIT)
/dts-v1/;
#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>
#include "mt7986b.dtsi"
/ {
aliases: aliases {
led-boot = &led_status_green;
led-failsafe = &led_status_green;
led-running = &led_status_green;
led-upgrade = &led_status_green;
serial0 = &uart0;
};
chosen: chosen {
stdout-path = "serial0:115200n8";
};
memory {
reg = <0 0x40000000 0 0x20000000>;
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&pio 10 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
leds {
compatible = "gpio-leds";
led-0 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <2>;
gpios = <&pio 7 GPIO_ACTIVE_LOW>;
};
led-1 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <1>;
gpios = <&pio 9 GPIO_ACTIVE_LOW>;
};
led-2 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <0>;
gpios = <&pio 12 GPIO_ACTIVE_LOW>;
};
led-3 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_WAN;
gpios = <&pio 13 GPIO_ACTIVE_LOW>;
};
led-4 {
color = <LED_COLOR_ID_AMBER>;
function = LED_FUNCTION_STATUS;
gpios = <&pio 16 GPIO_ACTIVE_HIGH>;
panic-indicator;
};
led_status_green: led-5 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_STATUS;
gpios = <&pio 17 GPIO_ACTIVE_HIGH>;
};
};
};
&crypto {
status = "okay";
};
&eth {
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-handle = <&phy6>;
phy-mode = "2500base-x";
};
mdio: mdio-bus {
#address-cells = <1>;
#size-cells = <0>;
};
};
&mdio {
#address-cells = <1>;
#size-cells = <0>;
reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>;
reset-delay-us = <1500000>;
reset-post-delay-us = <1000000>;
/* WAN/LAN 2.5Gbps phy
MaxLinear GPY211C0VC (SLNW8) */
phy6: phy@6 {
compatible = "ethernet-phy-ieee802.3-c45";
reg = <6>;
};
switch: switch@1f {
compatible = "mediatek,mt7531";
reg = <31>;
reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>;
};
};
&switch {
ports {
#address-cells = <1>;
#size-cells = <0>;
/* WAN/LAN 1Gbps port */
port@0 {
reg = <0>;
label = "lan0";
};
/* LAN1 port */
port@1 {
reg = <1>;
label = "lan1";
};
/* LAN2 port */
port@2 {
reg = <2>;
label = "lan2";
};
port@6 {
reg = <6>;
ethernet = <&gmac0>;
phy-mode = "2500base-x";
fixed-link {
speed = <2500>;
full-duplex;
pause;
};
};
};
};
&pio {
spi_flash_pins: spi-flash-pins-33-to-38 {
mux {
function = "spi";
groups = "spi0", "spi0_wp_hold";
};
conf-pu {
pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
drive-strength = <8>;
mediatek,pull-up-adv = <0>; /* bias-disable */
};
conf-pd {
pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
drive-strength = <8>;
mediatek,pull-down-adv = <0>; /* bias-disable */
};
};
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>;
};
};
};
&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi_flash_pins>;
status = "okay";
spi_nand_flash: flash@0 {
compatible = "spi-nand";
#address-cells = <1>;
#size-cells = <1>;
reg = <0>;
spi-max-frequency = <20000000>;
spi-tx-bus-width = <4>;
spi-rx-bus-width = <4>;
partitions: partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
};
};
};
&trng {
status = "okay";
};
&uart0 {
status = "okay";
};
&watchdog {
status = "okay";
};
&wifi {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&wf_2g_5g_pins>;
ieee80211-freq-limit = <2400000 2500000>, <5170000 5835000>;
};

View File

@ -0,0 +1,124 @@
// SPDX-License-Identifier: (GL-2.0 OR MIT)
#include "mt7986b-mercusys-mr90x-v1-common.dtsi"
/ {
compatible = "mercusys,mr90x-v1-ubi", "mediatek,mt7986b";
model = "MERCUSYS MR90X v1 (UBI)";
};
&aliases {
label-mac-device = &gmac0;
};
&chosen {
bootargs-append = " root=/dev/fit0 rootwait";
rootdisk = <&ubi_fit>;
};
&gmac0 {
nvmem-cells = <&macaddr_factory_8000 0>;
nvmem-cell-names = "mac-address";
};
&gmac1 {
nvmem-cells = <&macaddr_factory_8000 1>;
nvmem-cell-names = "mac-address";
};
&partitions {
partition@0 {
label = "boot";
reg = <0x0 0x200000>;
read-only;
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "bl2";
reg = <0x0 0x100000>;
read-only;
};
partition@100000 {
label = "factory";
reg = <0x100000 0x100000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
eeprom_factory_0: eeprom@0 {
reg = <0x0 0x1000>;
};
macaddr_factory_8000: macaddr@8000 {
compatible = "mac-base";
reg = <0x8000 0x6>;
#nvmem-cell-cells = <1>;
};
};
};
};
partition@200000 {
compatible = "linux,ubi";
reg = <0x200000 0x7e00000>;
label = "ubi";
volumes {
ubi_fit: ubi-volume-fit {
volname = "fit";
};
ubi_ubootenv: ubi-volume-ubootenv {
volname = "ubootenv";
};
ubi_ubootenv2: ubi-volume-ubootenv2 {
volname = "ubootenv2";
};
};
};
};
&trng {
status = "okay";
};
&uart0 {
status = "okay";
};
&ubi_ubootenv {
nvmem-layout {
compatible = "u-boot,env-redundant-bool";
};
};
&ubi_ubootenv2 {
nvmem-layout {
compatible = "u-boot,env-redundant-bool";
};
};
&wifi {
nvmem-cells = <&eeprom_factory_0>;
nvmem-cell-names = "eeprom";
band@0 {
reg = <0>;
nvmem-cells = <&macaddr_factory_8000 0>;
nvmem-cell-names = "mac-address";
};
band@1 {
reg = <1>;
nvmem-cells = <&macaddr_factory_8000 (-1)>;
nvmem-cell-names = "mac-address";
};
};

View File

@ -1,286 +1,44 @@
// SPDX-License-Identifier: (GL-2.0 OR MIT)
/dts-v1/;
#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>
#include "mt7986b.dtsi"
#include "mt7986b-mercusys-mr90x-v1-common.dtsi"
/ {
compatible = "mercusys,mr90x-v1", "mediatek,mt7986b";
model = "MERCUSYS MR90X v1";
aliases {
serial0 = &uart0;
led-boot = &led_status_green;
led-failsafe = &led_status_green;
led-running = &led_status_green;
led-upgrade = &led_status_green;
};
chosen {
stdout-path = "serial0:115200n8";
};
memory {
reg = <0 0x40000000 0 0x20000000>;
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&pio 10 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
leds {
compatible = "gpio-leds";
led-0 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <2>;
gpios = <&pio 7 GPIO_ACTIVE_LOW>;
};
led-1 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <1>;
gpios = <&pio 9 GPIO_ACTIVE_LOW>;
};
led-2 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <0>;
gpios = <&pio 12 GPIO_ACTIVE_LOW>;
};
led-3 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_WAN;
gpios = <&pio 13 GPIO_ACTIVE_LOW>;
};
led-4 {
color = <LED_COLOR_ID_AMBER>;
function = LED_FUNCTION_STATUS;
gpios = <&pio 16 GPIO_ACTIVE_HIGH>;
panic-indicator;
};
led_status_green: led-5 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_STATUS;
gpios = <&pio 17 GPIO_ACTIVE_HIGH>;
};
};
};
&crypto {
status = "okay";
};
&eth {
status = "okay";
gmac0: mac@0 {
compatible = "mediatek,eth-mac";
reg = <0>;
phy-mode = "2500base-x";
fixed-link {
speed = <2500>;
full-duplex;
pause;
};
&partitions {
partition@0 {
label = "boot";
reg = <0x0 0x200000>;
read-only;
};
gmac1: mac@1 {
compatible = "mediatek,eth-mac";
reg = <1>;
phy-handle = <&phy6>;
phy-mode = "2500base-x";
partition@200000 {
label = "u-boot-env";
reg = <0x200000 0x100000>;
};
mdio: mdio-bus {
#address-cells = <1>;
#size-cells = <0>;
};
};
&mdio {
#address-cells = <1>;
#size-cells = <0>;
reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>;
reset-delay-us = <1500000>;
reset-post-delay-us = <1000000>;
/* WAN/LAN 2.5Gbps phy
MaxLinear GPY211C0VC (SLNW8) */
phy6: phy@6 {
compatible = "ethernet-phy-ieee802.3-c45";
reg = <6>;
partition@300000 {
label = "ubi0";
reg = <0x300000 0x3200000>;
};
switch: switch@1f {
compatible = "mediatek,mt7531";
reg = <31>;
reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>;
};
};
&switch {
ports {
#address-cells = <1>;
#size-cells = <0>;
/* WAN/LAN 1Gbps port */
port@0 {
reg = <0>;
label = "lan0";
};
/* LAN1 port */
port@1 {
reg = <1>;
label = "lan1";
};
/* LAN2 port */
port@2 {
reg = <2>;
label = "lan2";
};
port@6 {
reg = <6>;
ethernet = <&gmac0>;
phy-mode = "2500base-x";
fixed-link {
speed = <2500>;
full-duplex;
pause;
};
};
};
};
&pio {
spi_flash_pins: spi-flash-pins-33-to-38 {
mux {
function = "spi";
groups = "spi0", "spi0_wp_hold";
};
conf-pu {
pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
drive-strength = <8>;
mediatek,pull-up-adv = <0>; /* bias-disable */
};
conf-pd {
pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
drive-strength = <8>;
mediatek,pull-down-adv = <0>; /* bias-disable */
};
partition@3500000 {
label = "ubi1";
reg = <0x3500000 0x3200000>;
read-only;
};
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>;
};
partition@6700000 {
label = "userconfig";
reg = <0x6700000 0x800000>;
read-only;
};
partition@6f00000 {
label = "tp_data";
reg = <0x6f00000 0x400000>;
read-only;
};
};
&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi_flash_pins>;
status = "okay";
spi_nand_flash: flash@0 {
compatible = "spi-nand";
#address-cells = <1>;
#size-cells = <1>;
reg = <0>;
spi-max-frequency = <20000000>;
spi-tx-bus-width = <4>;
spi-rx-bus-width = <4>;
partitions: partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "boot";
reg = <0x0 0x200000>;
read-only;
};
partition@200000 {
label = "u-boot-env";
reg = <0x200000 0x100000>;
};
partition@300000 {
label = "ubi0";
reg = <0x300000 0x3200000>;
};
partition@3500000 {
label = "ubi1";
reg = <0x3500000 0x3200000>;
read-only;
};
partition@6700000 {
label = "userconfig";
reg = <0x6700000 0x800000>;
read-only;
};
partition@6f00000 {
label = "tp_data";
reg = <0x6f00000 0x400000>;
read-only;
};
};
};
};
&trng {
status = "okay";
};
&uart0 {
status = "okay";
};
&watchdog {
status = "okay";
};
&wifi {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&wf_2g_5g_pins>;
};

View File

@ -61,7 +61,8 @@ livinet,zr-3020-ubootmod)
ucidef_set_led_netdev "wlan2g" "WLAN2G" "blue:wlan2g" "phy0-ap0"
ucidef_set_led_netdev "wlan5g" "WLAN5G" "blue:wlan5g" "phy1-ap0"
;;
mercusys,mr90x-v1)
mercusys,mr90x-v1|\
mercusys,mr90x-v1-ubi)
ucidef_set_led_netdev "lan-0" "lan-0" "green:lan-0" "lan0" "link tx rx"
ucidef_set_led_netdev "lan-1" "lan-1" "green:lan-1" "lan1" "link tx rx"
ucidef_set_led_netdev "lan-2" "lan-2" "green:lan-2" "lan2" "link tx rx"

View File

@ -113,7 +113,8 @@ mediatek_setup_interfaces()
mediatek,mt7988a-rfb)
ucidef_set_interfaces_lan_wan "lan0 lan1 lan2 lan3 eth2" eth1
;;
mercusys,mr90x-v1)
mercusys,mr90x-v1|\
mercusys,mr90x-v1-ubi)
ucidef_set_interfaces_lan_wan "lan0 lan1 lan2" eth1
;;
tplink,tl-xdr6086|\

View File

@ -81,6 +81,7 @@ platform_do_upgrade() {
livinet,zr-3020-ubootmod|\
mediatek,mt7981-rfb|\
mediatek,mt7988a-rfb|\
mercusys,mr90x-v1-ubi|\
nokia,ea0326gmp|\
openwrt,one|\
netcore,n60|\

View File

@ -1276,6 +1276,34 @@ define Device/mercusys_mr90x-v1
endef
TARGET_DEVICES += mercusys_mr90x-v1
define Device/mercusys_mr90x-v1-ubi
DEVICE_VENDOR := MERCUSYS
DEVICE_MODEL := MR90X v1 (UBI)
DEVICE_DTS := mt7986b-mercusys-mr90x-v1-ubi
DEVICE_DTS_DIR := ../dts
DEVICE_DTC_FLAGS := --pad 4096
DEVICE_DTS_LOADADDR := 0x43f00000
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
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-with-rootfs | \
append-metadata
ARTIFACTS := bl31-uboot.fip preloader.bin
ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot mercusys_mr90x-v1
ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-ubi-ddr3
endef
TARGET_DEVICES += mercusys_mr90x-v1-ubi
define Device/netcore_n60
DEVICE_VENDOR := Netcore
DEVICE_MODEL := N60