diff --git a/config/Config-build.in b/config/Config-build.in index 92ec97aefa..a028ebfbc3 100644 --- a/config/Config-build.in +++ b/config/Config-build.in @@ -107,7 +107,7 @@ menu "Global build settings" default n help This makes file checksums part of package metadata. It increases size - but provides you with pkg_check command to check for flash coruptions. + but provides you with pkg_check command to check for flash corruptions. config INCLUDE_CONFIG bool "Include build configuration in firmware" if DEVEL diff --git a/config/Config-kernel.in b/config/Config-kernel.in index d4648a5064..dc249a6031 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -1112,7 +1112,7 @@ config KERNEL_SQUASHFS_XATTR bool "Squashfs XATTR support" # -# compile optimiziation setting +# compile optimization setting # choice prompt "Compiler optimization level" diff --git a/include/image-commands.mk b/include/image-commands.mk index 1c9e8c12bb..91865e1e7e 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -187,6 +187,19 @@ define Build/elecom-product-header mv $(fw).new $(fw) endef +define Build/elecom-wrc-gs-factory + $(eval product=$(word 1,$(1))) + $(eval version=$(word 2,$(1))) + $(eval hash_opt=$(word 3,$(1))) + $(MKHASH) md5 $(hash_opt) $@ >> $@ + ( \ + echo -n "ELECOM $(product) v$(version)" | \ + dd bs=32 count=1 conv=sync; \ + dd if=$@; \ + ) > $@.new + mv $@.new $@ +endef + define Build/elx-header $(eval hw_id=$(word 1,$(1))) $(eval xor_pattern=$(word 2,$(1))) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index cb4f72716f..531a760281 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -7,10 +7,10 @@ ifdef CONFIG_TESTING_KERNEL endif LINUX_VERSION-5.4 = .155 -LINUX_VERSION-5.10 = .75 +LINUX_VERSION-5.10 = .76 LINUX_KERNEL_HASH-5.4.155 = cc0c0f902748d251cb22d0e69e3b8d260c447eb0072ef853da15da6cce775038 -LINUX_KERNEL_HASH-5.10.75 = 0a2b2f5fefb90773190aaef4726ac363e03992aedc424b0a57eca092d084304b +LINUX_KERNEL_HASH-5.10.76 = 480a09ba1962862ff18df9453fa0df6ba11cbe19eefedeab81bf2c84f49e1890 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/include/meson.mk b/include/meson.mk index 12e38b9e71..ae17e18d2d 100644 --- a/include/meson.mk +++ b/include/meson.mk @@ -64,6 +64,7 @@ define Meson/CreateNativeFile -e "s|@CC@|$(foreach BIN,$(HOSTCC),'$(BIN)',)|" \ -e "s|@CXX@|$(foreach BIN,$(HOSTCXX),'$(BIN)',)|" \ -e "s|@PKGCONFIG@|$(PKG_CONFIG)|" \ + -e "s|@CMAKE@|$(STAGING_DIR_HOST)/bin/cmake|" \ -e "s|@CFLAGS@|$(foreach FLAG,$(HOST_CFLAGS) $(HOST_CPPFLAGS),'$(FLAG)',)|" \ -e "s|@CXXFLAGS@|$(foreach FLAG,$(HOST_CXXFLAGS) $(HOST_CPPFLAGS),'$(FLAG)',)|" \ -e "s|@LDFLAGS@|$(foreach FLAG,$(HOST_LDFLAGS),'$(FLAG)',)|" \ @@ -80,6 +81,7 @@ define Meson/CreateCrossFile -e "s|@STRIP@|$(TARGET_CROSS)strip|" \ -e "s|@NM@|$(TARGET_NM)|" \ -e "s|@PKGCONFIG@|$(PKG_CONFIG)|" \ + -e "s|@CMAKE@|$(STAGING_DIR_HOST)/bin/cmake|" \ -e "s|@CFLAGS@|$(foreach FLAG,$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS),'$(FLAG)',)|" \ -e "s|@CXXFLAGS@|$(foreach FLAG,$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS),'$(FLAG)',)|" \ -e "s|@LDFLAGS@|$(foreach FLAG,$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS),'$(FLAG)',)|" \ diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index d8604415cc..e56e4637f0 100644 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -209,10 +209,10 @@ add_group_and_user() { if [ -n "$rusers" ]; then local tuple oIFS="$IFS" for tuple in $rusers; do - local uid gid uname gname + local uid gid uname gname addngroups addngroup addngname addngid IFS=":" - set -- $tuple; uname="$1"; gname="$2" + set -- $tuple; uname="$1"; gname="$2"; addngroups="$3" IFS="=" set -- $uname; uname="$1"; uid="$2" set -- $gname; gname="$1"; gid="$2" @@ -232,7 +232,24 @@ add_group_and_user() { group_add_user "$gname" "$uname" fi - unset uid gid uname gname + if [ -n "$uname" ] && [ -n "$addngroups" ]; then + oIFS="$IFS" + IFS="," + for addngroup in $addngroups ; do + IFS="=" + set -- $addngroup; addngname="$1"; addngid="$2" + if [ -n "$addngid" ]; then + group_exists "$addngname" || group_add "$addngname" "$addngid" + else + group_add_next "$addngname" + fi + + group_add_user "$addngname" "$uname" + done + IFS="$oIFS" + fi + + unset uid gid uname gname addngroups addngroup addngname addngid done fi } @@ -313,6 +330,19 @@ find_mtd_part() { echo "${INDEX:+$PREFIX$INDEX}" } +find_mmc_part() { + local DEVNAME PARTNAME + + if grep -q "$1" /proc/mtd; then + echo "" && return 0 + fi + + for DEVNAME in /sys/block/mmcblk*/mmcblk*p*; do + PARTNAME="$(grep PARTNAME ${DEVNAME}/uevent | cut -f2 -d'=')" + [ "$PARTNAME" = "$1" ] && echo "/dev/$(basename $DEVNAME)" && return 0 + done +} + group_add() { local name="$1" local gid="$2" diff --git a/package/base-files/files/lib/functions/caldata.sh b/package/base-files/files/lib/functions/caldata.sh index 2177cf8415..d7b88c7dce 100644 --- a/package/base-files/files/lib/functions/caldata.sh +++ b/package/base-files/files/lib/functions/caldata.sh @@ -48,6 +48,19 @@ caldata_extract_ubi() { caldata_die "failed to extract calibration data from $ubi" } +caldata_extract_mmc() { + local part=$1 + local offset=$(($2)) + local count=$(($3)) + local mmc_part + + mmc_part=$(find_mmc_part $part) + [ -n "$mmc_part" ] || caldata_die "no mmc partition found for partition $part" + + caldata_dd $mmc_part /lib/firmware/$FIRMWARE $count $offset || \ + caldata_die "failed to extract calibration data from $mmc_part" +} + caldata_extract_reverse() { local part=$1 local offset=$2 diff --git a/package/base-files/files/lib/functions/system.sh b/package/base-files/files/lib/functions/system.sh index 80e417182a..0ac2912014 100644 --- a/package/base-files/files/lib/functions/system.sh +++ b/package/base-files/files/lib/functions/system.sh @@ -135,6 +135,15 @@ mtd_get_part_size() { done < /proc/mtd } +mmc_get_mac_binary() { + local part_name="$1" + local offset="$2" + local part + + part=$(find_mmc_part "$part_name") + get_mac_binary "$part" "$offset" +} + macaddr_add() { local mac=$1 local val=$2 diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 91ba587bf8..00339dcbcc 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -77,9 +77,8 @@ buffalo,wzr-hp-g300nh-s) domywifi,dw33d) ubootenv_add_uci_config "/dev/mtd4" "0x0" "0x10000" "0x10000" ;; -glinet,gl-ar150) - ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x10000" - ;; +dongwon,dw02-412h-64m|\ +dongwon,dw02-412h-128m|\ glinet,gl-ar300m-lite|\ glinet,gl-ar300m-nand|\ glinet,gl-ar300m-nor|\ @@ -88,6 +87,9 @@ glinet,gl-ar300m16) [ -n "$idx" ] && \ ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" ;; +glinet,gl-ar150) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x10000" + ;; netgear,wndr3700|\ netgear,wndr3700-v2|\ netgear,wndrmac-v1) diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index 593f503cf2..9ad4d64ed9 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -37,6 +37,7 @@ samknows,whitebox-v8|\ xiaomi,mi-router-3g-v2|\ xiaomi,mi-router-4a-gigabit|\ xiaomi,mi-router-4c|\ +xiaomi,miwifi-3c|\ xiaomi,miwifi-nano|\ zbtlink,zbt-wg2626|\ zte,mf283plus) diff --git a/package/boot/uboot-sunxi/Makefile b/package/boot/uboot-sunxi/Makefile index 9dce3e448a..5c27407d15 100644 --- a/package/boot/uboot-sunxi/Makefile +++ b/package/boot/uboot-sunxi/Makefile @@ -270,6 +270,15 @@ define U-Boot/nanopi_neo2 ATF:=a64 endef +define U-Boot/nanopi_r1s_h5 + BUILD_SUBTARGET:=cortexa53 + NAME:=NanoPi R1S (H5) + BUILD_DEVICES:=friendlyarm_nanopi-r1s-h5 + DEPENDS:=+PACKAGE_u-boot-nanopi_r1s_h5:arm-trusted-firmware-sunxi-a64 + UENV:=a64 + ATF:=a64 +endef + define U-Boot/pine64_plus BUILD_SUBTARGET:=cortexa53 NAME:=Pine64 Plus A64 @@ -357,6 +366,7 @@ UBOOT_TARGETS := \ nanopi_neo_plus2 \ nanopi_neo2 \ nanopi_r1 \ + nanopi_r1s_h5 \ orangepi_zero \ orangepi_r1 \ orangepi_one \ diff --git a/package/boot/uboot-sunxi/patches/253-sunxi-h5-add-support-for-nanopi-r1s-h5.patch b/package/boot/uboot-sunxi/patches/253-sunxi-h5-add-support-for-nanopi-r1s-h5.patch new file mode 100644 index 0000000000..b89351d2e9 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/253-sunxi-h5-add-support-for-nanopi-r1s-h5.patch @@ -0,0 +1,271 @@ +From e7510d24cab4741f72489b9d67c2d42b18fe5374 Mon Sep 17 00:00:00 2001 +From: Chukun Pan +Date: Sun, 10 Oct 2021 21:36:57 +0800 +Subject: [PATCH] sunxi: Add support for FriendlyARM NanoPi R1S H5 + +This adds support for the NanoPi R1S H5 board. + +Allwinner H5 SoC +512MB DDR3 RAM +10/100/1000M Ethernet x 2 +RTL8189ETV WiFi 802.11b/g/n +USB 2.0 host port (A) +MicroSD Slot +Reset button +Serial Debug Port +WAN - LAN - SYS LED + +Signed-off-by: Chukun Pan +--- + arch/arm/dts/Makefile | 1 + + arch/arm/dts/sun50i-h5-nanopi-r1s-h5.dts | 195 +++++++++++++++++++++++ + board/sunxi/MAINTAINERS | 5 + + configs/nanopi_r1s_h5_defconfig | 14 ++ + 4 files changed, 215 insertions(+) + create mode 100644 arch/arm/dts/sun50i-h5-nanopi-r1s-h5.dts + create mode 100644 configs/nanopi_r1s_h5_defconfig + +diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile +index b8a382d1539..ed3d360bb10 100644 +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -638,6 +638,7 @@ dtb-$(CONFIG_MACH_SUN50I_H5) += \ + sun50i-h5-libretech-all-h5-cc.dtb \ + sun50i-h5-nanopi-neo2.dtb \ + sun50i-h5-nanopi-neo-plus2.dtb \ ++ sun50i-h5-nanopi-r1s-h5.dtb \ + sun50i-h5-orangepi-zero-plus.dtb \ + sun50i-h5-orangepi-pc2.dtb \ + sun50i-h5-orangepi-prime.dtb \ +diff --git a/arch/arm/dts/sun50i-h5-nanopi-r1s-h5.dts b/arch/arm/dts/sun50i-h5-nanopi-r1s-h5.dts +new file mode 100644 +index 00000000000..55bcdf8d1a0 +--- /dev/null ++++ b/arch/arm/dts/sun50i-h5-nanopi-r1s-h5.dts +@@ -0,0 +1,190 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (C) 2021 Chukun Pan ++ * ++ * Based on sun50i-h5-nanopi-neo-plus2.dts, which is: ++ * Copyright (C) 2017 Antony Antony ++ * Copyright (C) 2016 ARM Ltd. ++ */ ++ ++/dts-v1/; ++#include "sun50i-h5.dtsi" ++ ++#include ++#include ++ ++/ { ++ model = "FriendlyARM NanoPi R1S H5"; ++ compatible = "friendlyarm,nanopi-r1s-h5", "allwinner,sun50i-h5"; ++ ++ aliases { ++ ethernet0 = &emac; ++ ethernet1 = &rtl8189etv; ++ serial0 = &uart0; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ sys { ++ label = "nanopi:red:sys"; ++ gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "heartbeat"; ++ }; ++ ++ lan { ++ label = "nanopi:green:lan"; ++ gpios = <&pio 0 9 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ wan { ++ label = "nanopi:green:wan"; ++ gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++ ++ r-gpio-keys { ++ compatible = "gpio-keys"; ++ ++ reset { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ reg_gmac_3v3: gmac-3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "gmac-3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ startup-delay-us = <100000>; ++ enable-active-high; ++ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ reg_vcc3v3: vcc3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ }; ++ ++ reg_usb0_vbus: usb0-vbus { ++ compatible = "regulator-fixed"; ++ regulator-name = "usb0-vbus"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ enable-active-high; ++ gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */ ++ status = "okay"; ++ }; ++ ++ vdd_cpux: gpio-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 6 GPIO_ACTIVE_HIGH>; ++ gpios-states = <0x1>; ++ states = <1100000 0x0>, <1300000 0x1>; ++ }; ++ ++ wifi_pwrseq: wifi_pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */ ++ post-power-on-delay-ms = <200>; ++ }; ++}; ++ ++&cpu0 { ++ cpu-supply = <&vdd_cpux>; ++}; ++ ++&ehci1 { ++ status = "okay"; ++}; ++ ++&ehci2 { ++ status = "okay"; ++}; ++ ++&emac { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&emac_rgmii_pins>; ++ phy-supply = <®_gmac_3v3>; ++ phy-handle = <&ext_rgmii_phy>; ++ phy-mode = "rgmii-id"; ++ status = "okay"; ++}; ++ ++&external_mdio { ++ ext_rgmii_phy: ethernet-phy@7 { ++ compatible = "ethernet-phy-ieee802.3-c22"; ++ reg = <7>; ++ }; ++}; ++ ++&i2c0 { ++ status = "okay"; ++ ++ eeprom@51 { ++ compatible = "microchip,24c02"; ++ reg = <0x51>; ++ pagesize = <16>; ++ }; ++}; ++ ++&mmc0 { ++ vmmc-supply = <®_vcc3v3>; ++ bus-width = <4>; ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ ++ status = "okay"; ++}; ++ ++&mmc1 { ++ vmmc-supply = <®_vcc3v3>; ++ vqmmc-supply = <®_vcc3v3>; ++ mmc-pwrseq = <&wifi_pwrseq>; ++ bus-width = <4>; ++ non-removable; ++ status = "okay"; ++ ++ rtl8189etv: sdio_wifi@1 { ++ reg = <1>; ++ }; ++}; ++ ++&ohci1 { ++ status = "okay"; ++}; ++ ++&ohci2 { ++ status = "okay"; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pa_pins>; ++ status = "okay"; ++}; ++ ++&usb_otg { ++ dr_mode = "peripheral"; ++ status = "okay"; ++}; ++ ++&usbphy { ++ /* USB Type-A port's VBUS is always on */ ++ usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */ ++ usb0_vbus-supply = <®_usb0_vbus>; ++ status = "okay"; ++}; +diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS +index 2543c94de79..56a0ee3689b 100644 +--- a/board/sunxi/MAINTAINERS ++++ b/board/sunxi/MAINTAINERS +@@ -358,6 +358,11 @@ M: Jelle van der Waa + S: Maintained + F: configs/nanopi_neo_air_defconfig + ++NANOPI-R1S-H5 BOARD ++M: Chukun Pan ++S: Maintained ++F: configs/nanopi_r1s_h5_defconfig ++ + NANOPI-A64 BOARD + M: Jagan Teki + S: Maintained +diff --git a/configs/nanopi_r1s_h5_defconfig b/configs/nanopi_r1s_h5_defconfig +new file mode 100644 +index 00000000000..27cf172d72a +--- /dev/null ++++ b/configs/nanopi_r1s_h5_defconfig +@@ -0,0 +1,14 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_SUNXI=y ++CONFIG_SPL=y ++CONFIG_MACH_SUN50I_H5=y ++CONFIG_DRAM_CLK=672 ++CONFIG_DRAM_ZQ=3881977 ++# CONFIG_DRAM_ODT_EN is not set ++CONFIG_MACPWR="PD6" ++CONFIG_MMC_SUNXI_SLOT_EXTRA=2 ++# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set ++CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-nanopi-r1s-h5" ++CONFIG_SUN8I_EMAC=y ++CONFIG_USB_EHCI_HCD=y ++CONFIG_USB_OHCI_HCD=y diff --git a/package/firmware/ath10k-ct-firmware/Makefile b/package/firmware/ath10k-ct-firmware/Makefile index 4fd7266f22..b210f1a5e4 100644 --- a/package/firmware/ath10k-ct-firmware/Makefile +++ b/package/firmware/ath10k-ct-firmware/Makefile @@ -292,7 +292,6 @@ $(Package/ath10k-ct-firmware-default) CATEGORY:=Firmware PROVIDES:=ath10k-firmware-qca4019 CONFLICTS:=ath10k-firmware-qca4019 - DEPENDS:=+ath10k-board-qca4019 endef define Package/ath10k-firmware-qca4019-ct-full-htt $(Package/ath10k-ct-firmware-default) @@ -307,7 +306,6 @@ $(Package/ath10k-ct-firmware-default) ath10k-firmware-qca4019-ct \ ath10k-firmware-qca4019-ct-htt DEPENDS:=\ - +ath10k-board-qca4019 \ +!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct endef define Package/ath10k-firmware-qca4019-ct-htt @@ -322,7 +320,6 @@ $(Package/ath10k-firmware-default) ath10k-firmware-qca4019 \ ath10k-firmware-qca4019-ct DEPENDS:=\ - +ath10k-board-qca4019 \ +!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct endef diff --git a/package/firmware/linux-firmware/qca_ath10k.mk b/package/firmware/linux-firmware/qca_ath10k.mk index d30487441e..d2c709af7a 100644 --- a/package/firmware/linux-firmware/qca_ath10k.mk +++ b/package/firmware/linux-firmware/qca_ath10k.mk @@ -33,7 +33,7 @@ define Package/ath10k-board-qca4019/install $(1)/lib/firmware/ath10k/QCA4019/hw1.0/ endef $(eval $(call BuildPackage,ath10k-board-qca4019)) -Package/ath10k-firmware-qca4019 = $(call Package/firmware-default,ath10k qca4019 firmware,+ath10k-board-qca4019) +Package/ath10k-firmware-qca4019 = $(call Package/firmware-default,ath10k qca4019 firmware) define Package/ath10k-firmware-qca4019/install $(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA4019/hw1.0 $(INSTALL_DATA) \ diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk index 62d79db51e..166172dbf3 100644 --- a/package/kernel/linux/modules/netsupport.mk +++ b/package/kernel/linux/modules/netsupport.mk @@ -48,6 +48,7 @@ define KernelPackage/bonding KCONFIG:=CONFIG_BONDING FILES:=$(LINUX_DIR)/drivers/net/bonding/bonding.ko AUTOLOAD:=$(call AutoLoad,40,bonding) + MODPARAMS.bonding:=max_bonds=0 endef define KernelPackage/bonding/description diff --git a/package/kernel/mac80211/patches/ath10k/081-ath10k-fix-module-load-regression-with-iram-recovery-feature.patch b/package/kernel/mac80211/patches/ath10k/081-ath10k-fix-module-load-regression-with-iram-recovery-feature.patch new file mode 100644 index 0000000000..7a7d08be48 --- /dev/null +++ b/package/kernel/mac80211/patches/ath10k/081-ath10k-fix-module-load-regression-with-iram-recovery-feature.patch @@ -0,0 +1,121 @@ +From 6f8c8bf4c7c9be1c42088689fd4370e06b46608a Mon Sep 17 00:00:00 2001 +From: Abinaya Kalaiselvan +Date: Wed, 20 Oct 2021 11:59:07 +0300 +Subject: ath10k: fix module load regression with iram-recovery feature + +Commit 9af7c32ceca8 ("ath10k: add target IRAM recovery feature support") +introduced a new firmware feature flag ATH10K_FW_FEATURE_IRAM_RECOVERY. But +this caused ath10k_pci module load to fail if ATH10K_FW_CRASH_DUMP_RAM_DATA bit +was not enabled in the ath10k coredump_mask module parameter: + +[ 2209.328190] ath10k_pci 0000:02:00.0: qca9984/qca9994 hw1.0 target 0x01000000 chip_id 0x00000000 sub 168c:cafe +[ 2209.434414] ath10k_pci 0000:02:00.0: kconfig debug 1 debugfs 1 tracing 1 dfs 1 testmode 1 +[ 2209.547191] ath10k_pci 0000:02:00.0: firmware ver 10.4-3.9.0.2-00099 api 5 features no-p2p,mfp,peer-flow-ctrl,btcoex-param,allows-mesh-bcast,no-ps,peer-fixed-rate,iram-recovery crc32 cbade90a +[ 2210.896485] ath10k_pci 0000:02:00.0: board_file api 1 bmi_id 0:1 crc32 a040efc2 +[ 2213.603339] ath10k_pci 0000:02:00.0: failed to copy target iram contents: -12 +[ 2213.839027] ath10k_pci 0000:02:00.0: could not init core (-12) +[ 2213.933910] ath10k_pci 0000:02:00.0: could not probe fw (-12) + +And by default coredump_mask does not have ATH10K_FW_CRASH_DUMP_RAM_DATA +enabled so anyone using a firmware with iram-recovery feature would fail. To my +knowledge only QCA9984 firmwares starting from release 10.4-3.9.0.2-00099 +enabled the feature. + +The reason for regression was that ath10k_core_copy_target_iram() used +ath10k_coredump_get_mem_layout() to get the memory layout, but when +ATH10K_FW_CRASH_DUMP_RAM_DATA was disabled it would get just NULL and bail out +with an error. + +While looking at all this I noticed another bug: if CONFIG_DEV_COREDUMP is +disabled but the firmware has iram-recovery enabled the module load fails with +similar error messages. I fixed that by returning 0 from +ath10k_core_copy_target_iram() when _ath10k_coredump_get_mem_layout() returns +NULL. + +Tested-on: QCA9984 hw2.0 PCI 10.4-3.9.0.2-00139 + +Fixes: 9af7c32ceca8 ("ath10k: add target IRAM recovery feature support") +Signed-off-by: Abinaya Kalaiselvan +Signed-off-by: Jouni Malinen +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20211020075054.23061-1-kvalo@codeaurora.org +--- + drivers/net/wireless/ath/ath10k/core.c | 11 +++++++++-- + drivers/net/wireless/ath/ath10k/coredump.c | 11 ++++++++--- + drivers/net/wireless/ath/ath10k/coredump.h | 7 +++++++ + 3 files changed, 24 insertions(+), 5 deletions(-) + +--- a/drivers/net/wireless/ath/ath10k/core.c ++++ b/drivers/net/wireless/ath/ath10k/core.c +@@ -2690,9 +2690,16 @@ static int ath10k_core_copy_target_iram( + int i, ret; + u32 len, remaining_len; + +- hw_mem = ath10k_coredump_get_mem_layout(ar); ++ /* copy target iram feature must work also when ++ * ATH10K_FW_CRASH_DUMP_RAM_DATA is disabled, so ++ * _ath10k_coredump_get_mem_layout() to accomplist that ++ */ ++ hw_mem = _ath10k_coredump_get_mem_layout(ar); + if (!hw_mem) +- return -ENOMEM; ++ /* if CONFIG_DEV_COREDUMP is disabled we get NULL, then ++ * just silently disable the feature by doing nothing ++ */ ++ return 0; + + for (i = 0; i < hw_mem->region_table.size; i++) { + tmp = &hw_mem->region_table.regions[i]; +--- a/drivers/net/wireless/ath/ath10k/coredump.c ++++ b/drivers/net/wireless/ath/ath10k/coredump.c +@@ -1447,11 +1447,17 @@ static u32 ath10k_coredump_get_ramdump_s + + const struct ath10k_hw_mem_layout *ath10k_coredump_get_mem_layout(struct ath10k *ar) + { +- int i; +- + if (!test_bit(ATH10K_FW_CRASH_DUMP_RAM_DATA, &ath10k_coredump_mask)) + return NULL; + ++ return _ath10k_coredump_get_mem_layout(ar); ++} ++EXPORT_SYMBOL(ath10k_coredump_get_mem_layout); ++ ++const struct ath10k_hw_mem_layout *_ath10k_coredump_get_mem_layout(struct ath10k *ar) ++{ ++ int i; ++ + if (WARN_ON(ar->target_version == 0)) + return NULL; + +@@ -1464,7 +1470,6 @@ const struct ath10k_hw_mem_layout *ath10 + + return NULL; + } +-EXPORT_SYMBOL(ath10k_coredump_get_mem_layout); + + struct ath10k_fw_crash_data *ath10k_coredump_new(struct ath10k *ar) + { +--- a/drivers/net/wireless/ath/ath10k/coredump.h ++++ b/drivers/net/wireless/ath/ath10k/coredump.h +@@ -176,6 +176,7 @@ int ath10k_coredump_register(struct ath1 + void ath10k_coredump_unregister(struct ath10k *ar); + void ath10k_coredump_destroy(struct ath10k *ar); + ++const struct ath10k_hw_mem_layout *_ath10k_coredump_get_mem_layout(struct ath10k *ar); + const struct ath10k_hw_mem_layout *ath10k_coredump_get_mem_layout(struct ath10k *ar); + + #else /* CONFIG_DEV_COREDUMP */ +@@ -213,6 +214,12 @@ ath10k_coredump_get_mem_layout(struct at + { + return NULL; + } ++ ++static inline const struct ath10k_hw_mem_layout * ++_ath10k_coredump_get_mem_layout(struct ath10k *ar) ++{ ++ return NULL; ++} + + #endif /* CONFIG_DEV_COREDUMP */ + diff --git a/package/kernel/mac80211/patches/ath10k/921-ath10k_init_devices_synchronously.patch b/package/kernel/mac80211/patches/ath10k/921-ath10k_init_devices_synchronously.patch index 7648ec3b7a..9ff1224c43 100644 --- a/package/kernel/mac80211/patches/ath10k/921-ath10k_init_devices_synchronously.patch +++ b/package/kernel/mac80211/patches/ath10k/921-ath10k_init_devices_synchronously.patch @@ -14,7 +14,7 @@ Signed-off-by: Sven Eckelmann --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c -@@ -3345,6 +3345,16 @@ int ath10k_core_register(struct ath10k * +@@ -3352,6 +3352,16 @@ int ath10k_core_register(struct ath10k * queue_work(ar->workqueue, &ar->register_work); diff --git a/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch index d815ba2742..69491fc653 100644 --- a/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch +++ b/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch @@ -172,7 +172,7 @@ v13: .patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, -@@ -3060,6 +3066,10 @@ int ath10k_core_start(struct ath10k *ar, +@@ -3067,6 +3073,10 @@ int ath10k_core_start(struct ath10k *ar, goto err_hif_stop; } @@ -183,7 +183,7 @@ v13: return 0; err_hif_stop: -@@ -3318,9 +3328,18 @@ static void ath10k_core_register_work(st +@@ -3325,9 +3335,18 @@ static void ath10k_core_register_work(st goto err_spectral_destroy; } @@ -202,7 +202,7 @@ v13: err_spectral_destroy: ath10k_spectral_destroy(ar); err_debug_destroy: -@@ -3366,6 +3385,8 @@ void ath10k_core_unregister(struct ath10 +@@ -3373,6 +3392,8 @@ void ath10k_core_unregister(struct ath10 if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags)) return; diff --git a/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch b/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch index e9d3ac6560..ce3ebcc2a6 100644 --- a/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch +++ b/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch @@ -26,7 +26,7 @@ Signed-off-by: Ansuel Smith #include #include #include -@@ -3236,6 +3237,8 @@ static int ath10k_core_probe_fw(struct a +@@ -3243,6 +3244,8 @@ static int ath10k_core_probe_fw(struct a device_get_mac_address(ar->dev, ar->mac_addr, sizeof(ar->mac_addr)); diff --git a/package/kernel/mac80211/patches/ath9k/040-ath9k-support-DT-ieee80211-freq-limit-property-to-li.patch b/package/kernel/mac80211/patches/ath9k/040-ath9k-support-DT-ieee80211-freq-limit-property-to-li.patch new file mode 100644 index 0000000000..4142cb6ffd --- /dev/null +++ b/package/kernel/mac80211/patches/ath9k/040-ath9k-support-DT-ieee80211-freq-limit-property-to-li.patch @@ -0,0 +1,29 @@ +From 03469e79fee9e8e908dae3bd1a80bcd9a66f2a88 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Mon, 11 Oct 2021 18:18:00 +0300 +Subject: ath9k: support DT ieee80211-freq-limit property to limit channels + +The common DT property can be used to limit the available channels +but ath9k has to manually call wiphy_read_of_freq_limits(). + +I would have put this into ath9k_of_init(). But it didn't work there. +The reason is that in ath9k_of_init() the channels and bands are not yet +registered in the wiphy struct. So there isn't any channel to flag as +disabled. + +Signed-off-by: Christian Lamparter +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20211009212847.1781986-1-chunkeey@gmail.com +--- +--- a/drivers/net/wireless/ath/ath9k/init.c ++++ b/drivers/net/wireless/ath/ath9k/init.c +@@ -1094,6 +1094,8 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, + ARRAY_SIZE(ath9k_tpt_blink)); + #endif + ++ wiphy_read_of_freq_limits(hw->wiphy); ++ + /* Register with mac80211 */ + error = ieee80211_register_hw(hw); + if (error) + diff --git a/package/kernel/mac80211/patches/ath9k/550-ath9k-disable-bands-via-dt.patch b/package/kernel/mac80211/patches/ath9k/550-ath9k-disable-bands-via-dt.patch deleted file mode 100644 index d1593339d2..0000000000 --- a/package/kernel/mac80211/patches/ath9k/550-ath9k-disable-bands-via-dt.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/init.c -+++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -625,6 +625,12 @@ static int ath9k_of_init(struct ath_soft - - ath_dbg(common, CONFIG, "parsing configuration from OF node\n"); - -+ if (of_property_read_bool(np, "qca,disable-2ghz")) -+ ah->disable_2ghz = true; -+ -+ if (of_property_read_bool(np, "qca,disable-5ghz")) -+ ah->disable_5ghz = true; -+ - if (of_property_read_bool(np, "qca,no-eeprom")) { - /* ath9k-eeprom--.bin */ - scnprintf(eeprom_name, sizeof(eeprom_name), diff --git a/package/kernel/mac80211/patches/ath9k/552-ath9k-ahb_of.patch b/package/kernel/mac80211/patches/ath9k/552-ath9k-ahb_of.patch index 2552bbc7a1..fce6db2167 100644 --- a/package/kernel/mac80211/patches/ath9k/552-ath9k-ahb_of.patch +++ b/package/kernel/mac80211/patches/ath9k/552-ath9k-ahb_of.patch @@ -16,7 +16,7 @@ static const struct platform_device_id ath9k_platform_id_table[] = { { -@@ -69,6 +77,242 @@ static const struct ath_bus_ops ath_ahb_ +@@ -69,6 +77,236 @@ static const struct ath_bus_ops ath_ahb_ .eeprom_read = ath_ahb_eeprom_read, }; @@ -218,12 +218,6 @@ + else + pdata->led_pin = -1; + -+ if (of_property_read_bool(pdev->dev.of_node, "qca,disable-2ghz")) -+ pdata->disable_2ghz = true; -+ -+ if (of_property_read_bool(pdev->dev.of_node, "qca,disable-5ghz")) -+ pdata->disable_5ghz = true; -+ + if (of_property_read_bool(pdev->dev.of_node, "qca,tx-gain-buffalo")) + pdata->tx_gain_buffalo = true; + diff --git a/package/libs/elfutils/Makefile b/package/libs/elfutils/Makefile index d595e4caf2..b0c9b8bd8c 100644 --- a/package/libs/elfutils/Makefile +++ b/package/libs/elfutils/Makefile @@ -26,6 +26,7 @@ PKG_BUILD_DEPENDS:=!USE_GLIBC:argp-standalone include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/nls.mk +include $(INCLUDE_DIR)/host-build.mk define Package/elfutils/Default SECTION:=libs @@ -60,6 +61,12 @@ else CONFIGURE_ARGS += --disable-nls endif +HOST_CONFIGURE_ARGS += \ + --disable-debuginfod \ + --disable-libdebuginfod \ + --without-lzma \ + --without-zstd + CONFIGURE_ARGS += \ --program-prefix=eu- \ --disable-debuginfod \ @@ -97,6 +104,7 @@ define Package/libelf/install endef # these lines need to be ordered by dependency because of ABI versioning +$(eval $(call HostBuild)) $(eval $(call BuildPackage,libelf)) $(eval $(call BuildPackage,libdw)) $(eval $(call BuildPackage,libasm)) diff --git a/package/libs/libselinux/Makefile b/package/libs/libselinux/Makefile index 0c5f9baceb..3969ef38d9 100644 --- a/package/libs/libselinux/Makefile +++ b/package/libs/libselinux/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libselinux -PKG_VERSION:=3.2 +PKG_VERSION:=3.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/3.2 -PKG_HASH:=df758ef1d9d4811051dd901ea6b029ae334ffd7c671c128beb16bce1e25ac161 +PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION) +PKG_HASH:=acfdee27633d2496508c28727c3d41d3748076f66d42fccde2e6b9f3463a7057 HOST_BUILD_DEPENDS:=libsepol/host pcre/host PKG_LICENSE:=libselinux-1.0 diff --git a/package/libs/libsemanage/Makefile b/package/libs/libsemanage/Makefile index 2fde14c06c..8337b90bda 100644 --- a/package/libs/libsemanage/Makefile +++ b/package/libs/libsemanage/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libsemanage -PKG_VERSION:=3.2 -PKG_RELEASE:=2 +PKG_VERSION:=3.3 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/3.2 -PKG_HASH:=d722a55ca4fe2d4e2b30527720db657e6238b28079e69e2e4affeb8e733ee511 +PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION) +PKG_HASH:=84d0ec5afa34bbbb471f602d8c1bf317d12443d07852a34b60741d428d597ce8 PKG_MAINTAINER:=Thomas Petazzoni PKG_LICENSE:=LGPL-2.1 PKG_LICENSE_FILES:=COPYING diff --git a/package/libs/libsepol/Makefile b/package/libs/libsepol/Makefile index c7950a9ba0..87f1ccd917 100644 --- a/package/libs/libsepol/Makefile +++ b/package/libs/libsepol/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libsepol -PKG_VERSION:=3.2 +PKG_VERSION:=3.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/3.2 -PKG_HASH:=dfc7f662af8000116e56a01de6a0394ed79be1b34b999e551346233c5dd19508 +PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION) +PKG_HASH:=2d97df3eb8466169b389c3660acbb90c54200ac96e452eca9f41a9639f4f238b PKG_MAINTAINER:=Thomas Petazzoni diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile index 23d494819e..e4399b2473 100644 --- a/package/network/config/netifd/Makefile +++ b/package/network/config/netifd/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git -PKG_SOURCE_DATE:=2021-10-21 -PKG_SOURCE_VERSION:=f78bdec2ed5f4c83d2c93f422c8bd21b68b02517 -PKG_MIRROR_HASH:=579fdf2357bd8ccf528e18ac770d80c0f42eb916fd8442f747e29e7f121b76e7 +PKG_SOURCE_DATE:=2021-10-30 +PKG_SOURCE_VERSION:=8f82742ca4f47f459284f3a07323d04da72ea5f6 +PKG_MIRROR_HASH:=5e519bb1aec9bb30782213f32f19f12e874c909e42826618dd4332ded816d2fe PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0 diff --git a/package/network/ipv6/6in4/Makefile b/package/network/ipv6/6in4/Makefile index 331295ba7a..edbb7d71a0 100644 --- a/package/network/ipv6/6in4/Makefile +++ b/package/network/ipv6/6in4/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=6in4 -PKG_RELEASE:=27 +PKG_RELEASE:=28 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/ipv6/6in4/files/6in4.sh b/package/network/ipv6/6in4/files/6in4.sh index d0904952fd..5b5c7b36af 100755 --- a/package/network/ipv6/6in4/files/6in4.sh +++ b/package/network/ipv6/6in4/files/6in4.sh @@ -138,8 +138,6 @@ proto_6in4_setup() { proto_6in4_teardown() { local cfg="$1" - local link="6in4-$cfg" - ip link del $link } proto_6in4_init_config() { diff --git a/package/network/ipv6/6rd/Makefile b/package/network/ipv6/6rd/Makefile index f9c4c6f7a5..e2ca4e1200 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:=11 +PKG_RELEASE:=12 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 3c913e54f1..62a20314d9 100644 --- a/package/network/ipv6/6rd/files/6rd.sh +++ b/package/network/ipv6/6rd/files/6rd.sh @@ -82,8 +82,6 @@ proto_6rd_setup() { proto_6rd_teardown() { local cfg="$1" - local link="6rd-$cfg" - ip link del $link } proto_6rd_init_config() { diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index f4a4856532..9c0a259a15 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -829,12 +829,14 @@ dnsmasq_start() CONFIGFILE_TMP="${CONFIGFILE}.$$" HOSTFILE="${BASEHOSTFILE}.${cfg}" HOSTFILE_TMP="${HOSTFILE}.$$" + HOSTFILE_DIR="$(dirname "$HOSTFILE")" BASEDHCPSTAMPFILE_CFG="${BASEDHCPSTAMPFILE}.${cfg}" # before we can call xappend + umask u=rwx,g=rx,o=rx mkdir -p /var/run/dnsmasq/ mkdir -p $(dirname $CONFIGFILE) - mkdir -p $(dirname $HOSTFILE) + mkdir -p "$HOSTFILE_DIR" mkdir -p /var/lib/misc chown dnsmasq:dnsmasq /var/run/dnsmasq @@ -1158,6 +1160,7 @@ dnsmasq_start() procd_add_jail_mount $EXTRA_MOUNT $RFC6761FILE $TRUSTANCHORSFILE procd_add_jail_mount $dnsmasqconffile $dnsmasqconfdir $resolvdir $user_dhcpscript procd_add_jail_mount /etc/passwd /etc/group /etc/TZ /etc/hosts /etc/ethers + [ "$HOSTFILE_DIR" != "/tmp" ] && procd_add_jail_mount "$HOSTFILE_DIR" procd_add_jail_mount_rw /var/run/dnsmasq/ $leasefile procd_close_instance diff --git a/package/network/services/dropbear/Config.in b/package/network/services/dropbear/Config.in index 15000eff53..d4644fc88f 100644 --- a/package/network/services/dropbear/Config.in +++ b/package/network/services/dropbear/Config.in @@ -95,6 +95,11 @@ config DROPBEAR_DBCLIENT bool "Build dropbear with dbclient" default y +config DROPBEAR_DBCLIENT_AGENTFORWARD + bool "Enable agent forwarding in dbclient" + default y + depends on DROPBEAR_DBCLIENT + config DROPBEAR_SCP bool "Build dropbear with scp" default y @@ -109,4 +114,8 @@ config DROPBEAR_ASKPASS Increases binary size by about 0.1 kB (MIPS). +config DROPBEAR_AGENTFORWARD + bool "Enable agent forwarding" + default y + endmenu diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile index 7fb4b7f123..d518de3f70 100644 --- a/package/network/services/dropbear/Makefile +++ b/package/network/services/dropbear/Makefile @@ -32,7 +32,8 @@ PKG_CONFIG_DEPENDS:= \ CONFIG_DROPBEAR_CURVE25519 CONFIG_DROPBEAR_ZLIB \ CONFIG_DROPBEAR_ED25519 CONFIG_DROPBEAR_CHACHA20POLY1305 \ CONFIG_DROPBEAR_UTMP CONFIG_DROPBEAR_PUTUTLINE \ - CONFIG_DROPBEAR_DBCLIENT CONFIG_DROPBEAR_SCP CONFIG_DROPBEAR_ASKPASS + CONFIG_DROPBEAR_DBCLIENT CONFIG_DROPBEAR_SCP CONFIG_DROPBEAR_ASKPASS \ + CONFIG_DROPBEAR_DBCLIENT_AGENTFORWARD CONFIG_DROPBEAR_AGENTFORWARD include $(INCLUDE_DIR)/package.mk @@ -135,6 +136,8 @@ DB_OPT_CONFIG = \ !!DROPBEAR_ECC_384|CONFIG_DROPBEAR_ECC_FULL|1|0 \ !!DROPBEAR_ECC_521|CONFIG_DROPBEAR_ECC_FULL|1|0 \ DROPBEAR_CLI_ASKPASS_HELPER|CONFIG_DROPBEAR_ASKPASS|1|0 \ + DROPBEAR_CLI_AGENTFWD|CONFIG_DROPBEAR_DBCLIENT_AGENTFORWARD|1|0 \ + DROPBEAR_SVR_AGENTFWD|CONFIG_DROPBEAR_AGENTFORWARD|1|0 \ TARGET_CFLAGS += -DARGTYPE=3 -ffunction-sections -fdata-sections -flto diff --git a/package/network/services/umdns/files/umdns.json b/package/network/services/umdns/files/umdns.json index e941b223a8..92f1a17b52 100644 --- a/package/network/services/umdns/files/umdns.json +++ b/package/network/services/umdns/files/umdns.json @@ -21,6 +21,7 @@ "fstat", "getsockname", "ioctl", + "madvise", "mmap", "mmap2", "munmap", diff --git a/package/system/selinux-policy/Makefile b/package/system/selinux-policy/Makefile index 219ebc7995..0b85920170 100644 --- a/package/system/selinux-policy/Makefile +++ b/package/system/selinux-policy/Makefile @@ -7,9 +7,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=selinux-policy PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://git.defensec.nl/selinux-policy.git -PKG_VERSION:=0.9 -PKG_MIRROR_HASH:=f1a37a4fc104fbacde3012178fc117b473899360f26a8735156394288441d99c +PKG_SOURCE_URL:=https://github.com/DefenSec/selinux-policy +PKG_VERSION:=1.0 +PKG_MIRROR_HASH:=2358a064d1231d39e6292d646e1a38898d949b8bef6558ac1e0992d3b5bca33f PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_BUILD_DEPENDS:=secilc/host policycoreutils/host diff --git a/package/utils/checkpolicy/Makefile b/package/utils/checkpolicy/Makefile index 206bf201c0..e9c10e293f 100644 --- a/package/utils/checkpolicy/Makefile +++ b/package/utils/checkpolicy/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=checkpolicy -PKG_VERSION:=3.2 +PKG_VERSION:=3.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/3.2 -PKG_HASH:=9b1c81fa86fe3867842164448d90c8e7ea94b2987497809c65d4caa87a5c5bc8 +PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION) +PKG_HASH:=25c84edfa3a10ab8cb073b97bc55cb66377532d54a2723da9accdabd05431485 PKG_INSTALL:=1 PKG_BUILD_DEPENDS:=libselinux HOST_BUILD_DEPENDS:=libselinux/host diff --git a/package/utils/policycoreutils/Makefile b/package/utils/policycoreutils/Makefile index 249c2afb94..f724deda97 100644 --- a/package/utils/policycoreutils/Makefile +++ b/package/utils/policycoreutils/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=policycoreutils -PKG_VERSION:=3.2 +PKG_VERSION:=3.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/3.2 -PKG_HASH:=d1331c6fa766c547b071c491de90b9f343c8dbffdb119be8a5a7e491199b93a9 +PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION) +PKG_HASH:=4199040ced8a81f2ddd0522b4faf2aba62fc821473f4051dc8474fb1c4a01078 PKG_INSTALL:=1 HOST_BUILD_DEPENDS:=libsemanage/host gettext-full/host PKG_BUILD_DEPENDS:=BUSYBOX_CONFIG_PAM:libpam gettext-full/host diff --git a/package/utils/secilc/Makefile b/package/utils/secilc/Makefile index 7ed22615c0..6f059bfc81 100644 --- a/package/utils/secilc/Makefile +++ b/package/utils/secilc/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=secilc -PKG_VERSION:=3.2 +PKG_VERSION:=3.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/3.2 -PKG_HASH:=5f6e6528a281b29ac5e558babffc3d8aab682fd8df8977daff5f266a50292cc3 +PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION) +PKG_HASH:=2c5e1a5d417baf1d2aa3eac294e12c3aac7184a5ef6a779dcbe469ed756e8651 HOST_BUILD_DEPENDS:=libsepol/host PKG_MAINTAINER:=Dominick Grift diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 81b1ffcb56..2adc5efec5 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -4697,7 +4697,7 @@ sub process { ## $line !~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Type\s*$Ident.*/) { ## ## # Remove any bracketed sections to ensure we do not -## # falsly report the parameters of functions. +## # falsely report the parameters of functions. ## my $ln = $line; ## while ($ln =~ s/\([^\(\)]*\)//g) { ## } diff --git a/scripts/dl_github_archive.py b/scripts/dl_github_archive.py index 59fd7067be..b992227dc9 100755 --- a/scripts/dl_github_archive.py +++ b/scripts/dl_github_archive.py @@ -207,7 +207,7 @@ class GitHubCommitTsCache(object): class DownloadGitHubTarball(object): - """Download and repack archive tarabll from GitHub. + """Download and repack archive tarball from GitHub. Compared with the method of packing after cloning the whole repo, this method is more friendly to users with fragile internet connection. @@ -220,7 +220,7 @@ class DownloadGitHubTarball(object): - GitHub archives do not contain source codes for submodules. - - GitHub archives seem to respect .gitattributes and ignore pathes with + - GitHub archives seem to respect .gitattributes and ignore paths with export-ignore attributes. For the first two issues, the method will fail loudly to allow fallback to diff --git a/scripts/ext-toolchain.sh b/scripts/ext-toolchain.sh index ee7d9532f5..4da287591a 100755 --- a/scripts/ext-toolchain.sh +++ b/scripts/ext-toolchain.sh @@ -569,7 +569,7 @@ while [ -n "$1" ]; do echo -e " Most commands also take a --cflags parameter which " >&2 echo -e " is used to specify C flags to be passed to the " >&2 echo -e " cross compiler when performing tests." >&2 - echo -e " This paremter may be repeated multiple times." >&2 + echo -e " This parameter may be repeated multiple times." >&2 exit 1 ;; diff --git a/scripts/flashing/eva_ramboot.py b/scripts/flashing/eva_ramboot.py index b182f09d21..365fceecf6 100755 --- a/scripts/flashing/eva_ramboot.py +++ b/scripts/flashing/eva_ramboot.py @@ -3,7 +3,6 @@ import argparse from ftplib import FTP -from sys import argv from os import stat parser = argparse.ArgumentParser(description='Tool to boot AVM EVA ramdisk images.') diff --git a/scripts/json_overview_image_info.py b/scripts/json_overview_image_info.py index db47fd9e42..89b7d4fe20 100755 --- a/scripts/json_overview_image_info.py +++ b/scripts/json_overview_image_info.py @@ -7,7 +7,7 @@ from sys import argv import json if len(argv) != 2: - print("JSON info files script requires ouput file as argument") + print("JSON info files script requires output file as argument") exit(1) output_path = Path(argv[1]) diff --git a/scripts/linksys-image.sh b/scripts/linksys-image.sh index 36a676d964..c3baf44844 100755 --- a/scripts/linksys-image.sh +++ b/scripts/linksys-image.sh @@ -11,11 +11,11 @@ # This is appended to the factory image and is tested by the Linksys Upgrader - as observed in civic. # The footer is 256 bytes. The format is: # .LINKSYS. This is detected by the Linksys upgrader before continuing with upgrade. (9 bytes) -# The version number of upgrade. Not checked so use arbitary value (8 bytes) +# The version number of upgrade. Not checked so use arbitrary value (8 bytes) # Model of target device, padded (0x20) to (15 bytes) # CRC checksum of the image to flash (8 byte) # Padding (0x20) (7 bytes) -# Signature of signer. Not checked so use Arbitary value (16 bytes) +# Signature of signer. Not checked so use arbitrary value (16 bytes) # Padding (0x00) (192 bytes) # 0x0A (1 byte) diff --git a/scripts/metadata.pm b/scripts/metadata.pm index f252c5309c..ee5a2945ca 100644 --- a/scripts/metadata.pm +++ b/scripts/metadata.pm @@ -295,13 +295,19 @@ sub parse_package_metadata($) { my @ugspecs = split /\s+/, $1; for my $ugspec (@ugspecs) { - my @ugspec = split /:/, $ugspec, 2; + my @ugspec = split /:/, $ugspec, 3; if ($ugspec[0]) { parse_package_metadata_usergroup($src->{makefile}, "user", \%usernames, \%userids, $ugspec[0]) or return 0; } if ($ugspec[1]) { parse_package_metadata_usergroup($src->{makefile}, "group", \%groupnames, \%groupids, $ugspec[1]) or return 0; } + if ($ugspec[2]) { + my @addngroups = split /,/, $ugspec[2]; + for my $addngroup (@addngroups) { + parse_package_metadata_usergroup($src->{makefile}, "group", \%groupnames, \%groupids, $addngroup) or return 0; + } + } } }; } diff --git a/scripts/pad_image b/scripts/pad_image index b1941a28d8..871063af34 100755 --- a/scripts/pad_image +++ b/scripts/pad_image @@ -2,7 +2,7 @@ function usage { echo "Usage: prepare_image image_type kernel_image rootfs_image header_size" - echo "Padd root and kernel image to the correct size and append the jffs2 start marker as needed" + echo "Pad root and kernel image to the correct size and append the jffs2 start marker as needed" exit 1 } diff --git a/scripts/sign_images.sh b/scripts/sign_images.sh index c41b21e091..f37c2f5016 100755 --- a/scripts/sign_images.sh +++ b/scripts/sign_images.sh @@ -3,12 +3,12 @@ # directory where search for images TOP_DIR="${TOP_DIR:-./bin/targets}" # key to sign images -BUILD_KEY="${BUILD_KEY:-key-build}" # TODO unifiy naming? +BUILD_KEY="${BUILD_KEY:-key-build}" # TODO unify naming? # remove other signatures (added e.g. by buildbot) REMOVE_OTER_SIGNATURES="${REMOVE_OTER_SIGNATURES:-1}" # find all sysupgrade images in TOP_DIR -# factory images don't need signatures as non OpenWrt system doen't check them anyway +# factory images don't need signatures as non OpenWrt system doesn't check them anyway for image in $(find $TOP_DIR -type f -name "*-sysupgrade.bin"); do # check if image actually support metadata if fwtool -i /dev/null "$image"; then diff --git a/scripts/size_compare.sh b/scripts/size_compare.sh index 8b047a451e..a5cc3337c7 100755 --- a/scripts/size_compare.sh +++ b/scripts/size_compare.sh @@ -7,9 +7,9 @@ ### ### The script compares locally compiled package with the package indexes ### available upstream. This way the storage impact of optimizations or -### feature modifiactions is easy to see. +### feature modifications is easy to see. ### -### If no environmental variables are set the scritp reads the current +### If no environmental variables are set the script reads the current ### .config file. The evaluated env variables are the following: ### ### TARGET SUBTARGET ARCH PACKAGES BIN_DIR BASE_URL CHECK_INSTALLED diff --git a/scripts/slugimage.pl b/scripts/slugimage.pl index 8c0654d4f6..366b239e96 100755 --- a/scripts/slugimage.pl +++ b/scripts/slugimage.pl @@ -772,7 +772,7 @@ sub writeOutFirmware { $_->{'name'}, $filename); } - # If the next parition is before the end of the current image, then rewind. + # If the next partition is before the end of the current image, then rewind. elsif ($_->{'offset'} < $end_point) { $debug and printf("Rewound %s before <%s> in \"%s\"\n", (($end_point - $_->{'offset'}) >= $block_size ? @@ -971,7 +971,7 @@ if (!GetOptions("d|debug" => \$debug, print " [-b|--redboot] Input/Output RedBoot filename\n"; print " [-s|--sysconf] Input/Output SysConf filename\n"; print " [-L|--loader] Second stage boot loader filename\n"; - print " [-k|--kernel] Input/Ouptut Kernel filename\n"; + print " [-k|--kernel] Input/Output Kernel filename\n"; print " [-r|--ramdisk] Input/Output Ramdisk filename(s)\n"; print " [-f|--fisdir] Input/Output FIS directory filename\n"; print " [-m|--microcode] Input/Output Microcode filename\n"; diff --git a/target/linux/apm821xx/base-files/etc/board.d/02_network b/target/linux/apm821xx/base-files/etc/board.d/02_network index f289e4ec74..3a97c67f28 100644 --- a/target/linux/apm821xx/base-files/etc/board.d/02_network +++ b/target/linux/apm821xx/base-files/etc/board.d/02_network @@ -10,7 +10,7 @@ case "$board" in meraki,mr24|\ wd,mybooklive|\ wd,mybooklive-duo) - ucidef_set_interface_lan "eth0" + ucidef_set_interface_lan "eth0" "dhcp" ;; netgear,wndap620) ucidef_add_switch "switch0" "2:lan" "5@eth0" diff --git a/target/linux/apm821xx/patches-5.10/802-usb-xhci-force-msi-renesas-xhci.patch b/target/linux/apm821xx/patches-5.10/802-usb-xhci-force-msi-renesas-xhci.patch index 52198e41f4..3b17a27e79 100644 --- a/target/linux/apm821xx/patches-5.10/802-usb-xhci-force-msi-renesas-xhci.patch +++ b/target/linux/apm821xx/patches-5.10/802-usb-xhci-force-msi-renesas-xhci.patch @@ -43,7 +43,7 @@ produce a noisy warning. hcd->msi_enabled = 1; --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -1891,6 +1891,7 @@ struct xhci_hcd { +@@ -1892,6 +1892,7 @@ struct xhci_hcd { struct xhci_hub usb2_rhub; struct xhci_hub usb3_rhub; /* support xHCI 1.0 spec USB2 hardware LPM */ diff --git a/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts b/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts index 25adac4e8a..15e23f2421 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts +++ b/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts @@ -15,7 +15,7 @@ reset { label = "reset"; linux,code = ; - gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; debounce-interval = <60>; }; }; diff --git a/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi b/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi index 549daace7e..ba0f7ad23e 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi +++ b/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi @@ -78,7 +78,7 @@ &wmac { status = "okay"; - qca,disable-5ghz; + ieee80211-freq-limit = <2402000 2482000>; mtd-cal-data = <&art 0x1000>; }; diff --git a/target/linux/ath79/dts/ar9344_atheros_db120.dts b/target/linux/ath79/dts/ar9344_atheros_db120.dts index f96e31caca..625a8e4fa2 100644 --- a/target/linux/ath79/dts/ar9344_atheros_db120.dts +++ b/target/linux/ath79/dts/ar9344_atheros_db120.dts @@ -207,7 +207,7 @@ compatible = "pci168c,0030"; reg = <0x0000 0 0 0 0>; qca,no-eeprom; - qca,disable-2ghz; + ieee80211-freq-limit = <4900000 5990000>; #gpio-cells = <2>; gpio-controller; }; diff --git a/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi b/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi index 1c318f2083..09dc5806d7 100644 --- a/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi +++ b/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi @@ -69,7 +69,7 @@ ath9k: wifi@0,0,0 { compatible = "pci168c,0030"; reg = <0x0 0 0 0 0>; - qca,disable-5ghz; + ieee80211-freq-limit = <2402000 2482000>; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; @@ -79,7 +79,7 @@ &wmac { status = "okay"; - qca,disable-2ghz; + ieee80211-freq-limit = <4900000 5990000>; mtd-cal-data = <&art 0x1000>; }; diff --git a/target/linux/ath79/dts/ar9344_pcs_cap324.dts b/target/linux/ath79/dts/ar9344_pcs_cap324.dts index 1f15a2e8b8..6ebd6a43bb 100644 --- a/target/linux/ath79/dts/ar9344_pcs_cap324.dts +++ b/target/linux/ath79/dts/ar9344_pcs_cap324.dts @@ -123,7 +123,7 @@ mac-address-increment = <(-2)>; mtd-cal-data = <&art 0x5000>; qca,no-eeprom; - qca,disable-5ghz; + ieee80211-freq-limit = <2402000 2482000>; #gpio-cells = <2>; gpio-controller; }; @@ -132,7 +132,7 @@ &wmac { status = "okay"; - qca,disable-2ghz; + ieee80211-freq-limit = <4900000 5990000>; mtd-cal-data = <&art 0x1000>; nvmem-cells = <&macaddr_art_0>; nvmem-cell-names = "mac-address"; diff --git a/target/linux/ath79/dts/qca9531_letv_lba-047-ch.dts b/target/linux/ath79/dts/qca9531_letv_lba-047-ch.dts new file mode 100644 index 0000000000..d65417c0d5 --- /dev/null +++ b/target/linux/ath79/dts/qca9531_letv_lba-047-ch.dts @@ -0,0 +1,158 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca953x.dtsi" + +#include +#include +#include + +/ { + model = "Letv LBA-047-CH"; + compatible = "letv,lba-047-ch", "qca,qca9531"; + + aliases { + led-boot = &led_status_red; + led-failsafe = &led_status_red; + led-running = &led_status_blue; + led-upgrade = &led_status_red; + label-mac-device = ð0; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&led_wan_pin>; + + led_status_blue: status_blue { + label = "blue:status"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + led_status_red: status_red { + label = "red:status"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + devices = <&fwconcat0 &fwconcat1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x0 0x0>; + label = "firmware"; + compatible = "openwrt,uimage", "denx,uimage"; + openwrt,ih-magic = ; + }; + }; + }; +}; + +&pinmux { + /* GPIO 4: LED_LINK_5 (WAN) */ + led_wan_pin: pinmux_led_wan_pin { + pinctrl-single,bits = <0x04 0x0000002d 0x000000ff>; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + m25p,fast-read; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x10000>; + read-only; + }; + + fwconcat0: partition@50000 { + label = "fwconcat0"; + reg = <0x50000 0xe30000>; + }; + + partition@e80000 { + label = "loader"; + reg = <0xe80000 0x10000>; + }; + + fwconcat1: partition@e90000 { + label = "fwconcat1"; + reg = <0xe90000 0x160000>; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x10000>; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy4>; + + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + compatible = "qca,qca9530-eth", "syscon", "simple-mfd"; + + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9557_dongwon_dw02-412h-128m.dts b/target/linux/ath79/dts/qca9557_dongwon_dw02-412h-128m.dts new file mode 100644 index 0000000000..2308d82af9 --- /dev/null +++ b/target/linux/ath79/dts/qca9557_dongwon_dw02-412h-128m.dts @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9557_dongwon_dw02-412h.dtsi" + +/ { + model = "Dongwon T&I DW02-412H (128M)"; + compatible = "dongwon,dw02-412h-128m", "qca,qca9557"; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "current"; + reg = <0x0 0x1000000>; + read-only; + }; + + partition@1000000 { + label = "kernel"; + reg = <0x1000000 0x800000>; + }; + + partition@1800000 { + label = "ubi"; + reg = <0x1800000 0x6800000>; + }; + }; +}; diff --git a/target/linux/ath79/dts/qca9557_dongwon_dw02-412h-64m.dts b/target/linux/ath79/dts/qca9557_dongwon_dw02-412h-64m.dts new file mode 100644 index 0000000000..2420dc11a9 --- /dev/null +++ b/target/linux/ath79/dts/qca9557_dongwon_dw02-412h-64m.dts @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9557_dongwon_dw02-412h.dtsi" + +/ { + model = "Dongwon T&I DW02-412H (64M)"; + compatible = "dongwon,dw02-412h-64m", "qca,qca9557"; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "current"; + reg = <0x0 0x1000000>; + read-only; + }; + + partition@1000000 { + label = "kernel"; + reg = <0x1000000 0x800000>; + }; + + partition@1800000 { + label = "ubi"; + reg = <0x1800000 0x2800000>; + }; + }; +}; diff --git a/target/linux/ath79/dts/qca9557_dongwon_dw02-412h.dtsi b/target/linux/ath79/dts/qca9557_dongwon_dw02-412h.dtsi new file mode 100644 index 0000000000..fd56983432 --- /dev/null +++ b/target/linux/ath79/dts/qca9557_dongwon_dw02-412h.dtsi @@ -0,0 +1,175 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x.dtsi" + +#include +#include + +/ { + aliases { + led-boot = &led_wan; + led-failsafe = &led_wan; + led-upgrade = &led_wan; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "WPS button"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + reset { + label = "Reset button"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_wan: wan { + label = "green:wan"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "green:wlan"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + partition@50000 { + label = "log"; + reg = <0x050000 0x010000>; + read-only; + }; + + partition@60000 { + label = "recoverk"; + reg = <0x060000 0x0e0000>; + read-only; + }; + + partition@140000 { + label = "recoverr"; + reg = <0x140000 0x090000>; + read-only; + }; + + partition@1d0000 { + label = "nvram"; + reg = <0x1d0000 0x010000>; + read-only; + }; + + partition@1e0000 { + label = "nvbackup"; + reg = <0x1e0000 0x010000>; + read-only; + }; + + art: partition@1f0000 { + label = "art"; + reg = <0x1f0000 0x010000>; + read-only; + }; + }; + }; +}; + +&pcie0 { + status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0 0 0 0 0>; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <3>; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + + qca,ar8327-initvals = < + 0x04 0x07600000 /* PORT0 PAD MODE CTRL */ + 0x50 0xcf37cf37 /* LED Control Register 0 */ + 0x54 0x00000000 /* LED Control Register 1 */ + 0x58 0x00000000 /* LED Control Register 2 */ + 0x5c 0x0030c300 /* LED Control Register 3 */ + 0x7c 0x0000007e /* PORT0_STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; + phy-handle = <&phy0>; + pll-data = <0xa6000000 0x00000101 0x00001616>; + + gmac-config { + device = <&gmac>; + rgmii-enabled = <1>; + }; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-922uags-5hpacd.dts b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-922uags-5hpacd.dts index 36979bbd33..8ad834fe61 100644 --- a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-922uags-5hpacd.dts +++ b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-922uags-5hpacd.dts @@ -23,27 +23,6 @@ gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; }; }; - - i2c: i2c { - compatible = "i2c-gpio"; - - sda-gpios = <&gpio 18 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; - scl-gpios = <&gpio 19 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; - i2c-gpio,delay-us = <5>; - i2c-gpio,timeout-ms = <1>; - }; - - sfp1: sfp { - compatible = "sff,sfp"; - - i2c-bus = <&i2c>; - maximum-power-milliwatt = <1000>; - los-gpios = <&gpio 21 GPIO_ACTIVE_HIGH>; - mod-def0-gpios = <&gpio 17 GPIO_ACTIVE_LOW>; - tx-disable-gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; - // Toggling GPIO16 actually enables/disables the transmitter, - // but the SFP driver does not seem to be using it. - }; }; &pcie0 { @@ -76,30 +55,3 @@ &usb_phy1 { status = "okay"; }; - -&mdio1 { - status = "okay"; - - phy_sfp: ethernet-phy@0 { - reg = <0>; - phy-mode = "sgmii"; - sfp = <&sfp1>; - }; -}; - -ð1 { - status = "okay"; - - phy-handle = <&phy_sfp>; - pll-data = <0x03000000 0x00000101 0x00001616>; - qca955x-sgmii-fixup; - - gmac-config { - device = <&gmac>; - }; - - fixed-link { - speed = <1000>; - full-duplex; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi index 5e919856a5..d71c12c1fd 100644 --- a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi +++ b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi @@ -42,6 +42,27 @@ gpios = <&gpio 23 GPIO_ACTIVE_LOW>; }; }; + + i2c: i2c { + compatible = "i2c-gpio"; + + sda-gpios = <&gpio 18 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + scl-gpios = <&gpio 19 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + i2c-gpio,delay-us = <5>; + i2c-gpio,timeout-ms = <1>; + }; + + sfp1: sfp { + compatible = "sff,sfp"; + + i2c-bus = <&i2c>; + maximum-power-milliwatt = <1000>; + los-gpios = <&gpio 21 GPIO_ACTIVE_HIGH>; + mod-def0-gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + tx-disable-gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; + // Toggling GPIO16 actually enables/disables the transmitter, + // but the SFP driver does not seem to be using it. + }; }; &mdio0 { @@ -64,6 +85,33 @@ }; }; +&mdio1 { + status = "okay"; + + phy_sfp: ethernet-phy@0 { + reg = <0>; + phy-mode = "sgmii"; + sfp = <&sfp1>; + }; +}; + +ð1 { + status = "okay"; + + phy-handle = <&phy_sfp>; + pll-data = <0x03000000 0x00000101 0x00001616>; + qca955x-sgmii-fixup; + + gmac-config { + device = <&gmac>; + }; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + &spi { status = "okay"; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index c09a690434..4c6e9cbdda 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -307,6 +307,11 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" ;; + letv,lba-047-ch) + ucidef_set_interface_wan "eth0" + ucidef_add_switch "switch0" \ + "0@eth1" "3:lan:2" "4:lan:1" + ;; librerouter,librerouter-v1) ucidef_add_switch "switch0" \ "0@eth0" "5:wan" "6@eth1" "4:lan" diff --git a/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches b/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches index 83f428c54a..ca7d8c633c 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches @@ -76,13 +76,13 @@ tplink,wbs510-v2) ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "20" ;; ubnt,aircube-ac|\ -ubnt,aircube-isp) - ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "11" - ;; ubnt,nanobeam-ac-gen2|\ ubnt,nanostation-ac) ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "3" ;; +ubnt,aircube-isp) + ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "11" + ;; ubnt,nanostation-m) ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "8" ;; diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 483861daf2..e24831ec3f 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1443,6 +1443,21 @@ define Device/joyit_jt-or750i endef TARGET_DEVICES += joyit_jt-or750i +define Device/letv_lba-047-ch + $(Device/loader-okli-uimage) + SOC := qca9531 + DEVICE_VENDOR := Letv + DEVICE_MODEL := LBA-047-CH + IMAGE_SIZE := 15936k + LOADER_FLASH_OFFS := 0x50000 + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | check-size | pad-to 14528k | \ + append-loader-okli-uimage $(1) | pad-to 64k +endef +TARGET_DEVICES += letv_lba-047-ch + define Device/librerouter_librerouter-v1 SOC := qca9558 DEVICE_VENDOR := Librerouter diff --git a/target/linux/ath79/image/mikrotik.mk b/target/linux/ath79/image/mikrotik.mk index 4256f77379..2324ecc195 100644 --- a/target/linux/ath79/image/mikrotik.mk +++ b/target/linux/ath79/image/mikrotik.mk @@ -22,7 +22,8 @@ define Device/mikrotik_routerboard-921gs-5hpacd-15s $(Device/mikrotik_nand) SOC := qca9558 DEVICE_MODEL := RouterBOARD 921GS-5HPacD-15s (mANTBox 15s) - DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct + DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct kmod-i2c-gpio \ + kmod-sfp SUPPORTED_DEVICES += rb-921gs-5hpacd-r2 endef TARGET_DEVICES += mikrotik_routerboard-921gs-5hpacd-15s diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk index 52631789d9..b34e796ac3 100644 --- a/target/linux/ath79/image/nand.mk +++ b/target/linux/ath79/image/nand.mk @@ -1,13 +1,25 @@ +define Build/dw-headers + head -c 4 $@ >> $@.tmp && \ + head -c 8 /dev/zero >> $@.tmp && \ + tail -c +9 $@ >> $@.tmp && \ + ( \ + header_crc="$$(head -c 68 $@.tmp | gzip -c | \ + tail -c 8 | od -An -N4 -tx4 --endian little | tr -d ' \n')"; \ + printf "$$(echo $$header_crc | sed 's/../\\x&/g')" | \ + dd of=$@.tmp bs=4 count=1 seek=1 conv=notrunc \ + ) + mv $@.tmp $@ +endef + # attention: only zlib compression is allowed for the boot fs define Build/zyxel-buildkerneljffs - rm -rf $(KDIR_TMP)/zyxelnbg6716 - mkdir -p $(KDIR_TMP)/zyxelnbg6716/image/boot - cp $@ $(KDIR_TMP)/zyxelnbg6716/image/boot/vmlinux.lzma.uImage + mkdir -p $@.tmp/boot + cp $@ $@.tmp/boot/vmlinux.lzma.uImage $(STAGING_DIR_HOST)/bin/mkfs.jffs2 \ --big-endian --squash-uids -v -e 128KiB -q -f -n -x lzma -x rtime \ -o $@ \ - -d $(KDIR_TMP)/zyxelnbg6716/image - rm -rf $(KDIR_TMP)/zyxelnbg6716 + -d $@.tmp + rm -rf $@.tmp endef define Build/zyxel-factory @@ -77,6 +89,41 @@ define Device/domywifi_dw33d endef TARGET_DEVICES += domywifi_dw33d +define Device/dongwon_dw02-412h + SOC := qca9557 + DEVICE_VENDOR := Dongwon T&I + DEVICE_MODEL := DW02-412H + DEVICE_ALT0_VENDOR := KT + DEVICE_ALT0_MODEL := GiGA WiFi home + DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca988x-ct + KERNEL_SIZE := 8192k + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | dw-headers + KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma | dw-headers + UBINIZE_OPTS := -E 5 + IMAGES += factory.img + IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | \ + check-size + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef + +define Device/dongwon_dw02-412h-64m + $(Device/dongwon_dw02-412h) + DEVICE_VARIANT := (64M) + DEVICE_ALT0_VARIANT := (64M) + IMAGE_SIZE := 49152k +endef +TARGET_DEVICES += dongwon_dw02-412h-64m + +define Device/dongwon_dw02-412h-128m + $(Device/dongwon_dw02-412h) + DEVICE_VARIANT := (128M) + DEVICE_ALT0_VARIANT := (128M) + IMAGE_SIZE := 114688k +endef +TARGET_DEVICES += dongwon_dw02-412h-128m + define Device/glinet_gl-ar300m-common-nand SOC := qca9531 DEVICE_VENDOR := GL.iNet 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 d4a32c1e1a..4058742133 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 @@ -15,7 +15,6 @@ ath79_setup_interfaces() "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3" ;; mikrotik,routerboard-912uag-2hpnd|\ - mikrotik,routerboard-921gs-5hpacd-15s|\ mikrotik,routerboard-lhg-2nd|\ mikrotik,routerboard-sxt-5nd-r2|\ mikrotik,routerboard-wap-g-5hact2hnd|\ @@ -38,7 +37,6 @@ ath79_setup_macs() case "$board" in mikrotik,routerboard-912uag-2hpnd|\ - mikrotik,routerboard-921gs-5hpacd-15s|\ mikrotik,routerboard-lhg-2nd|\ mikrotik,routerboard-sxt-5nd-r2|\ mikrotik,routerboard-wap-g-5hact2hnd|\ @@ -46,6 +44,7 @@ ath79_setup_macs() label_mac="$mac_base" lan_mac="$mac_base" ;; + mikrotik,routerboard-921gs-5hpacd-15s|\ mikrotik,routerboard-922uags-5hpacd) label_mac="$mac_base" lan_mac="$mac_base" diff --git a/target/linux/ath79/nand/base-files/etc/board.d/01_leds b/target/linux/ath79/nand/base-files/etc/board.d/01_leds index fc74554763..f694d07e9c 100644 --- a/target/linux/ath79/nand/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/nand/base-files/etc/board.d/01_leds @@ -6,6 +6,10 @@ board_config_update board=$(board_name) case "$board" in +dongwon,dw02-412h-64m|\ +dongwon,dw02-412h-128m) + ucidef_set_led_switch "wan" "WAN" "green:wan" "switch0" "0x02" + ;; glinet,gl-ar300m-nand|\ glinet,gl-ar300m-nor) ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0" diff --git a/target/linux/ath79/nand/base-files/etc/board.d/02_network b/target/linux/ath79/nand/base-files/etc/board.d/02_network index 7402fc067a..dbb9e68150 100644 --- a/target/linux/ath79/nand/base-files/etc/board.d/02_network +++ b/target/linux/ath79/nand/base-files/etc/board.d/02_network @@ -15,6 +15,11 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:wan" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" ;; + dongwon,dw02-412h-64m|\ + dongwon,dw02-412h-128m) + ucidef_add_switch "switch0" \ + "0@eth0" "2:lan:4" "3:lan:3" "4:lan:2" "5:lan:1" "1:wan" + ;; glinet,gl-ar750s-nor|\ glinet,gl-ar750s-nor-nand) ucidef_add_switch "switch0" \ @@ -47,6 +52,11 @@ ath79_setup_macs() local board="$1" case "$board" in + dongwon,dw02-412h-64m|\ + dongwon,dw02-412h-128m) + wan_mac=$(mtd_get_mac_binary art 0x0) + label_mac=$wan_mac + ;; netgear,wndr3700-v4|\ netgear,wndr4300|\ netgear,wndr4300sw|\ diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index f8cc8f1a2b..71dfb161e4 100644 --- a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -13,6 +13,11 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(mtd_get_mac_binary art 0x12) ;; + dongwon,dw02-412h-64m|\ + dongwon,dw02-412h-128m) + caldata_extract "art" 0x5000 0x844 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) 4) + ;; glinet,gl-ar750s-nor|\ glinet,gl-ar750s-nor-nand) caldata_extract "art" 0x5000 0x844 diff --git a/target/linux/ath79/patches-5.10/425-at803x-allow-sgmii-aneg-override.patch b/target/linux/ath79/patches-5.10/425-at803x-allow-sgmii-aneg-override.patch index db3427683f..bf224b5f47 100644 --- a/target/linux/ath79/patches-5.10/425-at803x-allow-sgmii-aneg-override.patch +++ b/target/linux/ath79/patches-5.10/425-at803x-allow-sgmii-aneg-override.patch @@ -1,6 +1,6 @@ --- a/drivers/net/phy/at803x.c +++ b/drivers/net/phy/at803x.c -@@ -733,6 +733,13 @@ static int at803x_aneg_done(struct phy_d +@@ -830,6 +830,13 @@ static int at803x_aneg_done(struct phy_d if (!(phy_read(phydev, AT803X_PSSR) & AT803X_PSSR_MR_AN_COMPLETE)) { phydev_warn(phydev, "803x_aneg_done: SGMII link is not ok\n"); aneg_done = 0; diff --git a/target/linux/bcm27xx/patches-5.10/950-0145-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch b/target/linux/bcm27xx/patches-5.10/950-0145-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch deleted file mode 100644 index 0fcb3f672d..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0145-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch +++ /dev/null @@ -1,90 +0,0 @@ -From e47ad4978bde4920c1e1eb381531a6904025c852 Mon Sep 17 00:00:00 2001 -From: Jonathan Bell -Date: Thu, 11 Jul 2019 17:55:43 +0100 -Subject: [PATCH] xhci: add quirk for host controllers that don't - update endpoint DCS - -Seen on a VLI VL805 PCIe to USB controller. For non-stream endpoints -at least, if the xHC halts on a particular TRB due to an error then -the DCS field in the Out Endpoint Context maintained by the hardware -is not updated with the current cycle state. - -Using the quirk XHCI_EP_CTX_BROKEN_DCS and instead fetch the DCS bit -from the TRB that the xHC stopped on. - -See: https://github.com/raspberrypi/linux/issues/3060 - -Signed-off-by: Jonathan Bell ---- - drivers/usb/host/xhci-pci.c | 4 +++- - drivers/usb/host/xhci-ring.c | 26 +++++++++++++++++++++++++- - drivers/usb/host/xhci.h | 1 + - 3 files changed, 29 insertions(+), 2 deletions(-) - ---- a/drivers/usb/host/xhci-pci.c -+++ b/drivers/usb/host/xhci-pci.c -@@ -276,8 +276,10 @@ static void xhci_pci_quirks(struct devic - pdev->device == 0x3432) - xhci->quirks |= XHCI_BROKEN_STREAMS; - -- if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483) -+ if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483) { - xhci->quirks |= XHCI_LPM_SUPPORT; -+ xhci->quirks |= XHCI_EP_CTX_BROKEN_DCS; -+ } - - if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && - pdev->device == PCI_DEVICE_ID_ASMEDIA_1042_XHCI) ---- a/drivers/usb/host/xhci-ring.c -+++ b/drivers/usb/host/xhci-ring.c -@@ -562,7 +562,10 @@ void xhci_find_new_dequeue_state(struct - struct xhci_virt_ep *ep = &dev->eps[ep_index]; - struct xhci_ring *ep_ring; - struct xhci_segment *new_seg; -+ struct xhci_segment *halted_seg = NULL; - union xhci_trb *new_deq; -+ union xhci_trb *halted_trb; -+ int index = 0; - dma_addr_t addr; - u64 hw_dequeue; - bool cycle_found = false; -@@ -600,7 +603,28 @@ void xhci_find_new_dequeue_state(struct - hw_dequeue = xhci_get_hw_deq(xhci, dev, ep_index, stream_id); - new_seg = ep_ring->deq_seg; - new_deq = ep_ring->dequeue; -- state->new_cycle_state = hw_dequeue & 0x1; -+ -+ /* -+ * Quirk: xHC write-back of the DCS field in the hardware dequeue -+ * pointer is wrong - use the cycle state of the TRB pointed to by -+ * the dequeue pointer. -+ */ -+ if (xhci->quirks & XHCI_EP_CTX_BROKEN_DCS && -+ !(ep->ep_state & EP_HAS_STREAMS)) -+ halted_seg = trb_in_td(xhci, cur_td->start_seg, -+ cur_td->first_trb, cur_td->last_trb, -+ hw_dequeue & ~0xf, false); -+ if (halted_seg) { -+ index = ((dma_addr_t)(hw_dequeue & ~0xf) - halted_seg->dma) / -+ sizeof(*halted_trb); -+ halted_trb = &halted_seg->trbs[index]; -+ state->new_cycle_state = halted_trb->generic.field[3] & 0x1; -+ xhci_dbg(xhci, "Endpoint DCS = %d TRB index = %d cycle = %d\n", -+ (u8)(hw_dequeue & 0x1), index, -+ state->new_cycle_state); -+ } else { -+ state->new_cycle_state = hw_dequeue & 0x1; -+ } - state->stream_id = stream_id; - - /* ---- a/drivers/usb/host/xhci.h -+++ b/drivers/usb/host/xhci.h -@@ -1884,6 +1884,7 @@ struct xhci_hcd { - #define XHCI_DISABLE_SPARSE BIT_ULL(38) - #define XHCI_SG_TRB_CACHE_SIZE_QUIRK BIT_ULL(39) - #define XHCI_NO_SOFT_RETRY BIT_ULL(40) -+#define XHCI_EP_CTX_BROKEN_DCS BIT_ULL(41) - - unsigned int num_active_eps; - unsigned int limit_active_eps; diff --git a/target/linux/bcm27xx/patches-5.10/950-0355-xhci-quirks-add-link-TRB-quirk-for-VL805.patch b/target/linux/bcm27xx/patches-5.10/950-0355-xhci-quirks-add-link-TRB-quirk-for-VL805.patch index f63da53b8f..825b5969df 100644 --- a/target/linux/bcm27xx/patches-5.10/950-0355-xhci-quirks-add-link-TRB-quirk-for-VL805.patch +++ b/target/linux/bcm27xx/patches-5.10/950-0355-xhci-quirks-add-link-TRB-quirk-for-VL805.patch @@ -54,8 +54,8 @@ Signed-off-by: Jonathan Bell @@ -1885,6 +1885,7 @@ struct xhci_hcd { #define XHCI_SG_TRB_CACHE_SIZE_QUIRK BIT_ULL(39) #define XHCI_NO_SOFT_RETRY BIT_ULL(40) - #define XHCI_EP_CTX_BROKEN_DCS BIT_ULL(41) -+#define XHCI_AVOID_DQ_ON_LINK BIT_ULL(42) + #define XHCI_EP_CTX_BROKEN_DCS BIT_ULL(42) ++#define XHCI_AVOID_DQ_ON_LINK BIT_ULL(43) unsigned int num_active_eps; unsigned int limit_active_eps; diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile index 37ce04e6f0..11bec5885a 100644 --- a/target/linux/bcm53xx/image/Makefile +++ b/target/linux/bcm53xx/image/Makefile @@ -318,7 +318,7 @@ TARGET_DEVICES += luxul_xwr-3150 define Device/meraki_mr32 DEVICE_VENDOR := Meraki DEVICE_MODEL := MR32 - DEVICE_PACKAGES := $(B43) kmod-i2c-bcm-iproc kmod-i2c-gpio kmod-eeprom-at24 \ + DEVICE_PACKAGES := $(B43) kmod-i2c-bcm-iproc kmod-eeprom-at24 \ kmod-leds-pwm kmod-hwmon-ina2xx kmod-bluetooth DEVICE_DTS := bcm53016-meraki-mr32 # Meraki FW r23 tries to resize the part.safe partition before it will diff --git a/target/linux/bcm53xx/patches-5.10/040-v5.16-ARM-dts-BCM5301X-Fix-I2C-controller-interrupt.patch b/target/linux/bcm53xx/patches-5.10/040-v5.16-ARM-dts-BCM5301X-Fix-I2C-controller-interrupt.patch new file mode 100644 index 0000000000..628569eca9 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.10/040-v5.16-ARM-dts-BCM5301X-Fix-I2C-controller-interrupt.patch @@ -0,0 +1,32 @@ +From beda1bbdb19baa8319ed81fa370fe0c5b91d05df Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Tue, 26 Oct 2021 11:36:22 -0700 +Subject: [PATCH] ARM: dts: BCM5301X: Fix I2C controller interrupt + +The I2C interrupt controller line is off by 32 because the datasheet +describes interrupt inputs into the GIC which are for Shared Peripheral +Interrupts and are starting at offset 32. The ARM GIC binding expects +the SPI interrupts to be numbered from 0 relative to the SPI base. + +Fixes: bb097e3e0045 ("ARM: dts: BCM5301X: Add I2C support to the DT") +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm5301x.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/bcm5301x.dtsi b/arch/arm/boot/dts/bcm5301x.dtsi +index f92089290ccd..ec5de636796e 100644 +--- a/arch/arm/boot/dts/bcm5301x.dtsi ++++ b/arch/arm/boot/dts/bcm5301x.dtsi +@@ -408,7 +408,7 @@ uart2: serial@18008000 { + i2c0: i2c@18009000 { + compatible = "brcm,iproc-i2c"; + reg = <0x18009000 0x50>; +- interrupts = ; ++ interrupts = ; + #address-cells = <1>; + #size-cells = <0>; + clock-frequency = <100000>; +-- +2.25.1 + diff --git a/target/linux/bcm53xx/patches-5.10/081-v5.15-Revert-pinctrl-bcm-ns-support-updated-DT-binding-as-.patch b/target/linux/bcm53xx/patches-5.10/081-v5.15-Revert-pinctrl-bcm-ns-support-updated-DT-binding-as-.patch new file mode 100644 index 0000000000..822716d8e6 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.10/081-v5.15-Revert-pinctrl-bcm-ns-support-updated-DT-binding-as-.patch @@ -0,0 +1,106 @@ +From 6dba4bdfd7a30e77b848a45404b224588bf989e5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Fri, 8 Oct 2021 22:59:38 +0200 +Subject: [PATCH] Revert "pinctrl: bcm: ns: support updated DT binding as + syscon subnode" +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This reverts commit a49d784d5a8272d0f63c448fe8dc69e589db006e. + +The updated binding was wrong / invalid and has been reverted. There +isn't any upstream kernel DTS using it and Broadcom isn't known to use +it neither. There is close to zero chance this will cause regression for +anyone. + +Actually in-kernel bcm5301x.dtsi still uses the old good binding and so +it's broken since the driver update. This revert fixes it. + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20211008205938.29925-3-zajec5@gmail.com +Signed-off-by: Linus Walleij +--- + drivers/pinctrl/bcm/pinctrl-ns.c | 29 ++++++++++------------------- + 1 file changed, 10 insertions(+), 19 deletions(-) + +--- a/drivers/pinctrl/bcm/pinctrl-ns.c ++++ b/drivers/pinctrl/bcm/pinctrl-ns.c +@@ -5,7 +5,6 @@ + + #include + #include +-#include + #include + #include + #include +@@ -13,7 +12,6 @@ + #include + #include + #include +-#include + #include + + #define FLAG_BCM4708 BIT(1) +@@ -24,8 +22,7 @@ struct ns_pinctrl { + struct device *dev; + unsigned int chipset_flag; + struct pinctrl_dev *pctldev; +- struct regmap *regmap; +- u32 offset; ++ void __iomem *base; + + struct pinctrl_desc pctldesc; + struct ns_pinctrl_group *groups; +@@ -232,9 +229,9 @@ static int ns_pinctrl_set_mux(struct pin + unset |= BIT(pin_number); + } + +- regmap_read(ns_pinctrl->regmap, ns_pinctrl->offset, &tmp); ++ tmp = readl(ns_pinctrl->base); + tmp &= ~unset; +- regmap_write(ns_pinctrl->regmap, ns_pinctrl->offset, tmp); ++ writel(tmp, ns_pinctrl->base); + + return 0; + } +@@ -266,13 +263,13 @@ static const struct of_device_id ns_pinc + static int ns_pinctrl_probe(struct platform_device *pdev) + { + struct device *dev = &pdev->dev; +- struct device_node *np = dev->of_node; + const struct of_device_id *of_id; + struct ns_pinctrl *ns_pinctrl; + struct pinctrl_desc *pctldesc; + struct pinctrl_pin_desc *pin; + struct ns_pinctrl_group *group; + struct ns_pinctrl_function *function; ++ struct resource *res; + int i; + + ns_pinctrl = devm_kzalloc(dev, sizeof(*ns_pinctrl), GFP_KERNEL); +@@ -290,18 +287,12 @@ static int ns_pinctrl_probe(struct platf + return -EINVAL; + ns_pinctrl->chipset_flag = (uintptr_t)of_id->data; + +- ns_pinctrl->regmap = syscon_node_to_regmap(of_get_parent(np)); +- if (IS_ERR(ns_pinctrl->regmap)) { +- int err = PTR_ERR(ns_pinctrl->regmap); +- +- dev_err(dev, "Failed to map pinctrl regs: %d\n", err); +- +- return err; +- } +- +- if (of_property_read_u32(np, "offset", &ns_pinctrl->offset)) { +- dev_err(dev, "Failed to get register offset\n"); +- return -ENOENT; ++ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, ++ "cru_gpio_control"); ++ ns_pinctrl->base = devm_ioremap_resource(dev, res); ++ if (IS_ERR(ns_pinctrl->base)) { ++ dev_err(dev, "Failed to map pinctrl regs\n"); ++ return PTR_ERR(ns_pinctrl->base); + } + + memcpy(pctldesc, &ns_pinctrl_desc, sizeof(*pctldesc)); diff --git a/target/linux/bcm53xx/patches-5.10/180-usb-xhci-add-support-for-performing-fake-doorbell.patch b/target/linux/bcm53xx/patches-5.10/180-usb-xhci-add-support-for-performing-fake-doorbell.patch index 36fc3945c7..c497db727f 100644 --- a/target/linux/bcm53xx/patches-5.10/180-usb-xhci-add-support-for-performing-fake-doorbell.patch +++ b/target/linux/bcm53xx/patches-5.10/180-usb-xhci-add-support-for-performing-fake-doorbell.patch @@ -127,11 +127,11 @@ it on BCM4708 family. /* --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -1884,6 +1884,7 @@ struct xhci_hcd { - #define XHCI_DISABLE_SPARSE BIT_ULL(38) +@@ -1885,6 +1885,7 @@ struct xhci_hcd { #define XHCI_SG_TRB_CACHE_SIZE_QUIRK BIT_ULL(39) #define XHCI_NO_SOFT_RETRY BIT_ULL(40) -+#define XHCI_FAKE_DOORBELL BIT_ULL(41) + #define XHCI_EP_CTX_BROKEN_DCS BIT_ULL(42) ++#define XHCI_FAKE_DOORBELL BIT_ULL(44) unsigned int num_active_eps; unsigned int limit_active_eps; diff --git a/target/linux/bcm53xx/patches-5.10/302-ARM-dts-BCM5301X-Update-Northstar-pinctrl-binding.patch b/target/linux/bcm53xx/patches-5.10/302-ARM-dts-BCM5301X-Update-Northstar-pinctrl-binding.patch deleted file mode 100644 index ca94f46652..0000000000 --- a/target/linux/bcm53xx/patches-5.10/302-ARM-dts-BCM5301X-Update-Northstar-pinctrl-binding.patch +++ /dev/null @@ -1,33 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Subject: [PATCH] ARM: dts: BCM5301X: Update Northstar pinctrl binding -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Rafał Miłecki ---- - ---- a/arch/arm/boot/dts/bcm5301x.dtsi -+++ b/arch/arm/boot/dts/bcm5301x.dtsi -@@ -422,7 +422,7 @@ - #size-cells = <1>; - - cru@100 { -- compatible = "simple-bus"; -+ compatible = "syscon", "simple-mfd"; - reg = <0x100 0x1a4>; - ranges; - #address-cells = <1>; -@@ -448,10 +448,9 @@ - "sata1", "sata2"; - }; - -- pinctrl: pin-controller@1c0 { -+ pinctrl: pin-controller { - compatible = "brcm,bcm4708-pinmux"; -- reg = <0x1c0 0x24>; -- reg-names = "cru_gpio_control"; -+ offset = <0xc0>; - - spi-pins { - groups = "spi_grp"; diff --git a/target/linux/bcm53xx/patches-5.10/332-Meraki-MR32-use-hw-i2c.patch b/target/linux/bcm53xx/patches-5.10/332-Meraki-MR32-use-hw-i2c.patch new file mode 100644 index 0000000000..acd69edaab --- /dev/null +++ b/target/linux/bcm53xx/patches-5.10/332-Meraki-MR32-use-hw-i2c.patch @@ -0,0 +1,85 @@ +From: Christian Lamparter +Date: Sat, 12 Sep 2020 22:11:12 +0200 +Subject: bcm53xx: Meraki MR32 use hw i2c + +replace the i2c-gpio provided i2c functionality with the +hardware in the SoC. This can be activated once the +internal i2c works as well as the bit-banged i2c-gpio. + +Signed-off-by: Christian Lamparter + +--- a/arch/arm/boot/dts/bcm53016-meraki-mr32.dts ++++ b/arch/arm/boot/dts/bcm53016-meraki-mr32.dts +@@ -85,40 +85,6 @@ + max-brightness = <255>; + }; + }; +- +- i2c { +- /* +- * The platform provided I2C does not budge. +- * This is a replacement until I can figure +- * out what are the missing bits... +- */ +- +- compatible = "i2c-gpio"; +- sda-gpios = <&chipcommon 5 GPIO_ACTIVE_HIGH>; +- scl-gpios = <&chipcommon 4 GPIO_ACTIVE_HIGH>; +- i2c-gpio,delay-us = <10>; /* close to 100 kHz */ +- #address-cells = <1>; +- #size-cells = <0>; +- +- current_sense: ina219@45 { +- compatible = "ti,ina219"; +- reg = <0x45>; +- shunt-resistor = <60000>; /* = 60 mOhms */ +- }; +- +- eeprom: eeprom@50 { +- compatible = "atmel,24c64"; +- reg = <0x50>; +- pagesize = <32>; +- read-only; +- #address-cells = <1>; +- #size-cells = <1>; +- +- mac_address: mac-address@66 { +- reg = <0x66 0x6>; +- }; +- }; +- }; + }; + + &uart0 { +@@ -196,3 +168,31 @@ + }; + }; + }; ++ ++&i2c0 { ++ status = "okay"; ++ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinmux_i2c>; ++ ++ clock-frequency = <100000>; ++ ++ current_sense: ina219@45 { ++ compatible = "ti,ina219"; ++ reg = <0x45>; ++ shunt-resistor = <60000>; /* = 60 mOhms */ ++ }; ++ ++ eeprom: eeprom@50 { ++ compatible = "atmel,24c64"; ++ reg = <0x50>; ++ pagesize = <32>; ++ read-only; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ mac_address: mac-address@66 { ++ reg = <0x66 0x6>; ++ }; ++ }; ++}; diff --git a/target/linux/generic/backport-5.10/610-v5.13-14-net-bridge-resolve-forwarding-path-for-VLAN-tag-acti.patch b/target/linux/generic/backport-5.10/610-v5.13-14-net-bridge-resolve-forwarding-path-for-VLAN-tag-acti.patch index 2c1d935d9e..9abc6e6778 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-14-net-bridge-resolve-forwarding-path-for-VLAN-tag-acti.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-14-net-bridge-resolve-forwarding-path-for-VLAN-tag-acti.patch @@ -109,7 +109,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h -@@ -1095,6 +1095,13 @@ void br_vlan_notify(const struct net_bri +@@ -1093,6 +1093,13 @@ void br_vlan_notify(const struct net_bri bool br_vlan_can_enter_range(const struct net_bridge_vlan *v_curr, const struct net_bridge_vlan *range_end); @@ -123,7 +123,7 @@ Signed-off-by: Pablo Neira Ayuso static inline struct net_bridge_vlan_group *br_vlan_group( const struct net_bridge *br) { -@@ -1252,6 +1259,19 @@ static inline int nbp_get_num_vlan_infos +@@ -1250,6 +1257,19 @@ static inline int nbp_get_num_vlan_infos { return 0; } diff --git a/target/linux/generic/backport-5.10/610-v5.13-24-selftests-netfilter-flowtable-bridge-and-vlan-suppor.patch b/target/linux/generic/backport-5.10/610-v5.13-24-selftests-netfilter-flowtable-bridge-and-vlan-suppor.patch index 4924fda494..3f332c70d3 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-24-selftests-netfilter-flowtable-bridge-and-vlan-suppor.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-24-selftests-netfilter-flowtable-bridge-and-vlan-suppor.patch @@ -16,7 +16,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/tools/testing/selftests/netfilter/nft_flowtable.sh +++ b/tools/testing/selftests/netfilter/nft_flowtable.sh -@@ -371,6 +371,88 @@ else +@@ -370,6 +370,88 @@ else ip netns exec nsr1 nft list ruleset fi diff --git a/target/linux/generic/backport-5.10/781-v5.12-net-dsa-mt7530-MT7530-optional-GPIO-support.patch b/target/linux/generic/backport-5.10/781-v5.12-net-dsa-mt7530-MT7530-optional-GPIO-support.patch index 6931500c44..9e5047a16b 100644 --- a/target/linux/generic/backport-5.10/781-v5.12-net-dsa-mt7530-MT7530-optional-GPIO-support.patch +++ b/target/linux/generic/backport-5.10/781-v5.12-net-dsa-mt7530-MT7530-optional-GPIO-support.patch @@ -27,7 +27,7 @@ Signed-off-by: Jakub Kicinski #include #include "mt7530.h" -@@ -1540,6 +1541,109 @@ mtk_get_tag_protocol(struct dsa_switch * +@@ -1534,6 +1535,109 @@ mtk_get_tag_protocol(struct dsa_switch * } } @@ -137,7 +137,7 @@ Signed-off-by: Jakub Kicinski static int mt7530_setup(struct dsa_switch *ds) { -@@ -1681,6 +1785,12 @@ mt7530_setup(struct dsa_switch *ds) +@@ -1675,6 +1779,12 @@ mt7530_setup(struct dsa_switch *ds) } } diff --git a/target/linux/generic/backport-5.10/781-v5.13-net-dsa-mt7530-Add-support-for-EEE-features.patch b/target/linux/generic/backport-5.10/781-v5.13-net-dsa-mt7530-Add-support-for-EEE-features.patch index 4952abdb1e..38dd8a7296 100644 --- a/target/linux/generic/backport-5.10/781-v5.13-net-dsa-mt7530-Add-support-for-EEE-features.patch +++ b/target/linux/generic/backport-5.10/781-v5.13-net-dsa-mt7530-Add-support-for-EEE-features.patch @@ -17,7 +17,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -2377,6 +2377,17 @@ static void mt753x_phylink_mac_link_up(s +@@ -2371,6 +2371,17 @@ static void mt753x_phylink_mac_link_up(s mcr |= PMCR_RX_FC_EN; } @@ -35,7 +35,7 @@ Signed-off-by: David S. Miller mt7530_set(priv, MT7530_PMCR_P(port), mcr); } -@@ -2607,6 +2618,36 @@ mt753x_phy_write(struct dsa_switch *ds, +@@ -2601,6 +2612,36 @@ mt753x_phy_write(struct dsa_switch *ds, return priv->info->phy_write(ds, port, regnum, val); } @@ -72,7 +72,7 @@ Signed-off-by: David S. Miller static const struct dsa_switch_ops mt7530_switch_ops = { .get_tag_protocol = mtk_get_tag_protocol, .setup = mt753x_setup, -@@ -2635,6 +2676,8 @@ static const struct dsa_switch_ops mt753 +@@ -2629,6 +2670,8 @@ static const struct dsa_switch_ops mt753 .phylink_mac_an_restart = mt753x_phylink_mac_an_restart, .phylink_mac_link_down = mt753x_phylink_mac_link_down, .phylink_mac_link_up = mt753x_phylink_mac_link_up, diff --git a/target/linux/generic/backport-5.10/782-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch b/target/linux/generic/backport-5.10/782-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch index a2e31fab82..4d721c4f56 100644 --- a/target/linux/generic/backport-5.10/782-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch +++ b/target/linux/generic/backport-5.10/782-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch @@ -1398,7 +1398,7 @@ Signed-off-by: David S. Miller } phy_mode = device_get_phy_mode(&pdev->dev); -@@ -635,7 +635,7 @@ void stmmac_remove_config_dt(struct plat +@@ -643,7 +643,7 @@ void stmmac_remove_config_dt(struct plat } #else struct plat_stmmacenet_data * diff --git a/target/linux/generic/hack-5.10/220-arm-gc_sections.patch b/target/linux/generic/hack-5.10/220-arm-gc_sections.patch index 5c3ebcc810..d4f4efc505 100644 --- a/target/linux/generic/hack-5.10/220-arm-gc_sections.patch +++ b/target/linux/generic/hack-5.10/220-arm-gc_sections.patch @@ -12,7 +12,7 @@ Signed-off-by: Gabor Juhos --- --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -113,6 +113,7 @@ config ARM +@@ -114,6 +114,7 @@ config ARM select HAVE_UID16 select HAVE_VIRT_CPU_ACCOUNTING_GEN select IRQ_FORCED_THREADING diff --git a/target/linux/rockchip/patches-5.10/002-net-usb-r8152-add-LED-configuration-from-OF.patch b/target/linux/generic/hack-5.10/760-net-usb-r8152-add-LED-configuration-from-OF.patch similarity index 100% rename from target/linux/rockchip/patches-5.10/002-net-usb-r8152-add-LED-configuration-from-OF.patch rename to target/linux/generic/hack-5.10/760-net-usb-r8152-add-LED-configuration-from-OF.patch diff --git a/target/linux/rockchip/patches-5.10/003-dt-bindings-net-add-RTL8152-binding-documentation.patch b/target/linux/generic/hack-5.10/761-dt-bindings-net-add-RTL8152-binding-documentation.patch similarity index 100% rename from target/linux/rockchip/patches-5.10/003-dt-bindings-net-add-RTL8152-binding-documentation.patch rename to target/linux/generic/hack-5.10/761-dt-bindings-net-add-RTL8152-binding-documentation.patch diff --git a/target/linux/generic/hack-5.4/400-unlock_mx25l6406e_with_4bit_block_protect.patch b/target/linux/generic/hack-5.4/400-unlock_mx25l6406e_with_4bit_block_protect.patch index af0a14948c..8112fa7e13 100644 --- a/target/linux/generic/hack-5.4/400-unlock_mx25l6406e_with_4bit_block_protect.patch +++ b/target/linux/generic/hack-5.4/400-unlock_mx25l6406e_with_4bit_block_protect.patch @@ -30,7 +30,7 @@ ret = read_sr(nor); if (ret < 0) { dev_err(nor->dev, "error while reading status register\n"); -@@ -2337,7 +2344,7 @@ static const struct flash_info spi_nor_i +@@ -2338,7 +2345,7 @@ static const struct flash_info spi_nor_i { "mx25l1606e", INFO(0xc22015, 0, 64 * 1024, 32, SECT_4K) }, { "mx25l3205d", INFO(0xc22016, 0, 64 * 1024, 64, SECT_4K) }, { "mx25l3255e", INFO(0xc29e16, 0, 64 * 1024, 64, SECT_4K) }, @@ -39,7 +39,7 @@ { "mx25u2033e", INFO(0xc22532, 0, 64 * 1024, 4, SECT_4K) }, { "mx25u3235f", INFO(0xc22536, 0, 64 * 1024, 64, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, -@@ -5025,6 +5032,9 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -5026,6 +5033,9 @@ int spi_nor_scan(struct spi_nor *nor, co if (info->flags & USE_CLSR) nor->flags |= SNOR_F_USE_CLSR; diff --git a/target/linux/rockchip/patches-5.4/002-net-usb-r8152-add-LED-configuration-from-OF.patch b/target/linux/generic/hack-5.4/760-net-usb-r8152-add-LED-configuration-from-OF.patch similarity index 100% rename from target/linux/rockchip/patches-5.4/002-net-usb-r8152-add-LED-configuration-from-OF.patch rename to target/linux/generic/hack-5.4/760-net-usb-r8152-add-LED-configuration-from-OF.patch diff --git a/target/linux/rockchip/patches-5.4/003-dt-bindings-net-add-RTL8152-binding-documentation.patch b/target/linux/generic/hack-5.4/761-dt-bindings-net-add-RTL8152-binding-documentation.patch similarity index 100% rename from target/linux/rockchip/patches-5.4/003-dt-bindings-net-add-RTL8152-binding-documentation.patch rename to target/linux/generic/hack-5.4/761-dt-bindings-net-add-RTL8152-binding-documentation.patch diff --git a/target/linux/generic/pending-5.10/484-mtd-spi-nor-add-esmt-f25l16pa.patch b/target/linux/generic/pending-5.10/484-mtd-spi-nor-add-esmt-f25l16pa.patch new file mode 100644 index 0000000000..ce3857d511 --- /dev/null +++ b/target/linux/generic/pending-5.10/484-mtd-spi-nor-add-esmt-f25l16pa.patch @@ -0,0 +1,11 @@ +--- a/drivers/mtd/spi-nor/esmt.c ++++ b/drivers/mtd/spi-nor/esmt.c +@@ -10,6 +10,8 @@ + + static const struct flash_info esmt_parts[] = { + /* ESMT */ ++ { "f25l16pa-2s", INFO(0x8c2115, 0, 64 * 1024, 32, ++ SECT_4K | SPI_NOR_HAS_LOCK) }, + { "f25l32pa", INFO(0x8c2016, 0, 64 * 1024, 64, + SECT_4K | SPI_NOR_HAS_LOCK) }, + { "f25l32qa", INFO(0x8c4116, 0, 64 * 1024, 64, diff --git a/target/linux/generic/pending-5.10/764-net-bridge-switchdev-Send-FDB-notifications-for-host.patch b/target/linux/generic/pending-5.10/764-net-bridge-switchdev-Send-FDB-notifications-for-host.patch index 0e773888df..630e03bbfd 100644 --- a/target/linux/generic/pending-5.10/764-net-bridge-switchdev-Send-FDB-notifications-for-host.patch +++ b/target/linux/generic/pending-5.10/764-net-bridge-switchdev-Send-FDB-notifications-for-host.patch @@ -37,7 +37,7 @@ Signed-off-by: Tobias Waldekranz if (skb == NULL) --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h -@@ -1527,8 +1527,8 @@ bool nbp_switchdev_allowed_egress(const +@@ -1525,8 +1525,8 @@ bool nbp_switchdev_allowed_egress(const int br_switchdev_set_port_flag(struct net_bridge_port *p, unsigned long flags, unsigned long mask); @@ -48,7 +48,7 @@ Signed-off-by: Tobias Waldekranz int br_switchdev_port_vlan_add(struct net_device *dev, u16 vid, u16 flags, struct netlink_ext_ack *extack); int br_switchdev_port_vlan_del(struct net_device *dev, u16 vid); -@@ -1574,7 +1574,8 @@ static inline int br_switchdev_port_vlan +@@ -1572,7 +1572,8 @@ static inline int br_switchdev_port_vlan } static inline void diff --git a/target/linux/generic/pending-5.4/484-mtd-spi-nor-add-esmt-f25l16pa.patch b/target/linux/generic/pending-5.4/484-mtd-spi-nor-add-esmt-f25l16pa.patch new file mode 100644 index 0000000000..0a7d4f86d5 --- /dev/null +++ b/target/linux/generic/pending-5.4/484-mtd-spi-nor-add-esmt-f25l16pa.patch @@ -0,0 +1,10 @@ +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -2243,6 +2243,7 @@ static const struct flash_info spi_nor_i + { "en25s64", INFO(0x1c3817, 0, 64 * 1024, 128, SECT_4K) }, + + /* ESMT */ ++ { "f25l16pa-2s", INFO(0x8c2115, 0, 64 * 1024, 32, SECT_4K | SPI_NOR_HAS_LOCK) }, + { "f25l32pa", INFO(0x8c2016, 0, 64 * 1024, 64, SECT_4K | SPI_NOR_HAS_LOCK) }, + { "f25l32qa", INFO(0x8c4116, 0, 64 * 1024, 64, SECT_4K | SPI_NOR_HAS_LOCK) }, + { "f25l64qa", INFO(0x8c4117, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_HAS_LOCK) }, diff --git a/target/linux/ipq40xx/Makefile b/target/linux/ipq40xx/Makefile index a9f12d9230..0f41198e1b 100644 --- a/target/linux/ipq40xx/Makefile +++ b/target/linux/ipq40xx/Makefile @@ -19,6 +19,6 @@ DEFAULT_PACKAGES += \ kmod-leds-gpio kmod-gpio-button-hotplug swconfig \ kmod-ath10k-ct wpad-openssl uboot-envtools \ kmod-usb3 kmod-usb-dwc3 ath10k-firmware-qca4019-ct \ - autocore-arm e2fsprogs + ath10k-board-qca4019 autocore-arm e2fsprogs $(eval $(call BuildTarget)) 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 b7137122f1..bb7a759c6b 100644 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -108,6 +108,14 @@ ipq40xx_setup_interfaces() "0u@eth0" "3:lan:2" "4:lan:1" ucidef_set_interface_wan "eth1" ;; + netgear,rbr50|\ + netgear,rbs50|\ + netgear,srr60|\ + netgear,srs60) + ucidef_add_switch "switch0" \ + "0u@eth0" "2:lan" "3:lan" "4:lan" + ucidef_set_interface_wan "eth1" + ;; qxwlan,e2600ac-c1 |\ qxwlan,e2600ac-c2) ucidef_set_interfaces_lan_wan "eth0" "eth1" 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 9bff1c919d..8c96d682e5 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 @@ -46,6 +46,13 @@ case "$FIRMWARE" in # OEM assigns 4 sequential MACs ath10k_patch_mac $(macaddr_setbit_la $(macaddr_add "$(cat /sys/class/net/eth0/address)" 4)) ;; + netgear,rbr50|\ + netgear,rbs50|\ + netgear,srr60|\ + netgear,srs60) + caldata_extract_mmc "0:ART" 0x9000 0x2f20 + ath10k_patch_mac $(mmc_get_mac_binary ARTMTD 0x12) + ;; openmesh,a62) caldata_extract "0:ART" 0x9000 0x2f20 ;; @@ -155,6 +162,13 @@ case "$FIRMWARE" in caldata_extract "ART" 0x1000 0x2f20 ath10k_patch_mac $(mtd_get_mac_binary dnidata 0x0) ;; + netgear,rbr50|\ + netgear,rbs50|\ + netgear,srr60|\ + netgear,srs60) + caldata_extract_mmc "0:ART" 0x1000 0x2f20 + ath10k_patch_mac $(mmc_get_mac_binary ARTMTD 0x0) + ;; netgear,wac510) caldata_extract "0:ART" 0x1000 0x2f20 ath10k_patch_mac $(mtd_get_mac_binary "0:MANUDATA" 0x6) @@ -271,6 +285,13 @@ case "$FIRMWARE" in caldata_extract "ART" 0x5000 0x2f20 ath10k_patch_mac $(mtd_get_mac_binary dnidata 0xc) ;; + netgear,rbr50|\ + netgear,rbs50|\ + netgear,srr60|\ + netgear,srs60) + caldata_extract_mmc "0:ART" 0x5000 0x2f20 + ath10k_patch_mac $(mmc_get_mac_binary ARTMTD 0xc) + ;; netgear,wac510) caldata_extract "0:ART" 0x5000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary "0:MANUDATA" 0x6) 16) diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/netgear.sh b/target/linux/ipq40xx/base-files/lib/upgrade/netgear.sh new file mode 100644 index 0000000000..f3fb626d1f --- /dev/null +++ b/target/linux/ipq40xx/base-files/lib/upgrade/netgear.sh @@ -0,0 +1,76 @@ +# SPDX-License-Identifier: GPL-2.0-only +. /lib/functions.sh + +platform_do_upgrade_netgear_orbi_upgrade() { + command -v losetup >/dev/null || { + logger -s "Upgrade failed: 'losetup' not installed." + return 1 + } + + local tar_file=$1 + local kernel=$2 + local rootfs=$3 + + [ -z "$kernel" ] && kernel=$(find_mmc_part "kernel") + [ -z "$rootfs" ] && rootfs=$(find_mmc_part "rootfs") + + [ -z "$kernel" ] && echo "Upgrade failed: kernel partition not found! Rebooting..." && reboot -f + [ -z "$rootfs" ] && echo "Upgrade failed: rootfs partition not found! Rebooting..." && reboot -f + + netgear_orbi_do_flash $tar_file $kernel $rootfs + + echo "sysupgrade successful" + umount -a + reboot -f +} + +netgear_orbi_do_flash() { + local tar_file=$1 + local kernel=$2 + local rootfs=$3 + + # keep sure its unbound + losetup --detach-all || { + echo "Failed to detach all loop devices. Skip this try." + reboot -f + } + + # use the first found directory in the tar archive + local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$') + board_dir=${board_dir%/} + + echo "flashing kernel to $kernel" + tar xf $tar_file ${board_dir}/kernel -O >$kernel + + echo "flashing rootfs to ${rootfs}" + tar xf $tar_file ${board_dir}/root -O >"${rootfs}" + + # a padded rootfs is needed for overlay fs creation + local offset=$(tar xf $tar_file ${board_dir}/root -O | wc -c) + [ $offset -lt 65536 ] && { + echo "Wrong size for rootfs: $offset" + sleep 10 + reboot -f + } + + # Mount loop for rootfs_data + local loopdev="$(losetup -f)" + losetup -o $offset $loopdev $rootfs || { + echo "Failed to mount looped rootfs_data." + sleep 10 + reboot -f + } + + echo "Format new rootfs_data at position ${offset}." + mkfs.ext4 -F -L rootfs_data $loopdev + mkdir /tmp/new_root + mount -t ext4 $loopdev /tmp/new_root && { + echo "Saving config to rootfs_data at position ${offset}." + cp -v "$UPGRADE_BACKUP" "/tmp/new_root/$BACKUP_FILE" + umount /tmp/new_root + } + + # Cleanup + losetup -d $loopdev >/dev/null 2>&1 + sync +} diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh index 695d2af927..ee09c72040 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh @@ -119,6 +119,12 @@ platform_do_upgrade() { [ "$(rootfs_type)" = "tmpfs" ] && mtd erase firmware default_do_upgrade "$1" ;; + netgear,rbr50 |\ + netgear,rbs50 |\ + netgear,srr60 |\ + netgear,srs60) + platform_do_upgrade_netgear_orbi_upgrade "$1" + ;; openmesh,a42 |\ openmesh,a62 |\ plasmacloud,pa1200 |\ diff --git a/target/linux/ipq40xx/config-5.10 b/target/linux/ipq40xx/config-5.10 index 3a78123d52..16baa99f4d 100644 --- a/target/linux/ipq40xx/config-5.10 +++ b/target/linux/ipq40xx/config-5.10 @@ -54,6 +54,7 @@ CONFIG_BOUNCE=y CONFIG_CLKDEV_LOOKUP=y CONFIG_CLKSRC_QCOM=y CONFIG_CLONE_BACKWARDS=y +CONFIG_CMDLINE_PARTITION=y CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_QCOM=y CONFIG_COMPAT_32BIT_TIME=y @@ -224,6 +225,7 @@ CONFIG_IRQ_WORK=y CONFIG_LEDS_LP5523=y CONFIG_LEDS_LP5562=y CONFIG_LEDS_LP55XX_COMMON=y +CONFIG_LEDS_TLC591XX=y CONFIG_LIBFDT=y CONFIG_LLD_VERSION=0 CONFIG_LOCK_DEBUGGING_SUPPORT=y diff --git a/target/linux/ipq40xx/config-5.4 b/target/linux/ipq40xx/config-5.4 index 79c6d6c6c2..b4251a7748 100644 --- a/target/linux/ipq40xx/config-5.4 +++ b/target/linux/ipq40xx/config-5.4 @@ -52,6 +52,7 @@ CONFIG_BOUNCE=y CONFIG_CLKDEV_LOOKUP=y CONFIG_CLKSRC_QCOM=y CONFIG_CLONE_BACKWARDS=y +CONFIG_CMDLINE_PARTITION=y CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_QCOM=y CONFIG_COMPAT_32BIT_TIME=y @@ -222,6 +223,7 @@ CONFIG_IRQ_WORK=y CONFIG_LEDS_LP5523=y CONFIG_LEDS_LP5562=y CONFIG_LEDS_LP55XX_COMMON=y +CONFIG_LEDS_TLC591XX=y CONFIG_LIBFDT=y CONFIG_LOCK_DEBUGGING_SUPPORT=y CONFIG_LOCK_SPIN_ON_OWNER=y diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-orbi.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-orbi.dtsi new file mode 100644 index 0000000000..bdbee7f837 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-orbi.dtsi @@ -0,0 +1,325 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + aliases { + led-boot = &led_status_white; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_status_blue; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + counter@4a1000 { + compatible = "qcom,qca-gcnt"; + reg = <0x4a1000 0x4>; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + status = "okay"; + + 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 = ; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + + switch_lan_bmp = <0x1c>; + switch_wan_bmp = <0x02>; + }; + + edma@c080000 { + status = "okay"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&tlmm 49 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led-0 { + label = "green:power"; + gpios = <&tlmm 63 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + led-1 { + label = "red:power"; + gpios = <&tlmm 64 GPIO_ACTIVE_HIGH>; + panic-indicator; + }; + + led_status_green: led-2 { + label = "green:status"; + gpios = <&tlmm 53 GPIO_ACTIVE_HIGH>; + }; + + led_status_red: led-3 { + label = "red:status"; + gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; + }; + + led_status_blue: led-4 { + label = "blue:status"; + gpios = <&tlmm 57 GPIO_ACTIVE_HIGH>; + }; + + led_status_white: led-5 { + label = "white:status"; + gpios = <&tlmm 60 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&vqmmc { + status = "okay"; +}; + +&sdhci { + status = "okay"; + + pinctrl-0 = <&sd_pins>; + pinctrl-names = "default"; + cd-gpios = <&tlmm 22 GPIO_ACTIVE_LOW>; + vqmmc-supply = <&vqmmc>; +}; + +&qpic_bam { + 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; + }; + }; + + i2c_0_pins: i2c_0_pinmux { + pinmux { + function = "blsp_i2c0"; + pins = "gpio58", "gpio59"; + bias-disable; + }; + }; + + sd_pins: sd_pins { + pinmux { + function = "sdio"; + pins = "gpio23", "gpio24", "gpio25", "gpio26", + "gpio28", "gpio29", "gpio30", "gpio31"; + drive-strength = <10>; + }; + + pinmux_sd_clk { + function = "sdio"; + pins = "gpio27"; + drive-strength = <16>; + }; + + pinmux_sd7 { + function = "sdio"; + pins = "gpio32"; + drive-strength = <10>; + bias-disable; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_i2c3 { + pinctrl-0 = <&i2c_0_pins>; + pinctrl-names = "default"; + + status = "okay"; + + led-controller@27 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "ti,tlc59108"; /* really is tlc59208f */ + reg = <0x27>; + + led0@0 { + label = "rgb:led0"; + reg = <0x0>; + linux,default-trigger = "default-on"; + }; + + led1@1 { + label = "rgb:led1"; + reg = <0x1>; + linux,default-trigger = "default-on"; + }; + + led2@2 { + label = "rgb:led2"; + reg = <0x2>; + linux,default-trigger = "default-on"; + }; + + led3@3 { + label = "rgb:led3"; + reg = <0x3>; + linux,default-trigger = "default-on"; + }; + + led4@4 { + label = "rgb:led4"; + reg = <0x4>; + linux,default-trigger = "default-on"; + }; + + led5@5 { + label = "rgb:led5"; + reg = <0x5>; + linux,default-trigger = "default-on"; + }; + + led6@6 { + label = "rgb:led6"; + reg = <0x6>; + linux,default-trigger = "default-on"; + }; + + led7@7 { + label = "rgb:led7"; + reg = <0x7>; + linux,default-trigger = "default-on"; + }; + }; +}; + +&blsp1_uart1 { + status = "okay"; + + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; +}; + +&cryptobam { + status = "okay"; +}; + +&gmac0 { + vlan_tag = <1 0x1c>; +}; + +&gmac1 { + qcom,phy_mdio_addr = <0>; + vlan_tag = <2 0x02>; +}; + +&pcie0 { + status = "okay"; + + perst-gpio = <&tlmm 38 GPIO_ACTIVE_LOW>; + wake-gpio = <&tlmm 50 GPIO_ACTIVE_LOW>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "qcom,ath10k"; + status = "okay"; + reg = <0x00010000 0 0 0 0>; + ieee80211-freq-limit = <5470000 5875000>; + qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60"; + }; + }; +}; + +&wifi0 { + status = "okay"; + + qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60"; +}; + +&wifi1 { + status = "okay"; + + qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbr50.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbr50.dts new file mode 100644 index 0000000000..a803999804 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbr50.dts @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019-orbi.dtsi" + +/ { + model = "NETGEAR RBR50"; + compatible = "netgear,rbr50"; + + 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"; + }; + + soc { + usb2@60f8800 { + status = "okay"; + }; + + usb3@8af8800 { + status = "okay"; + }; + }; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&usb2_hs_phy { + status = "okay"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbs50.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbs50.dts new file mode 100644 index 0000000000..4d0a9132c6 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbs50.dts @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019-orbi.dtsi" + +/ { + model = "NETGEAR RBS50"; + compatible = "netgear,rbs50"; + + 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"; + }; + + soc { + usb2@60f8800 { + status = "okay"; + }; + + usb3@8af8800 { + status = "okay"; + }; + }; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&usb2_hs_phy { + status = "okay"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-srr60.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-srr60.dts new file mode 100644 index 0000000000..80bcb2e204 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-srr60.dts @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019-orbi.dtsi" + +/ { + model = "NETGEAR SRR60"; + compatible = "netgear,srr60"; + + chosen { + bootargs = "root=/dev/mmcblk0p20 blkdevparts=mmcblk0:512K@17K(0:SBL1)ro,512K(0:BOOTCONFIG)ro,512K(0:QSEE)ro,512K(0:QSEE_1)ro,256K(0:CDT)ro,256K(0:CDT_1)ro,512K(0:BOOTCONFIG1)ro,256K(0:APPSBLENV)ro,1M(0:APPSBL)ro,1M(0:APPSBL_1)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,64K(cert)ro,3840K(kernel-2)ro,31488K(rootfs-2)ro,35328K@44881K(firmware-2)ro,5M(device_table)ro,17M(cp_file)ro,102737K(reserved)ro,-(unallocated) rootfstype=squashfs,ext4 rootwait"; + }; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-srs60.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-srs60.dts new file mode 100644 index 0000000000..65bb7ac397 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-srs60.dts @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019-orbi.dtsi" + +/ { + model = "NETGEAR SRS60"; + compatible = "netgear,srs60"; + + chosen { + bootargs = "root=/dev/mmcblk0p20 blkdevparts=mmcblk0:512K@17K(0:SBL1)ro,512K(0:BOOTCONFIG)ro,512K(0:QSEE)ro,512K(0:QSEE_1)ro,256K(0:CDT)ro,256K(0:CDT_1)ro,512K(0:BOOTCONFIG1)ro,256K(0:APPSBLENV)ro,1M(0:APPSBL)ro,1M(0:APPSBL_1)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,64K(cert)ro,3840K(kernel-2)ro,31488K(rootfs-2)ro,35328K@44881K(firmware-2)ro,5M(device_table)ro,17M(cp_file)ro,102737K(reserved)ro,-(unallocated) rootfstype=squashfs,ext4 rootwait"; + }; +}; diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk index d8c66c8f7f..278a762270 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -646,6 +646,64 @@ define Device/netgear_ex6150v2 endef TARGET_DEVICES += netgear_ex6150v2 +define Device/netgear_orbi + $(call Device/DniImage) + SOC := qcom-ipq4019 + DEVICE_VENDOR := NETGEAR + IMAGE/factory.img := append-kernel | pad-offset 128k 64 | \ + append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | \ + append-rootfs | pad-rootfs | netgear-dni + IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to 64k | \ + sysupgrade-tar rootfs=$$$$@ | append-metadata + DEVICE_PACKAGES := ath10k-firmware-qca9984-ct e2fsprogs kmod-fs-ext4 losetup +endef + +define Device/netgear_rbx50 + $(call Device/netgear_orbi) + NETGEAR_HW_ID := 29765352+0+4000+512+2x2+2x2+4x4 + KERNEL_SIZE := 3932160 + ROOTFS_SIZE := 32243712 + IMAGE_SIZE := 36175872 +endef + +define Device/netgear_rbr50 + $(call Device/netgear_rbx50) + DEVICE_MODEL := RBR50 + DEVICE_VARIANT := v1 + NETGEAR_BOARD_ID := RBR50 +endef +TARGET_DEVICES += netgear_rbr50 + +define Device/netgear_rbs50 + $(call Device/netgear_rbx50) + DEVICE_MODEL := RBS50 + DEVICE_VARIANT := v1 + NETGEAR_BOARD_ID := RBS50 +endef +TARGET_DEVICES += netgear_rbs50 + +define Device/netgear_srx60 + $(call Device/netgear_orbi) + NETGEAR_HW_ID := 29765352+0+4096+512+2x2+2x2+4x4 + KERNEL_SIZE := 3932160 + ROOTFS_SIZE := 32243712 + IMAGE_SIZE := 36175872 +endef + +define Device/netgear_srr60 + $(call Device/netgear_srx60) + DEVICE_MODEL := SRR60 + NETGEAR_BOARD_ID := SRR60 +endef +TARGET_DEVICES += netgear_srr60 + +define Device/netgear_srs60 + $(call Device/netgear_srx60) + DEVICE_MODEL := SRS60 + NETGEAR_BOARD_ID := SRS60 +endef +TARGET_DEVICES += netgear_srs60 + define Device/netgear_wac510 $(call Device/FitImage) $(call Device/UbiFit) diff --git a/target/linux/ipq40xx/patches-5.10/105-ipq40xx-fix-sleep-clock.patch b/target/linux/ipq40xx/patches-5.10/105-ipq40xx-fix-sleep-clock.patch new file mode 100644 index 0000000000..97a36872e9 --- /dev/null +++ b/target/linux/ipq40xx/patches-5.10/105-ipq40xx-fix-sleep-clock.patch @@ -0,0 +1,29 @@ +From 4d44bb1031a68d7d5b604d3b340c059f41ca62af Mon Sep 17 00:00:00 2001 +From: dissent1 +Date: Mon, 6 May 2019 20:55:16 +0300 +Subject: [PATCH] ipq40xx: fix sleep clock + +It seems like sleep_clk was copied from ipq806x. +Fix ipq40xx sleep_clk to the value QSDK defines. + +Also rename the sleep clock node like the GCC driver names it. + +Signed-off-by: Pavel Kubelun +--- + arch/arm/boot/dts/qcom-ipq4019.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/qcom-ipq4019.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi +@@ -141,9 +141,9 @@ + }; + + clocks { +- sleep_clk: sleep_clk { ++ sleep_clk: gcc_sleep_clk_src { + compatible = "fixed-clock"; +- clock-frequency = <32768>; ++ clock-frequency = <32000>; + #clock-cells = <0>; + }; + diff --git a/target/linux/ipq40xx/patches-5.10/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-5.10/901-arm-boot-add-dts-files.patch index 4a8c7ede0a..6d3d2b04ed 100644 --- a/target/linux/ipq40xx/patches-5.10/901-arm-boot-add-dts-files.patch +++ b/target/linux/ipq40xx/patches-5.10/901-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -902,11 +902,63 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -902,11 +902,67 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -47,20 +47,24 @@ Signed-off-by: John Crispin qcom-ipq4019-ap.dk07.1-c2.dtb \ + qcom-ipq4019-a62.dtb \ + qcom-ipq4019-cm520-79f.dtb \ ++ qcom-ipq4019-e2600ac-c1.dtb \ ++ qcom-ipq4019-e2600ac-c2.dtb \ + qcom-ipq4019-ea8300.dtb \ + qcom-ipq4019-eap2200.dtb \ + qcom-ipq4019-fritzbox-7530.dtb \ + qcom-ipq4019-fritzrepeater-1200.dtb \ + qcom-ipq4019-fritzrepeater-3000.dtb \ ++ qcom-ipq4019-habanero-dvk.dtb \ + qcom-ipq4019-map-ac2200.dtb \ + qcom-ipq4019-mr8300.dtb \ -+ qcom-ipq4019-e2600ac-c1.dtb \ -+ qcom-ipq4019-e2600ac-c2.dtb \ ++ qcom-ipq4019-pa2200.dtb \ + qcom-ipq4019-r619ac.dtb \ + qcom-ipq4019-r619ac-128m.dtb \ -+ qcom-ipq4019-habanero-dvk.dtb \ -+ qcom-ipq4019-pa2200.dtb \ ++ qcom-ipq4019-rbr50.dtb \ ++ qcom-ipq4019-rbs50.dtb \ + qcom-ipq4019-rtl30vw.dtb \ ++ qcom-ipq4019-srr60.dtb \ ++ qcom-ipq4019-srs60.dtb \ + qcom-ipq4019-u4019-32m.dtb \ + qcom-ipq4019-wpj419.dtb \ + qcom-ipq4019-wtr-m2133hp.dtb \ diff --git a/target/linux/ipq40xx/patches-5.4/105-ipq40xx-fix-sleep-clock.patch b/target/linux/ipq40xx/patches-5.4/105-ipq40xx-fix-sleep-clock.patch new file mode 100644 index 0000000000..97a36872e9 --- /dev/null +++ b/target/linux/ipq40xx/patches-5.4/105-ipq40xx-fix-sleep-clock.patch @@ -0,0 +1,29 @@ +From 4d44bb1031a68d7d5b604d3b340c059f41ca62af Mon Sep 17 00:00:00 2001 +From: dissent1 +Date: Mon, 6 May 2019 20:55:16 +0300 +Subject: [PATCH] ipq40xx: fix sleep clock + +It seems like sleep_clk was copied from ipq806x. +Fix ipq40xx sleep_clk to the value QSDK defines. + +Also rename the sleep clock node like the GCC driver names it. + +Signed-off-by: Pavel Kubelun +--- + arch/arm/boot/dts/qcom-ipq4019.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/qcom-ipq4019.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi +@@ -141,9 +141,9 @@ + }; + + clocks { +- sleep_clk: sleep_clk { ++ sleep_clk: gcc_sleep_clk_src { + compatible = "fixed-clock"; +- clock-frequency = <32768>; ++ clock-frequency = <32000>; + #clock-cells = <0>; + }; + diff --git a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch index f6fae8206e..848f07be74 100644 --- a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch +++ b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -837,11 +837,63 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -837,11 +837,67 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -60,7 +60,11 @@ Signed-off-by: John Crispin + qcom-ipq4019-r619ac-128m.dtb \ + qcom-ipq4019-habanero-dvk.dtb \ + qcom-ipq4019-pa2200.dtb \ ++ qcom-ipq4019-rbr50.dtb \ ++ qcom-ipq4019-rbs50.dtb \ + qcom-ipq4019-rtl30vw.dtb \ ++ qcom-ipq4019-srr60.dtb \ ++ qcom-ipq4019-srs60.dtb \ + qcom-ipq4019-u4019-32m.dtb \ + qcom-ipq4019-wpj419.dtb \ + qcom-ipq4019-wtr-m2133hp.dtb \ diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network index bb77332ef9..65a0e98b3b 100644 --- a/target/linux/ipq806x/base-files/etc/board.d/02_network +++ b/target/linux/ipq806x/base-files/etc/board.d/02_network @@ -29,14 +29,6 @@ tplink,vr2600v) ;; edgecore,ecw5410) ucidef_set_interfaces_lan_wan "eth1" "eth0" - if [ -b "$(find_mtd_part 0:art)" ]; then - ucidef_set_interface_macaddr "lan" "$(mtd_get_mac_binary "0:art" 0x6)" - ucidef_set_interface_macaddr "wan" "$(mtd_get_mac_binary "0:art" 0x0)" - else - # XXX: drop upper case after kernel v5.4 is gone (qcom-smem) - ucidef_set_interface_macaddr "lan" "$(mtd_get_mac_binary "0:ART" 0x6)" - ucidef_set_interface_macaddr "wan" "$(mtd_get_mac_binary "0:ART" 0x0)" - fi ;; linksys,ea7500-v1) hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr) @@ -81,9 +73,6 @@ ubnt,unifi-ac-hd) ;; zyxel,nbg6817) hw_mac_addr=$(mtd_get_mac_ascii 0:appsblenv ethaddr) - # XXX: drop upper case after kernel v5.4 is gone (qcom-smem) - [ -n "$hw_mac_addr" ] || \ - hw_mac_addr=$(mtd_get_mac_ascii 0:APPSBLENV ethaddr) ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0" ucidef_set_interface_macaddr "lan" "$(macaddr_add $hw_mac_addr 2)" diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index a1cbe0a8f6..8de4e052cc 100644 --- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -13,63 +13,32 @@ case "$FIRMWARE" in caldata_extract "0:ART" 0x1000 0x2f20 ;; asrock,g10) - if [ -b "$(find_mtd_part 0:art)" ]; then - caldata_extract "0:art" 0x1000 0x2f20 - else - # XXX: drop upper case after kernel v5.4 is gone (qcom-smem) - caldata_extract "0:ART" 0x1000 0x2f20 - fi + caldata_extract "0:art" 0x1000 0x2f20 ;; - buffalo,wxr-2533dhp) + buffalo,wxr-2533dhp |\ + nec,wg2600hp |\ + nec,wg2600hp3 |\ + tplink,vr2600v) caldata_extract "ART" 0x1000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary ART 0x1e) - ;; - edgecore,ecw5410) - if [ -b "$(find_mtd_part 0:art)" ]; then - caldata_extract "0:art" 0x1000 0x2f20 - else - # XXX: drop upper case after kernel v5.4 is gone (qcom-smem) - caldata_extract "0:ART" 0x1000 0x2f20 - fi ;; linksys,ea7500-v1 |\ linksys,ea8500) caldata_extract "art" 0x1000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) 1) ;; - nec,wg2600hp |\ - nec,wg2600hp3) - caldata_extract "ART" 0x1000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary PRODUCTDATA 0x12) - ;; netgear,d7800 |\ netgear,r7500v2 |\ - netgear,r7800) - caldata_extract "art" 0x1000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x6) 1) - ;; + netgear,r7800 |\ netgear,xr500) caldata_extract "art" 0x1000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary art 0xc) ;; tplink,ad7200 |\ tplink,c2600) caldata_extract "radio" 0x1000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary default-mac 0x8) -1) - ;; - tplink,vr2600v) - caldata_extract "ART" 0x1000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary default-mac 0x0) -1) ;; zyxel,nbg6817) - if [ -b "$(find_mtd_part 0:art)" ]; then - caldata_extract "0:art" 0x1000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:appsblenv ethaddr) 1) - else - # XXX: drop upper case after kernel v5.4 is gone (qcom-smem) - caldata_extract "0:ART" 0x1000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV ethaddr) 1) - fi + caldata_extract "0:art" 0x1000 0x2f20 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:appsblenv ethaddr) 1) ;; esac ;; @@ -79,67 +48,42 @@ case "$FIRMWARE" in caldata_extract "0:ART" 0x5000 0x2f20 ;; asrock,g10) - if [ -b "$(find_mtd_part 0:art)" ]; then - caldata_extract "0:art" 0x5000 0x2f20 - else - # XXX: drop upper case after kernel v5.4 is gone (qcom-smem) - caldata_extract "0:ART" 0x5000 0x2f20 - fi + caldata_extract "0:art" 0x5000 0x2f20 ;; - buffalo,wxr-2533dhp) + buffalo,wxr-2533dhp |\ + nec,wg2600hp |\ + nec,wg2600hp3 |\ + tplink,vr2600v) caldata_extract "ART" 0x5000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary ART 0x18) + ;; + edgecore,ecw5410) + caldata_extract "0:art" 0x1000 0x2f20 ;; linksys,ea7500-v1 |\ linksys,ea8500) caldata_extract "art" 0x5000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) 2) ;; - nec,wg2600hp |\ - nec,wg2600hp3) - caldata_extract "ART" 0x5000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary PRODUCTDATA 0xc) - ;; netgear,d7800 |\ netgear,r7500v2 |\ - netgear,r7800) - caldata_extract "art" 0x5000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x6) 2) - ;; + netgear,r7800 |\ netgear,xr500) caldata_extract "art" 0x5000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary art 0x0) ;; tplink,ad7200 |\ tplink,c2600) caldata_extract "radio" 0x5000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary default-mac 0x8) - ;; - tplink,vr2600v) - caldata_extract "ART" 0x5000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary default-mac 0x0) ;; zyxel,nbg6817) - if [ -b "$(find_mtd_part 0:art)" ]; then - caldata_extract "0:art" 0x5000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_ascii 0:appsblenv ethaddr) - else - # XXX: drop upper case after kernel v5.4 is gone (qcom-smem) - caldata_extract "0:ART" 0x5000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_ascii 0:APPSBLENV ethaddr) - fi + caldata_extract "0:art" 0x5000 0x2f20 + ath10k_patch_mac $(mtd_get_mac_ascii 0:appsblenv ethaddr) ;; esac ;; "ath10k/pre-cal-pci-0002:01:00.0.bin") case $board in edgecore,ecw5410) - if [ -b "$(find_mtd_part 0:art)" ]; then - caldata_extract "0:art" 0x5000 0x2f20 - else - # XXX: drop upper case after kernel v5.4 is gone (qcom-smem) - caldata_extract "0:ART" 0x5000 0x2f20 - fi + caldata_extract "0:art" 0x5000 0x2f20 ;; esac ;; diff --git a/target/linux/ipq806x/base-files/lib/upgrade/asrock.sh b/target/linux/ipq806x/base-files/lib/upgrade/asrock.sh index 8be737d2da..9645b64671 100644 --- a/target/linux/ipq806x/base-files/lib/upgrade/asrock.sh +++ b/target/linux/ipq806x/base-files/lib/upgrade/asrock.sh @@ -2,8 +2,6 @@ asrock_bootconfig_mangle() { local mtdnum="$(find_mtd_index 0:bootconfig)" - # XXX: drop upper case after kernel v5.4 is gone (qcom-smem) - [ -n "$mtdnum" ] || mtdnum="$(find_mtd_index 0:BOOTCONFIG)" if [ -z "$mtdnum" ]; then echo "cannot find bootconfig mtd partition" diff --git a/target/linux/ipq806x/base-files/lib/upgrade/zyxel.sh b/target/linux/ipq806x/base-files/lib/upgrade/zyxel.sh index 50f8a3ceaf..f5501822f3 100644 --- a/target/linux/ipq806x/base-files/lib/upgrade/zyxel.sh +++ b/target/linux/ipq806x/base-files/lib/upgrade/zyxel.sh @@ -91,9 +91,6 @@ zyxel_do_upgrade() { case "$board" in zyxel,nbg6817) local dualflagmtd="$(find_mtd_part 0:dual_flag)" - # XXX: drop upper case after kernel v5.4 is gone (qcom-smem) - [ -b $dualflagmtd ] || \ - dualflagmtd="$(find_mtd_part 0:DUAL_FLAG)" [ -b $dualflagmtd ] || return 1 case "$rootfs" in diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts index c6feb71a8e..8f1bb74540 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts @@ -359,6 +359,9 @@ reg = <0x00010000 0 0 0 0>; qcom,ath10k-calibration-variant = "NEC-Platforms-WG2600HP3"; + + nvmem-cells = <&macaddr_PRODUCTDATA_12>; + nvmem-cell-names = "mac-address"; }; }; }; @@ -379,6 +382,9 @@ ieee80211-freq-limit = <2400000 2483000>; qcom,ath10k-calibration-variant = "NEC-Platforms-WG2600HP3"; + + nvmem-cells = <&macaddr_PRODUCTDATA_c>; + nvmem-cell-names = "mac-address"; }; }; }; @@ -451,4 +457,12 @@ macaddr_factory_6: macaddr@6 { reg = <0x6 0x6>; }; + + macaddr_PRODUCTDATA_c: macaddr@c { + reg = <0xc 0x6>; + }; + + macaddr_PRODUCTDATA_12: macaddr@12 { + reg = <0x12 0x6>; + }; }; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi index cd6c0ea77d..5842c34c16 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi @@ -255,11 +255,42 @@ &pcie0 { status = "okay"; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_defaultmac_8>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; + }; + }; }; &pcie1 { status = "okay"; max-link-speed = <1>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_defaultmac_8>; + nvmem-cell-names = "mac-address"; + }; + }; }; &mdio0 { diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts index 6e022cece0..940e01439d 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts @@ -175,6 +175,22 @@ reset-gpio = <&qcom_pinmux 3 GPIO_ACTIVE_HIGH>; pinctrl-0 = <&pcie0_pins>; pinctrl-names = "default"; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(1)>; + }; + }; }; &pcie1 { @@ -183,6 +199,22 @@ pinctrl-0 = <&pcie1_pins>; pinctrl-names = "default"; max-link-speed = <1>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(2)>; + }; + }; }; &nand_controller { diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500v2.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500v2.dts index 0f22480434..f2bd1705b5 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500v2.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500v2.dts @@ -186,6 +186,22 @@ reset-gpio = <&qcom_pinmux 3 GPIO_ACTIVE_LOW>; pinctrl-0 = <&pcie0_pins>; pinctrl-names = "default"; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(1)>; + }; + }; }; &pcie1 { @@ -194,6 +210,22 @@ pinctrl-0 = <&pcie1_pins>; pinctrl-names = "default"; max-link-speed = <1>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(2)>; + }; + }; }; &nand_controller { diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-vr2600v.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-vr2600v.dts index 54ae07590a..863c5d7b1c 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-vr2600v.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-vr2600v.dts @@ -284,11 +284,42 @@ &pcie0 { status = "okay"; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_defaultmac_0>; + nvmem-cell-names = "mac-address"; + mtd-mac-address-increment = <(-1)>; + }; + }; }; &pcie1 { status = "okay"; max-link-speed = <1>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_defaultmac_0>; + nvmem-cell-names = "mac-address"; + }; + }; }; &mdio0 { diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wg2600hp.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wg2600hp.dts index 7148fdf143..45da4a2b11 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wg2600hp.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wg2600hp.dts @@ -320,11 +320,41 @@ &pcie0 { status = "okay"; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_PRODUCTDATA_12>; + nvmem-cell-names = "mac-address"; + }; + }; }; &pcie1 { status = "okay"; max-link-speed = <1>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_PRODUCTDATA_c>; + nvmem-cell-names = "mac-address"; + }; + }; }; &qcom_pinmux { @@ -395,4 +425,12 @@ macaddr_PRODUCTDATA_6: macaddr@6 { reg = <0x6 0x6>; }; + + macaddr_PRODUCTDATA_c: macaddr@c { + reg = <0xc 0x6>; + }; + + macaddr_PRODUCTDATA_12: macaddr@12 { + reg = <0x12 0x6>; + }; }; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wxr-2533dhp.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wxr-2533dhp.dts index 1cf5e3452f..4b4e8736d4 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wxr-2533dhp.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wxr-2533dhp.dts @@ -395,11 +395,41 @@ &pcie0 { status = "okay"; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_ART_1e>; + nvmem-cell-names = "mac-address"; + }; + }; }; &pcie1 { status = "okay"; max-link-speed = <1>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_ART_18>; + nvmem-cell-names = "mac-address"; + }; + }; }; &qcom_pinmux { @@ -479,4 +509,12 @@ macaddr_ART_6: macaddr@6 { reg = <0x6 0x6>; }; + + macaddr_ART_18: macaddr@18 { + reg = <0x18 0x6>; + }; + + macaddr_ART_1e: macaddr@1e { + reg = <0x1e 0x6>; + }; }; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-ecw5410.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-ecw5410.dts index 43bed451cb..377bb09616 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-ecw5410.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-ecw5410.dts @@ -34,9 +34,8 @@ aliases { serial1 = &gsbi1_serial; - mdio-gpio0 = &mdio0; - ethernet0 = &gmac3; - ethernet1 = &gmac2; + ethernet0 = &gmac2; + ethernet1 = &gmac3; led-boot = &led_power_green; led-failsafe = &led_power_red; @@ -293,26 +292,18 @@ }; }; -&soc { - mdio1: mdio { - compatible = "virtual,mdio-gpio"; - #address-cells = <1>; - #size-cells = <0>; +&mdio0 { + status = "okay"; - status = "okay"; + pinctrl-0 = <&mdio0_pins>; + pinctrl-names = "default"; - pinctrl-0 = <&mdio0_pins>; - pinctrl-names = "default"; + phy0: ethernet-phy@0 { + reg = <0>; + }; - gpios = <&qcom_pinmux 1 GPIO_ACTIVE_HIGH &qcom_pinmux 0 GPIO_ACTIVE_HIGH>; - - phy0: ethernet-phy@0 { - reg = <0>; - }; - - phy1: ethernet-phy@1 { - reg = <1>; - }; + phy1: ethernet-phy@1 { + reg = <1>; }; }; @@ -330,7 +321,7 @@ status = "okay"; qcom,id = <3>; - mdiobus = <&mdio1>; + mdiobus = <&mdio0>; phy-mode = "sgmii"; phy-handle = <&phy0>; diff --git a/target/linux/ipq806x/patches-5.10/0060-HACK-arch-arm-force-ZRELADDR-on-arch-qcom.patch b/target/linux/ipq806x/patches-5.10/0060-HACK-arch-arm-force-ZRELADDR-on-arch-qcom.patch index b56480deaa..b73218e71b 100644 --- a/target/linux/ipq806x/patches-5.10/0060-HACK-arch-arm-force-ZRELADDR-on-arch-qcom.patch +++ b/target/linux/ipq806x/patches-5.10/0060-HACK-arch-arm-force-ZRELADDR-on-arch-qcom.patch @@ -33,7 +33,7 @@ Signed-off-by: Mathieu Olivari --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -321,7 +321,7 @@ config ARCH_MULTIPLATFORM +@@ -322,7 +322,7 @@ config ARCH_MULTIPLATFORM select ARCH_SELECT_MEMORY_MODEL select ARM_HAS_SG_CHAIN select ARM_PATCH_PHYS_VIRT diff --git a/target/linux/ipq806x/patches-5.10/0067-generic-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/ipq806x/patches-5.10/0067-generic-Mangle-bootloader-s-kernel-arguments.patch index c38e0a4669..25c58bee49 100644 --- a/target/linux/ipq806x/patches-5.10/0067-generic-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/ipq806x/patches-5.10/0067-generic-Mangle-bootloader-s-kernel-arguments.patch @@ -22,7 +22,7 @@ Signed-off-by: Adrian Panella --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -1780,6 +1780,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN +@@ -1781,6 +1781,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN The command-line arguments provided by the boot loader will be appended to the the device tree bootargs property. diff --git a/target/linux/ipq806x/patches-5.10/900-arm-add-cmdline-override.patch b/target/linux/ipq806x/patches-5.10/900-arm-add-cmdline-override.patch index 2459e6a2f0..830a14924c 100644 --- a/target/linux/ipq806x/patches-5.10/900-arm-add-cmdline-override.patch +++ b/target/linux/ipq806x/patches-5.10/900-arm-add-cmdline-override.patch @@ -1,6 +1,6 @@ --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -1793,6 +1793,14 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_MANGL +@@ -1794,6 +1794,14 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_MANGL endchoice diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_bt_homehub-v5a.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_bt_homehub-v5a.dts index 76cf69335b..1cd0f2c6b6 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_bt_homehub-v5a.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_bt_homehub-v5a.dts @@ -256,7 +256,7 @@ compatible = "pci168c,002d"; reg = <0x7000 0 0 0 0>; qca,no-eeprom; /* load from ath9k-eeprom-pci-0000:00:0e.0.bin */ - qca,disable-5ghz; + ieee80211-freq-limit = <2402000 2482000>; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi index bdf98fe98e..5b7c10bb9d 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi @@ -203,7 +203,7 @@ #gpio-cells = <2>; gpio-controller; qca,no-eeprom; - qca,disable-5ghz; + ieee80211-freq-limit = <2402000 2482000>; nvmem-cells = <&macaddr_ath9k_cal_f100>; nvmem-cell-names = "mac-address"; mac-address-increment = <2>; 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 0cdd8df8f9..513741d667 100755 --- a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh @@ -12,6 +12,7 @@ platform_do_upgrade() { export_partdevice rootdev 0 case "$rootdev" in mmc*) + blockdev --rereadpt /dev/$rootdev || return 1 local fitpart=$(get_partition_by_name $rootdev "production") [ "$fitpart" ] || return 1 dd if=/dev/zero of=/dev/$fitpart bs=4096 count=1 2>/dev/null diff --git a/target/linux/mediatek/mt7623/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/mt7623/base-files/lib/upgrade/platform.sh index 4564bc61dd..11da6314dc 100755 --- a/target/linux/mediatek/mt7623/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/mt7623/base-files/lib/upgrade/platform.sh @@ -86,6 +86,7 @@ platform_do_upgrade() { bananapi,bpi-r2) export_bootdevice export_partdevice rootdev 0 + blockdev --rereadpt /dev/$rootdev || return 1 export_partdevice fitpart 3 [ "$fitpart" ] || return 1 dd if=/dev/zero of=/dev/$fitpart bs=4096 count=1 2>/dev/null diff --git a/target/linux/mediatek/patches-5.10/500-gsw-rtl8367s-mt7622-support.patch b/target/linux/mediatek/patches-5.10/500-gsw-rtl8367s-mt7622-support.patch index bdd482def3..4ff9fb6bc9 100644 --- a/target/linux/mediatek/patches-5.10/500-gsw-rtl8367s-mt7622-support.patch +++ b/target/linux/mediatek/patches-5.10/500-gsw-rtl8367s-mt7622-support.patch @@ -1,6 +1,6 @@ --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -334,6 +334,12 @@ config ROCKCHIP_PHY +@@ -335,6 +335,12 @@ config ROCKCHIP_PHY help Currently supports the integrated Ethernet PHY. diff --git a/target/linux/mvebu/patches-5.10/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/mvebu/patches-5.10/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch index f2a0478693..15128828e9 100644 --- a/target/linux/mvebu/patches-5.10/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/mvebu/patches-5.10/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch @@ -28,7 +28,7 @@ Signed-off-by: Michael Gray --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -1780,6 +1780,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN +@@ -1781,6 +1781,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN The command-line arguments provided by the boot loader will be appended to the the device tree bootargs property. diff --git a/target/linux/oxnas/patches-5.10/996-generic-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/oxnas/patches-5.10/996-generic-Mangle-bootloader-s-kernel-arguments.patch index 07abd0c648..4b89260660 100644 --- a/target/linux/oxnas/patches-5.10/996-generic-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/oxnas/patches-5.10/996-generic-Mangle-bootloader-s-kernel-arguments.patch @@ -22,7 +22,7 @@ Signed-off-by: Adrian Panella --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -1780,6 +1780,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN +@@ -1781,6 +1781,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN The command-line arguments provided by the boot loader will be appended to the the device tree bootargs property. diff --git a/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts b/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts index 1966e4cffd..b7fa78661e 100644 --- a/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts +++ b/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts @@ -41,11 +41,13 @@ wifi2g { label = "green:wifi2g"; gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; }; wifi5g { label = "green:wifi5g"; gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; }; }; diff --git a/target/linux/ramips/dts/mt7621_hilink_hlk-7621a-evb.dts b/target/linux/ramips/dts/mt7621_hilink_hlk-7621a-evb.dts new file mode 100644 index 0000000000..4b807fcaa5 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_hilink_hlk-7621a-evb.dts @@ -0,0 +1,109 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "hilink,hlk-7621a-evb", "mediatek,mt7621-soc"; + model = "HiLink HLK-7621A evaluation board"; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 18 GPIO_ACTIVE_HIGH>; + linux,code = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <44000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x1fb0000>; + }; + }; + }; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan1"; + }; + + port@1 { + status = "okay"; + label = "lan2"; + }; + + port@2 { + status = "okay"; + label = "lan3"; + }; + + port@3 { + status = "okay"; + label = "lan4"; + }; + + port@4 { + status = "okay"; + label = "wan"; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie2 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + }; +}; + +&state_default { + gpio { + groups = "wdt"; + function = "gpio"; + }; +}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_re305-v1.dts b/target/linux/ramips/dts/mt7628an_tplink_re305-v1.dts index 6ac3730194..7948668b84 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_re305-v1.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_re305-v1.dts @@ -1,68 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "mt7628an.dtsi" - -#include -#include +#include "mt7628an_tplink_re305.dtsi" / { compatible = "tplink,re305-v1", "mediatek,mt7628an-soc"; model = "TP-Link RE305 v1"; - - aliases { - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - label-mac-device = ðernet; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - gpios = <&gpio 37 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - - wps { - label = "wps"; - gpios = <&gpio 38 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; - - leds { - compatible = "gpio-leds"; - - led_power: power { - label = "blue:power"; - gpios = <&gpio 39 GPIO_ACTIVE_LOW>; - }; - - wlan2g { - label = "blue:wlan2g"; - gpios = <&gpio 41 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy0tpt"; - }; - - wlan5g { - label = "blue:wlan5g"; - gpios = <&gpio 40 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy1tpt"; - }; - - rssi1 { - label = "red:rssi"; - gpios = <&gpio 43 GPIO_ACTIVE_LOW>; - }; - - rssi2 { - label = "blue:rssi"; - gpios = <&gpio 42 GPIO_ACTIVE_LOW>; - }; - }; }; &spi0 { @@ -110,33 +52,17 @@ }; }; -&state_default { - gpio { - groups = "refclk", "wdt", "p0led_an", "p1led_an", "p2led_an", "p3led_an", "p4led_an"; - function = "gpio"; - }; -}; +&wlan5g { + mediatek,mtd-eeprom = <&radio 0x8000>; -&pcie { - status = "okay"; -}; - -&pcie0 { - mt76@0,0 { - compatible = "mediatek,mt76"; - reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; - ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_config_10008>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; - }; + nvmem-cells = <&macaddr_config_10008>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <2>; }; &wmac { - status = "okay"; - mediatek,mtd-eeprom = <&radio 0x0>; + nvmem-cells = <&macaddr_config_10008>; nvmem-cell-names = "mac-address"; mac-address-increment = <1>; diff --git a/target/linux/ramips/dts/mt7628an_tplink_re305-v3.dts b/target/linux/ramips/dts/mt7628an_tplink_re305-v3.dts new file mode 100644 index 0000000000..652aebec83 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_tplink_re305-v3.dts @@ -0,0 +1,79 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7628an_tplink_re305.dtsi" + +/ { + compatible = "tplink,re305-v3", "mediatek,mt7628an-soc"; + model = "TP-Link RE305 v3"; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x20000>; + read-only; + }; + + partition@20000 { + compatible = "tplink,firmware"; + label = "firmware"; + reg = <0x20000 0x7a0000>; + }; + + config: partition@7c0000 { + label = "config"; + reg = <0x7c0000 0x30000>; + read-only; + }; + + radio: partition@7f0000 { + label = "radio"; + reg = <0x7f0000 0x10000>; + read-only; + }; + }; + }; +}; + +&wlan5g { + mediatek,mtd-eeprom = <&radio 0x8000>; + + nvmem-cells = <&macaddr_config_2008>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-2)>; +}; + +&wmac { + mediatek,mtd-eeprom = <&radio 0x0>; + + nvmem-cells = <&macaddr_config_2008>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; +}; + +ðernet { + nvmem-cells = <&macaddr_config_2008>; + nvmem-cell-names = "mac-address"; +}; + +&config { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_2008: macaddr@2008 { + reg = <0x2008 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_re305.dtsi b/target/linux/ramips/dts/mt7628an_tplink_re305.dtsi new file mode 100644 index 0000000000..029b955911 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_tplink_re305.dtsi @@ -0,0 +1,86 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7628an.dtsi" + +#include +#include + +/ { + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = ðernet; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 37 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 38 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "blue:power"; + gpios = <&gpio 39 GPIO_ACTIVE_LOW>; + }; + + wlan2g { + label = "blue:wlan2g"; + gpios = <&gpio 41 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wlan5g { + label = "blue:wlan5g"; + gpios = <&gpio 40 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + rssi1 { + label = "red:rssi"; + gpios = <&gpio 43 GPIO_ACTIVE_LOW>; + }; + + rssi2 { + label = "blue:rssi"; + gpios = <&gpio 42 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&state_default { + gpio { + groups = "refclk", "wdt", "p0led_an", "p1led_an", "p2led_an", "p3led_an", "p4led_an"; + function = "gpio"; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wlan5g: mt76@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&wmac { + status = "okay"; +}; diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-3c.dts b/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-3c.dts new file mode 100644 index 0000000000..c45f94b2f1 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-3c.dts @@ -0,0 +1,156 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7628an.dtsi" + +#include +#include + +/ { + compatible = "xiaomi,miwifi-3c", "mediatek,mt7628an-soc"; + model = "Xiaomi MiWiFi 3C"; + + aliases { + led-boot = &led_status_amber; + led-failsafe = &led_status_red; + led-running = &led_status_blue; + led-upgrade = &led_status_amber; + label-mac-device = ðernet; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + leds { + compatible = "gpio-leds"; + + led_status_blue: status_blue { + label = "blue:status"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + led_status_red: status_red { + label = "red:status"; + gpios = <&gpio 37 GPIO_ACTIVE_LOW>; + }; + + led_status_amber: status_amber { + label = "amber:status"; + gpios = <&gpio 44 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 38 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&state_default { + gpio { + groups = "gpio", "refclk", "wdt", "wled_an"; + function = "gpio"; + }; +}; + +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + +&esw { + mediatek,portmap = <0x3e>; + mediatek,portdisable = <0x2a>; +}; + +&wmac { + status = "okay"; + + mediatek,mtd-eeprom = <&factory 0x0>; +}; + +ðernet { + nvmem-cells = <&macaddr_factory_28>; + nvmem-cell-names = "mac-address"; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Bootloader"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "Config"; + reg = <0x30000 0x10000>; + }; + + partition@40000 { + label = "Bdata"; + reg = <0x40000 0x10000>; + read-only; + }; + + factory: partition@50000 { + label = "factory"; + reg = <0x50000 0x10000>; + read-only; + }; + + partition@60000 { + label = "crash"; + reg = <0x60000 0x10000>; + read-only; + }; + + partition@70000 { + label = "cfg_bak"; + reg = <0x70000 0x10000>; + read-only; + }; + + partition@80000 { + label = "overlay"; + reg = <0x80000 0xc0000>; + read-only; + }; + + partition@140000 { + label = "firmware"; + compatible = "denx,uimage"; + reg = <0x140000 0xec0000>; + }; + }; + }; +}; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 29e3123ec2..c754b41f64 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -9,19 +9,6 @@ DEFAULT_SOC := mt7621 KERNEL_DTB += -d21 DEVICE_VARS += ELECOM_HWNAME LINKSYS_HWNAME -define Build/elecom-wrc-gs-factory - $(eval product=$(word 1,$(1))) - $(eval version=$(word 2,$(1))) - $(eval hash_opt=$(word 3,$(1))) - $(MKHASH) md5 $(hash_opt) $@ >> $@ - ( \ - echo -n "ELECOM $(product) v$(version)" | \ - dd bs=32 count=1 conv=sync; \ - dd if=$@; \ - ) > $@.new - mv $@.new $@ -endef - define Build/gemtek-trailer printf "%s%08X" ".GEMTEK." "$$(cksum $@ | cut -d ' ' -f1)" >> $@ endef @@ -624,6 +611,16 @@ define Device/gnubee_gb-pc2 endef TARGET_DEVICES += gnubee_gb-pc2 +define Device/hilink_hlk-7621a-evb + $(Device/dsa-migration) + $(Device/uimage-lzma-loader) + DEVICE_VENDOR := HiLink + DEVICE_MODEL := HLK-7621A evaluation board + DEVICE_PACKAGES += kmod-mt76x2 kmod-usb3 + IMAGE_SIZE := 32448k +endef +TARGET_DEVICES += hilink_hlk-7621a-evb + define Device/hiwifi_hc5962 $(Device/dsa-migration) BLOCKSIZE := 128k diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 0c5debee14..ca3497c550 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -513,6 +513,16 @@ define Device/tplink_re305-v1 endef TARGET_DEVICES += tplink_re305-v1 +define Device/tplink_re305-v3 + $(Device/tplink-safeloader) + IMAGE_SIZE := 7808k + DEVICE_MODEL := RE305 + DEVICE_VARIANT := v3 + DEVICE_PACKAGES := kmod-mt76x2 + TPLINK_BOARD_ID := RE305-V3 +endef +TARGET_DEVICES += tplink_re305-v3 + define Device/tplink_tl-mr3020-v3 $(Device/tplink-v2) IMAGE_SIZE := 7808k @@ -832,6 +842,14 @@ define Device/xiaomi_mi-router-4c endef TARGET_DEVICES += xiaomi_mi-router-4c +define Device/xiaomi_miwifi-3c + IMAGE_SIZE := 15104k + DEVICE_VENDOR := Xiaomi + DEVICE_MODEL := MiWiFi 3C + DEVICE_PACKAGES := uboot-envtools +endef +TARGET_DEVICES += xiaomi_miwifi-3c + define Device/xiaomi_miwifi-nano IMAGE_SIZE := 16064k DEVICE_VENDOR := Xiaomi diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds index ff3a5c8c0c..694f3d1541 100644 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds @@ -143,10 +143,6 @@ kingston,mlwg2|\ sanlinking,d240) ucidef_set_led_netdev "wifi_led" "wifi" "blue:wifi" "wlan0" ;; -lava,lr-25g001) - ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "green:wlan2g" "wlan1" - ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "green:wlan5g" "wlan0" - ;; lenovo,newifi-y1) ucidef_set_led_netdev "wifi" "WIFI" "blue:wifi" "wlan1" ucidef_set_led_netdev "wifi5g" "WIFI5G" "blue:wifi5g" "wlan0" diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index 7cdf27c004..12a29b3907 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -25,6 +25,7 @@ ramips_setup_interfaces() tplink,re200-v4|\ tplink,re220-v2|\ tplink,re305-v1|\ + tplink,re305-v3|\ tplink,tl-mr3020-v3|\ tplink,tl-wr802n-v4|\ tplink,tl-wa801nd-v5|\ @@ -149,6 +150,10 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "4:lan:1" "2:lan:2" "1:wan" "6@eth0" ;; + xiaomi,miwifi-3c) + ucidef_add_switch "switch0" \ + "0:wan" "2:lan:2" "4:lan:1" "6@eth0" + ;; xiaomi,miwifi-nano) ucidef_add_switch "switch0" \ "0:lan:2" "2:lan:1" "4:wan" "6@eth0" diff --git a/target/linux/ramips/patches-5.10/710-at803x.patch b/target/linux/ramips/patches-5.10/710-at803x.patch index ec8f3ba55f..1b59f70cea 100644 --- a/target/linux/ramips/patches-5.10/710-at803x.patch +++ b/target/linux/ramips/patches-5.10/710-at803x.patch @@ -40,9 +40,9 @@ Signed-off-by: René van Dorst +#define PSSR_SPEED_1000 BIT(15) +#define PSSR_SPEED_100 BIT(14) - #define AT803X_DEBUG_REG_0 0x00 - #define AT803X_DEBUG_RX_CLK_DLY_EN BIT(15) -@@ -532,12 +543,75 @@ static int at803x_parse_dt(struct phy_de + #define AT803X_DEBUG_ANALOG_TEST_CTRL 0x00 + #define QCA8327_DEBUG_MANU_CTRL_EN BIT(2) +@@ -629,12 +640,75 @@ static int at803x_parse_dt(struct phy_de return 0; } @@ -118,7 +118,7 @@ Signed-off-by: René van Dorst priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; -@@ -554,6 +628,7 @@ static int at803x_probe(struct phy_devic +@@ -651,6 +725,7 @@ static int at803x_probe(struct phy_devic return ret; } @@ -126,7 +126,7 @@ Signed-off-by: René van Dorst /* Some bootloaders leave the fiber page selected. * Switch to the copper page, as otherwise we read * the PHY capabilities from the fiber side. -@@ -565,6 +640,7 @@ static int at803x_probe(struct phy_devic +@@ -662,6 +737,7 @@ static int at803x_probe(struct phy_devic if (ret) goto err; } @@ -134,7 +134,7 @@ Signed-off-by: René van Dorst return 0; -@@ -744,6 +820,10 @@ static int at803x_read_status(struct phy +@@ -841,6 +917,10 @@ static int at803x_read_status(struct phy { int ss, err, old_link = phydev->link; @@ -145,7 +145,7 @@ Signed-off-by: René van Dorst /* Update the link, but return if there was an error */ err = genphy_update_link(phydev); if (err) -@@ -844,6 +924,12 @@ static int at803x_config_aneg(struct phy +@@ -941,6 +1021,12 @@ static int at803x_config_aneg(struct phy { int ret; @@ -158,7 +158,7 @@ Signed-off-by: René van Dorst ret = at803x_config_mdix(phydev, phydev->mdix_ctrl); if (ret < 0) return ret; -@@ -943,6 +1029,7 @@ static int at803x_get_features(struct ph +@@ -1040,6 +1126,7 @@ static int at803x_get_features(struct ph if (err) return err; @@ -166,7 +166,7 @@ Signed-off-by: René van Dorst if (!at803x_match_phy_id(phydev, ATH8031_PHY_ID)) return 0; -@@ -960,6 +1047,7 @@ static int at803x_get_features(struct ph +@@ -1057,6 +1144,7 @@ static int at803x_get_features(struct ph */ linkmode_clear_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT, phydev->supported); @@ -174,7 +174,7 @@ Signed-off-by: René van Dorst return 0; } -@@ -1173,6 +1261,7 @@ static struct phy_driver at803x_driver[] +@@ -1381,6 +1469,7 @@ static struct phy_driver at803x_driver[] /* Qualcomm Atheros AR8031/AR8033 */ PHY_ID_MATCH_EXACT(ATH8031_PHY_ID), .name = "Qualcomm Atheros AR8031/AR8033", diff --git a/target/linux/ramips/patches-5.10/720-Revert-net-phy-simplify-phy_link_change-arguments.patch b/target/linux/ramips/patches-5.10/720-Revert-net-phy-simplify-phy_link_change-arguments.patch index a4398f9f8a..a2ace6057f 100644 --- a/target/linux/ramips/patches-5.10/720-Revert-net-phy-simplify-phy_link_change-arguments.patch +++ b/target/linux/ramips/patches-5.10/720-Revert-net-phy-simplify-phy_link_change-arguments.patch @@ -107,7 +107,7 @@ still required by target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c bool tx_pause, rx_pause; --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -638,7 +638,7 @@ struct phy_device { +@@ -642,7 +642,7 @@ struct phy_device { u8 mdix; u8 mdix_ctrl; diff --git a/target/linux/ramips/patches-5.10/721-NET-no-auto-carrier-off-support.patch b/target/linux/ramips/patches-5.10/721-NET-no-auto-carrier-off-support.patch index c9cbef7429..02bcb17354 100644 --- a/target/linux/ramips/patches-5.10/721-NET-no-auto-carrier-off-support.patch +++ b/target/linux/ramips/patches-5.10/721-NET-no-auto-carrier-off-support.patch @@ -37,7 +37,7 @@ Signed-off-by: John Crispin break; --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -557,6 +557,7 @@ struct phy_device { +@@ -561,6 +561,7 @@ struct phy_device { unsigned sysfs_links:1; unsigned loopback_enabled:1; unsigned downshifted_rate:1; diff --git a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/common.c b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/common.c index 9691b8b5c7..6d2996f0af 100644 --- a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/common.c +++ b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/common.c @@ -1342,7 +1342,7 @@ static int rtl83xx_fib_event(struct notifier_block *this, unsigned long event, v struct fib6_entry_notifier_info *fen6_info = ptr; pr_warn("%s: FIB_RULE ADD/DELL for IPv6 not supported\n", __func__); kfree(fib_work); - return notifier_from_errno(-EINVAL); + return NOTIFY_DONE; } break; diff --git a/target/linux/realtek/image/Makefile b/target/linux/realtek/image/Makefile index 5e4b4cde80..a7961970a3 100644 --- a/target/linux/realtek/image/Makefile +++ b/target/linux/realtek/image/Makefile @@ -10,7 +10,7 @@ DEVICE_VARS += ZYXEL_VERS define Build/zyxel-vers ( echo VERS;\ - for hw in $(1); do\ + for hw in $(ZYXEL_VERS); do\ echo -n "V9.99($$hw.0) | ";\ date -d @$(SOURCE_DATE_EPOCH) +%m/%d/%Y;\ done ) >> $@ @@ -117,7 +117,7 @@ define Device/zyxel_gs1900 IMAGE_SIZE := 6976k DEVICE_VENDOR := ZyXEL UIMAGE_MAGIC := 0x83800000 - KERNEL_INITRAMFS := kernel-bin | append-dtb | gzip | zyxel-vers $$$$(ZYXEL_VERS) | \ + KERNEL_INITRAMFS := kernel-bin | append-dtb | gzip | zyxel-vers | \ uImage gzip endef diff --git a/target/linux/realtek/patches-5.10/007-5.16-gpio-realtek-realtek-otto-fix-gpio-line-irq-offset.patch b/target/linux/realtek/patches-5.10/007-5.16-gpio-realtek-realtek-otto-fix-gpio-line-irq-offset.patch new file mode 100644 index 0000000000..f1f739d470 --- /dev/null +++ b/target/linux/realtek/patches-5.10/007-5.16-gpio-realtek-realtek-otto-fix-gpio-line-irq-offset.patch @@ -0,0 +1,21 @@ +gpio: realtek-otto: fix GPIO line IRQ offset + +The irqchip uses one domain for all GPIO lines, so th line offset should be +determined w.r.t. the first line of the first port, not the first line of the +triggered port. + +Fixes: 0d82fb1127fb ("gpio: Add Realtek Otto GPIO support") +Signed-off-by: Sander Vanheule +Link: https://lore.kernel.org/linux-gpio/20211028085243.34360-1-sander@svanheule.net/ + +--- a/drivers/gpio/gpio-realtek-otto.c ++++ b/drivers/gpio/gpio-realtek-otto.c +@@ -206,7 +206,7 @@ static void realtek_gpio_irq_handler(str + status = realtek_gpio_read_isr(ctrl, lines_done / 8); + port_pin_count = min(gc->ngpio - lines_done, 8U); + for_each_set_bit(offset, &status, port_pin_count) { +- irq = irq_find_mapping(gc->irq.domain, offset); ++ irq = irq_find_mapping(gc->irq.domain, offset + lines_done); + generic_handle_irq(irq); + } + } diff --git a/target/linux/realtek/patches-5.10/703-include-linux-add-phy-ops-for-rtl838x.patch b/target/linux/realtek/patches-5.10/703-include-linux-add-phy-ops-for-rtl838x.patch index 0a771b64f0..0841b85fd8 100644 --- a/target/linux/realtek/patches-5.10/703-include-linux-add-phy-ops-for-rtl838x.patch +++ b/target/linux/realtek/patches-5.10/703-include-linux-add-phy-ops-for-rtl838x.patch @@ -1,6 +1,6 @@ --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -881,6 +881,10 @@ struct phy_driver { +@@ -885,6 +885,10 @@ struct phy_driver { int (*get_sqi)(struct phy_device *dev); /** @get_sqi_max: Get the maximum signal quality indication */ int (*get_sqi_max)(struct phy_device *dev); diff --git a/target/linux/realtek/patches-5.10/704-include-linux-add-phy-hsgmii-mode.patch b/target/linux/realtek/patches-5.10/704-include-linux-add-phy-hsgmii-mode.patch index d47e7bad50..58f4fef456 100644 --- a/target/linux/realtek/patches-5.10/704-include-linux-add-phy-hsgmii-mode.patch +++ b/target/linux/realtek/patches-5.10/704-include-linux-add-phy-hsgmii-mode.patch @@ -1,14 +1,14 @@ --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -133,6 +133,7 @@ typedef enum { +@@ -134,6 +134,7 @@ typedef enum { PHY_INTERFACE_MODE_XGMII, PHY_INTERFACE_MODE_XLGMII, PHY_INTERFACE_MODE_MOCA, + PHY_INTERFACE_MODE_HSGMII, PHY_INTERFACE_MODE_QSGMII, PHY_INTERFACE_MODE_TRGMII, - PHY_INTERFACE_MODE_1000BASEX, -@@ -199,6 +200,8 @@ static inline const char *phy_modes(phy_ + PHY_INTERFACE_MODE_100BASEX, +@@ -201,6 +202,8 @@ static inline const char *phy_modes(phy_ return "xlgmii"; case PHY_INTERFACE_MODE_MOCA: return "moca"; diff --git a/target/linux/realtek/patches-5.10/705-add-rtl-phy.patch b/target/linux/realtek/patches-5.10/705-add-rtl-phy.patch index dbd936b446..3046a6aed5 100644 --- a/target/linux/realtek/patches-5.10/705-add-rtl-phy.patch +++ b/target/linux/realtek/patches-5.10/705-add-rtl-phy.patch @@ -1,6 +1,6 @@ --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -324,6 +324,12 @@ config REALTEK_PHY +@@ -325,6 +325,12 @@ config REALTEK_PHY help Supports the Realtek 821x PHY. diff --git a/target/linux/realtek/patches-5.10/705-include-linux-phy-increase-phy-address-number-for-rtl839x.patch b/target/linux/realtek/patches-5.10/705-include-linux-phy-increase-phy-address-number-for-rtl839x.patch index 64e6b5d309..ab3ea8e689 100644 --- a/target/linux/realtek/patches-5.10/705-include-linux-phy-increase-phy-address-number-for-rtl839x.patch +++ b/target/linux/realtek/patches-5.10/705-include-linux-phy-increase-phy-address-number-for-rtl839x.patch @@ -1,6 +1,6 @@ --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -229,7 +229,7 @@ static inline const char *phy_modes(phy_ +@@ -233,7 +233,7 @@ static inline const char *phy_modes(phy_ #define PHY_INIT_TIMEOUT 100000 #define PHY_FORCE_TIMEOUT 10 diff --git a/target/linux/sunxi/base-files/etc/board.d/01_leds b/target/linux/sunxi/base-files/etc/board.d/01_leds index 45153b44dc..60783363de 100644 --- a/target/linux/sunxi/base-files/etc/board.d/01_leds +++ b/target/linux/sunxi/base-files/etc/board.d/01_leds @@ -7,7 +7,8 @@ boardname="${board##*,}" board_config_update case $board in -friendlyarm,nanopi-r1) +friendlyarm,nanopi-r1|\ +friendlyarm,nanopi-r1s-h5) ucidef_set_led_netdev "wan" "WAN" "nanopi:green:wan" "eth0" ucidef_set_led_netdev "lan" "LAN" "nanopi:green:lan" "eth1" ;; diff --git a/target/linux/sunxi/base-files/etc/board.d/02_network b/target/linux/sunxi/base-files/etc/board.d/02_network index d5c615e7f2..46ace1f67c 100644 --- a/target/linux/sunxi/base-files/etc/board.d/02_network +++ b/target/linux/sunxi/base-files/etc/board.d/02_network @@ -3,27 +3,54 @@ # . /lib/functions/uci-defaults.sh +. /lib/functions/system.sh + +sunxi_setup_interfaces() +{ + local board="$1" + + case "$board" in + friendlyarm,nanopi-r1|\ + friendlyarm,nanopi-r1s-h5) + ucidef_set_interfaces_lan_wan "eth1" "eth0" + ;; + lamobo,lamobo-r1) + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" wan + ;; + olimex,a20-olinuxino-micro) + ucidef_set_interface_lan "wlan0" + ;; + xunlong,orangepi-r1) + ucidef_set_interfaces_lan_wan "eth0" "eth1" + ;; + *) + ucidef_set_interface_lan "eth0" + ;; + esac +} + +sunxi_setup_macs() +{ + local board="$1" + local lan_mac="" + local wan_mac="" + local label_mac="" + + case "$board" in + friendlyarm,nanopi-r1s-h5) + lan_mac=$(get_mac_binary "/sys/bus/i2c/devices/0-0051/eeprom" 0xfa) + ;; + esac + + [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac + [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac + [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac +} board_config_update - -case $(board_name) in -friendlyarm,nanopi-r1) - ucidef_set_interfaces_lan_wan "eth1" "eth0" - ;; -lamobo,lamobo-r1) - ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" wan - ;; -olimex,a20-olinuxino-micro) - ucidef_set_interface_lan "wlan0" - ;; -xunlong,orangepi-r1) - ucidef_set_interfaces_lan_wan "eth0" "eth1" - ;; -*) - ucidef_set_interface_lan "eth0" - ;; -esac - +board=$(board_name) +sunxi_setup_interfaces $board +sunxi_setup_macs $board board_config_flush exit 0 diff --git a/target/linux/sunxi/config-5.10 b/target/linux/sunxi/config-5.10 index 40cb834782..d25a4f33ce 100644 --- a/target/linux/sunxi/config-5.10 +++ b/target/linux/sunxi/config-5.10 @@ -27,6 +27,7 @@ CONFIG_ARM_CCI=y CONFIG_ARM_CCI400_COMMON=y CONFIG_ARM_CCI400_PORT_CTRL=y CONFIG_ARM_CPU_SUSPEND=y +CONFIG_ARM_CRYPTO=y CONFIG_ARM_ERRATA_643719=y CONFIG_ARM_GIC=y CONFIG_ARM_HAS_SG_CHAIN=y @@ -106,6 +107,7 @@ CONFIG_CRC_T10DIF=y CONFIG_CRYPTO_CRC32=y CONFIG_CRYPTO_CRC32C=y CONFIG_CRYPTO_CRCT10DIF=y +CONFIG_CRYPTO_CRCT10DIF_ARM_CE=y CONFIG_CRYPTO_DES=y CONFIG_CRYPTO_DEV_ALLWINNER=y CONFIG_CRYPTO_DEV_SUN4I_SS=y @@ -519,6 +521,8 @@ CONFIG_VFPv3=y CONFIG_VHOST=y CONFIG_VHOST_IOTLB=y CONFIG_VHOST_NET=y +# CONFIG_VIDEO_SUN4I_CSI is not set +# CONFIG_VIDEO_SUN6I_CSI is not set CONFIG_VM_EVENT_COUNTERS=y CONFIG_VT=y CONFIG_VT_CONSOLE=y diff --git a/target/linux/sunxi/cortexa53/config-5.10 b/target/linux/sunxi/cortexa53/config-5.10 index 88f5984858..5136705662 100644 --- a/target/linux/sunxi/cortexa53/config-5.10 +++ b/target/linux/sunxi/cortexa53/config-5.10 @@ -30,6 +30,7 @@ CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y CONFIG_DMA_DIRECT_REMAP=y CONFIG_DWMAC_SUN8I=y +CONFIG_EEPROM_AT24=y # CONFIG_FLATMEM_MANUAL is not set CONFIG_FRAME_POINTER=y CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y diff --git a/target/linux/sunxi/cortexa53/config-5.4 b/target/linux/sunxi/cortexa53/config-5.4 index ad9389e42e..9ef4842f04 100644 --- a/target/linux/sunxi/cortexa53/config-5.4 +++ b/target/linux/sunxi/cortexa53/config-5.4 @@ -72,6 +72,7 @@ CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y CONFIG_DMA_DIRECT_REMAP=y CONFIG_DRM_RCAR_WRITEBACK=y CONFIG_DWMAC_SUN8I=y +CONFIG_EEPROM_AT24=y CONFIG_EFI_EARLYCON=y # CONFIG_FLATMEM_MANUAL is not set CONFIG_FRAME_POINTER=y diff --git a/target/linux/sunxi/image/cortexa53.mk b/target/linux/sunxi/image/cortexa53.mk index 2d18b0b227..c88aee2d7c 100644 --- a/target/linux/sunxi/image/cortexa53.mk +++ b/target/linux/sunxi/image/cortexa53.mk @@ -40,6 +40,15 @@ define Device/friendlyarm_nanopi-neo2 endef TARGET_DEVICES += friendlyarm_nanopi-neo2 +define Device/friendlyarm_nanopi-r1s-h5 + DEVICE_VENDOR := FriendlyARM + DEVICE_MODEL := Nanopi R1S H5 + DEVICE_PACKAGES := kmod-gpio-button-hotplug kmod-usb-net-rtl8152 + SUPPORTED_DEVICES:=nanopi-r1s-h5 + $(Device/sun50i-h5) +endef +TARGET_DEVICES += friendlyarm_nanopi-r1s-h5 + define Device/libretech_all-h3-cc-h5 DEVICE_VENDOR := Libre Computer DEVICE_MODEL := ALL-H3-CC diff --git a/target/linux/sunxi/patches-5.10/101-sunxi-h5-add-support-for-nanopi-r1s-h5.patch b/target/linux/sunxi/patches-5.10/101-sunxi-h5-add-support-for-nanopi-r1s-h5.patch new file mode 100644 index 0000000000..e0c25bcb53 --- /dev/null +++ b/target/linux/sunxi/patches-5.10/101-sunxi-h5-add-support-for-nanopi-r1s-h5.patch @@ -0,0 +1,230 @@ +From 9962cb9be2db877c232aaf00db40125c0d7bf4bc Mon Sep 17 00:00:00 2001 +From: Chukun Pan +Date: Mon, 17 May 2021 00:35:22 +0800 +Subject: [PATCH] arm64: dts: allwinner: h5: Add NanoPi R1S H5 support + +The NanoPi R1S H5 is a open source board made by FriendlyElec. +It has the following features: + +- Allwinner H5, Quad-core Cortex-A53 +- 512MB DDR3 RAM +- 10/100/1000M Ethernet x 2 +- RTL8189ETV WiFi 802.11b/g/n +- USB 2.0 host port (A) +- MicroSD Slot +- Serial Debug Port +- 5V 2A DC power-supply + +Signed-off-by: Chukun Pan +Signed-off-by: Maxime Ripard +Link: https://lore.kernel.org/r/20210516163523.9484-2-amadeus@jmu.edu.cn +--- + arch/arm64/boot/dts/allwinner/Makefile | 1 + + .../dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts | 195 ++++++++++++++++++ + 2 files changed, 196 insertions(+) + create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts + +--- a/arch/arm64/boot/dts/allwinner/Makefile ++++ b/arch/arm64/boot/dts/allwinner/Makefile +@@ -24,6 +24,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-li + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-libretech-all-h5-cc.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo2.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo-plus2.dtb ++dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-r1s-h5.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-prime.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus.dtb +--- /dev/null ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts +@@ -0,0 +1,191 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (C) 2021 Chukun Pan ++ * ++ * Based on sun50i-h5-nanopi-neo-plus2.dts, which is: ++ * Copyright (C) 2017 Antony Antony ++ * Copyright (C) 2016 ARM Ltd. ++ */ ++ ++/dts-v1/; ++#include "sun50i-h5.dtsi" ++#include "sun50i-h5-cpu-opp.dtsi" ++ ++#include ++#include ++ ++/ { ++ model = "FriendlyARM NanoPi R1S H5"; ++ compatible = "friendlyarm,nanopi-r1s-h5", "allwinner,sun50i-h5"; ++ ++ aliases { ++ ethernet0 = &emac; ++ ethernet1 = &rtl8189etv; ++ serial0 = &uart0; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ sys { ++ label = "nanopi:red:sys"; ++ gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "heartbeat"; ++ }; ++ ++ lan { ++ label = "nanopi:green:lan"; ++ gpios = <&pio 0 9 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ wan { ++ label = "nanopi:green:wan"; ++ gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++ ++ r-gpio-keys { ++ compatible = "gpio-keys"; ++ ++ reset { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ reg_gmac_3v3: gmac-3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "gmac-3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ startup-delay-us = <100000>; ++ enable-active-high; ++ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ reg_vcc3v3: vcc3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ }; ++ ++ reg_usb0_vbus: usb0-vbus { ++ compatible = "regulator-fixed"; ++ regulator-name = "usb0-vbus"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ enable-active-high; ++ gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */ ++ status = "okay"; ++ }; ++ ++ vdd_cpux: gpio-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 6 GPIO_ACTIVE_HIGH>; ++ gpios-states = <0x1>; ++ states = <1100000 0x0>, <1300000 0x1>; ++ }; ++ ++ wifi_pwrseq: wifi_pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */ ++ post-power-on-delay-ms = <200>; ++ }; ++}; ++ ++&cpu0 { ++ cpu-supply = <&vdd_cpux>; ++}; ++ ++&ehci1 { ++ status = "okay"; ++}; ++ ++&ehci2 { ++ status = "okay"; ++}; ++ ++&emac { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&emac_rgmii_pins>; ++ phy-supply = <®_gmac_3v3>; ++ phy-handle = <&ext_rgmii_phy>; ++ phy-mode = "rgmii-id"; ++ status = "okay"; ++}; ++ ++&external_mdio { ++ ext_rgmii_phy: ethernet-phy@7 { ++ compatible = "ethernet-phy-ieee802.3-c22"; ++ reg = <7>; ++ }; ++}; ++ ++&i2c0 { ++ status = "okay"; ++ ++ eeprom@51 { ++ compatible = "microchip,24c02"; ++ reg = <0x51>; ++ pagesize = <16>; ++ }; ++}; ++ ++&mmc0 { ++ vmmc-supply = <®_vcc3v3>; ++ bus-width = <4>; ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ ++ status = "okay"; ++}; ++ ++&mmc1 { ++ vmmc-supply = <®_vcc3v3>; ++ vqmmc-supply = <®_vcc3v3>; ++ mmc-pwrseq = <&wifi_pwrseq>; ++ bus-width = <4>; ++ non-removable; ++ status = "okay"; ++ ++ rtl8189etv: sdio_wifi@1 { ++ reg = <1>; ++ }; ++}; ++ ++&ohci1 { ++ status = "okay"; ++}; ++ ++&ohci2 { ++ status = "okay"; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pa_pins>; ++ status = "okay"; ++}; ++ ++&usb_otg { ++ dr_mode = "peripheral"; ++ status = "okay"; ++}; ++ ++&usbphy { ++ /* USB Type-A port's VBUS is always on */ ++ usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */ ++ usb0_vbus-supply = <®_usb0_vbus>; ++ status = "okay"; ++}; diff --git a/target/linux/sunxi/patches-5.10/102-sunxi-add-OF-node-for-USB-eth-on-NanoPi-R1S-H5.patch b/target/linux/sunxi/patches-5.10/102-sunxi-add-OF-node-for-USB-eth-on-NanoPi-R1S-H5.patch new file mode 100644 index 0000000000..e14311aa64 --- /dev/null +++ b/target/linux/sunxi/patches-5.10/102-sunxi-add-OF-node-for-USB-eth-on-NanoPi-R1S-H5.patch @@ -0,0 +1,30 @@ +From a896bc1d79e3c00f0aacfe225499d811775616f3 Mon Sep 17 00:00:00 2001 +From: Chukun Pan +Date: Sun, 10 Oct 2021 21:50:17 +0800 +Subject: [PATCH] arm64: allwinner: add OF node for USB eth on NanoPi R1S H5 + +This adds the OF node for the USB3 ethernet adapter on the FriendlyARM +NanoPi R1S H5. Add the correct value for the RTL8153 LED configuration +register to match the blink behavior of the other port on the device. + +Signed-off-by: Chukun Pan +--- + arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts +@@ -112,6 +112,13 @@ + + &ehci1 { + status = "okay"; ++ ++ usb-eth@1 { ++ compatible = "realtek,rtl8153"; ++ reg = <1>; ++ ++ realtek,led-data = <0x78>; ++ }; + }; + + &ehci2 { diff --git a/target/linux/sunxi/patches-5.10/431-arm64-dts-allwinner-nanopi-r1s-h5-add-status-LED.patch b/target/linux/sunxi/patches-5.10/431-arm64-dts-allwinner-nanopi-r1s-h5-add-status-LED.patch new file mode 100644 index 0000000000..4a429c746e --- /dev/null +++ b/target/linux/sunxi/patches-5.10/431-arm64-dts-allwinner-nanopi-r1s-h5-add-status-LED.patch @@ -0,0 +1,35 @@ +From 1845163a052efac124f00656eb72f38947630a42 Mon Sep 17 00:00:00 2001 +From: Chukun Pan +Date: Sun, 10 Oct 2021 21:50:18 +0800 +Subject: [PATCH] arm64: dts: allwinner: NanoPi R1S H5: add status LED aliases + +Use the SYS LED on the casing for showing system status. + +Signed-off-by: Chukun Pan +--- + arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts +@@ -22,6 +22,11 @@ + ethernet0 = &emac; + ethernet1 = &rtl8189etv; + serial0 = &uart0; ++ ++ led-boot = &led_sys; ++ led-failsafe = &led_sys; ++ led-running = &led_sys; ++ led-upgrade = &led_sys; + }; + + chosen { +@@ -31,7 +36,7 @@ + leds { + compatible = "gpio-leds"; + +- sys { ++ led_sys: sys { + label = "nanopi:red:sys"; + gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; diff --git a/target/linux/sunxi/patches-5.4/101-sunxi-h5-add-support-for-nanopi-r1s-h5.patch b/target/linux/sunxi/patches-5.4/101-sunxi-h5-add-support-for-nanopi-r1s-h5.patch new file mode 100644 index 0000000000..339eadcd23 --- /dev/null +++ b/target/linux/sunxi/patches-5.4/101-sunxi-h5-add-support-for-nanopi-r1s-h5.patch @@ -0,0 +1,229 @@ +From 9962cb9be2db877c232aaf00db40125c0d7bf4bc Mon Sep 17 00:00:00 2001 +From: Chukun Pan +Date: Mon, 17 May 2021 00:35:22 +0800 +Subject: [PATCH] arm64: dts: allwinner: h5: Add NanoPi R1S H5 support + +The NanoPi R1S H5 is a open source board made by FriendlyElec. +It has the following features: + +- Allwinner H5, Quad-core Cortex-A53 +- 512MB DDR3 RAM +- 10/100/1000M Ethernet x 2 +- RTL8189ETV WiFi 802.11b/g/n +- USB 2.0 host port (A) +- MicroSD Slot +- Serial Debug Port +- 5V 2A DC power-supply + +Signed-off-by: Chukun Pan +Signed-off-by: Maxime Ripard +Link: https://lore.kernel.org/r/20210516163523.9484-2-amadeus@jmu.edu.cn +--- + arch/arm64/boot/dts/allwinner/Makefile | 1 + + .../dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts | 195 ++++++++++++++++++ + 2 files changed, 196 insertions(+) + create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts + +--- a/arch/arm64/boot/dts/allwinner/Makefile ++++ b/arch/arm64/boot/dts/allwinner/Makefile +@@ -17,6 +17,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-em + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-libretech-all-h3-cc.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo2.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo-plus2.dtb ++dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-r1s-h5.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-prime.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus.dtb +--- /dev/null ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts +@@ -0,0 +1,190 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (C) 2021 Chukun Pan ++ * ++ * Based on sun50i-h5-nanopi-neo-plus2.dts, which is: ++ * Copyright (C) 2017 Antony Antony ++ * Copyright (C) 2016 ARM Ltd. ++ */ ++ ++/dts-v1/; ++#include "sun50i-h5.dtsi" ++ ++#include ++#include ++ ++/ { ++ model = "FriendlyARM NanoPi R1S H5"; ++ compatible = "friendlyarm,nanopi-r1s-h5", "allwinner,sun50i-h5"; ++ ++ aliases { ++ ethernet0 = &emac; ++ ethernet1 = &rtl8189etv; ++ serial0 = &uart0; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ sys { ++ label = "nanopi:red:sys"; ++ gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "heartbeat"; ++ }; ++ ++ lan { ++ label = "nanopi:green:lan"; ++ gpios = <&pio 0 9 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ wan { ++ label = "nanopi:green:wan"; ++ gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++ ++ r-gpio-keys { ++ compatible = "gpio-keys"; ++ ++ reset { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ reg_gmac_3v3: gmac-3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "gmac-3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ startup-delay-us = <100000>; ++ enable-active-high; ++ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ reg_vcc3v3: vcc3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ }; ++ ++ reg_usb0_vbus: usb0-vbus { ++ compatible = "regulator-fixed"; ++ regulator-name = "usb0-vbus"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ enable-active-high; ++ gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */ ++ status = "okay"; ++ }; ++ ++ vdd_cpux: gpio-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 6 GPIO_ACTIVE_HIGH>; ++ gpios-states = <0x1>; ++ states = <1100000 0x0>, <1300000 0x1>; ++ }; ++ ++ wifi_pwrseq: wifi_pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */ ++ post-power-on-delay-ms = <200>; ++ }; ++}; ++ ++&cpu0 { ++ cpu-supply = <&vdd_cpux>; ++}; ++ ++&ehci1 { ++ status = "okay"; ++}; ++ ++&ehci2 { ++ status = "okay"; ++}; ++ ++&emac { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&emac_rgmii_pins>; ++ phy-supply = <®_gmac_3v3>; ++ phy-handle = <&ext_rgmii_phy>; ++ phy-mode = "rgmii"; ++ status = "okay"; ++}; ++ ++&external_mdio { ++ ext_rgmii_phy: ethernet-phy@7 { ++ compatible = "ethernet-phy-ieee802.3-c22"; ++ reg = <7>; ++ }; ++}; ++ ++&i2c0 { ++ status = "okay"; ++ ++ eeprom@51 { ++ compatible = "microchip,24c02"; ++ reg = <0x51>; ++ pagesize = <16>; ++ }; ++}; ++ ++&mmc0 { ++ vmmc-supply = <®_vcc3v3>; ++ bus-width = <4>; ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ ++ status = "okay"; ++}; ++ ++&mmc1 { ++ vmmc-supply = <®_vcc3v3>; ++ vqmmc-supply = <®_vcc3v3>; ++ mmc-pwrseq = <&wifi_pwrseq>; ++ bus-width = <4>; ++ non-removable; ++ status = "okay"; ++ ++ rtl8189etv: sdio_wifi@1 { ++ reg = <1>; ++ }; ++}; ++ ++&ohci1 { ++ status = "okay"; ++}; ++ ++&ohci2 { ++ status = "okay"; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pa_pins>; ++ status = "okay"; ++}; ++ ++&usb_otg { ++ dr_mode = "peripheral"; ++ status = "okay"; ++}; ++ ++&usbphy { ++ /* USB Type-A port's VBUS is always on */ ++ usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */ ++ usb0_vbus-supply = <®_usb0_vbus>; ++ status = "okay"; ++}; diff --git a/target/linux/sunxi/patches-5.4/102-sunxi-add-OF-node-for-USB-eth-on-NanoPi-R1S-H5.patch b/target/linux/sunxi/patches-5.4/102-sunxi-add-OF-node-for-USB-eth-on-NanoPi-R1S-H5.patch new file mode 100644 index 0000000000..1ee240afb5 --- /dev/null +++ b/target/linux/sunxi/patches-5.4/102-sunxi-add-OF-node-for-USB-eth-on-NanoPi-R1S-H5.patch @@ -0,0 +1,30 @@ +From a896bc1d79e3c00f0aacfe225499d811775616f3 Mon Sep 17 00:00:00 2001 +From: Chukun Pan +Date: Sun, 10 Oct 2021 21:50:17 +0800 +Subject: [PATCH] arm64: allwinner: add OF node for USB eth on NanoPi R1S H5 + +This adds the OF node for the USB3 ethernet adapter on the FriendlyARM +NanoPi R1S H5. Add the correct value for the RTL8153 LED configuration +register to match the blink behavior of the other port on the device. + +Signed-off-by: Chukun Pan +--- + arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts +@@ -111,6 +111,13 @@ + + &ehci1 { + status = "okay"; ++ ++ usb-eth@1 { ++ compatible = "realtek,rtl8153"; ++ reg = <1>; ++ ++ realtek,led-data = <0x78>; ++ }; + }; + + &ehci2 { diff --git a/target/linux/sunxi/patches-5.4/431-arm64-dts-allwinner-nanopi-r1s-h5-add-status-LED.patch b/target/linux/sunxi/patches-5.4/431-arm64-dts-allwinner-nanopi-r1s-h5-add-status-LED.patch new file mode 100644 index 0000000000..8281f78e06 --- /dev/null +++ b/target/linux/sunxi/patches-5.4/431-arm64-dts-allwinner-nanopi-r1s-h5-add-status-LED.patch @@ -0,0 +1,35 @@ +From 1845163a052efac124f00656eb72f38947630a42 Mon Sep 17 00:00:00 2001 +From: Chukun Pan +Date: Sun, 10 Oct 2021 21:50:18 +0800 +Subject: [PATCH] arm64: dts: allwinner: NanoPi R1S H5: add status LED aliases + +Use the SYS LED on the casing for showing system status. + +Signed-off-by: Chukun Pan +--- + arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts +@@ -21,6 +21,11 @@ + ethernet0 = &emac; + ethernet1 = &rtl8189etv; + serial0 = &uart0; ++ ++ led-boot = &led_sys; ++ led-failsafe = &led_sys; ++ led-running = &led_sys; ++ led-upgrade = &led_sys; + }; + + chosen { +@@ -30,7 +35,7 @@ + leds { + compatible = "gpio-leds"; + +- sys { ++ led_sys: sys { + label = "nanopi:red:sys"; + gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index 5929c468db..d980ddfda1 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -7,13 +7,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=firmware-utils -PKG_RELEASE:=13 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware-utils.git -PKG_SOURCE_DATE:=2021-10-05 -PKG_SOURCE_VERSION:=f9ad6b335e0fd699398370d4c6e2e45e1c459dea -PKG_MIRROR_HASH:=a1a5c22e8a05b4521e7f6ec20cfa443e9f33a9c07e30718e2f328ee99cebf6cf +PKG_SOURCE_DATE:=2021-10-30 +PKG_SOURCE_VERSION:=70737600d9385486df5c1970b4ab41ccb17006fa +PKG_MIRROR_HASH:=a2c64e34827992c0f0c71974aa0b66e0a2aafb38a838649500ecd78095098d4c include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/cmake.mk diff --git a/tools/meson/Makefile b/tools/meson/Makefile index 1aab5d8fcb..f648085f90 100644 --- a/tools/meson/Makefile +++ b/tools/meson/Makefile @@ -1,11 +1,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=meson -PKG_VERSION:=0.59.2 +PKG_VERSION:=0.60.0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/mesonbuild/meson/releases/download/$(PKG_VERSION) -PKG_HASH:=13dee549a7ba758b7e33ce7719f28d1d337a98d10d378a4779ccc996f5a2fc49 +PKG_HASH:=080d68b685e9a0d9c9bb475457e097b49e1d1a6f750abc971428a8d2e1b12d47 PKG_MAINTAINER:=Andre Heider PKG_LICENSE:=Apache-2.0 diff --git a/tools/meson/files/openwrt-cross.txt.in b/tools/meson/files/openwrt-cross.txt.in index 30b4c116c4..56aa393d63 100644 --- a/tools/meson/files/openwrt-cross.txt.in +++ b/tools/meson/files/openwrt-cross.txt.in @@ -5,6 +5,7 @@ ar = '@AR@' strip = '@STRIP@' nm = '@NM@' pkgconfig = '@PKGCONFIG@' +cmake = '@CMAKE@' [built-in options] c_args = [@CFLAGS@] diff --git a/tools/meson/files/openwrt-native.txt.in b/tools/meson/files/openwrt-native.txt.in index 50308ec8e4..eba63c00b1 100644 --- a/tools/meson/files/openwrt-native.txt.in +++ b/tools/meson/files/openwrt-native.txt.in @@ -2,6 +2,7 @@ c = [@CC@] cpp = [@CXX@] pkgconfig = '@PKGCONFIG@' +cmake = '@CMAKE@' [built-in options] c_args = [@CFLAGS@]