diff --git a/package/boot/mt7623n-preloader/Makefile b/package/boot/mt7623n-preloader/Makefile index 801c6d19b3..0faaf46d3f 100644 --- a/package/boot/mt7623n-preloader/Makefile +++ b/package/boot/mt7623n-preloader/Makefile @@ -30,6 +30,14 @@ define Download/BPI-R2-preloader-2k.img.gz endef $(eval $(call Download,BPI-R2-preloader-2k.img.gz)) +define Download/BPI-R64-preloader-2k.img.gz + FILE:=$(BPI_PRELOADER_PREFIX)-BPI-R64-preloader-2k.img.gz + URL:=$(BPI_PRELOADER_URL) + URL_FILE:=BPI-R64-preloader-2k.img.gz + HASH:=1a4b55da1717190aa4e790ce93850605e9b15aae4c3248bcf8734aac020ab0e4 +endef +$(eval $(call Download,BPI-R64-preloader-2k.img.gz)) + define Package/mt7623n-preloader SECTION:=boot @@ -43,10 +51,23 @@ define Package/mt7623n-preloader/description Preloader image for mt7623n based boards like Banana Pi R2. endef +define Package/mt7622-preloader + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:=@TARGET_mediatek_mt7622 + TITLE:=mt7622-preloader + DEFAULT:=y if TARGET_mediatek +endef + +define Package/mt7622-preloader/description + Preloader image for mt7622 based boards like Banana Pi R64. +endef + define Build/Prepare rm -rf $(PKG_BUILD_DIR) mkdir -p $(PKG_BUILD_DIR) cp $(DL_DIR)/$(BPI_PRELOADER_PREFIX)-BPI-R2-preloader-DDR1600-20191024-2k.img.gz $(PKG_BUILD_DIR)/mt7623n_bpir2-preloader.bin.gz + cp $(DL_DIR)/$(BPI_PRELOADER_PREFIX)-BPI-R64-preloader-2k.img.gz $(PKG_BUILD_DIR)/mt7622_bpir64-preloader.bin.gz endef define Build/Compile @@ -59,3 +80,4 @@ define Build/InstallDev endef $(eval $(call BuildPackage,mt7623n-preloader)) +$(eval $(call BuildPackage,mt7622-preloader)) diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh index cc3152ae4f..1d7f11f37c 100644 --- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh +++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh @@ -82,9 +82,9 @@ detect_mac80211() { iw phy "$dev" info | grep -q 'Capabilities:' && htmode=HT20 - iw phy "$dev" info | grep -q '5180 MHz' && { + iw phy "$dev" info | grep -q '\* 5... MHz \[' && { mode_band="a" - channel="36" + channel=$(iw phy "$dev" info | grep '\* 5... MHz \[' | grep '(disabled)' -v -m 1 | sed 's/[^[]*\[\|\].*//g') iw phy "$dev" info | grep -q 'VHT Capabilities' && htmode="VHT80" } diff --git a/package/system/zram-swap/Makefile b/package/system/zram-swap/Makefile index 5c132c9062..9a18dd3417 100644 --- a/package/system/zram-swap/Makefile +++ b/package/system/zram-swap/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=zram-swap -PKG_RELEASE:=6 +PKG_RELEASE:=7 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) @@ -17,7 +17,7 @@ include $(INCLUDE_DIR)/package.mk define Package/zram-swap SECTION:=utils CATEGORY:=Base system - DEPENDS:=+kmod-zram +!(BUSYBOX_CONFIG_MKSWAP&&BUSYBOX_CONFIG_SWAPON&&BUSYBOX_CONFIG_SWAPOFF):swap-utils + DEPENDS:=+kmod-zram +@BUSYBOX_CONFIG_MKSWAP +@BUSYBOX_CONFIG_SWAPON +@BUSYBOX_CONFIG_FEATURE_SWAPON_DISCARD +@BUSYBOX_CONFIG_FEATURE_SWAPON_PRI +@BUSYBOX_CONFIG_SWAPOFF TITLE:=ZRAM swap scripts PKGARCH:=all endef diff --git a/package/system/zram-swap/files/zram.init b/package/system/zram-swap/files/zram.init index bfb9285600..a42f019d92 100755 --- a/package/system/zram-swap/files/zram.init +++ b/package/system/zram-swap/files/zram.init @@ -35,18 +35,18 @@ zram_applicable() return 1 } - command -v mkswap >/dev/null || { - logger -s -t zram_applicable -p daemon.err "[ERROR] 'mkswap' not installed" + [ -x /sbin/mkswap ] || { + logger -s -t zram_applicable -p daemon.err "[ERROR] 'BusyBox mkswap' not installed" return 1 } - command -v swapon >/dev/null || { - logger -s -t zram_applicable -p daemon.err "[ERROR] 'swapon' not installed" + [ -x /sbin/swapon ] || { + logger -s -t zram_applicable -p daemon.err "[ERROR] 'BusyBox swapon' not installed" return 1 } - command -v swapoff >/dev/null || { - logger -s -t zram_applicable -p daemon.err "[ERROR] 'swapoff' not installed" + [ -x /sbin/swapoff ] || { + logger -s -t zram_applicable -p daemon.err "[ERROR] 'BusyBox swapoff' not installed" return 1 } } @@ -182,8 +182,8 @@ start() zram_comp_algo "$zram_dev" zram_comp_streams "$zram_dev" echo $(( $zram_size * 1024 * 1024 )) >"/sys/block/$( basename "$zram_dev" )/disksize" - mkswap "$zram_dev" - swapon -d $zram_priority "$zram_dev" + /sbin/mkswap "$zram_dev" + /sbin/swapon -d $zram_priority "$zram_dev" } stop() @@ -192,7 +192,7 @@ stop() for zram_dev in $( grep zram /proc/swaps |awk '{print $1}' ); do { logger -s -t zram_stop -p daemon.debug "deactivate swap $zram_dev" - swapoff "$zram_dev" && zram_reset "$zram_dev" "claiming memory back" + /sbin/swapoff "$zram_dev" && zram_reset "$zram_dev" "claiming memory back" local dev_index="$( echo $zram_dev | grep -o "[0-9]*$" )" if [ $dev_index -ne 0 ]; then logger -s -t zram_stop -p daemon.debug "removing zram $zram_dev" 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 f4572d038c..74ad00c5ce 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 @@ -14,7 +14,7 @@ case "$FIRMWARE" in ath10k_patch_mac $(mtd_get_mac_binary ART 0x1e) ;; edgecore,ecw5410) - ath10kcal_extract "0:ART" 4096 12064 + caldata_extract "0:ART" 0x1000 0x2f20 ;; linksys,ea7500-v1 |\ linksys,ea8500) @@ -83,7 +83,7 @@ case "$FIRMWARE" in "ath10k/pre-cal-pci-0002:01:00.0.bin") case $board in edgecore,ecw5410) - ath10kcal_extract "0:ART" 20480 12064 + caldata_extract "0:ART" 0x5000 0x2f20 ;; esac ;; diff --git a/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8068-ecw5410.dts b/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8068-ecw5410.dts index 6d216bd85e..9d6afa1c8a 100644 --- a/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8068-ecw5410.dts +++ b/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8068-ecw5410.dts @@ -8,10 +8,6 @@ compatible = "edgecore,ecw5410", "qcom,ipq8064"; reserved-memory { - #address-cells = <1>; - #size-cells = <1>; - ranges; - nss@40000000 { reg = <0x40000000 0x1000000>; no-map; @@ -26,11 +22,6 @@ reg = <0x44000000 0x600000>; no-map; }; - - rsvd@41200000 { - reg = <0x41200000 0x300000>; - no-map; - }; }; cpus { @@ -42,21 +33,19 @@ }; aliases { - serial0 = &gsbi4_serial; serial1 = &gsbi1_serial; mdio-gpio0 = &mdio0; ethernet0 = &gmac3; ethernet1 = &gmac2; - led-boot = &power_green; - led-failsafe = &power_red; - led-running = &power_green; - led-upgrade = &power_green; + led-boot = &led_power_green; + led-failsafe = &led_power_red; + led-running = &led_power_green; + led-upgrade = &led_power_green; }; chosen { bootargs-append = " console=ttyMSM0,115200n8 root=/dev/ubiblock0_1"; - stdout-path = "serial0:115200n8"; }; keys { @@ -76,7 +65,7 @@ pinctrl-0 = <&led_pins>; pinctrl-names = "default"; - power_green: power_green { + led_power_green: power_green { label = "ecw5410:green:power"; gpios = <&qcom_pinmux 16 GPIO_ACTIVE_HIGH>; }; @@ -96,7 +85,7 @@ gpios = <&qcom_pinmux 26 GPIO_ACTIVE_LOW>; }; - power_red: power_red { + led_power_red: power_red { label = "ecw5410:red:power"; gpios = <&qcom_pinmux 28 GPIO_ACTIVE_LOW>; }; @@ -133,40 +122,6 @@ }; }; - nand_pins: nand_pins { - disable { - pins = "gpio34", "gpio35", "gpio36", "gpio37", - "gpio38"; - function = "nand"; - drive-strength = <10>; - bias-disable; - }; - - pullups { - pins = "gpio39"; - function = "nand"; - drive-strength = <10>; - bias-pull-up; - }; - - hold { - pins = "gpio40", "gpio41", "gpio42", "gpio43", - "gpio44", "gpio45", "gpio46", "gpio47"; - function = "nand"; - drive-strength = <10>; - bias-bus-hold; - }; - }; - - mdio0_pins: mdio0_pins { - mux { - pins = "gpio0", "gpio1"; - function = "gpio"; - drive-strength = <8>; - bias-disable; - }; - }; - led_pins: led_pins { mux { pins = "gpio16", "gpio23", "gpio24", "gpio26", @@ -208,22 +163,6 @@ }; }; -&gsbi4 { - qcom,mode = ; - status = "okay"; - - serial@16340000 { - status = "okay"; - }; - - /* - * The i2c device on gsbi4 should not be enabled. - * On ipq806x designs gsbi4 i2c is meant for exclusive - * RPM usage. Turning this on in kernel manifests as - * i2c failure for the RPM. - */ -}; - &gsbi5 { qcom,mode = ; status = "okay"; diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile index 3b86760a19..ec73630ae5 100644 --- a/target/linux/ipq806x/image/Makefile +++ b/target/linux/ipq806x/image/Makefile @@ -109,6 +109,19 @@ define Device/compex_wpq864 endef TARGET_DEVICES += compex_wpq864 +define Device/edgecore_ecw5410 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Edgecore + DEVICE_MODEL := ECW5410 + SOC := qcom-ipq8068 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_DTS_CONFIG := config@v2.0-ap160 + DEVICE_PACKAGES := ath10k-firmware-qca9984-ct ipq-wifi-edgecore_ecw5410 +endef +TARGET_DEVICES += edgecore_ecw5410 + define Device/linksys_ea7500-v1 $(call Device/LegacyImage) DEVICE_VENDOR := Linksys @@ -126,18 +139,6 @@ define Device/linksys_ea7500-v1 endef TARGET_DEVICES += linksys_ea7500-v1 -define Device/edgecore_ecw5410 - $(call Device/FitImage) - $(call Device/UbiFit) - DEVICE_TITLE := Edgecore ECW5410 - BLOCKSIZE := 128k - PAGESIZE := 2048 - DEVICE_DTS := qcom-ipq8068-ecw5410 - DEVICE_DTS_CONFIG := config@v2.0-ap160 - DEVICE_PACKAGES := ath10k-firmware-qca9984-ct ipq-wifi-edgecore_ecw5410 -endef -TARGET_DEVICES += edgecore_ecw5410 - define Device/linksys_ea8500 $(call Device/LegacyImage) DEVICE_VENDOR := Linksys diff --git a/target/linux/mediatek/image/gen_mtk_mmc_img.sh b/target/linux/mediatek/image/gen_mtk_mmc_img.sh index ea8a9c63a1..2dacb9019d 100755 --- a/target/linux/mediatek/image/gen_mtk_mmc_img.sh +++ b/target/linux/mediatek/image/gen_mtk_mmc_img.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Copyright © 2019 Alexey Loukianov # Copyright © 2020 David Woodhouse diff --git a/target/linux/mediatek/patches-5.4/0700-arm-dts-mt7623-add-missing-pause-for-switchport.patch b/target/linux/mediatek/patches-5.4/0700-arm-dts-mt7623-add-missing-pause-for-switchport.patch new file mode 100644 index 0000000000..35277f0ddd --- /dev/null +++ b/target/linux/mediatek/patches-5.4/0700-arm-dts-mt7623-add-missing-pause-for-switchport.patch @@ -0,0 +1,27 @@ +From: Frank Wunderlich +Date: Mon, 7 Sep 2020 09:05:17 +0200 + +port6 of mt7530 switch (= cpu port 0) on bananapi-r2 misses pause option +which causes rx drops on running iperf. + +Cc: stable@vger.kernel.org +Fixes: f4ff257cd160 ("arm: dts: mt7623: add support for Bananapi R2 (BPI-R2) board") +Signed-off-by: Frank Wunderlich +--- + arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts b/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts +index 2b760f90f38c..5375c6699843 100644 +--- a/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts ++++ b/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts +@@ -192,6 +192,7 @@ port@6 { + fixed-link { + speed = <1000>; + full-duplex; ++ pause; + }; + }; + }; +-- +2.25.1