diff --git a/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch b/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch index eea561fab8..09dc587bf7 100644 --- a/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch +++ b/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch @@ -505,7 +505,7 @@ NOTE: this patch is ready for upstream, LEDE-specific parts are in +#endif /* __NSA310_H */ --- /dev/null +++ b/configs/nsa310_defconfig -@@ -0,0 +1,50 @@ +@@ -0,0 +1,48 @@ +CONFIG_ARM=y +CONFIG_SYS_DCACHE_OFF=y +CONFIG_ARCH_CPU_INIT=y @@ -554,8 +554,6 @@ NOTE: this patch is ready for upstream, LEDE-specific parts are in +CONFIG_LZMA=y +CONFIG_LZO=y +CONFIG_SYS_LONGHELP=y -+CONFIG_SATA_MV=y -+CONFIG_CMD_IDE=y --- /dev/null +++ b/include/configs/nsa310.h @@ -0,0 +1,103 @@ diff --git a/package/lean/mt-drivers/mt_wifi/config.in b/package/lean/mt-drivers/mt_wifi/config.in index 498884be05..fe7490e7fa 100644 --- a/package/lean/mt-drivers/mt_wifi/config.in +++ b/package/lean/mt-drivers/mt_wifi/config.in @@ -284,6 +284,7 @@ config MTK_DEFAULT_5G_PROFILE bool "5G default profile for DBDC" depends on MTK_DBDC_MODE # depends on MTK_MULTI_PROFILE_SUPPORT + default y if TARGET_ramips_mt7621_DEVICE_phicomm_k2p default n config MTK_WSC_INCLUDED diff --git a/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts b/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts new file mode 100644 index 0000000000..343a02e38a --- /dev/null +++ b/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts @@ -0,0 +1,141 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca953x.dtsi" + +/ { + compatible = "compex,wpj531-16m", "qca,qca9531"; + model = "Compex WPJ531 (16MB flash)"; + + aliases { + label-mac-device = ð0; + led-boot = &led_sig4; + led-failsafe = &led_sig4; + led-running = &led_sig4; + led-upgrade = &led_sig4; + }; + + beeper { + compatible = "gpio-beeper"; + gpios = <&gpio 4 GPIO_ACTIVE_HIGH>; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinmux_led_eth_pins>; + + sig1 { + label = "wpj531:red:sig1"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + sig2 { + label = "wpj531:yellow:sig2"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + sig3 { + label = "wpj531:green:sig3"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + led_sig4: sig4 { + label = "wpj531:green:sig4"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&pinmux { + pinmux_led_eth_pins: pinmux_led_eth_pins { + pinctrl-single,bits = <0x8 0x2b000000 0xff000000>, <0xc 0x00002d00 0x0000ff00>; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x000000 0x030000>; + read-only; + }; + + partition@30000 { + label = "firmware"; + reg = <0x030000 0xfc0000>; + compatible = "denx,uimage"; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +ð1 { + mtd-mac-address = <&uboot 0x2e018>; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy4>; + + mtd-mac-address = <&uboot 0x2e010>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; + +&pcie0 { + status = "okay"; + + wifi@0,0 { + compatible = "pci168c,003c"; + reg = <0x0000 0 0 0 0>; + }; +}; + +&usb_phy { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index 398c9ed495..aaa830c6ea 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -115,6 +115,13 @@ engenius,ecb1750|\ enterasys,ws-ap3705i) ucidef_set_led_netdev "lan" "LAN" "$boardname:blue:lan" "eth0" ;; +compex,wpj531-16m) + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "sig1" "SIG1" "wpj531:red:sig1" "wlan0" "85" "100" + ucidef_set_led_rssi "sig2" "SIG2" "wpj531:yellow:sig2" "wlan0" "75" "100" + ucidef_set_led_rssi "sig3" "SIG3" "wpj531:green:sig3" "wlan0" "65" "100" + ucidef_set_led_rssi "sig4" "SIG4" "wpj531:green:sig4" "wlan0" "50" "100" + ;; devolo,magic-2-wifi) ucidef_set_led_netdev "plcw" "dLAN" "devolo:white:dlan" "eth0.1" "rx" ;; 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 4b74565aa3..d0e73a5d3f 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -108,6 +108,7 @@ ath79_setup_interfaces() comfast,cf-e110n-v2|\ comfast,cf-e120a-v3|\ comfast,cf-e314n-v2|\ + compex,wpj531-16m|\ tplink,cpe210-v1|\ tplink,cpe220-v2|\ tplink,cpe220-v3|\ diff --git a/target/linux/ath79/image/common-tp-link.mk b/target/linux/ath79/image/common-tp-link.mk index 81a557df48..0b7b0e1935 100644 --- a/target/linux/ath79/image/common-tp-link.mk +++ b/target/linux/ath79/image/common-tp-link.mk @@ -1,14 +1,6 @@ DEVICE_VARS += TPLINK_HWID TPLINK_HWREV TPLINK_FLASHLAYOUT TPLINK_HEADER_VERSION DEVICE_VARS += TPLINK_BOARD_ID TPLINK_HWREVADD TPLINK_HVERSION -define Build/uImageArcher - mkimage -A $(LINUX_KARCH) \ - -O linux -T kernel -C $(1) -a $(KERNEL_LOADADDR) \ - -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ - -n '$(call toupper,$(LINUX_KARCH)) OpenWrt Linux-$(LINUX_VERSION)' -d $@ $@.new - @mv $@.new $@ -endef - define Device/tplink-v1 DEVICE_VENDOR := TP-Link TPLINK_HWID := 0x0 @@ -48,12 +40,14 @@ define Device/tplink-4m $(Device/tplink-nolzma) TPLINK_FLASHLAYOUT := 4M IMAGE_SIZE := 3904k + DEFAULT := n endef define Device/tplink-4mlzma $(Device/tplink-v1) TPLINK_FLASHLAYOUT := 4Mlzma IMAGE_SIZE := 3904k + DEFAULT := n endef define Device/tplink-8m @@ -86,7 +80,7 @@ endef define Device/tplink-safeloader-uimage $(Device/tplink-safeloader) - KERNEL := kernel-bin | append-dtb | lzma | uImageArcher lzma + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma KERNEL_INITRAMFS := $$(KERNEL) endef diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 9f296adaa7..f99fcdeda2 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -50,6 +50,29 @@ define Build/cybertan-trx -rm $@-empty.bin endef +define Build/mkmylofw_16m + $(eval device_id=$(word 1,$(1))) + $(eval revision=$(word 2,$(1))) + + # On WPJ344, WPJ531, and WPJ563, the default boot command tries 0x9f680000 + # first and fails if the remains of the stock image are sill there + # - resulting in an infinite boot loop. + # The size parameter is grown to have that block deleted if the firmware + # isn't big enough by itself. + + let \ + size="$$(stat -c%s $@)" \ + pad="$(subst k,* 1024,$(BLOCKSIZE))" \ + pad="(pad - (size % pad)) % pad" \ + newsize='size + pad' ; \ + [ $$newsize -lt $$((0x660000)) ] && newsize=0x660000 ; \ + $(STAGING_DIR_HOST)/bin/mkmylofw \ + -B WPE72 -i 0x11f6:$(device_id):0x11f6:$(device_id) -r $(revision) \ + -s 0x1000000 -p0x30000:$$newsize:al:0x80060000:"OpenWRT":$@ \ + $@.new + @mv $@.new $@ +endef + define Build/mkwrggimg $(STAGING_DIR_HOST)/bin/mkwrggimg -b \ -i $@ -o $@.imghdr -d /dev/mtdblock/1 \ @@ -418,6 +441,22 @@ define Device/comfast_cf-wr752ac-v1 endef TARGET_DEVICES += comfast_cf-wr752ac-v1 +define Device/compex_wpj531-16m + SOC := qca9531 + DEVICE_PACKAGES := kmod-usb2 + IMAGE_SIZE := 16128k + DEVICE_VENDOR := Compex + DEVICE_MODEL := WPJ531 + DEVICE_VARIANT := 16M + SUPPORTED_DEVICES += wpj531 + IMAGES += cpximg-7a03.bin cpximg-7a04.bin cpximg-7a06.bin cpximg-7a07.bin + IMAGE/cpximg-7a03.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | mkmylofw_16m 0x68a 2 + IMAGE/cpximg-7a04.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | mkmylofw_16m 0x693 3 + IMAGE/cpximg-7a06.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | mkmylofw_16m 0x693 3 + IMAGE/cpximg-7a07.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | mkmylofw_16m 0x693 3 +endef +TARGET_DEVICES += compex_wpj531-16m + define Device/devolo_dvl1200e SOC := qca9558 DEVICE_VENDOR := devolo diff --git a/target/linux/ath79/image/tiny-tp-link.mk b/target/linux/ath79/image/tiny-tp-link.mk index 4926084597..0da712c5d4 100644 --- a/target/linux/ath79/image/tiny-tp-link.mk +++ b/target/linux/ath79/image/tiny-tp-link.mk @@ -157,6 +157,7 @@ define Device/tplink_tl-wa850re-v2 TPLINK_HWID := 0x08500002 DEVICE_PACKAGES := rssileds SUPPORTED_DEVICES += tl-wa850re-v2 + DEFAULT := n endef TARGET_DEVICES += tplink_tl-wa850re-v2 diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile index 12da3a7b5e..7fedc6ccd3 100644 --- a/target/linux/ipq40xx/image/Makefile +++ b/target/linux/ipq40xx/image/Makefile @@ -13,6 +13,7 @@ define Device/Default KERNEL_LOADADDR := 0x80208000 DEVICE_DTS = $$(SOC)-$(lastword $(subst _, ,$(1))) SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) + IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin = sysupgrade-tar | append-metadata IMAGE/sysupgrade.bin/squashfs := endef @@ -46,7 +47,7 @@ define Device/DniImage $(call Device/FitzImage) NETGEAR_BOARD_ID := NETGEAR_HW_ID := - IMAGES := factory.img sysupgrade.bin + IMAGES += factory.img IMAGE/factory.img := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | append-rootfs | pad-rootfs | netgear-dni IMAGE/sysupgrade.bin := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | \ append-rootfs | pad-rootfs | append-metadata | check-size @@ -110,7 +111,6 @@ define Device/8dev_habanero-dvk IMAGE_SIZE := 30976k SOC := qcom-ipq4019 DEVICE_PACKAGES := ipq-wifi-8dev_habanero-dvk - IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | append-rootfs | pad-rootfs | append-metadata | check-size endef TARGET_DEVICES += 8dev_habanero-dvk @@ -151,7 +151,6 @@ define Device/aruba_glenmorangie DEVICE_VENDOR := Aruba SOC := qcom-ipq4029 DEVICE_PACKAGES := ipq-wifi-aruba_ap-303 - IMAGES := sysupgrade.bin endef define Device/aruba_ap-303 @@ -178,7 +177,6 @@ define Device/asus_map-ac2200 DEVICE_VENDOR := ASUS DEVICE_MODEL := Lyra (MAP-AC2200) SOC := qcom-ipq4019 - IMAGES := sysupgrade.bin DEVICE_PACKAGES := ath10k-firmware-qca9888-ct kmod-ath3k endef TARGET_DEVICES += asus_map-ac2200 @@ -199,7 +197,6 @@ define Device/asus_rt-ac58u # to add a version... or we are very careful not to add '\0' into that # string and call it a day.... Yeah, we do the latter! UIMAGE_NAME:=$(shell echo -e '\03\01\01\01RT-AC58U') - IMAGES := sysupgrade.bin DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers \ kmod-usb-ledtrig-usbport endef @@ -214,7 +211,7 @@ define Device/avm_fritzbox-4040 IMAGE_SIZE := 29056k UBOOT_PATH := $(STAGING_DIR_IMAGE)/uboot-fritz4040.bin UBOOT_PARTITION_SIZE := 524288 - IMAGES = eva.bin sysupgrade.bin + IMAGES += eva.bin IMAGE/eva.bin := append-uboot | pad-to $$$$(UBOOT_PARTITION_SIZE) | append-kernel | append-rootfs | pad-rootfs IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size DEVICE_PACKAGES := fritz-tffs fritz-caldata @@ -227,7 +224,6 @@ define Device/avm_fritzbox-7530 DEVICE_MODEL := FRITZ!Box 7530 SOC := qcom-ipq4019 DEVICE_PACKAGES := fritz-caldata fritz-tffs-nand - IMAGES := sysupgrade.bin endef TARGET_DEVICES += avm_fritzbox-7530 @@ -237,7 +233,6 @@ define Device/avm_fritzrepeater-1200 DEVICE_MODEL := FRITZ!Repeater 1200 SOC := qcom-ipq4019 DEVICE_PACKAGES := fritz-caldata fritz-tffs-nand ipq-wifi-avm_fritzrepeater-1200 - IMAGES := sysupgrade.bin endef TARGET_DEVICES += avm_fritzrepeater-1200 @@ -247,7 +242,6 @@ define Device/avm_fritzrepeater-3000 DEVICE_MODEL := FRITZ!Repeater 3000 SOC := qcom-ipq4019 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct fritz-caldata fritz-tffs-nand - IMAGES := sysupgrade.bin endef TARGET_DEVICES += avm_fritzrepeater-3000 @@ -304,7 +298,7 @@ define Device/compex_wpj428 BLOCKSIZE := 64k IMAGE_SIZE := 31232k KERNEL_SIZE := 4096k - IMAGES = sysupgrade.bin cpximg-6a04.bin + IMAGES += cpximg-6a04.bin IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata IMAGE/cpximg-6a04.bin := append-kernel | append-rootfs | pad-rootfs | mkmylofw_32m 0x8A2 3 DEVICE_PACKAGES := kmod-gpio-beeper @@ -321,7 +315,7 @@ define Device/dlink_dap-2610 WRGG_DEVNAME := /dev/mtdblock/8 WRGG_SIGNATURE := wapac30_dkbs_dap2610 IMAGE_SIZE := 14080k - IMAGES := sysupgrade.bin factory.bin + IMAGES += factory.bin # Bootloader expects a special 160 byte header which is added by # wrgg-image. # Factory image size must be larger than 6MB, and size in wrgg header must @@ -347,7 +341,6 @@ define Device/engenius_eap1300 SOC := qcom-ipq4018 KERNEL_SIZE := 5120k IMAGE_SIZE := 25344k - IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata endef TARGET_DEVICES += engenius_eap1300 @@ -371,7 +364,7 @@ define Device/engenius_emd1 DEVICE_DTS_CONFIG := config@4 SOC := qcom-ipq4018 IMAGE_SIZE := 30720k - IMAGES := sysupgrade.bin factory.bin + IMAGES += factory.bin IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata IMAGE/factory.bin := qsdk-ipq-factory-nor | check-size endef @@ -385,7 +378,7 @@ define Device/engenius_emr3500 SOC := qcom-ipq4018 KERNEL_SIZE := 4096k IMAGE_SIZE := 30720k - IMAGES := sysupgrade.bin factory.bin + IMAGES += factory.bin IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata IMAGE/factory.bin := qsdk-ipq-factory-nor | check-size endef @@ -410,7 +403,7 @@ define Device/engenius_ens620ext IMAGE_SIZE := 21312k KERNEL_SIZE := 5120k FILESYSTEMS := squashfs - IMAGES := sysupgrade.bin factory_30.bin factory_35.bin + IMAGES += factory_30.bin factory_35.bin IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size | append-metadata IMAGE/factory_30.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size | SenaoFW $$$$(PRODUCT_ID) $$$$(FW_VER) IMAGE/factory_35.bin := qsdk-ipq-factory-nor | check-size | SenaoFW $$$$(PRODUCT_ID_NEW) $$$$(FW_VER_NEW) @@ -425,7 +418,6 @@ define Device/ezviz_cs-w3-wd1200g-eup DEVICE_DTS_CONFIG := config@4 IMAGE_SIZE := 14848k SOC := qcom-ipq4018 - IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \ append-metadata DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers \ @@ -441,7 +433,6 @@ define Device/glinet_gl-b1300 SOC := qcom-ipq4029 KERNEL_SIZE := 4096k IMAGE_SIZE := 26624k - IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin := append-kernel |append-rootfs | pad-rootfs | append-metadata endef TARGET_DEVICES += glinet_gl-b1300 @@ -477,7 +468,7 @@ define Device/linksys_ea6350v3 KERNEL_SIZE := 3072k IMAGE_SIZE := 37888k UBINIZE_OPTS := -E 5 - IMAGES := factory.bin sysupgrade.bin + IMAGES += factory.bin IMAGE/factory.bin := append-kernel | append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=EA6350v3 DEVICE_PACKAGES := uboot-envtools endef @@ -493,7 +484,7 @@ define Device/linksys_ea8300 BLOCKSIZE := 128k PAGESIZE := 2048 UBINIZE_OPTS := -E 5 # EOD marks to "hide" factory sig at EOF - IMAGES := sysupgrade.bin factory.bin + IMAGES += factory.bin IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=EA8300 DEVICE_PACKAGES := uboot-envtools ath10k-firmware-qca9888-ct ipq-wifi-linksys_ea8300 kmod-usb-ledtrig-usbport endef @@ -506,7 +497,6 @@ define Device/meraki_mr33 SOC := qcom-ipq4029 BLOCKSIZE := 128k PAGESIZE := 2048 - IMAGES = sysupgrade.bin DEVICE_PACKAGES := -swconfig ath10k-firmware-qca9887-ct endef TARGET_DEVICES += meraki_mr33 @@ -557,7 +547,7 @@ define Device/openmesh_a42 BLOCKSIZE := 64k KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE) IMAGE_SIZE := 15616k - IMAGES = factory.bin sysupgrade.bin + IMAGES += factory.bin IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A42 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata DEVICE_PACKAGES := uboot-envtools @@ -573,7 +563,7 @@ define Device/openmesh_a62 BLOCKSIZE := 64k KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE) IMAGE_SIZE := 15552k - IMAGES = factory.bin sysupgrade.bin + IMAGES += factory.bin IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A62 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata DEVICE_PACKAGES := ath10k-firmware-qca9888-ct uboot-envtools @@ -620,7 +610,6 @@ define Device/qcom_ap-dk01.1-c1 KERNEL_SIZE := 4096k IMAGE_SIZE := 26624k $(call Device/FitImage) - IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | append-metadata endef TARGET_DEVICES += qcom_ap-dk01.1-c1 @@ -650,7 +639,6 @@ define Device/qxwlan_e2600ac-c1 SOC := qcom-ipq4019 KERNEL_SIZE := 4096k IMAGE_SIZE := 31232k - IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata DEVICE_PACKAGES := ipq-wifi-qxwlan_e2600ac endef @@ -679,7 +667,6 @@ define Device/unielec_u4019-32m SOC := qcom-ipq4019 KERNEL_SIZE := 4096k IMAGE_SIZE := 31232k - IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata endef TARGET_DEVICES += unielec_u4019-32m @@ -695,7 +682,7 @@ define Device/zyxel_nbg6617 RAS_ROOTFS_SIZE := 19840k RAS_VERSION := "$(VERSION_DIST) $(REVISION)" IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata - IMAGES := sysupgrade.bin factory.bin + IMAGES += factory.bin # The ZyXEL firmware allows flashing thru the web-gui only when the rootfs is # at least as large as the one of the initial firmware image (not the current # one on the device). This only applies to the Web-UI, the bootlaoder ignores @@ -713,7 +700,6 @@ define Device/zyxel_wre6606 DEVICE_DTS_CONFIG := config@4 SOC := qcom-ipq4018 IMAGE_SIZE := 13184k - IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers endef diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile index 6ea66d064d..578303e9e0 100644 --- a/target/linux/ipq806x/image/Makefile +++ b/target/linux/ipq806x/image/Makefile @@ -21,6 +21,7 @@ define Device/Default KERNEL_LOADADDR = 0x42208000 DEVICE_DTS = $$(SOC)-$(lastword $(subst _, ,$(1))) SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) + IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin = sysupgrade-tar | append-metadata IMAGE/sysupgrade.bin/squashfs := endef @@ -57,7 +58,7 @@ define Device/DniImage NETGEAR_BOARD_ID := NETGEAR_HW_ID := UBINIZE_OPTS := -E 5 - IMAGES := factory.img sysupgrade.bin + IMAGES += factory.img IMAGE/factory.img := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | append-ubi | netgear-dni IMAGE/sysupgrade.bin := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-uImage-fakehdr filesystem | sysupgrade-tar kernel=$$$$@ | append-metadata endef @@ -67,7 +68,7 @@ define Device/TpSafeImage KERNEL = kernel-bin | append-dtb | uImage none KERNEL_NAME := zImage TPLINK_BOARD_ID := - IMAGES := factory.bin sysupgrade.bin + IMAGES += factory.bin IMAGE/factory.bin := append-rootfs | tplink-safeloader factory IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | append-metadata endef @@ -76,7 +77,7 @@ define Device/ZyXELImage KERNEL_SUFFIX := -uImage KERNEL = kernel-bin | append-dtb | uImage none | pad-to $$(KERNEL_SIZE) KERNEL_NAME := zImage - IMAGES := factory.bin sysupgrade.bin + IMAGES += factory.bin IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to $$$$(BLOCKSIZE) | zyxel-ras-image separate-kernel IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to $$$$(BLOCKSIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata endef @@ -90,7 +91,6 @@ define Device/buffalo_wxr-2533dhp PAGESIZE := 2048 IMAGE_SIZE := 65536k KERNEL_IN_UBI := 1 - IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin := append-rootfs | buffalo-rootfs-cksum | \ sysupgrade-tar rootfs=$$$$@ | append-metadata DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct @@ -121,7 +121,7 @@ define Device/linksys_ea8500 BOARD_NAME := ea8500 SUPPORTED_DEVICES += ea8500 UBINIZE_OPTS := -E 5 - IMAGES := factory.bin sysupgrade.bin + IMAGES += factory.bin IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct endef @@ -134,7 +134,6 @@ define Device/nec_wg2600hp SOC := qcom-ipq8064 BLOCKSIZE := 64k BOARD_NAME := wg2600hp - IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct endef @@ -295,7 +294,6 @@ define Device/tplink_vr2600v BOARD_NAME := vr2600v SUPPORTED_DEVICES += vr2600v DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct - IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin := pad-extra 512 | append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | append-metadata endef TARGET_DEVICES += tplink_vr2600v diff --git a/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network b/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network index 44188c5fa7..9718b332a7 100755 --- a/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network +++ b/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network @@ -30,7 +30,6 @@ mvebu_setup_interfaces() marvell,axp-gp) ucidef_set_interface_lan "eth0 eth1 eth2 eth3" ;; - solidrun,clearfog-a1|\ solidrun,clearfog-pro-a1) # eth0 is standalone ethernet # eth1 is switch diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile index cbf34c1bc8..502e081ec3 100644 --- a/target/linux/mvebu/image/Makefile +++ b/target/linux/mvebu/image/Makefile @@ -104,7 +104,6 @@ define Device/Default KERNEL_NAME := zImage KERNEL := kernel-bin | append-dtb | uImage none IMAGES := sysupgrade.bin - IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | pad-to $$$$(PAGESIZE) IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata SUPPORTED_DEVICES = $(subst _,$(comma),$(1)) UBINIZE_OPTS := -E 5 diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk index bb09d2b6f7..f01a76a9d3 100644 --- a/target/linux/mvebu/image/cortexa9.mk +++ b/target/linux/mvebu/image/cortexa9.mk @@ -55,6 +55,8 @@ define Device/linksys DEVICE_VENDOR := Linksys DEVICE_PACKAGES := kmod-mwlwifi wpad-basic IMAGES += factory.img + IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | \ + append-ubi | pad-to $$$$(PAGESIZE) KERNEL_SIZE := 6144k endef @@ -151,6 +153,8 @@ define Device/marvell_a385-db-ap DEVICE_MODEL := Armada 385 Development Board AP (DB-88F6820-AP) DEVICE_DTS := armada-385-db-ap IMAGES += factory.img + IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | \ + append-ubi | pad-to $$$$(PAGESIZE) KERNEL_SIZE := 8192k SUPPORTED_DEVICES += armada-385-db-ap endef diff --git a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn577a2.dts b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn577a2.dts new file mode 100644 index 0000000000..41dfec3275 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn577a2.dts @@ -0,0 +1,137 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "mt7628an.dtsi" + +/ { + compatible = "wavlink,wl-wn577a2", "maginon,wlr-755", "mediatek,mt7628an-soc"; + model = "WAVLINK WL-WN577A2"; + + aliases { + led-boot = &led_wps; + led-failsafe = &led_wps; + led-running = &led_wps; + led-upgrade = &led_wps; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 43 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 38 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + lan { + label = "wl-wn577a2:green:lan"; + gpios = <&gpio 40 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "wl-wn577a2:green:wan"; + gpios = <&gpio 39 GPIO_ACTIVE_LOW>; + }; + + led_wps: wps { + label = "wl-wn577a2:green:wps"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "wdt", "p0led_an", "p3led_an", "p4led_an"; + function = "gpio"; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + mt76@0,0 { + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&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 = "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 0x7b0000>; + }; + }; + }; +}; + +&wmac { + status = "okay"; +}; + +ðernet { + mtd-mac-address = <&factory 0x28>; +}; + +&esw { + mediatek,portmap = <0x2f>; +}; + +&usbphy { + status = "disabled"; +}; + +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index a18afefd74..605537ace3 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -556,6 +556,16 @@ define Device/wavlink_wl-wn575a3 endef TARGET_DEVICES += wavlink_wl-wn575a3 +define Device/wavlink_wl-wn577a2 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Wavlink + DEVICE_MODEL := WL-WN577A2 + DEVICE_ALT0_VENDOR := Maginon + DEVICE_ALT0_MODEL := WLR-755 + DEVICE_PACKAGES := kmod-mt76x0e +endef +TARGET_DEVICES += wavlink_wl-wn577a2 + define Device/widora_neo-16m IMAGE_SIZE := 16064k DEVICE_VENDOR := Widora diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds index fc582becb9..9db39cbdde 100755 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds @@ -122,6 +122,10 @@ wavlink,wl-wn575a3) ucidef_set_led_rssi "wifi-med" "wifi-med" "$boardname:green:wifi-med" "wlan1" "50" "84" ucidef_set_led_rssi "wifi-high" "wifi-high" "$boardname:green:wifi-high" "wlan1" "85" "100" ;; +wavlink,wl-wn577a2) + ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x8" + ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10" + ;; zbtlink,zbt-we1226) set_wifi_led "$boardname:green:wlan" ucidef_set_led_switch "lan1" "LAN1" "$boardname:green:lan1" "switch0" "0x01" 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 2b4ca0926f..1cccc16415 100755 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -38,7 +38,8 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0" ;; - buffalo,wcr-1166ds) + buffalo,wcr-1166ds|\ + wavlink,wl-wn577a2) ucidef_add_switch "switch0" \ "3:lan" "4:wan" "6@eth0" ;; @@ -186,6 +187,10 @@ ramips_setup_macs() wiznet,wizfi630s) wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x28)" 1) ;; + wavlink,wl-wn577a2) + wan_mac=$(mtd_get_mac_binary factory 0x2e) + label_mac=$(mtd_get_mac_binary factory 0x4) + ;; skylab,skw92a|\ totolink,lr1200) wan_mac=$(mtd_get_mac_binary factory 0x2e) diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index 561d6d868f..3dd9ac5c2c 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -23,77 +23,77 @@ endef define Host/Compile mkdir -p $(HOST_BUILD_DIR)/bin + $(call cc,add_header) $(call cc,addpattern) $(call cc,asustrx) - $(call cc,lxlfw) - $(call cc,trx) - $(call cc,otrx) - $(call cc,motorola-bin) + $(call cc,buffalo-enc buffalo-lib,-Wall) + $(call cc,buffalo-tag buffalo-lib,-Wall) + $(call cc,buffalo-tftp buffalo-lib,-Wall) $(call cc,dgfirmware) - $(call cc,mksenaofw md5, -Wall --std=gnu99) - $(call cc,trx2usr) - $(call cc,ptgen cyg_crc32) - $(call cc,srec2bin) - $(call cc,mkmylofw) - $(call cc,mkcsysimg) - $(call cc,mkzynfw) - $(call cc,lzma2eva,-lz) - $(call cc,mkcasfw) - $(call cc,mkfwimage,-lz -Wall -Werror -Wextra -D_FILE_OFFSET_BITS=64) - $(call cc,mkfwimage2,-lz) - $(call cc,imagetag imagetag_cmdline cyg_crc32) - $(call cc,add_header) - $(call cc,makeamitbin) + $(call cc,dgn3500sum,-Wall) + $(call cc,dns313-header,-Wall) + $(call cc,edimax_fw_header,-Wall) $(call cc,encode_crc) - $(call cc,nand_ecc) - $(call cc,mkplanexfw sha1) - $(call cc,mktplinkfw mktplinkfw-lib md5, -Wall -fgnu89-inline) - $(call cc,mktplinkfw2 mktplinkfw-lib md5, -fgnu89-inline) - $(call cc,tplink-safeloader md5, -Wall --std=gnu99) - $(call cc,pc1crypt) - $(call cc,osbridge-crc) - $(call cc,wrt400n cyg_crc32) - $(call cc,mkdniimg) - $(call cc,mktitanimg) - $(call cc,mkchkimg) - $(call cc,mkzcfw cyg_crc32) - $(call cc,spw303v) - $(call cc,zyxbcm) - $(call cc,trx2edips) - $(call cc,xorimage) - $(call cc,buffalo-enc buffalo-lib, -Wall) - $(call cc,buffalo-tag buffalo-lib, -Wall) - $(call cc,buffalo-tftp buffalo-lib, -Wall) - $(call cc,mkwrgimg md5, -Wall) - $(call cc,mkwrggimg md5, -Wall) - $(call cc,mkedimaximg) - $(call cc,mkbrncmdline) - $(call cc,mkbrnimg) - $(call cc,mkdapimg) - $(call cc,mkdapimg2) - $(call cc, mkcameofw, -Wall) - $(call cc,seama md5) - $(call cc,oseama md5, -Wall) $(call cc,fix-u-media-header cyg_crc32,-Wall) $(call cc,hcsmakeimage bcmalgo) - $(call cc,mkporayfw, -Wall) - $(call cc,mkrasimage, --std=gnu99) - $(call cc,mkhilinkfw, -lcrypto) + $(call cc,imagetag imagetag_cmdline cyg_crc32) + $(call cc,jcgimage,-lz -Wall) + $(call cc,lxlfw) + $(call cc,lzma2eva,-lz) + $(call cc,makeamitbin) + $(call cc,mkbrncmdline) + $(call cc,mkbrnimg) + $(call cc,mkbuffaloimg,-Wall) + $(call cc,mkcameofw,-Wall) + $(call cc,mkcasfw) + $(call cc,mkchkimg) + $(call cc,mkcsysimg) + $(call cc,mkdapimg) + $(call cc,mkdapimg2) + $(call cc,mkdhpimg buffalo-lib,-Wall) + $(call cc,mkdlinkfw mkdlinkfw-lib,-lz -Wall --std=c99) + $(call cc,mkdniimg) + $(call cc,mkedimaximg) + $(call cc,mkfwimage,-lz -Wall -Werror -Wextra -D_FILE_OFFSET_BITS=64) + $(call cc,mkfwimage2,-lz) $(call cc,mkheader_gemtek,-lz) - $(call cc,mkrtn56uimg, -lz) - $(call cc,dgn3500sum, -Wall) - $(call cc,edimax_fw_header, -Wall) - $(call cc,mkmerakifw sha1, -Wall) - $(call cc,mkmerakifw-old, -Wall) - $(call cc,jcgimage, -lz -Wall) - $(call cc,mkbuffaloimg, -Wall) - $(call cc,zyimage, -Wall) - $(call cc,mkdhpimg buffalo-lib, -Wall) - $(call cc,mkdlinkfw mkdlinkfw-lib, -lz -Wall --std=c99) - $(call cc,dns313-header, -Wall) - $(call cc,mksercommfw, -Wall) - $(call cc,nec-enc, -Wall --std=gnu99) - $(call cc,uimage_padhdr, -Wall -lz) + $(call cc,mkhilinkfw,-lcrypto) + $(call cc,mkmerakifw sha1,-Wall) + $(call cc,mkmerakifw-old,-Wall) + $(call cc,mkmylofw) + $(call cc,mkplanexfw sha1) + $(call cc,mkporayfw,-Wall) + $(call cc,mkrasimage,--std=gnu99) + $(call cc,mkrtn56uimg,-lz) + $(call cc,mksenaofw md5,-Wall --std=gnu99) + $(call cc,mksercommfw,-Wall) + $(call cc,mktitanimg) + $(call cc,mktplinkfw mktplinkfw-lib md5,-Wall -fgnu89-inline) + $(call cc,mktplinkfw2 mktplinkfw-lib md5,-fgnu89-inline) + $(call cc,mkwrggimg md5,-Wall) + $(call cc,mkwrgimg md5,-Wall) + $(call cc,mkzcfw cyg_crc32) + $(call cc,mkzynfw) + $(call cc,motorola-bin) + $(call cc,nand_ecc) + $(call cc,nec-enc,-Wall --std=gnu99) + $(call cc,osbridge-crc) + $(call cc,oseama md5,-Wall) + $(call cc,otrx) + $(call cc,pc1crypt) + $(call cc,ptgen cyg_crc32) + $(call cc,seama md5) + $(call cc,spw303v) + $(call cc,srec2bin) + $(call cc,tplink-safeloader md5,-Wall --std=gnu99) + $(call cc,trx) + $(call cc,trx2edips) + $(call cc,trx2usr) + $(call cc,uimage_padhdr,-Wall -lz) + $(call cc,wrt400n cyg_crc32) + $(call cc,xorimage) + $(call cc,zyimage,-Wall) + $(call cc,zyxbcm) endef define Host/Install