From 143c81716dde81251fc9844f2fbe32846685de26 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 27 Jun 2020 18:38:12 +0200 Subject: [PATCH 01/11] uboot-kirkwood: Revert "uboot-kirkwood: enable sata in nsa310 uboot" This reverts commit 930f3c014821df423507c878415c7fb4910a454d. The build fails with the following build error: arm-openwrt-linux-muslgnueabi-ld.bfd: drivers/built-in.o: in function `ide_init': build_dir/target-arm_xscale_musl_eabi/u-boot-nsa310/u-boot-2020.04/drivers/block/ide.c:750: undefined reference to `ide_preinit' make[4]: *** [Makefile:1700: u-boot] Error 1 Signed-off-by: Hauke Mehrtens --- .../uboot-kirkwood/patches/007-nsa310-uboot-generic.patch | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 @@ From e10dd48360721a13d9196f9c2c7d2b901dfcc455 Mon Sep 17 00:00:00 2001 From: "Leon M. George" Date: Thu, 25 Jul 2019 03:06:32 +0200 Subject: [PATCH 02/11] ath79: add support for Compex WPJ531 (16M) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Specifications: SoC: QCA9531 DRAM: 128MB DDR2 Flash: 16MB SPI-NOR 2 100MBit ethernet ports 2×2 2.4GHz on-board radio miniPCIe slot that supports 5GHz radio PoE 24V - 48V IEEE 802.3af optional USB 2.0 header Installation: To install, start a tftp server in bin/targets/ath79/generic/ and use the u-boot prompt over UART: tftpboot 0x80500000 openwrt-ath79-generic-compex_wpj531-16m-squashfs-sysupgrade.bin erase 0x9f030000 +$filesize erase 0x9f680000 +1 cp.b $fileaddr 0x9f030000 $filesize boot The cpximg file can be used with sysupgrade in the stock firmware (add SSH key in luci for root access). Another way is to hold the reset button during power up or running 'cpximg' in the u-boot prompt. Once the last LED starts flashing regularly, a TFTP-server under 192.168.1.1 will accept the image appropriate for the board revision that is etched on the board. For example, if the board is labelled '7A04': tftp -v -m binary 192.168.1.1 -c put openwrt-ath79-generic-compex_wpj531-16m-squashfs-cpximg-7A04.bin MAC addresses: <&uboot 0x2e010> *:cb (label) <&uboot 0x2e018> *:cc <&uboot 0x2e020> *:cd <&uboot 0x2e028> *:ce Only the first two are used (for ethernet), the WiFi modules have separate (valid) addresses. The latter two addresses are not used. Signed-off-by: Leon M. George [commit title/message facelift, fix rssileds, add led aliases] Signed-off-by: Adrian Schmutzler --- .../ath79/dts/qca9531_compex_wpj531-16m.dts | 141 ++++++++++++++++++ .../generic/base-files/etc/board.d/01_leds | 7 + .../generic/base-files/etc/board.d/02_network | 1 + target/linux/ath79/image/generic.mk | 11 ++ 4 files changed, 160 insertions(+) create mode 100644 target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts 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/generic.mk b/target/linux/ath79/image/generic.mk index 9f296adaa7..35def34250 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -418,6 +418,17 @@ 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 +endef +TARGET_DEVICES += compex_wpj531-16m + define Device/devolo_dvl1200e SOC := qca9558 DEVICE_VENDOR := devolo From 9f261e36de799322512f36a54689260e617c4fba Mon Sep 17 00:00:00 2001 From: "Leon M. George" Date: Thu, 25 Jul 2019 11:59:56 +0200 Subject: [PATCH 03/11] ath79: build Compex WPJ531 cpximg files Generate additional images that are compatible to the cpximg loader. The cpximg loader can be started either by holding the reset button during power up or by entering the u-boot prompt and entering 'cpximg'. Once it's running, a TFTP-server under 192.168.1.1 will accept the image appropriate for the board revision that is etched on the board. For example, if the board is labelled '7A04': tftp -v -m binary 192.168.1.1 -c put openwrt-ath79-generic-compex_wpj531-16m-squashfs-cpximg-7A04.bin These files can also be used with the sysupgrade utility in stock images (add SSH key in luci for root access). Signed-off-by: Leon M. George [fix sorting of definitions] Signed-off-by: Adrian Schmutzler --- target/linux/ath79/image/generic.mk | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 35def34250..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 \ @@ -426,6 +449,11 @@ define Device/compex_wpj531-16m 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 From 89bb4ee450c52f05e4a606059cacc2f668fbffd6 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Tue, 9 Jun 2020 19:46:22 +0200 Subject: [PATCH 04/11] mvebu: remove non-existant board name solidrun,clearfog-a1 In 02_network, the board name solidrun,clearfog-a1 is used in a case, but it does not seem to be used/exist anywhere else in OpenWrt. The valid strings are: - solidrun,clearfog-pro-a1 - solidrun,clearfog-base-a1 Fixes: 12795ec9f16b ("mvebu: split interface configuration for clearfog pro and base") Signed-off-by: Adrian Schmutzler --- target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network | 1 - 1 file changed, 1 deletion(-) 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 From 8819faff47ff20cfe81d58ef26c6a9054b142b74 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Mon, 22 Jun 2020 13:41:27 +0200 Subject: [PATCH 05/11] ath79: do not build TP-Link tiny images by default For quite some time, the tiny (4M flash) TP-Link sysupgrade and factory images cannot be built anymore by the buildbots, just the initramfs-kernel.bin files are still there. Disable these images for the buildbots and prevent useless builds. Note that these devices still build fine with default settings, even for kernel 5.4. Signed-off-by: Adrian Schmutzler --- target/linux/ath79/image/common-tp-link.mk | 2 ++ target/linux/ath79/image/tiny-tp-link.mk | 1 + 2 files changed, 3 insertions(+) diff --git a/target/linux/ath79/image/common-tp-link.mk b/target/linux/ath79/image/common-tp-link.mk index 81a557df48..3ae377f78f 100644 --- a/target/linux/ath79/image/common-tp-link.mk +++ b/target/linux/ath79/image/common-tp-link.mk @@ -48,12 +48,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 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 From 7da3c3b491812601b33521d378bf6c2449566e5f Mon Sep 17 00:00:00 2001 From: Sungbo Eo Date: Sun, 31 May 2020 01:33:03 +0900 Subject: [PATCH 06/11] firmware-utils: sort tools alphabetically Also remove leading whitespace after comma. Signed-off-by: Sungbo Eo --- tools/firmware-utils/Makefile | 128 +++++++++++++++++----------------- 1 file changed, 64 insertions(+), 64 deletions(-) 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 From e8afeaabc09125eff30a7db1e90604e90286fe6b Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Wed, 24 Jun 2020 19:40:45 +0200 Subject: [PATCH 07/11] ipq40xx: set IMAGES in Device/Default definition The Device/Default definition sets a default IMAGE/sysupgrade.bin, but does not enable it by setting IMAGES. This is not consistent, and has led to IMAGES being defined at various other places in the file. Thus, this patch consolidates the default value for IMAGES by putting it in Device/Default. Since it's still overwritten where necessary, this patch is cosmetic. Signed-off-by: Adrian Schmutzler --- target/linux/ipq40xx/image/Makefile | 40 ++++++++++------------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile index 632836e94f..a374c7da47 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 @@ -592,7 +582,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 @@ -622,7 +611,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 @@ -651,7 +639,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 @@ -667,7 +654,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 @@ -685,7 +672,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 From 0127de9547285a0cf44aea76e0a726b85d8c5235 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Wed, 24 Jun 2020 19:47:06 +0200 Subject: [PATCH 08/11] ipq806x: set IMAGES in Device/Default definition The Device/Default definition sets a default IMAGE/sysupgrade.bin, but does not enable it by setting IMAGES. This is not consistent, and has led to IMAGES being defined at various other places in the file. Thus, this patch consolidates the default value for IMAGES by putting it in Device/Default. Since it's still overwritten where necessary, this patch is cosmetic. Signed-off-by: Adrian Schmutzler --- target/linux/ipq806x/image/Makefile | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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 From 5234593462bc72582fafd0769d3b679f9b598574 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Wed, 24 Jun 2020 19:56:23 +0200 Subject: [PATCH 09/11] mvebu: move definition of factory.img out of Device/Default The Device/Default definition in mvebu defines an IMAGE/factory.img which is not included in IMAGES, and only used twice in the individual definitions. Move it out of the default definition to keep it closer to the reassignment of IMAGES and make it more consistent with respect to other values of IMAGE/factory.img Signed-off-by: Adrian Schmutzler --- target/linux/mvebu/image/Makefile | 1 - target/linux/mvebu/image/cortexa9.mk | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) 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 From dbaf0d20bb6afec4a592456af6b1238b46fa1acb Mon Sep 17 00:00:00 2001 From: Lars Wessels Date: Thu, 25 Jun 2020 21:09:59 +0200 Subject: [PATCH 10/11] ramips: add support for WAVLINK WL-WN577A2 This commit adds support for the Wavlink WL-WN577A2 (black case) dual-band wall-plug wireless router. In Germany this device is sold under the brand name Maginon WL-755 (white case): Device specifications: - CPU: MediaTek MT7628AN (580MHz) - Flash: 8MB - RAM: 64MB - Bootloader: U-Boot - Ethernet: 2x 10/100 Mbps (Ralink RT3050) - 2.4 GHz: 802.11b/g/n SoC - 5 GHz: 802.11a/n/ac MT7610E - Antennas: internal - 4 green LEDs: 1 programmable (WPS) + LAN, WAN, POWER - Buttons: Reset, WPS - Small sliding power switch Flashing instructions (U-boot): - Configure a TFTP server on your PC/Laptop and set its IP to 192.168.10.100 - Rename the OpenWrt image to firmware.bin and place it in the root folder of the TFTP server - Power off (using the small sliding power switch on the left side) the device and connect an ethernet cable from its LAN or WAN port to your PC/Laptop - Press the WPS button (and keep it pressed) - Power on the device (using the small power switch) - After a few seconds, when the WAN/LAN LED stops blinking very fast, release the WPS button - Flashing OpenWrt takes less than a minute, system will reboot automatically - After reboot the WPS LED will indicate the current OpenWrt running status Signed-off-by: Lars Wessels [removed unused labels - fix whitespace errors - wrap commit message] Signed-off-by: David Bauer --- .../dts/mt7628an_wavlink_wl-wn577a2.dts | 137 ++++++++++++++++++ target/linux/ramips/image/mt76x8.mk | 10 ++ .../mt76x8/base-files/etc/board.d/01_leds | 4 + .../mt76x8/base-files/etc/board.d/02_network | 7 +- 4 files changed, 157 insertions(+), 1 deletion(-) create mode 100644 target/linux/ramips/dts/mt7628an_wavlink_wl-wn577a2.dts 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) From f49063ba9214cd679bd9b0d5504eadd5d6d86d4e Mon Sep 17 00:00:00 2001 From: David Bauer Date: Mon, 29 Jun 2020 01:07:00 +0200 Subject: [PATCH 11/11] ath79: replace custom uImageArcher generation The replaces the custom uImageArcher build step with the generic uImage build step. The only different between these two is the difference in the generated name. Tested on: TP-Link Archer C59 v1 Acked-by: Adrian Schmutzler Signed-off-by: David Bauer --- target/linux/ath79/image/common-tp-link.mk | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/target/linux/ath79/image/common-tp-link.mk b/target/linux/ath79/image/common-tp-link.mk index 3ae377f78f..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 @@ -88,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