diff --git a/include/kernel-5.15 b/include/kernel-5.15 index 0423befe74f95f..96feed23e078d4 100644 --- a/include/kernel-5.15 +++ b/include/kernel-5.15 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.15 = .131 -LINUX_KERNEL_HASH-5.15.131 = 997c3391f439fb6fe32f1938fe089a046b840a5cde9a2215b6745144f8b24c69 +LINUX_VERSION-5.15 = .132 +LINUX_KERNEL_HASH-5.15.132 = 4177b5c4d6e749bb8339ac4aa68eb0932ead9490b956a80d9a597089959618ac diff --git a/include/kernel-6.1 b/include/kernel-6.1 index cc106e2572f4a6..c916b86dcc3108 100644 --- a/include/kernel-6.1 +++ b/include/kernel-6.1 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.1 = .52 -LINUX_KERNEL_HASH-6.1.52 = 567737990dbc9265966a0786392821a9fa559fd346494fd1eff050dbeb383a52 +LINUX_VERSION-6.1 = .55 +LINUX_KERNEL_HASH-6.1.55 = a87e241ec15d53452c4efe219713a3769d88cc436b5b98cf6efb262c4aff15c0 diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk index 3063a86a28c195..afa2b81eb99800 100644 --- a/include/package-ipkg.mk +++ b/include/package-ipkg.mk @@ -179,7 +179,7 @@ $$(call addfield,Depends,$$(Package/$(1)/DEPENDS) )$$(call addfield,Provides,$$(call mergelist,$$(filter-out $(1)$$(ABIV_$(1)),$(PROVIDES)$$(if $$(ABIV_$(1)), $(1) $(foreach provide,$(PROVIDES),$(provide)$$(ABIV_$(1)))))) )$$(call addfield,Alternatives,$$(call mergelist,$(ALTERNATIVES)) )$$(call addfield,Source,$(SOURCE) -)$$(call addfield,SourceName,$(1) +)$$(call addfield,SourceName,$(PKG_NAME) )$$(call addfield,License,$(LICENSE) )$$(call addfield,LicenseFiles,$(LICENSE_FILES) )$$(call addfield,Section,$(SECTION) diff --git a/package/base-files/files/bin/ipcalc.sh b/package/base-files/files/bin/ipcalc.sh index 56854b4104105d..827cb5dc2ead71 100755 --- a/package/base-files/files/bin/ipcalc.sh +++ b/package/base-files/files/bin/ipcalc.sh @@ -50,27 +50,37 @@ BEGIN { network=and(ipaddr,netmask) prefix=32-bitcount(compl32(netmask)) - broadcast=or(network,compl32(netmask)) print "IP="int2ip(ipaddr) print "NETMASK="int2ip(netmask) - print "BROADCAST="int2ip(broadcast) print "NETWORK="int2ip(network) + if (prefix<=30) { + broadcast=or(network,compl32(netmask)) + print "BROADCAST="int2ip(broadcast) + } print "PREFIX="prefix # range calculations: - # ipcalc + # ipcalc if (ARGC <= 3) exit(0) + if (prefix<=30) + limit=network+1 + else + limit=network + start=or(network,and(ip2int(ARGV[3]),compl32(netmask))) - limit=network+1 if (startlimit) end=limit if (end==ipaddr) end=ipaddr-1 @@ -79,9 +89,10 @@ BEGIN { exit(1) } - if (ipaddr > start && ipaddr < end) { - print "ipaddr inside range" > "/dev/stderr" - exit(1) + if (ipaddr >= start && ipaddr <= end) { + print "warning: ipaddr inside range - this might not be supported in future releases of Openwrt" > "/dev/stderr" + # turn this into an error after Openwrt 24 has been released + # exit(1) } print "START="int2ip(start) diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index 4b1b838572a0cd..bbdecbbc47586d 100644 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -315,6 +315,11 @@ include() { done } +ipcalc() { + set -- $(ipcalc.sh "$@") + [ $? -eq 0 ] && export -- "$@" +} + find_mtd_index() { local PART="$(grep "\"$1\"" /proc/mtd | awk -F: '{print $1}')" local INDEX="${PART##mtd}" diff --git a/package/boot/arm-trusted-firmware-mediatek/Makefile b/package/boot/arm-trusted-firmware-mediatek/Makefile index 718ebf99e09498..f77f3059112f2e 100644 --- a/package/boot/arm-trusted-firmware-mediatek/Makefile +++ b/package/boot/arm-trusted-firmware-mediatek/Makefile @@ -118,7 +118,7 @@ define Trusted-Firmware-A/mt7981-sdmmc-ddr3 DDR_TYPE:=ddr3 endef -define Trusted-Firmware-A/mt7986-snand-ddr3 +define Trusted-Firmware-A/mt7981-snand-ddr3 NAME:=MediaTek MT7981 (SPI-NAND via SNFI, DDR3) BOOT_DEVICE:=snand BUILD_SUBTARGET:=filogic @@ -347,7 +347,7 @@ TFA_TARGETS:= \ mt7981-emmc-ddr3 \ mt7981-nor-ddr3 \ mt7981-sdmmc-ddr3 \ - mt7986-snand-ddr3 \ + mt7981-snand-ddr3 \ mt7981-spim-nand-ddr3 \ mt7986-emmc-ddr3 \ mt7986-nor-ddr3 \ diff --git a/package/boot/arm-trusted-firmware-sunxi/Makefile b/package/boot/arm-trusted-firmware-sunxi/Makefile index 0535640f9574bc..f15357d357b2d2 100644 --- a/package/boot/arm-trusted-firmware-sunxi/Makefile +++ b/package/boot/arm-trusted-firmware-sunxi/Makefile @@ -7,10 +7,10 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=2.8 +PKG_VERSION:=2.9 PKG_RELEASE:=1 -PKG_HASH:=df4e0f3803479df0ea4cbf3330b59731bc2efc2112c951f9adb3685229163af9 +PKG_HASH:=76a66a1de0c01aeb83dfc7b72b51173fe62c6e51d6fca17cc562393117bed08b PKG_LICENSE:=BSD-3-Clause PKG_LICENSE_FILES:=license.md @@ -36,9 +36,15 @@ define Trusted-Firmware-A/sunxi-h6 PLAT:=sun50i_h6 endef +define Trusted-Firmware-A/sunxi-h616 + NAME:=Allwinner H616 + PLAT:=sun50i_h616 +endef + TFA_TARGETS:= \ sunxi-a64 \ - sunxi-h6 + sunxi-h6 \ + sunxi-h616 define Package/trusted-firmware-a/install $(INSTALL_DIR) $(STAGING_DIR_IMAGE) diff --git a/package/boot/at91bootstrap/Makefile b/package/boot/at91bootstrap/Makefile index efd42ecf5cc02c..f27a3f01dc2fc3 100644 --- a/package/boot/at91bootstrap/Makefile +++ b/package/boot/at91bootstrap/Makefile @@ -13,6 +13,7 @@ PKG_VERSION:=v4.0.3 PKG_MIRROR_HASH:=1ecdc31a13350fcdcaa3f77ed8ad73906f79fc668dbb2f337e1d5dd877bf9882 PKG_SOURCE_VERSION:=1d9e673698d9db4a4f2301559f481274de2e75ae BINARIES_DIR:=build/binaries +PKG_CPE_ID:=cpe:/a:linux4sam:at91bootstrap AT91BOOTSTRAP_V4=y ifdef CONFIG_PACKAGE_at91bootstrap-sama5d4_xplaineddf_uboot_secure diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic index d7d6bbf05c31dc..803800ce1c751c 100644 --- a/package/boot/uboot-envtools/files/mediatek_filogic +++ b/package/boot/uboot-envtools/files/mediatek_filogic @@ -48,6 +48,9 @@ cetron,ct3003|\ netgear,wax220) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" ;; +ubnt,unifi-6-plus) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x10000" + ;; xiaomi,mi-router-wr30u-112m-nmbm|\ xiaomi,mi-router-wr30u-stock|\ xiaomi,redmi-router-ax6000-stock) diff --git a/package/boot/uboot-envtools/files/qualcommax_ipq807x b/package/boot/uboot-envtools/files/qualcommax_ipq807x index 297c72785794b9..106ba47c08e499 100644 --- a/package/boot/uboot-envtools/files/qualcommax_ipq807x +++ b/package/boot/uboot-envtools/files/qualcommax_ipq807x @@ -10,7 +10,8 @@ board=$(board_name) case "$board" in dynalink,dl-wrx36|\ netgear,rax120v2|\ -netgear,wax218) +netgear,wax218|\ +netgear,wax620) idx="$(find_mtd_index 0:appsblenv)" [ -n "$idx" ] && \ ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x20000" "2" diff --git a/package/boot/uboot-mediatek/Makefile b/package/boot/uboot-mediatek/Makefile index 66de3921852851..62199871e6b330 100644 --- a/package/boot/uboot-mediatek/Makefile +++ b/package/boot/uboot-mediatek/Makefile @@ -212,6 +212,66 @@ define U-Boot/mt7981_h3c_magic-nx30-pro DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3 endef +define U-Boot/mt7981_rfb-spim-nand + NAME:=MT7981 Reference Board + BUILD_SUBTARGET:=filogic + BUILD_DEVICES:=mediatek_mt7981-rfb + UBOOT_CONFIG:=mt7981_rfb + 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-emmc + NAME:=MT7981 Reference Board + BUILD_SUBTARGET:=filogic + BUILD_DEVICES:=mediatek_mt7981-rfb + UBOOT_CONFIG:=mt7981_emmc_rfb + UBOOT_IMAGE:=u-boot.fip + BL2_BOOTDEV:=emmc + BL2_SOC:=mt7981 + BL2_DDRTYPE:=ddr3 + DEPENDS:=+trusted-firmware-a-mt7981-emmc-ddr3 +endef + +define U-Boot/mt7981_rfb-nor + NAME:=MT7981 Reference Board + BUILD_SUBTARGET:=filogic + BUILD_DEVICES:=mediatek_mt7981-rfb + UBOOT_CONFIG:=mt7981_nor_rfb + UBOOT_IMAGE:=u-boot.fip + BL2_BOOTDEV:=spim-nand + BL2_SOC:=mt7981 + BL2_DDRTYPE:=ddr3 + DEPENDS:=+trusted-firmware-a-mt7981-nor-ddr3 +endef + +define U-Boot/mt7981_rfb-sd + NAME:=MT7981 Reference Board + BUILD_SUBTARGET:=filogic + BUILD_DEVICES:=mediatek_mt7981-rfb + UBOOT_CONFIG:=mt7981_sd_rfb + UBOOT_IMAGE:=u-boot.fip + BL2_BOOTDEV:=sdmmc + BL2_SOC:=mt7981 + BL2_DDRTYPE:=ddr3 + DEPENDS:=+trusted-firmware-a-mt7981-sdmmc-ddr3 +endef + +define U-Boot/mt7981_rfb-snfi + NAME:=MT7981 Reference Board + BUILD_SUBTARGET:=filogic + BUILD_DEVICES:=mediatek_mt7981-rfb + UBOOT_CONFIG:=mt7981_snfi_nand_rfb + UBOOT_IMAGE:=u-boot.fip + BL2_BOOTDEV:=snand + BL2_SOC:=mt7981 + BL2_DDRTYPE:=ddr3 + DEPENDS:=+trusted-firmware-a-mt7981-snand-ddr3 +endef + define U-Boot/mt7981_qihoo_360t7 NAME:=Qihoo 360T7 BUILD_SUBTARGET:=filogic @@ -425,6 +485,11 @@ UBOOT_TARGETS := \ ravpower_rp-wd009 \ mt7629_rfb \ mt7981_h3c_magic-nx30-pro \ + mt7981_rfb-spim-nand \ + mt7981_rfb-emmc \ + mt7981_rfb-nor \ + mt7981_rfb-sd \ + mt7981_rfb-snfi \ mt7981_qihoo_360t7 \ mt7981_xiaomi_mi-router-wr30u \ mt7986_bananapi_bpi-r3-emmc \ diff --git a/package/boot/uboot-mediatek/patches/106-configs-sync-mt7981-rfb-storage.patch b/package/boot/uboot-mediatek/patches/106-configs-sync-mt7981-rfb-storage.patch new file mode 100644 index 00000000000000..3a3f8d0e1ede4a --- /dev/null +++ b/package/boot/uboot-mediatek/patches/106-configs-sync-mt7981-rfb-storage.patch @@ -0,0 +1,129 @@ +--- a/configs/mt7981_rfb_defconfig ++++ b/configs/mt7981_rfb_defconfig +@@ -30,6 +30,9 @@ CONFIG_CMD_MTD=y + CONFIG_CMD_SF_TEST=y + CONFIG_CMD_PING=y + CONFIG_CMD_SMC=y ++CONFIG_CMD_UBI=y ++CONFIG_CMD_UBI_RENAME=y ++CONFIG_ENV_OVERWRITE=y + CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y + CONFIG_NET_RANDOM_ETHADDR=y + CONFIG_REGMAP=y +--- a/configs/mt7981_snfi_nand_rfb_defconfig ++++ b/configs/mt7981_snfi_nand_rfb_defconfig +@@ -1,11 +1,12 @@ + 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=0x20000 + CONFIG_DEFAULT_DEVICE_TREE="mt7981-snfi-nand-rfb" ++CONFIG_SYS_PROMPT="MT7981> " + CONFIG_TARGET_MT7981=y + CONFIG_DEBUG_UART_BASE=0x11002000 + CONFIG_DEBUG_UART_CLOCK=40000000 +@@ -15,7 +16,6 @@ CONFIG_DEBUG_UART=y + CONFIG_DEFAULT_FDT_FILE="mt7981-snfi-nand-rfb" + CONFIG_LOGLEVEL=7 + CONFIG_LOG=y +-CONFIG_SYS_PROMPT="MT7981> " + CONFIG_SYS_CBSIZE=512 + CONFIG_SYS_PBSIZE=1049 + # CONFIG_BOOTM_NETBSD is not set +@@ -29,8 +29,6 @@ CONFIG_CMD_GPIO=y + CONFIG_CMD_MTD=y + CONFIG_CMD_PING=y + CONFIG_CMD_SMC=y +-CONFIG_MTDIDS_DEFAULT="spi-nand0=spi-nand0" +-CONFIG_MTDPARTS_DEFAULT="spi-nand0:1024k(bl2),512k(u-boot-env),2048k(factory),2048k(fip),65536k(ubi)" + CONFIG_CMD_UBI=y + CONFIG_CMD_UBI_RENAME=y + CONFIG_ENV_OVERWRITE=y +@@ -45,7 +43,6 @@ CONFIG_DM_MTD=y + CONFIG_MTK_SPI_NAND=y + CONFIG_MTK_SPI_NAND_MTD=y + CONFIG_PHY_FIXED=y +-CONFIG_DM_ETH=y + CONFIG_MEDIATEK_ETH=y + CONFIG_PINCTRL=y + CONFIG_PINCONF=y +@@ -55,3 +52,4 @@ CONFIG_MTK_POWER_DOMAIN=y + CONFIG_DM_SERIAL=y + CONFIG_MTK_SERIAL=y + CONFIG_HEXDUMP=y ++CONFIG_LMB_MAX_REGIONS=64 +--- /dev/null ++++ b/configs/mt7981_nor_rfb_defconfig +@@ -0,0 +1,68 @@ ++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="mt7981-rfb" ++CONFIG_SYS_PROMPT="MT7981> " ++CONFIG_TARGET_MT7981=y ++CONFIG_DEBUG_UART_BASE=0x11002000 ++CONFIG_DEBUG_UART_CLOCK=40000000 ++CONFIG_SYS_LOAD_ADDR=0x46000000 ++CONFIG_DEBUG_UART=y ++# CONFIG_AUTOBOOT is not set ++CONFIG_DEFAULT_FDT_FILE="mt7981-rfb" ++CONFIG_LOGLEVEL=7 ++CONFIG_LOG=y ++CONFIG_SYS_CBSIZE=512 ++CONFIG_SYS_PBSIZE=1049 ++# CONFIG_BOOTM_NETBSD is not set ++# CONFIG_BOOTM_PLAN9 is not set ++# CONFIG_BOOTM_RTEMS is not set ++# CONFIG_BOOTM_VXWORKS is not set ++# CONFIG_CMD_ELF is not set ++# CONFIG_CMD_UNLZ4 is not set ++# CONFIG_CMD_UNZIP is not set ++CONFIG_CMD_GPIO=y ++CONFIG_CMD_MTD=y ++CONFIG_CMD_SF_TEST=y ++CONFIG_CMD_PING=y ++CONFIG_CMD_SMC=y ++CONFIG_ENV_OVERWRITE=y ++CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y ++CONFIG_NET_RANDOM_ETHADDR=y ++CONFIG_REGMAP=y ++CONFIG_SYSCON=y ++CONFIG_CLK=y ++# CONFIG_MMC is not set ++CONFIG_MTD=y ++CONFIG_DM_MTD=y ++CONFIG_MTD_SPI_NAND=y ++CONFIG_DM_SPI_FLASH=y ++CONFIG_SPI_FLASH_SFDP_SUPPORT=y ++CONFIG_SPI_FLASH_EON=y ++CONFIG_SPI_FLASH_GIGADEVICE=y ++CONFIG_SPI_FLASH_ISSI=y ++CONFIG_SPI_FLASH_MACRONIX=y ++CONFIG_SPI_FLASH_SPANSION=y ++CONFIG_SPI_FLASH_STMICRO=y ++CONFIG_SPI_FLASH_WINBOND=y ++CONFIG_SPI_FLASH_XMC=y ++CONFIG_SPI_FLASH_XTX=y ++CONFIG_SPI_FLASH_MTD=y ++CONFIG_PHY_FIXED=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_SERIAL=y ++CONFIG_MTK_SERIAL=y ++CONFIG_SPI=y ++CONFIG_DM_SPI=y ++CONFIG_MTK_SPIM=y ++CONFIG_HEXDUMP=y ++CONFIG_LMB_MAX_REGIONS=64 diff --git a/package/boot/uboot-mediatek/patches/107-configs-add-useful-options-to-mt7981-rfb.patch b/package/boot/uboot-mediatek/patches/107-configs-add-useful-options-to-mt7981-rfb.patch new file mode 100644 index 00000000000000..f5234ea0859d23 --- /dev/null +++ b/package/boot/uboot-mediatek/patches/107-configs-add-useful-options-to-mt7981-rfb.patch @@ -0,0 +1,474 @@ +--- a/configs/mt7981_emmc_rfb_defconfig ++++ b/configs/mt7981_emmc_rfb_defconfig +@@ -14,7 +14,22 @@ CONFIG_DEBUG_UART_BASE=0x11002000 + CONFIG_DEBUG_UART_CLOCK=40000000 + CONFIG_SYS_LOAD_ADDR=0x46000000 + CONFIG_DEBUG_UART=y +-# CONFIG_AUTOBOOT is not set ++CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_SMBIOS_PRODUCT_NAME="" ++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_MMC_BOOT=y ++CONFIG_BOOTSTD_DEFAULTS=y ++CONFIG_BOOTSTD_FULL=y + CONFIG_DEFAULT_FDT_FILE="mt7981-emmc-rfb" + CONFIG_LOGLEVEL=7 + CONFIG_LOG=y +@@ -24,9 +39,23 @@ CONFIG_SYS_PBSIZE=1049 + # CONFIG_BOOTM_PLAN9 is not set + # CONFIG_BOOTM_RTEMS is not set + # CONFIG_BOOTM_VXWORKS is not set +-# CONFIG_CMD_ELF is not set + # CONFIG_CMD_UNLZ4 is not set + # CONFIG_CMD_UNZIP is not set ++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_ELF=y ++CONFIG_CMD_DNS=y ++CONFIG_CMD_ECHO=y ++CONFIG_CMD_ENV_READMEM=y ++CONFIG_CMD_ERASEENV=y ++CONFIG_CMD_FDT=y ++CONFIG_CMD_FS_UUID=y + CONFIG_CMD_GPIO=y + CONFIG_CMD_GPT=y + CONFIG_CMD_GPT_RENAME=y +@@ -36,13 +65,35 @@ CONFIG_CMD_PART=y + CONFIG_CMD_READ=y + CONFIG_CMD_PING=y + CONFIG_CMD_SMC=y ++CONFIG_CMD_TFTPBOOT=y ++CONFIG_CMD_TFTPSRV=y ++CONFIG_CMD_ASKENV=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_CMD_FAT=y + CONFIG_CMD_FS_GENERIC=y ++CONFIG_CMD_HASH=y ++CONFIG_CMD_ITEST=y ++CONFIG_CMD_LED=y ++CONFIG_CMD_LICENSE=y ++CONFIG_CMD_LINK_LOCAL=y ++CONFIG_CMD_PSTORE=y ++CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000 ++CONFIG_CMD_SF=y ++CONFIG_CMD_SF_TEST=y ++CONFIG_CMD_PING=y ++CONFIG_CMD_PXE=y + CONFIG_PARTITION_TYPE_GUID=y + CONFIG_ENV_OVERWRITE=y + CONFIG_ENV_IS_IN_MMC=y + CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y + CONFIG_NET_RANDOM_ETHADDR=y ++CONFIG_REGEX=y + CONFIG_REGMAP=y + CONFIG_SYSCON=y + CONFIG_CLK=y +--- a/configs/mt7981_rfb_defconfig ++++ b/configs/mt7981_rfb_defconfig +@@ -12,7 +12,23 @@ CONFIG_DEBUG_UART_BASE=0x11002000 + CONFIG_DEBUG_UART_CLOCK=40000000 + CONFIG_SYS_LOAD_ADDR=0x46000000 + CONFIG_DEBUG_UART=y +-# CONFIG_AUTOBOOT is not set ++CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_SMBIOS_PRODUCT_NAME="" ++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_SPI_BOOT=y ++CONFIG_NAND_BOOT=y ++CONFIG_BOOTSTD_DEFAULTS=y ++CONFIG_BOOTSTD_FULL=y + CONFIG_DEFAULT_FDT_FILE="mt7981-rfb" + CONFIG_LOGLEVEL=7 + CONFIG_LOG=y +@@ -22,23 +38,74 @@ CONFIG_SYS_PBSIZE=1049 + # CONFIG_BOOTM_PLAN9 is not set + # CONFIG_BOOTM_RTEMS is not set + # CONFIG_BOOTM_VXWORKS is not set +-# CONFIG_CMD_ELF is not set + # CONFIG_CMD_UNLZ4 is not set + # CONFIG_CMD_UNZIP is not set ++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_ELF=y ++CONFIG_CMD_DNS=y ++CONFIG_CMD_ECHO=y ++CONFIG_CMD_ENV_READMEM=y ++CONFIG_CMD_ERASEENV=y ++CONFIG_CMD_FDT=y ++CONFIG_CMD_FS_GENERIC=y ++CONFIG_CMD_FS_UUID=y + CONFIG_CMD_GPIO=y + CONFIG_CMD_MTD=y +-CONFIG_CMD_SF_TEST=y ++CONFIG_CMD_HASH=y ++CONFIG_CMD_ITEST=y ++CONFIG_CMD_LED=y ++CONFIG_CMD_LICENSE=y ++CONFIG_CMD_LINK_LOCAL=y ++CONFIG_CMD_MTD=y ++CONFIG_CMD_NAND=y ++# CONFIG_MTD_RAW_NAND is not set ++CONFIG_CMD_NAND_TRIMFFS=y ++CONFIG_CMD_PCI=y ++CONFIG_CMD_PSTORE=y ++CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000 + CONFIG_CMD_PING=y ++CONFIG_CMD_PXE=y ++CONFIG_CMD_SF=y ++CONFIG_CMD_SF_TEST=y + CONFIG_CMD_SMC=y + CONFIG_CMD_UBI=y + CONFIG_CMD_UBI_RENAME=y ++CONFIG_CMD_UBIFS=y ++CONFIG_CMD_TFTPBOOT=y ++CONFIG_CMD_TFTPSRV=y ++CONFIG_CMD_ASKENV=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_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_ENV_OVERWRITE=y + CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y + CONFIG_NET_RANDOM_ETHADDR=y ++CONFIG_REGEX=y + CONFIG_REGMAP=y + CONFIG_SYSCON=y + CONFIG_CLK=y + # CONFIG_MMC is not set ++CONFIG_HUSH_PARSER=y ++CONFIG_SYS_REDUNDAND_ENVIRONMENT=y ++CONFIG_SYS_RELOC_GD_ENV_ADDR=y + CONFIG_MTD=y + CONFIG_DM_MTD=y + CONFIG_MTD_SPI_NAND=y +--- a/configs/mt7981_sd_rfb_defconfig ++++ b/configs/mt7981_sd_rfb_defconfig +@@ -14,7 +14,22 @@ CONFIG_DEBUG_UART_BASE=0x11002000 + CONFIG_DEBUG_UART_CLOCK=40000000 + CONFIG_SYS_LOAD_ADDR=0x46000000 + CONFIG_DEBUG_UART=y +-# CONFIG_AUTOBOOT is not set ++CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_SMBIOS_PRODUCT_NAME="" ++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_MMC_BOOT=y ++CONFIG_BOOTSTD_DEFAULTS=y ++CONFIG_BOOTSTD_FULL=y + CONFIG_DEFAULT_FDT_FILE="mt7981-sd-rfb" + CONFIG_LOGLEVEL=7 + CONFIG_LOG=y +@@ -24,9 +39,23 @@ CONFIG_SYS_PBSIZE=1049 + # CONFIG_BOOTM_PLAN9 is not set + # CONFIG_BOOTM_RTEMS is not set + # CONFIG_BOOTM_VXWORKS is not set +-# CONFIG_CMD_ELF is not set + # CONFIG_CMD_UNLZ4 is not set + # CONFIG_CMD_UNZIP is not set ++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_ELF=y ++CONFIG_CMD_DNS=y ++CONFIG_CMD_ECHO=y ++CONFIG_CMD_ENV_READMEM=y ++CONFIG_CMD_ERASEENV=y ++CONFIG_CMD_FDT=y ++CONFIG_CMD_FS_UUID=y + CONFIG_CMD_GPIO=y + CONFIG_CMD_GPT=y + CONFIG_CMD_GPT_RENAME=y +@@ -36,13 +65,35 @@ CONFIG_CMD_PART=y + CONFIG_CMD_READ=y + CONFIG_CMD_PING=y + CONFIG_CMD_SMC=y ++CONFIG_CMD_TFTPBOOT=y ++CONFIG_CMD_TFTPSRV=y ++CONFIG_CMD_ASKENV=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_CMD_FAT=y + CONFIG_CMD_FS_GENERIC=y ++CONFIG_CMD_HASH=y ++CONFIG_CMD_ITEST=y ++CONFIG_CMD_LED=y ++CONFIG_CMD_LICENSE=y ++CONFIG_CMD_LINK_LOCAL=y ++CONFIG_CMD_PSTORE=y ++CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000 ++CONFIG_CMD_SF=y ++CONFIG_CMD_SF_TEST=y ++CONFIG_CMD_PING=y ++CONFIG_CMD_PXE=y + CONFIG_PARTITION_TYPE_GUID=y + CONFIG_ENV_OVERWRITE=y + CONFIG_ENV_IS_IN_MMC=y + CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y + CONFIG_NET_RANDOM_ETHADDR=y ++CONFIG_REGEX=y + CONFIG_REGMAP=y + CONFIG_SYSCON=y + CONFIG_CLK=y +--- a/configs/mt7981_snfi_nand_rfb_defconfig ++++ b/configs/mt7981_snfi_nand_rfb_defconfig +@@ -12,7 +12,23 @@ CONFIG_DEBUG_UART_BASE=0x11002000 + CONFIG_DEBUG_UART_CLOCK=40000000 + CONFIG_SYS_LOAD_ADDR=0x46000000 + CONFIG_DEBUG_UART=y +-# CONFIG_AUTOBOOT is not set ++CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_SMBIOS_PRODUCT_NAME="" ++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_SPI_BOOT=y ++CONFIG_NAND_BOOT=y ++CONFIG_BOOTSTD_DEFAULTS=y ++CONFIG_BOOTSTD_FULL=y + CONFIG_DEFAULT_FDT_FILE="mt7981-snfi-nand-rfb" + CONFIG_LOGLEVEL=7 + CONFIG_LOG=y +@@ -22,22 +38,73 @@ CONFIG_SYS_PBSIZE=1049 + # CONFIG_BOOTM_PLAN9 is not set + # CONFIG_BOOTM_RTEMS is not set + # CONFIG_BOOTM_VXWORKS is not set +-# CONFIG_CMD_ELF is not set + # CONFIG_CMD_UNLZ4 is not set + # CONFIG_CMD_UNZIP is not set ++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_ELF=y ++CONFIG_CMD_DNS=y ++CONFIG_CMD_ECHO=y ++CONFIG_CMD_ENV_READMEM=y ++CONFIG_CMD_ERASEENV=y ++CONFIG_CMD_FDT=y ++CONFIG_CMD_FS_GENERIC=y ++CONFIG_CMD_FS_UUID=y + CONFIG_CMD_GPIO=y + CONFIG_CMD_MTD=y ++CONFIG_CMD_HASH=y ++CONFIG_CMD_ITEST=y ++CONFIG_CMD_LED=y ++CONFIG_CMD_LICENSE=y ++CONFIG_CMD_LINK_LOCAL=y ++CONFIG_CMD_MTD=y ++CONFIG_CMD_NAND=y ++# CONFIG_MTD_RAW_NAND is not set ++CONFIG_CMD_NAND_TRIMFFS=y ++CONFIG_CMD_PCI=y ++CONFIG_CMD_PSTORE=y ++CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000 ++CONFIG_CMD_SF=y ++CONFIG_CMD_SF_TEST=y + CONFIG_CMD_PING=y ++CONFIG_CMD_PXE=y + CONFIG_CMD_SMC=y + CONFIG_CMD_UBI=y + CONFIG_CMD_UBI_RENAME=y ++CONFIG_CMD_UBIFS=y ++CONFIG_CMD_TFTPBOOT=y ++CONFIG_CMD_TFTPSRV=y ++CONFIG_CMD_ASKENV=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_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_REGEX=y + CONFIG_REGMAP=y + CONFIG_SYSCON=y + CONFIG_CLK=y + # CONFIG_MMC is not set ++CONFIG_HUSH_PARSER=y ++CONFIG_SYS_REDUNDAND_ENVIRONMENT=y ++CONFIG_SYS_RELOC_GD_ENV_ADDR=y + CONFIG_MTD=y + CONFIG_DM_MTD=y + CONFIG_MTK_SPI_NAND=y +--- a/configs/mt7981_nor_rfb_defconfig ++++ b/configs/mt7981_nor_rfb_defconfig +@@ -12,7 +12,22 @@ CONFIG_DEBUG_UART_BASE=0x11002000 + CONFIG_DEBUG_UART_CLOCK=40000000 + CONFIG_SYS_LOAD_ADDR=0x46000000 + CONFIG_DEBUG_UART=y +-# CONFIG_AUTOBOOT is not set ++CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_SMBIOS_PRODUCT_NAME="" ++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_SPI_BOOT=y ++CONFIG_BOOTSTD_DEFAULTS=y ++CONFIG_BOOTSTD_FULL=y + CONFIG_DEFAULT_FDT_FILE="mt7981-rfb" + CONFIG_LOGLEVEL=7 + CONFIG_LOG=y +@@ -22,21 +37,66 @@ CONFIG_SYS_PBSIZE=1049 + # CONFIG_BOOTM_PLAN9 is not set + # CONFIG_BOOTM_RTEMS is not set + # CONFIG_BOOTM_VXWORKS is not set +-# CONFIG_CMD_ELF is not set + # CONFIG_CMD_UNLZ4 is not set + # CONFIG_CMD_UNZIP is not set ++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_ELF=y ++CONFIG_CMD_DNS=y ++CONFIG_CMD_ECHO=y ++CONFIG_CMD_ENV_READMEM=y ++CONFIG_CMD_ERASEENV=y ++CONFIG_CMD_FDT=y ++CONFIG_CMD_FS_GENERIC=y ++CONFIG_CMD_FS_UUID=y + CONFIG_CMD_GPIO=y + CONFIG_CMD_MTD=y ++CONFIG_CMD_HASH=y ++CONFIG_CMD_ITEST=y ++CONFIG_CMD_LED=y ++CONFIG_CMD_LICENSE=y ++CONFIG_CMD_LINK_LOCAL=y ++CONFIG_CMD_MTD=y ++CONFIG_CMD_PCI=y ++CONFIG_CMD_PSTORE=y ++CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000 ++CONFIG_CMD_SF=y + CONFIG_CMD_SF_TEST=y + CONFIG_CMD_PING=y ++CONFIG_CMD_PXE=y + CONFIG_CMD_SMC=y ++CONFIG_CMD_TFTPBOOT=y ++CONFIG_CMD_TFTPSRV=y ++CONFIG_CMD_ASKENV=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_ENV_IS_IN_MTD=y ++CONFIG_ENV_MTD_NAME="u-boot-env" ++CONFIG_ENV_SIZE_REDUND=0x4000 ++CONFIG_ENV_SIZE=0x4000 ++CONFIG_ENV_OFFSET=0x0 + CONFIG_ENV_OVERWRITE=y + CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y + CONFIG_NET_RANDOM_ETHADDR=y ++CONFIG_REGEX=y + CONFIG_REGMAP=y + CONFIG_SYSCON=y + CONFIG_CLK=y + # CONFIG_MMC is not set ++CONFIG_HUSH_PARSER=y ++CONFIG_SYS_REDUNDAND_ENVIRONMENT=y ++CONFIG_SYS_RELOC_GD_ENV_ADDR=y + CONFIG_MTD=y + CONFIG_DM_MTD=y + CONFIG_MTD_SPI_NAND=y diff --git a/package/boot/uboot-mediatek/patches/108-dts-arm64-mt7981-rfb-add-mtd-partitions.patch b/package/boot/uboot-mediatek/patches/108-dts-arm64-mt7981-rfb-add-mtd-partitions.patch new file mode 100644 index 00000000000000..a58c81b6568773 --- /dev/null +++ b/package/boot/uboot-mediatek/patches/108-dts-arm64-mt7981-rfb-add-mtd-partitions.patch @@ -0,0 +1,140 @@ +--- a/arch/arm/dts/mt7981-rfb.dts ++++ b/arch/arm/dts/mt7981-rfb.dts +@@ -143,6 +143,37 @@ + compatible = "spi-nand"; + reg = <0>; + spi-max-frequency = <52000000>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "BL2"; ++ reg = <0x00000 0x0100000>; ++ }; ++ ++ partition@100000 { ++ label = "u-boot-env"; ++ reg = <0x0100000 0x0080000>; ++ }; ++ ++ factory: partition@180000 { ++ label = "Factory"; ++ reg = <0x180000 0x0200000>; ++ }; ++ ++ partition@380000 { ++ label = "FIP"; ++ reg = <0x380000 0x0200000>; ++ }; ++ ++ partition@580000 { ++ label = "ubi"; ++ reg = <0x580000 0x4000000>; ++ }; ++ }; + }; + }; + +@@ -164,6 +195,37 @@ + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <52000000>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@00000 { ++ label = "BL2"; ++ reg = <0x00000 0x0040000>; ++ }; ++ ++ partition@40000 { ++ label = "u-boot-env"; ++ reg = <0x40000 0x0010000>; ++ }; ++ ++ partition@50000 { ++ label = "Factory"; ++ reg = <0x50000 0x00B0000>; ++ }; ++ ++ partition@100000 { ++ label = "FIP"; ++ reg = <0x100000 0x0080000>; ++ }; ++ ++ partition@180000 { ++ label = "firmware"; ++ reg = <0x180000 0xE00000>; ++ }; ++ }; + }; + }; + +--- a/arch/arm/dts/mt7981-snfi-nand-rfb.dts ++++ b/arch/arm/dts/mt7981-snfi-nand-rfb.dts +@@ -107,11 +107,11 @@ + }; + + mmc0_pins_default: mmc0default { +- mux { +- function = "flash"; +- groups = "emmc_45"; +- }; +- }; ++ mux { ++ function = "flash"; ++ groups = "emmc_45"; ++ }; ++ }; + }; + + &snand { +@@ -119,6 +119,42 @@ + pinctrl-0 = <&snfi_pins>; + status = "okay"; + quad-spi; ++ ++ spi_nand@0 { ++ compatible = "spi-nand"; ++ reg = <0>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "BL2"; ++ reg = <0x00000 0x0100000>; ++ }; ++ ++ partition@100000 { ++ label = "u-boot-env"; ++ reg = <0x0100000 0x0080000>; ++ }; ++ ++ factory: partition@180000 { ++ label = "Factory"; ++ reg = <0x180000 0x0200000>; ++ }; ++ ++ partition@380000 { ++ label = "FIP"; ++ reg = <0x380000 0x0200000>; ++ }; ++ ++ partition@580000 { ++ label = "ubi"; ++ reg = <0x580000 0x4000000>; ++ }; ++ }; ++ }; + }; + + &pwm { diff --git a/package/boot/uboot-mvebu/patches/0001-arm-mvebu-Espressobin-move-FDT-fixup-into-a-separate.patch b/package/boot/uboot-mvebu/patches/0001-arm-mvebu-Espressobin-move-FDT-fixup-into-a-separate.patch new file mode 100644 index 00000000000000..59bdc38adda553 --- /dev/null +++ b/package/boot/uboot-mvebu/patches/0001-arm-mvebu-Espressobin-move-FDT-fixup-into-a-separate.patch @@ -0,0 +1,54 @@ +From 8621f6d22a9589651c6f25742294dd19a26db430 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Thu, 3 Aug 2023 13:34:13 +0200 +Subject: [PATCH 1/3] arm: mvebu: Espressobin: move FDT fixup into a separate + function + +Currently, Esspresobin FDT is being fixed up directly in ft_board_setup() +which makes it hard to add support for any other board to be fixed up. + +So, lets just move the FDT fixup code to a separate function and call it +if compatible matches, there should be no functional change. + +Signed-off-by: Robert Marko +--- + board/Marvell/mvebu_armada-37xx/board.c | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +--- a/board/Marvell/mvebu_armada-37xx/board.c ++++ b/board/Marvell/mvebu_armada-37xx/board.c +@@ -359,18 +359,14 @@ int last_stage_init(void) + #endif + + #ifdef CONFIG_OF_BOARD_SETUP +-int ft_board_setup(void *blob, struct bd_info *bd) ++static int espressobin_fdt_setup(void *blob) + { +-#ifdef CONFIG_ENV_IS_IN_SPI_FLASH + int ret; + int spi_off; + int parts_off; + int part_off; + + /* Fill SPI MTD partitions for Linux kernel on Espressobin */ +- if (!of_machine_is_compatible("globalscale,espressobin")) +- return 0; +- + spi_off = fdt_node_offset_by_compatible(blob, -1, "jedec,spi-nor"); + if (spi_off < 0) + return 0; +@@ -455,6 +451,14 @@ int ft_board_setup(void *blob, struct bd + return 0; + } + ++ return 0; ++} ++ ++int ft_board_setup(void *blob, struct bd_info *bd) ++{ ++#ifdef CONFIG_ENV_IS_IN_SPI_FLASH ++ if (of_machine_is_compatible("globalscale,espressobin")) ++ return espressobin_fdt_setup(blob); + #endif + return 0; + } diff --git a/package/boot/uboot-mvebu/patches/0002-arm-mvebu-Espressobin-move-network-setup-into-a-sepa.patch b/package/boot/uboot-mvebu/patches/0002-arm-mvebu-Espressobin-move-network-setup-into-a-sepa.patch new file mode 100644 index 00000000000000..175deb397f50d4 --- /dev/null +++ b/package/boot/uboot-mvebu/patches/0002-arm-mvebu-Espressobin-move-network-setup-into-a-sepa.patch @@ -0,0 +1,53 @@ +From 3f8c18894a50fd45b81a807f217893f289500bc6 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Thu, 3 Aug 2023 14:24:31 +0200 +Subject: [PATCH 2/3] arm: mvebu: Espressobin: move network setup into a + separate function + +Currently, Esspresobin switch is being setup directly in last_stage_init() +which makes it hard to add support for any other board to be setup. + +So, lets just move the switch setup code to a separate function and call it +if compatible matches, there should be no functional change. + +Signed-off-by: Robert Marko +--- + board/Marvell/mvebu_armada-37xx/board.c | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +--- a/board/Marvell/mvebu_armada-37xx/board.c ++++ b/board/Marvell/mvebu_armada-37xx/board.c +@@ -300,15 +300,11 @@ static int mii_multi_chip_mode_write(str + return 0; + } + +-/* Bring-up board-specific network stuff */ +-int last_stage_init(void) ++static int espressobin_last_stage_init(void) + { + struct udevice *bus; + ofnode node; + +- if (!of_machine_is_compatible("globalscale,espressobin")) +- return 0; +- + node = ofnode_by_compatible(ofnode_null(), "marvell,orion-mdio"); + if (!ofnode_valid(node) || + uclass_get_device_by_ofnode(UCLASS_MDIO, node, &bus) || +@@ -356,6 +352,16 @@ int last_stage_init(void) + + return 0; + } ++ ++/* Bring-up board-specific network stuff */ ++int last_stage_init(void) ++{ ++ ++ if (of_machine_is_compatible("globalscale,espressobin")) ++ return espressobin_last_stage_init(); ++ ++ return 0; ++} + #endif + + #ifdef CONFIG_OF_BOARD_SETUP diff --git a/package/boot/uboot-mvebu/patches/0003-arm-mvebu-eDPU-support-new-board-revision.patch b/package/boot/uboot-mvebu/patches/0003-arm-mvebu-eDPU-support-new-board-revision.patch new file mode 100644 index 00000000000000..c27549e4d4dba7 --- /dev/null +++ b/package/boot/uboot-mvebu/patches/0003-arm-mvebu-eDPU-support-new-board-revision.patch @@ -0,0 +1,297 @@ +From 83c00ee665b8dde813458b2b07cf97ce8409248d Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Fri, 4 Aug 2023 22:39:06 +0200 +Subject: [PATCH 3/3] arm: mvebu: eDPU: support new board revision + +There is a new eDPU revision that uses Marvell 88E6361 switch onboard. +We can rely on detecting the switch to enable and fixup the Linux DTS +so a single DTS can be used. + +There is currently no support for the 88E6361 switch and thus no working +networking in U-Boot, so we disable both ports. + +Signed-off-by: Robert Marko +--- + arch/arm/dts/armada-3720-eDPU-u-boot.dtsi | 13 ++- + arch/arm/dts/armada-3720-eDPU.dts | 47 ++++++++ + board/Marvell/mvebu_armada-37xx/board.c | 125 ++++++++++++++++++++++ + configs/eDPU_defconfig | 2 + + 4 files changed, 182 insertions(+), 5 deletions(-) + +--- a/arch/arm/dts/armada-3720-eDPU-u-boot.dtsi ++++ b/arch/arm/dts/armada-3720-eDPU-u-boot.dtsi +@@ -32,14 +32,17 @@ + bootph-all; + }; + +-ð0 { +- /* G.hn does not work without additional configuration */ +- status = "disabled"; +-}; +- + ð1 { + fixed-link { + speed = <1000>; + full-duplex; + }; + }; ++ ++/* ++ * eDPU v2 has a MV88E6361 switch on the MDIO bus and U-boot is used ++ * to patch the Linux DTS if its found so enable MDIO by default. ++ */ ++&mdio { ++ status = "okay"; ++}; +--- a/arch/arm/dts/armada-3720-eDPU.dts ++++ b/arch/arm/dts/armada-3720-eDPU.dts +@@ -12,3 +12,50 @@ + ð0 { + phy-mode = "2500base-x"; + }; ++ ++/* ++ * External MV88E6361 switch is only available on v2 of the board. ++ * U-Boot will enable the MDIO bus and switch nodes. ++ */ ++&mdio { ++ status = "disabled"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&smi_pins>; ++ ++ /* Actual device is MV88E6361 */ ++ switch: switch@0 { ++ compatible = "marvell,mv88e6190"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0>; ++ status = "disabled"; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ label = "cpu"; ++ phy-mode = "2500base-x"; ++ managed = "in-band-status"; ++ ethernet = <ð0>; ++ }; ++ ++ port@9 { ++ reg = <9>; ++ label = "downlink"; ++ phy-mode = "2500base-x"; ++ managed = "in-band-status"; ++ }; ++ ++ port@a { ++ reg = <10>; ++ label = "uplink"; ++ phy-mode = "2500base-x"; ++ managed = "in-band-status"; ++ sfp = <&sfp_eth1>; ++ }; ++ }; ++ }; ++}; +--- a/board/Marvell/mvebu_armada-37xx/board.c ++++ b/board/Marvell/mvebu_armada-37xx/board.c +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -49,6 +50,7 @@ DECLARE_GLOBAL_DATA_PTR; + /* Single-chip mode */ + /* Switch Port Registers */ + #define MVEBU_SW_LINK_CTRL_REG (1) ++#define MVEBU_SW_PORT_SWITCH_ID (3) + #define MVEBU_SW_PORT_CTRL_REG (4) + #define MVEBU_SW_PORT_BASE_VLAN (6) + +@@ -56,6 +58,8 @@ DECLARE_GLOBAL_DATA_PTR; + #define MVEBU_G2_SMI_PHY_CMD_REG (24) + #define MVEBU_G2_SMI_PHY_DATA_REG (25) + ++#define SWITCH_88E6361_PRODUCT_NUMBER 0x2610 ++ + /* + * Memory Controller Registers + * +@@ -72,6 +76,27 @@ DECLARE_GLOBAL_DATA_PTR; + #define A3700_MC_CTRL2_SDRAM_TYPE_DDR3 2 + #define A3700_MC_CTRL2_SDRAM_TYPE_DDR4 3 + ++static bool is_edpu_plus(void) ++{ ++ struct udevice *bus; ++ ofnode node; ++ int val; ++ ++ node = ofnode_by_compatible(ofnode_null(), "marvell,orion-mdio"); ++ if (!ofnode_valid(node) || ++ uclass_get_device_by_ofnode(UCLASS_MDIO, node, &bus) || ++ device_probe(bus)) { ++ printf("Cannot find MDIO bus\n"); ++ return -ENODEV; ++ } ++ ++ val = dm_mdio_read(bus, 0x0, MDIO_DEVAD_NONE, MVEBU_SW_PORT_SWITCH_ID); ++ if (val == SWITCH_88E6361_PRODUCT_NUMBER) ++ return true; ++ else ++ return false; ++} ++ + int board_early_init_f(void) + { + return 0; +@@ -353,6 +378,41 @@ static int espressobin_last_stage_init(v + return 0; + } + ++static int edpu_plus_last_stage_init(void) ++{ ++ struct udevice *dev; ++ int ret; ++ ++ if (is_edpu_plus()) { ++ ret = uclass_get_device_by_name(UCLASS_ETH, ++ "ethernet@40000", ++ &dev); ++ if (!ret) { ++ device_remove(dev, DM_REMOVE_NORMAL); ++ device_unbind(dev); ++ } ++ ++ /* Currently no networking support on the eDPU+ board */ ++ ret = uclass_get_device_by_name(UCLASS_ETH, ++ "ethernet@30000", ++ &dev); ++ if (!ret) { ++ device_remove(dev, DM_REMOVE_NORMAL); ++ device_unbind(dev); ++ } ++ } else { ++ ret = uclass_get_device_by_name(UCLASS_ETH, ++ "ethernet@30000", ++ &dev); ++ if (!ret) { ++ device_remove(dev, DM_REMOVE_NORMAL); ++ device_unbind(dev); ++ } ++ } ++ ++ return 0; ++} ++ + /* Bring-up board-specific network stuff */ + int last_stage_init(void) + { +@@ -360,6 +420,9 @@ int last_stage_init(void) + if (of_machine_is_compatible("globalscale,espressobin")) + return espressobin_last_stage_init(); + ++ if (of_machine_is_compatible("methode,edpu")) ++ return edpu_plus_last_stage_init(); ++ + return 0; + } + #endif +@@ -460,12 +523,74 @@ static int espressobin_fdt_setup(void *b + return 0; + } + ++static int edpu_plus_fdt_setup(void *blob) ++{ ++ const char *ports[] = { "downlink", "uplink" }; ++ uint8_t mac[ETH_ALEN]; ++ const char *path; ++ int i, ret; ++ ++ if (is_edpu_plus()) { ++ ret = fdt_set_status_by_compatible(blob, ++ "marvell,orion-mdio", ++ FDT_STATUS_OKAY); ++ if (ret) ++ printf("Failed to enable MDIO!\n"); ++ ++ ret = fdt_set_status_by_alias(blob, ++ "ethernet1", ++ FDT_STATUS_DISABLED); ++ if (ret) ++ printf("Failed to disable ethernet1!\n"); ++ ++ path = fdt_get_alias(blob, "ethernet0"); ++ if (path) ++ do_fixup_by_path_string(blob, path, "phy-mode", "2500base-x"); ++ else ++ printf("Failed to update ethernet0 phy-mode to 2500base-x!\n"); ++ ++ ret = fdt_set_status_by_compatible(blob, ++ "marvell,mv88e6190", ++ FDT_STATUS_OKAY); ++ if (ret) ++ printf("Failed to enable MV88E6361!\n"); ++ ++ /* ++ * MAC-s for Uplink and Downlink ports are stored under ++ * non standard variable names, so lets manually fixup the ++ * switch port nodes to have the desired MAC-s. ++ */ ++ for (i = 0; i < 2; i++) { ++ if (eth_env_get_enetaddr(ports[i], mac)) { ++ do_fixup_by_prop(blob, ++ "label", ++ ports[i], ++ strlen(ports[i]) + 1, ++ "mac-address", ++ mac, ARP_HLEN, 1); ++ ++ do_fixup_by_prop(blob, ++ "label", ++ ports[i], ++ strlen(ports[i]) + 1, ++ "local-mac-address", ++ mac, ARP_HLEN, 1); ++ } ++ } ++ } ++ ++ return 0; ++} ++ + int ft_board_setup(void *blob, struct bd_info *bd) + { + #ifdef CONFIG_ENV_IS_IN_SPI_FLASH + if (of_machine_is_compatible("globalscale,espressobin")) + return espressobin_fdt_setup(blob); + #endif ++ if (of_machine_is_compatible("methode,edpu")) ++ return edpu_plus_fdt_setup(blob); ++ + return 0; + } + #endif +--- a/configs/eDPU_defconfig ++++ b/configs/eDPU_defconfig +@@ -17,12 +17,14 @@ CONFIG_DEBUG_UART=y + # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set + CONFIG_FIT=y + CONFIG_FIT_VERBOSE=y ++CONFIG_OF_BOARD_SETUP=y + CONFIG_DISTRO_DEFAULTS=y + CONFIG_USE_PREBOOT=y + # CONFIG_DISPLAY_CPUINFO is not set + # CONFIG_DISPLAY_BOARDINFO is not set + CONFIG_DISPLAY_BOARDINFO_LATE=y + CONFIG_BOARD_EARLY_INIT_F=y ++CONFIG_LAST_STAGE_INIT=y + CONFIG_SYS_MAXARGS=32 + CONFIG_SYS_PBSIZE=1048 + # CONFIG_CMD_ELF is not set diff --git a/package/boot/uboot-sunxi/Makefile b/package/boot/uboot-sunxi/Makefile index 56bc6ff2321339..f5180bf87eeaf9 100644 --- a/package/boot/uboot-sunxi/Makefile +++ b/package/boot/uboot-sunxi/Makefile @@ -370,6 +370,15 @@ define U-Boot/orangepi_pc2 ATF:=a64 endef +define U-Boot/orangepi_zero2 + BUILD_SUBTARGET:=cortexa53 + NAME:=Xunlong Orange Pi Zero2 + BUILD_DEVICES:=xunlong_orangepi-zero2 + DEPENDS:=+PACKAGE_u-boot-orangepi_zero2:trusted-firmware-a-sunxi-h616 + UENV:=h616 + ATF:=h616 +endef + define U-Boot/tlink_rp_h6 BUILD_SUBTARGET:=cortexa53 NAME:=ThingsLink RP-H6 @@ -463,6 +472,13 @@ define U-Boot/bananapi_m2_berry BUILD_DEVICES:=sinovoip_bananapi-m2-berry endef +define U-Boot/bananapi_p2_zero + BUILD_SUBTARGET:=cortexa7 + NAME:=Bananapi P2 Zero + BUILD_DEVICES:=sinovoip_bananapi-p2-zero +endef + + UBOOT_TARGETS := \ a64-olinuxino \ a64-olinuxino-emmc \ @@ -475,6 +491,7 @@ UBOOT_TARGETS := \ bananapi_m2_plus_h3 \ Bananapi \ bananapi_m2_berry \ + bananapi_p2_zero \ Bananapi_M2_Ultra \ Bananapro \ Cubieboard \ @@ -523,6 +540,7 @@ UBOOT_TARGETS := \ orangepi_plus \ orangepi_2 \ orangepi_pc2 \ + orangepi_zero2 \ pangolin \ pine64_plus \ Sinovoip_BPI_M3 \ diff --git a/package/boot/uboot-sunxi/patches/254-sunxi-h2-add-bpi-p2-zero.patch b/package/boot/uboot-sunxi/patches/254-sunxi-h2-add-bpi-p2-zero.patch new file mode 100644 index 00000000000000..9bf1a36b21f45e --- /dev/null +++ b/package/boot/uboot-sunxi/patches/254-sunxi-h2-add-bpi-p2-zero.patch @@ -0,0 +1,307 @@ +--- /dev/null ++++ b/arch/arm/dts/sun8i-h2-plus-bananapi-p2-zero.dts +@@ -0,0 +1,291 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (C) 2023 Zoltan HERPAI ++ * ++ * Based on sun8i-h2-plus-bananapi-m2-zero.dts, which is: ++ * Copyright (C) 2017 Icenowy Zheng ++ */ ++ ++/dts-v1/; ++#include "sun8i-h3.dtsi" ++#include "sunxi-common-regulators.dtsi" ++ ++#include ++#include ++ ++/ { ++ model = "Banana Pi BPI-P2-Zero"; ++ compatible = "sinovoip,bpi-p2-zero", "allwinner,sun8i-h2-plus"; ++ ++ aliases { ++ serial0 = &uart0; ++ serial1 = &uart1; ++ ethernet0 = &emac; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ connector { ++ compatible = "hdmi-connector"; ++ type = "c"; ++ ++ port { ++ hdmi_con_in: endpoint { ++ remote-endpoint = <&hdmi_out_con>; ++ }; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ pwr_led { ++ label = "bananapi-p2-zero:red:pwr"; ++ gpios = <&r_pio 0 10 GPIO_ACTIVE_LOW>; /* PL10 */ ++ default-state = "on"; ++ }; ++ }; ++ ++ gpio-keys { ++ compatible = "gpio-keys"; ++ ++ switch-4 { ++ label = "power"; ++ linux,code = ; ++ gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; ++ wakeup-source; ++ }; ++ }; ++ ++ reg_vdd_cpux: vdd-cpux-regulator { ++ compatible = "regulator-gpio"; ++ regulator-name = "vdd-cpux"; ++ regulator-type = "voltage"; ++ regulator-boot-on; ++ regulator-always-on; ++ regulator-min-microvolt = <1100000>; ++ regulator-max-microvolt = <1300000>; ++ regulator-ramp-delay = <50>; /* 4ms */ ++ ++ gpios = <&r_pio 0 1 GPIO_ACTIVE_HIGH>; /* PL1 */ ++ enable-active-high; ++ gpios-states = <0x1>; ++ states = <1100000 0>, <1300000 1>; ++ }; ++ ++ reg_vcc_dram: vcc-dram { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc-dram"; ++ regulator-min-microvolt = <1500000>; ++ regulator-max-microvolt = <1500000>; ++ regulator-always-on; ++ regulator-boot-on; ++ enable-active-high; ++ gpio = <&r_pio 0 9 GPIO_ACTIVE_HIGH>; /* PL9 */ ++ vin-supply = <®_vcc5v0>; ++ }; ++ ++ reg_vcc1v2: vcc1v2 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc1v2"; ++ regulator-min-microvolt = <1200000>; ++ regulator-max-microvolt = <1200000>; ++ regulator-always-on; ++ regulator-boot-on; ++ enable-active-high; ++ gpio = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */ ++ vin-supply = <®_vcc5v0>; ++ }; ++ ++ poweroff { ++ compatible = "regulator-poweroff"; ++ cpu-supply = <®_vcc1v2>; ++ }; ++ ++ wifi_pwrseq: wifi_pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */ ++ clocks = <&rtc CLK_OSC32K_FANOUT>; ++ clock-names = "ext_clock"; ++ }; ++}; ++ ++&cpu0 { ++ cpu-supply = <®_vdd_cpux>; ++}; ++ ++&de { ++ status = "okay"; ++}; ++ ++&ehci0 { ++ status = "okay"; ++}; ++ ++&emac { ++ phy-handle = <&int_mii_phy>; ++ phy-mode = "mii"; ++ allwinner,leds-active-low; ++ status = "okay"; ++}; ++ ++&hdmi { ++ status = "okay"; ++}; ++ ++&hdmi_out { ++ hdmi_out_con: endpoint { ++ remote-endpoint = <&hdmi_con_in>; ++ }; ++}; ++ ++&mmc0 { ++ vmmc-supply = <®_vcc3v3>; ++ bus-width = <4>; ++ /* ++ * On the production batch of this board the card detect GPIO is ++ * high active (card inserted), although on the early samples it's ++ * low active. ++ */ ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ ++ status = "okay"; ++}; ++ ++&mmc1 { ++ vmmc-supply = <®_vcc3v3>; ++ vqmmc-supply = <®_vcc3v3>; ++ mmc-pwrseq = <&wifi_pwrseq>; ++ bus-width = <4>; ++ non-removable; ++ status = "okay"; ++ ++ brcmf: wifi@1 { ++ reg = <1>; ++ compatible = "brcm,bcm4329-fmac"; ++ interrupt-parent = <&pio>; ++ interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */ ++ interrupt-names = "host-wake"; ++ }; ++}; ++ ++&mmc2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc2_8bit_pins>; ++ vmmc-supply = <®_vcc3v3>; ++ vqmmc-supply = <®_vcc3v3>; ++ bus-width = <8>; ++ non-removable; ++ status = "okay"; ++}; ++ ++&ohci0 { ++ status = "okay"; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pa_pins>; ++ status = "okay"; ++}; ++ ++&uart1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>; ++ uart-has-rtscts; ++ status = "okay"; ++ ++ bluetooth { ++ compatible = "brcm,bcm43438-bt"; ++ max-speed = <1500000>; ++ clocks = <&rtc CLK_OSC32K_FANOUT>; ++ clock-names = "lpo"; ++ vbat-supply = <®_vcc3v3>; ++ vddio-supply = <®_vcc3v3>; ++ device-wakeup-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */ ++ host-wakeup-gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */ ++ shutdown-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */ ++ }; ++ ++}; ++ ++&pio { ++ gpio-line-names = ++ /* PA */ ++ "CON2-P13", "CON2-P11", "CON2-P22", "CON2-P15", ++ "CON3-P03", "CON3-P02", "CON2-P07", "CON2-P29", ++ "CON2-P31", "CON2-P33", "CON2-P35", "CON2-P05", ++ "CON2-P03", "CON2-P08", "CON2-P10", "CON2-P16", ++ "CON2-P12", "CON2-P37", "CON2-P28", "CON2-P27", ++ "CON2-P40", "CON2-P38", "", "", ++ "", "", "", "", "", "", "", "", ++ ++ /* PB */ ++ "", "", "", "", "", "", "", "", ++ "", "", "", "", "", "", "", "", ++ "", "", "", "", "", "", "", "", ++ "", "", "", "", "", "", "", "", ++ ++ /* PC */ ++ "CON2-P19", "CON2-P21", "CON2-P23", "CON2-P24", ++ "CON2-P18", "", "", "CON2-P26", ++ "", "", "", "", "", "", "", "", ++ "", "", "", "", "", "", "", "", ++ "", "", "", "", "", "", "", "", ++ ++ /* PD */ ++ "", "", "", "", "", "", "", "", ++ "", "", "", "", "", "", "CSI-PWR-EN", "", ++ "", "", "", "", "", "", "", "", ++ "", "", "", "", "", "", "", "", ++ ++ /* PE */ ++ "CN3-P17", "CN3-P13", "CN3-P09", "CN3-P07", ++ "CN3-P19", "CN3-P21", "CN3-P22", "CN3-P20", ++ "CN3-P18", "CN3-P16", "CN3-P14", "CN3-P12", ++ "CN3-P05", "CN3-P03", "CN3-P06", "CN3-P08", ++ "", "", "", "", "", "", "", "", ++ "", "", "", "", "", "", "", "", ++ ++ /* PF */ ++ "SDC0-D1", "SDC0-D0", "SDC0-CLK", "SDC0-CMD", "SDC0-D3", ++ "SDC0-D2", "SDC0-DET", "", ++ "", "", "", "", "", "", "", "", ++ "", "", "", "", "", "", "", "", ++ "", "", "", "", "", "", "", "", ++ ++ /* PG */ ++ "WL-SDIO-CLK", "WL-SDIO-CMD", "WL-SDIO-D0", "WL-SDIO-D1", ++ "WL-SDIO-D2", "WL-SDIO-D3", "BT-UART-TX", "BT-UART-RX", ++ "BT-UART-RTS", "BT-UART-CTS", "WL-WAKE-AP", "BT-WAKE-AP", ++ "BT-RST-N", "AP-WAKE-BT", "", "", ++ "", "", "", "", "", "", "", "", ++ "", "", "", "", "", "", "", ""; ++}; ++ ++&r_pio { ++ gpio-line-names = ++ /* PL */ ++ "", "CPUX-SET", "CON2-P32", "POWER-KEY", "CON2-P36", ++ "VCC-IO-EN", "USB0-ID", "WL-PWR-EN", ++ "PWR-STB", "PWR-DRAM", "PWR-LED", "IR-RX", "", "", "", "", ++ "", "", "", "", "", "", "", "", ++ "", "", "", "", "", "", "", ""; ++}; ++ ++&usb_otg { ++ dr_mode = "otg"; ++ status = "okay"; ++}; ++ ++&usbphy { ++ usb0_id_det-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */ ++ /* ++ * There're two micro-USB connectors, one is power-only and another is ++ * OTG. The Vbus of these two connectors are connected together, so ++ * the external USB device will be powered just by the power input ++ * from the power-only USB port. ++ */ ++ status = "okay"; ++}; +--- /dev/null ++++ b/configs/bananapi_p2_zero_defconfig +@@ -0,0 +1,10 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_SUNXI=y ++CONFIG_DEFAULT_DEVICE_TREE="sun8i-h2-plus-bananapi-p2-zero" ++CONFIG_SPL=y ++CONFIG_MACH_SUN8I_H3=y ++CONFIG_DRAM_CLK=408 ++# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set ++CONFIG_MMC_SUNXI_SLOT_EXTRA=2 ++CONFIG_SUN8I_EMAC=y ++CONFIG_USB_EHCI_HCD=y diff --git a/package/boot/uboot-sunxi/uEnv-h616.txt b/package/boot/uboot-sunxi/uEnv-h616.txt new file mode 100644 index 00000000000000..78810ff223ccee --- /dev/null +++ b/package/boot/uboot-sunxi/uEnv-h616.txt @@ -0,0 +1,7 @@ +setenv mmc_rootpart 2 +part uuid mmc ${mmc_bootdev}:${mmc_rootpart} uuid +setenv loadkernel fatload mmc \$mmc_bootdev \$kernel_addr_r uImage +setenv loaddtb fatload mmc \$mmc_bootdev \$fdt_addr_r dtb +setenv bootargs console=ttyS0,115200 earlyprintk root=PARTUUID=${uuid} rootwait +setenv uenvcmd run loadkernel \&\& run loaddtb \&\& booti \$kernel_addr_r - \$fdt_addr_r +run uenvcmd diff --git a/package/firmware/intel-microcode/Makefile b/package/firmware/intel-microcode/Makefile index 5102bf81eae8fc..9e87dccc12b29e 100644 --- a/package/firmware/intel-microcode/Makefile +++ b/package/firmware/intel-microcode/Makefile @@ -15,6 +15,7 @@ PKG_SOURCE:=intel-microcode_3.$(PKG_VERSION).1.tar.xz PKG_SOURCE_URL:=@DEBIAN/pool/non-free-firmware/i/intel-microcode/ PKG_HASH:=29e77c275b3f60a691832c0844f70effbd94a4594d04af21e0c2e6e0c1ac1894 PKG_BUILD_DIR:=$(BUILD_DIR)/intel-microcode-3.$(PKG_VERSION).1 +PKG_CPE_ID:=cpe:/a:intel:microcode PKG_BUILD_DEPENDS:=iucode-tool/host diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index aa1466418ed82d..6dd2260fac0254 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -2,13 +2,13 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/version.mk PKG_NAME:=ipq-wifi -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git -PKG_SOURCE_DATE:=2023-06-03 -PKG_SOURCE_VERSION:=cd9c30ca47b8e5388b770c523a7f6b8b969e2f92 -PKG_MIRROR_HASH:=45e623fcc512b514ade0f22e217275536aa8de4afba7dfdb11696482b8fa71a2 +PKG_SOURCE_DATE:=2023-09-16 +PKG_SOURCE_VERSION:=57aa1b1562ac60f11a6bec8be02cd3b68b12b3fa +PKG_MIRROR_HASH:=f8f9ab78ae85180a6e601d7c911d6c350b0cc132172d4baefc8f9fe07566ce0f PKG_FLAGS:=nonshared @@ -35,13 +35,16 @@ ALLWIFIBOARDS:= \ edimax_cax1800 \ netgear_rax120v2 \ netgear_wax218 \ + netgear_wax620 \ prpl_haze \ qnap_301w \ redmi_ax6 \ wallys_dr40x9 \ xiaomi_ax3600 \ xiaomi_ax9000 \ + yyets_le1 \ zte_mf289f \ + zte_mf287 \ zte_mf287plus \ zyxel_nbg7815 @@ -124,13 +127,16 @@ $(eval $(call generate-ipq-wifi-package,edgecore_eap102,Edgecore EAP102)) $(eval $(call generate-ipq-wifi-package,edimax_cax1800,Edimax CAX1800)) $(eval $(call generate-ipq-wifi-package,netgear_rax120v2,Netgear RAX120v2)) $(eval $(call generate-ipq-wifi-package,netgear_wax218,Netgear WAX218)) +$(eval $(call generate-ipq-wifi-package,netgear_wax620,Netgear WAX620)) $(eval $(call generate-ipq-wifi-package,qnap_301w,QNAP 301w)) $(eval $(call generate-ipq-wifi-package,prpl_haze,prpl Haze)) $(eval $(call generate-ipq-wifi-package,redmi_ax6,Redmi AX6)) $(eval $(call generate-ipq-wifi-package,wallys_dr40x9,Wallys DR40X9)) $(eval $(call generate-ipq-wifi-package,xiaomi_ax3600,Xiaomi AX3600)) $(eval $(call generate-ipq-wifi-package,xiaomi_ax9000,Xiaomi AX9000)) +$(eval $(call generate-ipq-wifi-package,yyets_le1,YYeTs LE1)) $(eval $(call generate-ipq-wifi-package,zte_mf289f,ZTE MF289F)) +$(eval $(call generate-ipq-wifi-package,zte_mf287,ZTE MF287)) $(eval $(call generate-ipq-wifi-package,zte_mf287plus,ZTE MF287Plus)) $(eval $(call generate-ipq-wifi-package,zyxel_nbg7815,Zyxel NBG7815)) diff --git a/package/kernel/linux/modules/hwmon.mk b/package/kernel/linux/modules/hwmon.mk index b8025877aedd76..8bf61df6a0921b 100644 --- a/package/kernel/linux/modules/hwmon.mk +++ b/package/kernel/linux/modules/hwmon.mk @@ -417,9 +417,11 @@ $(eval $(call KernelPackage,hwmon-mcp3021)) define KernelPackage/hwmon-nct6775 TITLE:=NCT6106D/6775F/6776F/6779D/6791D/6792D/6793D and compatibles monitoring support KCONFIG:=CONFIG_SENSORS_NCT6775 - FILES:=$(LINUX_DIR)/drivers/hwmon/nct6775.ko + FILES:= \ + $(LINUX_DIR)/drivers/hwmon/nct6775.ko \ + $(LINUX_DIR)/drivers/hwmon/nct6775-core.ko@ge5.19 AUTOLOAD:=$(call AutoProbe,nct6775) - $(call AddDepends/hwmon,@PCI_SUPPORT @TARGET_x86 +kmod-hwmon-vid) + $(call AddDepends/hwmon,@PCI_SUPPORT @TARGET_x86 +kmod-hwmon-vid +LINUX_6_1:kmod-regmap-core) endef define KernelPackage/hwmon-nct6775/description diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index 52fd875f29048c..c1e71e7bb3f975 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -1363,7 +1363,8 @@ define KernelPackage/mlx5-core CONFIG_MLX5_MPFS=y \ CONFIG_MLX5_SW_STEERING=n \ CONFIG_MLX5_TC_CT=n \ - CONFIG_MLX5_TLS=n + CONFIG_MLX5_TLS=n \ + CONFIG_MLX5_VFIO_PCI=n AUTOLOAD:=$(call AutoProbe,mlx5_core) endef diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk index 5b978bae7bd8d3..fcf327b434e12e 100644 --- a/package/kernel/linux/modules/netsupport.mk +++ b/package/kernel/linux/modules/netsupport.mk @@ -1324,17 +1324,13 @@ $(eval $(call KernelPackage,mpls)) define KernelPackage/9pnet SUBMENU:=$(NETWORK_SUPPORT_MENU) TITLE:=Plan 9 Resource Sharing Support (9P2000) - DEPENDS:=@VIRTIO_SUPPORT KCONFIG:= \ CONFIG_NET_9P \ CONFIG_NET_9P_DEBUG=n \ - CONFIG_NET_9P_XEN=n \ - CONFIG_NET_9P_VIRTIO \ CONFIG_NET_9P_FD=n@ge5.17 FILES:= \ - $(LINUX_DIR)/net/9p/9pnet.ko \ - $(LINUX_DIR)/net/9p/9pnet_virtio.ko - AUTOLOAD:=$(call AutoLoad,29,9pnet 9pnet_virtio) + $(LINUX_DIR)/net/9p/9pnet.ko + AUTOLOAD:=$(call AutoLoad,29,9pnet) endef define KernelPackage/9pnet/description @@ -1344,6 +1340,25 @@ endef $(eval $(call KernelPackage,9pnet)) +define KernelPackage/9pvirtio + SUBMENU:=$(NETWORK_SUPPORT_MENU) + TITLE:=Plan 9 Virtio Support + DEPENDS:=+kmod-9pnet @VIRTIO_SUPPORT + KCONFIG:= \ + CONFIG_NET_9P_XEN=n \ + CONFIG_NET_9P_VIRTIO + FILES:= \ + $(LINUX_DIR)/net/9p/9pnet_virtio.ko + AUTOLOAD:=$(call AutoLoad,29,9pnet_virtio) +endef + +define KernelPackage/9pvirtio/description + Kernel support support for + Plan 9 resource sharing for virtio. +endef + +$(eval $(call KernelPackage,9pvirtio)) + define KernelPackage/nlmon SUBMENU:=$(NETWORK_SUPPORT_MENU) diff --git a/package/kernel/linux/modules/video.mk b/package/kernel/linux/modules/video.mk index 902daefb4f863f..a5bf3c398a4948 100644 --- a/package/kernel/linux/modules/video.mk +++ b/package/kernel/linux/modules/video.mk @@ -16,6 +16,24 @@ V4L2_MEM2MEM_DIR=platform # Video Display # +define KernelPackage/acpi-video + SUBMENU:=$(VIDEO_MENU) + TITLE:=ACPI Extensions For Display Adapters + DEPENDS:=@TARGET_x86 +kmod-backlight + HIDDEN:=1 + KCONFIG:=CONFIG_ACPI_VIDEO \ + CONFIG_ACPI_WMI + FILES:=$(LINUX_DIR)/drivers/acpi/video.ko \ + $(LINUX_DIR)/drivers/platform/x86/wmi.ko + AUTOLOAD:=$(call AutoProbe,wmi video) +endef + +define KernelPackage/acpi-video/description + Kernel support for integrated graphics devices. +endef + +$(eval $(call KernelPackage,acpi-video)) + define KernelPackage/backlight SUBMENU:=$(VIDEO_MENU) TITLE:=Backlight support @@ -241,6 +259,36 @@ endef $(eval $(call KernelPackage,drm)) +define KernelPackage/drm-buddy + SUBMENU:=$(VIDEO_MENU) + TITLE:=A page based buddy allocator + DEPENDS:=@DISPLAY_SUPPORT +kmod-drm @LINUX_6_1 + KCONFIG:=CONFIG_DRM_BUDDY + FILES:= $(LINUX_DIR)/drivers/gpu/drm/drm_buddy.ko + AUTOLOAD:=$(call AutoProbe,drm_buddy) +endef + +define KernelPackage/drm-buddy/description + A page based buddy allocator +endef + +$(eval $(call KernelPackage,drm-buddy)) + +define KernelPackage/drm-display-helper + SUBMENU:=$(VIDEO_MENU) + TITLE:=DRM helpers for display adapters drivers + DEPENDS:=@DISPLAY_SUPPORT +kmod-drm-kms-helper @LINUX_6_1 + KCONFIG:=CONFIG_DRM_DISPLAY_HELPER + FILES:=$(LINUX_DIR)/drivers/gpu/drm/display/drm_display_helper.ko + AUTOLOAD:=$(call AutoProbe,drm_display_helper) +endef + +define KernelPackage/drm-display-helper/description + DRM helpers for display adapters drivers. +endef + +$(eval $(call KernelPackage,drm-display-helper)) + define KernelPackage/drm-ttm SUBMENU:=$(VIDEO_MENU) TITLE:=GPU memory management subsystem @@ -293,7 +341,9 @@ define KernelPackage/drm-amdgpu SUBMENU:=$(VIDEO_MENU) TITLE:=AMDGPU DRM support DEPENDS:=@TARGET_x86 @DISPLAY_SUPPORT +kmod-backlight +kmod-drm-ttm \ - +kmod-drm-ttm-helper +kmod-drm-kms-helper +kmod-i2c-algo-bit +amdgpu-firmware + +kmod-drm-ttm-helper +kmod-drm-kms-helper +kmod-i2c-algo-bit +amdgpu-firmware \ + +LINUX_6_1:kmod-drm-display-helper +LINUX_6_1:kmod-drm-buddy \ + +LINUX_6_1:kmod-acpi-video KCONFIG:=CONFIG_DRM_AMDGPU \ CONFIG_DRM_AMDGPU_SI=y \ CONFIG_DRM_AMDGPU_CIK=y \ @@ -492,7 +542,8 @@ define KernelPackage/drm-radeon SUBMENU:=$(VIDEO_MENU) TITLE:=Radeon DRM support DEPENDS:=@TARGET_x86 @DISPLAY_SUPPORT +kmod-backlight +kmod-drm-kms-helper \ - +kmod-drm-ttm +kmod-drm-ttm-helper +kmod-i2c-algo-bit +radeon-firmware + +kmod-drm-ttm +kmod-drm-ttm-helper +kmod-i2c-algo-bit +radeon-firmware \ + +LINUX_6_1:kmod-drm-display-helper +LINUX_6_1:kmod-acpi-video KCONFIG:=CONFIG_DRM_RADEON FILES:=$(LINUX_DIR)/drivers/gpu/drm/radeon/radeon.ko AUTOLOAD:=$(call AutoProbe,radeon) diff --git a/package/kernel/mac80211/broadcom.mk b/package/kernel/mac80211/broadcom.mk index 13da62a6f469a1..d0b08890881baa 100644 --- a/package/kernel/mac80211/broadcom.mk +++ b/package/kernel/mac80211/broadcom.mk @@ -416,7 +416,10 @@ define KernelPackage/brcmfmac DEPENDS+= @USB_SUPPORT +kmod-cfg80211 +@DRIVER_11AC_SUPPORT \ +kmod-brcmutil +BRCMFMAC_SDIO:kmod-mmc @!TARGET_uml \ +BRCMFMAC_USB:kmod-usb-core +BRCMFMAC_USB:brcmfmac-firmware-usb - FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko + FILES:= \ + $(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko \ + $(foreach type,bca cyw wcc, \ + $(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/brcm80211/brcmfmac/$(type)/brcmfmac-$(type).ko) AUTOLOAD:=$(call AutoProbe,brcmfmac) endef diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index 3b88af46795970..860609305f4539 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -27,6 +27,7 @@ drv_mac80211_init_device_config() { config_add_string distance config_add_int beacon_int chanbw frag rts config_add_int rxantenna txantenna txpower min_tx_power + config_add_int num_global_macaddr multiple_bssid config_add_boolean noscan ht_coex acs_exclude_dfs background_radar config_add_array ht_capab config_add_array channels @@ -487,6 +488,8 @@ ${channel:+channel=$channel} ${channel_list:+chanlist=$channel_list} ${hostapd_noscan:+noscan=1} ${tx_burst:+tx_queue_data2_burst=$tx_burst} +${multiple_bssid:+mbssid=$multiple_bssid} +#num_global_macaddr=$num_global_macaddr $base_cfg EOF @@ -517,6 +520,7 @@ mac80211_hostapd_setup_bss() { cat >> /var/run/hostapd-$phy.conf < /dev/null ubus call wpa_supplicant config_set '{ "phy": "'"$phy"'", "config": [] }' > /dev/null - wdev_tool "$phy" '{}' + wdev_tool "$phy" set_config '{}' } drv_mac80211_setup() { @@ -1080,7 +1048,8 @@ drv_mac80211_setup() { country chanbw distance \ txpower \ rxantenna txantenna \ - frag rts beacon_int:100 htmode + frag rts beacon_int:100 htmode \ + num_global_macaddr:1 multiple_bssid json_get_values basic_rate_list basic_rate json_get_values scan_list scan_list json_select .. @@ -1174,7 +1143,7 @@ drv_mac80211_setup() { [ -x /usr/sbin/wpa_supplicant ] && wpa_supplicant_start "$phy" json_set_namespace wdev_uc prev - wdev_tool "$phy" "$(json_dump)" $active_ifnames + wdev_tool "$phy" set_config "$(json_dump)" $active_ifnames json_set_namespace "$prev" for_each_interface "ap sta adhoc mesh monitor" mac80211_set_vif_txpower diff --git a/package/kernel/mac80211/patches/ath11k/0001-wifi-ath11k-Fix-qmi_msg_handler-data-structure-initi.patch b/package/kernel/mac80211/patches/ath11k/0001-wifi-ath11k-Fix-qmi_msg_handler-data-structure-initi.patch deleted file mode 100644 index a3349736633b59..00000000000000 --- a/package/kernel/mac80211/patches/ath11k/0001-wifi-ath11k-Fix-qmi_msg_handler-data-structure-initi.patch +++ /dev/null @@ -1,33 +0,0 @@ -From ed3725e15a154ebebf44e0c34806c57525483f92 Mon Sep 17 00:00:00 2001 -From: Rahul Bhattacharjee -Date: Fri, 21 Oct 2022 14:31:26 +0530 -Subject: [PATCH] wifi: ath11k: Fix qmi_msg_handler data structure - initialization - -qmi_msg_handler is required to be null terminated by QMI module. -There might be a case where a handler for a msg id is not present in the -handlers array which can lead to infinite loop while searching the handler -and therefore out of bound access in qmi_invoke_handler(). -Hence update the initialization in qmi_msg_handler data structure. - -Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 - -Signed-off-by: Rahul Bhattacharjee -Signed-off-by: Kalle Valo -Link: https://lore.kernel.org/r/20221021090126.28626-1-quic_rbhattac@quicinc.com ---- - drivers/net/wireless/ath/ath11k/qmi.c | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/drivers/net/wireless/ath/ath11k/qmi.c -+++ b/drivers/net/wireless/ath/ath11k/qmi.c -@@ -1702,6 +1702,9 @@ static const struct qmi_elem_info qmi_wl - .data_type = QMI_EOTI, - .array_type = NO_ARRAY, - }, -+ -+ /* end of list */ -+ {}, - }; - - static int ath11k_qmi_host_cap_send(struct ath11k_base *ab) diff --git a/package/kernel/mac80211/patches/ath11k/0001-wifi-ath11k-fix-band-selection-for-ppdu-received-in-.patch b/package/kernel/mac80211/patches/ath11k/0001-wifi-ath11k-fix-band-selection-for-ppdu-received-in-.patch new file mode 100644 index 00000000000000..e6f9ac9e4c0aab --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0001-wifi-ath11k-fix-band-selection-for-ppdu-received-in-.patch @@ -0,0 +1,37 @@ +From 72c8caf904aed2caed5d6e75233294b6159ddb5d Mon Sep 17 00:00:00 2001 +From: Aditya Kumar Singh +Date: Wed, 26 Jul 2023 10:16:24 +0530 +Subject: [PATCH 1/5] wifi: ath11k: fix band selection for ppdu received in + channel 177 of 5 GHz + +5 GHz band channel 177 support was added with the commit e5e94d10c856 ("wifi: +ath11k: add channel 177 into 5 GHz channel list"). However, during processing +for the received ppdu in ath11k_dp_rx_h_ppdu(), channel number is checked only +till 173. This leads to driver code checking for channel and then fetching the +band from it which is extra effort since firmware has already given the channel +number in the metadata. + +Fix this issue by checking the channel number till 177 since we support +it now. + +Found via code review. Compile tested only. + +Fixes: e5e94d10c856 ("wifi: ath11k: add channel 177 into 5 GHz channel list") +Signed-off-by: Aditya Kumar Singh +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230726044624.20507-1-quic_adisi@quicinc.com +--- + drivers/net/wireless/ath/ath11k/dp_rx.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -2408,7 +2408,7 @@ static void ath11k_dp_rx_h_ppdu(struct a + rx_status->freq = center_freq; + } else if (channel_num >= 1 && channel_num <= 14) { + rx_status->band = NL80211_BAND_2GHZ; +- } else if (channel_num >= 36 && channel_num <= 173) { ++ } else if (channel_num >= 36 && channel_num <= 177) { + rx_status->band = NL80211_BAND_5GHZ; + } else { + spin_lock_bh(&ar->data_lock); diff --git a/package/kernel/mac80211/patches/ath11k/0002-wifi-ath11k-allow-system-suspend-to-survive-ath11k.patch b/package/kernel/mac80211/patches/ath11k/0002-wifi-ath11k-allow-system-suspend-to-survive-ath11k.patch deleted file mode 100644 index fa680954e6fae3..00000000000000 --- a/package/kernel/mac80211/patches/ath11k/0002-wifi-ath11k-allow-system-suspend-to-survive-ath11k.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 7c15430822e71e90203d87e6d0cfe83fa058b0dc Mon Sep 17 00:00:00 2001 -From: Len Brown -Date: Wed, 1 Feb 2023 12:32:01 -0600 -Subject: [PATCH] wifi: ath11k: allow system suspend to survive ath11k - -When ath11k runs into internal errors upon suspend, -it returns an error code to pci_pm_suspend, which -aborts the entire system suspend. - -The driver should not abort system suspend, but should -keep its internal errors to itself, and allow the system -to suspend. Otherwise, a user can suspend a laptop -by closing the lid and sealing it into a case, assuming -that is will suspend, rather than heating up and draining -the battery when in transit. - -In practice, the ath11k device seems to have plenty of transient -errors, and subsequent suspend cycles after this failure -often succeed. - -https://bugzilla.kernel.org/show_bug.cgi?id=216968 - -Fixes: d1b0c33850d29 ("ath11k: implement suspend for QCA6390 PCI devices") - -Signed-off-by: Len Brown -Cc: stable@vger.kernel.org -Signed-off-by: Kalle Valo -Link: https://lore.kernel.org/r/20230201183201.14431-1-len.brown@intel.com ---- - drivers/net/wireless/ath/ath11k/pci.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/net/wireless/ath/ath11k/pci.c -+++ b/drivers/net/wireless/ath/ath11k/pci.c -@@ -998,7 +998,7 @@ static __maybe_unused int ath11k_pci_pm_ - if (ret) - ath11k_warn(ab, "failed to resume core: %d\n", ret); - -- return ret; -+ return 0; - } - - static SIMPLE_DEV_PM_OPS(ath11k_pci_pm_ops, diff --git a/package/kernel/mac80211/patches/ath11k/0002-wifi-ath11k-simplify-ath11k_mac_validate_vht_he_fixe.patch b/package/kernel/mac80211/patches/ath11k/0002-wifi-ath11k-simplify-ath11k_mac_validate_vht_he_fixe.patch new file mode 100644 index 00000000000000..ad761e6a909098 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0002-wifi-ath11k-simplify-ath11k_mac_validate_vht_he_fixe.patch @@ -0,0 +1,38 @@ +From 6f092c98dcfa1e4cf37d45f9b8e4d4a3cbeb79d4 Mon Sep 17 00:00:00 2001 +From: Dmitry Antipov +Date: Wed, 26 Jul 2023 12:21:02 +0300 +Subject: [PATCH 2/5] wifi: ath11k: simplify + ath11k_mac_validate_vht_he_fixed_rate_settings() + +In ath11k_mac_validate_vht_he_fixed_rate_settings() ar->ab->peers +list is not altered so list_for_each_entry() should be safe. + +Compile tested only. + +Signed-off-by: Dmitry Antipov +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230726092113.78794-1-dmantipov@yandex.ru +--- + drivers/net/wireless/ath/ath11k/mac.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -8258,7 +8258,7 @@ ath11k_mac_validate_vht_he_fixed_rate_se + const struct cfg80211_bitrate_mask *mask) + { + bool he_fixed_rate = false, vht_fixed_rate = false; +- struct ath11k_peer *peer, *tmp; ++ struct ath11k_peer *peer; + const u16 *vht_mcs_mask, *he_mcs_mask; + struct ieee80211_link_sta *deflink; + u8 vht_nss, he_nss; +@@ -8281,7 +8281,7 @@ ath11k_mac_validate_vht_he_fixed_rate_se + + rcu_read_lock(); + spin_lock_bh(&ar->ab->base_lock); +- list_for_each_entry_safe(peer, tmp, &ar->ab->peers, list) { ++ list_for_each_entry(peer, &ar->ab->peers, list) { + if (peer->sta) { + deflink = &peer->sta->deflink; + diff --git a/package/kernel/mac80211/patches/ath11k/0003-wifi-ath11k-Split-coldboot-calibration-hw_param.patch b/package/kernel/mac80211/patches/ath11k/0003-wifi-ath11k-Split-coldboot-calibration-hw_param.patch new file mode 100644 index 00000000000000..f8c7c937eabfa8 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0003-wifi-ath11k-Split-coldboot-calibration-hw_param.patch @@ -0,0 +1,180 @@ +From 011e5a3052a22d3758d17442bf0c04c68bf79bea Mon Sep 17 00:00:00 2001 +From: Seevalamuthu Mariappan +Date: Wed, 26 Jul 2023 19:40:30 +0530 +Subject: [PATCH 3/5] wifi: ath11k: Split coldboot calibration hw_param + +QCN9074 enables coldboot calibration only in Factory Test Mode (FTM). +Hence, split cold_boot_calib to two hw_params for mission and FTM +mode. + +Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 + +Signed-off-by: Seevalamuthu Mariappan +Signed-off-by: Raj Kumar Bhagat +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230726141032.3061-2-quic_rajkbhag@quicinc.com +--- + drivers/net/wireless/ath/ath11k/ahb.c | 3 +-- + drivers/net/wireless/ath/ath11k/core.c | 36 ++++++++++++++++++++------ + drivers/net/wireless/ath/ath11k/core.h | 1 + + drivers/net/wireless/ath/ath11k/hw.h | 3 ++- + drivers/net/wireless/ath/ath11k/qmi.c | 6 ++--- + 5 files changed, 35 insertions(+), 14 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/ahb.c ++++ b/drivers/net/wireless/ath/ath11k/ahb.c +@@ -422,8 +422,7 @@ static int ath11k_ahb_fwreset_from_cold_ + { + int timeout; + +- if (ath11k_cold_boot_cal == 0 || ab->qmi.cal_done || +- ab->hw_params.cold_boot_calib == 0 || ++ if (!ath11k_core_coldboot_cal_support(ab) || ab->qmi.cal_done || + ab->hw_params.cbcal_restart_fw == 0) + return 0; + +--- a/drivers/net/wireless/ath/ath11k/core.c ++++ b/drivers/net/wireless/ath/ath11k/core.c +@@ -86,7 +86,8 @@ static const struct ath11k_hw_params ath + .supports_shadow_regs = false, + .idle_ps = false, + .supports_sta_ps = false, +- .cold_boot_calib = true, ++ .coldboot_cal_mm = true, ++ .coldboot_cal_ftm = true, + .cbcal_restart_fw = true, + .fw_mem_mode = 0, + .num_vdevs = 16 + 1, +@@ -167,7 +168,8 @@ static const struct ath11k_hw_params ath + .supports_shadow_regs = false, + .idle_ps = false, + .supports_sta_ps = false, +- .cold_boot_calib = true, ++ .coldboot_cal_mm = true, ++ .coldboot_cal_ftm = true, + .cbcal_restart_fw = true, + .fw_mem_mode = 0, + .num_vdevs = 16 + 1, +@@ -248,7 +250,8 @@ static const struct ath11k_hw_params ath + .supports_shadow_regs = true, + .idle_ps = true, + .supports_sta_ps = true, +- .cold_boot_calib = false, ++ .coldboot_cal_mm = false, ++ .coldboot_cal_ftm = false, + .cbcal_restart_fw = false, + .fw_mem_mode = 0, + .num_vdevs = 16 + 1, +@@ -332,7 +335,8 @@ static const struct ath11k_hw_params ath + .supports_shadow_regs = false, + .idle_ps = false, + .supports_sta_ps = false, +- .cold_boot_calib = false, ++ .coldboot_cal_mm = false, ++ .coldboot_cal_ftm = false, + .cbcal_restart_fw = false, + .fw_mem_mode = 2, + .num_vdevs = 8, +@@ -413,7 +417,8 @@ static const struct ath11k_hw_params ath + .supports_shadow_regs = true, + .idle_ps = true, + .supports_sta_ps = true, +- .cold_boot_calib = false, ++ .coldboot_cal_mm = false, ++ .coldboot_cal_ftm = false, + .cbcal_restart_fw = false, + .fw_mem_mode = 0, + .num_vdevs = 16 + 1, +@@ -495,7 +500,8 @@ static const struct ath11k_hw_params ath + .supports_shadow_regs = true, + .idle_ps = true, + .supports_sta_ps = true, +- .cold_boot_calib = false, ++ .coldboot_cal_mm = false, ++ .coldboot_cal_ftm = false, + .cbcal_restart_fw = false, + .fw_mem_mode = 0, + .num_vdevs = 16 + 1, +@@ -578,7 +584,8 @@ static const struct ath11k_hw_params ath + .supports_shadow_regs = true, + .idle_ps = true, + .supports_sta_ps = true, +- .cold_boot_calib = true, ++ .coldboot_cal_mm = true, ++ .coldboot_cal_ftm = true, + .cbcal_restart_fw = false, + .fw_mem_mode = 0, + .num_vdevs = 16 + 1, +@@ -667,7 +674,8 @@ static const struct ath11k_hw_params ath + .supports_suspend = false, + .hal_params = &ath11k_hw_hal_params_ipq8074, + .single_pdev_only = false, +- .cold_boot_calib = true, ++ .coldboot_cal_mm = true, ++ .coldboot_cal_ftm = true, + .cbcal_restart_fw = true, + .fix_l1ss = true, + .supports_dynamic_smps_6ghz = false, +@@ -749,6 +757,18 @@ void ath11k_fw_stats_free(struct ath11k_ + ath11k_fw_stats_bcn_free(&stats->bcn); + } + ++bool ath11k_core_coldboot_cal_support(struct ath11k_base *ab) ++{ ++ if (!ath11k_cold_boot_cal) ++ return false; ++ ++ if (ath11k_ftm_mode) ++ return ab->hw_params.coldboot_cal_ftm; ++ ++ else ++ return ab->hw_params.coldboot_cal_mm; ++} ++ + int ath11k_core_suspend(struct ath11k_base *ab) + { + int ret; +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -1186,6 +1186,7 @@ void ath11k_core_halt(struct ath11k *ar) + int ath11k_core_resume(struct ath11k_base *ab); + int ath11k_core_suspend(struct ath11k_base *ab); + void ath11k_core_pre_reconfigure_recovery(struct ath11k_base *ab); ++bool ath11k_core_coldboot_cal_support(struct ath11k_base *ab); + + const struct firmware *ath11k_core_firmware_request(struct ath11k_base *ab, + const char *filename); +--- a/drivers/net/wireless/ath/ath11k/hw.h ++++ b/drivers/net/wireless/ath/ath11k/hw.h +@@ -187,7 +187,8 @@ struct ath11k_hw_params { + bool supports_shadow_regs; + bool idle_ps; + bool supports_sta_ps; +- bool cold_boot_calib; ++ bool coldboot_cal_mm; ++ bool coldboot_cal_ftm; + bool cbcal_restart_fw; + int fw_mem_mode; + u32 num_vdevs; +--- a/drivers/net/wireless/ath/ath11k/qmi.c ++++ b/drivers/net/wireless/ath/ath11k/qmi.c +@@ -2079,7 +2079,7 @@ static int ath11k_qmi_assign_target_mem_ + return -EINVAL; + } + +- if (ath11k_cold_boot_cal && ab->hw_params.cold_boot_calib) { ++ if (ath11k_core_coldboot_cal_support(ab)) { + if (hremote_node) { + ab->qmi.target_mem[idx].paddr = + res.start + host_ddr_sz; +@@ -3209,8 +3209,8 @@ static void ath11k_qmi_driver_event_work + break; + } + +- if (ath11k_cold_boot_cal && ab->qmi.cal_done == 0 && +- ab->hw_params.cold_boot_calib) { ++ if (ab->qmi.cal_done == 0 && ++ ath11k_core_coldboot_cal_support(ab)) { + ath11k_qmi_process_coldboot_calibration(ab); + } else { + clear_bit(ATH11K_FLAG_CRASH_FLUSH, diff --git a/package/kernel/mac80211/patches/ath11k/0004-wifi-ath11k-Add-coldboot-calibration-support-for-QCN.patch b/package/kernel/mac80211/patches/ath11k/0004-wifi-ath11k-Add-coldboot-calibration-support-for-QCN.patch new file mode 100644 index 00000000000000..9d51c1c3eaaef5 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0004-wifi-ath11k-Add-coldboot-calibration-support-for-QCN.patch @@ -0,0 +1,176 @@ +From bdfc967bf5fcd762473a01d39edb81f1165ba290 Mon Sep 17 00:00:00 2001 +From: Anilkumar Kolli +Date: Wed, 26 Jul 2023 19:40:31 +0530 +Subject: [PATCH 4/5] wifi: ath11k: Add coldboot calibration support for + QCN9074 + +QCN9074 supports 6 GHz, which has increased number of channels +compared to 5 GHz/2 GHz. So, to support coldboot calibration in +QCN9074 ATH11K_COLD_BOOT_FW_RESET_DELAY extended to 60 seconds. To +avoid code redundancy, fwreset_from_cold_boot moved to QMI and made +common for both ahb and pci. Coldboot calibration is enabled only in +FTM mode for QCN9074. QCN9074 requires firmware restart after coldboot, +hence enable cbcal_restart_fw in hw_params. + +This support can be enabled/disabled using hw params for different +hardware. Currently it is not enabled for QCA6390. + +Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 + +Signed-off-by: Anilkumar Kolli +Signed-off-by: Seevalamuthu Mariappan +Signed-off-by: Raj Kumar Bhagat +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230726141032.3061-3-quic_rajkbhag@quicinc.com +--- + drivers/net/wireless/ath/ath11k/ahb.c | 28 ++------------------------ + drivers/net/wireless/ath/ath11k/core.c | 4 ++-- + drivers/net/wireless/ath/ath11k/pci.c | 2 ++ + drivers/net/wireless/ath/ath11k/qmi.c | 28 ++++++++++++++++++++++++++ + drivers/net/wireless/ath/ath11k/qmi.h | 3 ++- + 5 files changed, 36 insertions(+), 29 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/ahb.c ++++ b/drivers/net/wireless/ath/ath11k/ahb.c +@@ -14,6 +14,7 @@ + #include "ahb.h" + #include "debug.h" + #include "hif.h" ++#include "qmi.h" + #include + #include "pcic.h" + #include +@@ -418,31 +419,6 @@ static void ath11k_ahb_power_down(struct + rproc_shutdown(ab_ahb->tgt_rproc); + } + +-static int ath11k_ahb_fwreset_from_cold_boot(struct ath11k_base *ab) +-{ +- int timeout; +- +- if (!ath11k_core_coldboot_cal_support(ab) || ab->qmi.cal_done || +- ab->hw_params.cbcal_restart_fw == 0) +- return 0; +- +- ath11k_dbg(ab, ATH11K_DBG_AHB, "wait for cold boot done\n"); +- timeout = wait_event_timeout(ab->qmi.cold_boot_waitq, +- (ab->qmi.cal_done == 1), +- ATH11K_COLD_BOOT_FW_RESET_DELAY); +- if (timeout <= 0) { +- ath11k_cold_boot_cal = 0; +- ath11k_warn(ab, "Coldboot Calibration failed timed out\n"); +- } +- +- /* reset the firmware */ +- ath11k_ahb_power_down(ab); +- ath11k_ahb_power_up(ab); +- +- ath11k_dbg(ab, ATH11K_DBG_AHB, "exited from cold boot mode\n"); +- return 0; +-} +- + static void ath11k_ahb_init_qmi_ce_config(struct ath11k_base *ab) + { + struct ath11k_qmi_ce_cfg *cfg = &ab->qmi.ce_cfg; +@@ -1225,7 +1201,7 @@ static int ath11k_ahb_probe(struct platf + goto err_ce_free; + } + +- ath11k_ahb_fwreset_from_cold_boot(ab); ++ ath11k_qmi_fwreset_from_cold_boot(ab); + + return 0; + +--- a/drivers/net/wireless/ath/ath11k/core.c ++++ b/drivers/net/wireless/ath/ath11k/core.c +@@ -336,8 +336,8 @@ static const struct ath11k_hw_params ath + .idle_ps = false, + .supports_sta_ps = false, + .coldboot_cal_mm = false, +- .coldboot_cal_ftm = false, +- .cbcal_restart_fw = false, ++ .coldboot_cal_ftm = true, ++ .cbcal_restart_fw = true, + .fw_mem_mode = 2, + .num_vdevs = 8, + .num_peers = 128, +--- a/drivers/net/wireless/ath/ath11k/pci.c ++++ b/drivers/net/wireless/ath/ath11k/pci.c +@@ -15,6 +15,7 @@ + #include "mhi.h" + #include "debug.h" + #include "pcic.h" ++#include "qmi.h" + + #define ATH11K_PCI_BAR_NUM 0 + #define ATH11K_PCI_DMA_MASK 32 +@@ -897,6 +898,7 @@ unsupported_wcn6855_soc: + ath11k_err(ab, "failed to init core: %d\n", ret); + goto err_irq_affinity_cleanup; + } ++ ath11k_qmi_fwreset_from_cold_boot(ab); + return 0; + + err_irq_affinity_cleanup: +--- a/drivers/net/wireless/ath/ath11k/qmi.c ++++ b/drivers/net/wireless/ath/ath11k/qmi.c +@@ -9,6 +9,7 @@ + #include "qmi.h" + #include "core.h" + #include "debug.h" ++#include "hif.h" + #include + #include + #include +@@ -2839,6 +2840,33 @@ int ath11k_qmi_firmware_start(struct ath + return 0; + } + ++int ath11k_qmi_fwreset_from_cold_boot(struct ath11k_base *ab) ++{ ++ int timeout; ++ ++ if (!ath11k_core_coldboot_cal_support(ab) || ab->qmi.cal_done || ++ ab->hw_params.cbcal_restart_fw == 0) ++ return 0; ++ ++ ath11k_dbg(ab, ATH11K_DBG_QMI, "wait for cold boot done\n"); ++ ++ timeout = wait_event_timeout(ab->qmi.cold_boot_waitq, ++ (ab->qmi.cal_done == 1), ++ ATH11K_COLD_BOOT_FW_RESET_DELAY); ++ ++ if (timeout <= 0) { ++ ath11k_warn(ab, "Coldboot Calibration timed out\n"); ++ return -ETIMEDOUT; ++ } ++ ++ /* reset the firmware */ ++ ath11k_hif_power_down(ab); ++ ath11k_hif_power_up(ab); ++ ath11k_dbg(ab, ATH11K_DBG_QMI, "exit wait for cold boot done\n"); ++ return 0; ++} ++EXPORT_SYMBOL(ath11k_qmi_fwreset_from_cold_boot); ++ + static int ath11k_qmi_process_coldboot_calibration(struct ath11k_base *ab) + { + int timeout; +--- a/drivers/net/wireless/ath/ath11k/qmi.h ++++ b/drivers/net/wireless/ath/ath11k/qmi.h +@@ -37,7 +37,7 @@ + + #define QMI_WLANFW_MAX_DATA_SIZE_V01 6144 + #define ATH11K_FIRMWARE_MODE_OFF 4 +-#define ATH11K_COLD_BOOT_FW_RESET_DELAY (40 * HZ) ++#define ATH11K_COLD_BOOT_FW_RESET_DELAY (60 * HZ) + + #define ATH11K_QMI_DEVICE_BAR_SIZE 0x200000 + +@@ -519,5 +519,6 @@ void ath11k_qmi_msg_recv_work(struct wor + void ath11k_qmi_deinit_service(struct ath11k_base *ab); + int ath11k_qmi_init_service(struct ath11k_base *ab); + void ath11k_qmi_free_resource(struct ath11k_base *ab); ++int ath11k_qmi_fwreset_from_cold_boot(struct ath11k_base *ab); + + #endif diff --git a/package/kernel/mac80211/patches/ath11k/0005-wifi-ath11k-Remove-cal_done-check-during-probe.patch b/package/kernel/mac80211/patches/ath11k/0005-wifi-ath11k-Remove-cal_done-check-during-probe.patch new file mode 100644 index 00000000000000..884fd58d75b0ff --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0005-wifi-ath11k-Remove-cal_done-check-during-probe.patch @@ -0,0 +1,33 @@ +From 13329d0cb7212b058bd8451a99d215a8f97645ea Mon Sep 17 00:00:00 2001 +From: Seevalamuthu Mariappan +Date: Wed, 26 Jul 2023 19:40:32 +0530 +Subject: [PATCH 5/5] wifi: ath11k: Remove cal_done check during probe + +In some race conditions, calibration done QMI message is received even +before host wait starts for calibration to be done. +Due to this, resetting firmware was not performed after calibration. + +Hence, remove cal_done check in ath11k_qmi_fwreset_from_cold_boot() +as this is called only from probe. + +Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 + +Signed-off-by: Seevalamuthu Mariappan +Signed-off-by: Raj Kumar Bhagat +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230726141032.3061-4-quic_rajkbhag@quicinc.com +--- + drivers/net/wireless/ath/ath11k/qmi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/wireless/ath/ath11k/qmi.c ++++ b/drivers/net/wireless/ath/ath11k/qmi.c +@@ -2844,7 +2844,7 @@ int ath11k_qmi_fwreset_from_cold_boot(st + { + int timeout; + +- if (!ath11k_core_coldboot_cal_support(ab) || ab->qmi.cal_done || ++ if (!ath11k_core_coldboot_cal_support(ab) || + ab->hw_params.cbcal_restart_fw == 0) + return 0; + diff --git a/package/kernel/mac80211/patches/ath11k/0006-wifi-ath11k-Don-t-drop-tx_status-when-peer-cannot-be.patch b/package/kernel/mac80211/patches/ath11k/0006-wifi-ath11k-Don-t-drop-tx_status-when-peer-cannot-be.patch new file mode 100644 index 00000000000000..e404a7849e63f2 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0006-wifi-ath11k-Don-t-drop-tx_status-when-peer-cannot-be.patch @@ -0,0 +1,53 @@ +From 400ece6c7f346b0a30867bd00b03b5b2563d4357 Mon Sep 17 00:00:00 2001 +From: Sven Eckelmann +Date: Tue, 22 Aug 2023 16:42:24 +0300 +Subject: [PATCH] wifi: ath11k: Don't drop tx_status when peer cannot be found + +When a station idles for a long time, hostapd will try to send a QoS Null +frame to the station as "poll". NL80211_CMD_PROBE_CLIENT is used for this +purpose. And the skb will be added to ack_status_frame - waiting for a +completion via ieee80211_report_ack_skb(). + +But when the peer was already removed before the tx_complete arrives, the +peer will be missing. And when using dev_kfree_skb_any (instead of going +through mac80211), the entry will stay inside ack_status_frames. This IDR +will therefore run full after 8K request were generated for such clients. +At this point, the access point will then just stall and not allow any new +clients because idr_alloc() for ack_status_frame will fail. + +ieee80211_free_txskb() on the other hand will (when required) call +ieee80211_report_ack_skb() and make sure that (when required) remove the +entry from the ack_status_frame. + +Tested-on: IPQ6018 hw1.0 WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 + +Fixes: 6257c702264c ("wifi: ath11k: fix tx status reporting in encap offload mode") +Fixes: 94739d45c388 ("ath11k: switch to using ieee80211_tx_status_ext()") +Cc: stable@vger.kernel.org +Signed-off-by: Sven Eckelmann +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230802-ath11k-ack_status_leak-v2-1-c0af729d6229@narfation.org +--- + drivers/net/wireless/ath/ath11k/dp_tx.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/dp_tx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_tx.c +@@ -369,7 +369,7 @@ ath11k_dp_tx_htt_tx_complete_buf(struct + "dp_tx: failed to find the peer with peer_id %d\n", + ts->peer_id); + spin_unlock_bh(&ab->base_lock); +- dev_kfree_skb_any(msdu); ++ ieee80211_free_txskb(ar->hw, msdu); + return; + } + spin_unlock_bh(&ab->base_lock); +@@ -624,7 +624,7 @@ static void ath11k_dp_tx_complete_msdu(s + "dp_tx: failed to find the peer with peer_id %d\n", + ts->peer_id); + spin_unlock_bh(&ab->base_lock); +- dev_kfree_skb_any(msdu); ++ ieee80211_free_txskb(ar->hw, msdu); + return; + } + arsta = (struct ath11k_sta *)peer->sta->drv_priv; diff --git a/package/kernel/mac80211/patches/ath11k/0007-wifi-ath11k-Cleanup-mac80211-references-on-failure-d.patch b/package/kernel/mac80211/patches/ath11k/0007-wifi-ath11k-Cleanup-mac80211-references-on-failure-d.patch new file mode 100644 index 00000000000000..ae9cd05dd6220e --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0007-wifi-ath11k-Cleanup-mac80211-references-on-failure-d.patch @@ -0,0 +1,51 @@ +From 29d15589f084d71a4ea8c544039c5839db0236e2 Mon Sep 17 00:00:00 2001 +From: Sven Eckelmann +Date: Tue, 22 Aug 2023 16:42:24 +0300 +Subject: [PATCH] wifi: ath11k: Cleanup mac80211 references on failure during + tx_complete + +When a function is using functions from mac80211 to free an skb then it +should do it consistently and not switch to the generic dev_kfree_skb_any +(or similar functions). Otherwise (like in the error handlers), mac80211 +will will not be aware of the freed skb and thus not clean up related +information in its internal data structures. + +Not doing so lead in the past to filled up structure which then prevented +new clients to connect. + +Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") +Fixes: 6257c702264c ("wifi: ath11k: fix tx status reporting in encap offload mode") +Cc: stable@vger.kernel.org +Signed-off-by: Sven Eckelmann +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230802-ath11k-ack_status_leak-v2-2-c0af729d6229@narfation.org +--- + drivers/net/wireless/ath/ath11k/dp_tx.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/dp_tx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_tx.c +@@ -344,7 +344,7 @@ ath11k_dp_tx_htt_tx_complete_buf(struct + dma_unmap_single(ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); + + if (!skb_cb->vif) { +- dev_kfree_skb_any(msdu); ++ ieee80211_free_txskb(ar->hw, msdu); + return; + } + +@@ -566,12 +566,12 @@ static void ath11k_dp_tx_complete_msdu(s + dma_unmap_single(ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); + + if (unlikely(!rcu_access_pointer(ab->pdevs_active[ar->pdev_idx]))) { +- dev_kfree_skb_any(msdu); ++ ieee80211_free_txskb(ar->hw, msdu); + return; + } + + if (unlikely(!skb_cb->vif)) { +- dev_kfree_skb_any(msdu); ++ ieee80211_free_txskb(ar->hw, msdu); + return; + } + diff --git a/package/kernel/mac80211/patches/ath11k/0008-wifi-ath11k-Consistently-use-ath11k_vif_to_arvif.patch b/package/kernel/mac80211/patches/ath11k/0008-wifi-ath11k-Consistently-use-ath11k_vif_to_arvif.patch new file mode 100644 index 00000000000000..218b3ac35fc13b --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0008-wifi-ath11k-Consistently-use-ath11k_vif_to_arvif.patch @@ -0,0 +1,316 @@ +From 9476cda44c136089f14f8951ae5197d63e91735c Mon Sep 17 00:00:00 2001 +From: Jeff Johnson +Date: Mon, 21 Aug 2023 07:13:36 -0700 +Subject: [PATCH] wifi: ath11k: Consistently use ath11k_vif_to_arvif() + +Helper function ath11k_vif_to_arvif() exists to retrieve a struct +ath11k_vif from a struct ieee80211_vif. However, in multiple places +this logic is open-coded with inline typecasting. Since the +typecasting prevents the compiler from type-checking the source and +destination, update the driver to consistently use the helper +function. + +No functional changes, compile tested only. + +Signed-off-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230821-ath11k_vif_to_arvif-v1-1-fa2c3b60b5cf@quicinc.com +--- + drivers/net/wireless/ath/ath11k/mac.c | 64 +++++++++++----------- + drivers/net/wireless/ath/ath11k/testmode.c | 2 +- + 2 files changed, 33 insertions(+), 33 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -566,7 +566,7 @@ static void ath11k_get_arvif_iter(void * + struct ieee80211_vif *vif) + { + struct ath11k_vif_iter *arvif_iter = data; +- struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + + if (arvif->vdev_id == arvif_iter->vdev_id) + arvif_iter->arvif = arvif; +@@ -1464,7 +1464,7 @@ static int ath11k_mac_setup_bcn_tmpl_ema + u32 params = 0; + u8 i = 0; + +- tx_arvif = (void *)arvif->vif->mbssid_tx_vif->drv_priv; ++ tx_arvif = ath11k_vif_to_arvif(arvif->vif->mbssid_tx_vif); + + beacons = ieee80211_beacon_get_template_ema_list(tx_arvif->ar->hw, + tx_arvif->vif, 0); +@@ -1520,8 +1520,8 @@ static int ath11k_mac_setup_bcn_tmpl_mbs + struct sk_buff *bcn; + int ret; + +- if (arvif->vif->mbssid_tx_vif) { +- tx_arvif = (void *)arvif->vif->mbssid_tx_vif->drv_priv; ++ if (vif->mbssid_tx_vif) { ++ tx_arvif = ath11k_vif_to_arvif(vif->mbssid_tx_vif); + if (tx_arvif != arvif) { + ar = tx_arvif->ar; + ab = ar->ab; +@@ -1562,7 +1562,7 @@ static int ath11k_mac_setup_bcn_tmpl(str + * non-transmitting interfaces, and results in a crash if sent. + */ + if (vif->mbssid_tx_vif && +- arvif != (void *)vif->mbssid_tx_vif->drv_priv && arvif->is_up) ++ arvif != ath11k_vif_to_arvif(vif->mbssid_tx_vif) && arvif->is_up) + return 0; + + if (vif->bss_conf.ema_ap && vif->mbssid_tx_vif) +@@ -1626,7 +1626,7 @@ static void ath11k_control_beaconing(str + ether_addr_copy(arvif->bssid, info->bssid); + + if (arvif->vif->mbssid_tx_vif) +- tx_arvif = (struct ath11k_vif *)arvif->vif->mbssid_tx_vif->drv_priv; ++ tx_arvif = ath11k_vif_to_arvif(arvif->vif->mbssid_tx_vif); + + ret = ath11k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid, + arvif->bssid, +@@ -1649,7 +1649,7 @@ static void ath11k_mac_handle_beacon_ite + { + struct sk_buff *skb = data; + struct ieee80211_mgmt *mgmt = (void *)skb->data; +- struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + + if (vif->type != NL80211_IFTYPE_STATION) + return; +@@ -1672,7 +1672,7 @@ static void ath11k_mac_handle_beacon_mis + struct ieee80211_vif *vif) + { + u32 *vdev_id = data; +- struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + struct ath11k *ar = arvif->ar; + struct ieee80211_hw *hw = ar->hw; + +@@ -1718,7 +1718,7 @@ static void ath11k_peer_assoc_h_basic(st + struct ieee80211_sta *sta, + struct peer_assoc_params *arg) + { +- struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + u32 aid; + + lockdep_assert_held(&ar->conf_mutex); +@@ -1746,7 +1746,7 @@ static void ath11k_peer_assoc_h_crypto(s + struct ieee80211_bss_conf *info = &vif->bss_conf; + struct cfg80211_chan_def def; + struct cfg80211_bss *bss; +- struct ath11k_vif *arvif = (struct ath11k_vif *)vif->drv_priv; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + const u8 *rsnie = NULL; + const u8 *wpaie = NULL; + +@@ -1804,7 +1804,7 @@ static void ath11k_peer_assoc_h_rates(st + struct ieee80211_sta *sta, + struct peer_assoc_params *arg) + { +- struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + struct wmi_rate_set_arg *rateset = &arg->peer_legacy_rates; + struct cfg80211_chan_def def; + const struct ieee80211_supported_band *sband; +@@ -1867,7 +1867,7 @@ static void ath11k_peer_assoc_h_ht(struc + struct peer_assoc_params *arg) + { + const struct ieee80211_sta_ht_cap *ht_cap = &sta->deflink.ht_cap; +- struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + struct cfg80211_chan_def def; + enum nl80211_band band; + const u8 *ht_mcs_mask; +@@ -2064,7 +2064,7 @@ static void ath11k_peer_assoc_h_vht(stru + struct peer_assoc_params *arg) + { + const struct ieee80211_sta_vht_cap *vht_cap = &sta->deflink.vht_cap; +- struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + struct cfg80211_chan_def def; + enum nl80211_band band; + u16 *vht_mcs_mask; +@@ -2261,7 +2261,7 @@ static void ath11k_peer_assoc_h_he(struc + struct ieee80211_sta *sta, + struct peer_assoc_params *arg) + { +- struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + struct cfg80211_chan_def def; + const struct ieee80211_sta_he_cap *he_cap = &sta->deflink.he_cap; + enum nl80211_band band; +@@ -2584,7 +2584,7 @@ static void ath11k_peer_assoc_h_qos(stru + struct ieee80211_sta *sta, + struct peer_assoc_params *arg) + { +- struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + + switch (arvif->vdev_type) { + case WMI_VDEV_TYPE_AP: +@@ -2747,7 +2747,7 @@ static void ath11k_peer_assoc_h_phymode( + struct ieee80211_sta *sta, + struct peer_assoc_params *arg) + { +- struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + struct cfg80211_chan_def def; + enum nl80211_band band; + const u8 *ht_mcs_mask; +@@ -2933,7 +2933,7 @@ static bool ath11k_mac_vif_recalc_sta_he + struct ieee80211_vif *vif, + struct ieee80211_sta_he_cap *he_cap) + { +- struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + struct ieee80211_he_cap_elem he_cap_elem = {0}; + struct ieee80211_sta_he_cap *cap_band = NULL; + struct cfg80211_chan_def def; +@@ -2995,7 +2995,7 @@ static void ath11k_bss_assoc(struct ieee + struct ieee80211_bss_conf *bss_conf) + { + struct ath11k *ar = hw->priv; +- struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + struct peer_assoc_params peer_arg; + struct ieee80211_sta *ap_sta; + struct ath11k_peer *peer; +@@ -3111,7 +3111,7 @@ static void ath11k_bss_disassoc(struct i + struct ieee80211_vif *vif) + { + struct ath11k *ar = hw->priv; +- struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + int ret; + + lockdep_assert_held(&ar->conf_mutex); +@@ -3160,7 +3160,7 @@ static void ath11k_recalculate_mgmt_rate + struct ieee80211_vif *vif, + struct cfg80211_chan_def *def) + { +- struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + const struct ieee80211_supported_band *sband; + u8 basic_rate_idx; + int hw_rate_code; +@@ -4632,7 +4632,7 @@ static int ath11k_station_disassoc(struc + struct ieee80211_vif *vif, + struct ieee80211_sta *sta) + { +- struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + int ret = 0; + + lockdep_assert_held(&ar->conf_mutex); +@@ -5160,7 +5160,7 @@ static int ath11k_mac_op_sta_set_txpwr(s + struct ieee80211_sta *sta) + { + struct ath11k *ar = hw->priv; +- struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + int ret = 0; + s16 txpwr; + +@@ -5210,7 +5210,7 @@ static void ath11k_mac_op_sta_rc_update( + { + struct ath11k *ar = hw->priv; + struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; +- struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + struct ath11k_peer *peer; + u32 bw, smps; + +@@ -5337,7 +5337,7 @@ static int ath11k_mac_op_conf_tx(struct + const struct ieee80211_tx_queue_params *params) + { + struct ath11k *ar = hw->priv; +- struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + struct wmi_wmm_params_arg *p = NULL; + int ret; + +@@ -6458,7 +6458,7 @@ static int ath11k_mac_setup_vdev_params_ + return 0; + } + +- tx_arvif = (void *)tx_vif->drv_priv; ++ tx_arvif = ath11k_vif_to_arvif(tx_vif); + + if (arvif->vif->bss_conf.nontransmitted) { + if (ar->hw->wiphy != ieee80211_vif_to_wdev(tx_vif)->wiphy) +@@ -7411,7 +7411,7 @@ ath11k_mac_update_vif_chan(struct ath11k + /* TODO: Update ar->rx_channel */ + + for (i = 0; i < n_vifs; i++) { +- arvif = (void *)vifs[i].vif->drv_priv; ++ arvif = ath11k_vif_to_arvif(vifs[i].vif); + + if (WARN_ON(!arvif->is_started)) + continue; +@@ -7453,7 +7453,7 @@ ath11k_mac_update_vif_chan(struct ath11k + + mbssid_tx_vif = arvif->vif->mbssid_tx_vif; + if (mbssid_tx_vif) +- tx_arvif = (struct ath11k_vif *)mbssid_tx_vif->drv_priv; ++ tx_arvif = ath11k_vif_to_arvif(mbssid_tx_vif); + + ret = ath11k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid, + arvif->bssid, +@@ -7549,7 +7549,7 @@ static int ath11k_start_vdev_delay(struc + { + struct ath11k *ar = hw->priv; + struct ath11k_base *ab = ar->ab; +- struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + int ret; + + if (WARN_ON(arvif->is_started)) +@@ -7599,7 +7599,7 @@ ath11k_mac_op_assign_vif_chanctx(struct + { + struct ath11k *ar = hw->priv; + struct ath11k_base *ab = ar->ab; +- struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + int ret; + struct peer_create_params param; + +@@ -7689,7 +7689,7 @@ ath11k_mac_op_unassign_vif_chanctx(struc + { + struct ath11k *ar = hw->priv; + struct ath11k_base *ab = ar->ab; +- struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + struct ath11k_peer *peer; + int ret; + +@@ -8310,7 +8310,7 @@ ath11k_mac_op_set_bitrate_mask(struct ie + struct ieee80211_vif *vif, + const struct cfg80211_bitrate_mask *mask) + { +- struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + struct cfg80211_chan_def def; + struct ath11k_pdev_cap *cap; + struct ath11k *ar = arvif->ar; +@@ -8907,7 +8907,7 @@ static int ath11k_mac_op_remain_on_chann + enum ieee80211_roc_type type) + { + struct ath11k *ar = hw->priv; +- struct ath11k_vif *arvif = (void *)vif->drv_priv; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + struct scan_req_params arg; + int ret; + u32 scan_time_msec; +--- a/drivers/net/wireless/ath/ath11k/testmode.c ++++ b/drivers/net/wireless/ath/ath11k/testmode.c +@@ -350,7 +350,7 @@ static int ath11k_tm_cmd_wmi(struct ath1 + if (ar->ab->fw_mode != ATH11K_FIRMWARE_MODE_FTM && + (tag == WMI_TAG_VDEV_SET_PARAM_CMD || tag == WMI_TAG_UNIT_TEST_CMD)) { + if (vif) { +- arvif = (struct ath11k_vif *)vif->drv_priv; ++ arvif = ath11k_vif_to_arvif(vif); + *ptr = arvif->vdev_id; + } else { + ret = -EINVAL; diff --git a/package/kernel/mac80211/patches/ath11k/0009-wifi-ath11k-Fix-a-few-spelling-errors.patch b/package/kernel/mac80211/patches/ath11k/0009-wifi-ath11k-Fix-a-few-spelling-errors.patch new file mode 100644 index 00000000000000..b093f3e34211ba --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0009-wifi-ath11k-Fix-a-few-spelling-errors.patch @@ -0,0 +1,50 @@ +From d68a283bfc39aeed2a51c67804e014bf4b35c7e1 Mon Sep 17 00:00:00 2001 +From: Jeff Johnson +Date: Tue, 22 Aug 2023 07:50:49 -0700 +Subject: [PATCH] wifi: ath11k: Fix a few spelling errors + +Fix a few issues flagged by 'codespell'. + +Signed-off-by: Jeff Johnson +Acked-by: Randy Dunlap +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230822-ath_spelling-v1-2-8e2698759564@quicinc.com +--- + drivers/net/wireless/ath/ath11k/dp.h | 2 +- + drivers/net/wireless/ath/ath11k/dp_rx.c | 2 +- + drivers/net/wireless/ath/ath11k/dp_tx.c | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/dp.h ++++ b/drivers/net/wireless/ath/ath11k/dp.h +@@ -635,7 +635,7 @@ enum htt_ppdu_stats_tag_type { + * b'24 - status_swap: 1 is to swap status TLV + * b'25 - pkt_swap: 1 is to swap packet TLV + * b'26:31 - rsvd1: reserved for future use +- * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring, ++ * dword1 - b'0:16 - ring_buffer_size: size of buffers referenced by rx ring, + * in byte units. + * Valid only for HW_TO_SW_RING and SW_TO_HW_RING + * - b'16:31 - rsvd2: Reserved for future use +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -3423,7 +3423,7 @@ static int ath11k_dp_rx_h_defrag_reo_rei + ath11k_hal_rx_buf_addr_info_set(msdu0, paddr, cookie, + ab->hw_params.hal_params->rx_buf_rbm); + +- /* Fill mpdu details into reo entrace ring */ ++ /* Fill mpdu details into reo entrance ring */ + srng = &ab->hal.srng_list[ab->dp.reo_reinject_ring.ring_id]; + + spin_lock_bh(&srng->lock); +--- a/drivers/net/wireless/ath/ath11k/dp_tx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_tx.c +@@ -238,7 +238,7 @@ tcl_ring_sel: + spin_unlock_bh(&tcl_ring->lock); + ret = -ENOMEM; + +- /* Checking for available tcl descritors in another ring in ++ /* Checking for available tcl descriptors in another ring in + * case of failure due to full tcl ring now, is better than + * checking this ring earlier for each pkt tx. + * Restart ring selection if some rings are not checked yet. diff --git a/package/kernel/mac80211/patches/ath11k/0010-wifi-ath11k-simplify-the-code-with-module_platform_d.patch b/package/kernel/mac80211/patches/ath11k/0010-wifi-ath11k-simplify-the-code-with-module_platform_d.patch new file mode 100644 index 00000000000000..19873339b23741 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0010-wifi-ath11k-simplify-the-code-with-module_platform_d.patch @@ -0,0 +1,36 @@ +From 749a660b39030bfbacc366cd8670df2ee0e878b2 Mon Sep 17 00:00:00 2001 +From: Yang Yingliang +Date: Fri, 4 Aug 2023 17:12:55 +0800 +Subject: [PATCH] wifi: ath11k: simplify the code with module_platform_driver + +The init/exit() of driver only calls platform_driver_register/unregister, +it can be simpilfied with module_platform_driver. + +Signed-off-by: Yang Yingliang +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230804091255.1347178-1-yangyingliang@huawei.com +--- + drivers/net/wireless/ath/ath11k/ahb.c | 12 +----------- + 1 file changed, 1 insertion(+), 11 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/ahb.c ++++ b/drivers/net/wireless/ath/ath11k/ahb.c +@@ -1306,17 +1306,7 @@ static struct platform_driver ath11k_ahb + .shutdown = ath11k_ahb_shutdown, + }; + +-static int ath11k_ahb_init(void) +-{ +- return platform_driver_register(&ath11k_ahb_driver); +-} +-module_init(ath11k_ahb_init); +- +-static void ath11k_ahb_exit(void) +-{ +- platform_driver_unregister(&ath11k_ahb_driver); +-} +-module_exit(ath11k_ahb_exit); ++module_platform_driver(ath11k_ahb_driver); + + MODULE_DESCRIPTION("Driver support for Qualcomm Technologies 802.11ax WLAN AHB devices"); + MODULE_LICENSE("Dual BSD/GPL"); diff --git a/package/kernel/mac80211/patches/ath11k/0011-wifi-ath11k-fix-Wvoid-pointer-to-enum-cast-warning.patch b/package/kernel/mac80211/patches/ath11k/0011-wifi-ath11k-fix-Wvoid-pointer-to-enum-cast-warning.patch new file mode 100644 index 00000000000000..f42b021375b654 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0011-wifi-ath11k-fix-Wvoid-pointer-to-enum-cast-warning.patch @@ -0,0 +1,29 @@ +From 6763ef191d672ff3c2db0622652d49b0c0a60c4a Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Thu, 10 Aug 2023 11:12:23 +0200 +Subject: [PATCH] wifi: ath11k: fix Wvoid-pointer-to-enum-cast warning + +'hw_rev' is an enum, thus cast of pointer on 64-bit compile test with W=1 +causes: + + h11k/ahb.c:1124:11: error: cast to smaller integer type 'enum ath11k_hw_rev' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] + +Signed-off-by: Krzysztof Kozlowski +Acked-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230810091224.70088-1-krzysztof.kozlowski@linaro.org +--- + drivers/net/wireless/ath/ath11k/ahb.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/wireless/ath/ath11k/ahb.c ++++ b/drivers/net/wireless/ath/ath11k/ahb.c +@@ -1096,7 +1096,7 @@ static int ath11k_ahb_probe(struct platf + return -EINVAL; + } + +- hw_rev = (enum ath11k_hw_rev)of_id->data; ++ hw_rev = (uintptr_t)of_id->data; + + switch (hw_rev) { + case ATH11K_HW_IPQ8074: diff --git a/package/kernel/mac80211/patches/ath11k/0012-wifi-ath11k-Remove-unused-declarations.patch b/package/kernel/mac80211/patches/ath11k/0012-wifi-ath11k-Remove-unused-declarations.patch new file mode 100644 index 00000000000000..c318bbc3213e02 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0012-wifi-ath11k-Remove-unused-declarations.patch @@ -0,0 +1,44 @@ +From adb0b206709f4f2f1256a1ea20619ab98e99f2e7 Mon Sep 17 00:00:00 2001 +From: Yue Haibing +Date: Fri, 11 Aug 2023 18:44:13 +0800 +Subject: [PATCH] wifi: ath11k: Remove unused declarations + +Commit 2c3960c2253d ("ath11k: setup ce tasklet for control path") +declared but never implemented ath11k_ce_map_service_to_pipe(). +Commit e3396b8bddd2 ("ath11k: ce: support different CE configurations") +declared but never implemented ath11k_ce_attr_attach(). +Commit d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") +declared but never implemented ath11k_qmi_event_work()/ath11k_qmi_msg_recv_work(). + +Signed-off-by: Yue Haibing +Acked-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230811104413.33668-1-yuehaibing@huawei.com +--- + drivers/net/wireless/ath/ath11k/ce.h | 3 --- + drivers/net/wireless/ath/ath11k/qmi.h | 2 -- + 2 files changed, 5 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/ce.h ++++ b/drivers/net/wireless/ath/ath11k/ce.h +@@ -203,9 +203,6 @@ int ath11k_ce_alloc_pipes(struct ath11k_ + void ath11k_ce_free_pipes(struct ath11k_base *ab); + int ath11k_ce_get_attr_flags(struct ath11k_base *ab, int ce_id); + void ath11k_ce_poll_send_completed(struct ath11k_base *ab, u8 pipe_id); +-int ath11k_ce_map_service_to_pipe(struct ath11k_base *ab, u16 service_id, +- u8 *ul_pipe, u8 *dl_pipe); +-int ath11k_ce_attr_attach(struct ath11k_base *ab); + void ath11k_ce_get_shadow_config(struct ath11k_base *ab, + u32 **shadow_cfg, u32 *shadow_cfg_len); + void ath11k_ce_stop_shadow_timers(struct ath11k_base *ab); +--- a/drivers/net/wireless/ath/ath11k/qmi.h ++++ b/drivers/net/wireless/ath/ath11k/qmi.h +@@ -514,8 +514,6 @@ struct qmi_wlanfw_wlan_ini_resp_msg_v01 + int ath11k_qmi_firmware_start(struct ath11k_base *ab, + u32 mode); + void ath11k_qmi_firmware_stop(struct ath11k_base *ab); +-void ath11k_qmi_event_work(struct work_struct *work); +-void ath11k_qmi_msg_recv_work(struct work_struct *work); + void ath11k_qmi_deinit_service(struct ath11k_base *ab); + int ath11k_qmi_init_service(struct ath11k_base *ab); + void ath11k_qmi_free_resource(struct ath11k_base *ab); diff --git a/package/kernel/mac80211/patches/ath11k/0013-wifi-ath11k-mhi-add-a-warning-message-for-MHI_CB_EE_.patch b/package/kernel/mac80211/patches/ath11k/0013-wifi-ath11k-mhi-add-a-warning-message-for-MHI_CB_EE_.patch new file mode 100644 index 00000000000000..e1286c9537ce7f --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0013-wifi-ath11k-mhi-add-a-warning-message-for-MHI_CB_EE_.patch @@ -0,0 +1,34 @@ +From 4a93b554cf9fa64faa7cf164c0d32fc3ce67108b Mon Sep 17 00:00:00 2001 +From: Arowa Suliman +Date: Sat, 26 Aug 2023 08:42:42 +0300 +Subject: [PATCH] wifi: ath11k: mhi: add a warning message for MHI_CB_EE_RDDM + crash + +Currently, the ath11k driver does not print a crash signature when a +MHI_CB_EE_RDDM crash happens. Checked by triggering a simulated crash using the +command and checking dmesg for logs: + +echo assert > /sys/kernel/debug/ath11k/../simulate_fw_crash + +Add a warning when firmware crash MHI_CB_EE_RDDM happens. + +Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 + +Signed-off-by: Arowa Suliman +Reviewed-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230714001126.463127-1-arowa@chromium.org +--- + drivers/net/wireless/ath/ath11k/mhi.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/wireless/ath/ath11k/mhi.c ++++ b/drivers/net/wireless/ath/ath11k/mhi.c +@@ -333,6 +333,7 @@ static void ath11k_mhi_op_status_cb(stru + ath11k_warn(ab, "firmware crashed: MHI_CB_SYS_ERROR\n"); + break; + case MHI_CB_EE_RDDM: ++ ath11k_warn(ab, "firmware crashed: MHI_CB_EE_RDDM\n"); + if (!(test_bit(ATH11K_FLAG_UNREGISTERING, &ab->dev_flags))) + queue_work(ab->workqueue_aux, &ab->reset_work); + break; diff --git a/package/kernel/mac80211/patches/ath11k/0014-wifi-ath11k-move-references-from-rsvd2-to-info-field.patch b/package/kernel/mac80211/patches/ath11k/0014-wifi-ath11k-move-references-from-rsvd2-to-info-field.patch new file mode 100644 index 00000000000000..731a763e17ce75 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0014-wifi-ath11k-move-references-from-rsvd2-to-info-field.patch @@ -0,0 +1,75 @@ +From 5bd2ced044bb95029d5c44cf7d23ced73e0fc05b Mon Sep 17 00:00:00 2001 +From: Muna Sinada +Date: Sat, 26 Aug 2023 08:42:46 +0300 +Subject: [PATCH] wifi: ath11k: move references from rsvd2 to info fields + +Remove references to reserved fields and add new info fields for +struct hal_rx_ppdu_end_user_stats. Reserved fields should not be +accessed, therefore existing references to it are to be changed to +referencing specific info fields. + +Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00356-QCAHKSWPL_SILICONZ-1 + +Signed-off-by: Muna Sinada +Acked-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/1692827868-15667-1-git-send-email-quic_msinada@quicinc.com +--- + drivers/net/wireless/ath/ath11k/hal_rx.c | 10 +++++----- + drivers/net/wireless/ath/ath11k/hal_rx.h | 11 ++++++++--- + 2 files changed, 13 insertions(+), 8 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/hal_rx.c ++++ b/drivers/net/wireless/ath/ath11k/hal_rx.c +@@ -814,7 +814,7 @@ ath11k_hal_rx_handle_ofdma_info(void *rx + + rx_user_status->ul_ofdma_user_v0_word0 = __le32_to_cpu(ppdu_end_user->info6); + +- rx_user_status->ul_ofdma_user_v0_word1 = __le32_to_cpu(ppdu_end_user->rsvd2[10]); ++ rx_user_status->ul_ofdma_user_v0_word1 = __le32_to_cpu(ppdu_end_user->info9); + } + + static inline void +@@ -825,11 +825,11 @@ ath11k_hal_rx_populate_byte_count(void * + (struct hal_rx_ppdu_end_user_stats *)rx_tlv; + + rx_user_status->mpdu_ok_byte_count = +- FIELD_GET(HAL_RX_PPDU_END_USER_STATS_RSVD2_6_MPDU_OK_BYTE_COUNT, +- __le32_to_cpu(ppdu_end_user->rsvd2[6])); ++ FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO8_MPDU_OK_BYTE_COUNT, ++ __le32_to_cpu(ppdu_end_user->info7)); + rx_user_status->mpdu_err_byte_count = +- FIELD_GET(HAL_RX_PPDU_END_USER_STATS_RSVD2_8_MPDU_ERR_BYTE_COUNT, +- __le32_to_cpu(ppdu_end_user->rsvd2[8])); ++ FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO9_MPDU_ERR_BYTE_COUNT, ++ __le32_to_cpu(ppdu_end_user->info8)); + } + + static inline void +--- a/drivers/net/wireless/ath/ath11k/hal_rx.h ++++ b/drivers/net/wireless/ath/ath11k/hal_rx.h +@@ -222,8 +222,8 @@ struct hal_rx_ppdu_start { + #define HAL_RX_PPDU_END_USER_STATS_INFO6_TID_BITMAP GENMASK(15, 0) + #define HAL_RX_PPDU_END_USER_STATS_INFO6_TID_EOSP_BITMAP GENMASK(31, 16) + +-#define HAL_RX_PPDU_END_USER_STATS_RSVD2_6_MPDU_OK_BYTE_COUNT GENMASK(24, 0) +-#define HAL_RX_PPDU_END_USER_STATS_RSVD2_8_MPDU_ERR_BYTE_COUNT GENMASK(24, 0) ++#define HAL_RX_PPDU_END_USER_STATS_INFO7_MPDU_OK_BYTE_COUNT GENMASK(24, 0) ++#define HAL_RX_PPDU_END_USER_STATS_INFO8_MPDU_ERR_BYTE_COUNT GENMASK(24, 0) + + struct hal_rx_ppdu_end_user_stats { + __le32 rsvd0[2]; +@@ -236,7 +236,12 @@ struct hal_rx_ppdu_end_user_stats { + __le32 info4; + __le32 info5; + __le32 info6; +- __le32 rsvd2[11]; ++ __le32 rsvd2[5]; ++ __le32 info7; ++ __le32 rsvd3; ++ __le32 info8; ++ __le32 rsvd3[2]; ++ __le32 info9; + } __packed; + + struct hal_rx_ppdu_end_user_stats_ext { diff --git a/package/kernel/mac80211/patches/ath11k/0015-wifi-ath11k-fix-tid-bitmap-is-0-in-peer-rx-mu-stats.patch b/package/kernel/mac80211/patches/ath11k/0015-wifi-ath11k-fix-tid-bitmap-is-0-in-peer-rx-mu-stats.patch new file mode 100644 index 00000000000000..3edc3fc956cfc9 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0015-wifi-ath11k-fix-tid-bitmap-is-0-in-peer-rx-mu-stats.patch @@ -0,0 +1,100 @@ +From 7791487cd16cafd018cba0bf73789111a9f16843 Mon Sep 17 00:00:00 2001 +From: Muna Sinada +Date: Sat, 26 Aug 2023 08:42:46 +0300 +Subject: [PATCH] wifi: ath11k: fix tid bitmap is 0 in peer rx mu stats + +Correct parsing of reading offset for rx tid 16 bit bitmap. Incorrect +offset caused peer rx mu stats tid bitmap to always be zero. This +correction is in the software context and does not affect the +firmware interface. + +Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00356-QCAHKSWPL_SILICONZ-1 + +Signed-off-by: Muna Sinada +Acked-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/1692827868-15667-2-git-send-email-quic_msinada@quicinc.com +--- + drivers/net/wireless/ath/ath11k/hal_rx.c | 10 +++++----- + drivers/net/wireless/ath/ath11k/hal_rx.h | 17 +++++++++-------- + 2 files changed, 14 insertions(+), 13 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/hal_rx.c ++++ b/drivers/net/wireless/ath/ath11k/hal_rx.c +@@ -814,7 +814,7 @@ ath11k_hal_rx_handle_ofdma_info(void *rx + + rx_user_status->ul_ofdma_user_v0_word0 = __le32_to_cpu(ppdu_end_user->info6); + +- rx_user_status->ul_ofdma_user_v0_word1 = __le32_to_cpu(ppdu_end_user->info9); ++ rx_user_status->ul_ofdma_user_v0_word1 = __le32_to_cpu(ppdu_end_user->info10); + } + + static inline void +@@ -826,10 +826,10 @@ ath11k_hal_rx_populate_byte_count(void * + + rx_user_status->mpdu_ok_byte_count = + FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO8_MPDU_OK_BYTE_COUNT, +- __le32_to_cpu(ppdu_end_user->info7)); ++ __le32_to_cpu(ppdu_end_user->info8)); + rx_user_status->mpdu_err_byte_count = + FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO9_MPDU_ERR_BYTE_COUNT, +- __le32_to_cpu(ppdu_end_user->info8)); ++ __le32_to_cpu(ppdu_end_user->info9)); + } + + static inline void +@@ -903,8 +903,8 @@ ath11k_hal_rx_parse_mon_status_tlv(struc + FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO2_AST_INDEX, + __le32_to_cpu(eu_stats->info2)); + ppdu_info->tid = +- ffs(FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO6_TID_BITMAP, +- __le32_to_cpu(eu_stats->info6))) - 1; ++ ffs(FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO7_TID_BITMAP, ++ __le32_to_cpu(eu_stats->info7))) - 1; + ppdu_info->tcp_msdu_count = + FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO4_TCP_MSDU_CNT, + __le32_to_cpu(eu_stats->info4)); +--- a/drivers/net/wireless/ath/ath11k/hal_rx.h ++++ b/drivers/net/wireless/ath/ath11k/hal_rx.h +@@ -149,7 +149,7 @@ struct hal_rx_mon_ppdu_info { + u8 beamformed; + u8 rssi_comb; + u8 rssi_chain_pri20[HAL_RX_MAX_NSS]; +- u8 tid; ++ u16 tid; + u16 ht_flags; + u16 vht_flags; + u16 he_flags; +@@ -219,11 +219,11 @@ struct hal_rx_ppdu_start { + #define HAL_RX_PPDU_END_USER_STATS_INFO5_OTHER_MSDU_CNT GENMASK(15, 0) + #define HAL_RX_PPDU_END_USER_STATS_INFO5_TCP_ACK_MSDU_CNT GENMASK(31, 16) + +-#define HAL_RX_PPDU_END_USER_STATS_INFO6_TID_BITMAP GENMASK(15, 0) +-#define HAL_RX_PPDU_END_USER_STATS_INFO6_TID_EOSP_BITMAP GENMASK(31, 16) ++#define HAL_RX_PPDU_END_USER_STATS_INFO7_TID_BITMAP GENMASK(15, 0) ++#define HAL_RX_PPDU_END_USER_STATS_INFO7_TID_EOSP_BITMAP GENMASK(31, 16) + +-#define HAL_RX_PPDU_END_USER_STATS_INFO7_MPDU_OK_BYTE_COUNT GENMASK(24, 0) +-#define HAL_RX_PPDU_END_USER_STATS_INFO8_MPDU_ERR_BYTE_COUNT GENMASK(24, 0) ++#define HAL_RX_PPDU_END_USER_STATS_INFO8_MPDU_OK_BYTE_COUNT GENMASK(24, 0) ++#define HAL_RX_PPDU_END_USER_STATS_INFO9_MPDU_ERR_BYTE_COUNT GENMASK(24, 0) + + struct hal_rx_ppdu_end_user_stats { + __le32 rsvd0[2]; +@@ -236,12 +236,13 @@ struct hal_rx_ppdu_end_user_stats { + __le32 info4; + __le32 info5; + __le32 info6; +- __le32 rsvd2[5]; + __le32 info7; +- __le32 rsvd3; ++ __le32 rsvd2[4]; + __le32 info8; +- __le32 rsvd3[2]; ++ __le32 rsvd3; + __le32 info9; ++ __le32 rsvd4[2]; ++ __le32 info10; + } __packed; + + struct hal_rx_ppdu_end_user_stats_ext { diff --git a/package/kernel/mac80211/patches/ath11k/100-wifi-ath11k-use-unique-QRTR-instance-ID.patch b/package/kernel/mac80211/patches/ath11k/100-wifi-ath11k-use-unique-QRTR-instance-ID.patch index 39d5a61d5a1ed8..30472b322987d1 100644 --- a/package/kernel/mac80211/patches/ath11k/100-wifi-ath11k-use-unique-QRTR-instance-ID.patch +++ b/package/kernel/mac80211/patches/ath11k/100-wifi-ath11k-use-unique-QRTR-instance-ID.patch @@ -93,7 +93,7 @@ Signed-off-by: Robert Marko default: return "UNKNOWN"; } -@@ -336,27 +366,14 @@ static void ath11k_mhi_op_status_cb(stru +@@ -337,27 +367,14 @@ static void ath11k_mhi_op_status_cb(stru if (!(test_bit(ATH11K_FLAG_UNREGISTERING, &ab->dev_flags))) queue_work(ab->workqueue_aux, &ab->reset_work); break; @@ -138,7 +138,7 @@ Signed-off-by: Robert Marko int ath11k_mhi_register(struct ath11k_pci *ar_pci); --- a/drivers/net/wireless/ath/ath11k/pci.c +++ b/drivers/net/wireless/ath/ath11k/pci.c -@@ -370,13 +370,20 @@ static void ath11k_pci_sw_reset(struct a +@@ -371,13 +371,20 @@ static void ath11k_pci_sw_reset(struct a static void ath11k_pci_init_qmi_ce_config(struct ath11k_base *ab) { struct ath11k_qmi_ce_cfg *cfg = &ab->qmi.ce_cfg; diff --git a/package/kernel/mac80211/patches/ath11k/901-wifi-ath11k-pci-fix-compilation-in-5.16-and-older.patch b/package/kernel/mac80211/patches/ath11k/901-wifi-ath11k-pci-fix-compilation-in-5.16-and-older.patch index 72156563899370..9a0ca80090da8d 100644 --- a/package/kernel/mac80211/patches/ath11k/901-wifi-ath11k-pci-fix-compilation-in-5.16-and-older.patch +++ b/package/kernel/mac80211/patches/ath11k/901-wifi-ath11k-pci-fix-compilation-in-5.16-and-older.patch @@ -15,7 +15,7 @@ Signed-off-by: Robert Marko --- a/drivers/net/wireless/ath/ath11k/pci.c +++ b/drivers/net/wireless/ath/ath11k/pci.c -@@ -458,7 +458,11 @@ static int ath11k_pci_alloc_msi(struct a +@@ -459,7 +459,11 @@ static int ath11k_pci_alloc_msi(struct a pci_read_config_dword(pci_dev, pci_dev->msi_cap + PCI_MSI_ADDRESS_LO, &ab->pci.msi.addr_lo); diff --git a/package/kernel/mac80211/patches/ath11k/902-ath11k-Disable-coldboot-calibration-for-IPQ8074.patch b/package/kernel/mac80211/patches/ath11k/902-ath11k-Disable-coldboot-calibration-for-IPQ8074.patch index 5454fa75e4c62d..cff62eea908ec5 100644 --- a/package/kernel/mac80211/patches/ath11k/902-ath11k-Disable-coldboot-calibration-for-IPQ8074.patch +++ b/package/kernel/mac80211/patches/ath11k/902-ath11k-Disable-coldboot-calibration-for-IPQ8074.patch @@ -8,17 +8,19 @@ so until that is resolved disabled it to allow using the radio. Signed-off-by: Robert Marko --- - drivers/net/wireless/ath/ath11k/core.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + drivers/net/wireless/ath/ath11k/core.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -86,7 +86,7 @@ static const struct ath11k_hw_params ath +@@ -86,8 +86,8 @@ static const struct ath11k_hw_params ath .supports_shadow_regs = false, .idle_ps = false, .supports_sta_ps = false, -- .cold_boot_calib = true, -+ .cold_boot_calib = false, +- .coldboot_cal_mm = true, +- .coldboot_cal_ftm = true, ++ .coldboot_cal_mm = false, ++ .coldboot_cal_ftm = false, .cbcal_restart_fw = true, .fw_mem_mode = 0, .num_vdevs = 16 + 1, diff --git a/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch b/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch index ca77748fd2b3d0..aacbb348399278 100644 --- a/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch +++ b/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch @@ -31,7 +31,7 @@ Signed-off-by: Robert Marko { .hw_rev = ATH11K_HW_IPQ8074, .name = "ipq8074 hw2.0", -@@ -1954,7 +1954,8 @@ static void ath11k_core_reset(struct wor +@@ -1974,7 +1974,8 @@ static void ath11k_core_reset(struct wor static int ath11k_init_hw_params(struct ath11k_base *ab) { const struct ath11k_hw_params *hw_params = NULL; @@ -41,7 +41,7 @@ Signed-off-by: Robert Marko for (i = 0; i < ARRAY_SIZE(ath11k_hw_params); i++) { hw_params = &ath11k_hw_params[i]; -@@ -1970,7 +1971,30 @@ static int ath11k_init_hw_params(struct +@@ -1990,7 +1991,31 @@ static int ath11k_init_hw_params(struct ab->hw_params = *hw_params; @@ -62,7 +62,8 @@ Signed-off-by: Robert Marko + ab->hw_params.fw_mem_mode = 2; + ab->hw_params.num_vdevs = 8; + ab->hw_params.num_peers = 128; -+ ab->hw_params.cold_boot_calib = false; ++ ab->hw_params.coldboot_cal_mm = false; ++ ab->hw_params.coldboot_cal_ftm = false; + } else + ath11k_info(ab, "Unsupported FW memory mode: %u\n", fw_mem_mode); + } diff --git a/package/kernel/mac80211/patches/rt2x00/999-wifi-rt2x00-fix-MT7620-low-RSSI-issue.patch b/package/kernel/mac80211/patches/rt2x00/999-wifi-rt2x00-fix-MT7620-low-RSSI-issue.patch new file mode 100644 index 00000000000000..8f7343d14e30b0 --- /dev/null +++ b/package/kernel/mac80211/patches/rt2x00/999-wifi-rt2x00-fix-MT7620-low-RSSI-issue.patch @@ -0,0 +1,39 @@ +From: Shiji Yang +Date: Sat, 23 Sep 2023 07:51:39 +0800 +Subject: [PATCH] wifi: rt2x00: fix MT7620 low RSSI issue + +On Mediatek vendor driver[1], MT7620 (RT6352) uses different RSSI +base value '-2' compared to the other RT2x00 chips. This patch +introduces the SoC specific base value to fix the low RSSI value +reports on MT7620. + +[1] Found on MT76x2E_MT7620_LinuxAP_V3.0.4.0_P3 ConvertToRssi(). + +Signed-off-by: Shiji Yang +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -875,6 +875,7 @@ static int rt2800_agc_to_rssi(struct rt2 + s8 rssi0 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI0); + s8 rssi1 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI1); + s8 rssi2 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI2); ++ s8 base_val = rt2x00_rt(rt2x00dev, RT6352) ? -2 : -12; + u16 eeprom; + u8 offset0; + u8 offset1; +@@ -899,9 +900,9 @@ static int rt2800_agc_to_rssi(struct rt2 + * If the value in the descriptor is 0, it is considered invalid + * and the default (extremely low) rssi value is assumed + */ +- rssi0 = (rssi0) ? (-12 - offset0 - rt2x00dev->lna_gain - rssi0) : -128; +- rssi1 = (rssi1) ? (-12 - offset1 - rt2x00dev->lna_gain - rssi1) : -128; +- rssi2 = (rssi2) ? (-12 - offset2 - rt2x00dev->lna_gain - rssi2) : -128; ++ rssi0 = (rssi0) ? (base_val - offset0 - rt2x00dev->lna_gain - rssi0) : -128; ++ rssi1 = (rssi1) ? (base_val - offset1 - rt2x00dev->lna_gain - rssi1) : -128; ++ rssi2 = (rssi2) ? (base_val - offset2 - rt2x00dev->lna_gain - rssi2) : -128; + + /* + * mac80211 only accepts a single RSSI value. Calculating the diff --git a/package/kernel/mac80211/patches/subsys/130-disable_auto_vif.patch b/package/kernel/mac80211/patches/subsys/130-disable_auto_vif.patch new file mode 100644 index 00000000000000..9d8f781ac41ffa --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/130-disable_auto_vif.patch @@ -0,0 +1,27 @@ +--- a/net/mac80211/main.c ++++ b/net/mac80211/main.c +@@ -1396,24 +1396,6 @@ int ieee80211_register_hw(struct ieee802 + debugfs_hw_add(local); + rate_control_add_debugfs(local); + +- rtnl_lock(); +- wiphy_lock(hw->wiphy); +- +- /* add one default STA interface if supported */ +- if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_STATION) && +- !ieee80211_hw_check(hw, NO_AUTO_VIF)) { +- struct vif_params params = {0}; +- +- result = ieee80211_if_add(local, "wlan%d", NET_NAME_ENUM, NULL, +- NL80211_IFTYPE_STATION, ¶ms); +- if (result) +- wiphy_warn(local->hw.wiphy, +- "Failed to add default virtual iface\n"); +- } +- +- wiphy_unlock(hw->wiphy); +- rtnl_unlock(); +- + #ifdef CONFIG_INET + local->ifa_notifier.notifier_call = ieee80211_ifa_changed; + result = register_inetaddr_notifier(&local->ifa_notifier); diff --git a/package/kernel/mac80211/patches/subsys/312-wifi-cfg80211-annotate-iftype_data-pointer-with-spar.patch b/package/kernel/mac80211/patches/subsys/312-wifi-cfg80211-annotate-iftype_data-pointer-with-spar.patch new file mode 100644 index 00000000000000..18420a80cf9e84 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/312-wifi-cfg80211-annotate-iftype_data-pointer-with-spar.patch @@ -0,0 +1,467 @@ +From: Johannes Berg +Date: Mon, 28 Aug 2023 09:54:39 +0200 +Subject: [PATCH] wifi: cfg80211: annotate iftype_data pointer with sparse + +There were are a number of cases in mac80211 and iwlwifi (at +least) that used the sband->iftype_data pointer directly, +instead of using the accessors to find the right array entry +to use. + +Make sparse warn when such a thing is done. + +To not have a lot of casts, add two helper functions/macros + + - ieee80211_set_sband_iftype_data() + - for_each_sband_iftype_data() + +Signed-off-by: Johannes Berg +--- + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -5893,8 +5893,9 @@ static void ath11k_mac_setup_he_cap(stru + ar->mac.iftype[NL80211_BAND_2GHZ], + NL80211_BAND_2GHZ); + band = &ar->mac.sbands[NL80211_BAND_2GHZ]; +- band->iftype_data = ar->mac.iftype[NL80211_BAND_2GHZ]; +- band->n_iftype_data = count; ++ _ieee80211_set_sband_iftype_data(band, ++ ar->mac.iftype[NL80211_BAND_2GHZ], ++ count); + } + + if (cap->supported_bands & WMI_HOST_WLAN_5G_CAP) { +@@ -5902,8 +5903,9 @@ static void ath11k_mac_setup_he_cap(stru + ar->mac.iftype[NL80211_BAND_5GHZ], + NL80211_BAND_5GHZ); + band = &ar->mac.sbands[NL80211_BAND_5GHZ]; +- band->iftype_data = ar->mac.iftype[NL80211_BAND_5GHZ]; +- band->n_iftype_data = count; ++ _ieee80211_set_sband_iftype_data(band, ++ ar->mac.iftype[NL80211_BAND_5GHZ], ++ count); + } + + if (cap->supported_bands & WMI_HOST_WLAN_5G_CAP && +@@ -5912,8 +5914,9 @@ static void ath11k_mac_setup_he_cap(stru + ar->mac.iftype[NL80211_BAND_6GHZ], + NL80211_BAND_6GHZ); + band = &ar->mac.sbands[NL80211_BAND_6GHZ]; +- band->iftype_data = ar->mac.iftype[NL80211_BAND_6GHZ]; +- band->n_iftype_data = count; ++ _ieee80211_set_sband_iftype_data(band, ++ ar->mac.iftype[NL80211_BAND_6GHZ], ++ count); + } + } + +--- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c ++++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +@@ -1075,8 +1075,8 @@ static void iwl_init_he_hw_capab(struct + + memcpy(iftype_data, iwl_he_eht_capa, sizeof(iwl_he_eht_capa)); + +- sband->iftype_data = iftype_data; +- sband->n_iftype_data = ARRAY_SIZE(iwl_he_eht_capa); ++ _ieee80211_set_sband_iftype_data(sband, iftype_data, ++ ARRAY_SIZE(iwl_he_eht_capa)); + + for (i = 0; i < sband->n_iftype_data; i++) + iwl_nvm_fixup_sband_iftd(trans, data, sband, &iftype_data[i], +--- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c ++++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c +@@ -1119,8 +1119,7 @@ void mt7915_set_stream_he_caps(struct mt + n = mt7915_init_he_caps(phy, NL80211_BAND_2GHZ, data); + + band = &phy->mt76->sband_2g.sband; +- band->iftype_data = data; +- band->n_iftype_data = n; ++ _ieee80211_set_sband_iftype_data(band, data, n); + } + + if (phy->mt76->cap.has_5ghz) { +@@ -1128,8 +1127,7 @@ void mt7915_set_stream_he_caps(struct mt + n = mt7915_init_he_caps(phy, NL80211_BAND_5GHZ, data); + + band = &phy->mt76->sband_5g.sband; +- band->iftype_data = data; +- band->n_iftype_data = n; ++ _ieee80211_set_sband_iftype_data(band, data, n); + } + + if (phy->mt76->cap.has_6ghz) { +@@ -1137,8 +1135,7 @@ void mt7915_set_stream_he_caps(struct mt + n = mt7915_init_he_caps(phy, NL80211_BAND_6GHZ, data); + + band = &phy->mt76->sband_6g.sband; +- band->iftype_data = data; +- band->n_iftype_data = n; ++ _ieee80211_set_sband_iftype_data(band, data, n); + } + } + +--- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c ++++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c +@@ -196,8 +196,7 @@ void mt7921_set_stream_he_caps(struct mt + n = mt7921_init_he_caps(phy, NL80211_BAND_2GHZ, data); + + band = &phy->mt76->sband_2g.sband; +- band->iftype_data = data; +- band->n_iftype_data = n; ++ _ieee80211_set_sband_iftype_data(band, data, n); + } + + if (phy->mt76->cap.has_5ghz) { +@@ -205,16 +204,14 @@ void mt7921_set_stream_he_caps(struct mt + n = mt7921_init_he_caps(phy, NL80211_BAND_5GHZ, data); + + band = &phy->mt76->sband_5g.sband; +- band->iftype_data = data; +- band->n_iftype_data = n; ++ _ieee80211_set_sband_iftype_data(band, data, n); + + if (phy->mt76->cap.has_6ghz) { + data = phy->iftype[NL80211_BAND_6GHZ]; + n = mt7921_init_he_caps(phy, NL80211_BAND_6GHZ, data); + + band = &phy->mt76->sband_6g.sband; +- band->iftype_data = data; +- band->n_iftype_data = n; ++ _ieee80211_set_sband_iftype_data(band, data, n); + } + } + } +--- a/drivers/net/wireless/mediatek/mt76/mt7996/init.c ++++ b/drivers/net/wireless/mediatek/mt76/mt7996/init.c +@@ -823,8 +823,7 @@ __mt7996_set_stream_he_eht_caps(struct m + n++; + } + +- sband->iftype_data = data; +- sband->n_iftype_data = n; ++ _ieee80211_set_sband_iftype_data(sband, data, n); + } + + void mt7996_set_stream_he_eht_caps(struct mt7996_phy *phy) +--- a/drivers/net/wireless/quantenna/qtnfmac/commands.c ++++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c +@@ -1335,7 +1335,7 @@ static int qtnf_cmd_band_fill_iftype(con + return -EINVAL; + } + +- kfree(band->iftype_data); ++ kfree((__force void *)band->iftype_data); + band->iftype_data = NULL; + band->n_iftype_data = tlv->n_iftype_data; + if (band->n_iftype_data == 0) +@@ -1347,7 +1347,8 @@ static int qtnf_cmd_band_fill_iftype(con + band->n_iftype_data = 0; + return -ENOMEM; + } +- band->iftype_data = iftype_data; ++ ++ _ieee80211_set_sband_iftype_data(band, iftype_data, tlv->n_iftype_data); + + for (i = 0; i < band->n_iftype_data; i++) + qtnf_cmd_conv_iftype(iftype_data++, &tlv->iftype_data[i]); +--- a/drivers/net/wireless/quantenna/qtnfmac/core.c ++++ b/drivers/net/wireless/quantenna/qtnfmac/core.c +@@ -549,7 +549,7 @@ static void qtnf_core_mac_detach(struct + if (!wiphy->bands[band]) + continue; + +- kfree(wiphy->bands[band]->iftype_data); ++ kfree((__force void *)wiphy->bands[band]->iftype_data); + wiphy->bands[band]->n_iftype_data = 0; + + kfree(wiphy->bands[band]->channels); +--- a/drivers/net/wireless/realtek/rtw89/core.c ++++ b/drivers/net/wireless/realtek/rtw89/core.c +@@ -3328,8 +3328,7 @@ static void rtw89_init_he_cap(struct rtw + idx++; + } + +- sband->iftype_data = iftype_data; +- sband->n_iftype_data = idx; ++ _ieee80211_set_sband_iftype_data(sband, iftype_data, idx); + } + + static int rtw89_core_set_supported_band(struct rtw89_dev *rtwdev) +@@ -3374,11 +3373,11 @@ err: + hw->wiphy->bands[NL80211_BAND_5GHZ] = NULL; + hw->wiphy->bands[NL80211_BAND_6GHZ] = NULL; + if (sband_2ghz) +- kfree(sband_2ghz->iftype_data); ++ kfree((__force void *)sband_2ghz->iftype_data); + if (sband_5ghz) +- kfree(sband_5ghz->iftype_data); ++ kfree((__force void *)sband_5ghz->iftype_data); + if (sband_6ghz) +- kfree(sband_6ghz->iftype_data); ++ kfree((__force void *)sband_6ghz->iftype_data); + kfree(sband_2ghz); + kfree(sband_5ghz); + kfree(sband_6ghz); +@@ -3390,11 +3389,11 @@ static void rtw89_core_clr_supported_ban + struct ieee80211_hw *hw = rtwdev->hw; + + if (hw->wiphy->bands[NL80211_BAND_2GHZ]) +- kfree(hw->wiphy->bands[NL80211_BAND_2GHZ]->iftype_data); ++ kfree((__force void *)hw->wiphy->bands[NL80211_BAND_2GHZ]->iftype_data); + if (hw->wiphy->bands[NL80211_BAND_5GHZ]) +- kfree(hw->wiphy->bands[NL80211_BAND_5GHZ]->iftype_data); ++ kfree((__force void *)hw->wiphy->bands[NL80211_BAND_5GHZ]->iftype_data); + if (hw->wiphy->bands[NL80211_BAND_6GHZ]) +- kfree(hw->wiphy->bands[NL80211_BAND_6GHZ]->iftype_data); ++ kfree((__force void *)hw->wiphy->bands[NL80211_BAND_6GHZ]->iftype_data); + kfree(hw->wiphy->bands[NL80211_BAND_2GHZ]); + kfree(hw->wiphy->bands[NL80211_BAND_5GHZ]); + kfree(hw->wiphy->bands[NL80211_BAND_6GHZ]); +--- a/drivers/net/wireless/realtek/rtw89/regd.c ++++ b/drivers/net/wireless/realtek/rtw89/regd.c +@@ -376,7 +376,7 @@ bottom: + return; + + wiphy->bands[NL80211_BAND_6GHZ] = NULL; +- kfree(sband->iftype_data); ++ kfree((__force void *)sband->iftype_data); + kfree(sband); + } + +--- a/drivers/net/wireless/virtual/mac80211_hwsim.c ++++ b/drivers/net/wireless/virtual/mac80211_hwsim.c +@@ -4900,25 +4900,19 @@ static const struct ieee80211_sband_ifty + + static void mac80211_hwsim_sband_capab(struct ieee80211_supported_band *sband) + { +- u16 n_iftype_data; +- +- if (sband->band == NL80211_BAND_2GHZ) { +- n_iftype_data = ARRAY_SIZE(sband_capa_2ghz); +- sband->iftype_data = +- (struct ieee80211_sband_iftype_data *)sband_capa_2ghz; +- } else if (sband->band == NL80211_BAND_5GHZ) { +- n_iftype_data = ARRAY_SIZE(sband_capa_5ghz); +- sband->iftype_data = +- (struct ieee80211_sband_iftype_data *)sband_capa_5ghz; +- } else if (sband->band == NL80211_BAND_6GHZ) { +- n_iftype_data = ARRAY_SIZE(sband_capa_6ghz); +- sband->iftype_data = +- (struct ieee80211_sband_iftype_data *)sband_capa_6ghz; +- } else { +- return; ++ switch (sband->band) { ++ case NL80211_BAND_2GHZ: ++ ieee80211_set_sband_iftype_data(sband, sband_capa_2ghz); ++ break; ++ case NL80211_BAND_5GHZ: ++ ieee80211_set_sband_iftype_data(sband, sband_capa_5ghz); ++ break; ++ case NL80211_BAND_6GHZ: ++ ieee80211_set_sband_iftype_data(sband, sband_capa_6ghz); ++ break; ++ default: ++ break; + } +- +- sband->n_iftype_data = n_iftype_data; + } + + #ifdef CPTCFG_MAC80211_MESH +--- a/include/net/cfg80211.h ++++ b/include/net/cfg80211.h +@@ -415,6 +415,19 @@ struct ieee80211_sta_eht_cap { + u8 eht_ppe_thres[IEEE80211_EHT_PPE_THRES_MAX_LEN]; + }; + ++/* sparse defines __CHECKER__; see Documentation/dev-tools/sparse.rst */ ++#ifdef __CHECKER__ ++/* ++ * This is used to mark the sband->iftype_data pointer which is supposed ++ * to be an array with special access semantics (per iftype), but a lot ++ * of code got it wrong in the past, so with this marking sparse will be ++ * noisy when the pointer is used directly. ++ */ ++# define __iftd __attribute__((noderef, address_space(__iftype_data))) ++#else ++# define __iftd ++#endif /* __CHECKER__ */ ++ + /** + * struct ieee80211_sband_iftype_data - sband data per interface type + * +@@ -548,10 +561,48 @@ struct ieee80211_supported_band { + struct ieee80211_sta_s1g_cap s1g_cap; + struct ieee80211_edmg edmg_cap; + u16 n_iftype_data; +- const struct ieee80211_sband_iftype_data *iftype_data; ++ const struct ieee80211_sband_iftype_data __iftd *iftype_data; + }; + + /** ++ * _ieee80211_set_sband_iftype_data - set sband iftype data array ++ * @sband: the sband to initialize ++ * @iftd: the iftype data array pointer ++ * @n_iftd: the length of the iftype data array ++ * ++ * Set the sband iftype data array; use this where the length cannot ++ * be derived from the ARRAY_SIZE() of the argument, but prefer ++ * ieee80211_set_sband_iftype_data() where it can be used. ++ */ ++static inline void ++_ieee80211_set_sband_iftype_data(struct ieee80211_supported_band *sband, ++ const struct ieee80211_sband_iftype_data *iftd, ++ u16 n_iftd) ++{ ++ sband->iftype_data = (const void __iftd __force *)iftd; ++ sband->n_iftype_data = n_iftd; ++} ++ ++/** ++ * ieee80211_set_sband_iftype_data - set sband iftype data array ++ * @sband: the sband to initialize ++ * @iftd: the iftype data array ++ */ ++#define ieee80211_set_sband_iftype_data(sband, iftd) \ ++ _ieee80211_set_sband_iftype_data(sband, iftd, ARRAY_SIZE(iftd)) ++ ++/** ++ * for_each_sband_iftype_data - iterate sband iftype data entries ++ * @sband: the sband whose iftype_data array to iterate ++ * @i: iterator counter ++ * @iftd: iftype data pointer to set ++ */ ++#define for_each_sband_iftype_data(sband, i, iftd) \ ++ for (i = 0, iftd = (const void __force *)&(sband)->iftype_data[i]; \ ++ i < (sband)->n_iftype_data; \ ++ i++, iftd = (const void __force *)&(sband)->iftype_data[i]) ++ ++/** + * ieee80211_get_sband_iftype_data - return sband data for a given iftype + * @sband: the sband to search for the STA on + * @iftype: enum nl80211_iftype +@@ -562,6 +613,7 @@ static inline const struct ieee80211_sba + ieee80211_get_sband_iftype_data(const struct ieee80211_supported_band *sband, + u8 iftype) + { ++ const struct ieee80211_sband_iftype_data *data; + int i; + + if (WARN_ON(iftype >= NL80211_IFTYPE_MAX)) +@@ -570,10 +622,7 @@ ieee80211_get_sband_iftype_data(const st + if (iftype == NL80211_IFTYPE_AP_VLAN) + iftype = NL80211_IFTYPE_AP; + +- for (i = 0; i < sband->n_iftype_data; i++) { +- const struct ieee80211_sband_iftype_data *data = +- &sband->iftype_data[i]; +- ++ for_each_sband_iftype_data(sband, i, data) { + if (data->types_mask & BIT(iftype)) + return data; + } +--- a/net/mac80211/main.c ++++ b/net/mac80211/main.c +@@ -1055,6 +1055,7 @@ int ieee80211_register_hw(struct ieee802 + supp_he = false; + supp_eht = false; + for (band = 0; band < NUM_NL80211_BANDS; band++) { ++ const struct ieee80211_sband_iftype_data *iftd; + struct ieee80211_supported_band *sband; + + sband = local->hw.wiphy->bands[band]; +@@ -1101,11 +1102,7 @@ int ieee80211_register_hw(struct ieee802 + supp_ht = supp_ht || sband->ht_cap.ht_supported; + supp_vht = supp_vht || sband->vht_cap.vht_supported; + +- for (i = 0; i < sband->n_iftype_data; i++) { +- const struct ieee80211_sband_iftype_data *iftd; +- +- iftd = &sband->iftype_data[i]; +- ++ for_each_sband_iftype_data(sband, i, iftd) { + supp_he = supp_he || iftd->he_cap.has_he; + supp_eht = supp_eht || iftd->eht_cap.has_eht; + } +--- a/net/wireless/chan.c ++++ b/net/wireless/chan.c +@@ -6,7 +6,7 @@ + * + * Copyright 2009 Johannes Berg + * Copyright 2013-2014 Intel Mobile Communications GmbH +- * Copyright 2018-2022 Intel Corporation ++ * Copyright 2018-2023 Intel Corporation + */ + + #include +@@ -1162,8 +1162,7 @@ bool cfg80211_chandef_usable(struct wiph + if (!sband) + return false; + +- for (i = 0; i < sband->n_iftype_data; i++) { +- iftd = &sband->iftype_data[i]; ++ for_each_sband_iftype_data(sband, i, iftd) { + if (!iftd->eht_cap.has_eht) + continue; + +--- a/net/wireless/core.c ++++ b/net/wireless/core.c +@@ -5,7 +5,7 @@ + * Copyright 2006-2010 Johannes Berg + * Copyright 2013-2014 Intel Mobile Communications GmbH + * Copyright 2015-2017 Intel Deutschland GmbH +- * Copyright (C) 2018-2022 Intel Corporation ++ * Copyright (C) 2018-2023 Intel Corporation + */ + + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +@@ -817,6 +817,7 @@ int wiphy_register(struct wiphy *wiphy) + + /* sanity check supported bands/channels */ + for (band = 0; band < NUM_NL80211_BANDS; band++) { ++ const struct ieee80211_sband_iftype_data *iftd; + u16 types = 0; + bool have_he = false; + +@@ -873,14 +874,11 @@ int wiphy_register(struct wiphy *wiphy) + return -EINVAL; + } + +- for (i = 0; i < sband->n_iftype_data; i++) { +- const struct ieee80211_sband_iftype_data *iftd; ++ for_each_sband_iftype_data(sband, i, iftd) { + bool has_ap, has_non_ap; + u32 ap_bits = BIT(NL80211_IFTYPE_AP) | + BIT(NL80211_IFTYPE_P2P_GO); + +- iftd = &sband->iftype_data[i]; +- + if (WARN_ON(!iftd->types_mask)) + return -EINVAL; + if (WARN_ON(types & iftd->types_mask)) +--- a/net/wireless/nl80211.c ++++ b/net/wireless/nl80211.c +@@ -1906,20 +1906,20 @@ static int nl80211_send_band_rateinfo(st + struct nlattr *nl_iftype_data = + nla_nest_start_noflag(msg, + NL80211_BAND_ATTR_IFTYPE_DATA); ++ const struct ieee80211_sband_iftype_data *iftd; + int err; + + if (!nl_iftype_data) + return -ENOBUFS; + +- for (i = 0; i < sband->n_iftype_data; i++) { ++ for_each_sband_iftype_data(sband, i, iftd) { + struct nlattr *iftdata; + + iftdata = nla_nest_start_noflag(msg, i + 1); + if (!iftdata) + return -ENOBUFS; + +- err = nl80211_send_iftype_data(msg, sband, +- &sband->iftype_data[i]); ++ err = nl80211_send_iftype_data(msg, sband, iftd); + if (err) + return err; + diff --git a/package/kernel/mac80211/patches/subsys/320-cfg80211-allow-grace-period-for-DFS-available-after-.patch b/package/kernel/mac80211/patches/subsys/320-cfg80211-allow-grace-period-for-DFS-available-after-.patch new file mode 100644 index 00000000000000..d04b1165bfc676 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/320-cfg80211-allow-grace-period-for-DFS-available-after-.patch @@ -0,0 +1,149 @@ +From: Felix Fietkau +Date: Thu, 14 Sep 2023 13:17:16 +0200 +Subject: [PATCH] cfg80211: allow grace period for DFS available after beacon + shutdown + +Fixes reconfiguring an AP on a DFS channel in non-ETSI regdomain + +Fixes: b35a51c7dd25 ("cfg80211: Make pre-CAC results valid only for ETSI domain") +Signed-off-by: Felix Fietkau +--- + +--- a/include/net/cfg80211.h ++++ b/include/net/cfg80211.h +@@ -175,6 +175,8 @@ enum ieee80211_channel_flags { + * @dfs_state: current state of this channel. Only relevant if radar is required + * on this channel. + * @dfs_state_entered: timestamp (jiffies) when the dfs state was entered. ++ * @dfs_state_last_available: timestamp (jiffies) of the last time when the ++ * channel was available. + * @dfs_cac_ms: DFS CAC time in milliseconds, this is valid for DFS channels. + */ + struct ieee80211_channel { +@@ -191,6 +193,7 @@ struct ieee80211_channel { + int orig_mag, orig_mpwr; + enum nl80211_dfs_state dfs_state; + unsigned long dfs_state_entered; ++ unsigned long dfs_state_last_available; + unsigned int dfs_cac_ms; + }; + +--- a/net/wireless/ap.c ++++ b/net/wireless/ap.c +@@ -30,6 +30,9 @@ static int ___cfg80211_stop_ap(struct cf + if (!wdev->links[link_id].ap.beacon_interval) + return -ENOENT; + ++ cfg80211_update_last_available(wdev->wiphy, ++ &wdev->links[link_id].ap.chandef); ++ + err = rdev_stop_ap(rdev, dev, link_id); + if (!err) { + wdev->conn_owner_nlportid = 0; +@@ -41,9 +44,6 @@ static int ___cfg80211_stop_ap(struct cf + if (notify) + nl80211_send_ap_stopped(wdev, link_id); + +- /* Should we apply the grace period during beaconing interface +- * shutdown also? +- */ + cfg80211_sched_dfs_chan_update(rdev); + } + +--- a/net/wireless/chan.c ++++ b/net/wireless/chan.c +@@ -461,6 +461,8 @@ static void cfg80211_set_chans_dfs_state + + c->dfs_state = dfs_state; + c->dfs_state_entered = jiffies; ++ if (dfs_state == NL80211_DFS_AVAILABLE) ++ c->dfs_state_last_available = jiffies; + } + } + +@@ -873,6 +875,49 @@ static bool cfg80211_get_chans_dfs_avail + return true; + } + ++static void ++__cfg80211_update_last_available(struct wiphy *wiphy, ++ u32 center_freq, ++ u32 bandwidth) ++{ ++ struct ieee80211_channel *c; ++ u32 freq, start_freq, end_freq; ++ ++ start_freq = cfg80211_get_start_freq(center_freq, bandwidth); ++ end_freq = cfg80211_get_end_freq(center_freq, bandwidth); ++ ++ /* ++ * Check entire range of channels for the bandwidth. ++ * If any channel in between is disabled or has not ++ * had gone through CAC return false ++ */ ++ for (freq = start_freq; freq <= end_freq; freq += MHZ_TO_KHZ(20)) { ++ c = ieee80211_get_channel_khz(wiphy, freq); ++ if (!c) ++ return; ++ ++ c->dfs_state_last_available = jiffies; ++ } ++} ++ ++void cfg80211_update_last_available(struct wiphy *wiphy, ++ const struct cfg80211_chan_def *chandef) ++{ ++ int width; ++ ++ width = cfg80211_chandef_get_width(chandef); ++ if (width < 0) ++ return; ++ ++ __cfg80211_update_last_available(wiphy, MHZ_TO_KHZ(chandef->center_freq1), ++ width); ++ if (chandef->width != NL80211_CHAN_WIDTH_80P80) ++ return; ++ ++ __cfg80211_update_last_available(wiphy, MHZ_TO_KHZ(chandef->center_freq2), ++ width); ++} ++ + static bool cfg80211_chandef_dfs_available(struct wiphy *wiphy, + const struct cfg80211_chan_def *chandef) + { +--- a/net/wireless/core.h ++++ b/net/wireless/core.h +@@ -487,6 +487,8 @@ void cfg80211_set_dfs_state(struct wiphy + enum nl80211_dfs_state dfs_state); + + void cfg80211_dfs_channels_update_work(struct work_struct *work); ++void cfg80211_update_last_available(struct wiphy *wiphy, ++ const struct cfg80211_chan_def *chandef); + + unsigned int + cfg80211_chandef_dfs_cac_time(struct wiphy *wiphy, +--- a/net/wireless/mlme.c ++++ b/net/wireless/mlme.c +@@ -915,6 +915,8 @@ void cfg80211_dfs_channels_update_work(s + if (c->dfs_state == NL80211_DFS_UNAVAILABLE) { + time_dfs_update = IEEE80211_DFS_MIN_NOP_TIME_MS; + radar_event = NL80211_RADAR_NOP_FINISHED; ++ timeout = c->dfs_state_entered + ++ msecs_to_jiffies(time_dfs_update); + } else { + if (regulatory_pre_cac_allowed(wiphy) || + cfg80211_any_wiphy_oper_chan(wiphy, c)) +@@ -922,11 +924,10 @@ void cfg80211_dfs_channels_update_work(s + + time_dfs_update = REG_PRE_CAC_EXPIRY_GRACE_MS; + radar_event = NL80211_RADAR_PRE_CAC_EXPIRED; ++ timeout = c->dfs_state_last_available + ++ msecs_to_jiffies(time_dfs_update); + } + +- timeout = c->dfs_state_entered + +- msecs_to_jiffies(time_dfs_update); +- + if (time_after_eq(jiffies, timeout)) { + c->dfs_state = NL80211_DFS_USABLE; + c->dfs_state_entered = jiffies; diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 78f01c119fbfda..9a3597f770c5a7 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2023-08-14 -PKG_SOURCE_VERSION:=b14c2351ddb8601c322576d84029e463d456caef -PKG_MIRROR_HASH:=62b5e157ad525424b6857e77ed373e8d39d03af71b057f8b309d8b293d6eac5f +PKG_SOURCE_DATE:=2023-09-18 +PKG_SOURCE_VERSION:=2afc7285f75dca5a0583fd917285bf33f1429cc6 +PKG_MIRROR_HASH:=2c9556b298246277ac2d65415e4449f98e6d5fdb99e0d0a92262f162df772bbc PKG_MAINTAINER:=Felix Fietkau PKG_USE_NINJA:=0 @@ -310,6 +310,38 @@ define KernelPackage/mt7921e AUTOLOAD:=$(call AutoProbe,mt7921e) endef +define KernelPackage/mt7996e + $(KernelPackage/mt76-default) + TITLE:=MediaTek MT7996E wireless driver + DEPENDS+=@PCI_SUPPORT +kmod-mt76-connac + FILES:= $(PKG_BUILD_DIR)/mt7996/mt7996e.ko + AUTOLOAD:=$(call AutoProbe,mt7996e) +endef + +define KernelPackage/mt7925-common + $(KernelPackage/mt76-default) + TITLE:=MediaTek MT7925 wireless driver common code + HIDDEN:=1 + DEPENDS+=+kmod-mt792x-common +@DRIVER_11AX_SUPPORT +kmod-hwmon-core + FILES:= $(PKG_BUILD_DIR)/mt7925/mt7925-common.ko +endef + +define KernelPackage/mt7925u + $(KernelPackage/mt76-default) + TITLE:=MediaTek MT7925U wireless driver + DEPENDS+=+kmod-mt792x-usb +kmod-mt7925-common + FILES:= $(PKG_BUILD_DIR)/mt7925/mt7925u.ko + AUTOLOAD:=$(call AutoProbe,mt7921u) +endef + +define KernelPackage/mt7925e + $(KernelPackage/mt76-default) + TITLE:=MediaTek MT7925e wireless driver + DEPENDS+=@PCI_SUPPORT +kmod-mt7925-common + FILES:= $(PKG_BUILD_DIR)/mt7925/mt7925e.ko + AUTOLOAD:=$(call AutoProbe,mt7921e) +endef + define Package/mt76-test SECTION:=devel CATEGORY:=Development @@ -418,6 +450,18 @@ endif ifdef CONFIG_PACKAGE_kmod-mt7921e PKG_MAKE_FLAGS += CONFIG_MT7921E=m endif +ifdef CONFIG_PACKAGE_kmod-mt7996e + PKG_MAKE_FLAGS += CONFIG_MT7996E=m +endif +ifdef CONFIG_PACKAGE_kmod-mt7925-common + PKG_MAKE_FLAGS += CONFIG_MT7925_COMMON=m +endif +ifdef CONFIG_PACKAGE_kmod-mt7925u + PKG_MAKE_FLAGS += CONFIG_MT7925U=m +endif +ifdef CONFIG_PACKAGE_kmod-mt7925e + PKG_MAKE_FLAGS += CONFIG_MT7925E=m +endif define Build/Compile +$(KERNEL_MAKE) $(PKG_JOBS) \ @@ -591,8 +635,12 @@ $(eval $(call KernelPackage,mt7921-firmware)) $(eval $(call KernelPackage,mt792x-common)) $(eval $(call KernelPackage,mt792x-usb)) $(eval $(call KernelPackage,mt7921-common)) +$(eval $(call KernelPackage,mt7925-common)) $(eval $(call KernelPackage,mt7921u)) $(eval $(call KernelPackage,mt7921s)) $(eval $(call KernelPackage,mt7921e)) +$(eval $(call KernelPackage,mt7925u)) +$(eval $(call KernelPackage,mt7925e)) +$(eval $(call KernelPackage,mt7996e)) $(eval $(call KernelPackage,mt76)) $(eval $(call BuildPackage,mt76-test)) diff --git a/package/libs/gmp/Makefile b/package/libs/gmp/Makefile index c9f886e7648d88..601e4f804def78 100644 --- a/package/libs/gmp/Makefile +++ b/package/libs/gmp/Makefile @@ -19,6 +19,7 @@ PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 PKG_FIXUP:=autoreconf PKG_LICENSE:=GPL-2.0-or-later +PKG_CPE_ID:=cpe:/a:gmplib:gmp PKG_BUILD_FLAGS:=no-mips16 diff --git a/package/libs/libbpf/Makefile b/package/libs/libbpf/Makefile index 316a56627432e1..a034231138456e 100644 --- a/package/libs/libbpf/Makefile +++ b/package/libs/libbpf/Makefile @@ -18,6 +18,7 @@ PKG_SOURCE_VERSION:=1728e3e4bef0e138ea95ffe62163eb9a6ac6fa32 PKG_ABI_VERSION:=$(firstword $(subst .,$(space),$(PKG_VERSION))) PKG_MAINTAINER:=Tony Ambardar +PKG_CPE_ID:=cpe:/a:libbpf_project:libbpf PKG_BUILD_FLAGS:=no-mips16 PKG_BUILD_PARALLEL:=1 diff --git a/package/libs/libbsd/Makefile b/package/libs/libbsd/Makefile index 1872e3ce30f3b5..6a148a985fd9f2 100644 --- a/package/libs/libbsd/Makefile +++ b/package/libs/libbsd/Makefile @@ -10,6 +10,7 @@ PKG_HASH:=9baa186059ebbf25c06308e9f991fda31f7183c0f24931826d83aa6abd8a0261 PKG_LICENSE:=BSD-4-Clause PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:freedesktop:libbsd PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 diff --git a/package/libs/libnetfilter-conntrack/Makefile b/package/libs/libnetfilter-conntrack/Makefile index 50432e9cd8d27e..97197b4a619cd8 100644 --- a/package/libs/libnetfilter-conntrack/Makefile +++ b/package/libs/libnetfilter-conntrack/Makefile @@ -18,6 +18,7 @@ PKG_HASH:=67bd9df49fe34e8b82144f6dfb93b320f384a8ea59727e92ff8d18b5f4b579a8 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0-or-later PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:netfilter:libnetfilter_conntrack PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 diff --git a/package/libs/libpcap/Makefile b/package/libs/libpcap/Makefile index 107c00aa03165d..d7358e32d036c3 100644 --- a/package/libs/libpcap/Makefile +++ b/package/libs/libpcap/Makefile @@ -18,6 +18,7 @@ PKG_HASH:=ed19a0383fad72e3ad435fd239d7cd80d64916b87269550159d20e47160ebe5f PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:tcpdump:libpcap PKG_ASLR_PIE_REGULAR:=1 diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index 7bee249676fc23..459d367372f749 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openssl -PKG_VERSION:=3.0.10 +PKG_VERSION:=3.0.11 PKG_RELEASE:=1 PKG_BUILD_FLAGS:=no-mips16 gc-sections no-lto @@ -24,7 +24,7 @@ PKG_SOURCE_URL:= \ ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/ \ ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/old/$(PKG_BASE)/ -PKG_HASH:=1761d4f5b13a1028b9b6f3d4b8e17feb0cedc9370f6afe61d7193d2cdce83323 +PKG_HASH:=b3425d3bb4a2218d0697eb41f7fc0cdede016ed19ca49d168b78e8d947887f55 PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=LICENSE diff --git a/package/libs/popt/Makefile b/package/libs/popt/Makefile index ad767b8eede5b4..ba9c82349bb5d7 100644 --- a/package/libs/popt/Makefile +++ b/package/libs/popt/Makefile @@ -15,6 +15,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://ftp.rpm.org/popt/releases/popt-1.x/ PKG_HASH:=c25a4838fc8e4c1c8aacb8bd620edb3084a3d63bf8987fdad3ca2758c63240f9 PKG_LICENSE:=MIT +PKG_CPE_ID:=cpe:/a:popt_project:popt PKG_FIXUP:=autoreconf PKG_REMOVE_FILES:=autogen.sh aclocal.m4 diff --git a/package/libs/sysfsutils/Makefile b/package/libs/sysfsutils/Makefile index ff676308dab5af..b7c9d8cdc14dd8 100644 --- a/package/libs/sysfsutils/Makefile +++ b/package/libs/sysfsutils/Makefile @@ -15,6 +15,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@SF/linux-diag PKG_HASH:=e865de2c1f559fff0d3fc936e660c0efaf7afe662064f2fb97ccad1ec28d208a PKG_MAINTAINER:=Jo-Philipp Wich +PKG_CPE_ID:=cpe:/a:sysfsutils_project:sysfsutils PKG_LICENSE:=LGPL-2.1 PKG_LICENSE_FILES:=COPYING cmd/GPL lib/LGPL diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile index 808432756ab51e..811d745a6fcd62 100644 --- a/package/network/config/netifd/Makefile +++ b/package/network/config/netifd/Makefile @@ -1,13 +1,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=netifd -PKG_RELEASE:=3 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git -PKG_SOURCE_DATE:=2023-08-31 -PKG_SOURCE_VERSION:=1a07f1dff32b3af49e39533e33e8964b59535662 -PKG_MIRROR_HASH:=dc621dd04c3c9631002f929cf10a4620f57af8b0baf614c590bda17957fa6201 +PKG_SOURCE_DATE:=2023-09-19 +PKG_SOURCE_VERSION:=7a58b995fdbecd9beed57e4d66d42cb3cf66aee2 +PKG_MIRROR_HASH:=a460a3b912047f8802eb24bb737084a08dad65b2dd520e5f5e7459379d1fcf8c PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0 diff --git a/package/network/config/netifd/files/lib/netifd/dhcp.script b/package/network/config/netifd/files/lib/netifd/dhcp.script index 6fcf139beba34b..db8deac9e67157 100755 --- a/package/network/config/netifd/files/lib/netifd/dhcp.script +++ b/package/network/config/netifd/files/lib/netifd/dhcp.script @@ -18,13 +18,13 @@ setup_interface () { proto_add_ipv4_address "$ip" "${subnet:-255.255.255.0}" # TODO: apply $broadcast - local ip_net - eval "$(ipcalc.sh "$ip/$mask")";ip_net="$NETWORK" + local ip_net IP PREFIX NETWORK NETMASK BROADCAST + ipcalc "$ip/$mask" && ip_net="$NETWORK" local i for i in $router; do local gw_net - eval "$(ipcalc.sh "$i/$mask")";gw_net="$NETWORK" + ipcalc "$i/$mask" && gw_net="$NETWORK" [ "$ip_net" != "$gw_net" ] && proto_add_ipv4_route "$i" 32 "" "$ip" proto_add_ipv4_route 0.0.0.0 0 "$i" "$ip" diff --git a/package/network/config/netifd/files/sbin/ifup b/package/network/config/netifd/files/sbin/ifup index 15be535bbfc9ee..fbf2fd80c7ea7d 100755 --- a/package/network/config/netifd/files/sbin/ifup +++ b/package/network/config/netifd/files/sbin/ifup @@ -1,7 +1,6 @@ #!/bin/sh ifup_all= -setup_wifi= if_call() { local interface="$1" @@ -14,7 +13,6 @@ case "$0" in *ifdown) modes=down;; *ifup) modes="down up" - setup_wifi=1 ;; *) echo "Invalid command: $0";; esac @@ -25,10 +23,6 @@ while :; do ifup_all=1 shift ;; - -w) - setup_wifi= - shift - ;; *) break ;; @@ -40,7 +34,6 @@ if [ -n "$ifup_all" ]; then for interface in $(ubus -S list 'network.interface.*'); do if_call "${interface##network.interface.}" done - [ -n "$setup_wifi" ] && /sbin/wifi up exit else ubus -S list "network.interface.$1" > /dev/null || { @@ -49,29 +42,3 @@ else } if_call "$1" fi - -if [ -n "$setup_wifi" ] && grep -sq config /etc/config/wireless; then - . /lib/functions.sh - - find_related_radios() { - local wdev wnet - config_get wdev "$1" device - config_get wnet "$1" network - - if [ -n "$wdev" ]; then - for wnet in $wnet; do - if [ "$wnet" = "$network" ]; then - append radio_devs "$wdev" "$N" - fi - done - fi - } - - network="$1" - config_load wireless - config_foreach find_related_radios wifi-iface - - for dev in $(echo "$radio_devs" | sort -u); do - /sbin/wifi up "$dev" - done -fi diff --git a/package/network/ipv6/6rd/Makefile b/package/network/ipv6/6rd/Makefile index e2ca4e12003c53..3ab8198ef312de 100644 --- a/package/network/ipv6/6rd/Makefile +++ b/package/network/ipv6/6rd/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=6rd -PKG_RELEASE:=12 +PKG_RELEASE:=13 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/ipv6/6rd/files/6rd.sh b/package/network/ipv6/6rd/files/6rd.sh index 62a20314d9322b..dad61118fe675a 100644 --- a/package/network/ipv6/6rd/files/6rd.sh +++ b/package/network/ipv6/6rd/files/6rd.sh @@ -40,8 +40,8 @@ proto_6rd_setup() { # Determine the relay prefix. local ip4prefixlen="${ip4prefixlen:-0}" - local ip4prefix - eval "$(ipcalc.sh "$ipaddr/$ip4prefixlen")";ip4prefix=$NETWORK + local ip4prefix IP PREFIX NETWORK NETMASK BROADCAST + ipcalc "$ipaddr/$ip4prefixlen" && ip4prefix="$NETWORK" # Determine our IPv6 address. local ip6subnet=$(6rdcalc "$ip6prefix/$ip6prefixlen" "$ipaddr/$ip4prefixlen") diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index 4272398a927440..e442d0005b90e9 100644 --- a/package/network/services/dnsmasq/Makefile +++ b/package/network/services/dnsmasq/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsmasq PKG_UPSTREAM_VERSION:=2.89 PKG_VERSION:=$(subst test,~~test,$(subst rc,~rc,$(PKG_UPSTREAM_VERSION))) -PKG_RELEASE:=4 +PKG_RELEASE:=6 PKG_SOURCE:=$(PKG_NAME)-$(PKG_UPSTREAM_VERSION).tar.xz PKG_SOURCE_URL:=https://thekelleys.org.uk/dnsmasq/ diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 2a3327b0c6f263..af5ca5822ea8a6 100755 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -1,6 +1,8 @@ #!/bin/sh /etc/rc.common # Copyright (C) 2007-2012 OpenWrt.org +. /lib/functions.sh + START=19 USE_PROCD=1 @@ -509,7 +511,6 @@ dhcp_boot_add() { dhcp_option_add "$cfg" "$networkid" "$force" } - dhcp_add() { local cfg="$1" local dhcp6range="::" @@ -582,12 +583,8 @@ dhcp_add() { nettag="${networkid:+set:${networkid},}" - if [ "$limit" -gt 0 ] ; then - limit=$((limit-1)) - fi - # make sure the DHCP range is not empty - if [ "$dhcpv4" != "disabled" ] && eval "$(ipcalc.sh "${subnet%%/*}" "$netmask" "$start" "$limit")" ; then + if [ "$dhcpv4" != "disabled" ] && ipcalc "${subnet%%/*}" "$netmask" "$start" "$limit" ; then [ "$dynamicdhcpv4" = "0" ] && END="static" xappend "--dhcp-range=$tags$nettag$START,$END,$NETMASK,$leasetime${options:+ $options}" diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 4bc1b94d1f0faa..5537500313e9dc 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -5,13 +5,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2023-06-22 -PKG_SOURCE_VERSION:=599d00be9de2846c6ea18c1487d8329522ade22b -PKG_MIRROR_HASH:=828810c558ea181e45ed0c8b940f5c41e55775e2979a15aed8cf0ab17dd7723c +PKG_SOURCE_DATE:=2023-09-08 +PKG_SOURCE_VERSION:=e5ccbfc69ecf297590341ae8b461edba9d8e964c +PKG_MIRROR_HASH:=fcc6550f46c7f8bbdbf71e63f8f699b9a0878565ad1b90a17855f5ec21283b8f PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause diff --git a/package/network/services/hostapd/files/common.uc b/package/network/services/hostapd/files/common.uc index 74c07855c95848..ccffe3eb436219 100644 --- a/package/network/services/hostapd/files/common.uc +++ b/package/network/services/hostapd/files/common.uc @@ -1,6 +1,6 @@ import * as nl80211 from "nl80211"; import * as rtnl from "rtnl"; -import { readfile } from "fs"; +import { readfile, glob, basename, readlink } from "fs"; const iftypes = { ap: nl80211.const.NL80211_IFTYPE_AP, @@ -94,6 +94,156 @@ function wdev_create(phy, name, data) return null; } +function phy_sysfs_file(phy, name) +{ + return trim(readfile(`/sys/class/ieee80211/${phy}/${name}`)); +} + +function macaddr_split(str) +{ + return map(split(str, ":"), (val) => hex(val)); +} + +function macaddr_join(addr) +{ + return join(":", map(addr, (val) => sprintf("%02x", val))); +} + +function wdev_macaddr(wdev) +{ + return trim(readfile(`/sys/class/net/${wdev}/address`)); +} + +const phy_proto = { + macaddr_init: function(used, options) { + this.macaddr_options = options ?? {}; + this.macaddr_list = {}; + + if (type(used) == "object") + for (let addr in used) + this.macaddr_list[addr] = used[addr]; + else + for (let addr in used) + this.macaddr_list[addr] = -1; + + this.for_each_wdev((wdev) => { + let macaddr = wdev_macaddr(wdev); + this.macaddr_list[macaddr] ??= -1; + }); + + return this.macaddr_list; + }, + + macaddr_generate: function(data) { + let phy = this.name; + let idx = int(data.id ?? 0); + let mbssid = int(data.mbssid ?? 0) > 0; + let num_global = int(data.num_global ?? 1); + let use_global = !mbssid && idx < num_global; + + let base_addr = phy_sysfs_file(phy, "macaddress"); + if (!base_addr) + return null; + + if (!idx && !mbssid) + return base_addr; + + let base_mask = phy_sysfs_file(phy, "address_mask"); + if (!base_mask) + return null; + + if (base_mask == "00:00:00:00:00:00" && idx >= num_global) { + let addrs = split(phy_sysfs_file(phy, "addresses"), "\n"); + + if (idx < length(addrs)) + return addrs[idx]; + + base_mask = "ff:ff:ff:ff:ff:ff"; + } + + let addr = macaddr_split(base_addr); + let mask = macaddr_split(base_mask); + let type; + + if (mbssid) + type = "b5"; + else if (use_global) + type = "add"; + else if (mask[0] > 0) + type = "b1"; + else if (mask[5] < 0xff) + type = "b5"; + else + type = "add"; + + switch (type) { + case "b1": + if (!(addr[0] & 2)) + idx--; + addr[0] |= 2; + addr[0] ^= idx << 2; + break; + case "b5": + if (mbssid) + addr[0] |= 2; + addr[5] ^= idx; + break; + default: + for (let i = 5; i > 0; i--) { + addr[i] += idx; + if (addr[i] < 256) + break; + addr[i] %= 256; + } + break; + } + + return macaddr_join(addr); + }, + + macaddr_next: function(val) { + let data = this.macaddr_options ?? {}; + let list = this.macaddr_list; + + for (let i = 0; i < 32; i++) { + data.id = i; + + let mac = this.macaddr_generate(data); + if (!mac) + return null; + + if (list[mac] != null) + continue; + + list[mac] = val != null ? val : -1; + return mac; + } + }, + + for_each_wdev: function(cb) { + let wdevs = glob(`/sys/class/ieee80211/${this.name}/device/net/*`); + wdevs = map(wdevs, (arg) => basename(arg)); + for (let wdev in wdevs) { + if (basename(readlink(`/sys/class/net/${wdev}/phy80211`)) != this.name) + continue; + + cb(wdev); + } + } +}; + +function phy_open(phy) +{ + let phyidx = readfile(`/sys/class/ieee80211/${phy}/index`); + if (!phyidx) + return null; + + return proto({ + name: phy, + idx: int(phyidx) + }, phy_proto); +} + const vlist_proto = { update: function(values, arg) { let data = this.data; @@ -165,4 +315,4 @@ function vlist_new(cb) { }, vlist_proto); } -export { wdev_remove, wdev_create, is_equal, vlist_new, phy_is_fullmac }; +export { wdev_remove, wdev_create, is_equal, vlist_new, phy_is_fullmac, phy_open }; diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index a0945fdc53ea11..271c1f7becd270 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -632,8 +632,7 @@ hostapd_set_bss_options() { [ -n "$wpa_strict_rekey" ] && append bss_conf "wpa_strict_rekey=$wpa_strict_rekey" "$N" } - set_default nasid "${macaddr//\:}" - append bss_conf "nas_identifier=$nasid" "$N" + [ -n "$nasid" ] && append bss_conf "nas_identifier=$nasid" "$N" [ -n "$acct_interval" ] && \ append bss_conf "radius_acct_interim_interval=$acct_interval" "$N" diff --git a/package/network/services/hostapd/files/hostapd.uc b/package/network/services/hostapd/files/hostapd.uc index 384c5c2eb08d51..5cddb9c268bb69 100644 --- a/package/network/services/hostapd/files/hostapd.uc +++ b/package/network/services/hostapd/files/hostapd.uc @@ -1,6 +1,6 @@ let libubus = require("ubus"); import { open, readfile } from "fs"; -import { wdev_create, wdev_remove, is_equal, vlist_new, phy_is_fullmac } from "common"; +import { wdev_create, wdev_remove, is_equal, vlist_new, phy_is_fullmac, phy_open } from "common"; let ubus = libubus.connect(); @@ -26,7 +26,6 @@ function iface_remove(cfg) if (!cfg || !cfg.bss || !cfg.bss[0] || !cfg.bss[0].ifname) return; - hostapd.remove_iface(cfg.bss[0].ifname); for (let bss in cfg.bss) wdev_remove(bss.ifname); } @@ -41,10 +40,13 @@ channel=${config.radio.channel} for (let i = 0; i < length(config.bss); i++) { let bss = config.bss[i]; let type = i > 0 ? "bss" : "interface"; + let nasid = bss.nasid ?? replace(bss.bssid, ":", ""); str += ` ${type}=${bss.ifname} +bssid=${bss.bssid} ${join("\n", bss.data)} +nas_identifier=${nasid} `; if (start_disabled) str += ` @@ -92,14 +94,14 @@ function iface_add(phy, config, phy_status) let config_inline = iface_gen_config(phy, config, !!phy_status); let bss = config.bss[0]; - let ret = hostapd.add_iface(`bss_config=${bss.ifname}:${config_inline}`); + let ret = hostapd.add_iface(`bss_config=${phy}:${config_inline}`); if (ret < 0) return false; if (!phy_status) return true; - let iface = hostapd.interfaces[bss.ifname]; + let iface = hostapd.interfaces[phy]; if (!iface) return false; @@ -108,8 +110,23 @@ function iface_add(phy, config, phy_status) return iface.start(freq_info) >= 0; } -function iface_restart(phy, config, old_config) +function iface_config_macaddr_list(config) { + let macaddr_list = {}; + for (let i = 0; i < length(config.bss); i++) { + let bss = config.bss[i]; + if (!bss.default_macaddr) + macaddr_list[bss.bssid] = i; + } + + return macaddr_list; +} + +function iface_restart(phydev, config, old_config) +{ + let phy = phydev.name; + + hostapd.remove_iface(phy); iface_remove(old_config); iface_remove(config); @@ -118,6 +135,13 @@ function iface_restart(phy, config, old_config) return; } + phydev.macaddr_init(iface_config_macaddr_list(config)); + for (let i = 0; i < length(config.bss); i++) { + let bss = config.bss[i]; + if (bss.default_macaddr) + bss.bssid = phydev.macaddr_next(); + } + let bss = config.bss[0]; let err = wdev_create(phy, bss.ifname, { mode: "ap" }); if (err) @@ -175,8 +199,65 @@ function bss_reload_psk(bss, config, old_config) hostapd.printf(`Reload WPA PSK file for bss ${config.ifname}: ${ret}`); } -function iface_reload_config(phy, config, old_config) +function remove_file_fields(config) +{ + return filter(config, (line) => !hostapd.data.file_fields[split(line, "=")[0]]); +} + +function bss_remove_file_fields(config) +{ + let new_cfg = {}; + + for (let key in config) + new_cfg[key] = config[key]; + new_cfg.data = remove_file_fields(new_cfg.data); + new_cfg.hash = {}; + for (let key in config.hash) + new_cfg.hash[key] = config.hash[key]; + delete new_cfg.hash.wpa_psk_file; + delete new_cfg.hash.vlan_file; + + return new_cfg; +} + +function bss_config_hash(config) +{ + return hostapd.sha1(remove_file_fields(config) + ""); +} + +function bss_find_existing(config, prev_config, prev_hash) +{ + let hash = bss_config_hash(config.data); + + for (let i = 0; i < length(prev_config.bss); i++) { + if (!prev_hash[i] || hash != prev_hash[i]) + continue; + + prev_hash[i] = null; + return i; + } + + return -1; +} + +function get_config_bss(config, idx) +{ + if (!config.bss[idx]) { + hostapd.printf(`Invalid bss index ${idx}`); + return null; + } + + let ifname = config.bss[idx].ifname; + if (!ifname) + hostapd.printf(`Could not find bss ${config.bss[idx].ifname}`); + + return hostapd.bss[ifname]; +} + +function iface_reload_config(phydev, config, old_config) { + let phy = phydev.name; + if (!old_config || !is_equal(old_config.radio, config.radio)) return false; @@ -186,82 +267,230 @@ function iface_reload_config(phy, config, old_config) if (!old_config.bss || !old_config.bss[0]) return false; - if (config.bss[0].ifname != old_config.bss[0].ifname) - return false; - - let iface_name = config.bss[0].ifname; - let iface = hostapd.interfaces[iface_name]; - if (!iface) + let iface = hostapd.interfaces[phy]; + if (!iface) { + hostapd.printf(`Could not find previous interface ${iface_name}`); return false; + } + let iface_name = old_config.bss[0].ifname; let first_bss = hostapd.bss[iface_name]; - if (!first_bss) + if (!first_bss) { + hostapd.printf(`Could not find bss of previous interface ${iface_name}`); return false; + } - let config_inline = iface_gen_config(phy, config); + let macaddr_list = iface_config_macaddr_list(config); + let bss_list = []; + let bss_list_cfg = []; + let prev_bss_hash = []; + + for (let bss in old_config.bss) { + let hash = bss_config_hash(bss.data); + push(prev_bss_hash, bss_config_hash(bss.data)); + } - bss_reload_psk(first_bss, config.bss[0], old_config.bss[0]); - if (!is_equal(config.bss[0], old_config.bss[0])) { - if (phy_is_fullmac(phy)) + // Step 1: find (possibly renamed) interfaces with the same config + // and store them in the new order (with gaps) + for (let i = 0; i < length(config.bss); i++) { + let prev; + + // For fullmac devices, the first interface needs to be preserved, + // since it's treated as the master + if (!i && phy_is_fullmac(phy)) { + prev = 0; + prev_bss_hash[0] = null; + } else { + prev = bss_find_existing(config.bss[i], old_config, prev_bss_hash); + } + if (prev < 0) + continue; + + let cur_config = config.bss[i]; + let prev_config = old_config.bss[prev]; + + let prev_bss = get_config_bss(old_config, prev); + if (!prev_bss) return false; - if (config.bss[0].bssid != old_config.bss[0].bssid) + // try to preserve MAC address of this BSS by reassigning another + // BSS if necessary + if (cur_config.default_macaddr && + !macaddr_list[prev_config.bssid]) { + macaddr_list[prev_config.bssid] = i; + cur_config.bssid = prev_config.bssid; + } + + bss_list[i] = prev_bss; + bss_list_cfg[i] = old_config.bss[prev]; + } + + if (config.mbssid && !bss_list_cfg[0]) { + hostapd.printf("First BSS changed with MBSSID enabled"); + return false; + } + + // Step 2: if none were found, rename and preserve the first one + if (length(bss_list) == 0) { + // can't change the bssid of the first bss + if (config.bss[0].bssid != old_config.bss[0].bssid) { + if (!config.bss[0].default_macaddr) { + hostapd.printf(`BSSID of first interface changed: ${lc(old_config.bss[0].bssid)} -> ${lc(config.bss[0].bssid)}`); + return false; + } + + config.bss[0].bssid = old_config.bss[0].bssid; + } + + let prev_bss = get_config_bss(old_config, 0); + if (!prev_bss) return false; - hostapd.printf(`Reload config for bss '${config.bss[0].ifname}' on phy '${phy}'`); - if (first_bss.set_config(config_inline, 0) < 0) { - hostapd.printf(`Failed to set config`); + macaddr_list[config.bss[0].bssid] = 0; + bss_list[0] = prev_bss; + bss_list_cfg[0] = old_config.bss[0]; + prev_bss_hash[0] = null; + } + + // Step 3: delete all unused old interfaces + for (let i = 0; i < length(prev_bss_hash); i++) { + if (!prev_bss_hash[i]) + continue; + + let prev_bss = get_config_bss(old_config, i); + if (!prev_bss) return false; - } + + let ifname = old_config.bss[i].ifname; + hostapd.printf(`Remove bss '${ifname}' on phy '${phy}'`); + prev_bss.delete(); + wdev_remove(ifname); } - let new_cfg = array_to_obj(config.bss, "ifname", 1); - let old_cfg = array_to_obj(old_config.bss, "ifname", 1); + // Step 4: rename preserved interfaces, use temporary name on duplicates + let rename_list = []; + for (let i = 0; i < length(bss_list); i++) { + if (!bss_list[i]) + continue; + + let old_ifname = bss_list_cfg[i].ifname; + let new_ifname = config.bss[i].ifname; + if (old_ifname == new_ifname) + continue; - for (let name in old_cfg) { - let bss = hostapd.bss[name]; - if (!bss) { - hostapd.printf(`bss '${name}' not found`); + if (hostapd.bss[new_ifname]) { + new_ifname = "tmp_" + substr(hostapd.sha1(new_ifname), 0, 8); + push(rename_list, i); + } + + hostapd.printf(`Rename bss ${old_ifname} to ${new_ifname}`); + if (!bss_list[i].rename(new_ifname)) { + hostapd.printf(`Failed to rename bss ${old_ifname} to ${new_ifname}`); return false; } - if (!new_cfg[name]) { - hostapd.printf(`Remove bss '${name}' on phy '${phy}'`); - bss.delete(); - wdev_remove(name); - continue; + bss_list_cfg[i].ifname = new_ifname; + } + + // Step 5: rename interfaces with temporary names + for (let i in rename_list) { + let new_ifname = config.bss[i].ifname; + if (!bss_list[i].rename(new_ifname)) { + hostapd.printf(`Failed to rename bss to ${new_ifname}`); + return false; } + bss_list_cfg[i].ifname = new_ifname; + } - let new_cfg_data = new_cfg[name]; - delete new_cfg[name]; + // Step 6: assign BSSID for newly created interfaces + let macaddr_data = { + num_global: config.num_global_macaddr ?? 1, + mbssid: config.mbssid ?? 0, + }; + macaddr_list = phydev.macaddr_init(macaddr_list, macaddr_data); + for (let i = 0; i < length(config.bss); i++) { + if (bss_list[i]) + continue; + let bsscfg = config.bss[i]; - if (is_equal(old_cfg[name], new_cfg_data)) + let mac_idx = macaddr_list[bsscfg.bssid]; + if (mac_idx < 0) + macaddr_list[bsscfg.bssid] = i; + if (mac_idx == i) continue; - hostapd.printf(`Reload config for bss '${name}' on phy '${phy}'`); - let idx = find_array_idx(config.bss, "ifname", name); - if (idx < 0) { - hostapd.printf(`bss index not found`); - return false; + // statically assigned bssid of the new interface is in conflict + // with the bssid of a reused interface. reassign the reused interface + if (!bsscfg.default_macaddr) { + // can't update bssid of the first BSS, need to restart + if (!mac_idx < 0) + return false; + + bsscfg = config.bss[mac_idx]; } - if (bss.set_config(config_inline, idx) < 0) { - hostapd.printf(`Failed to set config`); + let addr = phydev.macaddr_next(i); + if (!addr) { + hostapd.printf(`Failed to generate mac address for phy ${phy}`); return false; } + bsscfg.bssid = addr; } - for (let name in new_cfg) { - hostapd.printf(`Add bss '${name}' on phy '${phy}'`); + let config_inline = iface_gen_config(phy, config); + + // Step 7: fill in the gaps with new interfaces + for (let i = 0; i < length(config.bss); i++) { + let ifname = config.bss[i].ifname; + let bss = bss_list[i]; - let idx = find_array_idx(config.bss, "ifname", name); - if (idx < 0) { - hostapd.printf(`bss index not found`); + if (bss) + continue; + + hostapd.printf(`Add bss ${ifname} on phy ${phy}`); + bss_list[i] = iface.add_bss(config_inline, i); + if (!bss_list[i]) { + hostapd.printf(`Failed to add new bss ${ifname} on phy ${phy}`); return false; } + } + + // Step 8: update interface bss order + if (!iface.set_bss_order(bss_list)) { + hostapd.printf(`Failed to update BSS order on phy '${phy}'`); + return false; + } + + // Step 9: update config + for (let i = 0; i < length(config.bss); i++) { + if (!bss_list_cfg[i]) + continue; + + let ifname = config.bss[i].ifname; + let bss = bss_list[i]; + + if (is_equal(config.bss[i], bss_list_cfg[i])) + continue; + + if (is_equal(bss_remove_file_fields(config.bss[i]), + bss_remove_file_fields(bss_list_cfg[i]))) { + hostapd.printf(`Update config data files for bss ${ifname}`); + if (bss.set_config(config_inline, i, true) < 0) { + hostapd.printf(`Could not update config data files for bss ${ifname}`); + return false; + } else { + bss.ctrl("RELOAD_WPA_PSK"); + continue; + } + } + + bss_reload_psk(bss, config.bss[i], bss_list_cfg[i]); + if (is_equal(config.bss[i], bss_list_cfg[i])) + continue; - if (iface.add_bss(config_inline, idx) < 0) { - hostapd.printf(`Failed to add bss`); + hostapd.printf(`Reload config for bss '${config.bss[0].ifname}' on phy '${phy}'`); + if (bss.set_config(config_inline, i) < 0) { + hostapd.printf(`Failed to set config for bss ${ifname}`); return false; } } @@ -269,23 +498,47 @@ function iface_reload_config(phy, config, old_config) return true; } +function iface_update_supplicant_macaddr(phy, config) +{ + let macaddr_list = []; + for (let i = 0; i < length(config.bss); i++) + push(macaddr_list, config.bss[i].bssid); + ubus.call("wpa_supplicant", "phy_set_macaddr_list", { phy: phy, macaddr: macaddr_list }); +} + function iface_set_config(phy, config) { let old_config = hostapd.data.config[phy]; hostapd.data.config[phy] = config; - if (!config) + if (!config) { + hostapd.remove_iface(phy); return iface_remove(old_config); + } - let ret = iface_reload_config(phy, config, old_config); - if (ret) { - hostapd.printf(`Reloaded settings for phy ${phy}`); - return 0; + let phydev = phy_open(phy); + if (!phydev) { + hostapd.printf(`Failed to open phy ${phy}`); + return false; + } + + try { + let ret = iface_reload_config(phydev, config, old_config); + if (ret) { + iface_update_supplicant_macaddr(phy, config); + hostapd.printf(`Reloaded settings for phy ${phy}`); + return 0; + } + } catch (e) { + hostapd.printf(`Error reloading config: ${e}\n${e.stacktrace[0].context}`); } hostapd.printf(`Restart interface for phy ${phy}`); - return iface_restart(phy, config, old_config); + let ret = iface_restart(phydev, config, old_config); + iface_update_supplicant_macaddr(phy, config); + + return ret; } function config_add_bss(config, name) @@ -332,16 +585,28 @@ function iface_load_config(filename) continue; } + if (val[0] == "#num_global_macaddr" || + val[0] == "mbssid") + config[val[0]] = int(val[1]); + push(config.radio.data, line); } while ((line = trim(f.read("line"))) != null) { + if (line == "#default_macaddr") + bss.default_macaddr = true; + let val = split(line, "=", 2); if (!val[0]) continue; - if (val[0] == "bssid") - bss.bssid = val[1]; + if (val[0] == "bssid") { + bss.bssid = lc(val[1]); + continue; + } + + if (val[0] == "nas_identifier") + bss.nasid = val[1]; if (val[0] == "bss") { bss = config_add_bss(config, val[1]); @@ -358,27 +623,33 @@ function iface_load_config(filename) return config; } +function ex_wrap(func) { + return (req) => { + try { + let ret = func(req); + return ret; + } catch(e) { + hostapd.printf(`Exception in ubus function: ${e}\n${e.stacktrace[0].context}`); + } + return libubus.STATUS_UNKNOWN_ERROR; + }; +} let main_obj = { reload: { args: { phy: "", }, - call: function(req) { - try { - let phy_list = req.args.phy ? [ req.args.phy ] : keys(hostapd.data.config); - for (let phy_name in phy_list) { - let phy = hostapd.data.config[phy_name]; - let config = iface_load_config(phy.orig_file); - iface_set_config(phy_name, config); - } - } catch(e) { - hostapd.printf(`Error reloading config: ${e}\n${e.stacktrace[0].context}`); - return libubus.STATUS_INVALID_ARGUMENT; + call: ex_wrap(function(req) { + let phy_list = req.args.phy ? [ req.args.phy ] : keys(hostapd.data.config); + for (let phy_name in phy_list) { + let phy = hostapd.data.config[phy_name]; + let config = iface_load_config(phy.orig_file); + iface_set_config(phy_name, config); } return 0; - } + }) }, apsta_state: { args: { @@ -389,7 +660,7 @@ let main_obj = { csa: true, csa_count: 0, }, - call: function(req) { + call: ex_wrap(function(req) { if (req.args.up == null || !req.args.phy) return libubus.STATUS_INVALID_ARGUMENT; @@ -398,7 +669,7 @@ let main_obj = { if (!config || !config.bss || !config.bss[0] || !config.bss[0].ifname) return 0; - let iface = hostapd.interfaces[config.bss[0].ifname]; + let iface = hostapd.interfaces[phy]; if (!iface) return 0; @@ -419,14 +690,34 @@ let main_obj = { freq_info.csa_count = req.args.csa_count ?? 10; ret = iface.switch_channel(freq_info); } else { - iface.stop(); ret = iface.start(freq_info); } if (!ret) return libubus.STATUS_UNKNOWN_ERROR; return 0; - } + }) + }, + config_get_macaddr_list: { + args: { + phy: "" + }, + call: ex_wrap(function(req) { + let phy = req.args.phy; + if (!phy) + return libubus.STATUS_INVALID_ARGUMENT; + + let ret = { + macaddr: [], + }; + + let config = hostapd.data.config[phy]; + if (!config) + return ret; + + ret.macaddr = map(config.bss, (bss) => bss.bssid); + return ret; + }) }, config_set: { args: { @@ -434,7 +725,7 @@ let main_obj = { config: "", prev_config: "", }, - call: function(req) { + call: ex_wrap(function(req) { let phy = req.args.phy; let file = req.args.config; let prev_file = req.args.prev_config; @@ -442,34 +733,29 @@ let main_obj = { if (!phy) return libubus.STATUS_INVALID_ARGUMENT; - try { - if (prev_file && !hostapd.data.config[phy]) { - let config = iface_load_config(prev_file); - if (config) - config.radio.data = []; - hostapd.data.config[phy] = config; - } + if (prev_file && !hostapd.data.config[phy]) { + let config = iface_load_config(prev_file); + if (config) + config.radio.data = []; + hostapd.data.config[phy] = config; + } - let config = iface_load_config(file); + let config = iface_load_config(file); - hostapd.printf(`Set new config for phy ${phy}: ${file}`); - iface_set_config(phy, config); - } catch(e) { - hostapd.printf(`Error loading config: ${e}\n${e.stacktrace[0].context}`); - return libubus.STATUS_INVALID_ARGUMENT; - } + hostapd.printf(`Set new config for phy ${phy}: ${file}`); + iface_set_config(phy, config); return { pid: hostapd.getpid() }; - } + }) }, config_add: { args: { iface: "", config: "", }, - call: function(req) { + call: ex_wrap(function(req) { if (!req.args.iface || !req.args.config) return libubus.STATUS_INVALID_ARGUMENT; @@ -479,19 +765,19 @@ let main_obj = { return { pid: hostapd.getpid() }; - } + }) }, config_remove: { args: { iface: "" }, - call: function(req) { + call: ex_wrap(function(req) { if (!req.args.iface) return libubus.STATUS_INVALID_ARGUMENT; hostapd.remove_iface(req.args.iface); return 0; - } + }) }, }; diff --git a/package/network/services/hostapd/files/wdev.uc b/package/network/services/hostapd/files/wdev.uc index 78037a9d27131b..8a031b40b9ee2d 100644 --- a/package/network/services/hostapd/files/wdev.uc +++ b/package/network/services/hostapd/files/wdev.uc @@ -1,11 +1,14 @@ #!/usr/bin/env ucode 'use strict'; -import { vlist_new, is_equal, wdev_create, wdev_remove } from "/usr/share/hostap/common.uc"; +import { vlist_new, is_equal, wdev_create, wdev_remove, phy_open } from "/usr/share/hostap/common.uc"; import { readfile, writefile, basename, readlink, glob } from "fs"; +let libubus = require("ubus"); let keep_devices = {}; let phy = shift(ARGV); -let new_config = shift(ARGV); +let command = shift(ARGV); +let phydev; + const mesh_params = [ "mesh_retry_timeout", "mesh_confirm_timeout", "mesh_holding_timeout", "mesh_max_peer_links", "mesh_max_retries", "mesh_ttl", "mesh_element_ttl", "mesh_hwmp_max_preq_retries", @@ -33,6 +36,11 @@ function iface_start(wdev) system([ "ip", "link", "set", "dev", ifname, "down" ]); wdev_remove(ifname); } + let wdev_config = {}; + for (let key in wdev) + wdev_config[key] = wdev[key]; + if (!wdev_config.macaddr && wdev.mode != "monitor") + wdev_config.macaddr = phydev.macaddr_next(); wdev_create(phy, ifname, wdev); system([ "ip", "link", "set", "dev", ifname, "up" ]); if (wdev.freq) @@ -114,43 +122,86 @@ function add_existing(phy, config) } } +function usage() +{ + warn(`Usage: ${basename(sourcepath())} [] -let statefile = `/var/run/wdev-${phy}.json`; - -for (let dev in ARGV) - keep_devices[dev] = true; - -if (!phy || !new_config) { - warn(`Usage: ${basename(sourcepath())} [ [ - get phy MAC address for vif index +`); exit(1); } -if (!readfile(`/sys/class/ieee80211/${phy}/index`)) { +const commands = { + set_config: function(args) { + let statefile = `/var/run/wdev-${phy}.json`; + + let new_config = shift(args); + for (let dev in ARGV) + keep_devices[dev] = true; + + if (!new_config) + usage(); + + new_config = json(new_config); + if (!new_config) { + warn("Invalid configuration\n"); + exit(1); + } + + let old_config = readfile(statefile); + if (old_config) + old_config = json(old_config); + + let config = vlist_new(iface_cb); + if (type(old_config) == "object") + config.data = old_config; + + add_existing(phy, config.data); + add_ifname(config.data); + drop_inactive(config.data); + + let ubus = libubus.connect(); + let data = ubus.call("hostapd", "config_get_macaddr_list", { phy: phy }); + let macaddr_list = []; + if (type(data) == "object" && data.macaddr) + macaddr_list = data.macaddr; + ubus.disconnect(); + phydev.macaddr_init(macaddr_list); + + add_ifname(new_config); + config.update(new_config); + + drop_inactive(config.data); + delete_ifname(config.data); + writefile(statefile, sprintf("%J", config.data)); + }, + get_macaddr: function(args) { + let data = {}; + + for (let arg in args) { + arg = split(arg, "=", 2); + data[arg[0]] = arg[1]; + } + + let macaddr = phydev.macaddr_generate(data); + if (!macaddr) { + warn(`Could not get MAC address for phy ${phy}\n`); + exit(1); + } + + print(macaddr + "\n"); + }, +}; + +if (!phy || !command | !commands[command]) + usage(); + +phydev = phy_open(phy); +if (!phydev) { warn(`PHY ${phy} does not exist\n`); exit(1); } -new_config = json(new_config); -if (!new_config) { - warn("Invalid configuration\n"); - exit(1); -} - -let old_config = readfile(statefile); -if (old_config) - old_config = json(old_config); - -let config = vlist_new(iface_cb); -if (type(old_config) == "object") - config.data = old_config; - -add_existing(phy, config.data); -add_ifname(config.data); -drop_inactive(config.data); - -add_ifname(new_config); -config.update(new_config); - -drop_inactive(config.data); -delete_ifname(config.data); -writefile(statefile, sprintf("%J", config.data)); +commands[command](ARGV); diff --git a/package/network/services/hostapd/files/wpa_supplicant.uc b/package/network/services/hostapd/files/wpa_supplicant.uc index f8a3fcb52531c0..cb5f41b1af3ac0 100644 --- a/package/network/services/hostapd/files/wpa_supplicant.uc +++ b/package/network/services/hostapd/files/wpa_supplicant.uc @@ -1,11 +1,12 @@ let libubus = require("ubus"); import { open, readfile } from "fs"; -import { wdev_create, wdev_remove, is_equal, vlist_new } from "common"; +import { wdev_create, wdev_remove, is_equal, vlist_new, phy_open } from "common"; let ubus = libubus.connect(); wpas.data.config = {}; wpas.data.iface_phy = {}; +wpas.data.macaddr_list = {}; function iface_stop(iface) { @@ -20,16 +21,23 @@ function iface_stop(iface) iface.running = false; } -function iface_start(phy, iface) +function iface_start(phydev, iface, macaddr_list) { + let phy = phydev.name; + if (iface.running) return; let ifname = iface.config.iface; + let wdev_config = {}; + for (let field in iface.config) + wdev_config[field] = iface.config[field]; + if (!wdev_config.macaddr) + wdev_config.macaddr = phydev.macaddr_next(); wpas.data.iface_phy[ifname] = phy; wdev_remove(ifname); - let ret = wdev_create(phy, ifname, iface.config); + let ret = wdev_create(phy, ifname, wdev_config); if (ret) wpas.printf(`Failed to create device ${ifname}: ${ret}`); wpas.add_iface(iface.config); @@ -78,9 +86,22 @@ function set_config(phy_name, config_list) function start_pending(phy_name) { let phy = wpas.data.config[phy_name]; + let ubus = wpas.data.ubus; + + if (!phy || !phy.data) + return; + + let phydev = phy_open(phy_name); + if (!phydev) { + wpas.printf(`Could not open phy ${phy_name}`); + return; + } + + let macaddr_list = wpas.data.macaddr_list[phy_name]; + phydev.macaddr_init(macaddr_list); for (let ifname in phy.data) - iface_start(phy_name, phy.data[ifname]); + iface_start(phydev, phy.data[ifname]); } let main_obj = { @@ -111,6 +132,20 @@ let main_obj = { return 0; } }, + phy_set_macaddr_list: { + args: { + phy: "", + macaddr: [], + }, + call: function(req) { + let phy = req.args.phy; + if (!phy) + return libubus.STATUS_INVALID_ARGUMENT; + + wpas.data.macaddr_list[phy] = req.args.macaddr; + return 0; + } + }, phy_status: { args: { phy: "" diff --git a/package/network/services/hostapd/files/wpad_acl.json b/package/network/services/hostapd/files/wpad_acl.json index c77ccd8ea0c0bb..d00fd945ba5824 100644 --- a/package/network/services/hostapd/files/wpad_acl.json +++ b/package/network/services/hostapd/files/wpad_acl.json @@ -3,6 +3,12 @@ "access": { "service": { "methods": [ "event" ] + }, + "wpa_supplicant": { + "methods": [ "phy_set_state", "phy_set_macaddr_list", "phy_status" ] + }, + "hostapd": { + "methods": [ "apsta_state" ] } }, "publish": [ "hostapd", "hostapd.*", "wpa_supplicant", "wpa_supplicant.*" ], diff --git a/package/network/services/hostapd/patches/011-mesh-use-deterministic-channel-on-channel-switch.patch b/package/network/services/hostapd/patches/011-mesh-use-deterministic-channel-on-channel-switch.patch index 9b11f0e8031033..07b7a5971d3e00 100644 --- a/package/network/services/hostapd/patches/011-mesh-use-deterministic-channel-on-channel-switch.patch +++ b/package/network/services/hostapd/patches/011-mesh-use-deterministic-channel-on-channel-switch.patch @@ -29,7 +29,7 @@ Signed-off-by: Markus Theil enum dfs_channel_type { -@@ -521,9 +522,14 @@ dfs_get_valid_channel(struct hostapd_ifa +@@ -526,9 +527,14 @@ dfs_get_valid_channel(struct hostapd_ifa int num_available_chandefs; int chan_idx, chan_idx2; int sec_chan_idx_80p80 = -1; @@ -44,7 +44,7 @@ Signed-off-by: Markus Theil wpa_printf(MSG_DEBUG, "DFS: Selecting random channel"); *secondary_channel = 0; *oper_centr_freq_seg0_idx = 0; -@@ -543,8 +549,20 @@ dfs_get_valid_channel(struct hostapd_ifa +@@ -548,8 +554,20 @@ dfs_get_valid_channel(struct hostapd_ifa if (num_available_chandefs == 0) return NULL; @@ -68,7 +68,7 @@ Signed-off-by: Markus Theil if (!chan) { --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -10977,6 +10977,10 @@ static int nl80211_switch_channel(void * +@@ -11017,6 +11017,10 @@ static int nl80211_switch_channel(void * if (ret) goto error; diff --git a/package/network/services/hostapd/patches/021-fix-sta-add-after-previous-connection.patch b/package/network/services/hostapd/patches/021-fix-sta-add-after-previous-connection.patch index 4ee43b5186a5d2..edf599e3e282f3 100644 --- a/package/network/services/hostapd/patches/021-fix-sta-add-after-previous-connection.patch +++ b/package/network/services/hostapd/patches/021-fix-sta-add-after-previous-connection.patch @@ -1,6 +1,6 @@ --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -4601,6 +4601,13 @@ static int add_associated_sta(struct hos +@@ -4621,6 +4621,13 @@ static int add_associated_sta(struct hos * drivers to accept the STA parameter configuration. Since this is * after a new FT-over-DS exchange, a new TK has been derived, so key * reinstallation is not a concern for this case. @@ -14,7 +14,7 @@ */ wpa_printf(MSG_DEBUG, "Add associated STA " MACSTR " (added_unassoc=%d auth_alg=%u ft_over_ds=%u reassoc=%d authorized=%d ft_tk=%d fils_tk=%d)", -@@ -4614,7 +4621,8 @@ static int add_associated_sta(struct hos +@@ -4634,7 +4641,8 @@ static int add_associated_sta(struct hos (!(sta->flags & WLAN_STA_AUTHORIZED) || (reassoc && sta->ft_over_ds && sta->auth_alg == WLAN_AUTH_FT) || (!wpa_auth_sta_ft_tk_already_set(sta->wpa_sm) && diff --git a/package/network/services/hostapd/patches/030-driver_nl80211-rewrite-neigh-code-to-not-depend-on-l.patch b/package/network/services/hostapd/patches/030-driver_nl80211-rewrite-neigh-code-to-not-depend-on-l.patch index 19248e80d8c975..ef2bb408fb28d9 100644 --- a/package/network/services/hostapd/patches/030-driver_nl80211-rewrite-neigh-code-to-not-depend-on-l.patch +++ b/package/network/services/hostapd/patches/030-driver_nl80211-rewrite-neigh-code-to-not-depend-on-l.patch @@ -92,7 +92,7 @@ Signed-off-by: Felix Fietkau if (drv->capa.flags2 & WPA_DRIVER_FLAGS2_CONTROL_PORT_RX) { wpa_printf(MSG_DEBUG, -@@ -11843,13 +11840,14 @@ static int wpa_driver_br_add_ip_neigh(vo +@@ -11883,13 +11880,14 @@ static int wpa_driver_br_add_ip_neigh(vo const u8 *ipaddr, int prefixlen, const u8 *addr) { @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau int res; if (!ipaddr || prefixlen == 0 || !addr) -@@ -11868,85 +11866,66 @@ static int wpa_driver_br_add_ip_neigh(vo +@@ -11908,85 +11906,66 @@ static int wpa_driver_br_add_ip_neigh(vo } if (version == 4) { @@ -220,7 +220,7 @@ Signed-off-by: Felix Fietkau addrsize = 16; } else { return -EINVAL; -@@ -11964,41 +11943,30 @@ static int wpa_driver_br_delete_ip_neigh +@@ -12004,41 +11983,30 @@ static int wpa_driver_br_delete_ip_neigh return -1; } diff --git a/package/network/services/hostapd/patches/040-mesh-allow-processing-authentication-frames-in-block.patch b/package/network/services/hostapd/patches/040-mesh-allow-processing-authentication-frames-in-block.patch index f98d3806dc1689..b7bf9e351e08b5 100644 --- a/package/network/services/hostapd/patches/040-mesh-allow-processing-authentication-frames-in-block.patch +++ b/package/network/services/hostapd/patches/040-mesh-allow-processing-authentication-frames-in-block.patch @@ -16,7 +16,7 @@ Signed-off-by: Felix Fietkau --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -3012,15 +3012,6 @@ static void handle_auth(struct hostapd_d +@@ -3020,15 +3020,6 @@ static void handle_auth(struct hostapd_d seq_ctrl); return; } diff --git a/package/network/services/hostapd/patches/140-tests-Makefile-make-run-tests-with-CONFIG_TLS.patch b/package/network/services/hostapd/patches/140-tests-Makefile-make-run-tests-with-CONFIG_TLS.patch index 148c268f9ca1e6..e967cff427e177 100644 --- a/package/network/services/hostapd/patches/140-tests-Makefile-make-run-tests-with-CONFIG_TLS.patch +++ b/package/network/services/hostapd/patches/140-tests-Makefile-make-run-tests-with-CONFIG_TLS.patch @@ -903,7 +903,7 @@ Signed-off-by: Glenn Strauss for exp, flags in tests: hapd.disable() hapd.set("tls_flags", flags) -@@ -7115,6 +7173,7 @@ def test_ap_wpa2_eap_assoc_rsn(dev, apde +@@ -7138,6 +7196,7 @@ def test_ap_wpa2_eap_assoc_rsn(dev, apde def test_eap_tls_ext_cert_check(dev, apdev): """EAP-TLS and external server certification validation""" # With internal server certificate chain validation @@ -911,7 +911,7 @@ Signed-off-by: Glenn Strauss id = dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="TLS", identity="tls user", ca_cert="auth_serv/ca.pem", -@@ -7127,6 +7186,7 @@ def test_eap_tls_ext_cert_check(dev, apd +@@ -7150,6 +7209,7 @@ def test_eap_tls_ext_cert_check(dev, apd def test_eap_ttls_ext_cert_check(dev, apdev): """EAP-TTLS and external server certification validation""" # Without internal server certificate chain validation @@ -919,7 +919,7 @@ Signed-off-by: Glenn Strauss id = dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="TTLS", identity="pap user", anonymous_identity="ttls", password="password", phase2="auth=PAP", -@@ -7137,6 +7197,7 @@ def test_eap_ttls_ext_cert_check(dev, ap +@@ -7160,6 +7220,7 @@ def test_eap_ttls_ext_cert_check(dev, ap def test_eap_peap_ext_cert_check(dev, apdev): """EAP-PEAP and external server certification validation""" # With internal server certificate chain validation @@ -927,7 +927,7 @@ Signed-off-by: Glenn Strauss id = dev[0].connect("test-wpa2-eap", key_mgmt="WPA-EAP", eap="PEAP", identity="user", anonymous_identity="peap", ca_cert="auth_serv/ca.pem", -@@ -7147,6 +7208,7 @@ def test_eap_peap_ext_cert_check(dev, ap +@@ -7170,6 +7231,7 @@ def test_eap_peap_ext_cert_check(dev, ap def test_eap_fast_ext_cert_check(dev, apdev): """EAP-FAST and external server certification validation""" @@ -935,7 +935,7 @@ Signed-off-by: Glenn Strauss check_eap_capa(dev[0], "FAST") # With internal server certificate chain validation dev[0].request("SET blob fast_pac_auth_ext ") -@@ -7161,10 +7223,6 @@ def test_eap_fast_ext_cert_check(dev, ap +@@ -7184,10 +7246,6 @@ def test_eap_fast_ext_cert_check(dev, ap run_ext_cert_check(dev, apdev, id) def run_ext_cert_check(dev, apdev, net_id): @@ -948,7 +948,7 @@ Signed-off-by: Glenn Strauss --- a/tests/hwsim/test_ap_ft.py +++ b/tests/hwsim/test_ap_ft.py -@@ -2471,11 +2471,11 @@ def test_ap_ft_ap_oom5(dev, apdev): +@@ -2474,11 +2474,11 @@ def test_ap_ft_ap_oom5(dev, apdev): # This will fail to roam dev[0].roam(bssid1, check_bssid=False) @@ -1138,7 +1138,7 @@ Signed-off-by: Glenn Strauss heavy_groups = [14, 15, 16] suitable_groups = [15, 16, 17, 18, 19, 20, 21] groups = [str(g) for g in sae_groups] -@@ -2188,6 +2193,8 @@ def run_sae_pwe_group(dev, apdev, group) +@@ -2193,6 +2198,8 @@ def run_sae_pwe_group(dev, apdev, group) logger.info("Add Brainpool EC groups since OpenSSL is new enough") elif tls.startswith("wolfSSL"): logger.info("Make sure Brainpool EC groups were enabled when compiling wolfSSL") diff --git a/package/network/services/hostapd/patches/170-hostapd-update-cfs0-and-cfs1-for-160MHz.patch b/package/network/services/hostapd/patches/170-hostapd-update-cfs0-and-cfs1-for-160MHz.patch index 710a3c851e119e..b0151b071f6aab 100644 --- a/package/network/services/hostapd/patches/170-hostapd-update-cfs0-and-cfs1-for-160MHz.patch +++ b/package/network/services/hostapd/patches/170-hostapd-update-cfs0-and-cfs1-for-160MHz.patch @@ -120,7 +120,7 @@ Signed-off-by: P Praneesh * Convert 80+80 MHz channel width to new style as interop --- a/src/common/hw_features_common.c +++ b/src/common/hw_features_common.c -@@ -808,6 +808,7 @@ int ieee80211ac_cap_check(u32 hw, u32 co +@@ -811,6 +811,7 @@ int ieee80211ac_cap_check(u32 hw, u32 co VHT_CAP_CHECK(VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB); VHT_CAP_CHECK(VHT_CAP_RX_ANTENNA_PATTERN); VHT_CAP_CHECK(VHT_CAP_TX_ANTENNA_PATTERN); @@ -130,7 +130,7 @@ Signed-off-by: P Praneesh #undef VHT_CAP_CHECK_MAX --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h -@@ -1348,6 +1348,8 @@ struct ieee80211_ampe_ie { +@@ -1349,6 +1349,8 @@ struct ieee80211_ampe_ie { #define VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB ((u32) BIT(26) | BIT(27)) #define VHT_CAP_RX_ANTENNA_PATTERN ((u32) BIT(28)) #define VHT_CAP_TX_ANTENNA_PATTERN ((u32) BIT(29)) diff --git a/package/network/services/hostapd/patches/180-BSS-coloring-fix-CCA-with-multiple-BSS.patch b/package/network/services/hostapd/patches/180-BSS-coloring-fix-CCA-with-multiple-BSS.patch deleted file mode 100644 index 7b0435a45334c9..00000000000000 --- a/package/network/services/hostapd/patches/180-BSS-coloring-fix-CCA-with-multiple-BSS.patch +++ /dev/null @@ -1,103 +0,0 @@ -From: Felix Fietkau -Date: Mon, 7 Aug 2023 21:55:57 +0200 -Subject: [PATCH] BSS coloring: fix CCA with multiple BSS - -Pass bss->ctx instead of drv->ctx in order to avoid multiple reports for -the first bss. The first report would otherwise clear hapd->cca_color and -subsequent reports would cause the iface bss color to be set to 0. -In order to avoid any issues with cancellations, only overwrite the color -based on hapd->cca_color if it was actually set. - -Fixes: 33c4dd26cd11 ("BSS coloring: Handle the collision and CCA events coming from the kernel") -Signed-off-by: Felix Fietkau ---- - ---- a/src/ap/drv_callbacks.c -+++ b/src/ap/drv_callbacks.c -@@ -2260,7 +2260,8 @@ void wpa_supplicant_event(void *ctx, enu - case EVENT_CCA_NOTIFY: - wpa_printf(MSG_DEBUG, "CCA finished on on %s", - hapd->conf->iface); -- hapd->iface->conf->he_op.he_bss_color = hapd->cca_color; -+ if (hapd->cca_color) -+ hapd->iface->conf->he_op.he_bss_color = hapd->cca_color; - hostapd_cleanup_cca_params(hapd); - break; - #endif /* CONFIG_IEEE80211AX */ ---- a/src/drivers/driver_nl80211_event.c -+++ b/src/drivers/driver_nl80211_event.c -@@ -3653,7 +3653,7 @@ static void nl80211_assoc_comeback(struc - - #ifdef CONFIG_IEEE80211AX - --static void nl80211_obss_color_collision(struct wpa_driver_nl80211_data *drv, -+static void nl80211_obss_color_collision(struct i802_bss *bss, - struct nlattr *tb[]) - { - union wpa_event_data data; -@@ -3667,37 +3667,37 @@ static void nl80211_obss_color_collision - - wpa_printf(MSG_DEBUG, "nl80211: BSS color collision - bitmap %08llx", - (long long unsigned int) data.bss_color_collision.bitmap); -- wpa_supplicant_event(drv->ctx, EVENT_BSS_COLOR_COLLISION, &data); -+ wpa_supplicant_event(bss->ctx, EVENT_BSS_COLOR_COLLISION, &data); - } - - - static void --nl80211_color_change_announcement_started(struct wpa_driver_nl80211_data *drv) -+nl80211_color_change_announcement_started(struct i802_bss *bss) - { - union wpa_event_data data = {}; - - wpa_printf(MSG_DEBUG, "nl80211: CCA started"); -- wpa_supplicant_event(drv->ctx, EVENT_CCA_STARTED_NOTIFY, &data); -+ wpa_supplicant_event(bss->ctx, EVENT_CCA_STARTED_NOTIFY, &data); - } - - - static void --nl80211_color_change_announcement_aborted(struct wpa_driver_nl80211_data *drv) -+nl80211_color_change_announcement_aborted(struct i802_bss *bss) - { - union wpa_event_data data = {}; - - wpa_printf(MSG_DEBUG, "nl80211: CCA aborted"); -- wpa_supplicant_event(drv->ctx, EVENT_CCA_ABORTED_NOTIFY, &data); -+ wpa_supplicant_event(bss->ctx, EVENT_CCA_ABORTED_NOTIFY, &data); - } - - - static void --nl80211_color_change_announcement_completed(struct wpa_driver_nl80211_data *drv) -+nl80211_color_change_announcement_completed(struct i802_bss *bss) - { - union wpa_event_data data = {}; - - wpa_printf(MSG_DEBUG, "nl80211: CCA completed"); -- wpa_supplicant_event(drv->ctx, EVENT_CCA_NOTIFY, &data); -+ wpa_supplicant_event(bss->ctx, EVENT_CCA_NOTIFY, &data); - } - - #endif /* CONFIG_IEEE80211AX */ -@@ -3957,16 +3957,16 @@ static void do_process_drv_event(struct - break; - #ifdef CONFIG_IEEE80211AX - case NL80211_CMD_OBSS_COLOR_COLLISION: -- nl80211_obss_color_collision(drv, tb); -+ nl80211_obss_color_collision(bss, tb); - break; - case NL80211_CMD_COLOR_CHANGE_STARTED: -- nl80211_color_change_announcement_started(drv); -+ nl80211_color_change_announcement_started(bss); - break; - case NL80211_CMD_COLOR_CHANGE_ABORTED: -- nl80211_color_change_announcement_aborted(drv); -+ nl80211_color_change_announcement_aborted(bss); - break; - case NL80211_CMD_COLOR_CHANGE_COMPLETED: -- nl80211_color_change_announcement_completed(drv); -+ nl80211_color_change_announcement_completed(bss); - break; - #endif /* CONFIG_IEEE80211AX */ - default: diff --git a/package/network/services/hostapd/patches/180-driver_nl80211-fix-setting-QoS-map-on-secondary-BSSs.patch b/package/network/services/hostapd/patches/180-driver_nl80211-fix-setting-QoS-map-on-secondary-BSSs.patch new file mode 100644 index 00000000000000..4929c581ce2bde --- /dev/null +++ b/package/network/services/hostapd/patches/180-driver_nl80211-fix-setting-QoS-map-on-secondary-BSSs.patch @@ -0,0 +1,20 @@ +From: Felix Fietkau +Date: Thu, 14 Sep 2023 10:53:50 +0200 +Subject: [PATCH] driver_nl80211: fix setting QoS map on secondary BSSs + +The setting is per-BSS, not per PHY + +Signed-off-by: Felix Fietkau +--- + +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -11341,7 +11341,7 @@ static int nl80211_set_qos_map(void *pri + wpa_hexdump(MSG_DEBUG, "nl80211: Setting QoS Map", + qos_map_set, qos_map_set_len); + +- if (!(msg = nl80211_drv_msg(drv, 0, NL80211_CMD_SET_QOS_MAP)) || ++ if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_QOS_MAP)) || + nla_put(msg, NL80211_ATTR_QOS_MAP, qos_map_set_len, qos_map_set)) { + nlmsg_free(msg); + return -ENOBUFS; diff --git a/package/network/services/hostapd/patches/181-driver_nl80211-update-drv-ifindex-on-removing-the-fi.patch b/package/network/services/hostapd/patches/181-driver_nl80211-update-drv-ifindex-on-removing-the-fi.patch new file mode 100644 index 00000000000000..adfb21fb471a49 --- /dev/null +++ b/package/network/services/hostapd/patches/181-driver_nl80211-update-drv-ifindex-on-removing-the-fi.patch @@ -0,0 +1,18 @@ +From: Felix Fietkau +Date: Thu, 14 Sep 2023 11:28:03 +0200 +Subject: [PATCH] driver_nl80211: update drv->ifindex on removing the first + BSS + +Signed-off-by: Felix Fietkau +--- + +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -8867,6 +8867,7 @@ static int wpa_driver_nl80211_if_remove( + if (drv->first_bss->next) { + drv->first_bss = drv->first_bss->next; + drv->ctx = drv->first_bss->ctx; ++ drv->ifindex = drv->first_bss->ifindex; + os_free(bss); + } else { + wpa_printf(MSG_DEBUG, "nl80211: No second BSS to reassign context to"); diff --git a/package/network/services/hostapd/patches/182-nl80211-move-nl80211_put_freq_params-call-outside-of.patch b/package/network/services/hostapd/patches/182-nl80211-move-nl80211_put_freq_params-call-outside-of.patch new file mode 100644 index 00000000000000..395c645954247c --- /dev/null +++ b/package/network/services/hostapd/patches/182-nl80211-move-nl80211_put_freq_params-call-outside-of.patch @@ -0,0 +1,34 @@ +From: Felix Fietkau +Date: Mon, 18 Sep 2023 16:47:41 +0200 +Subject: [PATCH] nl80211: move nl80211_put_freq_params call outside of + 802.11ax #ifdef + +The relevance of this call is not specific to 802.11ax, so it should be done +even with CONFIG_IEEE80211AX disabled. + +Fixes: b3921db426ea ("nl80211: Add frequency info in start AP command") +Signed-off-by: Felix Fietkau +--- + +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -5226,6 +5226,9 @@ static int wpa_driver_nl80211_set_ap(voi + nla_nest_end(msg, ftm); + } + ++ if (params->freq && nl80211_put_freq_params(msg, params->freq) < 0) ++ goto fail; ++ + #ifdef CONFIG_IEEE80211AX + if (params->he_spr_ctrl) { + struct nlattr *spr; +@@ -5260,9 +5263,6 @@ static int wpa_driver_nl80211_set_ap(voi + nla_nest_end(msg, spr); + } + +- if (params->freq && nl80211_put_freq_params(msg, params->freq) < 0) +- goto fail; +- + if (params->freq && params->freq->he_enabled) { + struct nlattr *bss_color; + diff --git a/package/network/services/hostapd/patches/183-hostapd-cancel-channel_list_update_timeout-in-hostap.patch b/package/network/services/hostapd/patches/183-hostapd-cancel-channel_list_update_timeout-in-hostap.patch new file mode 100644 index 00000000000000..fe81318385f15a --- /dev/null +++ b/package/network/services/hostapd/patches/183-hostapd-cancel-channel_list_update_timeout-in-hostap.patch @@ -0,0 +1,28 @@ +From: Felix Fietkau +Date: Wed, 20 Sep 2023 13:41:10 +0200 +Subject: [PATCH] hostapd: cancel channel_list_update_timeout in + hostapd_cleanup_iface_partial + +Fixes a crash when disabling an interface during channel list update + +Signed-off-by: Felix Fietkau +--- + +--- a/src/ap/hostapd.c ++++ b/src/ap/hostapd.c +@@ -569,6 +569,7 @@ static void sta_track_deinit(struct host + void hostapd_cleanup_iface_partial(struct hostapd_iface *iface) + { + wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); ++ eloop_cancel_timeout(channel_list_update_timeout, iface, NULL); + #ifdef NEED_AP_MLME + hostapd_stop_setup_timers(iface); + #endif /* NEED_AP_MLME */ +@@ -598,7 +599,6 @@ void hostapd_cleanup_iface_partial(struc + static void hostapd_cleanup_iface(struct hostapd_iface *iface) + { + wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); +- eloop_cancel_timeout(channel_list_update_timeout, iface, NULL); + eloop_cancel_timeout(hostapd_interface_setup_failure_handler, iface, + NULL); + diff --git a/package/network/services/hostapd/patches/200-multicall.patch b/package/network/services/hostapd/patches/200-multicall.patch index 8ebbed0c32c8ad..e3ed00f2ded2a4 100644 --- a/package/network/services/hostapd/patches/200-multicall.patch +++ b/package/network/services/hostapd/patches/200-multicall.patch @@ -156,7 +156,7 @@ wpa_cli.exe: wpa_cli --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -6651,8 +6651,8 @@ union wpa_event_data { +@@ -6667,8 +6667,8 @@ union wpa_event_data { * Driver wrapper code should call this function whenever an event is received * from the driver. */ @@ -167,7 +167,7 @@ /** * wpa_supplicant_event_global - Report a driver event for wpa_supplicant -@@ -6664,7 +6664,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -6680,7 +6680,7 @@ void wpa_supplicant_event(void *ctx, enu * Same as wpa_supplicant_event(), but we search for the interface in * wpa_global. */ @@ -178,7 +178,7 @@ /* --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c -@@ -1994,8 +1994,8 @@ err: +@@ -2184,8 +2184,8 @@ err: #endif /* CONFIG_OWE */ @@ -189,7 +189,7 @@ { struct hostapd_data *hapd = ctx; #ifndef CONFIG_NO_STDOUT_DEBUG -@@ -2272,7 +2272,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -2489,7 +2489,7 @@ void wpa_supplicant_event(void *ctx, enu } @@ -231,7 +231,7 @@ os_memset(&global, 0, sizeof(global)); --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c -@@ -5345,8 +5345,8 @@ static void wpas_link_reconfig(struct wp +@@ -5353,8 +5353,8 @@ static void wpas_link_reconfig(struct wp } @@ -242,7 +242,7 @@ { struct wpa_supplicant *wpa_s = ctx; int resched; -@@ -6264,7 +6264,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -6272,7 +6272,7 @@ void wpa_supplicant_event(void *ctx, enu } @@ -253,7 +253,7 @@ struct wpa_supplicant *wpa_s; --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -7435,7 +7435,6 @@ struct wpa_interface * wpa_supplicant_ma +@@ -7462,7 +7462,6 @@ struct wpa_interface * wpa_supplicant_ma return NULL; } @@ -261,7 +261,7 @@ /** * wpa_supplicant_match_existing - Match existing interfaces * @global: Pointer to global data from wpa_supplicant_init() -@@ -7470,6 +7469,11 @@ static int wpa_supplicant_match_existing +@@ -7497,6 +7496,11 @@ static int wpa_supplicant_match_existing #endif /* CONFIG_MATCH_IFACE */ @@ -273,7 +273,7 @@ /** * wpa_supplicant_add_iface - Add a new network interface -@@ -7726,6 +7730,8 @@ struct wpa_global * wpa_supplicant_init( +@@ -7753,6 +7757,8 @@ struct wpa_global * wpa_supplicant_init( #ifndef CONFIG_NO_WPA_MSG wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb); #endif /* CONFIG_NO_WPA_MSG */ @@ -284,7 +284,7 @@ wpa_debug_open_file(params->wpa_debug_file_path); --- a/hostapd/main.c +++ b/hostapd/main.c -@@ -685,6 +685,11 @@ fail: +@@ -698,6 +698,11 @@ fail: return -1; } @@ -296,7 +296,7 @@ #ifdef CONFIG_WPS static int gen_uuid(const char *txt_addr) -@@ -778,6 +783,8 @@ int main(int argc, char *argv[]) +@@ -791,6 +796,8 @@ int main(int argc, char *argv[]) return -1; #endif /* CONFIG_DPP */ diff --git a/package/network/services/hostapd/patches/300-noscan.patch b/package/network/services/hostapd/patches/300-noscan.patch index 1ea89043e89605..3b5f4325de0c96 100644 --- a/package/network/services/hostapd/patches/300-noscan.patch +++ b/package/network/services/hostapd/patches/300-noscan.patch @@ -13,7 +13,7 @@ } else if (os_strcmp(buf, "ht_capab") == 0) { --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -1072,6 +1072,8 @@ struct hostapd_config { +@@ -1075,6 +1075,8 @@ struct hostapd_config { int ht_op_mode_fixed; u16 ht_capab; @@ -24,7 +24,7 @@ int no_pri_sec_switch; --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c -@@ -517,7 +517,8 @@ static int ieee80211n_check_40mhz(struct +@@ -546,7 +546,8 @@ static int ieee80211n_check_40mhz(struct int ret; /* Check that HT40 is used and PRI / SEC switch is allowed */ diff --git a/package/network/services/hostapd/patches/310-rescan_immediately.patch b/package/network/services/hostapd/patches/310-rescan_immediately.patch index a47546d38fc2f9..e12b2059b3e38c 100644 --- a/package/network/services/hostapd/patches/310-rescan_immediately.patch +++ b/package/network/services/hostapd/patches/310-rescan_immediately.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -5740,7 +5740,7 @@ wpa_supplicant_alloc(struct wpa_supplica +@@ -5767,7 +5767,7 @@ wpa_supplicant_alloc(struct wpa_supplica if (wpa_s == NULL) return NULL; wpa_s->scan_req = INITIAL_SCAN_REQ; diff --git a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch index 54a736fe915d9f..f7720fce2fac84 100644 --- a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch +++ b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch @@ -51,7 +51,7 @@ if (wpa_s->ap_iface) { pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos, end - pos, -@@ -11964,6 +11964,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -12087,6 +12087,7 @@ char * wpa_supplicant_ctrl_iface_process reply_len = -1; } else if (os_strncmp(buf, "NOTE ", 5) == 0) { wpa_printf(MSG_INFO, "NOTE: %s", buf + 5); @@ -59,7 +59,7 @@ } else if (os_strcmp(buf, "MIB") == 0) { reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size); if (reply_len >= 0) { -@@ -11976,6 +11977,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -12099,6 +12100,7 @@ char * wpa_supplicant_ctrl_iface_process reply_size - reply_len); #endif /* CONFIG_MACSEC */ } @@ -67,7 +67,7 @@ } else if (os_strncmp(buf, "STATUS", 6) == 0) { reply_len = wpa_supplicant_ctrl_iface_status( wpa_s, buf + 6, reply, reply_size); -@@ -12464,6 +12466,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -12587,6 +12589,7 @@ char * wpa_supplicant_ctrl_iface_process reply_len = wpa_supplicant_ctrl_iface_bss( wpa_s, buf + 4, reply, reply_size); #ifdef CONFIG_AP @@ -75,7 +75,7 @@ } else if (os_strcmp(buf, "STA-FIRST") == 0) { reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size); } else if (os_strncmp(buf, "STA ", 4) == 0) { -@@ -12472,12 +12475,15 @@ char * wpa_supplicant_ctrl_iface_process +@@ -12595,12 +12598,15 @@ char * wpa_supplicant_ctrl_iface_process } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply, reply_size); diff --git a/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch b/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch index 40c39ff29c7e12..4592c341277ed4 100644 --- a/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch +++ b/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch @@ -1,6 +1,6 @@ --- a/src/common/wpa_common.c +++ b/src/common/wpa_common.c -@@ -2719,6 +2719,31 @@ u32 wpa_akm_to_suite(int akm) +@@ -2841,6 +2841,31 @@ u32 wpa_akm_to_suite(int akm) } @@ -32,7 +32,7 @@ int wpa_compare_rsn_ie(int ft_initial_assoc, const u8 *ie1, size_t ie1len, const u8 *ie2, size_t ie2len) -@@ -2726,8 +2751,19 @@ int wpa_compare_rsn_ie(int ft_initial_as +@@ -2848,8 +2873,19 @@ int wpa_compare_rsn_ie(int ft_initial_as if (ie1 == NULL || ie2 == NULL) return -1; diff --git a/package/network/services/hostapd/patches/420-indicate-features.patch b/package/network/services/hostapd/patches/420-indicate-features.patch index 3b28b6e75247dc..07df8e5a9afd1c 100644 --- a/package/network/services/hostapd/patches/420-indicate-features.patch +++ b/package/network/services/hostapd/patches/420-indicate-features.patch @@ -9,7 +9,7 @@ struct hapd_global { void **drv_priv; -@@ -786,7 +786,7 @@ int main(int argc, char *argv[]) +@@ -799,7 +799,7 @@ int main(int argc, char *argv[]) wpa_supplicant_event = hostapd_wpa_event; wpa_supplicant_event_global = hostapd_wpa_event_global; for (;;) { @@ -18,7 +18,7 @@ if (c < 0) break; switch (c) { -@@ -823,6 +823,8 @@ int main(int argc, char *argv[]) +@@ -836,6 +836,8 @@ int main(int argc, char *argv[]) break; #endif /* CONFIG_DEBUG_LINUX_TRACING */ case 'v': diff --git a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch index e50c609d9765ba..c6fe54efed0220 100644 --- a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch +++ b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch @@ -174,7 +174,7 @@ Signed-hostap: Antonio Quartulli * macsec_policy - Determines the policy for MACsec secure session --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -4149,6 +4149,12 @@ static void wpas_start_assoc_cb(struct w +@@ -4175,6 +4175,12 @@ static void wpas_start_assoc_cb(struct w params.beacon_int = ssid->beacon_int; else params.beacon_int = wpa_s->conf->beacon_int; diff --git a/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch b/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch index be9e0507d6daf3..daa36c2f35cbb9 100644 --- a/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch +++ b/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch @@ -29,7 +29,7 @@ Tested-by: Simon Wunderlich struct wpa_driver_set_key_params { --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -11626,6 +11626,18 @@ static int nl80211_put_mesh_id(struct nl +@@ -11667,6 +11667,18 @@ static int nl80211_put_mesh_id(struct nl } @@ -48,7 +48,7 @@ Tested-by: Simon Wunderlich static int nl80211_put_mesh_config(struct nl_msg *msg, struct wpa_driver_mesh_bss_params *params) { -@@ -11687,6 +11699,7 @@ static int nl80211_join_mesh(struct i802 +@@ -11728,6 +11740,7 @@ static int nl80211_join_mesh(struct i802 nl80211_put_basic_rates(msg, params->basic_rates) || nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) || nl80211_put_beacon_int(msg, params->beacon_int) || diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch index 5b2745a3beec6f..bc80ef0e813ae1 100644 --- a/package/network/services/hostapd/patches/600-ubus_support.patch +++ b/package/network/services/hostapd/patches/600-ubus_support.patch @@ -84,7 +84,7 @@ __func__, driver, drv_priv); --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -2778,7 +2778,7 @@ static void handle_auth(struct hostapd_d +@@ -2786,7 +2786,7 @@ static void handle_auth(struct hostapd_d u16 auth_alg, auth_transaction, status_code; u16 resp = WLAN_STATUS_SUCCESS; struct sta_info *sta = NULL; @@ -93,7 +93,7 @@ u16 fc; const u8 *challenge = NULL; u8 resp_ies[2 + WLAN_AUTH_CHALLENGE_LEN]; -@@ -2787,6 +2787,11 @@ static void handle_auth(struct hostapd_d +@@ -2795,6 +2795,11 @@ static void handle_auth(struct hostapd_d struct radius_sta rad_info; const u8 *dst, *sa, *bssid; bool mld_sta = false; @@ -105,7 +105,7 @@ if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.auth)) { wpa_printf(MSG_INFO, "handle_auth - too short payload (len=%lu)", -@@ -2978,6 +2983,13 @@ static void handle_auth(struct hostapd_d +@@ -2986,6 +2991,13 @@ static void handle_auth(struct hostapd_d resp = WLAN_STATUS_UNSPECIFIED_FAILURE; goto fail; } @@ -119,7 +119,7 @@ if (res == HOSTAPD_ACL_PENDING) return; -@@ -5141,7 +5153,7 @@ static void handle_assoc(struct hostapd_ +@@ -5161,7 +5173,7 @@ static void handle_assoc(struct hostapd_ int resp = WLAN_STATUS_SUCCESS; u16 reply_res = WLAN_STATUS_UNSPECIFIED_FAILURE; const u8 *pos; @@ -128,7 +128,7 @@ struct sta_info *sta; u8 *tmp = NULL; #ifdef CONFIG_FILS -@@ -5354,6 +5366,11 @@ static void handle_assoc(struct hostapd_ +@@ -5374,6 +5386,11 @@ static void handle_assoc(struct hostapd_ left = res; } #endif /* CONFIG_FILS */ @@ -140,7 +140,7 @@ /* followed by SSID and Supported rates; and HT capabilities if 802.11n * is used */ -@@ -5452,6 +5469,13 @@ static void handle_assoc(struct hostapd_ +@@ -5472,6 +5489,13 @@ static void handle_assoc(struct hostapd_ } #endif /* CONFIG_FILS */ @@ -154,7 +154,7 @@ fail: /* -@@ -5733,6 +5757,7 @@ static void handle_disassoc(struct hosta +@@ -5753,6 +5777,7 @@ static void handle_disassoc(struct hosta (unsigned long) len); return; } @@ -162,7 +162,7 @@ sta = ap_get_sta(hapd, mgmt->sa); if (!sta) { -@@ -5764,6 +5789,8 @@ static void handle_deauth(struct hostapd +@@ -5784,6 +5809,8 @@ static void handle_deauth(struct hostapd /* Clear the PTKSA cache entries for PASN */ ptksa_cache_flush(hapd->ptksa, mgmt->sa, WPA_CIPHER_NONE); @@ -201,7 +201,7 @@ --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c -@@ -145,6 +145,10 @@ int hostapd_notif_assoc(struct hostapd_d +@@ -260,6 +260,10 @@ int hostapd_notif_assoc(struct hostapd_d u16 reason = WLAN_REASON_UNSPECIFIED; int status = WLAN_STATUS_SUCCESS; const u8 *p2p_dev_addr = NULL; @@ -212,7 +212,7 @@ if (addr == NULL) { /* -@@ -237,6 +241,12 @@ int hostapd_notif_assoc(struct hostapd_d +@@ -396,6 +400,12 @@ int hostapd_notif_assoc(struct hostapd_d goto fail; } @@ -348,7 +348,7 @@ CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -7566,6 +7566,8 @@ struct wpa_supplicant * wpa_supplicant_a +@@ -7593,6 +7593,8 @@ struct wpa_supplicant * wpa_supplicant_a } #endif /* CONFIG_P2P */ @@ -357,7 +357,7 @@ return wpa_s; } -@@ -7592,6 +7594,8 @@ int wpa_supplicant_remove_iface(struct w +@@ -7619,6 +7621,8 @@ int wpa_supplicant_remove_iface(struct w struct wpa_supplicant *parent = wpa_s->parent; #endif /* CONFIG_MESH */ @@ -366,7 +366,7 @@ /* Remove interface from the global list of interfaces */ prev = global->ifaces; if (prev == wpa_s) { -@@ -7938,8 +7942,12 @@ int wpa_supplicant_run(struct wpa_global +@@ -7965,8 +7969,12 @@ int wpa_supplicant_run(struct wpa_global eloop_register_signal_terminate(wpa_supplicant_terminate, global); eloop_register_signal_reconfig(wpa_supplicant_reconfig, global); @@ -398,7 +398,7 @@ }; -@@ -650,6 +653,7 @@ struct wpa_supplicant { +@@ -685,6 +688,7 @@ struct wpa_supplicant { unsigned char own_addr[ETH_ALEN]; unsigned char perm_addr[ETH_ALEN]; char ifname[100]; @@ -508,7 +508,7 @@ --- a/src/ap/dfs.c +++ b/src/ap/dfs.c -@@ -1211,6 +1211,8 @@ int hostapd_dfs_pre_cac_expired(struct h +@@ -1216,6 +1216,8 @@ int hostapd_dfs_pre_cac_expired(struct h "freq=%d ht_enabled=%d chan_offset=%d chan_width=%d cf1=%d cf2=%d", freq, ht_enabled, chan_offset, chan_width, cf1, cf2); diff --git a/package/network/services/hostapd/patches/601-ucode_support.patch b/package/network/services/hostapd/patches/601-ucode_support.patch index e0bbf1337da8ad..de182b985d97b3 100644 --- a/package/network/services/hostapd/patches/601-ucode_support.patch +++ b/package/network/services/hostapd/patches/601-ucode_support.patch @@ -26,7 +26,7 @@ ifdef CONFIG_CODE_COVERAGE --- a/hostapd/main.c +++ b/hostapd/main.c -@@ -994,6 +994,7 @@ int main(int argc, char *argv[]) +@@ -1007,6 +1007,7 @@ int main(int argc, char *argv[]) } hostapd_global_ctrl_iface_init(&interfaces); @@ -34,7 +34,7 @@ if (hostapd_global_run(&interfaces, daemonize, pid_file)) { wpa_printf(MSG_ERROR, "Failed to start eloop"); -@@ -1003,6 +1004,7 @@ int main(int argc, char *argv[]) +@@ -1016,6 +1017,7 @@ int main(int argc, char *argv[]) ret = 0; out: @@ -107,14 +107,14 @@ hostapd_ubus_free_bss(hapd); accounting_deinit(hapd); hostapd_deinit_wpa(hapd); -@@ -599,6 +602,7 @@ void hostapd_cleanup_iface_partial(struc +@@ -600,6 +603,7 @@ void hostapd_cleanup_iface_partial(struc static void hostapd_cleanup_iface(struct hostapd_iface *iface) { wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); + hostapd_ucode_free_iface(iface); - eloop_cancel_timeout(channel_list_update_timeout, iface, NULL); eloop_cancel_timeout(hostapd_interface_setup_failure_handler, iface, NULL); + @@ -1189,6 +1193,7 @@ static int hostapd_start_beacon(struct h hapd->driver->set_operstate(hapd->drv_priv, 1); @@ -142,6 +142,16 @@ { if (!hapd) return; +@@ -3491,7 +3495,8 @@ int hostapd_remove_iface(struct hapd_int + hapd_iface = interfaces->iface[i]; + if (hapd_iface == NULL) + return -1; +- if (!os_strcmp(hapd_iface->conf->bss[0]->iface, buf)) { ++ if (!os_strcmp(hapd_iface->phy, buf) || ++ !os_strcmp(hapd_iface->conf->bss[0]->iface, buf)) { + wpa_printf(MSG_INFO, "Remove interface '%s'", buf); + hapd_iface->driver_ap_teardown = + !!(hapd_iface->drv_flags & --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile @@ -195,8 +195,20 @@ endif @@ -186,7 +196,7 @@ #ifdef CONFIG_BGSCAN if (state == WPA_COMPLETED && wpa_s->current_ssid != wpa_s->bgscan_ssid) -@@ -7567,6 +7568,7 @@ struct wpa_supplicant * wpa_supplicant_a +@@ -7594,6 +7595,7 @@ struct wpa_supplicant * wpa_supplicant_a #endif /* CONFIG_P2P */ wpas_ubus_add_bss(wpa_s); @@ -194,7 +204,7 @@ return wpa_s; } -@@ -7594,6 +7596,7 @@ int wpa_supplicant_remove_iface(struct w +@@ -7621,6 +7623,7 @@ int wpa_supplicant_remove_iface(struct w struct wpa_supplicant *parent = wpa_s->parent; #endif /* CONFIG_MESH */ @@ -202,7 +212,7 @@ wpas_ubus_free_bss(wpa_s); /* Remove interface from the global list of interfaces */ -@@ -7904,6 +7907,7 @@ struct wpa_global * wpa_supplicant_init( +@@ -7931,6 +7934,7 @@ struct wpa_global * wpa_supplicant_init( eloop_register_timeout(WPA_SUPPLICANT_CLEANUP_INTERVAL, 0, wpas_periodic, global, NULL); @@ -210,7 +220,7 @@ return global; } -@@ -7942,12 +7946,8 @@ int wpa_supplicant_run(struct wpa_global +@@ -7969,12 +7973,8 @@ int wpa_supplicant_run(struct wpa_global eloop_register_signal_terminate(wpa_supplicant_terminate, global); eloop_register_signal_reconfig(wpa_supplicant_reconfig, global); @@ -223,7 +233,7 @@ return 0; } -@@ -7980,6 +7980,8 @@ void wpa_supplicant_deinit(struct wpa_gl +@@ -8007,6 +8007,8 @@ void wpa_supplicant_deinit(struct wpa_gl wpas_notify_supplicant_deinitialized(global); @@ -242,7 +252,7 @@ extern const char *const wpa_supplicant_version; extern const char *const wpa_supplicant_license; -@@ -654,6 +655,7 @@ struct wpa_supplicant { +@@ -689,6 +690,7 @@ struct wpa_supplicant { unsigned char perm_addr[ETH_ALEN]; char ifname[100]; struct wpas_ubus_bss ubus; @@ -270,7 +280,33 @@ --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -6426,6 +6426,7 @@ union wpa_event_data { +@@ -3787,6 +3787,25 @@ struct wpa_driver_ops { + const char *ifname); + + /** ++ * if_rename - Rename a virtual interface ++ * @priv: Private driver interface data ++ * @type: Interface type ++ * @ifname: Interface name of the virtual interface to be renamed ++ * (NULL when renaming the AP BSS interface) ++ * @new_name: New interface name of the virtual interface ++ * Returns: 0 on success, -1 on failure ++ */ ++ int (*if_rename)(void *priv, enum wpa_driver_if_type type, ++ const char *ifname, const char *new_name); ++ ++ /** ++ * set_first_bss - Make a virtual interface the first (primary) bss ++ * @priv: Private driver interface data ++ * Returns: 0 on success, -1 on failure ++ */ ++ int (*set_first_bss)(void *priv); ++ ++ /** + * set_sta_vlan - Bind a station into a specific interface (AP only) + * @priv: Private driver interface data + * @ifname: Interface (main or virtual BSS or VLAN) +@@ -6440,6 +6459,7 @@ union wpa_event_data { /** * struct ch_switch @@ -278,7 +314,7 @@ * @freq: Frequency of new channel in MHz * @ht_enabled: Whether this is an HT channel * @ch_offset: Secondary channel offset -@@ -6436,6 +6437,7 @@ union wpa_event_data { +@@ -6450,6 +6470,7 @@ union wpa_event_data { * @punct_bitmap: Puncturing bitmap */ struct ch_switch { @@ -305,7 +341,7 @@ if (finished) bss->flink->freq = data.ch_switch.freq; -@@ -3848,6 +3851,7 @@ static void do_process_drv_event(struct +@@ -3912,6 +3915,7 @@ static void do_process_drv_event(struct tb[NL80211_ATTR_CENTER_FREQ1], tb[NL80211_ATTR_CENTER_FREQ2], tb[NL80211_ATTR_PUNCT_BITMAP], @@ -313,7 +349,7 @@ 0); break; case NL80211_CMD_CH_SWITCH_NOTIFY: -@@ -3860,6 +3864,7 @@ static void do_process_drv_event(struct +@@ -3924,6 +3928,7 @@ static void do_process_drv_event(struct tb[NL80211_ATTR_CENTER_FREQ1], tb[NL80211_ATTR_CENTER_FREQ2], tb[NL80211_ATTR_PUNCT_BITMAP], @@ -323,7 +359,7 @@ case NL80211_CMD_DISCONNECT: --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c -@@ -5381,6 +5381,7 @@ void supplicant_event(void *ctx, enum wp +@@ -5389,6 +5389,7 @@ void supplicant_event(void *ctx, enum wp event_to_string(event), event); #endif /* CONFIG_NO_STDOUT_DEBUG */ @@ -331,3 +367,187 @@ switch (event) { case EVENT_AUTH: #ifdef CONFIG_FST +--- a/src/ap/ap_drv_ops.h ++++ b/src/ap/ap_drv_ops.h +@@ -393,6 +393,23 @@ static inline int hostapd_drv_stop_ap(st + return hapd->driver->stop_ap(hapd->drv_priv); + } + ++static inline int hostapd_drv_if_rename(struct hostapd_data *hapd, ++ enum wpa_driver_if_type type, ++ const char *ifname, ++ const char *new_name) ++{ ++ if (!hapd->driver || !hapd->driver->if_rename || !hapd->drv_priv) ++ return -1; ++ return hapd->driver->if_rename(hapd->drv_priv, type, ifname, new_name); ++} ++ ++static inline int hostapd_drv_set_first_bss(struct hostapd_data *hapd) ++{ ++ if (!hapd->driver || !hapd->driver->set_first_bss || !hapd->drv_priv) ++ return 0; ++ return hapd->driver->set_first_bss(hapd->drv_priv); ++} ++ + static inline int hostapd_drv_channel_info(struct hostapd_data *hapd, + struct wpa_channel_info *ci) + { +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -1333,7 +1333,7 @@ static void wpa_driver_nl80211_event_rtm + } + wpa_printf(MSG_DEBUG, "nl80211: Interface down (%s/%s)", + namebuf, ifname); +- if (os_strcmp(drv->first_bss->ifname, ifname) != 0) { ++ if (drv->first_bss->ifindex != ifi->ifi_index) { + wpa_printf(MSG_DEBUG, + "nl80211: Not the main interface (%s) - do not indicate interface down", + drv->first_bss->ifname); +@@ -1369,7 +1369,7 @@ static void wpa_driver_nl80211_event_rtm + } + wpa_printf(MSG_DEBUG, "nl80211: Interface up (%s/%s)", + namebuf, ifname); +- if (os_strcmp(drv->first_bss->ifname, ifname) != 0) { ++ if (drv->first_bss->ifindex != ifi->ifi_index) { + wpa_printf(MSG_DEBUG, + "nl80211: Not the main interface (%s) - do not indicate interface up", + drv->first_bss->ifname); +@@ -8432,6 +8432,7 @@ static void *i802_init(struct hostapd_da + char master_ifname[IFNAMSIZ]; + int ifindex, br_ifindex = 0; + int br_added = 0; ++ int err; + + bss = wpa_driver_nl80211_drv_init(hapd, params->ifname, + params->global_priv, 1, +@@ -8491,21 +8492,17 @@ static void *i802_init(struct hostapd_da + (params->num_bridge == 0 || !params->bridge[0])) + add_ifidx(drv, br_ifindex, drv->ifindex); + +- if (bss->added_if_into_bridge || bss->already_in_bridge) { +- int err; +- +- drv->rtnl_sk = nl_socket_alloc(); +- if (drv->rtnl_sk == NULL) { +- wpa_printf(MSG_ERROR, "nl80211: Failed to allocate nl_sock"); +- goto failed; +- } ++ drv->rtnl_sk = nl_socket_alloc(); ++ if (drv->rtnl_sk == NULL) { ++ wpa_printf(MSG_ERROR, "nl80211: Failed to allocate nl_sock"); ++ goto failed; ++ } + +- err = nl_connect(drv->rtnl_sk, NETLINK_ROUTE); +- if (err) { +- wpa_printf(MSG_ERROR, "nl80211: Failed to connect nl_sock to NETLINK_ROUTE: %s", +- nl_geterror(err)); +- goto failed; +- } ++ err = nl_connect(drv->rtnl_sk, NETLINK_ROUTE); ++ if (err) { ++ wpa_printf(MSG_ERROR, "nl80211: Failed to connect nl_sock to NETLINK_ROUTE: %s", ++ nl_geterror(err)); ++ goto failed; + } + + if (drv->capa.flags2 & WPA_DRIVER_FLAGS2_CONTROL_PORT_RX) { +@@ -8875,6 +8872,50 @@ static int wpa_driver_nl80211_if_remove( + return 0; + } + ++static int wpa_driver_nl80211_if_rename(struct i802_bss *bss, ++ enum wpa_driver_if_type type, ++ const char *ifname, const char *new_name) ++{ ++ struct wpa_driver_nl80211_data *drv = bss->drv; ++ struct ifinfomsg ifi = { ++ .ifi_family = AF_UNSPEC, ++ .ifi_index = bss->ifindex, ++ }; ++ struct nl_msg *msg; ++ int res = -ENOMEM; ++ ++ if (ifname) ++ ifi.ifi_index = if_nametoindex(ifname); ++ ++ msg = nlmsg_alloc_simple(RTM_SETLINK, 0); ++ if (!msg) ++ return res; ++ ++ if (nlmsg_append(msg, &ifi, sizeof(ifi), NLMSG_ALIGNTO) < 0) ++ goto out; ++ ++ if (nla_put_string(msg, IFLA_IFNAME, new_name)) ++ goto out; ++ ++ res = nl_send_auto_complete(drv->rtnl_sk, msg); ++ if (res < 0) ++ goto out; ++ ++ res = nl_wait_for_ack(drv->rtnl_sk); ++ if (res) { ++ wpa_printf(MSG_INFO, ++ "nl80211: Renaming device %s to %s failed: %s", ++ ifname ? ifname : bss->ifname, new_name, nl_geterror(res)); ++ goto out; ++ } ++ ++ if (type == WPA_IF_AP_BSS && !ifname) ++ os_strlcpy(bss->ifname, new_name, sizeof(bss->ifname)); ++ ++out: ++ nlmsg_free(msg); ++ return res; ++} + + static int cookie_handler(struct nl_msg *msg, void *arg) + { +@@ -10513,6 +10554,37 @@ static int driver_nl80211_if_remove(void + } + + ++static int driver_nl80211_if_rename(void *priv, enum wpa_driver_if_type type, ++ const char *ifname, const char *new_name) ++{ ++ struct i802_bss *bss = priv; ++ return wpa_driver_nl80211_if_rename(bss, type, ifname, new_name); ++} ++ ++ ++static int driver_nl80211_set_first_bss(void *priv) ++{ ++ struct i802_bss *bss = priv, *tbss; ++ struct wpa_driver_nl80211_data *drv = bss->drv; ++ ++ if (drv->first_bss == bss) ++ return 0; ++ ++ for (tbss = drv->first_bss; tbss; tbss = tbss->next) { ++ if (tbss->next != bss) ++ continue; ++ ++ tbss->next = bss->next; ++ bss->next = drv->first_bss; ++ drv->first_bss = bss; ++ drv->ctx = bss->ctx; ++ return 0; ++ } ++ ++ return -1; ++} ++ ++ + static int driver_nl80211_send_mlme(void *priv, const u8 *data, + size_t data_len, int noack, + unsigned int freq, +@@ -13697,6 +13769,8 @@ const struct wpa_driver_ops wpa_driver_n + .set_acl = wpa_driver_nl80211_set_acl, + .if_add = wpa_driver_nl80211_if_add, + .if_remove = driver_nl80211_if_remove, ++ .if_rename = driver_nl80211_if_rename, ++ .set_first_bss = driver_nl80211_set_first_bss, + .send_mlme = driver_nl80211_send_mlme, + .get_hw_feature_data = nl80211_get_hw_feature_data, + .sta_add = wpa_driver_nl80211_sta_add, diff --git a/package/network/services/hostapd/patches/701-reload_config_inline.patch b/package/network/services/hostapd/patches/701-reload_config_inline.patch index 44c8892bae9938..3c62bf670f5bc5 100644 --- a/package/network/services/hostapd/patches/701-reload_config_inline.patch +++ b/package/network/services/hostapd/patches/701-reload_config_inline.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -4810,7 +4810,12 @@ struct hostapd_config * hostapd_config_r +@@ -4816,7 +4816,12 @@ struct hostapd_config * hostapd_config_r int errors = 0; size_t i; diff --git a/package/network/services/hostapd/patches/720-iface_max_num_sta.patch b/package/network/services/hostapd/patches/720-iface_max_num_sta.patch index 1aa4456a5f403d..089c1ddc2461ba 100644 --- a/package/network/services/hostapd/patches/720-iface_max_num_sta.patch +++ b/package/network/services/hostapd/patches/720-iface_max_num_sta.patch @@ -70,7 +70,7 @@ " since no room for additional STA", --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -1036,6 +1036,8 @@ struct hostapd_config { +@@ -1039,6 +1039,8 @@ struct hostapd_config { unsigned int track_sta_max_num; unsigned int track_sta_max_age; diff --git a/package/network/services/hostapd/patches/740-snoop_iface.patch b/package/network/services/hostapd/patches/740-snoop_iface.patch index 004b8a0d392a7e..ce64513a421b42 100644 --- a/package/network/services/hostapd/patches/740-snoop_iface.patch +++ b/package/network/services/hostapd/patches/740-snoop_iface.patch @@ -104,7 +104,7 @@ static inline int hostapd_drv_vendor_cmd(struct hostapd_data *hapd, --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -4206,7 +4206,7 @@ struct wpa_driver_ops { +@@ -4209,7 +4209,7 @@ struct wpa_driver_ops { * Returns: 0 on success, negative (<0) on failure */ int (*br_set_net_param)(void *priv, enum drv_br_net_param param, @@ -115,7 +115,7 @@ * get_wowlan - Get wake-on-wireless status --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -12127,7 +12127,7 @@ static const char * drv_br_net_param_str +@@ -12168,7 +12168,7 @@ static const char * drv_br_net_param_str static int wpa_driver_br_set_net_param(void *priv, enum drv_br_net_param param, @@ -124,7 +124,7 @@ { struct i802_bss *bss = priv; char path[128]; -@@ -12153,8 +12153,11 @@ static int wpa_driver_br_set_net_param(v +@@ -12194,8 +12194,11 @@ static int wpa_driver_br_set_net_param(v return -EINVAL; } diff --git a/package/network/services/hostapd/patches/770-radius_server.patch b/package/network/services/hostapd/patches/770-radius_server.patch index e4690c76b8b5d8..8837a26257b3d9 100644 --- a/package/network/services/hostapd/patches/770-radius_server.patch +++ b/package/network/services/hostapd/patches/770-radius_server.patch @@ -21,7 +21,7 @@ #ifndef CONFIG_NO_HOSTAPD_LOGGER static void hostapd_logger_cb(void *ctx, const u8 *addr, unsigned int module, -@@ -758,6 +759,11 @@ int main(int argc, char *argv[]) +@@ -771,6 +772,11 @@ int main(int argc, char *argv[]) if (os_program_init()) return -1; diff --git a/package/network/services/hostapd/patches/990-ctrl-make-WNM_AP-functions-dependant-on-CONFIG_AP.patch b/package/network/services/hostapd/patches/990-ctrl-make-WNM_AP-functions-dependant-on-CONFIG_AP.patch index 51690def09c708..5809a3b7e8170f 100644 --- a/package/network/services/hostapd/patches/990-ctrl-make-WNM_AP-functions-dependant-on-CONFIG_AP.patch +++ b/package/network/services/hostapd/patches/990-ctrl-make-WNM_AP-functions-dependant-on-CONFIG_AP.patch @@ -13,7 +13,7 @@ Signed-off-by: David Bauer --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c -@@ -12640,7 +12640,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -12763,7 +12763,7 @@ char * wpa_supplicant_ctrl_iface_process if (wpas_ctrl_iface_coloc_intf_report(wpa_s, buf + 18)) reply_len = -1; #endif /* CONFIG_WNM */ @@ -22,7 +22,7 @@ Signed-off-by: David Bauer } else if (os_strncmp(buf, "DISASSOC_IMMINENT ", 18) == 0) { if (ap_ctrl_iface_disassoc_imminent(wpa_s, buf + 18)) reply_len = -1; -@@ -12650,7 +12650,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -12773,7 +12773,7 @@ char * wpa_supplicant_ctrl_iface_process } else if (os_strncmp(buf, "BSS_TM_REQ ", 11) == 0) { if (ap_ctrl_iface_bss_tm_req(wpa_s, buf + 11)) reply_len = -1; diff --git a/package/network/services/hostapd/patches/991-Fix-OpenWrt-13156.patch b/package/network/services/hostapd/patches/991-Fix-OpenWrt-13156.patch index 3f10fb1eef7602..097d62abc0116d 100644 --- a/package/network/services/hostapd/patches/991-Fix-OpenWrt-13156.patch +++ b/package/network/services/hostapd/patches/991-Fix-OpenWrt-13156.patch @@ -20,7 +20,7 @@ Signed-off-by: Stijn Tintel --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -3563,6 +3563,8 @@ int hostapd_remove_iface(struct hapd_int +@@ -3564,6 +3564,8 @@ int hostapd_remove_iface(struct hapd_int void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta, int reassoc) { @@ -29,7 +29,7 @@ Signed-off-by: Stijn Tintel if (hapd->tkip_countermeasures) { hostapd_drv_sta_deauth(hapd, sta->addr, WLAN_REASON_MICHAEL_MIC_FAILURE); -@@ -3570,10 +3572,16 @@ void hostapd_new_assoc_sta(struct hostap +@@ -3571,10 +3573,16 @@ void hostapd_new_assoc_sta(struct hostap } #ifdef CONFIG_IEEE80211BE diff --git a/package/network/services/hostapd/src/src/ap/ucode.c b/package/network/services/hostapd/src/src/ap/ucode.c index 0326f6fc82dc9f..af97091be55e82 100644 --- a/package/network/services/hostapd/src/src/ap/ucode.c +++ b/package/network/services/hostapd/src/src/ap/ucode.c @@ -8,6 +8,7 @@ #include "hw_features.h" #include "ap_drv_ops.h" #include "dfs.h" +#include "acs.h" #include static uc_resource_type_t *global_type, *bss_type, *iface_type; @@ -110,6 +111,94 @@ uc_hostapd_remove_iface(uc_vm_t *vm, size_t nargs) return NULL; } +static struct hostapd_vlan * +bss_conf_find_vlan(struct hostapd_bss_config *bss, int id) +{ + struct hostapd_vlan *vlan; + + for (vlan = bss->vlan; vlan; vlan = vlan->next) + if (vlan->vlan_id == id) + return vlan; + + return NULL; +} + +static int +bss_conf_rename_vlan(struct hostapd_data *hapd, struct hostapd_vlan *vlan, + const char *ifname) +{ + if (!strcmp(ifname, vlan->ifname)) + return 0; + + hostapd_drv_if_rename(hapd, WPA_IF_AP_VLAN, vlan->ifname, ifname); + os_strlcpy(vlan->ifname, ifname, sizeof(vlan->ifname)); + + return 0; +} + +static int +bss_reload_vlans(struct hostapd_data *hapd, struct hostapd_bss_config *bss) +{ + struct hostapd_bss_config *old_bss = hapd->conf; + struct hostapd_vlan *vlan, *vlan_new, *wildcard; + char ifname[IFNAMSIZ + 1], vlan_ifname[IFNAMSIZ + 1], *pos; + int ret; + + vlan = bss_conf_find_vlan(old_bss, VLAN_ID_WILDCARD); + wildcard = bss_conf_find_vlan(bss, VLAN_ID_WILDCARD); + if (!!vlan != !!wildcard) + return -1; + + if (vlan && wildcard && strcmp(vlan->ifname, wildcard->ifname) != 0) + strcpy(vlan->ifname, wildcard->ifname); + else + wildcard = NULL; + + for (vlan = bss->vlan; vlan; vlan = vlan->next) { + if (vlan->vlan_id == VLAN_ID_WILDCARD || + vlan->dynamic_vlan > 0) + continue; + + if (!bss_conf_find_vlan(old_bss, vlan->vlan_id)) + return -1; + } + + for (vlan = old_bss->vlan; vlan; vlan = vlan->next) { + if (vlan->vlan_id == VLAN_ID_WILDCARD) + continue; + + if (vlan->dynamic_vlan == 0) { + vlan_new = bss_conf_find_vlan(bss, vlan->vlan_id); + if (!vlan_new) + return -1; + + if (bss_conf_rename_vlan(hapd, vlan, vlan_new->ifname)) + return -1; + + continue; + } + + if (!wildcard) + continue; + + os_strlcpy(ifname, wildcard->ifname, sizeof(ifname)); + pos = os_strchr(ifname, '#'); + if (!pos) + return -1; + + *pos++ = '\0'; + ret = os_snprintf(vlan_ifname, sizeof(vlan_ifname), "%s%d%s", + ifname, vlan->vlan_id, pos); + if (os_snprintf_error(sizeof(vlan_ifname), ret)) + return -1; + + if (bss_conf_rename_vlan(hapd, vlan, vlan_ifname)) + return -1; + } + + return 0; +} + static uc_value_t * uc_hostapd_bss_set_config(uc_vm_t *vm, size_t nargs) { @@ -119,6 +208,7 @@ uc_hostapd_bss_set_config(uc_vm_t *vm, size_t nargs) struct hostapd_config *conf; uc_value_t *file = uc_fn_arg(0); uc_value_t *index = uc_fn_arg(1); + uc_value_t *files_only = uc_fn_arg(2); unsigned int i, idx = 0; int ret = -1; @@ -130,9 +220,28 @@ uc_hostapd_bss_set_config(uc_vm_t *vm, size_t nargs) iface = hapd->iface; conf = interfaces->config_read_cb(ucv_string_get(file)); - if (!conf || idx > conf->num_bss || !conf->bss[idx]) + if (!conf) goto out; + if (idx > conf->num_bss || !conf->bss[idx]) + goto free; + + if (ucv_boolean_get(files_only)) { + struct hostapd_bss_config *bss = conf->bss[idx]; + struct hostapd_bss_config *old_bss = hapd->conf; + +#define swap_field(name) \ + do { \ + void *ptr = old_bss->name; \ + old_bss->name = bss->name; \ + bss->name = ptr; \ + } while (0) + + swap_field(ssid.wpa_psk_file); + ret = bss_reload_vlans(hapd, bss); + goto done; + } + hostapd_bss_deinit_no_free(hapd); hostapd_drv_stop_ap(hapd); hostapd_free_hapd_data(hapd); @@ -143,12 +252,14 @@ uc_hostapd_bss_set_config(uc_vm_t *vm, size_t nargs) iface->conf->bss[i] = conf->bss[idx]; hapd->conf = conf->bss[idx]; conf->bss[idx] = old_bss; - hostapd_config_free(conf); - hostapd_setup_bss(hapd, hapd == iface->bss[0], !iface->conf->mbssid); + hostapd_setup_bss(hapd, hapd == iface->bss[0], true); + hostapd_ucode_update_interfaces(); +done: ret = 0; - +free: + hostapd_config_free(conf); out: return ucv_int64_new(ret); } @@ -179,10 +290,15 @@ uc_hostapd_bss_delete(uc_vm_t *vm, size_t nargs) struct hostapd_iface *iface; int i, idx; - if (!hapd || hapd == hapd->iface->bss[0]) + if (!hapd) return NULL; iface = hapd->iface; + if (iface->num_bss == 1) { + wpa_printf(MSG_ERROR, "trying to delete last bss of an iface: %s\n", hapd->conf->iface); + return NULL; + } + for (idx = 0; idx < iface->num_bss; idx++) if (iface->bss[idx] == hapd) break; @@ -192,8 +308,13 @@ uc_hostapd_bss_delete(uc_vm_t *vm, size_t nargs) for (i = idx + 1; i < iface->num_bss; i++) iface->bss[i - 1] = iface->bss[i]; + iface->num_bss--; + iface->bss[0]->interface_added = 0; + hostapd_drv_set_first_bss(iface->bss[0]); + hapd->interface_added = 1; + hostapd_drv_stop_ap(hapd); hostapd_bss_deinit(hapd); hostapd_remove_iface_bss_conf(iface->conf, hapd->conf); @@ -267,6 +388,58 @@ uc_hostapd_iface_add_bss(uc_vm_t *vm, size_t nargs) return ret; } +static uc_value_t * +uc_hostapd_iface_set_bss_order(uc_vm_t *vm, size_t nargs) +{ + struct hostapd_iface *iface = uc_fn_thisval("hostapd.iface"); + uc_value_t *bss_list = uc_fn_arg(0); + struct hostapd_data **new_bss; + struct hostapd_bss_config **new_conf; + + if (!iface) + return NULL; + + if (ucv_type(bss_list) != UC_ARRAY || + ucv_array_length(bss_list) != iface->num_bss) + return NULL; + + new_bss = calloc(iface->num_bss, sizeof(*new_bss)); + new_conf = calloc(iface->num_bss, sizeof(*new_conf)); + for (size_t i = 0; i < iface->num_bss; i++) { + struct hostapd_data *bss; + + bss = ucv_resource_data(ucv_array_get(bss_list, i), "hostapd.bss"); + if (bss->iface != iface) + goto free; + + for (size_t k = 0; k < i; k++) + if (new_bss[k] == bss) + goto free; + + new_bss[i] = bss; + new_conf[i] = bss->conf; + } + + new_bss[0]->interface_added = 0; + for (size_t i = 1; i < iface->num_bss; i++) + new_bss[i]->interface_added = 1; + + free(iface->bss); + iface->bss = new_bss; + + free(iface->conf->bss); + iface->conf->bss = new_conf; + iface->conf->num_bss = iface->num_bss; + hostapd_drv_set_first_bss(iface->bss[0]); + + return ucv_boolean_new(true); + +free: + free(new_bss); + free(new_conf); + return NULL; +} + static uc_value_t * uc_hostapd_bss_ctrl(uc_vm_t *vm, size_t nargs) { @@ -292,18 +465,44 @@ uc_hostapd_bss_ctrl(uc_vm_t *vm, size_t nargs) return ucv_string_new_length(reply, reply_len); } +static void +uc_hostapd_disable_iface(struct hostapd_iface *iface) +{ + switch (iface->state) { + case HAPD_IFACE_DISABLED: + break; +#ifdef CONFIG_ACS + case HAPD_IFACE_ACS: + acs_cleanup(iface); + iface->scan_cb = NULL; + /* fallthrough */ +#endif + default: + hostapd_disable_iface(iface); + break; + } +} + static uc_value_t * uc_hostapd_iface_stop(uc_vm_t *vm, size_t nargs) { struct hostapd_iface *iface = uc_fn_thisval("hostapd.iface"); int i; + if (!iface) + return NULL; + + if (iface->state != HAPD_IFACE_ENABLED) + uc_hostapd_disable_iface(iface); + for (i = 0; i < iface->num_bss; i++) { struct hostapd_data *hapd = iface->bss[i]; hostapd_drv_stop_ap(hapd); - hapd->started = 0; + hapd->beacon_set_done = 0; } + + return NULL; } static uc_value_t * @@ -312,27 +511,37 @@ uc_hostapd_iface_start(uc_vm_t *vm, size_t nargs) struct hostapd_iface *iface = uc_fn_thisval("hostapd.iface"); uc_value_t *info = uc_fn_arg(0); struct hostapd_config *conf; + bool changed = false; uint64_t intval; int i; if (!iface) return NULL; - if (!info) + if (!info) { + iface->freq = 0; goto out; + } if (ucv_type(info) != UC_OBJECT) return NULL; +#define UPDATE_VAL(field, name) \ + if ((intval = ucv_int64_get(ucv_object_get(info, name, NULL))) && \ + !errno && intval != conf->field) do { \ + conf->field = intval; \ + changed = true; \ + } while(0) + conf = iface->conf; - if ((intval = ucv_int64_get(ucv_object_get(info, "op_class", NULL))) && !errno) - conf->op_class = intval; - if ((intval = ucv_int64_get(ucv_object_get(info, "hw_mode", NULL))) && !errno) - conf->hw_mode = intval; - if ((intval = ucv_int64_get(ucv_object_get(info, "channel", NULL))) && !errno) - conf->channel = intval; - if ((intval = ucv_int64_get(ucv_object_get(info, "sec_channel", NULL))) && !errno) - conf->secondary_channel = intval; + UPDATE_VAL(op_class, "op_class"); + UPDATE_VAL(hw_mode, "hw_mode"); + UPDATE_VAL(channel, "channel"); + UPDATE_VAL(secondary_channel, "sec_channel"); + if (!changed && + (iface->bss[0]->beacon_set_done || + iface->state == HAPD_IFACE_DFS)) + return ucv_boolean_new(true); intval = ucv_int64_get(ucv_object_get(info, "center_seg0_idx", NULL)); if (!errno) @@ -346,13 +555,30 @@ uc_hostapd_iface_start(uc_vm_t *vm, size_t nargs) if (!errno) hostapd_set_oper_chwidth(conf, intval); + intval = ucv_int64_get(ucv_object_get(info, "frequency", NULL)); + if (!errno) + iface->freq = intval; + else + iface->freq = 0; + conf->acs = 0; + out: - if (conf->channel) + switch (iface->state) { + case HAPD_IFACE_ENABLED: + if (!hostapd_is_dfs_required(iface) || + hostapd_is_dfs_chan_available(iface)) + break; + wpa_printf(MSG_INFO, "DFS CAC required on new channel, restart interface"); + /* fallthrough */ + default: + uc_hostapd_disable_iface(iface); + break; + } + + if (conf->channel && !iface->freq) iface->freq = hostapd_hw_get_freq(iface->bss[0], conf->channel); - if (hostapd_is_dfs_required(iface) && !hostapd_is_dfs_chan_available(iface)) { - wpa_printf(MSG_INFO, "DFS CAC required on new channel, restart interface"); - hostapd_disable_iface(iface); + if (iface->state != HAPD_IFACE_ENABLED) { hostapd_enable_iface(iface); return ucv_boolean_new(true); } @@ -361,7 +587,6 @@ uc_hostapd_iface_start(uc_vm_t *vm, size_t nargs) struct hostapd_data *hapd = iface->bss[i]; int ret; - hapd->started = 1; hapd->conf->start_disabled = 0; hostapd_set_freq(hapd, conf->hw_mode, iface->freq, conf->channel, @@ -428,6 +653,55 @@ uc_hostapd_iface_switch_channel(uc_vm_t *vm, size_t nargs) return ucv_boolean_new(!ret); } +static uc_value_t * +uc_hostapd_bss_rename(uc_vm_t *vm, size_t nargs) +{ + struct hostapd_data *hapd = uc_fn_thisval("hostapd.bss"); + uc_value_t *ifname_arg = uc_fn_arg(0); + char prev_ifname[IFNAMSIZ + 1]; + struct sta_info *sta; + const char *ifname; + int ret; + + if (!hapd || ucv_type(ifname_arg) != UC_STRING) + return NULL; + + os_strlcpy(prev_ifname, hapd->conf->iface, sizeof(prev_ifname)); + ifname = ucv_string_get(ifname_arg); + + hostapd_ubus_free_bss(hapd); + if (interfaces->ctrl_iface_deinit) + interfaces->ctrl_iface_deinit(hapd); + + ret = hostapd_drv_if_rename(hapd, WPA_IF_AP_BSS, NULL, ifname); + if (ret) + goto out; + + for (sta = hapd->sta_list; sta; sta = sta->next) { + char cur_name[IFNAMSIZ + 1], new_name[IFNAMSIZ + 1]; + + if (!(sta->flags & WLAN_STA_WDS) || sta->pending_wds_enable) + continue; + + snprintf(cur_name, sizeof(cur_name), "%s.sta%d", prev_ifname, sta->aid); + snprintf(new_name, sizeof(new_name), "%s.sta%d", ifname, sta->aid); + hostapd_drv_if_rename(hapd, WPA_IF_AP_VLAN, cur_name, new_name); + } + + if (!strncmp(hapd->conf->ssid.vlan, hapd->conf->iface, sizeof(hapd->conf->ssid.vlan))) + os_strlcpy(hapd->conf->ssid.vlan, ifname, sizeof(hapd->conf->ssid.vlan)); + os_strlcpy(hapd->conf->iface, ifname, sizeof(hapd->conf->iface)); + hostapd_ubus_add_bss(hapd); + + hostapd_ucode_update_interfaces(); +out: + if (interfaces->ctrl_iface_init) + interfaces->ctrl_iface_init(hapd); + + return ret ? NULL : ucv_boolean_new(true); +} + + int hostapd_ucode_init(struct hapd_interfaces *ifaces) { static const uc_function_list_t global_fns[] = { @@ -441,9 +715,11 @@ int hostapd_ucode_init(struct hapd_interfaces *ifaces) static const uc_function_list_t bss_fns[] = { { "ctrl", uc_hostapd_bss_ctrl }, { "set_config", uc_hostapd_bss_set_config }, + { "rename", uc_hostapd_bss_rename }, { "delete", uc_hostapd_bss_delete }, }; static const uc_function_list_t iface_fns[] = { + { "set_bss_order", uc_hostapd_iface_set_bss_order }, { "add_bss", uc_hostapd_iface_add_bss }, { "stop", uc_hostapd_iface_stop }, { "start", uc_hostapd_iface_start }, diff --git a/package/network/services/hostapd/src/wpa_supplicant/ucode.c b/package/network/services/hostapd/src/wpa_supplicant/ucode.c index 55d22584ff4d4d..6cba73dcd53240 100644 --- a/package/network/services/hostapd/src/wpa_supplicant/ucode.c +++ b/package/network/services/hostapd/src/wpa_supplicant/ucode.c @@ -136,6 +136,7 @@ static uc_value_t * uc_wpas_add_iface(uc_vm_t *vm, size_t nargs) { uc_value_t *info = uc_fn_arg(0); + uc_value_t *driver = ucv_object_get(info, "driver", NULL); uc_value_t *ifname = ucv_object_get(info, "iface", NULL); uc_value_t *bridge = ucv_object_get(info, "bridge", NULL); uc_value_t *config = ucv_object_get(info, "config", NULL); @@ -154,6 +155,22 @@ uc_wpas_add_iface(uc_vm_t *vm, size_t nargs) .ctrl_interface = ucv_string_get(ctrl), }; + if (driver) { + const char *drvname; + if (ucv_type(driver) != UC_STRING) + goto out; + + iface.driver = NULL; + drvname = ucv_string_get(driver); + for (int i = 0; wpa_drivers[i]; i++) { + if (!strcmp(drvname, wpa_drivers[i]->name)) + iface.driver = wpa_drivers[i]->name; + } + + if (!iface.driver) + goto out; + } + if (!iface.ifname || !iface.confname) goto out; diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init index 5b39144921f10a..e1e8ac9fd4a5f7 100644 --- a/package/network/services/lldpd/files/lldpd.init +++ b/package/network/services/lldpd/files/lldpd.init @@ -45,12 +45,16 @@ write_lldpd_conf() local lldp_mgmt_ip config_get lldp_mgmt_ip 'config' 'lldp_mgmt_ip' + local lldp_syscapabilities + config_get lldp_syscapabilities 'config' 'lldp_syscapabilities' + # Clear out the config file first echo -n > "$LLDPD_CONF" [ -n "$ifnames" ] && echo "configure system interface pattern" "$ifnames" >> "$LLDPD_CONF" [ -n "$lldp_description" ] && echo "configure system description" "\"$lldp_description\"" >> "$LLDPD_CONF" [ -n "$lldp_hostname" ] && echo "configure system hostname" "\"$lldp_hostname\"" >> "$LLDPD_CONF" [ -n "$lldp_mgmt_ip" ] && echo "configure system ip management pattern" "\"$lldp_mgmt_ip\"" >> "$LLDPD_CONF" + [ -n "$lldp_syscapabilities" ] && echo "configure system capabilities enabled" "\"$lldp_syscapabilities\"" >> "$LLDPD_CONF" # Since lldpd's sysconfdir is /tmp, we'll symlink /etc/lldpd.d to /tmp/$LLDPD_CONFS_DIR [ -e $LLDPD_CONFS_DIR ] || ln -s /etc/lldpd.d $LLDPD_CONFS_DIR diff --git a/package/network/utils/ebtables/Makefile b/package/network/utils/ebtables/Makefile index 67cc14a76089b6..f35b768b43754d 100644 --- a/package/network/utils/ebtables/Makefile +++ b/package/network/utils/ebtables/Makefile @@ -17,6 +17,7 @@ PKG_SOURCE_VERSION:=48cff25dfea5b37e16ba5dc6601e98ab140f5f99 PKG_MIRROR_HASH:=1327cdc3402e5e3056819e4e9b6f9d4a5bfd401f2c4f58447afb2c3c73fc8aac PKG_LICENSE:=GPL-2.0 +PKG_CPE_ID:=cpe:/a:netfilter:ebtables include $(INCLUDE_DIR)/package.mk diff --git a/package/network/utils/ipset/Makefile b/package/network/utils/ipset/Makefile index 6d48103d0ecf37..b0aac8fe36ee1d 100644 --- a/package/network/utils/ipset/Makefile +++ b/package/network/utils/ipset/Makefile @@ -18,6 +18,7 @@ PKG_HASH:=be49c9ff489dd6610cad6541e743c3384eac96e9f24707da7b3929d8f2ac64d8 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 +PKG_CPE_ID:=cpe:/a:netfilter:ipset PKG_FIXUP:=autoreconf PKG_INSTALL:=1 diff --git a/package/network/utils/iw/Makefile b/package/network/utils/iw/Makefile index 746c2c3c129cd3..528f6868b232e8 100644 --- a/package/network/utils/iw/Makefile +++ b/package/network/utils/iw/Makefile @@ -17,6 +17,7 @@ PKG_HASH:=f167bbe947dd53bb9ebc0c1dcef5db6ad73ac1d6084f2c6f9376c5c360cc4d4e PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0 +PKG_CPE_ID:=cpe:/a:kernel:iw PKG_BUILD_FLAGS:=gc-sections lto diff --git a/package/system/iucode-tool/Makefile b/package/system/iucode-tool/Makefile index d7c85b2d42d922..c2ea37a5c5c81b 100644 --- a/package/system/iucode-tool/Makefile +++ b/package/system/iucode-tool/Makefile @@ -14,6 +14,7 @@ PKG_RELEASE:=2 PKG_SOURCE:=iucode-tool_$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://gitlab.com/iucode-tool/releases/raw/latest PKG_HASH:=12b88efa4d0d95af08db05a50b3dcb217c0eb2bfc67b483779e33d498ddb2f95 +PKG_CPE_ID:=cpe:/a:iucode-tool_project:iucode-tool PKG_BUILD_DEPENDS:=USE_UCLIBC:argp-standalone USE_MUSL:argp-standalone HOST_BUILD_DEPENDS:=HOST_OS_MACOS:argp-standalone/host diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index d0576c12595dee..7c829260d5ef89 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=procd -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git diff --git a/package/system/procd/files/hotplug.json b/package/system/procd/files/hotplug.json index b930b307a4f3cb..9fecddae6be1f0 100644 --- a/package/system/procd/files/hotplug.json +++ b/package/system/procd/files/hotplug.json @@ -11,6 +11,7 @@ [ "eq", "DEVNAME", "null" ], [ [ "makedev", "/dev/%DEVNAME%", "0666" ], + [ "exec", "/bin/ln", "-s", "/proc/self/fd", "/dev/fd" ], [ "exec", "/bin/ln", "-s", "/proc/self/fd/0", "/dev/stdin" ], [ "exec", "/bin/ln", "-s", "/proc/self/fd/1", "/dev/stdout" ], [ "exec", "/bin/ln", "-s", "/proc/self/fd/2", "/dev/stderr" ], diff --git a/package/utils/adb/Makefile b/package/utils/adb/Makefile index 0482a40da15bfc..c207c333b24dae 100644 --- a/package/utils/adb/Makefile +++ b/package/utils/adb/Makefile @@ -13,6 +13,7 @@ PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION) PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.xz PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR) PKG_MAINTAINER:=Henryk Heisig +PKG_CPE_ID:=cpe:/a:google:android_debug_bridge include $(INCLUDE_DIR)/package.mk diff --git a/package/utils/bsdiff/Makefile b/package/utils/bsdiff/Makefile index 09e6f126f627ac..32e59cea9c6965 100644 --- a/package/utils/bsdiff/Makefile +++ b/package/utils/bsdiff/Makefile @@ -18,6 +18,7 @@ PKG_MAINTAINER:=Hauke Mehrtens HOST_BUILD_DEPENDS:=bzip2/host PKG_LICENSE:=BSD-2-Clause +PKG_CPE_ID:=cpe:/a:daemonology:bsdiff include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/package.mk diff --git a/package/utils/dtc/Makefile b/package/utils/dtc/Makefile index 2e20c29cc641ca..dc10e9c5195b17 100644 --- a/package/utils/dtc/Makefile +++ b/package/utils/dtc/Makefile @@ -15,6 +15,7 @@ PKG_SOURCE_URL:=@KERNEL/software/utils/dtc PKG_MAINTAINER:=Yousong Zhou PKG_LICENSE:=GPL-2.0-only PKG_LICENSE_FILES:=GPL +PKG_CPE_ID:=cpe:/a:dtc_project:dtc PKG_INSTALL:=1 diff --git a/package/utils/lua/Makefile b/package/utils/lua/Makefile index e4d2fd1c500069..9496ffb366be97 100644 --- a/package/utils/lua/Makefile +++ b/package/utils/lua/Makefile @@ -19,6 +19,7 @@ PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYRIGHT +PKG_CPE_ID:=cpe:/a:lua:lua HOST_PATCH_DIR := ./patches-host diff --git a/package/utils/lua5.3/Makefile b/package/utils/lua5.3/Makefile index 9a707fbbab2a07..d43ac59ed4285c 100644 --- a/package/utils/lua5.3/Makefile +++ b/package/utils/lua5.3/Makefile @@ -19,6 +19,7 @@ PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYRIGHT +PKG_CPE_ID:=cpe:/a:lua:lua HOST_PATCH_DIR := ./patches-host diff --git a/scripts/download.pl b/scripts/download.pl index 508147f240bb0a..c14ec07e448d67 100755 --- a/scripts/download.pl +++ b/scripts/download.pl @@ -256,15 +256,14 @@ sub cleanup push @mirrors, "https://mirrors.ustc.edu.cn/debian/$1" } elsif ($mirror =~ /^\@APACHE\/(.+)$/) { push @mirrors, "https://dlcdn.apache.org/$1"; - push @mirrors, "https://mirror.netcologne.de/apache.org/$1"; push @mirrors, "https://mirror.aarnet.edu.au/pub/apache/$1"; push @mirrors, "https://mirror.csclub.uwaterloo.ca/apache/$1"; push @mirrors, "https://archive.apache.org/dist/$1"; - push @mirrors, "http://mirror.cogentco.com/pub/apache/$1"; - push @mirrors, "http://mirror.navercorp.com/apache/$1"; - push @mirrors, "http://ftp.jaist.ac.jp/pub/apache/$1"; - push @mirrors, "ftp://apache.cs.utah.edu/apache.org/$1"; - push @mirrors, "ftp://apache.mirrors.ovh.net/ftp.apache.org/dist/$1"; + push @mirrors, "https://mirror.cogentco.com/pub/apache/$1"; + push @mirrors, "https://mirror.navercorp.com/apache/$1"; + push @mirrors, "https://ftp.jaist.ac.jp/pub/apache/$1"; + push @mirrors, "https://apache.cs.utah.edu/apache.org/$1"; + push @mirrors, "http://apache.mirrors.ovh.net/ftp.apache.org/dist/$1"; push @mirrors, "https://mirrors.tuna.tsinghua.edu.cn/apache/$1"; push @mirrors, "https://mirrors.ustc.edu.cn/apache/$1"; } elsif ($mirror =~ /^\@GITHUB\/(.+)$/) { @@ -275,23 +274,19 @@ sub cleanup } elsif ($mirror =~ /^\@GNU\/(.+)$/) { push @mirrors, "https://mirror.csclub.uwaterloo.ca/gnu/$1"; push @mirrors, "https://mirror.netcologne.de/gnu/$1"; - push @mirrors, "http://ftp.kddilabs.jp/GNU/gnu/$1"; - push @mirrors, "http://www.nic.funet.fi/pub/gnu/gnu/$1"; - push @mirrors, "http://mirror.internode.on.net/pub/gnu/$1"; - push @mirrors, "http://mirror.navercorp.com/gnu/$1"; - push @mirrors, "ftp://mirrors.rit.edu/gnu/$1"; - push @mirrors, "ftp://download.xs4all.nl/pub/gnu/$1"; + push @mirrors, "https://ftp.kddilabs.jp/GNU/gnu/$1"; + push @mirrors, "https://www.nic.funet.fi/pub/gnu/gnu/$1"; + push @mirrors, "https://mirror.navercorp.com/gnu/$1"; + push @mirrors, "https://mirrors.rit.edu/gnu/$1"; push @mirrors, "https://ftp.gnu.org/gnu/$1"; push @mirrors, "https://mirrors.tuna.tsinghua.edu.cn/gnu/$1"; push @mirrors, "https://mirrors.ustc.edu.cn/gnu/$1"; } elsif ($mirror =~ /^\@SAVANNAH\/(.+)$/) { push @mirrors, "https://mirror.netcologne.de/savannah/$1"; push @mirrors, "https://mirror.csclub.uwaterloo.ca/nongnu/$1"; - push @mirrors, "http://ftp.acc.umu.se/mirror/gnu.org/savannah/$1"; - push @mirrors, "http://nongnu.uib.no/$1"; - push @mirrors, "http://ftp.igh.cnrs.fr/pub/nongnu/$1"; - push @mirrors, "ftp://cdimage.debian.org/mirror/gnu.org/savannah/$1"; - push @mirrors, "ftp://ftp.acc.umu.se/mirror/gnu.org/savannah/$1"; + push @mirrors, "https://ftp.acc.umu.se/mirror/gnu.org/savannah/$1"; + push @mirrors, "https://nongnu.uib.no/$1"; + push @mirrors, "https://cdimage.debian.org/mirror/gnu.org/savannah/$1"; } elsif ($mirror =~ /^\@KERNEL\/(.+)$/) { my @extra = ( $1 ); if ($filename =~ /linux-\d+\.\d+(?:\.\d+)?-rc/) { @@ -301,19 +296,17 @@ sub cleanup } foreach my $dir (@extra) { push @mirrors, "https://cdn.kernel.org/pub/$dir"; - push @mirrors, "https://download.xs4all.nl/ftp.kernel.org/pub/$dir"; push @mirrors, "https://mirrors.mit.edu/kernel/$dir"; push @mirrors, "http://ftp.nara.wide.ad.jp/pub/kernel.org/$dir"; push @mirrors, "http://www.ring.gr.jp/archives/linux/kernel.org/$dir"; - push @mirrors, "ftp://ftp.riken.jp/Linux/kernel.org/$dir"; - push @mirrors, "ftp://www.mirrorservice.org/sites/ftp.kernel.org/pub/$dir"; - push @mirrors, "https://mirrors.tuna.tsinghua.edu.cn/kernel/$dir"; + push @mirrors, "https://ftp.riken.jp/Linux/kernel.org/$dir"; + push @mirrors, "https://www.mirrorservice.org/sites/ftp.kernel.org/pub/$dir"; push @mirrors, "https://mirrors.ustc.edu.cn/kernel.org/$dir"; } } elsif ($mirror =~ /^\@GNOME\/(.+)$/) { push @mirrors, "https://download.gnome.org/sources/$1"; push @mirrors, "https://mirror.csclub.uwaterloo.ca/gnome/sources/$1"; - push @mirrors, "http://ftp.acc.umu.se/pub/GNOME/sources/$1"; + push @mirrors, "https://ftp.acc.umu.se/pub/GNOME/sources/$1"; push @mirrors, "http://ftp.cse.buffalo.edu/pub/Gnome/sources/$1"; push @mirrors, "http://ftp.nara.wide.ad.jp/pub/X11/GNOME/sources/$1"; push @mirrors, "https://mirrors.ustc.edu.cn/gnome/sources/$1"; diff --git a/target/linux/apm821xx/patches-6.1/900-powerpc-bootwrapper-force-gzip-as-mkimage-s-compress.patch b/target/linux/apm821xx/patches-6.1/900-powerpc-bootwrapper-force-gzip-as-mkimage-s-compress.patch index 2e2bda7c60fd36..292a252a2ef41a 100644 --- a/target/linux/apm821xx/patches-6.1/900-powerpc-bootwrapper-force-gzip-as-mkimage-s-compress.patch +++ b/target/linux/apm821xx/patches-6.1/900-powerpc-bootwrapper-force-gzip-as-mkimage-s-compress.patch @@ -18,7 +18,7 @@ Signed-off-by: Christian Lamparter --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile -@@ -272,7 +272,7 @@ compressor-$(CONFIG_KERNEL_LZO) := lzo +@@ -274,7 +274,7 @@ compressor-$(CONFIG_KERNEL_LZO) := lzo # args (to if_changed): 1 = (this rule), 2 = platform, 3 = dts 4=dtb 5=initrd quiet_cmd_wrap = WRAP $@ diff --git a/target/linux/armsr/Makefile b/target/linux/armsr/Makefile index b34500ed8a592a..7de77decb55390 100644 --- a/target/linux/armsr/Makefile +++ b/target/linux/armsr/Makefile @@ -15,7 +15,8 @@ include $(INCLUDE_DIR)/target.mk DEFAULT_PACKAGES += mkf2fs e2fsprogs # blkid used for resolving PARTUUID -# in sysupgrade -DEFAULT_PACKAGES += blkid +# in sysupgrade. vfat required for +# mounting ESP partition +DEFAULT_PACKAGES += blkid kmod-fs-vfat $(eval $(call BuildTarget)) diff --git a/target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts b/target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts index d008dd5ec86e08..e2ccef105d6fb6 100644 --- a/target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts +++ b/target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts @@ -65,6 +65,8 @@ gmac-config { device = <&gmac>; rgmii-gmac0 = <1>; + rxdv-delay = <3>; + rxd-delay = <3>; }; }; diff --git a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-16m.dtsi b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-16m.dtsi index e9bd05487c63d2..c112b9a193f3cb 100644 --- a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-16m.dtsi +++ b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-16m.dtsi @@ -75,9 +75,3 @@ }; }; }; - -&wmac { - status = "okay"; - - qca,no-eeprom; -}; diff --git a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-750-r2.dts b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-750-r2.dts new file mode 100644 index 00000000000000..b8fa9f2a7020c6 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-750-r2.dts @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9533_mikrotik_routerboard-16m.dtsi" + +/ { + compatible = "mikrotik,routerboard-750-r2", "qca,qca9533"; + model = "MikroTik RouterBOARD 750 r2 (hEX lite)"; + + aliases { + led-boot = &led_usr; + led-failsafe = &led_usr; + led-upgrade = &led_usr; + led-running = &led_usr; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + + led_usr: usr { + label = "green:usr"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + led1 { + label = "green:port1"; + gpios = <&ssr 0 GPIO_ACTIVE_LOW>; + }; + + led2 { + label = "green:port2"; + gpios = <&ssr 1 GPIO_ACTIVE_LOW>; + }; + + led3 { + label = "green:port3"; + gpios = <&ssr 2 GPIO_ACTIVE_LOW>; + }; + + led4 { + label = "green:port4"; + gpios = <&ssr 3 GPIO_ACTIVE_LOW>; + }; + + led5 { + label = "green:port5"; + gpios = <&ssr 4 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&pinmux { + pmx_spi_cs1: pinmux_spi_cs1 { + pinctrl-single,bits = <0x8 0x0a000000 0xff000000>; + }; +}; + +&spi { + pinctrl-names = "default"; + pinctrl-0 = <&pmx_spi_cs1>; + + cs-gpios = <0>, <&gpio 11 GPIO_ACTIVE_LOW>; + + ssr: ssr@1 { + compatible = "fairchild,74hc595"; + gpio-controller; + #gpio-cells = <2>; + registers-number = <1>; + reg = <1>; + spi-max-frequency = <10000000>; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy4>; +}; diff --git a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-95x.dtsi b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-95x.dtsi index 79c9f44d328012..4f6503f9eac4e6 100644 --- a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-95x.dtsi +++ b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-95x.dtsi @@ -83,6 +83,12 @@ }; }; +&wmac { + status = "okay"; + + qca,no-eeprom; +}; + ð0 { status = "okay"; diff --git a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-lhg-hb.dtsi b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-lhg-hb.dtsi index a45365073be65c..aa5c57b27891d6 100644 --- a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-lhg-hb.dtsi +++ b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-lhg-hb.dtsi @@ -66,6 +66,12 @@ }; }; +&wmac { + status = "okay"; + + qca,no-eeprom; +}; + ð0 { status = "okay"; diff --git a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-map-2nd.dts b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-map-2nd.dts index 25971e6f4321c3..062c3bd061a617 100644 --- a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-map-2nd.dts +++ b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-map-2nd.dts @@ -93,6 +93,12 @@ }; }; +&wmac { + status = "okay"; + + qca,no-eeprom; +}; + ð0 { status = "okay"; diff --git a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-mapl-2nd.dts b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-mapl-2nd.dts index e2442f00950cf7..e337bcc70db878 100644 --- a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-mapl-2nd.dts +++ b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-mapl-2nd.dts @@ -42,6 +42,12 @@ }; }; +&wmac { + status = "okay"; + + qca,no-eeprom; +}; + ð0 { status = "okay"; diff --git a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-wap-2nd.dts b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-wap-2nd.dts index 807941c6081a50..d4d049920c7f3d 100644 --- a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-wap-2nd.dts +++ b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-wap-2nd.dts @@ -36,6 +36,12 @@ }; }; +&wmac { + status = "okay"; + + qca,no-eeprom; +}; + ð0 { status = "okay"; diff --git a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-wapr-2nd.dts b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-wapr-2nd.dts index 49756f3336de29..19ada708d99083 100644 --- a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-wapr-2nd.dts +++ b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-wapr-2nd.dts @@ -50,6 +50,12 @@ }; }; +&wmac { + status = "okay"; + + qca,no-eeprom; +}; + ð0 { status = "okay"; diff --git a/target/linux/ath79/image/mikrotik.mk b/target/linux/ath79/image/mikrotik.mk index 683e9a33304dc0..d26420c7f54c4b 100644 --- a/target/linux/ath79/image/mikrotik.mk +++ b/target/linux/ath79/image/mikrotik.mk @@ -9,6 +9,15 @@ define Device/mikrotik_routerboard-493g endef TARGET_DEVICES += mikrotik_routerboard-493g +define Device/mikrotik_routerboard-750-r2 + $(Device/mikrotik_nor) + SOC := qca9533 + DEVICE_MODEL := RouterBOARD 750 r2 (hEX lite) + IMAGE_SIZE := 16256k + SUPPORTED_DEVICES += rb-750-r2 +endef +TARGET_DEVICES += mikrotik_routerboard-750-r2 + define Device/mikrotik_routerboard-911-lite $(Device/mikrotik_nor) SOC := ar9344 diff --git a/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds b/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds index 31346ebdf581bf..66fa2ee6acdf8a 100644 --- a/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds @@ -16,6 +16,7 @@ mikrotik,routerboard-lhg-5nd) ucidef_set_led_rssi "rssimediumhigh" "rssimediumhigh" "green:rssimediumhigh" "wlan0" "60" "100" ucidef_set_led_rssi "rssihigh" "rssihigh" "green:rssihigh" "wlan0" "80" "100" ;; +mikrotik,routerboard-750-r2|\ mikrotik,routerboard-951ui-2hnd|\ mikrotik,routerboard-951ui-2nd|\ mikrotik,routerboard-952ui-5ac2nd) diff --git a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network index 68c8cfb96e7534..d45af6dbb39b42 100644 --- a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network +++ b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network @@ -14,6 +14,11 @@ ath79_setup_interfaces() ucidef_add_switch "switch1" \ "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3" ;; + mikrotik,routerboard-750-r2) + ucidef_set_interface_wan "eth1" + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan:4" "2:lan:1" "3:lan:3" "4:lan:2" + ;; mikrotik,routerboard-911-lite|\ mikrotik,routerboard-912uag-2hpnd|\ mikrotik,routerboard-lhg-2nd|\ diff --git a/target/linux/ath79/patches-5.15/400-mtd-nor-support-mtd-name-from-device-tree.patch b/target/linux/ath79/patches-5.15/400-mtd-nor-support-mtd-name-from-device-tree.patch index 163bafdb2e5b34..7db6346c37e418 100644 --- a/target/linux/ath79/patches-5.15/400-mtd-nor-support-mtd-name-from-device-tree.patch +++ b/target/linux/ath79/patches-5.15/400-mtd-nor-support-mtd-name-from-device-tree.patch @@ -10,7 +10,7 @@ Signed-off-by: Abhimanyu Vishwakarma --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c -@@ -3107,6 +3107,7 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -3108,6 +3108,7 @@ int spi_nor_scan(struct spi_nor *nor, co struct device *dev = nor->dev; struct mtd_info *mtd = &nor->mtd; struct device_node *np = spi_nor_get_flash_node(nor); @@ -18,7 +18,7 @@ Signed-off-by: Abhimanyu Vishwakarma int ret; int i; -@@ -3161,7 +3162,12 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -3162,7 +3163,12 @@ int spi_nor_scan(struct spi_nor *nor, co if (ret) return ret; diff --git a/target/linux/ath79/patches-5.15/900-unaligned_access_hacks.patch b/target/linux/ath79/patches-5.15/900-unaligned_access_hacks.patch index 1971b9cd010185..53f5b1472d9c5a 100644 --- a/target/linux/ath79/patches-5.15/900-unaligned_access_hacks.patch +++ b/target/linux/ath79/patches-5.15/900-unaligned_access_hacks.patch @@ -750,7 +750,7 @@ SVN-Revision: 35130 EXPORT_SYMBOL(xfrm_parse_spi); --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c -@@ -4158,14 +4158,16 @@ static bool tcp_parse_aligned_timestamp( +@@ -4157,14 +4157,16 @@ static bool tcp_parse_aligned_timestamp( { const __be32 *ptr = (const __be32 *)(th + 1); diff --git a/target/linux/ath79/patches-6.1/370-MIPS-ath79-sanitize-symbols.patch b/target/linux/ath79/patches-6.1/370-MIPS-ath79-sanitize-symbols.patch index 67dc54725a97b0..eac17c2b507be6 100644 --- a/target/linux/ath79/patches-6.1/370-MIPS-ath79-sanitize-symbols.patch +++ b/target/linux/ath79/patches-6.1/370-MIPS-ath79-sanitize-symbols.patch @@ -15,7 +15,7 @@ Signed-off-by: John Crispin --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -258,6 +258,8 @@ config ATH79 +@@ -257,6 +257,8 @@ config ATH79 select SYS_SUPPORTS_BIG_ENDIAN select SYS_SUPPORTS_MIPS16 select SYS_SUPPORTS_ZBOOT_UART_PROM diff --git a/target/linux/ath79/patches-6.1/400-mtd-nor-support-mtd-name-from-device-tree.patch b/target/linux/ath79/patches-6.1/400-mtd-nor-support-mtd-name-from-device-tree.patch index 2f83b23e80967b..3546696a23a5d6 100644 --- a/target/linux/ath79/patches-6.1/400-mtd-nor-support-mtd-name-from-device-tree.patch +++ b/target/linux/ath79/patches-6.1/400-mtd-nor-support-mtd-name-from-device-tree.patch @@ -10,7 +10,7 @@ Signed-off-by: Abhimanyu Vishwakarma --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c -@@ -2941,12 +2941,19 @@ static void spi_nor_set_mtd_info(struct +@@ -2942,12 +2942,19 @@ static void spi_nor_set_mtd_info(struct { struct mtd_info *mtd = &nor->mtd; struct device *dev = nor->dev; diff --git a/target/linux/ath79/patches-6.1/900-unaligned_access_hacks.patch b/target/linux/ath79/patches-6.1/900-unaligned_access_hacks.patch index 6e4b2848c83ed6..943aa1a132f75b 100644 --- a/target/linux/ath79/patches-6.1/900-unaligned_access_hacks.patch +++ b/target/linux/ath79/patches-6.1/900-unaligned_access_hacks.patch @@ -654,7 +654,7 @@ SVN-Revision: 35130 return false; return true; -@@ -800,13 +804,13 @@ static inline void ipv6_addr_set_v4mappe +@@ -805,13 +809,13 @@ static inline void ipv6_addr_set_v4mappe */ static inline int __ipv6_addr_diff32(const void *token1, const void *token2, int addrlen) { @@ -670,7 +670,7 @@ SVN-Revision: 35130 if (xb) return i * 32 + 31 - __fls(ntohl(xb)); } -@@ -1000,17 +1004,18 @@ static inline u32 ip6_multipath_hash_fie +@@ -1005,17 +1009,18 @@ static inline u32 ip6_multipath_hash_fie static inline void ip6_flow_hdr(struct ipv6hdr *hdr, unsigned int tclass, __be32 flowlabel) { @@ -750,7 +750,7 @@ SVN-Revision: 35130 EXPORT_SYMBOL(xfrm_parse_spi); --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c -@@ -4166,14 +4166,16 @@ static bool tcp_parse_aligned_timestamp( +@@ -4165,14 +4165,16 @@ static bool tcp_parse_aligned_timestamp( { const __be32 *ptr = (const __be32 *)(th + 1); diff --git a/target/linux/bcm27xx/patches-6.1/950-0106-Add-dwc_otg-driver.patch b/target/linux/bcm27xx/patches-6.1/950-0106-Add-dwc_otg-driver.patch index a3d861ec2f8b8e..7eadf3f50962cb 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0106-Add-dwc_otg-driver.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0106-Add-dwc_otg-driver.patch @@ -1185,7 +1185,7 @@ Signed-off-by: Jonathan Bell } --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c -@@ -5580,7 +5580,7 @@ static void port_event(struct usb_hub *h +@@ -5636,7 +5636,7 @@ static void port_event(struct usb_hub *h port_dev->over_current_count++; port_over_current_notify(port_dev); @@ -1196,7 +1196,7 @@ Signed-off-by: Jonathan Bell USB_PORT_FEAT_C_OVER_CURRENT); --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c -@@ -2140,6 +2140,85 @@ free_interfaces: +@@ -2135,6 +2135,85 @@ free_interfaces: if (cp->string == NULL && !(dev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS)) cp->string = usb_cache_string(dev, cp->desc.iConfiguration); diff --git a/target/linux/bcm27xx/patches-6.1/950-0110-dmaengine-Add-support-for-BCM2708.patch b/target/linux/bcm27xx/patches-6.1/950-0110-dmaengine-Add-support-for-BCM2708.patch index 7bf10b85ed3f53..0400fbfe7fef78 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0110-dmaengine-Add-support-for-BCM2708.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0110-dmaengine-Add-support-for-BCM2708.patch @@ -199,7 +199,7 @@ Signed-off-by: Phil Elwell select DMA_ENGINE select DMA_VIRTUAL_CHANNELS -@@ -703,6 +703,10 @@ config UNIPHIER_XDMAC +@@ -705,6 +705,10 @@ config UNIPHIER_XDMAC UniPhier platform. This DMA controller can transfer data from memory to memory, memory to peripheral and peripheral to memory. diff --git a/target/linux/bcm27xx/patches-6.1/950-0124-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch b/target/linux/bcm27xx/patches-6.1/950-0124-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch index 72ab99d62e5e7b..79c281ade2ebb8 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0124-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0124-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch @@ -14974,7 +14974,7 @@ Signed-off-by: Ashish Vara config SND_SOC_RT5631 tristate "Realtek ALC5631/RT5631 CODEC" depends on I2C -@@ -1622,6 +1637,9 @@ config SND_SOC_TFA9879 +@@ -1623,6 +1638,9 @@ config SND_SOC_TFA9879 tristate "NXP Semiconductors TFA9879 amplifier" depends on I2C @@ -14984,7 +14984,7 @@ Signed-off-by: Ashish Vara config SND_SOC_TFA989X tristate "NXP/Goodix TFA989X (TFA1) amplifiers" depends on I2C -@@ -2168,4 +2186,8 @@ config SND_SOC_LPASS_TX_MACRO +@@ -2169,4 +2187,8 @@ config SND_SOC_LPASS_TX_MACRO select SND_SOC_LPASS_MACRO_COMMON tristate "Qualcomm TX Macro in LPASS(Low Power Audio SubSystem)" @@ -17615,7 +17615,7 @@ Signed-off-by: Ashish Vara * For devices with more than one control interface, we assume the --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c -@@ -2156,6 +2156,8 @@ static const struct usb_audio_quirk_flag +@@ -2171,6 +2171,8 @@ static const struct usb_audio_quirk_flag QUIRK_FLAG_FIXED_RATE), DEVICE_FLG(0x0ecb, 0x2069, /* JBL Quantum810 Wireless */ QUIRK_FLAG_FIXED_RATE), diff --git a/target/linux/bcm27xx/patches-6.1/950-0146-sc16is7xx-Don-t-spin-if-no-data-received.patch b/target/linux/bcm27xx/patches-6.1/950-0146-sc16is7xx-Don-t-spin-if-no-data-received.patch index 0e9255b0f2d8ae..4c2741eb25dc98 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0146-sc16is7xx-Don-t-spin-if-no-data-received.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0146-sc16is7xx-Don-t-spin-if-no-data-received.patch @@ -12,7 +12,7 @@ Signed-off-by: Phil Elwell --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c -@@ -772,6 +772,8 @@ static bool sc16is7xx_port_irq(struct sc +@@ -770,6 +770,8 @@ static bool sc16is7xx_port_irq(struct sc rxlen = sc16is7xx_port_read(port, SC16IS7XX_RXLVL_REG); if (rxlen) sc16is7xx_handle_rx(port, rxlen, iir); diff --git a/target/linux/bcm27xx/patches-6.1/950-0177-hwrng-iproc-rng200-Add-BCM2838-support.patch b/target/linux/bcm27xx/patches-6.1/950-0177-hwrng-iproc-rng200-Add-BCM2838-support.patch index 89b7fabe2a700e..9a36dd1bcde8ca 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0177-hwrng-iproc-rng200-Add-BCM2838-support.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0177-hwrng-iproc-rng200-Add-BCM2838-support.patch @@ -130,9 +130,9 @@ Signed-off-by: Phil Elwell static void iproc_rng200_cleanup(struct hwrng *rng) { struct iproc_rng200_dev *priv = to_rng_priv(rng); -@@ -182,11 +248,17 @@ static int iproc_rng200_probe(struct pla - return PTR_ERR(priv->base); - } +@@ -184,11 +250,17 @@ static int iproc_rng200_probe(struct pla + + dev_set_drvdata(dev, priv); - priv->rng.name = "iproc-rng200"; - priv->rng.read = iproc_rng200_read; diff --git a/target/linux/bcm27xx/patches-6.1/950-0181-usb-add-plumbing-for-updating-interrupt-endpoint-int.patch b/target/linux/bcm27xx/patches-6.1/950-0181-usb-add-plumbing-for-updating-interrupt-endpoint-int.patch index 8f302fda045a35..34b923fb235ca5 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0181-usb-add-plumbing-for-updating-interrupt-endpoint-int.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0181-usb-add-plumbing-for-updating-interrupt-endpoint-int.patch @@ -27,7 +27,7 @@ Signed-off-by: Jonathan Bell --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c -@@ -1973,6 +1973,16 @@ reset: +@@ -1977,6 +1977,16 @@ reset: return ret; } @@ -46,7 +46,7 @@ Signed-off-by: Jonathan Bell * have been called previously. Use for set_configuration, set_interface, --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c -@@ -1268,6 +1268,21 @@ static void remove_intf_ep_devs(struct u +@@ -1263,6 +1263,21 @@ static void remove_intf_ep_devs(struct u intf->ep_devs_created = 0; } diff --git a/target/linux/bcm27xx/patches-6.1/950-0195-media-i2c-imx477-Support-for-the-Sony-IMX477-sensor.patch b/target/linux/bcm27xx/patches-6.1/950-0195-media-i2c-imx477-Support-for-the-Sony-IMX477-sensor.patch index 91d8f295a2c072..dc2e539f3a2295 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0195-media-i2c-imx477-Support-for-the-Sony-IMX477-sensor.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0195-media-i2c-imx477-Support-for-the-Sony-IMX477-sensor.patch @@ -360,7 +360,7 @@ Signed-off-by: Naushir Patuck M: Alex Dubov --- a/drivers/media/i2c/Kconfig +++ b/drivers/media/i2c/Kconfig -@@ -1023,6 +1023,17 @@ config VIDEO_UDA1342 +@@ -1030,6 +1030,17 @@ config VIDEO_UDA1342 To compile this driver as a module, choose M here: the module will be called uda1342. diff --git a/target/linux/bcm27xx/patches-6.1/950-0196-media-i2c-imx519-Support-for-the-Sony-IMX519-sensor.patch b/target/linux/bcm27xx/patches-6.1/950-0196-media-i2c-imx519-Support-for-the-Sony-IMX519-sensor.patch index 3aecaa17576bca..8ba6f7e5fc1e3d 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0196-media-i2c-imx519-Support-for-the-Sony-IMX519-sensor.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0196-media-i2c-imx519-Support-for-the-Sony-IMX519-sensor.patch @@ -194,7 +194,7 @@ Signed-off-by: Phil Elwell M: Alex Dubov --- a/drivers/media/i2c/Kconfig +++ b/drivers/media/i2c/Kconfig -@@ -228,6 +228,17 @@ config VIDEO_IMX412 +@@ -235,6 +235,17 @@ config VIDEO_IMX412 To compile this driver as a module, choose M here: the module will be called imx412. diff --git a/target/linux/bcm27xx/patches-6.1/950-0204-media-i2c-Add-a-driver-for-the-Infineon-IRS1125-dept.patch b/target/linux/bcm27xx/patches-6.1/950-0204-media-i2c-Add-a-driver-for-the-Infineon-IRS1125-dept.patch index ea1df61b7d83de..ddd62a9dc47a33 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0204-media-i2c-Add-a-driver-for-the-Infineon-IRS1125-dept.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0204-media-i2c-Add-a-driver-for-the-Infineon-IRS1125-dept.patch @@ -21,7 +21,7 @@ Signed-off-by: Markus Proeller --- a/drivers/media/i2c/Kconfig +++ b/drivers/media/i2c/Kconfig -@@ -1366,6 +1366,18 @@ config VIDEO_TW9910 +@@ -1373,6 +1373,18 @@ config VIDEO_TW9910 To compile this driver as a module, choose M here: the module will be called tw9910. diff --git a/target/linux/bcm27xx/patches-6.1/950-0312-media-i2c-add-ov9281-driver.patch b/target/linux/bcm27xx/patches-6.1/950-0312-media-i2c-add-ov9281-driver.patch index e89e6a98eb11d2..58c5997e83c1f8 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0312-media-i2c-add-ov9281-driver.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0312-media-i2c-add-ov9281-driver.patch @@ -105,7 +105,7 @@ Signed-off-by: David Plowman --- a/drivers/media/i2c/Kconfig +++ b/drivers/media/i2c/Kconfig -@@ -1336,6 +1336,17 @@ config VIDEO_TW2804 +@@ -1343,6 +1343,17 @@ config VIDEO_TW2804 To compile this driver as a module, choose M here: the module will be called tw2804. diff --git a/target/linux/bcm27xx/patches-6.1/950-0332-drm-panel-simple-Add-a-timing-for-the-Raspberry-Pi-7.patch b/target/linux/bcm27xx/patches-6.1/950-0332-drm-panel-simple-Add-a-timing-for-the-Raspberry-Pi-7.patch index 4ce71a86aa7529..5046dff024e475 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0332-drm-panel-simple-Add-a-timing-for-the-Raspberry-Pi-7.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0332-drm-panel-simple-Add-a-timing-for-the-Raspberry-Pi-7.patch @@ -15,7 +15,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c -@@ -3190,6 +3190,31 @@ static const struct panel_desc qishenglo +@@ -3192,6 +3192,31 @@ static const struct panel_desc qishenglo .connector_type = DRM_MODE_CONNECTOR_DPI, }; @@ -47,7 +47,7 @@ Signed-off-by: Dave Stevenson static const struct display_timing rocktech_rk070er9427_timing = { .pixelclock = { 26400000, 33300000, 46800000 }, .hactive = { 800, 800, 800 }, -@@ -4221,6 +4246,9 @@ static const struct of_device_id platfor +@@ -4223,6 +4248,9 @@ static const struct of_device_id platfor .compatible = "qishenglong,gopher2b-lcd", .data = &qishenglong_gopher2b_lcd, }, { diff --git a/target/linux/bcm27xx/patches-6.1/950-0383-drm-panel-simple-add-Geekworm-MZP280-Panel.patch b/target/linux/bcm27xx/patches-6.1/950-0383-drm-panel-simple-add-Geekworm-MZP280-Panel.patch index 5b7d4cb218d7ce..83ba935113213e 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0383-drm-panel-simple-add-Geekworm-MZP280-Panel.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0383-drm-panel-simple-add-Geekworm-MZP280-Panel.patch @@ -13,7 +13,7 @@ Acked-by: Maxime Ripard --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c -@@ -1944,6 +1944,32 @@ static const struct panel_desc friendlya +@@ -1946,6 +1946,32 @@ static const struct panel_desc friendlya }, }; @@ -46,7 +46,7 @@ Acked-by: Maxime Ripard static const struct drm_display_mode giantplus_gpg482739qs5_mode = { .clock = 9000, .hdisplay = 480, -@@ -4105,6 +4131,9 @@ static const struct of_device_id platfor +@@ -4107,6 +4133,9 @@ static const struct of_device_id platfor .compatible = "friendlyarm,hd702e", .data = &friendlyarm_hd702e, }, { diff --git a/target/linux/bcm27xx/patches-6.1/950-0393-media-i2c-Add-driver-for-Omnivision-OV2311.patch b/target/linux/bcm27xx/patches-6.1/950-0393-media-i2c-Add-driver-for-Omnivision-OV2311.patch index 5db533297defd4..cff524e2f1b076 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0393-media-i2c-Add-driver-for-Omnivision-OV2311.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0393-media-i2c-Add-driver-for-Omnivision-OV2311.patch @@ -16,7 +16,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/media/i2c/Kconfig +++ b/drivers/media/i2c/Kconfig -@@ -395,6 +395,17 @@ config VIDEO_OV13B10 +@@ -402,6 +402,17 @@ config VIDEO_OV13B10 This is a Video4Linux2 sensor driver for the OmniVision OV13B10 camera. diff --git a/target/linux/bcm27xx/patches-6.1/950-0397-media-i2c-Add-driver-for-AD5398-VCM-lens-driver.patch b/target/linux/bcm27xx/patches-6.1/950-0397-media-i2c-Add-driver-for-AD5398-VCM-lens-driver.patch index e5b20d2d1eff80..00420b044c5d4a 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0397-media-i2c-Add-driver-for-AD5398-VCM-lens-driver.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0397-media-i2c-Add-driver-for-AD5398-VCM-lens-driver.patch @@ -17,7 +17,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/media/i2c/Kconfig +++ b/drivers/media/i2c/Kconfig -@@ -810,6 +810,13 @@ endmenu +@@ -817,6 +817,13 @@ endif menu "Lens drivers" visible if MEDIA_CAMERA_SUPPORT diff --git a/target/linux/bcm27xx/patches-6.1/950-0410-media-i2c-Add-driver-of-Arducam-Pivariety-series-cam.patch b/target/linux/bcm27xx/patches-6.1/950-0410-media-i2c-Add-driver-of-Arducam-Pivariety-series-cam.patch index 443f5b0c4f08b2..04c69d186a6030 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0410-media-i2c-Add-driver-of-Arducam-Pivariety-series-cam.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0410-media-i2c-Add-driver-of-Arducam-Pivariety-series-cam.patch @@ -25,7 +25,7 @@ Signed-off-by: Phil Elwell --- a/drivers/media/i2c/Kconfig +++ b/drivers/media/i2c/Kconfig -@@ -47,6 +47,17 @@ config VIDEO_AR0521 +@@ -54,6 +54,17 @@ config VIDEO_AR0521 To compile this driver as a module, choose M here: the module will be called ar0521. diff --git a/target/linux/bcm27xx/patches-6.1/950-0414-media-i2c-Update-ov2311-Kconfig-entry.patch b/target/linux/bcm27xx/patches-6.1/950-0414-media-i2c-Update-ov2311-Kconfig-entry.patch index e998a44aaea607..f874c934da9fc5 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0414-media-i2c-Update-ov2311-Kconfig-entry.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0414-media-i2c-Update-ov2311-Kconfig-entry.patch @@ -12,7 +12,7 @@ Signed-off-by: Phil Elwell --- a/drivers/media/i2c/Kconfig +++ b/drivers/media/i2c/Kconfig -@@ -409,7 +409,6 @@ config VIDEO_OV13B10 +@@ -416,7 +416,6 @@ config VIDEO_OV13B10 config VIDEO_OV2311 tristate "OmniVision OV2311 sensor support" depends on I2C && VIDEO_DEV diff --git a/target/linux/bcm27xx/patches-6.1/950-0415-media-i2c-Update-ov9281-Kconfig-entry.patch b/target/linux/bcm27xx/patches-6.1/950-0415-media-i2c-Update-ov9281-Kconfig-entry.patch index 00aa8dd4c56d2d..b6e0e800701fc4 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0415-media-i2c-Update-ov9281-Kconfig-entry.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0415-media-i2c-Update-ov9281-Kconfig-entry.patch @@ -12,7 +12,7 @@ Signed-off-by: Phil Elwell --- a/drivers/media/i2c/Kconfig +++ b/drivers/media/i2c/Kconfig -@@ -1367,7 +1367,6 @@ config VIDEO_TW2804 +@@ -1374,7 +1374,6 @@ config VIDEO_TW2804 config VIDEO_OV9281 tristate "OmniVision OV9281 sensor support" depends on I2C && VIDEO_DEV diff --git a/target/linux/bcm27xx/patches-6.1/950-0416-media-i2c-Update-irs1125-Kconfig-entry.patch b/target/linux/bcm27xx/patches-6.1/950-0416-media-i2c-Update-irs1125-Kconfig-entry.patch index 85634b9997cce1..6f27e4be3757c4 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0416-media-i2c-Update-irs1125-Kconfig-entry.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0416-media-i2c-Update-irs1125-Kconfig-entry.patch @@ -12,7 +12,7 @@ Signed-off-by: Phil Elwell --- a/drivers/media/i2c/Kconfig +++ b/drivers/media/i2c/Kconfig -@@ -1406,8 +1406,8 @@ config VIDEO_TW9910 +@@ -1413,8 +1413,8 @@ config VIDEO_TW9910 config VIDEO_IRS1125 tristate "Infineon IRS1125 sensor support" diff --git a/target/linux/bcm27xx/patches-6.1/950-0424-media-i2c-Add-driver-of-Arducam-64MP-camera.patch b/target/linux/bcm27xx/patches-6.1/950-0424-media-i2c-Add-driver-of-Arducam-64MP-camera.patch index 9c34715236aa9a..faf453206c3928 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0424-media-i2c-Add-driver-of-Arducam-64MP-camera.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0424-media-i2c-Add-driver-of-Arducam-64MP-camera.patch @@ -26,7 +26,7 @@ Signed-off-by: Lee Jackson --- a/drivers/media/i2c/Kconfig +++ b/drivers/media/i2c/Kconfig -@@ -47,6 +47,17 @@ config VIDEO_AR0521 +@@ -54,6 +54,17 @@ config VIDEO_AR0521 To compile this driver as a module, choose M here: the module will be called ar0521. diff --git a/target/linux/bcm27xx/patches-6.1/950-0521-drm-panel-simple-Add-Innolux-AT056tN53V1-5.6-VGA.patch b/target/linux/bcm27xx/patches-6.1/950-0521-drm-panel-simple-Add-Innolux-AT056tN53V1-5.6-VGA.patch index 411c9c7c109f33..09324871aaff52 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0521-drm-panel-simple-Add-Innolux-AT056tN53V1-5.6-VGA.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0521-drm-panel-simple-Add-Innolux-AT056tN53V1-5.6-VGA.patch @@ -126,7 +126,7 @@ Signed-off-by: Phil Elwell - MEDIA_BUS_FMT_RGB666_1X24_CPADHI --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c -@@ -2136,6 +2136,38 @@ static const struct panel_desc innolux_a +@@ -2138,6 +2138,38 @@ static const struct panel_desc innolux_a .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE, }; @@ -165,7 +165,7 @@ Signed-off-by: Phil Elwell static const struct drm_display_mode innolux_at070tn92_mode = { .clock = 33333, .hdisplay = 800, -@@ -4141,6 +4173,9 @@ static const struct of_device_id platfor +@@ -4143,6 +4175,9 @@ static const struct of_device_id platfor .compatible = "innolux,at043tn24", .data = &innolux_at043tn24, }, { diff --git a/target/linux/bcm27xx/patches-6.1/950-0529-media-i2c-Add-a-driver-for-the-Sony-IMX708-image-sen.patch b/target/linux/bcm27xx/patches-6.1/950-0529-media-i2c-Add-a-driver-for-the-Sony-IMX708-image-sen.patch index 1f8cda317893e1..b4154c9cca85b8 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0529-media-i2c-Add-a-driver-for-the-Sony-IMX708-image-sen.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0529-media-i2c-Add-a-driver-for-the-Sony-IMX708-image-sen.patch @@ -26,7 +26,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/media/i2c/Kconfig +++ b/drivers/media/i2c/Kconfig -@@ -261,6 +261,19 @@ config VIDEO_IMX519 +@@ -268,6 +268,19 @@ config VIDEO_IMX519 To compile this driver as a module, choose M here: the module will be called IMX519. diff --git a/target/linux/bcm27xx/patches-6.1/950-0594-media-i2c-IMX296-camera-sensor-driver.patch b/target/linux/bcm27xx/patches-6.1/950-0594-media-i2c-IMX296-camera-sensor-driver.patch index 2581db28235159..94ddb850c32a11 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0594-media-i2c-IMX296-camera-sensor-driver.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0594-media-i2c-IMX296-camera-sensor-driver.patch @@ -33,7 +33,7 @@ Signed-off-by: Sakari Ailus M: Bingbu Cao --- a/drivers/media/i2c/Kconfig +++ b/drivers/media/i2c/Kconfig -@@ -184,6 +184,19 @@ config VIDEO_IMX290 +@@ -191,6 +191,19 @@ config VIDEO_IMX290 To compile this driver as a module, choose M here: the module will be called imx290. diff --git a/target/linux/bcm27xx/patches-6.1/960-hwrng-iproc-set-quality-to-1000.patch b/target/linux/bcm27xx/patches-6.1/960-hwrng-iproc-set-quality-to-1000.patch index b23d63f75c7c1e..c1b4879a7c8cf0 100644 --- a/target/linux/bcm27xx/patches-6.1/960-hwrng-iproc-set-quality-to-1000.patch +++ b/target/linux/bcm27xx/patches-6.1/960-hwrng-iproc-set-quality-to-1000.patch @@ -15,7 +15,7 @@ Signed-off-by: Álvaro Fernández Rojas --- a/drivers/char/hw_random/iproc-rng200.c +++ b/drivers/char/hw_random/iproc-rng200.c -@@ -250,6 +250,7 @@ static int iproc_rng200_probe(struct pla +@@ -252,6 +252,7 @@ static int iproc_rng200_probe(struct pla priv->rng.name = pdev->name; priv->rng.cleanup = iproc_rng200_cleanup; diff --git a/target/linux/bcm47xx/patches-5.15/100-v5.18-mtd-rawnand-brcmnand-Assign-soc-as-early-as-possible.patch b/target/linux/bcm47xx/patches-5.15/100-v5.18-mtd-rawnand-brcmnand-Assign-soc-as-early-as-possible.patch index a87d6acd0caf3b..ce14834fa71b63 100644 --- a/target/linux/bcm47xx/patches-5.15/100-v5.18-mtd-rawnand-brcmnand-Assign-soc-as-early-as-possible.patch +++ b/target/linux/bcm47xx/patches-5.15/100-v5.18-mtd-rawnand-brcmnand-Assign-soc-as-early-as-possible.patch @@ -14,7 +14,7 @@ Signed-off-by: Florian Fainelli --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c -@@ -2998,6 +2998,7 @@ int brcmnand_probe(struct platform_devic +@@ -3033,6 +3033,7 @@ int brcmnand_probe(struct platform_devic dev_set_drvdata(dev, ctrl); ctrl->dev = dev; @@ -22,7 +22,7 @@ Signed-off-by: Florian Fainelli init_completion(&ctrl->done); init_completion(&ctrl->dma_done); -@@ -3138,8 +3139,6 @@ int brcmnand_probe(struct platform_devic +@@ -3173,8 +3174,6 @@ int brcmnand_probe(struct platform_devic * interesting ways */ if (soc) { diff --git a/target/linux/bcm47xx/patches-5.15/101-v5.18-mtd-rawnand-brcmnand-Allow-SoC-to-provide-I-O-operations.patch b/target/linux/bcm47xx/patches-5.15/101-v5.18-mtd-rawnand-brcmnand-Allow-SoC-to-provide-I-O-operations.patch index 8da25358655312..60671658fedf85 100644 --- a/target/linux/bcm47xx/patches-5.15/101-v5.18-mtd-rawnand-brcmnand-Allow-SoC-to-provide-I-O-operations.patch +++ b/target/linux/bcm47xx/patches-5.15/101-v5.18-mtd-rawnand-brcmnand-Allow-SoC-to-provide-I-O-operations.patch @@ -84,7 +84,7 @@ Signed-off-by: Florian Fainelli } static inline void edu_writel(struct brcmnand_controller *ctrl, -@@ -3000,6 +3018,12 @@ int brcmnand_probe(struct platform_devic +@@ -3035,6 +3053,12 @@ int brcmnand_probe(struct platform_devic ctrl->dev = dev; ctrl->soc = soc; diff --git a/target/linux/bcm47xx/patches-5.15/102-v5.18-mtd-rawnand-brcmnand-Avoid-pdev-in-brcmnand_init_cs.patch b/target/linux/bcm47xx/patches-5.15/102-v5.18-mtd-rawnand-brcmnand-Avoid-pdev-in-brcmnand_init_cs.patch index d7eab183d6c616..d514998fd72ace 100644 --- a/target/linux/bcm47xx/patches-5.15/102-v5.18-mtd-rawnand-brcmnand-Avoid-pdev-in-brcmnand_init_cs.patch +++ b/target/linux/bcm47xx/patches-5.15/102-v5.18-mtd-rawnand-brcmnand-Avoid-pdev-in-brcmnand_init_cs.patch @@ -16,7 +16,7 @@ Signed-off-by: Florian Fainelli --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c -@@ -2771,7 +2771,7 @@ static const struct nand_controller_ops +@@ -2806,7 +2806,7 @@ static const struct nand_controller_ops static int brcmnand_init_cs(struct brcmnand_host *host, struct device_node *dn) { struct brcmnand_controller *ctrl = host->ctrl; @@ -25,7 +25,7 @@ Signed-off-by: Florian Fainelli struct mtd_info *mtd; struct nand_chip *chip; int ret; -@@ -2779,7 +2779,7 @@ static int brcmnand_init_cs(struct brcmn +@@ -2814,7 +2814,7 @@ static int brcmnand_init_cs(struct brcmn ret = of_property_read_u32(dn, "reg", &host->cs); if (ret) { @@ -34,7 +34,7 @@ Signed-off-by: Florian Fainelli return -ENXIO; } -@@ -2788,13 +2788,13 @@ static int brcmnand_init_cs(struct brcmn +@@ -2823,13 +2823,13 @@ static int brcmnand_init_cs(struct brcmn nand_set_flash_node(chip, dn); nand_set_controller_data(chip, host); diff --git a/target/linux/bcm47xx/patches-5.15/103-v5.18-mtd-rawnand-brcmnand-Move-OF-operations-out-of-brcmnand_init_cs.patch b/target/linux/bcm47xx/patches-5.15/103-v5.18-mtd-rawnand-brcmnand-Move-OF-operations-out-of-brcmnand_init_cs.patch index e2fa72add1c4af..2e2c05a43244ad 100644 --- a/target/linux/bcm47xx/patches-5.15/103-v5.18-mtd-rawnand-brcmnand-Move-OF-operations-out-of-brcmnand_init_cs.patch +++ b/target/linux/bcm47xx/patches-5.15/103-v5.18-mtd-rawnand-brcmnand-Move-OF-operations-out-of-brcmnand_init_cs.patch @@ -17,7 +17,7 @@ Signed-off-by: Florian Fainelli --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c -@@ -2768,7 +2768,7 @@ static const struct nand_controller_ops +@@ -2803,7 +2803,7 @@ static const struct nand_controller_ops .attach_chip = brcmnand_attach_chip, }; @@ -26,7 +26,7 @@ Signed-off-by: Florian Fainelli { struct brcmnand_controller *ctrl = host->ctrl; struct device *dev = ctrl->dev; -@@ -2777,16 +2777,9 @@ static int brcmnand_init_cs(struct brcmn +@@ -2812,16 +2812,9 @@ static int brcmnand_init_cs(struct brcmn int ret; u16 cfg_offs; @@ -43,7 +43,7 @@ Signed-off-by: Florian Fainelli nand_set_controller_data(chip, host); mtd->name = devm_kasprintf(dev, GFP_KERNEL, "brcmnand.%d", host->cs); -@@ -3193,7 +3186,16 @@ int brcmnand_probe(struct platform_devic +@@ -3228,7 +3221,16 @@ int brcmnand_probe(struct platform_devic host->pdev = pdev; host->ctrl = ctrl; diff --git a/target/linux/bcm47xx/patches-5.15/104-v5.18-mtd-rawnand-brcmnand-Allow-working-without-interrupts.patch b/target/linux/bcm47xx/patches-5.15/104-v5.18-mtd-rawnand-brcmnand-Allow-working-without-interrupts.patch index bdf325d732eb05..0845a7bfa329aa 100644 --- a/target/linux/bcm47xx/patches-5.15/104-v5.18-mtd-rawnand-brcmnand-Allow-working-without-interrupts.patch +++ b/target/linux/bcm47xx/patches-5.15/104-v5.18-mtd-rawnand-brcmnand-Allow-working-without-interrupts.patch @@ -23,7 +23,7 @@ Signed-off-by: Florian Fainelli unsigned int dma_irq; int nand_version; -@@ -1610,7 +1610,7 @@ static bool brcmstb_nand_wait_for_comple +@@ -1642,7 +1642,7 @@ static bool brcmstb_nand_wait_for_comple bool err = false; int sts; @@ -32,7 +32,7 @@ Signed-off-by: Florian Fainelli /* switch to interrupt polling and PIO mode */ disable_ctrl_irqs(ctrl); sts = bcmnand_ctrl_poll_status(ctrl, NAND_CTRL_RDY, -@@ -3144,33 +3144,29 @@ int brcmnand_probe(struct platform_devic +@@ -3179,33 +3179,29 @@ int brcmnand_probe(struct platform_devic } /* IRQ */ diff --git a/target/linux/bcm47xx/patches-5.15/106-v5.18-mtd-rawnand-brcmnand-Allow-platform-data-instantation.patch b/target/linux/bcm47xx/patches-5.15/106-v5.18-mtd-rawnand-brcmnand-Allow-platform-data-instantation.patch index 31d686b9557b41..bf9b410102a38c 100644 --- a/target/linux/bcm47xx/patches-5.15/106-v5.18-mtd-rawnand-brcmnand-Allow-platform-data-instantation.patch +++ b/target/linux/bcm47xx/patches-5.15/106-v5.18-mtd-rawnand-brcmnand-Allow-platform-data-instantation.patch @@ -23,7 +23,7 @@ Signed-off-by: Florian Fainelli #include #include #include -@@ -2768,7 +2769,8 @@ static const struct nand_controller_ops +@@ -2803,7 +2804,8 @@ static const struct nand_controller_ops .attach_chip = brcmnand_attach_chip, }; @@ -33,7 +33,7 @@ Signed-off-by: Florian Fainelli { struct brcmnand_controller *ctrl = host->ctrl; struct device *dev = ctrl->dev; -@@ -2821,7 +2823,7 @@ static int brcmnand_init_cs(struct brcmn +@@ -2856,7 +2858,7 @@ static int brcmnand_init_cs(struct brcmn if (ret) return ret; @@ -42,7 +42,7 @@ Signed-off-by: Florian Fainelli if (ret) nand_cleanup(chip); -@@ -2990,17 +2992,15 @@ static int brcmnand_edu_setup(struct pla +@@ -3025,17 +3027,15 @@ static int brcmnand_edu_setup(struct pla int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc) { @@ -63,7 +63,7 @@ Signed-off-by: Florian Fainelli return -ENODEV; ctrl = devm_kzalloc(dev, sizeof(*ctrl), GFP_KERNEL); -@@ -3027,7 +3027,7 @@ int brcmnand_probe(struct platform_devic +@@ -3062,7 +3062,7 @@ int brcmnand_probe(struct platform_devic /* NAND register range */ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ctrl->nand_base = devm_ioremap_resource(dev, res); @@ -72,7 +72,7 @@ Signed-off-by: Florian Fainelli return PTR_ERR(ctrl->nand_base); /* Enable clock before using NAND registers */ -@@ -3171,7 +3171,6 @@ int brcmnand_probe(struct platform_devic +@@ -3206,7 +3206,6 @@ int brcmnand_probe(struct platform_devic for_each_available_child_of_node(dn, child) { if (of_device_is_compatible(child, "brcm,nandcs")) { @@ -80,7 +80,7 @@ Signed-off-by: Florian Fainelli host = devm_kzalloc(dev, sizeof(*host), GFP_KERNEL); if (!host) { -@@ -3191,7 +3190,7 @@ int brcmnand_probe(struct platform_devic +@@ -3226,7 +3225,7 @@ int brcmnand_probe(struct platform_devic nand_set_flash_node(&host->chip, child); @@ -89,7 +89,7 @@ Signed-off-by: Florian Fainelli if (ret) { devm_kfree(dev, host); continue; /* Try all chip-selects */ -@@ -3201,6 +3200,32 @@ int brcmnand_probe(struct platform_devic +@@ -3236,6 +3235,32 @@ int brcmnand_probe(struct platform_devic } } diff --git a/target/linux/bcm53xx/patches-5.15/030-v5.16-0019-ARM-dts-BCM53573-Describe-on-SoC-BCM53125-rev-4-swit.patch b/target/linux/bcm53xx/patches-5.15/030-v5.16-0019-ARM-dts-BCM53573-Describe-on-SoC-BCM53125-rev-4-swit.patch index 3a5438c228241f..914117cb2cb872 100644 --- a/target/linux/bcm53xx/patches-5.15/030-v5.16-0019-ARM-dts-BCM53573-Describe-on-SoC-BCM53125-rev-4-swit.patch +++ b/target/linux/bcm53xx/patches-5.15/030-v5.16-0019-ARM-dts-BCM53573-Describe-on-SoC-BCM53125-rev-4-swit.patch @@ -17,7 +17,7 @@ Signed-off-by: Florian Fainelli --- a/arch/arm/boot/dts/bcm53573.dtsi +++ b/arch/arm/boot/dts/bcm53573.dtsi -@@ -180,6 +180,24 @@ +@@ -183,6 +183,24 @@ gmac0: ethernet@5000 { reg = <0x5000 0x1000>; diff --git a/target/linux/bcm53xx/patches-5.15/034-v6.0-0001-ARM-dts-broadcom-align-gpio-key-node-names-with-dtsc.patch b/target/linux/bcm53xx/patches-5.15/034-v6.0-0001-ARM-dts-broadcom-align-gpio-key-node-names-with-dtsc.patch index 33d675297e3b65..f929dc3b6067a5 100644 --- a/target/linux/bcm53xx/patches-5.15/034-v6.0-0001-ARM-dts-broadcom-align-gpio-key-node-names-with-dtsc.patch +++ b/target/linux/bcm53xx/patches-5.15/034-v6.0-0001-ARM-dts-broadcom-align-gpio-key-node-names-with-dtsc.patch @@ -213,7 +213,7 @@ Signed-off-by: Florian Fainelli gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; --- a/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts +++ b/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts -@@ -25,13 +25,13 @@ +@@ -26,13 +26,13 @@ gpio-keys { compatible = "gpio-keys"; diff --git a/target/linux/bcm53xx/patches-5.15/037-v6.6-0005-ARM-dts-BCM53573-Drop-nonexistent-usb-cells.patch b/target/linux/bcm53xx/patches-5.15/037-v6.6-0005-ARM-dts-BCM53573-Drop-nonexistent-usb-cells.patch index 7836d560a16967..e7a1835d47a978 100644 --- a/target/linux/bcm53xx/patches-5.15/037-v6.6-0005-ARM-dts-BCM53573-Drop-nonexistent-usb-cells.patch +++ b/target/linux/bcm53xx/patches-5.15/037-v6.6-0005-ARM-dts-BCM53573-Drop-nonexistent-usb-cells.patch @@ -21,7 +21,7 @@ Signed-off-by: Florian Fainelli --- a/arch/arm/boot/dts/bcm53573.dtsi +++ b/arch/arm/boot/dts/bcm53573.dtsi -@@ -156,8 +156,6 @@ +@@ -159,8 +159,6 @@ }; ohci: usb@d000 { diff --git a/target/linux/bcm53xx/patches-5.15/037-v6.6-0006-ARM-dts-BCM53573-Add-cells-sizes-to-PCIe-node.patch b/target/linux/bcm53xx/patches-5.15/037-v6.6-0006-ARM-dts-BCM53573-Add-cells-sizes-to-PCIe-node.patch deleted file mode 100644 index 86a52aa505724b..00000000000000 --- a/target/linux/bcm53xx/patches-5.15/037-v6.6-0006-ARM-dts-BCM53573-Add-cells-sizes-to-PCIe-node.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 3392ef368d9b04622fe758b1079b512664b6110a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Fri, 7 Jul 2023 13:40:03 +0200 -Subject: [PATCH] ARM: dts: BCM53573: Add cells sizes to PCIe node -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This fixes: -arch/arm/boot/dts/broadcom/bcm47189-luxul-xap-1440.dtb: pcie@2000: '#address-cells' is a required property - From schema: /lib/python3.10/site-packages/dtschema/schemas/pci/pci-bus.yaml -arch/arm/boot/dts/broadcom/bcm47189-luxul-xap-1440.dtb: pcie@2000: '#size-cells' is a required property - From schema: /lib/python3.10/site-packages/dtschema/schemas/pci/pci-bus.yaml - -Two properties that need to be added later are "device_type" and -"ranges". Adding "device_type" on its own causes a new warning and the -value of "ranges" needs to be determined yet. - -Signed-off-by: Rafał Miłecki -Link: https://lore.kernel.org/r/20230707114004.2740-3-zajec5@gmail.com -Signed-off-by: Florian Fainelli ---- - arch/arm/boot/dts/broadcom/bcm53573.dtsi | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/arch/arm/boot/dts/bcm53573.dtsi -+++ b/arch/arm/boot/dts/bcm53573.dtsi -@@ -127,6 +127,9 @@ - - pcie0: pcie@2000 { - reg = <0x00002000 0x1000>; -+ -+ #address-cells = <3>; -+ #size-cells = <2>; - }; - - usb2: usb2@4000 { diff --git a/target/linux/bcm53xx/patches-5.15/037-v6.6-0007-ARM-dts-BCM53573-Use-updated-spi-gpio-binding-proper.patch b/target/linux/bcm53xx/patches-5.15/037-v6.6-0007-ARM-dts-BCM53573-Use-updated-spi-gpio-binding-proper.patch deleted file mode 100644 index 28d89949e46440..00000000000000 --- a/target/linux/bcm53xx/patches-5.15/037-v6.6-0007-ARM-dts-BCM53573-Use-updated-spi-gpio-binding-proper.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 2c0fd6b3d0778ceab40205315ccef74568490f17 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Fri, 7 Jul 2023 13:40:04 +0200 -Subject: [PATCH] ARM: dts: BCM53573: Use updated "spi-gpio" binding properties -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Switch away from deprecated properties. - -This fixes: -arch/arm/boot/dts/broadcom/bcm947189acdbmr.dtb: spi: gpio-sck: False schema does not allow [[3, 21, 0]] - From schema: Documentation/devicetree/bindings/spi/spi-gpio.yaml -arch/arm/boot/dts/broadcom/bcm947189acdbmr.dtb: spi: gpio-miso: False schema does not allow [[3, 22, 0]] - From schema: Documentation/devicetree/bindings/spi/spi-gpio.yaml -arch/arm/boot/dts/broadcom/bcm947189acdbmr.dtb: spi: gpio-mosi: False schema does not allow [[3, 23, 0]] - From schema: Documentation/devicetree/bindings/spi/spi-gpio.yaml -arch/arm/boot/dts/broadcom/bcm947189acdbmr.dtb: spi: 'sck-gpios' is a required property - From schema: Documentation/devicetree/bindings/spi/spi-gpio.yaml -arch/arm/boot/dts/broadcom/bcm947189acdbmr.dtb: spi: Unevaluated properties are not allowed ('gpio-miso', 'gpio-mosi', 'gpio-sck' were unexpected) - From schema: Documentation/devicetree/bindings/spi/spi-gpio.yaml - -Signed-off-by: Rafał Miłecki -Link: https://lore.kernel.org/r/20230707114004.2740-4-zajec5@gmail.com -Signed-off-by: Florian Fainelli ---- - arch/arm/boot/dts/broadcom/bcm947189acdbmr.dts | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/arch/arm/boot/dts/bcm947189acdbmr.dts -+++ b/arch/arm/boot/dts/bcm947189acdbmr.dts -@@ -60,9 +60,9 @@ - spi { - compatible = "spi-gpio"; - num-chipselects = <1>; -- gpio-sck = <&chipcommon 21 0>; -- gpio-miso = <&chipcommon 22 0>; -- gpio-mosi = <&chipcommon 23 0>; -+ sck-gpios = <&chipcommon 21 0>; -+ miso-gpios = <&chipcommon 22 0>; -+ mosi-gpios = <&chipcommon 23 0>; - cs-gpios = <&chipcommon 24 0>; - #address-cells = <1>; - #size-cells = <0>; diff --git a/target/linux/bcm53xx/patches-5.15/037-v6.6-0008-ARM-dts-BCM5301X-Extend-RAM-to-full-256MB-for-Linksy.patch b/target/linux/bcm53xx/patches-5.15/037-v6.6-0008-ARM-dts-BCM5301X-Extend-RAM-to-full-256MB-for-Linksy.patch deleted file mode 100644 index 6ae8aad3c34f10..00000000000000 --- a/target/linux/bcm53xx/patches-5.15/037-v6.6-0008-ARM-dts-BCM5301X-Extend-RAM-to-full-256MB-for-Linksy.patch +++ /dev/null @@ -1,34 +0,0 @@ -From: Aleksey Nasibulin -Date: Wed, 12 Jul 2023 03:40:17 +0200 -Subject: [PATCH] ARM: dts: BCM5301X: Extend RAM to full 256MB for Linksys - EA6500 V2 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Linksys ea6500-v2 have 256MB of ram. Currently we only use 128MB. -Expand the definition to use all the available RAM. - -Fixes: 03e96644d7a8 ("ARM: dts: BCM5301X: Add basic DT for Linksys EA6500 V2") -Signed-off-by: Aleksey Nasibulin -Signed-off-by: Christian Marangi -Cc: stable@vger.kernel.org -Acked-by: Rafał Miłecki -Link: https://lore.kernel.org/r/20230712014017.28123-1-ansuelsmth@gmail.com -Signed-off-by: Florian Fainelli ---- - arch/arm/boot/dts/broadcom/bcm4708-linksys-ea6500-v2.dts | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts -+++ b/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts -@@ -19,7 +19,8 @@ - - memory@0 { - device_type = "memory"; -- reg = <0x00000000 0x08000000>; -+ reg = <0x00000000 0x08000000>, -+ <0x88000000 0x08000000>; - }; - - gpio-keys { diff --git a/target/linux/bcm53xx/patches-5.15/037-v6.6-0009-ARM-dts-BCM53573-Fix-Ethernet-info-for-Luxul-devices.patch b/target/linux/bcm53xx/patches-5.15/037-v6.6-0009-ARM-dts-BCM53573-Fix-Ethernet-info-for-Luxul-devices.patch index 07dd9296b69359..7930c52b162ab1 100644 --- a/target/linux/bcm53xx/patches-5.15/037-v6.6-0009-ARM-dts-BCM53573-Fix-Ethernet-info-for-Luxul-devices.patch +++ b/target/linux/bcm53xx/patches-5.15/037-v6.6-0009-ARM-dts-BCM53573-Fix-Ethernet-info-for-Luxul-devices.patch @@ -37,7 +37,7 @@ Signed-off-by: Florian Fainelli --- a/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts +++ b/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts -@@ -45,3 +45,16 @@ +@@ -58,3 +58,16 @@ }; }; }; @@ -56,7 +56,7 @@ Signed-off-by: Florian Fainelli +}; --- a/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts +++ b/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts -@@ -81,3 +81,16 @@ +@@ -94,3 +94,16 @@ }; }; }; diff --git a/target/linux/bcm53xx/patches-5.15/037-v6.6-0015-ARM-dts-BCM53573-Disable-second-Ethernet-on-Luxul-de.patch b/target/linux/bcm53xx/patches-5.15/037-v6.6-0015-ARM-dts-BCM53573-Disable-second-Ethernet-on-Luxul-de.patch index 166f602452a904..e9e347075d7a76 100644 --- a/target/linux/bcm53xx/patches-5.15/037-v6.6-0015-ARM-dts-BCM53573-Disable-second-Ethernet-on-Luxul-de.patch +++ b/target/linux/bcm53xx/patches-5.15/037-v6.6-0015-ARM-dts-BCM53573-Disable-second-Ethernet-on-Luxul-de.patch @@ -19,7 +19,7 @@ Signed-off-by: Florian Fainelli --- a/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts +++ b/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts -@@ -60,3 +60,7 @@ +@@ -73,3 +73,7 @@ }; }; }; @@ -29,7 +29,7 @@ Signed-off-by: Florian Fainelli +}; --- a/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts +++ b/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts -@@ -96,3 +96,7 @@ +@@ -109,3 +109,7 @@ }; }; }; diff --git a/target/linux/bcm53xx/patches-6.1/032-v6.6-0005-ARM-dts-BCM53573-Drop-nonexistent-usb-cells.patch b/target/linux/bcm53xx/patches-6.1/032-v6.6-0005-ARM-dts-BCM53573-Drop-nonexistent-usb-cells.patch deleted file mode 100644 index 7836d560a16967..00000000000000 --- a/target/linux/bcm53xx/patches-6.1/032-v6.6-0005-ARM-dts-BCM53573-Drop-nonexistent-usb-cells.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 05d2c3d552b8c92fc397377d9d1112fc58e2cd59 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Fri, 7 Jul 2023 13:40:02 +0200 -Subject: [PATCH] ARM: dts: BCM53573: Drop nonexistent #usb-cells -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Such property simply doesn't exist (is not documented or used anywhere). - -This fixes: -arch/arm/boot/dts/broadcom/bcm47189-luxul-xap-1440.dtb: usb@d000: Unevaluated properties are not allowed ('#usb-cells' was unexpected) - From schema: Documentation/devicetree/bindings/usb/generic-ohci.yaml - -Signed-off-by: Rafał Miłecki -Link: https://lore.kernel.org/r/20230707114004.2740-2-zajec5@gmail.com -Signed-off-by: Florian Fainelli ---- - arch/arm/boot/dts/broadcom/bcm53573.dtsi | 2 -- - 1 file changed, 2 deletions(-) - ---- a/arch/arm/boot/dts/bcm53573.dtsi -+++ b/arch/arm/boot/dts/bcm53573.dtsi -@@ -156,8 +156,6 @@ - }; - - ohci: usb@d000 { -- #usb-cells = <0>; -- - compatible = "generic-ohci"; - reg = <0xd000 0x1000>; - interrupt-parent = <&gic>; diff --git a/target/linux/bcm53xx/patches-6.1/032-v6.6-0006-ARM-dts-BCM53573-Add-cells-sizes-to-PCIe-node.patch b/target/linux/bcm53xx/patches-6.1/032-v6.6-0006-ARM-dts-BCM53573-Add-cells-sizes-to-PCIe-node.patch deleted file mode 100644 index 86a52aa505724b..00000000000000 --- a/target/linux/bcm53xx/patches-6.1/032-v6.6-0006-ARM-dts-BCM53573-Add-cells-sizes-to-PCIe-node.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 3392ef368d9b04622fe758b1079b512664b6110a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Fri, 7 Jul 2023 13:40:03 +0200 -Subject: [PATCH] ARM: dts: BCM53573: Add cells sizes to PCIe node -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This fixes: -arch/arm/boot/dts/broadcom/bcm47189-luxul-xap-1440.dtb: pcie@2000: '#address-cells' is a required property - From schema: /lib/python3.10/site-packages/dtschema/schemas/pci/pci-bus.yaml -arch/arm/boot/dts/broadcom/bcm47189-luxul-xap-1440.dtb: pcie@2000: '#size-cells' is a required property - From schema: /lib/python3.10/site-packages/dtschema/schemas/pci/pci-bus.yaml - -Two properties that need to be added later are "device_type" and -"ranges". Adding "device_type" on its own causes a new warning and the -value of "ranges" needs to be determined yet. - -Signed-off-by: Rafał Miłecki -Link: https://lore.kernel.org/r/20230707114004.2740-3-zajec5@gmail.com -Signed-off-by: Florian Fainelli ---- - arch/arm/boot/dts/broadcom/bcm53573.dtsi | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/arch/arm/boot/dts/bcm53573.dtsi -+++ b/arch/arm/boot/dts/bcm53573.dtsi -@@ -127,6 +127,9 @@ - - pcie0: pcie@2000 { - reg = <0x00002000 0x1000>; -+ -+ #address-cells = <3>; -+ #size-cells = <2>; - }; - - usb2: usb2@4000 { diff --git a/target/linux/bcm53xx/patches-6.1/032-v6.6-0007-ARM-dts-BCM53573-Use-updated-spi-gpio-binding-proper.patch b/target/linux/bcm53xx/patches-6.1/032-v6.6-0007-ARM-dts-BCM53573-Use-updated-spi-gpio-binding-proper.patch deleted file mode 100644 index 28d89949e46440..00000000000000 --- a/target/linux/bcm53xx/patches-6.1/032-v6.6-0007-ARM-dts-BCM53573-Use-updated-spi-gpio-binding-proper.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 2c0fd6b3d0778ceab40205315ccef74568490f17 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Fri, 7 Jul 2023 13:40:04 +0200 -Subject: [PATCH] ARM: dts: BCM53573: Use updated "spi-gpio" binding properties -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Switch away from deprecated properties. - -This fixes: -arch/arm/boot/dts/broadcom/bcm947189acdbmr.dtb: spi: gpio-sck: False schema does not allow [[3, 21, 0]] - From schema: Documentation/devicetree/bindings/spi/spi-gpio.yaml -arch/arm/boot/dts/broadcom/bcm947189acdbmr.dtb: spi: gpio-miso: False schema does not allow [[3, 22, 0]] - From schema: Documentation/devicetree/bindings/spi/spi-gpio.yaml -arch/arm/boot/dts/broadcom/bcm947189acdbmr.dtb: spi: gpio-mosi: False schema does not allow [[3, 23, 0]] - From schema: Documentation/devicetree/bindings/spi/spi-gpio.yaml -arch/arm/boot/dts/broadcom/bcm947189acdbmr.dtb: spi: 'sck-gpios' is a required property - From schema: Documentation/devicetree/bindings/spi/spi-gpio.yaml -arch/arm/boot/dts/broadcom/bcm947189acdbmr.dtb: spi: Unevaluated properties are not allowed ('gpio-miso', 'gpio-mosi', 'gpio-sck' were unexpected) - From schema: Documentation/devicetree/bindings/spi/spi-gpio.yaml - -Signed-off-by: Rafał Miłecki -Link: https://lore.kernel.org/r/20230707114004.2740-4-zajec5@gmail.com -Signed-off-by: Florian Fainelli ---- - arch/arm/boot/dts/broadcom/bcm947189acdbmr.dts | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/arch/arm/boot/dts/bcm947189acdbmr.dts -+++ b/arch/arm/boot/dts/bcm947189acdbmr.dts -@@ -60,9 +60,9 @@ - spi { - compatible = "spi-gpio"; - num-chipselects = <1>; -- gpio-sck = <&chipcommon 21 0>; -- gpio-miso = <&chipcommon 22 0>; -- gpio-mosi = <&chipcommon 23 0>; -+ sck-gpios = <&chipcommon 21 0>; -+ miso-gpios = <&chipcommon 22 0>; -+ mosi-gpios = <&chipcommon 23 0>; - cs-gpios = <&chipcommon 24 0>; - #address-cells = <1>; - #size-cells = <0>; diff --git a/target/linux/bcm53xx/patches-6.1/032-v6.6-0009-ARM-dts-BCM53573-Fix-Ethernet-info-for-Luxul-devices.patch b/target/linux/bcm53xx/patches-6.1/032-v6.6-0009-ARM-dts-BCM53573-Fix-Ethernet-info-for-Luxul-devices.patch index 07dd9296b69359..7930c52b162ab1 100644 --- a/target/linux/bcm53xx/patches-6.1/032-v6.6-0009-ARM-dts-BCM53573-Fix-Ethernet-info-for-Luxul-devices.patch +++ b/target/linux/bcm53xx/patches-6.1/032-v6.6-0009-ARM-dts-BCM53573-Fix-Ethernet-info-for-Luxul-devices.patch @@ -37,7 +37,7 @@ Signed-off-by: Florian Fainelli --- a/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts +++ b/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts -@@ -45,3 +45,16 @@ +@@ -58,3 +58,16 @@ }; }; }; @@ -56,7 +56,7 @@ Signed-off-by: Florian Fainelli +}; --- a/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts +++ b/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts -@@ -81,3 +81,16 @@ +@@ -94,3 +94,16 @@ }; }; }; diff --git a/target/linux/bcm53xx/patches-6.1/032-v6.6-0011-ARM-dts-BCM53573-Fix-Tenda-AC9-switch-CPU-port.patch b/target/linux/bcm53xx/patches-6.1/032-v6.6-0011-ARM-dts-BCM53573-Fix-Tenda-AC9-switch-CPU-port.patch deleted file mode 100644 index d5cb817e8e246e..00000000000000 --- a/target/linux/bcm53xx/patches-6.1/032-v6.6-0011-ARM-dts-BCM53573-Fix-Tenda-AC9-switch-CPU-port.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 7141209db9c335ab261a17933809a3e660ebdc12 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Sun, 23 Jul 2023 21:54:14 +0200 -Subject: [PATCH] ARM: dts: BCM53573: Fix Tenda AC9 switch CPU port -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Primary Ethernet interface is connected to the port 8 (not 5). - -Fixes: 64612828628c ("ARM: dts: BCM53573: Add Tenda AC9 switch ports") -Signed-off-by: Rafał Miłecki -Link: https://lore.kernel.org/r/20230723195416.7831-1-zajec5@gmail.com -Signed-off-by: Florian Fainelli ---- - arch/arm/boot/dts/broadcom/bcm47189-tenda-ac9.dts | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/arch/arm/boot/dts/bcm47189-tenda-ac9.dts -+++ b/arch/arm/boot/dts/bcm47189-tenda-ac9.dts -@@ -135,8 +135,8 @@ - label = "lan4"; - }; - -- port@5 { -- reg = <5>; -+ port@8 { -+ reg = <8>; - label = "cpu"; - ethernet = <&gmac0>; - }; diff --git a/target/linux/bcm53xx/patches-6.1/032-v6.6-0015-ARM-dts-BCM53573-Disable-second-Ethernet-on-Luxul-de.patch b/target/linux/bcm53xx/patches-6.1/032-v6.6-0015-ARM-dts-BCM53573-Disable-second-Ethernet-on-Luxul-de.patch index 166f602452a904..e9e347075d7a76 100644 --- a/target/linux/bcm53xx/patches-6.1/032-v6.6-0015-ARM-dts-BCM53573-Disable-second-Ethernet-on-Luxul-de.patch +++ b/target/linux/bcm53xx/patches-6.1/032-v6.6-0015-ARM-dts-BCM53573-Disable-second-Ethernet-on-Luxul-de.patch @@ -19,7 +19,7 @@ Signed-off-by: Florian Fainelli --- a/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts +++ b/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts -@@ -60,3 +60,7 @@ +@@ -73,3 +73,7 @@ }; }; }; @@ -29,7 +29,7 @@ Signed-off-by: Florian Fainelli +}; --- a/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts +++ b/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts -@@ -96,3 +96,7 @@ +@@ -109,3 +109,7 @@ }; }; }; diff --git a/target/linux/bcm53xx/patches-6.1/905-BCM53573-minor-hacks.patch b/target/linux/bcm53xx/patches-6.1/905-BCM53573-minor-hacks.patch index 721cc3c154893b..0d4962462b4c3f 100644 --- a/target/linux/bcm53xx/patches-6.1/905-BCM53573-minor-hacks.patch +++ b/target/linux/bcm53xx/patches-6.1/905-BCM53573-minor-hacks.patch @@ -61,7 +61,7 @@ Signed-off-by: Rafał Miłecki #include #include #include -@@ -1021,6 +1022,16 @@ static void __init arch_timer_of_configu +@@ -1028,6 +1029,16 @@ static void __init arch_timer_of_configu if (of_property_read_u32(np, "clock-frequency", &arch_timer_rate)) arch_timer_rate = rate; diff --git a/target/linux/bmips/patches-6.1/202-mips-bmips-tweak-Kconfig-options.patch b/target/linux/bmips/patches-6.1/202-mips-bmips-tweak-Kconfig-options.patch index 99d9947c962419..36f8beb89f1518 100644 --- a/target/linux/bmips/patches-6.1/202-mips-bmips-tweak-Kconfig-options.patch +++ b/target/linux/bmips/patches-6.1/202-mips-bmips-tweak-Kconfig-options.patch @@ -13,7 +13,7 @@ Signed-off-by: Álvaro Fernández Rojas --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -275,19 +275,13 @@ config BMIPS_GENERIC +@@ -274,19 +274,13 @@ config BMIPS_GENERIC select SYNC_R4K select COMMON_CLK select BCM6345_L1_IRQ @@ -33,7 +33,7 @@ Signed-off-by: Álvaro Fernández Rojas select SWAP_IO_SPACE select USB_EHCI_BIG_ENDIAN_DESC if CPU_BIG_ENDIAN select USB_EHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN -@@ -297,6 +291,7 @@ config BMIPS_GENERIC +@@ -296,6 +290,7 @@ config BMIPS_GENERIC select HAVE_PCI select PCI_DRIVERS_GENERIC select FW_CFE diff --git a/target/linux/bmips/patches-6.1/600-mips-bmips-add-pci-support.patch b/target/linux/bmips/patches-6.1/600-mips-bmips-add-pci-support.patch index d45a7a82393bb3..e5c22bb17fda17 100644 --- a/target/linux/bmips/patches-6.1/600-mips-bmips-add-pci-support.patch +++ b/target/linux/bmips/patches-6.1/600-mips-bmips-add-pci-support.patch @@ -14,7 +14,7 @@ Signed-off-by: Álvaro Fernández Rojas --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -289,7 +289,6 @@ config BMIPS_GENERIC +@@ -288,7 +288,6 @@ config BMIPS_GENERIC select USB_OHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN select HARDIRQS_SW_RESEND select HAVE_PCI diff --git a/target/linux/generic/backport-5.15/020-v6.1-07-mm-multi-gen-LRU-exploit-locality-in-rmap.patch b/target/linux/generic/backport-5.15/020-v6.1-07-mm-multi-gen-LRU-exploit-locality-in-rmap.patch index 5cd6e03dc60779..40e51b4294a75a 100644 --- a/target/linux/generic/backport-5.15/020-v6.1-07-mm-multi-gen-LRU-exploit-locality-in-rmap.patch +++ b/target/linux/generic/backport-5.15/020-v6.1-07-mm-multi-gen-LRU-exploit-locality-in-rmap.patch @@ -110,7 +110,7 @@ Signed-off-by: Andrew Morton --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h -@@ -442,6 +442,7 @@ static inline struct obj_cgroup *__page_ +@@ -447,6 +447,7 @@ static inline struct obj_cgroup *__page_ * - LRU isolation * - lock_page_memcg() * - exclusive reference @@ -118,7 +118,7 @@ Signed-off-by: Andrew Morton * * For a kmem page a caller should hold an rcu read lock to protect memcg * associated with a kmem page from being released. -@@ -497,6 +498,7 @@ static inline struct mem_cgroup *page_me +@@ -502,6 +503,7 @@ static inline struct mem_cgroup *page_me * - LRU isolation * - lock_page_memcg() * - exclusive reference @@ -126,7 +126,7 @@ Signed-off-by: Andrew Morton * * For a kmem page a caller should hold an rcu read lock to protect memcg * associated with a kmem page from being released. -@@ -953,6 +955,23 @@ void unlock_page_memcg(struct page *page +@@ -958,6 +960,23 @@ void unlock_page_memcg(struct page *page void __mod_memcg_state(struct mem_cgroup *memcg, int idx, int val); @@ -150,7 +150,7 @@ Signed-off-by: Andrew Morton /* idx can be of type enum memcg_stat_item or node_stat_item */ static inline void mod_memcg_state(struct mem_cgroup *memcg, int idx, int val) -@@ -1369,6 +1388,18 @@ static inline void unlock_page_memcg(str +@@ -1374,6 +1393,18 @@ static inline void unlock_page_memcg(str { } diff --git a/target/linux/generic/backport-5.15/020-v6.1-08-mm-multi-gen-LRU-support-page-table-walks.patch b/target/linux/generic/backport-5.15/020-v6.1-08-mm-multi-gen-LRU-support-page-table-walks.patch index e6ce94e3d4fcac..c89d3c2542814b 100644 --- a/target/linux/generic/backport-5.15/020-v6.1-08-mm-multi-gen-LRU-support-page-table-walks.patch +++ b/target/linux/generic/backport-5.15/020-v6.1-08-mm-multi-gen-LRU-support-page-table-walks.patch @@ -167,7 +167,7 @@ Signed-off-by: Andrew Morton BUG_ON(active_mm != old_mm); --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h -@@ -348,6 +348,11 @@ struct mem_cgroup { +@@ -353,6 +353,11 @@ struct mem_cgroup { struct deferred_split deferred_split_queue; #endif diff --git a/target/linux/generic/backport-5.15/020-v6.3-26-mm-multi-gen-LRU-per-node-lru_gen_page-lists.patch b/target/linux/generic/backport-5.15/020-v6.3-26-mm-multi-gen-LRU-per-node-lru_gen_page-lists.patch index f54e828de10600..6010e617b863e4 100644 --- a/target/linux/generic/backport-5.15/020-v6.3-26-mm-multi-gen-LRU-per-node-lru_gen_page-lists.patch +++ b/target/linux/generic/backport-5.15/020-v6.3-26-mm-multi-gen-LRU-per-node-lru_gen_page-lists.patch @@ -69,7 +69,7 @@ Signed-off-by: Andrew Morton --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h -@@ -818,6 +818,11 @@ static inline void obj_cgroup_put(struct +@@ -823,6 +823,11 @@ static inline void obj_cgroup_put(struct percpu_ref_put(&objcg->refcnt); } @@ -81,7 +81,7 @@ Signed-off-by: Andrew Morton static inline void mem_cgroup_put(struct mem_cgroup *memcg) { if (memcg) -@@ -1283,6 +1288,11 @@ struct mem_cgroup *mem_cgroup_from_css(s +@@ -1288,6 +1293,11 @@ struct mem_cgroup *mem_cgroup_from_css(s return NULL; } diff --git a/target/linux/generic/backport-5.15/608-v5.18-net-veth-Account-total-xdp_frame-len-running-ndo_xdp.patch b/target/linux/generic/backport-5.15/608-v5.18-net-veth-Account-total-xdp_frame-len-running-ndo_xdp.patch index 3bdba8728cfade..1ec260a2e6a750 100644 --- a/target/linux/generic/backport-5.15/608-v5.18-net-veth-Account-total-xdp_frame-len-running-ndo_xdp.patch +++ b/target/linux/generic/backport-5.15/608-v5.18-net-veth-Account-total-xdp_frame-len-running-ndo_xdp.patch @@ -22,7 +22,7 @@ Link: https://lore.kernel.org/bpf/54f9fd3bb65d190daf2c0bbae2f852ff16cfbaa0.16469 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c -@@ -501,7 +501,7 @@ static int veth_xdp_xmit(struct net_devi +@@ -503,7 +503,7 @@ static int veth_xdp_xmit(struct net_devi struct xdp_frame *frame = frames[i]; void *ptr = veth_xdp_to_ptr(frame); @@ -31,7 +31,7 @@ Link: https://lore.kernel.org/bpf/54f9fd3bb65d190daf2c0bbae2f852ff16cfbaa0.16469 __ptr_ring_produce(&rq->xdp_ring, ptr))) break; nxmit++; -@@ -862,7 +862,7 @@ static int veth_xdp_rcv(struct veth_rq * +@@ -864,7 +864,7 @@ static int veth_xdp_rcv(struct veth_rq * /* ndo_xdp_xmit */ struct xdp_frame *frame = veth_ptr_to_xdp(ptr); diff --git a/target/linux/generic/backport-5.15/609-v5.18-veth-Allow-jumbo-frames-in-xdp-mode.patch b/target/linux/generic/backport-5.15/609-v5.18-veth-Allow-jumbo-frames-in-xdp-mode.patch index 31b44f117079b2..cab980a6dceef8 100644 --- a/target/linux/generic/backport-5.15/609-v5.18-veth-Allow-jumbo-frames-in-xdp-mode.patch +++ b/target/linux/generic/backport-5.15/609-v5.18-veth-Allow-jumbo-frames-in-xdp-mode.patch @@ -20,7 +20,7 @@ Link: https://lore.kernel.org/bpf/d5dc039c3d4123426e7023a488c449181a7bc57f.16469 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c -@@ -1471,9 +1471,14 @@ static int veth_xdp_set(struct net_devic +@@ -1473,9 +1473,14 @@ static int veth_xdp_set(struct net_devic goto err; } diff --git a/target/linux/generic/backport-5.15/702-v5.19-00-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch b/target/linux/generic/backport-5.15/702-v5.19-00-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch index d6de92a487360f..3e7612b0d90c17 100644 --- a/target/linux/generic/backport-5.15/702-v5.19-00-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch +++ b/target/linux/generic/backport-5.15/702-v5.19-00-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch @@ -196,7 +196,7 @@ Signed-off-by: Felix Fietkau ring->dma_size * sizeof(*ring->dma), ring->dma, ring->phys); -@@ -2162,7 +2163,7 @@ static void mtk_dma_free(struct mtk_eth +@@ -2165,7 +2166,7 @@ static void mtk_dma_free(struct mtk_eth if (eth->netdev[i]) netdev_reset_queue(eth->netdev[i]); if (eth->scratch_ring) { @@ -205,7 +205,7 @@ Signed-off-by: Felix Fietkau MTK_DMA_SIZE * sizeof(struct mtk_tx_dma), eth->scratch_ring, eth->phy_scratch_ring); -@@ -2514,6 +2515,8 @@ static void mtk_dim_tx(struct work_struc +@@ -2517,6 +2518,8 @@ static void mtk_dim_tx(struct work_struc static int mtk_hw_init(struct mtk_eth *eth) { @@ -214,7 +214,7 @@ Signed-off-by: Felix Fietkau int i, val, ret; if (test_and_set_bit(MTK_HW_INIT, ð->state)) -@@ -2526,6 +2529,10 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -2529,6 +2532,10 @@ static int mtk_hw_init(struct mtk_eth *e if (ret) goto err_disable_pm; @@ -225,7 +225,7 @@ Signed-off-by: Felix Fietkau if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) { ret = device_reset(eth->dev); if (ret) { -@@ -3072,6 +3079,35 @@ free_netdev: +@@ -3075,6 +3082,35 @@ free_netdev: return err; } @@ -261,7 +261,7 @@ Signed-off-by: Felix Fietkau static int mtk_probe(struct platform_device *pdev) { struct device_node *mac_np; -@@ -3085,6 +3121,7 @@ static int mtk_probe(struct platform_dev +@@ -3088,6 +3124,7 @@ static int mtk_probe(struct platform_dev eth->soc = of_device_get_match_data(&pdev->dev); eth->dev = &pdev->dev; @@ -269,7 +269,7 @@ Signed-off-by: Felix Fietkau eth->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(eth->base)) return PTR_ERR(eth->base); -@@ -3133,6 +3170,16 @@ static int mtk_probe(struct platform_dev +@@ -3136,6 +3173,16 @@ static int mtk_probe(struct platform_dev } } diff --git a/target/linux/generic/backport-5.15/702-v5.19-02-net-ethernet-mtk_eth_soc-add-support-for-Wireless-Et.patch b/target/linux/generic/backport-5.15/702-v5.19-02-net-ethernet-mtk_eth_soc-add-support-for-Wireless-Et.patch index 06f948823612dd..ba72a796ee3f74 100644 --- a/target/linux/generic/backport-5.15/702-v5.19-02-net-ethernet-mtk_eth_soc-add-support-for-Wireless-Et.patch +++ b/target/linux/generic/backport-5.15/702-v5.19-02-net-ethernet-mtk_eth_soc-add-support-for-Wireless-Et.patch @@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau static int mtk_msg_level = -1; module_param_named(msg_level, mtk_msg_level, int, 0); -@@ -3202,6 +3203,22 @@ static int mtk_probe(struct platform_dev +@@ -3205,6 +3206,22 @@ static int mtk_probe(struct platform_dev } } diff --git a/target/linux/generic/backport-5.15/702-v5.19-07-net-ethernet-mtk_eth_soc-allocate-struct-mtk_ppe-sep.patch b/target/linux/generic/backport-5.15/702-v5.19-07-net-ethernet-mtk_eth_soc-allocate-struct-mtk_ppe-sep.patch index 1951a1d6764f0f..030a3346768afc 100644 --- a/target/linux/generic/backport-5.15/702-v5.19-07-net-ethernet-mtk_eth_soc-allocate-struct-mtk_ppe-sep.patch +++ b/target/linux/generic/backport-5.15/702-v5.19-07-net-ethernet-mtk_eth_soc-allocate-struct-mtk_ppe-sep.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -2335,7 +2335,7 @@ static int mtk_open(struct net_device *d +@@ -2338,7 +2338,7 @@ static int mtk_open(struct net_device *d return err; } @@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau gdm_config = MTK_GDMA_TO_PPE; mtk_gdm_config(eth, gdm_config); -@@ -2409,7 +2409,7 @@ static int mtk_stop(struct net_device *d +@@ -2412,7 +2412,7 @@ static int mtk_stop(struct net_device *d mtk_dma_free(eth); if (eth->soc->offload_version) @@ -28,7 +28,7 @@ Signed-off-by: Felix Fietkau return 0; } -@@ -3294,10 +3294,11 @@ static int mtk_probe(struct platform_dev +@@ -3297,10 +3297,11 @@ static int mtk_probe(struct platform_dev } if (eth->soc->offload_version) { diff --git a/target/linux/generic/backport-5.15/702-v5.19-08-net-ethernet-mtk_eth_soc-rework-hardware-flow-table-.patch b/target/linux/generic/backport-5.15/702-v5.19-08-net-ethernet-mtk_eth_soc-rework-hardware-flow-table-.patch index 9213f28b2a0aa4..0bb3f906accfe5 100644 --- a/target/linux/generic/backport-5.15/702-v5.19-08-net-ethernet-mtk_eth_soc-rework-hardware-flow-table-.patch +++ b/target/linux/generic/backport-5.15/702-v5.19-08-net-ethernet-mtk_eth_soc-rework-hardware-flow-table-.patch @@ -54,7 +54,7 @@ Signed-off-by: Felix Fietkau if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX && (trxd.rxd2 & RX_DMA_VTAG)) __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), -@@ -3294,7 +3300,7 @@ static int mtk_probe(struct platform_dev +@@ -3297,7 +3303,7 @@ static int mtk_probe(struct platform_dev } if (eth->soc->offload_version) { diff --git a/target/linux/generic/backport-5.15/702-v5.19-13-net-ethernet-mtk_eth_soc-use-standard-property-for-c.patch b/target/linux/generic/backport-5.15/702-v5.19-13-net-ethernet-mtk_eth_soc-use-standard-property-for-c.patch index 5a7561798d55d2..fe5b9263df9a58 100644 --- a/target/linux/generic/backport-5.15/702-v5.19-13-net-ethernet-mtk_eth_soc-use-standard-property-for-c.patch +++ b/target/linux/generic/backport-5.15/702-v5.19-13-net-ethernet-mtk_eth_soc-use-standard-property-for-c.patch @@ -24,7 +24,7 @@ Signed-off-by: David S. Miller mediatek,hifsys = <&hifsys>; --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3181,7 +3181,7 @@ static int mtk_probe(struct platform_dev +@@ -3184,7 +3184,7 @@ static int mtk_probe(struct platform_dev struct regmap *cci; cci = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, diff --git a/target/linux/generic/backport-5.15/702-v5.19-19-net-ethernet-mtk_eth_soc-add-txd_size-to-mtk_soc_dat.patch b/target/linux/generic/backport-5.15/702-v5.19-19-net-ethernet-mtk_eth_soc-add-txd_size-to-mtk_soc_dat.patch index 5bf44cc772dcaa..cadebbfa7551ec 100644 --- a/target/linux/generic/backport-5.15/702-v5.19-19-net-ethernet-mtk_eth_soc-add-txd_size-to-mtk_soc_dat.patch +++ b/target/linux/generic/backport-5.15/702-v5.19-19-net-ethernet-mtk_eth_soc-add-txd_size-to-mtk_soc_dat.patch @@ -65,7 +65,7 @@ Signed-off-by: David S. Miller } mtk_w32(eth, eth->phy_scratch_ring, MTK_QDMA_FQ_HEAD); -@@ -2170,6 +2173,7 @@ static int mtk_dma_init(struct mtk_eth * +@@ -2173,6 +2176,7 @@ static int mtk_dma_init(struct mtk_eth * static void mtk_dma_free(struct mtk_eth *eth) { @@ -73,7 +73,7 @@ Signed-off-by: David S. Miller int i; for (i = 0; i < MTK_MAC_COUNT; i++) -@@ -2177,9 +2181,8 @@ static void mtk_dma_free(struct mtk_eth +@@ -2180,9 +2184,8 @@ static void mtk_dma_free(struct mtk_eth netdev_reset_queue(eth->netdev[i]); if (eth->scratch_ring) { dma_free_coherent(eth->dma_dev, @@ -85,7 +85,7 @@ Signed-off-by: David S. Miller eth->scratch_ring = NULL; eth->phy_scratch_ring = 0; } -@@ -3384,6 +3387,9 @@ static const struct mtk_soc_data mt2701_ +@@ -3387,6 +3390,9 @@ static const struct mtk_soc_data mt2701_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7623_CLKS_BITMAP, .required_pctl = true, @@ -95,7 +95,7 @@ Signed-off-by: David S. Miller }; static const struct mtk_soc_data mt7621_data = { -@@ -3392,6 +3398,9 @@ static const struct mtk_soc_data mt7621_ +@@ -3395,6 +3401,9 @@ static const struct mtk_soc_data mt7621_ .required_clks = MT7621_CLKS_BITMAP, .required_pctl = false, .offload_version = 2, @@ -105,7 +105,7 @@ Signed-off-by: David S. Miller }; static const struct mtk_soc_data mt7622_data = { -@@ -3401,6 +3410,9 @@ static const struct mtk_soc_data mt7622_ +@@ -3404,6 +3413,9 @@ static const struct mtk_soc_data mt7622_ .required_clks = MT7622_CLKS_BITMAP, .required_pctl = false, .offload_version = 2, @@ -115,7 +115,7 @@ Signed-off-by: David S. Miller }; static const struct mtk_soc_data mt7623_data = { -@@ -3409,6 +3421,9 @@ static const struct mtk_soc_data mt7623_ +@@ -3412,6 +3424,9 @@ static const struct mtk_soc_data mt7623_ .required_clks = MT7623_CLKS_BITMAP, .required_pctl = true, .offload_version = 2, @@ -125,7 +125,7 @@ Signed-off-by: David S. Miller }; static const struct mtk_soc_data mt7629_data = { -@@ -3417,6 +3432,9 @@ static const struct mtk_soc_data mt7629_ +@@ -3420,6 +3435,9 @@ static const struct mtk_soc_data mt7629_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7629_CLKS_BITMAP, .required_pctl = false, @@ -135,7 +135,7 @@ Signed-off-by: David S. Miller }; static const struct mtk_soc_data rt5350_data = { -@@ -3424,6 +3442,9 @@ static const struct mtk_soc_data rt5350_ +@@ -3427,6 +3445,9 @@ static const struct mtk_soc_data rt5350_ .hw_features = MTK_HW_FEATURES_MT7628, .required_clks = MT7628_CLKS_BITMAP, .required_pctl = false, diff --git a/target/linux/generic/backport-5.15/702-v5.19-23-net-ethernet-mtk_eth_soc-add-rxd_size-to-mtk_soc_dat.patch b/target/linux/generic/backport-5.15/702-v5.19-23-net-ethernet-mtk_eth_soc-add-rxd_size-to-mtk_soc_dat.patch index 127312baeca240..525882c956b2df 100644 --- a/target/linux/generic/backport-5.15/702-v5.19-23-net-ethernet-mtk_eth_soc-add-rxd_size-to-mtk_soc_dat.patch +++ b/target/linux/generic/backport-5.15/702-v5.19-23-net-ethernet-mtk_eth_soc-add-rxd_size-to-mtk_soc_dat.patch @@ -34,7 +34,7 @@ Signed-off-by: David S. Miller ring->dma = NULL; } } -@@ -3399,6 +3398,7 @@ static const struct mtk_soc_data mt2701_ +@@ -3402,6 +3401,7 @@ static const struct mtk_soc_data mt2701_ .required_pctl = true, .txrx = { .txd_size = sizeof(struct mtk_tx_dma), @@ -42,7 +42,7 @@ Signed-off-by: David S. Miller }, }; -@@ -3410,6 +3410,7 @@ static const struct mtk_soc_data mt7621_ +@@ -3413,6 +3413,7 @@ static const struct mtk_soc_data mt7621_ .offload_version = 2, .txrx = { .txd_size = sizeof(struct mtk_tx_dma), @@ -50,7 +50,7 @@ Signed-off-by: David S. Miller }, }; -@@ -3422,6 +3423,7 @@ static const struct mtk_soc_data mt7622_ +@@ -3425,6 +3426,7 @@ static const struct mtk_soc_data mt7622_ .offload_version = 2, .txrx = { .txd_size = sizeof(struct mtk_tx_dma), @@ -58,7 +58,7 @@ Signed-off-by: David S. Miller }, }; -@@ -3433,6 +3435,7 @@ static const struct mtk_soc_data mt7623_ +@@ -3436,6 +3438,7 @@ static const struct mtk_soc_data mt7623_ .offload_version = 2, .txrx = { .txd_size = sizeof(struct mtk_tx_dma), @@ -66,7 +66,7 @@ Signed-off-by: David S. Miller }, }; -@@ -3444,6 +3447,7 @@ static const struct mtk_soc_data mt7629_ +@@ -3447,6 +3450,7 @@ static const struct mtk_soc_data mt7629_ .required_pctl = false, .txrx = { .txd_size = sizeof(struct mtk_tx_dma), @@ -74,7 +74,7 @@ Signed-off-by: David S. Miller }, }; -@@ -3454,6 +3458,7 @@ static const struct mtk_soc_data rt5350_ +@@ -3457,6 +3461,7 @@ static const struct mtk_soc_data rt5350_ .required_pctl = false, .txrx = { .txd_size = sizeof(struct mtk_tx_dma), diff --git a/target/linux/generic/backport-5.15/702-v5.19-26-net-ethernet-mtk_eth_soc-introduce-device-register-m.patch b/target/linux/generic/backport-5.15/702-v5.19-26-net-ethernet-mtk_eth_soc-introduce-device-register-m.patch index d694578b33e1a9..11941d5c37436c 100644 --- a/target/linux/generic/backport-5.15/702-v5.19-26-net-ethernet-mtk_eth_soc-introduce-device-register-m.patch +++ b/target/linux/generic/backport-5.15/702-v5.19-26-net-ethernet-mtk_eth_soc-introduce-device-register-m.patch @@ -345,7 +345,7 @@ Signed-off-by: David S. Miller return 0; } -@@ -2126,9 +2185,9 @@ static int mtk_dma_busy_wait(struct mtk_ +@@ -2129,9 +2188,9 @@ static int mtk_dma_busy_wait(struct mtk_ u32 val; if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) @@ -357,7 +357,7 @@ Signed-off-by: David S. Miller ret = readx_poll_timeout_atomic(__raw_readl, eth->base + reg, val, !(val & (MTK_RX_DMA_BUSY | MTK_TX_DMA_BUSY)), -@@ -2186,8 +2245,8 @@ static int mtk_dma_init(struct mtk_eth * +@@ -2189,8 +2248,8 @@ static int mtk_dma_init(struct mtk_eth * * automatically */ mtk_w32(eth, FC_THRES_DROP_MODE | FC_THRES_DROP_EN | @@ -368,7 +368,7 @@ Signed-off-by: David S. Miller } return 0; -@@ -2261,13 +2320,14 @@ static irqreturn_t mtk_handle_irq_tx(int +@@ -2264,13 +2323,14 @@ static irqreturn_t mtk_handle_irq_tx(int static irqreturn_t mtk_handle_irq(int irq, void *_eth) { struct mtk_eth *eth = _eth; @@ -387,7 +387,7 @@ Signed-off-by: David S. Miller mtk_handle_irq_tx(irq, _eth); } -@@ -2291,6 +2351,7 @@ static void mtk_poll_controller(struct n +@@ -2294,6 +2354,7 @@ static void mtk_poll_controller(struct n static int mtk_start_dma(struct mtk_eth *eth) { u32 rx_2b_offset = (NET_IP_ALIGN == 2) ? MTK_RX_2B_OFFSET : 0; @@ -395,7 +395,7 @@ Signed-off-by: David S. Miller int err; err = mtk_dma_init(eth); -@@ -2305,16 +2366,15 @@ static int mtk_start_dma(struct mtk_eth +@@ -2308,16 +2369,15 @@ static int mtk_start_dma(struct mtk_eth MTK_TX_BT_32DWORDS | MTK_NDP_CO_PRO | MTK_RX_DMA_EN | MTK_RX_2B_OFFSET | MTK_RX_BT_32DWORDS, @@ -415,7 +415,7 @@ Signed-off-by: David S. Miller } return 0; -@@ -2440,8 +2500,8 @@ static int mtk_stop(struct net_device *d +@@ -2443,8 +2503,8 @@ static int mtk_stop(struct net_device *d cancel_work_sync(ð->tx_dim.work); if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) @@ -426,7 +426,7 @@ Signed-off-by: David S. Miller mtk_dma_free(eth); -@@ -2495,6 +2555,7 @@ static void mtk_dim_rx(struct work_struc +@@ -2498,6 +2558,7 @@ static void mtk_dim_rx(struct work_struc { struct dim *dim = container_of(work, struct dim, work); struct mtk_eth *eth = container_of(dim, struct mtk_eth, rx_dim); @@ -434,7 +434,7 @@ Signed-off-by: David S. Miller struct dim_cq_moder cur_profile; u32 val, cur; -@@ -2502,7 +2563,7 @@ static void mtk_dim_rx(struct work_struc +@@ -2505,7 +2566,7 @@ static void mtk_dim_rx(struct work_struc dim->profile_ix); spin_lock_bh(ð->dim_lock); @@ -443,7 +443,7 @@ Signed-off-by: David S. Miller val &= MTK_PDMA_DELAY_TX_MASK; val |= MTK_PDMA_DELAY_RX_EN; -@@ -2512,9 +2573,9 @@ static void mtk_dim_rx(struct work_struc +@@ -2515,9 +2576,9 @@ static void mtk_dim_rx(struct work_struc cur = min_t(u32, cur_profile.pkts, MTK_PDMA_DELAY_PINT_MASK); val |= cur << MTK_PDMA_DELAY_RX_PINT_SHIFT; @@ -455,7 +455,7 @@ Signed-off-by: David S. Miller spin_unlock_bh(ð->dim_lock); -@@ -2525,6 +2586,7 @@ static void mtk_dim_tx(struct work_struc +@@ -2528,6 +2589,7 @@ static void mtk_dim_tx(struct work_struc { struct dim *dim = container_of(work, struct dim, work); struct mtk_eth *eth = container_of(dim, struct mtk_eth, tx_dim); @@ -463,7 +463,7 @@ Signed-off-by: David S. Miller struct dim_cq_moder cur_profile; u32 val, cur; -@@ -2532,7 +2594,7 @@ static void mtk_dim_tx(struct work_struc +@@ -2535,7 +2597,7 @@ static void mtk_dim_tx(struct work_struc dim->profile_ix); spin_lock_bh(ð->dim_lock); @@ -472,7 +472,7 @@ Signed-off-by: David S. Miller val &= MTK_PDMA_DELAY_RX_MASK; val |= MTK_PDMA_DELAY_TX_EN; -@@ -2542,9 +2604,9 @@ static void mtk_dim_tx(struct work_struc +@@ -2545,9 +2607,9 @@ static void mtk_dim_tx(struct work_struc cur = min_t(u32, cur_profile.pkts, MTK_PDMA_DELAY_PINT_MASK); val |= cur << MTK_PDMA_DELAY_TX_PINT_SHIFT; @@ -484,7 +484,7 @@ Signed-off-by: David S. Miller spin_unlock_bh(ð->dim_lock); -@@ -2555,6 +2617,7 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -2558,6 +2620,7 @@ static int mtk_hw_init(struct mtk_eth *e { u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA | ETHSYS_DMA_AG_MAP_PPE; @@ -492,7 +492,7 @@ Signed-off-by: David S. Miller int i, val, ret; if (test_and_set_bit(MTK_HW_INIT, ð->state)) -@@ -2629,10 +2692,10 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -2632,10 +2695,10 @@ static int mtk_hw_init(struct mtk_eth *e mtk_rx_irq_disable(eth, ~0); /* FE int grouping */ @@ -507,7 +507,7 @@ Signed-off-by: David S. Miller mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP); return 0; -@@ -3164,14 +3227,6 @@ static int mtk_probe(struct platform_dev +@@ -3167,14 +3230,6 @@ static int mtk_probe(struct platform_dev if (IS_ERR(eth->base)) return PTR_ERR(eth->base); @@ -522,7 +522,7 @@ Signed-off-by: David S. Miller if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) { eth->rx_dma_l4_valid = RX_DMA_L4_VALID_PDMA; eth->ip_align = NET_IP_ALIGN; -@@ -3405,6 +3460,7 @@ static int mtk_remove(struct platform_de +@@ -3408,6 +3463,7 @@ static int mtk_remove(struct platform_de } static const struct mtk_soc_data mt2701_data = { @@ -530,7 +530,7 @@ Signed-off-by: David S. Miller .caps = MT7623_CAPS | MTK_HWLRO, .hw_features = MTK_HW_FEATURES, .required_clks = MT7623_CLKS_BITMAP, -@@ -3416,6 +3472,7 @@ static const struct mtk_soc_data mt2701_ +@@ -3419,6 +3475,7 @@ static const struct mtk_soc_data mt2701_ }; static const struct mtk_soc_data mt7621_data = { @@ -538,7 +538,7 @@ Signed-off-by: David S. Miller .caps = MT7621_CAPS, .hw_features = MTK_HW_FEATURES, .required_clks = MT7621_CLKS_BITMAP, -@@ -3428,6 +3485,7 @@ static const struct mtk_soc_data mt7621_ +@@ -3431,6 +3488,7 @@ static const struct mtk_soc_data mt7621_ }; static const struct mtk_soc_data mt7622_data = { @@ -546,7 +546,7 @@ Signed-off-by: David S. Miller .ana_rgc3 = 0x2028, .caps = MT7622_CAPS | MTK_HWLRO, .hw_features = MTK_HW_FEATURES, -@@ -3441,6 +3499,7 @@ static const struct mtk_soc_data mt7622_ +@@ -3444,6 +3502,7 @@ static const struct mtk_soc_data mt7622_ }; static const struct mtk_soc_data mt7623_data = { @@ -554,7 +554,7 @@ Signed-off-by: David S. Miller .caps = MT7623_CAPS | MTK_HWLRO, .hw_features = MTK_HW_FEATURES, .required_clks = MT7623_CLKS_BITMAP, -@@ -3453,6 +3512,7 @@ static const struct mtk_soc_data mt7623_ +@@ -3456,6 +3515,7 @@ static const struct mtk_soc_data mt7623_ }; static const struct mtk_soc_data mt7629_data = { @@ -562,7 +562,7 @@ Signed-off-by: David S. Miller .ana_rgc3 = 0x128, .caps = MT7629_CAPS | MTK_HWLRO, .hw_features = MTK_HW_FEATURES, -@@ -3465,6 +3525,7 @@ static const struct mtk_soc_data mt7629_ +@@ -3468,6 +3528,7 @@ static const struct mtk_soc_data mt7629_ }; static const struct mtk_soc_data rt5350_data = { diff --git a/target/linux/generic/backport-5.15/702-v5.19-27-net-ethernet-mtk_eth_soc-introduce-MTK_NETSYS_V2-sup.patch b/target/linux/generic/backport-5.15/702-v5.19-27-net-ethernet-mtk_eth_soc-introduce-MTK_NETSYS_V2-sup.patch index 548d62a027143c..91739ddd34162a 100644 --- a/target/linux/generic/backport-5.15/702-v5.19-27-net-ethernet-mtk_eth_soc-introduce-MTK_NETSYS_V2-sup.patch +++ b/target/linux/generic/backport-5.15/702-v5.19-27-net-ethernet-mtk_eth_soc-introduce-MTK_NETSYS_V2-sup.patch @@ -403,7 +403,7 @@ Signed-off-by: David S. Miller return 0; } -@@ -2298,7 +2406,7 @@ static irqreturn_t mtk_handle_irq_rx(int +@@ -2301,7 +2409,7 @@ static irqreturn_t mtk_handle_irq_rx(int eth->rx_events++; if (likely(napi_schedule_prep(ð->rx_napi))) { __napi_schedule(ð->rx_napi); @@ -412,7 +412,7 @@ Signed-off-by: David S. Miller } return IRQ_HANDLED; -@@ -2322,8 +2430,10 @@ static irqreturn_t mtk_handle_irq(int ir +@@ -2325,8 +2433,10 @@ static irqreturn_t mtk_handle_irq(int ir struct mtk_eth *eth = _eth; const struct mtk_reg_map *reg_map = eth->soc->reg_map; @@ -425,7 +425,7 @@ Signed-off-by: David S. Miller mtk_handle_irq_rx(irq, _eth); } if (mtk_r32(eth, reg_map->tx_irq_mask) & MTK_TX_DONE_INT) { -@@ -2341,16 +2451,16 @@ static void mtk_poll_controller(struct n +@@ -2344,16 +2454,16 @@ static void mtk_poll_controller(struct n struct mtk_eth *eth = mac->hw; mtk_tx_irq_disable(eth, MTK_TX_DONE_INT); @@ -445,7 +445,7 @@ Signed-off-by: David S. Miller const struct mtk_reg_map *reg_map = eth->soc->reg_map; int err; -@@ -2361,12 +2471,19 @@ static int mtk_start_dma(struct mtk_eth +@@ -2364,12 +2474,19 @@ static int mtk_start_dma(struct mtk_eth } if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) { @@ -471,7 +471,7 @@ Signed-off-by: David S. Miller mtk_w32(eth, MTK_RX_DMA_EN | rx_2b_offset | MTK_RX_BT_32DWORDS | MTK_MULTI_EN, -@@ -2440,7 +2557,7 @@ static int mtk_open(struct net_device *d +@@ -2443,7 +2560,7 @@ static int mtk_open(struct net_device *d napi_enable(ð->tx_napi); napi_enable(ð->rx_napi); mtk_tx_irq_enable(eth, MTK_TX_DONE_INT); @@ -480,7 +480,7 @@ Signed-off-by: David S. Miller refcount_set(ð->dma_refcnt, 1); } else -@@ -2492,7 +2609,7 @@ static int mtk_stop(struct net_device *d +@@ -2495,7 +2612,7 @@ static int mtk_stop(struct net_device *d mtk_gdm_config(eth, MTK_GDMA_DROP_ALL); mtk_tx_irq_disable(eth, MTK_TX_DONE_INT); @@ -489,7 +489,7 @@ Signed-off-by: David S. Miller napi_disable(ð->tx_napi); napi_disable(ð->rx_napi); -@@ -2652,9 +2769,25 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -2655,9 +2772,25 @@ static int mtk_hw_init(struct mtk_eth *e return 0; } @@ -518,7 +518,7 @@ Signed-off-by: David S. Miller if (eth->pctl) { /* Set GE2 driving and slew rate */ -@@ -2693,11 +2826,47 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -2696,11 +2829,47 @@ static int mtk_hw_init(struct mtk_eth *e /* FE int grouping */ mtk_w32(eth, MTK_TX_DONE_INT, reg_map->pdma.int_grp); @@ -568,7 +568,7 @@ Signed-off-by: David S. Miller return 0; err_disable_pm: -@@ -3227,12 +3396,8 @@ static int mtk_probe(struct platform_dev +@@ -3230,12 +3399,8 @@ static int mtk_probe(struct platform_dev if (IS_ERR(eth->base)) return PTR_ERR(eth->base); @@ -582,7 +582,7 @@ Signed-off-by: David S. Miller spin_lock_init(ð->page_lock); spin_lock_init(ð->tx_irq_lock); -@@ -3468,6 +3633,10 @@ static const struct mtk_soc_data mt2701_ +@@ -3471,6 +3636,10 @@ static const struct mtk_soc_data mt2701_ .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), @@ -593,7 +593,7 @@ Signed-off-by: David S. Miller }, }; -@@ -3481,6 +3650,10 @@ static const struct mtk_soc_data mt7621_ +@@ -3484,6 +3653,10 @@ static const struct mtk_soc_data mt7621_ .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), @@ -604,7 +604,7 @@ Signed-off-by: David S. Miller }, }; -@@ -3495,6 +3668,10 @@ static const struct mtk_soc_data mt7622_ +@@ -3498,6 +3671,10 @@ static const struct mtk_soc_data mt7622_ .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), @@ -615,7 +615,7 @@ Signed-off-by: David S. Miller }, }; -@@ -3508,6 +3685,10 @@ static const struct mtk_soc_data mt7623_ +@@ -3511,6 +3688,10 @@ static const struct mtk_soc_data mt7623_ .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), @@ -626,7 +626,7 @@ Signed-off-by: David S. Miller }, }; -@@ -3521,6 +3702,10 @@ static const struct mtk_soc_data mt7629_ +@@ -3524,6 +3705,10 @@ static const struct mtk_soc_data mt7629_ .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), @@ -637,7 +637,7 @@ Signed-off-by: David S. Miller }, }; -@@ -3533,6 +3718,10 @@ static const struct mtk_soc_data rt5350_ +@@ -3536,6 +3721,10 @@ static const struct mtk_soc_data rt5350_ .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), diff --git a/target/linux/generic/backport-5.15/702-v5.19-30-net-ethernet-mtk_eth_soc-introduce-support-for-mt798.patch b/target/linux/generic/backport-5.15/702-v5.19-30-net-ethernet-mtk_eth_soc-introduce-support-for-mt798.patch index 2df4b265a9b29e..713d24b3c99108 100644 --- a/target/linux/generic/backport-5.15/702-v5.19-30-net-ethernet-mtk_eth_soc-introduce-support-for-mt798.patch +++ b/target/linux/generic/backport-5.15/702-v5.19-30-net-ethernet-mtk_eth_soc-introduce-support-for-mt798.patch @@ -65,7 +65,7 @@ Signed-off-by: David S. Miller }; void mtk_w32(struct mtk_eth *eth, u32 val, unsigned reg) -@@ -3705,6 +3742,21 @@ static const struct mtk_soc_data mt7629_ +@@ -3708,6 +3745,21 @@ static const struct mtk_soc_data mt7629_ }, }; @@ -87,7 +87,7 @@ Signed-off-by: David S. Miller static const struct mtk_soc_data rt5350_data = { .reg_map = &mt7628_reg_map, .caps = MT7628_CAPS, -@@ -3727,6 +3779,7 @@ const struct of_device_id of_mtk_match[] +@@ -3730,6 +3782,7 @@ const struct of_device_id of_mtk_match[] { .compatible = "mediatek,mt7622-eth", .data = &mt7622_data}, { .compatible = "mediatek,mt7623-eth", .data = &mt7623_data}, { .compatible = "mediatek,mt7629-eth", .data = &mt7629_data}, diff --git a/target/linux/generic/backport-5.15/702-v5.19-33-net-ethernet-mtk_eth_soc-enable-rx-cksum-offload-for.patch b/target/linux/generic/backport-5.15/702-v5.19-33-net-ethernet-mtk_eth_soc-enable-rx-cksum-offload-for.patch index 2ad7b5792e9b66..b05faa9c4b7b95 100644 --- a/target/linux/generic/backport-5.15/702-v5.19-33-net-ethernet-mtk_eth_soc-enable-rx-cksum-offload-for.patch +++ b/target/linux/generic/backport-5.15/702-v5.19-33-net-ethernet-mtk_eth_soc-enable-rx-cksum-offload-for.patch @@ -37,7 +37,7 @@ Signed-off-by: Jakub Kicinski skb->ip_summed = CHECKSUM_UNNECESSARY; else skb_checksum_none_assert(skb); -@@ -3752,6 +3758,7 @@ static const struct mtk_soc_data mt7986_ +@@ -3755,6 +3761,7 @@ static const struct mtk_soc_data mt7986_ .txd_size = sizeof(struct mtk_tx_dma_v2), .rxd_size = sizeof(struct mtk_rx_dma_v2), .rx_irq_done_mask = MTK_RX_DONE_INT_V2, diff --git a/target/linux/generic/backport-5.15/703-00-v5.16-net-convert-users-of-bitmap_foo-to-linkmode_foo.patch b/target/linux/generic/backport-5.15/703-00-v5.16-net-convert-users-of-bitmap_foo-to-linkmode_foo.patch index 919da4d1ef198f..2f8128b3f30551 100644 --- a/target/linux/generic/backport-5.15/703-00-v5.16-net-convert-users-of-bitmap_foo-to-linkmode_foo.patch +++ b/target/linux/generic/backport-5.15/703-00-v5.16-net-convert-users-of-bitmap_foo-to-linkmode_foo.patch @@ -726,7 +726,7 @@ Signed-off-by: David S. Miller * to advertise both, only report advertising at 2500BaseX. --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c -@@ -6347,15 +6347,14 @@ static void mvpp2_phylink_validate(struc +@@ -6352,15 +6352,14 @@ static void mvpp2_phylink_validate(struc goto empty_set; } diff --git a/target/linux/generic/backport-5.15/704-01-v5.17-net-mtk_eth_soc-populate-supported_interfaces-member.patch b/target/linux/generic/backport-5.15/704-01-v5.17-net-mtk_eth_soc-populate-supported_interfaces-member.patch index f6279bf13d8b74..b26b15e60d4af3 100644 --- a/target/linux/generic/backport-5.15/704-01-v5.17-net-mtk_eth_soc-populate-supported_interfaces-member.patch +++ b/target/linux/generic/backport-5.15/704-01-v5.17-net-mtk_eth_soc-populate-supported_interfaces-member.patch @@ -14,7 +14,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3348,6 +3348,26 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -3351,6 +3351,26 @@ static int mtk_add_mac(struct mtk_eth *e mac->phylink_config.dev = ð->netdev[id]->dev; mac->phylink_config.type = PHYLINK_NETDEV; diff --git a/target/linux/generic/backport-5.15/704-04-v5.17-net-mtk_eth_soc-use-phylink_generic_validate.patch b/target/linux/generic/backport-5.15/704-04-v5.17-net-mtk_eth_soc-use-phylink_generic_validate.patch index 84c02992122057..6d52e4e37fec63 100644 --- a/target/linux/generic/backport-5.15/704-04-v5.17-net-mtk_eth_soc-use-phylink_generic_validate.patch +++ b/target/linux/generic/backport-5.15/704-04-v5.17-net-mtk_eth_soc-use-phylink_generic_validate.patch @@ -72,7 +72,7 @@ Signed-off-by: David S. Miller .mac_pcs_get_state = mtk_mac_pcs_get_state, .mac_an_restart = mtk_mac_an_restart, .mac_config = mtk_mac_config, -@@ -3310,6 +3262,9 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -3313,6 +3265,9 @@ static int mtk_add_mac(struct mtk_eth *e mac->phylink_config.dev = ð->netdev[id]->dev; mac->phylink_config.type = PHYLINK_NETDEV; diff --git a/target/linux/generic/backport-5.15/704-05-v5.17-net-mtk_eth_soc-mark-as-a-legacy_pre_march2020-drive.patch b/target/linux/generic/backport-5.15/704-05-v5.17-net-mtk_eth_soc-mark-as-a-legacy_pre_march2020-drive.patch index a6fbde5c892067..381c51b81ae3a1 100644 --- a/target/linux/generic/backport-5.15/704-05-v5.17-net-mtk_eth_soc-mark-as-a-legacy_pre_march2020-drive.patch +++ b/target/linux/generic/backport-5.15/704-05-v5.17-net-mtk_eth_soc-mark-as-a-legacy_pre_march2020-drive.patch @@ -16,7 +16,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3262,6 +3262,10 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -3265,6 +3265,10 @@ static int mtk_add_mac(struct mtk_eth *e mac->phylink_config.dev = ð->netdev[id]->dev; mac->phylink_config.type = PHYLINK_NETDEV; diff --git a/target/linux/generic/backport-5.15/704-06-v5.19-eth-mtk_eth_soc-remove-a-copy-of-the-NAPI_POLL_WEIGH.patch b/target/linux/generic/backport-5.15/704-06-v5.19-eth-mtk_eth_soc-remove-a-copy-of-the-NAPI_POLL_WEIGH.patch index 63f4ef13e12017..887ff565784a05 100644 --- a/target/linux/generic/backport-5.15/704-06-v5.19-eth-mtk_eth_soc-remove-a-copy-of-the-NAPI_POLL_WEIGH.patch +++ b/target/linux/generic/backport-5.15/704-06-v5.19-eth-mtk_eth_soc-remove-a-copy-of-the-NAPI_POLL_WEIGH.patch @@ -16,7 +16,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3561,9 +3561,9 @@ static int mtk_probe(struct platform_dev +@@ -3564,9 +3564,9 @@ static int mtk_probe(struct platform_dev */ init_dummy_netdev(ð->dummy_dev); netif_napi_add(ð->dummy_dev, ð->tx_napi, mtk_napi_tx, diff --git a/target/linux/generic/backport-5.15/704-07-v5.19-mtk_eth_soc-remove-unused-mac-mode.patch b/target/linux/generic/backport-5.15/704-07-v5.19-mtk_eth_soc-remove-unused-mac-mode.patch index ff3c422f26e38c..58aa54f4e53c9f 100644 --- a/target/linux/generic/backport-5.15/704-07-v5.19-mtk_eth_soc-remove-unused-mac-mode.patch +++ b/target/linux/generic/backport-5.15/704-07-v5.19-mtk_eth_soc-remove-unused-mac-mode.patch @@ -15,7 +15,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3257,7 +3257,6 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -3260,7 +3260,6 @@ static int mtk_add_mac(struct mtk_eth *e /* mac config is not set */ mac->interface = PHY_INTERFACE_MODE_NA; diff --git a/target/linux/generic/backport-5.15/704-11-v5.19-net-mtk_eth_soc-correct-802.3z-duplex-setting.patch b/target/linux/generic/backport-5.15/704-11-v5.19-net-mtk_eth_soc-correct-802.3z-duplex-setting.patch index e9e3e1f745248c..951c8fea84d85c 100644 --- a/target/linux/generic/backport-5.15/704-11-v5.19-net-mtk_eth_soc-correct-802.3z-duplex-setting.patch +++ b/target/linux/generic/backport-5.15/704-11-v5.19-net-mtk_eth_soc-correct-802.3z-duplex-setting.patch @@ -38,7 +38,7 @@ Signed-off-by: Jakub Kicinski mcr &= ~(MAC_MCR_SPEED_100 | MAC_MCR_SPEED_1000 | MAC_MCR_FORCE_DPX | MAC_MCR_FORCE_TX_FC | MAC_MCR_FORCE_RX_FC); -@@ -3261,9 +3271,7 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -3264,9 +3274,7 @@ static int mtk_add_mac(struct mtk_eth *e mac->phylink_config.dev = ð->netdev[id]->dev; mac->phylink_config.type = PHYLINK_NETDEV; diff --git a/target/linux/generic/backport-5.15/706-01-v6.0-net-ethernet-mtk_eth_soc-add-basic-XDP-support.patch b/target/linux/generic/backport-5.15/706-01-v6.0-net-ethernet-mtk_eth_soc-add-basic-XDP-support.patch index 60e83a16513af7..49b2355ce40848 100644 --- a/target/linux/generic/backport-5.15/706-01-v6.0-net-ethernet-mtk_eth_soc-add-basic-XDP-support.patch +++ b/target/linux/generic/backport-5.15/706-01-v6.0-net-ethernet-mtk_eth_soc-add-basic-XDP-support.patch @@ -208,7 +208,7 @@ Signed-off-by: David S. Miller struct page_pool *pp; pp = mtk_create_page_pool(eth, &ring->xdp_q, ring_no, -@@ -2710,6 +2785,48 @@ static int mtk_stop(struct net_device *d +@@ -2713,6 +2788,48 @@ static int mtk_stop(struct net_device *d return 0; } @@ -257,7 +257,7 @@ Signed-off-by: David S. Miller static void ethsys_reset(struct mtk_eth *eth, u32 reset_bits) { regmap_update_bits(eth->ethsys, ETHSYS_RSTCTRL, -@@ -2988,6 +3105,12 @@ static int mtk_change_mtu(struct net_dev +@@ -2991,6 +3108,12 @@ static int mtk_change_mtu(struct net_dev struct mtk_eth *eth = mac->hw; u32 mcr_cur, mcr_new; @@ -270,7 +270,7 @@ Signed-off-by: David S. Miller if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) { mcr_cur = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id)); mcr_new = mcr_cur & ~MAC_MCR_MAX_RX_MASK; -@@ -3314,6 +3437,7 @@ static const struct net_device_ops mtk_n +@@ -3317,6 +3440,7 @@ static const struct net_device_ops mtk_n .ndo_poll_controller = mtk_poll_controller, #endif .ndo_setup_tc = mtk_eth_setup_tc, diff --git a/target/linux/generic/backport-5.15/706-03-v6.0-net-ethernet-mtk_eth_soc-add-xmit-XDP-support.patch b/target/linux/generic/backport-5.15/706-03-v6.0-net-ethernet-mtk_eth_soc-add-xmit-XDP-support.patch index 8c134500117266..f774f9875d9dea 100644 --- a/target/linux/generic/backport-5.15/706-03-v6.0-net-ethernet-mtk_eth_soc-add-xmit-XDP-support.patch +++ b/target/linux/generic/backport-5.15/706-03-v6.0-net-ethernet-mtk_eth_soc-add-xmit-XDP-support.patch @@ -304,7 +304,7 @@ Signed-off-by: David S. Miller } mtk_tx_unmap(eth, tx_buf, true); -@@ -3460,6 +3609,7 @@ static const struct net_device_ops mtk_n +@@ -3463,6 +3612,7 @@ static const struct net_device_ops mtk_n #endif .ndo_setup_tc = mtk_eth_setup_tc, .ndo_bpf = mtk_xdp, diff --git a/target/linux/generic/backport-5.15/706-04-v6.0-net-ethernet-mtk_eth_soc-add-support-for-page_pool_g.patch b/target/linux/generic/backport-5.15/706-04-v6.0-net-ethernet-mtk_eth_soc-add-support-for-page_pool_g.patch index 3108d67da49c5e..d3d95a34b80f0d 100644 --- a/target/linux/generic/backport-5.15/706-04-v6.0-net-ethernet-mtk_eth_soc-add-support-for-page_pool_g.patch +++ b/target/linux/generic/backport-5.15/706-04-v6.0-net-ethernet-mtk_eth_soc-add-support-for-page_pool_g.patch @@ -26,7 +26,7 @@ Signed-off-by: David S. Miller MediaTek SoC family. --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3471,11 +3471,18 @@ static void mtk_get_strings(struct net_d +@@ -3474,11 +3474,18 @@ static void mtk_get_strings(struct net_d int i; switch (stringset) { @@ -46,7 +46,7 @@ Signed-off-by: David S. Miller break; } } -@@ -3483,13 +3490,35 @@ static void mtk_get_strings(struct net_d +@@ -3486,13 +3493,35 @@ static void mtk_get_strings(struct net_d static int mtk_get_sset_count(struct net_device *dev, int sset) { switch (sset) { @@ -84,7 +84,7 @@ Signed-off-by: David S. Miller static void mtk_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *stats, u64 *data) { -@@ -3517,6 +3546,8 @@ static void mtk_get_ethtool_stats(struct +@@ -3520,6 +3549,8 @@ static void mtk_get_ethtool_stats(struct for (i = 0; i < ARRAY_SIZE(mtk_ethtool_stats); i++) *data_dst++ = *(data_src + mtk_ethtool_stats[i].offset); diff --git a/target/linux/generic/backport-5.15/713-v6.0-net-ethernet-mtk_eth_soc-move-gdma_to_ppe-and-ppe_ba.patch b/target/linux/generic/backport-5.15/713-v6.0-net-ethernet-mtk_eth_soc-move-gdma_to_ppe-and-ppe_ba.patch index dbc338cf351450..66e2778709dd30 100644 --- a/target/linux/generic/backport-5.15/713-v6.0-net-ethernet-mtk_eth_soc-move-gdma_to_ppe-and-ppe_ba.patch +++ b/target/linux/generic/backport-5.15/713-v6.0-net-ethernet-mtk_eth_soc-move-gdma_to_ppe-and-ppe_ba.patch @@ -57,7 +57,7 @@ Signed-off-by: Lorenzo Bianconi }; /* strings used by ethtool */ -@@ -2925,6 +2929,7 @@ static int mtk_open(struct net_device *d +@@ -2928,6 +2932,7 @@ static int mtk_open(struct net_device *d /* we run 2 netdevs on the same dma ring so we only bring it up once */ if (!refcount_read(ð->dma_refcnt)) { @@ -65,7 +65,7 @@ Signed-off-by: Lorenzo Bianconi u32 gdm_config = MTK_GDMA_TO_PDMA; int err; -@@ -2934,15 +2939,15 @@ static int mtk_open(struct net_device *d +@@ -2937,15 +2942,15 @@ static int mtk_open(struct net_device *d return err; } @@ -84,7 +84,7 @@ Signed-off-by: Lorenzo Bianconi refcount_set(ð->dma_refcnt, 1); } else -@@ -4041,7 +4046,9 @@ static int mtk_probe(struct platform_dev +@@ -4044,7 +4049,9 @@ static int mtk_probe(struct platform_dev } if (eth->soc->offload_version) { diff --git a/target/linux/generic/backport-5.15/714-v6.0-net-ethernet-mtk_eth_soc-move-ppe-table-hash-offset-.patch b/target/linux/generic/backport-5.15/714-v6.0-net-ethernet-mtk_eth_soc-move-ppe-table-hash-offset-.patch index 7cc0ab225ebeeb..1dfcc862d611c4 100644 --- a/target/linux/generic/backport-5.15/714-v6.0-net-ethernet-mtk_eth_soc-move-ppe-table-hash-offset-.patch +++ b/target/linux/generic/backport-5.15/714-v6.0-net-ethernet-mtk_eth_soc-move-ppe-table-hash-offset-.patch @@ -44,7 +44,7 @@ Signed-off-by: Lorenzo Bianconi --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -4144,6 +4144,7 @@ static const struct mtk_soc_data mt7621_ +@@ -4147,6 +4147,7 @@ static const struct mtk_soc_data mt7621_ .required_clks = MT7621_CLKS_BITMAP, .required_pctl = false, .offload_version = 2, @@ -52,7 +52,7 @@ Signed-off-by: Lorenzo Bianconi .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), -@@ -4162,6 +4163,7 @@ static const struct mtk_soc_data mt7622_ +@@ -4165,6 +4166,7 @@ static const struct mtk_soc_data mt7622_ .required_clks = MT7622_CLKS_BITMAP, .required_pctl = false, .offload_version = 2, @@ -60,7 +60,7 @@ Signed-off-by: Lorenzo Bianconi .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), -@@ -4179,6 +4181,7 @@ static const struct mtk_soc_data mt7623_ +@@ -4182,6 +4184,7 @@ static const struct mtk_soc_data mt7623_ .required_clks = MT7623_CLKS_BITMAP, .required_pctl = true, .offload_version = 2, @@ -68,7 +68,7 @@ Signed-off-by: Lorenzo Bianconi .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), -@@ -4212,6 +4215,7 @@ static const struct mtk_soc_data mt7986_ +@@ -4215,6 +4218,7 @@ static const struct mtk_soc_data mt7986_ .caps = MT7986_CAPS, .required_clks = MT7986_CLKS_BITMAP, .required_pctl = false, diff --git a/target/linux/generic/backport-5.15/715-v6.0-net-ethernet-mtk_eth_soc-add-the-capability-to-run-m.patch b/target/linux/generic/backport-5.15/715-v6.0-net-ethernet-mtk_eth_soc-add-the-capability-to-run-m.patch index 6b21a82352e9cd..e779d3b344e8f8 100644 --- a/target/linux/generic/backport-5.15/715-v6.0-net-ethernet-mtk_eth_soc-add-the-capability-to-run-m.patch +++ b/target/linux/generic/backport-5.15/715-v6.0-net-ethernet-mtk_eth_soc-add-the-capability-to-run-m.patch @@ -57,7 +57,7 @@ Signed-off-by: Lorenzo Bianconi if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX) { if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) { -@@ -2930,7 +2930,8 @@ static int mtk_open(struct net_device *d +@@ -2933,7 +2933,8 @@ static int mtk_open(struct net_device *d /* we run 2 netdevs on the same dma ring so we only bring it up once */ if (!refcount_read(ð->dma_refcnt)) { const struct mtk_soc_data *soc = eth->soc; @@ -67,7 +67,7 @@ Signed-off-by: Lorenzo Bianconi int err; err = mtk_start_dma(eth); -@@ -2939,8 +2940,11 @@ static int mtk_open(struct net_device *d +@@ -2942,8 +2943,11 @@ static int mtk_open(struct net_device *d return err; } @@ -81,7 +81,7 @@ Signed-off-by: Lorenzo Bianconi mtk_gdm_config(eth, gdm_config); -@@ -2985,6 +2989,7 @@ static int mtk_stop(struct net_device *d +@@ -2988,6 +2992,7 @@ static int mtk_stop(struct net_device *d { struct mtk_mac *mac = netdev_priv(dev); struct mtk_eth *eth = mac->hw; @@ -89,7 +89,7 @@ Signed-off-by: Lorenzo Bianconi phylink_stop(mac->phylink); -@@ -3012,8 +3017,8 @@ static int mtk_stop(struct net_device *d +@@ -3015,8 +3020,8 @@ static int mtk_stop(struct net_device *d mtk_dma_free(eth); @@ -100,7 +100,7 @@ Signed-off-by: Lorenzo Bianconi return 0; } -@@ -4046,12 +4051,19 @@ static int mtk_probe(struct platform_dev +@@ -4049,12 +4054,19 @@ static int mtk_probe(struct platform_dev } if (eth->soc->offload_version) { diff --git a/target/linux/generic/backport-5.15/716-v6.0-net-ethernet-mtk_eth_soc-move-wdma_base-definitions-.patch b/target/linux/generic/backport-5.15/716-v6.0-net-ethernet-mtk_eth_soc-move-wdma_base-definitions-.patch index 92de6e7963784e..f93285642d1c59 100644 --- a/target/linux/generic/backport-5.15/716-v6.0-net-ethernet-mtk_eth_soc-move-wdma_base-definitions-.patch +++ b/target/linux/generic/backport-5.15/716-v6.0-net-ethernet-mtk_eth_soc-move-wdma_base-definitions-.patch @@ -39,7 +39,7 @@ Signed-off-by: Lorenzo Bianconi }; /* strings used by ethtool */ -@@ -3963,16 +3971,12 @@ static int mtk_probe(struct platform_dev +@@ -3966,16 +3974,12 @@ static int mtk_probe(struct platform_dev for (i = 0;; i++) { struct device_node *np = of_parse_phandle(pdev->dev.of_node, "mediatek,wed", i); diff --git a/target/linux/generic/backport-5.15/717-v6.0-net-ethernet-mtk_eth_soc-add-foe_entry_size-to-mtk_e.patch b/target/linux/generic/backport-5.15/717-v6.0-net-ethernet-mtk_eth_soc-add-foe_entry_size-to-mtk_e.patch index fdafba43d81cd4..656a60b15a2ed6 100644 --- a/target/linux/generic/backport-5.15/717-v6.0-net-ethernet-mtk_eth_soc-add-foe_entry_size-to-mtk_e.patch +++ b/target/linux/generic/backport-5.15/717-v6.0-net-ethernet-mtk_eth_soc-add-foe_entry_size-to-mtk_e.patch @@ -21,7 +21,7 @@ Signed-off-by: Lorenzo Bianconi --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -4161,6 +4161,7 @@ static const struct mtk_soc_data mt7621_ +@@ -4164,6 +4164,7 @@ static const struct mtk_soc_data mt7621_ .required_pctl = false, .offload_version = 2, .hash_offset = 2, @@ -29,7 +29,7 @@ Signed-off-by: Lorenzo Bianconi .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), -@@ -4180,6 +4181,7 @@ static const struct mtk_soc_data mt7622_ +@@ -4183,6 +4184,7 @@ static const struct mtk_soc_data mt7622_ .required_pctl = false, .offload_version = 2, .hash_offset = 2, @@ -37,7 +37,7 @@ Signed-off-by: Lorenzo Bianconi .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), -@@ -4198,6 +4200,7 @@ static const struct mtk_soc_data mt7623_ +@@ -4201,6 +4203,7 @@ static const struct mtk_soc_data mt7623_ .required_pctl = true, .offload_version = 2, .hash_offset = 2, diff --git a/target/linux/generic/backport-5.15/721-v6.0-net-ethernet-mtk_eth_wed-add-wed-support-for-mt7986-.patch b/target/linux/generic/backport-5.15/721-v6.0-net-ethernet-mtk_eth_wed-add-wed-support-for-mt7986-.patch index f87fc4c451a414..f28997c7b2d5dc 100644 --- a/target/linux/generic/backport-5.15/721-v6.0-net-ethernet-mtk_eth_wed-add-wed-support-for-mt7986-.patch +++ b/target/linux/generic/backport-5.15/721-v6.0-net-ethernet-mtk_eth_wed-add-wed-support-for-mt7986-.patch @@ -26,7 +26,7 @@ Signed-off-by: Lorenzo Bianconi --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3888,6 +3888,7 @@ void mtk_eth_set_dma_device(struct mtk_e +@@ -3891,6 +3891,7 @@ void mtk_eth_set_dma_device(struct mtk_e static int mtk_probe(struct platform_device *pdev) { @@ -34,7 +34,7 @@ Signed-off-by: Lorenzo Bianconi struct device_node *mac_np; struct mtk_eth *eth; int err, i; -@@ -3968,16 +3969,31 @@ static int mtk_probe(struct platform_dev +@@ -3971,16 +3972,31 @@ static int mtk_probe(struct platform_dev } } diff --git a/target/linux/generic/backport-5.15/723-v6.0-net-ethernet-mtk_eth_soc-introduce-flow-offloading-s.patch b/target/linux/generic/backport-5.15/723-v6.0-net-ethernet-mtk_eth_soc-introduce-flow-offloading-s.patch index 50ea41240b8b50..f10878da43a856 100644 --- a/target/linux/generic/backport-5.15/723-v6.0-net-ethernet-mtk_eth_soc-introduce-flow-offloading-s.patch +++ b/target/linux/generic/backport-5.15/723-v6.0-net-ethernet-mtk_eth_soc-introduce-flow-offloading-s.patch @@ -49,7 +49,7 @@ Signed-off-by: Lorenzo Bianconi if (reason == MTK_PPE_CPU_REASON_HIT_UNBIND_RATE_REACHED) mtk_ppe_check_skb(eth->ppe[0], skb, hash); -@@ -4177,7 +4178,7 @@ static const struct mtk_soc_data mt7621_ +@@ -4180,7 +4181,7 @@ static const struct mtk_soc_data mt7621_ .required_pctl = false, .offload_version = 2, .hash_offset = 2, @@ -58,7 +58,7 @@ Signed-off-by: Lorenzo Bianconi .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), -@@ -4197,7 +4198,7 @@ static const struct mtk_soc_data mt7622_ +@@ -4200,7 +4201,7 @@ static const struct mtk_soc_data mt7622_ .required_pctl = false, .offload_version = 2, .hash_offset = 2, @@ -67,7 +67,7 @@ Signed-off-by: Lorenzo Bianconi .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), -@@ -4216,7 +4217,7 @@ static const struct mtk_soc_data mt7623_ +@@ -4219,7 +4220,7 @@ static const struct mtk_soc_data mt7623_ .required_pctl = true, .offload_version = 2, .hash_offset = 2, @@ -76,7 +76,7 @@ Signed-off-by: Lorenzo Bianconi .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), -@@ -4248,9 +4249,11 @@ static const struct mtk_soc_data mt7986_ +@@ -4251,9 +4252,11 @@ static const struct mtk_soc_data mt7986_ .reg_map = &mt7986_reg_map, .ana_rgc3 = 0x128, .caps = MT7986_CAPS, diff --git a/target/linux/generic/backport-5.15/724-v6.2-net-ethernet-mtk_eth_soc-enable-flow-offloading-supp.patch b/target/linux/generic/backport-5.15/724-v6.2-net-ethernet-mtk_eth_soc-enable-flow-offloading-supp.patch index cd4747672de35a..aba5673b76d875 100644 --- a/target/linux/generic/backport-5.15/724-v6.2-net-ethernet-mtk_eth_soc-enable-flow-offloading-supp.patch +++ b/target/linux/generic/backport-5.15/724-v6.2-net-ethernet-mtk_eth_soc-enable-flow-offloading-supp.patch @@ -16,7 +16,7 @@ Signed-off-by: Lorenzo Bianconi --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -4252,6 +4252,7 @@ static const struct mtk_soc_data mt7986_ +@@ -4255,6 +4255,7 @@ static const struct mtk_soc_data mt7986_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7986_CLKS_BITMAP, .required_pctl = false, diff --git a/target/linux/generic/backport-5.15/728-v6.1-01-net-ethernet-mtk_eth_soc-fix-possible-memory-leak-in.patch b/target/linux/generic/backport-5.15/728-v6.1-01-net-ethernet-mtk_eth_soc-fix-possible-memory-leak-in.patch index 624e0178bf8c17..7ebe8566a041d2 100644 --- a/target/linux/generic/backport-5.15/728-v6.1-01-net-ethernet-mtk_eth_soc-fix-possible-memory-leak-in.patch +++ b/target/linux/generic/backport-5.15/728-v6.1-01-net-ethernet-mtk_eth_soc-fix-possible-memory-leak-in.patch @@ -17,7 +17,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -4004,19 +4004,23 @@ static int mtk_probe(struct platform_dev +@@ -4007,19 +4007,23 @@ static int mtk_probe(struct platform_dev eth->irq[i] = platform_get_irq(pdev, i); if (eth->irq[i] < 0) { dev_err(&pdev->dev, "no IRQ%d resource found\n", i); @@ -45,7 +45,7 @@ Signed-off-by: David S. Miller } eth->clks[i] = NULL; } -@@ -4027,7 +4031,7 @@ static int mtk_probe(struct platform_dev +@@ -4030,7 +4034,7 @@ static int mtk_probe(struct platform_dev err = mtk_hw_init(eth); if (err) @@ -54,7 +54,7 @@ Signed-off-by: David S. Miller eth->hwlro = MTK_HAS_CAPS(eth->soc->caps, MTK_HWLRO); -@@ -4125,6 +4129,8 @@ err_free_dev: +@@ -4128,6 +4132,8 @@ err_free_dev: mtk_free_dev(eth); err_deinit_hw: mtk_hw_deinit(eth); @@ -63,7 +63,7 @@ Signed-off-by: David S. Miller return err; } -@@ -4144,6 +4150,7 @@ static int mtk_remove(struct platform_de +@@ -4147,6 +4153,7 @@ static int mtk_remove(struct platform_de phylink_disconnect_phy(mac->phylink); } diff --git a/target/linux/generic/backport-5.15/728-v6.1-04-net-ethernet-mtk_eth_soc-fix-resource-leak-in-error-.patch b/target/linux/generic/backport-5.15/728-v6.1-04-net-ethernet-mtk_eth_soc-fix-resource-leak-in-error-.patch index ae3acfef725b85..9c526ecec93ad7 100644 --- a/target/linux/generic/backport-5.15/728-v6.1-04-net-ethernet-mtk_eth_soc-fix-resource-leak-in-error-.patch +++ b/target/linux/generic/backport-5.15/728-v6.1-04-net-ethernet-mtk_eth_soc-fix-resource-leak-in-error-.patch @@ -17,7 +17,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -4087,13 +4087,13 @@ static int mtk_probe(struct platform_dev +@@ -4090,13 +4090,13 @@ static int mtk_probe(struct platform_dev eth->soc->offload_version, i); if (!eth->ppe[i]) { err = -ENOMEM; diff --git a/target/linux/generic/backport-5.15/728-v6.1-05-net-ethernet-mtk_eth_soc-fix-memory-leak-in-error-pa.patch b/target/linux/generic/backport-5.15/728-v6.1-05-net-ethernet-mtk_eth_soc-fix-memory-leak-in-error-pa.patch index b0f5723f7bf1b6..55c9b35238b735 100644 --- a/target/linux/generic/backport-5.15/728-v6.1-05-net-ethernet-mtk_eth_soc-fix-memory-leak-in-error-pa.patch +++ b/target/linux/generic/backport-5.15/728-v6.1-05-net-ethernet-mtk_eth_soc-fix-memory-leak-in-error-pa.patch @@ -21,7 +21,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -4087,13 +4087,13 @@ static int mtk_probe(struct platform_dev +@@ -4090,13 +4090,13 @@ static int mtk_probe(struct platform_dev eth->soc->offload_version, i); if (!eth->ppe[i]) { err = -ENOMEM; @@ -37,7 +37,7 @@ Signed-off-by: Jakub Kicinski } for (i = 0; i < MTK_MAX_DEVS; i++) { -@@ -4103,7 +4103,7 @@ static int mtk_probe(struct platform_dev +@@ -4106,7 +4106,7 @@ static int mtk_probe(struct platform_dev err = register_netdev(eth->netdev[i]); if (err) { dev_err(eth->dev, "error bringing up device\n"); @@ -46,7 +46,7 @@ Signed-off-by: Jakub Kicinski } else netif_info(eth, probe, eth->netdev[i], "mediatek frame engine at 0x%08lx, irq %d\n", -@@ -4123,7 +4123,8 @@ static int mtk_probe(struct platform_dev +@@ -4126,7 +4126,8 @@ static int mtk_probe(struct platform_dev return 0; diff --git a/target/linux/generic/backport-5.15/729-06-v6.1-net-ethernet-mtk_eth_soc-do-not-overwrite-mtu-config.patch b/target/linux/generic/backport-5.15/729-06-v6.1-net-ethernet-mtk_eth_soc-do-not-overwrite-mtu-config.patch index 78f5f1859e4fe5..9206be370f818c 100644 --- a/target/linux/generic/backport-5.15/729-06-v6.1-net-ethernet-mtk_eth_soc-do-not-overwrite-mtu-config.patch +++ b/target/linux/generic/backport-5.15/729-06-v6.1-net-ethernet-mtk_eth_soc-do-not-overwrite-mtu-config.patch @@ -14,7 +14,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3176,6 +3176,30 @@ static void mtk_dim_tx(struct work_struc +@@ -3179,6 +3179,30 @@ static void mtk_dim_tx(struct work_struc dim->state = DIM_START_MEASURE; } @@ -45,7 +45,7 @@ Signed-off-by: David S. Miller static int mtk_hw_init(struct mtk_eth *eth) { u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA | -@@ -3250,8 +3274,16 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3253,8 +3277,16 @@ static int mtk_hw_init(struct mtk_eth *e * up with the more appropriate value when mtk_mac_config call is being * invoked. */ @@ -63,7 +63,7 @@ Signed-off-by: David S. Miller /* Indicates CDM to parse the MTK special tag from CPU * which also is working out for untag packets. -@@ -3350,7 +3382,6 @@ static int mtk_change_mtu(struct net_dev +@@ -3353,7 +3385,6 @@ static int mtk_change_mtu(struct net_dev int length = new_mtu + MTK_RX_ETH_HLEN; struct mtk_mac *mac = netdev_priv(dev); struct mtk_eth *eth = mac->hw; @@ -71,7 +71,7 @@ Signed-off-by: David S. Miller if (rcu_access_pointer(eth->prog) && length > MTK_PP_MAX_BUF_SIZE) { -@@ -3358,23 +3389,7 @@ static int mtk_change_mtu(struct net_dev +@@ -3361,23 +3392,7 @@ static int mtk_change_mtu(struct net_dev return -EINVAL; } diff --git a/target/linux/generic/backport-5.15/729-07-v6.1-net-ethernet-mtk_eth_soc-remove-cpu_relax-in-mtk_pen.patch b/target/linux/generic/backport-5.15/729-07-v6.1-net-ethernet-mtk_eth_soc-remove-cpu_relax-in-mtk_pen.patch index 5b8768899dd160..063415c618195d 100644 --- a/target/linux/generic/backport-5.15/729-07-v6.1-net-ethernet-mtk_eth_soc-remove-cpu_relax-in-mtk_pen.patch +++ b/target/linux/generic/backport-5.15/729-07-v6.1-net-ethernet-mtk_eth_soc-remove-cpu_relax-in-mtk_pen.patch @@ -12,7 +12,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3420,11 +3420,8 @@ static void mtk_pending_work(struct work +@@ -3423,11 +3423,8 @@ static void mtk_pending_work(struct work rtnl_lock(); dev_dbg(eth->dev, "[%s][%d] reset\n", __func__, __LINE__); @@ -25,7 +25,7 @@ Signed-off-by: David S. Miller /* stop all devices to make sure that dma is properly shut down */ for (i = 0; i < MTK_MAC_COUNT; i++) { if (!eth->netdev[i]) -@@ -3458,7 +3455,7 @@ static void mtk_pending_work(struct work +@@ -3461,7 +3458,7 @@ static void mtk_pending_work(struct work dev_dbg(eth->dev, "[%s][%d] reset done\n", __func__, __LINE__); diff --git a/target/linux/generic/backport-5.15/729-08-v6.2-net-ethernet-mtk_eth_soc-fix-RSTCTRL_PPE-0-1-definit.patch b/target/linux/generic/backport-5.15/729-08-v6.2-net-ethernet-mtk_eth_soc-fix-RSTCTRL_PPE-0-1-definit.patch index 12aa3ebf6a7cef..30be5b392bf6d3 100644 --- a/target/linux/generic/backport-5.15/729-08-v6.2-net-ethernet-mtk_eth_soc-fix-RSTCTRL_PPE-0-1-definit.patch +++ b/target/linux/generic/backport-5.15/729-08-v6.2-net-ethernet-mtk_eth_soc-fix-RSTCTRL_PPE-0-1-definit.patch @@ -13,7 +13,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3239,16 +3239,17 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3242,16 +3242,17 @@ static int mtk_hw_init(struct mtk_eth *e return 0; } diff --git a/target/linux/generic/backport-5.15/729-18-v6.3-net-ethernet-mtk_eth_soc-introduce-mtk_hw_reset-util.patch b/target/linux/generic/backport-5.15/729-18-v6.3-net-ethernet-mtk_eth_soc-introduce-mtk_hw_reset-util.patch index 45b85c06cb529d..3ab5dba434ecf0 100644 --- a/target/linux/generic/backport-5.15/729-18-v6.3-net-ethernet-mtk_eth_soc-introduce-mtk_hw_reset-util.patch +++ b/target/linux/generic/backport-5.15/729-18-v6.3-net-ethernet-mtk_eth_soc-introduce-mtk_hw_reset-util.patch @@ -16,7 +16,7 @@ Signed-off-by: Paolo Abeni --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3200,6 +3200,27 @@ static void mtk_set_mcr_max_rx(struct mt +@@ -3203,6 +3203,27 @@ static void mtk_set_mcr_max_rx(struct mt mtk_w32(mac->hw, mcr_new, MTK_MAC_MCR(mac->id)); } @@ -44,7 +44,7 @@ Signed-off-by: Paolo Abeni static int mtk_hw_init(struct mtk_eth *eth) { u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA | -@@ -3239,22 +3260,9 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3242,22 +3263,9 @@ static int mtk_hw_init(struct mtk_eth *e return 0; } diff --git a/target/linux/generic/backport-5.15/729-19-v6.3-net-ethernet-mtk_eth_soc-introduce-mtk_hw_warm_reset.patch b/target/linux/generic/backport-5.15/729-19-v6.3-net-ethernet-mtk_eth_soc-introduce-mtk_hw_warm_reset.patch index 35004462d25248..deb39477ec73fb 100644 --- a/target/linux/generic/backport-5.15/729-19-v6.3-net-ethernet-mtk_eth_soc-introduce-mtk_hw_warm_reset.patch +++ b/target/linux/generic/backport-5.15/729-19-v6.3-net-ethernet-mtk_eth_soc-introduce-mtk_hw_warm_reset.patch @@ -17,7 +17,7 @@ Signed-off-by: Paolo Abeni --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3221,7 +3221,54 @@ static void mtk_hw_reset(struct mtk_eth +@@ -3224,7 +3224,54 @@ static void mtk_hw_reset(struct mtk_eth 0x3ffffff); } @@ -73,7 +73,7 @@ Signed-off-by: Paolo Abeni { u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA | ETHSYS_DMA_AG_MAP_PPE; -@@ -3260,7 +3307,12 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3263,7 +3310,12 @@ static int mtk_hw_init(struct mtk_eth *e return 0; } @@ -87,7 +87,7 @@ Signed-off-by: Paolo Abeni if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) { /* Set FE to PDMAv2 if necessary */ -@@ -3448,7 +3500,7 @@ static void mtk_pending_work(struct work +@@ -3451,7 +3503,7 @@ static void mtk_pending_work(struct work if (eth->dev->pins) pinctrl_select_state(eth->dev->pins->p, eth->dev->pins->default_state); @@ -96,7 +96,7 @@ Signed-off-by: Paolo Abeni /* restart DMA and enable IRQs */ for (i = 0; i < MTK_MAC_COUNT; i++) { -@@ -4050,7 +4102,7 @@ static int mtk_probe(struct platform_dev +@@ -4053,7 +4105,7 @@ static int mtk_probe(struct platform_dev eth->msg_enable = netif_msg_init(mtk_msg_level, MTK_DEFAULT_MSG_ENABLE); INIT_WORK(ð->pending_work, mtk_pending_work); diff --git a/target/linux/generic/backport-5.15/729-20-v6.3-net-ethernet-mtk_eth_soc-align-reset-procedure-to-ve.patch b/target/linux/generic/backport-5.15/729-20-v6.3-net-ethernet-mtk_eth_soc-align-reset-procedure-to-ve.patch index 7dde9a54824d2c..b3812cccbbdbde 100644 --- a/target/linux/generic/backport-5.15/729-20-v6.3-net-ethernet-mtk_eth_soc-align-reset-procedure-to-ve.patch +++ b/target/linux/generic/backport-5.15/729-20-v6.3-net-ethernet-mtk_eth_soc-align-reset-procedure-to-ve.patch @@ -16,7 +16,7 @@ Signed-off-by: Paolo Abeni --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -2786,14 +2786,29 @@ static void mtk_dma_free(struct mtk_eth +@@ -2789,14 +2789,29 @@ static void mtk_dma_free(struct mtk_eth kfree(eth->scratch_head); } @@ -48,7 +48,7 @@ Signed-off-by: Paolo Abeni schedule_work(ð->pending_work); } -@@ -3275,15 +3290,17 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3278,15 +3293,17 @@ static int mtk_hw_init(struct mtk_eth *e const struct mtk_reg_map *reg_map = eth->soc->reg_map; int i, val, ret; @@ -72,7 +72,7 @@ Signed-off-by: Paolo Abeni if (eth->ethsys) regmap_update_bits(eth->ethsys, ETHSYS_DMA_AG_MAP, dma_mask, -@@ -3409,8 +3426,10 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3412,8 +3429,10 @@ static int mtk_hw_init(struct mtk_eth *e return 0; err_disable_pm: @@ -85,7 +85,7 @@ Signed-off-by: Paolo Abeni return ret; } -@@ -3472,30 +3491,53 @@ static int mtk_do_ioctl(struct net_devic +@@ -3475,30 +3494,53 @@ static int mtk_do_ioctl(struct net_devic return -EOPNOTSUPP; } @@ -148,7 +148,7 @@ Signed-off-by: Paolo Abeni if (eth->dev->pins) pinctrl_select_state(eth->dev->pins->p, -@@ -3506,15 +3548,19 @@ static void mtk_pending_work(struct work +@@ -3509,15 +3551,19 @@ static void mtk_pending_work(struct work for (i = 0; i < MTK_MAC_COUNT; i++) { if (!test_bit(i, &restart)) continue; diff --git a/target/linux/generic/backport-5.15/729-21-v6.3-net-ethernet-mtk_eth_soc-add-dma-checks-to-mtk_hw_re.patch b/target/linux/generic/backport-5.15/729-21-v6.3-net-ethernet-mtk_eth_soc-add-dma-checks-to-mtk_hw_re.patch index bc8b9a33274716..633c66f1c2f6c8 100644 --- a/target/linux/generic/backport-5.15/729-21-v6.3-net-ethernet-mtk_eth_soc-add-dma-checks-to-mtk_hw_re.patch +++ b/target/linux/generic/backport-5.15/729-21-v6.3-net-ethernet-mtk_eth_soc-add-dma-checks-to-mtk_hw_re.patch @@ -49,7 +49,7 @@ Signed-off-by: Paolo Abeni }; /* strings used by ethtool */ -@@ -3283,6 +3289,102 @@ static void mtk_hw_warm_reset(struct mtk +@@ -3286,6 +3292,102 @@ static void mtk_hw_warm_reset(struct mtk val, rst_mask); } @@ -152,7 +152,7 @@ Signed-off-by: Paolo Abeni static int mtk_hw_init(struct mtk_eth *eth, bool reset) { u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA | -@@ -3598,6 +3700,7 @@ static int mtk_cleanup(struct mtk_eth *e +@@ -3601,6 +3703,7 @@ static int mtk_cleanup(struct mtk_eth *e mtk_unreg_dev(eth); mtk_free_dev(eth); cancel_work_sync(ð->pending_work); @@ -160,7 +160,7 @@ Signed-off-by: Paolo Abeni return 0; } -@@ -4035,6 +4138,7 @@ static int mtk_probe(struct platform_dev +@@ -4038,6 +4141,7 @@ static int mtk_probe(struct platform_dev eth->rx_dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE; INIT_WORK(ð->rx_dim.work, mtk_dim_rx); @@ -168,7 +168,7 @@ Signed-off-by: Paolo Abeni eth->tx_dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE; INIT_WORK(ð->tx_dim.work, mtk_dim_tx); -@@ -4239,6 +4343,8 @@ static int mtk_probe(struct platform_dev +@@ -4242,6 +4346,8 @@ static int mtk_probe(struct platform_dev NAPI_POLL_WEIGHT); platform_set_drvdata(pdev, eth); diff --git a/target/linux/generic/backport-5.15/729-22-v6.3-net-ethernet-mtk_wed-add-reset-reset_complete-callba.patch b/target/linux/generic/backport-5.15/729-22-v6.3-net-ethernet-mtk_wed-add-reset-reset_complete-callba.patch index ae0e0e959106fa..1f61be0a1fb8a7 100644 --- a/target/linux/generic/backport-5.15/729-22-v6.3-net-ethernet-mtk_wed-add-reset-reset_complete-callba.patch +++ b/target/linux/generic/backport-5.15/729-22-v6.3-net-ethernet-mtk_wed-add-reset-reset_complete-callba.patch @@ -14,7 +14,7 @@ Signed-off-by: Paolo Abeni --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3629,6 +3629,11 @@ static void mtk_pending_work(struct work +@@ -3632,6 +3632,11 @@ static void mtk_pending_work(struct work set_bit(MTK_RESETTING, ð->state); mtk_prepare_for_reset(eth); @@ -26,7 +26,7 @@ Signed-off-by: Paolo Abeni /* stop all devices to make sure that dma is properly shut down */ for (i = 0; i < MTK_MAC_COUNT; i++) { -@@ -3666,6 +3671,8 @@ static void mtk_pending_work(struct work +@@ -3669,6 +3674,8 @@ static void mtk_pending_work(struct work clear_bit(MTK_RESETTING, ð->state); diff --git a/target/linux/generic/backport-5.15/730-02-v6.3-net-ethernet-mtk_eth_soc-increase-tx-ring-side-for-Q.patch b/target/linux/generic/backport-5.15/730-02-v6.3-net-ethernet-mtk_eth_soc-increase-tx-ring-side-for-Q.patch index b3412df9e0ccef..8b6d9e908f2e1a 100644 --- a/target/linux/generic/backport-5.15/730-02-v6.3-net-ethernet-mtk_eth_soc-increase-tx-ring-side-for-Q.patch +++ b/target/linux/generic/backport-5.15/730-02-v6.3-net-ethernet-mtk_eth_soc-increase-tx-ring-side-for-Q.patch @@ -122,7 +122,7 @@ Signed-off-by: Felix Fietkau ring->dma_pdma, ring->phys_pdma); ring->dma_pdma = NULL; } -@@ -2774,7 +2780,7 @@ static void mtk_dma_free(struct mtk_eth +@@ -2777,7 +2783,7 @@ static void mtk_dma_free(struct mtk_eth netdev_reset_queue(eth->netdev[i]); if (eth->scratch_ring) { dma_free_coherent(eth->dma_dev, diff --git a/target/linux/generic/backport-5.15/730-03-v6.3-net-ethernet-mtk_eth_soc-avoid-port_mg-assignment-on.patch b/target/linux/generic/backport-5.15/730-03-v6.3-net-ethernet-mtk_eth_soc-avoid-port_mg-assignment-on.patch index af987c42e25a95..391727b30d3f4d 100644 --- a/target/linux/generic/backport-5.15/730-03-v6.3-net-ethernet-mtk_eth_soc-avoid-port_mg-assignment-on.patch +++ b/target/linux/generic/backport-5.15/730-03-v6.3-net-ethernet-mtk_eth_soc-avoid-port_mg-assignment-on.patch @@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -4422,7 +4422,7 @@ static const struct mtk_soc_data mt7621_ +@@ -4425,7 +4425,7 @@ static const struct mtk_soc_data mt7621_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7621_CLKS_BITMAP, .required_pctl = false, @@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau .hash_offset = 2, .foe_entry_size = sizeof(struct mtk_foe_entry) - 16, .txrx = { -@@ -4461,7 +4461,7 @@ static const struct mtk_soc_data mt7623_ +@@ -4464,7 +4464,7 @@ static const struct mtk_soc_data mt7623_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7623_CLKS_BITMAP, .required_pctl = true, diff --git a/target/linux/generic/backport-5.15/730-04-v6.3-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch b/target/linux/generic/backport-5.15/730-04-v6.3-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch index 2e2299c932fcf0..8e743dd02a374e 100644 --- a/target/linux/generic/backport-5.15/730-04-v6.3-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch +++ b/target/linux/generic/backport-5.15/730-04-v6.3-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch @@ -424,7 +424,7 @@ Signed-off-by: Felix Fietkau } else { mtk_w32(eth, ring->phys_pdma, MT7628_TX_BASE_PTR0); mtk_w32(eth, ring_size, MT7628_TX_MAX_CNT0); -@@ -2904,7 +3020,7 @@ static int mtk_start_dma(struct mtk_eth +@@ -2907,7 +3023,7 @@ static int mtk_start_dma(struct mtk_eth if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) val |= MTK_MUTLI_CNT | MTK_RESV_BUF | MTK_WCOMP_EN | MTK_DMAD_WR_WDONE | @@ -433,7 +433,7 @@ Signed-off-by: Felix Fietkau else val |= MTK_RX_BT_32DWORDS; mtk_w32(eth, val, reg_map->qdma.glo_cfg); -@@ -2950,6 +3066,45 @@ static void mtk_gdm_config(struct mtk_et +@@ -2953,6 +3069,45 @@ static void mtk_gdm_config(struct mtk_et mtk_w32(eth, 0, MTK_RST_GL); } @@ -479,7 +479,7 @@ Signed-off-by: Felix Fietkau static int mtk_open(struct net_device *dev) { struct mtk_mac *mac = netdev_priv(dev); -@@ -2994,7 +3149,8 @@ static int mtk_open(struct net_device *d +@@ -2997,7 +3152,8 @@ static int mtk_open(struct net_device *d refcount_inc(ð->dma_refcnt); phylink_start(mac->phylink); @@ -489,7 +489,7 @@ Signed-off-by: Felix Fietkau return 0; } -@@ -3700,8 +3856,12 @@ static int mtk_unreg_dev(struct mtk_eth +@@ -3703,8 +3859,12 @@ static int mtk_unreg_dev(struct mtk_eth int i; for (i = 0; i < MTK_MAC_COUNT; i++) { @@ -502,7 +502,7 @@ Signed-off-by: Felix Fietkau unregister_netdev(eth->netdev[i]); } -@@ -3918,6 +4078,23 @@ static int mtk_set_rxnfc(struct net_devi +@@ -3921,6 +4081,23 @@ static int mtk_set_rxnfc(struct net_devi return ret; } @@ -526,7 +526,7 @@ Signed-off-by: Felix Fietkau static const struct ethtool_ops mtk_ethtool_ops = { .get_link_ksettings = mtk_get_link_ksettings, .set_link_ksettings = mtk_set_link_ksettings, -@@ -3952,6 +4129,7 @@ static const struct net_device_ops mtk_n +@@ -3955,6 +4132,7 @@ static const struct net_device_ops mtk_n .ndo_setup_tc = mtk_eth_setup_tc, .ndo_bpf = mtk_xdp, .ndo_xdp_xmit = mtk_xdp_xmit, @@ -534,7 +534,7 @@ Signed-off-by: Felix Fietkau }; static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) -@@ -3961,6 +4139,7 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -3964,6 +4142,7 @@ static int mtk_add_mac(struct mtk_eth *e struct phylink *phylink; struct mtk_mac *mac; int id, err; @@ -542,7 +542,7 @@ Signed-off-by: Felix Fietkau if (!_id) { dev_err(eth->dev, "missing mac id\n"); -@@ -3978,7 +4157,10 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -3981,7 +4160,10 @@ static int mtk_add_mac(struct mtk_eth *e return -EINVAL; } @@ -554,7 +554,7 @@ Signed-off-by: Felix Fietkau if (!eth->netdev[id]) { dev_err(eth->dev, "alloc_etherdev failed\n"); return -ENOMEM; -@@ -4086,6 +4268,11 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4089,6 +4271,11 @@ static int mtk_add_mac(struct mtk_eth *e else eth->netdev[id]->max_mtu = MTK_MAX_RX_LENGTH_2K - MTK_RX_ETH_HLEN; diff --git a/target/linux/generic/backport-5.15/730-09-v6.3-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch b/target/linux/generic/backport-5.15/730-09-v6.3-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch index f9d822ad447bb6..3733b7279f91b6 100644 --- a/target/linux/generic/backport-5.15/730-09-v6.3-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch +++ b/target/linux/generic/backport-5.15/730-09-v6.3-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch @@ -52,7 +52,7 @@ Signed-off-by: Felix Fietkau } skb_record_rx_queue(skb, 0); -@@ -2800,15 +2807,30 @@ static netdev_features_t mtk_fix_feature +@@ -2803,15 +2810,30 @@ static netdev_features_t mtk_fix_feature static int mtk_set_features(struct net_device *dev, netdev_features_t features) { @@ -88,7 +88,7 @@ Signed-off-by: Felix Fietkau } /* wait for DMA to finish whatever it is doing before we start using it again */ -@@ -3105,11 +3127,45 @@ found: +@@ -3108,11 +3130,45 @@ found: return NOTIFY_DONE; } @@ -135,7 +135,7 @@ Signed-off-by: Felix Fietkau err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0); if (err) { -@@ -3632,6 +3688,10 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3635,6 +3691,10 @@ static int mtk_hw_init(struct mtk_eth *e */ val = mtk_r32(eth, MTK_CDMQ_IG_CTRL); mtk_w32(eth, val | MTK_CDMQ_STAG_EN, MTK_CDMQ_IG_CTRL); @@ -146,7 +146,7 @@ Signed-off-by: Felix Fietkau /* Enable RX VLan Offloading */ mtk_w32(eth, 1, MTK_CDMP_EG_CTRL); -@@ -3848,6 +3908,12 @@ static int mtk_free_dev(struct mtk_eth * +@@ -3851,6 +3911,12 @@ static int mtk_free_dev(struct mtk_eth * free_netdev(eth->netdev[i]); } diff --git a/target/linux/generic/backport-5.15/730-10-v6.3-net-ethernet-mtk_eth_soc-drop-packets-to-WDMA-if-the.patch b/target/linux/generic/backport-5.15/730-10-v6.3-net-ethernet-mtk_eth_soc-drop-packets-to-WDMA-if-the.patch index 0bf48b07800132..9c2843a6c9c34d 100644 --- a/target/linux/generic/backport-5.15/730-10-v6.3-net-ethernet-mtk_eth_soc-drop-packets-to-WDMA-if-the.patch +++ b/target/linux/generic/backport-5.15/730-10-v6.3-net-ethernet-mtk_eth_soc-drop-packets-to-WDMA-if-the.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3712,9 +3712,12 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3715,9 +3715,12 @@ static int mtk_hw_init(struct mtk_eth *e mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP); if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) { diff --git a/target/linux/generic/backport-5.15/730-12-v6.3-net-ethernet-mtk_eth_soc-disable-hardware-DSA-untagg.patch b/target/linux/generic/backport-5.15/730-12-v6.3-net-ethernet-mtk_eth_soc-disable-hardware-DSA-untagg.patch index 08bf608bc1217b..5a4d343a72cf39 100644 --- a/target/linux/generic/backport-5.15/730-12-v6.3-net-ethernet-mtk_eth_soc-disable-hardware-DSA-untagg.patch +++ b/target/linux/generic/backport-5.15/730-12-v6.3-net-ethernet-mtk_eth_soc-disable-hardware-DSA-untagg.patch @@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3143,7 +3143,8 @@ static int mtk_open(struct net_device *d +@@ -3146,7 +3146,8 @@ static int mtk_open(struct net_device *d struct mtk_eth *eth = mac->hw; int i, err; @@ -30,7 +30,7 @@ Signed-off-by: Jakub Kicinski for (i = 0; i < ARRAY_SIZE(eth->dsa_meta); i++) { struct metadata_dst *md_dst = eth->dsa_meta[i]; -@@ -3160,7 +3161,8 @@ static int mtk_open(struct net_device *d +@@ -3163,7 +3164,8 @@ static int mtk_open(struct net_device *d } } else { /* Hardware special tag parsing needs to be disabled if at least diff --git a/target/linux/generic/backport-5.15/730-13-v6.3-net-ethernet-mtk_eth_soc-enable-special-tag-when-any.patch b/target/linux/generic/backport-5.15/730-13-v6.3-net-ethernet-mtk_eth_soc-enable-special-tag-when-any.patch index efab99ada006ef..e93e62125d458a 100644 --- a/target/linux/generic/backport-5.15/730-13-v6.3-net-ethernet-mtk_eth_soc-enable-special-tag-when-any.patch +++ b/target/linux/generic/backport-5.15/730-13-v6.3-net-ethernet-mtk_eth_soc-enable-special-tag-when-any.patch @@ -23,7 +23,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3078,7 +3078,7 @@ static void mtk_gdm_config(struct mtk_et +@@ -3081,7 +3081,7 @@ static void mtk_gdm_config(struct mtk_et val |= config; @@ -32,7 +32,7 @@ Signed-off-by: David S. Miller val |= MTK_GDMA_SPECIAL_TAG; mtk_w32(eth, val, MTK_GDMA_FWD_CFG(i)); -@@ -3143,8 +3143,7 @@ static int mtk_open(struct net_device *d +@@ -3146,8 +3146,7 @@ static int mtk_open(struct net_device *d struct mtk_eth *eth = mac->hw; int i, err; @@ -42,7 +42,7 @@ Signed-off-by: David S. Miller for (i = 0; i < ARRAY_SIZE(eth->dsa_meta); i++) { struct metadata_dst *md_dst = eth->dsa_meta[i]; -@@ -3161,8 +3160,7 @@ static int mtk_open(struct net_device *d +@@ -3164,8 +3163,7 @@ static int mtk_open(struct net_device *d } } else { /* Hardware special tag parsing needs to be disabled if at least diff --git a/target/linux/generic/backport-5.15/733-v6.3-18-net-ethernet-mtk_eth_soc-add-support-for-MT7981.patch b/target/linux/generic/backport-5.15/733-v6.3-18-net-ethernet-mtk_eth_soc-add-support-for-MT7981.patch index 1ae4e83363232e..b59638e772b80c 100644 --- a/target/linux/generic/backport-5.15/733-v6.3-18-net-ethernet-mtk_eth_soc-add-support-for-MT7981.patch +++ b/target/linux/generic/backport-5.15/733-v6.3-18-net-ethernet-mtk_eth_soc-add-support-for-MT7981.patch @@ -51,7 +51,7 @@ Signed-off-by: Jakub Kicinski mtk_eth_path_name(path), __func__, updated); --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -4749,6 +4749,26 @@ static const struct mtk_soc_data mt7629_ +@@ -4752,6 +4752,26 @@ static const struct mtk_soc_data mt7629_ }, }; @@ -78,7 +78,7 @@ Signed-off-by: Jakub Kicinski static const struct mtk_soc_data mt7986_data = { .reg_map = &mt7986_reg_map, .ana_rgc3 = 0x128, -@@ -4791,6 +4811,7 @@ const struct of_device_id of_mtk_match[] +@@ -4794,6 +4814,7 @@ const struct of_device_id of_mtk_match[] { .compatible = "mediatek,mt7622-eth", .data = &mt7622_data}, { .compatible = "mediatek,mt7623-eth", .data = &mt7623_data}, { .compatible = "mediatek,mt7629-eth", .data = &mt7629_data}, diff --git a/target/linux/generic/backport-5.15/733-v6.3-20-net-ethernet-mtk_eth_soc-switch-to-external-PCS-driv.patch b/target/linux/generic/backport-5.15/733-v6.3-20-net-ethernet-mtk_eth_soc-switch-to-external-PCS-driv.patch index 42a700d5439219..c55d6b6428caf1 100644 --- a/target/linux/generic/backport-5.15/733-v6.3-20-net-ethernet-mtk_eth_soc-switch-to-external-PCS-driv.patch +++ b/target/linux/generic/backport-5.15/733-v6.3-20-net-ethernet-mtk_eth_soc-switch-to-external-PCS-driv.patch @@ -60,7 +60,7 @@ Signed-off-by: Jakub Kicinski } return NULL; -@@ -3960,8 +3961,17 @@ static int mtk_unreg_dev(struct mtk_eth +@@ -3963,8 +3964,17 @@ static int mtk_unreg_dev(struct mtk_eth return 0; } @@ -78,7 +78,7 @@ Signed-off-by: Jakub Kicinski mtk_unreg_dev(eth); mtk_free_dev(eth); cancel_work_sync(ð->pending_work); -@@ -4401,6 +4411,36 @@ void mtk_eth_set_dma_device(struct mtk_e +@@ -4404,6 +4414,36 @@ void mtk_eth_set_dma_device(struct mtk_e rtnl_unlock(); } @@ -115,7 +115,7 @@ Signed-off-by: Jakub Kicinski static int mtk_probe(struct platform_device *pdev) { struct resource *res = NULL; -@@ -4464,13 +4504,7 @@ static int mtk_probe(struct platform_dev +@@ -4467,13 +4507,7 @@ static int mtk_probe(struct platform_dev } if (MTK_HAS_CAPS(eth->soc->caps, MTK_SGMII)) { @@ -130,7 +130,7 @@ Signed-off-by: Jakub Kicinski if (err) return err; -@@ -4481,14 +4515,17 @@ static int mtk_probe(struct platform_dev +@@ -4484,14 +4518,17 @@ static int mtk_probe(struct platform_dev "mediatek,pctl"); if (IS_ERR(eth->pctl)) { dev_err(&pdev->dev, "no pctl regmap found\n"); @@ -151,7 +151,7 @@ Signed-off-by: Jakub Kicinski } if (eth->soc->offload_version) { -@@ -4649,6 +4686,8 @@ err_deinit_hw: +@@ -4652,6 +4689,8 @@ err_deinit_hw: mtk_hw_deinit(eth); err_wed_exit: mtk_wed_exit(); diff --git a/target/linux/generic/backport-5.15/733-v6.4-24-net-ethernet-mtk_eth_soc-ppe-add-support-for-flow-ac.patch b/target/linux/generic/backport-5.15/733-v6.4-24-net-ethernet-mtk_eth_soc-ppe-add-support-for-flow-ac.patch index 51ebcfe8f11901..1c804f29b67e58 100644 --- a/target/linux/generic/backport-5.15/733-v6.4-24-net-ethernet-mtk_eth_soc-ppe-add-support-for-flow-ac.patch +++ b/target/linux/generic/backport-5.15/733-v6.4-24-net-ethernet-mtk_eth_soc-ppe-add-support-for-flow-ac.patch @@ -53,7 +53,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -4635,8 +4635,8 @@ static int mtk_probe(struct platform_dev +@@ -4638,8 +4638,8 @@ static int mtk_probe(struct platform_dev for (i = 0; i < num_ppe; i++) { u32 ppe_addr = eth->soc->reg_map->ppe_base + i * 0x400; @@ -64,7 +64,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov if (!eth->ppe[i]) { err = -ENOMEM; goto err_deinit_ppe; -@@ -4762,6 +4762,7 @@ static const struct mtk_soc_data mt7622_ +@@ -4765,6 +4765,7 @@ static const struct mtk_soc_data mt7622_ .required_pctl = false, .offload_version = 2, .hash_offset = 2, @@ -72,7 +72,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov .foe_entry_size = sizeof(struct mtk_foe_entry) - 16, .txrx = { .txd_size = sizeof(struct mtk_tx_dma), -@@ -4799,6 +4800,7 @@ static const struct mtk_soc_data mt7629_ +@@ -4802,6 +4803,7 @@ static const struct mtk_soc_data mt7629_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7629_CLKS_BITMAP, .required_pctl = false, @@ -80,7 +80,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), -@@ -4819,6 +4821,7 @@ static const struct mtk_soc_data mt7981_ +@@ -4822,6 +4824,7 @@ static const struct mtk_soc_data mt7981_ .offload_version = 2, .hash_offset = 4, .foe_entry_size = sizeof(struct mtk_foe_entry), @@ -88,7 +88,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov .txrx = { .txd_size = sizeof(struct mtk_tx_dma_v2), .rxd_size = sizeof(struct mtk_rx_dma_v2), -@@ -4839,6 +4842,7 @@ static const struct mtk_soc_data mt7986_ +@@ -4842,6 +4845,7 @@ static const struct mtk_soc_data mt7986_ .offload_version = 2, .hash_offset = 4, .foe_entry_size = sizeof(struct mtk_foe_entry), diff --git a/target/linux/generic/backport-5.15/733-v6.4-26-net-ethernet-mtk_eth_soc-drop-generic-vlan-rx-offloa.patch b/target/linux/generic/backport-5.15/733-v6.4-26-net-ethernet-mtk_eth_soc-drop-generic-vlan-rx-offloa.patch index f6c70e7e6aff02..6126dfeadc2e94 100644 --- a/target/linux/generic/backport-5.15/733-v6.4-26-net-ethernet-mtk_eth_soc-drop-generic-vlan-rx-offloa.patch +++ b/target/linux/generic/backport-5.15/733-v6.4-26-net-ethernet-mtk_eth_soc-drop-generic-vlan-rx-offloa.patch @@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau skb_record_rx_queue(skb, 0); napi_gro_receive(napi, skb); -@@ -2831,29 +2814,11 @@ static netdev_features_t mtk_fix_feature +@@ -2834,29 +2817,11 @@ static netdev_features_t mtk_fix_feature static int mtk_set_features(struct net_device *dev, netdev_features_t features) { @@ -100,7 +100,7 @@ Signed-off-by: Felix Fietkau return 0; } -@@ -3167,30 +3132,6 @@ static int mtk_open(struct net_device *d +@@ -3170,30 +3135,6 @@ static int mtk_open(struct net_device *d struct mtk_eth *eth = mac->hw; int i, err; @@ -131,7 +131,7 @@ Signed-off-by: Felix Fietkau err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0); if (err) { netdev_err(dev, "%s: could not attach PHY: %d\n", __func__, -@@ -3231,6 +3172,35 @@ static int mtk_open(struct net_device *d +@@ -3234,6 +3175,35 @@ static int mtk_open(struct net_device *d phylink_start(mac->phylink); netif_tx_start_all_queues(dev); @@ -167,7 +167,7 @@ Signed-off-by: Felix Fietkau return 0; } -@@ -3715,10 +3685,9 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3718,10 +3688,9 @@ static int mtk_hw_init(struct mtk_eth *e if (!MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) { val = mtk_r32(eth, MTK_CDMP_IG_CTRL); mtk_w32(eth, val | MTK_CDMP_STAG_EN, MTK_CDMP_IG_CTRL); @@ -180,7 +180,7 @@ Signed-off-by: Felix Fietkau /* set interrupt delays based on current Net DIM sample */ mtk_dim_rx(ð->rx_dim.work); -@@ -4358,7 +4327,7 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4361,7 +4330,7 @@ static int mtk_add_mac(struct mtk_eth *e eth->netdev[id]->hw_features |= NETIF_F_LRO; eth->netdev[id]->vlan_features = eth->soc->hw_features & diff --git a/target/linux/generic/backport-5.15/750-v6.5-01-net-ethernet-mtk_ppe-add-MTK_FOE_ENTRY_V-1-2-_SIZE-m.patch b/target/linux/generic/backport-5.15/750-v6.5-01-net-ethernet-mtk_ppe-add-MTK_FOE_ENTRY_V-1-2-_SIZE-m.patch index 0ba8bb8ec43ac1..ad63dd61963626 100644 --- a/target/linux/generic/backport-5.15/750-v6.5-01-net-ethernet-mtk_ppe-add-MTK_FOE_ENTRY_V-1-2-_SIZE-m.patch +++ b/target/linux/generic/backport-5.15/750-v6.5-01-net-ethernet-mtk_ppe-add-MTK_FOE_ENTRY_V-1-2-_SIZE-m.patch @@ -17,7 +17,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -4711,7 +4711,7 @@ static const struct mtk_soc_data mt7621_ +@@ -4714,7 +4714,7 @@ static const struct mtk_soc_data mt7621_ .required_pctl = false, .offload_version = 1, .hash_offset = 2, @@ -26,7 +26,7 @@ Signed-off-by: David S. Miller .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), -@@ -4732,7 +4732,7 @@ static const struct mtk_soc_data mt7622_ +@@ -4735,7 +4735,7 @@ static const struct mtk_soc_data mt7622_ .offload_version = 2, .hash_offset = 2, .has_accounting = true, @@ -35,7 +35,7 @@ Signed-off-by: David S. Miller .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), -@@ -4751,7 +4751,7 @@ static const struct mtk_soc_data mt7623_ +@@ -4754,7 +4754,7 @@ static const struct mtk_soc_data mt7623_ .required_pctl = true, .offload_version = 1, .hash_offset = 2, @@ -44,7 +44,7 @@ Signed-off-by: David S. Miller .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), -@@ -4789,8 +4789,8 @@ static const struct mtk_soc_data mt7981_ +@@ -4792,8 +4792,8 @@ static const struct mtk_soc_data mt7981_ .required_pctl = false, .offload_version = 2, .hash_offset = 4, @@ -54,7 +54,7 @@ Signed-off-by: David S. Miller .txrx = { .txd_size = sizeof(struct mtk_tx_dma_v2), .rxd_size = sizeof(struct mtk_rx_dma_v2), -@@ -4810,8 +4810,8 @@ static const struct mtk_soc_data mt7986_ +@@ -4813,8 +4813,8 @@ static const struct mtk_soc_data mt7986_ .required_pctl = false, .offload_version = 2, .hash_offset = 4, diff --git a/target/linux/generic/backport-5.15/750-v6.5-02-net-ethernet-mtk_eth_soc-remove-incorrect-PLL-config.patch b/target/linux/generic/backport-5.15/750-v6.5-02-net-ethernet-mtk_eth_soc-remove-incorrect-PLL-config.patch index 681022078cb8d6..c502c4c28c4ac4 100644 --- a/target/linux/generic/backport-5.15/750-v6.5-02-net-ethernet-mtk_eth_soc-remove-incorrect-PLL-config.patch +++ b/target/linux/generic/backport-5.15/750-v6.5-02-net-ethernet-mtk_eth_soc-remove-incorrect-PLL-config.patch @@ -95,7 +95,7 @@ Signed-off-by: Paolo Abeni /* mt7623_pad_clk_setup */ for (i = 0 ; i < NUM_TRGMII_CTRL; i++) -@@ -4286,13 +4258,19 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4289,13 +4261,19 @@ static int mtk_add_mac(struct mtk_eth *e mac->phylink_config.mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE | MAC_10 | MAC_100 | MAC_1000 | MAC_2500FD; @@ -121,7 +121,7 @@ Signed-off-by: Paolo Abeni if (MTK_HAS_CAPS(mac->hw->soc->caps, MTK_TRGMII) && !mac->id) __set_bit(PHY_INTERFACE_MODE_TRGMII, -@@ -4752,6 +4730,7 @@ static const struct mtk_soc_data mt7623_ +@@ -4755,6 +4733,7 @@ static const struct mtk_soc_data mt7623_ .offload_version = 1, .hash_offset = 2, .foe_entry_size = MTK_FOE_ENTRY_V1_SIZE, diff --git a/target/linux/generic/backport-5.15/750-v6.5-03-net-ethernet-mtk_eth_soc-remove-mac_pcs_get_state-an.patch b/target/linux/generic/backport-5.15/750-v6.5-03-net-ethernet-mtk_eth_soc-remove-mac_pcs_get_state-an.patch index 816f98ecc537cc..21ca0b1c08ca78 100644 --- a/target/linux/generic/backport-5.15/750-v6.5-03-net-ethernet-mtk_eth_soc-remove-mac_pcs_get_state-an.patch +++ b/target/linux/generic/backport-5.15/750-v6.5-03-net-ethernet-mtk_eth_soc-remove-mac_pcs_get_state-an.patch @@ -70,7 +70,7 @@ Signed-off-by: Paolo Abeni .mac_config = mtk_mac_config, .mac_finish = mtk_mac_finish, .mac_link_down = mtk_mac_link_down, -@@ -4253,8 +4220,6 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4256,8 +4223,6 @@ static int mtk_add_mac(struct mtk_eth *e mac->phylink_config.dev = ð->netdev[id]->dev; mac->phylink_config.type = PHYLINK_NETDEV; diff --git a/target/linux/generic/backport-5.15/750-v6.5-05-net-ethernet-mtk_eth_soc-add-version-in-mtk_soc_data.patch b/target/linux/generic/backport-5.15/750-v6.5-05-net-ethernet-mtk_eth_soc-add-version-in-mtk_soc_data.patch index d836acc4b04503..d1d692002d12a4 100644 --- a/target/linux/generic/backport-5.15/750-v6.5-05-net-ethernet-mtk_eth_soc-add-version-in-mtk_soc_data.patch +++ b/target/linux/generic/backport-5.15/750-v6.5-05-net-ethernet-mtk_eth_soc-add-version-in-mtk_soc_data.patch @@ -132,7 +132,7 @@ Signed-off-by: Jakub Kicinski rxd->rxd5 = 0; rxd->rxd6 = 0; rxd->rxd7 = 0; -@@ -2967,7 +2967,7 @@ static int mtk_start_dma(struct mtk_eth +@@ -2970,7 +2970,7 @@ static int mtk_start_dma(struct mtk_eth MTK_TX_BT_32DWORDS | MTK_NDP_CO_PRO | MTK_RX_2B_OFFSET | MTK_TX_WB_DDONE; @@ -141,7 +141,7 @@ Signed-off-by: Jakub Kicinski val |= MTK_MUTLI_CNT | MTK_RESV_BUF | MTK_WCOMP_EN | MTK_DMAD_WR_WDONE | MTK_CHK_DDONE_EN | MTK_LEAKY_BUCKET_EN; -@@ -3111,7 +3111,7 @@ static int mtk_open(struct net_device *d +@@ -3114,7 +3114,7 @@ static int mtk_open(struct net_device *d phylink_start(mac->phylink); netif_tx_start_all_queues(dev); @@ -150,7 +150,7 @@ Signed-off-by: Jakub Kicinski return 0; if (mtk_uses_dsa(dev) && !eth->prog) { -@@ -3376,7 +3376,7 @@ static void mtk_hw_reset(struct mtk_eth +@@ -3379,7 +3379,7 @@ static void mtk_hw_reset(struct mtk_eth { u32 val; @@ -159,7 +159,7 @@ Signed-off-by: Jakub Kicinski regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN, 0); val = RSTCTRL_PPE0_V2; } else { -@@ -3388,7 +3388,7 @@ static void mtk_hw_reset(struct mtk_eth +@@ -3391,7 +3391,7 @@ static void mtk_hw_reset(struct mtk_eth ethsys_reset(eth, RSTCTRL_ETH | RSTCTRL_FE | val); @@ -168,7 +168,7 @@ Signed-off-by: Jakub Kicinski regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN, 0x3ffffff); } -@@ -3414,7 +3414,7 @@ static void mtk_hw_warm_reset(struct mtk +@@ -3417,7 +3417,7 @@ static void mtk_hw_warm_reset(struct mtk return; } @@ -177,7 +177,7 @@ Signed-off-by: Jakub Kicinski rst_mask = RSTCTRL_ETH | RSTCTRL_PPE0_V2; else rst_mask = RSTCTRL_ETH | RSTCTRL_PPE0; -@@ -3584,7 +3584,7 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3587,7 +3587,7 @@ static int mtk_hw_init(struct mtk_eth *e else mtk_hw_reset(eth); @@ -186,7 +186,7 @@ Signed-off-by: Jakub Kicinski /* Set FE to PDMAv2 if necessary */ val = mtk_r32(eth, MTK_FE_GLO_MISC); mtk_w32(eth, val | BIT(4), MTK_FE_GLO_MISC); -@@ -3621,7 +3621,7 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3624,7 +3624,7 @@ static int mtk_hw_init(struct mtk_eth *e */ val = mtk_r32(eth, MTK_CDMQ_IG_CTRL); mtk_w32(eth, val | MTK_CDMQ_STAG_EN, MTK_CDMQ_IG_CTRL); @@ -195,7 +195,7 @@ Signed-off-by: Jakub Kicinski val = mtk_r32(eth, MTK_CDMP_IG_CTRL); mtk_w32(eth, val | MTK_CDMP_STAG_EN, MTK_CDMP_IG_CTRL); -@@ -3643,7 +3643,7 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3646,7 +3646,7 @@ static int mtk_hw_init(struct mtk_eth *e mtk_w32(eth, eth->soc->txrx.rx_irq_done_mask, reg_map->qdma.int_grp + 4); mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP); @@ -204,7 +204,7 @@ Signed-off-by: Jakub Kicinski /* PSE should not drop port8 and port9 packets from WDMA Tx */ mtk_w32(eth, 0x00000300, PSE_DROP_CFG); -@@ -4432,7 +4432,7 @@ static int mtk_probe(struct platform_dev +@@ -4435,7 +4435,7 @@ static int mtk_probe(struct platform_dev } } @@ -213,7 +213,7 @@ Signed-off-by: Jakub Kicinski res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { err = -EINVAL; -@@ -4540,9 +4540,8 @@ static int mtk_probe(struct platform_dev +@@ -4543,9 +4543,8 @@ static int mtk_probe(struct platform_dev } if (eth->soc->offload_version) { @@ -224,7 +224,7 @@ Signed-off-by: Jakub Kicinski num_ppe = min_t(u32, ARRAY_SIZE(eth->ppe), num_ppe); for (i = 0; i < num_ppe; i++) { u32 ppe_addr = eth->soc->reg_map->ppe_base + i * 0x400; -@@ -4636,6 +4635,7 @@ static const struct mtk_soc_data mt2701_ +@@ -4639,6 +4638,7 @@ static const struct mtk_soc_data mt2701_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7623_CLKS_BITMAP, .required_pctl = true, @@ -232,7 +232,7 @@ Signed-off-by: Jakub Kicinski .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), -@@ -4652,6 +4652,7 @@ static const struct mtk_soc_data mt7621_ +@@ -4655,6 +4655,7 @@ static const struct mtk_soc_data mt7621_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7621_CLKS_BITMAP, .required_pctl = false, @@ -240,7 +240,7 @@ Signed-off-by: Jakub Kicinski .offload_version = 1, .hash_offset = 2, .foe_entry_size = MTK_FOE_ENTRY_V1_SIZE, -@@ -4672,6 +4673,7 @@ static const struct mtk_soc_data mt7622_ +@@ -4675,6 +4676,7 @@ static const struct mtk_soc_data mt7622_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7622_CLKS_BITMAP, .required_pctl = false, @@ -248,7 +248,7 @@ Signed-off-by: Jakub Kicinski .offload_version = 2, .hash_offset = 2, .has_accounting = true, -@@ -4692,6 +4694,7 @@ static const struct mtk_soc_data mt7623_ +@@ -4695,6 +4697,7 @@ static const struct mtk_soc_data mt7623_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7623_CLKS_BITMAP, .required_pctl = true, @@ -256,7 +256,7 @@ Signed-off-by: Jakub Kicinski .offload_version = 1, .hash_offset = 2, .foe_entry_size = MTK_FOE_ENTRY_V1_SIZE, -@@ -4714,6 +4717,7 @@ static const struct mtk_soc_data mt7629_ +@@ -4717,6 +4720,7 @@ static const struct mtk_soc_data mt7629_ .required_clks = MT7629_CLKS_BITMAP, .required_pctl = false, .has_accounting = true, @@ -264,7 +264,7 @@ Signed-off-by: Jakub Kicinski .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), -@@ -4731,6 +4735,7 @@ static const struct mtk_soc_data mt7981_ +@@ -4734,6 +4738,7 @@ static const struct mtk_soc_data mt7981_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7981_CLKS_BITMAP, .required_pctl = false, @@ -272,7 +272,7 @@ Signed-off-by: Jakub Kicinski .offload_version = 2, .hash_offset = 4, .has_accounting = true, -@@ -4752,6 +4757,7 @@ static const struct mtk_soc_data mt7986_ +@@ -4755,6 +4760,7 @@ static const struct mtk_soc_data mt7986_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7986_CLKS_BITMAP, .required_pctl = false, @@ -280,7 +280,7 @@ Signed-off-by: Jakub Kicinski .offload_version = 2, .hash_offset = 4, .has_accounting = true, -@@ -4772,6 +4778,7 @@ static const struct mtk_soc_data rt5350_ +@@ -4775,6 +4781,7 @@ static const struct mtk_soc_data rt5350_ .hw_features = MTK_HW_FEATURES_MT7628, .required_clks = MT7628_CLKS_BITMAP, .required_pctl = false, diff --git a/target/linux/generic/backport-5.15/750-v6.5-07-net-ethernet-mtk_eth_soc-rely-on-MTK_MAX_DEVS-and-re.patch b/target/linux/generic/backport-5.15/750-v6.5-07-net-ethernet-mtk_eth_soc-rely-on-MTK_MAX_DEVS-and-re.patch index 58729cec521510..281291252b45a5 100644 --- a/target/linux/generic/backport-5.15/750-v6.5-07-net-ethernet-mtk_eth_soc-rely-on-MTK_MAX_DEVS-and-re.patch +++ b/target/linux/generic/backport-5.15/750-v6.5-07-net-ethernet-mtk_eth_soc-rely-on-MTK_MAX_DEVS-and-re.patch @@ -53,7 +53,7 @@ Signed-off-by: Jakub Kicinski !eth->netdev[mac])) goto release_desc; -@@ -2841,7 +2841,7 @@ static void mtk_dma_free(struct mtk_eth +@@ -2844,7 +2844,7 @@ static void mtk_dma_free(struct mtk_eth const struct mtk_soc_data *soc = eth->soc; int i; @@ -62,7 +62,7 @@ Signed-off-by: Jakub Kicinski if (eth->netdev[i]) netdev_reset_queue(eth->netdev[i]); if (eth->scratch_ring) { -@@ -2995,8 +2995,13 @@ static void mtk_gdm_config(struct mtk_et +@@ -2998,8 +2998,13 @@ static void mtk_gdm_config(struct mtk_et if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) return; @@ -78,7 +78,7 @@ Signed-off-by: Jakub Kicinski /* default setup the forward port to send frame to PDMA */ val &= ~0xffff; -@@ -3006,7 +3011,7 @@ static void mtk_gdm_config(struct mtk_et +@@ -3009,7 +3014,7 @@ static void mtk_gdm_config(struct mtk_et val |= config; @@ -87,7 +87,7 @@ Signed-off-by: Jakub Kicinski val |= MTK_GDMA_SPECIAL_TAG; mtk_w32(eth, val, MTK_GDMA_FWD_CFG(i)); -@@ -3605,15 +3610,15 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3608,15 +3613,15 @@ static int mtk_hw_init(struct mtk_eth *e * up with the more appropriate value when mtk_mac_config call is being * invoked. */ @@ -109,7 +109,7 @@ Signed-off-by: Jakub Kicinski } /* Indicates CDM to parse the MTK special tag from CPU -@@ -3793,7 +3798,7 @@ static void mtk_pending_work(struct work +@@ -3796,7 +3801,7 @@ static void mtk_pending_work(struct work mtk_prepare_for_reset(eth); /* stop all devices to make sure that dma is properly shut down */ @@ -118,7 +118,7 @@ Signed-off-by: Jakub Kicinski if (!eth->netdev[i] || !netif_running(eth->netdev[i])) continue; -@@ -3809,8 +3814,8 @@ static void mtk_pending_work(struct work +@@ -3812,8 +3817,8 @@ static void mtk_pending_work(struct work mtk_hw_init(eth, true); /* restart DMA and enable IRQs */ @@ -129,7 +129,7 @@ Signed-off-by: Jakub Kicinski continue; if (mtk_open(eth->netdev[i])) { -@@ -3837,7 +3842,7 @@ static int mtk_free_dev(struct mtk_eth * +@@ -3840,7 +3845,7 @@ static int mtk_free_dev(struct mtk_eth * { int i; @@ -138,7 +138,7 @@ Signed-off-by: Jakub Kicinski if (!eth->netdev[i]) continue; free_netdev(eth->netdev[i]); -@@ -3856,7 +3861,7 @@ static int mtk_unreg_dev(struct mtk_eth +@@ -3859,7 +3864,7 @@ static int mtk_unreg_dev(struct mtk_eth { int i; @@ -147,7 +147,7 @@ Signed-off-by: Jakub Kicinski struct mtk_mac *mac; if (!eth->netdev[i]) continue; -@@ -4157,7 +4162,7 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4160,7 +4165,7 @@ static int mtk_add_mac(struct mtk_eth *e } id = be32_to_cpup(_id); @@ -156,7 +156,7 @@ Signed-off-by: Jakub Kicinski dev_err(eth->dev, "%d is not a valid mac id\n", id); return -EINVAL; } -@@ -4302,7 +4307,7 @@ void mtk_eth_set_dma_device(struct mtk_e +@@ -4305,7 +4310,7 @@ void mtk_eth_set_dma_device(struct mtk_e rtnl_lock(); @@ -165,7 +165,7 @@ Signed-off-by: Jakub Kicinski dev = eth->netdev[i]; if (!dev || !(dev->flags & IFF_UP)) -@@ -4610,7 +4615,7 @@ static int mtk_remove(struct platform_de +@@ -4613,7 +4618,7 @@ static int mtk_remove(struct platform_de int i; /* stop all devices to make sure that dma is properly shut down */ diff --git a/target/linux/generic/backport-5.15/750-v6.5-08-net-ethernet-mtk_eth_soc-add-NETSYS_V3-version-suppo.patch b/target/linux/generic/backport-5.15/750-v6.5-08-net-ethernet-mtk_eth_soc-add-NETSYS_V3-version-suppo.patch index 09f59c291ce92d..abfda59339a186 100644 --- a/target/linux/generic/backport-5.15/750-v6.5-08-net-ethernet-mtk_eth_soc-add-NETSYS_V3-version-suppo.patch +++ b/target/linux/generic/backport-5.15/750-v6.5-08-net-ethernet-mtk_eth_soc-add-NETSYS_V3-version-suppo.patch @@ -167,7 +167,7 @@ Signed-off-by: Jakub Kicinski budget--; } -@@ -3648,7 +3676,24 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3651,7 +3679,24 @@ static int mtk_hw_init(struct mtk_eth *e mtk_w32(eth, eth->soc->txrx.rx_irq_done_mask, reg_map->qdma.int_grp + 4); mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP); @@ -193,7 +193,7 @@ Signed-off-by: Jakub Kicinski /* PSE should not drop port8 and port9 packets from WDMA Tx */ mtk_w32(eth, 0x00000300, PSE_DROP_CFG); -@@ -4210,7 +4255,11 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4213,7 +4258,11 @@ static int mtk_add_mac(struct mtk_eth *e } spin_lock_init(&mac->hw_stats->stats_lock); u64_stats_init(&mac->hw_stats->syncp); diff --git a/target/linux/generic/backport-5.15/750-v6.5-11-net-ethernet-mtk_eth_soc-add-basic-support-for-MT798.patch b/target/linux/generic/backport-5.15/750-v6.5-11-net-ethernet-mtk_eth_soc-add-basic-support-for-MT798.patch index 028c28b1f74c52..cc08ef133882b5 100644 --- a/target/linux/generic/backport-5.15/750-v6.5-11-net-ethernet-mtk_eth_soc-add-basic-support-for-MT798.patch +++ b/target/linux/generic/backport-5.15/750-v6.5-11-net-ethernet-mtk_eth_soc-add-basic-support-for-MT798.patch @@ -263,7 +263,7 @@ Signed-off-by: Jakub Kicinski data |= TX_DMA_SWC_V2 | QID_BITS_V2(info->qid); WRITE_ONCE(desc->txd4, data); -@@ -4304,6 +4433,17 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4307,6 +4436,17 @@ static int mtk_add_mac(struct mtk_eth *e mac->phylink_config.supported_interfaces); } @@ -281,7 +281,7 @@ Signed-off-by: Jakub Kicinski phylink = phylink_create(&mac->phylink_config, of_fwnode_handle(mac->of_node), phy_mode, &mtk_phylink_ops); -@@ -4826,6 +4966,24 @@ static const struct mtk_soc_data mt7986_ +@@ -4829,6 +4969,24 @@ static const struct mtk_soc_data mt7986_ }, }; @@ -306,7 +306,7 @@ Signed-off-by: Jakub Kicinski static const struct mtk_soc_data rt5350_data = { .reg_map = &mt7628_reg_map, .caps = MT7628_CAPS, -@@ -4844,14 +5002,15 @@ static const struct mtk_soc_data rt5350_ +@@ -4847,14 +5005,15 @@ static const struct mtk_soc_data rt5350_ }; const struct of_device_id of_mtk_match[] = { diff --git a/target/linux/generic/backport-5.15/750-v6.5-13-net-ethernet-mtk_eth_soc-enable-nft-hw-flowtable_off.patch b/target/linux/generic/backport-5.15/750-v6.5-13-net-ethernet-mtk_eth_soc-enable-nft-hw-flowtable_off.patch index b32670d7a49604..ebfb1f0c35c45e 100644 --- a/target/linux/generic/backport-5.15/750-v6.5-13-net-ethernet-mtk_eth_soc-enable-nft-hw-flowtable_off.patch +++ b/target/linux/generic/backport-5.15/750-v6.5-13-net-ethernet-mtk_eth_soc-enable-nft-hw-flowtable_off.patch @@ -18,7 +18,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -4974,6 +4974,9 @@ static const struct mtk_soc_data mt7988_ +@@ -4977,6 +4977,9 @@ static const struct mtk_soc_data mt7988_ .required_clks = MT7988_CLKS_BITMAP, .required_pctl = false, .version = 3, diff --git a/target/linux/generic/backport-5.15/750-v6.5-14-net-ethernet-mtk_eth_soc-support-per-flow-accounting.patch b/target/linux/generic/backport-5.15/750-v6.5-14-net-ethernet-mtk_eth_soc-support-per-flow-accounting.patch index f314550af64c31..aab3b848a6c7f8 100644 --- a/target/linux/generic/backport-5.15/750-v6.5-14-net-ethernet-mtk_eth_soc-support-per-flow-accounting.patch +++ b/target/linux/generic/backport-5.15/750-v6.5-14-net-ethernet-mtk_eth_soc-support-per-flow-accounting.patch @@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -4976,6 +4976,7 @@ static const struct mtk_soc_data mt7988_ +@@ -4979,6 +4979,7 @@ static const struct mtk_soc_data mt7988_ .version = 3, .offload_version = 2, .hash_offset = 4, diff --git a/target/linux/generic/backport-5.15/750-v6.5-17-net-ethernet-mtk_eth_soc-add-reset-bits-for-MT7988.patch b/target/linux/generic/backport-5.15/750-v6.5-17-net-ethernet-mtk_eth_soc-add-reset-bits-for-MT7988.patch index 5f6651b7b02cf0..2d750abb45ab85 100644 --- a/target/linux/generic/backport-5.15/750-v6.5-17-net-ethernet-mtk_eth_soc-add-reset-bits-for-MT7988.patch +++ b/target/linux/generic/backport-5.15/750-v6.5-17-net-ethernet-mtk_eth_soc-add-reset-bits-for-MT7988.patch @@ -16,7 +16,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3538,19 +3538,34 @@ static void mtk_hw_reset(struct mtk_eth +@@ -3541,19 +3541,34 @@ static void mtk_hw_reset(struct mtk_eth { u32 val; @@ -56,7 +56,7 @@ Signed-off-by: Jakub Kicinski regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN, 0x3ffffff); } -@@ -3576,13 +3591,21 @@ static void mtk_hw_warm_reset(struct mtk +@@ -3579,13 +3594,21 @@ static void mtk_hw_warm_reset(struct mtk return; } @@ -83,7 +83,7 @@ Signed-off-by: Jakub Kicinski regmap_update_bits(eth->ethsys, ETHSYS_RSTCTRL, rst_mask, rst_mask); -@@ -3934,11 +3957,17 @@ static void mtk_prepare_for_reset(struct +@@ -3937,11 +3960,17 @@ static void mtk_prepare_for_reset(struct u32 val; int i; @@ -106,7 +106,7 @@ Signed-off-by: Jakub Kicinski /* adjust PPE configurations to prepare for reset */ for (i = 0; i < ARRAY_SIZE(eth->ppe); i++) -@@ -3999,11 +4028,18 @@ static void mtk_pending_work(struct work +@@ -4002,11 +4031,18 @@ static void mtk_pending_work(struct work } } diff --git a/target/linux/generic/backport-5.15/750-v6.5-18-net-ethernet-mtk_eth_soc-add-support-for-in-SoC-SRAM.patch b/target/linux/generic/backport-5.15/750-v6.5-18-net-ethernet-mtk_eth_soc-add-support-for-in-SoC-SRAM.patch index 67ba1a5f0a57cb..52bd017300836b 100644 --- a/target/linux/generic/backport-5.15/750-v6.5-18-net-ethernet-mtk_eth_soc-add-support-for-in-SoC-SRAM.patch +++ b/target/linux/generic/backport-5.15/750-v6.5-18-net-ethernet-mtk_eth_soc-add-support-for-in-SoC-SRAM.patch @@ -123,7 +123,7 @@ Signed-off-by: Jakub Kicinski dma_free_coherent(eth->dma_dev, ring->dma_size * eth->soc->txrx.rxd_size, ring->dma, ring->phys); -@@ -3001,7 +3025,7 @@ static void mtk_dma_free(struct mtk_eth +@@ -3004,7 +3028,7 @@ static void mtk_dma_free(struct mtk_eth for (i = 0; i < MTK_MAX_DEVS; i++) if (eth->netdev[i]) netdev_reset_queue(eth->netdev[i]); @@ -132,7 +132,7 @@ Signed-off-by: Jakub Kicinski dma_free_coherent(eth->dma_dev, MTK_QDMA_RING_SIZE * soc->txrx.txd_size, eth->scratch_ring, eth->phy_scratch_ring); -@@ -3009,13 +3033,13 @@ static void mtk_dma_free(struct mtk_eth +@@ -3012,13 +3036,13 @@ static void mtk_dma_free(struct mtk_eth eth->phy_scratch_ring = 0; } mtk_tx_clean(eth); @@ -149,7 +149,7 @@ Signed-off-by: Jakub Kicinski } kfree(eth->scratch_head); -@@ -4585,7 +4609,7 @@ static int mtk_sgmii_init(struct mtk_eth +@@ -4588,7 +4612,7 @@ static int mtk_sgmii_init(struct mtk_eth static int mtk_probe(struct platform_device *pdev) { @@ -158,7 +158,7 @@ Signed-off-by: Jakub Kicinski struct device_node *mac_np; struct mtk_eth *eth; int err, i; -@@ -4605,6 +4629,20 @@ static int mtk_probe(struct platform_dev +@@ -4608,6 +4632,20 @@ static int mtk_probe(struct platform_dev if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) eth->ip_align = NET_IP_ALIGN; @@ -179,7 +179,7 @@ Signed-off-by: Jakub Kicinski spin_lock_init(ð->page_lock); spin_lock_init(ð->tx_irq_lock); spin_lock_init(ð->rx_irq_lock); -@@ -4668,6 +4706,18 @@ static int mtk_probe(struct platform_dev +@@ -4671,6 +4709,18 @@ static int mtk_probe(struct platform_dev err = -EINVAL; goto err_destroy_sgmii; } diff --git a/target/linux/generic/backport-5.15/750-v6.5-19-net-ethernet-mtk_eth_soc-support-36-bit-DMA-addressi.patch b/target/linux/generic/backport-5.15/750-v6.5-19-net-ethernet-mtk_eth_soc-support-36-bit-DMA-addressi.patch index 175db56c37bf8c..26c5889545459b 100644 --- a/target/linux/generic/backport-5.15/750-v6.5-19-net-ethernet-mtk_eth_soc-support-36-bit-DMA-addressi.patch +++ b/target/linux/generic/backport-5.15/750-v6.5-19-net-ethernet-mtk_eth_soc-support-36-bit-DMA-addressi.patch @@ -90,7 +90,7 @@ Signed-off-by: Jakub Kicinski ring->buf_size, DMA_FROM_DEVICE); mtk_rx_put_buff(ring, ring->data[i], false); } -@@ -4643,6 +4661,14 @@ static int mtk_probe(struct platform_dev +@@ -4646,6 +4664,14 @@ static int mtk_probe(struct platform_dev } } diff --git a/target/linux/generic/backport-5.15/893-v6.5-01-net-dsa-mv88e6xxx-pass-directly-chip-structure-to-mv.patch b/target/linux/generic/backport-5.15/893-v6.5-01-net-dsa-mv88e6xxx-pass-directly-chip-structure-to-mv.patch new file mode 100644 index 00000000000000..177a8ce43e2763 --- /dev/null +++ b/target/linux/generic/backport-5.15/893-v6.5-01-net-dsa-mv88e6xxx-pass-directly-chip-structure-to-mv.patch @@ -0,0 +1,46 @@ +From 19f291d8a65cd19e7595006c7872cd95aa6f9e93 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alexis=20Lothor=C3=A9?= +Date: Fri, 4 Aug 2023 19:13:10 +0200 +Subject: [PATCH 893/898] net: dsa: mv88e6xxx: pass directly chip structure to + mv88e6xxx_phy_is_internal +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Since this function is a simple helper, we do not need to pass a full +dsa_switch structure, we can directly pass the mv88e6xxx_chip structure. +Doing so will allow to share this function with any other function +not manipulating dsa_switch structure but needing info about number of +internal phys + +Signed-off-by: Alexis Lothoré +Reviewed-by: Russell King (Oracle) +Reviewed-by: Florian Fainelli +Signed-off-by: Jakub Kicinski +--- + drivers/net/dsa/mv88e6xxx/chip.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +--- a/drivers/net/dsa/mv88e6xxx/chip.c ++++ b/drivers/net/dsa/mv88e6xxx/chip.c +@@ -459,10 +459,8 @@ restore_link: + return err; + } + +-static int mv88e6xxx_phy_is_internal(struct dsa_switch *ds, int port) ++static int mv88e6xxx_phy_is_internal(struct mv88e6xxx_chip *chip, int port) + { +- struct mv88e6xxx_chip *chip = ds->priv; +- + return port < chip->info->num_internal_phys; + } + +@@ -704,7 +702,7 @@ static void mv88e6xxx_mac_config(struct + + mv88e6xxx_reg_lock(chip); + +- if (mode != MLO_AN_PHY || !mv88e6xxx_phy_is_internal(ds, port)) { ++ if (mode != MLO_AN_PHY || !mv88e6xxx_phy_is_internal(chip, port)) { + /* In inband mode, the link may come up at any time while the + * link is not forced down. Force the link down while we + * reconfigure the interface mode. diff --git a/target/linux/generic/backport-5.15/893-v6.5-02-net-dsa-mv88e6xxx-use-mv88e6xxx_phy_is_internal-in-m.patch b/target/linux/generic/backport-5.15/893-v6.5-02-net-dsa-mv88e6xxx-use-mv88e6xxx_phy_is_internal-in-m.patch new file mode 100644 index 00000000000000..02cafa3765332e --- /dev/null +++ b/target/linux/generic/backport-5.15/893-v6.5-02-net-dsa-mv88e6xxx-use-mv88e6xxx_phy_is_internal-in-m.patch @@ -0,0 +1,31 @@ +From 03a50b4f81d9e8bcf86165d6b2ac9376d02e5df9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alexis=20Lothor=C3=A9?= +Date: Mon, 29 May 2023 10:02:42 +0200 +Subject: [PATCH 894/898] net: dsa: mv88e6xxx: use mv88e6xxx_phy_is_internal in + mv88e6xxx_port_ppu_updates +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Make sure to use existing helper to get internal PHYs count instead of +redoing it manually + +Signed-off-by: Alexis Lothoré +Reviewed-by: Russell King (Oracle) +Reviewed-by: Florian Fainelli +Signed-off-by: Jakub Kicinski +--- + drivers/net/dsa/mv88e6xxx/chip.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/dsa/mv88e6xxx/chip.c ++++ b/drivers/net/dsa/mv88e6xxx/chip.c +@@ -473,7 +473,7 @@ static int mv88e6xxx_port_ppu_updates(st + * report whether the port is internal. + */ + if (chip->info->family == MV88E6XXX_FAMILY_6250) +- return port < chip->info->num_internal_phys; ++ return mv88e6xxx_phy_is_internal(chip, port); + + err = mv88e6xxx_port_read(chip, port, MV88E6XXX_PORT_STS, ®); + if (err) { diff --git a/target/linux/generic/backport-5.15/893-v6.5-03-net-dsa-mv88e6xxx-add-field-to-specify-internal-phys.patch b/target/linux/generic/backport-5.15/893-v6.5-03-net-dsa-mv88e6xxx-add-field-to-specify-internal-phys.patch new file mode 100644 index 00000000000000..239620b686ab2d --- /dev/null +++ b/target/linux/generic/backport-5.15/893-v6.5-03-net-dsa-mv88e6xxx-add-field-to-specify-internal-phys.patch @@ -0,0 +1,69 @@ +From 07120894b24cc3cf2318925baeaaf0893e3312e4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alexis=20Lothor=C3=A9?= +Date: Mon, 29 May 2023 10:02:43 +0200 +Subject: [PATCH 895/898] net: dsa: mv88e6xxx: add field to specify internal + phys layout +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +mv88e6xxx currently assumes that switch equipped with internal phys have +those phys mapped contiguously starting from port 0 (see +mv88e6xxx_phy_is_internal). However, some switches have internal PHYs but +NOT starting from port 0. For example 88e6393X, 88E6193X and 88E6191X have +integrated PHYs available on ports 1 to 8 +To properly support this offset, add a new field to allow specifying an +internal PHYs layout. If field is not set, default layout is assumed (start +at port 0) + +Signed-off-by: Alexis Lothoré +Reviewed-by: Andrew Lunn +Signed-off-by: Jakub Kicinski +--- + drivers/net/dsa/mv88e6xxx/chip.c | 4 +++- + drivers/net/dsa/mv88e6xxx/chip.h | 5 +++++ + drivers/net/dsa/mv88e6xxx/global2.c | 5 ++++- + 3 files changed, 12 insertions(+), 2 deletions(-) + +--- a/drivers/net/dsa/mv88e6xxx/chip.c ++++ b/drivers/net/dsa/mv88e6xxx/chip.c +@@ -461,7 +461,9 @@ restore_link: + + static int mv88e6xxx_phy_is_internal(struct mv88e6xxx_chip *chip, int port) + { +- return port < chip->info->num_internal_phys; ++ return port >= chip->info->internal_phys_offset && ++ port < chip->info->num_internal_phys + ++ chip->info->internal_phys_offset; + } + + static int mv88e6xxx_port_ppu_updates(struct mv88e6xxx_chip *chip, int port) +--- a/drivers/net/dsa/mv88e6xxx/chip.h ++++ b/drivers/net/dsa/mv88e6xxx/chip.h +@@ -165,6 +165,11 @@ struct mv88e6xxx_info { + + /* Supports PTP */ + bool ptp_support; ++ ++ /* Internal PHY start index. 0 means that internal PHYs range starts at ++ * port 0, 1 means internal PHYs range starts at port 1, etc ++ */ ++ unsigned int internal_phys_offset; + }; + + struct mv88e6xxx_atu_entry { +--- a/drivers/net/dsa/mv88e6xxx/global2.c ++++ b/drivers/net/dsa/mv88e6xxx/global2.c +@@ -1185,8 +1185,11 @@ int mv88e6xxx_g2_irq_mdio_setup(struct m + struct mii_bus *bus) + { + int phy, irq, err, err_phy; ++ int phy_start = chip->info->internal_phys_offset; ++ int phy_end = chip->info->internal_phys_offset + ++ chip->info->num_internal_phys; + +- for (phy = 0; phy < chip->info->num_internal_phys; phy++) { ++ for (phy = phy_start; phy < phy_end; phy++) { + irq = irq_find_mapping(chip->g2_irq.domain, phy); + if (irq < 0) { + err = irq; diff --git a/target/linux/generic/backport-5.15/893-v6.5-04-net-dsa-mv88e6xxx-fix-88E6393X-family-internal-phys-.patch b/target/linux/generic/backport-5.15/893-v6.5-04-net-dsa-mv88e6xxx-fix-88E6393X-family-internal-phys-.patch new file mode 100644 index 00000000000000..01bc65609c5ac6 --- /dev/null +++ b/target/linux/generic/backport-5.15/893-v6.5-04-net-dsa-mv88e6xxx-fix-88E6393X-family-internal-phys-.patch @@ -0,0 +1,52 @@ +From 492b06747f544c19b5ffe531a24b67858764c50e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alexis=20Lothor=C3=A9?= +Date: Mon, 29 May 2023 10:02:44 +0200 +Subject: [PATCH 896/898] net: dsa: mv88e6xxx: fix 88E6393X family internal + phys layout +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +88E6393X/88E6193X/88E6191X switches have in fact 8 internal PHYs, but those +are not present starting at port 0: supported ports go from 1 to 8 + +Signed-off-by: Alexis Lothoré +Reviewed-by: Andrew Lunn +Reviewed-by: Florian Fainelli +Signed-off-by: Jakub Kicinski +--- + drivers/net/dsa/mv88e6xxx/chip.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +--- a/drivers/net/dsa/mv88e6xxx/chip.c ++++ b/drivers/net/dsa/mv88e6xxx/chip.c +@@ -5370,7 +5370,8 @@ static const struct mv88e6xxx_info mv88e + .name = "Marvell 88E6191X", + .num_databases = 4096, + .num_ports = 11, /* 10 + Z80 */ +- .num_internal_phys = 9, ++ .num_internal_phys = 8, ++ .internal_phys_offset = 1, + .max_vid = 8191, + .port_base_addr = 0x0, + .phy_base_addr = 0x0, +@@ -5392,7 +5393,8 @@ static const struct mv88e6xxx_info mv88e + .name = "Marvell 88E6193X", + .num_databases = 4096, + .num_ports = 11, /* 10 + Z80 */ +- .num_internal_phys = 9, ++ .num_internal_phys = 8, ++ .internal_phys_offset = 1, + .max_vid = 8191, + .port_base_addr = 0x0, + .phy_base_addr = 0x0, +@@ -5702,7 +5704,8 @@ static const struct mv88e6xxx_info mv88e + .name = "Marvell 88E6393X", + .num_databases = 4096, + .num_ports = 11, /* 10 + Z80 */ +- .num_internal_phys = 9, ++ .num_internal_phys = 8, ++ .internal_phys_offset = 1, + .max_vid = 8191, + .port_base_addr = 0x0, + .phy_base_addr = 0x0, diff --git a/target/linux/generic/backport-5.15/893-v6.5-05-net-dsa-mv88e6xxx-pass-mv88e6xxx_chip-structure-to-p.patch b/target/linux/generic/backport-5.15/893-v6.5-05-net-dsa-mv88e6xxx-pass-mv88e6xxx_chip-structure-to-p.patch new file mode 100644 index 00000000000000..f4de58ac32b18a --- /dev/null +++ b/target/linux/generic/backport-5.15/893-v6.5-05-net-dsa-mv88e6xxx-pass-mv88e6xxx_chip-structure-to-p.patch @@ -0,0 +1,113 @@ +From 68690045f8e220826517c0d6f9388ffc1faa57ea Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alexis=20Lothor=C3=A9?= +Date: Mon, 29 May 2023 10:02:45 +0200 +Subject: [PATCH 897/898] net: dsa: mv88e6xxx: pass mv88e6xxx_chip structure to + port_max_speed_mode +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Some switches families have minor differences on supported link speed for +ports. Instead of redefining a new port_max_speed_mode for each different +configuration, allow to pass mv88e6xxx_chip structure to allow +differentiating those chips by known chip id + +Signed-off-by: Alexis Lothoré +Reviewed-by: Florian Fainelli +Signed-off-by: Jakub Kicinski +Update one more instance of port_max_speed_mode that 5.15 has. +[Robert Marko] +Signed-off-by: Robert Marko +--- + drivers/net/dsa/mv88e6xxx/chip.c | 2 +- + drivers/net/dsa/mv88e6xxx/chip.h | 3 ++- + drivers/net/dsa/mv88e6xxx/port.c | 12 ++++++++---- + drivers/net/dsa/mv88e6xxx/port.h | 12 ++++++++---- + 4 files changed, 19 insertions(+), 10 deletions(-) + +--- a/drivers/net/dsa/mv88e6xxx/chip.c ++++ b/drivers/net/dsa/mv88e6xxx/chip.c +@@ -443,7 +443,7 @@ static int mv88e6xxx_port_setup_mac(stru + } + + if (speed == SPEED_MAX && chip->info->ops->port_max_speed_mode) +- mode = chip->info->ops->port_max_speed_mode(port); ++ mode = chip->info->ops->port_max_speed_mode(chip, port); + + if (chip->info->ops->port_set_pause) { + err = chip->info->ops->port_set_pause(chip, port, pause); +--- a/drivers/net/dsa/mv88e6xxx/chip.h ++++ b/drivers/net/dsa/mv88e6xxx/chip.h +@@ -485,7 +485,8 @@ struct mv88e6xxx_ops { + int speed, int duplex); + + /* What interface mode should be used for maximum speed? */ +- phy_interface_t (*port_max_speed_mode)(int port); ++ phy_interface_t (*port_max_speed_mode)(struct mv88e6xxx_chip *chip, ++ int port); + + int (*port_tag_remap)(struct mv88e6xxx_chip *chip, int port); + +--- a/drivers/net/dsa/mv88e6xxx/port.c ++++ b/drivers/net/dsa/mv88e6xxx/port.c +@@ -357,7 +357,8 @@ int mv88e6341_port_set_speed_duplex(stru + duplex); + } + +-phy_interface_t mv88e6341_port_max_speed_mode(int port) ++phy_interface_t mv88e6341_port_max_speed_mode(struct mv88e6xxx_chip *chip, ++ int port) + { + if (port == 5) + return PHY_INTERFACE_MODE_2500BASEX; +@@ -402,7 +403,8 @@ int mv88e6390_port_set_speed_duplex(stru + duplex); + } + +-phy_interface_t mv88e6390_port_max_speed_mode(int port) ++phy_interface_t mv88e6390_port_max_speed_mode(struct mv88e6xxx_chip *chip, ++ int port) + { + if (port == 9 || port == 10) + return PHY_INTERFACE_MODE_2500BASEX; +@@ -427,7 +429,8 @@ int mv88e6390x_port_set_speed_duplex(str + duplex); + } + +-phy_interface_t mv88e6390x_port_max_speed_mode(int port) ++phy_interface_t mv88e6390x_port_max_speed_mode(struct mv88e6xxx_chip *chip, ++ int port) + { + if (port == 9 || port == 10) + return PHY_INTERFACE_MODE_XAUI; +@@ -527,7 +530,8 @@ int mv88e6393x_port_set_speed_duplex(str + return 0; + } + +-phy_interface_t mv88e6393x_port_max_speed_mode(int port) ++phy_interface_t mv88e6393x_port_max_speed_mode(struct mv88e6xxx_chip *chip, ++ int port) + { + if (port == 0 || port == 9 || port == 10) + return PHY_INTERFACE_MODE_10GBASER; +--- a/drivers/net/dsa/mv88e6xxx/port.h ++++ b/drivers/net/dsa/mv88e6xxx/port.h +@@ -350,10 +350,14 @@ int mv88e6390x_port_set_speed_duplex(str + int mv88e6393x_port_set_speed_duplex(struct mv88e6xxx_chip *chip, int port, + int speed, int duplex); + +-phy_interface_t mv88e6341_port_max_speed_mode(int port); +-phy_interface_t mv88e6390_port_max_speed_mode(int port); +-phy_interface_t mv88e6390x_port_max_speed_mode(int port); +-phy_interface_t mv88e6393x_port_max_speed_mode(int port); ++phy_interface_t mv88e6341_port_max_speed_mode(struct mv88e6xxx_chip *chip, ++ int port); ++phy_interface_t mv88e6390_port_max_speed_mode(struct mv88e6xxx_chip *chip, ++ int port); ++phy_interface_t mv88e6390x_port_max_speed_mode(struct mv88e6xxx_chip *chip, ++ int port); ++phy_interface_t mv88e6393x_port_max_speed_mode(struct mv88e6xxx_chip *chip, ++ int port); + + int mv88e6xxx_port_set_state(struct mv88e6xxx_chip *chip, int port, u8 state); + diff --git a/target/linux/generic/backport-5.15/893-v6.5-06-net-dsa-mv88e6xxx-enable-support-for-88E6361-switch.patch b/target/linux/generic/backport-5.15/893-v6.5-06-net-dsa-mv88e6xxx-enable-support-for-88E6361-switch.patch new file mode 100644 index 00000000000000..c8254e5e4270c8 --- /dev/null +++ b/target/linux/generic/backport-5.15/893-v6.5-06-net-dsa-mv88e6xxx-enable-support-for-88E6361-switch.patch @@ -0,0 +1,165 @@ +From f318a015330a11befd8c69336efc6284e240f535 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alexis=20Lothor=C3=A9?= +Date: Mon, 29 May 2023 10:02:46 +0200 +Subject: [PATCH 898/898] net: dsa: mv88e6xxx: enable support for 88E6361 + switch +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Marvell 88E6361 is an 8-port switch derived from the +88E6393X/88E9193X/88E6191X switches family. It can benefit from the +existing mv88e6xxx driver by simply adding the proper switch description in +the driver. Main differences with other switches from this +family are: +- 8 ports exposed (instead of 11): ports 1, 2 and 8 not available +- No 5GBase-x nor SFI/USXGMII support + +Signed-off-by: Alexis Lothoré +Reviewed-by: Andrew Lunn +Signed-off-by: Jakub Kicinski +Adapt to 5.15 since we dont have phylink_get_caps yet. +So, update the old mv88e6393x_phylink_validate instead. +Remove max_sid since 5.15 driver does not support it yet. +[Robert Marko] +Signed-off-by: Robert Marko +--- + drivers/net/dsa/mv88e6xxx/chip.c | 49 +++++++++++++++++++++++++++++++- + drivers/net/dsa/mv88e6xxx/chip.h | 3 +- + drivers/net/dsa/mv88e6xxx/port.c | 14 +++++++-- + drivers/net/dsa/mv88e6xxx/port.h | 1 + + 4 files changed, 62 insertions(+), 5 deletions(-) + +--- a/drivers/net/dsa/mv88e6xxx/chip.c ++++ b/drivers/net/dsa/mv88e6xxx/chip.c +@@ -648,6 +648,8 @@ static void mv88e6393x_phylink_validate( + { + bool is_6191x = + chip->info->prod_num == MV88E6XXX_PORT_SWITCH_ID_PROD_6191X; ++ bool is_6361 = ++ chip->info->prod_num == MV88E6XXX_PORT_SWITCH_ID_PROD_6361; + + if (((port == 0 || port == 9) && !is_6191x) || port == 10) { + phylink_set(mask, 10000baseT_Full); +@@ -662,8 +664,28 @@ static void mv88e6393x_phylink_validate( + phylink_set(mask, 2500baseT_Full); + } + ++ if (port == 0 || port == 9 || port == 10) { ++ phylink_set(mask, 1000baseX_Full); ++ ++ /* 6191X supports >1G modes only on port 10 */ ++ if (!is_6191x || port == 10) { ++ phylink_set(mask, 2500baseX_Full); ++ phylink_set(mask, 2500baseT_Full); ++ ++ if (!is_6361) { ++ phylink_set(mask, 10000baseT_Full); ++ phylink_set(mask, 10000baseKR_Full); ++ phylink_set(mask, 10000baseCR_Full); ++ phylink_set(mask, 10000baseSR_Full); ++ phylink_set(mask, 10000baseLR_Full); ++ phylink_set(mask, 10000baseLRM_Full); ++ phylink_set(mask, 10000baseER_Full); ++ phylink_set(mask, 5000baseT_Full); ++ } ++ } ++ } ++ + phylink_set(mask, 1000baseT_Full); +- phylink_set(mask, 1000baseX_Full); + + mv88e6065_phylink_validate(chip, port, mask, state); + } +@@ -5649,6 +5671,31 @@ static const struct mv88e6xxx_info mv88e + .ptp_support = true, + .ops = &mv88e6352_ops, + }, ++ [MV88E6361] = { ++ .prod_num = MV88E6XXX_PORT_SWITCH_ID_PROD_6361, ++ .family = MV88E6XXX_FAMILY_6393, ++ .name = "Marvell 88E6361", ++ .num_databases = 4096, ++ .num_macs = 16384, ++ .num_ports = 11, ++ /* Ports 1, 2 and 8 are not routed */ ++ .invalid_port_mask = BIT(1) | BIT(2) | BIT(8), ++ .num_internal_phys = 5, ++ .internal_phys_offset = 3, ++ .max_vid = 4095, ++ .port_base_addr = 0x0, ++ .phy_base_addr = 0x0, ++ .global1_addr = 0x1b, ++ .global2_addr = 0x1c, ++ .age_time_coeff = 3750, ++ .g1_irqs = 10, ++ .g2_irqs = 14, ++ .atu_move_port_mask = 0x1f, ++ .pvt = true, ++ .multi_chip = true, ++ .ptp_support = true, ++ .ops = &mv88e6393x_ops, ++ }, + [MV88E6390] = { + .prod_num = MV88E6XXX_PORT_SWITCH_ID_PROD_6390, + .family = MV88E6XXX_FAMILY_6390, +--- a/drivers/net/dsa/mv88e6xxx/chip.h ++++ b/drivers/net/dsa/mv88e6xxx/chip.h +@@ -81,6 +81,7 @@ enum mv88e6xxx_model { + MV88E6350, + MV88E6351, + MV88E6352, ++ MV88E6361, + MV88E6390, + MV88E6390X, + MV88E6393X, +@@ -99,7 +100,7 @@ enum mv88e6xxx_family { + MV88E6XXX_FAMILY_6351, /* 6171 6175 6350 6351 */ + MV88E6XXX_FAMILY_6352, /* 6172 6176 6240 6352 */ + MV88E6XXX_FAMILY_6390, /* 6190 6190X 6191 6290 6390 6390X */ +- MV88E6XXX_FAMILY_6393, /* 6191X 6193X 6393X */ ++ MV88E6XXX_FAMILY_6393, /* 6191X 6193X 6361 6393X */ + }; + + /** +--- a/drivers/net/dsa/mv88e6xxx/port.c ++++ b/drivers/net/dsa/mv88e6xxx/port.c +@@ -451,6 +451,10 @@ int mv88e6393x_port_set_speed_duplex(str + if (speed == SPEED_MAX) + speed = (port > 0 && port < 9) ? 1000 : 10000; + ++ if (chip->info->prod_num == MV88E6XXX_PORT_SWITCH_ID_PROD_6361 && ++ speed > 2500) ++ return -EOPNOTSUPP; ++ + if (speed == 200 && port != 0) + return -EOPNOTSUPP; + +@@ -533,10 +537,14 @@ int mv88e6393x_port_set_speed_duplex(str + phy_interface_t mv88e6393x_port_max_speed_mode(struct mv88e6xxx_chip *chip, + int port) + { +- if (port == 0 || port == 9 || port == 10) +- return PHY_INTERFACE_MODE_10GBASER; + +- return PHY_INTERFACE_MODE_NA; ++ if (port != 0 && port != 9 && port != 10) ++ return PHY_INTERFACE_MODE_NA; ++ ++ if (chip->info->prod_num == MV88E6XXX_PORT_SWITCH_ID_PROD_6361) ++ return PHY_INTERFACE_MODE_2500BASEX; ++ ++ return PHY_INTERFACE_MODE_10GBASER; + } + + static int mv88e6xxx_port_set_cmode(struct mv88e6xxx_chip *chip, int port, +--- a/drivers/net/dsa/mv88e6xxx/port.h ++++ b/drivers/net/dsa/mv88e6xxx/port.h +@@ -128,6 +128,7 @@ + #define MV88E6XXX_PORT_SWITCH_ID_PROD_6220 0x2200 + #define MV88E6XXX_PORT_SWITCH_ID_PROD_6240 0x2400 + #define MV88E6XXX_PORT_SWITCH_ID_PROD_6250 0x2500 ++#define MV88E6XXX_PORT_SWITCH_ID_PROD_6361 0x2610 + #define MV88E6XXX_PORT_SWITCH_ID_PROD_6290 0x2900 + #define MV88E6XXX_PORT_SWITCH_ID_PROD_6321 0x3100 + #define MV88E6XXX_PORT_SWITCH_ID_PROD_6141 0x3400 diff --git a/target/linux/generic/backport-6.1/020-v6.3-01-UPSTREAM-mm-multi-gen-LRU-rename-lru_gen_struct-to-l.patch b/target/linux/generic/backport-6.1/020-v6.3-01-UPSTREAM-mm-multi-gen-LRU-rename-lru_gen_struct-to-l.patch index 9d21f8de22fd68..fe32acc9851223 100644 --- a/target/linux/generic/backport-6.1/020-v6.3-01-UPSTREAM-mm-multi-gen-LRU-rename-lru_gen_struct-to-l.patch +++ b/target/linux/generic/backport-6.1/020-v6.3-01-UPSTREAM-mm-multi-gen-LRU-rename-lru_gen_struct-to-l.patch @@ -256,9 +256,9 @@ Signed-off-by: T.J. Mercier - struct lru_gen_struct *lrugen = &lruvec->lrugen; + struct lru_gen_folio *lrugen = &lruvec->lrugen; + restart: spin_lock_irq(&lruvec->lru_lock); - -@@ -4387,7 +4387,7 @@ static bool try_to_inc_max_seq(struct lr +@@ -4389,7 +4389,7 @@ static bool try_to_inc_max_seq(struct lr bool success; struct lru_gen_mm_walk *walk; struct mm_struct *mm = NULL; @@ -267,7 +267,7 @@ Signed-off-by: T.J. Mercier VM_WARN_ON_ONCE(max_seq > READ_ONCE(lrugen->max_seq)); -@@ -4452,7 +4452,7 @@ static bool should_run_aging(struct lruv +@@ -4454,7 +4454,7 @@ static bool should_run_aging(struct lruv unsigned long old = 0; unsigned long young = 0; unsigned long total = 0; @@ -276,7 +276,7 @@ Signed-off-by: T.J. Mercier struct mem_cgroup *memcg = lruvec_memcg(lruvec); for (type = !can_swap; type < ANON_AND_FILE; type++) { -@@ -4737,7 +4737,7 @@ static bool sort_folio(struct lruvec *lr +@@ -4740,7 +4740,7 @@ static bool sort_folio(struct lruvec *lr int delta = folio_nr_pages(folio); int refs = folio_lru_refs(folio); int tier = lru_tier_from_refs(refs); @@ -285,7 +285,7 @@ Signed-off-by: T.J. Mercier VM_WARN_ON_ONCE_FOLIO(gen >= MAX_NR_GENS, folio); -@@ -4837,7 +4837,7 @@ static int scan_folios(struct lruvec *lr +@@ -4848,7 +4848,7 @@ static int scan_folios(struct lruvec *lr int scanned = 0; int isolated = 0; int remaining = MAX_LRU_BATCH; @@ -294,7 +294,7 @@ Signed-off-by: T.J. Mercier struct mem_cgroup *memcg = lruvec_memcg(lruvec); VM_WARN_ON_ONCE(!list_empty(list)); -@@ -5237,7 +5237,7 @@ done: +@@ -5249,7 +5249,7 @@ done: static bool __maybe_unused state_is_valid(struct lruvec *lruvec) { @@ -303,7 +303,7 @@ Signed-off-by: T.J. Mercier if (lrugen->enabled) { enum lru_list lru; -@@ -5519,7 +5519,7 @@ static void lru_gen_seq_show_full(struct +@@ -5531,7 +5531,7 @@ static void lru_gen_seq_show_full(struct int i; int type, tier; int hist = lru_hist_from_seq(seq); @@ -312,7 +312,7 @@ Signed-off-by: T.J. Mercier for (tier = 0; tier < MAX_NR_TIERS; tier++) { seq_printf(m, " %10d", tier); -@@ -5569,7 +5569,7 @@ static int lru_gen_seq_show(struct seq_f +@@ -5581,7 +5581,7 @@ static int lru_gen_seq_show(struct seq_f unsigned long seq; bool full = !debugfs_real_fops(m->file)->write; struct lruvec *lruvec = v; @@ -321,7 +321,7 @@ Signed-off-by: T.J. Mercier int nid = lruvec_pgdat(lruvec)->node_id; struct mem_cgroup *memcg = lruvec_memcg(lruvec); DEFINE_MAX_SEQ(lruvec); -@@ -5823,7 +5823,7 @@ void lru_gen_init_lruvec(struct lruvec * +@@ -5835,7 +5835,7 @@ void lru_gen_init_lruvec(struct lruvec * { int i; int gen, type, zone; diff --git a/target/linux/generic/backport-6.1/020-v6.3-02-UPSTREAM-mm-multi-gen-LRU-rename-lrugen-lists-to-lru.patch b/target/linux/generic/backport-6.1/020-v6.3-02-UPSTREAM-mm-multi-gen-LRU-rename-lrugen-lists-to-lru.patch deleted file mode 100644 index 97ea33c528b879..00000000000000 --- a/target/linux/generic/backport-6.1/020-v6.3-02-UPSTREAM-mm-multi-gen-LRU-rename-lrugen-lists-to-lru.patch +++ /dev/null @@ -1,197 +0,0 @@ -From 656287d55d9cfc72a4bcd4d9bd098570f12ce409 Mon Sep 17 00:00:00 2001 -From: Yu Zhao -Date: Wed, 21 Dec 2022 21:19:00 -0700 -Subject: [PATCH 02/19] UPSTREAM: mm: multi-gen LRU: rename lrugen->lists[] to - lrugen->folios[] - -lru_gen_folio will be chained into per-node lists by the coming -lrugen->list. - -Link: https://lkml.kernel.org/r/20221222041905.2431096-3-yuzhao@google.com -Signed-off-by: Yu Zhao -Cc: Johannes Weiner -Cc: Jonathan Corbet -Cc: Michael Larabel -Cc: Michal Hocko -Cc: Mike Rapoport -Cc: Roman Gushchin -Cc: Suren Baghdasaryan -Signed-off-by: Andrew Morton -Bug: 274865848 -(cherry picked from commit 6df1b2212950aae2b2188c6645ea18e2a9e3fdd5) -Change-Id: I09f53e0fb2cd6b8b3adbb8a80b15dc5efbeae857 -Signed-off-by: T.J. Mercier ---- - Documentation/mm/multigen_lru.rst | 8 ++++---- - include/linux/mm_inline.h | 4 ++-- - include/linux/mmzone.h | 8 ++++---- - mm/vmscan.c | 20 ++++++++++---------- - 4 files changed, 20 insertions(+), 20 deletions(-) - ---- a/Documentation/mm/multigen_lru.rst -+++ b/Documentation/mm/multigen_lru.rst -@@ -89,15 +89,15 @@ variables are monotonically increasing. - - Generation numbers are truncated into ``order_base_2(MAX_NR_GENS+1)`` - bits in order to fit into the gen counter in ``folio->flags``. Each --truncated generation number is an index to ``lrugen->lists[]``. The -+truncated generation number is an index to ``lrugen->folios[]``. The - sliding window technique is used to track at least ``MIN_NR_GENS`` and - at most ``MAX_NR_GENS`` generations. The gen counter stores a value - within ``[1, MAX_NR_GENS]`` while a page is on one of --``lrugen->lists[]``; otherwise it stores zero. -+``lrugen->folios[]``; otherwise it stores zero. - - Each generation is divided into multiple tiers. A page accessed ``N`` - times through file descriptors is in tier ``order_base_2(N)``. Unlike --generations, tiers do not have dedicated ``lrugen->lists[]``. In -+generations, tiers do not have dedicated ``lrugen->folios[]``. In - contrast to moving across generations, which requires the LRU lock, - moving across tiers only involves atomic operations on - ``folio->flags`` and therefore has a negligible cost. A feedback loop -@@ -127,7 +127,7 @@ page mapped by this PTE to ``(max_seq%MA - Eviction - -------- - The eviction consumes old generations. Given an ``lruvec``, it --increments ``min_seq`` when ``lrugen->lists[]`` indexed by -+increments ``min_seq`` when ``lrugen->folios[]`` indexed by - ``min_seq%MAX_NR_GENS`` becomes empty. To select a type and a tier to - evict from, it first compares ``min_seq[]`` to select the older type. - If both types are equally old, it selects the one whose first tier has ---- a/include/linux/mm_inline.h -+++ b/include/linux/mm_inline.h -@@ -256,9 +256,9 @@ static inline bool lru_gen_add_folio(str - lru_gen_update_size(lruvec, folio, -1, gen); - /* for folio_rotate_reclaimable() */ - if (reclaiming) -- list_add_tail(&folio->lru, &lrugen->lists[gen][type][zone]); -+ list_add_tail(&folio->lru, &lrugen->folios[gen][type][zone]); - else -- list_add(&folio->lru, &lrugen->lists[gen][type][zone]); -+ list_add(&folio->lru, &lrugen->folios[gen][type][zone]); - - return true; - } ---- a/include/linux/mmzone.h -+++ b/include/linux/mmzone.h -@@ -312,7 +312,7 @@ enum lruvec_flags { - * They form a sliding window of a variable size [MIN_NR_GENS, MAX_NR_GENS]. An - * offset within MAX_NR_GENS, i.e., gen, indexes the LRU list of the - * corresponding generation. The gen counter in folio->flags stores gen+1 while -- * a page is on one of lrugen->lists[]. Otherwise it stores 0. -+ * a page is on one of lrugen->folios[]. Otherwise it stores 0. - * - * A page is added to the youngest generation on faulting. The aging needs to - * check the accessed bit at least twice before handing this page over to the -@@ -324,8 +324,8 @@ enum lruvec_flags { - * rest of generations, if they exist, are considered inactive. See - * lru_gen_is_active(). - * -- * PG_active is always cleared while a page is on one of lrugen->lists[] so that -- * the aging needs not to worry about it. And it's set again when a page -+ * PG_active is always cleared while a page is on one of lrugen->folios[] so -+ * that the aging needs not to worry about it. And it's set again when a page - * considered active is isolated for non-reclaiming purposes, e.g., migration. - * See lru_gen_add_folio() and lru_gen_del_folio(). - * -@@ -412,7 +412,7 @@ struct lru_gen_folio { - /* the birth time of each generation in jiffies */ - unsigned long timestamps[MAX_NR_GENS]; - /* the multi-gen LRU lists, lazily sorted on eviction */ -- struct list_head lists[MAX_NR_GENS][ANON_AND_FILE][MAX_NR_ZONES]; -+ struct list_head folios[MAX_NR_GENS][ANON_AND_FILE][MAX_NR_ZONES]; - /* the multi-gen LRU sizes, eventually consistent */ - long nr_pages[MAX_NR_GENS][ANON_AND_FILE][MAX_NR_ZONES]; - /* the exponential moving average of refaulted */ ---- a/mm/vmscan.c -+++ b/mm/vmscan.c -@@ -4258,7 +4258,7 @@ static bool inc_min_seq(struct lruvec *l - - /* prevent cold/hot inversion if force_scan is true */ - for (zone = 0; zone < MAX_NR_ZONES; zone++) { -- struct list_head *head = &lrugen->lists[old_gen][type][zone]; -+ struct list_head *head = &lrugen->folios[old_gen][type][zone]; - - while (!list_empty(head)) { - struct folio *folio = lru_to_folio(head); -@@ -4269,7 +4269,7 @@ static bool inc_min_seq(struct lruvec *l - VM_WARN_ON_ONCE_FOLIO(folio_zonenum(folio) != zone, folio); - - new_gen = folio_inc_gen(lruvec, folio, false); -- list_move_tail(&folio->lru, &lrugen->lists[new_gen][type][zone]); -+ list_move_tail(&folio->lru, &lrugen->folios[new_gen][type][zone]); - - if (!--remaining) - return false; -@@ -4297,7 +4297,7 @@ static bool try_to_inc_min_seq(struct lr - gen = lru_gen_from_seq(min_seq[type]); - - for (zone = 0; zone < MAX_NR_ZONES; zone++) { -- if (!list_empty(&lrugen->lists[gen][type][zone])) -+ if (!list_empty(&lrugen->folios[gen][type][zone])) - goto next; - } - -@@ -4762,7 +4762,7 @@ static bool sort_folio(struct lruvec *lr - - /* promoted */ - if (gen != lru_gen_from_seq(lrugen->min_seq[type])) { -- list_move(&folio->lru, &lrugen->lists[gen][type][zone]); -+ list_move(&folio->lru, &lrugen->folios[gen][type][zone]); - return true; - } - -@@ -4771,7 +4771,7 @@ static bool sort_folio(struct lruvec *lr - int hist = lru_hist_from_seq(lrugen->min_seq[type]); - - gen = folio_inc_gen(lruvec, folio, false); -- list_move_tail(&folio->lru, &lrugen->lists[gen][type][zone]); -+ list_move_tail(&folio->lru, &lrugen->folios[gen][type][zone]); - - WRITE_ONCE(lrugen->protected[hist][type][tier - 1], - lrugen->protected[hist][type][tier - 1] + delta); -@@ -4783,7 +4783,7 @@ static bool sort_folio(struct lruvec *lr - if (folio_test_locked(folio) || folio_test_writeback(folio) || - (type == LRU_GEN_FILE && folio_test_dirty(folio))) { - gen = folio_inc_gen(lruvec, folio, true); -- list_move(&folio->lru, &lrugen->lists[gen][type][zone]); -+ list_move(&folio->lru, &lrugen->folios[gen][type][zone]); - return true; - } - -@@ -4850,7 +4850,7 @@ static int scan_folios(struct lruvec *lr - for (zone = sc->reclaim_idx; zone >= 0; zone--) { - LIST_HEAD(moved); - int skipped = 0; -- struct list_head *head = &lrugen->lists[gen][type][zone]; -+ struct list_head *head = &lrugen->folios[gen][type][zone]; - - while (!list_empty(head)) { - struct folio *folio = lru_to_folio(head); -@@ -5250,7 +5250,7 @@ static bool __maybe_unused state_is_vali - int gen, type, zone; - - for_each_gen_type_zone(gen, type, zone) { -- if (!list_empty(&lrugen->lists[gen][type][zone])) -+ if (!list_empty(&lrugen->folios[gen][type][zone])) - return false; - } - } -@@ -5295,7 +5295,7 @@ static bool drain_evictable(struct lruve - int remaining = MAX_LRU_BATCH; - - for_each_gen_type_zone(gen, type, zone) { -- struct list_head *head = &lruvec->lrugen.lists[gen][type][zone]; -+ struct list_head *head = &lruvec->lrugen.folios[gen][type][zone]; - - while (!list_empty(head)) { - bool success; -@@ -5832,7 +5832,7 @@ void lru_gen_init_lruvec(struct lruvec * - lrugen->timestamps[i] = jiffies; - - for_each_gen_type_zone(gen, type, zone) -- INIT_LIST_HEAD(&lrugen->lists[gen][type][zone]); -+ INIT_LIST_HEAD(&lrugen->folios[gen][type][zone]); - - lruvec->mm_state.seq = MIN_NR_GENS; - init_waitqueue_head(&lruvec->mm_state.wait); diff --git a/target/linux/generic/backport-6.1/020-v6.3-03-UPSTREAM-mm-multi-gen-LRU-remove-eviction-fairness-s.patch b/target/linux/generic/backport-6.1/020-v6.3-03-UPSTREAM-mm-multi-gen-LRU-remove-eviction-fairness-s.patch index a5e4ad557f862c..e5ad78b61d3563 100644 --- a/target/linux/generic/backport-6.1/020-v6.3-03-UPSTREAM-mm-multi-gen-LRU-remove-eviction-fairness-s.patch +++ b/target/linux/generic/backport-6.1/020-v6.3-03-UPSTREAM-mm-multi-gen-LRU-remove-eviction-fairness-s.patch @@ -66,7 +66,7 @@ Signed-off-by: T.J. Mercier static bool writeback_throttling_sane(struct scan_control *sc) { return true; -@@ -4993,8 +5003,7 @@ static int isolate_folios(struct lruvec +@@ -5005,8 +5015,7 @@ static int isolate_folios(struct lruvec return scanned; } @@ -76,7 +76,7 @@ Signed-off-by: T.J. Mercier { int type; int scanned; -@@ -5083,9 +5092,6 @@ retry: +@@ -5095,9 +5104,6 @@ retry: goto retry; } @@ -86,7 +86,7 @@ Signed-off-by: T.J. Mercier return scanned; } -@@ -5124,67 +5130,26 @@ done: +@@ -5136,67 +5142,26 @@ done: return min_seq[!can_swap] + MIN_NR_GENS <= max_seq ? nr_to_scan : 0; } @@ -163,7 +163,7 @@ Signed-off-by: T.J. Mercier lru_add_drain(); -@@ -5208,7 +5173,7 @@ static void lru_gen_shrink_lruvec(struct +@@ -5220,7 +5185,7 @@ static void lru_gen_shrink_lruvec(struct if (!nr_to_scan) goto done; @@ -172,7 +172,7 @@ Signed-off-by: T.J. Mercier if (!delta) goto done; -@@ -5216,7 +5181,7 @@ static void lru_gen_shrink_lruvec(struct +@@ -5228,7 +5193,7 @@ static void lru_gen_shrink_lruvec(struct if (scanned >= nr_to_scan) break; @@ -181,7 +181,7 @@ Signed-off-by: T.J. Mercier break; cond_resched(); -@@ -5666,7 +5631,7 @@ static int run_eviction(struct lruvec *l +@@ -5678,7 +5643,7 @@ static int run_eviction(struct lruvec *l if (sc->nr_reclaimed >= nr_to_reclaim) return 0; diff --git a/target/linux/generic/backport-6.1/020-v6.3-04-BACKPORT-mm-multi-gen-LRU-remove-aging-fairness-safe.patch b/target/linux/generic/backport-6.1/020-v6.3-04-BACKPORT-mm-multi-gen-LRU-remove-aging-fairness-safe.patch index 87ed87a52d08be..cb349abcdb6c6c 100644 --- a/target/linux/generic/backport-6.1/020-v6.3-04-BACKPORT-mm-multi-gen-LRU-remove-aging-fairness-safe.patch +++ b/target/linux/generic/backport-6.1/020-v6.3-04-BACKPORT-mm-multi-gen-LRU-remove-aging-fairness-safe.patch @@ -52,7 +52,7 @@ Signed-off-by: T.J. Mercier unsigned long last_reclaimed; #endif -@@ -4455,7 +4454,7 @@ done: +@@ -4457,7 +4456,7 @@ done: return true; } @@ -61,7 +61,7 @@ Signed-off-by: T.J. Mercier struct scan_control *sc, bool can_swap, unsigned long *nr_to_scan) { int gen, type, zone; -@@ -4464,6 +4463,13 @@ static bool should_run_aging(struct lruv +@@ -4466,6 +4465,13 @@ static bool should_run_aging(struct lruv unsigned long total = 0; struct lru_gen_folio *lrugen = &lruvec->lrugen; struct mem_cgroup *memcg = lruvec_memcg(lruvec); @@ -75,7 +75,7 @@ Signed-off-by: T.J. Mercier for (type = !can_swap; type < ANON_AND_FILE; type++) { unsigned long seq; -@@ -4492,8 +4498,6 @@ static bool should_run_aging(struct lruv +@@ -4494,8 +4500,6 @@ static bool should_run_aging(struct lruv * stalls when the number of generations reaches MIN_NR_GENS. Hence, the * ideal number of generations is MIN_NR_GENS+1. */ @@ -84,7 +84,7 @@ Signed-off-by: T.J. Mercier if (min_seq[!can_swap] + MIN_NR_GENS < max_seq) return false; -@@ -4512,40 +4516,54 @@ static bool should_run_aging(struct lruv +@@ -4514,40 +4518,54 @@ static bool should_run_aging(struct lruv return false; } @@ -160,7 +160,7 @@ Signed-off-by: T.J. Mercier } /* to protect the working set of the last N jiffies */ -@@ -4554,46 +4572,32 @@ static unsigned long lru_gen_min_ttl __r +@@ -4556,46 +4574,32 @@ static unsigned long lru_gen_min_ttl __r static void lru_gen_age_node(struct pglist_data *pgdat, struct scan_control *sc) { struct mem_cgroup *memcg; @@ -214,7 +214,7 @@ Signed-off-by: T.J. Mercier */ if (mutex_trylock(&oom_lock)) { struct oom_control oc = { -@@ -5101,33 +5105,27 @@ retry: +@@ -5113,33 +5117,27 @@ retry: * reclaim. */ static unsigned long get_nr_to_scan(struct lruvec *lruvec, struct scan_control *sc, @@ -254,7 +254,7 @@ Signed-off-by: T.J. Mercier } static unsigned long get_nr_to_reclaim(struct scan_control *sc) -@@ -5146,9 +5144,7 @@ static unsigned long get_nr_to_reclaim(s +@@ -5158,9 +5156,7 @@ static unsigned long get_nr_to_reclaim(s static void lru_gen_shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc) { struct blk_plug plug; @@ -264,7 +264,7 @@ Signed-off-by: T.J. Mercier unsigned long nr_to_reclaim = get_nr_to_reclaim(sc); lru_add_drain(); -@@ -5169,13 +5165,13 @@ static void lru_gen_shrink_lruvec(struct +@@ -5181,13 +5177,13 @@ static void lru_gen_shrink_lruvec(struct else swappiness = 0; @@ -281,7 +281,7 @@ Signed-off-by: T.J. Mercier scanned += delta; if (scanned >= nr_to_scan) -@@ -5187,10 +5183,6 @@ static void lru_gen_shrink_lruvec(struct +@@ -5199,10 +5195,6 @@ static void lru_gen_shrink_lruvec(struct cond_resched(); } diff --git a/target/linux/generic/backport-6.1/020-v6.3-05-UPSTREAM-mm-multi-gen-LRU-shuffle-should_run_aging.patch b/target/linux/generic/backport-6.1/020-v6.3-05-UPSTREAM-mm-multi-gen-LRU-shuffle-should_run_aging.patch index 857072296bfb83..42caab7c3785e2 100644 --- a/target/linux/generic/backport-6.1/020-v6.3-05-UPSTREAM-mm-multi-gen-LRU-shuffle-should_run_aging.patch +++ b/target/linux/generic/backport-6.1/020-v6.3-05-UPSTREAM-mm-multi-gen-LRU-shuffle-should_run_aging.patch @@ -26,7 +26,7 @@ Signed-off-by: T.J. Mercier --- a/mm/vmscan.c +++ b/mm/vmscan.c -@@ -4454,68 +4454,6 @@ done: +@@ -4456,68 +4456,6 @@ done: return true; } @@ -95,7 +95,7 @@ Signed-off-by: T.J. Mercier static bool lruvec_is_sizable(struct lruvec *lruvec, struct scan_control *sc) { int gen, type, zone; -@@ -5099,6 +5037,68 @@ retry: +@@ -5111,6 +5049,68 @@ retry: return scanned; } diff --git a/target/linux/generic/backport-6.1/020-v6.3-06-BACKPORT-mm-multi-gen-LRU-per-node-lru_gen_folio-lis.patch b/target/linux/generic/backport-6.1/020-v6.3-06-BACKPORT-mm-multi-gen-LRU-per-node-lru_gen_folio-lis.patch index 87e7c49a766fda..ef98d52b78d616 100644 --- a/target/linux/generic/backport-6.1/020-v6.3-06-BACKPORT-mm-multi-gen-LRU-per-node-lru_gen_folio-lis.patch +++ b/target/linux/generic/backport-6.1/020-v6.3-06-BACKPORT-mm-multi-gen-LRU-per-node-lru_gen_folio-lis.patch @@ -76,7 +76,7 @@ Signed-off-by: T.J. Mercier --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h -@@ -790,6 +790,11 @@ static inline void obj_cgroup_put(struct +@@ -795,6 +795,11 @@ static inline void obj_cgroup_put(struct percpu_ref_put(&objcg->refcnt); } @@ -88,7 +88,7 @@ Signed-off-by: T.J. Mercier static inline void mem_cgroup_put(struct mem_cgroup *memcg) { if (memcg) -@@ -1290,6 +1295,11 @@ static inline void obj_cgroup_put(struct +@@ -1295,6 +1300,11 @@ static inline void obj_cgroup_put(struct { } @@ -402,7 +402,7 @@ Signed-off-by: T.J. Mercier static struct lruvec *get_lruvec(struct mem_cgroup *memcg, int nid) { struct pglist_data *pgdat = NODE_DATA(nid); -@@ -4440,8 +4440,7 @@ done: +@@ -4442,8 +4442,7 @@ done: if (sc->priority <= DEF_PRIORITY - 2) wait_event_killable(lruvec->mm_state.wait, max_seq < READ_ONCE(lrugen->max_seq)); @@ -412,7 +412,7 @@ Signed-off-by: T.J. Mercier } VM_WARN_ON_ONCE(max_seq != READ_ONCE(lrugen->max_seq)); -@@ -4514,8 +4513,6 @@ static void lru_gen_age_node(struct pgli +@@ -4516,8 +4515,6 @@ static void lru_gen_age_node(struct pgli VM_WARN_ON_ONCE(!current_is_kswapd()); @@ -421,7 +421,7 @@ Signed-off-by: T.J. Mercier /* check the order to exclude compaction-induced reclaim */ if (!min_ttl || sc->order || sc->priority == DEF_PRIORITY) return; -@@ -5104,8 +5101,7 @@ static bool should_run_aging(struct lruv +@@ -5116,8 +5113,7 @@ static bool should_run_aging(struct lruv * 1. Defer try_to_inc_max_seq() to workqueues to reduce latency for memcg * reclaim. */ @@ -431,7 +431,7 @@ Signed-off-by: T.J. Mercier { unsigned long nr_to_scan; struct mem_cgroup *memcg = lruvec_memcg(lruvec); -@@ -5122,10 +5118,8 @@ static unsigned long get_nr_to_scan(stru +@@ -5134,10 +5130,8 @@ static unsigned long get_nr_to_scan(stru if (sc->priority == DEF_PRIORITY) return nr_to_scan; @@ -443,7 +443,7 @@ Signed-off-by: T.J. Mercier } static unsigned long get_nr_to_reclaim(struct scan_control *sc) -@@ -5134,29 +5128,18 @@ static unsigned long get_nr_to_reclaim(s +@@ -5146,29 +5140,18 @@ static unsigned long get_nr_to_reclaim(s if (!global_reclaim(sc)) return -1; @@ -475,7 +475,7 @@ Signed-off-by: T.J. Mercier if (sc->may_swap) swappiness = get_swappiness(lruvec, sc); -@@ -5166,7 +5149,7 @@ static void lru_gen_shrink_lruvec(struct +@@ -5178,7 +5161,7 @@ static void lru_gen_shrink_lruvec(struct swappiness = 0; nr_to_scan = get_nr_to_scan(lruvec, sc, swappiness); @@ -484,7 +484,7 @@ Signed-off-by: T.J. Mercier break; delta = evict_folios(lruvec, sc, swappiness); -@@ -5183,10 +5166,251 @@ static void lru_gen_shrink_lruvec(struct +@@ -5195,10 +5178,251 @@ static void lru_gen_shrink_lruvec(struct cond_resched(); } @@ -736,7 +736,7 @@ Signed-off-by: T.J. Mercier /****************************************************************************** * state change -@@ -5644,11 +5868,11 @@ static int run_cmd(char cmd, int memcg_i +@@ -5656,11 +5880,11 @@ static int run_cmd(char cmd, int memcg_i if (!mem_cgroup_disabled()) { rcu_read_lock(); @@ -751,7 +751,7 @@ Signed-off-by: T.J. Mercier rcu_read_unlock(); if (!memcg) -@@ -5796,6 +6020,19 @@ void lru_gen_init_lruvec(struct lruvec * +@@ -5808,6 +6032,19 @@ void lru_gen_init_lruvec(struct lruvec * } #ifdef CONFIG_MEMCG @@ -771,7 +771,7 @@ Signed-off-by: T.J. Mercier void lru_gen_init_memcg(struct mem_cgroup *memcg) { INIT_LIST_HEAD(&memcg->mm_list.fifo); -@@ -5819,7 +6056,69 @@ void lru_gen_exit_memcg(struct mem_cgrou +@@ -5831,7 +6068,69 @@ void lru_gen_exit_memcg(struct mem_cgrou } } } @@ -842,7 +842,7 @@ Signed-off-by: T.J. Mercier static int __init init_lru_gen(void) { -@@ -5846,6 +6145,10 @@ static void lru_gen_shrink_lruvec(struct +@@ -5858,6 +6157,10 @@ static void lru_gen_shrink_lruvec(struct { } @@ -853,7 +853,7 @@ Signed-off-by: T.J. Mercier #endif /* CONFIG_LRU_GEN */ static void shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc) -@@ -5859,7 +6162,7 @@ static void shrink_lruvec(struct lruvec +@@ -5871,7 +6174,7 @@ static void shrink_lruvec(struct lruvec bool proportional_reclaim; struct blk_plug plug; @@ -862,7 +862,7 @@ Signed-off-by: T.J. Mercier lru_gen_shrink_lruvec(lruvec, sc); return; } -@@ -6102,6 +6405,11 @@ static void shrink_node(pg_data_t *pgdat +@@ -6114,6 +6417,11 @@ static void shrink_node(pg_data_t *pgdat struct lruvec *target_lruvec; bool reclaimable = false; diff --git a/target/linux/generic/backport-6.1/020-v6.3-07-BACKPORT-mm-multi-gen-LRU-clarify-scan_control-flags.patch b/target/linux/generic/backport-6.1/020-v6.3-07-BACKPORT-mm-multi-gen-LRU-clarify-scan_control-flags.patch index 29430636ff41f4..d60ddb9dccafed 100644 --- a/target/linux/generic/backport-6.1/020-v6.3-07-BACKPORT-mm-multi-gen-LRU-clarify-scan_control-flags.patch +++ b/target/linux/generic/backport-6.1/020-v6.3-07-BACKPORT-mm-multi-gen-LRU-clarify-scan_control-flags.patch @@ -69,7 +69,7 @@ Signed-off-by: T.J. Mercier VM_WARN_ON_ONCE(current_is_kswapd()); walk = kzalloc(sizeof(*walk), __GFP_HIGH | __GFP_NOMEMALLOC | __GFP_NOWARN); -@@ -4417,7 +4420,7 @@ static bool try_to_inc_max_seq(struct lr +@@ -4419,7 +4422,7 @@ static bool try_to_inc_max_seq(struct lr goto done; } @@ -78,7 +78,7 @@ Signed-off-by: T.J. Mercier if (!walk) { success = iterate_mm_list_nowalk(lruvec, max_seq); goto done; -@@ -4486,8 +4489,6 @@ static bool lruvec_is_reclaimable(struct +@@ -4488,8 +4491,6 @@ static bool lruvec_is_reclaimable(struct struct mem_cgroup *memcg = lruvec_memcg(lruvec); DEFINE_MIN_SEQ(lruvec); @@ -87,7 +87,7 @@ Signed-off-by: T.J. Mercier /* see the comment on lru_gen_folio */ gen = lru_gen_from_seq(min_seq[LRU_GEN_FILE]); birth = READ_ONCE(lruvec->lrugen.timestamps[gen]); -@@ -4743,12 +4744,8 @@ static bool isolate_folio(struct lruvec +@@ -4753,12 +4754,8 @@ static bool isolate_folio(struct lruvec { bool success; @@ -101,7 +101,7 @@ Signed-off-by: T.J. Mercier (folio_test_dirty(folio) || (folio_test_anon(folio) && !folio_test_swapcache(folio)))) return false; -@@ -4845,9 +4842,8 @@ static int scan_folios(struct lruvec *lr +@@ -4857,9 +4854,8 @@ static int scan_folios(struct lruvec *lr __count_vm_events(PGSCAN_ANON + type, isolated); /* @@ -113,7 +113,7 @@ Signed-off-by: T.J. Mercier */ return isolated || !remaining ? scanned : 0; } -@@ -5107,8 +5103,7 @@ static long get_nr_to_scan(struct lruvec +@@ -5119,8 +5115,7 @@ static long get_nr_to_scan(struct lruvec struct mem_cgroup *memcg = lruvec_memcg(lruvec); DEFINE_MAX_SEQ(lruvec); @@ -123,7 +123,7 @@ Signed-off-by: T.J. Mercier return 0; if (!should_run_aging(lruvec, max_seq, sc, can_swap, &nr_to_scan)) -@@ -5136,17 +5131,14 @@ static bool try_to_shrink_lruvec(struct +@@ -5148,17 +5143,14 @@ static bool try_to_shrink_lruvec(struct long nr_to_scan; unsigned long scanned = 0; unsigned long nr_to_reclaim = get_nr_to_reclaim(sc); @@ -146,7 +146,7 @@ Signed-off-by: T.J. Mercier nr_to_scan = get_nr_to_scan(lruvec, sc, swappiness); if (nr_to_scan <= 0) -@@ -5277,12 +5269,13 @@ static void lru_gen_shrink_lruvec(struct +@@ -5289,12 +5281,13 @@ static void lru_gen_shrink_lruvec(struct struct blk_plug plug; VM_WARN_ON_ONCE(global_reclaim(sc)); @@ -161,7 +161,7 @@ Signed-off-by: T.J. Mercier if (try_to_shrink_lruvec(lruvec, sc)) lru_gen_rotate_memcg(lruvec, MEMCG_LRU_YOUNG); -@@ -5338,11 +5331,19 @@ static void lru_gen_shrink_node(struct p +@@ -5350,11 +5343,19 @@ static void lru_gen_shrink_node(struct p VM_WARN_ON_ONCE(!global_reclaim(sc)); @@ -182,7 +182,7 @@ Signed-off-by: T.J. Mercier set_initial_priority(pgdat, sc); -@@ -5360,7 +5361,7 @@ static void lru_gen_shrink_node(struct p +@@ -5372,7 +5373,7 @@ static void lru_gen_shrink_node(struct p clear_mm_walk(); blk_finish_plug(&plug); @@ -191,7 +191,7 @@ Signed-off-by: T.J. Mercier /* kswapd should never fail */ pgdat->kswapd_failures = 0; } -@@ -5932,7 +5933,7 @@ static ssize_t lru_gen_seq_write(struct +@@ -5944,7 +5945,7 @@ static ssize_t lru_gen_seq_write(struct set_task_reclaim_state(current, &sc.reclaim_state); flags = memalloc_noreclaim_save(); blk_start_plug(&plug); diff --git a/target/linux/generic/backport-6.1/020-v6.3-08-UPSTREAM-mm-multi-gen-LRU-simplify-arch_has_hw_pte_y.patch b/target/linux/generic/backport-6.1/020-v6.3-08-UPSTREAM-mm-multi-gen-LRU-simplify-arch_has_hw_pte_y.patch index d7d98ca6c59291..3cbc84f8b8e5c8 100644 --- a/target/linux/generic/backport-6.1/020-v6.3-08-UPSTREAM-mm-multi-gen-LRU-simplify-arch_has_hw_pte_y.patch +++ b/target/linux/generic/backport-6.1/020-v6.3-08-UPSTREAM-mm-multi-gen-LRU-simplify-arch_has_hw_pte_y.patch @@ -27,7 +27,7 @@ Signed-off-by: T.J. Mercier --- a/mm/vmscan.c +++ b/mm/vmscan.c -@@ -4415,7 +4415,7 @@ static bool try_to_inc_max_seq(struct lr +@@ -4417,7 +4417,7 @@ static bool try_to_inc_max_seq(struct lr * handful of PTEs. Spreading the work out over a period of time usually * is less efficient, but it avoids bursty page faults. */ diff --git a/target/linux/generic/backport-6.1/020-v6.3-09-UPSTREAM-mm-multi-gen-LRU-avoid-futile-retries.patch b/target/linux/generic/backport-6.1/020-v6.3-09-UPSTREAM-mm-multi-gen-LRU-avoid-futile-retries.patch index 1f91cb9f54f6ab..c1ad1c538eabcc 100644 --- a/target/linux/generic/backport-6.1/020-v6.3-09-UPSTREAM-mm-multi-gen-LRU-avoid-futile-retries.patch +++ b/target/linux/generic/backport-6.1/020-v6.3-09-UPSTREAM-mm-multi-gen-LRU-avoid-futile-retries.patch @@ -29,7 +29,7 @@ Signed-off-by: T.J. Mercier --- a/mm/vmscan.c +++ b/mm/vmscan.c -@@ -5206,18 +5206,20 @@ static int shrink_one(struct lruvec *lru +@@ -5218,18 +5218,20 @@ static int shrink_one(struct lruvec *lru static void shrink_many(struct pglist_data *pgdat, struct scan_control *sc) { @@ -52,7 +52,7 @@ Signed-off-by: T.J. Mercier gen = get_memcg_gen(READ_ONCE(pgdat->memcg_lru.seq)); rcu_read_lock(); -@@ -5241,14 +5243,22 @@ restart: +@@ -5253,14 +5255,22 @@ restart: op = shrink_one(lruvec, sc); @@ -78,7 +78,7 @@ Signed-off-by: T.J. Mercier /* restart if raced with lru_gen_rotate_memcg() */ if (gen != get_nulls_value(pos)) goto restart; -@@ -5257,11 +5267,6 @@ restart: +@@ -5269,11 +5279,6 @@ restart: bin = get_memcg_bin(bin + 1); if (bin != first_bin) goto restart; diff --git a/target/linux/generic/backport-6.1/020-v6.3-12-UPSTREAM-mm-multi-gen-LRU-section-for-working-set-pr.patch b/target/linux/generic/backport-6.1/020-v6.3-12-UPSTREAM-mm-multi-gen-LRU-section-for-working-set-pr.patch index ca68b3a86aa8be..bac2e3e34409b0 100644 --- a/target/linux/generic/backport-6.1/020-v6.3-12-UPSTREAM-mm-multi-gen-LRU-section-for-working-set-pr.patch +++ b/target/linux/generic/backport-6.1/020-v6.3-12-UPSTREAM-mm-multi-gen-LRU-section-for-working-set-pr.patch @@ -54,7 +54,7 @@ Signed-off-by: T.J. Mercier The multi-gen LRU can be disassembled into the following parts: --- a/mm/vmscan.c +++ b/mm/vmscan.c -@@ -4459,6 +4459,10 @@ done: +@@ -4461,6 +4461,10 @@ done: return true; } diff --git a/target/linux/generic/backport-6.1/020-v6.3-13-UPSTREAM-mm-multi-gen-LRU-section-for-rmap-PT-walk-f.patch b/target/linux/generic/backport-6.1/020-v6.3-13-UPSTREAM-mm-multi-gen-LRU-section-for-rmap-PT-walk-f.patch index ca28cee2cb35fd..c28a1c5d5b9b4b 100644 --- a/target/linux/generic/backport-6.1/020-v6.3-13-UPSTREAM-mm-multi-gen-LRU-section-for-rmap-PT-walk-f.patch +++ b/target/linux/generic/backport-6.1/020-v6.3-13-UPSTREAM-mm-multi-gen-LRU-section-for-rmap-PT-walk-f.patch @@ -44,7 +44,7 @@ Signed-off-by: T.J. Mercier The multi-gen LRU can be disassembled into the following parts: --- a/mm/vmscan.c +++ b/mm/vmscan.c -@@ -4553,6 +4553,10 @@ static void lru_gen_age_node(struct pgli +@@ -4555,6 +4555,10 @@ static void lru_gen_age_node(struct pgli } } diff --git a/target/linux/generic/backport-6.1/020-v6.3-15-UPSTREAM-mm-multi-gen-LRU-section-for-memcg-LRU.patch b/target/linux/generic/backport-6.1/020-v6.3-15-UPSTREAM-mm-multi-gen-LRU-section-for-memcg-LRU.patch index 735c91f79983be..39552b07c0e8f3 100644 --- a/target/linux/generic/backport-6.1/020-v6.3-15-UPSTREAM-mm-multi-gen-LRU-section-for-memcg-LRU.patch +++ b/target/linux/generic/backport-6.1/020-v6.3-15-UPSTREAM-mm-multi-gen-LRU-section-for-memcg-LRU.patch @@ -154,7 +154,7 @@ Signed-off-by: T.J. Mercier --- a/mm/vmscan.c +++ b/mm/vmscan.c -@@ -4690,6 +4690,148 @@ void lru_gen_look_around(struct page_vma +@@ -4692,6 +4692,148 @@ void lru_gen_look_around(struct page_vma } /****************************************************************************** @@ -303,7 +303,7 @@ Signed-off-by: T.J. Mercier * the eviction ******************************************************************************/ -@@ -5386,53 +5528,6 @@ done: +@@ -5398,53 +5540,6 @@ done: pgdat->kswapd_failures = 0; } @@ -357,7 +357,7 @@ Signed-off-by: T.J. Mercier /****************************************************************************** * state change ******************************************************************************/ -@@ -6078,67 +6173,6 @@ void lru_gen_exit_memcg(struct mem_cgrou +@@ -6090,67 +6185,6 @@ void lru_gen_exit_memcg(struct mem_cgrou } } diff --git a/target/linux/generic/backport-6.1/020-v6.3-16-UPSTREAM-mm-multi-gen-LRU-improve-lru_gen_exit_memcg.patch b/target/linux/generic/backport-6.1/020-v6.3-16-UPSTREAM-mm-multi-gen-LRU-improve-lru_gen_exit_memcg.patch index 94473755058d24..1ee766f8613faf 100644 --- a/target/linux/generic/backport-6.1/020-v6.3-16-UPSTREAM-mm-multi-gen-LRU-improve-lru_gen_exit_memcg.patch +++ b/target/linux/generic/backport-6.1/020-v6.3-16-UPSTREAM-mm-multi-gen-LRU-improve-lru_gen_exit_memcg.patch @@ -20,7 +20,7 @@ Signed-off-by: T.J. Mercier --- a/mm/vmscan.c +++ b/mm/vmscan.c -@@ -6160,12 +6160,17 @@ void lru_gen_exit_memcg(struct mem_cgrou +@@ -6172,12 +6172,17 @@ void lru_gen_exit_memcg(struct mem_cgrou int i; int nid; diff --git a/target/linux/generic/backport-6.1/020-v6.3-18-UPSTREAM-mm-multi-gen-LRU-simplify-lru_gen_look_arou.patch b/target/linux/generic/backport-6.1/020-v6.3-18-UPSTREAM-mm-multi-gen-LRU-simplify-lru_gen_look_arou.patch index 1f071f0839c5f2..856199574a1c43 100644 --- a/target/linux/generic/backport-6.1/020-v6.3-18-UPSTREAM-mm-multi-gen-LRU-simplify-lru_gen_look_arou.patch +++ b/target/linux/generic/backport-6.1/020-v6.3-18-UPSTREAM-mm-multi-gen-LRU-simplify-lru_gen_look_arou.patch @@ -26,7 +26,7 @@ Signed-off-by: T.J. Mercier --- a/mm/vmscan.c +++ b/mm/vmscan.c -@@ -4571,13 +4571,12 @@ static void lru_gen_age_node(struct pgli +@@ -4573,13 +4573,12 @@ static void lru_gen_age_node(struct pgli void lru_gen_look_around(struct page_vma_mapped_walk *pvmw) { int i; @@ -42,7 +42,7 @@ Signed-off-by: T.J. Mercier struct folio *folio = pfn_folio(pvmw->pfn); struct mem_cgroup *memcg = folio_memcg(folio); struct pglist_data *pgdat = folio_pgdat(folio); -@@ -4594,25 +4593,28 @@ void lru_gen_look_around(struct page_vma +@@ -4596,25 +4595,28 @@ void lru_gen_look_around(struct page_vma /* avoid taking the LRU lock under the PTL when possible */ walk = current->reclaim_state ? current->reclaim_state->mm_walk : NULL; @@ -79,7 +79,7 @@ Signed-off-by: T.J. Mercier for (i = 0, addr = start; addr != end; i++, addr += PAGE_SIZE) { unsigned long pfn; -@@ -4637,56 +4639,27 @@ void lru_gen_look_around(struct page_vma +@@ -4639,56 +4641,27 @@ void lru_gen_look_around(struct page_vma !folio_test_swapcache(folio))) folio_mark_dirty(folio); diff --git a/target/linux/generic/backport-6.1/020-v6.4-19-mm-Multi-gen-LRU-remove-wait_event_killable.patch b/target/linux/generic/backport-6.1/020-v6.4-19-mm-Multi-gen-LRU-remove-wait_event_killable.patch index fc42a245f39fcb..1b0459cdb9cc97 100644 --- a/target/linux/generic/backport-6.1/020-v6.4-19-mm-Multi-gen-LRU-remove-wait_event_killable.patch +++ b/target/linux/generic/backport-6.1/020-v6.4-19-mm-Multi-gen-LRU-remove-wait_event_killable.patch @@ -226,7 +226,7 @@ Signed-off-by: Andrew Morton /* folio_update_gen() requires stable folio_memcg() */ if (!mem_cgroup_trylock_pages(memcg)) break; -@@ -4442,25 +4425,12 @@ static bool try_to_inc_max_seq(struct lr +@@ -4444,25 +4427,12 @@ static bool try_to_inc_max_seq(struct lr success = iterate_mm_list(lruvec, walk, &mm); if (mm) walk_mm(lruvec, mm, walk); @@ -255,7 +255,7 @@ Signed-off-by: Andrew Morton } /****************************************************************************** -@@ -6105,7 +6075,6 @@ void lru_gen_init_lruvec(struct lruvec * +@@ -6117,7 +6087,6 @@ void lru_gen_init_lruvec(struct lruvec * INIT_LIST_HEAD(&lrugen->folios[gen][type][zone]); lruvec->mm_state.seq = MIN_NR_GENS; @@ -263,7 +263,7 @@ Signed-off-by: Andrew Morton } #ifdef CONFIG_MEMCG -@@ -6138,7 +6107,6 @@ void lru_gen_exit_memcg(struct mem_cgrou +@@ -6150,7 +6119,6 @@ void lru_gen_exit_memcg(struct mem_cgrou for_each_node(nid) { struct lruvec *lruvec = get_lruvec(memcg, nid); diff --git a/target/linux/generic/backport-6.1/724-v6.2-net-ethernet-mtk_eth_soc-enable-flow-offloading-supp.patch b/target/linux/generic/backport-6.1/724-v6.2-net-ethernet-mtk_eth_soc-enable-flow-offloading-supp.patch index dcef5ff2893408..55267916242a99 100644 --- a/target/linux/generic/backport-6.1/724-v6.2-net-ethernet-mtk_eth_soc-enable-flow-offloading-supp.patch +++ b/target/linux/generic/backport-6.1/724-v6.2-net-ethernet-mtk_eth_soc-enable-flow-offloading-supp.patch @@ -16,7 +16,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -4331,6 +4331,7 @@ static const struct mtk_soc_data mt7986_ +@@ -4334,6 +4334,7 @@ static const struct mtk_soc_data mt7986_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7986_CLKS_BITMAP, .required_pctl = false, diff --git a/target/linux/generic/backport-6.1/729-07-v6.1-net-ethernet-mtk_eth_soc-remove-cpu_relax-in-mtk_pen.patch b/target/linux/generic/backport-6.1/729-07-v6.1-net-ethernet-mtk_eth_soc-remove-cpu_relax-in-mtk_pen.patch index 7d05eb8ee8b81c..95a21e1c9a39d7 100644 --- a/target/linux/generic/backport-6.1/729-07-v6.1-net-ethernet-mtk_eth_soc-remove-cpu_relax-in-mtk_pen.patch +++ b/target/linux/generic/backport-6.1/729-07-v6.1-net-ethernet-mtk_eth_soc-remove-cpu_relax-in-mtk_pen.patch @@ -12,7 +12,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3478,11 +3478,8 @@ static void mtk_pending_work(struct work +@@ -3481,11 +3481,8 @@ static void mtk_pending_work(struct work rtnl_lock(); dev_dbg(eth->dev, "[%s][%d] reset\n", __func__, __LINE__); @@ -25,7 +25,7 @@ Signed-off-by: David S. Miller /* stop all devices to make sure that dma is properly shut down */ for (i = 0; i < MTK_MAC_COUNT; i++) { if (!eth->netdev[i]) -@@ -3516,7 +3513,7 @@ static void mtk_pending_work(struct work +@@ -3519,7 +3516,7 @@ static void mtk_pending_work(struct work dev_dbg(eth->dev, "[%s][%d] reset done\n", __func__, __LINE__); diff --git a/target/linux/generic/backport-6.1/729-18-v6.3-net-ethernet-mtk_eth_soc-introduce-mtk_hw_reset-util.patch b/target/linux/generic/backport-6.1/729-18-v6.3-net-ethernet-mtk_eth_soc-introduce-mtk_hw_reset-util.patch index ce64f84ffbdcf2..8bdbfc29279982 100644 --- a/target/linux/generic/backport-6.1/729-18-v6.3-net-ethernet-mtk_eth_soc-introduce-mtk_hw_reset-util.patch +++ b/target/linux/generic/backport-6.1/729-18-v6.3-net-ethernet-mtk_eth_soc-introduce-mtk_hw_reset-util.patch @@ -16,7 +16,7 @@ Signed-off-by: Paolo Abeni --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3254,6 +3254,27 @@ static void mtk_set_mcr_max_rx(struct mt +@@ -3257,6 +3257,27 @@ static void mtk_set_mcr_max_rx(struct mt mtk_w32(mac->hw, mcr_new, MTK_MAC_MCR(mac->id)); } @@ -44,7 +44,7 @@ Signed-off-by: Paolo Abeni static int mtk_hw_init(struct mtk_eth *eth) { u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA | -@@ -3293,22 +3314,9 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3296,22 +3317,9 @@ static int mtk_hw_init(struct mtk_eth *e return 0; } diff --git a/target/linux/generic/backport-6.1/729-19-v6.3-net-ethernet-mtk_eth_soc-introduce-mtk_hw_warm_reset.patch b/target/linux/generic/backport-6.1/729-19-v6.3-net-ethernet-mtk_eth_soc-introduce-mtk_hw_warm_reset.patch index 652623493b6f60..712b6a2d3afeee 100644 --- a/target/linux/generic/backport-6.1/729-19-v6.3-net-ethernet-mtk_eth_soc-introduce-mtk_hw_warm_reset.patch +++ b/target/linux/generic/backport-6.1/729-19-v6.3-net-ethernet-mtk_eth_soc-introduce-mtk_hw_warm_reset.patch @@ -17,7 +17,7 @@ Signed-off-by: Paolo Abeni --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3275,7 +3275,54 @@ static void mtk_hw_reset(struct mtk_eth +@@ -3278,7 +3278,54 @@ static void mtk_hw_reset(struct mtk_eth 0x3ffffff); } @@ -73,7 +73,7 @@ Signed-off-by: Paolo Abeni { u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA | ETHSYS_DMA_AG_MAP_PPE; -@@ -3314,7 +3361,12 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3317,7 +3364,12 @@ static int mtk_hw_init(struct mtk_eth *e return 0; } @@ -87,7 +87,7 @@ Signed-off-by: Paolo Abeni if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) { /* Set FE to PDMAv2 if necessary */ -@@ -3505,7 +3557,7 @@ static void mtk_pending_work(struct work +@@ -3508,7 +3560,7 @@ static void mtk_pending_work(struct work if (eth->dev->pins) pinctrl_select_state(eth->dev->pins->p, eth->dev->pins->default_state); @@ -96,7 +96,7 @@ Signed-off-by: Paolo Abeni /* restart DMA and enable IRQs */ for (i = 0; i < MTK_MAC_COUNT; i++) { -@@ -4107,7 +4159,7 @@ static int mtk_probe(struct platform_dev +@@ -4110,7 +4162,7 @@ static int mtk_probe(struct platform_dev eth->msg_enable = netif_msg_init(mtk_msg_level, MTK_DEFAULT_MSG_ENABLE); INIT_WORK(ð->pending_work, mtk_pending_work); diff --git a/target/linux/generic/backport-6.1/729-20-v6.3-net-ethernet-mtk_eth_soc-align-reset-procedure-to-ve.patch b/target/linux/generic/backport-6.1/729-20-v6.3-net-ethernet-mtk_eth_soc-align-reset-procedure-to-ve.patch index 17c168a6c0583c..9da16ec56ccd8f 100644 --- a/target/linux/generic/backport-6.1/729-20-v6.3-net-ethernet-mtk_eth_soc-align-reset-procedure-to-ve.patch +++ b/target/linux/generic/backport-6.1/729-20-v6.3-net-ethernet-mtk_eth_soc-align-reset-procedure-to-ve.patch @@ -16,7 +16,7 @@ Signed-off-by: Paolo Abeni --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -2842,14 +2842,29 @@ static void mtk_dma_free(struct mtk_eth +@@ -2845,14 +2845,29 @@ static void mtk_dma_free(struct mtk_eth kfree(eth->scratch_head); } @@ -48,7 +48,7 @@ Signed-off-by: Paolo Abeni schedule_work(ð->pending_work); } -@@ -3329,15 +3344,17 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3332,15 +3347,17 @@ static int mtk_hw_init(struct mtk_eth *e const struct mtk_reg_map *reg_map = eth->soc->reg_map; int i, val, ret; @@ -72,7 +72,7 @@ Signed-off-by: Paolo Abeni if (eth->ethsys) regmap_update_bits(eth->ethsys, ETHSYS_DMA_AG_MAP, dma_mask, -@@ -3466,8 +3483,10 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3469,8 +3486,10 @@ static int mtk_hw_init(struct mtk_eth *e return 0; err_disable_pm: @@ -85,7 +85,7 @@ Signed-off-by: Paolo Abeni return ret; } -@@ -3529,30 +3548,53 @@ static int mtk_do_ioctl(struct net_devic +@@ -3532,30 +3551,53 @@ static int mtk_do_ioctl(struct net_devic return -EOPNOTSUPP; } @@ -148,7 +148,7 @@ Signed-off-by: Paolo Abeni if (eth->dev->pins) pinctrl_select_state(eth->dev->pins->p, -@@ -3563,15 +3605,19 @@ static void mtk_pending_work(struct work +@@ -3566,15 +3608,19 @@ static void mtk_pending_work(struct work for (i = 0; i < MTK_MAC_COUNT; i++) { if (!test_bit(i, &restart)) continue; diff --git a/target/linux/generic/backport-6.1/729-21-v6.3-net-ethernet-mtk_eth_soc-add-dma-checks-to-mtk_hw_re.patch b/target/linux/generic/backport-6.1/729-21-v6.3-net-ethernet-mtk_eth_soc-add-dma-checks-to-mtk_hw_re.patch index d682bee89a63f2..96ebc874814fb8 100644 --- a/target/linux/generic/backport-6.1/729-21-v6.3-net-ethernet-mtk_eth_soc-add-dma-checks-to-mtk_hw_re.patch +++ b/target/linux/generic/backport-6.1/729-21-v6.3-net-ethernet-mtk_eth_soc-add-dma-checks-to-mtk_hw_re.patch @@ -49,7 +49,7 @@ Signed-off-by: Paolo Abeni }; /* strings used by ethtool */ -@@ -3337,6 +3343,102 @@ static void mtk_hw_warm_reset(struct mtk +@@ -3340,6 +3346,102 @@ static void mtk_hw_warm_reset(struct mtk val, rst_mask); } @@ -152,7 +152,7 @@ Signed-off-by: Paolo Abeni static int mtk_hw_init(struct mtk_eth *eth, bool reset) { u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA | -@@ -3655,6 +3757,7 @@ static int mtk_cleanup(struct mtk_eth *e +@@ -3658,6 +3760,7 @@ static int mtk_cleanup(struct mtk_eth *e mtk_unreg_dev(eth); mtk_free_dev(eth); cancel_work_sync(ð->pending_work); @@ -160,7 +160,7 @@ Signed-off-by: Paolo Abeni return 0; } -@@ -4092,6 +4195,7 @@ static int mtk_probe(struct platform_dev +@@ -4095,6 +4198,7 @@ static int mtk_probe(struct platform_dev eth->rx_dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE; INIT_WORK(ð->rx_dim.work, mtk_dim_rx); @@ -168,7 +168,7 @@ Signed-off-by: Paolo Abeni eth->tx_dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE; INIT_WORK(ð->tx_dim.work, mtk_dim_tx); -@@ -4294,6 +4398,8 @@ static int mtk_probe(struct platform_dev +@@ -4297,6 +4401,8 @@ static int mtk_probe(struct platform_dev netif_napi_add(ð->dummy_dev, ð->rx_napi, mtk_napi_rx); platform_set_drvdata(pdev, eth); diff --git a/target/linux/generic/backport-6.1/729-22-v6.3-net-ethernet-mtk_wed-add-reset-reset_complete-callba.patch b/target/linux/generic/backport-6.1/729-22-v6.3-net-ethernet-mtk_wed-add-reset-reset_complete-callba.patch index b8b3a1a181cf55..da1ce24b8ffe4b 100644 --- a/target/linux/generic/backport-6.1/729-22-v6.3-net-ethernet-mtk_wed-add-reset-reset_complete-callba.patch +++ b/target/linux/generic/backport-6.1/729-22-v6.3-net-ethernet-mtk_wed-add-reset-reset_complete-callba.patch @@ -14,7 +14,7 @@ Signed-off-by: Paolo Abeni --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3686,6 +3686,11 @@ static void mtk_pending_work(struct work +@@ -3689,6 +3689,11 @@ static void mtk_pending_work(struct work set_bit(MTK_RESETTING, ð->state); mtk_prepare_for_reset(eth); @@ -26,7 +26,7 @@ Signed-off-by: Paolo Abeni /* stop all devices to make sure that dma is properly shut down */ for (i = 0; i < MTK_MAC_COUNT; i++) { -@@ -3723,6 +3728,8 @@ static void mtk_pending_work(struct work +@@ -3726,6 +3731,8 @@ static void mtk_pending_work(struct work clear_bit(MTK_RESETTING, ð->state); diff --git a/target/linux/generic/backport-6.1/730-02-v6.3-net-ethernet-mtk_eth_soc-increase-tx-ring-side-for-Q.patch b/target/linux/generic/backport-6.1/730-02-v6.3-net-ethernet-mtk_eth_soc-increase-tx-ring-side-for-Q.patch index 34c41b8d4db869..c3b8af0b2b7fe9 100644 --- a/target/linux/generic/backport-6.1/730-02-v6.3-net-ethernet-mtk_eth_soc-increase-tx-ring-side-for-Q.patch +++ b/target/linux/generic/backport-6.1/730-02-v6.3-net-ethernet-mtk_eth_soc-increase-tx-ring-side-for-Q.patch @@ -122,7 +122,7 @@ Signed-off-by: Felix Fietkau ring->dma_pdma, ring->phys_pdma); ring->dma_pdma = NULL; } -@@ -2830,7 +2836,7 @@ static void mtk_dma_free(struct mtk_eth +@@ -2833,7 +2839,7 @@ static void mtk_dma_free(struct mtk_eth netdev_reset_queue(eth->netdev[i]); if (eth->scratch_ring) { dma_free_coherent(eth->dma_dev, diff --git a/target/linux/generic/backport-6.1/730-03-v6.3-net-ethernet-mtk_eth_soc-avoid-port_mg-assignment-on.patch b/target/linux/generic/backport-6.1/730-03-v6.3-net-ethernet-mtk_eth_soc-avoid-port_mg-assignment-on.patch index d91d7932080932..bc794a5c8a0f9b 100644 --- a/target/linux/generic/backport-6.1/730-03-v6.3-net-ethernet-mtk_eth_soc-avoid-port_mg-assignment-on.patch +++ b/target/linux/generic/backport-6.1/730-03-v6.3-net-ethernet-mtk_eth_soc-avoid-port_mg-assignment-on.patch @@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -4477,7 +4477,7 @@ static const struct mtk_soc_data mt7621_ +@@ -4480,7 +4480,7 @@ static const struct mtk_soc_data mt7621_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7621_CLKS_BITMAP, .required_pctl = false, @@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau .hash_offset = 2, .foe_entry_size = sizeof(struct mtk_foe_entry) - 16, .txrx = { -@@ -4516,7 +4516,7 @@ static const struct mtk_soc_data mt7623_ +@@ -4519,7 +4519,7 @@ static const struct mtk_soc_data mt7623_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7623_CLKS_BITMAP, .required_pctl = true, diff --git a/target/linux/generic/backport-6.1/730-04-v6.3-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch b/target/linux/generic/backport-6.1/730-04-v6.3-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch index be2d78911e4547..48d9b31fef4300 100644 --- a/target/linux/generic/backport-6.1/730-04-v6.3-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch +++ b/target/linux/generic/backport-6.1/730-04-v6.3-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch @@ -424,7 +424,7 @@ Signed-off-by: Felix Fietkau } else { mtk_w32(eth, ring->phys_pdma, MT7628_TX_BASE_PTR0); mtk_w32(eth, ring_size, MT7628_TX_MAX_CNT0); -@@ -2960,7 +3076,7 @@ static int mtk_start_dma(struct mtk_eth +@@ -2963,7 +3079,7 @@ static int mtk_start_dma(struct mtk_eth if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) val |= MTK_MUTLI_CNT | MTK_RESV_BUF | MTK_WCOMP_EN | MTK_DMAD_WR_WDONE | @@ -433,7 +433,7 @@ Signed-off-by: Felix Fietkau else val |= MTK_RX_BT_32DWORDS; mtk_w32(eth, val, reg_map->qdma.glo_cfg); -@@ -3006,6 +3122,45 @@ static void mtk_gdm_config(struct mtk_et +@@ -3009,6 +3125,45 @@ static void mtk_gdm_config(struct mtk_et mtk_w32(eth, 0, MTK_RST_GL); } @@ -479,7 +479,7 @@ Signed-off-by: Felix Fietkau static int mtk_open(struct net_device *dev) { struct mtk_mac *mac = netdev_priv(dev); -@@ -3048,7 +3203,8 @@ static int mtk_open(struct net_device *d +@@ -3051,7 +3206,8 @@ static int mtk_open(struct net_device *d refcount_inc(ð->dma_refcnt); phylink_start(mac->phylink); @@ -489,7 +489,7 @@ Signed-off-by: Felix Fietkau return 0; } -@@ -3757,8 +3913,12 @@ static int mtk_unreg_dev(struct mtk_eth +@@ -3760,8 +3916,12 @@ static int mtk_unreg_dev(struct mtk_eth int i; for (i = 0; i < MTK_MAC_COUNT; i++) { @@ -502,7 +502,7 @@ Signed-off-by: Felix Fietkau unregister_netdev(eth->netdev[i]); } -@@ -3975,6 +4135,23 @@ static int mtk_set_rxnfc(struct net_devi +@@ -3978,6 +4138,23 @@ static int mtk_set_rxnfc(struct net_devi return ret; } @@ -526,7 +526,7 @@ Signed-off-by: Felix Fietkau static const struct ethtool_ops mtk_ethtool_ops = { .get_link_ksettings = mtk_get_link_ksettings, .set_link_ksettings = mtk_set_link_ksettings, -@@ -4009,6 +4186,7 @@ static const struct net_device_ops mtk_n +@@ -4012,6 +4189,7 @@ static const struct net_device_ops mtk_n .ndo_setup_tc = mtk_eth_setup_tc, .ndo_bpf = mtk_xdp, .ndo_xdp_xmit = mtk_xdp_xmit, @@ -534,7 +534,7 @@ Signed-off-by: Felix Fietkau }; static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) -@@ -4018,6 +4196,7 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4021,6 +4199,7 @@ static int mtk_add_mac(struct mtk_eth *e struct phylink *phylink; struct mtk_mac *mac; int id, err; @@ -542,7 +542,7 @@ Signed-off-by: Felix Fietkau if (!_id) { dev_err(eth->dev, "missing mac id\n"); -@@ -4035,7 +4214,10 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4038,7 +4217,10 @@ static int mtk_add_mac(struct mtk_eth *e return -EINVAL; } @@ -554,7 +554,7 @@ Signed-off-by: Felix Fietkau if (!eth->netdev[id]) { dev_err(eth->dev, "alloc_etherdev failed\n"); return -ENOMEM; -@@ -4143,6 +4325,11 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4146,6 +4328,11 @@ static int mtk_add_mac(struct mtk_eth *e else eth->netdev[id]->max_mtu = MTK_MAX_RX_LENGTH_2K - MTK_RX_ETH_HLEN; diff --git a/target/linux/generic/backport-6.1/730-09-v6.3-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch b/target/linux/generic/backport-6.1/730-09-v6.3-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch index fda017f7fc105b..b45a33c4cb5388 100644 --- a/target/linux/generic/backport-6.1/730-09-v6.3-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch +++ b/target/linux/generic/backport-6.1/730-09-v6.3-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch @@ -52,7 +52,7 @@ Signed-off-by: Felix Fietkau } skb_record_rx_queue(skb, 0); -@@ -2856,15 +2863,30 @@ static netdev_features_t mtk_fix_feature +@@ -2859,15 +2866,30 @@ static netdev_features_t mtk_fix_feature static int mtk_set_features(struct net_device *dev, netdev_features_t features) { @@ -88,7 +88,7 @@ Signed-off-by: Felix Fietkau } /* wait for DMA to finish whatever it is doing before we start using it again */ -@@ -3161,11 +3183,45 @@ found: +@@ -3164,11 +3186,45 @@ found: return NOTIFY_DONE; } @@ -135,7 +135,7 @@ Signed-off-by: Felix Fietkau err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0); if (err) { -@@ -3686,6 +3742,10 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3689,6 +3745,10 @@ static int mtk_hw_init(struct mtk_eth *e */ val = mtk_r32(eth, MTK_CDMQ_IG_CTRL); mtk_w32(eth, val | MTK_CDMQ_STAG_EN, MTK_CDMQ_IG_CTRL); @@ -146,7 +146,7 @@ Signed-off-by: Felix Fietkau /* Enable RX VLan Offloading */ mtk_w32(eth, 1, MTK_CDMP_EG_CTRL); -@@ -3905,6 +3965,12 @@ static int mtk_free_dev(struct mtk_eth * +@@ -3908,6 +3968,12 @@ static int mtk_free_dev(struct mtk_eth * free_netdev(eth->netdev[i]); } diff --git a/target/linux/generic/backport-6.1/730-12-v6.3-net-ethernet-mtk_eth_soc-disable-hardware-DSA-untagg.patch b/target/linux/generic/backport-6.1/730-12-v6.3-net-ethernet-mtk_eth_soc-disable-hardware-DSA-untagg.patch index efbceb9a13de1c..42c745d02fa9a0 100644 --- a/target/linux/generic/backport-6.1/730-12-v6.3-net-ethernet-mtk_eth_soc-disable-hardware-DSA-untagg.patch +++ b/target/linux/generic/backport-6.1/730-12-v6.3-net-ethernet-mtk_eth_soc-disable-hardware-DSA-untagg.patch @@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3199,7 +3199,8 @@ static int mtk_open(struct net_device *d +@@ -3202,7 +3202,8 @@ static int mtk_open(struct net_device *d struct mtk_eth *eth = mac->hw; int i, err; @@ -30,7 +30,7 @@ Signed-off-by: Jakub Kicinski for (i = 0; i < ARRAY_SIZE(eth->dsa_meta); i++) { struct metadata_dst *md_dst = eth->dsa_meta[i]; -@@ -3216,7 +3217,8 @@ static int mtk_open(struct net_device *d +@@ -3219,7 +3220,8 @@ static int mtk_open(struct net_device *d } } else { /* Hardware special tag parsing needs to be disabled if at least diff --git a/target/linux/generic/backport-6.1/730-13-v6.3-net-ethernet-mtk_eth_soc-enable-special-tag-when-any.patch b/target/linux/generic/backport-6.1/730-13-v6.3-net-ethernet-mtk_eth_soc-enable-special-tag-when-any.patch index c0bfd9bd042e07..39874c9d1c0959 100644 --- a/target/linux/generic/backport-6.1/730-13-v6.3-net-ethernet-mtk_eth_soc-enable-special-tag-when-any.patch +++ b/target/linux/generic/backport-6.1/730-13-v6.3-net-ethernet-mtk_eth_soc-enable-special-tag-when-any.patch @@ -23,7 +23,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3134,7 +3134,7 @@ static void mtk_gdm_config(struct mtk_et +@@ -3137,7 +3137,7 @@ static void mtk_gdm_config(struct mtk_et val |= config; @@ -32,7 +32,7 @@ Signed-off-by: David S. Miller val |= MTK_GDMA_SPECIAL_TAG; mtk_w32(eth, val, MTK_GDMA_FWD_CFG(i)); -@@ -3199,8 +3199,7 @@ static int mtk_open(struct net_device *d +@@ -3202,8 +3202,7 @@ static int mtk_open(struct net_device *d struct mtk_eth *eth = mac->hw; int i, err; @@ -42,7 +42,7 @@ Signed-off-by: David S. Miller for (i = 0; i < ARRAY_SIZE(eth->dsa_meta); i++) { struct metadata_dst *md_dst = eth->dsa_meta[i]; -@@ -3217,8 +3216,7 @@ static int mtk_open(struct net_device *d +@@ -3220,8 +3219,7 @@ static int mtk_open(struct net_device *d } } else { /* Hardware special tag parsing needs to be disabled if at least diff --git a/target/linux/generic/backport-6.1/733-v6.3-18-net-ethernet-mtk_eth_soc-add-support-for-MT7981.patch b/target/linux/generic/backport-6.1/733-v6.3-18-net-ethernet-mtk_eth_soc-add-support-for-MT7981.patch index 4b53ef903a25f2..089f25545d60f4 100644 --- a/target/linux/generic/backport-6.1/733-v6.3-18-net-ethernet-mtk_eth_soc-add-support-for-MT7981.patch +++ b/target/linux/generic/backport-6.1/733-v6.3-18-net-ethernet-mtk_eth_soc-add-support-for-MT7981.patch @@ -57,7 +57,7 @@ Signed-off-by: Jakub Kicinski mtk_eth_path_name(path), __func__, updated); --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -4801,6 +4801,26 @@ static const struct mtk_soc_data mt7629_ +@@ -4804,6 +4804,26 @@ static const struct mtk_soc_data mt7629_ }, }; @@ -84,7 +84,7 @@ Signed-off-by: Jakub Kicinski static const struct mtk_soc_data mt7986_data = { .reg_map = &mt7986_reg_map, .ana_rgc3 = 0x128, -@@ -4843,6 +4863,7 @@ const struct of_device_id of_mtk_match[] +@@ -4846,6 +4866,7 @@ const struct of_device_id of_mtk_match[] { .compatible = "mediatek,mt7622-eth", .data = &mt7622_data}, { .compatible = "mediatek,mt7623-eth", .data = &mt7623_data}, { .compatible = "mediatek,mt7629-eth", .data = &mt7629_data}, diff --git a/target/linux/generic/backport-6.1/733-v6.3-20-net-ethernet-mtk_eth_soc-switch-to-external-PCS-driv.patch b/target/linux/generic/backport-6.1/733-v6.3-20-net-ethernet-mtk_eth_soc-switch-to-external-PCS-driv.patch index e40d658ddcfb1a..15295959c11ad9 100644 --- a/target/linux/generic/backport-6.1/733-v6.3-20-net-ethernet-mtk_eth_soc-switch-to-external-PCS-driv.patch +++ b/target/linux/generic/backport-6.1/733-v6.3-20-net-ethernet-mtk_eth_soc-switch-to-external-PCS-driv.patch @@ -60,7 +60,7 @@ Signed-off-by: Jakub Kicinski } return NULL; -@@ -4014,8 +4015,17 @@ static int mtk_unreg_dev(struct mtk_eth +@@ -4017,8 +4018,17 @@ static int mtk_unreg_dev(struct mtk_eth return 0; } @@ -78,7 +78,7 @@ Signed-off-by: Jakub Kicinski mtk_unreg_dev(eth); mtk_free_dev(eth); cancel_work_sync(ð->pending_work); -@@ -4455,6 +4465,36 @@ void mtk_eth_set_dma_device(struct mtk_e +@@ -4458,6 +4468,36 @@ void mtk_eth_set_dma_device(struct mtk_e rtnl_unlock(); } @@ -115,7 +115,7 @@ Signed-off-by: Jakub Kicinski static int mtk_probe(struct platform_device *pdev) { struct resource *res = NULL; -@@ -4518,13 +4558,7 @@ static int mtk_probe(struct platform_dev +@@ -4521,13 +4561,7 @@ static int mtk_probe(struct platform_dev } if (MTK_HAS_CAPS(eth->soc->caps, MTK_SGMII)) { @@ -130,7 +130,7 @@ Signed-off-by: Jakub Kicinski if (err) return err; -@@ -4535,14 +4569,17 @@ static int mtk_probe(struct platform_dev +@@ -4538,14 +4572,17 @@ static int mtk_probe(struct platform_dev "mediatek,pctl"); if (IS_ERR(eth->pctl)) { dev_err(&pdev->dev, "no pctl regmap found\n"); @@ -151,7 +151,7 @@ Signed-off-by: Jakub Kicinski } if (eth->soc->offload_version) { -@@ -4701,6 +4738,8 @@ err_deinit_hw: +@@ -4704,6 +4741,8 @@ err_deinit_hw: mtk_hw_deinit(eth); err_wed_exit: mtk_wed_exit(); diff --git a/target/linux/generic/backport-6.1/733-v6.4-23-net-ethernet-mtk_eth_soc-ppe-add-support-for-flow-ac.patch b/target/linux/generic/backport-6.1/733-v6.4-23-net-ethernet-mtk_eth_soc-ppe-add-support-for-flow-ac.patch index 3384086bdc685d..df8d6427943c9d 100644 --- a/target/linux/generic/backport-6.1/733-v6.4-23-net-ethernet-mtk_eth_soc-ppe-add-support-for-flow-ac.patch +++ b/target/linux/generic/backport-6.1/733-v6.4-23-net-ethernet-mtk_eth_soc-ppe-add-support-for-flow-ac.patch @@ -27,7 +27,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -4689,8 +4689,8 @@ static int mtk_probe(struct platform_dev +@@ -4692,8 +4692,8 @@ static int mtk_probe(struct platform_dev for (i = 0; i < num_ppe; i++) { u32 ppe_addr = eth->soc->reg_map->ppe_base + i * 0x400; @@ -38,7 +38,7 @@ Signed-off-by: Jakub Kicinski if (!eth->ppe[i]) { err = -ENOMEM; goto err_deinit_ppe; -@@ -4814,6 +4814,7 @@ static const struct mtk_soc_data mt7622_ +@@ -4817,6 +4817,7 @@ static const struct mtk_soc_data mt7622_ .required_pctl = false, .offload_version = 2, .hash_offset = 2, @@ -46,7 +46,7 @@ Signed-off-by: Jakub Kicinski .foe_entry_size = sizeof(struct mtk_foe_entry) - 16, .txrx = { .txd_size = sizeof(struct mtk_tx_dma), -@@ -4851,6 +4852,7 @@ static const struct mtk_soc_data mt7629_ +@@ -4854,6 +4855,7 @@ static const struct mtk_soc_data mt7629_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7629_CLKS_BITMAP, .required_pctl = false, @@ -54,7 +54,7 @@ Signed-off-by: Jakub Kicinski .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), -@@ -4871,6 +4873,7 @@ static const struct mtk_soc_data mt7981_ +@@ -4874,6 +4876,7 @@ static const struct mtk_soc_data mt7981_ .offload_version = 2, .hash_offset = 4, .foe_entry_size = sizeof(struct mtk_foe_entry), @@ -62,7 +62,7 @@ Signed-off-by: Jakub Kicinski .txrx = { .txd_size = sizeof(struct mtk_tx_dma_v2), .rxd_size = sizeof(struct mtk_rx_dma_v2), -@@ -4891,6 +4894,7 @@ static const struct mtk_soc_data mt7986_ +@@ -4894,6 +4897,7 @@ static const struct mtk_soc_data mt7986_ .offload_version = 2, .hash_offset = 4, .foe_entry_size = sizeof(struct mtk_foe_entry), diff --git a/target/linux/generic/backport-6.1/733-v6.4-25-net-ethernet-mtk_eth_soc-drop-generic-vlan-rx-offloa.patch b/target/linux/generic/backport-6.1/733-v6.4-25-net-ethernet-mtk_eth_soc-drop-generic-vlan-rx-offloa.patch index 3a4cc910b05884..d6309964c384bd 100644 --- a/target/linux/generic/backport-6.1/733-v6.4-25-net-ethernet-mtk_eth_soc-drop-generic-vlan-rx-offloa.patch +++ b/target/linux/generic/backport-6.1/733-v6.4-25-net-ethernet-mtk_eth_soc-drop-generic-vlan-rx-offloa.patch @@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau skb_record_rx_queue(skb, 0); napi_gro_receive(napi, skb); -@@ -2887,29 +2870,11 @@ static netdev_features_t mtk_fix_feature +@@ -2890,29 +2873,11 @@ static netdev_features_t mtk_fix_feature static int mtk_set_features(struct net_device *dev, netdev_features_t features) { @@ -100,7 +100,7 @@ Signed-off-by: Felix Fietkau return 0; } -@@ -3223,30 +3188,6 @@ static int mtk_open(struct net_device *d +@@ -3226,30 +3191,6 @@ static int mtk_open(struct net_device *d struct mtk_eth *eth = mac->hw; int i, err; @@ -131,7 +131,7 @@ Signed-off-by: Felix Fietkau err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0); if (err) { netdev_err(dev, "%s: could not attach PHY: %d\n", __func__, -@@ -3285,6 +3226,35 @@ static int mtk_open(struct net_device *d +@@ -3288,6 +3229,35 @@ static int mtk_open(struct net_device *d phylink_start(mac->phylink); netif_tx_start_all_queues(dev); @@ -167,7 +167,7 @@ Signed-off-by: Felix Fietkau return 0; } -@@ -3769,10 +3739,9 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3772,10 +3742,9 @@ static int mtk_hw_init(struct mtk_eth *e if (!MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) { val = mtk_r32(eth, MTK_CDMP_IG_CTRL); mtk_w32(eth, val | MTK_CDMP_STAG_EN, MTK_CDMP_IG_CTRL); @@ -180,7 +180,7 @@ Signed-off-by: Felix Fietkau /* set interrupt delays based on current Net DIM sample */ mtk_dim_rx(ð->rx_dim.work); -@@ -4412,7 +4381,7 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4415,7 +4384,7 @@ static int mtk_add_mac(struct mtk_eth *e eth->netdev[id]->hw_features |= NETIF_F_LRO; eth->netdev[id]->vlan_features = eth->soc->hw_features & diff --git a/target/linux/generic/backport-6.1/750-v6.5-01-net-ethernet-mtk_ppe-add-MTK_FOE_ENTRY_V-1-2-_SIZE-m.patch b/target/linux/generic/backport-6.1/750-v6.5-01-net-ethernet-mtk_ppe-add-MTK_FOE_ENTRY_V-1-2-_SIZE-m.patch index aceeaa9fe56fd2..a0b9b6a299bc21 100644 --- a/target/linux/generic/backport-6.1/750-v6.5-01-net-ethernet-mtk_ppe-add-MTK_FOE_ENTRY_V-1-2-_SIZE-m.patch +++ b/target/linux/generic/backport-6.1/750-v6.5-01-net-ethernet-mtk_ppe-add-MTK_FOE_ENTRY_V-1-2-_SIZE-m.patch @@ -17,7 +17,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -4763,7 +4763,7 @@ static const struct mtk_soc_data mt7621_ +@@ -4766,7 +4766,7 @@ static const struct mtk_soc_data mt7621_ .required_pctl = false, .offload_version = 1, .hash_offset = 2, @@ -26,7 +26,7 @@ Signed-off-by: David S. Miller .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), -@@ -4784,7 +4784,7 @@ static const struct mtk_soc_data mt7622_ +@@ -4787,7 +4787,7 @@ static const struct mtk_soc_data mt7622_ .offload_version = 2, .hash_offset = 2, .has_accounting = true, @@ -35,7 +35,7 @@ Signed-off-by: David S. Miller .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), -@@ -4803,7 +4803,7 @@ static const struct mtk_soc_data mt7623_ +@@ -4806,7 +4806,7 @@ static const struct mtk_soc_data mt7623_ .required_pctl = true, .offload_version = 1, .hash_offset = 2, @@ -44,7 +44,7 @@ Signed-off-by: David S. Miller .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), -@@ -4841,8 +4841,8 @@ static const struct mtk_soc_data mt7981_ +@@ -4844,8 +4844,8 @@ static const struct mtk_soc_data mt7981_ .required_pctl = false, .offload_version = 2, .hash_offset = 4, @@ -54,7 +54,7 @@ Signed-off-by: David S. Miller .txrx = { .txd_size = sizeof(struct mtk_tx_dma_v2), .rxd_size = sizeof(struct mtk_rx_dma_v2), -@@ -4862,8 +4862,8 @@ static const struct mtk_soc_data mt7986_ +@@ -4865,8 +4865,8 @@ static const struct mtk_soc_data mt7986_ .required_pctl = false, .offload_version = 2, .hash_offset = 4, diff --git a/target/linux/generic/backport-6.1/750-v6.5-02-net-ethernet-mtk_eth_soc-remove-incorrect-PLL-config.patch b/target/linux/generic/backport-6.1/750-v6.5-02-net-ethernet-mtk_eth_soc-remove-incorrect-PLL-config.patch index ae56a99e8386d4..8914e8da96d87c 100644 --- a/target/linux/generic/backport-6.1/750-v6.5-02-net-ethernet-mtk_eth_soc-remove-incorrect-PLL-config.patch +++ b/target/linux/generic/backport-6.1/750-v6.5-02-net-ethernet-mtk_eth_soc-remove-incorrect-PLL-config.patch @@ -95,7 +95,7 @@ Signed-off-by: Paolo Abeni /* mt7623_pad_clk_setup */ for (i = 0 ; i < NUM_TRGMII_CTRL; i++) -@@ -4340,13 +4312,19 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4343,13 +4315,19 @@ static int mtk_add_mac(struct mtk_eth *e mac->phylink_config.mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE | MAC_10 | MAC_100 | MAC_1000 | MAC_2500FD; @@ -121,7 +121,7 @@ Signed-off-by: Paolo Abeni if (MTK_HAS_CAPS(mac->hw->soc->caps, MTK_TRGMII) && !mac->id) __set_bit(PHY_INTERFACE_MODE_TRGMII, -@@ -4804,6 +4782,7 @@ static const struct mtk_soc_data mt7623_ +@@ -4807,6 +4785,7 @@ static const struct mtk_soc_data mt7623_ .offload_version = 1, .hash_offset = 2, .foe_entry_size = MTK_FOE_ENTRY_V1_SIZE, diff --git a/target/linux/generic/backport-6.1/750-v6.5-03-net-ethernet-mtk_eth_soc-remove-mac_pcs_get_state-an.patch b/target/linux/generic/backport-6.1/750-v6.5-03-net-ethernet-mtk_eth_soc-remove-mac_pcs_get_state-an.patch index 2893a073fdeb9a..351568f187ca9c 100644 --- a/target/linux/generic/backport-6.1/750-v6.5-03-net-ethernet-mtk_eth_soc-remove-mac_pcs_get_state-an.patch +++ b/target/linux/generic/backport-6.1/750-v6.5-03-net-ethernet-mtk_eth_soc-remove-mac_pcs_get_state-an.patch @@ -70,7 +70,7 @@ Signed-off-by: Paolo Abeni .mac_config = mtk_mac_config, .mac_finish = mtk_mac_finish, .mac_link_down = mtk_mac_link_down, -@@ -4307,8 +4274,6 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4310,8 +4277,6 @@ static int mtk_add_mac(struct mtk_eth *e mac->phylink_config.dev = ð->netdev[id]->dev; mac->phylink_config.type = PHYLINK_NETDEV; diff --git a/target/linux/generic/backport-6.1/750-v6.5-05-net-ethernet-mtk_eth_soc-add-version-in-mtk_soc_data.patch b/target/linux/generic/backport-6.1/750-v6.5-05-net-ethernet-mtk_eth_soc-add-version-in-mtk_soc_data.patch index 9151702d01b439..f4795223394283 100644 --- a/target/linux/generic/backport-6.1/750-v6.5-05-net-ethernet-mtk_eth_soc-add-version-in-mtk_soc_data.patch +++ b/target/linux/generic/backport-6.1/750-v6.5-05-net-ethernet-mtk_eth_soc-add-version-in-mtk_soc_data.patch @@ -132,7 +132,7 @@ Signed-off-by: Jakub Kicinski rxd->rxd5 = 0; rxd->rxd6 = 0; rxd->rxd7 = 0; -@@ -3023,7 +3023,7 @@ static int mtk_start_dma(struct mtk_eth +@@ -3026,7 +3026,7 @@ static int mtk_start_dma(struct mtk_eth MTK_TX_BT_32DWORDS | MTK_NDP_CO_PRO | MTK_RX_2B_OFFSET | MTK_TX_WB_DDONE; @@ -141,7 +141,7 @@ Signed-off-by: Jakub Kicinski val |= MTK_MUTLI_CNT | MTK_RESV_BUF | MTK_WCOMP_EN | MTK_DMAD_WR_WDONE | MTK_CHK_DDONE_EN | MTK_LEAKY_BUCKET_EN; -@@ -3165,7 +3165,7 @@ static int mtk_open(struct net_device *d +@@ -3168,7 +3168,7 @@ static int mtk_open(struct net_device *d phylink_start(mac->phylink); netif_tx_start_all_queues(dev); @@ -150,7 +150,7 @@ Signed-off-by: Jakub Kicinski return 0; if (mtk_uses_dsa(dev) && !eth->prog) { -@@ -3430,7 +3430,7 @@ static void mtk_hw_reset(struct mtk_eth +@@ -3433,7 +3433,7 @@ static void mtk_hw_reset(struct mtk_eth { u32 val; @@ -159,7 +159,7 @@ Signed-off-by: Jakub Kicinski regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN, 0); val = RSTCTRL_PPE0_V2; } else { -@@ -3442,7 +3442,7 @@ static void mtk_hw_reset(struct mtk_eth +@@ -3445,7 +3445,7 @@ static void mtk_hw_reset(struct mtk_eth ethsys_reset(eth, RSTCTRL_ETH | RSTCTRL_FE | val); @@ -168,7 +168,7 @@ Signed-off-by: Jakub Kicinski regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN, 0x3ffffff); } -@@ -3468,7 +3468,7 @@ static void mtk_hw_warm_reset(struct mtk +@@ -3471,7 +3471,7 @@ static void mtk_hw_warm_reset(struct mtk return; } @@ -177,7 +177,7 @@ Signed-off-by: Jakub Kicinski rst_mask = RSTCTRL_ETH | RSTCTRL_PPE0_V2; else rst_mask = RSTCTRL_ETH | RSTCTRL_PPE0; -@@ -3638,7 +3638,7 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3641,7 +3641,7 @@ static int mtk_hw_init(struct mtk_eth *e else mtk_hw_reset(eth); @@ -186,7 +186,7 @@ Signed-off-by: Jakub Kicinski /* Set FE to PDMAv2 if necessary */ val = mtk_r32(eth, MTK_FE_GLO_MISC); mtk_w32(eth, val | BIT(4), MTK_FE_GLO_MISC); -@@ -3675,7 +3675,7 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3678,7 +3678,7 @@ static int mtk_hw_init(struct mtk_eth *e */ val = mtk_r32(eth, MTK_CDMQ_IG_CTRL); mtk_w32(eth, val | MTK_CDMQ_STAG_EN, MTK_CDMQ_IG_CTRL); @@ -195,7 +195,7 @@ Signed-off-by: Jakub Kicinski val = mtk_r32(eth, MTK_CDMP_IG_CTRL); mtk_w32(eth, val | MTK_CDMP_STAG_EN, MTK_CDMP_IG_CTRL); -@@ -3697,7 +3697,7 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3700,7 +3700,7 @@ static int mtk_hw_init(struct mtk_eth *e mtk_w32(eth, eth->soc->txrx.rx_irq_done_mask, reg_map->qdma.int_grp + 4); mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP); @@ -204,7 +204,7 @@ Signed-off-by: Jakub Kicinski /* PSE should not drop port8 and port9 packets from WDMA Tx */ mtk_w32(eth, 0x00000300, PSE_DROP_CFG); -@@ -4486,7 +4486,7 @@ static int mtk_probe(struct platform_dev +@@ -4489,7 +4489,7 @@ static int mtk_probe(struct platform_dev } } @@ -213,7 +213,7 @@ Signed-off-by: Jakub Kicinski res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { err = -EINVAL; -@@ -4594,9 +4594,8 @@ static int mtk_probe(struct platform_dev +@@ -4597,9 +4597,8 @@ static int mtk_probe(struct platform_dev } if (eth->soc->offload_version) { @@ -224,7 +224,7 @@ Signed-off-by: Jakub Kicinski num_ppe = min_t(u32, ARRAY_SIZE(eth->ppe), num_ppe); for (i = 0; i < num_ppe; i++) { u32 ppe_addr = eth->soc->reg_map->ppe_base + i * 0x400; -@@ -4688,6 +4687,7 @@ static const struct mtk_soc_data mt2701_ +@@ -4691,6 +4690,7 @@ static const struct mtk_soc_data mt2701_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7623_CLKS_BITMAP, .required_pctl = true, @@ -232,7 +232,7 @@ Signed-off-by: Jakub Kicinski .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), -@@ -4704,6 +4704,7 @@ static const struct mtk_soc_data mt7621_ +@@ -4707,6 +4707,7 @@ static const struct mtk_soc_data mt7621_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7621_CLKS_BITMAP, .required_pctl = false, @@ -240,7 +240,7 @@ Signed-off-by: Jakub Kicinski .offload_version = 1, .hash_offset = 2, .foe_entry_size = MTK_FOE_ENTRY_V1_SIZE, -@@ -4724,6 +4725,7 @@ static const struct mtk_soc_data mt7622_ +@@ -4727,6 +4728,7 @@ static const struct mtk_soc_data mt7622_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7622_CLKS_BITMAP, .required_pctl = false, @@ -248,7 +248,7 @@ Signed-off-by: Jakub Kicinski .offload_version = 2, .hash_offset = 2, .has_accounting = true, -@@ -4744,6 +4746,7 @@ static const struct mtk_soc_data mt7623_ +@@ -4747,6 +4749,7 @@ static const struct mtk_soc_data mt7623_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7623_CLKS_BITMAP, .required_pctl = true, @@ -256,7 +256,7 @@ Signed-off-by: Jakub Kicinski .offload_version = 1, .hash_offset = 2, .foe_entry_size = MTK_FOE_ENTRY_V1_SIZE, -@@ -4766,6 +4769,7 @@ static const struct mtk_soc_data mt7629_ +@@ -4769,6 +4772,7 @@ static const struct mtk_soc_data mt7629_ .required_clks = MT7629_CLKS_BITMAP, .required_pctl = false, .has_accounting = true, @@ -264,7 +264,7 @@ Signed-off-by: Jakub Kicinski .txrx = { .txd_size = sizeof(struct mtk_tx_dma), .rxd_size = sizeof(struct mtk_rx_dma), -@@ -4783,6 +4787,7 @@ static const struct mtk_soc_data mt7981_ +@@ -4786,6 +4790,7 @@ static const struct mtk_soc_data mt7981_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7981_CLKS_BITMAP, .required_pctl = false, @@ -272,7 +272,7 @@ Signed-off-by: Jakub Kicinski .offload_version = 2, .hash_offset = 4, .has_accounting = true, -@@ -4804,6 +4809,7 @@ static const struct mtk_soc_data mt7986_ +@@ -4807,6 +4812,7 @@ static const struct mtk_soc_data mt7986_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7986_CLKS_BITMAP, .required_pctl = false, @@ -280,7 +280,7 @@ Signed-off-by: Jakub Kicinski .offload_version = 2, .hash_offset = 4, .has_accounting = true, -@@ -4824,6 +4830,7 @@ static const struct mtk_soc_data rt5350_ +@@ -4827,6 +4833,7 @@ static const struct mtk_soc_data rt5350_ .hw_features = MTK_HW_FEATURES_MT7628, .required_clks = MT7628_CLKS_BITMAP, .required_pctl = false, diff --git a/target/linux/generic/backport-6.1/750-v6.5-07-net-ethernet-mtk_eth_soc-rely-on-MTK_MAX_DEVS-and-re.patch b/target/linux/generic/backport-6.1/750-v6.5-07-net-ethernet-mtk_eth_soc-rely-on-MTK_MAX_DEVS-and-re.patch index d7ba0d4a5729ea..5ac9d61ab424a7 100644 --- a/target/linux/generic/backport-6.1/750-v6.5-07-net-ethernet-mtk_eth_soc-rely-on-MTK_MAX_DEVS-and-re.patch +++ b/target/linux/generic/backport-6.1/750-v6.5-07-net-ethernet-mtk_eth_soc-rely-on-MTK_MAX_DEVS-and-re.patch @@ -53,7 +53,7 @@ Signed-off-by: Jakub Kicinski !eth->netdev[mac])) goto release_desc; -@@ -2897,7 +2897,7 @@ static void mtk_dma_free(struct mtk_eth +@@ -2900,7 +2900,7 @@ static void mtk_dma_free(struct mtk_eth const struct mtk_soc_data *soc = eth->soc; int i; @@ -62,7 +62,7 @@ Signed-off-by: Jakub Kicinski if (eth->netdev[i]) netdev_reset_queue(eth->netdev[i]); if (eth->scratch_ring) { -@@ -3051,8 +3051,13 @@ static void mtk_gdm_config(struct mtk_et +@@ -3054,8 +3054,13 @@ static void mtk_gdm_config(struct mtk_et if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) return; @@ -78,7 +78,7 @@ Signed-off-by: Jakub Kicinski /* default setup the forward port to send frame to PDMA */ val &= ~0xffff; -@@ -3062,7 +3067,7 @@ static void mtk_gdm_config(struct mtk_et +@@ -3065,7 +3070,7 @@ static void mtk_gdm_config(struct mtk_et val |= config; @@ -87,7 +87,7 @@ Signed-off-by: Jakub Kicinski val |= MTK_GDMA_SPECIAL_TAG; mtk_w32(eth, val, MTK_GDMA_FWD_CFG(i)); -@@ -3659,15 +3664,15 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3662,15 +3667,15 @@ static int mtk_hw_init(struct mtk_eth *e * up with the more appropriate value when mtk_mac_config call is being * invoked. */ @@ -109,7 +109,7 @@ Signed-off-by: Jakub Kicinski } /* Indicates CDM to parse the MTK special tag from CPU -@@ -3847,7 +3852,7 @@ static void mtk_pending_work(struct work +@@ -3850,7 +3855,7 @@ static void mtk_pending_work(struct work mtk_prepare_for_reset(eth); /* stop all devices to make sure that dma is properly shut down */ @@ -118,7 +118,7 @@ Signed-off-by: Jakub Kicinski if (!eth->netdev[i] || !netif_running(eth->netdev[i])) continue; -@@ -3863,8 +3868,8 @@ static void mtk_pending_work(struct work +@@ -3866,8 +3871,8 @@ static void mtk_pending_work(struct work mtk_hw_init(eth, true); /* restart DMA and enable IRQs */ @@ -129,7 +129,7 @@ Signed-off-by: Jakub Kicinski continue; if (mtk_open(eth->netdev[i])) { -@@ -3891,7 +3896,7 @@ static int mtk_free_dev(struct mtk_eth * +@@ -3894,7 +3899,7 @@ static int mtk_free_dev(struct mtk_eth * { int i; @@ -138,7 +138,7 @@ Signed-off-by: Jakub Kicinski if (!eth->netdev[i]) continue; free_netdev(eth->netdev[i]); -@@ -3910,7 +3915,7 @@ static int mtk_unreg_dev(struct mtk_eth +@@ -3913,7 +3918,7 @@ static int mtk_unreg_dev(struct mtk_eth { int i; @@ -147,7 +147,7 @@ Signed-off-by: Jakub Kicinski struct mtk_mac *mac; if (!eth->netdev[i]) continue; -@@ -4211,7 +4216,7 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4214,7 +4219,7 @@ static int mtk_add_mac(struct mtk_eth *e } id = be32_to_cpup(_id); @@ -156,7 +156,7 @@ Signed-off-by: Jakub Kicinski dev_err(eth->dev, "%d is not a valid mac id\n", id); return -EINVAL; } -@@ -4356,7 +4361,7 @@ void mtk_eth_set_dma_device(struct mtk_e +@@ -4359,7 +4364,7 @@ void mtk_eth_set_dma_device(struct mtk_e rtnl_lock(); @@ -165,7 +165,7 @@ Signed-off-by: Jakub Kicinski dev = eth->netdev[i]; if (!dev || !(dev->flags & IFF_UP)) -@@ -4662,7 +4667,7 @@ static int mtk_remove(struct platform_de +@@ -4665,7 +4670,7 @@ static int mtk_remove(struct platform_de int i; /* stop all devices to make sure that dma is properly shut down */ diff --git a/target/linux/generic/backport-6.1/750-v6.5-08-net-ethernet-mtk_eth_soc-add-NETSYS_V3-version-suppo.patch b/target/linux/generic/backport-6.1/750-v6.5-08-net-ethernet-mtk_eth_soc-add-NETSYS_V3-version-suppo.patch index f06fcce618b9e5..bf6ef4c1370676 100644 --- a/target/linux/generic/backport-6.1/750-v6.5-08-net-ethernet-mtk_eth_soc-add-NETSYS_V3-version-suppo.patch +++ b/target/linux/generic/backport-6.1/750-v6.5-08-net-ethernet-mtk_eth_soc-add-NETSYS_V3-version-suppo.patch @@ -167,7 +167,7 @@ Signed-off-by: Jakub Kicinski budget--; } -@@ -3702,7 +3730,24 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -3705,7 +3733,24 @@ static int mtk_hw_init(struct mtk_eth *e mtk_w32(eth, eth->soc->txrx.rx_irq_done_mask, reg_map->qdma.int_grp + 4); mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP); @@ -193,7 +193,7 @@ Signed-off-by: Jakub Kicinski /* PSE should not drop port8 and port9 packets from WDMA Tx */ mtk_w32(eth, 0x00000300, PSE_DROP_CFG); -@@ -4264,7 +4309,11 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4267,7 +4312,11 @@ static int mtk_add_mac(struct mtk_eth *e } spin_lock_init(&mac->hw_stats->stats_lock); u64_stats_init(&mac->hw_stats->syncp); diff --git a/target/linux/generic/backport-6.1/750-v6.5-11-net-ethernet-mtk_eth_soc-add-basic-support-for-MT798.patch b/target/linux/generic/backport-6.1/750-v6.5-11-net-ethernet-mtk_eth_soc-add-basic-support-for-MT798.patch index a7195236c38735..97a2992cfedc7c 100644 --- a/target/linux/generic/backport-6.1/750-v6.5-11-net-ethernet-mtk_eth_soc-add-basic-support-for-MT798.patch +++ b/target/linux/generic/backport-6.1/750-v6.5-11-net-ethernet-mtk_eth_soc-add-basic-support-for-MT798.patch @@ -263,7 +263,7 @@ Signed-off-by: Jakub Kicinski data |= TX_DMA_SWC_V2 | QID_BITS_V2(info->qid); WRITE_ONCE(desc->txd4, data); -@@ -4358,6 +4487,17 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4361,6 +4490,17 @@ static int mtk_add_mac(struct mtk_eth *e mac->phylink_config.supported_interfaces); } @@ -281,7 +281,7 @@ Signed-off-by: Jakub Kicinski phylink = phylink_create(&mac->phylink_config, of_fwnode_handle(mac->of_node), phy_mode, &mtk_phylink_ops); -@@ -4878,6 +5018,24 @@ static const struct mtk_soc_data mt7986_ +@@ -4881,6 +5021,24 @@ static const struct mtk_soc_data mt7986_ }, }; @@ -306,7 +306,7 @@ Signed-off-by: Jakub Kicinski static const struct mtk_soc_data rt5350_data = { .reg_map = &mt7628_reg_map, .caps = MT7628_CAPS, -@@ -4896,14 +5054,15 @@ static const struct mtk_soc_data rt5350_ +@@ -4899,14 +5057,15 @@ static const struct mtk_soc_data rt5350_ }; const struct of_device_id of_mtk_match[] = { diff --git a/target/linux/generic/backport-6.1/750-v6.5-13-net-ethernet-mtk_eth_soc-enable-nft-hw-flowtable_off.patch b/target/linux/generic/backport-6.1/750-v6.5-13-net-ethernet-mtk_eth_soc-enable-nft-hw-flowtable_off.patch index 49f4bd6a9d344c..b175aedf0c43e2 100644 --- a/target/linux/generic/backport-6.1/750-v6.5-13-net-ethernet-mtk_eth_soc-enable-nft-hw-flowtable_off.patch +++ b/target/linux/generic/backport-6.1/750-v6.5-13-net-ethernet-mtk_eth_soc-enable-nft-hw-flowtable_off.patch @@ -18,7 +18,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -5026,6 +5026,9 @@ static const struct mtk_soc_data mt7988_ +@@ -5029,6 +5029,9 @@ static const struct mtk_soc_data mt7988_ .required_clks = MT7988_CLKS_BITMAP, .required_pctl = false, .version = 3, diff --git a/target/linux/generic/backport-6.1/750-v6.5-14-net-ethernet-mtk_eth_soc-support-per-flow-accounting.patch b/target/linux/generic/backport-6.1/750-v6.5-14-net-ethernet-mtk_eth_soc-support-per-flow-accounting.patch index 88987d7bc943da..bf0a39b9d3fda8 100644 --- a/target/linux/generic/backport-6.1/750-v6.5-14-net-ethernet-mtk_eth_soc-support-per-flow-accounting.patch +++ b/target/linux/generic/backport-6.1/750-v6.5-14-net-ethernet-mtk_eth_soc-support-per-flow-accounting.patch @@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -5028,6 +5028,7 @@ static const struct mtk_soc_data mt7988_ +@@ -5031,6 +5031,7 @@ static const struct mtk_soc_data mt7988_ .version = 3, .offload_version = 2, .hash_offset = 4, diff --git a/target/linux/generic/backport-6.1/750-v6.5-17-net-ethernet-mtk_eth_soc-add-reset-bits-for-MT7988.patch b/target/linux/generic/backport-6.1/750-v6.5-17-net-ethernet-mtk_eth_soc-add-reset-bits-for-MT7988.patch index b94ca7ebc5a460..a4ff5a292e7d8e 100644 --- a/target/linux/generic/backport-6.1/750-v6.5-17-net-ethernet-mtk_eth_soc-add-reset-bits-for-MT7988.patch +++ b/target/linux/generic/backport-6.1/750-v6.5-17-net-ethernet-mtk_eth_soc-add-reset-bits-for-MT7988.patch @@ -16,7 +16,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3592,19 +3592,34 @@ static void mtk_hw_reset(struct mtk_eth +@@ -3595,19 +3595,34 @@ static void mtk_hw_reset(struct mtk_eth { u32 val; @@ -56,7 +56,7 @@ Signed-off-by: Jakub Kicinski regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN, 0x3ffffff); } -@@ -3630,13 +3645,21 @@ static void mtk_hw_warm_reset(struct mtk +@@ -3633,13 +3648,21 @@ static void mtk_hw_warm_reset(struct mtk return; } @@ -83,7 +83,7 @@ Signed-off-by: Jakub Kicinski regmap_update_bits(eth->ethsys, ETHSYS_RSTCTRL, rst_mask, rst_mask); -@@ -3988,11 +4011,17 @@ static void mtk_prepare_for_reset(struct +@@ -3991,11 +4014,17 @@ static void mtk_prepare_for_reset(struct u32 val; int i; @@ -106,7 +106,7 @@ Signed-off-by: Jakub Kicinski /* adjust PPE configurations to prepare for reset */ for (i = 0; i < ARRAY_SIZE(eth->ppe); i++) -@@ -4053,11 +4082,18 @@ static void mtk_pending_work(struct work +@@ -4056,11 +4085,18 @@ static void mtk_pending_work(struct work } } diff --git a/target/linux/generic/backport-6.1/750-v6.5-18-net-ethernet-mtk_eth_soc-add-support-for-in-SoC-SRAM.patch b/target/linux/generic/backport-6.1/750-v6.5-18-net-ethernet-mtk_eth_soc-add-support-for-in-SoC-SRAM.patch index 43fbffc51b8783..872262b0f82a80 100644 --- a/target/linux/generic/backport-6.1/750-v6.5-18-net-ethernet-mtk_eth_soc-add-support-for-in-SoC-SRAM.patch +++ b/target/linux/generic/backport-6.1/750-v6.5-18-net-ethernet-mtk_eth_soc-add-support-for-in-SoC-SRAM.patch @@ -123,7 +123,7 @@ Signed-off-by: Jakub Kicinski dma_free_coherent(eth->dma_dev, ring->dma_size * eth->soc->txrx.rxd_size, ring->dma, ring->phys); -@@ -3057,7 +3081,7 @@ static void mtk_dma_free(struct mtk_eth +@@ -3060,7 +3084,7 @@ static void mtk_dma_free(struct mtk_eth for (i = 0; i < MTK_MAX_DEVS; i++) if (eth->netdev[i]) netdev_reset_queue(eth->netdev[i]); @@ -132,7 +132,7 @@ Signed-off-by: Jakub Kicinski dma_free_coherent(eth->dma_dev, MTK_QDMA_RING_SIZE * soc->txrx.txd_size, eth->scratch_ring, eth->phy_scratch_ring); -@@ -3065,13 +3089,13 @@ static void mtk_dma_free(struct mtk_eth +@@ -3068,13 +3092,13 @@ static void mtk_dma_free(struct mtk_eth eth->phy_scratch_ring = 0; } mtk_tx_clean(eth); @@ -149,7 +149,7 @@ Signed-off-by: Jakub Kicinski } kfree(eth->scratch_head); -@@ -4639,7 +4663,7 @@ static int mtk_sgmii_init(struct mtk_eth +@@ -4642,7 +4666,7 @@ static int mtk_sgmii_init(struct mtk_eth static int mtk_probe(struct platform_device *pdev) { @@ -158,7 +158,7 @@ Signed-off-by: Jakub Kicinski struct device_node *mac_np; struct mtk_eth *eth; int err, i; -@@ -4659,6 +4683,20 @@ static int mtk_probe(struct platform_dev +@@ -4662,6 +4686,20 @@ static int mtk_probe(struct platform_dev if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) eth->ip_align = NET_IP_ALIGN; @@ -179,7 +179,7 @@ Signed-off-by: Jakub Kicinski spin_lock_init(ð->page_lock); spin_lock_init(ð->tx_irq_lock); spin_lock_init(ð->rx_irq_lock); -@@ -4722,6 +4760,18 @@ static int mtk_probe(struct platform_dev +@@ -4725,6 +4763,18 @@ static int mtk_probe(struct platform_dev err = -EINVAL; goto err_destroy_sgmii; } diff --git a/target/linux/generic/backport-6.1/750-v6.5-19-net-ethernet-mtk_eth_soc-support-36-bit-DMA-addressi.patch b/target/linux/generic/backport-6.1/750-v6.5-19-net-ethernet-mtk_eth_soc-support-36-bit-DMA-addressi.patch index 3933997003adee..9266c33f825545 100644 --- a/target/linux/generic/backport-6.1/750-v6.5-19-net-ethernet-mtk_eth_soc-support-36-bit-DMA-addressi.patch +++ b/target/linux/generic/backport-6.1/750-v6.5-19-net-ethernet-mtk_eth_soc-support-36-bit-DMA-addressi.patch @@ -90,7 +90,7 @@ Signed-off-by: Jakub Kicinski ring->buf_size, DMA_FROM_DEVICE); mtk_rx_put_buff(ring, ring->data[i], false); } -@@ -4697,6 +4715,14 @@ static int mtk_probe(struct platform_dev +@@ -4700,6 +4718,14 @@ static int mtk_probe(struct platform_dev } } diff --git a/target/linux/generic/backport-6.1/807-v6.5-01-net-dsa-mv88e6xxx-pass-directly-chip-structure-to-mv.patch b/target/linux/generic/backport-6.1/807-v6.5-01-net-dsa-mv88e6xxx-pass-directly-chip-structure-to-mv.patch new file mode 100644 index 00000000000000..58777cd280be9f --- /dev/null +++ b/target/linux/generic/backport-6.1/807-v6.5-01-net-dsa-mv88e6xxx-pass-directly-chip-structure-to-mv.patch @@ -0,0 +1,64 @@ +From 4f86eb098e18fd0f032877dfa1a7e8c1503ca409 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alexis=20Lothor=C3=A9?= +Date: Mon, 29 May 2023 10:02:41 +0200 +Subject: [PATCH 1/6] net: dsa: mv88e6xxx: pass directly chip structure to + mv88e6xxx_phy_is_internal +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Since this function is a simple helper, we do not need to pass a full +dsa_switch structure, we can directly pass the mv88e6xxx_chip structure. +Doing so will allow to share this function with any other function +not manipulating dsa_switch structure but needing info about number of +internal phys + +Signed-off-by: Alexis Lothoré +Reviewed-by: Russell King (Oracle) +Reviewed-by: Florian Fainelli +Signed-off-by: Jakub Kicinski +--- + drivers/net/dsa/mv88e6xxx/chip.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +--- a/drivers/net/dsa/mv88e6xxx/chip.c ++++ b/drivers/net/dsa/mv88e6xxx/chip.c +@@ -470,10 +470,8 @@ restore_link: + return err; + } + +-static int mv88e6xxx_phy_is_internal(struct dsa_switch *ds, int port) ++static int mv88e6xxx_phy_is_internal(struct mv88e6xxx_chip *chip, int port) + { +- struct mv88e6xxx_chip *chip = ds->priv; +- + return port < chip->info->num_internal_phys; + } + +@@ -591,7 +589,7 @@ static void mv88e6095_phylink_get_caps(s + + config->mac_capabilities = MAC_SYM_PAUSE | MAC_10 | MAC_100; + +- if (mv88e6xxx_phy_is_internal(chip->ds, port)) { ++ if (mv88e6xxx_phy_is_internal(chip, port)) { + __set_bit(PHY_INTERFACE_MODE_MII, config->supported_interfaces); + } else { + if (cmode < ARRAY_SIZE(mv88e6185_phy_interface_modes) && +@@ -839,7 +837,7 @@ static void mv88e6xxx_get_caps(struct ds + chip->info->ops->phylink_get_caps(chip, port, config); + mv88e6xxx_reg_unlock(chip); + +- if (mv88e6xxx_phy_is_internal(ds, port)) { ++ if (mv88e6xxx_phy_is_internal(chip, port)) { + __set_bit(PHY_INTERFACE_MODE_INTERNAL, + config->supported_interfaces); + /* Internal ports with no phy-mode need GMII for PHYLIB */ +@@ -860,7 +858,7 @@ static void mv88e6xxx_mac_config(struct + + mv88e6xxx_reg_lock(chip); + +- if (mode != MLO_AN_PHY || !mv88e6xxx_phy_is_internal(ds, port)) { ++ if (mode != MLO_AN_PHY || !mv88e6xxx_phy_is_internal(chip, port)) { + /* In inband mode, the link may come up at any time while the + * link is not forced down. Force the link down while we + * reconfigure the interface mode. diff --git a/target/linux/generic/backport-6.1/807-v6.5-02-net-dsa-mv88e6xxx-use-mv88e6xxx_phy_is_internal-in-m.patch b/target/linux/generic/backport-6.1/807-v6.5-02-net-dsa-mv88e6xxx-use-mv88e6xxx_phy_is_internal-in-m.patch new file mode 100644 index 00000000000000..75a21a931d5e78 --- /dev/null +++ b/target/linux/generic/backport-6.1/807-v6.5-02-net-dsa-mv88e6xxx-use-mv88e6xxx_phy_is_internal-in-m.patch @@ -0,0 +1,31 @@ +From 73cbfad9296eed004992806e056db5b48583ca41 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alexis=20Lothor=C3=A9?= +Date: Mon, 29 May 2023 10:02:42 +0200 +Subject: [PATCH 2/6] net: dsa: mv88e6xxx: use mv88e6xxx_phy_is_internal in + mv88e6xxx_port_ppu_updates +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Make sure to use existing helper to get internal PHYs count instead of +redoing it manually + +Signed-off-by: Alexis Lothoré +Reviewed-by: Russell King (Oracle) +Reviewed-by: Florian Fainelli +Signed-off-by: Jakub Kicinski +--- + drivers/net/dsa/mv88e6xxx/chip.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/dsa/mv88e6xxx/chip.c ++++ b/drivers/net/dsa/mv88e6xxx/chip.c +@@ -484,7 +484,7 @@ static int mv88e6xxx_port_ppu_updates(st + * report whether the port is internal. + */ + if (chip->info->family == MV88E6XXX_FAMILY_6250) +- return port < chip->info->num_internal_phys; ++ return mv88e6xxx_phy_is_internal(chip, port); + + err = mv88e6xxx_port_read(chip, port, MV88E6XXX_PORT_STS, ®); + if (err) { diff --git a/target/linux/generic/backport-6.1/807-v6.5-03-net-dsa-mv88e6xxx-add-field-to-specify-internal-phys.patch b/target/linux/generic/backport-6.1/807-v6.5-03-net-dsa-mv88e6xxx-add-field-to-specify-internal-phys.patch new file mode 100644 index 00000000000000..e24dca819b10d3 --- /dev/null +++ b/target/linux/generic/backport-6.1/807-v6.5-03-net-dsa-mv88e6xxx-add-field-to-specify-internal-phys.patch @@ -0,0 +1,69 @@ +From 1414d30660d201f515a9d877571ceea9ca190b6a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alexis=20Lothor=C3=A9?= +Date: Mon, 29 May 2023 10:02:43 +0200 +Subject: [PATCH 3/6] net: dsa: mv88e6xxx: add field to specify internal phys + layout +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +mv88e6xxx currently assumes that switch equipped with internal phys have +those phys mapped contiguously starting from port 0 (see +mv88e6xxx_phy_is_internal). However, some switches have internal PHYs but +NOT starting from port 0. For example 88e6393X, 88E6193X and 88E6191X have +integrated PHYs available on ports 1 to 8 +To properly support this offset, add a new field to allow specifying an +internal PHYs layout. If field is not set, default layout is assumed (start +at port 0) + +Signed-off-by: Alexis Lothoré +Reviewed-by: Andrew Lunn +Signed-off-by: Jakub Kicinski +--- + drivers/net/dsa/mv88e6xxx/chip.c | 4 +++- + drivers/net/dsa/mv88e6xxx/chip.h | 5 +++++ + drivers/net/dsa/mv88e6xxx/global2.c | 5 ++++- + 3 files changed, 12 insertions(+), 2 deletions(-) + +--- a/drivers/net/dsa/mv88e6xxx/chip.c ++++ b/drivers/net/dsa/mv88e6xxx/chip.c +@@ -472,7 +472,9 @@ restore_link: + + static int mv88e6xxx_phy_is_internal(struct mv88e6xxx_chip *chip, int port) + { +- return port < chip->info->num_internal_phys; ++ return port >= chip->info->internal_phys_offset && ++ port < chip->info->num_internal_phys + ++ chip->info->internal_phys_offset; + } + + static int mv88e6xxx_port_ppu_updates(struct mv88e6xxx_chip *chip, int port) +--- a/drivers/net/dsa/mv88e6xxx/chip.h ++++ b/drivers/net/dsa/mv88e6xxx/chip.h +@@ -167,6 +167,11 @@ struct mv88e6xxx_info { + + /* Supports PTP */ + bool ptp_support; ++ ++ /* Internal PHY start index. 0 means that internal PHYs range starts at ++ * port 0, 1 means internal PHYs range starts at port 1, etc ++ */ ++ unsigned int internal_phys_offset; + }; + + struct mv88e6xxx_atu_entry { +--- a/drivers/net/dsa/mv88e6xxx/global2.c ++++ b/drivers/net/dsa/mv88e6xxx/global2.c +@@ -1185,8 +1185,11 @@ int mv88e6xxx_g2_irq_mdio_setup(struct m + struct mii_bus *bus) + { + int phy, irq, err, err_phy; ++ int phy_start = chip->info->internal_phys_offset; ++ int phy_end = chip->info->internal_phys_offset + ++ chip->info->num_internal_phys; + +- for (phy = 0; phy < chip->info->num_internal_phys; phy++) { ++ for (phy = phy_start; phy < phy_end; phy++) { + irq = irq_find_mapping(chip->g2_irq.domain, phy); + if (irq < 0) { + err = irq; diff --git a/target/linux/generic/backport-6.1/807-v6.5-04-net-dsa-mv88e6xxx-fix-88E6393X-family-internal-phys-.patch b/target/linux/generic/backport-6.1/807-v6.5-04-net-dsa-mv88e6xxx-fix-88E6393X-family-internal-phys-.patch new file mode 100644 index 00000000000000..b7db7fb1bc4183 --- /dev/null +++ b/target/linux/generic/backport-6.1/807-v6.5-04-net-dsa-mv88e6xxx-fix-88E6393X-family-internal-phys-.patch @@ -0,0 +1,52 @@ +From eb8c75f82a6711387f3b9e03e28923f3e75a761b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alexis=20Lothor=C3=A9?= +Date: Mon, 29 May 2023 10:02:44 +0200 +Subject: [PATCH 4/6] net: dsa: mv88e6xxx: fix 88E6393X family internal phys + layout +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +88E6393X/88E6193X/88E6191X switches have in fact 8 internal PHYs, but those +are not present starting at port 0: supported ports go from 1 to 8 + +Signed-off-by: Alexis Lothoré +Reviewed-by: Andrew Lunn +Reviewed-by: Florian Fainelli +Signed-off-by: Jakub Kicinski +--- + drivers/net/dsa/mv88e6xxx/chip.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +--- a/drivers/net/dsa/mv88e6xxx/chip.c ++++ b/drivers/net/dsa/mv88e6xxx/chip.c +@@ -5942,7 +5942,8 @@ static const struct mv88e6xxx_info mv88e + .name = "Marvell 88E6191X", + .num_databases = 4096, + .num_ports = 11, /* 10 + Z80 */ +- .num_internal_phys = 9, ++ .num_internal_phys = 8, ++ .internal_phys_offset = 1, + .max_vid = 8191, + .max_sid = 63, + .port_base_addr = 0x0, +@@ -5965,7 +5966,8 @@ static const struct mv88e6xxx_info mv88e + .name = "Marvell 88E6193X", + .num_databases = 4096, + .num_ports = 11, /* 10 + Z80 */ +- .num_internal_phys = 9, ++ .num_internal_phys = 8, ++ .internal_phys_offset = 1, + .max_vid = 8191, + .max_sid = 63, + .port_base_addr = 0x0, +@@ -6284,7 +6286,8 @@ static const struct mv88e6xxx_info mv88e + .name = "Marvell 88E6393X", + .num_databases = 4096, + .num_ports = 11, /* 10 + Z80 */ +- .num_internal_phys = 9, ++ .num_internal_phys = 8, ++ .internal_phys_offset = 1, + .max_vid = 8191, + .max_sid = 63, + .port_base_addr = 0x0, diff --git a/target/linux/generic/backport-6.1/807-v6.5-05-net-dsa-mv88e6xxx-pass-mv88e6xxx_chip-structure-to-p.patch b/target/linux/generic/backport-6.1/807-v6.5-05-net-dsa-mv88e6xxx-pass-mv88e6xxx_chip-structure-to-p.patch new file mode 100644 index 00000000000000..92ce97b27b4e9c --- /dev/null +++ b/target/linux/generic/backport-6.1/807-v6.5-05-net-dsa-mv88e6xxx-pass-mv88e6xxx_chip-structure-to-p.patch @@ -0,0 +1,110 @@ +From cef945452c8468efce75ba0dc8420510a5b84af9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alexis=20Lothor=C3=A9?= +Date: Mon, 29 May 2023 10:02:45 +0200 +Subject: [PATCH 5/6] net: dsa: mv88e6xxx: pass mv88e6xxx_chip structure to + port_max_speed_mode +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Some switches families have minor differences on supported link speed for +ports. Instead of redefining a new port_max_speed_mode for each different +configuration, allow to pass mv88e6xxx_chip structure to allow +differentiating those chips by known chip id + +Signed-off-by: Alexis Lothoré +Reviewed-by: Florian Fainelli +Signed-off-by: Jakub Kicinski +--- + drivers/net/dsa/mv88e6xxx/chip.c | 2 +- + drivers/net/dsa/mv88e6xxx/chip.h | 3 ++- + drivers/net/dsa/mv88e6xxx/port.c | 12 ++++++++---- + drivers/net/dsa/mv88e6xxx/port.h | 12 ++++++++---- + 4 files changed, 19 insertions(+), 10 deletions(-) + +--- a/drivers/net/dsa/mv88e6xxx/chip.c ++++ b/drivers/net/dsa/mv88e6xxx/chip.c +@@ -3326,7 +3326,7 @@ static int mv88e6xxx_setup_port(struct m + caps = pl_config.mac_capabilities; + + if (chip->info->ops->port_max_speed_mode) +- mode = chip->info->ops->port_max_speed_mode(port); ++ mode = chip->info->ops->port_max_speed_mode(chip, port); + else + mode = PHY_INTERFACE_MODE_NA; + +--- a/drivers/net/dsa/mv88e6xxx/chip.h ++++ b/drivers/net/dsa/mv88e6xxx/chip.h +@@ -508,7 +508,8 @@ struct mv88e6xxx_ops { + int speed, int duplex); + + /* What interface mode should be used for maximum speed? */ +- phy_interface_t (*port_max_speed_mode)(int port); ++ phy_interface_t (*port_max_speed_mode)(struct mv88e6xxx_chip *chip, ++ int port); + + int (*port_tag_remap)(struct mv88e6xxx_chip *chip, int port); + +--- a/drivers/net/dsa/mv88e6xxx/port.c ++++ b/drivers/net/dsa/mv88e6xxx/port.c +@@ -342,7 +342,8 @@ int mv88e6341_port_set_speed_duplex(stru + duplex); + } + +-phy_interface_t mv88e6341_port_max_speed_mode(int port) ++phy_interface_t mv88e6341_port_max_speed_mode(struct mv88e6xxx_chip *chip, ++ int port) + { + if (port == 5) + return PHY_INTERFACE_MODE_2500BASEX; +@@ -381,7 +382,8 @@ int mv88e6390_port_set_speed_duplex(stru + duplex); + } + +-phy_interface_t mv88e6390_port_max_speed_mode(int port) ++phy_interface_t mv88e6390_port_max_speed_mode(struct mv88e6xxx_chip *chip, ++ int port) + { + if (port == 9 || port == 10) + return PHY_INTERFACE_MODE_2500BASEX; +@@ -403,7 +405,8 @@ int mv88e6390x_port_set_speed_duplex(str + duplex); + } + +-phy_interface_t mv88e6390x_port_max_speed_mode(int port) ++phy_interface_t mv88e6390x_port_max_speed_mode(struct mv88e6xxx_chip *chip, ++ int port) + { + if (port == 9 || port == 10) + return PHY_INTERFACE_MODE_XAUI; +@@ -500,7 +503,8 @@ int mv88e6393x_port_set_speed_duplex(str + return 0; + } + +-phy_interface_t mv88e6393x_port_max_speed_mode(int port) ++phy_interface_t mv88e6393x_port_max_speed_mode(struct mv88e6xxx_chip *chip, ++ int port) + { + if (port == 0 || port == 9 || port == 10) + return PHY_INTERFACE_MODE_10GBASER; +--- a/drivers/net/dsa/mv88e6xxx/port.h ++++ b/drivers/net/dsa/mv88e6xxx/port.h +@@ -359,10 +359,14 @@ int mv88e6390x_port_set_speed_duplex(str + int mv88e6393x_port_set_speed_duplex(struct mv88e6xxx_chip *chip, int port, + int speed, int duplex); + +-phy_interface_t mv88e6341_port_max_speed_mode(int port); +-phy_interface_t mv88e6390_port_max_speed_mode(int port); +-phy_interface_t mv88e6390x_port_max_speed_mode(int port); +-phy_interface_t mv88e6393x_port_max_speed_mode(int port); ++phy_interface_t mv88e6341_port_max_speed_mode(struct mv88e6xxx_chip *chip, ++ int port); ++phy_interface_t mv88e6390_port_max_speed_mode(struct mv88e6xxx_chip *chip, ++ int port); ++phy_interface_t mv88e6390x_port_max_speed_mode(struct mv88e6xxx_chip *chip, ++ int port); ++phy_interface_t mv88e6393x_port_max_speed_mode(struct mv88e6xxx_chip *chip, ++ int port); + + int mv88e6xxx_port_set_state(struct mv88e6xxx_chip *chip, int port, u8 state); + diff --git a/target/linux/generic/backport-6.1/807-v6.5-06-net-dsa-mv88e6xxx-enable-support-for-88E6361-switch.patch b/target/linux/generic/backport-6.1/807-v6.5-06-net-dsa-mv88e6xxx-enable-support-for-88E6361-switch.patch new file mode 100644 index 00000000000000..e5e815d2a4b869 --- /dev/null +++ b/target/linux/generic/backport-6.1/807-v6.5-06-net-dsa-mv88e6xxx-enable-support-for-88E6361-switch.patch @@ -0,0 +1,153 @@ +From 23680321789863bab2d60af507858ce50ff9f56a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alexis=20Lothor=C3=A9?= +Date: Mon, 29 May 2023 10:02:46 +0200 +Subject: [PATCH 6/6] net: dsa: mv88e6xxx: enable support for 88E6361 switch +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Marvell 88E6361 is an 8-port switch derived from the +88E6393X/88E9193X/88E6191X switches family. It can benefit from the +existing mv88e6xxx driver by simply adding the proper switch description in +the driver. Main differences with other switches from this +family are: +- 8 ports exposed (instead of 11): ports 1, 2 and 8 not available +- No 5GBase-x nor SFI/USXGMII support + +Signed-off-by: Alexis Lothoré +Reviewed-by: Andrew Lunn +Signed-off-by: Jakub Kicinski +--- + drivers/net/dsa/mv88e6xxx/chip.c | 42 ++++++++++++++++++++++++++++---- + drivers/net/dsa/mv88e6xxx/chip.h | 3 ++- + drivers/net/dsa/mv88e6xxx/port.c | 14 ++++++++--- + drivers/net/dsa/mv88e6xxx/port.h | 1 + + 4 files changed, 51 insertions(+), 9 deletions(-) + +--- a/drivers/net/dsa/mv88e6xxx/chip.c ++++ b/drivers/net/dsa/mv88e6xxx/chip.c +@@ -797,6 +797,8 @@ static void mv88e6393x_phylink_get_caps( + unsigned long *supported = config->supported_interfaces; + bool is_6191x = + chip->info->prod_num == MV88E6XXX_PORT_SWITCH_ID_PROD_6191X; ++ bool is_6361 = ++ chip->info->prod_num == MV88E6XXX_PORT_SWITCH_ID_PROD_6361; + + mv88e6xxx_translate_cmode(chip->ports[port].cmode, supported); + +@@ -811,13 +813,17 @@ static void mv88e6393x_phylink_get_caps( + /* 6191X supports >1G modes only on port 10 */ + if (!is_6191x || port == 10) { + __set_bit(PHY_INTERFACE_MODE_2500BASEX, supported); +- __set_bit(PHY_INTERFACE_MODE_5GBASER, supported); +- __set_bit(PHY_INTERFACE_MODE_10GBASER, supported); ++ config->mac_capabilities |= MAC_2500FD; ++ ++ /* 6361 only supports up to 2500BaseX */ ++ if (!is_6361) { ++ __set_bit(PHY_INTERFACE_MODE_5GBASER, supported); ++ __set_bit(PHY_INTERFACE_MODE_10GBASER, supported); ++ config->mac_capabilities |= MAC_5000FD | ++ MAC_10000FD; ++ } + /* FIXME: USXGMII is not supported yet */ + /* __set_bit(PHY_INTERFACE_MODE_USXGMII, supported); */ +- +- config->mac_capabilities |= MAC_2500FD | MAC_5000FD | +- MAC_10000FD; + } + } + +@@ -6229,6 +6235,32 @@ static const struct mv88e6xxx_info mv88e + .ptp_support = true, + .ops = &mv88e6352_ops, + }, ++ [MV88E6361] = { ++ .prod_num = MV88E6XXX_PORT_SWITCH_ID_PROD_6361, ++ .family = MV88E6XXX_FAMILY_6393, ++ .name = "Marvell 88E6361", ++ .num_databases = 4096, ++ .num_macs = 16384, ++ .num_ports = 11, ++ /* Ports 1, 2 and 8 are not routed */ ++ .invalid_port_mask = BIT(1) | BIT(2) | BIT(8), ++ .num_internal_phys = 5, ++ .internal_phys_offset = 3, ++ .max_vid = 4095, ++ .max_sid = 63, ++ .port_base_addr = 0x0, ++ .phy_base_addr = 0x0, ++ .global1_addr = 0x1b, ++ .global2_addr = 0x1c, ++ .age_time_coeff = 3750, ++ .g1_irqs = 10, ++ .g2_irqs = 14, ++ .atu_move_port_mask = 0x1f, ++ .pvt = true, ++ .multi_chip = true, ++ .ptp_support = true, ++ .ops = &mv88e6393x_ops, ++ }, + [MV88E6390] = { + .prod_num = MV88E6XXX_PORT_SWITCH_ID_PROD_6390, + .family = MV88E6XXX_FAMILY_6390, +--- a/drivers/net/dsa/mv88e6xxx/chip.h ++++ b/drivers/net/dsa/mv88e6xxx/chip.h +@@ -82,6 +82,7 @@ enum mv88e6xxx_model { + MV88E6350, + MV88E6351, + MV88E6352, ++ MV88E6361, + MV88E6390, + MV88E6390X, + MV88E6393X, +@@ -100,7 +101,7 @@ enum mv88e6xxx_family { + MV88E6XXX_FAMILY_6351, /* 6171 6175 6350 6351 */ + MV88E6XXX_FAMILY_6352, /* 6172 6176 6240 6352 */ + MV88E6XXX_FAMILY_6390, /* 6190 6190X 6191 6290 6390 6390X */ +- MV88E6XXX_FAMILY_6393, /* 6191X 6193X 6393X */ ++ MV88E6XXX_FAMILY_6393, /* 6191X 6193X 6361 6393X */ + }; + + /** +--- a/drivers/net/dsa/mv88e6xxx/port.c ++++ b/drivers/net/dsa/mv88e6xxx/port.c +@@ -424,6 +424,10 @@ int mv88e6393x_port_set_speed_duplex(str + u16 reg, ctrl; + int err; + ++ if (chip->info->prod_num == MV88E6XXX_PORT_SWITCH_ID_PROD_6361 && ++ speed > 2500) ++ return -EOPNOTSUPP; ++ + if (speed == 200 && port != 0) + return -EOPNOTSUPP; + +@@ -506,10 +510,14 @@ int mv88e6393x_port_set_speed_duplex(str + phy_interface_t mv88e6393x_port_max_speed_mode(struct mv88e6xxx_chip *chip, + int port) + { +- if (port == 0 || port == 9 || port == 10) +- return PHY_INTERFACE_MODE_10GBASER; + +- return PHY_INTERFACE_MODE_NA; ++ if (port != 0 && port != 9 && port != 10) ++ return PHY_INTERFACE_MODE_NA; ++ ++ if (chip->info->prod_num == MV88E6XXX_PORT_SWITCH_ID_PROD_6361) ++ return PHY_INTERFACE_MODE_2500BASEX; ++ ++ return PHY_INTERFACE_MODE_10GBASER; + } + + static int mv88e6xxx_port_set_cmode(struct mv88e6xxx_chip *chip, int port, +--- a/drivers/net/dsa/mv88e6xxx/port.h ++++ b/drivers/net/dsa/mv88e6xxx/port.h +@@ -133,6 +133,7 @@ + #define MV88E6XXX_PORT_SWITCH_ID_PROD_6220 0x2200 + #define MV88E6XXX_PORT_SWITCH_ID_PROD_6240 0x2400 + #define MV88E6XXX_PORT_SWITCH_ID_PROD_6250 0x2500 ++#define MV88E6XXX_PORT_SWITCH_ID_PROD_6361 0x2610 + #define MV88E6XXX_PORT_SWITCH_ID_PROD_6290 0x2900 + #define MV88E6XXX_PORT_SWITCH_ID_PROD_6321 0x3100 + #define MV88E6XXX_PORT_SWITCH_ID_PROD_6141 0x3400 diff --git a/target/linux/generic/backport-6.1/827-v6.3-0002-of-property-make-.-cells-optional-for-simple-props.patch b/target/linux/generic/backport-6.1/827-v6.3-0002-of-property-make-.-cells-optional-for-simple-props.patch index c4f44b87a4d39d..3af514c42dfd5b 100644 --- a/target/linux/generic/backport-6.1/827-v6.3-0002-of-property-make-.-cells-optional-for-simple-props.patch +++ b/target/linux/generic/backport-6.1/827-v6.3-0002-of-property-make-.-cells-optional-for-simple-props.patch @@ -21,7 +21,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/of/property.c +++ b/drivers/of/property.c -@@ -1202,8 +1202,8 @@ static struct device_node *parse_prop_ce +@@ -1144,8 +1144,8 @@ static struct device_node *parse_prop_ce if (strcmp(prop_name, list_name)) return NULL; diff --git a/target/linux/generic/backport-6.1/827-v6.3-0003-of-property-add-nvmem-cell-cells-property.patch b/target/linux/generic/backport-6.1/827-v6.3-0003-of-property-add-nvmem-cell-cells-property.patch index c2b86de9b97dd1..025f094987a680 100644 --- a/target/linux/generic/backport-6.1/827-v6.3-0003-of-property-add-nvmem-cell-cells-property.patch +++ b/target/linux/generic/backport-6.1/827-v6.3-0003-of-property-add-nvmem-cell-cells-property.patch @@ -19,7 +19,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/of/property.c +++ b/drivers/of/property.c -@@ -1307,7 +1307,7 @@ DEFINE_SIMPLE_PROP(dmas, "dmas", "#dma-c +@@ -1249,7 +1249,7 @@ DEFINE_SIMPLE_PROP(dmas, "dmas", "#dma-c DEFINE_SIMPLE_PROP(power_domains, "power-domains", "#power-domain-cells") DEFINE_SIMPLE_PROP(hwlocks, "hwlocks", "#hwlock-cells") DEFINE_SIMPLE_PROP(extcon, "extcon", NULL) diff --git a/target/linux/generic/config-6.1 b/target/linux/generic/config-6.1 index a6bec3ac73570a..5796cbb67c8f96 100644 --- a/target/linux/generic/config-6.1 +++ b/target/linux/generic/config-6.1 @@ -6989,6 +6989,7 @@ CONFIG_TRAD_SIGNALS=y # CONFIG_TRUSTED_FOUNDATIONS is not set # CONFIG_TRUSTED_KEYS is not set # CONFIG_TRUSTED_KEYS_TPM is not set +# CONFIG_TRUSTED_KEYS_TEE is not set # CONFIG_TSL2583 is not set # CONFIG_TSL2591 is not set # CONFIG_TSL2772 is not set @@ -7507,6 +7508,7 @@ CONFIG_VHOST_MENU=y # CONFIG_VIDEO_CADENCE_CSI2RX is not set # CONFIG_VIDEO_CADENCE_CSI2TX is not set # CONFIG_VIDEO_CAFE_CCIC is not set +# CONFIG_VIDEO_CAMERA_SENSOR is not set # CONFIG_VIDEO_CCS is not set # CONFIG_VIDEO_COBALT is not set # CONFIG_VIDEO_CODA is not set diff --git a/target/linux/generic/hack-5.15/410-block-fit-partition-parser.patch b/target/linux/generic/hack-5.15/410-block-fit-partition-parser.patch index 96c89f41c48f78..13a16b6fa08240 100644 --- a/target/linux/generic/hack-5.15/410-block-fit-partition-parser.patch +++ b/target/linux/generic/hack-5.15/410-block-fit-partition-parser.patch @@ -105,7 +105,7 @@ Subject: [PATCH] kernel: add block fit partition parser /* everything is up and running, commence */ err = xa_insert(&disk->part_tbl, partno, bdev, GFP_KERNEL); if (err) -@@ -598,6 +610,11 @@ static bool blk_add_partition(struct gen +@@ -595,6 +607,11 @@ static bool blk_add_partition(struct gen (state->parts[p].flags & ADDPART_FLAG_RAID)) md_autodetect_dev(part->bd_dev); diff --git a/target/linux/generic/hack-5.15/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch b/target/linux/generic/hack-5.15/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch index f6dacb6e503688..a63bb25f1a5adf 100644 --- a/target/linux/generic/hack-5.15/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch +++ b/target/linux/generic/hack-5.15/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch @@ -9,7 +9,7 @@ Subject: [PATCH] net/dsa/mv88e6xxx: disable ATU violation --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -2993,6 +2993,9 @@ static int mv88e6xxx_setup_port(struct m +@@ -3015,6 +3015,9 @@ static int mv88e6xxx_setup_port(struct m else reg = 1 << port; diff --git a/target/linux/generic/hack-5.15/760-net-usb-r8152-add-LED-configuration-from-OF.patch b/target/linux/generic/hack-5.15/760-net-usb-r8152-add-LED-configuration-from-OF.patch index f61c078521e2ce..383dfe397ff432 100644 --- a/target/linux/generic/hack-5.15/760-net-usb-r8152-add-LED-configuration-from-OF.patch +++ b/target/linux/generic/hack-5.15/760-net-usb-r8152-add-LED-configuration-from-OF.patch @@ -22,7 +22,7 @@ Signed-off-by: David Bauer #include #include #include -@@ -6886,6 +6887,22 @@ static void rtl_tally_reset(struct r8152 +@@ -6889,6 +6890,22 @@ static void rtl_tally_reset(struct r8152 ocp_write_word(tp, MCU_TYPE_PLA, PLA_RSTTALLY, ocp_data); } @@ -45,7 +45,7 @@ Signed-off-by: David Bauer static void r8152b_init(struct r8152 *tp) { u32 ocp_data; -@@ -6927,6 +6944,8 @@ static void r8152b_init(struct r8152 *tp +@@ -6930,6 +6947,8 @@ static void r8152b_init(struct r8152 *tp ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL); ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN); ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data); @@ -54,7 +54,7 @@ Signed-off-by: David Bauer } static void r8153_init(struct r8152 *tp) -@@ -7067,6 +7086,8 @@ static void r8153_init(struct r8152 *tp) +@@ -7070,6 +7089,8 @@ static void r8153_init(struct r8152 *tp) tp->coalesce = COALESCE_SLOW; break; } @@ -63,7 +63,7 @@ Signed-off-by: David Bauer } static void r8153b_init(struct r8152 *tp) -@@ -7149,6 +7170,8 @@ static void r8153b_init(struct r8152 *tp +@@ -7152,6 +7173,8 @@ static void r8153b_init(struct r8152 *tp rtl_tally_reset(tp); tp->coalesce = 15000; /* 15 us */ diff --git a/target/linux/generic/hack-5.15/901-debloat_sock_diag.patch b/target/linux/generic/hack-5.15/901-debloat_sock_diag.patch index 5c1ce01a2ce93d..11f4f556e86391 100644 --- a/target/linux/generic/hack-5.15/901-debloat_sock_diag.patch +++ b/target/linux/generic/hack-5.15/901-debloat_sock_diag.patch @@ -77,7 +77,7 @@ Signed-off-by: Felix Fietkau INDIRECT_CALLABLE_DECLARE(struct dst_entry *ip6_dst_check(struct dst_entry *, u32)); INDIRECT_CALLABLE_DECLARE(struct dst_entry *ipv4_dst_check(struct dst_entry *, -@@ -1986,9 +2000,11 @@ static void __sk_free(struct sock *sk) +@@ -1987,9 +2001,11 @@ static void __sk_free(struct sock *sk) if (likely(sk->sk_net_refcnt)) sock_inuse_add(sock_net(sk), -1); diff --git a/target/linux/generic/hack-5.15/902-debloat_proc.patch b/target/linux/generic/hack-5.15/902-debloat_proc.patch index 7528df483e5279..58c2026c48e2c8 100644 --- a/target/linux/generic/hack-5.15/902-debloat_proc.patch +++ b/target/linux/generic/hack-5.15/902-debloat_proc.patch @@ -235,7 +235,7 @@ Signed-off-by: Felix Fietkau if (!pe) --- a/mm/vmalloc.c +++ b/mm/vmalloc.c -@@ -3968,6 +3968,8 @@ static const struct seq_operations vmall +@@ -3986,6 +3986,8 @@ static const struct seq_operations vmall static int __init proc_vmalloc_init(void) { @@ -330,7 +330,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -3880,6 +3880,8 @@ static __net_initdata struct pernet_oper +@@ -3881,6 +3881,8 @@ static __net_initdata struct pernet_oper static int __init proto_init(void) { @@ -341,7 +341,7 @@ Signed-off-by: Felix Fietkau --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c -@@ -3024,11 +3024,13 @@ static const struct seq_operations fib_r +@@ -3025,11 +3025,13 @@ static const struct seq_operations fib_r int __net_init fib_proc_init(struct net *net) { @@ -357,7 +357,7 @@ Signed-off-by: Felix Fietkau fib_triestat_seq_show, NULL)) goto out2; -@@ -3039,17 +3041,21 @@ int __net_init fib_proc_init(struct net +@@ -3040,17 +3042,21 @@ int __net_init fib_proc_init(struct net return 0; out3: diff --git a/target/linux/generic/hack-6.1/253-ksmbd-config.patch b/target/linux/generic/hack-6.1/253-ksmbd-config.patch index b0c379657e3b21..4bb5eb9a6c5b74 100644 --- a/target/linux/generic/hack-6.1/253-ksmbd-config.patch +++ b/target/linux/generic/hack-6.1/253-ksmbd-config.patch @@ -10,7 +10,7 @@ Subject: [PATCH] Kconfig: add tristate for OID and ASNI string --- a/init/Kconfig +++ b/init/Kconfig -@@ -2003,7 +2003,7 @@ config PADATA +@@ -2004,7 +2004,7 @@ config PADATA bool config ASN1 diff --git a/target/linux/generic/hack-6.1/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch b/target/linux/generic/hack-6.1/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch index 9c45115ebb09dc..5a8f253c34831a 100644 --- a/target/linux/generic/hack-6.1/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch +++ b/target/linux/generic/hack-6.1/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch @@ -9,7 +9,7 @@ Subject: [PATCH] net/dsa/mv88e6xxx: disable ATU violation --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -3480,6 +3480,9 @@ static int mv88e6xxx_setup_port(struct m +@@ -3486,6 +3486,9 @@ static int mv88e6xxx_setup_port(struct m else reg = 1 << port; diff --git a/target/linux/generic/hack-6.1/721-net-add-packet-mangeling.patch b/target/linux/generic/hack-6.1/721-net-add-packet-mangeling.patch index bfb4f50e792840..dd9ca868a2e7ae 100644 --- a/target/linux/generic/hack-6.1/721-net-add-packet-mangeling.patch +++ b/target/linux/generic/hack-6.1/721-net-add-packet-mangeling.patch @@ -60,7 +60,7 @@ Signed-off-by: Felix Fietkau */ --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -3032,6 +3032,10 @@ static inline int pskb_trim(struct sk_bu +@@ -3040,6 +3040,10 @@ static inline int pskb_trim(struct sk_bu return (len < skb->len) ? __pskb_trim(skb, len) : 0; } @@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau /** * pskb_trim_unique - remove end from a paged unique (not cloned) buffer * @skb: buffer to alter -@@ -3181,16 +3185,6 @@ static inline struct sk_buff *dev_alloc_ +@@ -3189,16 +3193,6 @@ static inline struct sk_buff *dev_alloc_ } @@ -127,7 +127,7 @@ Signed-off-by: Felix Fietkau #include #include -@@ -707,6 +708,22 @@ skb_fail: +@@ -709,6 +710,22 @@ skb_fail: } EXPORT_SYMBOL(__napi_alloc_skb); diff --git a/target/linux/generic/hack-6.1/760-net-usb-r8152-add-LED-configuration-from-OF.patch b/target/linux/generic/hack-6.1/760-net-usb-r8152-add-LED-configuration-from-OF.patch index ba03a00eb27abf..96525089ef5a9e 100644 --- a/target/linux/generic/hack-6.1/760-net-usb-r8152-add-LED-configuration-from-OF.patch +++ b/target/linux/generic/hack-6.1/760-net-usb-r8152-add-LED-configuration-from-OF.patch @@ -22,7 +22,7 @@ Signed-off-by: David Bauer #include #include #include -@@ -6893,6 +6894,22 @@ static void rtl_tally_reset(struct r8152 +@@ -6896,6 +6897,22 @@ static void rtl_tally_reset(struct r8152 ocp_write_word(tp, MCU_TYPE_PLA, PLA_RSTTALLY, ocp_data); } @@ -45,7 +45,7 @@ Signed-off-by: David Bauer static void r8152b_init(struct r8152 *tp) { u32 ocp_data; -@@ -6934,6 +6951,8 @@ static void r8152b_init(struct r8152 *tp +@@ -6937,6 +6954,8 @@ static void r8152b_init(struct r8152 *tp ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL); ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN); ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data); @@ -54,7 +54,7 @@ Signed-off-by: David Bauer } static void r8153_init(struct r8152 *tp) -@@ -7074,6 +7093,8 @@ static void r8153_init(struct r8152 *tp) +@@ -7077,6 +7096,8 @@ static void r8153_init(struct r8152 *tp) tp->coalesce = COALESCE_SLOW; break; } @@ -63,7 +63,7 @@ Signed-off-by: David Bauer } static void r8153b_init(struct r8152 *tp) -@@ -7156,6 +7177,8 @@ static void r8153b_init(struct r8152 *tp +@@ -7159,6 +7180,8 @@ static void r8153b_init(struct r8152 *tp rtl_tally_reset(tp); tp->coalesce = 15000; /* 15 us */ diff --git a/target/linux/generic/hack-6.1/901-debloat_sock_diag.patch b/target/linux/generic/hack-6.1/901-debloat_sock_diag.patch index 6cd30813a5d4e3..b4403e82c8a62f 100644 --- a/target/linux/generic/hack-6.1/901-debloat_sock_diag.patch +++ b/target/linux/generic/hack-6.1/901-debloat_sock_diag.patch @@ -60,7 +60,7 @@ Signed-off-by: Felix Fietkau static void sock_def_write_space_wfree(struct sock *sk); static void sock_def_write_space(struct sock *sk); -@@ -582,6 +584,18 @@ discard_and_relse: +@@ -584,6 +586,18 @@ discard_and_relse: } EXPORT_SYMBOL(__sk_receive_skb); @@ -79,7 +79,7 @@ Signed-off-by: Felix Fietkau INDIRECT_CALLABLE_DECLARE(struct dst_entry *ip6_dst_check(struct dst_entry *, u32)); INDIRECT_CALLABLE_DECLARE(struct dst_entry *ipv4_dst_check(struct dst_entry *, -@@ -2175,9 +2189,11 @@ static void __sk_free(struct sock *sk) +@@ -2180,9 +2194,11 @@ static void __sk_free(struct sock *sk) if (likely(sk->sk_net_refcnt)) sock_inuse_add(sock_net(sk), -1); diff --git a/target/linux/generic/hack-6.1/902-debloat_proc.patch b/target/linux/generic/hack-6.1/902-debloat_proc.patch index abf588f12fc372..23de30f4923af1 100644 --- a/target/linux/generic/hack-6.1/902-debloat_proc.patch +++ b/target/linux/generic/hack-6.1/902-debloat_proc.patch @@ -235,7 +235,7 @@ Signed-off-by: Felix Fietkau if (!pe) --- a/mm/vmalloc.c +++ b/mm/vmalloc.c -@@ -4187,6 +4187,8 @@ static const struct seq_operations vmall +@@ -4205,6 +4205,8 @@ static const struct seq_operations vmall static int __init proc_vmalloc_init(void) { @@ -330,7 +330,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -4100,6 +4100,8 @@ static __net_initdata struct pernet_oper +@@ -4105,6 +4105,8 @@ static __net_initdata struct pernet_oper static int __init proto_init(void) { @@ -341,7 +341,7 @@ Signed-off-by: Felix Fietkau --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c -@@ -3031,11 +3031,13 @@ static const struct seq_operations fib_r +@@ -3032,11 +3032,13 @@ static const struct seq_operations fib_r int __net_init fib_proc_init(struct net *net) { @@ -357,7 +357,7 @@ Signed-off-by: Felix Fietkau fib_triestat_seq_show, NULL)) goto out2; -@@ -3046,17 +3048,21 @@ int __net_init fib_proc_init(struct net +@@ -3047,17 +3049,21 @@ int __net_init fib_proc_init(struct net return 0; out3: diff --git a/target/linux/generic/hack-6.1/904-debloat_dma_buf.patch b/target/linux/generic/hack-6.1/904-debloat_dma_buf.patch index 48c001bfab5cab..8b6bd6a7862af4 100644 --- a/target/linux/generic/hack-6.1/904-debloat_dma_buf.patch +++ b/target/linux/generic/hack-6.1/904-debloat_dma_buf.patch @@ -64,7 +64,7 @@ Signed-off-by: Felix Fietkau +dma-shared-buffer-objs := $(dma-buf-objs-y) --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c -@@ -1583,4 +1583,5 @@ static void __exit dma_buf_deinit(void) +@@ -1636,4 +1636,5 @@ static void __exit dma_buf_deinit(void) kern_unmount(dma_buf_mnt); dma_buf_uninit_sysfs_statistics(); } diff --git a/target/linux/generic/pending-5.15/402-mtd-spi-nor-write-support-for-minor-aligned-partitions.patch b/target/linux/generic/pending-5.15/402-mtd-spi-nor-write-support-for-minor-aligned-partitions.patch index d12bc9c3d59b6c..0a12132de36b56 100644 --- a/target/linux/generic/pending-5.15/402-mtd-spi-nor-write-support-for-minor-aligned-partitions.patch +++ b/target/linux/generic/pending-5.15/402-mtd-spi-nor-write-support-for-minor-aligned-partitions.patch @@ -193,7 +193,7 @@ Reported-by: Dan Carpenter default y --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c -@@ -1271,6 +1271,8 @@ static u8 spi_nor_convert_3to4_erase(u8 +@@ -1272,6 +1272,8 @@ static u8 spi_nor_convert_3to4_erase(u8 static bool spi_nor_has_uniform_erase(const struct spi_nor *nor) { @@ -202,7 +202,7 @@ Reported-by: Dan Carpenter return !!nor->params->erase_map.uniform_erase_type; } -@@ -2400,6 +2402,7 @@ static int spi_nor_select_erase(struct s +@@ -2401,6 +2403,7 @@ static int spi_nor_select_erase(struct s { struct spi_nor_erase_map *map = &nor->params->erase_map; const struct spi_nor_erase_type *erase = NULL; @@ -210,7 +210,7 @@ Reported-by: Dan Carpenter struct mtd_info *mtd = &nor->mtd; u32 wanted_size = nor->info->sector_size; int i; -@@ -2432,8 +2435,9 @@ static int spi_nor_select_erase(struct s +@@ -2433,8 +2436,9 @@ static int spi_nor_select_erase(struct s */ for (i = SNOR_ERASE_TYPE_MAX - 1; i >= 0; i--) { if (map->erase_type[i].size) { @@ -222,7 +222,7 @@ Reported-by: Dan Carpenter } } -@@ -2441,6 +2445,9 @@ static int spi_nor_select_erase(struct s +@@ -2442,6 +2446,9 @@ static int spi_nor_select_erase(struct s return -EINVAL; mtd->erasesize = erase->size; diff --git a/target/linux/generic/pending-5.15/479-mtd-spi-nor-add-xtx-xt25f128b.patch b/target/linux/generic/pending-5.15/479-mtd-spi-nor-add-xtx-xt25f128b.patch index 5a064b714bfdcd..3e1958c8a09267 100644 --- a/target/linux/generic/pending-5.15/479-mtd-spi-nor-add-xtx-xt25f128b.patch +++ b/target/linux/generic/pending-5.15/479-mtd-spi-nor-add-xtx-xt25f128b.patch @@ -59,7 +59,7 @@ Signed-off-by: Felix Fietkau +}; --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c -@@ -1859,6 +1859,7 @@ static const struct spi_nor_manufacturer +@@ -1860,6 +1860,7 @@ static const struct spi_nor_manufacturer &spi_nor_winbond, &spi_nor_xilinx, &spi_nor_xmc, diff --git a/target/linux/generic/pending-5.15/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-5.15/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index 86bd9664e55552..351d5864a1f8b1 100644 --- a/target/linux/generic/pending-5.15/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-5.15/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -66,7 +66,7 @@ Signed-off-by: Jonas Gorski static void rt_fibinfo_free(struct rtable __rcu **rtp) --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c -@@ -2772,6 +2772,7 @@ static const char *const rtn_type_names[ +@@ -2773,6 +2773,7 @@ static const char *const rtn_type_names[ [RTN_THROW] = "THROW", [RTN_NAT] = "NAT", [RTN_XRESOLVE] = "XRESOLVE", diff --git a/target/linux/generic/pending-5.15/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch b/target/linux/generic/pending-5.15/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch index 2eb6dc133cf039..67cff4d22bac1b 100644 --- a/target/linux/generic/pending-5.15/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch +++ b/target/linux/generic/pending-5.15/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3096,8 +3096,8 @@ static irqreturn_t mtk_handle_irq_rx(int +@@ -3099,8 +3099,8 @@ static irqreturn_t mtk_handle_irq_rx(int eth->rx_events++; if (likely(napi_schedule_prep(ð->rx_napi))) { @@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau } return IRQ_HANDLED; -@@ -3109,8 +3109,8 @@ static irqreturn_t mtk_handle_irq_tx(int +@@ -3112,8 +3112,8 @@ static irqreturn_t mtk_handle_irq_tx(int eth->tx_events++; if (likely(napi_schedule_prep(ð->tx_napi))) { @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau } return IRQ_HANDLED; -@@ -4884,6 +4884,8 @@ static int mtk_probe(struct platform_dev +@@ -4887,6 +4887,8 @@ static int mtk_probe(struct platform_dev * for NAPI to work */ init_dummy_netdev(ð->dummy_dev); diff --git a/target/linux/generic/pending-5.15/732-03-net-ethernet-mtk_eth_soc-fix-remaining-throughput-re.patch b/target/linux/generic/pending-5.15/732-03-net-ethernet-mtk_eth_soc-fix-remaining-throughput-re.patch index 305d63d5b731f8..cc6c9e91bf7294 100644 --- a/target/linux/generic/pending-5.15/732-03-net-ethernet-mtk_eth_soc-fix-remaining-throughput-re.patch +++ b/target/linux/generic/pending-5.15/732-03-net-ethernet-mtk_eth_soc-fix-remaining-throughput-re.patch @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau switch (speed) { case SPEED_2500: case SPEED_1000: -@@ -3289,6 +3290,9 @@ found: +@@ -3292,6 +3293,9 @@ found: if (dp->index >= MTK_QDMA_NUM_QUEUES) return NOTIFY_DONE; diff --git a/target/linux/generic/pending-5.15/737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch b/target/linux/generic/pending-5.15/737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch index cc5cf935fd95ad..b85b1364e18134 100644 --- a/target/linux/generic/pending-5.15/737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch +++ b/target/linux/generic/pending-5.15/737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch @@ -478,7 +478,7 @@ Signed-off-by: Daniel Golle static const struct phylink_mac_ops mtk_phylink_ops = { .validate = phylink_generic_validate, .mac_select_pcs = mtk_mac_select_pcs, -@@ -4559,8 +4673,21 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4562,8 +4676,21 @@ static int mtk_add_mac(struct mtk_eth *e phy_interface_zero(mac->phylink_config.supported_interfaces); __set_bit(PHY_INTERFACE_MODE_INTERNAL, mac->phylink_config.supported_interfaces); @@ -500,7 +500,7 @@ Signed-off-by: Daniel Golle phylink = phylink_create(&mac->phylink_config, of_fwnode_handle(mac->of_node), phy_mode, &mtk_phylink_ops); -@@ -4753,6 +4880,13 @@ static int mtk_probe(struct platform_dev +@@ -4756,6 +4883,13 @@ static int mtk_probe(struct platform_dev if (err) return err; diff --git a/target/linux/generic/pending-5.15/750-skb-Do-mix-page-pool-and-page-referenced-frags-in-GR.patch b/target/linux/generic/pending-5.15/750-skb-Do-mix-page-pool-and-page-referenced-frags-in-GR.patch index f2bfd14b18de31..2a57a7ef03505a 100644 --- a/target/linux/generic/pending-5.15/750-skb-Do-mix-page-pool-and-page-referenced-frags-in-GR.patch +++ b/target/linux/generic/pending-5.15/750-skb-Do-mix-page-pool-and-page-referenced-frags-in-GR.patch @@ -17,7 +17,7 @@ Signed-off-by: Alexander Duyck --- a/net/core/skbuff.c +++ b/net/core/skbuff.c -@@ -4352,6 +4352,15 @@ int skb_gro_receive(struct sk_buff *p, s +@@ -4358,6 +4358,15 @@ int skb_gro_receive(struct sk_buff *p, s if (unlikely(p->len + len >= 65536 || NAPI_GRO_CB(skb)->flush)) return -E2BIG; diff --git a/target/linux/generic/pending-5.15/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch b/target/linux/generic/pending-5.15/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch index 5aa540acf7772d..fa9d7ff0b85ba4 100644 --- a/target/linux/generic/pending-5.15/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch +++ b/target/linux/generic/pending-5.15/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch @@ -17,7 +17,7 @@ Signed-off-by: Tobias Waldekranz --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -6341,6 +6341,7 @@ static int mv88e6xxx_register_switch(str +@@ -6391,6 +6391,7 @@ static int mv88e6xxx_register_switch(str ds->ops = &mv88e6xxx_switch_ops; ds->ageing_time_min = chip->info->age_time_coeff; ds->ageing_time_max = chip->info->age_time_coeff * U8_MAX; diff --git a/target/linux/generic/pending-5.15/860-serial-8250_mtk-track-busclk-state-to-avoid-bus-error.patch b/target/linux/generic/pending-5.15/860-serial-8250_mtk-track-busclk-state-to-avoid-bus-error.patch new file mode 100644 index 00000000000000..c5db5d9491d410 --- /dev/null +++ b/target/linux/generic/pending-5.15/860-serial-8250_mtk-track-busclk-state-to-avoid-bus-error.patch @@ -0,0 +1,61 @@ +From 629c701fc39f1ada9416e0766a86729e83bde86c Mon Sep 17 00:00:00 2001 +Message-ID: <629c701fc39f1ada9416e0766a86729e83bde86c.1694465766.git.daniel@makrotopia.org> +From: Daniel Golle +Date: Mon, 11 Sep 2023 21:27:44 +0100 +Subject: [PATCH] serial: 8250_mtk: track busclk state to avoid bus error +To: Greg Kroah-Hartman , + Jiri Slaby , + Matthias Brugger , + AngeloGioacchino Del Regno , + Daniel Golle , + John Ogness , + Chen-Yu Tsai , + Changqi Hu , + linux-kernel@vger.kernel.org, + linux-serial@vger.kernel.org, + linux-arm-kernel@lists.infradead.org, + linux-mediatek@lists.infradead.org + +Commit e32a83c70cf9 ("serial: 8250-mtk: modify mtk uart power and +clock management") introduced polling a debug register to make sure +the UART is idle before disabling the bus clock. However, at least on +some MediaTek SoCs access to that very debug register requires the bus +clock being enabled. Hence calling the suspend function while already +in suspended state results in that register access triggering a bus +error. In order to avoid that, track the state of the bus clock and +only poll the debug register if not already in suspended state. + +Fixes: e32a83c70cf9 ("serial: 8250-mtk: modify mtk uart power and clock management") +Signed-off-by: Daniel Golle +--- + drivers/tty/serial/8250/8250_mtk.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +--- a/drivers/tty/serial/8250/8250_mtk.c ++++ b/drivers/tty/serial/8250/8250_mtk.c +@@ -32,7 +32,7 @@ + #define MTK_UART_RXTRI_AD 0x14 /* RX Trigger address */ + #define MTK_UART_FRACDIV_L 0x15 /* Fractional divider LSB address */ + #define MTK_UART_FRACDIV_M 0x16 /* Fractional divider MSB address */ +-#define MTK_UART_DEBUG0 0x18 ++#define MTK_UART_DEBUG0 0x18 + #define MTK_UART_IER_XOFFI 0x20 /* Enable XOFF character interrupt */ + #define MTK_UART_IER_RTSI 0x40 /* Enable RTS Modem status interrupt */ + #define MTK_UART_IER_CTSI 0x80 /* Enable CTS Modem status interrupt */ +@@ -418,13 +418,12 @@ static int __maybe_unused mtk8250_runtim + struct mtk8250_data *data = dev_get_drvdata(dev); + struct uart_8250_port *up = serial8250_get_port(data->line); + +- /* wait until UART in idle status */ +- while +- (serial_in(up, MTK_UART_DEBUG0)); +- + if (data->clk_count == 0U) { + dev_dbg(dev, "%s clock count is 0\n", __func__); + } else { ++ /* wait until UART in idle status */ ++ while ++ (serial_in(up, MTK_UART_DEBUG0)); + clk_disable_unprepare(data->bus_clk); + data->clk_count--; + } diff --git a/target/linux/generic/pending-6.1/203-kallsyms_uncompressed.patch b/target/linux/generic/pending-6.1/203-kallsyms_uncompressed.patch index e066ad3cf30485..1b577ec3bb5d25 100644 --- a/target/linux/generic/pending-6.1/203-kallsyms_uncompressed.patch +++ b/target/linux/generic/pending-6.1/203-kallsyms_uncompressed.patch @@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau --- a/init/Kconfig +++ b/init/Kconfig -@@ -1481,6 +1481,17 @@ config SYSCTL_ARCH_UNALIGN_ALLOW +@@ -1482,6 +1482,17 @@ config SYSCTL_ARCH_UNALIGN_ALLOW the unaligned access emulation. see arch/parisc/kernel/unaligned.c for reference diff --git a/target/linux/generic/pending-6.1/300-mips_expose_boot_raw.patch b/target/linux/generic/pending-6.1/300-mips_expose_boot_raw.patch index 15d94f4d3c19a7..9e571a6d875b18 100644 --- a/target/linux/generic/pending-6.1/300-mips_expose_boot_raw.patch +++ b/target/linux/generic/pending-6.1/300-mips_expose_boot_raw.patch @@ -9,7 +9,7 @@ Acked-by: Rob Landley --- --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -1035,9 +1035,6 @@ config FW_ARC +@@ -1034,9 +1034,6 @@ config FW_ARC config ARCH_MAY_HAVE_PC_FDC bool @@ -19,7 +19,7 @@ Acked-by: Rob Landley config CEVT_BCM1480 bool -@@ -3092,6 +3089,18 @@ choice +@@ -3091,6 +3088,18 @@ choice bool "Extend builtin kernel arguments with bootloader arguments" endchoice diff --git a/target/linux/generic/pending-6.1/402-mtd-spi-nor-write-support-for-minor-aligned-partitions.patch b/target/linux/generic/pending-6.1/402-mtd-spi-nor-write-support-for-minor-aligned-partitions.patch index f04da4000ccb88..c7da2f883435fe 100644 --- a/target/linux/generic/pending-6.1/402-mtd-spi-nor-write-support-for-minor-aligned-partitions.patch +++ b/target/linux/generic/pending-6.1/402-mtd-spi-nor-write-support-for-minor-aligned-partitions.patch @@ -193,7 +193,7 @@ Reported-by: Dan Carpenter default y --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c -@@ -1049,6 +1049,8 @@ static u8 spi_nor_convert_3to4_erase(u8 +@@ -1050,6 +1050,8 @@ static u8 spi_nor_convert_3to4_erase(u8 static bool spi_nor_has_uniform_erase(const struct spi_nor *nor) { @@ -202,7 +202,7 @@ Reported-by: Dan Carpenter return !!nor->params->erase_map.uniform_erase_type; } -@@ -2157,6 +2159,7 @@ static int spi_nor_select_erase(struct s +@@ -2158,6 +2160,7 @@ static int spi_nor_select_erase(struct s { struct spi_nor_erase_map *map = &nor->params->erase_map; const struct spi_nor_erase_type *erase = NULL; @@ -210,7 +210,7 @@ Reported-by: Dan Carpenter struct mtd_info *mtd = &nor->mtd; u32 wanted_size = nor->info->sector_size; int i; -@@ -2189,8 +2192,9 @@ static int spi_nor_select_erase(struct s +@@ -2190,8 +2193,9 @@ static int spi_nor_select_erase(struct s */ for (i = SNOR_ERASE_TYPE_MAX - 1; i >= 0; i--) { if (map->erase_type[i].size) { @@ -222,7 +222,7 @@ Reported-by: Dan Carpenter } } -@@ -2198,6 +2202,9 @@ static int spi_nor_select_erase(struct s +@@ -2199,6 +2203,9 @@ static int spi_nor_select_erase(struct s return -EINVAL; mtd->erasesize = erase->size; diff --git a/target/linux/generic/pending-6.1/479-mtd-spi-nor-add-xtx-xt25f128b.patch b/target/linux/generic/pending-6.1/479-mtd-spi-nor-add-xtx-xt25f128b.patch index 0ec6aa7fb65052..d2a9fb34365d7f 100644 --- a/target/linux/generic/pending-6.1/479-mtd-spi-nor-add-xtx-xt25f128b.patch +++ b/target/linux/generic/pending-6.1/479-mtd-spi-nor-add-xtx-xt25f128b.patch @@ -61,7 +61,7 @@ Signed-off-by: Felix Fietkau +}; --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c -@@ -1635,6 +1635,7 @@ static const struct spi_nor_manufacturer +@@ -1636,6 +1636,7 @@ static const struct spi_nor_manufacturer &spi_nor_winbond, &spi_nor_xilinx, &spi_nor_xmc, diff --git a/target/linux/generic/pending-6.1/655-increase_skb_pad.patch b/target/linux/generic/pending-6.1/655-increase_skb_pad.patch index 85e9e4a1a3c52a..0c47bc9d2c3c02 100644 --- a/target/linux/generic/pending-6.1/655-increase_skb_pad.patch +++ b/target/linux/generic/pending-6.1/655-increase_skb_pad.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2998,7 +2998,7 @@ static inline int pskb_network_may_pull( +@@ -3006,7 +3006,7 @@ static inline int pskb_network_may_pull( * NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8) */ #ifndef NET_SKB_PAD diff --git a/target/linux/generic/pending-6.1/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-6.1/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index a3cfad2206e8af..e67b709fde5d83 100644 --- a/target/linux/generic/pending-6.1/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-6.1/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -66,7 +66,7 @@ Signed-off-by: Jonas Gorski static void rt_fibinfo_free(struct rtable __rcu **rtp) --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c -@@ -2778,6 +2778,7 @@ static const char *const rtn_type_names[ +@@ -2779,6 +2779,7 @@ static const char *const rtn_type_names[ [RTN_THROW] = "THROW", [RTN_NAT] = "NAT", [RTN_XRESOLVE] = "XRESOLVE", @@ -138,7 +138,7 @@ Signed-off-by: Jonas Gorski static const struct rt6_info ip6_blk_hole_entry_template = { .dst = { .__refcnt = ATOMIC_INIT(1), -@@ -1036,6 +1050,7 @@ static const int fib6_prop[RTN_MAX + 1] +@@ -1039,6 +1053,7 @@ static const int fib6_prop[RTN_MAX + 1] [RTN_BLACKHOLE] = -EINVAL, [RTN_UNREACHABLE] = -EHOSTUNREACH, [RTN_PROHIBIT] = -EACCES, @@ -146,7 +146,7 @@ Signed-off-by: Jonas Gorski [RTN_THROW] = -EAGAIN, [RTN_NAT] = -EINVAL, [RTN_XRESOLVE] = -EINVAL, -@@ -1071,6 +1086,10 @@ static void ip6_rt_init_dst_reject(struc +@@ -1074,6 +1089,10 @@ static void ip6_rt_init_dst_reject(struc rt->dst.output = ip6_pkt_prohibit_out; rt->dst.input = ip6_pkt_prohibit; break; @@ -157,7 +157,7 @@ Signed-off-by: Jonas Gorski case RTN_THROW: case RTN_UNREACHABLE: default: -@@ -4540,6 +4559,17 @@ static int ip6_pkt_prohibit_out(struct n +@@ -4543,6 +4562,17 @@ static int ip6_pkt_prohibit_out(struct n return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES); } @@ -175,7 +175,7 @@ Signed-off-by: Jonas Gorski /* * Allocate a dst for local (unicast / anycast) address. */ -@@ -5033,7 +5063,8 @@ static int rtm_to_fib6_config(struct sk_ +@@ -5036,7 +5066,8 @@ static int rtm_to_fib6_config(struct sk_ if (rtm->rtm_type == RTN_UNREACHABLE || rtm->rtm_type == RTN_BLACKHOLE || rtm->rtm_type == RTN_PROHIBIT || @@ -185,7 +185,7 @@ Signed-off-by: Jonas Gorski cfg->fc_flags |= RTF_REJECT; if (rtm->rtm_type == RTN_LOCAL) -@@ -6287,6 +6318,8 @@ static int ip6_route_dev_notify(struct n +@@ -6290,6 +6321,8 @@ static int ip6_route_dev_notify(struct n #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.ip6_prohibit_entry->dst.dev = dev; net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev); @@ -194,7 +194,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); #endif -@@ -6298,6 +6331,7 @@ static int ip6_route_dev_notify(struct n +@@ -6301,6 +6334,7 @@ static int ip6_route_dev_notify(struct n in6_dev_put_clear(&net->ipv6.ip6_null_entry->rt6i_idev); #ifdef CONFIG_IPV6_MULTIPLE_TABLES in6_dev_put_clear(&net->ipv6.ip6_prohibit_entry->rt6i_idev); @@ -202,7 +202,7 @@ Signed-off-by: Jonas Gorski in6_dev_put_clear(&net->ipv6.ip6_blk_hole_entry->rt6i_idev); #endif } -@@ -6489,6 +6523,8 @@ static int __net_init ip6_route_net_init +@@ -6492,6 +6526,8 @@ static int __net_init ip6_route_net_init #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.fib6_has_custom_rules = false; @@ -211,7 +211,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_prohibit_entry = kmemdup(&ip6_prohibit_entry_template, sizeof(*net->ipv6.ip6_prohibit_entry), GFP_KERNEL); -@@ -6499,11 +6535,21 @@ static int __net_init ip6_route_net_init +@@ -6502,11 +6538,21 @@ static int __net_init ip6_route_net_init ip6_template_metrics, true); INIT_LIST_HEAD(&net->ipv6.ip6_prohibit_entry->rt6i_uncached); @@ -234,7 +234,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, ip6_template_metrics, true); -@@ -6530,6 +6576,8 @@ out: +@@ -6533,6 +6579,8 @@ out: return ret; #ifdef CONFIG_IPV6_MULTIPLE_TABLES @@ -243,7 +243,7 @@ Signed-off-by: Jonas Gorski out_ip6_prohibit_entry: kfree(net->ipv6.ip6_prohibit_entry); out_ip6_null_entry: -@@ -6549,6 +6597,7 @@ static void __net_exit ip6_route_net_exi +@@ -6552,6 +6600,7 @@ static void __net_exit ip6_route_net_exi kfree(net->ipv6.ip6_null_entry); #ifdef CONFIG_IPV6_MULTIPLE_TABLES kfree(net->ipv6.ip6_prohibit_entry); @@ -251,7 +251,7 @@ Signed-off-by: Jonas Gorski kfree(net->ipv6.ip6_blk_hole_entry); #endif dst_entries_destroy(&net->ipv6.ip6_dst_ops); -@@ -6632,6 +6681,9 @@ void __init ip6_route_init_special_entri +@@ -6635,6 +6684,9 @@ void __init ip6_route_init_special_entri init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); diff --git a/target/linux/generic/pending-6.1/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-6.1/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index 400ec1577ece1f..062b3e82b50209 100644 --- a/target/linux/generic/pending-6.1/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-6.1/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -22,7 +22,7 @@ Signed-off-by: Felix Fietkau #endif --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -964,6 +964,7 @@ struct sk_buff { +@@ -972,6 +972,7 @@ struct sk_buff { #ifdef CONFIG_IPV6_NDISC_NODETYPE __u8 ndisc_nodetype:2; #endif diff --git a/target/linux/generic/pending-6.1/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch b/target/linux/generic/pending-6.1/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch index c29aa970944517..a48a993e2fb3ad 100644 --- a/target/linux/generic/pending-6.1/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch +++ b/target/linux/generic/pending-6.1/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3152,8 +3152,8 @@ static irqreturn_t mtk_handle_irq_rx(int +@@ -3155,8 +3155,8 @@ static irqreturn_t mtk_handle_irq_rx(int eth->rx_events++; if (likely(napi_schedule_prep(ð->rx_napi))) { @@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau } return IRQ_HANDLED; -@@ -3165,8 +3165,8 @@ static irqreturn_t mtk_handle_irq_tx(int +@@ -3168,8 +3168,8 @@ static irqreturn_t mtk_handle_irq_tx(int eth->tx_events++; if (likely(napi_schedule_prep(ð->tx_napi))) { @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau } return IRQ_HANDLED; -@@ -4938,6 +4938,8 @@ static int mtk_probe(struct platform_dev +@@ -4941,6 +4941,8 @@ static int mtk_probe(struct platform_dev * for NAPI to work */ init_dummy_netdev(ð->dummy_dev); diff --git a/target/linux/generic/pending-6.1/732-03-net-ethernet-mtk_eth_soc-fix-remaining-throughput-re.patch b/target/linux/generic/pending-6.1/732-03-net-ethernet-mtk_eth_soc-fix-remaining-throughput-re.patch index bd883502d3f543..29cbcad699a164 100644 --- a/target/linux/generic/pending-6.1/732-03-net-ethernet-mtk_eth_soc-fix-remaining-throughput-re.patch +++ b/target/linux/generic/pending-6.1/732-03-net-ethernet-mtk_eth_soc-fix-remaining-throughput-re.patch @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau switch (speed) { case SPEED_2500: case SPEED_1000: -@@ -3345,6 +3346,9 @@ found: +@@ -3348,6 +3349,9 @@ found: if (dp->index >= MTK_QDMA_NUM_QUEUES) return NOTIFY_DONE; diff --git a/target/linux/generic/pending-6.1/737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch b/target/linux/generic/pending-6.1/737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch index 500fb550ba8da2..bb760c1a6971d2 100644 --- a/target/linux/generic/pending-6.1/737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch +++ b/target/linux/generic/pending-6.1/737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch @@ -478,7 +478,7 @@ Signed-off-by: Daniel Golle static const struct phylink_mac_ops mtk_phylink_ops = { .validate = phylink_generic_validate, .mac_select_pcs = mtk_mac_select_pcs, -@@ -4613,8 +4727,21 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4616,8 +4730,21 @@ static int mtk_add_mac(struct mtk_eth *e phy_interface_zero(mac->phylink_config.supported_interfaces); __set_bit(PHY_INTERFACE_MODE_INTERNAL, mac->phylink_config.supported_interfaces); @@ -500,7 +500,7 @@ Signed-off-by: Daniel Golle phylink = phylink_create(&mac->phylink_config, of_fwnode_handle(mac->of_node), phy_mode, &mtk_phylink_ops); -@@ -4807,6 +4934,13 @@ static int mtk_probe(struct platform_dev +@@ -4810,6 +4937,13 @@ static int mtk_probe(struct platform_dev if (err) return err; diff --git a/target/linux/generic/pending-6.1/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch b/target/linux/generic/pending-6.1/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch index ac59b4b5ea6162..a32c7d3603ffe6 100644 --- a/target/linux/generic/pending-6.1/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch +++ b/target/linux/generic/pending-6.1/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch @@ -17,7 +17,7 @@ Signed-off-by: Tobias Waldekranz --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -6988,6 +6988,7 @@ static int mv88e6xxx_register_switch(str +@@ -7023,6 +7023,7 @@ static int mv88e6xxx_register_switch(str ds->ops = &mv88e6xxx_switch_ops; ds->ageing_time_min = chip->info->age_time_coeff; ds->ageing_time_max = chip->info->age_time_coeff * U8_MAX; diff --git a/target/linux/generic/pending-6.1/834-ledtrig-libata.patch b/target/linux/generic/pending-6.1/834-ledtrig-libata.patch index f3c0b1802b35dd..57fdb020f812fe 100644 --- a/target/linux/generic/pending-6.1/834-ledtrig-libata.patch +++ b/target/linux/generic/pending-6.1/834-ledtrig-libata.patch @@ -134,7 +134,7 @@ Signed-off-by: Daniel Golle /* * Define if arch has non-standard setup. This is a _PCI_ standard -@@ -857,6 +860,12 @@ struct ata_port { +@@ -861,6 +864,12 @@ struct ata_port { #ifdef CONFIG_ATA_ACPI struct ata_acpi_gtm __acpi_init_gtm; /* use ata_acpi_init_gtm() */ #endif diff --git a/target/linux/generic/pending-6.1/860-serial-8250_mtk-track-busclk-state-to-avoid-bus-error.patch b/target/linux/generic/pending-6.1/860-serial-8250_mtk-track-busclk-state-to-avoid-bus-error.patch new file mode 100644 index 00000000000000..c5db5d9491d410 --- /dev/null +++ b/target/linux/generic/pending-6.1/860-serial-8250_mtk-track-busclk-state-to-avoid-bus-error.patch @@ -0,0 +1,61 @@ +From 629c701fc39f1ada9416e0766a86729e83bde86c Mon Sep 17 00:00:00 2001 +Message-ID: <629c701fc39f1ada9416e0766a86729e83bde86c.1694465766.git.daniel@makrotopia.org> +From: Daniel Golle +Date: Mon, 11 Sep 2023 21:27:44 +0100 +Subject: [PATCH] serial: 8250_mtk: track busclk state to avoid bus error +To: Greg Kroah-Hartman , + Jiri Slaby , + Matthias Brugger , + AngeloGioacchino Del Regno , + Daniel Golle , + John Ogness , + Chen-Yu Tsai , + Changqi Hu , + linux-kernel@vger.kernel.org, + linux-serial@vger.kernel.org, + linux-arm-kernel@lists.infradead.org, + linux-mediatek@lists.infradead.org + +Commit e32a83c70cf9 ("serial: 8250-mtk: modify mtk uart power and +clock management") introduced polling a debug register to make sure +the UART is idle before disabling the bus clock. However, at least on +some MediaTek SoCs access to that very debug register requires the bus +clock being enabled. Hence calling the suspend function while already +in suspended state results in that register access triggering a bus +error. In order to avoid that, track the state of the bus clock and +only poll the debug register if not already in suspended state. + +Fixes: e32a83c70cf9 ("serial: 8250-mtk: modify mtk uart power and clock management") +Signed-off-by: Daniel Golle +--- + drivers/tty/serial/8250/8250_mtk.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +--- a/drivers/tty/serial/8250/8250_mtk.c ++++ b/drivers/tty/serial/8250/8250_mtk.c +@@ -32,7 +32,7 @@ + #define MTK_UART_RXTRI_AD 0x14 /* RX Trigger address */ + #define MTK_UART_FRACDIV_L 0x15 /* Fractional divider LSB address */ + #define MTK_UART_FRACDIV_M 0x16 /* Fractional divider MSB address */ +-#define MTK_UART_DEBUG0 0x18 ++#define MTK_UART_DEBUG0 0x18 + #define MTK_UART_IER_XOFFI 0x20 /* Enable XOFF character interrupt */ + #define MTK_UART_IER_RTSI 0x40 /* Enable RTS Modem status interrupt */ + #define MTK_UART_IER_CTSI 0x80 /* Enable CTS Modem status interrupt */ +@@ -418,13 +418,12 @@ static int __maybe_unused mtk8250_runtim + struct mtk8250_data *data = dev_get_drvdata(dev); + struct uart_8250_port *up = serial8250_get_port(data->line); + +- /* wait until UART in idle status */ +- while +- (serial_in(up, MTK_UART_DEBUG0)); +- + if (data->clk_count == 0U) { + dev_dbg(dev, "%s clock count is 0\n", __func__); + } else { ++ /* wait until UART in idle status */ ++ while ++ (serial_in(up, MTK_UART_DEBUG0)); + clk_disable_unprepare(data->bus_clk); + data->clk_count--; + } diff --git a/target/linux/generic/pending-6.1/920-mangle_bootargs.patch b/target/linux/generic/pending-6.1/920-mangle_bootargs.patch index 2017f04d0f37f1..1015266084e2a4 100644 --- a/target/linux/generic/pending-6.1/920-mangle_bootargs.patch +++ b/target/linux/generic/pending-6.1/920-mangle_bootargs.patch @@ -13,7 +13,7 @@ Signed-off-by: Imre Kaloz --- a/init/Kconfig +++ b/init/Kconfig -@@ -1826,6 +1826,15 @@ config EMBEDDED +@@ -1827,6 +1827,15 @@ config EMBEDDED an embedded system so certain expert options are available for configuration. diff --git a/target/linux/ipq40xx/Makefile b/target/linux/ipq40xx/Makefile index 53b2f909aeb3ba..b494e66e5d43da 100644 --- a/target/linux/ipq40xx/Makefile +++ b/target/linux/ipq40xx/Makefile @@ -8,7 +8,7 @@ CPU_TYPE:=cortex-a7 CPU_SUBTYPE:=neon-vfpv4 SUBTARGETS:=generic chromium mikrotik -KERNEL_PATCHVER:=5.15 +KERNEL_PATCHVER:=6.1 KERNELNAME:=zImage Image dtbs diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network index 951e0ad0444ba3..babde1b8e220b2 100644 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -25,6 +25,7 @@ ipq40xx_setup_interfaces() p2w,r619ac-128m|\ pakedge,wr-1|\ teltonika,rutx50|\ + yyets,le1|\ zyxel,nbg6617) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan" ;; @@ -56,7 +57,8 @@ ipq40xx_setup_interfaces() mikrotik,lhgg-60ad|\ mikrotik,sxtsq-5-ac|\ netgear,ex6100v2|\ - netgear,ex6150v2) + netgear,ex6150v2|\ + zte,mf282plus) ucidef_set_interface_lan "lan" ;; avm,fritzbox-7530) @@ -72,6 +74,9 @@ ipq40xx_setup_interfaces() devolo,magic-2-wifi-next) ucidef_set_interface_lan "lan1 lan2 ghn" ;; + extreme-networks,ws-ap391x) + ucidef_set_interfaces_lan_wan "sw-eth1 sw-eth2 sw-eth3 sw-eth5" "sw-eth4" + ;; linksys,whw01) ucidef_set_interface_lan "eth1 eth2" ;; @@ -88,6 +93,8 @@ ipq40xx_setup_interfaces() aruba,ap-303h|\ buffalo,wtr-m2133hp|\ ezviz,cs-w3-wd1200g-eup|\ + netgear,rbr40|\ + netgear,rbs40|\ netgear,rbr50|\ netgear,rbs50|\ netgear,srr60|\ @@ -111,6 +118,7 @@ ipq40xx_setup_interfaces() zte,mf286d) ucidef_set_interfaces_lan_wan "lan2 lan3 lan4" "wan" ;; + zte,mf287|\ zte,mf287plus|\ zte,mf287pro) ucidef_set_interface_lan "lan1 lan2 lan3 lan4" diff --git a/target/linux/ipq40xx/base-files/etc/board.d/03_gpio_switches b/target/linux/ipq40xx/base-files/etc/board.d/03_gpio_switches index 2035d84993b7df..ee369d596307fe 100644 --- a/target/linux/ipq40xx/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ipq40xx/base-files/etc/board.d/03_gpio_switches @@ -35,6 +35,7 @@ sony,ncp-hg100-cellular) wallys,dr40x9) ucidef_add_gpio_switch "sim_card_select" "SIM card select" "423" "0" ;; +zte,mf282plus|\ zte,mf286d|\ zte,mf287pro|\ zte,mf289f) diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index e77267bf42dcb7..654be2697a6362 100644 --- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -40,6 +40,8 @@ case "$FIRMWARE" in # OEM assigns 4 sequential MACs ath10k_patch_mac $(macaddr_setbit_la $(macaddr_add "$(cat /sys/class/net/eth0/address)" 4)) ;; + netgear,rbr40|\ + netgear,rbs40|\ netgear,rbr50|\ netgear,rbs50|\ netgear,srr60|\ @@ -92,7 +94,8 @@ case "$FIRMWARE" in caldata_extract "ART" 0x1000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) 2) ;; - extreme-networks,ws-ap3915i) + extreme-networks,ws-ap3915i |\ + extreme-networks,ws-ap391x) caldata_extract "ART" 0x1000 0x2f20 ath10k_patch_mac $(mtd_get_mac_ascii CFG1 RADIOADDR0) ;; @@ -117,6 +120,8 @@ case "$FIRMWARE" in ( [ -f "$wlan_data" ] && caldata_sysfsload_from_file "$wlan_data" 0x0 0x2f20 ) || \ ( [ -d "$wlan_data" ] && caldata_sysfsload_from_file "$wlan_data/data_0" 0x0 0x2f20 ) ;; + netgear,rbr40|\ + netgear,rbs40|\ netgear,rbr50|\ netgear,rbs50|\ netgear,srr60|\ @@ -185,7 +190,8 @@ case "$FIRMWARE" in caldata_extract "ART" 0x5000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) 3) ;; - extreme-networks,ws-ap3915i) + extreme-networks,ws-ap3915i |\ + extreme-networks,ws-ap391x) caldata_extract "ART" 0x5000 0x2f20 ath10k_patch_mac $(mtd_get_mac_ascii CFG1 RADIOADDR1) ;; @@ -211,6 +217,8 @@ case "$FIRMWARE" in ( [ -f "$wlan_data" ] && caldata_sysfsload_from_file "$wlan_data" 0x8000 0x2f20 ) || \ ( [ -d "$wlan_data" ] && caldata_sysfsload_from_file "$wlan_data/data_2" 0x0 0x2f20 ) ;; + netgear,rbr40|\ + netgear,rbs40|\ netgear,rbr50|\ netgear,rbs50|\ netgear,srr60|\ diff --git a/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh b/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh index ce0b55bb80915e..96e70f62a92349 100644 --- a/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh +++ b/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh @@ -20,7 +20,8 @@ preinit_set_mac_address() { base_mac=$(cat /sys/class/net/eth0/address) ip link set dev eth1 address $(macaddr_add "$base_mac" 1) ;; - extreme-networks,ws-ap3915i) + extreme-networks,ws-ap3915i|\ + extreme-networks,ws-ap391x) ip link set dev eth0 address $(mtd_get_mac_ascii CFG1 ethaddr) ;; linksys,ea8300|\ diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh index 83aac330ca2dde..22f2ee9ccc8238 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh @@ -26,7 +26,9 @@ EOF return 1 ;; zte,mf18a |\ + zte,mf282plus|\ zte,mf286d |\ + zte,mf287|\ zte,mf287plus |\ zte,mf287pro |\ zte,mf289f) @@ -191,6 +193,8 @@ platform_do_upgrade() { mikrotik,hap-ac3) platform_do_upgrade_mikrotik_nand "$1" ;; + netgear,rbr40|\ + netgear,rbs40|\ netgear,rbr50 |\ netgear,rbs50 |\ netgear,srr60 |\ @@ -210,7 +214,9 @@ platform_do_upgrade() { teltonika,rutx10 |\ teltonika,rutx50 |\ zte,mf18a |\ + zte,mf282plus |\ zte,mf286d |\ + zte,mf287 |\ zte,mf287plus |\ zte,mf287pro |\ zte,mf289f) diff --git a/target/linux/ipq40xx/config-5.15 b/target/linux/ipq40xx/config-6.1 similarity index 89% rename from target/linux/ipq40xx/config-5.15 rename to target/linux/ipq40xx/config-6.1 index f1fc501010d56e..2619f3f87c2f8d 100644 --- a/target/linux/ipq40xx/config-5.15 +++ b/target/linux/ipq40xx/config-6.1 @@ -7,6 +7,8 @@ CONFIG_ARCH_IPQ40XX=y CONFIG_ARCH_KEEP_MEMBLOCK=y # CONFIG_ARCH_MDM9615 is not set CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +# CONFIG_ARCH_MSM8909 is not set +# CONFIG_ARCH_MSM8916 is not set # CONFIG_ARCH_MSM8960 is not set # CONFIG_ARCH_MSM8974 is not set # CONFIG_ARCH_MSM8X60 is not set @@ -28,9 +30,8 @@ CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y # CONFIG_ARM_ATAG_DTB_COMPAT is not set CONFIG_ARM_CPUIDLE=y # CONFIG_ARM_CPU_TOPOLOGY is not set -CONFIG_ARM_CRYPTO=y CONFIG_ARM_GIC=y -CONFIG_ARM_HAS_SG_CHAIN=y +CONFIG_ARM_HAS_GROUP_RELOCS=y CONFIG_ARM_L1_CACHE_SHIFT=6 CONFIG_ARM_L1_CACHE_SHIFT_6=y CONFIG_ARM_PATCH_IDIV=y @@ -50,12 +51,18 @@ CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_MQ_PCI=y CONFIG_BOUNCE=y # CONFIG_CACHE_L2X0 is not set +CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y +CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" +CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_QCOM=y CONFIG_CLONE_BACKWARDS=y CONFIG_CMDLINE_PARTITION=y CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_QCOM=y +CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 CONFIG_COMPAT_32BIT_TIME=y +CONFIG_CONTEXT_TRACKING=y +CONFIG_CONTEXT_TRACKING_IDLE=y CONFIG_CPUFREQ_DT=y CONFIG_CPUFREQ_DT_PLATDEV=y CONFIG_CPU_32v6K=y @@ -82,6 +89,7 @@ CONFIG_CPU_IDLE=y CONFIG_CPU_IDLE_GOV_LADDER=y CONFIG_CPU_IDLE_GOV_MENU=y CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=y +CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_CPU_PABRT_V7=y CONFIG_CPU_PM=y CONFIG_CPU_RMAP=y @@ -96,6 +104,7 @@ CONFIG_CRC32_SLICEBY8=y CONFIG_CRC8=y CONFIG_CRYPTO_AES_ARM=y CONFIG_CRYPTO_AES_ARM_BS=y +CONFIG_CRYPTO_ARCH_HAVE_LIB_BLAKE2S=y CONFIG_CRYPTO_BLAKE2S_ARM=y CONFIG_CRYPTO_CBC=y CONFIG_CRYPTO_CRYPTD=y @@ -117,9 +126,10 @@ CONFIG_CRYPTO_HASH_INFO=y CONFIG_CRYPTO_HMAC=y CONFIG_CRYPTO_HW=y CONFIG_CRYPTO_JITTERENTROPY=y -CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y CONFIG_CRYPTO_LIB_DES=y +CONFIG_CRYPTO_LIB_SHA1=y CONFIG_CRYPTO_LIB_SHA256=y +CONFIG_CRYPTO_LIB_UTILS=y CONFIG_CRYPTO_LZO=y CONFIG_CRYPTO_RNG=y CONFIG_CRYPTO_RNG2=y @@ -132,14 +142,15 @@ CONFIG_CRYPTO_SHA512=y CONFIG_CRYPTO_SIMD=y CONFIG_CRYPTO_XTS=y CONFIG_CRYPTO_ZSTD=y +CONFIG_CURRENT_POINTER_IN_TPIDRURO=y CONFIG_DCACHE_WORD_ACCESS=y +CONFIG_DEBUG_INFO=y CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" CONFIG_DEBUG_MISC=y CONFIG_DMADEVICES=y CONFIG_DMA_ENGINE=y CONFIG_DMA_OF=y CONFIG_DMA_OPS=y -CONFIG_DMA_REMAP=y CONFIG_DMA_SHARED_BUFFER=y CONFIG_DMA_VIRTUAL_CHANNELS=y CONFIG_DTC=y @@ -147,11 +158,14 @@ CONFIG_DT_IDLE_STATES=y CONFIG_EDAC_ATOMIC_SCRUB=y CONFIG_EDAC_SUPPORT=y CONFIG_EEPROM_AT24=y +CONFIG_EXCLUSIVE_SYSTEM_RAM=y CONFIG_EXTCON=y CONFIG_FIXED_PHY=y CONFIG_FIX_EARLYCON_MEM=y CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y +CONFIG_FW_LOADER_SYSFS=y +CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_CLOCKEVENTS=y @@ -185,7 +199,6 @@ CONFIG_GPIO_CDEV=y CONFIG_GPIO_WATCHDOG=y CONFIG_GPIO_WATCHDOG_ARCH_INITCALL=y CONFIG_GRO_CELLS=y -CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDEN_BRANCH_PREDICTOR=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y @@ -217,6 +230,7 @@ CONFIG_IPQ_GCC_4019=y # CONFIG_IPQ_GCC_8074 is not set # CONFIG_IPQ_LCC_806X is not set CONFIG_IRQCHIP=y +CONFIG_IRQSTACKS=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y CONFIG_IRQ_FASTEOI_HIERARCHY_HANDLERS=y @@ -260,10 +274,12 @@ CONFIG_MMC_SDHCI_MSM=y CONFIG_MMC_SDHCI_PLTFM=y CONFIG_MODULES_USE_ELF_REL=y # CONFIG_MSM_GCC_8660 is not set +# CONFIG_MSM_GCC_8909 is not set # CONFIG_MSM_GCC_8916 is not set # CONFIG_MSM_GCC_8939 is not set # CONFIG_MSM_GCC_8960 is not set # CONFIG_MSM_GCC_8974 is not set +# CONFIG_MSM_GCC_8976 is not set # CONFIG_MSM_GCC_8994 is not set # CONFIG_MSM_GCC_8996 is not set # CONFIG_MSM_GCC_8998 is not set @@ -296,7 +312,7 @@ CONFIG_NEON=y CONFIG_NET_DEVLINK=y CONFIG_NET_DSA=y CONFIG_NET_DSA_QCA8K_IPQ4019=y -CONFIG_NET_DSA_TAG_IPQ4019=y +CONFIG_NET_DSA_TAG_OOB=y CONFIG_NET_FLOW_LIMIT=y CONFIG_NET_PTP_CLASSIFY=y CONFIG_NET_SELFTESTS=y @@ -322,9 +338,11 @@ CONFIG_OF_MDIO=y CONFIG_OLD_SIGACTION=y CONFIG_OLD_SIGSUSPEND3=y CONFIG_OPTEE=y -CONFIG_OPTEE_SHM_NUM_PRIV_PAGES=1 CONFIG_PADATA=y CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PAGE_POOL=y +CONFIG_PAGE_SIZE_LESS_THAN_256KB=y +CONFIG_PAGE_SIZE_LESS_THAN_64KB=y CONFIG_PCI=y CONFIG_PCIEAER=y CONFIG_PCIEPORTBUS=y @@ -341,6 +359,7 @@ CONFIG_PGTABLE_LEVELS=2 CONFIG_PHYLIB=y CONFIG_PHYLINK=y # CONFIG_PHY_QCOM_APQ8064_SATA is not set +# CONFIG_PHY_QCOM_EDP is not set CONFIG_PHY_QCOM_IPQ4019_USB=y # CONFIG_PHY_QCOM_IPQ806X_SATA is not set # CONFIG_PHY_QCOM_IPQ806X_USB is not set @@ -354,37 +373,30 @@ CONFIG_PINCTRL=y # CONFIG_PINCTRL_APQ8064 is not set # CONFIG_PINCTRL_APQ8084 is not set CONFIG_PINCTRL_IPQ4019=y -# CONFIG_PINCTRL_IPQ6018 is not set # CONFIG_PINCTRL_IPQ8064 is not set -# CONFIG_PINCTRL_IPQ8074 is not set # CONFIG_PINCTRL_MDM9615 is not set CONFIG_PINCTRL_MSM=y # CONFIG_PINCTRL_MSM8226 is not set # CONFIG_PINCTRL_MSM8660 is not set +# CONFIG_PINCTRL_MSM8909 is not set # CONFIG_PINCTRL_MSM8916 is not set # CONFIG_PINCTRL_MSM8960 is not set -# CONFIG_PINCTRL_MSM8976 is not set -# CONFIG_PINCTRL_MSM8994 is not set -# CONFIG_PINCTRL_MSM8996 is not set -# CONFIG_PINCTRL_MSM8998 is not set # CONFIG_PINCTRL_QCOM_SPMI_PMIC is not set # CONFIG_PINCTRL_QCOM_SSBI_PMIC is not set -# CONFIG_PINCTRL_QCS404 is not set -# CONFIG_PINCTRL_SC7180 is not set -# CONFIG_PINCTRL_SDM660 is not set -# CONFIG_PINCTRL_SDM845 is not set -# CONFIG_PINCTRL_SM8150 is not set -# CONFIG_PINCTRL_SM8250 is not set +# CONFIG_PINCTRL_SDX65 is not set CONFIG_PM_OPP=y CONFIG_POWER_RESET=y CONFIG_POWER_RESET_GPIO_RESTART=y CONFIG_POWER_RESET_MSM=y CONFIG_POWER_SUPPLY=y CONFIG_PPS=y +CONFIG_PREEMPT_NONE_BUILD=y CONFIG_PRINTK_TIME=y CONFIG_PTP_1588_CLOCK=y CONFIG_PTP_1588_CLOCK_OPTIONAL=y CONFIG_QCA807X_PHY=y +# CONFIG_QCM_DISPCC_2290 is not set +# CONFIG_QCM_GCC_2290 is not set CONFIG_QCOM_A53PLL=y # CONFIG_QCOM_ADM is not set CONFIG_QCOM_BAM_DMA=y @@ -394,6 +406,7 @@ CONFIG_QCOM_BAM_DMA=y # CONFIG_QCOM_GENI_SE is not set # CONFIG_QCOM_GSBI is not set # CONFIG_QCOM_HFPLL is not set +# CONFIG_QCOM_ICC_BWMON is not set # CONFIG_QCOM_IOMMU is not set CONFIG_QCOM_IPQ4019_ESS_EDMA=y # CONFIG_QCOM_LLCC is not set @@ -406,12 +419,15 @@ CONFIG_QCOM_SCM=y CONFIG_QCOM_SMEM=y # CONFIG_QCOM_SMSM is not set # CONFIG_QCOM_SOCINFO is not set +# CONFIG_QCOM_SPM is not set +# CONFIG_QCOM_STATS is not set CONFIG_QCOM_TCSR=y # CONFIG_QCOM_TSENS is not set CONFIG_QCOM_WDT=y # CONFIG_QCS_GCC_404 is not set # CONFIG_QCS_Q6SSTOP_404 is not set # CONFIG_QCS_TURING_404 is not set +CONFIG_RANDSTRUCT_NONE=y CONFIG_RAS=y CONFIG_RATIONAL=y CONFIG_REGMAP=y @@ -430,13 +446,18 @@ CONFIG_RESET_CONTROLLER=y CONFIG_RFS_ACCEL=y CONFIG_RPS=y CONFIG_RTC_CLASS=y +# CONFIG_RTC_DRV_OPTEE is not set CONFIG_RTC_I2C_AND_SPI=y CONFIG_RTC_MC146818_LIB=y CONFIG_RWSEM_SPIN_ON_OWNER=y +# CONFIG_SC_CAMCC_7280 is not set # CONFIG_SC_DISPCC_7180 is not set # CONFIG_SC_GCC_7180 is not set +# CONFIG_SC_GCC_8280XP is not set # CONFIG_SC_GPUCC_7180 is not set +# CONFIG_SC_LPASSCC_7280 is not set # CONFIG_SC_LPASS_CORECC_7180 is not set +# CONFIG_SC_LPASS_CORECC_7280 is not set # CONFIG_SC_MSS_7180 is not set # CONFIG_SC_VIDEOCC_7180 is not set # CONFIG_SDM_CAMCC_845 is not set @@ -446,20 +467,27 @@ CONFIG_RWSEM_SPIN_ON_OWNER=y # CONFIG_SDM_GPUCC_845 is not set # CONFIG_SDM_LPASSCC_845 is not set # CONFIG_SDM_VIDEOCC_845 is not set +# CONFIG_SDX_GCC_65 is not set CONFIG_SERIAL_8250_FSL=y CONFIG_SERIAL_MCTRL_GPIO=y CONFIG_SERIAL_MSM=y CONFIG_SERIAL_MSM_CONSOLE=y CONFIG_SGL_ALLOC=y +CONFIG_SKB_EXTENSIONS=y CONFIG_SMP=y CONFIG_SMP_ON_UP=y +# CONFIG_SM_CAMCC_8450 is not set # CONFIG_SM_GCC_8150 is not set # CONFIG_SM_GCC_8250 is not set +# CONFIG_SM_GCC_8450 is not set +# CONFIG_SM_GPUCC_6350 is not set # CONFIG_SM_GPUCC_8150 is not set # CONFIG_SM_GPUCC_8250 is not set +# CONFIG_SM_GPUCC_8350 is not set # CONFIG_SM_VIDEOCC_8150 is not set # CONFIG_SM_VIDEOCC_8250 is not set CONFIG_SOCK_RX_QUEUE_MAPPING=y +CONFIG_SOFTIRQ_ON_OWN_STACK=y CONFIG_SPARSE_IRQ=y CONFIG_SPI=y CONFIG_SPI_BITBANG=y @@ -481,6 +509,7 @@ CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 CONFIG_THERMAL_GOV_STEP_WISE=y CONFIG_THERMAL_OF=y +CONFIG_THREAD_INFO_IN_TASK=y CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_TIMER_OF=y CONFIG_TIMER_PROBE=y @@ -505,5 +534,6 @@ CONFIG_ZBOOT_ROM_BSS=0 CONFIG_ZBOOT_ROM_TEXT=0 CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y +CONFIG_ZSTD_COMMON=y CONFIG_ZSTD_COMPRESS=y CONFIG_ZSTD_DECOMPRESS=y diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287.dts new file mode 100644 index 00000000000000..43e39bdf960017 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287.dts @@ -0,0 +1,221 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +// Copyright (c) 2022, Pawel Dembicki . +// Copyright (c) 2022, Giammarco Marzano . +// Copyright (c) 2023, Andreas Böhler + +#include "qcom-ipq4018-mf287_common.dtsi" + +/ { + model = "ZTE MF287"; + compatible = "zte,mf287"; +}; + +&gpio_modem_reset { + gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>; +}; + +&key_reset { + gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; +}; + +&key_wps { + gpios = <&tlmm 2 GPIO_ACTIVE_LOW>; +}; + +&led_status { + gpios = <&tlmm 0 GPIO_ACTIVE_LOW>; +}; + +&blsp1_spi1 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + status = "okay"; + cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>, + <&tlmm 59 GPIO_ACTIVE_HIGH>, + <&tlmm 1 GPIO_ACTIVE_HIGH>; + + flash@0 { + compatible = "jedec,spi-nor"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "0:SBL1"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "0:MIBIB"; + reg = <0x40000 0x20000>; + read-only; + }; + + partition@60000 { + label = "0:QSEE"; + reg = <0x60000 0x60000>; + read-only; + }; + + partition@c0000 { + label = "0:CDT"; + reg = <0xc0000 0x10000>; + read-only; + }; + + partition@d0000 { + label = "0:DDRPARAMS"; + reg = <0xd0000 0x10000>; + read-only; + }; + + partition@e0000 { + label = "0:APPSBLENV"; + reg = <0xe0000 0x10000>; + read-only; + }; + + partition@f0000 { + label = "0:APPSBL"; + reg = <0xf0000 0xc0000>; + read-only; + }; + + partition@1b0000 { + label = "0:reserved1"; + reg = <0x1b0000 0x50000>; + read-only; + }; + }; + }; + + spi-nand@1 { /* flash@1 ? */ + compatible = "spi-nand"; + reg = <1>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "fota-flag"; + reg = <0x0 0x140000>; + read-only; + }; + + partition@140000 { + label = "ART"; + reg = <0x140000 0x140000>; + read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + }; + + partition@280000 { + label = "mac"; + reg = <0x280000 0x140000>; + read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mac_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; + + partition@3c0000 { + label = "cfg-param"; + reg = <0x3c0000 0x600000>; + read-only; + }; + + partition@9c0000 { + label = "oops"; + reg = <0x9c0000 0x140000>; + }; + + partition@b00000 { + label = "web"; + reg = <0xb00000 0x800000>; + }; + + partition@1300000 { + label = "rootfs"; + reg = <0x1300000 0x2200000>; + }; + + partition@3500000 { + label = "data"; + reg = <0x3500000 0x1900000>; + }; + + partition@4e00000 { + label = "fota"; + reg = <0x4e00000 0x3200000>; + }; + }; + }; + + zigbee@2 { + #address-cells = <1>; + #size-cells = <0>; + + compatible = "silabs,em3581"; + reg = <2>; + spi-max-frequency = <12000000>; + }; +}; + +&tlmm { + serial_pins: serial_pinmux { + mux { + pins = "gpio60", "gpio61"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pinmux { + function = "blsp_spi0"; + pins = "gpio55", "gpio56", "gpio57"; + drive-strength = <12>; + bias-disable; + }; + + pinmux_cs { + function = "gpio"; + pins = "gpio54", "gpio59", "gpio1"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; +}; + +&wifi0 { + qcom,ath10k-calibration-variant = "zte,mf287"; +}; + +&wifi1{ + qcom,ath10k-calibration-variant = "zte,mf287"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287_common.dtsi similarity index 94% rename from target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287.dtsi rename to target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287_common.dtsi index 3cbe2eaa382068..52272434679cbf 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287.dtsi +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287_common.dtsi @@ -35,6 +35,16 @@ }; }; + gpio_export { + compatible = "gpio-export"; + #size-cells = <0>; + + gpio_modem_reset: modem { + gpio-export,name = "modem-reset"; + gpio-export,output = <0>; + }; + }; + keys { compatible = "gpio-keys"; @@ -171,7 +181,6 @@ status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; nvmem-cells = <&precal_art_1000>, <&macaddr_mac_0>; - qcom,ath10k-calibration-variant = "zte,mf287plus"; }; &wifi1 { @@ -179,5 +188,4 @@ nvmem-cell-names = "pre-calibration", "mac-address"; nvmem-cells = <&precal_art_5000>, <&macaddr_mac_0>; mac-address-increment = <1>; - qcom,ath10k-calibration-variant = "zte,mf287plus"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287plus.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287plus.dts index db8c8c9ad02a9f..f09a77ff59f985 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287plus.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287plus.dts @@ -3,20 +3,15 @@ // Copyright (c) 2022, Giammarco Marzano . // Copyright (c) 2023, Andreas Böhler -#include "qcom-ipq4018-mf287.dtsi" +#include "qcom-ipq4018-mf287_common.dtsi" / { model = "ZTE MF287Plus"; compatible = "zte,mf287plus"; +}; - /* - * This node is used to restart modem module to avoid anomalous - * behaviours on initial communication. - */ - gpio-restart { - compatible = "gpio-restart"; - gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>; - }; +&gpio_modem_reset { + gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>; }; &key_reset { @@ -216,3 +211,11 @@ }; }; }; + +&wifi0 { + qcom,ath10k-calibration-variant = "zte,mf287plus"; +}; + +&wifi1{ + qcom,ath10k-calibration-variant = "zte,mf287plus"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287pro.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287pro.dts index dda0f74449b7c6..4fd44989c5eddc 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287pro.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287pro.dts @@ -3,23 +3,12 @@ // Copyright (c) 2022, Giammarco Marzano . // Copyright (c) 2023, Andreas Böhler -#include "qcom-ipq4018-mf287.dtsi" +#include "qcom-ipq4018-mf287_common.dtsi" / { model = "ZTE MF287Pro"; compatible = "zte,mf287pro"; - gpio_export { - compatible = "gpio-export"; - #size-cells = <0>; - - modem { - gpio-export,name = "modem-reset"; - gpio-export,output = <0>; - gpios = <&tlmm 8 GPIO_ACTIVE_HIGH>; - }; - }; - regulator-usb-vbus { compatible = "regulator-fixed"; regulator-name = "USB_VBUS"; @@ -31,6 +20,10 @@ }; }; +&gpio_modem_reset { + gpios = <&tlmm 8 GPIO_ACTIVE_HIGH>; +}; + &key_reset { gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; }; @@ -263,3 +256,13 @@ }; }; }; + +/* The MF287Plus and MF287Pro share the same board data file */ +&wifi0 { + qcom,ath10k-calibration-variant = "zte,mf287plus"; +}; + +/* The MF287Plus and MF287Pro share the same board data file */ +&wifi1{ + qcom,ath10k-calibration-variant = "zte,mf287plus"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-le1.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-le1.dts new file mode 100644 index 00000000000000..282a0eaaa608c2 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-le1.dts @@ -0,0 +1,326 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "YYeTs LE1"; + compatible = "yyets,le1"; + + aliases { + led-boot = &led_usb; + led-failsafe = &led_usb; + led-upgrade = &led_usb; + + ethernet0 = &swport5; + ethernet1 = &gmac; + label-mac-device = &gmac; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_usb: usb { + label = "green:usb"; + gpios = <&tlmm 36 GPIO_ACTIVE_LOW>; + linux,default-trigger = "usbport"; + trigger-sources = <&usb3_port1>, <&usb3_port2>, <&usb2_port1>; + }; + + wlan2g { + label = "green:wlan2g"; + gpios = <&tlmm 32 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wlan5g { + label = "green:wlan5g"; + gpios = <&tlmm 50 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; + + soc { + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_spi1 { + cs-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>; + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "SBL1"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "MIBIB"; + reg = <0x40000 0x20000>; + read-only; + }; + + partition@60000 { + label = "QSEE"; + reg = <0x60000 0x60000>; + read-only; + }; + + partition@c0000 { + label = "CDT"; + reg = <0xc0000 0x10000>; + read-only; + }; + + partition@d0000 { + label = "DDRPARAMS"; + reg = <0xd0000 0x10000>; + read-only; + }; + + partition@e0000 { + label = "APPSBLENV"; + reg = <0xe0000 0x10000>; + read-only; + }; + + partition@f0000 { + label = "APPSBL"; + reg = <0xf0000 0x80000>; + read-only; + }; + + partition@170000 { + label = "ART"; + reg = <0x170000 0x10000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + }; + + partition@180000 { + compatible = "denx,fit"; + label = "firmware"; + reg = <0x180000 0x1e80000>; + }; + }; + }; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&crypto { + status = "okay"; +}; + +&gmac { + status = "okay"; +}; + +&mdio { + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&prng { + status = "okay"; +}; + +&switch { + status = "okay"; +}; + +&swport1 { + status = "okay"; +}; + +&swport2 { + status = "okay"; +}; + +&swport3 { + status = "okay"; +}; + +&swport4 { + status = "okay"; +}; + +&swport5 { + status = "okay"; +}; + +&tlmm { + mdio_pins: mdio_pinmux { + mux_1 { + pins = "gpio6"; + function = "mdio"; + bias-pull-up; + }; + mux_2 { + pins = "gpio7"; + function = "mdc"; + bias-pull-up; + }; + }; + + serial_pins: serial_pinmux { + mux { + pins = "gpio16", "gpio17"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pinmux { + function = "blsp_spi0"; + pins = "gpio13", "gpio14", "gpio15"; + drive-strength = <12>; + bias-disable; + }; + + pinmux_cs { + function = "gpio"; + pins = "gpio12"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; +}; + +&usb2 { + status = "okay"; + + dwc3@6000000 { + #address-cells = <1>; + #size-cells = <0>; + + usb2_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + }; +}; + +&usb2_hs_phy { + status = "okay"; +}; + +&usb3 { + status = "okay"; + + dwc3@8a00000 { + #address-cells = <1>; + #size-cells = <0>; + + usb3_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + + usb3_port2: port@2 { + reg = <2>; + #trigger-source-cells = <0>; + }; + }; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&usb3_ss_phy { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&wifi0 { + status = "okay"; + nvmem-cells = <&precal_art_1000>; + nvmem-cell-names = "pre-calibration"; + qcom,ath10k-calibration-variant = "YYeTs-LE1"; +}; + +&wifi1 { + status = "okay"; + nvmem-cells = <&precal_art_5000>; + nvmem-cell-names = "pre-calibration"; + qcom,ath10k-calibration-variant = "YYeTs-LE1"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf282plus.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf282plus.dts new file mode 100644 index 00000000000000..6688577c079a5e --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf282plus.dts @@ -0,0 +1,448 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +// Copyright (c) 2022, Pawel Dembicki . +// Copyright (c) 2023, Andreas Böhler + +#include "qcom-ipq4019.dtsi" +#include +#include +#include +#include + +/ { + model = "ZTE MF282Plus"; + compatible = "zte,mf282plus"; + + aliases { + led-boot = &led_internal; + led-failsafe = &led_internal; + led-running = &led_internal; + led-upgrade = &led_internal; + }; + + chosen { + /* + * bootargs forced by u-boot bootipq command: + * 'ubi.mtd=rootfs root=mtd:ubi_rootfs rootfstype=squashfs rootwait' + */ + bootargs-append = " root=/dev/ubiblock0_1"; + }; + + gpio_export { + compatible = "gpio-export"; + #size-cells = <0>; + + modem { + gpio-export,name = "modem-reset"; + gpio-export,output = <0>; + gpios = <&tlmm 8 GPIO_ACTIVE_HIGH>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_internal: led-0 { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&tlmm 10 GPIO_ACTIVE_LOW>; + label = "blue:internal_led"; + default-state = "keep"; + }; + + led-1 { + function = LED_FUNCTION_WLAN; + color = ; + gpios = <&tlmm 61 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + keys { + compatible = "gpio-keys"; + + wifi { + label = "wifi"; + linux,code = ; + gpios = <&tlmm 11 GPIO_ACTIVE_LOW>; + }; + + reset { + label = "reset"; + linux,code = ; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "wps"; + linux,code = ; + gpios = <&tlmm 68 GPIO_ACTIVE_LOW>; + }; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 47 GPIO_ACTIVE_LOW>; + reset-delay-us = <2000>; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + /* select hostmode */ + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + status = "okay"; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + usb2@60f8800 { + status = "okay"; + }; + + usb3@8af8800 { + status = "okay"; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_spi1 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + status = "okay"; + cs-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>; + + flash@0 { + /* u-boot is looking for "n25q128a11" property */ + compatible = "jedec,spi-nor", "n25q128a11"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "0:SBL1"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "0:MIBIB"; + reg = <0x40000 0x20000>; + read-only; + }; + + partition@60000 { + label = "0:QSEE"; + reg = <0x60000 0x60000>; + read-only; + }; + + partition@c0000 { + label = "0:CDT"; + reg = <0xc0000 0x10000>; + read-only; + }; + + partition@d0000 { + label = "0:DDRPARAMS"; + reg = <0xd0000 0x10000>; + read-only; + }; + + partition@e0000 { + label = "0:APPSBLENV"; + reg = <0xe0000 0x10000>; + read-only; + }; + + partition@f0000 { + label = "0:APPSBL"; + reg = <0xf0000 0xc0000>; + read-only; + }; + + partition@1b0000 { + label = "0:reserved1"; + reg = <0x1b0000 0x50000>; + read-only; + }; + }; + }; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&gmac { + status = "okay"; + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_config_0>; +}; + +&nand { + pinctrl-0 = <&nand_pins>; + pinctrl-names = "default"; + status = "okay"; + + nand@0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "fota-flag"; + reg = <0x0 0xa0000>; + read-only; + }; + + partition@a0000 { + label = "ART"; + reg = <0xa0000 0x80000>; + read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + }; + + partition@120000 { + label = "mac"; + reg = <0x120000 0x80000>; + read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; + + partition@1a0000 { + label = "reserved2"; + reg = <0x1a0000 0xc0000>; + read-only; + }; + + partition@260000 { + label = "cfg-param"; + reg = <0x260000 0x400000>; + read-only; + }; + + partition@660000 { + label = "log"; + reg = <0x660000 0x400000>; + }; + + partition@a60000 { + label = "oops"; + reg = <0xa60000 0xa0000>; + }; + + partition@b00000 { + label = "reserved3"; + reg = <0xb00000 0x500000>; + read-only; + }; + + partition@1000000 { + label = "web"; + reg = <0x1000000 0x800000>; + }; + + partition@1800000 { + label = "rootfs"; + reg = <0x1800000 0x1d00000>; + }; + + partition@3500000 { + label = "data"; + reg = <0x3500000 0x1900000>; + }; + + partition@4e00000 { + label = "fota"; + reg = <0x4e00000 0x2800000>; + }; + + partition@7600000 { + label = "extra-cfg"; + reg = <0x7600000 0xa00000>; + }; + }; + }; +}; + +&qpic_bam { + status = "okay"; +}; + +&switch { + status = "okay"; +}; + +&swport4 { + status = "okay"; + + label = "lan"; +}; + +&tlmm { + i2c_0_pins: i2c_0_pinmux { + mux { + pins = "gpio20", "gpio21"; + function = "blsp_i2c0"; + bias-disable; + }; + }; + + mdio_pins: mdio_pinmux { + mux_1 { + pins = "gpio6"; + function = "mdio"; + bias-pull-up; + }; + + mux_2 { + pins = "gpio7"; + function = "mdc"; + bias-pull-up; + }; + }; + + nand_pins: nand_pins { + pullups { + pins = "gpio52", "gpio53", "gpio58", + "gpio59"; + function = "qpic"; + bias-pull-up; + }; + + pulldowns { + pins = "gpio54", "gpio55", "gpio56", + "gpio57", "gpio60", + "gpio62", "gpio63", "gpio64", + "gpio65", "gpio66", "gpio67", + "gpio69"; + function = "qpic"; + bias-pull-down; + }; + }; + + serial_pins: serial_pinmux { + mux { + pins = "gpio16", "gpio17"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pinmux { + function = "blsp_spi0"; + pins = "gpio13", "gpio14", "gpio15"; + drive-strength = <12>; + bias-disable; + }; + + pinmux_cs { + function = "gpio"; + pins = "gpio12"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; +}; + +&usb2_hs_phy { + status = "okay"; +}; + +&usb3_ss_phy { + status = "okay"; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +/* + * The MD5 sum of the board file of the MF286D is identical to the board + * file in the OEM firmware + */ +&wifi0 { + status = "okay"; + nvmem-cell-names = "pre-calibration", "mac-address"; + nvmem-cells = <&precal_art_1000>, <&macaddr_config_0>; + mac-address-increment = <1>; + qcom,ath10k-calibration-variant = "zte,mf286d"; +}; + +/* + * The MD5 sum of the board file of the MF286D is identical to the board + * file in the OEM firmware + */ +&wifi1 { + status = "okay"; + nvmem-cell-names = "pre-calibration", "mac-address"; + nvmem-cells = <&precal_art_5000>, <&macaddr_config_0>; + mac-address-increment = <1>; + qcom,ath10k-calibration-variant = "zte,mf286d"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbr40.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbr40.dts new file mode 100644 index 00000000000000..26e87b808c8eba --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbr40.dts @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019-orbi.dtsi" + +/ { + model = "NETGEAR RBR40"; + compatible = "netgear,rbr40"; + + chosen { + bootargs = "root=/dev/mmcblk0p20 blkdevparts=mmcblk0:512K@17K(0:SBL1)ro,512K(0:BOOTCONFIG)ro,512K(0:QSEE)ro,512K(0:QSEE_ALT)ro,256K(0:CDT)ro,256K(0:CDT_ALT)ro,256K(0:DDRPARAMS)ro,256K(0:APPSBLENV)ro,1M(0:APPSBL)ro,1M(0:APPSBL_ALT)ro,256K(0:ART)ro,256K(ARTMTD)ro,2M(language)ro,256K(config)ro,256K(pot)ro,256K(traffic_meter)ro,256K(pot_bak)ro,256K(traffic_meter.bak)ro,3840K(kernel),31488K(rootfs),35328K@9233K(firmware),256K(mtdoops)ro,1457651200(reserved)ro,-(unallocated) rootfstype=squashfs,ext4 rootwait"; + }; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbs40.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbs40.dts new file mode 100644 index 00000000000000..2dfa0c96546fdb --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbs40.dts @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019-orbi.dtsi" + +/ { + model = "NETGEAR RBS40"; + compatible = "netgear,rbs40"; + + chosen { + bootargs = "root=/dev/mmcblk0p20 blkdevparts=mmcblk0:512K@17K(0:SBL1)ro,512K(0:BOOTCONFIG)ro,512K(0:QSEE)ro,512K(0:QSEE_ALT)ro,256K(0:CDT)ro,256K(0:CDT_ALT)ro,256K(0:DDRPARAMS)ro,256K(0:APPSBLENV)ro,1M(0:APPSBL)ro,1M(0:APPSBL_ALT)ro,256K(0:ART)ro,256K(ARTMTD)ro,2M(language)ro,256K(config)ro,256K(pot)ro,256K(traffic_meter)ro,256K(pot_bak)ro,256K(traffic_meter.bak)ro,3840K(kernel),31488K(rootfs),35328K@9233K(firmware),256K(mtdoops)ro,1457651200(reserved)ro,-(unallocated) rootfstype=squashfs,ext4 rootwait"; + }; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts index 48b5cd53d80bd4..d84d54e39bb868 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts @@ -25,6 +25,15 @@ model = "Compex WPJ428"; compatible = "compex,wpj428"; + chosen { + /* + * There's a chance that SPI reads fail even though the data itself is alright. + * The read result is cached and squashfs can't recover. + * Just panic when that happens and hope that next time it doesn't. + */ + bootargs-append = " rootflags=errors=panic"; + }; + soc { rng@22000 { status = "okay"; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ws-ap391x.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ws-ap391x.dts new file mode 100644 index 00000000000000..04b55b1abf9edf --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ws-ap391x.dts @@ -0,0 +1,344 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "Extreme Networks WS-AP391x"; + compatible = "extreme-networks,ws-ap391x"; + + aliases { + led-boot = &led_system_green; + led-failsafe = &led_system_red; + led-running = &led_system_green; + led-upgrade = &led_system_red; + }; + + soc { + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + }; + + leds { + compatible = "gpio-leds"; + + led_system_green: system_green { + label = "system:green"; + gpios = <&tlmm 49 GPIO_ACTIVE_LOW>; + }; + + /* + * system:amber ==> AP3917 + * system:red ==> AP3916 + * */ + led_system_red: system_red { + label = "system:red_or_system:amber"; + gpios = <&tlmm 50 GPIO_ACTIVE_LOW>; + }; + + led_wlan24_green: wlan24_green { + label = "wlan24:green"; + gpios = <&tlmm 23 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + /* + * wlan24:amber ==> AP3915/AP3917 + * pse:green ==> AP3912 + * */ + led_wlan24_amber: wlan24_amber { + label = "wlan24:amber_or_pse:green"; + gpios = <&tlmm 32 GPIO_ACTIVE_LOW>; + }; + + led_wlan5_green: wlan5_green { + label = "wlan5:green"; + gpios = <&tlmm 22 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + /* iot:blue ==> AP3917 */ + led_iot_green: iot_green { + label = "iot:green_or_iot:blue"; + gpios = <&tlmm 10 GPIO_ACTIVE_LOW>; + }; + + /* eth:green ==> only AP3912/AP3916 */ + led_eth_green: eth_green { + label = "eth:green"; + gpios = <&tlmm 41 GPIO_ACTIVE_LOW>; + }; + + /* + * eth:amber ==> only AP3912/AP3916 + * usb_enable ==> only AP3915e + */ + led_eth_amber: eth_amber { + label = "eth:amber_or_usb_enable"; + gpios = <&tlmm 52 GPIO_ACTIVE_LOW>; + }; + + /* + * wlan5:amber ==> AP3915/AP3917 + * cam:green ==> only AP3916 + */ + led_wlan5_amber: wlan5_amber { + label = "wlan5:amber_or_cam:green"; + gpios = <&tlmm 26 GPIO_ACTIVE_LOW>; + }; + + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&prng { + status = "okay"; +}; + +&mdio { + status = "okay"; + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; +}; + +&crypto { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&usb3_ss_phy { + status = "okay"; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&usb3 { + status = "okay"; +}; + +&usb2_hs_phy { + status = "okay"; +}; + +&usb2 { + status = "okay"; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&qpic_bam { + status = "okay"; +}; + +&gmac { + status = "okay"; +}; + +&switch { + status = "okay"; +}; + +&swport1 { + status = "okay"; + label = "sw-eth1"; +}; + +&swport2 { + status = "okay"; + label = "sw-eth2"; +}; + +&swport3 { + status = "okay"; + label = "sw-eth3"; +}; + +/* "GE2" on AP3917/AP3916/WiNG-AP7662 */ +&swport4 { + status = "okay"; + label = "sw-eth4"; +}; + +/* + * "GE1" on AP3917/AP3916/AP3915/AP7662 + * "LAN1" on EXTR-AP3912 + */ +&swport5 { + status = "okay"; + label = "sw-eth5"; +}; + +&tlmm { + mdio_pins: mdio_pinmux { + mux_1 { + pins = "gpio6"; + function = "mdio"; + bias-pull-up; + }; + mux_2 { + pins = "gpio7"; + function = "mdc"; + bias-pull-up; + }; + }; + + spi_0_pins: spi_0_pinmux { + pin { + function = "blsp_spi0"; + pins = "gpio13", "gpio14", "gpio15"; + drive-strength = <12>; + bias-disable; + }; + pin_cs { + function = "gpio"; + pins = "gpio12"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; + + serial_pins: serial_0_pinmux { + mux { + pins = "gpio16", "gpio17"; + function = "blsp_uart0"; + bias-disable; + }; + }; +}; + +&wifi0 { + status = "okay"; + qcom,ath10k-calibration-variant = "Extreme-Networks-WS-AP3915i"; +}; + +&wifi1 { + status = "okay"; + qcom,ath10k-calibration-variant = "Extreme-Networks-WS-AP3915i"; +}; + +&blsp1_spi1 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + status = "okay"; + cs-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* Layout for 0x0 - 0xe0000 unknown */ + + partition@e0000 { + label = "CFG1"; + compatible = "u-boot,env-redundant-bool"; + reg = <0xe0000 0x10000>; + read-only; + }; + + partition@f0000 { + label = "BootBAK"; + reg = <0xf0000 0x70000>; + read-only; + }; + + partition@160000 { + label = "WINGCFG1"; + reg = <0x160000 0x10000>; + read-only; + }; + + partition@170000 { + label = "ART"; + reg = <0x170000 0x10000>; + read-only; + }; + + partition@180000 { + label = "BootPRI"; + reg = <0x180000 0x70000>; + read-only; + }; + + partition@1f0000 { + label = "WINGCFG2"; + reg = <0x1f0000 0x10000>; + read-only; + }; + + partition@200000 { + label = "FS"; + reg = <0x200000 0x80000>; + read-only; + }; + + partition@280000 { + label = "firmware"; + reg = <0x280000 0xeb0000>; + }; + + partition@1130000 { + label = "firmware2"; + reg = <0x1130000 0xeb0000>; + }; + + partition@1fe0000 { + label = "CFG2"; + compatible = "u-boot,env-redundant-bool"; + reg = <0x1fe0000 0x10000>; + read-only; + }; + }; + }; +}; diff --git a/target/linux/ipq40xx/files/drivers/net/dsa/qca/qca8k-ipq4019.c b/target/linux/ipq40xx/files/drivers/net/dsa/qca/qca8k-ipq4019.c deleted file mode 100644 index 0526445d65391b..00000000000000 --- a/target/linux/ipq40xx/files/drivers/net/dsa/qca/qca8k-ipq4019.c +++ /dev/null @@ -1,1687 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * Copyright (C) 2009 Felix Fietkau - * Copyright (C) 2011-2012, 2020-2021 Gabor Juhos - * Copyright (c) 2015, 2019, The Linux Foundation. All rights reserved. - * Copyright (c) 2016 John Crispin - * Copyright (c) 2021 Robert Marko - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "qca8k-ipq4019.h" - -#define MIB_DESC(_s, _o, _n) \ - { \ - .size = (_s), \ - .offset = (_o), \ - .name = (_n), \ - } - -static const struct qca8k_mib_desc ar8327_mib[] = { - MIB_DESC(1, 0x00, "RxBroad"), - MIB_DESC(1, 0x04, "RxPause"), - MIB_DESC(1, 0x08, "RxMulti"), - MIB_DESC(1, 0x0c, "RxFcsErr"), - MIB_DESC(1, 0x10, "RxAlignErr"), - MIB_DESC(1, 0x14, "RxRunt"), - MIB_DESC(1, 0x18, "RxFragment"), - MIB_DESC(1, 0x1c, "Rx64Byte"), - MIB_DESC(1, 0x20, "Rx128Byte"), - MIB_DESC(1, 0x24, "Rx256Byte"), - MIB_DESC(1, 0x28, "Rx512Byte"), - MIB_DESC(1, 0x2c, "Rx1024Byte"), - MIB_DESC(1, 0x30, "Rx1518Byte"), - MIB_DESC(1, 0x34, "RxMaxByte"), - MIB_DESC(1, 0x38, "RxTooLong"), - MIB_DESC(2, 0x3c, "RxGoodByte"), - MIB_DESC(2, 0x44, "RxBadByte"), - MIB_DESC(1, 0x4c, "RxOverFlow"), - MIB_DESC(1, 0x50, "Filtered"), - MIB_DESC(1, 0x54, "TxBroad"), - MIB_DESC(1, 0x58, "TxPause"), - MIB_DESC(1, 0x5c, "TxMulti"), - MIB_DESC(1, 0x60, "TxUnderRun"), - MIB_DESC(1, 0x64, "Tx64Byte"), - MIB_DESC(1, 0x68, "Tx128Byte"), - MIB_DESC(1, 0x6c, "Tx256Byte"), - MIB_DESC(1, 0x70, "Tx512Byte"), - MIB_DESC(1, 0x74, "Tx1024Byte"), - MIB_DESC(1, 0x78, "Tx1518Byte"), - MIB_DESC(1, 0x7c, "TxMaxByte"), - MIB_DESC(1, 0x80, "TxOverSize"), - MIB_DESC(2, 0x84, "TxByte"), - MIB_DESC(1, 0x8c, "TxCollision"), - MIB_DESC(1, 0x90, "TxAbortCol"), - MIB_DESC(1, 0x94, "TxMultiCol"), - MIB_DESC(1, 0x98, "TxSingleCol"), - MIB_DESC(1, 0x9c, "TxExcDefer"), - MIB_DESC(1, 0xa0, "TxDefer"), - MIB_DESC(1, 0xa4, "TxLateCol"), - MIB_DESC(1, 0xa8, "RXUnicast"), - MIB_DESC(1, 0xac, "TXunicast"), -}; - -static int -qca8k_read(struct qca8k_priv *priv, u32 reg, u32 *val) -{ - return regmap_read(priv->regmap, reg, val); -} - -static int -qca8k_write(struct qca8k_priv *priv, u32 reg, u32 val) -{ - return regmap_write(priv->regmap, reg, val); -} - -static int -qca8k_rmw(struct qca8k_priv *priv, u32 reg, u32 mask, u32 write_val) -{ - return regmap_update_bits(priv->regmap, reg, mask, write_val); -} - -static int -qca8k_reg_set(struct qca8k_priv *priv, u32 reg, u32 val) -{ - return regmap_set_bits(priv->regmap, reg, val); -} - -static int -qca8k_reg_clear(struct qca8k_priv *priv, u32 reg, u32 val) -{ - return regmap_clear_bits(priv->regmap, reg, val); -} - -static const struct regmap_range qca8k_readable_ranges[] = { - regmap_reg_range(0x0000, 0x00e4), /* Global control */ - regmap_reg_range(0x0100, 0x0168), /* EEE control */ - regmap_reg_range(0x0200, 0x0270), /* Parser control */ - regmap_reg_range(0x0400, 0x0454), /* ACL */ - regmap_reg_range(0x0600, 0x0718), /* Lookup */ - regmap_reg_range(0x0800, 0x0b70), /* QM */ - regmap_reg_range(0x0c00, 0x0c80), /* PKT */ - regmap_reg_range(0x0e00, 0x0e98), /* L3 */ - regmap_reg_range(0x1000, 0x10ac), /* MIB - Port0 */ - regmap_reg_range(0x1100, 0x11ac), /* MIB - Port1 */ - regmap_reg_range(0x1200, 0x12ac), /* MIB - Port2 */ - regmap_reg_range(0x1300, 0x13ac), /* MIB - Port3 */ - regmap_reg_range(0x1400, 0x14ac), /* MIB - Port4 */ - regmap_reg_range(0x1500, 0x15ac), /* MIB - Port5 */ - regmap_reg_range(0x1600, 0x16ac), /* MIB - Port6 */ - -}; - -static const struct regmap_access_table qca8k_readable_table = { - .yes_ranges = qca8k_readable_ranges, - .n_yes_ranges = ARRAY_SIZE(qca8k_readable_ranges), -}; - -static struct regmap_config qca8k_ipq4019_regmap_config = { - .reg_bits = 32, - .val_bits = 32, - .reg_stride = 4, - .max_register = 0x16ac, /* end MIB - Port6 range */ - .rd_table = &qca8k_readable_table, -}; - -static struct regmap_config qca8k_ipq4019_psgmii_phy_regmap_config = { - .name = "psgmii-phy", - .reg_bits = 32, - .val_bits = 32, - .reg_stride = 4, - .max_register = 0x7fc, -}; - -static int -qca8k_busy_wait(struct qca8k_priv *priv, u32 reg, u32 mask) -{ - u32 val; - - return regmap_read_poll_timeout(priv->regmap, reg, val, - !(val & mask), - 0, - QCA8K_BUSY_WAIT_TIMEOUT); -} - -static int -qca8k_fdb_read(struct qca8k_priv *priv, struct qca8k_fdb *fdb) -{ - u32 reg[4], val; - int i, ret; - - /* load the ARL table into an array */ - for (i = 0; i < 4; i++) { - ret = qca8k_read(priv, QCA8K_REG_ATU_DATA0 + (i * 4), &val); - if (ret < 0) - return ret; - - reg[i] = val; - } - - /* vid - 83:72 */ - fdb->vid = (reg[2] >> QCA8K_ATU_VID_S) & QCA8K_ATU_VID_M; - /* aging - 67:64 */ - fdb->aging = reg[2] & QCA8K_ATU_STATUS_M; - /* portmask - 54:48 */ - fdb->port_mask = (reg[1] >> QCA8K_ATU_PORT_S) & QCA8K_ATU_PORT_M; - /* mac - 47:0 */ - fdb->mac[0] = (reg[1] >> QCA8K_ATU_ADDR0_S) & 0xff; - fdb->mac[1] = reg[1] & 0xff; - fdb->mac[2] = (reg[0] >> QCA8K_ATU_ADDR2_S) & 0xff; - fdb->mac[3] = (reg[0] >> QCA8K_ATU_ADDR3_S) & 0xff; - fdb->mac[4] = (reg[0] >> QCA8K_ATU_ADDR4_S) & 0xff; - fdb->mac[5] = reg[0] & 0xff; - - return 0; -} - -static void -qca8k_fdb_write(struct qca8k_priv *priv, u16 vid, u8 port_mask, const u8 *mac, - u8 aging) -{ - u32 reg[3] = { 0 }; - int i; - - /* vid - 83:72 */ - reg[2] = (vid & QCA8K_ATU_VID_M) << QCA8K_ATU_VID_S; - /* aging - 67:64 */ - reg[2] |= aging & QCA8K_ATU_STATUS_M; - /* portmask - 54:48 */ - reg[1] = (port_mask & QCA8K_ATU_PORT_M) << QCA8K_ATU_PORT_S; - /* mac - 47:0 */ - reg[1] |= mac[0] << QCA8K_ATU_ADDR0_S; - reg[1] |= mac[1]; - reg[0] |= mac[2] << QCA8K_ATU_ADDR2_S; - reg[0] |= mac[3] << QCA8K_ATU_ADDR3_S; - reg[0] |= mac[4] << QCA8K_ATU_ADDR4_S; - reg[0] |= mac[5]; - - /* load the array into the ARL table */ - for (i = 0; i < 3; i++) - qca8k_write(priv, QCA8K_REG_ATU_DATA0 + (i * 4), reg[i]); -} - -static int -qca8k_fdb_access(struct qca8k_priv *priv, enum qca8k_fdb_cmd cmd, int port) -{ - u32 reg; - int ret; - - /* Set the command and FDB index */ - reg = QCA8K_ATU_FUNC_BUSY; - reg |= cmd; - if (port >= 0) { - reg |= QCA8K_ATU_FUNC_PORT_EN; - reg |= (port & QCA8K_ATU_FUNC_PORT_M) << QCA8K_ATU_FUNC_PORT_S; - } - - /* Write the function register triggering the table access */ - ret = qca8k_write(priv, QCA8K_REG_ATU_FUNC, reg); - if (ret) - return ret; - - /* wait for completion */ - ret = qca8k_busy_wait(priv, QCA8K_REG_ATU_FUNC, QCA8K_ATU_FUNC_BUSY); - if (ret) - return ret; - - /* Check for table full violation when adding an entry */ - if (cmd == QCA8K_FDB_LOAD) { - ret = qca8k_read(priv, QCA8K_REG_ATU_FUNC, ®); - if (ret < 0) - return ret; - if (reg & QCA8K_ATU_FUNC_FULL) - return -1; - } - - return 0; -} - -static int -qca8k_fdb_next(struct qca8k_priv *priv, struct qca8k_fdb *fdb, int port) -{ - int ret; - - qca8k_fdb_write(priv, fdb->vid, fdb->port_mask, fdb->mac, fdb->aging); - ret = qca8k_fdb_access(priv, QCA8K_FDB_NEXT, port); - if (ret < 0) - return ret; - - return qca8k_fdb_read(priv, fdb); -} - -static int -qca8k_fdb_add(struct qca8k_priv *priv, const u8 *mac, u16 port_mask, - u16 vid, u8 aging) -{ - int ret; - - mutex_lock(&priv->reg_mutex); - qca8k_fdb_write(priv, vid, port_mask, mac, aging); - ret = qca8k_fdb_access(priv, QCA8K_FDB_LOAD, -1); - mutex_unlock(&priv->reg_mutex); - - return ret; -} - -static int -qca8k_fdb_del(struct qca8k_priv *priv, const u8 *mac, u16 port_mask, u16 vid) -{ - int ret; - - mutex_lock(&priv->reg_mutex); - qca8k_fdb_write(priv, vid, port_mask, mac, 0); - ret = qca8k_fdb_access(priv, QCA8K_FDB_PURGE, -1); - mutex_unlock(&priv->reg_mutex); - - return ret; -} - -static void -qca8k_fdb_flush(struct qca8k_priv *priv) -{ - mutex_lock(&priv->reg_mutex); - qca8k_fdb_access(priv, QCA8K_FDB_FLUSH, -1); - mutex_unlock(&priv->reg_mutex); -} - -static int -qca8k_vlan_access(struct qca8k_priv *priv, enum qca8k_vlan_cmd cmd, u16 vid) -{ - u32 reg; - int ret; - - /* Set the command and VLAN index */ - reg = QCA8K_VTU_FUNC1_BUSY; - reg |= cmd; - reg |= vid << QCA8K_VTU_FUNC1_VID_S; - - /* Write the function register triggering the table access */ - ret = qca8k_write(priv, QCA8K_REG_VTU_FUNC1, reg); - if (ret) - return ret; - - /* wait for completion */ - ret = qca8k_busy_wait(priv, QCA8K_REG_VTU_FUNC1, QCA8K_VTU_FUNC1_BUSY); - if (ret) - return ret; - - /* Check for table full violation when adding an entry */ - if (cmd == QCA8K_VLAN_LOAD) { - ret = qca8k_read(priv, QCA8K_REG_VTU_FUNC1, ®); - if (ret < 0) - return ret; - if (reg & QCA8K_VTU_FUNC1_FULL) - return -ENOMEM; - } - - return 0; -} - -static int -qca8k_vlan_add(struct qca8k_priv *priv, u8 port, u16 vid, bool untagged) -{ - u32 reg; - int ret; - - /* - We do the right thing with VLAN 0 and treat it as untagged while - preserving the tag on egress. - */ - if (vid == 0) - return 0; - - mutex_lock(&priv->reg_mutex); - ret = qca8k_vlan_access(priv, QCA8K_VLAN_READ, vid); - if (ret < 0) - goto out; - - ret = qca8k_read(priv, QCA8K_REG_VTU_FUNC0, ®); - if (ret < 0) - goto out; - reg |= QCA8K_VTU_FUNC0_VALID | QCA8K_VTU_FUNC0_IVL_EN; - reg &= ~(QCA8K_VTU_FUNC0_EG_MODE_MASK << QCA8K_VTU_FUNC0_EG_MODE_S(port)); - if (untagged) - reg |= QCA8K_VTU_FUNC0_EG_MODE_UNTAG << - QCA8K_VTU_FUNC0_EG_MODE_S(port); - else - reg |= QCA8K_VTU_FUNC0_EG_MODE_TAG << - QCA8K_VTU_FUNC0_EG_MODE_S(port); - - ret = qca8k_write(priv, QCA8K_REG_VTU_FUNC0, reg); - if (ret) - goto out; - ret = qca8k_vlan_access(priv, QCA8K_VLAN_LOAD, vid); - -out: - mutex_unlock(&priv->reg_mutex); - - return ret; -} - -static int -qca8k_vlan_del(struct qca8k_priv *priv, u8 port, u16 vid) -{ - u32 reg, mask; - int ret, i; - bool del; - - mutex_lock(&priv->reg_mutex); - ret = qca8k_vlan_access(priv, QCA8K_VLAN_READ, vid); - if (ret < 0) - goto out; - - ret = qca8k_read(priv, QCA8K_REG_VTU_FUNC0, ®); - if (ret < 0) - goto out; - reg &= ~(3 << QCA8K_VTU_FUNC0_EG_MODE_S(port)); - reg |= QCA8K_VTU_FUNC0_EG_MODE_NOT << - QCA8K_VTU_FUNC0_EG_MODE_S(port); - - /* Check if we're the last member to be removed */ - del = true; - for (i = 0; i < QCA8K_NUM_PORTS; i++) { - mask = QCA8K_VTU_FUNC0_EG_MODE_NOT; - mask <<= QCA8K_VTU_FUNC0_EG_MODE_S(i); - - if ((reg & mask) != mask) { - del = false; - break; - } - } - - if (del) { - ret = qca8k_vlan_access(priv, QCA8K_VLAN_PURGE, vid); - } else { - ret = qca8k_write(priv, QCA8K_REG_VTU_FUNC0, reg); - if (ret) - goto out; - ret = qca8k_vlan_access(priv, QCA8K_VLAN_LOAD, vid); - } - -out: - mutex_unlock(&priv->reg_mutex); - - return ret; -} - -static int -qca8k_mib_init(struct qca8k_priv *priv) -{ - int ret; - - mutex_lock(&priv->reg_mutex); - ret = qca8k_reg_set(priv, QCA8K_REG_MIB, QCA8K_MIB_FLUSH | QCA8K_MIB_BUSY); - if (ret) - goto exit; - - ret = qca8k_busy_wait(priv, QCA8K_REG_MIB, QCA8K_MIB_BUSY); - if (ret) - goto exit; - - ret = qca8k_reg_set(priv, QCA8K_REG_MIB, QCA8K_MIB_CPU_KEEP); - if (ret) - goto exit; - - ret = qca8k_write(priv, QCA8K_REG_MODULE_EN, QCA8K_MODULE_EN_MIB); - -exit: - mutex_unlock(&priv->reg_mutex); - return ret; -} - -static void -qca8k_port_set_status(struct qca8k_priv *priv, int port, int enable) -{ - u32 mask = QCA8K_PORT_STATUS_TXMAC | QCA8K_PORT_STATUS_RXMAC; - - /* Port 0 is internally connected to the CPU - * TODO: Probably check for RGMII as well if it doesnt work - * in RGMII mode. - */ - if (port > QCA8K_CPU_PORT) - mask |= QCA8K_PORT_STATUS_LINK_AUTO; - - if (enable) - qca8k_reg_set(priv, QCA8K_REG_PORT_STATUS(port), mask); - else - qca8k_reg_clear(priv, QCA8K_REG_PORT_STATUS(port), mask); -} - -static int -qca8k_setup_port(struct dsa_switch *ds, int port) -{ - struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv; - int ret; - - /* CPU port gets connected to all user ports of the switch */ - if (dsa_is_cpu_port(ds, port)) { - ret = qca8k_rmw(priv, QCA8K_PORT_LOOKUP_CTRL(QCA8K_CPU_PORT), - QCA8K_PORT_LOOKUP_MEMBER, dsa_user_ports(ds)); - if (ret) - return ret; - - /* Disable CPU ARP Auto-learning by default */ - ret = qca8k_reg_clear(priv, QCA8K_PORT_LOOKUP_CTRL(QCA8K_CPU_PORT), - QCA8K_PORT_LOOKUP_LEARN); - if (ret) - return ret; - } - - /* Individual user ports get connected to CPU port only */ - if (dsa_is_user_port(ds, port)) { - int shift = 16 * (port % 2); - - ret = qca8k_rmw(priv, QCA8K_PORT_LOOKUP_CTRL(port), - QCA8K_PORT_LOOKUP_MEMBER, - BIT(QCA8K_CPU_PORT)); - if (ret) - return ret; - - /* Enable ARP Auto-learning by default */ - ret = qca8k_reg_set(priv, QCA8K_PORT_LOOKUP_CTRL(port), - QCA8K_PORT_LOOKUP_LEARN); - if (ret) - return ret; - - /* For port based vlans to work we need to set the - * default egress vid - */ - ret = qca8k_rmw(priv, QCA8K_EGRESS_VLAN(port), - 0xfff << shift, - QCA8K_PORT_VID_DEF << shift); - if (ret) - return ret; - - ret = qca8k_write(priv, QCA8K_REG_PORT_VLAN_CTRL0(port), - QCA8K_PORT_VLAN_CVID(QCA8K_PORT_VID_DEF) | - QCA8K_PORT_VLAN_SVID(QCA8K_PORT_VID_DEF)); - if (ret) - return ret; - } - - return 0; -} - -static int -qca8k_setup(struct dsa_switch *ds) -{ - struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv; - int ret, i; - - /* Make sure that port 0 is the cpu port */ - if (!dsa_is_cpu_port(ds, 0)) { - dev_err(priv->dev, "port 0 is not the CPU port"); - return -EINVAL; - } - - /* Enable CPU Port */ - ret = qca8k_reg_set(priv, QCA8K_REG_GLOBAL_FW_CTRL0, - QCA8K_GLOBAL_FW_CTRL0_CPU_PORT_EN); - if (ret) { - dev_err(priv->dev, "failed enabling CPU port"); - return ret; - } - - /* Enable MIB counters */ - ret = qca8k_mib_init(priv); - if (ret) - dev_warn(priv->dev, "MIB init failed"); - - /* Enable QCA header mode on the cpu port */ - ret = qca8k_write(priv, QCA8K_REG_PORT_HDR_CTRL(QCA8K_CPU_PORT), - QCA8K_PORT_HDR_CTRL_ALL << QCA8K_PORT_HDR_CTRL_TX_S | - QCA8K_PORT_HDR_CTRL_ALL << QCA8K_PORT_HDR_CTRL_RX_S); - if (ret) { - dev_err(priv->dev, "failed enabling QCA header mode"); - return ret; - } - - /* Disable forwarding by default on all ports */ - for (i = 0; i < QCA8K_NUM_PORTS; i++) { - ret = qca8k_rmw(priv, QCA8K_PORT_LOOKUP_CTRL(i), - QCA8K_PORT_LOOKUP_MEMBER, 0); - if (ret) - return ret; - } - - /* Disable MAC by default on all ports */ - for (i = 1; i < QCA8K_NUM_PORTS; i++) - qca8k_port_set_status(priv, i, 0); - - /* Forward all unknown frames to CPU port for Linux processing */ - ret = qca8k_write(priv, QCA8K_REG_GLOBAL_FW_CTRL1, - BIT(QCA8K_CPU_PORT) << QCA8K_GLOBAL_FW_CTRL1_IGMP_DP_S | - BIT(QCA8K_CPU_PORT) << QCA8K_GLOBAL_FW_CTRL1_BC_DP_S | - BIT(QCA8K_CPU_PORT) << QCA8K_GLOBAL_FW_CTRL1_MC_DP_S | - BIT(QCA8K_CPU_PORT) << QCA8K_GLOBAL_FW_CTRL1_UC_DP_S); - if (ret) - return ret; - - /* Setup connection between CPU port & user ports */ - for (i = 0; i < QCA8K_NUM_PORTS; i++) { - ret = qca8k_setup_port(ds, i); - if (ret) - return ret; - } - - /* Setup our port MTUs to match power on defaults */ - for (i = 0; i < QCA8K_NUM_PORTS; i++) - /* Set per port MTU to 1500 as the MTU change function - * will add the overhead and if its set to 1518 then it - * will apply the overhead again and we will end up with - * MTU of 1536 instead of 1518 - */ - priv->port_mtu[i] = ETH_DATA_LEN; - ret = qca8k_write(priv, QCA8K_MAX_FRAME_SIZE, ETH_FRAME_LEN + ETH_FCS_LEN); - if (ret) - dev_warn(priv->dev, "failed setting MTU settings"); - - /* Flush the FDB table */ - qca8k_fdb_flush(priv); - - /* We don't have interrupts for link changes, so we need to poll */ - ds->pcs_poll = true; - - /* CPU port HW learning doesnt work correctly, so let DSA handle it */ - ds->assisted_learning_on_cpu_port = true; - - return 0; -} - -static int psgmii_vco_calibrate(struct qca8k_priv *priv) -{ - int val, ret; - - if (!priv->psgmii_ethphy) { - dev_err(priv->dev, "PSGMII eth PHY missing, calibration failed!\n"); - return -ENODEV; - } - - /* Fix PSGMII RX 20bit */ - ret = phy_write(priv->psgmii_ethphy, MII_BMCR, 0x5b); - /* Reset PHY PSGMII */ - ret = phy_write(priv->psgmii_ethphy, MII_BMCR, 0x1b); - /* Release PHY PSGMII reset */ - ret = phy_write(priv->psgmii_ethphy, MII_BMCR, 0x5b); - - /* Poll for VCO PLL calibration finish - Malibu(QCA8075) */ - ret = phy_read_mmd_poll_timeout(priv->psgmii_ethphy, - MDIO_MMD_PMAPMD, - 0x28, val, - (val & BIT(0)), - 10000, 1000000, - false); - if (ret) { - dev_err(priv->dev, "QCA807x PSGMII VCO calibration PLL not ready\n"); - return ret; - } - mdelay(50); - - /* Freeze PSGMII RX CDR */ - ret = phy_write(priv->psgmii_ethphy, MII_RESV2, 0x2230); - - /* Start PSGMIIPHY VCO PLL calibration */ - ret = regmap_set_bits(priv->psgmii, - PSGMIIPHY_VCO_CALIBRATION_CONTROL_REGISTER_1, - PSGMIIPHY_REG_PLL_VCO_CALIB_RESTART); - - /* Poll for PSGMIIPHY PLL calibration finish - Dakota(IPQ40xx) */ - ret = regmap_read_poll_timeout(priv->psgmii, - PSGMIIPHY_VCO_CALIBRATION_CONTROL_REGISTER_2, - val, val & PSGMIIPHY_REG_PLL_VCO_CALIB_READY, - 10000, 1000000); - if (ret) { - dev_err(priv->dev, "IPQ PSGMIIPHY VCO calibration PLL not ready\n"); - return ret; - } - mdelay(50); - - /* Release PSGMII RX CDR */ - ret = phy_write(priv->psgmii_ethphy, MII_RESV2, 0x3230); - /* Release PSGMII RX 20bit */ - ret = phy_write(priv->psgmii_ethphy, MII_BMCR, 0x5f); - mdelay(200); - - return ret; -} - -static void -qca8k_switch_port_loopback_on_off(struct qca8k_priv *priv, int port, int on) -{ - u32 val = QCA8K_PORT_LOOKUP_LOOPBACK; - - if (on == 0) - val = 0; - - qca8k_rmw(priv, QCA8K_PORT_LOOKUP_CTRL(port), - QCA8K_PORT_LOOKUP_LOOPBACK, val); -} - -static int -qca8k_wait_for_phy_link_state(struct phy_device *phy, int need_status) -{ - int a; - u16 status; - - for (a = 0; a < 100; a++) { - status = phy_read(phy, MII_QCA8075_SSTATUS); - status &= QCA8075_PHY_SPEC_STATUS_LINK; - status = !!status; - if (status == need_status) - return 0; - mdelay(8); - } - - return -1; -} - -static void -qca8k_phy_loopback_on_off(struct qca8k_priv *priv, struct phy_device *phy, - int sw_port, int on) -{ - if (on) { - phy_write(phy, MII_BMCR, BMCR_ANENABLE | BMCR_RESET); - phy_modify(phy, MII_BMCR, BMCR_PDOWN, BMCR_PDOWN); - qca8k_wait_for_phy_link_state(phy, 0); - qca8k_write(priv, QCA8K_REG_PORT_STATUS(sw_port), 0); - phy_write(phy, MII_BMCR, - BMCR_SPEED1000 | - BMCR_FULLDPLX | - BMCR_LOOPBACK); - qca8k_wait_for_phy_link_state(phy, 1); - qca8k_write(priv, QCA8K_REG_PORT_STATUS(sw_port), - QCA8K_PORT_STATUS_SPEED_1000 | - QCA8K_PORT_STATUS_TXMAC | - QCA8K_PORT_STATUS_RXMAC | - QCA8K_PORT_STATUS_DUPLEX); - qca8k_rmw(priv, QCA8K_PORT_LOOKUP_CTRL(sw_port), - QCA8K_PORT_LOOKUP_STATE_FORWARD, - QCA8K_PORT_LOOKUP_STATE_FORWARD); - } else { /* off */ - qca8k_write(priv, QCA8K_REG_PORT_STATUS(sw_port), 0); - qca8k_rmw(priv, QCA8K_PORT_LOOKUP_CTRL(sw_port), - QCA8K_PORT_LOOKUP_STATE_DISABLED, - QCA8K_PORT_LOOKUP_STATE_DISABLED); - phy_write(phy, MII_BMCR, BMCR_SPEED1000 | BMCR_ANENABLE | BMCR_RESET); - /* turn off the power of the phys - so that unused - ports do not raise links */ - phy_modify(phy, MII_BMCR, BMCR_PDOWN, BMCR_PDOWN); - } -} - -static void -qca8k_phy_pkt_gen_prep(struct qca8k_priv *priv, struct phy_device *phy, - int pkts_num, int on) -{ - if (on) { - /* enable CRC checker and packets counters */ - phy_write_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_CRC_AND_PKTS_COUNT, 0); - phy_write_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_CRC_AND_PKTS_COUNT, - QCA8075_MMD7_CNT_FRAME_CHK_EN | QCA8075_MMD7_CNT_SELFCLR); - qca8k_wait_for_phy_link_state(phy, 1); - /* packet number */ - phy_write_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_PKT_GEN_PKT_NUMB, pkts_num); - /* pkt size - 1504 bytes + 20 bytes */ - phy_write_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_PKT_GEN_PKT_SIZE, 1504); - } else { /* off */ - /* packet number */ - phy_write_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_PKT_GEN_PKT_NUMB, 0); - /* disable CRC checker and packet counter */ - phy_write_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_CRC_AND_PKTS_COUNT, 0); - /* disable traffic gen */ - phy_write_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_PKT_GEN_CTRL, 0); - } -} - -static void -qca8k_wait_for_phy_pkt_gen_fin(struct qca8k_priv *priv, struct phy_device *phy) -{ - int val; - /* wait for all traffic end: 4096(pkt num)*1524(size)*8ns(125MHz)=49938us */ - phy_read_mmd_poll_timeout(phy, MDIO_MMD_AN, QCA8075_MMD7_PKT_GEN_CTRL, - val, !(val & QCA8075_MMD7_PKT_GEN_INPROGR), - 50000, 1000000, true); -} - -static void -qca8k_start_phy_pkt_gen(struct phy_device *phy) -{ - /* start traffic gen */ - phy_write_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_PKT_GEN_CTRL, - QCA8075_MMD7_PKT_GEN_START | QCA8075_MMD7_PKT_GEN_INPROGR); -} - -static int -qca8k_start_all_phys_pkt_gens(struct qca8k_priv *priv) -{ - struct phy_device *phy; - phy = phy_device_create(priv->bus, QCA8075_MDIO_BRDCST_PHY_ADDR, - 0, 0, NULL); - if (!phy) { - dev_err(priv->dev, "unable to create mdio broadcast PHY(0x%x)\n", - QCA8075_MDIO_BRDCST_PHY_ADDR); - return -ENODEV; - } - - qca8k_start_phy_pkt_gen(phy); - - phy_device_free(phy); - return 0; -} - -static int -qca8k_get_phy_pkt_gen_test_result(struct phy_device *phy, int pkts_num) -{ - u32 tx_ok, tx_error; - u32 rx_ok, rx_error; - u32 tx_ok_high16; - u32 rx_ok_high16; - u32 tx_all_ok, rx_all_ok; - - /* check counters */ - tx_ok = phy_read_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_EG_FRAME_RECV_CNT_LO); - tx_ok_high16 = phy_read_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_EG_FRAME_RECV_CNT_HI); - tx_error = phy_read_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_EG_FRAME_ERR_CNT); - rx_ok = phy_read_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_IG_FRAME_RECV_CNT_LO); - rx_ok_high16 = phy_read_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_IG_FRAME_RECV_CNT_HI); - rx_error = phy_read_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_IG_FRAME_ERR_CNT); - tx_all_ok = tx_ok + (tx_ok_high16 << 16); - rx_all_ok = rx_ok + (rx_ok_high16 << 16); - - if (tx_all_ok < pkts_num) - return -1; - if(rx_all_ok < pkts_num) - return -2; - if(tx_error) - return -3; - if(rx_error) - return -4; - return 0; /* test is ok */ -} - -static -void qca8k_phy_broadcast_write_on_off(struct qca8k_priv *priv, - struct phy_device *phy, int on) -{ - u32 val; - - val = phy_read_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_MDIO_BRDCST_WRITE); - - if (on == 0) - val &= ~QCA8075_MMD7_MDIO_BRDCST_WRITE_EN; - else - val |= QCA8075_MMD7_MDIO_BRDCST_WRITE_EN; - - phy_write_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_MDIO_BRDCST_WRITE, val); -} - -static int -qca8k_test_dsa_port_for_errors(struct qca8k_priv *priv, struct phy_device *phy, - int port, int test_phase) -{ - int res = 0; - const int test_pkts_num = QCA8075_PKT_GEN_PKTS_COUNT; - - if (test_phase == 1) { /* start test preps */ - qca8k_phy_loopback_on_off(priv, phy, port, 1); - qca8k_switch_port_loopback_on_off(priv, port, 1); - qca8k_phy_broadcast_write_on_off(priv, phy, 1); - qca8k_phy_pkt_gen_prep(priv, phy, test_pkts_num, 1); - } else if (test_phase == 2) { - /* wait for test results, collect it and cleanup */ - qca8k_wait_for_phy_pkt_gen_fin(priv, phy); - res = qca8k_get_phy_pkt_gen_test_result(phy, test_pkts_num); - qca8k_phy_pkt_gen_prep(priv, phy, test_pkts_num, 0); - qca8k_phy_broadcast_write_on_off(priv, phy, 0); - qca8k_switch_port_loopback_on_off(priv, port, 0); - qca8k_phy_loopback_on_off(priv, phy, port, 0); - } - - return res; -} - -static int -qca8k_do_dsa_sw_ports_self_test(struct qca8k_priv *priv, int parallel_test) -{ - struct device_node *dn = priv->dev->of_node; - struct device_node *ports, *port; - struct device_node *phy_dn; - struct phy_device *phy; - int reg, err = 0, test_phase; - u32 tests_result = 0; - - ports = of_get_child_by_name(dn, "ports"); - if (!ports) { - dev_err(priv->dev, "no ports child node found\n"); - return -EINVAL; - } - - for (test_phase = 1; test_phase <= 2; test_phase++) { - if (parallel_test && test_phase == 2) { - err = qca8k_start_all_phys_pkt_gens(priv); - if (err) - goto error; - } - for_each_available_child_of_node(ports, port) { - err = of_property_read_u32(port, "reg", ®); - if (err) - goto error; - if (reg >= QCA8K_NUM_PORTS) { - err = -EINVAL; - goto error; - } - phy_dn = of_parse_phandle(port, "phy-handle", 0); - if (phy_dn) { - phy = of_phy_find_device(phy_dn); - of_node_put(phy_dn); - if (phy) { - int result; - result = qca8k_test_dsa_port_for_errors(priv, - phy, reg, test_phase); - if (!parallel_test && test_phase == 1) - qca8k_start_phy_pkt_gen(phy); - put_device(&phy->mdio.dev); - if (test_phase == 2) { - tests_result <<= 1; - if (result) - tests_result |= 1; - } - } - } - } - } - -end: - of_node_put(ports); - qca8k_fdb_flush(priv); - return tests_result; -error: - tests_result |= 0xf000; - goto end; -} - -static int -psgmii_vco_calibrate_and_test(struct dsa_switch *ds) -{ - int ret, a, test_result; - struct qca8k_priv *priv = ds->priv; - - for (a = 0; a <= QCA8K_PSGMII_CALB_NUM; a++) { - ret = psgmii_vco_calibrate(priv); - if (ret) - return ret; - /* first we run serial test */ - test_result = qca8k_do_dsa_sw_ports_self_test(priv, 0); - /* and if it is ok then we run the test in parallel */ - if (!test_result) - test_result = qca8k_do_dsa_sw_ports_self_test(priv, 1); - if (!test_result) { - if (a > 0) { - dev_warn(priv->dev, "PSGMII work was stabilized after %d " - "calibration retries !\n", a); - } - return 0; - } else { - schedule(); - if (a > 0 && a % 10 == 0) { - dev_err(priv->dev, "PSGMII work is unstable !!! " - "Let's try to wait a bit ... %d\n", a); - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(msecs_to_jiffies(a * 100)); - } - } - } - - panic("PSGMII work is unstable !!! " - "Repeated recalibration attempts did not help(0x%x) !\n", - test_result); - - return -EFAULT; -} - -static int -ipq4019_psgmii_configure(struct dsa_switch *ds) -{ - struct qca8k_priv *priv = ds->priv; - int ret; - - if (!priv->psgmii_calibrated) { - ret = psgmii_vco_calibrate_and_test(ds); - - ret = regmap_clear_bits(priv->psgmii, PSGMIIPHY_MODE_CONTROL, - PSGMIIPHY_MODE_ATHR_CSCO_MODE_25M); - ret = regmap_write(priv->psgmii, PSGMIIPHY_TX_CONTROL, - PSGMIIPHY_TX_CONTROL_MAGIC_VALUE); - - priv->psgmii_calibrated = true; - - return ret; - } - - return 0; -} - -static void -qca8k_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode, - const struct phylink_link_state *state) -{ - struct qca8k_priv *priv = ds->priv; - - switch (port) { - case 0: - /* CPU port, no configuration needed */ - return; - case 1: - case 2: - case 3: - if (state->interface == PHY_INTERFACE_MODE_PSGMII) - if (ipq4019_psgmii_configure(ds)) - dev_err(ds->dev, "PSGMII configuration failed!\n"); - return; - case 4: - case 5: - if (state->interface == PHY_INTERFACE_MODE_RGMII || - state->interface == PHY_INTERFACE_MODE_RGMII_ID || - state->interface == PHY_INTERFACE_MODE_RGMII_RXID || - state->interface == PHY_INTERFACE_MODE_RGMII_TXID) { - qca8k_reg_set(priv, QCA8K_REG_RGMII_CTRL, QCA8K_RGMII_CTRL_CLK); - } - - if (state->interface == PHY_INTERFACE_MODE_PSGMII) - if (ipq4019_psgmii_configure(ds)) - dev_err(ds->dev, "PSGMII configuration failed!\n"); - return; - default: - dev_err(ds->dev, "%s: unsupported port: %i\n", __func__, port); - return; - } -} - -static void -qca8k_phylink_validate(struct dsa_switch *ds, int port, - unsigned long *supported, - struct phylink_link_state *state) -{ - __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; - - switch (port) { - case 0: /* CPU port */ - if (state->interface != PHY_INTERFACE_MODE_INTERNAL) - goto unsupported; - break; - case 1: - case 2: - case 3: - /* Only PSGMII mode is supported */ - if (state->interface != PHY_INTERFACE_MODE_PSGMII) - goto unsupported; - break; - case 4: - case 5: - /* PSGMII and RGMII modes are supported */ - if (state->interface != PHY_INTERFACE_MODE_PSGMII && - state->interface != PHY_INTERFACE_MODE_RGMII && - state->interface != PHY_INTERFACE_MODE_RGMII_ID && - state->interface != PHY_INTERFACE_MODE_RGMII_RXID && - state->interface != PHY_INTERFACE_MODE_RGMII_TXID) - goto unsupported; - break; - default: -unsupported: - dev_warn(ds->dev, "interface '%s' (%d) on port %d is not supported\n", - phy_modes(state->interface), state->interface, port); - linkmode_zero(supported); - return; - } - - if (port == 0) { - phylink_set_port_modes(mask); - - phylink_set(mask, 1000baseT_Full); - - phylink_set(mask, Pause); - phylink_set(mask, Asym_Pause); - - linkmode_and(supported, supported, mask); - linkmode_and(state->advertising, state->advertising, mask); - } else { - /* Simply copy what PHYs tell us */ - linkmode_copy(state->advertising, supported); - } -} - -static int -qca8k_phylink_mac_link_state(struct dsa_switch *ds, int port, - struct phylink_link_state *state) -{ - struct qca8k_priv *priv = ds->priv; - u32 reg; - int ret; - - ret = qca8k_read(priv, QCA8K_REG_PORT_STATUS(port), ®); - if (ret < 0) - return ret; - - state->link = !!(reg & QCA8K_PORT_STATUS_LINK_UP); - state->an_complete = state->link; - state->an_enabled = !!(reg & QCA8K_PORT_STATUS_LINK_AUTO); - state->duplex = (reg & QCA8K_PORT_STATUS_DUPLEX) ? DUPLEX_FULL : - DUPLEX_HALF; - - switch (reg & QCA8K_PORT_STATUS_SPEED) { - case QCA8K_PORT_STATUS_SPEED_10: - state->speed = SPEED_10; - break; - case QCA8K_PORT_STATUS_SPEED_100: - state->speed = SPEED_100; - break; - case QCA8K_PORT_STATUS_SPEED_1000: - state->speed = SPEED_1000; - break; - default: - state->speed = SPEED_UNKNOWN; - break; - } - - state->pause = MLO_PAUSE_NONE; - if (reg & QCA8K_PORT_STATUS_RXFLOW) - state->pause |= MLO_PAUSE_RX; - if (reg & QCA8K_PORT_STATUS_TXFLOW) - state->pause |= MLO_PAUSE_TX; - - return 1; -} - -static void -qca8k_phylink_mac_link_down(struct dsa_switch *ds, int port, unsigned int mode, - phy_interface_t interface) -{ - struct qca8k_priv *priv = ds->priv; - - qca8k_port_set_status(priv, port, 0); -} - -static void -qca8k_phylink_mac_link_up(struct dsa_switch *ds, int port, unsigned int mode, - phy_interface_t interface, struct phy_device *phydev, - int speed, int duplex, bool tx_pause, bool rx_pause) -{ - struct qca8k_priv *priv = ds->priv; - u32 reg; - - if (phylink_autoneg_inband(mode)) { - reg = QCA8K_PORT_STATUS_LINK_AUTO; - } else { - switch (speed) { - case SPEED_10: - reg = QCA8K_PORT_STATUS_SPEED_10; - break; - case SPEED_100: - reg = QCA8K_PORT_STATUS_SPEED_100; - break; - case SPEED_1000: - reg = QCA8K_PORT_STATUS_SPEED_1000; - break; - default: - reg = QCA8K_PORT_STATUS_LINK_AUTO; - break; - } - - if (duplex == DUPLEX_FULL) - reg |= QCA8K_PORT_STATUS_DUPLEX; - - if (rx_pause || dsa_is_cpu_port(ds, port)) - reg |= QCA8K_PORT_STATUS_RXFLOW; - - if (tx_pause || dsa_is_cpu_port(ds, port)) - reg |= QCA8K_PORT_STATUS_TXFLOW; - } - - reg |= QCA8K_PORT_STATUS_TXMAC | QCA8K_PORT_STATUS_RXMAC; - - qca8k_write(priv, QCA8K_REG_PORT_STATUS(port), reg); -} - -static void -qca8k_get_strings(struct dsa_switch *ds, int port, u32 stringset, uint8_t *data) -{ - int i; - - if (stringset != ETH_SS_STATS) - return; - - for (i = 0; i < ARRAY_SIZE(ar8327_mib); i++) - strncpy(data + i * ETH_GSTRING_LEN, ar8327_mib[i].name, - ETH_GSTRING_LEN); -} - -static void -qca8k_get_ethtool_stats(struct dsa_switch *ds, int port, - uint64_t *data) -{ - struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv; - const struct qca8k_mib_desc *mib; - u32 reg, i, val; - u32 hi = 0; - int ret; - - for (i = 0; i < ARRAY_SIZE(ar8327_mib); i++) { - mib = &ar8327_mib[i]; - reg = QCA8K_PORT_MIB_COUNTER(port) + mib->offset; - - ret = qca8k_read(priv, reg, &val); - if (ret < 0) - continue; - - if (mib->size == 2) { - ret = qca8k_read(priv, reg + 4, &hi); - if (ret < 0) - continue; - } - - data[i] = val; - if (mib->size == 2) - data[i] |= (u64)hi << 32; - } -} - -static int -qca8k_get_sset_count(struct dsa_switch *ds, int port, int sset) -{ - if (sset != ETH_SS_STATS) - return 0; - - return ARRAY_SIZE(ar8327_mib); -} - -static int -qca8k_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *eee) -{ - struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv; - u32 lpi_en = QCA8K_REG_EEE_CTRL_LPI_EN(port); - u32 reg; - int ret; - - mutex_lock(&priv->reg_mutex); - ret = qca8k_read(priv, QCA8K_REG_EEE_CTRL, ®); - if (ret < 0) - goto exit; - - if (eee->eee_enabled) - reg |= lpi_en; - else - reg &= ~lpi_en; - ret = qca8k_write(priv, QCA8K_REG_EEE_CTRL, reg); - -exit: - mutex_unlock(&priv->reg_mutex); - return ret; -} - -static int -qca8k_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e) -{ - /* Nothing to do on the port's MAC */ - return 0; -} - -static void -qca8k_port_stp_state_set(struct dsa_switch *ds, int port, u8 state) -{ - struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv; - u32 stp_state; - - switch (state) { - case BR_STATE_DISABLED: - stp_state = QCA8K_PORT_LOOKUP_STATE_DISABLED; - break; - case BR_STATE_BLOCKING: - stp_state = QCA8K_PORT_LOOKUP_STATE_BLOCKING; - break; - case BR_STATE_LISTENING: - stp_state = QCA8K_PORT_LOOKUP_STATE_LISTENING; - break; - case BR_STATE_LEARNING: - stp_state = QCA8K_PORT_LOOKUP_STATE_LEARNING; - break; - case BR_STATE_FORWARDING: - default: - stp_state = QCA8K_PORT_LOOKUP_STATE_FORWARD; - break; - } - - qca8k_rmw(priv, QCA8K_PORT_LOOKUP_CTRL(port), - QCA8K_PORT_LOOKUP_STATE_MASK, stp_state); -} - -static int -qca8k_port_bridge_join(struct dsa_switch *ds, int port, struct net_device *br) -{ - struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv; - int port_mask, cpu_port; - int i, ret; - - cpu_port = dsa_to_port(ds, port)->cpu_dp->index; - port_mask = BIT(cpu_port); - - for (i = 0; i < QCA8K_NUM_PORTS; i++) { - if (dsa_is_cpu_port(ds, i)) - continue; - if (dsa_to_port(ds, i)->bridge_dev != br) - continue; - /* Add this port to the portvlan mask of the other ports - * in the bridge - */ - ret = qca8k_reg_set(priv, - QCA8K_PORT_LOOKUP_CTRL(i), - BIT(port)); - if (ret) - return ret; - if (i != port) - port_mask |= BIT(i); - } - - /* Add all other ports to this ports portvlan mask */ - ret = qca8k_rmw(priv, QCA8K_PORT_LOOKUP_CTRL(port), - QCA8K_PORT_LOOKUP_MEMBER, port_mask); - - return ret; -} - -static void -qca8k_port_bridge_leave(struct dsa_switch *ds, int port, struct net_device *br) -{ - struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv; - int cpu_port, i; - - cpu_port = dsa_to_port(ds, port)->cpu_dp->index; - - for (i = 0; i < QCA8K_NUM_PORTS; i++) { - if (dsa_is_cpu_port(ds, i)) - continue; - if (dsa_to_port(ds, i)->bridge_dev != br) - continue; - /* Remove this port to the portvlan mask of the other ports - * in the bridge - */ - qca8k_reg_clear(priv, - QCA8K_PORT_LOOKUP_CTRL(i), - BIT(port)); - } - - /* Set the cpu port to be the only one in the portvlan mask of - * this port - */ - qca8k_rmw(priv, QCA8K_PORT_LOOKUP_CTRL(port), - QCA8K_PORT_LOOKUP_MEMBER, BIT(cpu_port)); -} - -void qca8k_port_fast_age(struct dsa_switch *ds, int port) -{ - struct qca8k_priv *priv = ds->priv; - - mutex_lock(&priv->reg_mutex); - qca8k_fdb_access(priv, QCA8K_FDB_FLUSH_PORT, port); - mutex_unlock(&priv->reg_mutex); -} - -int qca8k_set_ageing_time(struct dsa_switch *ds, unsigned int msecs) -{ - struct qca8k_priv *priv = ds->priv; - unsigned int secs = msecs / 1000; - u32 val; - - /* AGE_TIME reg is set in 7s step */ - val = secs / 7; - - /* Handle case with 0 as val to NOT disable - * learning - */ - if (!val) - val = 1; - - return qca8k_rmw(priv, QCA8K_REG_ATU_CTRL, - QCA8K_ATU_AGE_TIME_MASK, - QCA8K_ATU_AGE_TIME(val)); -} - -static int -qca8k_port_enable(struct dsa_switch *ds, int port, - struct phy_device *phy) -{ - struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv; - - qca8k_port_set_status(priv, port, 1); - priv->port_sts[port].enabled = 1; - - if (dsa_is_user_port(ds, port)) - phy_support_asym_pause(phy); - - return 0; -} - -static void -qca8k_port_disable(struct dsa_switch *ds, int port) -{ - struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv; - - qca8k_port_set_status(priv, port, 0); - priv->port_sts[port].enabled = 0; -} - -static int -qca8k_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu) -{ - struct qca8k_priv *priv = ds->priv; - int i, mtu = 0; - - priv->port_mtu[port] = new_mtu; - - for (i = 0; i < QCA8K_NUM_PORTS; i++) - if (priv->port_mtu[i] > mtu) - mtu = priv->port_mtu[i]; - - /* Include L2 header / FCS length */ - return qca8k_write(priv, QCA8K_MAX_FRAME_SIZE, mtu + ETH_HLEN + ETH_FCS_LEN); -} - -static int -qca8k_port_max_mtu(struct dsa_switch *ds, int port) -{ - return QCA8K_MAX_MTU; -} - -static int -qca8k_port_fdb_insert(struct qca8k_priv *priv, const u8 *addr, - u16 port_mask, u16 vid) -{ - /* Set the vid to the port vlan id if no vid is set */ - if (!vid) - vid = QCA8K_PORT_VID_DEF; - - return qca8k_fdb_add(priv, addr, port_mask, vid, - QCA8K_ATU_STATUS_STATIC); -} - -static int -qca8k_port_fdb_add(struct dsa_switch *ds, int port, - const unsigned char *addr, u16 vid) -{ - struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv; - u16 port_mask = BIT(port); - - return qca8k_port_fdb_insert(priv, addr, port_mask, vid); -} - -static int -qca8k_port_fdb_del(struct dsa_switch *ds, int port, - const unsigned char *addr, u16 vid) -{ - struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv; - u16 port_mask = BIT(port); - - if (!vid) - vid = QCA8K_PORT_VID_DEF; - - return qca8k_fdb_del(priv, addr, port_mask, vid); -} - -static int -qca8k_port_fdb_dump(struct dsa_switch *ds, int port, - dsa_fdb_dump_cb_t *cb, void *data) -{ - struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv; - struct qca8k_fdb _fdb = { 0 }; - int cnt = QCA8K_NUM_FDB_RECORDS; - bool is_static; - int ret = 0; - - mutex_lock(&priv->reg_mutex); - while (cnt-- && !qca8k_fdb_next(priv, &_fdb, port)) { - if (!_fdb.aging) - break; - is_static = (_fdb.aging == QCA8K_ATU_STATUS_STATIC); - ret = cb(_fdb.mac, _fdb.vid, is_static, data); - if (ret) - break; - } - mutex_unlock(&priv->reg_mutex); - - return 0; -} - -static int -qca8k_port_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering, - struct netlink_ext_ack *extack) -{ - struct qca8k_priv *priv = ds->priv; - - if (vlan_filtering) { - qca8k_rmw(priv, QCA8K_PORT_LOOKUP_CTRL(port), - QCA8K_PORT_LOOKUP_VLAN_MODE, - QCA8K_PORT_LOOKUP_VLAN_MODE_SECURE); - } else { - qca8k_rmw(priv, QCA8K_PORT_LOOKUP_CTRL(port), - QCA8K_PORT_LOOKUP_VLAN_MODE, - QCA8K_PORT_LOOKUP_VLAN_MODE_NONE); - } - - return 0; -} - -static int -qca8k_port_vlan_add(struct dsa_switch *ds, int port, - const struct switchdev_obj_port_vlan *vlan, - struct netlink_ext_ack *extack) -{ - bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED; - bool pvid = vlan->flags & BRIDGE_VLAN_INFO_PVID; - struct qca8k_priv *priv = ds->priv; - int ret = 0; - - ret = qca8k_vlan_add(priv, port, vlan->vid, untagged); - if (ret) { - dev_err(priv->dev, "Failed to add VLAN to port %d (%d)", port, ret); - return ret; - } - - if (pvid) { - int shift = 16 * (port % 2); - - qca8k_rmw(priv, QCA8K_EGRESS_VLAN(port), - 0xfff << shift, vlan->vid << shift); - qca8k_write(priv, QCA8K_REG_PORT_VLAN_CTRL0(port), - QCA8K_PORT_VLAN_CVID(vlan->vid) | - QCA8K_PORT_VLAN_SVID(vlan->vid)); - } - return 0; -} - -static int -qca8k_port_vlan_del(struct dsa_switch *ds, int port, - const struct switchdev_obj_port_vlan *vlan) -{ - struct qca8k_priv *priv = ds->priv; - int ret = 0; - - ret = qca8k_vlan_del(priv, port, vlan->vid); - if (ret) - dev_err(priv->dev, "Failed to delete VLAN from port %d (%d)", port, ret); - - return ret; -} - -static enum dsa_tag_protocol -qca8k_get_tag_protocol(struct dsa_switch *ds, int port, - enum dsa_tag_protocol mp) -{ - return DSA_TAG_PROTO_IPQ4019; -} - -static const struct dsa_switch_ops qca8k_switch_ops = { - .get_tag_protocol = qca8k_get_tag_protocol, - .setup = qca8k_setup, - .get_strings = qca8k_get_strings, - .get_ethtool_stats = qca8k_get_ethtool_stats, - .get_sset_count = qca8k_get_sset_count, - .set_ageing_time = qca8k_set_ageing_time, - .get_mac_eee = qca8k_get_mac_eee, - .set_mac_eee = qca8k_set_mac_eee, - .port_enable = qca8k_port_enable, - .port_disable = qca8k_port_disable, - .port_change_mtu = qca8k_port_change_mtu, - .port_max_mtu = qca8k_port_max_mtu, - .port_stp_state_set = qca8k_port_stp_state_set, - .port_bridge_join = qca8k_port_bridge_join, - .port_bridge_leave = qca8k_port_bridge_leave, - .port_fast_age = qca8k_port_fast_age, - .port_fdb_add = qca8k_port_fdb_add, - .port_fdb_del = qca8k_port_fdb_del, - .port_fdb_dump = qca8k_port_fdb_dump, - .port_vlan_filtering = qca8k_port_vlan_filtering, - .port_vlan_add = qca8k_port_vlan_add, - .port_vlan_del = qca8k_port_vlan_del, - .phylink_validate = qca8k_phylink_validate, - .phylink_mac_link_state = qca8k_phylink_mac_link_state, - .phylink_mac_config = qca8k_phylink_mac_config, - .phylink_mac_link_down = qca8k_phylink_mac_link_down, - .phylink_mac_link_up = qca8k_phylink_mac_link_up, -}; - -static int -qca8k_ipq4019_probe(struct platform_device *pdev) -{ - struct qca8k_priv *priv; - void __iomem *base, *psgmii; - struct device_node *np = pdev->dev.of_node, *mdio_np, *psgmii_ethphy_np; - int ret; - - priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); - if (!priv) - return -ENOMEM; - - priv->dev = &pdev->dev; - - base = devm_platform_ioremap_resource_byname(pdev, "base"); - if (IS_ERR(base)) - return PTR_ERR(base); - - priv->regmap = devm_regmap_init_mmio(priv->dev, base, - &qca8k_ipq4019_regmap_config); - if (IS_ERR(priv->regmap)) { - ret = PTR_ERR(priv->regmap); - dev_err(priv->dev, "base regmap initialization failed, %d\n", ret); - return ret; - } - - psgmii = devm_platform_ioremap_resource_byname(pdev, "psgmii_phy"); - if (IS_ERR(psgmii)) - return PTR_ERR(psgmii); - - priv->psgmii = devm_regmap_init_mmio(priv->dev, psgmii, - &qca8k_ipq4019_psgmii_phy_regmap_config); - if (IS_ERR(priv->psgmii)) { - ret = PTR_ERR(priv->psgmii); - dev_err(priv->dev, "PSGMII regmap initialization failed, %d\n", ret); - return ret; - } - - mdio_np = of_parse_phandle(np, "mdio", 0); - if (!mdio_np) { - dev_err(&pdev->dev, "unable to get MDIO bus phandle\n"); - of_node_put(mdio_np); - return -EINVAL; - } - - priv->bus = of_mdio_find_bus(mdio_np); - of_node_put(mdio_np); - if (!priv->bus) { - dev_err(&pdev->dev, "unable to find MDIO bus\n"); - return -EPROBE_DEFER; - } - - psgmii_ethphy_np = of_parse_phandle(np, "psgmii-ethphy", 0); - if (!psgmii_ethphy_np) { - dev_dbg(&pdev->dev, "unable to get PSGMII eth PHY phandle\n"); - of_node_put(psgmii_ethphy_np); - } - - if (psgmii_ethphy_np) { - priv->psgmii_ethphy = of_phy_find_device(psgmii_ethphy_np); - of_node_put(psgmii_ethphy_np); - if (!priv->psgmii_ethphy) { - dev_err(&pdev->dev, "unable to get PSGMII eth PHY\n"); - return -ENODEV; - } - } - - priv->ds = devm_kzalloc(priv->dev, sizeof(*priv->ds), GFP_KERNEL); - if (!priv->ds) - return -ENOMEM; - - priv->ds->dev = priv->dev; - priv->ds->num_ports = QCA8K_NUM_PORTS; - priv->ds->priv = priv; - priv->ops = qca8k_switch_ops; - priv->ds->ops = &priv->ops; - - mutex_init(&priv->reg_mutex); - platform_set_drvdata(pdev, priv); - - return dsa_register_switch(priv->ds); -} - -static int -qca8k_ipq4019_remove(struct platform_device *pdev) -{ - struct qca8k_priv *priv = dev_get_drvdata(&pdev->dev); - int i; - - if (!priv) - return 0; - - for (i = 0; i < QCA8K_NUM_PORTS; i++) - qca8k_port_set_status(priv, i, 0); - - dsa_unregister_switch(priv->ds); - - dev_set_drvdata(&pdev->dev, NULL); - - return 0; -} - -static const struct of_device_id qca8k_ipq4019_of_match[] = { - { .compatible = "qca,ipq4019-qca8337n" }, - { /* sentinel */ }, -}; - -static struct platform_driver qca8k_ipq4019_driver = { - .probe = qca8k_ipq4019_probe, - .remove = qca8k_ipq4019_remove, - .driver = { - .name = "qca8k-ipq4019", - .of_match_table = qca8k_ipq4019_of_match, - }, -}; - -module_platform_driver(qca8k_ipq4019_driver); - -MODULE_AUTHOR("Mathieu Olivari, John Crispin "); -MODULE_AUTHOR("Gabor Juhos , Robert Marko "); -MODULE_DESCRIPTION("Qualcomm IPQ4019 built-in switch driver"); -MODULE_LICENSE("GPL v2"); diff --git a/target/linux/ipq40xx/files/drivers/net/dsa/qca/qca8k-ipq4019.h b/target/linux/ipq40xx/files/drivers/net/dsa/qca/qca8k-ipq4019.h deleted file mode 100644 index 1e1f45a443ef1a..00000000000000 --- a/target/linux/ipq40xx/files/drivers/net/dsa/qca/qca8k-ipq4019.h +++ /dev/null @@ -1,293 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * Copyright (C) 2009 Felix Fietkau - * Copyright (C) 2011-2012 Gabor Juhos - * Copyright (c) 2015, The Linux Foundation. All rights reserved. - */ - -#ifndef __QCA8K_H -#define __QCA8K_H - -#include - -#define QCA8K_NUM_PORTS 6 -#define QCA8K_CPU_PORT 0 -#define QCA8K_MAX_MTU 9000 - -#define QCA8K_BUSY_WAIT_TIMEOUT 2000 - -#define QCA8K_NUM_FDB_RECORDS 2048 - -#define QCA8K_PORT_VID_DEF 1 - -/* Global control registers */ -#define QCA8K_REG_MASK_CTRL 0x000 -#define QCA8K_MASK_CTRL_REV_ID_MASK GENMASK(7, 0) -#define QCA8K_MASK_CTRL_REV_ID(x) ((x) >> 0) -#define QCA8K_MASK_CTRL_DEVICE_ID_MASK GENMASK(15, 8) -#define QCA8K_MASK_CTRL_DEVICE_ID(x) ((x) >> 8) -#define QCA8K_REG_RGMII_CTRL 0x004 -#define QCA8K_RGMII_CTRL_RGMII_RXC GENMASK(1, 0) -#define QCA8K_RGMII_CTRL_RGMII_TXC GENMASK(9, 8) -/* Some kind of CLK selection - * 0: gcc_ess_dly2ns - * 1: gcc_ess_clk - */ -#define QCA8K_RGMII_CTRL_CLK BIT(10) -#define QCA8K_RGMII_CTRL_DELAY_RMII0 GENMASK(17, 16) -#define QCA8K_RGMII_CTRL_INVERT_RMII0_REF_CLK BIT(18) -#define QCA8K_RGMII_CTRL_DELAY_RMII1 GENMASK(20, 19) -#define QCA8K_RGMII_CTRL_INVERT_RMII1_REF_CLK BIT(21) -#define QCA8K_RGMII_CTRL_INVERT_RMII0_MASTER_EN BIT(24) -#define QCA8K_RGMII_CTRL_INVERT_RMII1_MASTER_EN BIT(25) -#define QCA8K_REG_MODULE_EN 0x030 -#define QCA8K_MODULE_EN_MIB BIT(0) -#define QCA8K_REG_MIB 0x034 -#define QCA8K_MIB_FLUSH BIT(24) -#define QCA8K_MIB_CPU_KEEP BIT(20) -#define QCA8K_MIB_BUSY BIT(17) -#define QCA8K_GOL_MAC_ADDR0 0x60 -#define QCA8K_GOL_MAC_ADDR1 0x64 -#define QCA8K_MAX_FRAME_SIZE 0x78 -#define QCA8K_REG_PORT_STATUS(_i) (0x07c + (_i) * 4) -#define QCA8K_PORT_STATUS_SPEED GENMASK(1, 0) -#define QCA8K_PORT_STATUS_SPEED_10 0 -#define QCA8K_PORT_STATUS_SPEED_100 0x1 -#define QCA8K_PORT_STATUS_SPEED_1000 0x2 -#define QCA8K_PORT_STATUS_TXMAC BIT(2) -#define QCA8K_PORT_STATUS_RXMAC BIT(3) -#define QCA8K_PORT_STATUS_TXFLOW BIT(4) -#define QCA8K_PORT_STATUS_RXFLOW BIT(5) -#define QCA8K_PORT_STATUS_DUPLEX BIT(6) -#define QCA8K_PORT_STATUS_LINK_UP BIT(8) -#define QCA8K_PORT_STATUS_LINK_AUTO BIT(9) -#define QCA8K_PORT_STATUS_LINK_PAUSE BIT(10) -#define QCA8K_PORT_STATUS_FLOW_AUTO BIT(12) -#define QCA8K_REG_PORT_HDR_CTRL(_i) (0x9c + (_i * 4)) -#define QCA8K_PORT_HDR_CTRL_RX_MASK GENMASK(3, 2) -#define QCA8K_PORT_HDR_CTRL_RX_S 2 -#define QCA8K_PORT_HDR_CTRL_TX_MASK GENMASK(1, 0) -#define QCA8K_PORT_HDR_CTRL_TX_S 0 -#define QCA8K_PORT_HDR_CTRL_ALL 2 -#define QCA8K_PORT_HDR_CTRL_MGMT 1 -#define QCA8K_PORT_HDR_CTRL_NONE 0 -#define QCA8K_REG_SGMII_CTRL 0x0e0 -#define QCA8K_SGMII_EN_PLL BIT(1) -#define QCA8K_SGMII_EN_RX BIT(2) -#define QCA8K_SGMII_EN_TX BIT(3) -#define QCA8K_SGMII_EN_SD BIT(4) -#define QCA8K_SGMII_CLK125M_DELAY BIT(7) -#define QCA8K_SGMII_MODE_CTRL_MASK (BIT(22) | BIT(23)) -#define QCA8K_SGMII_MODE_CTRL_BASEX (0 << 22) -#define QCA8K_SGMII_MODE_CTRL_PHY (1 << 22) -#define QCA8K_SGMII_MODE_CTRL_MAC (2 << 22) - -/* EEE control registers */ -#define QCA8K_REG_EEE_CTRL 0x100 -#define QCA8K_REG_EEE_CTRL_LPI_EN(_i) ((_i + 1) * 2) - -/* ACL registers */ -#define QCA8K_REG_PORT_VLAN_CTRL0(_i) (0x420 + (_i * 8)) -#define QCA8K_PORT_VLAN_CVID(x) (x << 16) -#define QCA8K_PORT_VLAN_SVID(x) x -#define QCA8K_REG_PORT_VLAN_CTRL1(_i) (0x424 + (_i * 8)) -#define QCA8K_REG_IPV4_PRI_BASE_ADDR 0x470 -#define QCA8K_REG_IPV4_PRI_ADDR_MASK 0x474 - -/* Lookup registers */ -#define QCA8K_REG_ATU_DATA0 0x600 -#define QCA8K_ATU_ADDR2_S 24 -#define QCA8K_ATU_ADDR3_S 16 -#define QCA8K_ATU_ADDR4_S 8 -#define QCA8K_REG_ATU_DATA1 0x604 -#define QCA8K_ATU_PORT_M 0x7f -#define QCA8K_ATU_PORT_S 16 -#define QCA8K_ATU_ADDR0_S 8 -#define QCA8K_REG_ATU_DATA2 0x608 -#define QCA8K_ATU_VID_M 0xfff -#define QCA8K_ATU_VID_S 8 -#define QCA8K_ATU_STATUS_M 0xf -#define QCA8K_ATU_STATUS_STATIC 0xf -#define QCA8K_REG_ATU_FUNC 0x60c -#define QCA8K_ATU_FUNC_BUSY BIT(31) -#define QCA8K_ATU_FUNC_PORT_EN BIT(14) -#define QCA8K_ATU_FUNC_MULTI_EN BIT(13) -#define QCA8K_ATU_FUNC_FULL BIT(12) -#define QCA8K_ATU_FUNC_PORT_M 0xf -#define QCA8K_ATU_FUNC_PORT_S 8 -#define QCA8K_REG_VTU_FUNC0 0x610 -#define QCA8K_VTU_FUNC0_VALID BIT(20) -#define QCA8K_VTU_FUNC0_IVL_EN BIT(19) -#define QCA8K_VTU_FUNC0_EG_MODE_S(_i) (4 + (_i) * 2) -#define QCA8K_VTU_FUNC0_EG_MODE_MASK 3 -#define QCA8K_VTU_FUNC0_EG_MODE_UNMOD 0 -#define QCA8K_VTU_FUNC0_EG_MODE_UNTAG 1 -#define QCA8K_VTU_FUNC0_EG_MODE_TAG 2 -#define QCA8K_VTU_FUNC0_EG_MODE_NOT 3 -#define QCA8K_REG_VTU_FUNC1 0x614 -#define QCA8K_VTU_FUNC1_BUSY BIT(31) -#define QCA8K_VTU_FUNC1_VID_S 16 -#define QCA8K_VTU_FUNC1_FULL BIT(4) -#define QCA8K_REG_ATU_CTRL 0x618 -#define QCA8K_ATU_AGE_TIME_MASK GENMASK(15, 0) -#define QCA8K_ATU_AGE_TIME(x) FIELD_PREP(QCA8K_ATU_AGE_TIME_MASK, (x)) -#define QCA8K_REG_GLOBAL_FW_CTRL0 0x620 -#define QCA8K_GLOBAL_FW_CTRL0_CPU_PORT_EN BIT(10) -#define QCA8K_REG_GLOBAL_FW_CTRL1 0x624 -#define QCA8K_GLOBAL_FW_CTRL1_IGMP_DP_S 24 -#define QCA8K_GLOBAL_FW_CTRL1_BC_DP_S 16 -#define QCA8K_GLOBAL_FW_CTRL1_MC_DP_S 8 -#define QCA8K_GLOBAL_FW_CTRL1_UC_DP_S 0 -#define QCA8K_PORT_LOOKUP_CTRL(_i) (0x660 + (_i) * 0xc) -#define QCA8K_PORT_LOOKUP_MEMBER GENMASK(6, 0) -#define QCA8K_PORT_LOOKUP_VLAN_MODE GENMASK(9, 8) -#define QCA8K_PORT_LOOKUP_VLAN_MODE_NONE (0 << 8) -#define QCA8K_PORT_LOOKUP_VLAN_MODE_FALLBACK (1 << 8) -#define QCA8K_PORT_LOOKUP_VLAN_MODE_CHECK (2 << 8) -#define QCA8K_PORT_LOOKUP_VLAN_MODE_SECURE (3 << 8) -#define QCA8K_PORT_LOOKUP_STATE_MASK GENMASK(18, 16) -#define QCA8K_PORT_LOOKUP_STATE_DISABLED (0 << 16) -#define QCA8K_PORT_LOOKUP_STATE_BLOCKING (1 << 16) -#define QCA8K_PORT_LOOKUP_STATE_LISTENING (2 << 16) -#define QCA8K_PORT_LOOKUP_STATE_LEARNING (3 << 16) -#define QCA8K_PORT_LOOKUP_STATE_FORWARD (4 << 16) -#define QCA8K_PORT_LOOKUP_STATE GENMASK(18, 16) -#define QCA8K_PORT_LOOKUP_LEARN BIT(20) -#define QCA8K_PORT_LOOKUP_LOOPBACK BIT(21) - -#define QCA8K_REG_GLOBAL_FC_THRESH 0x800 -#define QCA8K_GLOBAL_FC_GOL_XON_THRES(x) ((x) << 16) -#define QCA8K_GLOBAL_FC_GOL_XON_THRES_S GENMASK(24, 16) -#define QCA8K_GLOBAL_FC_GOL_XOFF_THRES(x) ((x) << 0) -#define QCA8K_GLOBAL_FC_GOL_XOFF_THRES_S GENMASK(8, 0) - -#define QCA8K_REG_PORT_HOL_CTRL0(_i) (0x970 + (_i) * 0x8) -#define QCA8K_PORT_HOL_CTRL0_EG_PRI0_BUF GENMASK(3, 0) -#define QCA8K_PORT_HOL_CTRL0_EG_PRI0(x) ((x) << 0) -#define QCA8K_PORT_HOL_CTRL0_EG_PRI1_BUF GENMASK(7, 4) -#define QCA8K_PORT_HOL_CTRL0_EG_PRI1(x) ((x) << 4) -#define QCA8K_PORT_HOL_CTRL0_EG_PRI2_BUF GENMASK(11, 8) -#define QCA8K_PORT_HOL_CTRL0_EG_PRI2(x) ((x) << 8) -#define QCA8K_PORT_HOL_CTRL0_EG_PRI3_BUF GENMASK(15, 12) -#define QCA8K_PORT_HOL_CTRL0_EG_PRI3(x) ((x) << 12) -#define QCA8K_PORT_HOL_CTRL0_EG_PRI4_BUF GENMASK(19, 16) -#define QCA8K_PORT_HOL_CTRL0_EG_PRI4(x) ((x) << 16) -#define QCA8K_PORT_HOL_CTRL0_EG_PRI5_BUF GENMASK(23, 20) -#define QCA8K_PORT_HOL_CTRL0_EG_PRI5(x) ((x) << 20) -#define QCA8K_PORT_HOL_CTRL0_EG_PORT_BUF GENMASK(29, 24) -#define QCA8K_PORT_HOL_CTRL0_EG_PORT(x) ((x) << 24) - -#define QCA8K_REG_PORT_HOL_CTRL1(_i) (0x974 + (_i) * 0x8) -#define QCA8K_PORT_HOL_CTRL1_ING_BUF GENMASK(3, 0) -#define QCA8K_PORT_HOL_CTRL1_ING(x) ((x) << 0) -#define QCA8K_PORT_HOL_CTRL1_EG_PRI_BUF_EN BIT(6) -#define QCA8K_PORT_HOL_CTRL1_EG_PORT_BUF_EN BIT(7) -#define QCA8K_PORT_HOL_CTRL1_WRED_EN BIT(8) -#define QCA8K_PORT_HOL_CTRL1_EG_MIRROR_EN BIT(16) - -/* Pkt edit registers */ -#define QCA8K_EGRESS_VLAN(x) (0x0c70 + (4 * (x / 2))) - -/* L3 registers */ -#define QCA8K_HROUTER_CONTROL 0xe00 -#define QCA8K_HROUTER_CONTROL_GLB_LOCKTIME_M GENMASK(17, 16) -#define QCA8K_HROUTER_CONTROL_GLB_LOCKTIME_S 16 -#define QCA8K_HROUTER_CONTROL_ARP_AGE_MODE 1 -#define QCA8K_HROUTER_PBASED_CONTROL1 0xe08 -#define QCA8K_HROUTER_PBASED_CONTROL2 0xe0c -#define QCA8K_HNAT_CONTROL 0xe38 - -/* MIB registers */ -#define QCA8K_PORT_MIB_COUNTER(_i) (0x1000 + (_i) * 0x100) - -/* IPQ4019 PSGMII PHY registers */ -#define PSGMIIPHY_MODE_CONTROL 0x1b4 -#define PSGMIIPHY_MODE_ATHR_CSCO_MODE_25M BIT(0) -#define PSGMIIPHY_TX_CONTROL 0x288 -#define PSGMIIPHY_TX_CONTROL_MAGIC_VALUE 0x8380 -#define PSGMIIPHY_VCO_CALIBRATION_CONTROL_REGISTER_1 0x9c -#define PSGMIIPHY_REG_PLL_VCO_CALIB_RESTART BIT(14) -#define PSGMIIPHY_VCO_CALIBRATION_CONTROL_REGISTER_2 0xa0 -#define PSGMIIPHY_REG_PLL_VCO_CALIB_READY BIT(0) - -#define QCA8K_PSGMII_CALB_NUM 100 -#define MII_QCA8075_SSTATUS 0x11 -#define QCA8075_PHY_SPEC_STATUS_LINK BIT(10) -#define QCA8075_MMD7_CRC_AND_PKTS_COUNT 0x8029 -#define QCA8075_MMD7_PKT_GEN_PKT_NUMB 0x8021 -#define QCA8075_MMD7_PKT_GEN_PKT_SIZE 0x8062 -#define QCA8075_MMD7_PKT_GEN_CTRL 0x8020 -#define QCA8075_MMD7_CNT_SELFCLR BIT(1) -#define QCA8075_MMD7_CNT_FRAME_CHK_EN BIT(0) -#define QCA8075_MMD7_PKT_GEN_START BIT(13) -#define QCA8075_MMD7_PKT_GEN_INPROGR BIT(15) -#define QCA8075_MMD7_IG_FRAME_RECV_CNT_HI 0x802a -#define QCA8075_MMD7_IG_FRAME_RECV_CNT_LO 0x802b -#define QCA8075_MMD7_IG_FRAME_ERR_CNT 0x802c -#define QCA8075_MMD7_EG_FRAME_RECV_CNT_HI 0x802d -#define QCA8075_MMD7_EG_FRAME_RECV_CNT_LO 0x802e -#define QCA8075_MMD7_EG_FRAME_ERR_CNT 0x802f -#define QCA8075_MMD7_MDIO_BRDCST_WRITE 0x8028 -#define QCA8075_MMD7_MDIO_BRDCST_WRITE_EN BIT(15) -#define QCA8075_MDIO_BRDCST_PHY_ADDR 0x1f -#define QCA8075_PKT_GEN_PKTS_COUNT 4096 - -enum { - QCA8K_PORT_SPEED_10M = 0, - QCA8K_PORT_SPEED_100M = 1, - QCA8K_PORT_SPEED_1000M = 2, - QCA8K_PORT_SPEED_ERR = 3, -}; - -enum qca8k_fdb_cmd { - QCA8K_FDB_FLUSH = 1, - QCA8K_FDB_LOAD = 2, - QCA8K_FDB_PURGE = 3, - QCA8K_FDB_FLUSH_PORT = 5, - QCA8K_FDB_NEXT = 6, - QCA8K_FDB_SEARCH = 7, -}; - -enum qca8k_vlan_cmd { - QCA8K_VLAN_FLUSH = 1, - QCA8K_VLAN_LOAD = 2, - QCA8K_VLAN_PURGE = 3, - QCA8K_VLAN_REMOVE_PORT = 4, - QCA8K_VLAN_NEXT = 5, - QCA8K_VLAN_READ = 6, -}; - -struct ar8xxx_port_status { - int enabled; -}; - -struct qca8k_priv { - struct regmap *regmap; - struct mii_bus *bus; - struct ar8xxx_port_status port_sts[QCA8K_NUM_PORTS]; - struct dsa_switch *ds; - struct mutex reg_mutex; - struct device *dev; - struct dsa_switch_ops ops; - unsigned int port_mtu[QCA8K_NUM_PORTS]; - - /* IPQ4019 specific */ - struct regmap *psgmii; - bool psgmii_calibrated; - struct phy_device *psgmii_ethphy; -}; - -struct qca8k_mib_desc { - unsigned int size; - unsigned int offset; - const char *name; -}; - -struct qca8k_fdb { - u16 vid; - u8 port_mask; - u8 aging; - u8 mac[6]; -}; - -#endif /* __QCA8K_H */ diff --git a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/ipqess/Makefile b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/ipqess/Makefile deleted file mode 100644 index 4f2db7283ebffd..00000000000000 --- a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/ipqess/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only -# -# Makefile for the IPQ ESS driver -# - -obj-$(CONFIG_QCOM_IPQ4019_ESS_EDMA) += ipq_ess.o - -ipq_ess-objs := ipqess.o ipqess_ethtool.o diff --git a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/ipqess/ipqess.c b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/ipqess/ipqess.c deleted file mode 100644 index ee33bb01667f55..00000000000000 --- a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/ipqess/ipqess.c +++ /dev/null @@ -1,1336 +0,0 @@ -// SPDX-License-Identifier: (GPL-2.0 OR ISC) -/* Copyright (c) 2014 - 2017, The Linux Foundation. All rights reserved. - * Copyright (c) 2017 - 2018, John Crispin - * Copyright (c) 2018 - 2019, Christian Lamparter - * Copyright (c) 2020 - 2021, Gabor Juhos - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "ipqess.h" - -#define IPQESS_RRD_SIZE 16 -#define IPQESS_NEXT_IDX(X, Y) (((X) + 1) & ((Y) - 1)) -#define IPQESS_TX_DMA_BUF_LEN 0x3fff - -static void ipqess_w32(struct ipqess *ess, u32 reg, u32 val) -{ - writel(val, ess->hw_addr + reg); -} - -static u32 ipqess_r32(struct ipqess *ess, u16 reg) -{ - return readl(ess->hw_addr + reg); -} - -static void ipqess_m32(struct ipqess *ess, u32 mask, u32 val, u16 reg) -{ - u32 _val = ipqess_r32(ess, reg); - _val &= ~mask; - _val |= val; - ipqess_w32(ess, reg, _val); -} - -void ipqess_update_hw_stats(struct ipqess *ess) -{ - uint32_t *p; - u32 stat; - int i; - - lockdep_assert_held(&ess->stats_lock); - - p = (uint32_t *)&(ess->ipqessstats); - for (i = 0; i < IPQESS_MAX_TX_QUEUE; i++) { - stat = ipqess_r32(ess, IPQESS_REG_TX_STAT_PKT_Q(i)); - *p += stat; - p++; - } - - for (i = 0; i < IPQESS_MAX_TX_QUEUE; i++) { - stat = ipqess_r32(ess, IPQESS_REG_TX_STAT_BYTE_Q(i)); - *p += stat; - p++; - } - - for (i = 0; i < IPQESS_MAX_RX_QUEUE; i++) { - stat = ipqess_r32(ess, IPQESS_REG_RX_STAT_PKT_Q(i)); - *p += stat; - p++; - } - - for (i = 0; i < IPQESS_MAX_RX_QUEUE; i++) { - stat = ipqess_r32(ess, IPQESS_REG_RX_STAT_BYTE_Q(i)); - *p += stat; - p++; - } -} - -static int ipqess_tx_ring_alloc(struct ipqess *ess) -{ - struct device *dev = &ess->pdev->dev; - int i; - - for (i = 0; i < IPQESS_NETDEV_QUEUES; i++) { - struct ipqess_tx_ring *tx_ring = &ess->tx_ring[i]; - size_t size; - u32 idx; - - tx_ring->ess = ess; - tx_ring->ring_id = i; - tx_ring->idx = i * 4; - tx_ring->count = IPQESS_TX_RING_SIZE; - tx_ring->nq = netdev_get_tx_queue(ess->netdev, i); - - size = sizeof(struct ipqess_buf) * IPQESS_TX_RING_SIZE; - tx_ring->buf = devm_kzalloc(dev, size, GFP_KERNEL); - if (!tx_ring->buf) { - netdev_err(ess->netdev, "buffer alloc of tx ring failed"); - return -ENOMEM; - } - - size = sizeof(struct ipqess_tx_desc) * IPQESS_TX_RING_SIZE; - tx_ring->hw_desc = dmam_alloc_coherent(dev, size, &tx_ring->dma, - GFP_KERNEL | __GFP_ZERO); - if (!tx_ring->hw_desc) { - netdev_err(ess->netdev, "descriptor allocation for tx ring failed"); - return -ENOMEM; - } - - ipqess_w32(ess, IPQESS_REG_TPD_BASE_ADDR_Q(tx_ring->idx), - (u32)tx_ring->dma); - - idx = ipqess_r32(ess, IPQESS_REG_TPD_IDX_Q(tx_ring->idx)); - idx >>= IPQESS_TPD_CONS_IDX_SHIFT; /* need u32 here */ - idx &= 0xffff; - tx_ring->head = tx_ring->tail = idx; - - ipqess_m32(ess, IPQESS_TPD_PROD_IDX_MASK << IPQESS_TPD_PROD_IDX_SHIFT, - idx, IPQESS_REG_TPD_IDX_Q(tx_ring->idx)); - ipqess_w32(ess, IPQESS_REG_TX_SW_CONS_IDX_Q(tx_ring->idx), idx); - ipqess_w32(ess, IPQESS_REG_TPD_RING_SIZE, IPQESS_TX_RING_SIZE); - } - - return 0; -} - -static int ipqess_tx_unmap_and_free(struct device *dev, struct ipqess_buf *buf) -{ - int len = 0; - - if (buf->flags & IPQESS_DESC_SINGLE) - dma_unmap_single(dev, buf->dma, buf->length, DMA_TO_DEVICE); - else if (buf->flags & IPQESS_DESC_PAGE) - dma_unmap_page(dev, buf->dma, buf->length, DMA_TO_DEVICE); - - if (buf->flags & IPQESS_DESC_LAST) { - len = buf->skb->len; - dev_kfree_skb_any(buf->skb); - } - - buf->flags = 0; - - return len; -} - -static void ipqess_tx_ring_free(struct ipqess *ess) -{ - int i; - - for (i = 0; i < IPQESS_NETDEV_QUEUES; i++) { - int j; - - if (ess->tx_ring[i].hw_desc) - continue; - - for (j = 0; j < IPQESS_TX_RING_SIZE; j++) { - struct ipqess_buf *buf = &ess->tx_ring[i].buf[j]; - - ipqess_tx_unmap_and_free(&ess->pdev->dev, buf); - } - - ess->tx_ring[i].buf = NULL; - } -} - -static int ipqess_rx_buf_prepare(struct ipqess_buf *buf, - struct ipqess_rx_ring *rx_ring) -{ - /* Clean the HW DESC header, otherwise we might end up - * with a spurious desc because of random garbage */ - memset(buf->skb->data, 0, sizeof(struct ipqess_rx_desc)); - - buf->dma = dma_map_single(rx_ring->ppdev, buf->skb->data, - IPQESS_RX_HEAD_BUFF_SIZE, DMA_FROM_DEVICE); - if (dma_mapping_error(rx_ring->ppdev, buf->dma)) { - dev_err_once(rx_ring->ppdev, - "IPQESS DMA mapping failed for linear address %x", - buf->dma); - dev_kfree_skb_any(buf->skb); - buf->skb = NULL; - return -EFAULT; - } - - buf->length = IPQESS_RX_HEAD_BUFF_SIZE; - rx_ring->hw_desc[rx_ring->head] = (struct ipqess_rx_desc *)buf->dma; - rx_ring->head = (rx_ring->head + 1) % IPQESS_RX_RING_SIZE; - - ipqess_m32(rx_ring->ess, IPQESS_RFD_PROD_IDX_BITS, - (rx_ring->head + IPQESS_RX_RING_SIZE - 1) % IPQESS_RX_RING_SIZE, - IPQESS_REG_RFD_IDX_Q(rx_ring->idx)); - - return 0; -} - -/* locking is handled by the caller */ -static int ipqess_rx_buf_alloc_napi(struct ipqess_rx_ring *rx_ring) -{ - struct ipqess_buf *buf = &rx_ring->buf[rx_ring->head]; - - buf->skb = napi_alloc_skb(&rx_ring->napi_rx, - IPQESS_RX_HEAD_BUFF_SIZE); - if (!buf->skb) - return -ENOMEM; - - return ipqess_rx_buf_prepare(buf, rx_ring); -} - -static int ipqess_rx_buf_alloc(struct ipqess_rx_ring *rx_ring) -{ - struct ipqess_buf *buf = &rx_ring->buf[rx_ring->head]; - - buf->skb = netdev_alloc_skb_ip_align(rx_ring->ess->netdev, - IPQESS_RX_HEAD_BUFF_SIZE); - if (!buf->skb) - return -ENOMEM; - - return ipqess_rx_buf_prepare(buf, rx_ring); -} - -static void ipqess_refill_work(struct work_struct *work) -{ - struct ipqess_rx_ring_refill *rx_refill = container_of(work, - struct ipqess_rx_ring_refill, refill_work); - struct ipqess_rx_ring *rx_ring = rx_refill->rx_ring; - int refill = 0; - - /* don't let this loop by accident. */ - while (atomic_dec_and_test(&rx_ring->refill_count)) { - napi_disable(&rx_ring->napi_rx); - if (ipqess_rx_buf_alloc(rx_ring)) { - refill++; - dev_dbg(rx_ring->ppdev, - "Not all buffers were reallocated"); - } - napi_enable(&rx_ring->napi_rx); - } - - if (atomic_add_return(refill, &rx_ring->refill_count)) - schedule_work(&rx_refill->refill_work); -} - - -static int ipqess_rx_ring_alloc(struct ipqess *ess) -{ - int i; - - for (i = 0; i < IPQESS_NETDEV_QUEUES; i++) { - int j; - - ess->rx_ring[i].ess = ess; - ess->rx_ring[i].ppdev = &ess->pdev->dev; - ess->rx_ring[i].ring_id = i; - ess->rx_ring[i].idx = i * 2; - - ess->rx_ring[i].buf = devm_kzalloc(&ess->pdev->dev, - sizeof(struct ipqess_buf) * IPQESS_RX_RING_SIZE, - GFP_KERNEL); - if (!ess->rx_ring[i].buf) - return -ENOMEM; - - ess->rx_ring[i].hw_desc = dmam_alloc_coherent(&ess->pdev->dev, - sizeof(struct ipqess_rx_desc) * IPQESS_RX_RING_SIZE, - &ess->rx_ring[i].dma, GFP_KERNEL); - if (!ess->rx_ring[i].hw_desc) - return -ENOMEM; - - for (j = 0; j < IPQESS_RX_RING_SIZE; j++) - if (ipqess_rx_buf_alloc(&ess->rx_ring[i]) < 0) - return -ENOMEM; - - ess->rx_refill[i].rx_ring = &ess->rx_ring[i]; - INIT_WORK(&ess->rx_refill[i].refill_work, ipqess_refill_work); - - ipqess_w32(ess, IPQESS_REG_RFD_BASE_ADDR_Q(ess->rx_ring[i].idx), - (u32)(ess->rx_ring[i].dma)); - } - - ipqess_w32(ess, IPQESS_REG_RX_DESC0, - (IPQESS_RX_HEAD_BUFF_SIZE << IPQESS_RX_BUF_SIZE_SHIFT) | - (IPQESS_RX_RING_SIZE << IPQESS_RFD_RING_SIZE_SHIFT)); - - return 0; -} - -static void ipqess_rx_ring_free(struct ipqess *ess) -{ - int i; - - for (i = 0; i < IPQESS_NETDEV_QUEUES; i++) { - int j; - - atomic_set(&ess->rx_ring[i].refill_count, 0); - cancel_work_sync(&ess->rx_refill[i].refill_work); - - for (j = 0; j < IPQESS_RX_RING_SIZE; j++) { - dma_unmap_single(&ess->pdev->dev, - ess->rx_ring[i].buf[j].dma, - ess->rx_ring[i].buf[j].length, - DMA_FROM_DEVICE); - dev_kfree_skb_any(ess->rx_ring[i].buf[j].skb); - } - } -} - -static struct net_device_stats *ipqess_get_stats(struct net_device *netdev) -{ - struct ipqess *ess = netdev_priv(netdev); - - spin_lock(&ess->stats_lock); - ipqess_update_hw_stats(ess); - spin_unlock(&ess->stats_lock); - - return &ess->stats; -} - -static int ipqess_rx_poll(struct ipqess_rx_ring *rx_ring, int budget) -{ - u32 length = 0, num_desc, tail, rx_ring_tail; - int done = 0; - - rx_ring_tail = rx_ring->tail; - - tail = ipqess_r32(rx_ring->ess, IPQESS_REG_RFD_IDX_Q(rx_ring->idx)); - tail >>= IPQESS_RFD_CONS_IDX_SHIFT; - tail &= IPQESS_RFD_CONS_IDX_MASK; - - while (done < budget) { - struct sk_buff *skb; - struct ipqess_rx_desc *rd; - - if (rx_ring_tail == tail) - break; - - dma_unmap_single(rx_ring->ppdev, - rx_ring->buf[rx_ring_tail].dma, - rx_ring->buf[rx_ring_tail].length, - DMA_FROM_DEVICE); - - skb = xchg(&rx_ring->buf[rx_ring_tail].skb, NULL); - rd = (struct ipqess_rx_desc *)skb->data; - rx_ring_tail = IPQESS_NEXT_IDX(rx_ring_tail, IPQESS_RX_RING_SIZE); - - /* Check if RRD is valid */ - if (!(rd->rrd7 & IPQESS_RRD_DESC_VALID)) { - num_desc = 1; - dev_kfree_skb_any(skb); - goto skip; - } - - num_desc = rd->rrd1 & IPQESS_RRD_NUM_RFD_MASK; - length = rd->rrd6 & IPQESS_RRD_PKT_SIZE_MASK; - - skb_reserve(skb, IPQESS_RRD_SIZE); - if (num_desc > 1) { - /* can we use build_skb here ? */ - struct sk_buff *skb_prev = NULL; - int size_remaining; - int i; - - skb->data_len = 0; - skb->tail += (IPQESS_RX_HEAD_BUFF_SIZE - IPQESS_RRD_SIZE); - skb->len = skb->truesize = length; - size_remaining = length - (IPQESS_RX_HEAD_BUFF_SIZE - IPQESS_RRD_SIZE); - - for (i = 1; i < num_desc; i++) { - /* TODO: use build_skb ? */ - struct sk_buff *skb_temp = rx_ring->buf[rx_ring_tail].skb; - - dma_unmap_single(rx_ring->ppdev, - rx_ring->buf[rx_ring_tail].dma, - rx_ring->buf[rx_ring_tail].length, - DMA_FROM_DEVICE); - - skb_put(skb_temp, min(size_remaining, IPQESS_RX_HEAD_BUFF_SIZE)); - if (skb_prev) - skb_prev->next = rx_ring->buf[rx_ring_tail].skb; - else - skb_shinfo(skb)->frag_list = rx_ring->buf[rx_ring_tail].skb; - skb_prev = rx_ring->buf[rx_ring_tail].skb; - rx_ring->buf[rx_ring_tail].skb->next = NULL; - - skb->data_len += rx_ring->buf[rx_ring_tail].skb->len; - size_remaining -= rx_ring->buf[rx_ring_tail].skb->len; - - rx_ring_tail = IPQESS_NEXT_IDX(rx_ring_tail, IPQESS_RX_RING_SIZE); - } - - } else { - skb_put(skb, length); - } - - skb->dev = rx_ring->ess->netdev; - skb->protocol = eth_type_trans(skb, rx_ring->ess->netdev); - skb_record_rx_queue(skb, rx_ring->ring_id); - - if (rd->rrd6 & IPQESS_RRD_CSUM_FAIL_MASK) - skb_checksum_none_assert(skb); - else - skb->ip_summed = CHECKSUM_UNNECESSARY; - - if (rd->rrd7 & IPQESS_RRD_CVLAN) { - __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), rd->rrd4); - } else if (rd->rrd1 & IPQESS_RRD_SVLAN) { - __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021AD), rd->rrd4); - } - napi_gro_receive(&rx_ring->napi_rx, skb); - - /* TODO: do we need to have these here ? */ - rx_ring->ess->stats.rx_packets++; - rx_ring->ess->stats.rx_bytes += length; - - done++; -skip: - - num_desc += atomic_xchg(&rx_ring->refill_count, 0); - while (num_desc) { - if (ipqess_rx_buf_alloc_napi(rx_ring)) { - num_desc = atomic_add_return(num_desc, - &rx_ring->refill_count); - if (num_desc >= ((4 * IPQESS_RX_RING_SIZE + 6) / 7)) - schedule_work(&rx_ring->ess->rx_refill[rx_ring->ring_id].refill_work); - break; - } - num_desc--; - } - } - - ipqess_w32(rx_ring->ess, IPQESS_REG_RX_SW_CONS_IDX_Q(rx_ring->idx), - rx_ring_tail); - rx_ring->tail = rx_ring_tail; - - return done; -} - -static int ipqess_tx_complete(struct ipqess_tx_ring *tx_ring, int budget) -{ - u32 tail; - int done = 0; - int total = 0, ret; - - tail = ipqess_r32(tx_ring->ess, IPQESS_REG_TPD_IDX_Q(tx_ring->idx)); - tail >>= IPQESS_TPD_CONS_IDX_SHIFT; - tail &= IPQESS_TPD_CONS_IDX_MASK; - - while ((tx_ring->tail != tail) && (done < budget)) { - //pr_info("freeing txq:%d tail:%d tailbuf:%p\n", tx_ring->idx, tx_ring->tail, &tx_ring->buf[tx_ring->tail]); - ret = ipqess_tx_unmap_and_free(&tx_ring->ess->pdev->dev, - &tx_ring->buf[tx_ring->tail]); - tx_ring->tail = IPQESS_NEXT_IDX(tx_ring->tail, tx_ring->count); - if (ret) { - total += ret; - done++; - } - } - - ipqess_w32(tx_ring->ess, - IPQESS_REG_TX_SW_CONS_IDX_Q(tx_ring->idx), - tx_ring->tail); - - if (netif_tx_queue_stopped(tx_ring->nq)) { - netdev_dbg(tx_ring->ess->netdev, "waking up tx queue %d\n", - tx_ring->idx); - netif_tx_wake_queue(tx_ring->nq); - } - - netdev_tx_completed_queue(tx_ring->nq, done, total); - - return done; -} - -static int ipqess_tx_napi(struct napi_struct *napi, int budget) -{ - struct ipqess_tx_ring *tx_ring = container_of(napi, struct ipqess_tx_ring, - napi_tx); - u32 tx_status; - int work_done = 0; - - tx_status = ipqess_r32(tx_ring->ess, IPQESS_REG_TX_ISR); - tx_status &= BIT(tx_ring->idx); - - work_done = ipqess_tx_complete(tx_ring, budget); - - ipqess_w32(tx_ring->ess, IPQESS_REG_TX_ISR, tx_status); - - if (likely(work_done < budget)) { - if (napi_complete_done(napi, work_done)) - ipqess_w32(tx_ring->ess, - IPQESS_REG_TX_INT_MASK_Q(tx_ring->idx), 0x1); - } - - return work_done; -} - -static int ipqess_rx_napi(struct napi_struct *napi, int budget) -{ - struct ipqess_rx_ring *rx_ring = container_of(napi, struct ipqess_rx_ring, - napi_rx); - struct ipqess *ess = rx_ring->ess; - int remain_budget = budget; - int rx_done; - u32 rx_mask = BIT(rx_ring->idx); - u32 status; - -poll_again: - ipqess_w32(ess, IPQESS_REG_RX_ISR, rx_mask); - rx_done = ipqess_rx_poll(rx_ring, remain_budget); - - if (rx_done == remain_budget) - return budget; - - status = ipqess_r32(ess, IPQESS_REG_RX_ISR); - if (status & rx_mask) { - remain_budget -= rx_done; - goto poll_again; - } - - if (napi_complete_done(napi, rx_done + budget - remain_budget)) - ipqess_w32(ess, IPQESS_REG_RX_INT_MASK_Q(rx_ring->idx), 0x1); - - return rx_done + budget - remain_budget; -} - -static irqreturn_t ipqess_interrupt_tx(int irq, void *priv) -{ - struct ipqess_tx_ring *tx_ring = (struct ipqess_tx_ring *) priv; - - if (likely(napi_schedule_prep(&tx_ring->napi_tx))) { - ipqess_w32(tx_ring->ess, - IPQESS_REG_TX_INT_MASK_Q(tx_ring->idx), - 0x0); - __napi_schedule(&tx_ring->napi_tx); - } - - return IRQ_HANDLED; -} - -static irqreturn_t ipqess_interrupt_rx(int irq, void *priv) -{ - struct ipqess_rx_ring *rx_ring = (struct ipqess_rx_ring *) priv; - - if (likely(napi_schedule_prep(&rx_ring->napi_rx))) { - ipqess_w32(rx_ring->ess, - IPQESS_REG_RX_INT_MASK_Q(rx_ring->idx), - 0x0); - __napi_schedule(&rx_ring->napi_rx); - } - - return IRQ_HANDLED; -} - -static void ipqess_irq_enable(struct ipqess *ess) -{ - int i; - - ipqess_w32(ess, IPQESS_REG_RX_ISR, 0xff); - ipqess_w32(ess, IPQESS_REG_TX_ISR, 0xffff); - for (i = 0; i < IPQESS_NETDEV_QUEUES; i++) { - ipqess_w32(ess, IPQESS_REG_RX_INT_MASK_Q(ess->rx_ring[i].idx), 1); - ipqess_w32(ess, IPQESS_REG_TX_INT_MASK_Q(ess->tx_ring[i].idx), 1); - } -} - -static void ipqess_irq_disable(struct ipqess *ess) -{ - int i; - - for (i = 0; i < IPQESS_NETDEV_QUEUES; i++) { - ipqess_w32(ess, IPQESS_REG_RX_INT_MASK_Q(ess->rx_ring[i].idx), 0); - ipqess_w32(ess, IPQESS_REG_TX_INT_MASK_Q(ess->tx_ring[i].idx), 0); - } -} - -static int __init ipqess_init(struct net_device *netdev) -{ - struct ipqess *ess = netdev_priv(netdev); - struct device_node *of_node = ess->pdev->dev.of_node; - return phylink_of_phy_connect(ess->phylink, of_node, 0); -} - -static void ipqess_uninit(struct net_device *netdev) -{ - struct ipqess *ess = netdev_priv(netdev); - - phylink_disconnect_phy(ess->phylink); -} - -static int ipqess_open(struct net_device *netdev) -{ - struct ipqess *ess = netdev_priv(netdev); - int i; - - for (i = 0; i < IPQESS_NETDEV_QUEUES; i++) { - napi_enable(&ess->tx_ring[i].napi_tx); - napi_enable(&ess->rx_ring[i].napi_rx); - } - ipqess_irq_enable(ess); - phylink_start(ess->phylink); - netif_tx_start_all_queues(netdev); - - return 0; -} - -static int ipqess_stop(struct net_device *netdev) -{ - struct ipqess *ess = netdev_priv(netdev); - int i; - - netif_tx_stop_all_queues(netdev); - phylink_stop(ess->phylink); - ipqess_irq_disable(ess); - for (i = 0; i < IPQESS_NETDEV_QUEUES; i++) { - napi_disable(&ess->tx_ring[i].napi_tx); - napi_disable(&ess->rx_ring[i].napi_rx); - } - - return 0; -} - -static int ipqess_do_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) -{ - struct ipqess *ess = netdev_priv(netdev); - - switch (cmd) { - case SIOCGMIIPHY: - case SIOCGMIIREG: - case SIOCSMIIREG: - return phylink_mii_ioctl(ess->phylink, ifr, cmd); - default: - break; - } - - return -EOPNOTSUPP; -} - - -static inline u16 ipqess_tx_desc_available(struct ipqess_tx_ring *tx_ring) -{ - u16 count = 0; - - if (tx_ring->tail <= tx_ring->head) - count = IPQESS_TX_RING_SIZE; - - count += tx_ring->tail - tx_ring->head - 1; - - return count; -} - -static inline int ipqess_cal_txd_req(struct sk_buff *skb) -{ - int tpds; - - /* one TPD for the header, and one for each fragments */ - tpds = 1 + skb_shinfo(skb)->nr_frags; - if (skb_is_gso(skb) && skb_is_gso_v6(skb)) { - /* for LSOv2 one extra TPD is needed */ - tpds++; - } - - return tpds; -} - -static struct ipqess_buf *ipqess_get_tx_buffer(struct ipqess_tx_ring *tx_ring, - struct ipqess_tx_desc *desc) -{ - return &tx_ring->buf[desc - tx_ring->hw_desc]; -} - -static struct ipqess_tx_desc *ipqess_tx_desc_next(struct ipqess_tx_ring *tx_ring) -{ - struct ipqess_tx_desc *desc; - - desc = &tx_ring->hw_desc[tx_ring->head]; - tx_ring->head = IPQESS_NEXT_IDX(tx_ring->head, tx_ring->count); - - return desc; -} - -static void ipqess_rollback_tx(struct ipqess *eth, - struct ipqess_tx_desc *first_desc, int ring_id) -{ - struct ipqess_tx_ring *tx_ring = ð->tx_ring[ring_id]; - struct ipqess_buf *buf; - struct ipqess_tx_desc *desc = NULL; - u16 start_index, index; - - start_index = first_desc - tx_ring->hw_desc; - - index = start_index; - while (index != tx_ring->head) { - desc = &tx_ring->hw_desc[index]; - buf = &tx_ring->buf[index]; - ipqess_tx_unmap_and_free(ð->pdev->dev, buf); - memset(desc, 0, sizeof(struct ipqess_tx_desc)); - if (++index == tx_ring->count) - index = 0; - } - tx_ring->head = start_index; -} - -static bool ipqess_process_dsa_tag_sh(struct sk_buff *skb, u32 *word3) -{ - struct skb_shared_info *shinfo = skb_shinfo(skb); - struct ipq40xx_dsa_tag_data *tag_data; - - if (shinfo->dsa_tag_proto != DSA_TAG_PROTO_IPQ4019) - return false; - - tag_data = (struct ipq40xx_dsa_tag_data *)shinfo->dsa_tag_data; - - pr_debug("SH tag @ %08x, dp:%02x from_cpu:%u\n", - (u32)tag_data, tag_data->dp, tag_data->from_cpu); - - *word3 |= tag_data->dp << IPQESS_TPD_PORT_BITMAP_SHIFT; - if (tag_data->from_cpu) - *word3 |= BIT(IPQESS_TPD_FROM_CPU_SHIFT); - - return true; -} - -static void ipqess_get_dp_info(struct ipqess *ess, struct sk_buff *skb, - u32 *word3) -{ - if (netdev_uses_dsa(ess->netdev)) { - - if (ipqess_process_dsa_tag_sh(skb, word3)) - return; - } - - *word3 |= 0x3e << IPQESS_TPD_PORT_BITMAP_SHIFT; -} - -static int ipqess_tx_map_and_fill(struct ipqess_tx_ring *tx_ring, struct sk_buff *skb) -{ - struct ipqess_buf *buf = NULL; - struct platform_device *pdev = tx_ring->ess->pdev; - struct ipqess_tx_desc *desc = NULL, *first_desc = NULL; - u32 word1 = 0, word3 = 0, lso_word1 = 0, svlan_tag = 0; - u16 len; - int i; - - ipqess_get_dp_info(tx_ring->ess, skb, &word3); - - if (skb_is_gso(skb)) { - if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV4) { - lso_word1 |= IPQESS_TPD_IPV4_EN; - ip_hdr(skb)->check = 0; - tcp_hdr(skb)->check = ~csum_tcpudp_magic(ip_hdr(skb)->saddr, - ip_hdr(skb)->daddr, 0, IPPROTO_TCP, 0); - } else if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6) { - lso_word1 |= IPQESS_TPD_LSO_V2_EN; - ipv6_hdr(skb)->payload_len = 0; - tcp_hdr(skb)->check = ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr, - &ipv6_hdr(skb)->daddr, 0, IPPROTO_TCP, 0); - } - - lso_word1 |= IPQESS_TPD_LSO_EN | - ((skb_shinfo(skb)->gso_size & IPQESS_TPD_MSS_MASK) << IPQESS_TPD_MSS_SHIFT) | - (skb_transport_offset(skb) << IPQESS_TPD_HDR_SHIFT); - } else if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) { - u8 css, cso; - cso = skb_checksum_start_offset(skb); - css = cso + skb->csum_offset; - - word1 |= (IPQESS_TPD_CUSTOM_CSUM_EN); - word1 |= (cso >> 1) << IPQESS_TPD_HDR_SHIFT; - word1 |= ((css >> 1) << IPQESS_TPD_CUSTOM_CSUM_SHIFT); - } - - if (skb_vlan_tag_present(skb)) { - switch (skb->vlan_proto) { - case htons(ETH_P_8021Q): - word3 |= BIT(IPQESS_TX_INS_CVLAN); - word3 |= skb_vlan_tag_get(skb) << IPQESS_TX_CVLAN_TAG_SHIFT; - break; - case htons(ETH_P_8021AD): - word1 |= BIT(IPQESS_TX_INS_SVLAN); - svlan_tag = skb_vlan_tag_get(skb); - break; - default: - dev_err(&pdev->dev, "no ctag or stag present\n"); - goto vlan_tag_error; - } - } - - if (eth_type_vlan(skb->protocol)) - word1 |= IPQESS_TPD_VLAN_TAGGED; - - if (skb->protocol == htons(ETH_P_PPP_SES)) - word1 |= IPQESS_TPD_PPPOE_EN; - - len = skb_headlen(skb); - - first_desc = desc = ipqess_tx_desc_next(tx_ring); - if (lso_word1 & IPQESS_TPD_LSO_V2_EN) { - desc->addr = cpu_to_le16(skb->len); - desc->word1 = word1 | lso_word1; - desc->svlan_tag = svlan_tag; - desc->word3 = word3; - desc = ipqess_tx_desc_next(tx_ring); - } - - buf = ipqess_get_tx_buffer(tx_ring, desc); - buf->length = len; - buf->dma = dma_map_single(&pdev->dev, - skb->data, len, DMA_TO_DEVICE); - if (dma_mapping_error(&pdev->dev, buf->dma)) - goto dma_error; - - desc->addr = cpu_to_le32(buf->dma); - desc->len = cpu_to_le16(len); - - buf->flags |= IPQESS_DESC_SINGLE; - desc->word1 = word1 | lso_word1; - desc->svlan_tag = svlan_tag; - desc->word3 = word3; - - for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { - skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; - len = skb_frag_size(frag); - desc = ipqess_tx_desc_next(tx_ring); - buf = ipqess_get_tx_buffer(tx_ring, desc); - buf->length = len; - buf->flags |= IPQESS_DESC_PAGE; - buf->dma = skb_frag_dma_map(&pdev->dev, frag, 0, len, DMA_TO_DEVICE); - if (dma_mapping_error(&pdev->dev, buf->dma)) - goto dma_error; - - desc->addr = cpu_to_le32(buf->dma); - desc->len = cpu_to_le16(len); - desc->svlan_tag = svlan_tag; - desc->word1 = word1 | lso_word1; - desc->word3 = word3; - } - desc->word1 |= 1 << IPQESS_TPD_EOP_SHIFT; - buf->skb = skb; - buf->flags |= IPQESS_DESC_LAST; - - return 0; - -dma_error: - ipqess_rollback_tx(tx_ring->ess, first_desc, tx_ring->ring_id); - dev_err(&pdev->dev, "TX DMA map failed\n"); - -vlan_tag_error: - return -ENOMEM; -} - -static inline void ipqess_kick_tx(struct ipqess_tx_ring *tx_ring) -{ - /* Ensure that all TPDs has been written completely */ - dma_wmb(); - - /* update software producer index */ - ipqess_w32(tx_ring->ess, IPQESS_REG_TPD_IDX_Q(tx_ring->idx), - tx_ring->head); -} - -static netdev_tx_t ipqess_xmit(struct sk_buff *skb, - struct net_device *netdev) -{ - struct ipqess *ess = netdev_priv(netdev); - struct ipqess_tx_ring *tx_ring; - int avail; - int tx_num; - int ret; - - tx_ring = &ess->tx_ring[skb_get_queue_mapping(skb)]; - tx_num = ipqess_cal_txd_req(skb); - avail = ipqess_tx_desc_available(tx_ring); - if (avail < tx_num) { - netdev_dbg(netdev, - "stopping tx queue %d, avail=%d req=%d im=%x\n", - tx_ring->idx, avail, tx_num, - ipqess_r32(tx_ring->ess, - IPQESS_REG_TX_INT_MASK_Q(tx_ring->idx))); - netif_tx_stop_queue(tx_ring->nq); - ipqess_w32(tx_ring->ess, IPQESS_REG_TX_INT_MASK_Q(tx_ring->idx), 0x1); - ipqess_kick_tx(tx_ring); - return NETDEV_TX_BUSY; - } - - ret = ipqess_tx_map_and_fill(tx_ring, skb); - if (ret) { - dev_kfree_skb_any(skb); - ess->stats.tx_errors++; - goto err_out; - } - - ess->stats.tx_packets++; - ess->stats.tx_bytes += skb->len; - netdev_tx_sent_queue(tx_ring->nq, skb->len); - - if (!netdev_xmit_more() || netif_xmit_stopped(tx_ring->nq)) - ipqess_kick_tx(tx_ring); - -err_out: - return NETDEV_TX_OK; -} - -static int ipqess_set_mac_address(struct net_device *netdev, void *p) -{ - int ret = eth_mac_addr(netdev, p); - struct ipqess *ess = netdev_priv(netdev); - const char *macaddr = netdev->dev_addr; - - if (ret) - return ret; - -// spin_lock_bh(&mac->hw->page_lock); - ipqess_w32(ess, IPQESS_REG_MAC_CTRL1, - (macaddr[0] << 8) | macaddr[1]); - ipqess_w32(ess, IPQESS_REG_MAC_CTRL0, - (macaddr[2] << 24) | (macaddr[3] << 16) | - (macaddr[4] << 8) | macaddr[5]); -// spin_unlock_bh(&mac->hw->page_lock); - - return 0; -} - -static void ipqess_tx_timeout(struct net_device *netdev, unsigned int txq_id) -{ - struct ipqess *ess = netdev_priv(netdev); - struct ipqess_tx_ring *tr = &ess->tx_ring[txq_id]; - - netdev_warn(netdev, "hardware queue %d is in stuck?\n", - tr->idx); - - /* TODO: dump hardware queue */ -} - -static const struct net_device_ops ipqess_axi_netdev_ops = { - .ndo_init = ipqess_init, - .ndo_uninit = ipqess_uninit, - .ndo_open = ipqess_open, - .ndo_stop = ipqess_stop, - .ndo_do_ioctl = ipqess_do_ioctl, - .ndo_start_xmit = ipqess_xmit, - .ndo_get_stats = ipqess_get_stats, - .ndo_set_mac_address = ipqess_set_mac_address, - .ndo_tx_timeout = ipqess_tx_timeout, -}; - -static void ipqess_hw_stop(struct ipqess *ess) -{ - int i; - - /* disable all RX queue IRQs */ - for (i = 0; i < IPQESS_MAX_RX_QUEUE; i++) - ipqess_w32(ess, IPQESS_REG_RX_INT_MASK_Q(i), 0); - - /* disable all TX queue IRQs */ - for (i = 0; i < IPQESS_MAX_TX_QUEUE; i++) - ipqess_w32(ess, IPQESS_REG_TX_INT_MASK_Q(i), 0); - - /* disable all other IRQs */ - ipqess_w32(ess, IPQESS_REG_MISC_IMR, 0); - ipqess_w32(ess, IPQESS_REG_WOL_IMR, 0); - - /* clear the IRQ status registers */ - ipqess_w32(ess, IPQESS_REG_RX_ISR, 0xff); - ipqess_w32(ess, IPQESS_REG_TX_ISR, 0xffff); - ipqess_w32(ess, IPQESS_REG_MISC_ISR, 0x1fff); - ipqess_w32(ess, IPQESS_REG_WOL_ISR, 0x1); - ipqess_w32(ess, IPQESS_REG_WOL_CTRL, 0); - - /* disable RX and TX queues */ - ipqess_m32(ess, IPQESS_RXQ_CTRL_EN_MASK, 0, IPQESS_REG_RXQ_CTRL); - ipqess_m32(ess, IPQESS_TXQ_CTRL_TXQ_EN, 0, IPQESS_REG_TXQ_CTRL); -} - -static int ipqess_hw_init(struct ipqess *ess) -{ - u32 tmp; - int i, err; - - ipqess_hw_stop(ess); - - ipqess_m32(ess, BIT(IPQESS_INTR_SW_IDX_W_TYP_SHIFT), - IPQESS_INTR_SW_IDX_W_TYPE << IPQESS_INTR_SW_IDX_W_TYP_SHIFT, - IPQESS_REG_INTR_CTRL); - - /* enable IRQ delay slot */ - ipqess_w32(ess, IPQESS_REG_IRQ_MODRT_TIMER_INIT, - (IPQESS_TX_IMT << IPQESS_IRQ_MODRT_TX_TIMER_SHIFT) | - (IPQESS_RX_IMT << IPQESS_IRQ_MODRT_RX_TIMER_SHIFT)); - - /* Set Customer and Service VLAN TPIDs */ - ipqess_w32(ess, IPQESS_REG_VLAN_CFG, - (ETH_P_8021Q << IPQESS_VLAN_CFG_CVLAN_TPID_SHIFT) | - (ETH_P_8021AD << IPQESS_VLAN_CFG_SVLAN_TPID_SHIFT)); - - /* Configure the TX Queue bursting */ - ipqess_w32(ess, IPQESS_REG_TXQ_CTRL, - (IPQESS_TPD_BURST << IPQESS_TXQ_NUM_TPD_BURST_SHIFT) | - (IPQESS_TXF_BURST << IPQESS_TXQ_TXF_BURST_NUM_SHIFT) | - IPQESS_TXQ_CTRL_TPD_BURST_EN); - - /* Set RSS type */ - ipqess_w32(ess, IPQESS_REG_RSS_TYPE, - IPQESS_RSS_TYPE_IPV4TCP | IPQESS_RSS_TYPE_IPV6_TCP | - IPQESS_RSS_TYPE_IPV4_UDP | IPQESS_RSS_TYPE_IPV6UDP | - IPQESS_RSS_TYPE_IPV4 | IPQESS_RSS_TYPE_IPV6); - - /* Set RFD ring burst and threshold */ - ipqess_w32(ess, IPQESS_REG_RX_DESC1, - (IPQESS_RFD_BURST << IPQESS_RXQ_RFD_BURST_NUM_SHIFT) | - (IPQESS_RFD_THR << IPQESS_RXQ_RFD_PF_THRESH_SHIFT) | - (IPQESS_RFD_LTHR << IPQESS_RXQ_RFD_LOW_THRESH_SHIFT)); - - /* Set Rx FIFO - * - threshold to start to DMA data to host - */ - ipqess_w32(ess, IPQESS_REG_RXQ_CTRL, - IPQESS_FIFO_THRESH_128_BYTE | IPQESS_RXQ_CTRL_RMV_VLAN); - - err = ipqess_rx_ring_alloc(ess); - if (err) - return err; - - err = ipqess_tx_ring_alloc(ess); - if (err) - return err; - - /* Load all of ring base addresses above into the dma engine */ - ipqess_m32(ess, 0, BIT(IPQESS_LOAD_PTR_SHIFT), - IPQESS_REG_TX_SRAM_PART); - - /* Disable TX FIFO low watermark and high watermark */ - ipqess_w32(ess, IPQESS_REG_TXF_WATER_MARK, 0); - - /* Configure RSS indirection table. - * 128 hash will be configured in the following - * pattern: hash{0,1,2,3} = {Q0,Q2,Q4,Q6} respectively - * and so on - */ - for (i = 0; i < IPQESS_NUM_IDT; i++) - ipqess_w32(ess, IPQESS_REG_RSS_IDT(i), IPQESS_RSS_IDT_VALUE); - - /* Configure load balance mapping table. - * 4 table entry will be configured according to the - * following pattern: load_balance{0,1,2,3} = {Q0,Q1,Q3,Q4} - * respectively. - */ - ipqess_w32(ess, IPQESS_REG_LB_RING, IPQESS_LB_REG_VALUE); - - /* Configure Virtual queue for Tx rings */ - ipqess_w32(ess, IPQESS_REG_VQ_CTRL0, IPQESS_VQ_REG_VALUE); - ipqess_w32(ess, IPQESS_REG_VQ_CTRL1, IPQESS_VQ_REG_VALUE); - - /* Configure Max AXI Burst write size to 128 bytes*/ - ipqess_w32(ess, IPQESS_REG_AXIW_CTRL_MAXWRSIZE, - IPQESS_AXIW_MAXWRSIZE_VALUE); - - /* Enable TX queues */ - ipqess_m32(ess, 0, IPQESS_TXQ_CTRL_TXQ_EN, IPQESS_REG_TXQ_CTRL); - - /* Enable RX queues */ - tmp = 0; - for (i = 0; i < IPQESS_NETDEV_QUEUES; i++) - tmp |= IPQESS_RXQ_CTRL_EN(ess->rx_ring[i].idx); - - ipqess_m32(ess, IPQESS_RXQ_CTRL_EN_MASK, tmp, IPQESS_REG_RXQ_CTRL); - - return 0; -} - -static void ipqess_validate(struct phylink_config *config, - unsigned long *supported, - struct phylink_link_state *state) -{ - struct ipqess *ess = container_of(config, struct ipqess, phylink_config); - __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; - - if (state->interface != PHY_INTERFACE_MODE_INTERNAL) { - dev_err(&ess->pdev->dev, "unsupported interface mode: %d\n", - state->interface); - linkmode_zero(supported); - return; - } - - phylink_set_port_modes(mask); - phylink_set(mask, 1000baseT_Full); - phylink_set(mask, Pause); - phylink_set(mask, Asym_Pause); - - linkmode_and(supported, supported, mask); - linkmode_and(state->advertising, state->advertising, mask); -} - -static void ipqess_mac_config(struct phylink_config *config, unsigned int mode, - const struct phylink_link_state *state) -{ - /* TODO */ -} - -static void ipqess_mac_link_down(struct phylink_config *config, - unsigned int mode, - phy_interface_t interface) -{ - /* TODO */ -} - -static void ipqess_mac_link_up(struct phylink_config *config, - struct phy_device *phy, unsigned int mode, - phy_interface_t interface, - int speed, int duplex, - bool tx_pause, bool rx_pause) -{ - /* TODO */ -} - -static struct phylink_mac_ops ipqess_phylink_mac_ops = { - .validate = ipqess_validate, - .mac_config = ipqess_mac_config, - .mac_link_up = ipqess_mac_link_up, - .mac_link_down = ipqess_mac_link_down, -}; - -static void ipqess_cleanup(struct ipqess *ess) -{ - ipqess_hw_stop(ess); - unregister_netdev(ess->netdev); - - ipqess_tx_ring_free(ess); - ipqess_rx_ring_free(ess); - - if (!IS_ERR_OR_NULL(ess->phylink)) - phylink_destroy(ess->phylink); -} - -static void ess_reset(struct ipqess *ess) -{ - reset_control_assert(ess->ess_rst); - - mdelay(10); - - reset_control_deassert(ess->ess_rst); - - /* Waiting for all inner tables to be flushed and reinitialized. - * This takes between 5 and 10ms. - */ - mdelay(10); -} - -static int ipqess_axi_probe(struct platform_device *pdev) -{ - struct device_node *np = pdev->dev.of_node; - struct ipqess *ess; - struct net_device *netdev; - struct resource *res; - int i, err = 0; - - netdev = devm_alloc_etherdev_mqs(&pdev->dev, sizeof(struct ipqess), - IPQESS_NETDEV_QUEUES, - IPQESS_NETDEV_QUEUES); - if (!netdev) - return -ENOMEM; - - ess = netdev_priv(netdev); - ess->netdev = netdev; - ess->pdev = pdev; - spin_lock_init(&ess->stats_lock); - SET_NETDEV_DEV(netdev, &pdev->dev); - platform_set_drvdata(pdev, netdev); - - err = of_get_mac_address(np, netdev->dev_addr); - if (err == -EPROBE_DEFER) - return -EPROBE_DEFER; - - if (err) { - - random_ether_addr(netdev->dev_addr); - dev_info(&ess->pdev->dev, "generated random MAC address %pM\n", - netdev->dev_addr); - netdev->addr_assign_type = NET_ADDR_RANDOM; - } - - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - ess->hw_addr = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(ess->hw_addr)) { - err = PTR_ERR(ess->hw_addr); - goto err_out; - } - - ess->ess_clk = of_clk_get_by_name(np, "ess_clk"); - if (IS_ERR(ess->ess_clk)) { - dev_err(&pdev->dev, "Failed to get ess_clk\n"); - return PTR_ERR(ess->ess_clk); - } - - ess->ess_rst = devm_reset_control_get(&pdev->dev, "ess_rst"); - if (IS_ERR(ess->ess_rst)) { - dev_err(&pdev->dev, "Failed to get ess_rst control!\n"); - return PTR_ERR(ess->ess_rst); - } - - clk_prepare_enable(ess->ess_clk); - - ess_reset(ess); - - ess->phylink_config.dev = &netdev->dev; - ess->phylink_config.type = PHYLINK_NETDEV; - ess->phylink_config.pcs_poll = true; - - ess->phylink = phylink_create(&ess->phylink_config, - of_fwnode_handle(np), - PHY_INTERFACE_MODE_INTERNAL, - &ipqess_phylink_mac_ops); - if (IS_ERR(ess->phylink)) { - err = PTR_ERR(ess->phylink); - goto err_out; - } - - for (i = 0; i < IPQESS_MAX_TX_QUEUE; i++) { - ess->tx_irq[i] = platform_get_irq(pdev, i); - scnprintf(ess->tx_irq_names[i], sizeof(ess->tx_irq_names[i]), - "%s:txq%d", pdev->name, i); - } - - for (i = 0; i < IPQESS_MAX_RX_QUEUE; i++) { - ess->rx_irq[i] = platform_get_irq(pdev, i + IPQESS_MAX_TX_QUEUE); - scnprintf(ess->rx_irq_names[i], sizeof(ess->rx_irq_names[i]), - "%s:rxq%d", pdev->name, i); - } - -#undef NETIF_F_TSO6 -#define NETIF_F_TSO6 0 - - netdev->netdev_ops = &ipqess_axi_netdev_ops; - netdev->features = NETIF_F_HW_CSUM | NETIF_F_RXCSUM | - NETIF_F_HW_VLAN_CTAG_RX | - NETIF_F_HW_VLAN_CTAG_TX | - NETIF_F_TSO | NETIF_F_TSO6 | - NETIF_F_GRO | NETIF_F_SG; - /* feature change is not supported yet */ - netdev->hw_features = 0; - netdev->vlan_features = NETIF_F_HW_CSUM | NETIF_F_SG | NETIF_F_RXCSUM | - NETIF_F_TSO | NETIF_F_TSO6 | - NETIF_F_GRO; - netdev->watchdog_timeo = 5 * HZ; - netdev->base_addr = (u32) ess->hw_addr; - netdev->max_mtu = 9000; - netdev->gso_max_segs = IPQESS_TX_RING_SIZE / 2; - - ipqess_set_ethtool_ops(netdev); - - err = register_netdev(netdev); - if (err) - goto err_out; - - err = ipqess_hw_init(ess); - if (err) - goto err_out; - - dev_set_threaded(netdev, true); - - for (i = 0; i < IPQESS_NETDEV_QUEUES; i++) { - int qid; - - netif_tx_napi_add(netdev, &ess->tx_ring[i].napi_tx, - ipqess_tx_napi, 64); - netif_napi_add(netdev, - &ess->rx_ring[i].napi_rx, - ipqess_rx_napi, 64); - - qid = ess->tx_ring[i].idx; - err = devm_request_irq(&ess->netdev->dev, ess->tx_irq[qid], - ipqess_interrupt_tx, 0, ess->tx_irq_names[qid], - &ess->tx_ring[i]); - if (err) - goto err_out; - - qid = ess->rx_ring[i].idx; - err = devm_request_irq(&ess->netdev->dev, ess->rx_irq[qid], - ipqess_interrupt_rx, 0, ess->rx_irq_names[qid], - &ess->rx_ring[i]); - if (err) - goto err_out; - } - - return 0; - -err_out: - ipqess_cleanup(ess); - return err; -} - -static int ipqess_axi_remove(struct platform_device *pdev) -{ - const struct net_device *netdev = platform_get_drvdata(pdev); - struct ipqess *ess = netdev_priv(netdev); - - ipqess_cleanup(ess); - - return 0; -} - -static const struct of_device_id ipqess_of_mtable[] = { - {.compatible = "qcom,ipq4019-ess-edma" }, - {} -}; -MODULE_DEVICE_TABLE(of, ipqess_of_mtable); - -static struct platform_driver ipqess_axi_driver = { - .driver = { - .name = "ipqess-edma", - .of_match_table = ipqess_of_mtable, - }, - .probe = ipqess_axi_probe, - .remove = ipqess_axi_remove, -}; - -module_platform_driver(ipqess_axi_driver); - -MODULE_AUTHOR("Qualcomm Atheros Inc"); -MODULE_AUTHOR("John Crispin "); -MODULE_AUTHOR("Christian Lamparter "); -MODULE_AUTHOR("Gabor Juhos "); -MODULE_LICENSE("GPL"); diff --git a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/ipqess/ipqess.h b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/ipqess/ipqess.h deleted file mode 100644 index ca4cb7b2d42073..00000000000000 --- a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/ipqess/ipqess.h +++ /dev/null @@ -1,530 +0,0 @@ -// SPDX-License-Identifier: (GPL-2.0 OR ISC) -/* Copyright (c) 2014 - 2016, The Linux Foundation. All rights reserved. - * Copyright (c) 2017 - 2018, John Crispin - * Copyright (c) 2018 - 2019, Christian Lamparter - * Copyright (c) 2020 - 2021, Gabor Juhos - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _IPQESS_H_ -#define _IPQESS_H_ - -#define IPQESS_NETDEV_QUEUES 4 - -#define IPQESS_TPD_EOP_SHIFT 31 - -#define IPQESS_PORT_ID_SHIFT 12 -#define IPQESS_PORT_ID_MASK 0x7 - -/* tpd word 3 bit 18-28 */ -#define IPQESS_TPD_PORT_BITMAP_SHIFT 18 - -#define IPQESS_TPD_FROM_CPU_SHIFT 25 - -#define IPQESS_RX_RING_SIZE 128 -#define IPQESS_RX_HEAD_BUFF_SIZE 1540 -#define IPQESS_TX_RING_SIZE 128 -#define IPQESS_MAX_RX_QUEUE 8 -#define IPQESS_MAX_TX_QUEUE 16 - - -/* Configurations */ -#define IPQESS_INTR_CLEAR_TYPE 0 -#define IPQESS_INTR_SW_IDX_W_TYPE 0 -#define IPQESS_FIFO_THRESH_TYPE 0 -#define IPQESS_RSS_TYPE 0 -#define IPQESS_RX_IMT 0x0020 -#define IPQESS_TX_IMT 0x0050 -#define IPQESS_TPD_BURST 5 -#define IPQESS_TXF_BURST 0x100 -#define IPQESS_RFD_BURST 8 -#define IPQESS_RFD_THR 16 -#define IPQESS_RFD_LTHR 0 - -/* Flags used in transmit direction */ -#define IPQESS_DESC_LAST 0x1 -#define IPQESS_DESC_SINGLE 0x2 -#define IPQESS_DESC_PAGE 0x4 - -struct ipqesstool_statistics { - u32 tx_q0_pkt; - u32 tx_q1_pkt; - u32 tx_q2_pkt; - u32 tx_q3_pkt; - u32 tx_q4_pkt; - u32 tx_q5_pkt; - u32 tx_q6_pkt; - u32 tx_q7_pkt; - u32 tx_q8_pkt; - u32 tx_q9_pkt; - u32 tx_q10_pkt; - u32 tx_q11_pkt; - u32 tx_q12_pkt; - u32 tx_q13_pkt; - u32 tx_q14_pkt; - u32 tx_q15_pkt; - u32 tx_q0_byte; - u32 tx_q1_byte; - u32 tx_q2_byte; - u32 tx_q3_byte; - u32 tx_q4_byte; - u32 tx_q5_byte; - u32 tx_q6_byte; - u32 tx_q7_byte; - u32 tx_q8_byte; - u32 tx_q9_byte; - u32 tx_q10_byte; - u32 tx_q11_byte; - u32 tx_q12_byte; - u32 tx_q13_byte; - u32 tx_q14_byte; - u32 tx_q15_byte; - u32 rx_q0_pkt; - u32 rx_q1_pkt; - u32 rx_q2_pkt; - u32 rx_q3_pkt; - u32 rx_q4_pkt; - u32 rx_q5_pkt; - u32 rx_q6_pkt; - u32 rx_q7_pkt; - u32 rx_q0_byte; - u32 rx_q1_byte; - u32 rx_q2_byte; - u32 rx_q3_byte; - u32 rx_q4_byte; - u32 rx_q5_byte; - u32 rx_q6_byte; - u32 rx_q7_byte; - u32 tx_desc_error; -}; - -struct ipqess_tx_desc { - __le16 len; - __le16 svlan_tag; - __le32 word1; - __le32 addr; - __le32 word3; -} __aligned(16) __packed; - -struct ipqess_rx_desc { - u16 rrd0; - u16 rrd1; - u16 rrd2; - u16 rrd3; - u16 rrd4; - u16 rrd5; - u16 rrd6; - u16 rrd7; -} __aligned(16) __packed; - -struct ipqess_buf { - struct sk_buff *skb; - dma_addr_t dma; - u32 flags; - u16 length; -}; - -struct ipqess_tx_ring { - struct napi_struct napi_tx; - u32 idx; - int ring_id; - struct ipqess *ess; - struct netdev_queue *nq; - struct ipqess_tx_desc *hw_desc; - struct ipqess_buf *buf; - dma_addr_t dma; - u16 count; - u16 head; - u16 tail; -}; - -struct ipqess_rx_ring { - struct napi_struct napi_rx; - u32 idx; - int ring_id; - struct ipqess *ess; - struct device *ppdev; - struct ipqess_rx_desc **hw_desc; - struct ipqess_buf *buf; - dma_addr_t dma; - u16 head; - u16 tail; - atomic_t refill_count; -}; - -struct ipqess_rx_ring_refill { - struct ipqess_rx_ring *rx_ring; - struct work_struct refill_work; -}; - -#define IPQESS_IRQ_NAME_LEN 32 - -struct ipqess { - struct net_device *netdev; - void __iomem *hw_addr; - struct clk *ess_clk; - struct reset_control *ess_rst; - - struct ipqess_rx_ring rx_ring[IPQESS_NETDEV_QUEUES]; - - struct platform_device *pdev; - struct phylink *phylink; - struct phylink_config phylink_config; - struct ipqess_tx_ring tx_ring[IPQESS_NETDEV_QUEUES]; - - struct ipqesstool_statistics ipqessstats; - spinlock_t stats_lock; - struct net_device_stats stats; - - struct ipqess_rx_ring_refill rx_refill[IPQESS_NETDEV_QUEUES]; - u32 tx_irq[IPQESS_MAX_TX_QUEUE]; - char tx_irq_names[IPQESS_MAX_TX_QUEUE][IPQESS_IRQ_NAME_LEN]; - u32 rx_irq[IPQESS_MAX_RX_QUEUE]; - char rx_irq_names[IPQESS_MAX_TX_QUEUE][IPQESS_IRQ_NAME_LEN]; -}; - -static inline void build_test(void) -{ - struct ipqess *ess; - BUILD_BUG_ON(ARRAY_SIZE(ess->rx_ring) != ARRAY_SIZE(ess->rx_refill)); -} - -void ipqess_set_ethtool_ops(struct net_device *netdev); -void ipqess_update_hw_stats(struct ipqess *ess); - -/* register definition */ -#define IPQESS_REG_MAS_CTRL 0x0 -#define IPQESS_REG_TIMEOUT_CTRL 0x004 -#define IPQESS_REG_DBG0 0x008 -#define IPQESS_REG_DBG1 0x00C -#define IPQESS_REG_SW_CTRL0 0x100 -#define IPQESS_REG_SW_CTRL1 0x104 - -/* Interrupt Status Register */ -#define IPQESS_REG_RX_ISR 0x200 -#define IPQESS_REG_TX_ISR 0x208 -#define IPQESS_REG_MISC_ISR 0x210 -#define IPQESS_REG_WOL_ISR 0x218 - -#define IPQESS_MISC_ISR_RX_URG_Q(x) (1 << x) - -#define IPQESS_MISC_ISR_AXIR_TIMEOUT 0x00000100 -#define IPQESS_MISC_ISR_AXIR_ERR 0x00000200 -#define IPQESS_MISC_ISR_TXF_DEAD 0x00000400 -#define IPQESS_MISC_ISR_AXIW_ERR 0x00000800 -#define IPQESS_MISC_ISR_AXIW_TIMEOUT 0x00001000 - -#define IPQESS_WOL_ISR 0x00000001 - -/* Interrupt Mask Register */ -#define IPQESS_REG_MISC_IMR 0x214 -#define IPQESS_REG_WOL_IMR 0x218 - -#define IPQESS_RX_IMR_NORMAL_MASK 0x1 -#define IPQESS_TX_IMR_NORMAL_MASK 0x1 -#define IPQESS_MISC_IMR_NORMAL_MASK 0x80001FFF -#define IPQESS_WOL_IMR_NORMAL_MASK 0x1 - -/* Edma receive consumer index */ -#define IPQESS_REG_RX_SW_CONS_IDX_Q(x) (0x220 + ((x) << 2)) /* x is the queue id */ - -/* Edma transmit consumer index */ -#define IPQESS_REG_TX_SW_CONS_IDX_Q(x) (0x240 + ((x) << 2)) /* x is the queue id */ - -/* IRQ Moderator Initial Timer Register */ -#define IPQESS_REG_IRQ_MODRT_TIMER_INIT 0x280 -#define IPQESS_IRQ_MODRT_TIMER_MASK 0xFFFF -#define IPQESS_IRQ_MODRT_RX_TIMER_SHIFT 0 -#define IPQESS_IRQ_MODRT_TX_TIMER_SHIFT 16 - -/* Interrupt Control Register */ -#define IPQESS_REG_INTR_CTRL 0x284 -#define IPQESS_INTR_CLR_TYP_SHIFT 0 -#define IPQESS_INTR_SW_IDX_W_TYP_SHIFT 1 -#define IPQESS_INTR_CLEAR_TYPE_W1 0 -#define IPQESS_INTR_CLEAR_TYPE_R 1 - -/* RX Interrupt Mask Register */ -#define IPQESS_REG_RX_INT_MASK_Q(x) (0x300 + ((x) << 2)) /* x = queue id */ - -/* TX Interrupt mask register */ -#define IPQESS_REG_TX_INT_MASK_Q(x) (0x340 + ((x) << 2)) /* x = queue id */ - -/* Load Ptr Register - * Software sets this bit after the initialization of the head and tail - */ -#define IPQESS_REG_TX_SRAM_PART 0x400 -#define IPQESS_LOAD_PTR_SHIFT 16 - -/* TXQ Control Register */ -#define IPQESS_REG_TXQ_CTRL 0x404 -#define IPQESS_TXQ_CTRL_IP_OPTION_EN 0x10 -#define IPQESS_TXQ_CTRL_TXQ_EN 0x20 -#define IPQESS_TXQ_CTRL_ENH_MODE 0x40 -#define IPQESS_TXQ_CTRL_LS_8023_EN 0x80 -#define IPQESS_TXQ_CTRL_TPD_BURST_EN 0x100 -#define IPQESS_TXQ_CTRL_LSO_BREAK_EN 0x200 -#define IPQESS_TXQ_NUM_TPD_BURST_MASK 0xF -#define IPQESS_TXQ_TXF_BURST_NUM_MASK 0xFFFF -#define IPQESS_TXQ_NUM_TPD_BURST_SHIFT 0 -#define IPQESS_TXQ_TXF_BURST_NUM_SHIFT 16 - -#define IPQESS_REG_TXF_WATER_MARK 0x408 /* In 8-bytes */ -#define IPQESS_TXF_WATER_MARK_MASK 0x0FFF -#define IPQESS_TXF_LOW_WATER_MARK_SHIFT 0 -#define IPQESS_TXF_HIGH_WATER_MARK_SHIFT 16 -#define IPQESS_TXQ_CTRL_BURST_MODE_EN 0x80000000 - -/* WRR Control Register */ -#define IPQESS_REG_WRR_CTRL_Q0_Q3 0x40c -#define IPQESS_REG_WRR_CTRL_Q4_Q7 0x410 -#define IPQESS_REG_WRR_CTRL_Q8_Q11 0x414 -#define IPQESS_REG_WRR_CTRL_Q12_Q15 0x418 - -/* Weight round robin(WRR), it takes queue as input, and computes - * starting bits where we need to write the weight for a particular - * queue - */ -#define IPQESS_WRR_SHIFT(x) (((x) * 5) % 20) - -/* Tx Descriptor Control Register */ -#define IPQESS_REG_TPD_RING_SIZE 0x41C -#define IPQESS_TPD_RING_SIZE_SHIFT 0 -#define IPQESS_TPD_RING_SIZE_MASK 0xFFFF - -/* Transmit descriptor base address */ -#define IPQESS_REG_TPD_BASE_ADDR_Q(x) (0x420 + ((x) << 2)) /* x = queue id */ - -/* TPD Index Register */ -#define IPQESS_REG_TPD_IDX_Q(x) (0x460 + ((x) << 2)) /* x = queue id */ - -#define IPQESS_TPD_PROD_IDX_BITS 0x0000FFFF -#define IPQESS_TPD_CONS_IDX_BITS 0xFFFF0000 -#define IPQESS_TPD_PROD_IDX_MASK 0xFFFF -#define IPQESS_TPD_CONS_IDX_MASK 0xFFFF -#define IPQESS_TPD_PROD_IDX_SHIFT 0 -#define IPQESS_TPD_CONS_IDX_SHIFT 16 - -/* TX Virtual Queue Mapping Control Register */ -#define IPQESS_REG_VQ_CTRL0 0x4A0 -#define IPQESS_REG_VQ_CTRL1 0x4A4 - -/* Virtual QID shift, it takes queue as input, and computes - * Virtual QID position in virtual qid control register - */ -#define IPQESS_VQ_ID_SHIFT(i) (((i) * 3) % 24) - -/* Virtual Queue Default Value */ -#define IPQESS_VQ_REG_VALUE 0x240240 - -/* Tx side Port Interface Control Register */ -#define IPQESS_REG_PORT_CTRL 0x4A8 -#define IPQESS_PAD_EN_SHIFT 15 - -/* Tx side VLAN Configuration Register */ -#define IPQESS_REG_VLAN_CFG 0x4AC - -#define IPQESS_VLAN_CFG_SVLAN_TPID_SHIFT 0 -#define IPQESS_VLAN_CFG_SVLAN_TPID_MASK 0xffff -#define IPQESS_VLAN_CFG_CVLAN_TPID_SHIFT 16 -#define IPQESS_VLAN_CFG_CVLAN_TPID_MASK 0xffff - -#define IPQESS_TX_CVLAN 16 -#define IPQESS_TX_INS_CVLAN 17 -#define IPQESS_TX_CVLAN_TAG_SHIFT 0 - -#define IPQESS_TX_SVLAN 14 -#define IPQESS_TX_INS_SVLAN 15 -#define IPQESS_TX_SVLAN_TAG_SHIFT 16 - -/* Tx Queue Packet Statistic Register */ -#define IPQESS_REG_TX_STAT_PKT_Q(x) (0x700 + ((x) << 3)) /* x = queue id */ - -#define IPQESS_TX_STAT_PKT_MASK 0xFFFFFF - -/* Tx Queue Byte Statistic Register */ -#define IPQESS_REG_TX_STAT_BYTE_Q(x) (0x704 + ((x) << 3)) /* x = queue id */ - -/* Load Balance Based Ring Offset Register */ -#define IPQESS_REG_LB_RING 0x800 -#define IPQESS_LB_RING_ENTRY_MASK 0xff -#define IPQESS_LB_RING_ID_MASK 0x7 -#define IPQESS_LB_RING_PROFILE_ID_MASK 0x3 -#define IPQESS_LB_RING_ENTRY_BIT_OFFSET 8 -#define IPQESS_LB_RING_ID_OFFSET 0 -#define IPQESS_LB_RING_PROFILE_ID_OFFSET 3 -#define IPQESS_LB_REG_VALUE 0x6040200 - -/* Load Balance Priority Mapping Register */ -#define IPQESS_REG_LB_PRI_START 0x804 -#define IPQESS_REG_LB_PRI_END 0x810 -#define IPQESS_LB_PRI_REG_INC 4 -#define IPQESS_LB_PRI_ENTRY_BIT_OFFSET 4 -#define IPQESS_LB_PRI_ENTRY_MASK 0xf - -/* RSS Priority Mapping Register */ -#define IPQESS_REG_RSS_PRI 0x820 -#define IPQESS_RSS_PRI_ENTRY_MASK 0xf -#define IPQESS_RSS_RING_ID_MASK 0x7 -#define IPQESS_RSS_PRI_ENTRY_BIT_OFFSET 4 - -/* RSS Indirection Register */ -#define IPQESS_REG_RSS_IDT(x) (0x840 + ((x) << 2)) /* x = No. of indirection table */ -#define IPQESS_NUM_IDT 16 -#define IPQESS_RSS_IDT_VALUE 0x64206420 - -/* Default RSS Ring Register */ -#define IPQESS_REG_DEF_RSS 0x890 -#define IPQESS_DEF_RSS_MASK 0x7 - -/* RSS Hash Function Type Register */ -#define IPQESS_REG_RSS_TYPE 0x894 -#define IPQESS_RSS_TYPE_NONE 0x01 -#define IPQESS_RSS_TYPE_IPV4TCP 0x02 -#define IPQESS_RSS_TYPE_IPV6_TCP 0x04 -#define IPQESS_RSS_TYPE_IPV4_UDP 0x08 -#define IPQESS_RSS_TYPE_IPV6UDP 0x10 -#define IPQESS_RSS_TYPE_IPV4 0x20 -#define IPQESS_RSS_TYPE_IPV6 0x40 -#define IPQESS_RSS_HASH_MODE_MASK 0x7f - -#define IPQESS_REG_RSS_HASH_VALUE 0x8C0 - -#define IPQESS_REG_RSS_TYPE_RESULT 0x8C4 - -#define IPQESS_HASH_TYPE_START 0 -#define IPQESS_HASH_TYPE_END 5 -#define IPQESS_HASH_TYPE_SHIFT 12 - -#define IPQESS_RFS_FLOW_ENTRIES 1024 -#define IPQESS_RFS_FLOW_ENTRIES_MASK (IPQESS_RFS_FLOW_ENTRIES - 1) -#define IPQESS_RFS_EXPIRE_COUNT_PER_CALL 128 - -/* RFD Base Address Register */ -#define IPQESS_REG_RFD_BASE_ADDR_Q(x) (0x950 + ((x) << 2)) /* x = queue id */ - -/* RFD Index Register */ -#define IPQESS_REG_RFD_IDX_Q(x) (0x9B0 + ((x) << 2)) /* x = queue id */ - -#define IPQESS_RFD_PROD_IDX_BITS 0x00000FFF -#define IPQESS_RFD_CONS_IDX_BITS 0x0FFF0000 -#define IPQESS_RFD_PROD_IDX_MASK 0xFFF -#define IPQESS_RFD_CONS_IDX_MASK 0xFFF -#define IPQESS_RFD_PROD_IDX_SHIFT 0 -#define IPQESS_RFD_CONS_IDX_SHIFT 16 - -/* Rx Descriptor Control Register */ -#define IPQESS_REG_RX_DESC0 0xA10 -#define IPQESS_RFD_RING_SIZE_MASK 0xFFF -#define IPQESS_RX_BUF_SIZE_MASK 0xFFFF -#define IPQESS_RFD_RING_SIZE_SHIFT 0 -#define IPQESS_RX_BUF_SIZE_SHIFT 16 - -#define IPQESS_REG_RX_DESC1 0xA14 -#define IPQESS_RXQ_RFD_BURST_NUM_MASK 0x3F -#define IPQESS_RXQ_RFD_PF_THRESH_MASK 0x1F -#define IPQESS_RXQ_RFD_LOW_THRESH_MASK 0xFFF -#define IPQESS_RXQ_RFD_BURST_NUM_SHIFT 0 -#define IPQESS_RXQ_RFD_PF_THRESH_SHIFT 8 -#define IPQESS_RXQ_RFD_LOW_THRESH_SHIFT 16 - -/* RXQ Control Register */ -#define IPQESS_REG_RXQ_CTRL 0xA18 -#define IPQESS_FIFO_THRESH_TYPE_SHIF 0 -#define IPQESS_FIFO_THRESH_128_BYTE 0x0 -#define IPQESS_FIFO_THRESH_64_BYTE 0x1 -#define IPQESS_RXQ_CTRL_RMV_VLAN 0x00000002 -#define IPQESS_RXQ_CTRL_EN_MASK GENMASK(15, 8) -#define IPQESS_RXQ_CTRL_EN(__qid) BIT(8 + (__qid)) - -/* AXI Burst Size Config */ -#define IPQESS_REG_AXIW_CTRL_MAXWRSIZE 0xA1C -#define IPQESS_AXIW_MAXWRSIZE_VALUE 0x0 - -/* Rx Statistics Register */ -#define IPQESS_REG_RX_STAT_BYTE_Q(x) (0xA30 + ((x) << 2)) /* x = queue id */ -#define IPQESS_REG_RX_STAT_PKT_Q(x) (0xA50 + ((x) << 2)) /* x = queue id */ - -/* WoL Pattern Length Register */ -#define IPQESS_REG_WOL_PATTERN_LEN0 0xC00 -#define IPQESS_WOL_PT_LEN_MASK 0xFF -#define IPQESS_WOL_PT0_LEN_SHIFT 0 -#define IPQESS_WOL_PT1_LEN_SHIFT 8 -#define IPQESS_WOL_PT2_LEN_SHIFT 16 -#define IPQESS_WOL_PT3_LEN_SHIFT 24 - -#define IPQESS_REG_WOL_PATTERN_LEN1 0xC04 -#define IPQESS_WOL_PT4_LEN_SHIFT 0 -#define IPQESS_WOL_PT5_LEN_SHIFT 8 -#define IPQESS_WOL_PT6_LEN_SHIFT 16 - -/* WoL Control Register */ -#define IPQESS_REG_WOL_CTRL 0xC08 -#define IPQESS_WOL_WK_EN 0x00000001 -#define IPQESS_WOL_MG_EN 0x00000002 -#define IPQESS_WOL_PT0_EN 0x00000004 -#define IPQESS_WOL_PT1_EN 0x00000008 -#define IPQESS_WOL_PT2_EN 0x00000010 -#define IPQESS_WOL_PT3_EN 0x00000020 -#define IPQESS_WOL_PT4_EN 0x00000040 -#define IPQESS_WOL_PT5_EN 0x00000080 -#define IPQESS_WOL_PT6_EN 0x00000100 - -/* MAC Control Register */ -#define IPQESS_REG_MAC_CTRL0 0xC20 -#define IPQESS_REG_MAC_CTRL1 0xC24 - -/* WoL Pattern Register */ -#define IPQESS_REG_WOL_PATTERN_START 0x5000 -#define IPQESS_PATTERN_PART_REG_OFFSET 0x40 - - -/* TX descriptor fields */ -#define IPQESS_TPD_HDR_SHIFT 0 -#define IPQESS_TPD_PPPOE_EN 0x00000100 -#define IPQESS_TPD_IP_CSUM_EN 0x00000200 -#define IPQESS_TPD_TCP_CSUM_EN 0x0000400 -#define IPQESS_TPD_UDP_CSUM_EN 0x00000800 -#define IPQESS_TPD_CUSTOM_CSUM_EN 0x00000C00 -#define IPQESS_TPD_LSO_EN 0x00001000 -#define IPQESS_TPD_LSO_V2_EN 0x00002000 -/* The VLAN_TAGGED bit is not used in the publicly available - * drivers. The definition has been stolen from the Atheros - * 'alx' driver (drivers/net/ethernet/atheros/alx/hw.h). It - * seems that it has the same meaning in regard to the EDMA - * hardware. - */ -#define IPQESS_TPD_VLAN_TAGGED 0x00004000 -#define IPQESS_TPD_IPV4_EN 0x00010000 -#define IPQESS_TPD_MSS_MASK 0x1FFF -#define IPQESS_TPD_MSS_SHIFT 18 -#define IPQESS_TPD_CUSTOM_CSUM_SHIFT 18 - -/* RRD descriptor fields */ -#define IPQESS_RRD_NUM_RFD_MASK 0x000F -#define IPQESS_RRD_PKT_SIZE_MASK 0x3FFF -#define IPQESS_RRD_SRC_PORT_NUM_MASK 0x4000 -#define IPQESS_RRD_SVLAN 0x8000 -#define IPQESS_RRD_FLOW_COOKIE_MASK 0x07FF; - -#define IPQESS_RRD_PKT_SIZE_MASK 0x3FFF -#define IPQESS_RRD_CSUM_FAIL_MASK 0xC000 -#define IPQESS_RRD_CVLAN 0x0001 -#define IPQESS_RRD_DESC_VALID 0x8000 - -#define IPQESS_RRD_PRIORITY_SHIFT 4 -#define IPQESS_RRD_PRIORITY_MASK 0x7 -#define IPQESS_RRD_PORT_TYPE_SHIFT 7 -#define IPQESS_RRD_PORT_TYPE_MASK 0x1F - -#endif diff --git a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/ipqess/ipqess_ethtool.c b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/ipqess/ipqess_ethtool.c deleted file mode 100644 index da5fb4deed8976..00000000000000 --- a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/ipqess/ipqess_ethtool.c +++ /dev/null @@ -1,175 +0,0 @@ -// SPDX-License-Identifier: (GPL-2.0 OR ISC) -/* Copyright (c) 2015 - 2016, The Linux Foundation. All rights reserved. - * Copyright (c) 2017 - 2018, John Crispin - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all copies. - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include -#include -#include -#include - -#include "ipqess.h" - -struct ipqesstool_stats { - uint8_t string[ETH_GSTRING_LEN]; - uint32_t offset; -}; - -#define IPQESS_STAT(m) offsetof(struct ipqesstool_statistics, m) -#define DRVINFO_LEN 32 - -static const struct ipqesstool_stats ipqess_stats[] = { - {"tx_q0_pkt", IPQESS_STAT(tx_q0_pkt)}, - {"tx_q1_pkt", IPQESS_STAT(tx_q1_pkt)}, - {"tx_q2_pkt", IPQESS_STAT(tx_q2_pkt)}, - {"tx_q3_pkt", IPQESS_STAT(tx_q3_pkt)}, - {"tx_q4_pkt", IPQESS_STAT(tx_q4_pkt)}, - {"tx_q5_pkt", IPQESS_STAT(tx_q5_pkt)}, - {"tx_q6_pkt", IPQESS_STAT(tx_q6_pkt)}, - {"tx_q7_pkt", IPQESS_STAT(tx_q7_pkt)}, - {"tx_q8_pkt", IPQESS_STAT(tx_q8_pkt)}, - {"tx_q9_pkt", IPQESS_STAT(tx_q9_pkt)}, - {"tx_q10_pkt", IPQESS_STAT(tx_q10_pkt)}, - {"tx_q11_pkt", IPQESS_STAT(tx_q11_pkt)}, - {"tx_q12_pkt", IPQESS_STAT(tx_q12_pkt)}, - {"tx_q13_pkt", IPQESS_STAT(tx_q13_pkt)}, - {"tx_q14_pkt", IPQESS_STAT(tx_q14_pkt)}, - {"tx_q15_pkt", IPQESS_STAT(tx_q15_pkt)}, - {"tx_q0_byte", IPQESS_STAT(tx_q0_byte)}, - {"tx_q1_byte", IPQESS_STAT(tx_q1_byte)}, - {"tx_q2_byte", IPQESS_STAT(tx_q2_byte)}, - {"tx_q3_byte", IPQESS_STAT(tx_q3_byte)}, - {"tx_q4_byte", IPQESS_STAT(tx_q4_byte)}, - {"tx_q5_byte", IPQESS_STAT(tx_q5_byte)}, - {"tx_q6_byte", IPQESS_STAT(tx_q6_byte)}, - {"tx_q7_byte", IPQESS_STAT(tx_q7_byte)}, - {"tx_q8_byte", IPQESS_STAT(tx_q8_byte)}, - {"tx_q9_byte", IPQESS_STAT(tx_q9_byte)}, - {"tx_q10_byte", IPQESS_STAT(tx_q10_byte)}, - {"tx_q11_byte", IPQESS_STAT(tx_q11_byte)}, - {"tx_q12_byte", IPQESS_STAT(tx_q12_byte)}, - {"tx_q13_byte", IPQESS_STAT(tx_q13_byte)}, - {"tx_q14_byte", IPQESS_STAT(tx_q14_byte)}, - {"tx_q15_byte", IPQESS_STAT(tx_q15_byte)}, - {"rx_q0_pkt", IPQESS_STAT(rx_q0_pkt)}, - {"rx_q1_pkt", IPQESS_STAT(rx_q1_pkt)}, - {"rx_q2_pkt", IPQESS_STAT(rx_q2_pkt)}, - {"rx_q3_pkt", IPQESS_STAT(rx_q3_pkt)}, - {"rx_q4_pkt", IPQESS_STAT(rx_q4_pkt)}, - {"rx_q5_pkt", IPQESS_STAT(rx_q5_pkt)}, - {"rx_q6_pkt", IPQESS_STAT(rx_q6_pkt)}, - {"rx_q7_pkt", IPQESS_STAT(rx_q7_pkt)}, - {"rx_q0_byte", IPQESS_STAT(rx_q0_byte)}, - {"rx_q1_byte", IPQESS_STAT(rx_q1_byte)}, - {"rx_q2_byte", IPQESS_STAT(rx_q2_byte)}, - {"rx_q3_byte", IPQESS_STAT(rx_q3_byte)}, - {"rx_q4_byte", IPQESS_STAT(rx_q4_byte)}, - {"rx_q5_byte", IPQESS_STAT(rx_q5_byte)}, - {"rx_q6_byte", IPQESS_STAT(rx_q6_byte)}, - {"rx_q7_byte", IPQESS_STAT(rx_q7_byte)}, - {"tx_desc_error", IPQESS_STAT(tx_desc_error)}, -}; - -static int ipqess_get_strset_count(struct net_device *netdev, int sset) -{ - switch (sset) { - case ETH_SS_STATS: - return ARRAY_SIZE(ipqess_stats); - default: - netdev_dbg(netdev, "%s: Invalid string set", __func__); - return -EOPNOTSUPP; - } -} - -static void ipqess_get_strings(struct net_device *netdev, uint32_t stringset, - uint8_t *data) -{ - uint8_t *p = data; - uint32_t i; - - switch (stringset) { - case ETH_SS_STATS: - for (i = 0; i < ARRAY_SIZE(ipqess_stats); i++) { - memcpy(p, ipqess_stats[i].string, - min((size_t)ETH_GSTRING_LEN, - strlen(ipqess_stats[i].string) + 1)); - p += ETH_GSTRING_LEN; - } - break; - } -} - -static void ipqess_get_ethtool_stats(struct net_device *netdev, - struct ethtool_stats *stats, - uint64_t *data) -{ - struct ipqess *ess = netdev_priv(netdev); - u32 *essstats = (u32 *)&ess->ipqessstats; - int i; - - spin_lock(&ess->stats_lock); - - ipqess_update_hw_stats(ess); - - for (i = 0; i < ARRAY_SIZE(ipqess_stats); i++) - data[i] = *(u32 *)(essstats + (ipqess_stats[i].offset / sizeof(u32))); - - spin_unlock(&ess->stats_lock); -} - -static void ipqess_get_drvinfo(struct net_device *dev, - struct ethtool_drvinfo *info) -{ - strlcpy(info->driver, "qca_ipqess", DRVINFO_LEN); - strlcpy(info->bus_info, "axi", ETHTOOL_BUSINFO_LEN); -} - -static int ipqess_get_settings(struct net_device *netdev, - struct ethtool_link_ksettings *cmd) -{ - struct ipqess *ess = netdev_priv(netdev); - - return phylink_ethtool_ksettings_get(ess->phylink, cmd); -} - -static int ipqess_set_settings(struct net_device *netdev, - const struct ethtool_link_ksettings *cmd) -{ - struct ipqess *ess = netdev_priv(netdev); - - return phylink_ethtool_ksettings_set(ess->phylink, cmd); -} - -static void ipqess_get_ringparam(struct net_device *netdev, - struct ethtool_ringparam *ring) -{ - ring->tx_max_pending = IPQESS_TX_RING_SIZE; - ring->rx_max_pending = IPQESS_RX_RING_SIZE; -} - -static const struct ethtool_ops ipqesstool_ops = { - .get_drvinfo = &ipqess_get_drvinfo, - .get_link = ðtool_op_get_link, - .get_link_ksettings = &ipqess_get_settings, - .set_link_ksettings = &ipqess_set_settings, - .get_strings = &ipqess_get_strings, - .get_sset_count = &ipqess_get_strset_count, - .get_ethtool_stats = &ipqess_get_ethtool_stats, - .get_ringparam = ipqess_get_ringparam, -}; - -void ipqess_set_ethtool_ops(struct net_device *netdev) -{ - netdev->ethtool_ops = &ipqesstool_ops; -} diff --git a/target/linux/ipq40xx/files/drivers/net/phy/qca807x.c b/target/linux/ipq40xx/files/drivers/net/phy/qca807x.c index 23b0ca74f7142f..abfc11e121c1bf 100644 --- a/target/linux/ipq40xx/files/drivers/net/phy/qca807x.c +++ b/target/linux/ipq40xx/files/drivers/net/phy/qca807x.c @@ -644,8 +644,13 @@ static int qca807x_sfp_insert(void *upstream, const struct sfp_eeprom_id *id) __ETHTOOL_DECLARE_LINK_MODE_MASK(support) = { 0, }; phy_interface_t iface; int ret; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0) + DECLARE_PHY_INTERFACE_MASK(interfaces); + sfp_parse_support(phydev->sfp_bus, id, support, interfaces); +#else sfp_parse_support(phydev->sfp_bus, id, support); +#endif iface = sfp_select_interface(phydev->sfp_bus, support); dev_info(&phydev->mdio.dev, "%s SFP module inserted\n", phy_modes(iface)); diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk index 15f48a67b255cb..6581d81c00eb1d 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -538,6 +538,16 @@ define Device/extreme-networks_ws-ap3915i endef TARGET_DEVICES += extreme-networks_ws-ap3915i +define Device/extreme-networks_ws-ap391x + $(call Device/FitImage) + DEVICE_VENDOR := Extreme Networks + DEVICE_MODEL := WS-AP391x + IMAGE_SIZE := 15040k + SOC := qcom-ipq4029 + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size | append-metadata +endef +TARGET_DEVICES += extreme-networks_ws-ap391x + define Device/ezviz_cs-w3-wd1200g-eup $(call Device/FitImage) DEVICE_VENDOR := EZVIZ @@ -826,6 +836,30 @@ define Device/netgear_orbi DEVICE_PACKAGES := ath10k-firmware-qca9984-ct e2fsprogs kmod-fs-ext4 losetup endef +define Device/netgear_rbx40 + $(call Device/netgear_orbi) + NETGEAR_HW_ID := 29765515+0+4096+512+2x2+2x2+2x2 + KERNEL_SIZE := 3932160 + ROOTFS_SIZE := 32243712 + IMAGE_SIZE := 36175872 +endef + +define Device/netgear_rbr40 + $(call Device/netgear_rbx40) + DEVICE_MODEL := RBR40 + DEVICE_VARIANT := v1 + NETGEAR_BOARD_ID := RBR40 +endef +TARGET_DEVICES += netgear_rbr40 + +define Device/netgear_rbs40 + $(call Device/netgear_rbx40) + DEVICE_MODEL := RBS40 + DEVICE_VARIANT := v1 + NETGEAR_BOARD_ID := RBS40 +endef +TARGET_DEVICES += netgear_rbs40 + define Device/netgear_rbx50 $(call Device/netgear_orbi) NETGEAR_HW_ID := 29765352+0+4000+512+2x2+2x2+4x4 @@ -1098,6 +1132,20 @@ define Device/wallys_dr40x9 endef TARGET_DEVICES += wallys_dr40x9 +define Device/yyets_le1 + $(call Device/FitzImage) + DEVICE_VENDOR := YYeTs + DEVICE_MODEL := LE1 + SOC := qcom-ipq4019 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 31232k + IMAGES += factory.bin + IMAGE/factory.bin := qsdk-ipq-factory-nor | check-size + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata + DEVICE_PACKAGES := ipq-wifi-yyets_le1 kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += yyets_le1 + define Device/zte_mf18a $(call Device/FitImage) DEVICE_VENDOR := ZTE @@ -1122,6 +1170,20 @@ define Device/zte_mf28x_common DEVICE_PACKAGES := kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi endef +define Device/zte_mf282plus + $(call Device/zte_mf28x_common) + DEVICE_MODEL := MF282Plus +# The recovery image is used to return back to stock (an initramfs-based image +# that can be flashed to the device via sysupgrade +# The factory image is used to install from the stock firmware by using an +# exploit for the web interface + IMAGES += factory.bin recovery.bin + IMAGE/factory.bin := append-ubi + IMAGE/recovery.bin := append-squashfs4-fakeroot | sysupgrade-tar kernel=$$$$(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE) rootfs=$$$$@ | append-metadata + DEVICE_PACKAGES := kmod-usb-acm kmod-usb-net-rndis +endef +TARGET_DEVICES += zte_mf282plus + define Device/zte_mf286d $(call Device/zte_mf28x_common) DEVICE_MODEL := MF286D @@ -1130,7 +1192,6 @@ TARGET_DEVICES += zte_mf286d define Device/zte_mf287_common $(call Device/zte_mf28x_common) - DEVICE_PACKAGES += ipq-wifi-zte_mf287plus SOC := qcom-ipq4018 # The recovery image is used to return back to stock (an initramfs-based image # that can be flashed to the device via sysupgrade @@ -1138,20 +1199,28 @@ define Device/zte_mf287_common # exploit for the web interface IMAGES += factory.bin recovery.bin IMAGE/factory.bin := append-ubi - IMAGE/recovery.bin := append-squashfs4-fakeroot | sysupgrade-tar kernel=$$$$(BIN_DIR)/openwrt-$$(BOARD)$$(if $$(SUBTARGET),-$$(SUBTARGET))-$$(DEVICE_NAME)-initramfs-zImage.itb rootfs=$$$$@ | append-metadata + IMAGE/recovery.bin := append-squashfs4-fakeroot | sysupgrade-tar kernel=$$$$(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE) rootfs=$$$$@ | append-metadata endef define Device/zte_mf287plus $(call Device/zte_mf287_common) + DEVICE_PACKAGES += ipq-wifi-zte_mf287plus DEVICE_DTS_CONFIG := config@ap.dk01.1-c2 DEVICE_MODEL := MF287Plus - DEVICE_ALT0_VENDOR := ZTE - DEVICE_ALT0_MODEL := MF287 endef TARGET_DEVICES += zte_mf287plus +define Device/zte_mf287 + $(call Device/zte_mf287_common) + DEVICE_PACKAGES += ipq-wifi-zte_mf287 + DEVICE_DTS_CONFIG := config@ap.dk01.1-c2 + DEVICE_MODEL := MF287 +endef +TARGET_DEVICES += zte_mf287 + define Device/zte_mf287pro $(call Device/zte_mf287_common) + DEVICE_PACKAGES += ipq-wifi-zte_mf287plus DEVICE_DTS_CONFIG := config@ap.dk04.1-c1 DEVICE_MODEL := MF287Pro endef diff --git a/target/linux/ipq40xx/patches-5.15/300-clk-qcom-ipq4019-add-ess-reset.patch b/target/linux/ipq40xx/patches-5.15/300-clk-qcom-ipq4019-add-ess-reset.patch deleted file mode 100644 index eb015251a1efb3..00000000000000 --- a/target/linux/ipq40xx/patches-5.15/300-clk-qcom-ipq4019-add-ess-reset.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 480c1f7648fc586db12d6003c717c23667a4fcf0 Mon Sep 17 00:00:00 2001 -From: Ram Chandra Jangir -Date: Tue, 28 Mar 2017 22:35:33 +0530 -Subject: [PATCH] clk: qcom: ipq4019: add ess reset - -Added the ESS reset in IPQ4019 GCC. - -Signed-off-by: Ram Chandra Jangir ---- - drivers/clk/qcom/gcc-ipq4019.c | 11 +++++++++++ - include/dt-bindings/clock/qcom,gcc-ipq4019.h | 11 +++++++++++ - 2 files changed, 22 insertions(+) - ---- a/drivers/clk/qcom/gcc-ipq4019.c -+++ b/drivers/clk/qcom/gcc-ipq4019.c -@@ -1735,6 +1735,17 @@ static const struct qcom_reset_map gcc_i - [GCC_TCSR_BCR] = {0x22000, 0}, - [GCC_MPM_BCR] = {0x24000, 0}, - [GCC_SPDM_BCR] = {0x25000, 0}, -+ [ESS_MAC1_ARES] = {0x1200C, 0}, -+ [ESS_MAC2_ARES] = {0x1200C, 1}, -+ [ESS_MAC3_ARES] = {0x1200C, 2}, -+ [ESS_MAC4_ARES] = {0x1200C, 3}, -+ [ESS_MAC5_ARES] = {0x1200C, 4}, -+ [ESS_PSGMII_ARES] = {0x1200C, 5}, -+ [ESS_MAC1_CLK_DIS] = {0x1200C, 8}, -+ [ESS_MAC2_CLK_DIS] = {0x1200C, 9}, -+ [ESS_MAC3_CLK_DIS] = {0x1200C, 10}, -+ [ESS_MAC4_CLK_DIS] = {0x1200C, 11}, -+ [ESS_MAC5_CLK_DIS] = {0x1200C, 12}, - }; - - static const struct regmap_config gcc_ipq4019_regmap_config = { ---- a/include/dt-bindings/clock/qcom,gcc-ipq4019.h -+++ b/include/dt-bindings/clock/qcom,gcc-ipq4019.h -@@ -165,5 +165,16 @@ - #define GCC_QDSS_BCR 69 - #define GCC_MPM_BCR 70 - #define GCC_SPDM_BCR 71 -+#define ESS_MAC1_ARES 72 -+#define ESS_MAC2_ARES 73 -+#define ESS_MAC3_ARES 74 -+#define ESS_MAC4_ARES 75 -+#define ESS_MAC5_ARES 76 -+#define ESS_PSGMII_ARES 77 -+#define ESS_MAC1_CLK_DIS 78 -+#define ESS_MAC2_CLK_DIS 79 -+#define ESS_MAC3_CLK_DIS 80 -+#define ESS_MAC4_CLK_DIS 81 -+#define ESS_MAC5_CLK_DIS 82 - - #endif diff --git a/target/linux/ipq40xx/patches-5.15/700-skbuff-add-DSA-specific-data-to-struct-skb_shared_in.patch b/target/linux/ipq40xx/patches-5.15/700-skbuff-add-DSA-specific-data-to-struct-skb_shared_in.patch deleted file mode 100644 index 385364c076eaeb..00000000000000 --- a/target/linux/ipq40xx/patches-5.15/700-skbuff-add-DSA-specific-data-to-struct-skb_shared_in.patch +++ /dev/null @@ -1,43 +0,0 @@ -From da75807ac41175e9db8c95f7a172b4133763b744 Mon Sep 17 00:00:00 2001 -From: Gabor Juhos -Date: Mon, 11 Jan 2021 17:49:36 +0100 -Subject: [PATCH] skbuff: add DSA specific data to struct skb_shared_info - -All of the already existing DSA tagging protocol drivers -are storing the tagging data directly into the skb. In most -cases that is the only way to send the required information -to the underlying ethernet switch. - -However on certain platforms (like the Qualcomm IPQ40xx -SoCs) the built-in ethernet switch is connected directly -to an ethernet MAC, and the tagging information must be -sent out-of-band which is done directly via the hardware -TX descriptors of the ethernet MAC. - -In such cases, putting the information into the skb causes -unneccesary overhead, because the ethernet driver must -remove that before sending the ethernet frame towards to -the hardware. - -This change adds two new DSA specific fields to struct -skb_shared_info which makes it possible to send the -tagging information via skb->shinfo. With this approach, -the twofold modifications of the skb data can be avoided. - -Signed-off-by: Gabor Juhos ---- - include/linux/skbuff.h | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/include/linux/skbuff.h -+++ b/include/linux/skbuff.h -@@ -564,6 +564,9 @@ struct skb_shared_info { - unsigned int gso_type; - u32 tskey; - -+ unsigned int dsa_tag_proto; -+ unsigned char dsa_tag_data[8]; -+ - /* - * Warning : all fields before dataref are cleared in __alloc_skb() - */ diff --git a/target/linux/ipq40xx/patches-5.15/701-net-dsa-tag_ipq4019-add-shinfo-based-tagging-driver-.patch b/target/linux/ipq40xx/patches-5.15/701-net-dsa-tag_ipq4019-add-shinfo-based-tagging-driver-.patch deleted file mode 100644 index 74079d68a13d5e..00000000000000 --- a/target/linux/ipq40xx/patches-5.15/701-net-dsa-tag_ipq4019-add-shinfo-based-tagging-driver-.patch +++ /dev/null @@ -1,187 +0,0 @@ -From 29a0c2fae991cab142575c92276c0afdeb260ebe Mon Sep 17 00:00:00 2001 -From: Gabor Juhos -Date: Thu, 28 Oct 2021 21:44:52 +0200 -Subject: [PATCH] net: dsa: tag_ipq4019: add shinfo based tagging driver for - IPQ40xx - -This change adds a tagging protocol driver for the built-in -ethernet switch of the Qualcomm Atheros IPQ4019 SoCs. - -In comparison to the existing tagging protocols this hardware -requires a slightly different approach because the switch does -not use in-band tags. - -On the receive path, the source port information is embedded -into the RX descriptors of the ethernet MAC hardware. Similarly, -the destination port mask must be sent via the TX descriptors -of the ethernet MAC when a packet is sent towards the switch. - -In order to support this special requirements, this patch -adds a new tagging protocol driver. - -The driver extracts the source port information directly -from the 'receive return descriptor' of the ethernet MAC. -It is possible because that descriptor is part of the skb -received from the ethernet driver. - -Unfortunatley, it is not possible to put the destination -port information directly to the TX descriptors, because -those are handled internally by the driver of the ethernet -hardware. - -To overcome this limitation, this tagging driver uses the -DSA specific fields in skb->shinfo to send the destination -port information to the ethernet driver. - -A similar tagging driver is exist but that uses skb -extensions which causes unnecessary overhead. - -Signed-off-by: Gabor Juhos ---- - include/linux/dsa/ipq4019.h | 11 ++++++ - include/net/dsa.h | 2 + - net/dsa/Kconfig | 6 +++ - net/dsa/Makefile | 1 + - net/dsa/tag_ipq4019.c | 79 +++++++++++++++++++++++++++++++++++++ - 5 files changed, 99 insertions(+) - create mode 100644 include/linux/dsa/ipq4019.h - create mode 100644 net/dsa/tag_ipq4019.c - ---- /dev/null -+++ b/include/linux/dsa/ipq4019.h -@@ -0,0 +1,11 @@ -+/* SPDX-License-Identifier: GPL-2.0-only */ -+ -+#ifndef DSA_IPQ40XX_H -+#define DSA_IPQ40XX_H -+ -+struct ipq40xx_dsa_tag_data { -+ u8 from_cpu; -+ u8 dp; -+}; -+ -+#endif /* DSA_IPQ40XX_H */ ---- a/include/net/dsa.h -+++ b/include/net/dsa.h -@@ -51,6 +51,7 @@ struct phylink_link_state; - #define DSA_TAG_PROTO_SEVILLE_VALUE 21 - #define DSA_TAG_PROTO_BRCM_LEGACY_VALUE 22 - #define DSA_TAG_PROTO_SJA1110_VALUE 23 -+#define DSA_TAG_PROTO_IPQ4019_VALUE 24 - - enum dsa_tag_protocol { - DSA_TAG_PROTO_NONE = DSA_TAG_PROTO_NONE_VALUE, -@@ -77,6 +78,7 @@ enum dsa_tag_protocol { - DSA_TAG_PROTO_OCELOT_8021Q = DSA_TAG_PROTO_OCELOT_8021Q_VALUE, - DSA_TAG_PROTO_SEVILLE = DSA_TAG_PROTO_SEVILLE_VALUE, - DSA_TAG_PROTO_SJA1110 = DSA_TAG_PROTO_SJA1110_VALUE, -+ DSA_TAG_PROTO_IPQ4019 = DSA_TAG_PROTO_IPQ4019_VALUE, - }; - - struct dsa_switch; ---- a/net/dsa/Kconfig -+++ b/net/dsa/Kconfig -@@ -57,6 +57,12 @@ config NET_DSA_TAG_HELLCREEK - Say Y or M if you want to enable support for tagging frames - for the Hirschmann Hellcreek TSN switches. - -+config NET_DSA_TAG_IPQ4019 -+ tristate "Tag driver for Qualcomm Atheros IPQ4019 SoC built-in switch" -+ help -+ Say Y or M if you want to enable support for tagging frames for -+ the built-in switch of the Qualcomm Atheros IPQ4019 SoC-s. -+ - config NET_DSA_TAG_GSWIP - tristate "Tag driver for Lantiq / Intel GSWIP switches" - help ---- a/net/dsa/Makefile -+++ b/net/dsa/Makefile -@@ -8,6 +8,7 @@ obj-$(CONFIG_NET_DSA_TAG_AR9331) += tag_ - obj-$(CONFIG_NET_DSA_TAG_BRCM_COMMON) += tag_brcm.o - obj-$(CONFIG_NET_DSA_TAG_DSA_COMMON) += tag_dsa.o - obj-$(CONFIG_NET_DSA_TAG_GSWIP) += tag_gswip.o -+obj-$(CONFIG_NET_DSA_TAG_IPQ4019) += tag_ipq4019.o - obj-$(CONFIG_NET_DSA_TAG_HELLCREEK) += tag_hellcreek.o - obj-$(CONFIG_NET_DSA_TAG_KSZ) += tag_ksz.o - obj-$(CONFIG_NET_DSA_TAG_RTL4_A) += tag_rtl4_a.o ---- /dev/null -+++ b/net/dsa/tag_ipq4019.c -@@ -0,0 +1,78 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+ -+/* Copyright (c) 2021, Gabor Juhos */ -+ -+#include -+#include -+ -+#include "dsa_priv.h" -+ -+/* Receive Return Descriptor */ -+struct edma_rrd { -+ u16 rrd0; -+ u16 rrd1; -+ u16 rrd2; -+ u16 rrd3; -+ u16 rrd4; -+ u16 rrd5; -+ u16 rrd6; -+ u16 rrd7; -+} __packed; -+ -+#define EDMA_RRD_SIZE sizeof(struct edma_rrd) -+ -+#define EDMA_RRD1_PORT_ID_MASK GENMASK(14, 12) -+ -+static struct sk_buff *ipq4019_sh_tag_xmit(struct sk_buff *skb, -+ struct net_device *dev) -+{ -+ struct dsa_port *dp = dsa_slave_to_port(dev); -+ struct ipq40xx_dsa_tag_data *tag_data; -+ -+ BUILD_BUG_ON(sizeof_field(struct skb_shared_info, dsa_tag_data) < -+ sizeof(struct ipq40xx_dsa_tag_data)); -+ -+ skb_shinfo(skb)->dsa_tag_proto = DSA_TAG_PROTO_IPQ4019; -+ tag_data = (struct ipq40xx_dsa_tag_data *)skb_shinfo(skb)->dsa_tag_data; -+ -+ tag_data->from_cpu = 1; -+ /* set the destination port information */ -+ tag_data->dp = BIT(dp->index); -+ -+ return skb; -+} -+ -+static struct sk_buff *ipq4019_sh_tag_rcv(struct sk_buff *skb, -+ struct net_device *dev) -+{ -+ struct edma_rrd *rrd; -+ int offset; -+ int port; -+ -+ offset = EDMA_RRD_SIZE + ETH_HLEN; -+ if (unlikely(skb_headroom(skb) < offset)) -+ return NULL; -+ -+ rrd = (struct edma_rrd *)(skb->data - offset); -+ port = FIELD_GET(EDMA_RRD1_PORT_ID_MASK, rrd->rrd1); -+ -+ skb->dev = dsa_master_find_slave(dev, 0, port); -+ if (!skb->dev) -+ return NULL; -+ -+ return skb; -+} -+ -+const struct dsa_device_ops ipq4019_sh_tag_dsa_ops = { -+ .name = "ipq4019-sh", -+ .proto = DSA_TAG_PROTO_IPQ4019, -+ .xmit = ipq4019_sh_tag_xmit, -+ .rcv = ipq4019_sh_tag_rcv, -+}; -+ -+MODULE_LICENSE("GPL v2"); -+MODULE_DESCRIPTION("DSA tag driver for the IPQ4019 SoC built-in ethernet switch"); -+MODULE_AUTHOR("Gabor Juhos "); -+MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_IPQ4019); -+ -+module_dsa_tag_driver(ipq4019_sh_tag_dsa_ops); diff --git a/target/linux/ipq40xx/patches-5.15/702-net-ethernet-qualcomm-add-IPQESS-support.patch b/target/linux/ipq40xx/patches-5.15/702-net-ethernet-qualcomm-add-IPQESS-support.patch deleted file mode 100644 index 72e9345118e859..00000000000000 --- a/target/linux/ipq40xx/patches-5.15/702-net-ethernet-qualcomm-add-IPQESS-support.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 4f488235f498db43f2412116dea6e02c7fb20216 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Mon, 1 Nov 2021 12:36:51 +0100 -Subject: [PATCH] net: ethernet: qualcomm: add IPQESS support - -Allow compiling the IPQESS driver that supports the -Qualcomm IPQ40xx SoC built-in ethernet controller. - -Signed-off-by: Robert Marko ---- - drivers/net/ethernet/qualcomm/Kconfig | 11 +++++++++++ - drivers/net/ethernet/qualcomm/Makefile | 1 + - 2 files changed, 12 insertions(+) - ---- a/drivers/net/ethernet/qualcomm/Kconfig -+++ b/drivers/net/ethernet/qualcomm/Kconfig -@@ -60,6 +60,17 @@ config QCOM_EMAC - low power, Receive-Side Scaling (RSS), and IEEE 1588-2008 - Precision Clock Synchronization Protocol. - -+config QCOM_IPQ4019_ESS_EDMA -+ tristate "Qualcomm Atheros IPQ4019 ESS EDMA support" -+ depends on OF -+ select PHYLINK -+ help -+ This driver supports the Qualcomm Atheros IPQ40xx built-in -+ ESS EDMA ethernet controller. -+ -+ To compile this driver as a module, choose M here: the -+ module will be called ipqess. -+ - source "drivers/net/ethernet/qualcomm/rmnet/Kconfig" - - endif # NET_VENDOR_QUALCOMM ---- a/drivers/net/ethernet/qualcomm/Makefile -+++ b/drivers/net/ethernet/qualcomm/Makefile -@@ -10,5 +10,6 @@ obj-$(CONFIG_QCA7000_UART) += qcauart.o - qcauart-objs := qca_uart.o - - obj-y += emac/ -+obj-y += ipqess/ - - obj-$(CONFIG_RMNET) += rmnet/ diff --git a/target/linux/ipq40xx/patches-5.15/704-net-phy-define-PSGMII-PHY-interface-mode.patch b/target/linux/ipq40xx/patches-5.15/704-net-phy-define-PSGMII-PHY-interface-mode.patch deleted file mode 100644 index ed5b7b60fb9add..00000000000000 --- a/target/linux/ipq40xx/patches-5.15/704-net-phy-define-PSGMII-PHY-interface-mode.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 157ac9f52fd9b9a22cf12f7755a905fb34ef72f7 Mon Sep 17 00:00:00 2001 -From: Gabor Juhos -Date: Fri, 25 Dec 2020 08:02:47 +0100 -Subject: [PATCH] net: phy: define PSGMII PHY interface mode - -The PSGMII interface is similar to QSGMII. The main difference -is that the PSGMII interface combines five SGMII lines into a -single link while in QSGMII only four lines are combined. - -Similarly to the QSGMII, this interface mode might also needs -special handling within the MAC driver. - -Add definitions for the PHY layer to allow to express this type -of connection between the MAC and PHY. - -Signed-off-by: Gabor Juhos ---- - Documentation/devicetree/bindings/net/ethernet-controller.yaml | 1 + - drivers/net/phy/phylink.c | 2 ++ - include/linux/phy.h | 3 +++ - 3 files changed, 6 insertions(+) - ---- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml -+++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml -@@ -64,6 +64,7 @@ properties: - - mii - - gmii - - sgmii -+ - psgmii - - qsgmii - - tbi - - rev-mii ---- a/drivers/net/phy/phylink.c -+++ b/drivers/net/phy/phylink.c -@@ -371,6 +371,7 @@ void phylink_get_linkmodes(unsigned long - case PHY_INTERFACE_MODE_RGMII_RXID: - case PHY_INTERFACE_MODE_RGMII_ID: - case PHY_INTERFACE_MODE_RGMII: -+ case PHY_INTERFACE_MODE_PSGMII: - case PHY_INTERFACE_MODE_QSGMII: - case PHY_INTERFACE_MODE_SGMII: - case PHY_INTERFACE_MODE_GMII: -@@ -634,6 +635,7 @@ static int phylink_parse_mode(struct phy - - switch (pl->link_config.interface) { - case PHY_INTERFACE_MODE_SGMII: -+ case PHY_INTERFACE_MODE_PSGMII: - case PHY_INTERFACE_MODE_QSGMII: - phylink_set(pl->supported, 10baseT_Half); - phylink_set(pl->supported, 10baseT_Full); ---- a/include/linux/phy.h -+++ b/include/linux/phy.h -@@ -139,6 +139,7 @@ typedef enum { - PHY_INTERFACE_MODE_XGMII, - PHY_INTERFACE_MODE_XLGMII, - PHY_INTERFACE_MODE_MOCA, -+ PHY_INTERFACE_MODE_PSGMII, - PHY_INTERFACE_MODE_QSGMII, - PHY_INTERFACE_MODE_TRGMII, - PHY_INTERFACE_MODE_100BASEX, -@@ -244,6 +245,8 @@ static inline const char *phy_modes(phy_ - return "xlgmii"; - case PHY_INTERFACE_MODE_MOCA: - return "moca"; -+ case PHY_INTERFACE_MODE_PSGMII: -+ return "psgmii"; - case PHY_INTERFACE_MODE_QSGMII: - return "qsgmii"; - case PHY_INTERFACE_MODE_TRGMII: diff --git a/target/linux/ipq40xx/patches-5.15/705-net-dsa-add-Qualcomm-IPQ4019-built-in-switch-support.patch b/target/linux/ipq40xx/patches-5.15/705-net-dsa-add-Qualcomm-IPQ4019-built-in-switch-support.patch deleted file mode 100644 index 13b169e576c479..00000000000000 --- a/target/linux/ipq40xx/patches-5.15/705-net-dsa-add-Qualcomm-IPQ4019-built-in-switch-support.patch +++ /dev/null @@ -1,57 +0,0 @@ -From b5f71652b85a85ea53162e9e2b760b84fd0d254f Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Mon, 1 Nov 2021 18:10:28 +0100 -Subject: [PATCH] net: dsa: add Qualcomm IPQ4019 built-in switch support - -Qualcomm IPQ40xx SoC-s have a variant of QCA8337N switch built-in. - -It shares most of the stuff with its external counterpart, however it is -modified for the SoC. -Namely, it doesn't have second CPU port (Port 6), so it has 6 ports -instead of 7. -It also has no built-in PHY-s but rather requires external PSGMII based -companion PHY-s (QCA8072 and QCA8075) for which it first needs to carry -out calibration before using them. -PSGMII has a SoC built-in PHY that is used to connect to the PHY-s which -unfortunately requires some magic values as the datasheet doesnt document -the bits that are being set or the register at all. - -Since its built-in it is MMIO like other peripherals and doesn't have its -own MDIO bus but depends on the SoC provided one. - -CPU connection is at Port 0 and it uses some kind of a internal connection -and no traditional RGMII/SGMII. -It also doesn't use in-band tagging like other qca8k switches so a shinfo -based tagger is used. - -Signed-off-by: Robert Marko ---- - drivers/net/dsa/qca/Kconfig | 9 +++++++++ - drivers/net/dsa/qca/Makefile | 1 + - 2 files changed, 10 insertions(+) - ---- a/drivers/net/dsa/qca/Kconfig -+++ b/drivers/net/dsa/qca/Kconfig -@@ -23,3 +23,13 @@ config NET_DSA_QCA8K_LEDS_SUPPORT - help - This enabled support for LEDs present on the Qualcomm Atheros - QCA8K Ethernet switch chips. -+ -+config NET_DSA_QCA8K_IPQ4019 -+ tristate "Qualcomm Atheros IPQ4019 built-in Ethernet switch support" -+ depends on HAS_IOMEM && NET_DSA -+ select NET_DSA_TAG_IPQ4019 -+ select REGMAP -+ help -+ This enables support for the Qualcomm Atheros IPQ4019 SoC built-in -+ Ethernet switch. -+ ---- a/drivers/net/dsa/qca/Makefile -+++ b/drivers/net/dsa/qca/Makefile -@@ -1,5 +1,6 @@ - # SPDX-License-Identifier: GPL-2.0-only - obj-$(CONFIG_NET_DSA_AR9331) += ar9331.o -+obj-$(CONFIG_NET_DSA_QCA8K_IPQ4019) += qca8k-ipq4019.o - obj-$(CONFIG_NET_DSA_QCA8K) += qca8k.o - qca8k-y += qca8k-common.o qca8k-8xxx.o - ifdef CONFIG_NET_DSA_QCA8K_LEDS_SUPPORT diff --git a/target/linux/ipq40xx/patches-6.1/001-v6.6-dt-bindings-clock-qcom-ipq4019-add-missing-networkin.patch b/target/linux/ipq40xx/patches-6.1/001-v6.6-dt-bindings-clock-qcom-ipq4019-add-missing-networkin.patch new file mode 100644 index 00000000000000..87feaf79f8214a --- /dev/null +++ b/target/linux/ipq40xx/patches-6.1/001-v6.6-dt-bindings-clock-qcom-ipq4019-add-missing-networkin.patch @@ -0,0 +1,30 @@ +From be59072c6eeb7535bf9a339fb9d5a8bfae17ac22 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Mon, 14 Aug 2023 12:40:23 +0200 +Subject: [PATCH] dt-bindings: clock: qcom: ipq4019: add missing networking + resets + +Add bindings for the missing networking resets found in IPQ4019 GCC. + +Signed-off-by: Robert Marko +Acked-by: Krzysztof Kozlowski +Link: https://lore.kernel.org/r/20230814104119.96858-1-robert.marko@sartura.hr +Signed-off-by: Bjorn Andersson +--- + include/dt-bindings/clock/qcom,gcc-ipq4019.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/include/dt-bindings/clock/qcom,gcc-ipq4019.h ++++ b/include/dt-bindings/clock/qcom,gcc-ipq4019.h +@@ -165,5 +165,11 @@ + #define GCC_QDSS_BCR 69 + #define GCC_MPM_BCR 70 + #define GCC_SPDM_BCR 71 ++#define ESS_MAC1_ARES 72 ++#define ESS_MAC2_ARES 73 ++#define ESS_MAC3_ARES 74 ++#define ESS_MAC4_ARES 75 ++#define ESS_MAC5_ARES 76 ++#define ESS_PSGMII_ARES 77 + + #endif diff --git a/target/linux/ipq40xx/patches-6.1/002-v6.6-clk-qcom-gcc-ipq4019-add-missing-networking-resets.patch b/target/linux/ipq40xx/patches-6.1/002-v6.6-clk-qcom-gcc-ipq4019-add-missing-networking-resets.patch new file mode 100644 index 00000000000000..70b278c80353b8 --- /dev/null +++ b/target/linux/ipq40xx/patches-6.1/002-v6.6-clk-qcom-gcc-ipq4019-add-missing-networking-resets.patch @@ -0,0 +1,30 @@ +From 20014461691efc9e274c3870357152db7f091820 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Mon, 14 Aug 2023 12:40:24 +0200 +Subject: [PATCH] clk: qcom: gcc-ipq4019: add missing networking resets + +IPQ4019 has more networking related resets that will be required for future +wired networking support, so lets add them. + +Signed-off-by: Robert Marko +Link: https://lore.kernel.org/r/20230814104119.96858-2-robert.marko@sartura.hr +Signed-off-by: Bjorn Andersson +--- + drivers/clk/qcom/gcc-ipq4019.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/clk/qcom/gcc-ipq4019.c ++++ b/drivers/clk/qcom/gcc-ipq4019.c +@@ -1707,6 +1707,12 @@ static const struct qcom_reset_map gcc_i + [GCC_TCSR_BCR] = {0x22000, 0}, + [GCC_MPM_BCR] = {0x24000, 0}, + [GCC_SPDM_BCR] = {0x25000, 0}, ++ [ESS_MAC1_ARES] = {0x1200C, 0}, ++ [ESS_MAC2_ARES] = {0x1200C, 1}, ++ [ESS_MAC3_ARES] = {0x1200C, 2}, ++ [ESS_MAC4_ARES] = {0x1200C, 3}, ++ [ESS_MAC5_ARES] = {0x1200C, 4}, ++ [ESS_PSGMII_ARES] = {0x1200C, 5}, + }; + + static const struct regmap_config gcc_ipq4019_regmap_config = { diff --git a/target/linux/ipq40xx/patches-6.1/003-v6.6-net-phy-Introduce-PSGMII-PHY-interface-mode.patch b/target/linux/ipq40xx/patches-6.1/003-v6.6-net-phy-Introduce-PSGMII-PHY-interface-mode.patch new file mode 100644 index 00000000000000..a28394f629d0f6 --- /dev/null +++ b/target/linux/ipq40xx/patches-6.1/003-v6.6-net-phy-Introduce-PSGMII-PHY-interface-mode.patch @@ -0,0 +1,105 @@ +From 9a0e95e34e9c0a713ddfd48c3a88a20d2bdfd514 Mon Sep 17 00:00:00 2001 +From: Gabor Juhos +Date: Fri, 11 Aug 2023 13:10:07 +0200 +Subject: [PATCH] net: phy: Introduce PSGMII PHY interface mode + +The PSGMII interface is similar to QSGMII. The main difference +is that the PSGMII interface combines five SGMII lines into a +single link while in QSGMII only four lines are combined. + +Similarly to the QSGMII, this interface mode might also needs +special handling within the MAC driver. + +It is commonly used by Qualcomm with their QCA807x PHY series and +modern WiSoC-s. + +Add definitions for the PHY layer to allow to express this type +of connection between the MAC and PHY. + +Signed-off-by: Gabor Juhos +Signed-off-by: Robert Marko +Signed-off-by: David S. Miller +--- + Documentation/networking/phy.rst | 4 ++++ + drivers/net/phy/phy-core.c | 2 ++ + drivers/net/phy/phylink.c | 3 +++ + include/linux/phy.h | 4 ++++ + 4 files changed, 13 insertions(+) + +--- a/Documentation/networking/phy.rst ++++ b/Documentation/networking/phy.rst +@@ -323,6 +323,10 @@ Some of the interface modes are describe + contrast with the 1000BASE-X phy mode used for Clause 38 and 39 PMDs, this + interface mode has different autonegotiation and only supports full duplex. + ++``PHY_INTERFACE_MODE_PSGMII`` ++ This is the Penta SGMII mode, it is similar to QSGMII but it combines 5 ++ SGMII lines into a single link compared to 4 on QSGMII. ++ + Pause frames / flow control + =========================== + +--- a/drivers/net/phy/phy-core.c ++++ b/drivers/net/phy/phy-core.c +@@ -140,6 +140,8 @@ int phy_interface_num_ports(phy_interfac + case PHY_INTERFACE_MODE_QSGMII: + case PHY_INTERFACE_MODE_QUSGMII: + return 4; ++ case PHY_INTERFACE_MODE_PSGMII: ++ return 5; + case PHY_INTERFACE_MODE_MAX: + WARN_ONCE(1, "PHY_INTERFACE_MODE_MAX isn't a valid interface mode"); + return 0; +--- a/drivers/net/phy/phylink.c ++++ b/drivers/net/phy/phylink.c +@@ -192,6 +192,7 @@ static int phylink_interface_max_speed(p + case PHY_INTERFACE_MODE_RGMII_RXID: + case PHY_INTERFACE_MODE_RGMII_ID: + case PHY_INTERFACE_MODE_RGMII: ++ case PHY_INTERFACE_MODE_PSGMII: + case PHY_INTERFACE_MODE_QSGMII: + case PHY_INTERFACE_MODE_QUSGMII: + case PHY_INTERFACE_MODE_SGMII: +@@ -453,6 +454,7 @@ unsigned long phylink_get_capabilities(p + case PHY_INTERFACE_MODE_RGMII_RXID: + case PHY_INTERFACE_MODE_RGMII_ID: + case PHY_INTERFACE_MODE_RGMII: ++ case PHY_INTERFACE_MODE_PSGMII: + case PHY_INTERFACE_MODE_QSGMII: + case PHY_INTERFACE_MODE_QUSGMII: + case PHY_INTERFACE_MODE_SGMII: +@@ -819,6 +821,7 @@ static int phylink_parse_mode(struct phy + + switch (pl->link_config.interface) { + case PHY_INTERFACE_MODE_SGMII: ++ case PHY_INTERFACE_MODE_PSGMII: + case PHY_INTERFACE_MODE_QSGMII: + case PHY_INTERFACE_MODE_QUSGMII: + case PHY_INTERFACE_MODE_RGMII: +--- a/include/linux/phy.h ++++ b/include/linux/phy.h +@@ -104,6 +104,7 @@ extern const int phy_10gbit_features_arr + * @PHY_INTERFACE_MODE_XGMII: 10 gigabit media-independent interface + * @PHY_INTERFACE_MODE_XLGMII:40 gigabit media-independent interface + * @PHY_INTERFACE_MODE_MOCA: Multimedia over Coax ++ * @PHY_INTERFACE_MODE_PSGMII: Penta SGMII + * @PHY_INTERFACE_MODE_QSGMII: Quad SGMII + * @PHY_INTERFACE_MODE_TRGMII: Turbo RGMII + * @PHY_INTERFACE_MODE_100BASEX: 100 BaseX +@@ -141,6 +142,7 @@ typedef enum { + PHY_INTERFACE_MODE_XGMII, + PHY_INTERFACE_MODE_XLGMII, + PHY_INTERFACE_MODE_MOCA, ++ PHY_INTERFACE_MODE_PSGMII, + PHY_INTERFACE_MODE_QSGMII, + PHY_INTERFACE_MODE_TRGMII, + PHY_INTERFACE_MODE_100BASEX, +@@ -248,6 +250,8 @@ static inline const char *phy_modes(phy_ + return "xlgmii"; + case PHY_INTERFACE_MODE_MOCA: + return "moca"; ++ case PHY_INTERFACE_MODE_PSGMII: ++ return "psgmii"; + case PHY_INTERFACE_MODE_QSGMII: + return "qsgmii"; + case PHY_INTERFACE_MODE_TRGMII: diff --git a/target/linux/ipq40xx/patches-5.15/104-clk-fix-apss-cpu-overclocking.patch b/target/linux/ipq40xx/patches-6.1/104-clk-fix-apss-cpu-overclocking.patch similarity index 100% rename from target/linux/ipq40xx/patches-5.15/104-clk-fix-apss-cpu-overclocking.patch rename to target/linux/ipq40xx/patches-6.1/104-clk-fix-apss-cpu-overclocking.patch diff --git a/target/linux/ipq40xx/patches-5.15/301-arm-compressed-add-appended-DTB-section.patch b/target/linux/ipq40xx/patches-6.1/301-arm-compressed-add-appended-DTB-section.patch similarity index 100% rename from target/linux/ipq40xx/patches-5.15/301-arm-compressed-add-appended-DTB-section.patch rename to target/linux/ipq40xx/patches-6.1/301-arm-compressed-add-appended-DTB-section.patch diff --git a/target/linux/ipq40xx/patches-5.15/302-arm-compressed-set-ipq40xx-watchdog-to-allow-boot.patch b/target/linux/ipq40xx/patches-6.1/302-arm-compressed-set-ipq40xx-watchdog-to-allow-boot.patch similarity index 98% rename from target/linux/ipq40xx/patches-5.15/302-arm-compressed-set-ipq40xx-watchdog-to-allow-boot.patch rename to target/linux/ipq40xx/patches-6.1/302-arm-compressed-set-ipq40xx-watchdog-to-allow-boot.patch index 51891c1f22794f..4939c564700700 100644 --- a/target/linux/ipq40xx/patches-5.15/302-arm-compressed-set-ipq40xx-watchdog-to-allow-boot.patch +++ b/target/linux/ipq40xx/patches-6.1/302-arm-compressed-set-ipq40xx-watchdog-to-allow-boot.patch @@ -22,7 +22,7 @@ Signed-off-by: John Thomson --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S -@@ -624,6 +624,41 @@ not_relocated: mov r0, #0 +@@ -620,6 +620,41 @@ not_relocated: mov r0, #0 bic r4, r4, #1 blne cache_on diff --git a/target/linux/ipq40xx/patches-5.15/400-mmc-sdhci-sdhci-msm-use-sdhci_set_clock-instead-of-s.patch b/target/linux/ipq40xx/patches-6.1/400-mmc-sdhci-sdhci-msm-use-sdhci_set_clock-instead-of-s.patch similarity index 92% rename from target/linux/ipq40xx/patches-5.15/400-mmc-sdhci-sdhci-msm-use-sdhci_set_clock-instead-of-s.patch rename to target/linux/ipq40xx/patches-6.1/400-mmc-sdhci-sdhci-msm-use-sdhci_set_clock-instead-of-s.patch index 3a3be91709eb97..bf36164aedecf6 100644 --- a/target/linux/ipq40xx/patches-5.15/400-mmc-sdhci-sdhci-msm-use-sdhci_set_clock-instead-of-s.patch +++ b/target/linux/ipq40xx/patches-6.1/400-mmc-sdhci-sdhci-msm-use-sdhci_set_clock-instead-of-s.patch @@ -13,7 +13,7 @@ Signed-off-by: Robert Marko --- a/drivers/mmc/host/sdhci-msm.c +++ b/drivers/mmc/host/sdhci-msm.c -@@ -2447,7 +2447,7 @@ MODULE_DEVICE_TABLE(of, sdhci_msm_dt_mat +@@ -2451,7 +2451,7 @@ MODULE_DEVICE_TABLE(of, sdhci_msm_dt_mat static const struct sdhci_ops sdhci_msm_ops = { .reset = sdhci_msm_reset, diff --git a/target/linux/ipq40xx/patches-5.15/401-mmc-sdhci-msm-comment-unused-sdhci_msm_set_clock.patch b/target/linux/ipq40xx/patches-6.1/401-mmc-sdhci-msm-comment-unused-sdhci_msm_set_clock.patch similarity index 100% rename from target/linux/ipq40xx/patches-5.15/401-mmc-sdhci-msm-comment-unused-sdhci_msm_set_clock.patch rename to target/linux/ipq40xx/patches-6.1/401-mmc-sdhci-msm-comment-unused-sdhci_msm_set_clock.patch diff --git a/target/linux/ipq40xx/patches-5.15/420-firmware-qcom-scm-Add-SDI-disable-support.patch b/target/linux/ipq40xx/patches-6.1/420-firmware-qcom-scm-Add-SDI-disable-support.patch similarity index 94% rename from target/linux/ipq40xx/patches-5.15/420-firmware-qcom-scm-Add-SDI-disable-support.patch rename to target/linux/ipq40xx/patches-6.1/420-firmware-qcom-scm-Add-SDI-disable-support.patch index e4ee745ff1cc46..732f3c50fb6144 100644 --- a/target/linux/ipq40xx/patches-5.15/420-firmware-qcom-scm-Add-SDI-disable-support.patch +++ b/target/linux/ipq40xx/patches-6.1/420-firmware-qcom-scm-Add-SDI-disable-support.patch @@ -18,7 +18,7 @@ Acked-by: Mukesh Ojha --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c -@@ -389,6 +389,29 @@ int qcom_scm_set_remote_state(u32 state, +@@ -400,6 +400,29 @@ int qcom_scm_set_remote_state(u32 state, } EXPORT_SYMBOL(qcom_scm_set_remote_state); @@ -56,5 +56,5 @@ Acked-by: Mukesh Ojha #define QCOM_SCM_BOOT_TERMINATE_PC 0x02 +#define QCOM_SCM_BOOT_SDI_CONFIG 0x09 #define QCOM_SCM_BOOT_SET_DLOAD_MODE 0x10 + #define QCOM_SCM_BOOT_SET_ADDR_MC 0x11 #define QCOM_SCM_BOOT_SET_REMOTE_STATE 0x0a - #define QCOM_SCM_FLUSH_FLAG_MASK 0x3 diff --git a/target/linux/ipq40xx/patches-5.15/421-firmware-qcom-scm-disable-SDI-on-Google-WiFi.patch b/target/linux/ipq40xx/patches-6.1/421-firmware-qcom-scm-disable-SDI-on-Google-WiFi.patch similarity index 94% rename from target/linux/ipq40xx/patches-5.15/421-firmware-qcom-scm-disable-SDI-on-Google-WiFi.patch rename to target/linux/ipq40xx/patches-6.1/421-firmware-qcom-scm-disable-SDI-on-Google-WiFi.patch index 98f02934a96619..ff788c5c566098 100644 --- a/target/linux/ipq40xx/patches-5.15/421-firmware-qcom-scm-disable-SDI-on-Google-WiFi.patch +++ b/target/linux/ipq40xx/patches-6.1/421-firmware-qcom-scm-disable-SDI-on-Google-WiFi.patch @@ -18,7 +18,7 @@ Signed-off-by: Brian Norris --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c -@@ -1337,6 +1337,13 @@ static int qcom_scm_probe(struct platfor +@@ -1435,6 +1435,13 @@ static int qcom_scm_probe(struct platfor if (download_mode) qcom_scm_set_download_mode(true); diff --git a/target/linux/ipq40xx/patches-5.15/422-firmware-qcom-scm-fix-SCM-cold-boot-address.patch b/target/linux/ipq40xx/patches-6.1/422-firmware-qcom-scm-fix-SCM-cold-boot-address.patch similarity index 93% rename from target/linux/ipq40xx/patches-5.15/422-firmware-qcom-scm-fix-SCM-cold-boot-address.patch rename to target/linux/ipq40xx/patches-6.1/422-firmware-qcom-scm-fix-SCM-cold-boot-address.patch index a31ea69e897fe6..a92342215e6719 100644 --- a/target/linux/ipq40xx/patches-5.15/422-firmware-qcom-scm-fix-SCM-cold-boot-address.patch +++ b/target/linux/ipq40xx/patches-6.1/422-firmware-qcom-scm-fix-SCM-cold-boot-address.patch @@ -53,7 +53,7 @@ Signed-off-by: Brian Norris /** * scm_legacy_call() - Sends a command to the SCM and waits for the command to * finish processing. -@@ -160,10 +182,16 @@ int scm_legacy_call(struct device *dev, +@@ -163,10 +185,16 @@ int scm_legacy_call(struct device *dev, rsp = scm_legacy_command_to_response(cmd); @@ -74,7 +74,7 @@ Signed-off-by: Brian Norris } smc.args[0] = 1; -@@ -179,13 +207,26 @@ int scm_legacy_call(struct device *dev, +@@ -182,13 +210,26 @@ int scm_legacy_call(struct device *dev, goto out; do { @@ -106,7 +106,7 @@ Signed-off-by: Brian Norris if (res) { res_buf = scm_legacy_get_response_buffer(rsp); -@@ -193,7 +234,8 @@ int scm_legacy_call(struct device *dev, +@@ -196,7 +237,8 @@ int scm_legacy_call(struct device *dev, res->result[i] = le32_to_cpu(res_buf[i]); } out: @@ -118,7 +118,7 @@ Signed-off-by: Brian Norris } --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c -@@ -344,6 +344,17 @@ int qcom_scm_set_cold_boot_addr(void *en +@@ -305,6 +305,17 @@ static int qcom_scm_set_boot_addr(void * desc.args[0] = flags; desc.args[1] = virt_to_phys(entry); @@ -135,4 +135,4 @@ Signed-off-by: Brian Norris + return qcom_scm_call_atomic(__scm ? __scm->dev : NULL, &desc, NULL); } - EXPORT_SYMBOL(qcom_scm_set_cold_boot_addr); + diff --git a/target/linux/ipq40xx/patches-5.15/444-mtd-nand-rawnand-add-support-for-Toshiba-TC58NVG0S3H.patch b/target/linux/ipq40xx/patches-6.1/444-mtd-nand-rawnand-add-support-for-Toshiba-TC58NVG0S3H.patch similarity index 100% rename from target/linux/ipq40xx/patches-5.15/444-mtd-nand-rawnand-add-support-for-Toshiba-TC58NVG0S3H.patch rename to target/linux/ipq40xx/patches-6.1/444-mtd-nand-rawnand-add-support-for-Toshiba-TC58NVG0S3H.patch diff --git a/target/linux/ipq40xx/patches-6.1/700-net-ipqess-introduce-the-Qualcomm-IPQESS-driver.patch b/target/linux/ipq40xx/patches-6.1/700-net-ipqess-introduce-the-Qualcomm-IPQESS-driver.patch new file mode 100644 index 00000000000000..254e85c2844cc2 --- /dev/null +++ b/target/linux/ipq40xx/patches-6.1/700-net-ipqess-introduce-the-Qualcomm-IPQESS-driver.patch @@ -0,0 +1,2025 @@ +From 76e25c1f46456416ba5358be8a0677f1ab8196b6 Mon Sep 17 00:00:00 2001 +From: Maxime Chevallier +Date: Fri, 4 Nov 2022 18:41:48 +0100 +Subject: [PATCH] net: ipqess: introduce the Qualcomm IPQESS driver + +The Qualcomm IPQESS controller is a simple 1G Ethernet controller found +on the IPQ4019 chip. This controller has some specificities, in that the +IPQ4019 platform that includes that controller also has an internal +switch, based on the QCA8K IP. + +It is connected to that switch through an internal link, and doesn't +expose directly any external interface, hence it only supports the +PHY_INTERFACE_MODE_INTERNAL for now. + +It has 16 RX and TX queues, with a very basic RSS fanout configured at +init time. + +Signed-off-by: Maxime Chevallier +--- + MAINTAINERS | 7 + + drivers/net/ethernet/qualcomm/Kconfig | 11 + + drivers/net/ethernet/qualcomm/Makefile | 2 + + drivers/net/ethernet/qualcomm/ipqess/Makefile | 8 + + drivers/net/ethernet/qualcomm/ipqess/ipqess.c | 1246 +++++++++++++++++ + drivers/net/ethernet/qualcomm/ipqess/ipqess.h | 518 +++++++ + .../ethernet/qualcomm/ipqess/ipqess_ethtool.c | 164 +++ + 7 files changed, 1956 insertions(+) + create mode 100644 drivers/net/ethernet/qualcomm/ipqess/Makefile + create mode 100644 drivers/net/ethernet/qualcomm/ipqess/ipqess.c + create mode 100644 drivers/net/ethernet/qualcomm/ipqess/ipqess.h + create mode 100644 drivers/net/ethernet/qualcomm/ipqess/ipqess_ethtool.c + +--- a/MAINTAINERS ++++ b/MAINTAINERS +@@ -17064,6 +17064,13 @@ L: netdev@vger.kernel.org + S: Maintained + F: drivers/net/ethernet/qualcomm/emac/ + ++QUALCOMM IPQESS ETHERNET DRIVER ++M: Maxime Chevallier ++L: netdev@vger.kernel.org ++S: Maintained ++F: Documentation/devicetree/bindings/net/qcom,ipq4019-ess-edma.yaml ++F: drivers/net/ethernet/qualcomm/ipqess/ ++ + QUALCOMM ETHQOS ETHERNET DRIVER + M: Vinod Koul + R: Bhupesh Sharma +--- a/drivers/net/ethernet/qualcomm/Kconfig ++++ b/drivers/net/ethernet/qualcomm/Kconfig +@@ -60,6 +60,17 @@ config QCOM_EMAC + low power, Receive-Side Scaling (RSS), and IEEE 1588-2008 + Precision Clock Synchronization Protocol. + ++config QCOM_IPQ4019_ESS_EDMA ++ tristate "Qualcomm Atheros IPQ4019 ESS EDMA support" ++ depends on (OF && ARCH_QCOM) || COMPILE_TEST ++ select PHYLINK ++ help ++ This driver supports the Qualcomm Atheros IPQ40xx built-in ++ ESS EDMA ethernet controller. ++ ++ To compile this driver as a module, choose M here: the ++ module will be called ipqess. ++ + source "drivers/net/ethernet/qualcomm/rmnet/Kconfig" + + endif # NET_VENDOR_QUALCOMM +--- a/drivers/net/ethernet/qualcomm/Makefile ++++ b/drivers/net/ethernet/qualcomm/Makefile +@@ -11,4 +11,6 @@ qcauart-objs := qca_uart.o + + obj-y += emac/ + ++obj-$(CONFIG_QCOM_IPQ4019_ESS_EDMA) += ipqess/ ++ + obj-$(CONFIG_RMNET) += rmnet/ +--- /dev/null ++++ b/drivers/net/ethernet/qualcomm/ipqess/Makefile +@@ -0,0 +1,8 @@ ++# SPDX-License-Identifier: GPL-2.0-only ++# ++# Makefile for the IPQ ESS driver ++# ++ ++obj-$(CONFIG_QCOM_IPQ4019_ESS_EDMA) += ipq_ess.o ++ ++ipq_ess-objs := ipqess.o ipqess_ethtool.o +--- /dev/null ++++ b/drivers/net/ethernet/qualcomm/ipqess/ipqess.c +@@ -0,0 +1,1246 @@ ++// SPDX-License-Identifier: GPL-2.0 OR ISC ++/* Copyright (c) 2014 - 2017, The Linux Foundation. All rights reserved. ++ * Copyright (c) 2017 - 2018, John Crispin ++ * Copyright (c) 2018 - 2019, Christian Lamparter ++ * Copyright (c) 2020 - 2021, Gabor Juhos ++ * Copyright (c) 2021 - 2022, Maxime Chevallier ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "ipqess.h" ++ ++#define IPQESS_RRD_SIZE 16 ++#define IPQESS_NEXT_IDX(X, Y) (((X) + 1) & ((Y) - 1)) ++#define IPQESS_TX_DMA_BUF_LEN 0x3fff ++ ++static void ipqess_w32(struct ipqess *ess, u32 reg, u32 val) ++{ ++ writel(val, ess->hw_addr + reg); ++} ++ ++static u32 ipqess_r32(struct ipqess *ess, u16 reg) ++{ ++ return readl(ess->hw_addr + reg); ++} ++ ++static void ipqess_m32(struct ipqess *ess, u32 mask, u32 val, u16 reg) ++{ ++ u32 _val = ipqess_r32(ess, reg); ++ ++ _val &= ~mask; ++ _val |= val; ++ ++ ipqess_w32(ess, reg, _val); ++} ++ ++void ipqess_update_hw_stats(struct ipqess *ess) ++{ ++ u32 *p; ++ u32 stat; ++ int i; ++ ++ lockdep_assert_held(&ess->stats_lock); ++ ++ p = (u32 *)&ess->ipqess_stats; ++ for (i = 0; i < IPQESS_MAX_TX_QUEUE; i++) { ++ stat = ipqess_r32(ess, IPQESS_REG_TX_STAT_PKT_Q(i)); ++ *p += stat; ++ p++; ++ } ++ ++ for (i = 0; i < IPQESS_MAX_TX_QUEUE; i++) { ++ stat = ipqess_r32(ess, IPQESS_REG_TX_STAT_BYTE_Q(i)); ++ *p += stat; ++ p++; ++ } ++ ++ for (i = 0; i < IPQESS_MAX_RX_QUEUE; i++) { ++ stat = ipqess_r32(ess, IPQESS_REG_RX_STAT_PKT_Q(i)); ++ *p += stat; ++ p++; ++ } ++ ++ for (i = 0; i < IPQESS_MAX_RX_QUEUE; i++) { ++ stat = ipqess_r32(ess, IPQESS_REG_RX_STAT_BYTE_Q(i)); ++ *p += stat; ++ p++; ++ } ++} ++ ++static int ipqess_tx_ring_alloc(struct ipqess *ess) ++{ ++ struct device *dev = &ess->pdev->dev; ++ int i; ++ ++ for (i = 0; i < IPQESS_NETDEV_QUEUES; i++) { ++ struct ipqess_tx_ring *tx_ring = &ess->tx_ring[i]; ++ size_t size; ++ u32 idx; ++ ++ tx_ring->ess = ess; ++ tx_ring->ring_id = i; ++ tx_ring->idx = i * 4; ++ tx_ring->count = IPQESS_TX_RING_SIZE; ++ tx_ring->nq = netdev_get_tx_queue(ess->netdev, i); ++ ++ size = sizeof(struct ipqess_buf) * IPQESS_TX_RING_SIZE; ++ tx_ring->buf = devm_kzalloc(dev, size, GFP_KERNEL); ++ if (!tx_ring->buf) ++ return -ENOMEM; ++ ++ size = sizeof(struct ipqess_tx_desc) * IPQESS_TX_RING_SIZE; ++ tx_ring->hw_desc = dmam_alloc_coherent(dev, size, &tx_ring->dma, ++ GFP_KERNEL); ++ if (!tx_ring->hw_desc) ++ return -ENOMEM; ++ ++ ipqess_w32(ess, IPQESS_REG_TPD_BASE_ADDR_Q(tx_ring->idx), ++ (u32)tx_ring->dma); ++ ++ idx = ipqess_r32(ess, IPQESS_REG_TPD_IDX_Q(tx_ring->idx)); ++ idx >>= IPQESS_TPD_CONS_IDX_SHIFT; /* need u32 here */ ++ idx &= 0xffff; ++ tx_ring->head = idx; ++ tx_ring->tail = idx; ++ ++ ipqess_m32(ess, IPQESS_TPD_PROD_IDX_MASK << IPQESS_TPD_PROD_IDX_SHIFT, ++ idx, IPQESS_REG_TPD_IDX_Q(tx_ring->idx)); ++ ipqess_w32(ess, IPQESS_REG_TX_SW_CONS_IDX_Q(tx_ring->idx), idx); ++ ipqess_w32(ess, IPQESS_REG_TPD_RING_SIZE, IPQESS_TX_RING_SIZE); ++ } ++ ++ return 0; ++} ++ ++static int ipqess_tx_unmap_and_free(struct device *dev, struct ipqess_buf *buf) ++{ ++ int len = 0; ++ ++ if (buf->flags & IPQESS_DESC_SINGLE) ++ dma_unmap_single(dev, buf->dma, buf->length, DMA_TO_DEVICE); ++ else if (buf->flags & IPQESS_DESC_PAGE) ++ dma_unmap_page(dev, buf->dma, buf->length, DMA_TO_DEVICE); ++ ++ if (buf->flags & IPQESS_DESC_LAST) { ++ len = buf->skb->len; ++ dev_kfree_skb_any(buf->skb); ++ } ++ ++ buf->flags = 0; ++ ++ return len; ++} ++ ++static void ipqess_tx_ring_free(struct ipqess *ess) ++{ ++ int i; ++ ++ for (i = 0; i < IPQESS_NETDEV_QUEUES; i++) { ++ int j; ++ ++ if (ess->tx_ring[i].hw_desc) ++ continue; ++ ++ for (j = 0; j < IPQESS_TX_RING_SIZE; j++) { ++ struct ipqess_buf *buf = &ess->tx_ring[i].buf[j]; ++ ++ ipqess_tx_unmap_and_free(&ess->pdev->dev, buf); ++ } ++ ++ ess->tx_ring[i].buf = NULL; ++ } ++} ++ ++static int ipqess_rx_buf_prepare(struct ipqess_buf *buf, ++ struct ipqess_rx_ring *rx_ring) ++{ ++ memset(buf->skb->data, 0, sizeof(struct ipqess_rx_desc)); ++ ++ buf->dma = dma_map_single(rx_ring->ppdev, buf->skb->data, ++ IPQESS_RX_HEAD_BUFF_SIZE, DMA_FROM_DEVICE); ++ if (dma_mapping_error(rx_ring->ppdev, buf->dma)) { ++ dev_kfree_skb_any(buf->skb); ++ buf->skb = NULL; ++ return -EFAULT; ++ } ++ ++ buf->length = IPQESS_RX_HEAD_BUFF_SIZE; ++ rx_ring->hw_desc[rx_ring->head] = (struct ipqess_rx_desc *)buf->dma; ++ rx_ring->head = (rx_ring->head + 1) % IPQESS_RX_RING_SIZE; ++ ++ ipqess_m32(rx_ring->ess, IPQESS_RFD_PROD_IDX_BITS, ++ (rx_ring->head + IPQESS_RX_RING_SIZE - 1) % IPQESS_RX_RING_SIZE, ++ IPQESS_REG_RFD_IDX_Q(rx_ring->idx)); ++ ++ return 0; ++} ++ ++/* locking is handled by the caller */ ++static int ipqess_rx_buf_alloc_napi(struct ipqess_rx_ring *rx_ring) ++{ ++ struct ipqess_buf *buf = &rx_ring->buf[rx_ring->head]; ++ ++ buf->skb = napi_alloc_skb(&rx_ring->napi_rx, IPQESS_RX_HEAD_BUFF_SIZE); ++ if (!buf->skb) ++ return -ENOMEM; ++ ++ return ipqess_rx_buf_prepare(buf, rx_ring); ++} ++ ++static int ipqess_rx_buf_alloc(struct ipqess_rx_ring *rx_ring) ++{ ++ struct ipqess_buf *buf = &rx_ring->buf[rx_ring->head]; ++ ++ buf->skb = netdev_alloc_skb_ip_align(rx_ring->ess->netdev, ++ IPQESS_RX_HEAD_BUFF_SIZE); ++ ++ if (!buf->skb) ++ return -ENOMEM; ++ ++ return ipqess_rx_buf_prepare(buf, rx_ring); ++} ++ ++static void ipqess_refill_work(struct work_struct *work) ++{ ++ struct ipqess_rx_ring_refill *rx_refill = container_of(work, ++ struct ipqess_rx_ring_refill, refill_work); ++ struct ipqess_rx_ring *rx_ring = rx_refill->rx_ring; ++ int refill = 0; ++ ++ /* don't let this loop by accident. */ ++ while (atomic_dec_and_test(&rx_ring->refill_count)) { ++ napi_disable(&rx_ring->napi_rx); ++ if (ipqess_rx_buf_alloc(rx_ring)) { ++ refill++; ++ dev_dbg(rx_ring->ppdev, ++ "Not all buffers were reallocated"); ++ } ++ napi_enable(&rx_ring->napi_rx); ++ } ++ ++ if (atomic_add_return(refill, &rx_ring->refill_count)) ++ schedule_work(&rx_refill->refill_work); ++} ++ ++static int ipqess_rx_ring_alloc(struct ipqess *ess) ++{ ++ int i; ++ ++ for (i = 0; i < IPQESS_NETDEV_QUEUES; i++) { ++ int j; ++ ++ ess->rx_ring[i].ess = ess; ++ ess->rx_ring[i].ppdev = &ess->pdev->dev; ++ ess->rx_ring[i].ring_id = i; ++ ess->rx_ring[i].idx = i * 2; ++ ++ ess->rx_ring[i].buf = devm_kzalloc(&ess->pdev->dev, ++ sizeof(struct ipqess_buf) * IPQESS_RX_RING_SIZE, ++ GFP_KERNEL); ++ ++ if (!ess->rx_ring[i].buf) ++ return -ENOMEM; ++ ++ ess->rx_ring[i].hw_desc = ++ dmam_alloc_coherent(&ess->pdev->dev, ++ sizeof(struct ipqess_rx_desc) * IPQESS_RX_RING_SIZE, ++ &ess->rx_ring[i].dma, GFP_KERNEL); ++ ++ if (!ess->rx_ring[i].hw_desc) ++ return -ENOMEM; ++ ++ for (j = 0; j < IPQESS_RX_RING_SIZE; j++) ++ if (ipqess_rx_buf_alloc(&ess->rx_ring[i]) < 0) ++ return -ENOMEM; ++ ++ ess->rx_refill[i].rx_ring = &ess->rx_ring[i]; ++ INIT_WORK(&ess->rx_refill[i].refill_work, ipqess_refill_work); ++ ++ ipqess_w32(ess, IPQESS_REG_RFD_BASE_ADDR_Q(ess->rx_ring[i].idx), ++ (u32)(ess->rx_ring[i].dma)); ++ } ++ ++ ipqess_w32(ess, IPQESS_REG_RX_DESC0, ++ (IPQESS_RX_HEAD_BUFF_SIZE << IPQESS_RX_BUF_SIZE_SHIFT) | ++ (IPQESS_RX_RING_SIZE << IPQESS_RFD_RING_SIZE_SHIFT)); ++ ++ return 0; ++} ++ ++static void ipqess_rx_ring_free(struct ipqess *ess) ++{ ++ int i; ++ ++ for (i = 0; i < IPQESS_NETDEV_QUEUES; i++) { ++ int j; ++ ++ cancel_work_sync(&ess->rx_refill[i].refill_work); ++ atomic_set(&ess->rx_ring[i].refill_count, 0); ++ ++ for (j = 0; j < IPQESS_RX_RING_SIZE; j++) { ++ dma_unmap_single(&ess->pdev->dev, ++ ess->rx_ring[i].buf[j].dma, ++ ess->rx_ring[i].buf[j].length, ++ DMA_FROM_DEVICE); ++ dev_kfree_skb_any(ess->rx_ring[i].buf[j].skb); ++ } ++ } ++} ++ ++static struct net_device_stats *ipqess_get_stats(struct net_device *netdev) ++{ ++ struct ipqess *ess = netdev_priv(netdev); ++ ++ spin_lock(&ess->stats_lock); ++ ipqess_update_hw_stats(ess); ++ spin_unlock(&ess->stats_lock); ++ ++ return &ess->stats; ++} ++ ++static int ipqess_rx_poll(struct ipqess_rx_ring *rx_ring, int budget) ++{ ++ u32 length = 0, num_desc, tail, rx_ring_tail; ++ int done = 0; ++ ++ rx_ring_tail = rx_ring->tail; ++ ++ tail = ipqess_r32(rx_ring->ess, IPQESS_REG_RFD_IDX_Q(rx_ring->idx)); ++ tail >>= IPQESS_RFD_CONS_IDX_SHIFT; ++ tail &= IPQESS_RFD_CONS_IDX_MASK; ++ ++ while (done < budget) { ++ struct ipqess_rx_desc *rd; ++ struct sk_buff *skb; ++ ++ if (rx_ring_tail == tail) ++ break; ++ ++ dma_unmap_single(rx_ring->ppdev, ++ rx_ring->buf[rx_ring_tail].dma, ++ rx_ring->buf[rx_ring_tail].length, ++ DMA_FROM_DEVICE); ++ ++ skb = xchg(&rx_ring->buf[rx_ring_tail].skb, NULL); ++ rd = (struct ipqess_rx_desc *)skb->data; ++ rx_ring_tail = IPQESS_NEXT_IDX(rx_ring_tail, IPQESS_RX_RING_SIZE); ++ ++ /* Check if RRD is valid */ ++ if (!(rd->rrd7 & cpu_to_le16(IPQESS_RRD_DESC_VALID))) { ++ num_desc = 1; ++ dev_kfree_skb_any(skb); ++ goto skip; ++ } ++ ++ num_desc = le16_to_cpu(rd->rrd1) & IPQESS_RRD_NUM_RFD_MASK; ++ length = le16_to_cpu(rd->rrd6) & IPQESS_RRD_PKT_SIZE_MASK; ++ ++ skb_reserve(skb, IPQESS_RRD_SIZE); ++ if (num_desc > 1) { ++ struct sk_buff *skb_prev = NULL; ++ int size_remaining; ++ int i; ++ ++ skb->data_len = 0; ++ skb->tail += (IPQESS_RX_HEAD_BUFF_SIZE - IPQESS_RRD_SIZE); ++ skb->len = length; ++ skb->truesize = length; ++ size_remaining = length - (IPQESS_RX_HEAD_BUFF_SIZE - IPQESS_RRD_SIZE); ++ ++ for (i = 1; i < num_desc; i++) { ++ struct sk_buff *skb_temp = rx_ring->buf[rx_ring_tail].skb; ++ ++ dma_unmap_single(rx_ring->ppdev, ++ rx_ring->buf[rx_ring_tail].dma, ++ rx_ring->buf[rx_ring_tail].length, ++ DMA_FROM_DEVICE); ++ ++ skb_put(skb_temp, min(size_remaining, IPQESS_RX_HEAD_BUFF_SIZE)); ++ if (skb_prev) ++ skb_prev->next = rx_ring->buf[rx_ring_tail].skb; ++ else ++ skb_shinfo(skb)->frag_list = rx_ring->buf[rx_ring_tail].skb; ++ skb_prev = rx_ring->buf[rx_ring_tail].skb; ++ rx_ring->buf[rx_ring_tail].skb->next = NULL; ++ ++ skb->data_len += rx_ring->buf[rx_ring_tail].skb->len; ++ size_remaining -= rx_ring->buf[rx_ring_tail].skb->len; ++ ++ rx_ring_tail = IPQESS_NEXT_IDX(rx_ring_tail, IPQESS_RX_RING_SIZE); ++ } ++ ++ } else { ++ skb_put(skb, length); ++ } ++ ++ skb->dev = rx_ring->ess->netdev; ++ skb->protocol = eth_type_trans(skb, rx_ring->ess->netdev); ++ skb_record_rx_queue(skb, rx_ring->ring_id); ++ ++ if (rd->rrd6 & cpu_to_le16(IPQESS_RRD_CSUM_FAIL_MASK)) ++ skb_checksum_none_assert(skb); ++ else ++ skb->ip_summed = CHECKSUM_UNNECESSARY; ++ ++ if (rd->rrd7 & cpu_to_le16(IPQESS_RRD_CVLAN)) ++ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ++ le16_to_cpu(rd->rrd4)); ++ else if (rd->rrd1 & cpu_to_le16(IPQESS_RRD_SVLAN)) ++ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021AD), ++ le16_to_cpu(rd->rrd4)); ++ ++ napi_gro_receive(&rx_ring->napi_rx, skb); ++ ++ rx_ring->ess->stats.rx_packets++; ++ rx_ring->ess->stats.rx_bytes += length; ++ ++ done++; ++skip: ++ ++ num_desc += atomic_xchg(&rx_ring->refill_count, 0); ++ while (num_desc) { ++ if (ipqess_rx_buf_alloc_napi(rx_ring)) { ++ num_desc = atomic_add_return(num_desc, ++ &rx_ring->refill_count); ++ if (num_desc >= DIV_ROUND_UP(IPQESS_RX_RING_SIZE * 4, 7)) ++ schedule_work(&rx_ring->ess->rx_refill[rx_ring->ring_id].refill_work); ++ break; ++ } ++ num_desc--; ++ } ++ } ++ ++ ipqess_w32(rx_ring->ess, IPQESS_REG_RX_SW_CONS_IDX_Q(rx_ring->idx), ++ rx_ring_tail); ++ rx_ring->tail = rx_ring_tail; ++ ++ return done; ++} ++ ++static int ipqess_tx_complete(struct ipqess_tx_ring *tx_ring, int budget) ++{ ++ int total = 0, ret; ++ int done = 0; ++ u32 tail; ++ ++ tail = ipqess_r32(tx_ring->ess, IPQESS_REG_TPD_IDX_Q(tx_ring->idx)); ++ tail >>= IPQESS_TPD_CONS_IDX_SHIFT; ++ tail &= IPQESS_TPD_CONS_IDX_MASK; ++ ++ do { ++ ret = ipqess_tx_unmap_and_free(&tx_ring->ess->pdev->dev, ++ &tx_ring->buf[tx_ring->tail]); ++ tx_ring->tail = IPQESS_NEXT_IDX(tx_ring->tail, tx_ring->count); ++ ++ total += ret; ++ } while ((++done < budget) && (tx_ring->tail != tail)); ++ ++ ipqess_w32(tx_ring->ess, IPQESS_REG_TX_SW_CONS_IDX_Q(tx_ring->idx), ++ tx_ring->tail); ++ ++ if (netif_tx_queue_stopped(tx_ring->nq)) { ++ netdev_dbg(tx_ring->ess->netdev, "waking up tx queue %d\n", ++ tx_ring->idx); ++ netif_tx_wake_queue(tx_ring->nq); ++ } ++ ++ netdev_tx_completed_queue(tx_ring->nq, done, total); ++ ++ return done; ++} ++ ++static int ipqess_tx_napi(struct napi_struct *napi, int budget) ++{ ++ struct ipqess_tx_ring *tx_ring = container_of(napi, struct ipqess_tx_ring, ++ napi_tx); ++ int work_done = 0; ++ u32 tx_status; ++ ++ tx_status = ipqess_r32(tx_ring->ess, IPQESS_REG_TX_ISR); ++ tx_status &= BIT(tx_ring->idx); ++ ++ work_done = ipqess_tx_complete(tx_ring, budget); ++ ++ ipqess_w32(tx_ring->ess, IPQESS_REG_TX_ISR, tx_status); ++ ++ if (likely(work_done < budget)) { ++ if (napi_complete_done(napi, work_done)) ++ ipqess_w32(tx_ring->ess, ++ IPQESS_REG_TX_INT_MASK_Q(tx_ring->idx), 0x1); ++ } ++ ++ return work_done; ++} ++ ++static int ipqess_rx_napi(struct napi_struct *napi, int budget) ++{ ++ struct ipqess_rx_ring *rx_ring = container_of(napi, struct ipqess_rx_ring, ++ napi_rx); ++ struct ipqess *ess = rx_ring->ess; ++ u32 rx_mask = BIT(rx_ring->idx); ++ int remaining_budget = budget; ++ int rx_done; ++ u32 status; ++ ++ do { ++ ipqess_w32(ess, IPQESS_REG_RX_ISR, rx_mask); ++ rx_done = ipqess_rx_poll(rx_ring, remaining_budget); ++ remaining_budget -= rx_done; ++ ++ status = ipqess_r32(ess, IPQESS_REG_RX_ISR); ++ } while (remaining_budget > 0 && (status & rx_mask)); ++ ++ if (remaining_budget <= 0) ++ return budget; ++ ++ if (napi_complete_done(napi, budget - remaining_budget)) ++ ipqess_w32(ess, IPQESS_REG_RX_INT_MASK_Q(rx_ring->idx), 0x1); ++ ++ return budget - remaining_budget; ++} ++ ++static irqreturn_t ipqess_interrupt_tx(int irq, void *priv) ++{ ++ struct ipqess_tx_ring *tx_ring = (struct ipqess_tx_ring *)priv; ++ ++ if (likely(napi_schedule_prep(&tx_ring->napi_tx))) { ++ __napi_schedule(&tx_ring->napi_tx); ++ ipqess_w32(tx_ring->ess, IPQESS_REG_TX_INT_MASK_Q(tx_ring->idx), ++ 0x0); ++ } ++ ++ return IRQ_HANDLED; ++} ++ ++static irqreturn_t ipqess_interrupt_rx(int irq, void *priv) ++{ ++ struct ipqess_rx_ring *rx_ring = (struct ipqess_rx_ring *)priv; ++ ++ if (likely(napi_schedule_prep(&rx_ring->napi_rx))) { ++ __napi_schedule(&rx_ring->napi_rx); ++ ipqess_w32(rx_ring->ess, IPQESS_REG_RX_INT_MASK_Q(rx_ring->idx), ++ 0x0); ++ } ++ ++ return IRQ_HANDLED; ++} ++ ++static void ipqess_irq_enable(struct ipqess *ess) ++{ ++ int i; ++ ++ ipqess_w32(ess, IPQESS_REG_RX_ISR, 0xff); ++ ipqess_w32(ess, IPQESS_REG_TX_ISR, 0xffff); ++ for (i = 0; i < IPQESS_NETDEV_QUEUES; i++) { ++ ipqess_w32(ess, IPQESS_REG_RX_INT_MASK_Q(ess->rx_ring[i].idx), 1); ++ ipqess_w32(ess, IPQESS_REG_TX_INT_MASK_Q(ess->tx_ring[i].idx), 1); ++ } ++} ++ ++static void ipqess_irq_disable(struct ipqess *ess) ++{ ++ int i; ++ ++ for (i = 0; i < IPQESS_NETDEV_QUEUES; i++) { ++ ipqess_w32(ess, IPQESS_REG_RX_INT_MASK_Q(ess->rx_ring[i].idx), 0); ++ ipqess_w32(ess, IPQESS_REG_TX_INT_MASK_Q(ess->tx_ring[i].idx), 0); ++ } ++} ++ ++static int __init ipqess_init(struct net_device *netdev) ++{ ++ struct ipqess *ess = netdev_priv(netdev); ++ struct device_node *of_node = ess->pdev->dev.of_node; ++ int ret; ++ ++ ret = of_get_ethdev_address(of_node, netdev); ++ if (ret) ++ eth_hw_addr_random(netdev); ++ ++ return phylink_of_phy_connect(ess->phylink, of_node, 0); ++} ++ ++static void ipqess_uninit(struct net_device *netdev) ++{ ++ struct ipqess *ess = netdev_priv(netdev); ++ ++ phylink_disconnect_phy(ess->phylink); ++} ++ ++static int ipqess_open(struct net_device *netdev) ++{ ++ struct ipqess *ess = netdev_priv(netdev); ++ int i, err; ++ ++ for (i = 0; i < IPQESS_NETDEV_QUEUES; i++) { ++ int qid; ++ ++ qid = ess->tx_ring[i].idx; ++ err = devm_request_irq(&netdev->dev, ess->tx_irq[qid], ++ ipqess_interrupt_tx, 0, ++ ess->tx_irq_names[qid], ++ &ess->tx_ring[i]); ++ if (err) ++ return err; ++ ++ qid = ess->rx_ring[i].idx; ++ err = devm_request_irq(&netdev->dev, ess->rx_irq[qid], ++ ipqess_interrupt_rx, 0, ++ ess->rx_irq_names[qid], ++ &ess->rx_ring[i]); ++ if (err) ++ return err; ++ ++ napi_enable(&ess->tx_ring[i].napi_tx); ++ napi_enable(&ess->rx_ring[i].napi_rx); ++ } ++ ++ ipqess_irq_enable(ess); ++ phylink_start(ess->phylink); ++ netif_tx_start_all_queues(netdev); ++ ++ return 0; ++} ++ ++static int ipqess_stop(struct net_device *netdev) ++{ ++ struct ipqess *ess = netdev_priv(netdev); ++ int i; ++ ++ netif_tx_stop_all_queues(netdev); ++ phylink_stop(ess->phylink); ++ ipqess_irq_disable(ess); ++ for (i = 0; i < IPQESS_NETDEV_QUEUES; i++) { ++ napi_disable(&ess->tx_ring[i].napi_tx); ++ napi_disable(&ess->rx_ring[i].napi_rx); ++ } ++ ++ return 0; ++} ++ ++static int ipqess_do_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) ++{ ++ struct ipqess *ess = netdev_priv(netdev); ++ ++ return phylink_mii_ioctl(ess->phylink, ifr, cmd); ++} ++ ++static u16 ipqess_tx_desc_available(struct ipqess_tx_ring *tx_ring) ++{ ++ u16 count = 0; ++ ++ if (tx_ring->tail <= tx_ring->head) ++ count = IPQESS_TX_RING_SIZE; ++ ++ count += tx_ring->tail - tx_ring->head - 1; ++ ++ return count; ++} ++ ++static int ipqess_cal_txd_req(struct sk_buff *skb) ++{ ++ int tpds; ++ ++ /* one TPD for the header, and one for each fragments */ ++ tpds = 1 + skb_shinfo(skb)->nr_frags; ++ if (skb_is_gso(skb) && skb_is_gso_v6(skb)) { ++ /* for LSOv2 one extra TPD is needed */ ++ tpds++; ++ } ++ ++ return tpds; ++} ++ ++static struct ipqess_buf *ipqess_get_tx_buffer(struct ipqess_tx_ring *tx_ring, ++ struct ipqess_tx_desc *desc) ++{ ++ return &tx_ring->buf[desc - tx_ring->hw_desc]; ++} ++ ++static struct ipqess_tx_desc *ipqess_tx_desc_next(struct ipqess_tx_ring *tx_ring) ++{ ++ struct ipqess_tx_desc *desc; ++ ++ desc = &tx_ring->hw_desc[tx_ring->head]; ++ tx_ring->head = IPQESS_NEXT_IDX(tx_ring->head, tx_ring->count); ++ ++ return desc; ++} ++ ++static void ipqess_rollback_tx(struct ipqess *eth, ++ struct ipqess_tx_desc *first_desc, int ring_id) ++{ ++ struct ipqess_tx_ring *tx_ring = ð->tx_ring[ring_id]; ++ struct ipqess_tx_desc *desc = NULL; ++ struct ipqess_buf *buf; ++ u16 start_index, index; ++ ++ start_index = first_desc - tx_ring->hw_desc; ++ ++ index = start_index; ++ while (index != tx_ring->head) { ++ desc = &tx_ring->hw_desc[index]; ++ buf = &tx_ring->buf[index]; ++ ipqess_tx_unmap_and_free(ð->pdev->dev, buf); ++ memset(desc, 0, sizeof(*desc)); ++ if (++index == tx_ring->count) ++ index = 0; ++ } ++ tx_ring->head = start_index; ++} ++ ++static int ipqess_tx_map_and_fill(struct ipqess_tx_ring *tx_ring, ++ struct sk_buff *skb) ++{ ++ struct ipqess_tx_desc *desc = NULL, *first_desc = NULL; ++ u32 word1 = 0, word3 = 0, lso_word1 = 0, svlan_tag = 0; ++ struct platform_device *pdev = tx_ring->ess->pdev; ++ struct ipqess_buf *buf = NULL; ++ u16 len; ++ int i; ++ ++ if (skb_is_gso(skb)) { ++ if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV4) { ++ lso_word1 |= IPQESS_TPD_IPV4_EN; ++ ip_hdr(skb)->check = 0; ++ tcp_hdr(skb)->check = ~csum_tcpudp_magic(ip_hdr(skb)->saddr, ++ ip_hdr(skb)->daddr, ++ 0, IPPROTO_TCP, 0); ++ } else if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6) { ++ lso_word1 |= IPQESS_TPD_LSO_V2_EN; ++ ipv6_hdr(skb)->payload_len = 0; ++ tcp_hdr(skb)->check = ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr, ++ &ipv6_hdr(skb)->daddr, ++ 0, IPPROTO_TCP, 0); ++ } ++ ++ lso_word1 |= IPQESS_TPD_LSO_EN | ++ ((skb_shinfo(skb)->gso_size & IPQESS_TPD_MSS_MASK) << ++ IPQESS_TPD_MSS_SHIFT) | ++ (skb_transport_offset(skb) << IPQESS_TPD_HDR_SHIFT); ++ } else if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) { ++ u8 css, cso; ++ ++ cso = skb_checksum_start_offset(skb); ++ css = cso + skb->csum_offset; ++ ++ word1 |= (IPQESS_TPD_CUSTOM_CSUM_EN); ++ word1 |= (cso >> 1) << IPQESS_TPD_HDR_SHIFT; ++ word1 |= ((css >> 1) << IPQESS_TPD_CUSTOM_CSUM_SHIFT); ++ } ++ ++ if (skb_vlan_tag_present(skb)) { ++ switch (skb->vlan_proto) { ++ case htons(ETH_P_8021Q): ++ word3 |= BIT(IPQESS_TX_INS_CVLAN); ++ word3 |= skb_vlan_tag_get(skb) << IPQESS_TX_CVLAN_TAG_SHIFT; ++ break; ++ case htons(ETH_P_8021AD): ++ word1 |= BIT(IPQESS_TX_INS_SVLAN); ++ svlan_tag = skb_vlan_tag_get(skb); ++ break; ++ default: ++ dev_err(&pdev->dev, "no ctag or stag present\n"); ++ goto vlan_tag_error; ++ } ++ } ++ ++ if (eth_type_vlan(skb->protocol)) ++ word1 |= IPQESS_TPD_VLAN_TAGGED; ++ ++ if (skb->protocol == htons(ETH_P_PPP_SES)) ++ word1 |= IPQESS_TPD_PPPOE_EN; ++ ++ len = skb_headlen(skb); ++ ++ first_desc = ipqess_tx_desc_next(tx_ring); ++ desc = first_desc; ++ if (lso_word1 & IPQESS_TPD_LSO_V2_EN) { ++ desc->addr = cpu_to_le32(skb->len); ++ desc->word1 = cpu_to_le32(word1 | lso_word1); ++ desc->svlan_tag = cpu_to_le16(svlan_tag); ++ desc->word3 = cpu_to_le32(word3); ++ desc = ipqess_tx_desc_next(tx_ring); ++ } ++ ++ buf = ipqess_get_tx_buffer(tx_ring, desc); ++ buf->length = len; ++ buf->dma = dma_map_single(&pdev->dev, skb->data, len, DMA_TO_DEVICE); ++ ++ if (dma_mapping_error(&pdev->dev, buf->dma)) ++ goto dma_error; ++ ++ desc->addr = cpu_to_le32(buf->dma); ++ desc->len = cpu_to_le16(len); ++ ++ buf->flags |= IPQESS_DESC_SINGLE; ++ desc->word1 = cpu_to_le32(word1 | lso_word1); ++ desc->svlan_tag = cpu_to_le16(svlan_tag); ++ desc->word3 = cpu_to_le32(word3); ++ ++ for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { ++ skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; ++ ++ len = skb_frag_size(frag); ++ desc = ipqess_tx_desc_next(tx_ring); ++ buf = ipqess_get_tx_buffer(tx_ring, desc); ++ buf->length = len; ++ buf->flags |= IPQESS_DESC_PAGE; ++ buf->dma = skb_frag_dma_map(&pdev->dev, frag, 0, len, ++ DMA_TO_DEVICE); ++ ++ if (dma_mapping_error(&pdev->dev, buf->dma)) ++ goto dma_error; ++ ++ desc->addr = cpu_to_le32(buf->dma); ++ desc->len = cpu_to_le16(len); ++ desc->svlan_tag = cpu_to_le16(svlan_tag); ++ desc->word1 = cpu_to_le32(word1 | lso_word1); ++ desc->word3 = cpu_to_le32(word3); ++ } ++ desc->word1 |= cpu_to_le32(1 << IPQESS_TPD_EOP_SHIFT); ++ buf->skb = skb; ++ buf->flags |= IPQESS_DESC_LAST; ++ ++ return 0; ++ ++dma_error: ++ ipqess_rollback_tx(tx_ring->ess, first_desc, tx_ring->ring_id); ++ dev_err(&pdev->dev, "TX DMA map failed\n"); ++ ++vlan_tag_error: ++ return -ENOMEM; ++} ++ ++static void ipqess_kick_tx(struct ipqess_tx_ring *tx_ring) ++{ ++ /* Ensure that all TPDs has been written completely */ ++ dma_wmb(); ++ ++ /* update software producer index */ ++ ipqess_w32(tx_ring->ess, IPQESS_REG_TPD_IDX_Q(tx_ring->idx), ++ tx_ring->head); ++} ++ ++static netdev_tx_t ipqess_xmit(struct sk_buff *skb, struct net_device *netdev) ++{ ++ struct ipqess *ess = netdev_priv(netdev); ++ struct ipqess_tx_ring *tx_ring; ++ int avail; ++ int tx_num; ++ int ret; ++ ++ tx_ring = &ess->tx_ring[skb_get_queue_mapping(skb)]; ++ tx_num = ipqess_cal_txd_req(skb); ++ avail = ipqess_tx_desc_available(tx_ring); ++ if (avail < tx_num) { ++ netdev_dbg(netdev, ++ "stopping tx queue %d, avail=%d req=%d im=%x\n", ++ tx_ring->idx, avail, tx_num, ++ ipqess_r32(tx_ring->ess, ++ IPQESS_REG_TX_INT_MASK_Q(tx_ring->idx))); ++ netif_tx_stop_queue(tx_ring->nq); ++ ipqess_w32(tx_ring->ess, IPQESS_REG_TX_INT_MASK_Q(tx_ring->idx), 0x1); ++ ipqess_kick_tx(tx_ring); ++ return NETDEV_TX_BUSY; ++ } ++ ++ ret = ipqess_tx_map_and_fill(tx_ring, skb); ++ if (ret) { ++ dev_kfree_skb_any(skb); ++ ess->stats.tx_errors++; ++ goto err_out; ++ } ++ ++ ess->stats.tx_packets++; ++ ess->stats.tx_bytes += skb->len; ++ netdev_tx_sent_queue(tx_ring->nq, skb->len); ++ ++ if (!netdev_xmit_more() || netif_xmit_stopped(tx_ring->nq)) ++ ipqess_kick_tx(tx_ring); ++ ++err_out: ++ return NETDEV_TX_OK; ++} ++ ++static int ipqess_set_mac_address(struct net_device *netdev, void *p) ++{ ++ struct ipqess *ess = netdev_priv(netdev); ++ const char *macaddr = netdev->dev_addr; ++ int ret = eth_mac_addr(netdev, p); ++ ++ if (ret) ++ return ret; ++ ++ ipqess_w32(ess, IPQESS_REG_MAC_CTRL1, (macaddr[0] << 8) | macaddr[1]); ++ ipqess_w32(ess, IPQESS_REG_MAC_CTRL0, ++ (macaddr[2] << 24) | (macaddr[3] << 16) | (macaddr[4] << 8) | ++ macaddr[5]); ++ ++ return 0; ++} ++ ++static void ipqess_tx_timeout(struct net_device *netdev, unsigned int txq_id) ++{ ++ struct ipqess *ess = netdev_priv(netdev); ++ struct ipqess_tx_ring *tr = &ess->tx_ring[txq_id]; ++ ++ netdev_warn(netdev, "TX timeout on queue %d\n", tr->idx); ++} ++ ++static const struct net_device_ops ipqess_axi_netdev_ops = { ++ .ndo_init = ipqess_init, ++ .ndo_uninit = ipqess_uninit, ++ .ndo_open = ipqess_open, ++ .ndo_stop = ipqess_stop, ++ .ndo_do_ioctl = ipqess_do_ioctl, ++ .ndo_start_xmit = ipqess_xmit, ++ .ndo_get_stats = ipqess_get_stats, ++ .ndo_set_mac_address = ipqess_set_mac_address, ++ .ndo_tx_timeout = ipqess_tx_timeout, ++}; ++ ++static void ipqess_hw_stop(struct ipqess *ess) ++{ ++ int i; ++ ++ /* disable all RX queue IRQs */ ++ for (i = 0; i < IPQESS_MAX_RX_QUEUE; i++) ++ ipqess_w32(ess, IPQESS_REG_RX_INT_MASK_Q(i), 0); ++ ++ /* disable all TX queue IRQs */ ++ for (i = 0; i < IPQESS_MAX_TX_QUEUE; i++) ++ ipqess_w32(ess, IPQESS_REG_TX_INT_MASK_Q(i), 0); ++ ++ /* disable all other IRQs */ ++ ipqess_w32(ess, IPQESS_REG_MISC_IMR, 0); ++ ipqess_w32(ess, IPQESS_REG_WOL_IMR, 0); ++ ++ /* clear the IRQ status registers */ ++ ipqess_w32(ess, IPQESS_REG_RX_ISR, 0xff); ++ ipqess_w32(ess, IPQESS_REG_TX_ISR, 0xffff); ++ ipqess_w32(ess, IPQESS_REG_MISC_ISR, 0x1fff); ++ ipqess_w32(ess, IPQESS_REG_WOL_ISR, 0x1); ++ ipqess_w32(ess, IPQESS_REG_WOL_CTRL, 0); ++ ++ /* disable RX and TX queues */ ++ ipqess_m32(ess, IPQESS_RXQ_CTRL_EN_MASK, 0, IPQESS_REG_RXQ_CTRL); ++ ipqess_m32(ess, IPQESS_TXQ_CTRL_TXQ_EN, 0, IPQESS_REG_TXQ_CTRL); ++} ++ ++static int ipqess_hw_init(struct ipqess *ess) ++{ ++ int i, err; ++ u32 tmp; ++ ++ ipqess_hw_stop(ess); ++ ++ ipqess_m32(ess, BIT(IPQESS_INTR_SW_IDX_W_TYP_SHIFT), ++ IPQESS_INTR_SW_IDX_W_TYPE << IPQESS_INTR_SW_IDX_W_TYP_SHIFT, ++ IPQESS_REG_INTR_CTRL); ++ ++ /* enable IRQ delay slot */ ++ ipqess_w32(ess, IPQESS_REG_IRQ_MODRT_TIMER_INIT, ++ (IPQESS_TX_IMT << IPQESS_IRQ_MODRT_TX_TIMER_SHIFT) | ++ (IPQESS_RX_IMT << IPQESS_IRQ_MODRT_RX_TIMER_SHIFT)); ++ ++ /* Set Customer and Service VLAN TPIDs */ ++ ipqess_w32(ess, IPQESS_REG_VLAN_CFG, ++ (ETH_P_8021Q << IPQESS_VLAN_CFG_CVLAN_TPID_SHIFT) | ++ (ETH_P_8021AD << IPQESS_VLAN_CFG_SVLAN_TPID_SHIFT)); ++ ++ /* Configure the TX Queue bursting */ ++ ipqess_w32(ess, IPQESS_REG_TXQ_CTRL, ++ (IPQESS_TPD_BURST << IPQESS_TXQ_NUM_TPD_BURST_SHIFT) | ++ (IPQESS_TXF_BURST << IPQESS_TXQ_TXF_BURST_NUM_SHIFT) | ++ IPQESS_TXQ_CTRL_TPD_BURST_EN); ++ ++ /* Set RSS type */ ++ ipqess_w32(ess, IPQESS_REG_RSS_TYPE, ++ IPQESS_RSS_TYPE_IPV4TCP | IPQESS_RSS_TYPE_IPV6_TCP | ++ IPQESS_RSS_TYPE_IPV4_UDP | IPQESS_RSS_TYPE_IPV6UDP | ++ IPQESS_RSS_TYPE_IPV4 | IPQESS_RSS_TYPE_IPV6); ++ ++ /* Set RFD ring burst and threshold */ ++ ipqess_w32(ess, IPQESS_REG_RX_DESC1, ++ (IPQESS_RFD_BURST << IPQESS_RXQ_RFD_BURST_NUM_SHIFT) | ++ (IPQESS_RFD_THR << IPQESS_RXQ_RFD_PF_THRESH_SHIFT) | ++ (IPQESS_RFD_LTHR << IPQESS_RXQ_RFD_LOW_THRESH_SHIFT)); ++ ++ /* Set Rx FIFO ++ * - threshold to start to DMA data to host ++ */ ++ ipqess_w32(ess, IPQESS_REG_RXQ_CTRL, ++ IPQESS_FIFO_THRESH_128_BYTE | IPQESS_RXQ_CTRL_RMV_VLAN); ++ ++ err = ipqess_rx_ring_alloc(ess); ++ if (err) ++ return err; ++ ++ err = ipqess_tx_ring_alloc(ess); ++ if (err) ++ goto err_rx_ring_free; ++ ++ /* Load all of ring base addresses above into the dma engine */ ++ ipqess_m32(ess, 0, BIT(IPQESS_LOAD_PTR_SHIFT), IPQESS_REG_TX_SRAM_PART); ++ ++ /* Disable TX FIFO low watermark and high watermark */ ++ ipqess_w32(ess, IPQESS_REG_TXF_WATER_MARK, 0); ++ ++ /* Configure RSS indirection table. ++ * 128 hash will be configured in the following ++ * pattern: hash{0,1,2,3} = {Q0,Q2,Q4,Q6} respectively ++ * and so on ++ */ ++ for (i = 0; i < IPQESS_NUM_IDT; i++) ++ ipqess_w32(ess, IPQESS_REG_RSS_IDT(i), IPQESS_RSS_IDT_VALUE); ++ ++ /* Configure load balance mapping table. ++ * 4 table entry will be configured according to the ++ * following pattern: load_balance{0,1,2,3} = {Q0,Q1,Q3,Q4} ++ * respectively. ++ */ ++ ipqess_w32(ess, IPQESS_REG_LB_RING, IPQESS_LB_REG_VALUE); ++ ++ /* Configure Virtual queue for Tx rings */ ++ ipqess_w32(ess, IPQESS_REG_VQ_CTRL0, IPQESS_VQ_REG_VALUE); ++ ipqess_w32(ess, IPQESS_REG_VQ_CTRL1, IPQESS_VQ_REG_VALUE); ++ ++ /* Configure Max AXI Burst write size to 128 bytes*/ ++ ipqess_w32(ess, IPQESS_REG_AXIW_CTRL_MAXWRSIZE, ++ IPQESS_AXIW_MAXWRSIZE_VALUE); ++ ++ /* Enable TX queues */ ++ ipqess_m32(ess, 0, IPQESS_TXQ_CTRL_TXQ_EN, IPQESS_REG_TXQ_CTRL); ++ ++ /* Enable RX queues */ ++ tmp = 0; ++ for (i = 0; i < IPQESS_NETDEV_QUEUES; i++) ++ tmp |= IPQESS_RXQ_CTRL_EN(ess->rx_ring[i].idx); ++ ++ ipqess_m32(ess, IPQESS_RXQ_CTRL_EN_MASK, tmp, IPQESS_REG_RXQ_CTRL); ++ ++ return 0; ++ ++err_rx_ring_free: ++ ++ ipqess_rx_ring_free(ess); ++ return err; ++} ++ ++static void ipqess_mac_config(struct phylink_config *config, unsigned int mode, ++ const struct phylink_link_state *state) ++{ ++ /* Nothing to do, use fixed Internal mode */ ++} ++ ++static void ipqess_mac_link_down(struct phylink_config *config, ++ unsigned int mode, ++ phy_interface_t interface) ++{ ++ /* Nothing to do, use fixed Internal mode */ ++} ++ ++static void ipqess_mac_link_up(struct phylink_config *config, ++ struct phy_device *phy, unsigned int mode, ++ phy_interface_t interface, ++ int speed, int duplex, ++ bool tx_pause, bool rx_pause) ++{ ++ /* Nothing to do, use fixed Internal mode */ ++} ++ ++static struct phylink_mac_ops ipqess_phylink_mac_ops = { ++ .validate = phylink_generic_validate, ++ .mac_config = ipqess_mac_config, ++ .mac_link_up = ipqess_mac_link_up, ++ .mac_link_down = ipqess_mac_link_down, ++}; ++ ++static void ipqess_reset(struct ipqess *ess) ++{ ++ reset_control_assert(ess->ess_rst); ++ ++ mdelay(10); ++ ++ reset_control_deassert(ess->ess_rst); ++ ++ /* Waiting for all inner tables to be flushed and reinitialized. ++ * This takes between 5 and 10 ms ++ */ ++ ++ mdelay(10); ++} ++ ++static int ipqess_axi_probe(struct platform_device *pdev) ++{ ++ struct device_node *np = pdev->dev.of_node; ++ struct net_device *netdev; ++ phy_interface_t phy_mode; ++ struct ipqess *ess; ++ int i, err = 0; ++ ++ netdev = devm_alloc_etherdev_mqs(&pdev->dev, sizeof(*ess), ++ IPQESS_NETDEV_QUEUES, ++ IPQESS_NETDEV_QUEUES); ++ if (!netdev) ++ return -ENOMEM; ++ ++ ess = netdev_priv(netdev); ++ ess->netdev = netdev; ++ ess->pdev = pdev; ++ spin_lock_init(&ess->stats_lock); ++ SET_NETDEV_DEV(netdev, &pdev->dev); ++ platform_set_drvdata(pdev, netdev); ++ ++ ess->hw_addr = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); ++ if (IS_ERR(ess->hw_addr)) ++ return PTR_ERR(ess->hw_addr); ++ ++ err = of_get_phy_mode(np, &phy_mode); ++ if (err) { ++ dev_err(&pdev->dev, "incorrect phy-mode\n"); ++ return err; ++ } ++ ++ ess->ess_clk = devm_clk_get(&pdev->dev, NULL); ++ if (!IS_ERR(ess->ess_clk)) ++ clk_prepare_enable(ess->ess_clk); ++ ++ ess->ess_rst = devm_reset_control_get(&pdev->dev, NULL); ++ if (IS_ERR(ess->ess_rst)) ++ goto err_clk; ++ ++ ipqess_reset(ess); ++ ++ ess->phylink_config.dev = &netdev->dev; ++ ess->phylink_config.type = PHYLINK_NETDEV; ++ ess->phylink_config.mac_capabilities = MAC_SYM_PAUSE | MAC_10 | ++ MAC_100 | MAC_1000FD; ++ ++ __set_bit(PHY_INTERFACE_MODE_INTERNAL, ++ ess->phylink_config.supported_interfaces); ++ ++ ess->phylink = phylink_create(&ess->phylink_config, ++ of_fwnode_handle(np), phy_mode, ++ &ipqess_phylink_mac_ops); ++ if (IS_ERR(ess->phylink)) { ++ err = PTR_ERR(ess->phylink); ++ goto err_clk; ++ } ++ ++ for (i = 0; i < IPQESS_MAX_TX_QUEUE; i++) { ++ ess->tx_irq[i] = platform_get_irq(pdev, i); ++ scnprintf(ess->tx_irq_names[i], sizeof(ess->tx_irq_names[i]), ++ "%s:txq%d", pdev->name, i); ++ } ++ ++ for (i = 0; i < IPQESS_MAX_RX_QUEUE; i++) { ++ ess->rx_irq[i] = platform_get_irq(pdev, i + IPQESS_MAX_TX_QUEUE); ++ scnprintf(ess->rx_irq_names[i], sizeof(ess->rx_irq_names[i]), ++ "%s:rxq%d", pdev->name, i); ++ } ++ ++ netdev->netdev_ops = &ipqess_axi_netdev_ops; ++ netdev->features = NETIF_F_HW_CSUM | NETIF_F_RXCSUM | ++ NETIF_F_HW_VLAN_CTAG_RX | ++ NETIF_F_HW_VLAN_CTAG_TX | ++ NETIF_F_TSO | NETIF_F_GRO | NETIF_F_SG; ++ /* feature change is not supported yet */ ++ netdev->hw_features = 0; ++ netdev->vlan_features = NETIF_F_HW_CSUM | NETIF_F_SG | NETIF_F_RXCSUM | ++ NETIF_F_TSO | ++ NETIF_F_GRO; ++ netdev->watchdog_timeo = 5 * HZ; ++ netdev->base_addr = (u32)ess->hw_addr; ++ netdev->max_mtu = 9000; ++ netdev->gso_max_segs = IPQESS_TX_RING_SIZE / 2; ++ ++ ipqess_set_ethtool_ops(netdev); ++ ++ err = ipqess_hw_init(ess); ++ if (err) ++ goto err_phylink; ++ ++ for (i = 0; i < IPQESS_NETDEV_QUEUES; i++) { ++ netif_napi_add_tx(netdev, &ess->tx_ring[i].napi_tx, ipqess_tx_napi); ++ netif_napi_add(netdev, &ess->rx_ring[i].napi_rx, ipqess_rx_napi); ++ } ++ ++ err = register_netdev(netdev); ++ if (err) ++ goto err_hw_stop; ++ ++ return 0; ++ ++err_hw_stop: ++ ipqess_hw_stop(ess); ++ ++ ipqess_tx_ring_free(ess); ++ ipqess_rx_ring_free(ess); ++err_phylink: ++ phylink_destroy(ess->phylink); ++ ++err_clk: ++ clk_disable_unprepare(ess->ess_clk); ++ ++ return err; ++} ++ ++static int ipqess_axi_remove(struct platform_device *pdev) ++{ ++ const struct net_device *netdev = platform_get_drvdata(pdev); ++ struct ipqess *ess = netdev_priv(netdev); ++ ++ unregister_netdev(ess->netdev); ++ ipqess_hw_stop(ess); ++ ++ ipqess_tx_ring_free(ess); ++ ipqess_rx_ring_free(ess); ++ ++ phylink_destroy(ess->phylink); ++ clk_disable_unprepare(ess->ess_clk); ++ ++ return 0; ++} ++ ++static const struct of_device_id ipqess_of_mtable[] = { ++ {.compatible = "qcom,ipq4019-ess-edma" }, ++ {} ++}; ++MODULE_DEVICE_TABLE(of, ipqess_of_mtable); ++ ++static struct platform_driver ipqess_axi_driver = { ++ .driver = { ++ .name = "ipqess-edma", ++ .of_match_table = ipqess_of_mtable, ++ }, ++ .probe = ipqess_axi_probe, ++ .remove = ipqess_axi_remove, ++}; ++ ++module_platform_driver(ipqess_axi_driver); ++ ++MODULE_AUTHOR("Qualcomm Atheros Inc"); ++MODULE_AUTHOR("John Crispin "); ++MODULE_AUTHOR("Christian Lamparter "); ++MODULE_AUTHOR("Gabor Juhos "); ++MODULE_AUTHOR("Maxime Chevallier "); ++MODULE_LICENSE("GPL"); +--- /dev/null ++++ b/drivers/net/ethernet/qualcomm/ipqess/ipqess.h +@@ -0,0 +1,518 @@ ++/* SPDX-License-Identifier: (GPL-2.0 OR ISC) */ ++/* Copyright (c) 2014 - 2016, The Linux Foundation. All rights reserved. ++ * Copyright (c) 2017 - 2018, John Crispin ++ * Copyright (c) 2018 - 2019, Christian Lamparter ++ * Copyright (c) 2020 - 2021, Gabor Juhos ++ * Copyright (c) 2021 - 2022, Maxime Chevallier ++ * ++ */ ++ ++#ifndef _IPQESS_H_ ++#define _IPQESS_H_ ++ ++#define IPQESS_NETDEV_QUEUES 4 ++ ++#define IPQESS_TPD_EOP_SHIFT 31 ++ ++#define IPQESS_PORT_ID_SHIFT 12 ++#define IPQESS_PORT_ID_MASK 0x7 ++ ++/* tpd word 3 bit 18-28 */ ++#define IPQESS_TPD_PORT_BITMAP_SHIFT 18 ++ ++#define IPQESS_TPD_FROM_CPU_SHIFT 25 ++ ++#define IPQESS_RX_RING_SIZE 128 ++#define IPQESS_RX_HEAD_BUFF_SIZE 1540 ++#define IPQESS_TX_RING_SIZE 128 ++#define IPQESS_MAX_RX_QUEUE 8 ++#define IPQESS_MAX_TX_QUEUE 16 ++ ++/* Configurations */ ++#define IPQESS_INTR_CLEAR_TYPE 0 ++#define IPQESS_INTR_SW_IDX_W_TYPE 0 ++#define IPQESS_FIFO_THRESH_TYPE 0 ++#define IPQESS_RSS_TYPE 0 ++#define IPQESS_RX_IMT 0x0020 ++#define IPQESS_TX_IMT 0x0050 ++#define IPQESS_TPD_BURST 5 ++#define IPQESS_TXF_BURST 0x100 ++#define IPQESS_RFD_BURST 8 ++#define IPQESS_RFD_THR 16 ++#define IPQESS_RFD_LTHR 0 ++ ++/* Flags used in transmit direction */ ++#define IPQESS_DESC_LAST 0x1 ++#define IPQESS_DESC_SINGLE 0x2 ++#define IPQESS_DESC_PAGE 0x4 ++ ++struct ipqess_statistics { ++ u32 tx_q0_pkt; ++ u32 tx_q1_pkt; ++ u32 tx_q2_pkt; ++ u32 tx_q3_pkt; ++ u32 tx_q4_pkt; ++ u32 tx_q5_pkt; ++ u32 tx_q6_pkt; ++ u32 tx_q7_pkt; ++ u32 tx_q8_pkt; ++ u32 tx_q9_pkt; ++ u32 tx_q10_pkt; ++ u32 tx_q11_pkt; ++ u32 tx_q12_pkt; ++ u32 tx_q13_pkt; ++ u32 tx_q14_pkt; ++ u32 tx_q15_pkt; ++ u32 tx_q0_byte; ++ u32 tx_q1_byte; ++ u32 tx_q2_byte; ++ u32 tx_q3_byte; ++ u32 tx_q4_byte; ++ u32 tx_q5_byte; ++ u32 tx_q6_byte; ++ u32 tx_q7_byte; ++ u32 tx_q8_byte; ++ u32 tx_q9_byte; ++ u32 tx_q10_byte; ++ u32 tx_q11_byte; ++ u32 tx_q12_byte; ++ u32 tx_q13_byte; ++ u32 tx_q14_byte; ++ u32 tx_q15_byte; ++ u32 rx_q0_pkt; ++ u32 rx_q1_pkt; ++ u32 rx_q2_pkt; ++ u32 rx_q3_pkt; ++ u32 rx_q4_pkt; ++ u32 rx_q5_pkt; ++ u32 rx_q6_pkt; ++ u32 rx_q7_pkt; ++ u32 rx_q0_byte; ++ u32 rx_q1_byte; ++ u32 rx_q2_byte; ++ u32 rx_q3_byte; ++ u32 rx_q4_byte; ++ u32 rx_q5_byte; ++ u32 rx_q6_byte; ++ u32 rx_q7_byte; ++ u32 tx_desc_error; ++}; ++ ++struct ipqess_tx_desc { ++ __le16 len; ++ __le16 svlan_tag; ++ __le32 word1; ++ __le32 addr; ++ __le32 word3; ++} __aligned(16) __packed; ++ ++struct ipqess_rx_desc { ++ __le16 rrd0; ++ __le16 rrd1; ++ __le16 rrd2; ++ __le16 rrd3; ++ __le16 rrd4; ++ __le16 rrd5; ++ __le16 rrd6; ++ __le16 rrd7; ++} __aligned(16) __packed; ++ ++struct ipqess_buf { ++ struct sk_buff *skb; ++ dma_addr_t dma; ++ u32 flags; ++ u16 length; ++}; ++ ++struct ipqess_tx_ring { ++ struct napi_struct napi_tx; ++ u32 idx; ++ int ring_id; ++ struct ipqess *ess; ++ struct netdev_queue *nq; ++ struct ipqess_tx_desc *hw_desc; ++ struct ipqess_buf *buf; ++ dma_addr_t dma; ++ u16 count; ++ u16 head; ++ u16 tail; ++}; ++ ++struct ipqess_rx_ring { ++ struct napi_struct napi_rx; ++ u32 idx; ++ int ring_id; ++ struct ipqess *ess; ++ struct device *ppdev; ++ struct ipqess_rx_desc **hw_desc; ++ struct ipqess_buf *buf; ++ dma_addr_t dma; ++ u16 head; ++ u16 tail; ++ atomic_t refill_count; ++}; ++ ++struct ipqess_rx_ring_refill { ++ struct ipqess_rx_ring *rx_ring; ++ struct work_struct refill_work; ++}; ++ ++#define IPQESS_IRQ_NAME_LEN 32 ++ ++struct ipqess { ++ struct net_device *netdev; ++ void __iomem *hw_addr; ++ ++ struct clk *ess_clk; ++ struct reset_control *ess_rst; ++ ++ struct ipqess_rx_ring rx_ring[IPQESS_NETDEV_QUEUES]; ++ ++ struct platform_device *pdev; ++ struct phylink *phylink; ++ struct phylink_config phylink_config; ++ struct ipqess_tx_ring tx_ring[IPQESS_NETDEV_QUEUES]; ++ ++ struct ipqess_statistics ipqess_stats; ++ ++ /* Protects stats */ ++ spinlock_t stats_lock; ++ struct net_device_stats stats; ++ ++ struct ipqess_rx_ring_refill rx_refill[IPQESS_NETDEV_QUEUES]; ++ u32 tx_irq[IPQESS_MAX_TX_QUEUE]; ++ char tx_irq_names[IPQESS_MAX_TX_QUEUE][IPQESS_IRQ_NAME_LEN]; ++ u32 rx_irq[IPQESS_MAX_RX_QUEUE]; ++ char rx_irq_names[IPQESS_MAX_TX_QUEUE][IPQESS_IRQ_NAME_LEN]; ++}; ++ ++void ipqess_set_ethtool_ops(struct net_device *netdev); ++void ipqess_update_hw_stats(struct ipqess *ess); ++ ++/* register definition */ ++#define IPQESS_REG_MAS_CTRL 0x0 ++#define IPQESS_REG_TIMEOUT_CTRL 0x004 ++#define IPQESS_REG_DBG0 0x008 ++#define IPQESS_REG_DBG1 0x00C ++#define IPQESS_REG_SW_CTRL0 0x100 ++#define IPQESS_REG_SW_CTRL1 0x104 ++ ++/* Interrupt Status Register */ ++#define IPQESS_REG_RX_ISR 0x200 ++#define IPQESS_REG_TX_ISR 0x208 ++#define IPQESS_REG_MISC_ISR 0x210 ++#define IPQESS_REG_WOL_ISR 0x218 ++ ++#define IPQESS_MISC_ISR_RX_URG_Q(x) (1 << (x)) ++ ++#define IPQESS_MISC_ISR_AXIR_TIMEOUT 0x00000100 ++#define IPQESS_MISC_ISR_AXIR_ERR 0x00000200 ++#define IPQESS_MISC_ISR_TXF_DEAD 0x00000400 ++#define IPQESS_MISC_ISR_AXIW_ERR 0x00000800 ++#define IPQESS_MISC_ISR_AXIW_TIMEOUT 0x00001000 ++ ++#define IPQESS_WOL_ISR 0x00000001 ++ ++/* Interrupt Mask Register */ ++#define IPQESS_REG_MISC_IMR 0x214 ++#define IPQESS_REG_WOL_IMR 0x218 ++ ++#define IPQESS_RX_IMR_NORMAL_MASK 0x1 ++#define IPQESS_TX_IMR_NORMAL_MASK 0x1 ++#define IPQESS_MISC_IMR_NORMAL_MASK 0x80001FFF ++#define IPQESS_WOL_IMR_NORMAL_MASK 0x1 ++ ++/* Edma receive consumer index */ ++#define IPQESS_REG_RX_SW_CONS_IDX_Q(x) (0x220 + ((x) << 2)) /* x is the queue id */ ++ ++/* Edma transmit consumer index */ ++#define IPQESS_REG_TX_SW_CONS_IDX_Q(x) (0x240 + ((x) << 2)) /* x is the queue id */ ++ ++/* IRQ Moderator Initial Timer Register */ ++#define IPQESS_REG_IRQ_MODRT_TIMER_INIT 0x280 ++#define IPQESS_IRQ_MODRT_TIMER_MASK 0xFFFF ++#define IPQESS_IRQ_MODRT_RX_TIMER_SHIFT 0 ++#define IPQESS_IRQ_MODRT_TX_TIMER_SHIFT 16 ++ ++/* Interrupt Control Register */ ++#define IPQESS_REG_INTR_CTRL 0x284 ++#define IPQESS_INTR_CLR_TYP_SHIFT 0 ++#define IPQESS_INTR_SW_IDX_W_TYP_SHIFT 1 ++#define IPQESS_INTR_CLEAR_TYPE_W1 0 ++#define IPQESS_INTR_CLEAR_TYPE_R 1 ++ ++/* RX Interrupt Mask Register */ ++#define IPQESS_REG_RX_INT_MASK_Q(x) (0x300 + ((x) << 2)) /* x = queue id */ ++ ++/* TX Interrupt mask register */ ++#define IPQESS_REG_TX_INT_MASK_Q(x) (0x340 + ((x) << 2)) /* x = queue id */ ++ ++/* Load Ptr Register ++ * Software sets this bit after the initialization of the head and tail ++ */ ++#define IPQESS_REG_TX_SRAM_PART 0x400 ++#define IPQESS_LOAD_PTR_SHIFT 16 ++ ++/* TXQ Control Register */ ++#define IPQESS_REG_TXQ_CTRL 0x404 ++#define IPQESS_TXQ_CTRL_IP_OPTION_EN 0x10 ++#define IPQESS_TXQ_CTRL_TXQ_EN 0x20 ++#define IPQESS_TXQ_CTRL_ENH_MODE 0x40 ++#define IPQESS_TXQ_CTRL_LS_8023_EN 0x80 ++#define IPQESS_TXQ_CTRL_TPD_BURST_EN 0x100 ++#define IPQESS_TXQ_CTRL_LSO_BREAK_EN 0x200 ++#define IPQESS_TXQ_NUM_TPD_BURST_MASK 0xF ++#define IPQESS_TXQ_TXF_BURST_NUM_MASK 0xFFFF ++#define IPQESS_TXQ_NUM_TPD_BURST_SHIFT 0 ++#define IPQESS_TXQ_TXF_BURST_NUM_SHIFT 16 ++ ++#define IPQESS_REG_TXF_WATER_MARK 0x408 /* In 8-bytes */ ++#define IPQESS_TXF_WATER_MARK_MASK 0x0FFF ++#define IPQESS_TXF_LOW_WATER_MARK_SHIFT 0 ++#define IPQESS_TXF_HIGH_WATER_MARK_SHIFT 16 ++#define IPQESS_TXQ_CTRL_BURST_MODE_EN 0x80000000 ++ ++/* WRR Control Register */ ++#define IPQESS_REG_WRR_CTRL_Q0_Q3 0x40c ++#define IPQESS_REG_WRR_CTRL_Q4_Q7 0x410 ++#define IPQESS_REG_WRR_CTRL_Q8_Q11 0x414 ++#define IPQESS_REG_WRR_CTRL_Q12_Q15 0x418 ++ ++/* Weight round robin(WRR), it takes queue as input, and computes ++ * starting bits where we need to write the weight for a particular ++ * queue ++ */ ++#define IPQESS_WRR_SHIFT(x) (((x) * 5) % 20) ++ ++/* Tx Descriptor Control Register */ ++#define IPQESS_REG_TPD_RING_SIZE 0x41C ++#define IPQESS_TPD_RING_SIZE_SHIFT 0 ++#define IPQESS_TPD_RING_SIZE_MASK 0xFFFF ++ ++/* Transmit descriptor base address */ ++#define IPQESS_REG_TPD_BASE_ADDR_Q(x) (0x420 + ((x) << 2)) /* x = queue id */ ++ ++/* TPD Index Register */ ++#define IPQESS_REG_TPD_IDX_Q(x) (0x460 + ((x) << 2)) /* x = queue id */ ++ ++#define IPQESS_TPD_PROD_IDX_BITS 0x0000FFFF ++#define IPQESS_TPD_CONS_IDX_BITS 0xFFFF0000 ++#define IPQESS_TPD_PROD_IDX_MASK 0xFFFF ++#define IPQESS_TPD_CONS_IDX_MASK 0xFFFF ++#define IPQESS_TPD_PROD_IDX_SHIFT 0 ++#define IPQESS_TPD_CONS_IDX_SHIFT 16 ++ ++/* TX Virtual Queue Mapping Control Register */ ++#define IPQESS_REG_VQ_CTRL0 0x4A0 ++#define IPQESS_REG_VQ_CTRL1 0x4A4 ++ ++/* Virtual QID shift, it takes queue as input, and computes ++ * Virtual QID position in virtual qid control register ++ */ ++#define IPQESS_VQ_ID_SHIFT(i) (((i) * 3) % 24) ++ ++/* Virtual Queue Default Value */ ++#define IPQESS_VQ_REG_VALUE 0x240240 ++ ++/* Tx side Port Interface Control Register */ ++#define IPQESS_REG_PORT_CTRL 0x4A8 ++#define IPQESS_PAD_EN_SHIFT 15 ++ ++/* Tx side VLAN Configuration Register */ ++#define IPQESS_REG_VLAN_CFG 0x4AC ++ ++#define IPQESS_VLAN_CFG_SVLAN_TPID_SHIFT 0 ++#define IPQESS_VLAN_CFG_SVLAN_TPID_MASK 0xffff ++#define IPQESS_VLAN_CFG_CVLAN_TPID_SHIFT 16 ++#define IPQESS_VLAN_CFG_CVLAN_TPID_MASK 0xffff ++ ++#define IPQESS_TX_CVLAN 16 ++#define IPQESS_TX_INS_CVLAN 17 ++#define IPQESS_TX_CVLAN_TAG_SHIFT 0 ++ ++#define IPQESS_TX_SVLAN 14 ++#define IPQESS_TX_INS_SVLAN 15 ++#define IPQESS_TX_SVLAN_TAG_SHIFT 16 ++ ++/* Tx Queue Packet Statistic Register */ ++#define IPQESS_REG_TX_STAT_PKT_Q(x) (0x700 + ((x) << 3)) /* x = queue id */ ++ ++#define IPQESS_TX_STAT_PKT_MASK 0xFFFFFF ++ ++/* Tx Queue Byte Statistic Register */ ++#define IPQESS_REG_TX_STAT_BYTE_Q(x) (0x704 + ((x) << 3)) /* x = queue id */ ++ ++/* Load Balance Based Ring Offset Register */ ++#define IPQESS_REG_LB_RING 0x800 ++#define IPQESS_LB_RING_ENTRY_MASK 0xff ++#define IPQESS_LB_RING_ID_MASK 0x7 ++#define IPQESS_LB_RING_PROFILE_ID_MASK 0x3 ++#define IPQESS_LB_RING_ENTRY_BIT_OFFSET 8 ++#define IPQESS_LB_RING_ID_OFFSET 0 ++#define IPQESS_LB_RING_PROFILE_ID_OFFSET 3 ++#define IPQESS_LB_REG_VALUE 0x6040200 ++ ++/* Load Balance Priority Mapping Register */ ++#define IPQESS_REG_LB_PRI_START 0x804 ++#define IPQESS_REG_LB_PRI_END 0x810 ++#define IPQESS_LB_PRI_REG_INC 4 ++#define IPQESS_LB_PRI_ENTRY_BIT_OFFSET 4 ++#define IPQESS_LB_PRI_ENTRY_MASK 0xf ++ ++/* RSS Priority Mapping Register */ ++#define IPQESS_REG_RSS_PRI 0x820 ++#define IPQESS_RSS_PRI_ENTRY_MASK 0xf ++#define IPQESS_RSS_RING_ID_MASK 0x7 ++#define IPQESS_RSS_PRI_ENTRY_BIT_OFFSET 4 ++ ++/* RSS Indirection Register */ ++#define IPQESS_REG_RSS_IDT(x) (0x840 + ((x) << 2)) /* x = No. of indirection table */ ++#define IPQESS_NUM_IDT 16 ++#define IPQESS_RSS_IDT_VALUE 0x64206420 ++ ++/* Default RSS Ring Register */ ++#define IPQESS_REG_DEF_RSS 0x890 ++#define IPQESS_DEF_RSS_MASK 0x7 ++ ++/* RSS Hash Function Type Register */ ++#define IPQESS_REG_RSS_TYPE 0x894 ++#define IPQESS_RSS_TYPE_NONE 0x01 ++#define IPQESS_RSS_TYPE_IPV4TCP 0x02 ++#define IPQESS_RSS_TYPE_IPV6_TCP 0x04 ++#define IPQESS_RSS_TYPE_IPV4_UDP 0x08 ++#define IPQESS_RSS_TYPE_IPV6UDP 0x10 ++#define IPQESS_RSS_TYPE_IPV4 0x20 ++#define IPQESS_RSS_TYPE_IPV6 0x40 ++#define IPQESS_RSS_HASH_MODE_MASK 0x7f ++ ++#define IPQESS_REG_RSS_HASH_VALUE 0x8C0 ++ ++#define IPQESS_REG_RSS_TYPE_RESULT 0x8C4 ++ ++#define IPQESS_HASH_TYPE_START 0 ++#define IPQESS_HASH_TYPE_END 5 ++#define IPQESS_HASH_TYPE_SHIFT 12 ++ ++#define IPQESS_RFS_FLOW_ENTRIES 1024 ++#define IPQESS_RFS_FLOW_ENTRIES_MASK (IPQESS_RFS_FLOW_ENTRIES - 1) ++#define IPQESS_RFS_EXPIRE_COUNT_PER_CALL 128 ++ ++/* RFD Base Address Register */ ++#define IPQESS_REG_RFD_BASE_ADDR_Q(x) (0x950 + ((x) << 2)) /* x = queue id */ ++ ++/* RFD Index Register */ ++#define IPQESS_REG_RFD_IDX_Q(x) (0x9B0 + ((x) << 2)) /* x = queue id */ ++ ++#define IPQESS_RFD_PROD_IDX_BITS 0x00000FFF ++#define IPQESS_RFD_CONS_IDX_BITS 0x0FFF0000 ++#define IPQESS_RFD_PROD_IDX_MASK 0xFFF ++#define IPQESS_RFD_CONS_IDX_MASK 0xFFF ++#define IPQESS_RFD_PROD_IDX_SHIFT 0 ++#define IPQESS_RFD_CONS_IDX_SHIFT 16 ++ ++/* Rx Descriptor Control Register */ ++#define IPQESS_REG_RX_DESC0 0xA10 ++#define IPQESS_RFD_RING_SIZE_MASK 0xFFF ++#define IPQESS_RX_BUF_SIZE_MASK 0xFFFF ++#define IPQESS_RFD_RING_SIZE_SHIFT 0 ++#define IPQESS_RX_BUF_SIZE_SHIFT 16 ++ ++#define IPQESS_REG_RX_DESC1 0xA14 ++#define IPQESS_RXQ_RFD_BURST_NUM_MASK 0x3F ++#define IPQESS_RXQ_RFD_PF_THRESH_MASK 0x1F ++#define IPQESS_RXQ_RFD_LOW_THRESH_MASK 0xFFF ++#define IPQESS_RXQ_RFD_BURST_NUM_SHIFT 0 ++#define IPQESS_RXQ_RFD_PF_THRESH_SHIFT 8 ++#define IPQESS_RXQ_RFD_LOW_THRESH_SHIFT 16 ++ ++/* RXQ Control Register */ ++#define IPQESS_REG_RXQ_CTRL 0xA18 ++#define IPQESS_FIFO_THRESH_TYPE_SHIF 0 ++#define IPQESS_FIFO_THRESH_128_BYTE 0x0 ++#define IPQESS_FIFO_THRESH_64_BYTE 0x1 ++#define IPQESS_RXQ_CTRL_RMV_VLAN 0x00000002 ++#define IPQESS_RXQ_CTRL_EN_MASK GENMASK(15, 8) ++#define IPQESS_RXQ_CTRL_EN(__qid) BIT(8 + (__qid)) ++ ++/* AXI Burst Size Config */ ++#define IPQESS_REG_AXIW_CTRL_MAXWRSIZE 0xA1C ++#define IPQESS_AXIW_MAXWRSIZE_VALUE 0x0 ++ ++/* Rx Statistics Register */ ++#define IPQESS_REG_RX_STAT_BYTE_Q(x) (0xA30 + ((x) << 2)) /* x = queue id */ ++#define IPQESS_REG_RX_STAT_PKT_Q(x) (0xA50 + ((x) << 2)) /* x = queue id */ ++ ++/* WoL Pattern Length Register */ ++#define IPQESS_REG_WOL_PATTERN_LEN0 0xC00 ++#define IPQESS_WOL_PT_LEN_MASK 0xFF ++#define IPQESS_WOL_PT0_LEN_SHIFT 0 ++#define IPQESS_WOL_PT1_LEN_SHIFT 8 ++#define IPQESS_WOL_PT2_LEN_SHIFT 16 ++#define IPQESS_WOL_PT3_LEN_SHIFT 24 ++ ++#define IPQESS_REG_WOL_PATTERN_LEN1 0xC04 ++#define IPQESS_WOL_PT4_LEN_SHIFT 0 ++#define IPQESS_WOL_PT5_LEN_SHIFT 8 ++#define IPQESS_WOL_PT6_LEN_SHIFT 16 ++ ++/* WoL Control Register */ ++#define IPQESS_REG_WOL_CTRL 0xC08 ++#define IPQESS_WOL_WK_EN 0x00000001 ++#define IPQESS_WOL_MG_EN 0x00000002 ++#define IPQESS_WOL_PT0_EN 0x00000004 ++#define IPQESS_WOL_PT1_EN 0x00000008 ++#define IPQESS_WOL_PT2_EN 0x00000010 ++#define IPQESS_WOL_PT3_EN 0x00000020 ++#define IPQESS_WOL_PT4_EN 0x00000040 ++#define IPQESS_WOL_PT5_EN 0x00000080 ++#define IPQESS_WOL_PT6_EN 0x00000100 ++ ++/* MAC Control Register */ ++#define IPQESS_REG_MAC_CTRL0 0xC20 ++#define IPQESS_REG_MAC_CTRL1 0xC24 ++ ++/* WoL Pattern Register */ ++#define IPQESS_REG_WOL_PATTERN_START 0x5000 ++#define IPQESS_PATTERN_PART_REG_OFFSET 0x40 ++ ++/* TX descriptor fields */ ++#define IPQESS_TPD_HDR_SHIFT 0 ++#define IPQESS_TPD_PPPOE_EN 0x00000100 ++#define IPQESS_TPD_IP_CSUM_EN 0x00000200 ++#define IPQESS_TPD_TCP_CSUM_EN 0x0000400 ++#define IPQESS_TPD_UDP_CSUM_EN 0x00000800 ++#define IPQESS_TPD_CUSTOM_CSUM_EN 0x00000C00 ++#define IPQESS_TPD_LSO_EN 0x00001000 ++#define IPQESS_TPD_LSO_V2_EN 0x00002000 ++/* The VLAN_TAGGED bit is not used in the publicly available ++ * drivers. The definition has been stolen from the Atheros ++ * 'alx' driver (drivers/net/ethernet/atheros/alx/hw.h). It ++ * seems that it has the same meaning in regard to the EDMA ++ * hardware. ++ */ ++#define IPQESS_TPD_VLAN_TAGGED 0x00004000 ++#define IPQESS_TPD_IPV4_EN 0x00010000 ++#define IPQESS_TPD_MSS_MASK 0x1FFF ++#define IPQESS_TPD_MSS_SHIFT 18 ++#define IPQESS_TPD_CUSTOM_CSUM_SHIFT 18 ++ ++/* RRD descriptor fields */ ++#define IPQESS_RRD_NUM_RFD_MASK 0x000F ++#define IPQESS_RRD_PKT_SIZE_MASK 0x3FFF ++#define IPQESS_RRD_SRC_PORT_NUM_MASK 0x4000 ++#define IPQESS_RRD_SVLAN 0x8000 ++#define IPQESS_RRD_FLOW_COOKIE_MASK 0x07FF ++ ++#define IPQESS_RRD_PKT_SIZE_MASK 0x3FFF ++#define IPQESS_RRD_CSUM_FAIL_MASK 0xC000 ++#define IPQESS_RRD_CVLAN 0x0001 ++#define IPQESS_RRD_DESC_VALID 0x8000 ++ ++#define IPQESS_RRD_PRIORITY_SHIFT 4 ++#define IPQESS_RRD_PRIORITY_MASK 0x7 ++#define IPQESS_RRD_PORT_TYPE_SHIFT 7 ++#define IPQESS_RRD_PORT_TYPE_MASK 0x1F ++ ++#define IPQESS_RRD_PORT_ID_MASK 0x7000 ++ ++#endif +--- /dev/null ++++ b/drivers/net/ethernet/qualcomm/ipqess/ipqess_ethtool.c +@@ -0,0 +1,164 @@ ++// SPDX-License-Identifier: GPL-2.0 OR ISC ++/* Copyright (c) 2015 - 2016, The Linux Foundation. All rights reserved. ++ * Copyright (c) 2017 - 2018, John Crispin ++ * Copyright (c) 2021 - 2022, Maxime Chevallier ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include "ipqess.h" ++ ++struct ipqess_ethtool_stats { ++ u8 string[ETH_GSTRING_LEN]; ++ u32 offset; ++}; ++ ++#define IPQESS_STAT(m) offsetof(struct ipqess_statistics, m) ++#define DRVINFO_LEN 32 ++ ++static const struct ipqess_ethtool_stats ipqess_stats[] = { ++ {"tx_q0_pkt", IPQESS_STAT(tx_q0_pkt)}, ++ {"tx_q1_pkt", IPQESS_STAT(tx_q1_pkt)}, ++ {"tx_q2_pkt", IPQESS_STAT(tx_q2_pkt)}, ++ {"tx_q3_pkt", IPQESS_STAT(tx_q3_pkt)}, ++ {"tx_q4_pkt", IPQESS_STAT(tx_q4_pkt)}, ++ {"tx_q5_pkt", IPQESS_STAT(tx_q5_pkt)}, ++ {"tx_q6_pkt", IPQESS_STAT(tx_q6_pkt)}, ++ {"tx_q7_pkt", IPQESS_STAT(tx_q7_pkt)}, ++ {"tx_q8_pkt", IPQESS_STAT(tx_q8_pkt)}, ++ {"tx_q9_pkt", IPQESS_STAT(tx_q9_pkt)}, ++ {"tx_q10_pkt", IPQESS_STAT(tx_q10_pkt)}, ++ {"tx_q11_pkt", IPQESS_STAT(tx_q11_pkt)}, ++ {"tx_q12_pkt", IPQESS_STAT(tx_q12_pkt)}, ++ {"tx_q13_pkt", IPQESS_STAT(tx_q13_pkt)}, ++ {"tx_q14_pkt", IPQESS_STAT(tx_q14_pkt)}, ++ {"tx_q15_pkt", IPQESS_STAT(tx_q15_pkt)}, ++ {"tx_q0_byte", IPQESS_STAT(tx_q0_byte)}, ++ {"tx_q1_byte", IPQESS_STAT(tx_q1_byte)}, ++ {"tx_q2_byte", IPQESS_STAT(tx_q2_byte)}, ++ {"tx_q3_byte", IPQESS_STAT(tx_q3_byte)}, ++ {"tx_q4_byte", IPQESS_STAT(tx_q4_byte)}, ++ {"tx_q5_byte", IPQESS_STAT(tx_q5_byte)}, ++ {"tx_q6_byte", IPQESS_STAT(tx_q6_byte)}, ++ {"tx_q7_byte", IPQESS_STAT(tx_q7_byte)}, ++ {"tx_q8_byte", IPQESS_STAT(tx_q8_byte)}, ++ {"tx_q9_byte", IPQESS_STAT(tx_q9_byte)}, ++ {"tx_q10_byte", IPQESS_STAT(tx_q10_byte)}, ++ {"tx_q11_byte", IPQESS_STAT(tx_q11_byte)}, ++ {"tx_q12_byte", IPQESS_STAT(tx_q12_byte)}, ++ {"tx_q13_byte", IPQESS_STAT(tx_q13_byte)}, ++ {"tx_q14_byte", IPQESS_STAT(tx_q14_byte)}, ++ {"tx_q15_byte", IPQESS_STAT(tx_q15_byte)}, ++ {"rx_q0_pkt", IPQESS_STAT(rx_q0_pkt)}, ++ {"rx_q1_pkt", IPQESS_STAT(rx_q1_pkt)}, ++ {"rx_q2_pkt", IPQESS_STAT(rx_q2_pkt)}, ++ {"rx_q3_pkt", IPQESS_STAT(rx_q3_pkt)}, ++ {"rx_q4_pkt", IPQESS_STAT(rx_q4_pkt)}, ++ {"rx_q5_pkt", IPQESS_STAT(rx_q5_pkt)}, ++ {"rx_q6_pkt", IPQESS_STAT(rx_q6_pkt)}, ++ {"rx_q7_pkt", IPQESS_STAT(rx_q7_pkt)}, ++ {"rx_q0_byte", IPQESS_STAT(rx_q0_byte)}, ++ {"rx_q1_byte", IPQESS_STAT(rx_q1_byte)}, ++ {"rx_q2_byte", IPQESS_STAT(rx_q2_byte)}, ++ {"rx_q3_byte", IPQESS_STAT(rx_q3_byte)}, ++ {"rx_q4_byte", IPQESS_STAT(rx_q4_byte)}, ++ {"rx_q5_byte", IPQESS_STAT(rx_q5_byte)}, ++ {"rx_q6_byte", IPQESS_STAT(rx_q6_byte)}, ++ {"rx_q7_byte", IPQESS_STAT(rx_q7_byte)}, ++ {"tx_desc_error", IPQESS_STAT(tx_desc_error)}, ++}; ++ ++static int ipqess_get_strset_count(struct net_device *netdev, int sset) ++{ ++ switch (sset) { ++ case ETH_SS_STATS: ++ return ARRAY_SIZE(ipqess_stats); ++ default: ++ netdev_dbg(netdev, "%s: Unsupported string set", __func__); ++ return -EOPNOTSUPP; ++ } ++} ++ ++static void ipqess_get_strings(struct net_device *netdev, u32 stringset, ++ u8 *data) ++{ ++ u8 *p = data; ++ u32 i; ++ ++ switch (stringset) { ++ case ETH_SS_STATS: ++ for (i = 0; i < ARRAY_SIZE(ipqess_stats); i++) ++ ethtool_sprintf(&p, ipqess_stats[i].string); ++ break; ++ } ++} ++ ++static void ipqess_get_ethtool_stats(struct net_device *netdev, ++ struct ethtool_stats *stats, ++ uint64_t *data) ++{ ++ struct ipqess *ess = netdev_priv(netdev); ++ u32 *essstats = (u32 *)&ess->ipqess_stats; ++ int i; ++ ++ spin_lock(&ess->stats_lock); ++ ++ ipqess_update_hw_stats(ess); ++ ++ for (i = 0; i < ARRAY_SIZE(ipqess_stats); i++) ++ data[i] = *(u32 *)(essstats + (ipqess_stats[i].offset / sizeof(u32))); ++ ++ spin_unlock(&ess->stats_lock); ++} ++ ++static void ipqess_get_drvinfo(struct net_device *dev, ++ struct ethtool_drvinfo *info) ++{ ++ strscpy(info->driver, "qca_ipqess", DRVINFO_LEN); ++ strscpy(info->bus_info, "axi", ETHTOOL_BUSINFO_LEN); ++} ++ ++static int ipqess_get_link_ksettings(struct net_device *netdev, ++ struct ethtool_link_ksettings *cmd) ++{ ++ struct ipqess *ess = netdev_priv(netdev); ++ ++ return phylink_ethtool_ksettings_get(ess->phylink, cmd); ++} ++ ++static int ipqess_set_link_ksettings(struct net_device *netdev, ++ const struct ethtool_link_ksettings *cmd) ++{ ++ struct ipqess *ess = netdev_priv(netdev); ++ ++ return phylink_ethtool_ksettings_set(ess->phylink, cmd); ++} ++ ++static void ipqess_get_ringparam(struct net_device *netdev, ++ struct ethtool_ringparam *ring, ++ struct kernel_ethtool_ringparam *kernel_ering, ++ struct netlink_ext_ack *extack) ++{ ++ ring->tx_max_pending = IPQESS_TX_RING_SIZE; ++ ring->rx_max_pending = IPQESS_RX_RING_SIZE; ++} ++ ++static const struct ethtool_ops ipqesstool_ops = { ++ .get_drvinfo = &ipqess_get_drvinfo, ++ .get_link = ðtool_op_get_link, ++ .get_link_ksettings = &ipqess_get_link_ksettings, ++ .set_link_ksettings = &ipqess_set_link_ksettings, ++ .get_strings = &ipqess_get_strings, ++ .get_sset_count = &ipqess_get_strset_count, ++ .get_ethtool_stats = &ipqess_get_ethtool_stats, ++ .get_ringparam = ipqess_get_ringparam, ++}; ++ ++void ipqess_set_ethtool_ops(struct net_device *netdev) ++{ ++ netdev->ethtool_ops = &ipqesstool_ops; ++} diff --git a/target/linux/ipq40xx/patches-6.1/701-net-dsa-add-out-of-band-tagging-protocol.patch b/target/linux/ipq40xx/patches-6.1/701-net-dsa-add-out-of-band-tagging-protocol.patch new file mode 100644 index 00000000000000..8f296a6f7b701b --- /dev/null +++ b/target/linux/ipq40xx/patches-6.1/701-net-dsa-add-out-of-band-tagging-protocol.patch @@ -0,0 +1,238 @@ +From a32e16b3c2fc1954ad6e09737439f60e5890278e Mon Sep 17 00:00:00 2001 +From: Maxime Chevallier +Date: Fri, 4 Nov 2022 18:41:49 +0100 +Subject: [PATCH] net: dsa: add out-of-band tagging protocol + +This tagging protocol is designed for the situation where the link +between the MAC and the Switch is designed such that the Destination +Port, which is usually embedded in some part of the Ethernet Header, is +sent out-of-band, and isn't present at all in the Ethernet frame. + +This can happen when the MAC and Switch are tightly integrated on an +SoC, as is the case with the Qualcomm IPQ4019 for example, where the DSA +tag is inserted directly into the DMA descriptors. In that case, +the MAC driver is responsible for sending the tag to the switch using +the out-of-band medium. To do so, the MAC driver needs to have the +information of the destination port for that skb. + +Add a new tagging protocol based on SKB extensions to convey the +information about the destination port to the MAC driver + +Signed-off-by: Maxime Chevallier +--- + Documentation/networking/dsa/dsa.rst | 13 +++++++- + MAINTAINERS | 1 + + include/linux/dsa/oob.h | 16 +++++++++ + include/linux/skbuff.h | 3 ++ + include/net/dsa.h | 2 ++ + net/core/skbuff.c | 10 ++++++ + net/dsa/Kconfig | 9 +++++ + net/dsa/Makefile | 1 + + net/dsa/tag_oob.c | 49 ++++++++++++++++++++++++++++ + 9 files changed, 103 insertions(+), 1 deletion(-) + create mode 100644 include/linux/dsa/oob.h + create mode 100644 net/dsa/tag_oob.c + +--- a/Documentation/networking/dsa/dsa.rst ++++ b/Documentation/networking/dsa/dsa.rst +@@ -66,7 +66,8 @@ Switch tagging protocols + ------------------------ + + DSA supports many vendor-specific tagging protocols, one software-defined +-tagging protocol, and a tag-less mode as well (``DSA_TAG_PROTO_NONE``). ++tagging protocol, a tag-less mode as well (``DSA_TAG_PROTO_NONE``) and an ++out-of-band tagging protocol (``DSA_TAG_PROTO_OOB``). + + The exact format of the tag protocol is vendor specific, but in general, they + all contain something which: +@@ -217,6 +218,16 @@ receive all frames regardless of the val + setting the ``promisc_on_master`` property of the ``struct dsa_device_ops``. + Note that this assumes a DSA-unaware master driver, which is the norm. + ++Some SoCs have a tight integration between the conduit network interface and the ++embedded switch, such that the DSA tag isn't transmitted in the packet data, ++but through another media, using so-called out-of-band tagging. In that case, ++the host MAC driver is in charge of transmitting the tag to the switch. ++An example is the IPQ4019 SoC, that transmits the tag between the ipqess ++ethernet controller and the qca8k switch using the DMA descriptor. In that ++configuration, tag-chaining is permitted, but the OOB tag will always be the ++top-most switch in the tree. The tagger (``DSA_TAG_PROTO_OOB``) uses skb ++extensions to transmit the tag to and from the MAC driver. ++ + Master network devices + ---------------------- + +--- a/MAINTAINERS ++++ b/MAINTAINERS +@@ -17070,6 +17070,7 @@ L: netdev@vger.kernel.org + S: Maintained + F: Documentation/devicetree/bindings/net/qcom,ipq4019-ess-edma.yaml + F: drivers/net/ethernet/qualcomm/ipqess/ ++F: net/dsa/tag_oob.c + + QUALCOMM ETHQOS ETHERNET DRIVER + M: Vinod Koul +--- /dev/null ++++ b/include/linux/dsa/oob.h +@@ -0,0 +1,16 @@ ++/* SPDX-License-Identifier: GPL-2.0-only ++ * Copyright (C) 2022 Maxime Chevallier ++ */ ++ ++#ifndef _NET_DSA_OOB_H ++#define _NET_DSA_OOB_H ++ ++#include ++ ++struct dsa_oob_tag_info { ++ u16 port; ++}; ++ ++int dsa_oob_tag_push(struct sk_buff *skb, struct dsa_oob_tag_info *ti); ++int dsa_oob_tag_pop(struct sk_buff *skb, struct dsa_oob_tag_info *ti); ++#endif +--- a/include/linux/skbuff.h ++++ b/include/linux/skbuff.h +@@ -4588,6 +4588,9 @@ enum skb_ext_id { + #if IS_ENABLED(CONFIG_MCTP_FLOWS) + SKB_EXT_MCTP, + #endif ++#if IS_ENABLED(CONFIG_NET_DSA_TAG_OOB) ++ SKB_EXT_DSA_OOB, ++#endif + SKB_EXT_NUM, /* must be last */ + }; + +--- a/include/net/dsa.h ++++ b/include/net/dsa.h +@@ -55,6 +55,7 @@ struct phylink_link_state; + #define DSA_TAG_PROTO_RTL8_4T_VALUE 25 + #define DSA_TAG_PROTO_RZN1_A5PSW_VALUE 26 + #define DSA_TAG_PROTO_LAN937X_VALUE 27 ++#define DSA_TAG_PROTO_OOB_VALUE 28 + + enum dsa_tag_protocol { + DSA_TAG_PROTO_NONE = DSA_TAG_PROTO_NONE_VALUE, +@@ -85,6 +86,7 @@ enum dsa_tag_protocol { + DSA_TAG_PROTO_RTL8_4T = DSA_TAG_PROTO_RTL8_4T_VALUE, + DSA_TAG_PROTO_RZN1_A5PSW = DSA_TAG_PROTO_RZN1_A5PSW_VALUE, + DSA_TAG_PROTO_LAN937X = DSA_TAG_PROTO_LAN937X_VALUE, ++ DSA_TAG_PROTO_OOB = DSA_TAG_PROTO_OOB_VALUE, + }; + + struct dsa_switch; +--- a/net/core/skbuff.c ++++ b/net/core/skbuff.c +@@ -62,8 +62,12 @@ + #include + #include + #include ++#ifdef CONFIG_NET_DSA_TAG_OOB ++#include ++#endif + + #include ++#include + #include + #include + #include +@@ -4515,6 +4519,9 @@ static const u8 skb_ext_type_len[] = { + #if IS_ENABLED(CONFIG_MCTP_FLOWS) + [SKB_EXT_MCTP] = SKB_EXT_CHUNKSIZEOF(struct mctp_flow), + #endif ++#if IS_ENABLED(CONFIG_NET_DSA_TAG_OOB) ++ [SKB_EXT_DSA_OOB] = SKB_EXT_CHUNKSIZEOF(struct dsa_oob_tag_info), ++#endif + }; + + static __always_inline unsigned int skb_ext_total_length(void) +@@ -4535,6 +4542,9 @@ static __always_inline unsigned int skb_ + #if IS_ENABLED(CONFIG_MCTP_FLOWS) + skb_ext_type_len[SKB_EXT_MCTP] + + #endif ++#if IS_ENABLED(CONFIG_NET_DSA_TAG_OOB) ++ skb_ext_type_len[SKB_EXT_DSA_OOB] + ++#endif + 0; + } + +--- a/net/dsa/Kconfig ++++ b/net/dsa/Kconfig +@@ -113,6 +113,15 @@ config NET_DSA_TAG_OCELOT_8021Q + this mode, less TCAM resources (VCAP IS1, IS2, ES0) are available for + use with tc-flower. + ++config NET_DSA_TAG_OOB ++ select SKB_EXTENSIONS ++ tristate "Tag driver for Out-of-band tagging drivers" ++ help ++ Say Y or M if you want to enable support for pairs of embedded ++ switches and host MAC drivers which perform demultiplexing and ++ packet steering to ports using out of band metadata processed ++ by the DSA master, rather than tags present in the packets. ++ + config NET_DSA_TAG_QCA + tristate "Tag driver for Qualcomm Atheros QCA8K switches" + help +--- a/net/dsa/Makefile ++++ b/net/dsa/Makefile +@@ -22,6 +22,7 @@ obj-$(CONFIG_NET_DSA_TAG_LAN9303) += tag + obj-$(CONFIG_NET_DSA_TAG_MTK) += tag_mtk.o + obj-$(CONFIG_NET_DSA_TAG_OCELOT) += tag_ocelot.o + obj-$(CONFIG_NET_DSA_TAG_OCELOT_8021Q) += tag_ocelot_8021q.o ++obj-$(CONFIG_NET_DSA_TAG_OOB) += tag_oob.o + obj-$(CONFIG_NET_DSA_TAG_QCA) += tag_qca.o + obj-$(CONFIG_NET_DSA_TAG_RTL4_A) += tag_rtl4_a.o + obj-$(CONFIG_NET_DSA_TAG_RTL8_4) += tag_rtl8_4.o +--- /dev/null ++++ b/net/dsa/tag_oob.c +@@ -0,0 +1,49 @@ ++// SPDX-License-Identifier: GPL-2.0-only ++ ++/* Copyright (c) 2022, Maxime Chevallier */ ++ ++#include ++#include ++#include ++ ++#include "dsa_priv.h" ++ ++static struct sk_buff *oob_tag_xmit(struct sk_buff *skb, ++ struct net_device *dev) ++{ ++ struct dsa_oob_tag_info *tag_info = skb_ext_add(skb, SKB_EXT_DSA_OOB); ++ struct dsa_port *dp = dsa_slave_to_port(dev); ++ ++ tag_info->port = dp->index; ++ ++ return skb; ++} ++ ++static struct sk_buff *oob_tag_rcv(struct sk_buff *skb, ++ struct net_device *dev) ++{ ++ struct dsa_oob_tag_info *tag_info = skb_ext_find(skb, SKB_EXT_DSA_OOB); ++ ++ if (!tag_info) ++ return NULL; ++ ++ skb->dev = dsa_master_find_slave(dev, 0, tag_info->port); ++ if (!skb->dev) ++ return NULL; ++ ++ return skb; ++} ++ ++static const struct dsa_device_ops oob_tag_dsa_ops = { ++ .name = "oob", ++ .proto = DSA_TAG_PROTO_OOB, ++ .xmit = oob_tag_xmit, ++ .rcv = oob_tag_rcv, ++}; ++ ++MODULE_LICENSE("GPL"); ++MODULE_DESCRIPTION("DSA tag driver for out-of-band tagging"); ++MODULE_AUTHOR("Maxime Chevallier "); ++MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_OOB); ++ ++module_dsa_tag_driver(oob_tag_dsa_ops); diff --git a/target/linux/ipq40xx/patches-6.1/702-net-ipqess-Add-out-of-band-DSA-tagging-support.patch b/target/linux/ipq40xx/patches-6.1/702-net-ipqess-Add-out-of-band-DSA-tagging-support.patch new file mode 100644 index 00000000000000..ac0718ba2c4a27 --- /dev/null +++ b/target/linux/ipq40xx/patches-6.1/702-net-ipqess-Add-out-of-band-DSA-tagging-support.patch @@ -0,0 +1,173 @@ +From 4975e2b3f1d37bba04f262784cef0d5b7e0a30a4 Mon Sep 17 00:00:00 2001 +From: Maxime Chevallier +Date: Fri, 4 Nov 2022 18:41:50 +0100 +Subject: [PATCH] net: ipqess: Add out-of-band DSA tagging support + +On the IPQ4019, there's an 5 ports switch connected to the CPU through +the IPQESS Ethernet controller. The way the DSA tag is sent-out to that +switch is through the DMA descriptor, due to how tightly it is +integrated with the switch. + +We use the out-of-band tagging protocol by getting the source +port from the descriptor, push it into the skb extensions, and have the +tagger pull it to infer the destination netdev. The reverse process is +done on the TX side, where the driver pulls the tag from the skb and +builds the descriptor accordingly. + +Signed-off-by: Maxime Chevallier +--- + drivers/net/ethernet/qualcomm/Kconfig | 1 + + drivers/net/ethernet/qualcomm/ipqess/ipqess.c | 64 ++++++++++++++++++- + drivers/net/ethernet/qualcomm/ipqess/ipqess.h | 4 ++ + 3 files changed, 68 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/qualcomm/Kconfig ++++ b/drivers/net/ethernet/qualcomm/Kconfig +@@ -64,6 +64,7 @@ config QCOM_IPQ4019_ESS_EDMA + tristate "Qualcomm Atheros IPQ4019 ESS EDMA support" + depends on (OF && ARCH_QCOM) || COMPILE_TEST + select PHYLINK ++ select NET_DSA_TAG_OOB + help + This driver supports the Qualcomm Atheros IPQ40xx built-in + ESS EDMA ethernet controller. +--- a/drivers/net/ethernet/qualcomm/ipqess/ipqess.c ++++ b/drivers/net/ethernet/qualcomm/ipqess/ipqess.c +@@ -9,6 +9,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -22,6 +23,7 @@ + #include + #include + #include ++#include + #include + + #include "ipqess.h" +@@ -327,6 +329,7 @@ static int ipqess_rx_poll(struct ipqess_ + tail &= IPQESS_RFD_CONS_IDX_MASK; + + while (done < budget) { ++ struct dsa_oob_tag_info *tag_info; + struct ipqess_rx_desc *rd; + struct sk_buff *skb; + +@@ -406,6 +409,12 @@ static int ipqess_rx_poll(struct ipqess_ + __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021AD), + le16_to_cpu(rd->rrd4)); + ++ if (likely(rx_ring->ess->dsa_ports)) { ++ tag_info = skb_ext_add(skb, SKB_EXT_DSA_OOB); ++ tag_info->port = FIELD_GET(IPQESS_RRD_PORT_ID_MASK, ++ le16_to_cpu(rd->rrd1)); ++ } ++ + napi_gro_receive(&rx_ring->napi_rx, skb); + + rx_ring->ess->stats.rx_packets++; +@@ -706,6 +715,23 @@ static void ipqess_rollback_tx(struct ip + tx_ring->head = start_index; + } + ++static void ipqess_process_dsa_tag_sh(struct ipqess *ess, struct sk_buff *skb, ++ u32 *word3) ++{ ++ struct dsa_oob_tag_info *tag_info; ++ ++ if (unlikely(!ess->dsa_ports)) ++ return; ++ ++ tag_info = skb_ext_find(skb, SKB_EXT_DSA_OOB); ++ if (!tag_info) ++ return; ++ ++ *word3 |= tag_info->port << IPQESS_TPD_PORT_BITMAP_SHIFT; ++ *word3 |= BIT(IPQESS_TPD_FROM_CPU_SHIFT); ++ *word3 |= 0x3e << IPQESS_TPD_PORT_BITMAP_SHIFT; ++} ++ + static int ipqess_tx_map_and_fill(struct ipqess_tx_ring *tx_ring, + struct sk_buff *skb) + { +@@ -716,6 +742,8 @@ static int ipqess_tx_map_and_fill(struct + u16 len; + int i; + ++ ipqess_process_dsa_tag_sh(tx_ring->ess, skb, &word3); ++ + if (skb_is_gso(skb)) { + if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV4) { + lso_word1 |= IPQESS_TPD_IPV4_EN; +@@ -917,6 +945,33 @@ static const struct net_device_ops ipqes + .ndo_tx_timeout = ipqess_tx_timeout, + }; + ++static int ipqess_netdevice_event(struct notifier_block *nb, ++ unsigned long event, void *ptr) ++{ ++ struct ipqess *ess = container_of(nb, struct ipqess, netdev_notifier); ++ struct net_device *dev = netdev_notifier_info_to_dev(ptr); ++ struct netdev_notifier_changeupper_info *info; ++ ++ if (dev != ess->netdev) ++ return NOTIFY_DONE; ++ ++ switch (event) { ++ case NETDEV_CHANGEUPPER: ++ info = ptr; ++ ++ if (!dsa_slave_dev_check(info->upper_dev)) ++ return NOTIFY_DONE; ++ ++ if (info->linking) ++ ess->dsa_ports++; ++ else ++ ess->dsa_ports--; ++ ++ return NOTIFY_DONE; ++ } ++ return NOTIFY_OK; ++} ++ + static void ipqess_hw_stop(struct ipqess *ess) + { + int i; +@@ -1184,12 +1239,19 @@ static int ipqess_axi_probe(struct platf + netif_napi_add(netdev, &ess->rx_ring[i].napi_rx, ipqess_rx_napi); + } + +- err = register_netdev(netdev); ++ ess->netdev_notifier.notifier_call = ipqess_netdevice_event; ++ err = register_netdevice_notifier(&ess->netdev_notifier); + if (err) + goto err_hw_stop; + ++ err = register_netdev(netdev); ++ if (err) ++ goto err_notifier_unregister; ++ + return 0; + ++err_notifier_unregister: ++ unregister_netdevice_notifier(&ess->netdev_notifier); + err_hw_stop: + ipqess_hw_stop(ess); + +--- a/drivers/net/ethernet/qualcomm/ipqess/ipqess.h ++++ b/drivers/net/ethernet/qualcomm/ipqess/ipqess.h +@@ -171,6 +171,10 @@ struct ipqess { + struct platform_device *pdev; + struct phylink *phylink; + struct phylink_config phylink_config; ++ ++ struct notifier_block netdev_notifier; ++ int dsa_ports; ++ + struct ipqess_tx_ring tx_ring[IPQESS_NETDEV_QUEUES]; + + struct ipqess_statistics ipqess_stats; diff --git a/target/linux/ipq40xx/patches-6.1/703-net-qualcomm-ipqess-release-IRQ-s-on-network-device-.patch b/target/linux/ipq40xx/patches-6.1/703-net-qualcomm-ipqess-release-IRQ-s-on-network-device-.patch new file mode 100644 index 00000000000000..bd890e5c71c03e --- /dev/null +++ b/target/linux/ipq40xx/patches-6.1/703-net-qualcomm-ipqess-release-IRQ-s-on-network-device-.patch @@ -0,0 +1,75 @@ +From 5f15f7f170c76220dfd36cb9037d7848d1fc4aaf Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Tue, 15 Aug 2023 14:30:50 +0200 +Subject: [PATCH] net: qualcomm: ipqess: release IRQ-s on network device stop + +Currently, IPQESS driver is obtaining the IRQ-s during ndo_open, but they +are never freed as they are device managed. + +However, it is not enough for them to be released when device is removed +as the same network device can be stopped and started multiple times which +on the second start would lead to IRQ request to fail with -EBUSY as they +have already been requested before and are not of the shared type with: +[ 34.480769] ipqess-edma c080000.ethernet eth0: Link is Down +[ 34.488070] ipqess-edma c080000.ethernet eth0: ipqess_open +[ 34.488131] genirq: Flags mismatch irq 37. 00000001 (c080000.ethernet:txq0) vs. 00000001 (c080000.ethernet:txq0) +[ 34.494527] ipqess-edma c080000.ethernet eth0: ipqess_open +[ 34.502892] genirq: Flags mismatch irq 37. 00000001 (c080000.ethernet:txq0) vs. 00000001 (c080000.ethernet:txq0) +[ 34.508137] qca8k-ipq4019 c000000.switch lan1: failed to open master eth0 +[ 34.518966] br-lan: port 1(lan1) entered blocking state +[ 34.525165] br-lan: port 1(lan1) entered disabled state +[ 34.530633] device lan1 entered promiscuous mode +[ 34.548598] ipqess-edma c080000.ethernet eth0: ipqess_open +[ 34.548660] genirq: Flags mismatch irq 37. 00000001 (c080000.ethernet:txq0) vs. 00000001 (c080000.ethernet:txq0) +[ 34.553111] qca8k-ipq4019 c000000.switch lan2: failed to open master eth0 +[ 34.563841] br-lan: port 2(lan2) entered blocking state +[ 34.570083] br-lan: port 2(lan2) entered disabled state +[ 34.575530] device lan2 entered promiscuous mode +[ 34.587067] ipqess-edma c080000.ethernet eth0: ipqess_open +[ 34.587132] genirq: Flags mismatch irq 37. 00000001 (c080000.ethernet:txq0) vs. 00000001 (c080000.ethernet:txq0) +[ 34.591579] qca8k-ipq4019 c000000.switch lan3: failed to open master eth0 +[ 34.602451] br-lan: port 3(lan3) entered blocking state +[ 34.608496] br-lan: port 3(lan3) entered disabled state +[ 34.614084] device lan3 entered promiscuous mode +[ 34.626405] ipqess-edma c080000.ethernet eth0: ipqess_open +[ 34.626468] genirq: Flags mismatch irq 37. 00000001 (c080000.ethernet:txq0) vs. 00000001 (c080000.ethernet:txq0) +[ 34.630871] qca8k-ipq4019 c000000.switch lan4: failed to open master eth0 +[ 34.641689] br-lan: port 4(lan4) entered blocking state +[ 34.647834] br-lan: port 4(lan4) entered disabled state +[ 34.653455] device lan4 entered promiscuous mode +[ 34.667282] ipqess-edma c080000.ethernet eth0: ipqess_open +[ 34.667364] genirq: Flags mismatch irq 37. 00000001 (c080000.ethernet:txq0) vs. 00000001 (c080000.ethernet:txq0) +[ 34.671830] qca8k-ipq4019 c000000.switch wan: failed to open master eth0 + +So, lets free the IRQ-s on ndo_stop after stopping NAPI and HW IRQ-s. + +Signed-off-by: Robert Marko +--- + drivers/net/ethernet/qualcomm/ipqess/ipqess.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +--- a/drivers/net/ethernet/qualcomm/ipqess/ipqess.c ++++ b/drivers/net/ethernet/qualcomm/ipqess/ipqess.c +@@ -636,9 +636,22 @@ static int ipqess_stop(struct net_device + netif_tx_stop_all_queues(netdev); + phylink_stop(ess->phylink); + ipqess_irq_disable(ess); ++ + for (i = 0; i < IPQESS_NETDEV_QUEUES; i++) { ++ int qid; ++ + napi_disable(&ess->tx_ring[i].napi_tx); + napi_disable(&ess->rx_ring[i].napi_rx); ++ ++ qid = ess->tx_ring[i].idx; ++ devm_free_irq(&netdev->dev, ++ ess->tx_irq[qid], ++ &ess->tx_ring[i]); ++ ++ qid = ess->rx_ring[i].idx; ++ devm_free_irq(&netdev->dev, ++ ess->rx_irq[qid], ++ &ess->rx_ring[i]); + } + + return 0; diff --git a/target/linux/ipq40xx/patches-6.1/704-net-qualcomm-ipqess-enable-threaded-NAPI-by-default.patch b/target/linux/ipq40xx/patches-6.1/704-net-qualcomm-ipqess-enable-threaded-NAPI-by-default.patch new file mode 100644 index 00000000000000..cd586772846904 --- /dev/null +++ b/target/linux/ipq40xx/patches-6.1/704-net-qualcomm-ipqess-enable-threaded-NAPI-by-default.patch @@ -0,0 +1,49 @@ +From 9fa4a57a65e270e4d579cace4de5c438f46c7d12 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Tue, 15 Aug 2023 14:38:44 +0200 +Subject: [PATCH] net: qualcomm: ipqess: enable threaded NAPI by default + +Threaded NAPI provides a nice performance boost, so lets enable it by +default. + +We do however need to move the __napi_schedule() after HW IRQ has been +cleared in order to avoid concurency issues. + +Signed-off-by: Robert Marko +--- + drivers/net/ethernet/qualcomm/ipqess/ipqess.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/qualcomm/ipqess/ipqess.c ++++ b/drivers/net/ethernet/qualcomm/ipqess/ipqess.c +@@ -530,9 +530,9 @@ static irqreturn_t ipqess_interrupt_tx(i + struct ipqess_tx_ring *tx_ring = (struct ipqess_tx_ring *)priv; + + if (likely(napi_schedule_prep(&tx_ring->napi_tx))) { +- __napi_schedule(&tx_ring->napi_tx); + ipqess_w32(tx_ring->ess, IPQESS_REG_TX_INT_MASK_Q(tx_ring->idx), + 0x0); ++ __napi_schedule(&tx_ring->napi_tx); + } + + return IRQ_HANDLED; +@@ -543,9 +543,9 @@ static irqreturn_t ipqess_interrupt_rx(i + struct ipqess_rx_ring *rx_ring = (struct ipqess_rx_ring *)priv; + + if (likely(napi_schedule_prep(&rx_ring->napi_rx))) { +- __napi_schedule(&rx_ring->napi_rx); + ipqess_w32(rx_ring->ess, IPQESS_REG_RX_INT_MASK_Q(rx_ring->idx), + 0x0); ++ __napi_schedule(&rx_ring->napi_rx); + } + + return IRQ_HANDLED; +@@ -1261,6 +1261,8 @@ static int ipqess_axi_probe(struct platf + if (err) + goto err_notifier_unregister; + ++ dev_set_threaded(netdev, true); ++ + return 0; + + err_notifier_unregister: diff --git a/target/linux/ipq40xx/patches-5.15/703-arm-dts-ipq4019-add-ethernet-controller-DT-node.patch b/target/linux/ipq40xx/patches-6.1/705-ARM-dts-qcom-ipq4019-Add-description-for-the-IPQESS-.patch similarity index 71% rename from target/linux/ipq40xx/patches-5.15/703-arm-dts-ipq4019-add-ethernet-controller-DT-node.patch rename to target/linux/ipq40xx/patches-6.1/705-ARM-dts-qcom-ipq4019-Add-description-for-the-IPQESS-.patch index 68fb4eb4ceeb84..27bdebdb93bf1c 100644 --- a/target/linux/ipq40xx/patches-5.15/703-arm-dts-ipq4019-add-ethernet-controller-DT-node.patch +++ b/target/linux/ipq40xx/patches-6.1/705-ARM-dts-qcom-ipq4019-Add-description-for-the-IPQESS-.patch @@ -1,27 +1,27 @@ -From 44327d7098d4f32c24ec8c528e5aff6e030956bc Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Wed, 20 Oct 2021 13:21:45 +0200 -Subject: [PATCH] arm: dts: ipq4019: add ethernet controller DT node +From 5b71dbb867680887d47954ce1cc145cb747cbce6 Mon Sep 17 00:00:00 2001 +From: Maxime Chevallier +Date: Fri, 4 Nov 2022 18:41:51 +0100 +Subject: [PATCH] ARM: dts: qcom: ipq4019: Add description for the IPQESS + Ethernet controller -Since IPQ40xx SoC built-in ethernet controller now has a driver, -add its DT node so it can be used. +The Qualcomm IPQ4019 includes an internal 5 ports switch, which is +connected to the CPU through the internal IPQESS Ethernet controller. -Signed-off-by: Robert Marko +Add support for this internal interface, which is internally connected to a +modified version of the QCA8K Ethernet switch. + +This Ethernet controller only support a specific internal interface mode +for connection to the switch. + +Signed-off-by: Maxime Chevallier +Reviewed-by: Krzysztof Kozlowski --- arch/arm/boot/dts/qcom-ipq4019.dtsi | 48 +++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -38,6 +38,7 @@ - spi1 = &blsp1_spi2; - i2c0 = &blsp1_i2c3; - i2c1 = &blsp1_i2c4; -+ ethernet0 = &gmac; - }; - - cpus { -@@ -589,6 +590,57 @@ +@@ -594,6 +594,54 @@ status = "disabled"; }; @@ -29,9 +29,9 @@ Signed-off-by: Robert Marko + compatible = "qcom,ipq4019-ess-edma"; + reg = <0xc080000 0x8000>; + resets = <&gcc ESS_RESET>; -+ reset-names = "ess_rst"; ++ reset-names = "ess"; + clocks = <&gcc GCC_ESS_CLK>; -+ clock-names = "ess_clk"; ++ clock-names = "ess"; + interrupts = , + , + , @@ -64,15 +64,12 @@ Signed-off-by: Robert Marko + , + , + ; -+ -+ status = "disabled"; -+ + phy-mode = "internal"; ++ status = "disabled"; + fixed-link { + speed = <1000>; + full-duplex; + pause; -+ asym-pause; + }; + }; + diff --git a/target/linux/ipq40xx/patches-6.1/706-net-dsa-qca8k-add-IPQ4019-built-in-switch-support.patch b/target/linux/ipq40xx/patches-6.1/706-net-dsa-qca8k-add-IPQ4019-built-in-switch-support.patch new file mode 100644 index 00000000000000..8bacb2c71099f7 --- /dev/null +++ b/target/linux/ipq40xx/patches-6.1/706-net-dsa-qca8k-add-IPQ4019-built-in-switch-support.patch @@ -0,0 +1,1132 @@ +From a38126870488398932e017dd9d76174b4aadbbbb Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Sat, 10 Sep 2022 15:46:09 +0200 +Subject: [PATCH] net: dsa: qca8k: add IPQ4019 built-in switch support + +Qualcomm IPQ40xx SoC-s have a variant of QCA8337N switch built-in. + +It shares most of the stuff with its external counterpart, however it is +modified for the SoC. +Namely, it doesn't have second CPU port (Port 6), so it has 6 ports +instead of 7. +It also has no built-in PHY-s but rather requires external PSGMII based +companion PHY-s (QCA8072 and QCA8075) for which it first needs to carry +out calibration before using them. +PSGMII has a SoC built-in PHY that is used to connect to the PHY-s which +unfortunately requires some magic values as the datasheet doesnt document +the bits that are being set or the register at all. + +Since its built-in it is MMIO like other peripherals and doesn't have its +own MDIO bus but depends on the SoC provided one. + +CPU connection is at Port 0 and it uses some kind of a internal connection +and no traditional RGMII/SGMII. + +It also doesn't use in-band tagging like other qca8k switches so a out of +band based tagger is used. + +Signed-off-by: Robert Marko +--- + drivers/net/dsa/qca/Kconfig | 8 + + drivers/net/dsa/qca/Makefile | 1 + + drivers/net/dsa/qca/qca8k-common.c | 6 +- + drivers/net/dsa/qca/qca8k-ipq4019.c | 948 ++++++++++++++++++++++++++++ + drivers/net/dsa/qca/qca8k.h | 56 ++ + 5 files changed, 1016 insertions(+), 3 deletions(-) + create mode 100644 drivers/net/dsa/qca/qca8k-ipq4019.c + +--- a/drivers/net/dsa/qca/Kconfig ++++ b/drivers/net/dsa/qca/Kconfig +@@ -23,3 +23,11 @@ config NET_DSA_QCA8K_LEDS_SUPPORT + help + This enabled support for LEDs present on the Qualcomm Atheros + QCA8K Ethernet switch chips. ++ ++config NET_DSA_QCA8K_IPQ4019 ++ tristate "Qualcomm Atheros IPQ4019 Ethernet switch support" ++ select NET_DSA_TAG_OOB ++ select REGMAP_MMIO ++ help ++ This enables support for the switch built-into Qualcomm Atheros ++ IPQ4019 SoCs. +--- a/drivers/net/dsa/qca/Makefile ++++ b/drivers/net/dsa/qca/Makefile +@@ -5,3 +5,4 @@ qca8k-y += qca8k-common.o qca8k-8xxx. + ifdef CONFIG_NET_DSA_QCA8K_LEDS_SUPPORT + qca8k-y += qca8k-leds.o + endif ++obj-$(CONFIG_NET_DSA_QCA8K_IPQ4019) += qca8k-ipq4019.o qca8k-common.o +--- a/drivers/net/dsa/qca/qca8k-common.c ++++ b/drivers/net/dsa/qca/qca8k-common.c +@@ -449,7 +449,7 @@ static int qca8k_vlan_del(struct qca8k_p + + /* Check if we're the last member to be removed */ + del = true; +- for (i = 0; i < QCA8K_NUM_PORTS; i++) { ++ for (i = 0; i < priv->ds->num_ports; i++) { + mask = QCA8K_VTU_FUNC0_EG_MODE_PORT_NOT(i); + + if ((reg & mask) != mask) { +@@ -642,7 +642,7 @@ int qca8k_port_bridge_join(struct dsa_sw + cpu_port = dsa_to_port(ds, port)->cpu_dp->index; + port_mask = BIT(cpu_port); + +- for (i = 0; i < QCA8K_NUM_PORTS; i++) { ++ for (i = 0; i < ds->num_ports; i++) { + if (dsa_is_cpu_port(ds, i)) + continue; + if (!dsa_port_offloads_bridge(dsa_to_port(ds, i), &bridge)) +@@ -674,7 +674,7 @@ void qca8k_port_bridge_leave(struct dsa_ + + cpu_port = dsa_to_port(ds, port)->cpu_dp->index; + +- for (i = 0; i < QCA8K_NUM_PORTS; i++) { ++ for (i = 0; i < ds->num_ports; i++) { + if (dsa_is_cpu_port(ds, i)) + continue; + if (!dsa_port_offloads_bridge(dsa_to_port(ds, i), &bridge)) +--- /dev/null ++++ b/drivers/net/dsa/qca/qca8k-ipq4019.c +@@ -0,0 +1,948 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * Copyright (C) 2009 Felix Fietkau ++ * Copyright (C) 2011-2012, 2020-2021 Gabor Juhos ++ * Copyright (c) 2015, 2019, The Linux Foundation. All rights reserved. ++ * Copyright (c) 2016 John Crispin ++ * Copyright (c) 2022 Robert Marko ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "qca8k.h" ++ ++static struct regmap_config qca8k_ipq4019_regmap_config = { ++ .reg_bits = 32, ++ .val_bits = 32, ++ .reg_stride = 4, ++ .max_register = 0x16ac, /* end MIB - Port6 range */ ++ .rd_table = &qca8k_readable_table, ++}; ++ ++static struct regmap_config qca8k_ipq4019_psgmii_phy_regmap_config = { ++ .name = "psgmii-phy", ++ .reg_bits = 32, ++ .val_bits = 32, ++ .reg_stride = 4, ++ .max_register = 0x7fc, ++}; ++ ++static enum dsa_tag_protocol ++qca8k_ipq4019_get_tag_protocol(struct dsa_switch *ds, int port, ++ enum dsa_tag_protocol mp) ++{ ++ return DSA_TAG_PROTO_OOB; ++} ++ ++static struct phylink_pcs * ++qca8k_ipq4019_phylink_mac_select_pcs(struct dsa_switch *ds, int port, ++ phy_interface_t interface) ++{ ++ struct qca8k_priv *priv = ds->priv; ++ struct phylink_pcs *pcs = NULL; ++ ++ switch (interface) { ++ case PHY_INTERFACE_MODE_PSGMII: ++ switch (port) { ++ case 0: ++ pcs = &priv->pcs_port_0.pcs; ++ break; ++ } ++ break; ++ default: ++ break; ++ } ++ ++ return pcs; ++} ++ ++static int qca8k_ipq4019_pcs_config(struct phylink_pcs *pcs, unsigned int mode, ++ phy_interface_t interface, ++ const unsigned long *advertising, ++ bool permit_pause_to_mac) ++{ ++ return 0; ++} ++ ++static void qca8k_ipq4019_pcs_an_restart(struct phylink_pcs *pcs) ++{ ++} ++ ++static struct qca8k_pcs *pcs_to_qca8k_pcs(struct phylink_pcs *pcs) ++{ ++ return container_of(pcs, struct qca8k_pcs, pcs); ++} ++ ++static void qca8k_ipq4019_pcs_get_state(struct phylink_pcs *pcs, ++ struct phylink_link_state *state) ++{ ++ struct qca8k_priv *priv = pcs_to_qca8k_pcs(pcs)->priv; ++ int port = pcs_to_qca8k_pcs(pcs)->port; ++ u32 reg; ++ int ret; ++ ++ ret = qca8k_read(priv, QCA8K_REG_PORT_STATUS(port), ®); ++ if (ret < 0) { ++ state->link = false; ++ return; ++ } ++ ++ state->link = !!(reg & QCA8K_PORT_STATUS_LINK_UP); ++ state->an_complete = state->link; ++ state->duplex = (reg & QCA8K_PORT_STATUS_DUPLEX) ? DUPLEX_FULL : ++ DUPLEX_HALF; ++ ++ switch (reg & QCA8K_PORT_STATUS_SPEED) { ++ case QCA8K_PORT_STATUS_SPEED_10: ++ state->speed = SPEED_10; ++ break; ++ case QCA8K_PORT_STATUS_SPEED_100: ++ state->speed = SPEED_100; ++ break; ++ case QCA8K_PORT_STATUS_SPEED_1000: ++ state->speed = SPEED_1000; ++ break; ++ default: ++ state->speed = SPEED_UNKNOWN; ++ break; ++ } ++ ++ if (reg & QCA8K_PORT_STATUS_RXFLOW) ++ state->pause |= MLO_PAUSE_RX; ++ if (reg & QCA8K_PORT_STATUS_TXFLOW) ++ state->pause |= MLO_PAUSE_TX; ++} ++ ++static const struct phylink_pcs_ops qca8k_pcs_ops = { ++ .pcs_get_state = qca8k_ipq4019_pcs_get_state, ++ .pcs_config = qca8k_ipq4019_pcs_config, ++ .pcs_an_restart = qca8k_ipq4019_pcs_an_restart, ++}; ++ ++static void qca8k_ipq4019_setup_pcs(struct qca8k_priv *priv, ++ struct qca8k_pcs *qpcs, ++ int port) ++{ ++ qpcs->pcs.ops = &qca8k_pcs_ops; ++ ++ /* We don't have interrupts for link changes, so we need to poll */ ++ qpcs->pcs.poll = true; ++ qpcs->priv = priv; ++ qpcs->port = port; ++} ++ ++static void qca8k_ipq4019_phylink_get_caps(struct dsa_switch *ds, int port, ++ struct phylink_config *config) ++{ ++ switch (port) { ++ case 0: /* CPU port */ ++ __set_bit(PHY_INTERFACE_MODE_INTERNAL, ++ config->supported_interfaces); ++ break; ++ ++ case 1: ++ case 2: ++ case 3: ++ __set_bit(PHY_INTERFACE_MODE_PSGMII, ++ config->supported_interfaces); ++ break; ++ case 4: ++ case 5: ++ phy_interface_set_rgmii(config->supported_interfaces); ++ __set_bit(PHY_INTERFACE_MODE_PSGMII, ++ config->supported_interfaces); ++ break; ++ } ++ ++ config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE | ++ MAC_10 | MAC_100 | MAC_1000FD; ++ ++ config->legacy_pre_march2020 = false; ++} ++ ++static void ++qca8k_phylink_ipq4019_mac_link_down(struct dsa_switch *ds, int port, ++ unsigned int mode, ++ phy_interface_t interface) ++{ ++ struct qca8k_priv *priv = ds->priv; ++ ++ qca8k_port_set_status(priv, port, 0); ++} ++ ++static void ++qca8k_phylink_ipq4019_mac_link_up(struct dsa_switch *ds, int port, ++ unsigned int mode, phy_interface_t interface, ++ struct phy_device *phydev, int speed, ++ int duplex, bool tx_pause, bool rx_pause) ++{ ++ struct qca8k_priv *priv = ds->priv; ++ u32 reg; ++ ++ if (phylink_autoneg_inband(mode)) { ++ reg = QCA8K_PORT_STATUS_LINK_AUTO; ++ } else { ++ switch (speed) { ++ case SPEED_10: ++ reg = QCA8K_PORT_STATUS_SPEED_10; ++ break; ++ case SPEED_100: ++ reg = QCA8K_PORT_STATUS_SPEED_100; ++ break; ++ case SPEED_1000: ++ reg = QCA8K_PORT_STATUS_SPEED_1000; ++ break; ++ default: ++ reg = QCA8K_PORT_STATUS_LINK_AUTO; ++ break; ++ } ++ ++ if (duplex == DUPLEX_FULL) ++ reg |= QCA8K_PORT_STATUS_DUPLEX; ++ ++ if (rx_pause || dsa_is_cpu_port(ds, port)) ++ reg |= QCA8K_PORT_STATUS_RXFLOW; ++ ++ if (tx_pause || dsa_is_cpu_port(ds, port)) ++ reg |= QCA8K_PORT_STATUS_TXFLOW; ++ } ++ ++ reg |= QCA8K_PORT_STATUS_TXMAC | QCA8K_PORT_STATUS_RXMAC; ++ ++ qca8k_write(priv, QCA8K_REG_PORT_STATUS(port), reg); ++} ++ ++static int psgmii_vco_calibrate(struct qca8k_priv *priv) ++{ ++ int val, ret; ++ ++ if (!priv->psgmii_ethphy) { ++ dev_err(priv->dev, "PSGMII eth PHY missing, calibration failed!\n"); ++ return -ENODEV; ++ } ++ ++ /* Fix PSGMII RX 20bit */ ++ ret = phy_write(priv->psgmii_ethphy, MII_BMCR, 0x5b); ++ /* Reset PHY PSGMII */ ++ ret = phy_write(priv->psgmii_ethphy, MII_BMCR, 0x1b); ++ /* Release PHY PSGMII reset */ ++ ret = phy_write(priv->psgmii_ethphy, MII_BMCR, 0x5b); ++ ++ /* Poll for VCO PLL calibration finish - Malibu(QCA8075) */ ++ ret = phy_read_mmd_poll_timeout(priv->psgmii_ethphy, ++ MDIO_MMD_PMAPMD, ++ 0x28, val, ++ (val & BIT(0)), ++ 10000, 1000000, ++ false); ++ if (ret) { ++ dev_err(priv->dev, "QCA807x PSGMII VCO calibration PLL not ready\n"); ++ return ret; ++ } ++ mdelay(50); ++ ++ /* Freeze PSGMII RX CDR */ ++ ret = phy_write(priv->psgmii_ethphy, MII_RESV2, 0x2230); ++ ++ /* Start PSGMIIPHY VCO PLL calibration */ ++ ret = regmap_set_bits(priv->psgmii, ++ PSGMIIPHY_VCO_CALIBRATION_CONTROL_REGISTER_1, ++ PSGMIIPHY_REG_PLL_VCO_CALIB_RESTART); ++ ++ /* Poll for PSGMIIPHY PLL calibration finish - Dakota(IPQ40xx) */ ++ ret = regmap_read_poll_timeout(priv->psgmii, ++ PSGMIIPHY_VCO_CALIBRATION_CONTROL_REGISTER_2, ++ val, val & PSGMIIPHY_REG_PLL_VCO_CALIB_READY, ++ 10000, 1000000); ++ if (ret) { ++ dev_err(priv->dev, "IPQ PSGMIIPHY VCO calibration PLL not ready\n"); ++ return ret; ++ } ++ mdelay(50); ++ ++ /* Release PSGMII RX CDR */ ++ ret = phy_write(priv->psgmii_ethphy, MII_RESV2, 0x3230); ++ /* Release PSGMII RX 20bit */ ++ ret = phy_write(priv->psgmii_ethphy, MII_BMCR, 0x5f); ++ mdelay(200); ++ ++ return ret; ++} ++ ++static void ++qca8k_switch_port_loopback_on_off(struct qca8k_priv *priv, int port, int on) ++{ ++ u32 val = QCA8K_PORT_LOOKUP_LOOPBACK_EN; ++ ++ if (on == 0) ++ val = 0; ++ ++ qca8k_rmw(priv, QCA8K_PORT_LOOKUP_CTRL(port), ++ QCA8K_PORT_LOOKUP_LOOPBACK_EN, val); ++} ++ ++static int ++qca8k_wait_for_phy_link_state(struct phy_device *phy, int need_status) ++{ ++ int a; ++ u16 status; ++ ++ for (a = 0; a < 100; a++) { ++ status = phy_read(phy, MII_QCA8075_SSTATUS); ++ status &= QCA8075_PHY_SPEC_STATUS_LINK; ++ status = !!status; ++ if (status == need_status) ++ return 0; ++ mdelay(8); ++ } ++ ++ return -1; ++} ++ ++static void ++qca8k_phy_loopback_on_off(struct qca8k_priv *priv, struct phy_device *phy, ++ int sw_port, int on) ++{ ++ if (on) { ++ phy_write(phy, MII_BMCR, BMCR_ANENABLE | BMCR_RESET); ++ phy_modify(phy, MII_BMCR, BMCR_PDOWN, BMCR_PDOWN); ++ qca8k_wait_for_phy_link_state(phy, 0); ++ qca8k_write(priv, QCA8K_REG_PORT_STATUS(sw_port), 0); ++ phy_write(phy, MII_BMCR, ++ BMCR_SPEED1000 | ++ BMCR_FULLDPLX | ++ BMCR_LOOPBACK); ++ qca8k_wait_for_phy_link_state(phy, 1); ++ qca8k_write(priv, QCA8K_REG_PORT_STATUS(sw_port), ++ QCA8K_PORT_STATUS_SPEED_1000 | ++ QCA8K_PORT_STATUS_TXMAC | ++ QCA8K_PORT_STATUS_RXMAC | ++ QCA8K_PORT_STATUS_DUPLEX); ++ qca8k_rmw(priv, QCA8K_PORT_LOOKUP_CTRL(sw_port), ++ QCA8K_PORT_LOOKUP_STATE_FORWARD, ++ QCA8K_PORT_LOOKUP_STATE_FORWARD); ++ } else { /* off */ ++ qca8k_write(priv, QCA8K_REG_PORT_STATUS(sw_port), 0); ++ qca8k_rmw(priv, QCA8K_PORT_LOOKUP_CTRL(sw_port), ++ QCA8K_PORT_LOOKUP_STATE_DISABLED, ++ QCA8K_PORT_LOOKUP_STATE_DISABLED); ++ phy_write(phy, MII_BMCR, BMCR_SPEED1000 | BMCR_ANENABLE | BMCR_RESET); ++ /* turn off the power of the phys - so that unused ++ ports do not raise links */ ++ phy_modify(phy, MII_BMCR, BMCR_PDOWN, BMCR_PDOWN); ++ } ++} ++ ++static void ++qca8k_phy_pkt_gen_prep(struct qca8k_priv *priv, struct phy_device *phy, ++ int pkts_num, int on) ++{ ++ if (on) { ++ /* enable CRC checker and packets counters */ ++ phy_write_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_CRC_AND_PKTS_COUNT, 0); ++ phy_write_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_CRC_AND_PKTS_COUNT, ++ QCA8075_MMD7_CNT_FRAME_CHK_EN | QCA8075_MMD7_CNT_SELFCLR); ++ qca8k_wait_for_phy_link_state(phy, 1); ++ /* packet number */ ++ phy_write_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_PKT_GEN_PKT_NUMB, pkts_num); ++ /* pkt size - 1504 bytes + 20 bytes */ ++ phy_write_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_PKT_GEN_PKT_SIZE, 1504); ++ } else { /* off */ ++ /* packet number */ ++ phy_write_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_PKT_GEN_PKT_NUMB, 0); ++ /* disable CRC checker and packet counter */ ++ phy_write_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_CRC_AND_PKTS_COUNT, 0); ++ /* disable traffic gen */ ++ phy_write_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_PKT_GEN_CTRL, 0); ++ } ++} ++ ++static void ++qca8k_wait_for_phy_pkt_gen_fin(struct qca8k_priv *priv, struct phy_device *phy) ++{ ++ int val; ++ /* wait for all traffic end: 4096(pkt num)*1524(size)*8ns(125MHz)=49938us */ ++ phy_read_mmd_poll_timeout(phy, MDIO_MMD_AN, QCA8075_MMD7_PKT_GEN_CTRL, ++ val, !(val & QCA8075_MMD7_PKT_GEN_INPROGR), ++ 50000, 1000000, true); ++} ++ ++static void ++qca8k_start_phy_pkt_gen(struct phy_device *phy) ++{ ++ /* start traffic gen */ ++ phy_write_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_PKT_GEN_CTRL, ++ QCA8075_MMD7_PKT_GEN_START | QCA8075_MMD7_PKT_GEN_INPROGR); ++} ++ ++static int ++qca8k_start_all_phys_pkt_gens(struct qca8k_priv *priv) ++{ ++ struct phy_device *phy; ++ phy = phy_device_create(priv->bus, QCA8075_MDIO_BRDCST_PHY_ADDR, ++ 0, 0, NULL); ++ if (!phy) { ++ dev_err(priv->dev, "unable to create mdio broadcast PHY(0x%x)\n", ++ QCA8075_MDIO_BRDCST_PHY_ADDR); ++ return -ENODEV; ++ } ++ ++ qca8k_start_phy_pkt_gen(phy); ++ ++ phy_device_free(phy); ++ return 0; ++} ++ ++static int ++qca8k_get_phy_pkt_gen_test_result(struct phy_device *phy, int pkts_num) ++{ ++ u32 tx_ok, tx_error; ++ u32 rx_ok, rx_error; ++ u32 tx_ok_high16; ++ u32 rx_ok_high16; ++ u32 tx_all_ok, rx_all_ok; ++ ++ /* check counters */ ++ tx_ok = phy_read_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_EG_FRAME_RECV_CNT_LO); ++ tx_ok_high16 = phy_read_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_EG_FRAME_RECV_CNT_HI); ++ tx_error = phy_read_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_EG_FRAME_ERR_CNT); ++ rx_ok = phy_read_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_IG_FRAME_RECV_CNT_LO); ++ rx_ok_high16 = phy_read_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_IG_FRAME_RECV_CNT_HI); ++ rx_error = phy_read_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_IG_FRAME_ERR_CNT); ++ tx_all_ok = tx_ok + (tx_ok_high16 << 16); ++ rx_all_ok = rx_ok + (rx_ok_high16 << 16); ++ ++ if (tx_all_ok < pkts_num) ++ return -1; ++ if(rx_all_ok < pkts_num) ++ return -2; ++ if(tx_error) ++ return -3; ++ if(rx_error) ++ return -4; ++ return 0; /* test is ok */ ++} ++ ++static ++void qca8k_phy_broadcast_write_on_off(struct qca8k_priv *priv, ++ struct phy_device *phy, int on) ++{ ++ u32 val; ++ ++ val = phy_read_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_MDIO_BRDCST_WRITE); ++ ++ if (on == 0) ++ val &= ~QCA8075_MMD7_MDIO_BRDCST_WRITE_EN; ++ else ++ val |= QCA8075_MMD7_MDIO_BRDCST_WRITE_EN; ++ ++ phy_write_mmd(phy, MDIO_MMD_AN, QCA8075_MMD7_MDIO_BRDCST_WRITE, val); ++} ++ ++static int ++qca8k_test_dsa_port_for_errors(struct qca8k_priv *priv, struct phy_device *phy, ++ int port, int test_phase) ++{ ++ int res = 0; ++ const int test_pkts_num = QCA8075_PKT_GEN_PKTS_COUNT; ++ ++ if (test_phase == 1) { /* start test preps */ ++ qca8k_phy_loopback_on_off(priv, phy, port, 1); ++ qca8k_switch_port_loopback_on_off(priv, port, 1); ++ qca8k_phy_broadcast_write_on_off(priv, phy, 1); ++ qca8k_phy_pkt_gen_prep(priv, phy, test_pkts_num, 1); ++ } else if (test_phase == 2) { ++ /* wait for test results, collect it and cleanup */ ++ qca8k_wait_for_phy_pkt_gen_fin(priv, phy); ++ res = qca8k_get_phy_pkt_gen_test_result(phy, test_pkts_num); ++ qca8k_phy_pkt_gen_prep(priv, phy, test_pkts_num, 0); ++ qca8k_phy_broadcast_write_on_off(priv, phy, 0); ++ qca8k_switch_port_loopback_on_off(priv, port, 0); ++ qca8k_phy_loopback_on_off(priv, phy, port, 0); ++ } ++ ++ return res; ++} ++ ++static int ++qca8k_do_dsa_sw_ports_self_test(struct qca8k_priv *priv, int parallel_test) ++{ ++ struct device_node *dn = priv->dev->of_node; ++ struct device_node *ports, *port; ++ struct device_node *phy_dn; ++ struct phy_device *phy; ++ int reg, err = 0, test_phase; ++ u32 tests_result = 0; ++ ++ ports = of_get_child_by_name(dn, "ports"); ++ if (!ports) { ++ dev_err(priv->dev, "no ports child node found\n"); ++ return -EINVAL; ++ } ++ ++ for (test_phase = 1; test_phase <= 2; test_phase++) { ++ if (parallel_test && test_phase == 2) { ++ err = qca8k_start_all_phys_pkt_gens(priv); ++ if (err) ++ goto error; ++ } ++ for_each_available_child_of_node(ports, port) { ++ err = of_property_read_u32(port, "reg", ®); ++ if (err) ++ goto error; ++ if (reg >= QCA8K_NUM_PORTS) { ++ err = -EINVAL; ++ goto error; ++ } ++ phy_dn = of_parse_phandle(port, "phy-handle", 0); ++ if (phy_dn) { ++ phy = of_phy_find_device(phy_dn); ++ of_node_put(phy_dn); ++ if (phy) { ++ int result; ++ result = qca8k_test_dsa_port_for_errors(priv, ++ phy, reg, test_phase); ++ if (!parallel_test && test_phase == 1) ++ qca8k_start_phy_pkt_gen(phy); ++ put_device(&phy->mdio.dev); ++ if (test_phase == 2) { ++ tests_result <<= 1; ++ if (result) ++ tests_result |= 1; ++ } ++ } ++ } ++ } ++ } ++ ++end: ++ of_node_put(ports); ++ qca8k_fdb_flush(priv); ++ return tests_result; ++error: ++ tests_result |= 0xf000; ++ goto end; ++} ++ ++static int ++psgmii_vco_calibrate_and_test(struct dsa_switch *ds) ++{ ++ int ret, a, test_result; ++ struct qca8k_priv *priv = ds->priv; ++ ++ for (a = 0; a <= QCA8K_PSGMII_CALB_NUM; a++) { ++ ret = psgmii_vco_calibrate(priv); ++ if (ret) ++ return ret; ++ /* first we run serial test */ ++ test_result = qca8k_do_dsa_sw_ports_self_test(priv, 0); ++ /* and if it is ok then we run the test in parallel */ ++ if (!test_result) ++ test_result = qca8k_do_dsa_sw_ports_self_test(priv, 1); ++ if (!test_result) { ++ if (a > 0) { ++ dev_warn(priv->dev, "PSGMII work was stabilized after %d " ++ "calibration retries !\n", a); ++ } ++ return 0; ++ } else { ++ schedule(); ++ if (a > 0 && a % 10 == 0) { ++ dev_err(priv->dev, "PSGMII work is unstable !!! " ++ "Let's try to wait a bit ... %d\n", a); ++ set_current_state(TASK_INTERRUPTIBLE); ++ schedule_timeout(msecs_to_jiffies(a * 100)); ++ } ++ } ++ } ++ ++ panic("PSGMII work is unstable !!! " ++ "Repeated recalibration attempts did not help(0x%x) !\n", ++ test_result); ++ ++ return -EFAULT; ++} ++ ++static int ++ipq4019_psgmii_configure(struct dsa_switch *ds) ++{ ++ struct qca8k_priv *priv = ds->priv; ++ int ret; ++ ++ if (!priv->psgmii_calibrated) { ++ dev_info(ds->dev, "PSGMII calibration!\n"); ++ ret = psgmii_vco_calibrate_and_test(ds); ++ ++ ret = regmap_clear_bits(priv->psgmii, PSGMIIPHY_MODE_CONTROL, ++ PSGMIIPHY_MODE_ATHR_CSCO_MODE_25M); ++ ret = regmap_write(priv->psgmii, PSGMIIPHY_TX_CONTROL, ++ PSGMIIPHY_TX_CONTROL_MAGIC_VALUE); ++ ++ priv->psgmii_calibrated = true; ++ ++ return ret; ++ } ++ ++ return 0; ++} ++ ++static void ++qca8k_phylink_ipq4019_mac_config(struct dsa_switch *ds, int port, ++ unsigned int mode, ++ const struct phylink_link_state *state) ++{ ++ struct qca8k_priv *priv = ds->priv; ++ ++ switch (port) { ++ case 0: ++ /* CPU port, no configuration needed */ ++ return; ++ case 1: ++ case 2: ++ case 3: ++ if (state->interface == PHY_INTERFACE_MODE_PSGMII) ++ if (ipq4019_psgmii_configure(ds)) ++ dev_err(ds->dev, "PSGMII configuration failed!\n"); ++ return; ++ case 4: ++ case 5: ++ if (state->interface == PHY_INTERFACE_MODE_RGMII || ++ state->interface == PHY_INTERFACE_MODE_RGMII_ID || ++ state->interface == PHY_INTERFACE_MODE_RGMII_RXID || ++ state->interface == PHY_INTERFACE_MODE_RGMII_TXID) { ++ regmap_set_bits(priv->regmap, ++ QCA8K_IPQ4019_REG_RGMII_CTRL, ++ QCA8K_IPQ4019_RGMII_CTRL_CLK); ++ } ++ ++ if (state->interface == PHY_INTERFACE_MODE_PSGMII) ++ if (ipq4019_psgmii_configure(ds)) ++ dev_err(ds->dev, "PSGMII configuration failed!\n"); ++ return; ++ default: ++ dev_err(ds->dev, "%s: unsupported port: %i\n", __func__, port); ++ return; ++ } ++} ++ ++static int ++qca8k_ipq4019_setup_port(struct dsa_switch *ds, int port) ++{ ++ struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv; ++ int ret; ++ ++ /* CPU port gets connected to all user ports of the switch */ ++ if (dsa_is_cpu_port(ds, port)) { ++ ret = qca8k_rmw(priv, QCA8K_PORT_LOOKUP_CTRL(port), ++ QCA8K_PORT_LOOKUP_MEMBER, dsa_user_ports(ds)); ++ if (ret) ++ return ret; ++ ++ /* Disable CPU ARP Auto-learning by default */ ++ ret = regmap_clear_bits(priv->regmap, ++ QCA8K_PORT_LOOKUP_CTRL(port), ++ QCA8K_PORT_LOOKUP_LEARN); ++ if (ret) ++ return ret; ++ } ++ ++ /* Individual user ports get connected to CPU port only */ ++ if (dsa_is_user_port(ds, port)) { ++ ret = qca8k_rmw(priv, QCA8K_PORT_LOOKUP_CTRL(port), ++ QCA8K_PORT_LOOKUP_MEMBER, ++ BIT(QCA8K_IPQ4019_CPU_PORT)); ++ if (ret) ++ return ret; ++ ++ /* Enable ARP Auto-learning by default */ ++ ret = regmap_set_bits(priv->regmap, QCA8K_PORT_LOOKUP_CTRL(port), ++ QCA8K_PORT_LOOKUP_LEARN); ++ if (ret) ++ return ret; ++ ++ /* For port based vlans to work we need to set the ++ * default egress vid ++ */ ++ ret = qca8k_rmw(priv, QCA8K_EGRESS_VLAN(port), ++ QCA8K_EGREES_VLAN_PORT_MASK(port), ++ QCA8K_EGREES_VLAN_PORT(port, QCA8K_PORT_VID_DEF)); ++ if (ret) ++ return ret; ++ ++ ret = qca8k_write(priv, QCA8K_REG_PORT_VLAN_CTRL0(port), ++ QCA8K_PORT_VLAN_CVID(QCA8K_PORT_VID_DEF) | ++ QCA8K_PORT_VLAN_SVID(QCA8K_PORT_VID_DEF)); ++ if (ret) ++ return ret; ++ } ++ ++ return 0; ++} ++ ++static int ++qca8k_ipq4019_setup(struct dsa_switch *ds) ++{ ++ struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv; ++ int ret, i; ++ ++ /* Make sure that port 0 is the cpu port */ ++ if (!dsa_is_cpu_port(ds, QCA8K_IPQ4019_CPU_PORT)) { ++ dev_err(priv->dev, "port %d is not the CPU port", ++ QCA8K_IPQ4019_CPU_PORT); ++ return -EINVAL; ++ } ++ ++ qca8k_ipq4019_setup_pcs(priv, &priv->pcs_port_0, 0); ++ ++ /* Enable CPU Port */ ++ ret = regmap_set_bits(priv->regmap, QCA8K_REG_GLOBAL_FW_CTRL0, ++ QCA8K_GLOBAL_FW_CTRL0_CPU_PORT_EN); ++ if (ret) { ++ dev_err(priv->dev, "failed enabling CPU port"); ++ return ret; ++ } ++ ++ /* Enable MIB counters */ ++ ret = qca8k_mib_init(priv); ++ if (ret) ++ dev_warn(priv->dev, "MIB init failed"); ++ ++ /* Disable forwarding by default on all ports */ ++ for (i = 0; i < QCA8K_IPQ4019_NUM_PORTS; i++) { ++ ret = qca8k_rmw(priv, QCA8K_PORT_LOOKUP_CTRL(i), ++ QCA8K_PORT_LOOKUP_MEMBER, 0); ++ if (ret) ++ return ret; ++ } ++ ++ /* Enable QCA header mode on the CPU port */ ++ ret = qca8k_write(priv, QCA8K_REG_PORT_HDR_CTRL(QCA8K_IPQ4019_CPU_PORT), ++ FIELD_PREP(QCA8K_PORT_HDR_CTRL_TX_MASK, QCA8K_PORT_HDR_CTRL_ALL) | ++ FIELD_PREP(QCA8K_PORT_HDR_CTRL_RX_MASK, QCA8K_PORT_HDR_CTRL_ALL)); ++ if (ret) { ++ dev_err(priv->dev, "failed enabling QCA header mode"); ++ return ret; ++ } ++ ++ /* Disable MAC by default on all ports */ ++ for (i = 0; i < QCA8K_IPQ4019_NUM_PORTS; i++) { ++ if (dsa_is_user_port(ds, i)) ++ qca8k_port_set_status(priv, i, 0); ++ } ++ ++ /* Forward all unknown frames to CPU port for Linux processing */ ++ ret = qca8k_write(priv, QCA8K_REG_GLOBAL_FW_CTRL1, ++ FIELD_PREP(QCA8K_GLOBAL_FW_CTRL1_IGMP_DP_MASK, BIT(QCA8K_IPQ4019_CPU_PORT)) | ++ FIELD_PREP(QCA8K_GLOBAL_FW_CTRL1_BC_DP_MASK, BIT(QCA8K_IPQ4019_CPU_PORT)) | ++ FIELD_PREP(QCA8K_GLOBAL_FW_CTRL1_MC_DP_MASK, BIT(QCA8K_IPQ4019_CPU_PORT)) | ++ FIELD_PREP(QCA8K_GLOBAL_FW_CTRL1_UC_DP_MASK, BIT(QCA8K_IPQ4019_CPU_PORT))); ++ if (ret) ++ return ret; ++ ++ /* Setup connection between CPU port & user ports */ ++ for (i = 0; i < QCA8K_IPQ4019_NUM_PORTS; i++) { ++ ret = qca8k_ipq4019_setup_port(ds, i); ++ if (ret) ++ return ret; ++ } ++ ++ /* Setup our port MTUs to match power on defaults */ ++ ret = qca8k_write(priv, QCA8K_MAX_FRAME_SIZE, ETH_FRAME_LEN + ETH_FCS_LEN); ++ if (ret) ++ dev_warn(priv->dev, "failed setting MTU settings"); ++ ++ /* Flush the FDB table */ ++ qca8k_fdb_flush(priv); ++ ++ /* Set min a max ageing value supported */ ++ ds->ageing_time_min = 7000; ++ ds->ageing_time_max = 458745000; ++ ++ /* Set max number of LAGs supported */ ++ ds->num_lag_ids = QCA8K_NUM_LAGS; ++ ++ /* CPU port HW learning doesnt work correctly, so let DSA handle it */ ++ ds->assisted_learning_on_cpu_port = true; ++ ++ return 0; ++} ++ ++static const struct dsa_switch_ops qca8k_ipq4019_switch_ops = { ++ .get_tag_protocol = qca8k_ipq4019_get_tag_protocol, ++ .setup = qca8k_ipq4019_setup, ++ .get_strings = qca8k_get_strings, ++ .get_ethtool_stats = qca8k_get_ethtool_stats, ++ .get_sset_count = qca8k_get_sset_count, ++ .set_ageing_time = qca8k_set_ageing_time, ++ .get_mac_eee = qca8k_get_mac_eee, ++ .set_mac_eee = qca8k_set_mac_eee, ++ .port_enable = qca8k_port_enable, ++ .port_disable = qca8k_port_disable, ++ .port_change_mtu = qca8k_port_change_mtu, ++ .port_max_mtu = qca8k_port_max_mtu, ++ .port_stp_state_set = qca8k_port_stp_state_set, ++ .port_bridge_join = qca8k_port_bridge_join, ++ .port_bridge_leave = qca8k_port_bridge_leave, ++ .port_fast_age = qca8k_port_fast_age, ++ .port_fdb_add = qca8k_port_fdb_add, ++ .port_fdb_del = qca8k_port_fdb_del, ++ .port_fdb_dump = qca8k_port_fdb_dump, ++ .port_mdb_add = qca8k_port_mdb_add, ++ .port_mdb_del = qca8k_port_mdb_del, ++ .port_mirror_add = qca8k_port_mirror_add, ++ .port_mirror_del = qca8k_port_mirror_del, ++ .port_vlan_filtering = qca8k_port_vlan_filtering, ++ .port_vlan_add = qca8k_port_vlan_add, ++ .port_vlan_del = qca8k_port_vlan_del, ++ .phylink_mac_select_pcs = qca8k_ipq4019_phylink_mac_select_pcs, ++ .phylink_get_caps = qca8k_ipq4019_phylink_get_caps, ++ .phylink_mac_config = qca8k_phylink_ipq4019_mac_config, ++ .phylink_mac_link_down = qca8k_phylink_ipq4019_mac_link_down, ++ .phylink_mac_link_up = qca8k_phylink_ipq4019_mac_link_up, ++ .port_lag_join = qca8k_port_lag_join, ++ .port_lag_leave = qca8k_port_lag_leave, ++}; ++ ++static const struct qca8k_match_data ipq4019 = { ++ .id = QCA8K_ID_IPQ4019, ++ .mib_count = QCA8K_QCA833X_MIB_COUNT, ++}; ++ ++static int ++qca8k_ipq4019_probe(struct platform_device *pdev) ++{ ++ struct device *dev = &pdev->dev; ++ struct qca8k_priv *priv; ++ void __iomem *base, *psgmii; ++ struct device_node *np = dev->of_node, *mdio_np, *psgmii_ethphy_np; ++ int ret; ++ ++ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); ++ if (!priv) ++ return -ENOMEM; ++ ++ priv->dev = dev; ++ priv->info = &ipq4019; ++ ++ /* Start by setting up the register mapping */ ++ base = devm_platform_ioremap_resource_byname(pdev, "base"); ++ if (IS_ERR(base)) ++ return PTR_ERR(base); ++ ++ priv->regmap = devm_regmap_init_mmio(dev, base, ++ &qca8k_ipq4019_regmap_config); ++ if (IS_ERR(priv->regmap)) { ++ ret = PTR_ERR(priv->regmap); ++ dev_err(dev, "base regmap initialization failed, %d\n", ret); ++ return ret; ++ } ++ ++ psgmii = devm_platform_ioremap_resource_byname(pdev, "psgmii_phy"); ++ if (IS_ERR(psgmii)) ++ return PTR_ERR(psgmii); ++ ++ priv->psgmii = devm_regmap_init_mmio(dev, psgmii, ++ &qca8k_ipq4019_psgmii_phy_regmap_config); ++ if (IS_ERR(priv->psgmii)) { ++ ret = PTR_ERR(priv->psgmii); ++ dev_err(dev, "PSGMII regmap initialization failed, %d\n", ret); ++ return ret; ++ } ++ ++ mdio_np = of_parse_phandle(np, "mdio", 0); ++ if (!mdio_np) { ++ dev_err(dev, "unable to get MDIO bus phandle\n"); ++ of_node_put(mdio_np); ++ return -EINVAL; ++ } ++ ++ priv->bus = of_mdio_find_bus(mdio_np); ++ of_node_put(mdio_np); ++ if (!priv->bus) { ++ dev_err(dev, "unable to find MDIO bus\n"); ++ return -EPROBE_DEFER; ++ } ++ ++ psgmii_ethphy_np = of_parse_phandle(np, "psgmii-ethphy", 0); ++ if (!psgmii_ethphy_np) { ++ dev_dbg(dev, "unable to get PSGMII eth PHY phandle\n"); ++ of_node_put(psgmii_ethphy_np); ++ } ++ ++ if (psgmii_ethphy_np) { ++ priv->psgmii_ethphy = of_phy_find_device(psgmii_ethphy_np); ++ of_node_put(psgmii_ethphy_np); ++ if (!priv->psgmii_ethphy) { ++ dev_err(dev, "unable to get PSGMII eth PHY\n"); ++ return -ENODEV; ++ } ++ } ++ ++ /* Check the detected switch id */ ++ ret = qca8k_read_switch_id(priv); ++ if (ret) ++ return ret; ++ ++ priv->ds = devm_kzalloc(dev, sizeof(*priv->ds), GFP_KERNEL); ++ if (!priv->ds) ++ return -ENOMEM; ++ ++ priv->ds->dev = dev; ++ priv->ds->num_ports = QCA8K_IPQ4019_NUM_PORTS; ++ priv->ds->priv = priv; ++ priv->ds->ops = &qca8k_ipq4019_switch_ops; ++ mutex_init(&priv->reg_mutex); ++ platform_set_drvdata(pdev, priv); ++ ++ return dsa_register_switch(priv->ds); ++} ++ ++static int ++qca8k_ipq4019_remove(struct platform_device *pdev) ++{ ++ struct qca8k_priv *priv = dev_get_drvdata(&pdev->dev); ++ int i; ++ ++ if (!priv) ++ return 0; ++ ++ for (i = 0; i < QCA8K_IPQ4019_NUM_PORTS; i++) ++ qca8k_port_set_status(priv, i, 0); ++ ++ dsa_unregister_switch(priv->ds); ++ ++ platform_set_drvdata(pdev, NULL); ++ ++ return 0; ++} ++ ++static const struct of_device_id qca8k_ipq4019_of_match[] = { ++ { .compatible = "qca,ipq4019-qca8337n", }, ++ { /* sentinel */ }, ++}; ++ ++static struct platform_driver qca8k_ipq4019_driver = { ++ .probe = qca8k_ipq4019_probe, ++ .remove = qca8k_ipq4019_remove, ++ .driver = { ++ .name = "qca8k-ipq4019", ++ .of_match_table = qca8k_ipq4019_of_match, ++ }, ++}; ++ ++module_platform_driver(qca8k_ipq4019_driver); ++ ++MODULE_AUTHOR("Mathieu Olivari, John Crispin "); ++MODULE_AUTHOR("Gabor Juhos , Robert Marko "); ++MODULE_DESCRIPTION("Qualcomm IPQ4019 built-in switch driver"); ++MODULE_LICENSE("GPL"); +--- a/drivers/net/dsa/qca/qca8k.h ++++ b/drivers/net/dsa/qca/qca8k.h +@@ -19,7 +19,10 @@ + #define QCA8K_ETHERNET_TIMEOUT 5 + + #define QCA8K_NUM_PORTS 7 ++#define QCA8K_IPQ4019_NUM_PORTS 6 + #define QCA8K_NUM_CPU_PORTS 2 ++#define QCA8K_IPQ4019_NUM_CPU_PORTS 1 ++#define QCA8K_IPQ4019_CPU_PORT 0 + #define QCA8K_MAX_MTU 9000 + #define QCA8K_NUM_LAGS 4 + #define QCA8K_NUM_PORTS_FOR_LAG 4 +@@ -28,6 +31,7 @@ + #define QCA8K_ID_QCA8327 0x12 + #define PHY_ID_QCA8337 0x004dd036 + #define QCA8K_ID_QCA8337 0x13 ++#define QCA8K_ID_IPQ4019 0x14 + + #define QCA8K_QCA832X_MIB_COUNT 39 + #define QCA8K_QCA833X_MIB_COUNT 41 +@@ -263,6 +267,7 @@ + #define QCA8K_PORT_LOOKUP_STATE_LEARNING QCA8K_PORT_LOOKUP_STATE(0x3) + #define QCA8K_PORT_LOOKUP_STATE_FORWARD QCA8K_PORT_LOOKUP_STATE(0x4) + #define QCA8K_PORT_LOOKUP_LEARN BIT(20) ++#define QCA8K_PORT_LOOKUP_LOOPBACK_EN BIT(21) + #define QCA8K_PORT_LOOKUP_ING_MIRROR_EN BIT(25) + + #define QCA8K_REG_GOL_TRUNK_CTRL0 0x700 +@@ -339,6 +344,53 @@ + #define MII_ATH_MMD_ADDR 0x0d + #define MII_ATH_MMD_DATA 0x0e + ++/* IPQ4019 PSGMII PHY registers */ ++#define QCA8K_IPQ4019_REG_RGMII_CTRL 0x004 ++#define QCA8K_IPQ4019_RGMII_CTRL_RGMII_RXC GENMASK(1, 0) ++#define QCA8K_IPQ4019_RGMII_CTRL_RGMII_TXC GENMASK(9, 8) ++/* Some kind of CLK selection ++ * 0: gcc_ess_dly2ns ++ * 1: gcc_ess_clk ++ */ ++#define QCA8K_IPQ4019_RGMII_CTRL_CLK BIT(10) ++#define QCA8K_IPQ4019_RGMII_CTRL_DELAY_RMII0 GENMASK(17, 16) ++#define QCA8K_IPQ4019_RGMII_CTRL_INVERT_RMII0_REF_CLK BIT(18) ++#define QCA8K_IPQ4019_RGMII_CTRL_DELAY_RMII1 GENMASK(20, 19) ++#define QCA8K_IPQ4019_RGMII_CTRL_INVERT_RMII1_REF_CLK BIT(21) ++#define QCA8K_IPQ4019_RGMII_CTRL_INVERT_RMII0_MASTER_EN BIT(24) ++#define QCA8K_IPQ4019_RGMII_CTRL_INVERT_RMII1_MASTER_EN BIT(25) ++ ++#define PSGMIIPHY_MODE_CONTROL 0x1b4 ++#define PSGMIIPHY_MODE_ATHR_CSCO_MODE_25M BIT(0) ++#define PSGMIIPHY_TX_CONTROL 0x288 ++#define PSGMIIPHY_TX_CONTROL_MAGIC_VALUE 0x8380 ++#define PSGMIIPHY_VCO_CALIBRATION_CONTROL_REGISTER_1 0x9c ++#define PSGMIIPHY_REG_PLL_VCO_CALIB_RESTART BIT(14) ++#define PSGMIIPHY_VCO_CALIBRATION_CONTROL_REGISTER_2 0xa0 ++#define PSGMIIPHY_REG_PLL_VCO_CALIB_READY BIT(0) ++ ++#define QCA8K_PSGMII_CALB_NUM 100 ++#define MII_QCA8075_SSTATUS 0x11 ++#define QCA8075_PHY_SPEC_STATUS_LINK BIT(10) ++#define QCA8075_MMD7_CRC_AND_PKTS_COUNT 0x8029 ++#define QCA8075_MMD7_PKT_GEN_PKT_NUMB 0x8021 ++#define QCA8075_MMD7_PKT_GEN_PKT_SIZE 0x8062 ++#define QCA8075_MMD7_PKT_GEN_CTRL 0x8020 ++#define QCA8075_MMD7_CNT_SELFCLR BIT(1) ++#define QCA8075_MMD7_CNT_FRAME_CHK_EN BIT(0) ++#define QCA8075_MMD7_PKT_GEN_START BIT(13) ++#define QCA8075_MMD7_PKT_GEN_INPROGR BIT(15) ++#define QCA8075_MMD7_IG_FRAME_RECV_CNT_HI 0x802a ++#define QCA8075_MMD7_IG_FRAME_RECV_CNT_LO 0x802b ++#define QCA8075_MMD7_IG_FRAME_ERR_CNT 0x802c ++#define QCA8075_MMD7_EG_FRAME_RECV_CNT_HI 0x802d ++#define QCA8075_MMD7_EG_FRAME_RECV_CNT_LO 0x802e ++#define QCA8075_MMD7_EG_FRAME_ERR_CNT 0x802f ++#define QCA8075_MMD7_MDIO_BRDCST_WRITE 0x8028 ++#define QCA8075_MMD7_MDIO_BRDCST_WRITE_EN BIT(15) ++#define QCA8075_MDIO_BRDCST_PHY_ADDR 0x1f ++#define QCA8075_PKT_GEN_PKTS_COUNT 4096 ++ + enum { + QCA8K_PORT_SPEED_10M = 0, + QCA8K_PORT_SPEED_100M = 1, +@@ -467,6 +519,10 @@ struct qca8k_priv { + struct qca8k_pcs pcs_port_6; + const struct qca8k_match_data *info; + struct qca8k_led ports_led[QCA8K_LED_COUNT]; ++ /* IPQ4019 specific */ ++ struct regmap *psgmii; ++ struct phy_device *psgmii_ethphy; ++ bool psgmii_calibrated; + }; + + struct qca8k_mib_desc { diff --git a/target/linux/ipq40xx/patches-5.15/706-arm-dts-ipq4019-add-switch-node.patch b/target/linux/ipq40xx/patches-6.1/707-arm-dts-ipq4019-add-switch-node.patch similarity index 91% rename from target/linux/ipq40xx/patches-5.15/706-arm-dts-ipq4019-add-switch-node.patch rename to target/linux/ipq40xx/patches-6.1/707-arm-dts-ipq4019-add-switch-node.patch index a231c7331bfda8..e7203a3ac99ecd 100644 --- a/target/linux/ipq40xx/patches-5.15/706-arm-dts-ipq4019-add-switch-node.patch +++ b/target/linux/ipq40xx/patches-6.1/707-arm-dts-ipq4019-add-switch-node.patch @@ -1,4 +1,4 @@ -From ebb62523990a27b3a25e422fa575619f7f725a20 Mon Sep 17 00:00:00 2001 +From 19c507c3fe4a6fc60317dcae2c55de452aecb7d5 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Mon, 1 Nov 2021 18:15:04 +0100 Subject: [PATCH] arm: dts: ipq4019: add switch node @@ -8,12 +8,12 @@ for it to work. Signed-off-by: Robert Marko --- - arch/arm/boot/dts/qcom-ipq4019.dtsi | 78 +++++++++++++++++++++++++++++ - 1 file changed, 78 insertions(+) + arch/arm/boot/dts/qcom-ipq4019.dtsi | 76 +++++++++++++++++++++++++++++ + 1 file changed, 76 insertions(+) --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -590,6 +590,82 @@ +@@ -594,6 +594,82 @@ status = "disabled"; }; diff --git a/target/linux/ipq40xx/patches-5.15/707-dt-bindings-net-add-QCA807x-PHY.patch b/target/linux/ipq40xx/patches-6.1/708-dt-bindings-net-add-QCA807x-PHY.patch similarity index 97% rename from target/linux/ipq40xx/patches-5.15/707-dt-bindings-net-add-QCA807x-PHY.patch rename to target/linux/ipq40xx/patches-6.1/708-dt-bindings-net-add-QCA807x-PHY.patch index dfb8d692abe8a0..b325d9e535d379 100644 --- a/target/linux/ipq40xx/patches-5.15/707-dt-bindings-net-add-QCA807x-PHY.patch +++ b/target/linux/ipq40xx/patches-6.1/708-dt-bindings-net-add-QCA807x-PHY.patch @@ -1,4 +1,4 @@ -From c66863c1ba8995b61e6d727d78a241c734f5bb57 Mon Sep 17 00:00:00 2001 +From 96eb388c082bd0086b128d82def9daaab1617951 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Thu, 1 Oct 2020 15:05:35 +0200 Subject: [PATCH] dt-bindings: net: add QCA807x PHY diff --git a/target/linux/ipq40xx/patches-5.15/708-net-phy-Add-Qualcom-QCA807x-driver.patch b/target/linux/ipq40xx/patches-6.1/709-net-phy-Add-Qualcom-QCA807x-driver.patch similarity index 77% rename from target/linux/ipq40xx/patches-5.15/708-net-phy-Add-Qualcom-QCA807x-driver.patch rename to target/linux/ipq40xx/patches-6.1/709-net-phy-Add-Qualcom-QCA807x-driver.patch index 6a92a103d644ba..9bae6e7b96bc2f 100644 --- a/target/linux/ipq40xx/patches-5.15/708-net-phy-Add-Qualcom-QCA807x-driver.patch +++ b/target/linux/ipq40xx/patches-6.1/709-net-phy-Add-Qualcom-QCA807x-driver.patch @@ -1,6 +1,6 @@ -From f825cdc8bfde7616a14e2163f16303a8973031d2 Mon Sep 17 00:00:00 2001 +From 876bb5b69c1e083be526c0ea261982d5eb78556f Mon Sep 17 00:00:00 2001 From: Robert Marko -Date: Wed, 7 Oct 2020 17:38:48 +0200 +Date: Fri, 9 Sep 2022 23:44:42 +0200 Subject: [PATCH] net: phy: Add Qualcom QCA807x driver This adds driver for the Qualcomm QCA8072 and QCA8075 PHY-s. @@ -19,32 +19,33 @@ These are commonly used in Qualcomm IPQ40xx, IPQ60xx and IPQ807x boards. Signed-off-by: Robert Marko --- - drivers/net/phy/Kconfig | 6 ++++++ + drivers/net/phy/Kconfig | 7 +++++++ drivers/net/phy/Makefile | 1 + - 2 files changed, 7 insertions(+) + 2 files changed, 8 insertions(+) --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -347,6 +347,12 @@ config AT803X_PHY +@@ -369,6 +369,13 @@ config AT803X_PHY Currently supports the AR8030, AR8031, AR8033, AR8035 and internal QCA8337(Internal qca8k PHY) model +config QCA807X_PHY -+ tristate "Qualcomm QCA807X PHYs" ++ tristate "Qualcomm QCA807x PHYs" + depends on OF_MDIO + help -+ Currently supports the QCA8072 and QCA8075 models. ++ Currently supports the Qualcomm QCA8072, QCA8075 and the PSGMII ++ control PHY. + config QSEMI_PHY tristate "Quality Semiconductor PHYs" help --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile -@@ -92,6 +92,7 @@ obj-$(CONFIG_NATIONAL_PHY) += national.o +@@ -94,6 +94,7 @@ obj-$(CONFIG_MOTORCOMM_PHY) += motorcomm + obj-$(CONFIG_NATIONAL_PHY) += national.o obj-$(CONFIG_NXP_C45_TJA11XX_PHY) += nxp-c45-tja11xx.o obj-$(CONFIG_NXP_TJA11XX_PHY) += nxp-tja11xx.o - obj-$(CONFIG_QSEMI_PHY) += qsemi.o +obj-$(CONFIG_QCA807X_PHY) += qca807x.o + obj-$(CONFIG_QSEMI_PHY) += qsemi.o obj-$(CONFIG_REALTEK_PHY) += realtek.o obj-$(CONFIG_RENESAS_PHY) += uPD60620.o - obj-$(CONFIG_ROCKCHIP_PHY) += rockchip.o diff --git a/target/linux/ipq40xx/patches-5.15/709-arm-dts-ipq4019-QCA807x-properties.patch b/target/linux/ipq40xx/patches-6.1/710-arm-dts-ipq4019-QCA807x-properties.patch similarity index 88% rename from target/linux/ipq40xx/patches-5.15/709-arm-dts-ipq4019-QCA807x-properties.patch rename to target/linux/ipq40xx/patches-6.1/710-arm-dts-ipq4019-QCA807x-properties.patch index cc4b44b393a92a..92fb8a6a02271b 100644 --- a/target/linux/ipq40xx/patches-5.15/709-arm-dts-ipq4019-QCA807x-properties.patch +++ b/target/linux/ipq40xx/patches-6.1/710-arm-dts-ipq4019-QCA807x-properties.patch @@ -1,4 +1,4 @@ -From e0fa88eaa3c176b71e563da68949ac2ab45aaa61 Mon Sep 17 00:00:00 2001 +From 79b38b9f85da868ca59b66715c20aa55104b640b Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Fri, 2 Oct 2020 10:43:26 +0200 Subject: [PATCH] arm: dts: ipq4019: QCA807x properties @@ -7,8 +7,8 @@ This adds necessary DT properties for QCA807x PHY-s to IPQ4019 DTSI. Signed-off-by: Robert Marko --- - arch/arm/boot/dts/qcom-ipq4019.dtsi | 18 ++++++++++++++++++ - 1 file changed, 18 insertions(+) + arch/arm/boot/dts/qcom-ipq4019.dtsi | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi @@ -20,7 +20,7 @@ Signed-off-by: Robert Marko / { #address-cells = <1>; -@@ -726,22 +727,38 @@ +@@ -727,22 +728,38 @@ ethphy0: ethernet-phy@0 { reg = <0>; diff --git a/target/linux/ipq40xx/patches-6.1/711-net-qualcomm-ipqess-fix-TX-timeout-errors.patch b/target/linux/ipq40xx/patches-6.1/711-net-qualcomm-ipqess-fix-TX-timeout-errors.patch new file mode 100644 index 00000000000000..149208aa69da25 --- /dev/null +++ b/target/linux/ipq40xx/patches-6.1/711-net-qualcomm-ipqess-fix-TX-timeout-errors.patch @@ -0,0 +1,64 @@ +From d0055b03d9c8d48ad2b971821989b09ba95c39f8 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Sun, 17 Sep 2023 20:18:31 +0200 +Subject: [PATCH] net: qualcomm: ipqess: fix TX timeout errors + +Currently logic to handle napi tx completion is flawed and on the long +run on loaded condition cause TX timeout error with the queue not being +able to handle any new packet. + +There are 2 main cause of this: +- incrementing the packet done value wrongly +- handling 2 times the tx_ring tail + +ipqess_tx_unmap_and_free may return 2 kind values: +- 0: we are handling first and middle descriptor for the packet +- packet len: we are at the last descriptor for the packet + +Done value was wrongly incremented also for first and intermediate +descriptor for the packet resulting causing panic and TX timeouts by +comunicating to the kernel an inconsistent value of packet handling not +matching the expected ones. + +Tx_ring tail was handled twice for ipqess_tx_complete run resulting in +again done value incremented wrongly and also problem with idx handling +by actually skipping descriptor for some packets. + +Rework the loop logic to fix these 2 problem and also add some comments +to make sure ipqess_tx_unmap_and_free ret value is better +understandable. + +Signed-off-by: Christian Marangi +--- + drivers/net/ethernet/qualcomm/ipqess/ipqess.c | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +--- a/drivers/net/ethernet/qualcomm/ipqess/ipqess.c ++++ b/drivers/net/ethernet/qualcomm/ipqess/ipqess.c +@@ -453,13 +453,22 @@ static int ipqess_tx_complete(struct ipq + tail >>= IPQESS_TPD_CONS_IDX_SHIFT; + tail &= IPQESS_TPD_CONS_IDX_MASK; + +- do { ++ while ((tx_ring->tail != tail) && (done < budget)) { + ret = ipqess_tx_unmap_and_free(&tx_ring->ess->pdev->dev, + &tx_ring->buf[tx_ring->tail]); +- tx_ring->tail = IPQESS_NEXT_IDX(tx_ring->tail, tx_ring->count); ++ /* ipqess_tx_unmap_and_free may return 2 kind values: ++ * - 0: we are handling first and middle descriptor for the packet ++ * - packet len: we are at the last descriptor for the packet ++ * Increment total bytes handled and packet done only if we are ++ * handling the last descriptor for the packet. ++ */ ++ if (ret) { ++ total += ret; ++ done++; ++ } + +- total += ret; +- } while ((++done < budget) && (tx_ring->tail != tail)); ++ tx_ring->tail = IPQESS_NEXT_IDX(tx_ring->tail, tx_ring->count); ++ }; + + ipqess_w32(tx_ring->ess, IPQESS_REG_TX_SW_CONS_IDX_Q(tx_ring->idx), + tx_ring->tail); diff --git a/target/linux/ipq40xx/patches-5.15/850-soc-add-qualcomm-syscon.patch b/target/linux/ipq40xx/patches-6.1/850-soc-add-qualcomm-syscon.patch similarity index 90% rename from target/linux/ipq40xx/patches-5.15/850-soc-add-qualcomm-syscon.patch rename to target/linux/ipq40xx/patches-6.1/850-soc-add-qualcomm-syscon.patch index 9b44a4c885c408..6afb27b178d382 100644 --- a/target/linux/ipq40xx/patches-5.15/850-soc-add-qualcomm-syscon.patch +++ b/target/linux/ipq40xx/patches-6.1/850-soc-add-qualcomm-syscon.patch @@ -1,20 +1,10 @@ From: Christian Lamparter Subject: SoC: add qualcomm syscon ---- a/drivers/soc/qcom/Makefile -+++ b/drivers/soc/qcom/Makefile -@@ -21,6 +21,7 @@ obj-$(CONFIG_QCOM_SMP2P) += smp2p.o - obj-$(CONFIG_QCOM_SMSM) += smsm.o - obj-$(CONFIG_QCOM_SOCINFO) += socinfo.o - obj-$(CONFIG_QCOM_WCNSS_CTRL) += wcnss_ctrl.o -+obj-$(CONFIG_QCOM_TCSR) += qcom_tcsr.o - obj-$(CONFIG_QCOM_APR) += apr.o - obj-$(CONFIG_QCOM_LLCC) += llcc-qcom.o - obj-$(CONFIG_QCOM_RPMHPD) += rpmhpd.o --- a/drivers/soc/qcom/Kconfig +++ b/drivers/soc/qcom/Kconfig -@@ -192,6 +192,13 @@ config QCOM_SOCINFO - Say yes here to support the Qualcomm socinfo driver, providing - information about the SoC to user space. +@@ -248,4 +248,11 @@ config QCOM_ICC_BWMON + the fixed bandwidth votes from cpufreq (CPU nodes) thus achieve high + memory throughput even with lower CPU frequencies. +config QCOM_TCSR + tristate "QCOM Top Control and Status Registers" @@ -23,9 +13,14 @@ Subject: SoC: add qualcomm syscon + Say y here to enable TCSR support. The TCSR provides control + functions for various peripherals. + - config QCOM_WCNSS_CTRL - tristate "Qualcomm WCNSS control driver" - depends on ARCH_QCOM || COMPILE_TEST + endmenu +--- a/drivers/soc/qcom/Makefile ++++ b/drivers/soc/qcom/Makefile +@@ -29,3 +29,4 @@ obj-$(CONFIG_QCOM_RPMHPD) += rpmhpd.o + obj-$(CONFIG_QCOM_RPMPD) += rpmpd.o + obj-$(CONFIG_QCOM_KRYO_L2_ACCESSORS) += kryo-l2-accessors.o + obj-$(CONFIG_QCOM_ICC_BWMON) += icc-bwmon.o ++obj-$(CONFIG_QCOM_TCSR) += qcom_tcsr.o --- /dev/null +++ b/drivers/soc/qcom/qcom_tcsr.c @@ -0,0 +1,98 @@ diff --git a/target/linux/ipq40xx/patches-5.15/910-Revert-firmware-qcom_scm-Clear-download-bit-during-r.patch b/target/linux/ipq40xx/patches-6.1/910-Revert-firmware-qcom_scm-Clear-download-bit-during-r.patch similarity index 93% rename from target/linux/ipq40xx/patches-5.15/910-Revert-firmware-qcom_scm-Clear-download-bit-during-r.patch rename to target/linux/ipq40xx/patches-6.1/910-Revert-firmware-qcom_scm-Clear-download-bit-during-r.patch index b5b89b26f1deab..f08ff041378c72 100644 --- a/target/linux/ipq40xx/patches-5.15/910-Revert-firmware-qcom_scm-Clear-download-bit-during-r.patch +++ b/target/linux/ipq40xx/patches-6.1/910-Revert-firmware-qcom_scm-Clear-download-bit-during-r.patch @@ -15,7 +15,7 @@ Signed-off-by: Robert Marko --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c -@@ -1361,7 +1361,8 @@ static int qcom_scm_probe(struct platfor +@@ -1459,7 +1459,8 @@ static int qcom_scm_probe(struct platfor static void qcom_scm_shutdown(struct platform_device *pdev) { /* Clean shutdown, disable download mode to allow normal restart */ diff --git a/target/linux/ipq40xx/patches-5.15/998-lantiq-atm-hacks.patch b/target/linux/ipq40xx/patches-6.1/998-lantiq-atm-hacks.patch similarity index 100% rename from target/linux/ipq40xx/patches-5.15/998-lantiq-atm-hacks.patch rename to target/linux/ipq40xx/patches-6.1/998-lantiq-atm-hacks.patch diff --git a/target/linux/ipq40xx/patches-5.15/999-atm-mpoa-intel-dsl-phy-support.patch b/target/linux/ipq40xx/patches-6.1/999-atm-mpoa-intel-dsl-phy-support.patch similarity index 94% rename from target/linux/ipq40xx/patches-5.15/999-atm-mpoa-intel-dsl-phy-support.patch rename to target/linux/ipq40xx/patches-6.1/999-atm-mpoa-intel-dsl-phy-support.patch index b774fc39d8cb44..3d5b7afe8c2f96 100644 --- a/target/linux/ipq40xx/patches-5.15/999-atm-mpoa-intel-dsl-phy-support.patch +++ b/target/linux/ipq40xx/patches-6.1/999-atm-mpoa-intel-dsl-phy-support.patch @@ -4,7 +4,7 @@ Subject: [PATCH] UGW_SW-29163: ATM oam support --- a/drivers/net/ppp/ppp_generic.c +++ b/drivers/net/ppp/ppp_generic.c -@@ -2952,6 +2952,22 @@ char *ppp_dev_name(struct ppp_channel *c +@@ -2953,6 +2953,22 @@ char *ppp_dev_name(struct ppp_channel *c return name; } @@ -27,7 +27,7 @@ Subject: [PATCH] UGW_SW-29163: ATM oam support /* * Disconnect a channel from the generic layer. -@@ -3598,6 +3614,7 @@ EXPORT_SYMBOL(ppp_unregister_channel); +@@ -3599,6 +3615,7 @@ EXPORT_SYMBOL(ppp_unregister_channel); EXPORT_SYMBOL(ppp_channel_index); EXPORT_SYMBOL(ppp_unit_number); EXPORT_SYMBOL(ppp_dev_name); @@ -37,7 +37,7 @@ Subject: [PATCH] UGW_SW-29163: ATM oam support EXPORT_SYMBOL(ppp_output_wakeup); --- a/include/linux/ppp_channel.h +++ b/include/linux/ppp_channel.h -@@ -74,6 +74,9 @@ extern int ppp_unit_number(struct ppp_ch +@@ -76,6 +76,9 @@ extern int ppp_unit_number(struct ppp_ch /* Get the device name associated with a channel, or NULL if none */ extern char *ppp_dev_name(struct ppp_channel *); @@ -64,7 +64,7 @@ Subject: [PATCH] UGW_SW-29163: ATM oam support depends on ATM && INET --- a/net/atm/br2684.c +++ b/net/atm/br2684.c -@@ -596,6 +596,11 @@ static int br2684_regvcc(struct atm_vcc +@@ -598,6 +598,11 @@ static int br2684_regvcc(struct atm_vcc atmvcc->push = br2684_push; atmvcc->pop = br2684_pop; atmvcc->release_cb = br2684_release_cb; diff --git a/target/linux/ipq806x/config-6.1 b/target/linux/ipq806x/config-6.1 index 4c9d09bc2793b9..960e16ae74df6b 100644 --- a/target/linux/ipq806x/config-6.1 +++ b/target/linux/ipq806x/config-6.1 @@ -35,9 +35,8 @@ CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE=y CONFIG_ARM_CPUIDLE=y CONFIG_ARM_CPU_SUSPEND=y # CONFIG_ARM_CPU_TOPOLOGY is not set -CONFIG_ARM_CRYPTO=y CONFIG_ARM_GIC=y -CONFIG_ARM_HAS_SG_CHAIN=y +CONFIG_ARM_HAS_GROUP_RELOCS=y CONFIG_ARM_IPQ806X_FAB_DEVFREQ=y CONFIG_ARM_KRAIT_CACHE_DEVFREQ=y CONFIG_ARM_L1_CACHE_SHIFT=6 @@ -57,12 +56,18 @@ CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_MQ_PCI=y CONFIG_BOUNCE=y # CONFIG_CACHE_L2X0 is not set +CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y +CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" +CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_QCOM=y CONFIG_CLONE_BACKWARDS=y CONFIG_CMDLINE_OVERRIDE=y CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_QCOM=y +CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 CONFIG_COMPAT_32BIT_TIME=y +CONFIG_CONTEXT_TRACKING=y +CONFIG_CONTEXT_TRACKING_IDLE=y CONFIG_CPUFREQ_DT=y CONFIG_CPUFREQ_DT_PLATDEV=y CONFIG_CPU_32v6K=y @@ -74,7 +79,6 @@ CONFIG_CPU_COPY_V6=y CONFIG_CPU_CP15=y CONFIG_CPU_CP15_MMU=y CONFIG_CPU_FREQ=y -# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y CONFIG_CPU_FREQ_GOV_ATTR_SET=y CONFIG_CPU_FREQ_GOV_COMMON=y @@ -113,15 +117,19 @@ CONFIG_CRYPTO_HMAC=y CONFIG_CRYPTO_HW=y CONFIG_CRYPTO_JITTERENTROPY=y CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y +CONFIG_CRYPTO_LIB_SHA1=y CONFIG_CRYPTO_LIB_SHA256=y +CONFIG_CRYPTO_LIB_UTILS=y CONFIG_CRYPTO_LZO=y CONFIG_CRYPTO_RNG=y CONFIG_CRYPTO_RNG2=y CONFIG_CRYPTO_SHA256=y CONFIG_CRYPTO_SHA512=y CONFIG_CRYPTO_ZSTD=y +CONFIG_CURRENT_POINTER_IN_TPIDRURO=y CONFIG_DCACHE_WORD_ACCESS=y CONFIG_DEBUG_GPIO=y +CONFIG_DEBUG_INFO=y CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" CONFIG_DEVFREQ_GOV_PASSIVE=y # CONFIG_DEVFREQ_GOV_PERFORMANCE is not set @@ -133,7 +141,6 @@ CONFIG_DMADEVICES=y CONFIG_DMA_ENGINE=y CONFIG_DMA_OF=y CONFIG_DMA_OPS=y -CONFIG_DMA_REMAP=y CONFIG_DMA_VIRTUAL_CHANNELS=y CONFIG_DTC=y CONFIG_DT_IDLE_STATES=y @@ -143,10 +150,13 @@ CONFIG_DWMAC_IPQ806X=y CONFIG_EDAC_ATOMIC_SCRUB=y CONFIG_EDAC_SUPPORT=y CONFIG_ETHERNET_PACKET_MANGLE=y +CONFIG_EXCLUSIVE_SYSTEM_RAM=y CONFIG_FIXED_PHY=y CONFIG_FIX_EARLYCON_MEM=y CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y +CONFIG_FW_LOADER_SYSFS=y +CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_CLOCKEVENTS=y @@ -179,7 +189,6 @@ CONFIG_GLOB=y CONFIG_GPIOLIB_IRQCHIP=y CONFIG_GPIO_CDEV=y CONFIG_GRO_CELLS=y -CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDEN_BRANCH_PREDICTOR=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y @@ -212,6 +221,7 @@ CONFIG_IPQ_GCC_806X=y # CONFIG_IPQ_GCC_8074 is not set # CONFIG_IPQ_LCC_806X is not set CONFIG_IRQCHIP=y +CONFIG_IRQSTACKS=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y CONFIG_IRQ_FASTEOI_HIERARCHY_HANDLERS=y @@ -322,6 +332,8 @@ CONFIG_OLD_SIGSUSPEND3=y CONFIG_PADATA=y CONFIG_PAGE_OFFSET=0xC0000000 CONFIG_PAGE_POOL=y +CONFIG_PAGE_SIZE_LESS_THAN_256KB=y +CONFIG_PAGE_SIZE_LESS_THAN_64KB=y CONFIG_PCI=y CONFIG_PCIEAER=y CONFIG_PCIEPORTBUS=y @@ -355,9 +367,7 @@ CONFIG_PINCTRL=y # CONFIG_PINCTRL_APQ8064 is not set # CONFIG_PINCTRL_APQ8084 is not set # CONFIG_PINCTRL_IPQ4019 is not set -# CONFIG_PINCTRL_IPQ6018 is not set CONFIG_PINCTRL_IPQ8064=y -# CONFIG_PINCTRL_IPQ8074 is not set # CONFIG_PINCTRL_MDM9615 is not set CONFIG_PINCTRL_MSM=y # CONFIG_PINCTRL_MSM8226 is not set @@ -365,19 +375,9 @@ CONFIG_PINCTRL_MSM=y # CONFIG_PINCTRL_MSM8909 is not set # CONFIG_PINCTRL_MSM8916 is not set # CONFIG_PINCTRL_MSM8960 is not set -# CONFIG_PINCTRL_MSM8976 is not set -# CONFIG_PINCTRL_MSM8994 is not set -# CONFIG_PINCTRL_MSM8996 is not set -# CONFIG_PINCTRL_MSM8998 is not set # CONFIG_PINCTRL_QCOM_SPMI_PMIC is not set # CONFIG_PINCTRL_QCOM_SSBI_PMIC is not set -# CONFIG_PINCTRL_QCS404 is not set -# CONFIG_PINCTRL_SC7180 is not set -# CONFIG_PINCTRL_SDM660 is not set -# CONFIG_PINCTRL_SDM845 is not set # CONFIG_PINCTRL_SDX65 is not set -# CONFIG_PINCTRL_SM8150 is not set -# CONFIG_PINCTRL_SM8250 is not set CONFIG_PM_DEVFREQ=y # CONFIG_PM_DEVFREQ_EVENT is not set CONFIG_PM_OPP=y @@ -385,6 +385,7 @@ CONFIG_POWER_RESET=y CONFIG_POWER_RESET_MSM=y CONFIG_POWER_SUPPLY=y CONFIG_PPS=y +CONFIG_PREEMPT_NONE_BUILD=y CONFIG_PRINTK_TIME=y CONFIG_PTP_1588_CLOCK=y CONFIG_PTP_1588_CLOCK_OPTIONAL=y @@ -413,6 +414,7 @@ CONFIG_QCOM_SCM=y CONFIG_QCOM_SMEM=y # CONFIG_QCOM_SMSM is not set CONFIG_QCOM_SOCINFO=y +CONFIG_QCOM_SPM=y # CONFIG_QCOM_STATS is not set CONFIG_QCOM_TCSR=y CONFIG_QCOM_TSENS=y @@ -420,6 +422,7 @@ CONFIG_QCOM_WDT=y # CONFIG_QCS_GCC_404 is not set # CONFIG_QCS_Q6SSTOP_404 is not set # CONFIG_QCS_TURING_404 is not set +CONFIG_RANDSTRUCT_NONE=y CONFIG_RAS=y CONFIG_RATIONAL=y CONFIG_RCU_CPU_STALL_TIMEOUT=21 @@ -478,6 +481,7 @@ CONFIG_SMP_ON_UP=y # CONFIG_SM_VIDEOCC_8250 is not set CONFIG_SOCK_RX_QUEUE_MAPPING=y CONFIG_SOC_BUS=y +CONFIG_SOFTIRQ_ON_OWN_STACK=y CONFIG_SPARSE_IRQ=y CONFIG_SPI=y CONFIG_SPI_MASTER=y @@ -501,6 +505,7 @@ CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 CONFIG_THERMAL_GOV_STEP_WISE=y CONFIG_THERMAL_HWMON=y CONFIG_THERMAL_OF=y +CONFIG_THREAD_INFO_IN_TASK=y CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_TIMER_OF=y CONFIG_TIMER_PROBE=y @@ -527,5 +532,6 @@ CONFIG_ZBOOT_ROM_BSS=0 CONFIG_ZBOOT_ROM_TEXT=0 CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y +CONFIG_ZSTD_COMMON=y CONFIG_ZSTD_COMPRESS=y CONFIG_ZSTD_DECOMPRESS=y diff --git a/target/linux/ipq806x/patches-6.1/140-v6.5-hwspinlock-qcom-add-missing-regmap-config-for-SFPB-M.patch b/target/linux/ipq806x/patches-6.1/140-v6.5-hwspinlock-qcom-add-missing-regmap-config-for-SFPB-M.patch deleted file mode 100644 index faa9044d338169..00000000000000 --- a/target/linux/ipq806x/patches-6.1/140-v6.5-hwspinlock-qcom-add-missing-regmap-config-for-SFPB-M.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 23316be8a9d450f33a21f1efe7d89570becbec58 Mon Sep 17 00:00:00 2001 -From: Christian Marangi -Date: Sun, 16 Jul 2023 04:28:04 +0200 -Subject: [PATCH] hwspinlock: qcom: add missing regmap config for SFPB MMIO - implementation - -Commit 5d4753f741d8 ("hwspinlock: qcom: add support for MMIO on older -SoCs") introduced and made regmap_config mandatory in the of_data struct -but didn't add the regmap_config for sfpb based devices. - -SFPB based devices can both use the legacy syscon way to probe or the -new MMIO way and currently device that use the MMIO way are broken as -they lack the definition of the now required regmap_config and always -return -EINVAL (and indirectly makes fail probing everything that -depends on it, smem, nandc with smem-parser...) - -Fix this by correctly adding the missing regmap_config and restore -function of hwspinlock on SFPB based devices with MMIO implementation. - -Cc: stable@vger.kernel.org -Fixes: 5d4753f741d8 ("hwspinlock: qcom: add support for MMIO on older SoCs") -Signed-off-by: Christian Marangi -Link: https://lore.kernel.org/r/20230716022804.21239-1-ansuelsmth@gmail.com -Signed-off-by: Bjorn Andersson ---- - drivers/hwspinlock/qcom_hwspinlock.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - ---- a/drivers/hwspinlock/qcom_hwspinlock.c -+++ b/drivers/hwspinlock/qcom_hwspinlock.c -@@ -69,9 +69,18 @@ static const struct hwspinlock_ops qcom_ - .unlock = qcom_hwspinlock_unlock, - }; - -+static const struct regmap_config sfpb_mutex_config = { -+ .reg_bits = 32, -+ .reg_stride = 4, -+ .val_bits = 32, -+ .max_register = 0x100, -+ .fast_io = true, -+}; -+ - static const struct qcom_hwspinlock_of_data of_sfpb_mutex = { - .offset = 0x4, - .stride = 0x4, -+ .regmap_config = &sfpb_mutex_config, - }; - - static const struct regmap_config tcsr_msm8226_mutex_config = { diff --git a/target/linux/mediatek/dts/mt7622-buffalo-wsr-2533dhp2.dts b/target/linux/mediatek/dts/mt7622-buffalo-wsr-2533dhp2.dts index 6d77be532b1488..a9f29591912c54 100644 --- a/target/linux/mediatek/dts/mt7622-buffalo-wsr-2533dhp2.dts +++ b/target/linux/mediatek/dts/mt7622-buffalo-wsr-2533dhp2.dts @@ -1,108 +1,20 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include -#include -#include "mt7622.dtsi" -#include "mt6380.dtsi" +#include "mt7622-buffalo-wsr.dtsi" / { model = "Buffalo WSR-2533DHP2"; compatible = "buffalo,wsr-2533dhp2", "mediatek,mt7622"; aliases { - serial0 = &uart0; - led-boot = &power_green; - led-failsafe = &power_amber; - led-running = &power_green; - led-upgrade = &power_green; - }; - - chosen { - bootargs = "earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n8 swiotlb=512"; + label-mac-device = &gmac0; }; memory { reg = <0 0x40000000 0 0x0F000000>; }; - leds { - compatible = "gpio-leds"; - - wireless_amber { - label = "amber:wireless"; - gpios = <&pio 2 GPIO_ACTIVE_HIGH>; - }; - - power_amber: power_amber { - label = "amber:power"; - gpios = <&pio 3 GPIO_ACTIVE_LOW>; - }; - - power_green: power_green { - label = "green:power"; - gpios = <&pio 4 GPIO_ACTIVE_LOW>; - default-state = "on"; - }; - - wireless_green { - label = "green:wireless"; - gpios = <&pio 15 GPIO_ACTIVE_HIGH>; - }; - - internet { - label = "green:internet"; - gpios = <&pio 19 GPIO_ACTIVE_HIGH>; - }; - - router { - label = "green:router"; - gpios = <&pio 20 GPIO_ACTIVE_HIGH>; - }; - }; - - keys { - compatible = "gpio-keys"; - poll-interval = <100>; - - reset { - label = "reset"; - gpios = <&pio 0 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - - /* GPIO 1 and 16 are a tri-state switch button with - * ROUTER / AP / WB. - */ - router { - label = "router"; - gpios = <&pio 1 GPIO_ACTIVE_LOW>; - linux,code = ; - linux,input-type = ; - }; - - bridge { - label = "wb"; - gpios = <&pio 16 GPIO_ACTIVE_LOW>; - linux,code = ; - linux,input-type = ; - }; - - /* GPIO 18 is a switch button with AUTO / MANUAL. */ - manual { - label = "manual"; - gpios = <&pio 18 GPIO_ACTIVE_LOW>; - linux,code = ; - linux,input-type = ; - }; - - wps { - label = "wps"; - gpios = <&pio 102 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; - rtkgsw: rtkgsw@0 { compatible = "mediatek,rtk-gsw"; mediatek,ethsys = <ðsys>; @@ -111,41 +23,7 @@ }; }; -&cpu0 { - proc-supply = <&mt6380_vcpu_reg>; - sram-supply = <&mt6380_vm_reg>; -}; - -&cpu1 { - proc-supply = <&mt6380_vcpu_reg>; - sram-supply = <&mt6380_vm_reg>; -}; - -&pcie0 { - pinctrl-names = "default"; - pinctrl-0 = <&pcie0_pins>; - status = "okay"; -}; - -&slot0 { - status = "okay"; - - wifi@0,0 { - compatible = "mediatek,mt76"; - reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x5000>; - ieee80211-freq-limit = <5000000 6000000>; - }; -}; - &pio { - eth_pins: eth-pins { - mux { - function = "eth"; - groups = "mdc_mdio", "rgmii_via_gmac2"; - }; - }; - /* Parallel nand is shared pin with eMMC */ parallel_nand_pins: parallel-nand-pins { mux { @@ -164,75 +42,11 @@ bias-pull-up; }; }; - - pcie0_pins: pcie0-pins { - mux { - function = "pcie"; - groups = "pcie0_pad_perst", - "pcie0_1_waken", - "pcie0_1_clkreq"; - }; - }; - - pmic_bus_pins: pmic-bus-pins { - mux { - function = "pmic"; - groups = "pmic_bus"; - }; - }; - - pwm7_pins: pwm1-2-pins { - mux { - function = "pwm"; - groups = "pwm_ch7_2"; - }; - }; - - uart0_pins: uart0-pins { - mux { - function = "uart"; - groups = "uart0_0_tx_rx" ; - }; - }; - - watchdog_pins: watchdog-pins { - mux { - function = "watchdog"; - groups = "watchdog"; - }; - }; }; -&bch { - status = "okay"; -}; - -ð { - pinctrl-names = "default"; - pinctrl-0 = <ð_pins>; - status = "okay"; - - gmac0: mac@0 { - compatible = "mediatek,eth-mac"; - reg = <0>; - - phy-connection-type = "2500base-x"; - - nvmem-cells = <&macaddr_factory_4>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; - - fixed-link { - speed = <2500>; - full-duplex; - pause; - }; - }; - - mdio: mdio-bus { - #address-cells = <1>; - #size-cells = <0>; - }; +&gmac0 { + nvmem-cells = <&macaddr_factory_4 (-1)>; + nvmem-cell-names = "mac-address"; }; &nandc { @@ -273,9 +87,22 @@ }; factory: partition@1c0000 { + compatible = "nvmem-cells"; label = "factory"; reg = <0x1c0000 0x40000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@200000 { @@ -304,47 +131,3 @@ }; }; }; - -&pwm { - pinctrl-names = "default"; - pinctrl-0 = <&pwm7_pins>; - status = "okay"; -}; - -&pwrap { - pinctrl-names = "default"; - pinctrl-0 = <&pmic_bus_pins>; - status = "okay"; -}; - -&uart0 { - pinctrl-names = "default"; - pinctrl-0 = <&uart0_pins>; - status = "okay"; -}; - -&watchdog { - pinctrl-names = "default"; - pinctrl-0 = <&watchdog_pins>; - status = "okay"; -}; - -&wmac { - status = "okay"; - - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&rtc { - status = "disabled"; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/mediatek/dts/mt7622-buffalo-wsr-3200ax4s.dts b/target/linux/mediatek/dts/mt7622-buffalo-wsr-3200ax4s.dts new file mode 100644 index 00000000000000..678c31b711b741 --- /dev/null +++ b/target/linux/mediatek/dts/mt7622-buffalo-wsr-3200ax4s.dts @@ -0,0 +1,175 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7622-buffalo-wsr.dtsi" + +/ { + model = "Buffalo WSR-3200AX4S"; + compatible = "buffalo,wsr-3200ax4s", "mediatek,mt7622"; + + memory { + reg = <0 0x40000000 0 0x1f000000>; + }; +}; + +&pio { + /* Serial NAND is shared pin with SPI-NOR */ + serial_nand_pins: serial-nand-pins { + mux { + function = "flash"; + groups = "snfi"; + }; + + conf-cmd-dat { + pins = "SPI_WP", "SPI_HOLD", "SPI_MOSI", + "SPI_MISO", "SPI_CS"; + input-enable; + drive-strength = <16>; + bias-pull-up; + }; + + conf-clk { + pins = "SPI_CLK"; + drive-strength = <16>; + bias-pull-down; + }; + }; +}; + +&mdio { + switch@1f { + compatible = "mediatek,mt7531"; + reg = <0x1f>; + reset-gpios = <&pio 54 GPIO_ACTIVE_HIGH>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan4"; + }; + + port@1 { + reg = <1>; + label = "lan3"; + }; + + port@2 { + reg = <2>; + label = "lan2"; + }; + + port@3 { + reg = <3>; + label = "lan1"; + }; + + port@4 { + reg = <4>; + label = "wan"; + }; + + port@6 { + reg = <6>; + label = "cpu"; + ethernet = <&gmac0>; + phy-connection-type = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; + }; +}; + +&snfi { + pinctrl-names = "default"; + pinctrl-0 = <&serial_nand_pins>; + status = "okay"; + + flash@0 { + compatible = "spi-nand"; + reg = <0>; + spi-max-frequency = <104000000>; + nand-ecc-engine = <&snfi>; + mediatek,bmt-v2; + mediatek,bmt-table-size = <0x1000>; + /* + * - Preloader - (kernel (6MiB, in firmware)) + * - Kernel2 - WTB + */ + mediatek,bmt-remap-range = <0x0 0x8c0000>, + <0x1ac0000 0x5200000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Preloader"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + label = "ATF"; + reg = <0x80000 0x40000>; + read-only; + }; + + partition@c0000 { + label = "u-boot"; + reg = <0xc0000 0x80000>; + read-only; + }; + + partition@140000 { + label = "u-boot-env"; + reg = <0x140000 0x80000>; + read-only; + }; + + factory: partition@1c0000 { + label = "factory"; + reg = <0x1c0000 0x100000>; + read-only; + }; + + partition@2c0000 { + compatible = "brcm,trx"; + brcm,trx-magic = <0x33504844>; + label = "firmware"; + reg = <0x2c0000 0x1800000>; + }; + + partition@1ac0000 { + label = "Kernel2"; + reg = <0x1ac0000 0x1800000>; + }; + + partition@32c0000 { + label = "glbcfg"; + reg = <0x32c0000 0x200000>; + read-only; + }; + + partition@34c0000 { + label = "board_data"; + reg = <0x34c0000 0x200000>; + read-only; + }; + + partition@36c0000 { + label = "WTB"; + reg = <0x36c0000 0x3600000>; + read-only; + }; + }; + }; +}; diff --git a/target/linux/mediatek/dts/mt7622-buffalo-wsr.dtsi b/target/linux/mediatek/dts/mt7622-buffalo-wsr.dtsi new file mode 100644 index 00000000000000..e77f83d354bb0c --- /dev/null +++ b/target/linux/mediatek/dts/mt7622-buffalo-wsr.dtsi @@ -0,0 +1,236 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include +#include + +#include "mt7622.dtsi" +#include "mt6380.dtsi" + +/ { + aliases { + serial0 = &uart0; + led-boot = &power_green; + led-failsafe = &power_amber; + led-running = &power_green; + led-upgrade = &power_green; + }; + + chosen { + bootargs = "earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n8 swiotlb=512"; + }; + + leds { + compatible = "gpio-leds"; + + led-0 { + label = "amber:wireless"; + gpios = <&pio 2 GPIO_ACTIVE_HIGH>; + color = ; + function = LED_FUNCTION_WLAN; + }; + + power_amber: led-1 { + label = "amber:power"; + gpios = <&pio 3 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_POWER; + }; + + power_green: led-2 { + label = "green:power"; + gpios = <&pio 4 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_POWER; + }; + + led-3 { + label = "green:wireless"; + gpios = <&pio 15 GPIO_ACTIVE_HIGH>; + color = ; + function = LED_FUNCTION_WLAN; + }; + + led-4 { + label = "green:internet"; + gpios = <&pio 19 GPIO_ACTIVE_HIGH>; + color = ; + function = LED_FUNCTION_WAN; + }; + + led-5 { + label = "green:router"; + gpios = <&pio 20 GPIO_ACTIVE_HIGH>; + color = ; + function = LED_FUNCTION_INDICATOR; + }; + }; + + keys { + compatible = "gpio-keys"; + + key-reset { + label = "reset"; + gpios = <&pio 0 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + /* GPIO 1 and 16 are a tri-state switch button with + * ROUTER / AP / WB. + */ + key-router { + label = "router"; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + + key-bridge { + label = "wb"; + gpios = <&pio 16 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + + /* GPIO 18 is a switch button with AUTO / MANUAL. */ + key-manual { + label = "manual"; + gpios = <&pio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + + key-wps { + label = "wps"; + gpios = <&pio 102 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&cpu0 { + proc-supply = <&mt6380_vcpu_reg>; + sram-supply = <&mt6380_vm_reg>; +}; + +&cpu1 { + proc-supply = <&mt6380_vcpu_reg>; + sram-supply = <&mt6380_vm_reg>; +}; + +&pcie0 { + pinctrl-names = "default"; + pinctrl-0 = <&pcie0_pins>; + status = "okay"; +}; + +&slot0 { + status = "okay"; + + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x5000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&pio { + eth_pins: eth-pins { + mux { + function = "eth"; + groups = "mdc_mdio", "rgmii_via_gmac2"; + }; + }; + + pcie0_pins: pcie0-pins { + mux { + function = "pcie"; + groups = "pcie0_pad_perst", + "pcie0_1_waken", + "pcie0_1_clkreq"; + }; + }; + + pmic_bus_pins: pmic-bus-pins { + mux { + function = "pmic"; + groups = "pmic_bus"; + }; + }; + + uart0_pins: uart0-pins { + mux { + function = "uart"; + groups = "uart0_0_tx_rx" ; + }; + }; + + watchdog_pins: watchdog-pins { + mux { + function = "watchdog"; + groups = "watchdog"; + }; + }; +}; + +ð { + pinctrl-names = "default"; + pinctrl-0 = <ð_pins>; + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + + phy-connection-type = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + + mdio: mdio-bus { + #address-cells = <1>; + #size-cells = <0>; + }; +}; + +&bch { + status = "okay"; +}; + +&pwm { + status = "okay"; +}; + +&pwrap { + pinctrl-names = "default"; + pinctrl-0 = <&pmic_bus_pins>; + status = "okay"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins>; + status = "okay"; +}; + +&watchdog { + pinctrl-names = "default"; + pinctrl-0 = <&watchdog_pins>; + status = "okay"; +}; + +&wmac { + status = "okay"; + + mediatek,mtd-eeprom = <&factory 0x0>; +}; + +&rtc { + status = "disabled"; +}; diff --git a/target/linux/mediatek/dts/mt7981a-ubnt-unifi-6-plus.dts b/target/linux/mediatek/dts/mt7981a-ubnt-unifi-6-plus.dts new file mode 100644 index 00000000000000..ece78ee50ebc56 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981a-ubnt-unifi-6-plus.dts @@ -0,0 +1,168 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; +#include "mt7981.dtsi" + +/ { + model = "Ubiquiti UniFi 6 Plus"; + compatible = "ubnt,unifi-6-plus", "mediatek,mt7981"; + + aliases { + serial0 = &uart0; + led-boot = &led_white; + led-failsafe = &led_white; + led-running = &led_blue; + led-upgrade = &led_blue; + label-mac-device = &gmac1; + }; + + chosen { + bootargs-override = "console=ttyS0,115200n8 rootwait root=/dev/mmcblk0p7"; + stdout-path = "serial0:115200n8"; + }; + + gpio-keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + }; + + + leds { + compatible = "gpio-leds"; + + led_blue: dome-blue { + label = "blue:dome"; + gpios = <&pio 9 GPIO_ACTIVE_HIGH>; + }; + + led_white: dome-white { + label = "white:dome"; + gpios = <&pio 34 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&pio { + spi2_flash_pins: spi2-pins { + mux { + function = "spi"; + groups = "spi2", "spi2_wp_hold"; + }; + + conf-pu { + pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP"; + drive-strength = <8>; + bias-pull-up = <103>; + }; + + conf-pd { + pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO"; + drive-strength = <8>; + bias-pull-down = <103>; + }; + }; + + mmc0_pins_default: mmc0-pins-default { + mux { + function = "flash"; + groups = "emmc_45"; + }; + }; + + mmc0_pins_uhs: mmc0-pins-uhs { + mux { + function = "flash"; + groups = "emmc_45"; + }; + }; +}; + +&spi2 { + pinctrl-names = "default"; + pinctrl-0 = <&spi2_flash_pins>; + status = "okay"; + + flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + 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>; + + eeprom: partition@00000 { + label = "EEPROM"; + reg = <0x00000 0x10000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_eeprom_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_eeprom_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; + + partition@10000 { + label = "u-boot-env"; + reg = <0x10000 0x80000>; + }; + }; + }; +}; + +&mmc0 { + pinctrl-names = "default", "state_uhs"; + pinctrl-0 = <&mmc0_pins_default>; + pinctrl-1 = <&mmc0_pins_uhs>; + bus-width = <8>; + max-frequency = <52000000>; + cap-mmc-highspeed; + vmmc-supply = <®_3p3v>; + non-removable; + status = "okay"; +}; + +ð { + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>; + status = "okay"; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "gmii"; + phy-handle = <&int_gbe_phy>; + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_eeprom_0>; + }; +}; + +&wifi { + status = "okay"; +}; diff --git a/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7981-rfb-mxl-2p5g-phy-eth1.dtso b/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7981-rfb-mxl-2p5g-phy-eth1.dtso new file mode 100644 index 00000000000000..4d0e5c04067b39 --- /dev/null +++ b/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7981-rfb-mxl-2p5g-phy-eth1.dtso @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */ +/dts-v1/; +/plugin/; + +#include + +/ { + compatible = "mediatek,mt7981-rfb", "mediatek,mt7981"; + + fragment@0 { + target = <&gmac1>; + __overlay__ { + phy-mode = "2500base-x"; + phy-handle = <&phy5>; + }; + }; + + fragment@1 { + target = <&mdio_bus>; + __overlay__ { + reset-gpios = <&pio 14 GPIO_ACTIVE_LOW>; + reset-delay-us = <600>; + reset-post-delay-us = <20000>; + + phy5: ethernet-phy@5 { + reg = <5>; + compatible = "ethernet-phy-ieee802.3-c45"; + phy-mode = "2500base-x"; + }; + }; + }; +}; diff --git a/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7981-rfb-mxl-2p5g-phy-swp5.dtso b/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7981-rfb-mxl-2p5g-phy-swp5.dtso new file mode 100644 index 00000000000000..710e6c0bcfbee2 --- /dev/null +++ b/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7981-rfb-mxl-2p5g-phy-swp5.dtso @@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */ +/dts-v1/; +/plugin/; + +#include + +/ { + compatible = "mediatek,mt7981-rfb", "mediatek,mt7981"; + + fragment@0 { + target = <&sw_p5>; + __overlay__ { + phy-mode = "2500base-x"; + phy-handle = <&phy5>; + status = "okay"; + }; + }; + + fragment@1 { + target = <&mdio_bus>; + __overlay__ { + reset-gpios = <&pio 14 GPIO_ACTIVE_LOW>; + reset-delay-us = <600>; + reset-post-delay-us = <20000>; + + phy5: ethernet-phy@5 { + reg = <5>; + compatible = "ethernet-phy-ieee802.3-c45"; + phy-mode = "2500base-x"; + }; + }; + }; +}; diff --git a/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7981-rfb-spim-nand.dtso b/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7981-rfb-spim-nand.dtso new file mode 100644 index 00000000000000..5b51dfd671c228 --- /dev/null +++ b/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7981-rfb-spim-nand.dtso @@ -0,0 +1,66 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */ +/dts-v1/; +/plugin/; + +/ { + compatible = "mediatek,mt7981-rfb", "mediatek,mt7981"; + + fragment@0 { + target = <&spi0>; + __overlay__ { + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + + spi_nand: spi_nand@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spi-nand"; + reg = <1>; + spi-max-frequency = <10000000>; + 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 = <0x00000 0x0100000>; + read-only; + }; + + partition@100000 { + label = "u-boot-env"; + reg = <0x0100000 0x0080000>; + }; + + factory: partition@180000 { + label = "Factory"; + reg = <0x180000 0x0200000>; + }; + + partition@380000 { + label = "FIP"; + reg = <0x380000 0x0200000>; + }; + + partition@580000 { + label = "ubi"; + reg = <0x580000 0x4000000>; + }; + }; + }; + }; + }; + + fragment@1 { + target = <&wifi>; + __overlay__ { + mediatek,mtd-eeprom = <&factory 0x0>; + status = "okay"; + }; + }; +}; diff --git a/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7981-rfb.dts b/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7981-rfb.dts new file mode 100644 index 00000000000000..b2bb6929562ebd --- /dev/null +++ b/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7981-rfb.dts @@ -0,0 +1,188 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright (C) 2022 MediaTek Inc. + * Author: Sam.Shih + */ + +/dts-v1/; +#include "mt7981.dtsi" + +/ { + model = "MediaTek MT7981 RFB"; + compatible = "mediatek,mt7981-rfb", "mediatek,mt7981"; + + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory { + reg = <0 0x40000000 0 0x20000000>; + }; + + 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; + }; + + reg_5v: regulator-5v { + compatible = "regulator-fixed"; + regulator-name = "fixed-5V"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-boot-on; + regulator-always-on; + }; + + gpio-keys { + compatible = "gpio-keys"; + reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + wps { + label = "wps"; + linux,code = ; + gpios = <&pio 0 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +ð { + 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 = "gmii"; + phy-handle = <&int_gbe_phy>; + }; +}; + +&mdio_bus { + switch: switch@1f { + compatible = "mediatek,mt7531"; + reg = <31>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&pio>; + interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; + reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>; + }; +}; + +&crypto { + status = "okay"; +}; + +&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 = ; + bias-pull-up = ; + }; + conf-pd { + pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; + drive-strength = ; + bias-pull-down = ; + }; + }; + +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_flash_pins>; + cs-gpios = <0>, <0>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; +}; + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan1"; + }; + + port@1 { + reg = <1>; + label = "lan2"; + }; + + port@2 { + reg = <2>; + label = "lan3"; + }; + + port@3 { + reg = <3>; + label = "lan4"; + }; + + sw_p5: port@5 { + reg = <5>; + label = "lan5"; + status = "disabled"; + }; + + port@6 { + reg = <6>; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; +}; + +&xhci { + vusb33-supply = <®_3p3v>; + vbus-supply = <®_5v>; + status = "okay"; +}; + +&uart0 { + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; diff --git a/target/linux/mediatek/files-6.1/arch/arm64/boot/dts/mediatek/mt7981-rfb-mxl-2p5g-phy-eth1.dtso b/target/linux/mediatek/files-6.1/arch/arm64/boot/dts/mediatek/mt7981-rfb-mxl-2p5g-phy-eth1.dtso new file mode 100644 index 00000000000000..4d0e5c04067b39 --- /dev/null +++ b/target/linux/mediatek/files-6.1/arch/arm64/boot/dts/mediatek/mt7981-rfb-mxl-2p5g-phy-eth1.dtso @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */ +/dts-v1/; +/plugin/; + +#include + +/ { + compatible = "mediatek,mt7981-rfb", "mediatek,mt7981"; + + fragment@0 { + target = <&gmac1>; + __overlay__ { + phy-mode = "2500base-x"; + phy-handle = <&phy5>; + }; + }; + + fragment@1 { + target = <&mdio_bus>; + __overlay__ { + reset-gpios = <&pio 14 GPIO_ACTIVE_LOW>; + reset-delay-us = <600>; + reset-post-delay-us = <20000>; + + phy5: ethernet-phy@5 { + reg = <5>; + compatible = "ethernet-phy-ieee802.3-c45"; + phy-mode = "2500base-x"; + }; + }; + }; +}; diff --git a/target/linux/mediatek/files-6.1/arch/arm64/boot/dts/mediatek/mt7981-rfb-mxl-2p5g-phy-swp5.dtso b/target/linux/mediatek/files-6.1/arch/arm64/boot/dts/mediatek/mt7981-rfb-mxl-2p5g-phy-swp5.dtso new file mode 100644 index 00000000000000..710e6c0bcfbee2 --- /dev/null +++ b/target/linux/mediatek/files-6.1/arch/arm64/boot/dts/mediatek/mt7981-rfb-mxl-2p5g-phy-swp5.dtso @@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */ +/dts-v1/; +/plugin/; + +#include + +/ { + compatible = "mediatek,mt7981-rfb", "mediatek,mt7981"; + + fragment@0 { + target = <&sw_p5>; + __overlay__ { + phy-mode = "2500base-x"; + phy-handle = <&phy5>; + status = "okay"; + }; + }; + + fragment@1 { + target = <&mdio_bus>; + __overlay__ { + reset-gpios = <&pio 14 GPIO_ACTIVE_LOW>; + reset-delay-us = <600>; + reset-post-delay-us = <20000>; + + phy5: ethernet-phy@5 { + reg = <5>; + compatible = "ethernet-phy-ieee802.3-c45"; + phy-mode = "2500base-x"; + }; + }; + }; +}; diff --git a/target/linux/mediatek/files-6.1/arch/arm64/boot/dts/mediatek/mt7981-rfb-spim-nand.dtso b/target/linux/mediatek/files-6.1/arch/arm64/boot/dts/mediatek/mt7981-rfb-spim-nand.dtso new file mode 100644 index 00000000000000..5b51dfd671c228 --- /dev/null +++ b/target/linux/mediatek/files-6.1/arch/arm64/boot/dts/mediatek/mt7981-rfb-spim-nand.dtso @@ -0,0 +1,66 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */ +/dts-v1/; +/plugin/; + +/ { + compatible = "mediatek,mt7981-rfb", "mediatek,mt7981"; + + fragment@0 { + target = <&spi0>; + __overlay__ { + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + + spi_nand: spi_nand@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spi-nand"; + reg = <1>; + spi-max-frequency = <10000000>; + 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 = <0x00000 0x0100000>; + read-only; + }; + + partition@100000 { + label = "u-boot-env"; + reg = <0x0100000 0x0080000>; + }; + + factory: partition@180000 { + label = "Factory"; + reg = <0x180000 0x0200000>; + }; + + partition@380000 { + label = "FIP"; + reg = <0x380000 0x0200000>; + }; + + partition@580000 { + label = "ubi"; + reg = <0x580000 0x4000000>; + }; + }; + }; + }; + }; + + fragment@1 { + target = <&wifi>; + __overlay__ { + mediatek,mtd-eeprom = <&factory 0x0>; + status = "okay"; + }; + }; +}; diff --git a/target/linux/mediatek/files-6.1/arch/arm64/boot/dts/mediatek/mt7981-rfb.dts b/target/linux/mediatek/files-6.1/arch/arm64/boot/dts/mediatek/mt7981-rfb.dts new file mode 100644 index 00000000000000..b2bb6929562ebd --- /dev/null +++ b/target/linux/mediatek/files-6.1/arch/arm64/boot/dts/mediatek/mt7981-rfb.dts @@ -0,0 +1,188 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright (C) 2022 MediaTek Inc. + * Author: Sam.Shih + */ + +/dts-v1/; +#include "mt7981.dtsi" + +/ { + model = "MediaTek MT7981 RFB"; + compatible = "mediatek,mt7981-rfb", "mediatek,mt7981"; + + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory { + reg = <0 0x40000000 0 0x20000000>; + }; + + 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; + }; + + reg_5v: regulator-5v { + compatible = "regulator-fixed"; + regulator-name = "fixed-5V"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-boot-on; + regulator-always-on; + }; + + gpio-keys { + compatible = "gpio-keys"; + reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + wps { + label = "wps"; + linux,code = ; + gpios = <&pio 0 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +ð { + 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 = "gmii"; + phy-handle = <&int_gbe_phy>; + }; +}; + +&mdio_bus { + switch: switch@1f { + compatible = "mediatek,mt7531"; + reg = <31>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&pio>; + interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; + reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>; + }; +}; + +&crypto { + status = "okay"; +}; + +&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 = ; + bias-pull-up = ; + }; + conf-pd { + pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; + drive-strength = ; + bias-pull-down = ; + }; + }; + +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_flash_pins>; + cs-gpios = <0>, <0>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; +}; + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan1"; + }; + + port@1 { + reg = <1>; + label = "lan2"; + }; + + port@2 { + reg = <2>; + label = "lan3"; + }; + + port@3 { + reg = <3>; + label = "lan4"; + }; + + sw_p5: port@5 { + reg = <5>; + label = "lan5"; + status = "disabled"; + }; + + port@6 { + reg = <6>; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; +}; + +&xhci { + vusb33-supply = <®_3p3v>; + vbus-supply = <®_5v>; + status = "okay"; +}; + +&uart0 { + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&watchdog { + 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 680bee604f8cc6..42490cf8b3a0d9 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 @@ -11,10 +11,12 @@ mediatek_setup_interfaces() acer,predator-w6) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 game" eth1 ;; - asus,tuf-ax4200) + asus,tuf-ax4200|\ + mediatek,mt7981-rfb) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" eth1 ;; netgear,wax220|\ + ubnt,unifi-6-plus|\ zyxel,nwa50ax-pro) ucidef_set_interface_lan "eth0" ;; 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 c3d7c099740546..f6f18272cc3d06 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 @@ -14,6 +14,13 @@ case "$FIRMWARE" in ;; esac ;; +"mediatek/mt7981_eeprom_mt7976_dbdc.bin") + case "$board" in + ubnt,unifi-6-plus) + caldata_extract_mmc "factory" 0x0 0x1000 + ;; + esac + ;; "mediatek/mt7986_eeprom_mt7976.bin") case "$board" in acer,predator-w6) 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 ea8593906804a6..0fc90bd41b1076 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 @@ -58,6 +58,11 @@ case "$board" in [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 3 > /sys${DEVPATH}/macaddress ;; + ubnt,unifi-6-plus) + addr=$(mtd_get_mac_binary EEPROM 0x6) + [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress + ;; qihoo,360t7) addr=$(mtd_get_mac_ascii factory lanMac) [ "$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 f9f71a2b39119d..6155ddab72687f 100755 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -88,7 +88,13 @@ platform_do_upgrade() { CI_UBIPART="ubi0" nand_do_upgrade "$1" ;; + ubnt,unifi-6-plus) + CI_KERNPART="kernel0" + EMMC_ROOT_DEV="$(cmdline_get_var root)" + emmc_do_upgrade "$1" + ;; h3c,magic-nx30-pro|\ + mediatek,mt7981-rfb|\ qihoo,360t7|\ tplink,tl-xdr4288|\ tplink,tl-xdr6086|\ @@ -144,6 +150,9 @@ platform_copy_config() { ;; esac ;; + ubnt,unifi-6-plus) + emmc_copy_config + ;; esac } diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 571815249ff46d..c9cf30b1cea1c6 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -282,6 +282,61 @@ define Device/netgear_wax220 endef TARGET_DEVICES += netgear_wax220 +define Device/mediatek_mt7981-rfb + DEVICE_VENDOR := MediaTek + DEVICE_MODEL := MT7981 rfb + DEVICE_DTS := mt7981-rfb + DEVICE_DTS_OVERLAY:= \ + mt7981-rfb-spim-nand \ + mt7981-rfb-mxl-2p5g-phy-eth1 \ + mt7981-rfb-mxl-2p5g-phy-swp5 + DEVICE_DTS_DIR := $(DTS_DIR)/ + DEVICE_DTC_FLAGS := --pad 4096 + DEVICE_DTS_LOADADDR := 0x43f00000 + DEVICE_PACKAGES := kmod-mt7981-firmware kmod-usb3 e2fsprogs f2fsck mkf2fs mt7981-wo-firmware + KERNEL_LOADADDR := 0x44000000 + KERNEL := kernel-bin | gzip + KERNEL_INITRAMFS := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k + KERNEL_INITRAMFS_SUFFIX := .itb + KERNEL_IN_UBI := 1 + UBOOTENV_IN_UBI := 1 + IMAGES := sysupgrade.itb + IMAGE_SIZE := $$(shell expr 64 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m + IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-with-rootfs | pad-rootfs | append-metadata + ARTIFACTS := \ + emmc-preloader.bin emmc-bl31-uboot.fip \ + nor-preloader.bin nor-bl31-uboot.fip \ + sdcard.img.gz \ + snfi-nand-preloader.bin snfi-nand-bl31-uboot.fip \ + spim-nand-preloader.bin spim-nand-bl31-uboot.fip + ARTIFACT/emmc-preloader.bin := mt7981-bl2 emmc-ddr3 + ARTIFACT/emmc-bl31-uboot.fip := mt7981-bl31-uboot rfb-emmc + ARTIFACT/nor-preloader.bin := mt7981-bl2 nor-ddr3 + ARTIFACT/nor-bl31-uboot.fip := mt7981-bl31-uboot rfb-emmc + ARTIFACT/snfi-nand-preloader.bin := mt7981-bl2 snand-ddr3 + ARTIFACT/snfi-nand-bl31-uboot.fip := mt7981-bl31-uboot rfb-snfi + ARTIFACT/spim-nand-preloader.bin := mt7981-bl2 spim-nand-ddr3 + ARTIFACT/spim-nand-bl31-uboot.fip := mt7981-bl31-uboot rfb-spim-nand + ARTIFACT/sdcard.img.gz := mt798x-gpt sdmmc |\ + pad-to 17k | mt7981-bl2 sdmmc-ddr3 |\ + pad-to 6656k | mt7981-bl31-uboot rfb-sd |\ + $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),\ + pad-to 12M | append-image-stage initramfs.itb | check-size 44m |\ + ) \ + pad-to 44M | mt7981-bl2 spim-nand-ddr3 |\ + pad-to 45M | mt7981-bl31-uboot rfb-spim-nand |\ + pad-to 49M | mt7981-bl2 nor-ddr3 |\ + pad-to 50M | mt7981-bl31-uboot rfb-nor |\ + pad-to 51M | mt7981-bl2 snand-ddr3 |\ + pad-to 53M | mt7981-bl31-uboot rfb-snfi |\ + $(if $(CONFIG_TARGET_ROOTFS_SQUASHFS),\ + pad-to 64M | append-image squashfs-sysupgrade.itb | check-size |\ + ) \ + gzip +endef +TARGET_DEVICES += mediatek_mt7981-rfb + define Device/mediatek_mt7986a-rfb-nand DEVICE_VENDOR := MediaTek DEVICE_MODEL := MT7986 rfba AP (NAND) @@ -466,6 +521,16 @@ define Device/tplink_tl-xdr6088 endef TARGET_DEVICES += tplink_tl-xdr6088 +define Device/ubnt_unifi-6-plus + DEVICE_VENDOR := Ubiquiti + DEVICE_MODEL := UniFi 6 Plus + DEVICE_DTS := mt7981a-ubnt-unifi-6-plus + DEVICE_DTS_DIR := ../dts + DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware e2fsprogs f2fsck mkf2fs fdisk partx-utils + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += ubnt_unifi-6-plus + 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/target/linux/mediatek/image/mt7622.mk b/target/linux/mediatek/image/mt7622.mk index 53f5bd9d14ba9d..65db1ebe2e36fc 100644 --- a/target/linux/mediatek/image/mt7622.mk +++ b/target/linux/mediatek/image/mt7622.mk @@ -1,24 +1,31 @@ DTS_DIR := $(DTS_DIR)/mediatek +DEVICE_VARS += BUFFALO_TRX_MAGIC + define Image/Prepare # For UBI we want only one extra block rm -f $(KDIR)/ubi_mark echo -ne '\xde\xad\xc0\xde' > $(KDIR)/ubi_mark endef -define Build/buffalo-kernel-trx +define Build/buffalo-trx $(eval magic=$(word 1,$(1))) - $(eval dummy=$(word 2,$(1))) + $(eval kern_bin=$(if $(1),$(IMAGE_KERNEL),$@)) + $(eval rtfs_bin=$(word 2,$(1))) + $(eval apnd_bin=$(word 3,$(1))) $(eval kern_size=$(if $(KERNEL_SIZE),$(KERNEL_SIZE),0x400000)) - $(if $(dummy),touch $(dummy)) + $(if $(rtfs_bin),touch $(rtfs_bin)) $(STAGING_DIR_HOST)/bin/otrx create $@.new \ $(if $(magic),-M $(magic),) \ - -f $@ \ - $(if $(dummy),\ + -f $(kern_bin) \ + $(if $(rtfs_bin),\ -a 0x20000 \ -b $$(( $(subst k, * 1024,$(kern_size)) )) \ - -f $(dummy),) + -f $(rtfs_bin),) \ + $(if $(apnd_bin),\ + -A $(apnd_bin) \ + -a 0x20000) mv $@.new $@ endef @@ -51,19 +58,6 @@ define Build/mt7622-gpt rm $@.tmp endef -define Build/trx-nand - # kernel: always use 4 MiB (-28 B or TRX header) to allow upgrades even - # if it grows up between releases - # root: UBI with one extra block containing UBI mark to trigger erasing - # rest of partition - $(STAGING_DIR_HOST)/bin/otrx create $@.new \ - -M 0x32504844 \ - -f $(IMAGE_KERNEL) -a 0x20000 -b 0x400000 \ - -f $@ \ - -A $(KDIR)/ubi_mark -a 0x20000 - mv $@.new $@ -endef - define Device/bananapi_bpi-r64 DEVICE_VENDOR := Bananapi DEVICE_MODEL := BPi-R64 @@ -103,35 +97,56 @@ define Device/bananapi_bpi-r64 endef TARGET_DEVICES += bananapi_bpi-r64 -define Device/buffalo_wsr-2533dhp2 +define Device/buffalo_wsr DEVICE_VENDOR := Buffalo - DEVICE_MODEL := WSR-2533DHP2 - DEVICE_DTS := mt7622-buffalo-wsr-2533dhp2 DEVICE_DTS_DIR := ../dts - IMAGE_SIZE := 59392k - KERNEL_SIZE := 4096k + KERNEL_SIZE := 6144k BLOCKSIZE := 128k PAGESIZE := 2048 - SUBPAGESIZE := 512 UBINIZE_OPTS := -E 5 BUFFALO_TAG_PLATFORM := MTK BUFFALO_TAG_VERSION := 9.99 BUFFALO_TAG_MINOR := 9.99 IMAGES += factory.bin factory-uboot.bin - KERNEL_INITRAMFS := kernel-bin | lzma | \ + KERNEL_INITRAMFS = kernel-bin | lzma | \ fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | \ - buffalo-kernel-trx - IMAGE/factory.bin := append-ubi | trx-nand | \ - buffalo-enc WSR-2533DHP2 $$(BUFFALO_TAG_VERSION) -l | \ - buffalo-tag-dhp WSR-2533DHP2 JP JP | buffalo-enc-tag -l | buffalo-dhp-image - IMAGE/factory-uboot.bin := append-ubi | trx-nand - IMAGE/sysupgrade.bin := append-kernel | \ - buffalo-kernel-trx 0x32504844 $(KDIR)/tmp/$$(DEVICE_NAME).null | \ + buffalo-trx + IMAGE/factory.bin = append-ubi | \ + buffalo-trx $$$$(BUFFALO_TRX_MAGIC) $$$$@ $(KDIR)/ubi_mark | \ + buffalo-enc $$(DEVICE_MODEL) $$(BUFFALO_TAG_VERSION) -l | \ + buffalo-tag-dhp $$(DEVICE_MODEL) JP JP | buffalo-enc-tag -l | buffalo-dhp-image + IMAGE/factory-uboot.bin := append-ubi | \ + buffalo-trx $$$$(BUFFALO_TRX_MAGIC) $$$$@ $(KDIR)/ubi_mark + IMAGE/sysupgrade.bin := \ + buffalo-trx $$$$(BUFFALO_TRX_MAGIC) $(KDIR)/tmp/$$(DEVICE_NAME).null | \ sysupgrade-tar kernel=$$$$@ | append-metadata +endef + +define Device/buffalo_wsr-2533dhp2 + $(Device/buffalo_wsr) + DEVICE_MODEL := WSR-2533DHP2 + DEVICE_DTS := mt7622-buffalo-wsr-2533dhp2 + IMAGE_SIZE := 59392k + SUBPAGESIZE := 512 + BUFFALO_TRX_MAGIC := 0x32504844 DEVICE_PACKAGES := kmod-mt7615-firmware swconfig + DEVICE_COMPAT_VERSION := 1.1 + DEVICE_COMPAT_MESSAGE := Partition table has been changed due to kernel size restrictions. \ + Please upgrade via sysupgrade with factory-uboot.bin image and '-F' option. \ + (Warning: your configurations will be erased!) endef TARGET_DEVICES += buffalo_wsr-2533dhp2 +define Device/buffalo_wsr-3200ax4s + $(Device/buffalo_wsr) + DEVICE_MODEL := WSR-3200AX4S + DEVICE_DTS := mt7622-buffalo-wsr-3200ax4s + IMAGE_SIZE := 24576k + BUFFALO_TRX_MAGIC := 0x33504844 + DEVICE_PACKAGES := kmod-mt7915-firmware +endef +TARGET_DEVICES += buffalo_wsr-3200ax4s + define Device/elecom_wrc-2533gent DEVICE_VENDOR := Elecom DEVICE_MODEL := WRC-2533GENT diff --git a/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network b/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network index 38db921f5c58e9..d1341099bc8d41 100644 --- a/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network @@ -9,6 +9,7 @@ mediatek_setup_interfaces() case $board in bananapi,bpi-r64|\ + buffalo,wsr-3200ax4s|\ elecom,wrc-x3200gst3|\ linksys,e8450|\ linksys,e8450-ubi|\ @@ -55,6 +56,11 @@ mediatek_setup_macs() local label_mac="" case $board in + buffalo,wsr-3200ax4s) + lan_mac=$(mtd_get_mac_ascii board_data "mac") + wan_mac=$lan_mac + label_mac=$lan_mac + ;; reyee,ax3200-e5|\ ruijie,rg-ew3200gx-pro) lan_mac=$(macaddr_add $(get_mac_label) 1) diff --git a/target/linux/mediatek/mt7622/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/mt7622/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index f8639e9f409147..7ee9f24071c598 100644 --- a/target/linux/mediatek/mt7622/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/mediatek/mt7622/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -13,6 +13,11 @@ case "$board" in bananapi,bpi-r64) [ "$PHYNBR" = "0" ] && macaddr_add $(cat /sys/class/net/eth0/address) 2 > /sys${DEVPATH}/macaddress ;; + buffalo,wsr-3200ax4s) + basemac=$(mtd_get_mac_ascii board_data "mac") + [ "$PHYNBR" = "0" ] && macaddr_add $basemac 1 > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "1" ] && macaddr_add $basemac 8 > /sys${DEVPATH}/macaddress + ;; reyee,ax3200-e5|\ ruijie,rg-ew3200gx-pro) [ "$PHYNBR" = "0" ] && macaddr_add $(get_mac_label) 3 > /sys${DEVPATH}/macaddress diff --git a/target/linux/mediatek/mt7622/base-files/etc/uci-defaults/05_fix-compat-version b/target/linux/mediatek/mt7622/base-files/etc/uci-defaults/05_fix-compat-version index c77e1cb8bd1927..83310378694da7 100644 --- a/target/linux/mediatek/mt7622/base-files/etc/uci-defaults/05_fix-compat-version +++ b/target/linux/mediatek/mt7622/base-files/etc/uci-defaults/05_fix-compat-version @@ -1,7 +1,8 @@ . /lib/functions.sh case "$(board_name)" in - bananapi,bpi-r64) + bananapi,bpi-r64|\ + buffalo,wsr-2533dhp2) uci set system.@system[0].compat_version="1.1" uci commit system ;; diff --git a/target/linux/mediatek/mt7622/base-files/etc/uci-defaults/09_fix_crc b/target/linux/mediatek/mt7622/base-files/etc/uci-defaults/09_fix_crc index 81cb6b18b7a80b..59b00a6e69b00b 100644 --- a/target/linux/mediatek/mt7622/base-files/etc/uci-defaults/09_fix_crc +++ b/target/linux/mediatek/mt7622/base-files/etc/uci-defaults/09_fix_crc @@ -7,4 +7,8 @@ buffalo,wsr-2533dhp2) mtd -M 0x44485032 ${kernel_size:+-c 0x$kernel_size} fixtrx firmware && exit 0 exit 1 ;; +buffalo,wsr-3200ax4s) + mtd -M 0x44485033 ${kernel_size:+-c 0x$kernel_size} fixtrx firmware && exit 0 + exit 1 + ;; esac diff --git a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh index b37b7b1c6e5772..ea3176d2d1e79f 100755 --- a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh @@ -21,7 +21,8 @@ platform_do_upgrade() { ;; esac ;; - buffalo,wsr-2533dhp2) + buffalo,wsr-2533dhp2|\ + buffalo,wsr-3200ax4s) local magic="$(get_magic_long "$1")" # use "mtd write" if the magic is "DHP2 (0x44485032)" @@ -67,7 +68,8 @@ platform_check_image() { [ "$#" -gt 1 ] && return 1 case "$board" in - buffalo,wsr-2533dhp2) + buffalo,wsr-2533dhp2|\ + buffalo,wsr-3200ax4s) buffalo_check_image "$board" "$magic" "$1" || return 1 ;; elecom,wrc-x3200gst3|\ diff --git a/target/linux/mediatek/patches-5.15/436-drivers-mtd-spi-nor-Add-calibration-support-for-spi-.patch b/target/linux/mediatek/patches-5.15/436-drivers-mtd-spi-nor-Add-calibration-support-for-spi-.patch index 25a7cd38614d26..61712982fb2607 100644 --- a/target/linux/mediatek/patches-5.15/436-drivers-mtd-spi-nor-Add-calibration-support-for-spi-.patch +++ b/target/linux/mediatek/patches-5.15/436-drivers-mtd-spi-nor-Add-calibration-support-for-spi-.patch @@ -26,7 +26,7 @@ Signed-off-by: SkyLake.Huang --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c -@@ -3060,6 +3060,18 @@ static void spi_nor_debugfs_init(struct +@@ -3061,6 +3061,18 @@ static void spi_nor_debugfs_init(struct info->id_len, info->id); } @@ -45,7 +45,7 @@ Signed-off-by: SkyLake.Huang static const struct flash_info *spi_nor_get_flash_info(struct spi_nor *nor, const char *name) { -@@ -3133,6 +3145,9 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -3134,6 +3146,9 @@ int spi_nor_scan(struct spi_nor *nor, co if (!nor->bouncebuf) return -ENOMEM; diff --git a/target/linux/mediatek/patches-6.1/436-drivers-mtd-spi-nor-Add-calibration-support-for-spi-.patch b/target/linux/mediatek/patches-6.1/436-drivers-mtd-spi-nor-Add-calibration-support-for-spi-.patch index 704b81654af7db..1f747d1f4fd696 100644 --- a/target/linux/mediatek/patches-6.1/436-drivers-mtd-spi-nor-Add-calibration-support-for-spi-.patch +++ b/target/linux/mediatek/patches-6.1/436-drivers-mtd-spi-nor-Add-calibration-support-for-spi-.patch @@ -26,7 +26,7 @@ Signed-off-by: SkyLake.Huang --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c -@@ -2899,6 +2899,18 @@ static const struct flash_info *spi_nor_ +@@ -2900,6 +2900,18 @@ static const struct flash_info *spi_nor_ return NULL; } @@ -45,7 +45,7 @@ Signed-off-by: SkyLake.Huang static const struct flash_info *spi_nor_get_flash_info(struct spi_nor *nor, const char *name) { -@@ -3002,6 +3014,9 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -3003,6 +3015,9 @@ int spi_nor_scan(struct spi_nor *nor, co if (!nor->bouncebuf) return -ENOMEM; diff --git a/target/linux/mpc85xx/base-files/etc/board.d/01_leds b/target/linux/mpc85xx/base-files/etc/board.d/01_leds index d9b4d2d79d32b9..7e1d379efe4d51 100644 --- a/target/linux/mpc85xx/base-files/etc/board.d/01_leds +++ b/target/linux/mpc85xx/base-files/etc/board.d/01_leds @@ -8,7 +8,10 @@ boardname="${board##*,}" board_config_update case $board in -enterasys,ws-ap3715i|\ +enterasys,ws-ap3715i) + ucidef_set_led_netdev "lan1" "LAN1" "green:lan1" "eth0" + ucidef_set_led_netdev "lan2" "LAN2" "green:lan2" "eth1" + ;; extreme-networks,ws-ap3825i) ucidef_set_led_netdev "lan1" "LAN1" "green:lan1" "eth1" ucidef_set_led_netdev "lan2" "LAN2" "green:lan2" "eth0" diff --git a/target/linux/mvebu/cortexa53/base-files/etc/board.d/02_network b/target/linux/mvebu/cortexa53/base-files/etc/board.d/02_network index 489090d77ca772..6789edb8613c33 100644 --- a/target/linux/mvebu/cortexa53/base-files/etc/board.d/02_network +++ b/target/linux/mvebu/cortexa53/base-files/etc/board.d/02_network @@ -21,9 +21,16 @@ globalscale,espressobin-ultra) ucidef_set_interfaces_lan_wan "lan0 lan1 lan2 lan3" "wan" ;; marvell,armada-3720-db|\ -methode,udpu|\ +methode,udpu) + ucidef_set_interfaces_lan_wan "eth1" "eth0" + ;; methode,edpu) + # eDPU+ has a 88E6361 switch, so we check for it + if ip link | grep -q uplink; then + ucidef_set_interfaces_lan_wan "downlink" "uplink" + else ucidef_set_interfaces_lan_wan "eth1" "eth0" + fi ;; *) ucidef_set_interface_lan "eth0" diff --git a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-eDPU.dts b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-eDPU.dts index 4db8b946df2e5f..35f107b63b5431 100644 --- a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-eDPU.dts +++ b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-eDPU.dts @@ -17,3 +17,50 @@ ð0 { phy-mode = "1000base-x"; }; + +/* + * External MV88E6361 switch is only available on v2 of the board. + * U-Boot will enable the MDIO bus and switch nodes. + */ +&mdio { + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <&smi_pins>; + + /* Actual device is MV88E6361 */ + switch: switch@0 { + compatible = "marvell,mv88e6190"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "cpu"; + phy-mode = "2500base-x"; + managed = "in-band-status"; + ethernet = <ð0>; + }; + + port@9 { + reg = <9>; + label = "downlink"; + phy-mode = "2500base-x"; + managed = "in-band-status"; + }; + + port@a { + reg = <10>; + label = "uplink"; + phy-mode = "2500base-x"; + managed = "in-band-status"; + sfp = <&sfp_eth1>; + }; + }; + }; +}; diff --git a/target/linux/pistachio/patches-5.15/401-mtd-nor-support-mtd-name-from-device-tree.patch b/target/linux/pistachio/patches-5.15/401-mtd-nor-support-mtd-name-from-device-tree.patch index 163bafdb2e5b34..7db6346c37e418 100644 --- a/target/linux/pistachio/patches-5.15/401-mtd-nor-support-mtd-name-from-device-tree.patch +++ b/target/linux/pistachio/patches-5.15/401-mtd-nor-support-mtd-name-from-device-tree.patch @@ -10,7 +10,7 @@ Signed-off-by: Abhimanyu Vishwakarma --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c -@@ -3107,6 +3107,7 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -3108,6 +3108,7 @@ int spi_nor_scan(struct spi_nor *nor, co struct device *dev = nor->dev; struct mtd_info *mtd = &nor->mtd; struct device_node *np = spi_nor_get_flash_node(nor); @@ -18,7 +18,7 @@ Signed-off-by: Abhimanyu Vishwakarma int ret; int i; -@@ -3161,7 +3162,12 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -3162,7 +3163,12 @@ int spi_nor_scan(struct spi_nor *nor, co if (ret) return ret; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-wax620.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-wax620.dts new file mode 100644 index 00000000000000..d1c3245c8baf0c --- /dev/null +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-wax620.dts @@ -0,0 +1,201 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include "ipq8074.dtsi" +#include "ipq8074-hk-cpu.dtsi" +#include "ipq8074-ess.dtsi" +#include +#include + +/ { + model = "Netgear WAX620"; + compatible = "netgear,wax620", "qcom,ipq8074"; + + aliases { + serial0 = &blsp1_uart5; + ethernet0 = &dp6; + led-boot = &led_system_blue; + led-failsafe = &led_system_red; + led-running = &led_system_green; + led-upgrade = &led_system_blue; + }; + + chosen { + stdout-path = "serial0:115200n8"; + /* + * Netgear's U-Boot adds "ubi.mtd=rootfs root=mtd:ubi_rootfs" + * That fails to create a UBI block device, so add it here. + */ + bootargs-append = " root=/dev/ubiblock0_1"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 52 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + led_spi { + compatible = "spi-gpio"; + #address-cells = <1>; + #size-cells = <0>; + + sck-gpios = <&tlmm 18 GPIO_ACTIVE_HIGH>; + mosi-gpios = <&tlmm 19 GPIO_ACTIVE_HIGH>; + + led_gpio: led_gpio@0 { + compatible = "fairchild,74hc595"; + reg = <0>; + gpio-controller; + #gpio-cells = <2>; + registers-number = <1>; + enable-gpios = <&tlmm 20 GPIO_ACTIVE_HIGH>; + spi-max-frequency = <1000000>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_system_red: system-red { + label = "system:red"; + gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; + }; + + led_system_green: system-green { + label = "system:green"; + gpios = <&tlmm 55 GPIO_ACTIVE_HIGH>; + }; + + led_system_blue: system-blue { + label = "system:blue"; + gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; + }; + + led_lan_g { + label = "lan:green"; + gpios = <&led_gpio 0 GPIO_ACTIVE_HIGH>; + }; + + led_lan_o { + label = "lan:orange"; + gpios = <&led_gpio 1 GPIO_ACTIVE_HIGH>; + }; + + led_2g_b { + label = "wlan2g:blue"; + gpios = <&led_gpio 2 GPIO_ACTIVE_HIGH>; + }; + + led_2g_g { + label = "wlan2g:green"; + gpios = <&led_gpio 3 GPIO_ACTIVE_HIGH>; + }; + + led_5g_b { + label = "wlan5g:blue"; + gpios = <&led_gpio 4 GPIO_ACTIVE_HIGH>; + }; + + led_5g_g { + label = "wlan5g:green"; + gpios = <&led_gpio 5 GPIO_ACTIVE_HIGH>; + }; + + }; +}; + +&edma { + status = "okay"; +}; + +&switch { + status = "okay"; + + switch_cpu_bmp = <0x01>; + switch_lan_bmp = <0x3e>; + switch_wan_bmp = <0x40>; + switch_mac_mode = <0x00>; + switch_mac_mode1 = <0xff>; + switch_mac_mode2 = <0x0f>; + bm_tick_mode = <0x00>; + tm_tick_mode = <0x00>; + + qcom,port_phyinfo { + port@5 { + port_id = <6>; + phy_address = <28>; + port_mac_sel = "QGMAC_PORT"; + }; + }; +}; + +&tlmm { + mdio_pins: mdio-pins { + mdc { + pins = "gpio68"; + function = "mdc"; + drive-strength = <8>; + bias-pull-up; + }; + + mdio { + pins = "gpio69"; + function = "mdio"; + drive-strength = <8>; + bias-pull-up; + }; + }; +}; + +&mdio { + status = "okay"; + + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 44 GPIO_ACTIVE_LOW>; + + qca8081_28: ethernet-phy@28 { + reg = <28>; + }; +}; + +&dp6 { + status = "okay"; + phy-handle = <&qca8081_28>; + label = "lan"; +}; + +&qpic_bam { + status = "okay"; +}; + +&qpic_nand { + status = "okay"; + + nand@0 { + reg = <0>; + nand-ecc-strength = <4>; + nand-ecc-step-size = <512>; + nand-bus-width = <8>; + + partitions { + compatible = "qcom,smem-part"; + }; + }; +}; + +&blsp1_uart5 { + status = "okay"; +}; + +&wifi { + status = "okay"; + + qcom,ath11k-calibration-variant = "Netgear-WAX620"; +}; diff --git a/target/linux/qualcommax/image/ipq807x.mk b/target/linux/qualcommax/image/ipq807x.mk index 440a2674976c87..b61b721f3a4f55 100644 --- a/target/linux/qualcommax/image/ipq807x.mk +++ b/target/linux/qualcommax/image/ipq807x.mk @@ -115,6 +115,20 @@ define Device/netgear_rax120v2 endef TARGET_DEVICES += netgear_rax120v2 +define Device/netgear_wax620 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Netgear + DEVICE_MODEL := WAX620 + DEVICE_DTS_CONFIG := config@hk07 + BLOCKSIZE := 128k + PAGESIZE := 2048 + SOC := ipq8072 + DEVICE_PACKAGES += kmod-spi-gpio kmod-gpio-nxp-74hc164 \ + ipq-wifi-netgear_wax620 +endef +TARGET_DEVICES += netgear_wax620 + define Device/netgear_wax218 $(call Device/FitImage) $(call Device/UbiFit) diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/01_leds b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/01_leds index 6e2ec60403a95a..913b58750c276d 100644 --- a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/01_leds +++ b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/01_leds @@ -12,6 +12,9 @@ edgecore,eap102) netgear,rax120v2) ucidef_set_led_netdev "aqr" "AQR" "white:aqr" "lan5" ;; +netgear,wax620) + ucidef_set_led_netdev "lan" "LAN" "lan:green" "lan" + ;; netgear,wax218) ucidef_set_led_netdev "lan" "LAN" "blue:lan" "lan" ucidef_set_led_wlan "wlan5g" "WIFI 5GHz" "blue:wlan5g" "phy0radio" diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network index 3953ae8db2e3f8..ad8e34e9fe3156 100644 --- a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network +++ b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network @@ -25,7 +25,8 @@ ipq807x_setup_interfaces() netgear,rax120v2) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5" "wan" ;; - netgear,wax218) + netgear,wax218|\ + netgear,wax620) ucidef_set_interface_lan "lan" "dhcp" ;; prpl,haze) diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata index 742730f4760069..cba1f84b7fab9a 100644 --- a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata +++ b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata @@ -16,6 +16,7 @@ case "$FIRMWARE" in dynalink,dl-wrx36|\ netgear,rax120v2|\ netgear,wax218|\ + netgear,wax620|\ qnap,301w|\ redmi,ax6|\ xiaomi,ax3600|\ diff --git a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh index a7af1cc1df14f1..90ebff17d485db 100644 --- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh @@ -69,7 +69,8 @@ platform_do_upgrade() { compex,wpq873|\ edimax,cax1800|\ netgear,rax120v2|\ - netgear,wax218) + netgear,wax218|\ + netgear,wax620) nand_do_upgrade "$1" ;; prpl,haze|\ diff --git a/target/linux/ramips/dts/mt7621_wavlink_wl-wn573hx1.dts b/target/linux/ramips/dts/mt7621_wavlink_wl-wn573hx1.dts new file mode 100755 index 00000000000000..d8a94c85b9fa69 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_wavlink_wl-wn573hx1.dts @@ -0,0 +1,133 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "wavlink,wl-wn573hx1", "mediatek,mt7621-soc"; + model = "WAVLINK WL-WN573HX1"; + + aliases { + led-boot = &led_status_blue; + led-failsafe = &led_status_blue; + led-running = &led_status_blue; + led-upgrade = &led_status_blue; + label-mac-device = &gmac0; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status_blue:status_led { + label = "blue:status_led"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_3fff4>; + nvmem-cell-names = "mac-address"; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0>; + }; +}; + +&spi0 { + status = "okay"; + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <14000000>; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x00000 0x30000>; + }; + + partition@30000 { + label = "config"; + reg = <0x30000 0x10000>; + }; + + factory:partition@50000 { + label = "factory"; + reg = <0x50000 0x40000>; + }; + + partition@90000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x90000 0xf70000>; + }; + }; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_3fff4>; + nvmem-cell-names = "mac-address"; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + +&switch0 { + ports { + port@3 { + status = "okay"; + label = "lan"; + }; + }; +}; + + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_3fff4: macaddr@3fff4 { + reg = <0x3fff4 0x6>; + }; + +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index abcdc08ade3d25..0710564fa51f2c 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -119,7 +119,7 @@ define Build/belkin-header ( \ type_fw_date=$$(printf "01%02x%02x%02x" \ - $$(date -d "@$(SOURCE_DATE_EPOCH)" "+%y %m %d")); \ + $$(date -d "@$(SOURCE_DATE_EPOCH)" "+%-y %-m %-d")); \ hw_fw_ver=$$(printf "%02x%02x%02x%02x" \ $(hw_ver) $$(echo $(fw_ver) | cut -d. -f-3 | tr . ' ')); \ fw_len_crc=$$(gzip -c $@ | tail -c 8 | od -An -tx8 | tr -d ' \n'); \ @@ -2546,6 +2546,20 @@ define Device/wavlink_ws-wn572hp3-4g endef TARGET_DEVICES += wavlink_ws-wn572hp3-4g + +define Device/wavlink_wl-wn573hx1 + $(Device/uimage-lzma-loader) + IMAGE_SIZE := 15808k + DEVICE_VENDOR := Wavlink + DEVICE_MODEL := WL-WN573HX1 + DEVICE_PACKAGES := kmod-mt7915-firmware -uboot-envtools + IMAGES += factory.bin + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \ + check-size | append-metadata + IMAGE/factory.bin := append-kernel | append-rootfs | pad-rootfs | check-size +endef +TARGET_DEVICES += wavlink_wl-wn573hx1 + define Device/wevo_11acnas $(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 a162cb9d1de705..4496bf8f9f3461 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 @@ -17,6 +17,7 @@ ramips_setup_interfaces() h3c,tx1806|\ haier,har-20s2u1|\ hiwifi,hc5962|\ + mercusys,mr70x-v1|\ netgear,wax202|\ sim,simax1800t|\ xiaomi,mi-router-3-pro|\ @@ -55,6 +56,7 @@ ramips_setup_interfaces() ubnt,unifi-flexhd|\ ubnt,unifi-nanohd|\ yuncore,fap690|\ + wavlink,wl-wn573hx1|\ zyxel,nwa50ax|\ zyxel,nwa55axe) ucidef_set_interface_lan "lan" diff --git a/target/linux/ramips/patches-5.15/405-mtd-spi-nor-Add-support-for-BoHong-bh25q128as.patch b/target/linux/ramips/patches-5.15/405-mtd-spi-nor-Add-support-for-BoHong-bh25q128as.patch index 4fd05fe64ed74e..4cbb84efc6ca7a 100644 --- a/target/linux/ramips/patches-5.15/405-mtd-spi-nor-Add-support-for-BoHong-bh25q128as.patch +++ b/target/linux/ramips/patches-5.15/405-mtd-spi-nor-Add-support-for-BoHong-bh25q128as.patch @@ -55,7 +55,7 @@ Signed-off-by: David Bauer +}; --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c -@@ -1843,6 +1843,7 @@ int spi_nor_sr2_bit7_quad_enable(struct +@@ -1844,6 +1844,7 @@ int spi_nor_sr2_bit7_quad_enable(struct static const struct spi_nor_manufacturer *manufacturers[] = { &spi_nor_atmel, diff --git a/target/linux/ramips/patches-5.15/700-net-ethernet-mediatek-support-net-labels.patch b/target/linux/ramips/patches-5.15/700-net-ethernet-mediatek-support-net-labels.patch index 632e66eab470fe..ff492e7f6c7d37 100644 --- a/target/linux/ramips/patches-5.15/700-net-ethernet-mediatek-support-net-labels.patch +++ b/target/linux/ramips/patches-5.15/700-net-ethernet-mediatek-support-net-labels.patch @@ -14,7 +14,7 @@ Signed-off-by: René van Dorst --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -4554,6 +4554,7 @@ static const struct net_device_ops mtk_n +@@ -4557,6 +4557,7 @@ static const struct net_device_ops mtk_n static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) { @@ -22,7 +22,7 @@ Signed-off-by: René van Dorst const __be32 *_id = of_get_property(np, "reg", NULL); phy_interface_t phy_mode; struct phylink *phylink; -@@ -4725,6 +4726,9 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -4728,6 +4729,9 @@ static int mtk_add_mac(struct mtk_eth *e register_netdevice_notifier(&mac->device_notifier); } diff --git a/target/linux/realtek/patches-5.15/318-add-rtl83xx-clk-support.patch b/target/linux/realtek/patches-5.15/318-add-rtl83xx-clk-support.patch index c63c165cd28449..7d063d4faaa3df 100644 --- a/target/linux/realtek/patches-5.15/318-add-rtl83xx-clk-support.patch +++ b/target/linux/realtek/patches-5.15/318-add-rtl83xx-clk-support.patch @@ -13,7 +13,7 @@ Submitted-by: Markus Stockhausen --- a/drivers/clk/Kconfig +++ b/drivers/clk/Kconfig -@@ -405,6 +405,7 @@ source "drivers/clk/mstar/Kconfig" +@@ -406,6 +406,7 @@ source "drivers/clk/mstar/Kconfig" source "drivers/clk/mvebu/Kconfig" source "drivers/clk/pistachio/Kconfig" source "drivers/clk/qcom/Kconfig" diff --git a/target/linux/sunxi/Makefile b/target/linux/sunxi/Makefile index 32370f9c6582cc..62c9653bd49516 100644 --- a/target/linux/sunxi/Makefile +++ b/target/linux/sunxi/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk ARCH:=arm BOARD:=sunxi -BOARDNAME:=Allwinner A1x/A20/A3x/H3/H5/R40 -FEATURES:=fpu usb ext4 display rootfs-part rtc squashfs usbgadget +BOARDNAME:=Allwinner ARM SoCs +# FEATURES:=fpu usb ext4 display rootfs-part rtc squashfs usbgadget +FEATURES:=fpu usb ext4 display rootfs-part rtc squashfs SUBTARGETS:=cortexa8 cortexa7 cortexa53 -KERNEL_PATCHVER:=5.15 -KERNEL_TESTING_PATCHVER:=6.1 +KERNEL_PATCHVER:=6.1 KERNELNAME:=zImage dtbs @@ -22,6 +22,7 @@ KERNELNAME:=zImage dtbs # A80: octa Cortex-A15/A7 # H3: quad Cortex-A7 # R40: quad Cortex-A7 +# A64/H5/H6/H616: quad Cortex-A53 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/sunxi/cortexa53/config-6.1 b/target/linux/sunxi/cortexa53/config-6.1 index 54453d75eccbd5..f57c6645403ceb 100644 --- a/target/linux/sunxi/cortexa53/config-6.1 +++ b/target/linux/sunxi/cortexa53/config-6.1 @@ -66,6 +66,8 @@ CONFIG_PINCTRL_SUN50I_A64_R=y CONFIG_PINCTRL_SUN50I_H5=y CONFIG_PINCTRL_SUN50I_H6=y CONFIG_PINCTRL_SUN50I_H6_R=y +CONFIG_PINCTRL_SUN50I_H616=y +CONFIG_PINCTRL_SUN50I_H616_R=y # CONFIG_PREEMPT_DYNAMIC is not set CONFIG_QUEUED_RWLOCKS=y CONFIG_QUEUED_SPINLOCKS=y @@ -83,7 +85,7 @@ CONFIG_SUN50I_A100_R_CCU=y CONFIG_SUN50I_A64_CCU=y CONFIG_SUN50I_DE2_BUS=y CONFIG_SUN50I_ERRATUM_UNKNOWN1=y -# CONFIG_SUN50I_H616_CCU is not set +CONFIG_SUN50I_H616_CCU=y CONFIG_SUN50I_H6_CCU=y CONFIG_SUN50I_H6_R_CCU=y # CONFIG_SUN6I_RTC_CCU is not set diff --git a/target/linux/sunxi/cortexa53/target.mk b/target/linux/sunxi/cortexa53/target.mk index 9e3a4064be8dd4..771e07d29fcc0b 100644 --- a/target/linux/sunxi/cortexa53/target.mk +++ b/target/linux/sunxi/cortexa53/target.mk @@ -5,6 +5,6 @@ include $(TOPDIR)/rules.mk ARCH:=aarch64 -BOARDNAME:=Allwinner A64/H5 +BOARDNAME:=Allwinner A64/H5/H6/H616 CPU_TYPE:=cortex-a53 KERNELNAME:=Image dtbs diff --git a/target/linux/sunxi/image/cortexa53.mk b/target/linux/sunxi/image/cortexa53.mk index 08b7f767984b83..4bb729e9c63a87 100644 --- a/target/linux/sunxi/image/cortexa53.mk +++ b/target/linux/sunxi/image/cortexa53.mk @@ -24,6 +24,11 @@ define Device/sun50i-h6 $(Device/sun50i) endef +define Device/sun50i-h616 + SOC := sun50i-h616 + $(Device/sun50i) +endef + define Device/friendlyarm_nanopi-neo-plus2 DEVICE_VENDOR := FriendlyARM DEVICE_MODEL := NanoPi NEO Plus2 @@ -108,6 +113,13 @@ define Device/xunlong_orangepi-pc2 endef TARGET_DEVICES += xunlong_orangepi-pc2 +define Device/xunlong_orangepi-zero2 + DEVICE_VENDOR := Xunlong + DEVICE_MODEL := Orange Pi Zero 2 + $(Device/sun50i-h616) +endef +TARGET_DEVICES += xunlong_orangepi-zero2 + define Device/xunlong_orangepi-zero-plus DEVICE_VENDOR := Xunlong DEVICE_MODEL := Orange Pi Zero Plus diff --git a/target/linux/sunxi/image/cortexa7.mk b/target/linux/sunxi/image/cortexa7.mk index b2741b0f6589f7..0b7dcd15b00106 100644 --- a/target/linux/sunxi/image/cortexa7.mk +++ b/target/linux/sunxi/image/cortexa7.mk @@ -186,6 +186,15 @@ define Device/sinovoip_bananapi-m3 endef TARGET_DEVICES += sinovoip_bananapi-m3 +define Device/sinovoip_bananapi-p2-zero + DEVICE_VENDOR := Sinovoip + DEVICE_MODEL := Banana Pi P2 Zero + DEVICE_PACKAGES:=kmod-leds-gpio kmod-brcmfmac \ + cypress-firmware-43430-sdio wpad-basic-mbedtls + SOC := sun8i-h2-plus +endef +TARGET_DEVICES += sinovoip_bananapi-p2-zero + define Device/xunlong_orangepi-one DEVICE_VENDOR := Xunlong DEVICE_MODEL := Orange Pi One diff --git a/target/linux/sunxi/patches-6.1/410-sunxi-add-bananapi-p2-zero.patch b/target/linux/sunxi/patches-6.1/410-sunxi-add-bananapi-p2-zero.patch new file mode 100644 index 00000000000000..5b8dd170c59ffb --- /dev/null +++ b/target/linux/sunxi/patches-6.1/410-sunxi-add-bananapi-p2-zero.patch @@ -0,0 +1,292 @@ +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -1352,6 +1352,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \ + sun8i-a83t-cubietruck-plus.dtb \ + sun8i-a83t-tbs-a711.dtb \ + sun8i-h2-plus-bananapi-m2-zero.dtb \ ++ sun8i-h2-plus-bananapi-p2-zero.dtb \ + sun8i-h2-plus-libretech-all-h3-cc.dtb \ + sun8i-h2-plus-orangepi-r1.dtb \ + sun8i-h2-plus-orangepi-zero.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/sun8i-h2-plus-bananapi-p2-zero.dts +@@ -0,0 +1,279 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (C) 2023 Zoltan HERPAI ++ * ++ * Based on sun8i-h2-plus-bananapi-m2-zero.dts, which is: ++ * Copyright (C) 2017 Icenowy Zheng ++ */ ++ ++/dts-v1/; ++#include "sun8i-h3.dtsi" ++#include "sunxi-common-regulators.dtsi" ++ ++#include ++#include ++ ++/ { ++ model = "Banana Pi BPI-P2-Zero"; ++ compatible = "sinovoip,bpi-p2-zero", "allwinner,sun8i-h2-plus"; ++ ++ aliases { ++ serial0 = &uart0; ++ serial1 = &uart1; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ connector { ++ compatible = "hdmi-connector"; ++ type = "c"; ++ ++ port { ++ hdmi_con_in: endpoint { ++ remote-endpoint = <&hdmi_out_con>; ++ }; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ pwr_led { ++ label = "bananapi-p2-zero:red:pwr"; ++ gpios = <&r_pio 0 10 GPIO_ACTIVE_LOW>; /* PL10 */ ++ default-state = "on"; ++ }; ++ }; ++ ++ gpio_keys { ++ compatible = "gpio-keys"; ++ ++ sw4 { ++ label = "power"; ++ linux,code = ; ++ gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ reg_vdd_cpux: vdd-cpux-regulator { ++ compatible = "regulator-gpio"; ++ regulator-name = "vdd-cpux"; ++ regulator-type = "voltage"; ++ regulator-boot-on; ++ regulator-always-on; ++ regulator-min-microvolt = <1100000>; ++ regulator-max-microvolt = <1300000>; ++ regulator-ramp-delay = <50>; /* 4ms */ ++ ++ gpios = <&r_pio 0 1 GPIO_ACTIVE_HIGH>; /* PL1 */ ++ enable-active-high; ++ gpios-states = <0x1>; ++ states = <1100000 0>, <1300000 1>; ++ }; ++ ++ reg_vcc_dram: vcc-dram { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc-dram"; ++ regulator-min-microvolt = <1500000>; ++ regulator-max-microvolt = <1500000>; ++ regulator-always-on; ++ regulator-boot-on; ++ enable-active-high; ++ gpio = <&r_pio 0 9 GPIO_ACTIVE_HIGH>; /* PL9 */ ++ vin-supply = <®_vcc5v0>; ++ }; ++ ++ reg_vcc1v2: vcc1v2 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc1v2"; ++ regulator-min-microvolt = <1200000>; ++ regulator-max-microvolt = <1200000>; ++ regulator-always-on; ++ regulator-boot-on; ++ enable-active-high; ++ gpio = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */ ++ vin-supply = <®_vcc5v0>; ++ }; ++ ++ poweroff { ++ compatible = "regulator-poweroff"; ++ cpu-supply = <®_vcc1v2>; ++ }; ++ ++ wifi_pwrseq: wifi_pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */ ++ clocks = <&rtc 1>; ++ clock-names = "ext_clock"; ++ }; ++}; ++ ++&cpu0 { ++ cpu-supply = <®_vdd_cpux>; ++}; ++ ++&de { ++ status = "okay"; ++}; ++ ++&ehci0 { ++ status = "okay"; ++}; ++ ++&emac { ++ phy-handle = <&int_mii_phy>; ++ phy-mode = "mii"; ++ allwinner,leds-active-low; ++ status = "okay"; ++}; ++ ++&hdmi { ++ status = "okay"; ++}; ++ ++&hdmi_out { ++ hdmi_out_con: endpoint { ++ remote-endpoint = <&hdmi_con_in>; ++ }; ++}; ++ ++&mmc0 { ++ vmmc-supply = <®_vcc3v3>; ++ bus-width = <4>; ++ /* ++ * On the production batch of this board the card detect GPIO is ++ * high active (card inserted), although on the early samples it's ++ * low active. ++ */ ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ ++ status = "okay"; ++}; ++ ++&mmc1 { ++ vmmc-supply = <®_vcc3v3>; ++ vqmmc-supply = <®_vcc3v3>; ++ mmc-pwrseq = <&wifi_pwrseq>; ++ bus-width = <4>; ++ non-removable; ++ status = "okay"; ++ ++ brcmf: wifi@1 { ++ reg = <1>; ++ compatible = "brcm,bcm4329-fmac"; ++ interrupt-parent = <&pio>; ++ interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */ ++ interrupt-names = "host-wake"; ++ }; ++}; ++ ++&ohci0 { ++ status = "okay"; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pa_pins>; ++ status = "okay"; ++}; ++ ++&uart1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>; ++ uart-has-rtscts; ++ status = "okay"; ++ ++ bluetooth { ++ compatible = "brcm,bcm43438-bt"; ++ max-speed = <1500000>; ++ clocks = <&rtc 1>; ++ clock-names = "lpo"; ++ vbat-supply = <®_vcc3v3>; ++ vddio-supply = <®_vcc3v3>; ++ device-wakeup-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */ ++ host-wakeup-gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */ ++ shutdown-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */ ++ }; ++ ++}; ++ ++&pio { ++ gpio-line-names = ++ /* PA */ ++ "CON2-P13", "CON2-P11", "CON2-P22", "CON2-P15", ++ "CON3-P03", "CON3-P02", "CON2-P07", "CON2-P29", ++ "CON2-P31", "CON2-P33", "CON2-P35", "CON2-P05", ++ "CON2-P03", "CON2-P08", "CON2-P10", "CON2-P16", ++ "CON2-P12", "CON2-P37", "CON2-P28", "CON2-P27", ++ "CON2-P40", "CON2-P38", "", "", ++ "", "", "", "", "", "", "", "", ++ ++ /* PB */ ++ "", "", "", "", "", "", "", "", ++ "", "", "", "", "", "", "", "", ++ "", "", "", "", "", "", "", "", ++ "", "", "", "", "", "", "", "", ++ ++ /* PC */ ++ "CON2-P19", "CON2-P21", "CON2-P23", "CON2-P24", ++ "CON2-P18", "", "", "CON2-P26", ++ "", "", "", "", "", "", "", "", ++ "", "", "", "", "", "", "", "", ++ "", "", "", "", "", "", "", "", ++ ++ /* PD */ ++ "", "", "", "", "", "", "", "", ++ "", "", "", "", "", "", "CSI-PWR-EN", "", ++ "", "", "", "", "", "", "", "", ++ "", "", "", "", "", "", "", "", ++ ++ /* PE */ ++ "CN3-P17", "CN3-P13", "CN3-P09", "CN3-P07", ++ "CN3-P19", "CN3-P21", "CN3-P22", "CN3-P20", ++ "CN3-P18", "CN3-P16", "CN3-P14", "CN3-P12", ++ "CN3-P05", "CN3-P03", "CN3-P06", "CN3-P08", ++ "", "", "", "", "", "", "", "", ++ "", "", "", "", "", "", "", "", ++ ++ /* PF */ ++ "SDC0-D1", "SDC0-D0", "SDC0-CLK", "SDC0-CMD", "SDC0-D3", ++ "SDC0-D2", "SDC0-DET", "", ++ "", "", "", "", "", "", "", "", ++ "", "", "", "", "", "", "", "", ++ "", "", "", "", "", "", "", "", ++ ++ /* PG */ ++ "WL-SDIO-CLK", "WL-SDIO-CMD", "WL-SDIO-D0", "WL-SDIO-D1", ++ "WL-SDIO-D2", "WL-SDIO-D3", "BT-UART-TX", "BT-UART-RX", ++ "BT-UART-RTS", "BT-UART-CTS", "WL-WAKE-AP", "BT-WAKE-AP", ++ "BT-RST-N", "AP-WAKE-BT", "", "", ++ "", "", "", "", "", "", "", "", ++ "", "", "", "", "", "", "", ""; ++}; ++ ++&r_pio { ++ gpio-line-names = ++ /* PL */ ++ "", "CPUX-SET", "CON2-P32", "POWER-KEY", "CON2-P36", ++ "VCC-IO-EN", "USB0-ID", "WL-PWR-EN", ++ "PWR-STB", "PWR-DRAM", "PWR-LED", "IR-RX", "", "", "", "", ++ "", "", "", "", "", "", "", "", ++ "", "", "", "", "", "", "", ""; ++}; ++ ++&usb_otg { ++ dr_mode = "otg"; ++ status = "okay"; ++}; ++ ++&usbphy { ++ usb0_id_det-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */ ++ /* ++ * There're two micro-USB connectors, one is power-only and another is ++ * OTG. The Vbus of these two connectors are connected together, so ++ * the external USB device will be powered just by the power input ++ * from the power-only USB port. ++ */ ++ status = "okay"; ++}; diff --git a/target/linux/sunxi/patches-6.1/460-dt-bindings-usb-Add-H616-compatible-string.patch b/target/linux/sunxi/patches-6.1/460-dt-bindings-usb-Add-H616-compatible-string.patch new file mode 100644 index 00000000000000..bab535705c010f --- /dev/null +++ b/target/linux/sunxi/patches-6.1/460-dt-bindings-usb-Add-H616-compatible-string.patch @@ -0,0 +1,36 @@ +From e4045c8125d88a9eb8b4f8f74b5c7955d5d9adc0 Mon Sep 17 00:00:00 2001 +From: Andre Przywara +Date: Thu, 17 Jun 2021 10:54:22 +0100 +Subject: [PATCH 5000/5006] dt-bindings: usb: Add H616 compatible string + +The Allwinner H616 contains four fully OHCI/EHCI compatible USB host +controllers, so just add their compatible strings to the list of +generic OHCI/EHCI controllers. + +Signed-off-by: Andre Przywara +Acked-by: Krzysztof Kozlowski +--- + Documentation/devicetree/bindings/usb/generic-ehci.yaml | 1 + + Documentation/devicetree/bindings/usb/generic-ohci.yaml | 1 + + 2 files changed, 2 insertions(+) + +--- a/Documentation/devicetree/bindings/usb/generic-ehci.yaml ++++ b/Documentation/devicetree/bindings/usb/generic-ehci.yaml +@@ -30,6 +30,7 @@ properties: + - allwinner,sun4i-a10-ehci + - allwinner,sun50i-a64-ehci + - allwinner,sun50i-h6-ehci ++ - allwinner,sun50i-h616-ehci + - allwinner,sun5i-a13-ehci + - allwinner,sun6i-a31-ehci + - allwinner,sun7i-a20-ehci +--- a/Documentation/devicetree/bindings/usb/generic-ohci.yaml ++++ b/Documentation/devicetree/bindings/usb/generic-ohci.yaml +@@ -20,6 +20,7 @@ properties: + - allwinner,sun4i-a10-ohci + - allwinner,sun50i-a64-ohci + - allwinner,sun50i-h6-ohci ++ - allwinner,sun50i-h616-ohci + - allwinner,sun5i-a13-ohci + - allwinner,sun6i-a31-ohci + - allwinner,sun7i-a20-ohci diff --git a/target/linux/sunxi/patches-6.1/461-dt-bindings-phy-Add-special-clock-for-Allwinner-H616.patch b/target/linux/sunxi/patches-6.1/461-dt-bindings-phy-Add-special-clock-for-Allwinner-H616.patch new file mode 100644 index 00000000000000..238683b3c5358e --- /dev/null +++ b/target/linux/sunxi/patches-6.1/461-dt-bindings-phy-Add-special-clock-for-Allwinner-H616.patch @@ -0,0 +1,77 @@ +From e2078ae0c559b6ac91db19262b56d8cf334354cb Mon Sep 17 00:00:00 2001 +From: Andre Przywara +Date: Mon, 12 Sep 2022 00:03:22 +0100 +Subject: [PATCH 5001/5006] dt-bindings: phy: Add special clock for Allwinner + H616 PHY + +The USB PHY IP in the Allwinner H616 SoC requires a quirk that involves +some resources from port 2's PHY and HCI IP. In particular the PMU clock +for port 2 must be surely ungated before accessing the REG_HCI_PHY_CTL +register of port 2. To allow each USB port to be controlled +independently of port 2, we need a handle to that particular PMU clock +in the *PHY* node, as the HCI and PHY part might be handled by separate +drivers. + +Add that clock to the requirements of the H616 PHY binding, so that a +PHY driver can apply the quirk in isolation, without requiring help from +port 2's HCI driver. + +Signed-off-by: Andre Przywara +--- + .../phy/allwinner,sun8i-h3-usb-phy.yaml | 26 +++++++++++++++++++ + 1 file changed, 26 insertions(+) + +--- a/Documentation/devicetree/bindings/phy/allwinner,sun8i-h3-usb-phy.yaml ++++ b/Documentation/devicetree/bindings/phy/allwinner,sun8i-h3-usb-phy.yaml +@@ -36,18 +36,22 @@ properties: + - const: pmu3 + + clocks: ++ minItems: 4 + items: + - description: USB OTG PHY bus clock + - description: USB Host 0 PHY bus clock + - description: USB Host 1 PHY bus clock + - description: USB Host 2 PHY bus clock ++ - description: PMU clock for host port 2 + + clock-names: ++ minItems: 4 + items: + - const: usb0_phy + - const: usb1_phy + - const: usb2_phy + - const: usb3_phy ++ - const: pmu2_clk + + resets: + items: +@@ -96,6 +100,28 @@ required: + - resets + - reset-names + ++allOf: ++ - if: ++ properties: ++ compatible: ++ contains: ++ enum: ++ - allwinner,sun50i-h616-usb-phy ++ then: ++ properties: ++ clocks: ++ minItems: 5 ++ ++ clock-names: ++ minItems: 5 ++ else: ++ properties: ++ clocks: ++ maxItems: 4 ++ ++ clock-names: ++ maxItems: 4 ++ + additionalProperties: false + + examples: diff --git a/target/linux/sunxi/patches-6.1/462-arm64-dts-allwinner-h616-Add-USB-nodes.patch b/target/linux/sunxi/patches-6.1/462-arm64-dts-allwinner-h616-Add-USB-nodes.patch new file mode 100644 index 00000000000000..9a31bea8bfe96f --- /dev/null +++ b/target/linux/sunxi/patches-6.1/462-arm64-dts-allwinner-h616-Add-USB-nodes.patch @@ -0,0 +1,185 @@ +From 4cfd9d9350a57fc3ced240dbf61ca2f444283c50 Mon Sep 17 00:00:00 2001 +From: Andre Przywara +Date: Wed, 16 Jun 2021 18:20:47 +0100 +Subject: [PATCH 5004/5006] arm64: dts: allwinner: h616: Add USB nodes + +Add the nodes for the MUSB and the four USB host controllers to the SoC +.dtsi, along with the PHY node needed to bind all of them together. + +EHCI/OHCI and MUSB are compatible to previous SoCs, but the PHY requires +some quirks (handled in the driver). + +Signed-off-by: Andre Przywara +--- + .../arm64/boot/dts/allwinner/sun50i-h616.dtsi | 160 ++++++++++++++++++ + 1 file changed, 160 insertions(+) + +--- a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi +@@ -504,6 +504,166 @@ + }; + }; + ++ usbotg: usb@5100000 { ++ compatible = "allwinner,sun50i-h616-musb", ++ "allwinner,sun8i-h3-musb"; ++ reg = <0x05100000 0x0400>; ++ clocks = <&ccu CLK_BUS_OTG>; ++ resets = <&ccu RST_BUS_OTG>; ++ interrupts = ; ++ interrupt-names = "mc"; ++ phys = <&usbphy 0>; ++ phy-names = "usb"; ++ extcon = <&usbphy 0>; ++ status = "disabled"; ++ }; ++ ++ usbphy: phy@5100400 { ++ compatible = "allwinner,sun50i-h616-usb-phy"; ++ reg = <0x05100400 0x24>, ++ <0x05101800 0x14>, ++ <0x05200800 0x14>, ++ <0x05310800 0x14>, ++ <0x05311800 0x14>; ++ reg-names = "phy_ctrl", ++ "pmu0", ++ "pmu1", ++ "pmu2", ++ "pmu3"; ++ clocks = <&ccu CLK_USB_PHY0>, ++ <&ccu CLK_USB_PHY1>, ++ <&ccu CLK_USB_PHY2>, ++ <&ccu CLK_USB_PHY3>, ++ <&ccu CLK_BUS_EHCI2>; ++ clock-names = "usb0_phy", ++ "usb1_phy", ++ "usb2_phy", ++ "usb3_phy", ++ "pmu2_clk"; ++ resets = <&ccu RST_USB_PHY0>, ++ <&ccu RST_USB_PHY1>, ++ <&ccu RST_USB_PHY2>, ++ <&ccu RST_USB_PHY3>; ++ reset-names = "usb0_reset", ++ "usb1_reset", ++ "usb2_reset", ++ "usb3_reset"; ++ status = "disabled"; ++ #phy-cells = <1>; ++ }; ++ ++ ehci0: usb@5101000 { ++ compatible = "allwinner,sun50i-h616-ehci", ++ "generic-ehci"; ++ reg = <0x05101000 0x100>; ++ interrupts = ; ++ clocks = <&ccu CLK_BUS_OHCI0>, ++ <&ccu CLK_BUS_EHCI0>, ++ <&ccu CLK_USB_OHCI0>; ++ resets = <&ccu RST_BUS_OHCI0>, ++ <&ccu RST_BUS_EHCI0>; ++ phys = <&usbphy 0>; ++ phy-names = "usb"; ++ status = "disabled"; ++ }; ++ ++ ohci0: usb@5101400 { ++ compatible = "allwinner,sun50i-h616-ohci", ++ "generic-ohci"; ++ reg = <0x05101400 0x100>; ++ interrupts = ; ++ clocks = <&ccu CLK_BUS_OHCI0>, ++ <&ccu CLK_USB_OHCI0>; ++ resets = <&ccu RST_BUS_OHCI0>; ++ phys = <&usbphy 0>; ++ phy-names = "usb"; ++ status = "disabled"; ++ }; ++ ++ ehci1: usb@5200000 { ++ compatible = "allwinner,sun50i-h616-ehci", ++ "generic-ehci"; ++ reg = <0x05200000 0x100>; ++ interrupts = ; ++ clocks = <&ccu CLK_BUS_OHCI1>, ++ <&ccu CLK_BUS_EHCI1>, ++ <&ccu CLK_USB_OHCI1>; ++ resets = <&ccu RST_BUS_OHCI1>, ++ <&ccu RST_BUS_EHCI1>; ++ phys = <&usbphy 1>; ++ phy-names = "usb"; ++ status = "disabled"; ++ }; ++ ++ ohci1: usb@5200400 { ++ compatible = "allwinner,sun50i-h616-ohci", ++ "generic-ohci"; ++ reg = <0x05200400 0x100>; ++ interrupts = ; ++ clocks = <&ccu CLK_BUS_OHCI1>, ++ <&ccu CLK_USB_OHCI1>; ++ resets = <&ccu RST_BUS_OHCI1>; ++ phys = <&usbphy 1>; ++ phy-names = "usb"; ++ status = "disabled"; ++ }; ++ ++ ehci2: usb@5310000 { ++ compatible = "allwinner,sun50i-h616-ehci", ++ "generic-ehci"; ++ reg = <0x05310000 0x100>; ++ interrupts = ; ++ clocks = <&ccu CLK_BUS_OHCI2>, ++ <&ccu CLK_BUS_EHCI2>, ++ <&ccu CLK_USB_OHCI2>; ++ resets = <&ccu RST_BUS_OHCI2>, ++ <&ccu RST_BUS_EHCI2>; ++ phys = <&usbphy 2>; ++ phy-names = "usb"; ++ status = "disabled"; ++ }; ++ ++ ohci2: usb@5310400 { ++ compatible = "allwinner,sun50i-h616-ohci", ++ "generic-ohci"; ++ reg = <0x05310400 0x100>; ++ interrupts = ; ++ clocks = <&ccu CLK_BUS_OHCI2>, ++ <&ccu CLK_USB_OHCI2>; ++ resets = <&ccu RST_BUS_OHCI2>; ++ phys = <&usbphy 2>; ++ phy-names = "usb"; ++ status = "disabled"; ++ }; ++ ++ ehci3: usb@5311000 { ++ compatible = "allwinner,sun50i-h616-ehci", ++ "generic-ehci"; ++ reg = <0x05311000 0x100>; ++ interrupts = ; ++ clocks = <&ccu CLK_BUS_OHCI3>, ++ <&ccu CLK_BUS_EHCI3>, ++ <&ccu CLK_USB_OHCI3>; ++ resets = <&ccu RST_BUS_OHCI3>, ++ <&ccu RST_BUS_EHCI3>; ++ phys = <&usbphy 3>; ++ phy-names = "usb"; ++ status = "disabled"; ++ }; ++ ++ ohci3: usb@5311400 { ++ compatible = "allwinner,sun50i-h616-ohci", ++ "generic-ohci"; ++ reg = <0x05311400 0x100>; ++ interrupts = ; ++ clocks = <&ccu CLK_BUS_OHCI3>, ++ <&ccu CLK_USB_OHCI3>; ++ resets = <&ccu RST_BUS_OHCI3>; ++ phys = <&usbphy 3>; ++ phy-names = "usb"; ++ status = "disabled"; ++ }; ++ + rtc: rtc@7000000 { + compatible = "allwinner,sun50i-h616-rtc"; + reg = <0x07000000 0x400>; diff --git a/target/linux/sunxi/patches-6.1/463-arm64-dts-allwinner-h616-OrangePi-Zero-2-Add-USB-nod.patch b/target/linux/sunxi/patches-6.1/463-arm64-dts-allwinner-h616-OrangePi-Zero-2-Add-USB-nod.patch new file mode 100644 index 00000000000000..9ae5591cca02c5 --- /dev/null +++ b/target/linux/sunxi/patches-6.1/463-arm64-dts-allwinner-h616-OrangePi-Zero-2-Add-USB-nod.patch @@ -0,0 +1,79 @@ +From 1bc12a9ae690a22a525f9b71778022bb4533fec1 Mon Sep 17 00:00:00 2001 +From: Andre Przywara +Date: Wed, 16 Jun 2021 18:32:36 +0100 +Subject: [PATCH 5005/5006] arm64: dts: allwinner: h616: OrangePi Zero 2: Add + USB nodes + +The OrangePi Zero 2 has one USB-A host port, VBUS is provided by +a GPIO controlled regulator. +The USB-C port is meant to power the board, but is also connected to +the USB 0 port, which we configure as an MUSB peripheral. + +Signed-off-by: Andre Przywara +--- + .../allwinner/sun50i-h616-orangepi-zero2.dts | 41 +++++++++++++++++++ + 1 file changed, 41 insertions(+) + +--- a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts +@@ -49,8 +49,24 @@ + regulator-max-microvolt = <5000000>; + regulator-always-on; + }; ++ ++ reg_usb1_vbus: regulator-usb1-vbus { ++ compatible = "regulator-fixed"; ++ regulator-name = "usb1-vbus"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ vin-supply = <®_vcc5v>; ++ enable-active-high; ++ gpio = <&pio 2 16 GPIO_ACTIVE_HIGH>; /* PC16 */ ++ }; ++}; ++ ++&ehci1 { ++ status = "okay"; + }; + ++/* USB 2 & 3 are on headers only. */ ++ + &emac0 { + pinctrl-names = "default"; + pinctrl-0 = <&ext_rgmii_pins>; +@@ -76,6 +92,10 @@ + status = "okay"; + }; + ++&ohci1 { ++ status = "okay"; ++}; ++ + &r_rsb { + status = "okay"; + +@@ -211,3 +231,24 @@ + pinctrl-0 = <&uart0_ph_pins>; + status = "okay"; + }; ++ ++&usbotg { ++ /* ++ * PHY0 pins are connected to a USB-C socket, but a role switch ++ * is not implemented: both CC pins are pulled to GND. ++ * The VBUS pins power the device, so a fixed peripheral mode ++ * is the best choice. ++ * The board can be powered via GPIOs, in this case port0 *can* ++ * act as a host (with a cable/adapter ignoring CC), as VBUS is ++ * then provided by the GPIOs. Any user of this setup would ++ * need to adjust the DT accordingly: dr_mode set to "host", ++ * enabling OHCI0 and EHCI0. ++ */ ++ dr_mode = "peripheral"; ++ status = "okay"; ++}; ++ ++&usbphy { ++ usb1_vbus-supply = <®_usb1_vbus>; ++ status = "okay"; ++}; diff --git a/target/linux/uml/patches-5.15/102-pseudo-random-mac.patch b/target/linux/uml/patches-5.15/102-pseudo-random-mac.patch index 045d2d0dbd9ae3..6806bb8a8a6294 100644 --- a/target/linux/uml/patches-5.15/102-pseudo-random-mac.patch +++ b/target/linux/uml/patches-5.15/102-pseudo-random-mac.patch @@ -11,7 +11,7 @@ Applies to vanilla kernel 3.9.4. =============================================================================== --- a/arch/um/drivers/Kconfig +++ b/arch/um/drivers/Kconfig -@@ -146,6 +146,20 @@ config UML_NET +@@ -136,6 +136,20 @@ config UML_NET enable at least one of the following transport options to actually make use of UML networking. diff --git a/target/linux/uml/patches-6.1/102-pseudo-random-mac.patch b/target/linux/uml/patches-6.1/102-pseudo-random-mac.patch index a752e1d2779da4..d2dc7516e66104 100644 --- a/target/linux/uml/patches-6.1/102-pseudo-random-mac.patch +++ b/target/linux/uml/patches-6.1/102-pseudo-random-mac.patch @@ -11,7 +11,7 @@ Applies to vanilla kernel 3.9.4. =============================================================================== --- a/arch/um/drivers/Kconfig +++ b/arch/um/drivers/Kconfig -@@ -153,6 +153,20 @@ config UML_NET +@@ -143,6 +143,20 @@ config UML_NET enable at least one of the following transport options to actually make use of UML networking. diff --git a/target/linux/x86/64/config-6.1 b/target/linux/x86/64/config-6.1 new file mode 100644 index 00000000000000..66ae3e35f0fd54 --- /dev/null +++ b/target/linux/x86/64/config-6.1 @@ -0,0 +1,606 @@ +CONFIG_64BIT=y +# CONFIG_ACER_WMI is not set +CONFIG_ACPI=y +CONFIG_ACPI_AC=y +CONFIG_ACPI_BATTERY=y +# CONFIG_ACPI_BGRT is not set +CONFIG_ACPI_BUTTON=y +# CONFIG_ACPI_CMPC is not set +CONFIG_ACPI_CONTAINER=y +CONFIG_ACPI_CPPC_LIB=y +CONFIG_ACPI_CPU_FREQ_PSS=y +# CONFIG_ACPI_DEBUG is not set +# CONFIG_ACPI_DEBUGGER is not set +# CONFIG_ACPI_DOCK is not set +# CONFIG_ACPI_DPTF is not set +# CONFIG_ACPI_EC_DEBUGFS is not set +CONFIG_ACPI_FAN=y +# CONFIG_ACPI_FPDT is not set +CONFIG_ACPI_HOTPLUG_CPU=y +CONFIG_ACPI_HOTPLUG_IOAPIC=y +# CONFIG_ACPI_I2C_OPREGION is not set +CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y +CONFIG_ACPI_LPIT=y +CONFIG_ACPI_PCC=y +# CONFIG_ACPI_PCI_SLOT is not set +# CONFIG_ACPI_PFRUT is not set +CONFIG_ACPI_PRMT=y +CONFIG_ACPI_PROCESSOR=y +# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set +CONFIG_ACPI_PROCESSOR_CSTATE=y +CONFIG_ACPI_PROCESSOR_IDLE=y +CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y +# CONFIG_ACPI_SBS is not set +CONFIG_ACPI_SPCR_TABLE=y +CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT=y +# CONFIG_ACPI_TAD is not set +CONFIG_ACPI_THERMAL=y +# CONFIG_ACPI_TOSHIBA is not set +CONFIG_ACPI_VIDEO=y +# CONFIG_ACPI_WMI is not set +# CONFIG_ACRN_GUEST is not set +# CONFIG_ADV_SWBUTTON is not set +CONFIG_AGP=y +# CONFIG_AGP_AMD64 is not set +CONFIG_AGP_INTEL=y +# CONFIG_AGP_SIS is not set +# CONFIG_AGP_VIA is not set +# CONFIG_AMD_HSMP is not set +CONFIG_AMD_IOMMU=y +CONFIG_AMD_IOMMU_V2=y +# CONFIG_AMD_PMC is not set +# CONFIG_AMD_PMF is not set +# CONFIG_AMD_PTDMA is not set +# CONFIG_AMD_SFH_HID is not set +CONFIG_ARCH_CPUIDLE_HALTPOLL=y +CONFIG_ARCH_DMA_ADDR_T_64BIT=y +CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y +CONFIG_ARCH_MMAP_RND_BITS=28 +CONFIG_ARCH_MMAP_RND_BITS_MAX=32 +CONFIG_ARCH_MMAP_RND_BITS_MIN=28 +CONFIG_ARCH_NR_GPIO=1024 +CONFIG_ARCH_SPARSEMEM_DEFAULT=y +CONFIG_ARCH_WANTS_THP_SWAP=y +# CONFIG_ASUS_TF103C_DOCK is not set +# CONFIG_ASUS_WMI is not set +CONFIG_AUDIT_ARCH=y +CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_BALLOON_COMPACTION=y +CONFIG_BLK_DEV_BSGLIB=y +CONFIG_BLK_DEV_BSG_COMMON=y +CONFIG_BLK_DEV_INTEGRITY=y +CONFIG_BLK_DEV_INTEGRITY_T10=y +CONFIG_BLK_DEV_NVME=y +CONFIG_BLK_DEV_SR=y +CONFIG_BLK_MQ_VIRTIO=y +CONFIG_BLK_PM=y +# CONFIG_BOOTPARAM_HOTPLUG_CPU0 is not set +CONFIG_BTT=y +CONFIG_CDROM=y +CONFIG_CONNECTOR=y +CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y +CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y +CONFIG_CPU_IBPB_ENTRY=y +CONFIG_CPU_IBRS_ENTRY=y +# CONFIG_CPU_IDLE_GOV_HALTPOLL is not set +CONFIG_CPU_RMAP=y +CONFIG_CPU_SRSO=y +CONFIG_CPU_UNRET_ENTRY=y +CONFIG_CRC_T10DIF=y +CONFIG_CRYPTO_AES_NI_INTEL=y +# CONFIG_CRYPTO_ARIA_AESNI_AVX_X86_64 is not set +CONFIG_CRYPTO_BLAKE2S_X86=y +# CONFIG_CRYPTO_BLOWFISH_X86_64 is not set +# CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64 is not set +# CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64 is not set +# CONFIG_CRYPTO_CAMELLIA_X86_64 is not set +# CONFIG_CRYPTO_CAST5_AVX_X86_64 is not set +# CONFIG_CRYPTO_CAST6_AVX_X86_64 is not set +CONFIG_CRYPTO_CRCT10DIF=y +# CONFIG_CRYPTO_CRCT10DIF_PCLMUL is not set +CONFIG_CRYPTO_CRYPTD=y +# CONFIG_CRYPTO_DES3_EDE_X86_64 is not set +CONFIG_CRYPTO_ECB=y +CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y +CONFIG_CRYPTO_LIB_POLY1305_RSIZE=11 +CONFIG_CRYPTO_LRW=y +# CONFIG_CRYPTO_NHPOLY1305_AVX2 is not set +# CONFIG_CRYPTO_NHPOLY1305_SSE2 is not set +# CONFIG_CRYPTO_POLYVAL_CLMUL_NI is not set +# CONFIG_CRYPTO_SERPENT_AVX_X86_64 is not set +# CONFIG_CRYPTO_SERPENT_AVX2_X86_64 is not set +# CONFIG_CRYPTO_SERPENT_SSE2_X86_64 is not set +# CONFIG_CRYPTO_SHA1_SSSE3 is not set +# CONFIG_CRYPTO_SHA256_SSSE3 is not set +# CONFIG_CRYPTO_SHA512_SSSE3 is not set +CONFIG_CRYPTO_SIMD=y +# CONFIG_CRYPTO_SM3_AVX_X86_64 is not set +# CONFIG_CRYPTO_SM4_AESNI_AVX_X86_64 is not set +# CONFIG_CRYPTO_SM4_AESNI_AVX2_X86_64 is not set +# CONFIG_CRYPTO_TWOFISH_AVX_X86_64 is not set +# CONFIG_CRYPTO_TWOFISH_X86_64 is not set +# CONFIG_CRYPTO_TWOFISH_X86_64_3WAY is not set +CONFIG_CRYPTO_XTS=y +# CONFIG_DEBUG_HOTPLUG_CPU0 is not set +CONFIG_DMA_ACPI=y +CONFIG_DMA_OPS=y +CONFIG_DMA_SHARED_BUFFER=y +CONFIG_DRM=y +CONFIG_DRM_BOCHS=y +CONFIG_DRM_BRIDGE=y +CONFIG_DRM_FBDEV_EMULATION=y +CONFIG_DRM_FBDEV_OVERALLOC=100 +CONFIG_DRM_GEM_SHMEM_HELPER=y +# CONFIG_DRM_HYPERV is not set +CONFIG_DRM_I915=y +CONFIG_DRM_I915_CAPTURE_ERROR=y +CONFIG_DRM_I915_COMPRESS_ERROR=y +# CONFIG_DRM_I915_DEBUG is not set +# CONFIG_DRM_I915_DEBUG_GUC is not set +# CONFIG_DRM_I915_DEBUG_MMIO is not set +# CONFIG_DRM_I915_DEBUG_RUNTIME_PM is not set +# CONFIG_DRM_I915_DEBUG_VBLANK_EVADE is not set +CONFIG_DRM_I915_FENCE_TIMEOUT=10000 +CONFIG_DRM_I915_FORCE_PROBE="" +CONFIG_DRM_I915_GVT=y +CONFIG_DRM_I915_HEARTBEAT_INTERVAL=2500 +# CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS is not set +CONFIG_DRM_I915_MAX_REQUEST_BUSYWAIT=8000 +CONFIG_DRM_I915_PREEMPT_TIMEOUT=640 +CONFIG_DRM_I915_REQUEST_TIMEOUT=20000 +# CONFIG_DRM_I915_SELFTEST is not set +CONFIG_DRM_I915_STOP_TIMEOUT=100 +# CONFIG_DRM_I915_SW_FENCE_CHECK_DAG is not set +# CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS is not set +CONFIG_DRM_I915_TIMESLICE_DURATION=1 +CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND=250 +CONFIG_DRM_I915_USERPTR=y +# CONFIG_DRM_I915_WERROR is not set +CONFIG_DRM_KMS_HELPER=y +CONFIG_DRM_MIPI_DSI=y +CONFIG_DRM_PANEL=y +CONFIG_DRM_PANEL_BRIDGE=y +CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y +CONFIG_DRM_TTM=y +CONFIG_DRM_TTM_HELPER=y +CONFIG_DRM_VIRTIO_GPU=y +CONFIG_DRM_VRAM_HELPER=y +CONFIG_EFI=y +CONFIG_EFIVAR_FS=m +# CONFIG_EFI_BOOTLOADER_CONTROL is not set +# CONFIG_EFI_CAPSULE_LOADER is not set +# CONFIG_EFI_COCO_SECRET is not set +# CONFIG_EFI_CUSTOM_SSDT_OVERLAYS is not set +# CONFIG_EFI_DISABLE_PCI_DMA is not set +# CONFIG_EFI_DISABLE_RUNTIME is not set +CONFIG_EFI_DXE_MEM_ATTRIBUTES=y +CONFIG_EFI_EARLYCON=y +CONFIG_EFI_ESRT=y +# CONFIG_EFI_FAKE_MEMMAP is not set +CONFIG_EFI_GENERIC_STUB_INITRD_CMDLINE_LOADER=y +# CONFIG_EFI_MIXED is not set +# CONFIG_EFI_PGT_DUMP is not set +# CONFIG_EFI_RCI2_TABLE is not set +CONFIG_EFI_RUNTIME_MAP=y +CONFIG_EFI_RUNTIME_WRAPPERS=y +# CONFIG_EFI_SECRET is not set +CONFIG_EFI_STUB=y +# CONFIG_EFI_TEST is not set +# CONFIG_EFI_VARS is not set +CONFIG_FAILOVER=y +CONFIG_FB=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_IMAGEBLIT=y +CONFIG_FB_CMDLINE=y +CONFIG_FB_DEFERRED_IO=y +CONFIG_FB_EFI=y +CONFIG_FB_HYPERV=y +CONFIG_FB_MODE_HELPERS=y +CONFIG_FB_SIMPLE=y +CONFIG_FB_SYS_COPYAREA=y +CONFIG_FB_SYS_FILLRECT=y +CONFIG_FB_SYS_FOPS=y +CONFIG_FB_SYS_IMAGEBLIT=y +CONFIG_FB_TILEBLITTING=y +# CONFIG_FB_VESA is not set +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y +CONFIG_FONT_SUPPORT=y +CONFIG_FRAMEBUFFER_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +CONFIG_FREEZER=y +CONFIG_FUSION_SAS=y +CONFIG_FW_CACHE=y +CONFIG_GART_IOMMU=y +CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y +CONFIG_GENERIC_CPU=y +CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y +CONFIG_GENERIC_IRQ_MIGRATION=y +CONFIG_GENERIC_PENDING_IRQ=y +# CONFIG_GIGABYTE_WMI is not set +CONFIG_GPIOLIB_IRQCHIP=y +CONFIG_GPIO_ACPI=y +CONFIG_GPIO_CDEV=y +CONFIG_GPIO_ICH=y +CONFIG_GPIO_SCH=y +CONFIG_HALTPOLL_CPUIDLE=y +CONFIG_HARDLOCKUP_CHECK_TIMESTAMP=y +CONFIG_HDMI=y +CONFIG_HIBERNATE_CALLBACKS=y +CONFIG_HID_BATTERY_STRENGTH=y +CONFIG_HID_GENERIC=y +CONFIG_HID_HYPERV_MOUSE=y +CONFIG_HOTPLUG_CPU=y +CONFIG_HOTPLUG_PCI=y +CONFIG_HOTPLUG_PCI_ACPI=y +# CONFIG_HOTPLUG_PCI_ACPI_IBM is not set +# CONFIG_HOTPLUG_PCI_CPCI is not set +# CONFIG_HOTPLUG_PCI_PCIE is not set +# CONFIG_HOTPLUG_PCI_SHPC is not set +CONFIG_HOTPLUG_SMT=y +CONFIG_HPET=y +CONFIG_HPET_MMAP=y +# CONFIG_HP_ACCEL is not set +# CONFIG_HUAWEI_WMI is not set +CONFIG_HVC_DRIVER=y +CONFIG_HVC_IRQ=y +CONFIG_HVC_XEN=y +CONFIG_HVC_XEN_FRONTEND=y +CONFIG_HWMON=y +CONFIG_HWMON_VID=y +CONFIG_HW_RANDOM_AMD=y +CONFIG_HW_RANDOM_INTEL=y +CONFIG_HW_RANDOM_VIRTIO=y +CONFIG_HYPERV=y +CONFIG_HYPERVISOR_GUEST=y +CONFIG_HYPERV_BALLOON=y +CONFIG_HYPERV_IOMMU=y +CONFIG_HYPERV_KEYBOARD=y +CONFIG_HYPERV_NET=y +CONFIG_HYPERV_STORAGE=y +# CONFIG_HYPERV_TESTING is not set +CONFIG_HYPERV_TIMER=y +CONFIG_HYPERV_UTILS=y +# CONFIG_HYPERV_VSOCKETS is not set +CONFIG_I2C=y +CONFIG_I2C_ALGOBIT=y +# CONFIG_I2C_AMD_MP2 is not set +CONFIG_I2C_BOARDINFO=y +# CONFIG_I2C_HID_ACPI is not set +# CONFIG_I2C_MULTI_INSTANTIATE is not set +# CONFIG_I8K is not set +# CONFIG_IA32_EMULATION is not set +CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 +# CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT is not set +CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y +CONFIG_INTEL_GTT=y +CONFIG_INTEL_IDLE=y +# CONFIG_INTEL_IDXD is not set +# CONFIG_INTEL_IDXD_COMPAT is not set +CONFIG_INTEL_IOMMU=y +# CONFIG_INTEL_IOMMU_DEFAULT_ON is not set +CONFIG_INTEL_IOMMU_FLOPPY_WA=y +# CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON is not set +# CONFIG_INTEL_IOMMU_SVM is not set +# CONFIG_INTEL_IPS is not set +# CONFIG_INTEL_MEI_HDCP is not set +# CONFIG_INTEL_MEI_PXP is not set +# CONFIG_INTEL_MENLOW is not set +CONFIG_INTEL_PCH_THERMAL=y +# CONFIG_INTEL_SAR_INT1092 is not set +# CONFIG_INTEL_SCU_PLATFORM is not set +CONFIG_INTEL_SOC_DTS_IOSF_CORE=y +CONFIG_INTEL_SOC_DTS_THERMAL=y +# CONFIG_INTEL_SPEED_SELECT_INTERFACE is not set +CONFIG_INTEL_TDX_GUEST=y +# CONFIG_INTEL_TURBO_MAX_3 is not set +# CONFIG_INTEL_TXT is not set +# CONFIG_INTEL_UNCORE_FREQ_CONTROL is not set +# CONFIG_INTEL_WMI_SBL_FW_UPDATE is not set +# CONFIG_INTEL_WMI_THUNDERBOLT is not set +CONFIG_INTERVAL_TREE=y +CONFIG_IOASID=y +CONFIG_IOMMU_API=y +# CONFIG_IOMMU_DEBUG is not set +# CONFIG_IOMMU_DEBUGFS is not set +CONFIG_IOMMU_DEFAULT_DMA_LAZY=y +# CONFIG_IOMMU_DEFAULT_DMA_STRICT is not set +# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set +CONFIG_IOMMU_DMA=y +CONFIG_IOMMU_HELPER=y +CONFIG_IOMMU_IOVA=y +CONFIG_IOMMU_SUPPORT=y +CONFIG_IOSF_MBI=y +# CONFIG_IOSF_MBI_DEBUG is not set +CONFIG_IRQ_MSI_IOMMU=y +CONFIG_IRQ_REMAP=y +# CONFIG_ISCSI_IBFT is not set +CONFIG_ISO9660_FS=y +CONFIG_KALLSYMS_ABSOLUTE_PERCPU=y +CONFIG_KCMP=y +CONFIG_KVM_GUEST=y +CONFIG_LEDS_GPIO=y +# CONFIG_LEGACY_VSYSCALL_EMULATE is not set +CONFIG_LEGACY_VSYSCALL_NONE=y +# CONFIG_LEGACY_VSYSCALL_XONLY is not set +# CONFIG_LG_LAPTOP is not set +CONFIG_LIBNVDIMM=y +CONFIG_LOCK_SPIN_ON_OWNER=y +CONFIG_LPC_ICH=y +CONFIG_LPC_SCH=y +CONFIG_MAILBOX=y +# CONFIG_MAXSMP is not set +CONFIG_MEMORY_BALLOON=y +CONFIG_MEMREGION=y +# CONFIG_MERAKI_MX100 is not set +CONFIG_MFD_CORE=y +# CONFIG_MFD_INTEL_LPSS_ACPI is not set +# CONFIG_MFD_INTEL_PMC_BXT is not set +CONFIG_MMC=y +CONFIG_MMC_BLOCK=y +CONFIG_MMC_CQHCI=y +CONFIG_MMC_RICOH_MMC=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_ACPI=y +CONFIG_MMC_SDHCI_IO_ACCESSORS=y +CONFIG_MMC_SDHCI_PCI=y +# CONFIG_MMC_SDHCI_PLTFM is not set +# CONFIG_MMC_WBSD is not set +CONFIG_MMU_NOTIFIER=y +CONFIG_MODULES_USE_ELF_RELA=y +# CONFIG_MPSC is not set +# CONFIG_MSI_WMI is not set +CONFIG_MUTEX_SPIN_ON_OWNER=y +# CONFIG_MXM_WMI is not set +CONFIG_ND_BLK=y +CONFIG_ND_BTT=y +CONFIG_ND_CLAIM=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NET_FAILOVER=y +CONFIG_NET_FLOW_LIMIT=y +CONFIG_NET_PTP_CLASSIFY=y +# CONFIG_NITRO_ENCLAVES is not set +CONFIG_NR_CPUS=512 +CONFIG_NR_CPUS_DEFAULT=64 +CONFIG_NR_CPUS_RANGE_BEGIN=2 +CONFIG_NR_CPUS_RANGE_END=512 +# CONFIG_NVIDIA_WMI_EC_BACKLIGHT is not set +CONFIG_NVME_CORE=y +CONFIG_NVME_HWMON=y +CONFIG_NVME_MULTIPATH=y +CONFIG_OUTPUT_FORMAT="elf64-x86-64" +CONFIG_PADATA=y +CONFIG_PAGE_POOL=y +CONFIG_PAGE_REPORTING=y +CONFIG_PAGE_TABLE_ISOLATION=y +CONFIG_PARAVIRT=y +CONFIG_PARAVIRT_CLOCK=y +# CONFIG_PARAVIRT_DEBUG is not set +CONFIG_PARAVIRT_SPINLOCKS=y +CONFIG_PARAVIRT_XXL=y +CONFIG_PATA_AMD=y +CONFIG_PATA_ATIIXP=y +CONFIG_PATA_MPIIX=y +CONFIG_PATA_OLDPIIX=y +CONFIG_PATA_PLATFORM=y +CONFIG_PATA_TIMINGS=y +CONFIG_PATA_VIA=y +CONFIG_PCC=y +# CONFIG_PCENGINES_APU2 is not set +CONFIG_PCIEAER=y +CONFIG_PCIEASPM=y +CONFIG_PCIEASPM_DEFAULT=y +# CONFIG_PCIEASPM_PERFORMANCE is not set +# CONFIG_PCIEASPM_POWERSAVE is not set +# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set +CONFIG_PCIEPORTBUS=y +CONFIG_PCIE_PME=y +CONFIG_PCI_HYPERV=y +CONFIG_PCI_HYPERV_INTERFACE=y +# CONFIG_PCI_MMCONFIG is not set +CONFIG_PCI_XEN=y +# CONFIG_PEAQ_WMI is not set +CONFIG_PGTABLE_LEVELS=4 +CONFIG_PHYSICAL_ALIGN=0x1000000 +CONFIG_PHYS_ADDR_T_64BIT=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_ALDERLAKE=y +CONFIG_PINCTRL_BAYTRAIL=y +CONFIG_PINCTRL_BROXTON=y +CONFIG_PINCTRL_CANNONLAKE=y +CONFIG_PINCTRL_CHERRYVIEW=y +CONFIG_PINCTRL_DENVERTON=y +CONFIG_PINCTRL_ELKHARTLAKE=y +CONFIG_PINCTRL_EMMITSBURG=y +CONFIG_PINCTRL_GEMINILAKE=y +CONFIG_PINCTRL_INTEL=y +CONFIG_PINCTRL_JASPERLAKE=y +CONFIG_PINCTRL_LAKEFIELD=y +CONFIG_PINCTRL_LEWISBURG=y +CONFIG_PINCTRL_LYNXPOINT=y +CONFIG_PINCTRL_METEORLAKE=y +CONFIG_PINCTRL_SUNRISEPOINT=y +CONFIG_PINCTRL_TIGERLAKE=y +CONFIG_PM=y +# CONFIG_PMIC_OPREGION is not set +CONFIG_PM_CLK=y +CONFIG_PM_SLEEP=y +CONFIG_PM_SLEEP_SMP=y +CONFIG_PNP=y +CONFIG_PNPACPI=y +CONFIG_PNP_DEBUG_MESSAGES=y +CONFIG_PPS=y +CONFIG_PROC_EVENTS=y +CONFIG_PTP_1588_CLOCK=y +CONFIG_PTP_1588_CLOCK_KVM=y +CONFIG_PTP_1588_CLOCK_VMW=y +CONFIG_PVH=y +CONFIG_QUEUED_RWLOCKS=y +CONFIG_QUEUED_SPINLOCKS=y +CONFIG_RAS=y +CONFIG_RELAY=y +CONFIG_RELOCATABLE=y +CONFIG_RESET_ATTACK_MITIGATION=y +CONFIG_RFS_ACCEL=y +CONFIG_RPS=y +CONFIG_RTC_I2C_AND_SPI=y +CONFIG_RWSEM_SPIN_ON_OWNER=y +# CONFIG_SAMSUNG_Q10 is not set +CONFIG_SATA_AHCI=y +# CONFIG_SCHED_CORE is not set +CONFIG_SCHED_MC=y +CONFIG_SCHED_MC_PRIO=y +CONFIG_SCHED_SMT=y +CONFIG_SCSI_SAS_ATTRS=y +CONFIG_SCSI_VIRTIO=y +# CONFIG_SENSORS_ASUS_EC is not set +# CONFIG_SENSORS_ASUS_WMI is not set +CONFIG_SENSORS_CORETEMP=y +CONFIG_SENSORS_FAM15H_POWER=y +CONFIG_SENSORS_I5500=y +CONFIG_SENSORS_K8TEMP=y +CONFIG_SENSORS_K10TEMP=y +CONFIG_SENSORS_VIA_CPUTEMP=y +CONFIG_SERIAL_8250_PNP=y +CONFIG_SERIAL_MCTRL_GPIO=y +# CONFIG_SERIAL_MULTI_INSTANTIATE is not set +CONFIG_SLS=y +CONFIG_SMP=y +# CONFIG_SND_HDA_CTL_DEV_ID is not set +# CONFIG_SND_HDA_SCODEC_CS35L41_I2C is not set +# CONFIG_SND_HDA_SCODEC_CS35L41_SPI is not set +# CONFIG_SND_SOC_AMD_ACP6x is not set +# CONFIG_SND_SOC_AMD_ACP_COMMON is not set +# CONFIG_SND_SOC_AMD_PS is not set +# CONFIG_SND_SOC_AMD_RPL_ACP6x is not set +# CONFIG_SND_SOC_INTEL_AVS is not set +CONFIG_SOCK_RX_QUEUE_MAPPING=y +CONFIG_SPARSEMEM=y +CONFIG_SPARSEMEM_EXTREME=y +CONFIG_SPARSEMEM_MANUAL=y +# CONFIG_SPARSEMEM_VMEMMAP is not set +CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y +CONFIG_STACK_VALIDATION=y +# CONFIG_SURFACE_PLATFORMS is not set +CONFIG_SWIOTLB=y +CONFIG_SWIOTLB_XEN=y +CONFIG_SYNC_FILE=y +# CONFIG_SYSTEM76_ACPI is not set +CONFIG_SYS_HYPERVISOR=y +CONFIG_THERMAL_GOV_USER_SPACE=y +CONFIG_THERMAL_HWMON=y +CONFIG_THERMAL_WRITABLE_TRIPS=y +# CONFIG_THINKPAD_LMI is not set +# CONFIG_TOSHIBA_BT_RFKILL is not set +# CONFIG_TOSHIBA_WMI is not set +CONFIG_TREE_RCU=y +CONFIG_TREE_SRCU=y +# CONFIG_UACCE is not set +# CONFIG_UCLAMP_TASK is not set +CONFIG_UCS2_STRING=y +# CONFIG_UNWINDER_ORC is not set +CONFIG_USB_STORAGE=y +# CONFIG_VIDEO_IPU3_CIO2 is not set +CONFIG_VIRTIO=y +CONFIG_VIRTIO_BALLOON=y +CONFIG_VIRTIO_BLK=y +CONFIG_VIRTIO_CONSOLE=y +CONFIG_VIRTIO_DMA_SHARED_BUFFER=y +CONFIG_VIRTIO_IOMMU=y +CONFIG_VIRTIO_MMIO=y +CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y +CONFIG_VIRTIO_NET=y +CONFIG_VIRTIO_PCI=y +CONFIG_VIRTIO_PCI_LEGACY=y +CONFIG_VIRTIO_PCI_LIB=y +# CONFIG_VIRTIO_PMEM is not set +# CONFIG_VIRTIO_VSOCKETS is not set +CONFIG_VIRTIO_VSOCKETS_COMMON=y +CONFIG_VIRT_DRIVERS=y +CONFIG_VMAP_PFN=y +CONFIG_VMAP_STACK=y +# CONFIG_VMD is not set +CONFIG_VMGENID=y +CONFIG_VMWARE_BALLOON=y +CONFIG_VMWARE_PVSCSI=y +CONFIG_VMWARE_VMCI=y +CONFIG_VMWARE_VMCI_VSOCKETS=y +CONFIG_VMXNET3=y +CONFIG_VSOCKETS=y +CONFIG_VSOCKETS_LOOPBACK=y +CONFIG_VT_CONSOLE_SLEEP=y +CONFIG_WATCHDOG_CORE=y +# CONFIG_WIRELESS_HOTKEY is not set +# CONFIG_WMI_BMOF is not set +# CONFIG_X86_5LEVEL is not set +CONFIG_X86_64=y +CONFIG_X86_64_SMP=y +CONFIG_X86_ACPI_CPUFREQ=y +# CONFIG_X86_ACPI_CPUFREQ_CPB is not set +CONFIG_X86_AMD_FREQ_SENSITIVITY=y +CONFIG_X86_AMD_PLATFORM_DEVICE=y +CONFIG_X86_AMD_PSTATE=y +# CONFIG_X86_AMD_PSTATE_UT is not set +CONFIG_X86_CPUID=y +CONFIG_X86_DIRECT_GBPAGES=y +CONFIG_X86_HV_CALLBACK_VECTOR=y +CONFIG_X86_INTEL_LPSS=y +# CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS is not set +CONFIG_X86_INTEL_PSTATE=y +# CONFIG_X86_KERNEL_IBT is not set +CONFIG_X86_MINIMUM_CPU_FAMILY=64 +# CONFIG_X86_PCC_CPUFREQ is not set +CONFIG_X86_PKG_TEMP_THERMAL=y +# CONFIG_X86_PMEM_LEGACY is not set +CONFIG_X86_PM_TIMER=y +# CONFIG_X86_POWERNOW_K8 is not set +# CONFIG_X86_VSYSCALL_EMULATION is not set +CONFIG_X86_X2APIC=y +# CONFIG_X86_X32 is not set +# CONFIG_X86_X32_ABI is not set +CONFIG_XEN=y +CONFIG_XENFS=y +CONFIG_XEN_512GB=y +CONFIG_XEN_ACPI=y +CONFIG_XEN_ACPI_PROCESSOR=y +CONFIG_XEN_AUTO_XLATE=y +# CONFIG_XEN_BACKEND is not set +CONFIG_XEN_BALLOON=y +CONFIG_XEN_BLKDEV_FRONTEND=y +CONFIG_XEN_COMPAT_XENFS=y +CONFIG_XEN_DEBUG_FS=y +CONFIG_XEN_DEV_EVTCHN=y +CONFIG_XEN_DOM0=y +CONFIG_XEN_EFI=y +CONFIG_XEN_FBDEV_FRONTEND=y +CONFIG_XEN_GNTDEV=y +CONFIG_XEN_GRANT_DEV_ALLOC=y +CONFIG_XEN_HAVE_PVMMU=y +CONFIG_XEN_HAVE_VPMU=y +# CONFIG_XEN_MCE_LOG is not set +CONFIG_XEN_NETDEV_FRONTEND=y +CONFIG_XEN_PCIDEV_FRONTEND=y +CONFIG_XEN_PRIVCMD=y +CONFIG_XEN_PV=y +CONFIG_XEN_PVH=y +CONFIG_XEN_PVHVM=y +CONFIG_XEN_PVHVM_GUEST=y +CONFIG_XEN_PVHVM_SMP=y +CONFIG_XEN_PV_DOM0=y +CONFIG_XEN_PV_MSR_SAFE=y +CONFIG_XEN_PV_SMP=y +CONFIG_XEN_SAVE_RESTORE=y +CONFIG_XEN_SCSI_FRONTEND=y +CONFIG_XEN_SYMS=y +CONFIG_XEN_SYS_HYPERVISOR=y +CONFIG_XEN_VIRTIO=y +# CONFIG_XEN_VIRTIO_FORCE_GRANT is not set +CONFIG_XEN_WDT=y +CONFIG_XEN_XENBUS_FRONTEND=y +# CONFIG_XIAOMI_WMI is not set +CONFIG_XPS=y +# CONFIG_YOGABOOK_WMI is not set +CONFIG_ZLIB_DEFLATE=y +CONFIG_ZONE_DMA32=y diff --git a/target/linux/x86/Makefile b/target/linux/x86/Makefile index 5368a779e54f88..2ca1b4ca462582 100644 --- a/target/linux/x86/Makefile +++ b/target/linux/x86/Makefile @@ -11,6 +11,7 @@ FEATURES:=squashfs ext4 vdi vmdk vhdx pcmcia targz fpu boot-part rootfs-part SUBTARGETS:=generic legacy geode 64 KERNEL_PATCHVER:=5.15 +KERNEL_TESTING_PATCHVER:=6.1 KERNELNAME:=bzImage diff --git a/target/linux/x86/config-6.1 b/target/linux/x86/config-6.1 new file mode 100644 index 00000000000000..6776d05be38901 --- /dev/null +++ b/target/linux/x86/config-6.1 @@ -0,0 +1,462 @@ +# CONFIG_60XX_WDT is not set +# CONFIG_64BIT is not set +# CONFIG_ACPI is not set +# CONFIG_ACQUIRE_WDT is not set +# CONFIG_ADVANTECH_WDT is not set +# CONFIG_ALIM1535_WDT is not set +# CONFIG_ALIX is not set +CONFIG_AMD_NB=y +CONFIG_ARCH_32BIT_OFF_T=y +CONFIG_ARCH_CLOCKSOURCE_INIT=y +CONFIG_ARCH_CORRECT_STACKTRACE_ON_KRETPROBE=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_MAY_HAVE_PC_FDC=y +CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y +CONFIG_ARCH_NR_GPIO=512 +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_SPLIT_ARG64=y +CONFIG_ARCH_STACKWALK=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_USES_PG_UNCACHED=y +CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT=y +CONFIG_ARCH_WANTS_NO_INSTR=y +CONFIG_ATA=y +CONFIG_ATA_GENERIC=y +CONFIG_ATA_PIIX=y +# CONFIG_BARCO_P50_GPIO is not set +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_SD=y +CONFIG_BLK_MQ_PCI=y +CONFIG_BOUNCE=y +CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" +CONFIG_CC_NO_ARRAY_BOUNDS=y +CONFIG_CLKBLD_I8253=y +CONFIG_CLKEVT_I8253=y +CONFIG_CLKSRC_I8253=y +CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE=y +CONFIG_CLOCKSOURCE_WATCHDOG=y +CONFIG_CLOCKSOURCE_WATCHDOG_MAX_SKEW_US=100 +CONFIG_CLONE_BACKWARDS=y +CONFIG_COMMON_CLK=y +CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 +CONFIG_COMPAT_32=y +CONFIG_COMPAT_32BIT_TIME=y +# CONFIG_COMPAT_VDSO is not set +CONFIG_CONSOLE_TRANSLATIONS=y +# CONFIG_CPU5_WDT is not set +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set +CONFIG_CPU_FREQ_GOV_ATTR_SET=y +CONFIG_CPU_FREQ_GOV_COMMON=y +# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set +CONFIG_CPU_FREQ_GOV_ONDEMAND=y +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set +# CONFIG_CPU_FREQ_GOV_USERSPACE is not set +CONFIG_CPU_FREQ_STAT=y +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_LADDER=y +CONFIG_CPU_SUP_AMD=y +CONFIG_CPU_SUP_CENTAUR=y +CONFIG_CPU_SUP_CYRIX_32=y +CONFIG_CPU_SUP_HYGON=y +CONFIG_CPU_SUP_INTEL=y +CONFIG_CPU_SUP_TRANSMETA_32=y +CONFIG_CPU_SUP_UMC_32=y +CONFIG_CPU_SUP_VORTEX_32=y +CONFIG_CPU_SUP_ZHAOXIN=y +CONFIG_CRASH_CORE=y +CONFIG_CRC16=y +CONFIG_CRYPTO_CRC32=y +CONFIG_CRYPTO_CRC32C=y +# CONFIG_CRYPTO_CRC32_PCLMUL is not set +CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y +CONFIG_CRYPTO_LIB_POLY1305_RSIZE=1 +CONFIG_CRYPTO_LIB_SHA1=y +CONFIG_CRYPTO_LIB_UTILS=y +CONFIG_CRYPTO_RNG2=y +# CONFIG_CRYPTO_SERPENT_SSE2_586 is not set +# CONFIG_CX_ECAT is not set +CONFIG_DCACHE_WORD_ACCESS=y +# CONFIG_DEBUG_BOOT_PARAMS is not set +# CONFIG_DEBUG_ENTRY is not set +CONFIG_DEBUG_INFO=y +# CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAP is not set +CONFIG_DEBUG_MEMORY_INIT=y +CONFIG_DEBUG_MISC=y +# CONFIG_DEBUG_NMI_SELFTEST is not set +# CONFIG_DEBUG_TLBFLUSH is not set +CONFIG_DECOMPRESS_BZIP2=y +CONFIG_DECOMPRESS_GZIP=y +# CONFIG_DEVTMPFS_SAFE is not set +CONFIG_DMADEVICES=y +CONFIG_DMI=y +CONFIG_DMIID=y +CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y +CONFIG_DMI_SYSFS=y +# CONFIG_DM_AUDIT is not set +CONFIG_DNOTIFY=y +CONFIG_DUMMY_CONSOLE=y +CONFIG_DYNAMIC_SIGFRAME=y +CONFIG_EARLY_PRINTK=y +# CONFIG_EARLY_PRINTK_DBGP is not set +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +# CONFIG_EDD is not set +# CONFIG_EISA is not set +# CONFIG_EUROTECH_WDT is not set +# CONFIG_EXAR_WDT is not set +CONFIG_EXCLUSIVE_SYSTEM_RAM=y +CONFIG_EXT4_FS=y +CONFIG_F2FS_FS=y +# CONFIG_F71808E_WDT is not set +CONFIG_FIRMWARE_MEMMAP=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FRAME_POINTER=y +CONFIG_FS_IOMAP=y +CONFIG_FS_MBCACHE=y +CONFIG_FUSION=y +# CONFIG_FUSION_CTL is not set +# CONFIG_FUSION_LOGGING is not set +CONFIG_FUSION_MAX_SGE=128 +CONFIG_FUSION_SPI=y +CONFIG_FW_LOADER_PAGED_BUF=y +CONFIG_FW_LOADER_SYSFS=y +CONFIG_GCC11_NO_ARRAY_BOUNDS=y +# CONFIG_GDS_FORCE_MITIGATION is not set +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y +CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_CPU_VULNERABILITIES=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_ENTRY=y +CONFIG_GENERIC_GETTIMEOFDAY=y +CONFIG_GENERIC_IOMAP=y +CONFIG_GENERIC_IRQ_MATRIX_ALLOCATOR=y +CONFIG_GENERIC_IRQ_RESERVATION_MODE=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_ISA_DMA=y +CONFIG_GENERIC_MSI_IRQ=y +CONFIG_GENERIC_MSI_IRQ_DOMAIN=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GENERIC_VDSO_32=y +# CONFIG_GEOS is not set +CONFIG_GLOB=y +CONFIG_GPIO_CDEV=y +# CONFIG_HANGCHECK_TIMER is not set +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +CONFIG_HID=y +CONFIG_HIGHMEM=y +CONFIG_HIGHMEM4G=y +# CONFIG_HIGHMEM64G is not set +CONFIG_HIGHPTE=y +CONFIG_HPET_EMULATE_RTC=y +CONFIG_HPET_TIMER=y +CONFIG_HW_CONSOLE=y +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_GEODE=y +CONFIG_HW_RANDOM_VIA=y +# CONFIG_HYPERVISOR_GUEST is not set +CONFIG_HZ_PERIODIC=y +CONFIG_I8253_LOCK=y +CONFIG_IA32_FEAT_CTL=y +# CONFIG_IB700_WDT is not set +# CONFIG_IBMASR is not set +# CONFIG_IBM_RTL is not set +# CONFIG_IE6XX_WDT is not set +CONFIG_ILLEGAL_POINTER_VALUE=0 +CONFIG_INITRAMFS_SOURCE="" +CONFIG_INPUT=y +CONFIG_INPUT_KEYBOARD=y +CONFIG_INPUT_VIVALDIFMAP=y +CONFIG_INSTRUCTION_DECODER=y +# CONFIG_INTEL_HFI_THERMAL is not set +# CONFIG_INTEL_LDMA is not set +# CONFIG_INTEL_PCH_THERMAL is not set +# CONFIG_INTEL_POWERCLAMP is not set +# CONFIG_INTEL_SCU_PCI is not set +# CONFIG_INTEL_TCC_COOLING is not set +# CONFIG_INTEL_VSEC is not set +# CONFIG_IOSF_MBI is not set +CONFIG_IO_DELAY_0X80=y +# CONFIG_IO_DELAY_0XED is not set +# CONFIG_IO_DELAY_NONE is not set +# CONFIG_IO_DELAY_UDELAY is not set +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +# CONFIG_ISA is not set +CONFIG_ISA_DMA_API=y +# CONFIG_IT8712F_WDT is not set +# CONFIG_IT87_WDT is not set +# CONFIG_ITCO_WDT is not set +CONFIG_JBD2=y +CONFIG_KALLSYMS=y +CONFIG_KEXEC=y +CONFIG_KEXEC_CORE=y +CONFIG_KEYBOARD_ATKBD=y +CONFIG_KMAP_LOCAL=y +CONFIG_LOCK_DEBUGGING_SUPPORT=y +# CONFIG_M486 is not set +# CONFIG_M486SX is not set +# CONFIG_M586 is not set +# CONFIG_M586MMX is not set +# CONFIG_M586TSC is not set +CONFIG_M686=y +# CONFIG_MACHZ_WDT is not set +# CONFIG_MATOM is not set +# CONFIG_MCORE2 is not set +# CONFIG_MCRUSOE is not set +# CONFIG_MCYRIXIII is not set +# CONFIG_MEFFICEON is not set +# CONFIG_MELAN is not set +CONFIG_MEMFD_CREATE=y +# CONFIG_MFD_INTEL_LPSS_PCI is not set +# CONFIG_MGEODEGX1 is not set +# CONFIG_MGEODE_LX is not set +CONFIG_MICROCODE=y +CONFIG_MICROCODE_AMD=y +CONFIG_MICROCODE_INTEL=y +CONFIG_MICROCODE_LATE_LOADING=y +CONFIG_MIGRATION=y +# CONFIG_MK6 is not set +# CONFIG_MK7 is not set +# CONFIG_MK8 is not set +CONFIG_MMU_GATHER_MERGE_VMAS=y +# CONFIG_MODIFY_LDT_SYSCALL is not set +CONFIG_MODULES_TREE_LOOKUP=y +CONFIG_MODULES_USE_ELF_REL=y +# CONFIG_MPENTIUM4 is not set +# CONFIG_MPENTIUMII is not set +# CONFIG_MPENTIUMIII is not set +# CONFIG_MPENTIUMM is not set +# CONFIG_MTD is not set +CONFIG_MTRR=y +# CONFIG_MTRR_SANITIZER is not set +# CONFIG_MVIAC3_2 is not set +# CONFIG_MVIAC7 is not set +# CONFIG_MWINCHIP3D is not set +# CONFIG_MWINCHIPC6 is not set +CONFIG_NAMESPACES=y +CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y +CONFIG_NEED_PER_CPU_KM=y +CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y +CONFIG_NEED_SG_DMA_LENGTH=y +# CONFIG_NET5501 is not set +# CONFIG_NET_NS is not set +CONFIG_NLS=y +# CONFIG_NOHIGHMEM is not set +CONFIG_NR_CPUS=1 +CONFIG_NR_CPUS_DEFAULT=1 +CONFIG_NR_CPUS_RANGE_BEGIN=1 +CONFIG_NR_CPUS_RANGE_END=1 +# CONFIG_NSC_GPIO is not set +CONFIG_NVRAM=y +# CONFIG_OF is not set +CONFIG_OLD_SIGACTION=y +CONFIG_OLD_SIGSUSPEND3=y +# CONFIG_OLPC is not set +CONFIG_OUTPUT_FORMAT="elf32-i386" +# CONFIG_P2SB is not set +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PAGE_POOL=y +CONFIG_PAGE_SIZE_LESS_THAN_256KB=y +CONFIG_PAGE_SIZE_LESS_THAN_64KB=y +CONFIG_PC104=y +# CONFIG_PC8736x_GPIO is not set +# CONFIG_PC87413_WDT is not set +# CONFIG_PCENGINES_APU2 is not set +CONFIG_PCI=y +CONFIG_PCI_ATS=y +CONFIG_PCI_BIOS=y +CONFIG_PCI_DIRECT=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_GOANY=y +# CONFIG_PCI_GOBIOS is not set +# CONFIG_PCI_GODIRECT is not set +# CONFIG_PCI_GOMMCONFIG is not set +CONFIG_PCI_IOV=y +CONFIG_PCI_LABEL=y +CONFIG_PCI_LOCKLESS_CONFIG=y +CONFIG_PCI_MSI=y +CONFIG_PCI_MSI_IRQ_DOMAIN=y +CONFIG_PCSPKR_PLATFORM=y +CONFIG_PERF_EVENTS=y +# CONFIG_PERF_EVENTS_AMD_BRS is not set +# CONFIG_PERF_EVENTS_AMD_UNCORE is not set +CONFIG_PERF_EVENTS_INTEL_CSTATE=y +CONFIG_PERF_EVENTS_INTEL_RAPL=y +CONFIG_PERF_EVENTS_INTEL_UNCORE=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHYSICAL_ALIGN=0x100000 +CONFIG_PHYSICAL_START=0x1000000 +# CONFIG_PHY_INTEL_LGM_EMMC is not set +CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y +CONFIG_POWER_SUPPLY=y +CONFIG_PREEMPT_NONE_BUILD=y +# CONFIG_PROCESSOR_SELECT is not set +CONFIG_PROC_PAGE_MONITOR=y +CONFIG_PROC_PID_ARCH_STATUS=y +# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set +CONFIG_PTP_1588_CLOCK_OPTIONAL=y +# CONFIG_PUNIT_ATOM_DEBUG is not set +CONFIG_RANDSTRUCT_NONE=y +CONFIG_RATIONAL=y +CONFIG_RD_BZIP2=y +CONFIG_RD_GZIP=y +CONFIG_RETHUNK=y +CONFIG_RETPOLINE=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_MC146818_LIB=y +CONFIG_SATA_HOST=y +# CONFIG_SBC7240_WDT is not set +# CONFIG_SBC8360_WDT is not set +# CONFIG_SBC_EPX_C3_WATCHDOG is not set +# CONFIG_SC1200_WDT is not set +CONFIG_SCSI=y +CONFIG_SCSI_COMMON=y +CONFIG_SCSI_SPI_ATTRS=y +CONFIG_SCx200=y +CONFIG_SCx200HR_TIMER=y +# CONFIG_SCx200_GPIO is not set +# CONFIG_SCx200_WDT is not set +CONFIG_SERIAL_8250_PCI=y +# CONFIG_SERIAL_LANTIQ is not set +CONFIG_SERIAL_MCTRL_GPIO=y +CONFIG_SERIO=y +CONFIG_SERIO_I8042=y +CONFIG_SERIO_LIBPS2=y +CONFIG_SERIO_SERPORT=y +CONFIG_SG_POOL=y +# CONFIG_SIEMENS_SIMATIC_IPC is not set +# CONFIG_SMSC37B787_WDT is not set +# CONFIG_SMSC_SCH311X_WDT is not set +CONFIG_SOFTIRQ_ON_OWN_STACK=y +CONFIG_SPARSEMEM_STATIC=y +CONFIG_SPARSE_IRQ=y +CONFIG_SPECULATION_MITIGATIONS=y +CONFIG_SRCU=y +# CONFIG_STATIC_CALL_SELFTEST is not set +# CONFIG_STRICT_SIGALTSTACK_SIZE is not set +CONFIG_SYSCTL_EXCEPTION_TRACE=y +# CONFIG_SYSFB_SIMPLEFB is not set +# CONFIG_TELCLOCK is not set +# CONFIG_TEST_FPU is not set +CONFIG_THERMAL=y +CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y +CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 +CONFIG_THERMAL_GOV_STEP_WISE=y +CONFIG_THREAD_INFO_IN_TASK=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TINY_SRCU=y +# CONFIG_TOSHIBA is not set +# CONFIG_TQMX86_WDT is not set +CONFIG_TRACE_IRQFLAGS_NMI_SUPPORT=y +CONFIG_UNWINDER_FRAME_POINTER=y +# CONFIG_UNWINDER_GUESS is not set +CONFIG_UP_LATE_INIT=y +CONFIG_USB=y +CONFIG_USB_COMMON=y +CONFIG_USB_EHCI_HCD=y +# CONFIG_USB_EHCI_HCD_PLATFORM is not set +CONFIG_USB_EHCI_PCI=y +CONFIG_USB_HID=y +CONFIG_USB_HIDDEV=y +CONFIG_USB_OHCI_HCD=y +CONFIG_USB_OHCI_HCD_PCI=y +# CONFIG_USB_OHCI_HCD_PLATFORM is not set +CONFIG_USB_PCI=y +CONFIG_USB_SUPPORT=y +CONFIG_USB_UHCI_HCD=y +CONFIG_USB_XHCI_HCD=y +CONFIG_USB_XHCI_PCI=y +# CONFIG_USB_XHCI_PLATFORM is not set +# CONFIG_USER_NS is not set +CONFIG_USER_STACKTRACE_SUPPORT=y +CONFIG_VGA_CONSOLE=y +# CONFIG_VIA_WDT is not set +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +# CONFIG_WAFER_WDT is not set +# CONFIG_WINMATE_FM07_KEYS is not set +CONFIG_X86=y +CONFIG_X86_32=y +# CONFIG_X86_32_IRIS is not set +# CONFIG_X86_ANCIENT_MCE is not set +# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set +CONFIG_X86_CMOV=y +CONFIG_X86_CMPXCHG64=y +# CONFIG_X86_CPA_STATISTICS is not set +# CONFIG_X86_CPUFREQ_NFORCE2 is not set +# CONFIG_X86_CPUID is not set +# CONFIG_X86_CPU_RESCTRL is not set +CONFIG_X86_DEBUGCTLMSR=y +# CONFIG_X86_DEBUG_FPU is not set +# CONFIG_X86_DECODER_SELFTEST is not set +# CONFIG_X86_EXTENDED_PLATFORM is not set +CONFIG_X86_FEATURE_NAMES=y +CONFIG_X86_GENERIC=y +# CONFIG_X86_GX_SUSPMOD is not set +# CONFIG_X86_INTEL_PSTATE is not set +# CONFIG_X86_INTEL_TSX_MODE_AUTO is not set +CONFIG_X86_INTEL_TSX_MODE_OFF=y +# CONFIG_X86_INTEL_TSX_MODE_ON is not set +CONFIG_X86_INTEL_USERCOPY=y +CONFIG_X86_INTERNODE_CACHE_SHIFT=6 +CONFIG_X86_IOPL_IOPERM=y +CONFIG_X86_IO_APIC=y +CONFIG_X86_L1_CACHE_SHIFT=6 +# CONFIG_X86_LEGACY_VM86 is not set +CONFIG_X86_LOCAL_APIC=y +# CONFIG_X86_LONGRUN is not set +CONFIG_X86_MCE=y +# CONFIG_X86_MCELOG_LEGACY is not set +CONFIG_X86_MCE_AMD=y +# CONFIG_X86_MCE_INJECT is not set +CONFIG_X86_MCE_INTEL=y +CONFIG_X86_MCE_THRESHOLD=y +CONFIG_X86_MINIMUM_CPU_FAMILY=6 +CONFIG_X86_MPPARSE=y +CONFIG_X86_MSR=y +# CONFIG_X86_P4_CLOCKMOD is not set +CONFIG_X86_PAT=y +CONFIG_X86_PLATFORM_DEVICES=y +# CONFIG_X86_PLATFORM_DRIVERS_DELL is not set +# CONFIG_X86_PLATFORM_DRIVERS_HP is not set +# CONFIG_X86_POWERNOW_K6 is not set +# CONFIG_X86_POWERNOW_K7 is not set +# CONFIG_X86_REBOOTFIXUPS is not set +CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y +# CONFIG_X86_SPEEDSTEP_CENTRINO is not set +# CONFIG_X86_SPEEDSTEP_ICH is not set +# CONFIG_X86_SPEEDSTEP_SMI is not set +CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y +CONFIG_X86_THERMAL_VECTOR=y +CONFIG_X86_TSC=y +CONFIG_X86_UMIP=y +CONFIG_X86_UP_APIC=y +CONFIG_X86_UP_IOAPIC=y +CONFIG_X86_USE_PPRO_CHECKSUM=y +CONFIG_X86_VERBOSE_BOOTUP=y +CONFIG_X86_VMX_FEATURE_NAMES=y +CONFIG_XZ_DEC_BCJ=y +CONFIG_XZ_DEC_X86=y +CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/x86/generic/config-6.1 b/target/linux/x86/generic/config-6.1 new file mode 100644 index 00000000000000..b7c79de2736131 --- /dev/null +++ b/target/linux/x86/generic/config-6.1 @@ -0,0 +1,509 @@ +# CONFIG_3C515 is not set +# CONFIG_ACER_WMI is not set +CONFIG_ACPI=y +CONFIG_ACPI_AC=y +CONFIG_ACPI_BATTERY=y +# CONFIG_ACPI_BGRT is not set +CONFIG_ACPI_BUTTON=y +# CONFIG_ACPI_CMPC is not set +CONFIG_ACPI_CONTAINER=y +CONFIG_ACPI_CPU_FREQ_PSS=y +# CONFIG_ACPI_DEBUG is not set +# CONFIG_ACPI_DEBUGGER is not set +# CONFIG_ACPI_DOCK is not set +# CONFIG_ACPI_DPTF is not set +# CONFIG_ACPI_EC_DEBUGFS is not set +# CONFIG_ACPI_FAN is not set +CONFIG_ACPI_HOTPLUG_CPU=y +CONFIG_ACPI_HOTPLUG_IOAPIC=y +# CONFIG_ACPI_I2C_OPREGION is not set +CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y +# CONFIG_ACPI_PCI_SLOT is not set +CONFIG_ACPI_PROCESSOR=y +# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set +CONFIG_ACPI_PROCESSOR_CSTATE=y +CONFIG_ACPI_PROCESSOR_IDLE=y +CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y +# CONFIG_ACPI_SBS is not set +CONFIG_ACPI_SPCR_TABLE=y +CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT=y +CONFIG_ACPI_TAD=y +CONFIG_ACPI_THERMAL=y +# CONFIG_ACPI_TOSHIBA is not set +CONFIG_ACPI_VIDEO=y +# CONFIG_ACPI_WMI is not set +# CONFIG_ADV_SWBUTTON is not set +CONFIG_AGP=y +# CONFIG_AGP_ALI is not set +# CONFIG_AGP_AMD is not set +# CONFIG_AGP_AMD64 is not set +# CONFIG_AGP_ATI is not set +# CONFIG_AGP_EFFICEON is not set +CONFIG_AGP_INTEL=y +# CONFIG_AGP_NVIDIA is not set +# CONFIG_AGP_SIS is not set +# CONFIG_AGP_SWORKS is not set +# CONFIG_AGP_VIA is not set +# CONFIG_AMD_PMC is not set +# CONFIG_AMD_PMF is not set +# CONFIG_APM is not set +CONFIG_ARCH_CPUIDLE_HALTPOLL=y +CONFIG_ARCH_DMA_ADDR_T_64BIT=y +CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y +# CONFIG_ASUS_TF103C_DOCK is not set +# CONFIG_ASUS_WMI is not set +CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_BALLOON_COMPACTION=y +CONFIG_BLK_DEV_SR=y +CONFIG_BLK_MQ_VIRTIO=y +CONFIG_BLK_PM=y +# CONFIG_BOOTPARAM_HOTPLUG_CPU0 is not set +CONFIG_BTT=y +CONFIG_CDROM=y +CONFIG_CONNECTOR=y +CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y +CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y +# CONFIG_CPU_IDLE_GOV_HALTPOLL is not set +CONFIG_CPU_IDLE_GOV_MENU=y +CONFIG_CPU_RMAP=y +CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y +# CONFIG_CS89x0_ISA is not set +# CONFIG_DEBUG_HOTPLUG_CPU0 is not set +CONFIG_DMA_ACPI=y +CONFIG_DMA_SHARED_BUFFER=y +CONFIG_DRM=y +CONFIG_DRM_BOCHS=y +CONFIG_DRM_BRIDGE=y +CONFIG_DRM_FBDEV_EMULATION=y +CONFIG_DRM_FBDEV_OVERALLOC=100 +CONFIG_DRM_GEM_SHMEM_HELPER=y +# CONFIG_DRM_HYPERV is not set +CONFIG_DRM_I915=y +CONFIG_DRM_I915_CAPTURE_ERROR=y +CONFIG_DRM_I915_COMPRESS_ERROR=y +# CONFIG_DRM_I915_DEBUG is not set +# CONFIG_DRM_I915_DEBUG_GUC is not set +# CONFIG_DRM_I915_DEBUG_MMIO is not set +# CONFIG_DRM_I915_DEBUG_RUNTIME_PM is not set +# CONFIG_DRM_I915_DEBUG_VBLANK_EVADE is not set +CONFIG_DRM_I915_FENCE_TIMEOUT=10000 +CONFIG_DRM_I915_FORCE_PROBE="" +CONFIG_DRM_I915_HEARTBEAT_INTERVAL=2500 +# CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS is not set +CONFIG_DRM_I915_MAX_REQUEST_BUSYWAIT=8000 +CONFIG_DRM_I915_PREEMPT_TIMEOUT=640 +CONFIG_DRM_I915_REQUEST_TIMEOUT=20000 +# CONFIG_DRM_I915_SELFTEST is not set +CONFIG_DRM_I915_STOP_TIMEOUT=100 +# CONFIG_DRM_I915_SW_FENCE_CHECK_DAG is not set +# CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS is not set +CONFIG_DRM_I915_TIMESLICE_DURATION=1 +CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND=250 +CONFIG_DRM_I915_USERPTR=y +# CONFIG_DRM_I915_WERROR is not set +CONFIG_DRM_KMS_HELPER=y +CONFIG_DRM_MIPI_DSI=y +CONFIG_DRM_PANEL=y +CONFIG_DRM_PANEL_BRIDGE=y +CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y +CONFIG_DRM_TTM=y +CONFIG_DRM_TTM_HELPER=y +CONFIG_DRM_VIRTIO_GPU=y +CONFIG_DRM_VRAM_HELPER=y +CONFIG_EFI=y +CONFIG_EFIVAR_FS=m +# CONFIG_EFI_BOOTLOADER_CONTROL is not set +# CONFIG_EFI_CAPSULE_LOADER is not set +# CONFIG_EFI_CAPSULE_QUIRK_QUARK_CSH is not set +# CONFIG_EFI_COCO_SECRET is not set +# CONFIG_EFI_CUSTOM_SSDT_OVERLAYS is not set +# CONFIG_EFI_DISABLE_PCI_DMA is not set +# CONFIG_EFI_DISABLE_RUNTIME is not set +CONFIG_EFI_DXE_MEM_ATTRIBUTES=y +CONFIG_EFI_EARLYCON=y +CONFIG_EFI_ESRT=y +# CONFIG_EFI_FAKE_MEMMAP is not set +CONFIG_EFI_GENERIC_STUB_INITRD_CMDLINE_LOADER=y +# CONFIG_EFI_PGT_DUMP is not set +# CONFIG_EFI_RCI2_TABLE is not set +CONFIG_EFI_RUNTIME_MAP=y +CONFIG_EFI_RUNTIME_WRAPPERS=y +CONFIG_EFI_STUB=y +# CONFIG_EFI_TEST is not set +# CONFIG_EFI_VARS is not set +# CONFIG_EL3 is not set +CONFIG_FAILOVER=y +CONFIG_FB=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_IMAGEBLIT=y +CONFIG_FB_CMDLINE=y +CONFIG_FB_DEFERRED_IO=y +CONFIG_FB_EFI=y +CONFIG_FB_HYPERV=y +# CONFIG_FB_I810 is not set +CONFIG_FB_SIMPLE=y +CONFIG_FB_SYS_COPYAREA=y +CONFIG_FB_SYS_FILLRECT=y +CONFIG_FB_SYS_FOPS=y +CONFIG_FB_SYS_IMAGEBLIT=y +# CONFIG_FB_VESA is not set +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y +CONFIG_FONT_SUPPORT=y +CONFIG_FRAMEBUFFER_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +CONFIG_FREEZER=y +CONFIG_FW_CACHE=y +CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y +CONFIG_GENERIC_IRQ_MIGRATION=y +CONFIG_GENERIC_PENDING_IRQ=y +CONFIG_GENERIC_PINCONF=y +# CONFIG_GIGABYTE_WMI is not set +CONFIG_GPIOLIB_IRQCHIP=y +CONFIG_GPIO_ACPI=y +CONFIG_GPIO_CDEV=y +CONFIG_GUP_GET_PTE_LOW_HIGH=y +CONFIG_HALTPOLL_CPUIDLE=y +CONFIG_HDMI=y +CONFIG_HIBERNATE_CALLBACKS=y +CONFIG_HID_BATTERY_STRENGTH=y +CONFIG_HID_GENERIC=y +CONFIG_HID_HYPERV_MOUSE=y +# CONFIG_HIGHMEM4G is not set +CONFIG_HIGHMEM64G=y +CONFIG_HOTPLUG_CPU=y +CONFIG_HOTPLUG_PCI=y +CONFIG_HOTPLUG_PCI_ACPI=y +# CONFIG_HOTPLUG_PCI_ACPI_IBM is not set +# CONFIG_HOTPLUG_PCI_COMPAQ is not set +# CONFIG_HOTPLUG_PCI_CPCI is not set +# CONFIG_HOTPLUG_PCI_IBM is not set +CONFIG_HOTPLUG_PCI_PCIE=y +# CONFIG_HOTPLUG_PCI_SHPC is not set +CONFIG_HOTPLUG_SMT=y +CONFIG_HPET=y +CONFIG_HPET_MMAP=y +# CONFIG_HP_ACCEL is not set +# CONFIG_HUAWEI_WMI is not set +CONFIG_HVC_DRIVER=y +CONFIG_HVC_IRQ=y +CONFIG_HVC_XEN=y +CONFIG_HVC_XEN_FRONTEND=y +CONFIG_HWMON=y +CONFIG_HWMON_VID=y +CONFIG_HW_RANDOM_VIRTIO=y +CONFIG_HYPERV=y +CONFIG_HYPERVISOR_GUEST=y +CONFIG_HYPERV_BALLOON=y +CONFIG_HYPERV_KEYBOARD=y +CONFIG_HYPERV_NET=y +CONFIG_HYPERV_STORAGE=y +# CONFIG_HYPERV_TESTING is not set +CONFIG_HYPERV_TIMER=y +CONFIG_HYPERV_UTILS=y +CONFIG_I2C=y +CONFIG_I2C_ALGOBIT=y +# CONFIG_I2C_AMD_MP2 is not set +CONFIG_I2C_BOARDINFO=y +# CONFIG_I2C_HID_ACPI is not set +# CONFIG_I2C_MULTI_INSTANTIATE is not set +# CONFIG_I8K is not set +# CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT is not set +CONFIG_INPUT_MOUSE=y +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV_PSAUX=y +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y +CONFIG_INTEL_GTT=y +CONFIG_INTEL_IDLE=y +# CONFIG_INTEL_IPS is not set +# CONFIG_INTEL_MEI_HDCP is not set +# CONFIG_INTEL_MEI_PXP is not set +# CONFIG_INTEL_MENLOW is not set +CONFIG_INTEL_PCH_THERMAL=y +# CONFIG_INTEL_SAR_INT1092 is not set +# CONFIG_INTEL_SCU_PLATFORM is not set +CONFIG_INTEL_SOC_DTS_IOSF_CORE=y +CONFIG_INTEL_SOC_DTS_THERMAL=y +# CONFIG_INTEL_WMI_SBL_FW_UPDATE is not set +# CONFIG_INTEL_WMI_THUNDERBOLT is not set +CONFIG_INTERVAL_TREE=y +CONFIG_IOSF_MBI=y +# CONFIG_IOSF_MBI_DEBUG is not set +CONFIG_IRQ_BYPASS_MANAGER=y +CONFIG_ISA=y +CONFIG_ISAPNP=y +CONFIG_ISA_BUS_API=y +# CONFIG_ISCSI_IBFT is not set +CONFIG_ISO9660_FS=y +# CONFIG_JOLIET is not set +CONFIG_KCMP=y +CONFIG_KVM=y +CONFIG_KVM_AMD=y +CONFIG_KVM_ASYNC_PF=y +CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y +CONFIG_KVM_GUEST=y +CONFIG_KVM_INTEL=y +CONFIG_KVM_MMIO=y +CONFIG_KVM_VFIO=y +# CONFIG_KVM_XEN is not set +CONFIG_KVM_XFER_TO_GUEST_WORK=y +# CONFIG_LANCE is not set +# CONFIG_LG_LAPTOP is not set +CONFIG_LIBNVDIMM=y +CONFIG_LOCK_SPIN_ON_OWNER=y +# CONFIG_M686 is not set +# CONFIG_MDA_CONSOLE is not set +CONFIG_MEMORY_BALLOON=y +CONFIG_MEMREGION=y +CONFIG_MFD_CORE=y +CONFIG_MFD_INTEL_LPSS=y +CONFIG_MFD_INTEL_LPSS_ACPI=y +# CONFIG_MFD_INTEL_PMC_BXT is not set +# CONFIG_MIXCOMWD is not set +CONFIG_MMC=y +CONFIG_MMC_BLOCK=y +CONFIG_MMC_CQHCI=y +CONFIG_MMC_RICOH_MMC=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_IO_ACCESSORS=y +CONFIG_MMC_SDHCI_PCI=y +# CONFIG_MMC_SDHCI_PLTFM is not set +# CONFIG_MMC_WBSD is not set +CONFIG_MMU_NOTIFIER=y +# CONFIG_MOUSE_BCM5974 is not set +# CONFIG_MOUSE_CYAPA is not set +CONFIG_MOUSE_PS2=y +CONFIG_MOUSE_PS2_ALPS=y +# CONFIG_MOUSE_PS2_BYD is not set +# CONFIG_MOUSE_PS2_CYPRESS is not set +# CONFIG_MOUSE_PS2_ELANTECH is not set +CONFIG_MOUSE_PS2_LIFEBOOK=y +CONFIG_MOUSE_PS2_LOGIPS2PP=y +CONFIG_MOUSE_PS2_SMBUS=y +CONFIG_MOUSE_PS2_SYNAPTICS=y +CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS=y +# CONFIG_MOUSE_PS2_TOUCHKIT is not set +CONFIG_MOUSE_PS2_TRACKPOINT=y +# CONFIG_MOUSE_PS2_VMMOUSE is not set +# CONFIG_MOUSE_SERIAL is not set +# CONFIG_MOUSE_VSXXXAA is not set +CONFIG_MPENTIUM4=y +# CONFIG_MSI_WMI is not set +CONFIG_MUTEX_SPIN_ON_OWNER=y +# CONFIG_MXM_WMI is not set +CONFIG_ND_BLK=y +CONFIG_ND_BTT=y +CONFIG_ND_CLAIM=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NET_FAILOVER=y +CONFIG_NET_FLOW_LIMIT=y +CONFIG_NET_PTP_CLASSIFY=y +CONFIG_NO_HZ=y +CONFIG_NR_CPUS=4 +CONFIG_NR_CPUS_DEFAULT=8 +CONFIG_NR_CPUS_RANGE_BEGIN=2 +CONFIG_NR_CPUS_RANGE_END=8 +# CONFIG_NVIDIA_WMI_EC_BACKLIGHT is not set +CONFIG_PADATA=y +CONFIG_PAGE_POOL=y +CONFIG_PAGE_REPORTING=y +CONFIG_PAGE_TABLE_ISOLATION=y +CONFIG_PARAVIRT=y +CONFIG_PARAVIRT_CLOCK=y +# CONFIG_PARAVIRT_DEBUG is not set +CONFIG_PARAVIRT_SPINLOCKS=y +CONFIG_PATA_AMD=y +CONFIG_PATA_ATIIXP=y +CONFIG_PATA_MPIIX=y +CONFIG_PATA_OLDPIIX=y +CONFIG_PATA_PLATFORM=y +CONFIG_PATA_SC1200=y +CONFIG_PATA_TIMINGS=y +CONFIG_PATA_VIA=y +# CONFIG_PCENGINES_APU2 is not set +CONFIG_PCIEAER=y +CONFIG_PCIEASPM=y +CONFIG_PCIEASPM_DEFAULT=y +# CONFIG_PCIEASPM_PERFORMANCE is not set +# CONFIG_PCIEASPM_POWERSAVE is not set +# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set +CONFIG_PCIEPORTBUS=y +CONFIG_PCIE_PME=y +CONFIG_PCI_MMCONFIG=y +CONFIG_PCI_XEN=y +# CONFIG_PCWATCHDOG is not set +# CONFIG_PEAQ_WMI is not set +CONFIG_PGTABLE_LEVELS=3 +CONFIG_PHYS_ADDR_T_64BIT=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_ALDERLAKE=y +CONFIG_PINCTRL_BAYTRAIL=y +CONFIG_PINCTRL_BROXTON=y +CONFIG_PINCTRL_CANNONLAKE=y +CONFIG_PINCTRL_CHERRYVIEW=y +CONFIG_PINCTRL_DENVERTON=y +CONFIG_PINCTRL_ELKHARTLAKE=y +CONFIG_PINCTRL_EMMITSBURG=y +CONFIG_PINCTRL_GEMINILAKE=y +CONFIG_PINCTRL_INTEL=y +CONFIG_PINCTRL_JASPERLAKE=y +CONFIG_PINCTRL_LAKEFIELD=y +CONFIG_PINCTRL_LEWISBURG=y +CONFIG_PINCTRL_LYNXPOINT=y +CONFIG_PINCTRL_METEORLAKE=y +CONFIG_PINCTRL_SUNRISEPOINT=y +CONFIG_PINCTRL_TIGERLAKE=y +CONFIG_PM=y +# CONFIG_PMIC_OPREGION is not set +CONFIG_PM_CLK=y +CONFIG_PM_SLEEP=y +CONFIG_PM_SLEEP_SMP=y +CONFIG_PNP=y +CONFIG_PNPACPI=y +# CONFIG_PNPBIOS is not set +CONFIG_PNP_DEBUG_MESSAGES=y +CONFIG_PPS=y +CONFIG_PREEMPT_NOTIFIERS=y +CONFIG_PROC_EVENTS=y +CONFIG_PTP_1588_CLOCK=y +CONFIG_PTP_1588_CLOCK_KVM=y +CONFIG_PTP_1588_CLOCK_VMW=y +CONFIG_PVH=y +CONFIG_QUEUED_RWLOCKS=y +CONFIG_QUEUED_SPINLOCKS=y +CONFIG_RAS=y +CONFIG_RELAY=y +CONFIG_RELOCATABLE=y +CONFIG_RESET_ATTACK_MITIGATION=y +CONFIG_RFS_ACCEL=y +CONFIG_RPS=y +CONFIG_RTC_I2C_AND_SPI=y +CONFIG_RWSEM_SPIN_ON_OWNER=y +# CONFIG_SAMSUNG_Q10 is not set +CONFIG_SATA_AHCI=y +CONFIG_SATA_VIA=y +# CONFIG_SCHED_CORE is not set +CONFIG_SCHED_INFO=y +CONFIG_SCHED_SMT=y +# CONFIG_SCSI_FDOMAIN_ISA is not set +CONFIG_SCSI_VIRTIO=y +# CONFIG_SENSORS_ASUS_EC is not set +# CONFIG_SENSORS_ASUS_WMI is not set +CONFIG_SENSORS_CORETEMP=y +CONFIG_SENSORS_FAM15H_POWER=y +CONFIG_SENSORS_I5500=y +CONFIG_SENSORS_K8TEMP=y +CONFIG_SENSORS_K10TEMP=y +CONFIG_SENSORS_VIA_CPUTEMP=y +CONFIG_SERIAL_8250_PNP=y +CONFIG_SERIAL_MCTRL_GPIO=y +# CONFIG_SERIAL_MULTI_INSTANTIATE is not set +CONFIG_SMP=y +# CONFIG_SND_HDA_CTL_DEV_ID is not set +# CONFIG_SND_HDA_SCODEC_CS35L41_I2C is not set +# CONFIG_SND_HDA_SCODEC_CS35L41_SPI is not set +# CONFIG_SND_SOC_AMD_ACP6x is not set +# CONFIG_SND_SOC_AMD_ACP_COMMON is not set +# CONFIG_SND_SOC_AMD_PS is not set +# CONFIG_SND_SOC_AMD_RPL_ACP6x is not set +# CONFIG_SND_SOC_INTEL_AVS is not set +CONFIG_SOCK_RX_QUEUE_MAPPING=y +# CONFIG_SURFACE_PLATFORMS is not set +CONFIG_SWIOTLB=y +CONFIG_SYNC_FILE=y +# CONFIG_SYSTEM76_ACPI is not set +CONFIG_SYS_HYPERVISOR=y +CONFIG_TASKSTATS=y +CONFIG_TASK_DELAY_ACCT=y +CONFIG_THERMAL_GOV_USER_SPACE=y +CONFIG_THERMAL_HWMON=y +CONFIG_THERMAL_WRITABLE_TRIPS=y +# CONFIG_THINKPAD_LMI is not set +# CONFIG_TOSHIBA_BT_RFKILL is not set +# CONFIG_TOSHIBA_WMI is not set +CONFIG_TREE_RCU=y +CONFIG_TREE_SRCU=y +# CONFIG_UCLAMP_TASK is not set +CONFIG_UCS2_STRING=y +CONFIG_USB_STORAGE=y +CONFIG_USER_RETURN_NOTIFIER=y +CONFIG_VHOST=y +CONFIG_VHOST_IOTLB=y +CONFIG_VHOST_NET=y +# CONFIG_VIDEO_IPU3_CIO2 is not set +CONFIG_VIRTIO=y +CONFIG_VIRTIO_BALLOON=y +CONFIG_VIRTIO_BLK=y +CONFIG_VIRTIO_CONSOLE=y +CONFIG_VIRTIO_DMA_SHARED_BUFFER=y +CONFIG_VIRTIO_INPUT=y +CONFIG_VIRTIO_MMIO=y +CONFIG_VIRTIO_NET=y +CONFIG_VIRTIO_PCI=y +CONFIG_VIRTIO_PCI_LEGACY=y +CONFIG_VIRTIO_PCI_LIB=y +# CONFIG_VIRTIO_PMEM is not set +CONFIG_VIRTUALIZATION=y +CONFIG_VMAP_PFN=y +CONFIG_VT_CONSOLE_SLEEP=y +CONFIG_WATCHDOG_CORE=y +# CONFIG_WDT is not set +# CONFIG_WIRELESS_HOTKEY is not set +# CONFIG_WMI_BMOF is not set +CONFIG_X86_32_SMP=y +CONFIG_X86_ACPI_CPUFREQ=y +# CONFIG_X86_ACPI_CPUFREQ_CPB is not set +CONFIG_X86_AMD_FREQ_SENSITIVITY=y +CONFIG_X86_AMD_PLATFORM_DEVICE=y +CONFIG_X86_AMD_PSTATE=y +# CONFIG_X86_AMD_PSTATE_UT is not set +# CONFIG_X86_BIGSMP is not set +CONFIG_X86_CPUID=y +# CONFIG_X86_E_POWERSAVER is not set +CONFIG_X86_HV_CALLBACK_VECTOR=y +CONFIG_X86_INTEL_LPSS=y +CONFIG_X86_INTEL_PSTATE=y +CONFIG_X86_INTERNODE_CACHE_SHIFT=7 +CONFIG_X86_L1_CACHE_SHIFT=7 +# CONFIG_X86_LONGHAUL is not set +CONFIG_X86_NEED_RELOCS=y +CONFIG_X86_PAE=y +# CONFIG_X86_PCC_CPUFREQ is not set +CONFIG_X86_PKG_TEMP_THERMAL=y +# CONFIG_X86_PMEM_LEGACY is not set +CONFIG_X86_PM_TIMER=y +# CONFIG_X86_POWERNOW_K8 is not set +CONFIG_XEN=y +CONFIG_XENFS=y +CONFIG_XEN_ACPI=y +CONFIG_XEN_AUTO_XLATE=y +# CONFIG_XEN_BACKEND is not set +CONFIG_XEN_BALLOON=y +CONFIG_XEN_BLKDEV_FRONTEND=y +CONFIG_XEN_COMPAT_XENFS=y +CONFIG_XEN_DEBUG_FS=y +CONFIG_XEN_DEV_EVTCHN=y +CONFIG_XEN_FBDEV_FRONTEND=y +CONFIG_XEN_GNTDEV=y +CONFIG_XEN_GRANT_DEV_ALLOC=y +CONFIG_XEN_NETDEV_FRONTEND=y +CONFIG_XEN_PRIVCMD=y +CONFIG_XEN_PVH=y +CONFIG_XEN_PVHVM=y +CONFIG_XEN_PVHVM_GUEST=y +CONFIG_XEN_PVHVM_SMP=y +CONFIG_XEN_SAVE_RESTORE=y +CONFIG_XEN_SCSI_FRONTEND=y +CONFIG_XEN_SYS_HYPERVISOR=y +CONFIG_XEN_VIRTIO=y +# CONFIG_XEN_VIRTIO_FORCE_GRANT is not set +CONFIG_XEN_WDT=y +CONFIG_XEN_XENBUS_FRONTEND=y +# CONFIG_XIAOMI_WMI is not set +CONFIG_XPS=y +# CONFIG_YOGABOOK_WMI is not set +CONFIG_ZLIB_DEFLATE=y diff --git a/target/linux/x86/geode/config-6.1 b/target/linux/x86/geode/config-6.1 new file mode 100644 index 00000000000000..cf02d2b9b0a000 --- /dev/null +++ b/target/linux/x86/geode/config-6.1 @@ -0,0 +1,176 @@ +# CONFIG_3C515 is not set +CONFIG_8139CP=y +CONFIG_8139TOO=y +CONFIG_8139TOO_8129=y +CONFIG_8139TOO_PIO=y +# CONFIG_8139TOO_TUNE_TWISTER is not set +# CONFIG_8139_OLD_RX_RESET is not set +# CONFIG_ACER_WMI is not set +CONFIG_ACPI=y +CONFIG_ACPI_AC=y +# CONFIG_ACPI_BATTERY is not set +# CONFIG_ACPI_CMPC is not set +# CONFIG_ACPI_CONTAINER is not set +CONFIG_ACPI_CPU_FREQ_PSS=y +# CONFIG_ACPI_DEBUG is not set +# CONFIG_ACPI_DEBUGGER is not set +# CONFIG_ACPI_DOCK is not set +# CONFIG_ACPI_DPTF is not set +# CONFIG_ACPI_EC_DEBUGFS is not set +CONFIG_ACPI_FAN=y +CONFIG_ACPI_HOTPLUG_IOAPIC=y +CONFIG_ACPI_I2C_OPREGION=y +CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y +# CONFIG_ACPI_PCI_SLOT is not set +CONFIG_ACPI_PROCESSOR=y +# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set +CONFIG_ACPI_PROCESSOR_CSTATE=y +CONFIG_ACPI_PROCESSOR_IDLE=y +CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y +# CONFIG_ACPI_SBS is not set +CONFIG_ACPI_SPCR_TABLE=y +CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT=y +CONFIG_ACPI_THERMAL=y +# CONFIG_ACPI_TINY_POWER_BUTTON is not set +# CONFIG_ACPI_WMI is not set +# CONFIG_ADV_SWBUTTON is not set +CONFIG_ALIX=y +# CONFIG_AMD_PMC is not set +# CONFIG_AMD_PMF is not set +CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y +# CONFIG_ASUS_TF103C_DOCK is not set +# CONFIG_ATA_PIIX is not set +CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y +CONFIG_CS5535_CLOCK_EVENT_SRC=y +CONFIG_CS5535_MFGPT=y +CONFIG_CS5535_MFGPT_DEFAULT_IRQ=7 +# CONFIG_CS89x0_ISA is not set +CONFIG_DMA_ACPI=y +# CONFIG_EL3 is not set +CONFIG_GEODE_WDT=y +CONFIG_GEOS=y +# CONFIG_GIGABYTE_WMI is not set +CONFIG_GPIO_ACPI=y +CONFIG_GPIO_CDEV=y +CONFIG_GPIO_CS5535=y +# CONFIG_HPET is not set +# CONFIG_HP_ACCEL is not set +CONFIG_HWMON=y +CONFIG_I2C=y +CONFIG_I2C_ALGOBIT=y +CONFIG_I2C_ALGOPCA=y +CONFIG_I2C_ALGOPCF=y +# CONFIG_I2C_AMD_MP2 is not set +CONFIG_I2C_BOARDINFO=y +# CONFIG_I2C_HID_ACPI is not set +# CONFIG_I2C_MULTI_INSTANTIATE is not set +# CONFIG_I8K is not set +# CONFIG_INTEL_IPS is not set +# CONFIG_INTEL_MENLOW is not set +# CONFIG_INTEL_SAR_INT1092 is not set +# CONFIG_INTEL_SCU_PLATFORM is not set +# CONFIG_INTEL_SOC_DTS_THERMAL is not set +# CONFIG_INTEL_WMI_SBL_FW_UPDATE is not set +# CONFIG_INTEL_WMI_THUNDERBOLT is not set +CONFIG_IOSF_MBI=y +# CONFIG_IOSF_MBI_DEBUG is not set +CONFIG_ISA=y +# CONFIG_ISAPNP is not set +CONFIG_ISA_BUS_API=y +# CONFIG_ISCSI_IBFT is not set +# CONFIG_LANCE is not set +CONFIG_LEDS_GPIO=y +# CONFIG_M686 is not set +# CONFIG_MDA_CONSOLE is not set +CONFIG_MFD_CORE=y +CONFIG_MFD_CS5535=y +# CONFIG_MFD_INTEL_LPSS_ACPI is not set +# CONFIG_MFD_INTEL_PMC_BXT is not set +CONFIG_MGEODEGX1=y +# CONFIG_MIXCOMWD is not set +# CONFIG_MSI_WMI is not set +# CONFIG_MXM_WMI is not set +CONFIG_NATSEMI=y +CONFIG_NET5501=y +CONFIG_NSC_GPIO=y +# CONFIG_NVIDIA_WMI_EC_BACKLIGHT is not set +CONFIG_PATA_CS5520=y +CONFIG_PATA_CS5530=y +CONFIG_PATA_CS5535=y +CONFIG_PATA_CS5536=y +CONFIG_PATA_SC1200=y +CONFIG_PC8736x_GPIO=y +# CONFIG_PCENGINES_APU2 is not set +CONFIG_PCI_MMCONFIG=y +# CONFIG_PCWATCHDOG is not set +# CONFIG_PEAQ_WMI is not set +CONFIG_PINCTRL=y +# CONFIG_PINCTRL_ALDERLAKE is not set +# CONFIG_PINCTRL_BAYTRAIL is not set +# CONFIG_PINCTRL_BROXTON is not set +# CONFIG_PINCTRL_CANNONLAKE is not set +# CONFIG_PINCTRL_CHERRYVIEW is not set +# CONFIG_PINCTRL_DENVERTON is not set +# CONFIG_PINCTRL_ELKHARTLAKE is not set +# CONFIG_PINCTRL_EMMITSBURG is not set +# CONFIG_PINCTRL_GEMINILAKE is not set +# CONFIG_PINCTRL_JASPERLAKE is not set +# CONFIG_PINCTRL_LAKEFIELD is not set +# CONFIG_PINCTRL_LEWISBURG is not set +# CONFIG_PINCTRL_LYNXPOINT is not set +# CONFIG_PINCTRL_METEORLAKE is not set +# CONFIG_PINCTRL_SUNRISEPOINT is not set +# CONFIG_PINCTRL_TIGERLAKE is not set +# CONFIG_PMIC_OPREGION is not set +CONFIG_PNP=y +CONFIG_PNPACPI=y +# CONFIG_PNPBIOS is not set +CONFIG_PNP_DEBUG_MESSAGES=y +CONFIG_RTC_I2C_AND_SPI=y +# CONFIG_SAMSUNG_Q10 is not set +CONFIG_SC1200_WDT=y +# CONFIG_SCSI_FDOMAIN_ISA is not set +CONFIG_SCx200_ACB=y +CONFIG_SCx200_WDT=y +# CONFIG_SENSORS_ASUS_EC is not set +# CONFIG_SENSORS_ASUS_WMI is not set +CONFIG_SENSORS_LM90=y +CONFIG_SERIAL_8250_PNP=y +CONFIG_SERIAL_MCTRL_GPIO=y +# CONFIG_SERIAL_MULTI_INSTANTIATE is not set +# CONFIG_SND_HDA_CTL_DEV_ID is not set +# CONFIG_SND_HDA_SCODEC_CS35L41_I2C is not set +# CONFIG_SND_HDA_SCODEC_CS35L41_SPI is not set +# CONFIG_SND_SOC_AMD_ACP6x is not set +# CONFIG_SND_SOC_AMD_ACP_COMMON is not set +# CONFIG_SND_SOC_AMD_PS is not set +# CONFIG_SND_SOC_AMD_RPL_ACP6x is not set +# CONFIG_SND_SOC_INTEL_AVS is not set +# CONFIG_SURFACE_PLATFORMS is not set +# CONFIG_SYSTEM76_ACPI is not set +# CONFIG_THINKPAD_LMI is not set +# CONFIG_TOSHIBA_BT_RFKILL is not set +# CONFIG_TOSHIBA_WMI is not set +# CONFIG_USB_UHCI_HCD is not set +CONFIG_VIA_RHINE=y +CONFIG_VIA_RHINE_MMIO=y +CONFIG_WATCHDOG_CORE=y +# CONFIG_WDT is not set +# CONFIG_WIRELESS_HOTKEY is not set +# CONFIG_WMI_BMOF is not set +# CONFIG_X86_ACPI_CPUFREQ is not set +CONFIG_X86_ALIGNMENT_16=y +# CONFIG_X86_AMD_PLATFORM_DEVICE is not set +# CONFIG_X86_AMD_PSTATE is not set +# CONFIG_X86_AMD_PSTATE_UT is not set +CONFIG_X86_CPUID=y +# CONFIG_X86_E_POWERSAVER is not set +CONFIG_X86_INTEL_LPSS=y +# CONFIG_X86_LONGHAUL is not set +# CONFIG_X86_MCE is not set +CONFIG_X86_MINIMUM_CPU_FAMILY=5 +# CONFIG_X86_PCC_CPUFREQ is not set +CONFIG_X86_PM_TIMER=y +CONFIG_X86_REBOOTFIXUPS=y +# CONFIG_XIAOMI_WMI is not set +# CONFIG_YOGABOOK_WMI is not set diff --git a/target/linux/x86/legacy/config-6.1 b/target/linux/x86/legacy/config-6.1 new file mode 100644 index 00000000000000..efa1eabe82182d --- /dev/null +++ b/target/linux/x86/legacy/config-6.1 @@ -0,0 +1,262 @@ +# CONFIG_3C515 is not set +# CONFIG_ACER_WMI is not set +CONFIG_ACPI=y +CONFIG_ACPI_AC=y +CONFIG_ACPI_BATTERY=y +CONFIG_ACPI_BUTTON=y +# CONFIG_ACPI_CMPC is not set +# CONFIG_ACPI_CONTAINER is not set +CONFIG_ACPI_CPU_FREQ_PSS=y +# CONFIG_ACPI_DEBUG is not set +# CONFIG_ACPI_DEBUGGER is not set +# CONFIG_ACPI_DOCK is not set +# CONFIG_ACPI_DPTF is not set +# CONFIG_ACPI_EC_DEBUGFS is not set +# CONFIG_ACPI_FAN is not set +CONFIG_ACPI_HOTPLUG_IOAPIC=y +# CONFIG_ACPI_I2C_OPREGION is not set +CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y +# CONFIG_ACPI_PCI_SLOT is not set +CONFIG_ACPI_PROCESSOR=y +# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set +CONFIG_ACPI_PROCESSOR_CSTATE=y +CONFIG_ACPI_PROCESSOR_IDLE=y +CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y +# CONFIG_ACPI_SBS is not set +CONFIG_ACPI_SPCR_TABLE=y +CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT=y +CONFIG_ACPI_THERMAL=y +# CONFIG_ACPI_TOSHIBA is not set +CONFIG_ACPI_VIDEO=y +# CONFIG_ACPI_WMI is not set +# CONFIG_ADV_SWBUTTON is not set +CONFIG_AGP=y +# CONFIG_AGP_ALI is not set +# CONFIG_AGP_AMD is not set +# CONFIG_AGP_AMD64 is not set +# CONFIG_AGP_ATI is not set +# CONFIG_AGP_EFFICEON is not set +CONFIG_AGP_INTEL=y +# CONFIG_AGP_NVIDIA is not set +# CONFIG_AGP_SIS is not set +# CONFIG_AGP_SWORKS is not set +# CONFIG_AGP_VIA is not set +# CONFIG_AMD_PMC is not set +# CONFIG_AMD_PMF is not set +CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y +# CONFIG_ASUS_TF103C_DOCK is not set +CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_BLK_DEV_SR=y +CONFIG_CDROM=y +CONFIG_CPU_IDLE_GOV_MENU=y +CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y +# CONFIG_CS89x0_ISA is not set +CONFIG_DMA_ACPI=y +CONFIG_DMA_SHARED_BUFFER=y +CONFIG_DRM=y +CONFIG_DRM_AMDGPU=y +# CONFIG_DRM_AMD_DC is not set +CONFIG_DRM_BOCHS=y +CONFIG_DRM_BRIDGE=y +CONFIG_DRM_FBDEV_EMULATION=y +CONFIG_DRM_FBDEV_OVERALLOC=100 +CONFIG_DRM_I915=y +CONFIG_DRM_I915_CAPTURE_ERROR=y +CONFIG_DRM_I915_COMPRESS_ERROR=y +# CONFIG_DRM_I915_DEBUG is not set +# CONFIG_DRM_I915_DEBUG_GUC is not set +# CONFIG_DRM_I915_DEBUG_MMIO is not set +# CONFIG_DRM_I915_DEBUG_RUNTIME_PM is not set +# CONFIG_DRM_I915_DEBUG_VBLANK_EVADE is not set +CONFIG_DRM_I915_FENCE_TIMEOUT=10000 +CONFIG_DRM_I915_FORCE_PROBE="" +CONFIG_DRM_I915_HEARTBEAT_INTERVAL=2500 +# CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS is not set +CONFIG_DRM_I915_MAX_REQUEST_BUSYWAIT=8000 +CONFIG_DRM_I915_PREEMPT_TIMEOUT=640 +CONFIG_DRM_I915_REQUEST_TIMEOUT=20000 +# CONFIG_DRM_I915_SELFTEST is not set +CONFIG_DRM_I915_STOP_TIMEOUT=100 +# CONFIG_DRM_I915_SW_FENCE_CHECK_DAG is not set +# CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS is not set +CONFIG_DRM_I915_TIMESLICE_DURATION=1 +CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND=250 +CONFIG_DRM_I915_USERPTR=y +# CONFIG_DRM_I915_WERROR is not set +CONFIG_DRM_KMS_HELPER=y +CONFIG_DRM_MIPI_DSI=y +CONFIG_DRM_PANEL=y +CONFIG_DRM_PANEL_BRIDGE=y +CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y +CONFIG_DRM_RADEON=y +CONFIG_DRM_SCHED=y +CONFIG_DRM_TTM=y +CONFIG_DRM_TTM_HELPER=y +CONFIG_DRM_VRAM_HELPER=y +# CONFIG_EL3 is not set +CONFIG_FB=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_IMAGEBLIT=y +CONFIG_FB_CMDLINE=y +CONFIG_FB_DEFERRED_IO=y +# CONFIG_FB_I810 is not set +CONFIG_FB_SYS_COPYAREA=y +CONFIG_FB_SYS_FILLRECT=y +CONFIG_FB_SYS_FOPS=y +CONFIG_FB_SYS_IMAGEBLIT=y +# CONFIG_FB_VESA is not set +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y +CONFIG_FONT_SUPPORT=y +CONFIG_FRAMEBUFFER_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +# CONFIG_GIGABYTE_WMI is not set +CONFIG_HDMI=y +CONFIG_HID_BATTERY_STRENGTH=y +# CONFIG_HIGHMEM4G is not set +CONFIG_HPET=y +CONFIG_HPET_MMAP=y +# CONFIG_HP_ACCEL is not set +# CONFIG_HUAWEI_WMI is not set +CONFIG_HWMON=y +CONFIG_I2C=y +CONFIG_I2C_ALGOBIT=y +# CONFIG_I2C_AMD_MP2 is not set +CONFIG_I2C_BOARDINFO=y +# CONFIG_I2C_HID_ACPI is not set +# CONFIG_I2C_MULTI_INSTANTIATE is not set +# CONFIG_I8K is not set +CONFIG_INPUT_MOUSE=y +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV_PSAUX=y +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +CONFIG_INTEL_GTT=y +CONFIG_INTEL_IDLE=y +# CONFIG_INTEL_IPS is not set +# CONFIG_INTEL_MEI_HDCP is not set +# CONFIG_INTEL_MEI_PXP is not set +# CONFIG_INTEL_MENLOW is not set +# CONFIG_INTEL_SAR_INT1092 is not set +# CONFIG_INTEL_SCU_PLATFORM is not set +# CONFIG_INTEL_SOC_DTS_THERMAL is not set +# CONFIG_INTEL_WMI_SBL_FW_UPDATE is not set +# CONFIG_INTEL_WMI_THUNDERBOLT is not set +CONFIG_INTERVAL_TREE=y +CONFIG_IOSF_MBI=y +# CONFIG_IOSF_MBI_DEBUG is not set +CONFIG_ISA=y +CONFIG_ISAPNP=y +CONFIG_ISA_BUS_API=y +# CONFIG_ISCSI_IBFT is not set +CONFIG_ISO9660_FS=y +# CONFIG_JOLIET is not set +CONFIG_KCMP=y +# CONFIG_LANCE is not set +# CONFIG_LG_LAPTOP is not set +CONFIG_M586MMX=y +# CONFIG_M686 is not set +# CONFIG_MDA_CONSOLE is not set +CONFIG_MFD_CORE=y +CONFIG_MFD_INTEL_LPSS=y +CONFIG_MFD_INTEL_LPSS_ACPI=y +# CONFIG_MFD_INTEL_PMC_BXT is not set +# CONFIG_MIXCOMWD is not set +CONFIG_MMU_NOTIFIER=y +# CONFIG_MOUSE_BCM5974 is not set +# CONFIG_MOUSE_CYAPA is not set +CONFIG_MOUSE_PS2=y +CONFIG_MOUSE_PS2_ALPS=y +# CONFIG_MOUSE_PS2_BYD is not set +# CONFIG_MOUSE_PS2_CYPRESS is not set +# CONFIG_MOUSE_PS2_ELANTECH is not set +CONFIG_MOUSE_PS2_LIFEBOOK=y +CONFIG_MOUSE_PS2_LOGIPS2PP=y +CONFIG_MOUSE_PS2_SMBUS=y +CONFIG_MOUSE_PS2_SYNAPTICS=y +CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS=y +# CONFIG_MOUSE_PS2_TOUCHKIT is not set +CONFIG_MOUSE_PS2_TRACKPOINT=y +# CONFIG_MOUSE_SERIAL is not set +# CONFIG_MOUSE_VSXXXAA is not set +# CONFIG_MSI_WMI is not set +# CONFIG_MXM_WMI is not set +CONFIG_NOHIGHMEM=y +CONFIG_NO_HZ=y +# CONFIG_NVIDIA_WMI_EC_BACKLIGHT is not set +CONFIG_PATA_AMD=y +CONFIG_PATA_ATIIXP=y +CONFIG_PATA_LEGACY=y +CONFIG_PATA_MPIIX=y +CONFIG_PATA_OLDPIIX=y +CONFIG_PATA_PLATFORM=y +CONFIG_PATA_SC1200=y +CONFIG_PATA_SIS=y +CONFIG_PATA_TIMINGS=y +CONFIG_PATA_VIA=y +CONFIG_PCIEAER=y +CONFIG_PCIEASPM=y +CONFIG_PCIEASPM_DEFAULT=y +# CONFIG_PCIEASPM_PERFORMANCE is not set +# CONFIG_PCIEASPM_POWERSAVE is not set +# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set +CONFIG_PCIEPORTBUS=y +CONFIG_PCI_MMCONFIG=y +# CONFIG_PCWATCHDOG is not set +# CONFIG_PEAQ_WMI is not set +# CONFIG_PMIC_OPREGION is not set +CONFIG_PNP=y +CONFIG_PNPACPI=y +# CONFIG_PNPBIOS is not set +CONFIG_PNP_DEBUG_MESSAGES=y +CONFIG_RAS=y +CONFIG_RELAY=y +CONFIG_RTC_I2C_AND_SPI=y +# CONFIG_SAMSUNG_Q10 is not set +CONFIG_SATA_AHCI=y +# CONFIG_SCSI_FDOMAIN_ISA is not set +# CONFIG_SENSORS_ASUS_EC is not set +# CONFIG_SENSORS_ASUS_WMI is not set +CONFIG_SERIAL_8250_PNP=y +# CONFIG_SERIAL_MULTI_INSTANTIATE is not set +# CONFIG_SND_HDA_CTL_DEV_ID is not set +# CONFIG_SND_HDA_SCODEC_CS35L41_I2C is not set +# CONFIG_SND_HDA_SCODEC_CS35L41_SPI is not set +# CONFIG_SND_SOC_AMD_ACP6x is not set +# CONFIG_SND_SOC_AMD_ACP_COMMON is not set +# CONFIG_SND_SOC_AMD_PS is not set +# CONFIG_SND_SOC_AMD_RPL_ACP6x is not set +# CONFIG_SND_SOC_INTEL_AVS is not set +# CONFIG_SURFACE_PLATFORMS is not set +CONFIG_SYNC_FILE=y +# CONFIG_SYSTEM76_ACPI is not set +# CONFIG_THINKPAD_LMI is not set +# CONFIG_TOSHIBA_BT_RFKILL is not set +# CONFIG_TOSHIBA_WMI is not set +CONFIG_USB_STORAGE=y +# CONFIG_VIDEO_IPU3_CIO2 is not set +CONFIG_VMAP_PFN=y +# CONFIG_WDT is not set +# CONFIG_WIRELESS_HOTKEY is not set +# CONFIG_WMI_BMOF is not set +CONFIG_X86_ACPI_CPUFREQ=y +# CONFIG_X86_ACPI_CPUFREQ_CPB is not set +CONFIG_X86_ALIGNMENT_16=y +# CONFIG_X86_AMD_FREQ_SENSITIVITY is not set +# CONFIG_X86_AMD_PLATFORM_DEVICE is not set +# CONFIG_X86_AMD_PSTATE is not set +# CONFIG_X86_AMD_PSTATE_UT is not set +# CONFIG_X86_E_POWERSAVER is not set +CONFIG_X86_F00F_BUG=y +# CONFIG_X86_INTEL_LPSS is not set +# CONFIG_X86_LONGHAUL is not set +CONFIG_X86_MINIMUM_CPU_FAMILY=5 +# CONFIG_X86_PAE is not set +# CONFIG_X86_PCC_CPUFREQ is not set +CONFIG_X86_PM_TIMER=y +# CONFIG_X86_POWERNOW_K8 is not set +# CONFIG_XIAOMI_WMI is not set +# CONFIG_YOGABOOK_WMI is not set +CONFIG_ZLIB_DEFLATE=y diff --git a/target/linux/x86/patches-6.1/100-fix_cs5535_clockevt.patch b/target/linux/x86/patches-6.1/100-fix_cs5535_clockevt.patch new file mode 100644 index 00000000000000..d4de2027bafe15 --- /dev/null +++ b/target/linux/x86/patches-6.1/100-fix_cs5535_clockevt.patch @@ -0,0 +1,13 @@ +--- a/drivers/clocksource/timer-cs5535.c ++++ b/drivers/clocksource/timer-cs5535.c +@@ -127,7 +127,9 @@ static irqreturn_t mfgpt_tick(int irq, v + cs5535_mfgpt_write(cs5535_event_clock, MFGPT_REG_SETUP, + MFGPT_SETUP_CNTEN | MFGPT_SETUP_CMP2); + +- cs5535_clockevent.event_handler(&cs5535_clockevent); ++ if (cs5535_clockevent.event_handler) ++ cs5535_clockevent.event_handler(&cs5535_clockevent); ++ + return IRQ_HANDLED; + } + diff --git a/target/linux/x86/patches-6.1/103-pcengines_apu6_platform.patch b/target/linux/x86/patches-6.1/103-pcengines_apu6_platform.patch new file mode 100644 index 00000000000000..654bd88b7fcece --- /dev/null +++ b/target/linux/x86/patches-6.1/103-pcengines_apu6_platform.patch @@ -0,0 +1,280 @@ +From 970d9af9015a387bb81841faf05dcc1a171eb97a Mon Sep 17 00:00:00 2001 +From: Philip Prindeville +Date: Sun, 1 Jan 2023 15:25:04 -0700 +Subject: [PATCH v3 1/1] x86: Support APU5 in PCEngines platform driver +To: platform-driver-x86@vger.kernel.org, linux-x86_64@vger.kernel.org +Cc: Ed Wildgoose , Andres Salomon , Andreas Eberlein , Paul Spooren + +PCEngines make a number of SBC. APU5 has 5 mpcie slots + MSATA. +It also has support for 3x LTE modems with 6x SIM slots (pairs with a +SIM switch device). Each mpcie slot for modems has a reset GPIO + +To ensure that the naming is sane between APU2-6 the GPIOS are +renamed to be modem1-reset, modem2-reset, etc. This is significant +because the slots that can be reset change between APU2 and APU3/4 + +GPIO for simswap is moved to the end of the list as it could be dropped +for APU2 boards (but causes no harm to leave it in, hardware could be +added to a future rev of the board). + +Structure of the GPIOs for APU5 is extremely similar to APU2-4, but +many lines are moved around and there are simply more +modems/resets/sim-swap lines to breakout. + +Also added APU6, which is essentially APU4 with a different ethernet +interface and SFP cage on eth0. + +Revision history: + +v1: originally titled, "apu6: add apu6 variation to apu2 driver family" +this dealt only with detecting the APUv6, which is otherwise identical +to the v4 excepting the SFP cage on eth0. + +v2: at Ed's request, merged with his previous pull-request titled +"x86: Support APU5 in PCEngines platform driver", and some cleanup +to that changeset (including dropping the table "apu5_driver_data" +which did not have a defined type "struct apu_driver_data"), but got +mistitled when the Subject of that commit got accidentally dropped. + +v3: retitled to match Ed's previous pull-request. + +Cc: platform-driver-x86@vger.kernel.org +Cc: linux-x86_64@vger.kernel.org +Reviewed-by: Andreas Eberlein +Reviewed-by: Paul Spooren +Signed-off-by: Ed Wildgoose +Sighed-off-by: Philip Prindeville +--- + drivers/leds/leds-apu.c | 2 +- + drivers/platform/x86/Kconfig | 4 +- + drivers/platform/x86/pcengines-apuv2.c | 118 ++++++++++++++++++++++--- + 3 files changed, 107 insertions(+), 17 deletions(-) + +--- a/drivers/leds/leds-apu.c ++++ b/drivers/leds/leds-apu.c +@@ -183,7 +183,7 @@ static int __init apu_led_init(void) + + if (!(dmi_match(DMI_SYS_VENDOR, "PC Engines") && + (dmi_match(DMI_PRODUCT_NAME, "APU") || dmi_match(DMI_PRODUCT_NAME, "apu1")))) { +- pr_err("No PC Engines APUv1 board detected. For APUv2,3 support, enable CONFIG_PCENGINES_APU2\n"); ++ pr_err("No PC Engines APUv1 board detected. For APUv2,3,4,5,6 support, enable CONFIG_PCENGINES_APU2\n"); + return -ENODEV; + } + +--- a/drivers/platform/x86/Kconfig ++++ b/drivers/platform/x86/Kconfig +@@ -698,7 +698,7 @@ config XO1_RFKILL + laptop. + + config PCENGINES_APU2 +- tristate "PC Engines APUv2/3 front button and LEDs driver" ++ tristate "PC Engines APUv2/3/4/5/6 front button and LEDs driver" + depends on INPUT && INPUT_KEYBOARD && GPIOLIB + depends on LEDS_CLASS + select GPIO_AMD_FCH +@@ -706,7 +706,7 @@ config PCENGINES_APU2 + select LEDS_GPIO + help + This driver provides support for the front button and LEDs on +- PC Engines APUv2/APUv3 board. ++ PC Engines APUv2/APUv3/APUv4/APUv5/APUv6 board. + + To compile this driver as a module, choose M here: the module + will be called pcengines-apuv2. +--- a/drivers/platform/x86/pcengines-apuv2.c ++++ b/drivers/platform/x86/pcengines-apuv2.c +@@ -1,10 +1,12 @@ + // SPDX-License-Identifier: GPL-2.0+ + + /* +- * PC-Engines APUv2/APUv3 board platform driver ++ * PC-Engines APUv2-6 board platform driver + * for GPIO buttons and LEDs + * + * Copyright (C) 2018 metux IT consult ++ * Copyright (C) 2022 Ed Wildgoose ++ * Copyright (C) 2022 Philip Prindeville + * Author: Enrico Weigelt + */ + +@@ -22,38 +24,70 @@ + #include + + /* +- * NOTE: this driver only supports APUv2/3 - not APUv1, as this one ++ * NOTE: this driver only supports APUv2-6 - not APUv1, as this one + * has completely different register layouts. + */ + ++/* ++ * There are a number of APU variants, with differing features ++ * APU2 has SIM slots 1/2 mapping to mPCIe sockets 1/2 ++ * APU3/4 moved SIM slot 1 to mPCIe socket 3, ie logically reversed ++ * However, most APU3/4 have a SIM switch which we default on to reverse ++ * the order and keep physical SIM order matching physical modem order ++ * APU6 is approximately the same as APU4 with different ethernet layout ++ * ++ * APU5 has 3x SIM sockets, all with a SIM switch ++ * several GPIOs are shuffled (see schematic), including MODESW ++ */ ++ + /* Register mappings */ + #define APU2_GPIO_REG_LED1 AMD_FCH_GPIO_REG_GPIO57 + #define APU2_GPIO_REG_LED2 AMD_FCH_GPIO_REG_GPIO58 + #define APU2_GPIO_REG_LED3 AMD_FCH_GPIO_REG_GPIO59_DEVSLP1 + #define APU2_GPIO_REG_MODESW AMD_FCH_GPIO_REG_GPIO32_GE1 + #define APU2_GPIO_REG_SIMSWAP AMD_FCH_GPIO_REG_GPIO33_GE2 +-#define APU2_GPIO_REG_MPCIE2 AMD_FCH_GPIO_REG_GPIO55_DEVSLP0 +-#define APU2_GPIO_REG_MPCIE3 AMD_FCH_GPIO_REG_GPIO51 ++#define APU2_GPIO_REG_RESETM1 AMD_FCH_GPIO_REG_GPIO51 ++#define APU2_GPIO_REG_RESETM2 AMD_FCH_GPIO_REG_GPIO55_DEVSLP0 ++ ++#define APU5_GPIO_REG_MODESW AMT_FCH_GPIO_REG_GEVT22 ++#define APU5_GPIO_REG_SIMSWAP1 AMD_FCH_GPIO_REG_GPIO68 ++#define APU5_GPIO_REG_SIMSWAP2 AMD_FCH_GPIO_REG_GPIO32_GE1 ++#define APU5_GPIO_REG_SIMSWAP3 AMD_FCH_GPIO_REG_GPIO33_GE2 ++#define APU5_GPIO_REG_RESETM1 AMD_FCH_GPIO_REG_GPIO51 ++#define APU5_GPIO_REG_RESETM2 AMD_FCH_GPIO_REG_GPIO55_DEVSLP0 ++#define APU5_GPIO_REG_RESETM3 AMD_FCH_GPIO_REG_GPIO64 + + /* Order in which the GPIO lines are defined in the register list */ + #define APU2_GPIO_LINE_LED1 0 + #define APU2_GPIO_LINE_LED2 1 + #define APU2_GPIO_LINE_LED3 2 + #define APU2_GPIO_LINE_MODESW 3 +-#define APU2_GPIO_LINE_SIMSWAP 4 +-#define APU2_GPIO_LINE_MPCIE2 5 +-#define APU2_GPIO_LINE_MPCIE3 6 ++#define APU2_GPIO_LINE_RESETM1 4 ++#define APU2_GPIO_LINE_RESETM2 5 ++#define APU2_GPIO_LINE_SIMSWAP 6 ++ ++#define APU5_GPIO_LINE_LED1 0 ++#define APU5_GPIO_LINE_LED2 1 ++#define APU5_GPIO_LINE_LED3 2 ++#define APU5_GPIO_LINE_MODESW 3 ++#define APU5_GPIO_LINE_RESETM1 4 ++#define APU5_GPIO_LINE_RESETM2 5 ++#define APU5_GPIO_LINE_RESETM3 6 ++#define APU5_GPIO_LINE_SIMSWAP1 7 ++#define APU5_GPIO_LINE_SIMSWAP2 8 ++#define APU5_GPIO_LINE_SIMSWAP3 9 ++ + +-/* GPIO device */ ++/* GPIO device - APU2/3/4/6 */ + + static int apu2_gpio_regs[] = { + [APU2_GPIO_LINE_LED1] = APU2_GPIO_REG_LED1, + [APU2_GPIO_LINE_LED2] = APU2_GPIO_REG_LED2, + [APU2_GPIO_LINE_LED3] = APU2_GPIO_REG_LED3, + [APU2_GPIO_LINE_MODESW] = APU2_GPIO_REG_MODESW, ++ [APU2_GPIO_LINE_RESETM1] = APU2_GPIO_REG_RESETM1, ++ [APU2_GPIO_LINE_RESETM2] = APU2_GPIO_REG_RESETM2, + [APU2_GPIO_LINE_SIMSWAP] = APU2_GPIO_REG_SIMSWAP, +- [APU2_GPIO_LINE_MPCIE2] = APU2_GPIO_REG_MPCIE2, +- [APU2_GPIO_LINE_MPCIE3] = APU2_GPIO_REG_MPCIE3, + }; + + static const char * const apu2_gpio_names[] = { +@@ -61,9 +95,9 @@ static const char * const apu2_gpio_name + [APU2_GPIO_LINE_LED2] = "front-led2", + [APU2_GPIO_LINE_LED3] = "front-led3", + [APU2_GPIO_LINE_MODESW] = "front-button", ++ [APU2_GPIO_LINE_RESETM1] = "modem1-reset", ++ [APU2_GPIO_LINE_RESETM2] = "modem2-reset", + [APU2_GPIO_LINE_SIMSWAP] = "simswap", +- [APU2_GPIO_LINE_MPCIE2] = "mpcie2_reset", +- [APU2_GPIO_LINE_MPCIE3] = "mpcie3_reset", + }; + + static const struct amd_fch_gpio_pdata board_apu2 = { +@@ -72,6 +106,40 @@ static const struct amd_fch_gpio_pdata b + .gpio_names = apu2_gpio_names, + }; + ++/* GPIO device - APU5 */ ++ ++static int apu5_gpio_regs[] = { ++ [APU5_GPIO_LINE_LED1] = APU2_GPIO_REG_LED1, ++ [APU5_GPIO_LINE_LED2] = APU2_GPIO_REG_LED2, ++ [APU5_GPIO_LINE_LED3] = APU2_GPIO_REG_LED3, ++ [APU5_GPIO_LINE_MODESW] = APU5_GPIO_REG_MODESW, ++ [APU5_GPIO_LINE_RESETM1] = APU5_GPIO_REG_RESETM1, ++ [APU5_GPIO_LINE_RESETM2] = APU5_GPIO_REG_RESETM2, ++ [APU5_GPIO_LINE_RESETM3] = APU5_GPIO_REG_RESETM3, ++ [APU5_GPIO_LINE_SIMSWAP1] = APU5_GPIO_REG_SIMSWAP1, ++ [APU5_GPIO_LINE_SIMSWAP2] = APU5_GPIO_REG_SIMSWAP2, ++ [APU5_GPIO_LINE_SIMSWAP3] = APU5_GPIO_REG_SIMSWAP3, ++}; ++ ++static const char * const apu5_gpio_names[] = { ++ [APU5_GPIO_LINE_LED1] = "front-led1", ++ [APU5_GPIO_LINE_LED2] = "front-led2", ++ [APU5_GPIO_LINE_LED3] = "front-led3", ++ [APU5_GPIO_LINE_MODESW] = "front-button", ++ [APU5_GPIO_LINE_RESETM1] = "modem1-reset", ++ [APU5_GPIO_LINE_RESETM2] = "modem2-reset", ++ [APU5_GPIO_LINE_RESETM3] = "modem3-reset", ++ [APU5_GPIO_LINE_SIMSWAP1] = "simswap1", ++ [APU5_GPIO_LINE_SIMSWAP2] = "simswap2", ++ [APU5_GPIO_LINE_SIMSWAP3] = "simswap3", ++}; ++ ++static const struct amd_fch_gpio_pdata board_apu5 = { ++ .gpio_num = ARRAY_SIZE(apu5_gpio_regs), ++ .gpio_reg = apu5_gpio_regs, ++ .gpio_names = apu5_gpio_names, ++}; ++ + /* GPIO LEDs device */ + + static const struct gpio_led apu2_leds[] = { +@@ -215,6 +283,24 @@ static const struct dmi_system_id apu_gp + }, + .driver_data = (void *)&board_apu2, + }, ++ /* APU5 w/ mainline BIOS */ ++ { ++ .ident = "apu5", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "PC Engines"), ++ DMI_MATCH(DMI_BOARD_NAME, "apu5") ++ }, ++ .driver_data = (void *)&board_apu5, ++ }, ++ /* APU6 w/ mainline BIOS */ ++ { ++ .ident = "apu6", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "PC Engines"), ++ DMI_MATCH(DMI_BOARD_NAME, "apu6") ++ }, ++ .driver_data = (void *)&board_apu2, ++ }, + {} + }; + +@@ -249,7 +335,7 @@ static int __init apu_board_init(void) + + id = dmi_first_match(apu_gpio_dmi_table); + if (!id) { +- pr_err("failed to detect APU board via DMI\n"); ++ pr_err("No APU board detected via DMI\n"); + return -ENODEV; + } + +@@ -288,8 +374,12 @@ module_init(apu_board_init); + module_exit(apu_board_exit); + + MODULE_AUTHOR("Enrico Weigelt, metux IT consult "); +-MODULE_DESCRIPTION("PC Engines APUv2/APUv3 board GPIO/LEDs/keys driver"); ++MODULE_DESCRIPTION("PC Engines APUv2-6 board GPIO/LEDs/keys driver"); + MODULE_LICENSE("GPL"); + MODULE_DEVICE_TABLE(dmi, apu_gpio_dmi_table); + MODULE_ALIAS("platform:pcengines-apuv2"); ++MODULE_ALIAS("platform:pcengines-apuv3"); ++MODULE_ALIAS("platform:pcengines-apuv4"); ++MODULE_ALIAS("platform:pcengines-apuv5"); ++MODULE_ALIAS("platform:pcengines-apuv6"); + MODULE_SOFTDEP("pre: platform:" AMD_FCH_GPIO_DRIVER_NAME " platform:leds-gpio platform:gpio_keys_polled"); diff --git a/target/sdk/Makefile b/target/sdk/Makefile index 667d00b43f67cd..243d58bbaf15ea 100644 --- a/target/sdk/Makefile +++ b/target/sdk/Makefile @@ -86,9 +86,10 @@ KERNEL_FILES := $(patsubst $(TOPDIR)/%,%,$(wildcard $(addprefix $(LINUX_DIR)/,$( # USERSPACE_UTILS_FILES := \ tools/build \ + tools/power/cpupower \ tools/scripts \ - tools/usb/usbip \ - tools/spi + tools/spi \ + tools/usb/usbip USERSPACE_FILES := $(patsubst $(TOPDIR)/%,%,$(wildcard $(addprefix $(LINUX_DIR)/,$(USERSPACE_UTILS_FILES)))) diff --git a/toolchain/binutils/Makefile b/toolchain/binutils/Makefile index 701aded3335c36..1a7b877e6381f4 100644 --- a/toolchain/binutils/Makefile +++ b/toolchain/binutils/Makefile @@ -12,6 +12,7 @@ BIN_VERSION:=$(PKG_VERSION) PKG_SOURCE_URL:=@GNU/binutils/ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_CPE_ID:=cpe:/a:gnu:binutils TAR_OPTIONS += --exclude='*.rej' diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk index dcc79133ea3fd4..cdbf9fafa9474b 100644 --- a/toolchain/gcc/common.mk +++ b/toolchain/gcc/common.mk @@ -28,6 +28,7 @@ GCC_DIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_URL:=@GNU/gcc/gcc-$(PKG_VERSION) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_CPE_ID:=cpe:/a:gnu:gcc ifeq ($(PKG_VERSION),11.3.0) PKG_HASH:=b47cf2818691f5b1e21df2bb38c795fac2cfbd640ede2d0a5e1c89e338a3ac39 diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile index 70a4fa59026fc6..474a18e95ff264 100644 --- a/toolchain/gdb/Makefile +++ b/toolchain/gdb/Makefile @@ -13,6 +13,7 @@ PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/gdb PKG_HASH:=0e1793bf8f2b54d53f46dea84ccfd446f48f81b297b28c4f7fc017b818d69fed +PKG_CPE_ID:=cpe:/a:gnu:gdb GDB_DIR:=$(PKG_NAME)-$(PKG_VERSION) HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(GDB_DIR) diff --git a/toolchain/glibc/common.mk b/toolchain/glibc/common.mk index 0d880e04df9863..b80cb2678b8fad 100644 --- a/toolchain/glibc/common.mk +++ b/toolchain/glibc/common.mk @@ -16,6 +16,7 @@ PKG_SOURCE_VERSION:=7c32cb7dd88cf100b0b412163896e30aa2ee671a PKG_MIRROR_HASH:=92afa3672e4af0c3ba9d360e9aaac60c094a0aad9334ef78a1fd2ee49f5e1b64 PKG_SOURCE_URL:=https://sourceware.org/git/glibc.git PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz +PKG_CPE_ID:=cpe:/a:gnu:glibc HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_SOURCE_SUBDIR) CUR_BUILD_DIR:=$(HOST_BUILD_DIR)-$(VARIANT) diff --git a/toolchain/kernel-headers/Makefile b/toolchain/kernel-headers/Makefile index 8e3324816bfad3..dc70f32c907d0f 100644 --- a/toolchain/kernel-headers/Makefile +++ b/toolchain/kernel-headers/Makefile @@ -17,6 +17,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=linux PKG_VERSION:=$(LINUX_VERSION) PKG_SOURCE:=$(LINUX_SOURCE) +PKG_CPE_ID:=cpe:/o:linux:linux_kernel ifneq ($(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)) diff --git a/toolchain/musl/common.mk b/toolchain/musl/common.mk index 0901fe7d6f4d92..94444eaf75d25b 100644 --- a/toolchain/musl/common.mk +++ b/toolchain/musl/common.mk @@ -14,6 +14,7 @@ PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://musl.libc.org/releases/ PKG_HASH:=7a35eae33d5372a7c0da1188de798726f68825513b7ae3ebe97aaaa52114f039 +PKG_CPE_ID:=cpe:/a:musl-libc:musl LIBC_SO_VERSION:=$(PKG_VERSION) PATCH_DIR:=$(PATH_PREFIX)/patches diff --git a/toolchain/nasm/Makefile b/toolchain/nasm/Makefile index 64bb5e77511dac..27cd4764196e54 100644 --- a/toolchain/nasm/Makefile +++ b/toolchain/nasm/Makefile @@ -10,6 +10,7 @@ PKG_VERSION:=2.16.01 PKG_SOURCE_URL:=https://www.nasm.us/pub/nasm/releasebuilds/$(PKG_VERSION)/ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_HASH:=c77745f4802375efeee2ec5c0ad6b7f037ea9c87c92b149a9637ff099f162558 +PKG_CPE_ID:=cpe:/a:nasm:nasm HOST_BUILD_PARALLEL:=1 diff --git a/tools/7z/Makefile b/tools/7z/Makefile index 351ae527ffe09c..2d75d9059e6d65 100644 --- a/tools/7z/Makefile +++ b/tools/7z/Makefile @@ -7,6 +7,7 @@ PKG_SOURCE_VERSION:=2301 PKG_SOURCE:=$(PKG_NAME)$(PKG_SOURCE_VERSION)-src.tar.xz PKG_SOURCE_URL:=https://7-zip.org/a/ PKG_HASH:=356071007360e5a1824d9904993e8b2480b51b570e8c9faf7c0f58ebe4bf9f74 +PKG_CPE_ID:=cpe:/a:7-zip:7zip # This builds the 7zr variant which supports only 7z, so no non-LGPL code should be included PKG_LICENSE:=LGPL-2.1-or-later diff --git a/tools/bison/Makefile b/tools/bison/Makefile index 30555541e653a3..0aa0969b20bc5e 100644 --- a/tools/bison/Makefile +++ b/tools/bison/Makefile @@ -12,6 +12,7 @@ PKG_VERSION:=3.8.2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/$(PKG_NAME) PKG_HASH:=9bba0214ccf7f1079c5d59210045227bcf619519840ebfa80cd3849cff5a5bf2 +PKG_CPE_ID:=cpe:/a:gnu:bison HOST_BUILD_PARALLEL:=1 diff --git a/tools/ccache/Makefile b/tools/ccache/Makefile index 0571a994b8c9bb..7b89b441010133 100644 --- a/tools/ccache/Makefile +++ b/tools/ccache/Makefile @@ -21,7 +21,7 @@ CMAKE_HOST_OPTIONS += \ -DCMAKE_CXX_COMPILER_LAUNCHER="" \ -DCMAKE_SKIP_RPATH=FALSE \ -DCMAKE_INSTALL_RPATH="${STAGING_DIR_HOST}/lib" \ - -DENABLE_DOCUMENTATION=OFF + -DENABLE_DOCUMENTATION=OFF \ -DREDIS_STORAGE_BACKEND=OFF $(eval $(call HostBuild)) diff --git a/tools/gmp/Makefile b/tools/gmp/Makefile index cfd6e30e04ab03..c48069dd7bc616 100644 --- a/tools/gmp/Makefile +++ b/tools/gmp/Makefile @@ -12,6 +12,7 @@ PKG_VERSION:=6.2.1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/gmp/ PKG_HASH:=fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2 +PKG_CPE_ID:=cpe:/a:gmplib:gmp HOST_FIXUP:=autoreconf diff --git a/tools/liblzo/Makefile b/tools/liblzo/Makefile index 4ebda0c3336508..9f60109135944e 100644 --- a/tools/liblzo/Makefile +++ b/tools/liblzo/Makefile @@ -17,6 +17,7 @@ PKG_HASH:=c0f892943208266f9b6543b3ae308fab6284c5c90e627931446fb49b4221a072 PKG_LICENSE:=GPL-2.0-or-later PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:lzo_project:lzo CMAKE_BINARY_SUBDIR:=openwrt-build diff --git a/tools/libressl/Makefile b/tools/libressl/Makefile index 9a0fb6bee4d2de..4072194763f125 100644 --- a/tools/libressl/Makefile +++ b/tools/libressl/Makefile @@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libressl -PKG_VERSION:=3.7.2 -PKG_HASH:=b06aa538fefc9c6b33c4db4931a09a5f52d9d2357219afcbff7d93fe12ebf6f7 +PKG_VERSION:=3.7.3 +PKG_HASH:=7948c856a90c825bd7268b6f85674a8dcd254bae42e221781b24e3f8dc335db3 PKG_CPE_ID:=cpe:/a:openbsd:libressl diff --git a/tools/llvm-bpf/Makefile b/tools/llvm-bpf/Makefile index 71509511e73927..bb3179016c7b5c 100644 --- a/tools/llvm-bpf/Makefile +++ b/tools/llvm-bpf/Makefile @@ -13,6 +13,7 @@ PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).src.tar.xz PKG_SOURCE_URL:=https://github.com/llvm/llvm-project/releases/download/llvmorg-$(PKG_VERSION) PKG_HASH:=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6 +PKG_CPE_ID:=cpe:/a:llvm:llvm HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION).src diff --git a/tools/lz4/Makefile b/tools/lz4/Makefile index 8f12ca93e68329..cf1738a52fe699 100644 --- a/tools/lz4/Makefile +++ b/tools/lz4/Makefile @@ -16,6 +16,7 @@ PKG_HASH:=0b0e3aa07c8c063ddf40b082bdf7e37a1562bda40a0ff5272957f3e987e0e54b PKG_LICENSE:=BSD-2-Clause PKG_LICENSE_FILES:=LICENSE lib/LICENSE +PKG_CPE_ID:=cpe:/a:lz4_project:lz4 include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/meson.mk diff --git a/tools/mtd-utils/Makefile b/tools/mtd-utils/Makefile index 14f11acaf55b1a..90108019769b69 100644 --- a/tools/mtd-utils/Makefile +++ b/tools/mtd-utils/Makefile @@ -13,6 +13,7 @@ PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://infraroot.at/pub/mtd/ PKG_HASH:=386e27fd121699b6b729bc2e8e04dda987b31cca6b16e12fb6cc6dcf26449f46 +PKG_CPE_ID:=cpe:/a:mtd-utils_project:mtd-utils PKG_FIXUP:=autoreconf diff --git a/tools/sed/Makefile b/tools/sed/Makefile index 5cc15a3397e23a..49cbc72e6e1db6 100644 --- a/tools/sed/Makefile +++ b/tools/sed/Makefile @@ -12,6 +12,8 @@ PKG_VERSION:=4.9 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/$(PKG_NAME) PKG_HASH:=6e226b732e1cd739464ad6862bd1a1aba42d7982922da7a53519631d24975181 +PKG_CPE_ID:=cpe:/a:gnu:sed + export SED:= HOST_BUILD_PARALLEL:=1 diff --git a/tools/zip/Makefile b/tools/zip/Makefile index 6e83dafb40f610..5ad124d1c39a8f 100644 --- a/tools/zip/Makefile +++ b/tools/zip/Makefile @@ -17,6 +17,7 @@ PKG_HASH:=f0e8bb1f9b7eb0b01285495a2699df3a4b766784c1765a8f1aeedf63c0806369 PKG_LICENSE:=BSD-4-Clause PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:zip_project:zip HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)/zip$(PKG_REV) HOST_BUILD_PARALLEL:=1