From 8634c1080d5033e8cf0069ee7447821726232b95 Mon Sep 17 00:00:00 2001 From: Jeff Kletsky Date: Tue, 3 Jan 2023 23:17:03 -0800 Subject: [PATCH 01/16] ipq40xx: Fix Linksys upgrade, restore config step It appears that the refactor of the upgrade process for NAND devices resulted in the nand_do_upgrade_success step not being called for devices using the linksys.sh script. As a result, configuration was not preserved over sysupgrade steps. This was restored for some devices in commit 84ff6c90dda1 ("base-files: bring back nand_do_upgrade_success"). This restored preservation of config for ipq40xx devices using the linksys.sh script. Other devices and targets have not been examined. Closes: #11677 Fixes: e25e6d8e54 ("base-files: fix and clean up nand sysupgrade code") Tested-on: EA8300 Signed-off-by: Jeff Kletsky (checkpatch nitpick) Signed-off-by: Christian Lamparter --- target/linux/ipq40xx/base-files/lib/upgrade/linksys.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/linksys.sh b/target/linux/ipq40xx/base-files/lib/upgrade/linksys.sh index c0d45d640d..696f653eb9 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/linksys.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/linksys.sh @@ -100,7 +100,12 @@ platform_do_upgrade_linksys() { fi # complete std upgrade - nand_upgrade_tar "$1" + if nand_upgrade_tar "$1" ; then + nand_do_upgrade_success + else + nand_do_upgrade_failure + fi + } [ "$magic_long" = "27051956" ] && { From 4ca858f1a082414bf7ace719c1b61ae54fd8e015 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Mon, 2 Jan 2023 11:04:11 +0100 Subject: [PATCH 02/16] apm821xx: Migrate to libdeflate libdeflate's gzip compressor provides a better compression ratio and uboot's decompressor has no problem with the data streams. Tested on MX60, WNDR4700, WNDAP660 Signed-off-by: Christian Lamparter --- target/linux/apm821xx/image/nand.mk | 6 +++--- target/linux/apm821xx/image/sata.mk | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/target/linux/apm821xx/image/nand.mk b/target/linux/apm821xx/image/nand.mk index db3c9c0722..1d28df98e5 100644 --- a/target/linux/apm821xx/image/nand.mk +++ b/target/linux/apm821xx/image/nand.mk @@ -51,7 +51,7 @@ define Device/meraki_mx60 IMAGES := sysupgrade.bin DTB_SIZE := 20480 IMAGE_SIZE := 1021m - KERNEL := kernel-bin | gzip | dtb | MuImage-initramfs gzip + KERNEL := kernel-bin | libdeflate-gzip | dtb | MuImage-initramfs gzip IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata UBINIZE_OPTS := -E 5 DEVICE_COMPAT_VERSION := 2.0 @@ -70,7 +70,7 @@ define Device/netgear_wndap6x0 IMAGE_SIZE := 27392k IMAGES := sysupgrade.bin factory.img KERNEL_SIZE := 6080k - KERNEL := dtb | kernel-bin | gzip | MuImage-initramfs gzip + KERNEL := dtb | kernel-bin | libdeflate-gzip | MuImage-initramfs gzip IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi UBINIZE_OPTS := -E 5 @@ -114,7 +114,7 @@ define Device/netgear_wndr4700 # CHECK_DNI_FIRMWARE_ROOTFS_INTEGRITY in do_chk_dniimg() KERNEL := kernel-bin | lzma -d16 | uImage lzma | pad-offset $$(BLOCKSIZE) 64 | \ append-uImage-fakehdr filesystem | dtb | create-uImage-dtb | prepend-dtb - KERNEL_INITRAMFS := kernel-bin | gzip | dtb | MuImage-initramfs gzip + KERNEL_INITRAMFS := kernel-bin | libdeflate-gzip | dtb | MuImage-initramfs gzip IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | \ netgear-dni | check-size IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata diff --git a/target/linux/apm821xx/image/sata.mk b/target/linux/apm821xx/image/sata.mk index 89af488e09..8a9bd57988 100644 --- a/target/linux/apm821xx/image/sata.mk +++ b/target/linux/apm821xx/image/sata.mk @@ -12,14 +12,14 @@ define Device/wd_mybooklive SUPPORTED_DEVICES += mbl wd,mybooklive-duo BLOCKSIZE := 1k DTB_SIZE := 16384 - KERNEL := kernel-bin | dtb | gzip | uImage gzip - KERNEL_INITRAMFS := kernel-bin | gzip | dtb | MuImage-initramfs gzip + KERNEL := kernel-bin | dtb | libdeflate-gzip | uImage gzip + KERNEL_INITRAMFS := kernel-bin | libdeflate-gzip | dtb | MuImage-initramfs gzip IMAGES := factory.img.gz sysupgrade.img.gz ARTIFACTS := apollo3g.dtb DEVICE_DTB := apollo3g.dtb FILESYSTEMS := ext4 squashfs - IMAGE/factory.img.gz := boot-script | boot-img | hdd-img | gzip - IMAGE/sysupgrade.img.gz := boot-script | boot-img | hdd-img | gzip | append-metadata + IMAGE/factory.img.gz := boot-script | boot-img | hdd-img | libdeflate-gzip + IMAGE/sysupgrade.img.gz := boot-script | boot-img | hdd-img | libdeflate-gzip | append-metadata ARTIFACT/apollo3g.dtb := export-dtb endef From c2d1c32d1ef7f2797aa424a6c94d143e9ddaddc8 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Mon, 13 Mar 2023 22:49:50 +0100 Subject: [PATCH 03/16] lantiq: xrx200: convert FritzBox 7360v2's wifi to nvmem this was thoroughly tested (warm and cold boots). on a real 7360v2. This is because there have been documented hick-ups with other lantiq devices that need the owl-loader too. It's likely that the 7360(sl) could be converted in the same way as well. However the 7362sl uses a reversed caldata format, so the "qca,no-eeprom" stays in place. The patch also moves the urloader nvmem partition definition into the partition section. Signed-off-by: Christian Lamparter --- .../boot/dts/lantiq/vr9_avm_fritz7360-v2.dts | 24 ++++++++++++------- .../boot/dts/lantiq/vr9_avm_fritz736x.dtsi | 2 +- .../etc/hotplug.d/firmware/12-ath9k-eeprom | 3 +-- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360-v2.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360-v2.dts index 063d6dca5e..a30746cde2 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360-v2.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360-v2.dts @@ -42,6 +42,18 @@ label = "urlader"; reg = <0x00000 0x20000>; read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + cal_urlader_985: cal@985 { + reg = <0x985 0x440>; + }; + + macaddr_urlader_a91: macaddr@a91 { + reg = <0xa91 0x6>; + }; }; partition@20000 { @@ -78,12 +90,8 @@ reset-gpios = <&gpio 44 GPIO_ACTIVE_LOW>; }; -&urlader { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_urlader_a91: macaddr@a91 { - reg = <0xa91 0x6>; - }; +&wifi { + /delete-property/ qca,no-eeprom; + nvmem-cells = <&cal_urlader_985>; + nvmem-cell-names = "calibration"; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz736x.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz736x.dtsi index 73f6e152bf..7324127d2a 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz736x.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz736x.dtsi @@ -151,7 +151,7 @@ #address-cells = <2>; device_type = "pci"; - wifi@168c,002e { + wifi: wifi@168c,002e { compatible = "pci168c,002e"; reg = <0 0 0 0 0>; qca,no-eeprom; /* load from ath9k-eeprom-pci-0000:01:00.0.bin */ diff --git a/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom b/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom index c6bacb8d3c..eefc39b30b 100644 --- a/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom +++ b/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom @@ -19,8 +19,7 @@ case "$FIRMWARE" in avm,fritz3390) caldata_extract_reverse "urlader" 0x2546 0x440 ;; - avm,fritz7360sl|\ - avm,fritz7360-v2) + avm,fritz7360sl) caldata_extract "urlader" 0x985 0x1000 ;; avm,fritz7412|\ From de3d60b982c7b8e1821b90b312db57287e74ede3 Mon Sep 17 00:00:00 2001 From: Edward Chow Date: Sun, 20 Nov 2022 13:49:45 +0800 Subject: [PATCH 04/16] ath79: calibrate dlink dir-825 b1 with nvmem Driver for both soc (2.4GHz Wifi) and pci (5 GHz) now pull the calibration data from the nvmem subsystem. This allows us to move the userspace caldata extraction for the pci-e ath9k supported wifi into the device-tree definition of the device. Currently, only ethernet devices uses the mac address of "mac-address-ascii" cells, while PCI ath9k devices uses the mac address within calibration data. Signed-off-by: Edward Chow (restored switch configuration in 02_network, integrated caldata into partition) Signed-off-by: Christian Lamparter --- .../ath79/dts/ar7161_dlink_dir-825-b1.dts | 33 +++++++++++++++++-- .../generic/base-files/etc/board.d/02_network | 1 - .../etc/hotplug.d/firmware/10-ath9k-eeprom | 2 -- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts b/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts index 6934a8f952..0e39be7d0b 100644 --- a/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts +++ b/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts @@ -139,7 +139,8 @@ ath9k0: wifi@0,11 { compatible = "pci168c,0029"; reg = <0x8800 0 0 0 0>; - qca,no-eeprom; + nvmem-cells = <&macaddr_lan>, <&cal_art_1000>; + nvmem-cell-names = "mac-address-ascii", "calibration"; #gpio-cells = <2>; gpio-controller; }; @@ -147,7 +148,9 @@ ath9k1: wifi@0,12 { compatible = "pci168c,0029"; reg = <0x9000 0 0 0 0>; - qca,no-eeprom; + nvmem-cells = <&macaddr_wan>, <&cal_art_5000>; + nvmem-cell-names = "mac-address-ascii", "calibration"; + mac-address-increment = <1>; #gpio-cells = <2>; gpio-controller; }; @@ -184,9 +187,28 @@ }; partition@660000 { + compatible = "nvmem-cells"; label = "caldata"; reg = <0x660000 0x010000>; read-only; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: cal@1000 { + reg = <0x1000 0xeb8>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0xeb8>; + }; + + macaddr_lan: macaddr@ffa0 { + reg = <0xffa0 0x11>; + }; + + macaddr_wan: macaddr@ffb4 { + reg = <0xffb4 0x11>; + }; }; fwconcat1: partition@670000 { @@ -202,6 +224,9 @@ pll-data = <0x11110000 0x00001099 0x00991099>; + nvmem-cells = <&macaddr_lan>; + nvmem-cell-names = "mac-address-ascii"; + fixed-link { speed = <1000>; full-duplex; @@ -213,5 +238,9 @@ pll-data = <0x11110000 0x00001099 0x00991099>; + nvmem-cells = <&macaddr_wan>; + nvmem-cell-names = "mac-address-ascii"; + phy-handle = <&phy4>; }; + 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 31ea891d57..1e439b1e2f 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 @@ -634,7 +634,6 @@ ath79_setup_macs() dlink,dir-629-a1) wan_mac=$(mtd_get_mac_text "mfcdata" 0x6a) ;; - dlink,dir-825-b1|\ trendnet,tew-673gru) lan_mac=$(mtd_get_mac_text "caldata" 0xffa0) wan_mac=$(mtd_get_mac_text "caldata" 0xffb4) diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 9827508c04..022f5e2947 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -124,7 +124,6 @@ case "$FIRMWARE" in buffalo,wzr-hp-ag300h) caldata_extract "art" 0x1000 0xeb8 ;; - dlink,dir-825-b1|\ trendnet,tew-673gru) caldata_extract "caldata" 0x1000 0xeb8 ath9k_patch_mac_crc $(mtd_get_mac_text "caldata" 0xffa0) 0x20c @@ -143,7 +142,6 @@ case "$FIRMWARE" in buffalo,wzr-hp-ag300h) caldata_extract "art" 0x5000 0xeb8 ;; - dlink,dir-825-b1|\ trendnet,tew-673gru) caldata_extract "caldata" 0x5000 0xeb8 ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_text "caldata" 0xffb4) 1) 0x20c From 3ab670b24eee8adef77a71d9d11ee362c1668b26 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 26 Mar 2023 17:19:03 +0200 Subject: [PATCH 05/16] mac80211: fix receiving mesh packets in forwarding=0 networks When forwarding is set to 0, frames are typically sent with ttl=1. Move the ttl decrement check below the check for local receive in order to fix packet drops. Signed-off-by: Felix Fietkau --- ...x-receiving-mesh-packets-in-forwardi.patch | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 package/kernel/mac80211/patches/subsys/329-wifi-mac80211-fix-receiving-mesh-packets-in-forwardi.patch diff --git a/package/kernel/mac80211/patches/subsys/329-wifi-mac80211-fix-receiving-mesh-packets-in-forwardi.patch b/package/kernel/mac80211/patches/subsys/329-wifi-mac80211-fix-receiving-mesh-packets-in-forwardi.patch new file mode 100644 index 0000000000..6882694da8 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/329-wifi-mac80211-fix-receiving-mesh-packets-in-forwardi.patch @@ -0,0 +1,50 @@ +From: Felix Fietkau +Date: Sun, 26 Mar 2023 17:11:34 +0200 +Subject: [PATCH] wifi: mac80211: fix receiving mesh packets in forwarding=0 + networks +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When forwarding is set to 0, frames are typically sent with ttl=1. +Move the ttl decrement check below the check for local receive in order to +fix packet drops. + +Reported-by: Thomas Hühn +Reported-by: Nick Hainke +Fixes: 986e43b19ae9 ("wifi: mac80211: fix receiving A-MSDU frames on mesh interfaces") +Signed-off-by: Felix Fietkau +--- + +--- a/net/mac80211/rx.c ++++ b/net/mac80211/rx.c +@@ -2828,14 +2828,6 @@ ieee80211_rx_mesh_data(struct ieee80211_ + if (sdata->crypto_tx_tailroom_needed_cnt) + tailroom = IEEE80211_ENCRYPT_TAILROOM; + +- if (!--mesh_hdr->ttl) { +- if (multicast) +- goto rx_accept; +- +- IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_ttl); +- return RX_DROP_MONITOR; +- } +- + if (mesh_hdr->flags & MESH_FLAGS_AE) { + struct mesh_path *mppath; + char *proxied_addr; +@@ -2874,6 +2866,14 @@ ieee80211_rx_mesh_data(struct ieee80211_ + if (ether_addr_equal(sdata->vif.addr, eth->h_dest)) + goto rx_accept; + ++ if (!--mesh_hdr->ttl) { ++ if (multicast) ++ goto rx_accept; ++ ++ IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_ttl); ++ return RX_DROP_MONITOR; ++ } ++ + if (!ifmsh->mshcfg.dot11MeshForwarding) { + if (is_multicast_ether_addr(eth->h_dest)) + goto rx_accept; From 212632540043cc9b911c2efb86156479f2710836 Mon Sep 17 00:00:00 2001 From: Chuanhong Guo Date: Sun, 26 Mar 2023 23:50:43 +0800 Subject: [PATCH 06/16] ramips: fix 5g mac for TOTOLINK X5000R There's no valid mac address for the second band in the eeprom. The vendor fw uses 2.4G mac + 4 as the mac for 5G radio. Do the same in our firmware. Fixes: 23be410b3d ("ramips: add support for TOTOLINK X5000R") Signed-off-by: Chuanhong Guo --- .../mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index b23464bebe..b3de1f39cf 100644 --- a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -152,6 +152,10 @@ case "$board" in hw_mac_addr="$(mtd_get_mac_binary factory 0x4)" [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr "0x100000" > /sys${DEVPATH}/macaddress ;; + totolink,x5000r) + hw_mac_addr="$(mtd_get_mac_binary factory 0x4)" + [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 4 > /sys${DEVPATH}/macaddress + ;; tplink,eap615-wall-v1) hw_mac_addr="$(mtd_get_mac_binary product-info 0x8)" macaddr_add "$hw_mac_addr" "$PHYNBR" > "/sys${DEVPATH}/macaddress" From 88d76bb455c8fdb525ac2495feda71c14a558296 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Tue, 21 Mar 2023 16:50:56 +0800 Subject: [PATCH 07/16] ramips: mt7621: enable unused PCIe port to fix potential boot failure One user reported that his SIMAX1800T couldn't boot like the others. After debugging, I found that this was caused by the disabled PCIe port. I cannot reproduce this issue on my SIMAX1800T. But when I disabled pcie2 on the ASUS RT-AC57U, I got the same result. It seems that disabling these unused PCIe ports on some mt7621 revisions will cause PCIe to fail to initialize. So we'd better to re-enable them on all related mt7621 devices. Signed-off-by: Shiji Yang --- target/linux/ramips/dts/mt7621_h3c_tx180x.dtsi | 4 ---- target/linux/ramips/dts/mt7621_haier-sim_wr1800k.dtsi | 4 ---- target/linux/ramips/dts/mt7621_netgear_wax202.dts | 4 ---- target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts | 4 ---- 4 files changed, 16 deletions(-) diff --git a/target/linux/ramips/dts/mt7621_h3c_tx180x.dtsi b/target/linux/ramips/dts/mt7621_h3c_tx180x.dtsi index 54d7908e40..fe374bfa6b 100644 --- a/target/linux/ramips/dts/mt7621_h3c_tx180x.dtsi +++ b/target/linux/ramips/dts/mt7621_h3c_tx180x.dtsi @@ -138,10 +138,6 @@ }; }; -&pcie2 { - status = "disabled"; -}; - &state_default { gpio { groups = "jtag"; diff --git a/target/linux/ramips/dts/mt7621_haier-sim_wr1800k.dtsi b/target/linux/ramips/dts/mt7621_haier-sim_wr1800k.dtsi index a272d1ad75..4dd6f3b0ae 100644 --- a/target/linux/ramips/dts/mt7621_haier-sim_wr1800k.dtsi +++ b/target/linux/ramips/dts/mt7621_haier-sim_wr1800k.dtsi @@ -152,10 +152,6 @@ }; }; -&pcie2 { - status = "disabled"; -}; - &state_default { gpio { groups = "i2c", "uart3", "wdt"; diff --git a/target/linux/ramips/dts/mt7621_netgear_wax202.dts b/target/linux/ramips/dts/mt7621_netgear_wax202.dts index 02f540d743..fbe17ef0d3 100644 --- a/target/linux/ramips/dts/mt7621_netgear_wax202.dts +++ b/target/linux/ramips/dts/mt7621_netgear_wax202.dts @@ -217,10 +217,6 @@ }; }; -&pcie2 { - status = "disabled"; -}; - &state_default { gpio { groups = "uart3", "uart2", "jtag", "wdt"; diff --git a/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts b/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts index 36809d48ff..58e4bbf757 100644 --- a/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts @@ -148,10 +148,6 @@ }; }; -&pcie2 { - status = "disabled"; -}; - &gmac0 { nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; From 12f52336d2b18951d883af07f398fc9697adba24 Mon Sep 17 00:00:00 2001 From: Martin Kennedy Date: Sun, 18 Sep 2022 12:15:57 -0400 Subject: [PATCH 08/16] ath79: Add Aruba AP-175 support This board is very similar to the Aruba AP-105, but is outdoor-first. It is very similar to the MSR2000 (though certain MSR2000 models have a different PHY[^1]). A U-Boot replacement is required to install OpenWrt on these devices[^2]. Specifications -------------- * Device: Aruba AP-175 * SoC: Atheros AR7161 680 MHz MIPS * RAM: 128MB - 2x Mira P3S12D40ETP * Flash: 16MB MXIC MX25L12845EMI-10G (SPI-NOR) * WiFi: 2 x DNMA-H92 Atheros AR9220-AC1A 802.11abgn * ETH: IC+ IP1001 Gigabit + PoE PHY * LED: 2x int., plus 12 ext. on TCA6416 GPIO expander * Console: CP210X linking USB-A Port to CPU console @ 115200 * RTC: DS1374C, with internal battery * Temp: LM75 temperature sensor Factory installation: - Needs a u-boot replacement. The process is almost identical to that of the AP105, except that the case is easier to open, and that you need to compile u-boot from a slightly different branch: https://github.com/Hurricos/u-boot-ap105/tree/ap175 The instructions for performing an in-circuit reflash with an SPI-Flasher like a CH314A can be found on the OpenWrt Wiki (https://openwrt.org/toh/aruba/ap-105); in addition a detailed guide may be found on YouTube[^3]. - Once u-boot has been replaced, a USB-A-to-A cable may be used to connect your PC to the CP210X inside the AP at 115200 baud; at this point, the normal u-boot serial flashing procedure will work (set up networking; tftpboot and boot an OpenWrt initramfs; sysupgrade to OpenWrt proper.) - There is no built-in functionality to revert back to stock firmware, because the AP-175 has been declared by the vendor[^4] end-of-life as of 31 Jul 2020. If for some reason you wish to return to stock firmware, take a backup of the 16MiB flash before flashing u-boot. [^1]: https://github.com/shalzz/aruba-ap-310/blob/master/platform/bootloader/apboot-11n/include/configs/msr2k.h#L186 [^2]: https://github.com/Hurricos/u-boot-ap105/tree/ap175 [^3]: https://www.youtube.com/watch?v=Vof__dPiprs [^4]: https://www.arubanetworks.com/support-services/end-of-life/#product=access-points&version=0 Signed-off-by: Martin Kennedy --- package/boot/uboot-envtools/files/ath79 | 22 +- .../linux/ath79/dts/ar7161_aruba_ap-175.dts | 244 ++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 1 + target/linux/ath79/image/generic.mk | 9 + 4 files changed, 266 insertions(+), 10 deletions(-) create mode 100644 target/linux/ath79/dts/ar7161_aruba_ap-175.dts diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index b968fa8fde..c7049f7029 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -88,6 +88,18 @@ ziking,cpe46b|\ zyxel,nbg6616) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" ;; +aruba,ap-105|\ +aruba,ap-175|\ +dongwon,dw02-412h-64m|\ +dongwon,dw02-412h-128m|\ +glinet,gl-ar300m-lite|\ +glinet,gl-ar300m-nand|\ +glinet,gl-ar300m-nor|\ +glinet,gl-ar300m16) + idx="$(find_mtd_index u-boot-env)" + [ -n "$idx" ] && \ + ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" + ;; buffalo,wzr-hp-ag300h) ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000" ;; @@ -99,16 +111,6 @@ linksys,ea4500-v3) domywifi,dw33d) ubootenv_add_uci_config "/dev/mtd4" "0x0" "0x10000" "0x10000" ;; -dongwon,dw02-412h-64m|\ -dongwon,dw02-412h-128m|\ -glinet,gl-ar300m-lite|\ -glinet,gl-ar300m-nand|\ -glinet,gl-ar300m-nor|\ -glinet,gl-ar300m16) - idx="$(find_mtd_index u-boot-env)" - [ -n "$idx" ] && \ - ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" - ;; glinet,gl-ar150) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x10000" ;; diff --git a/target/linux/ath79/dts/ar7161_aruba_ap-175.dts b/target/linux/ath79/dts/ar7161_aruba_ap-175.dts new file mode 100644 index 0000000000..dd29a687ba --- /dev/null +++ b/target/linux/ath79/dts/ar7161_aruba_ap-175.dts @@ -0,0 +1,244 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar7100.dtsi" + +#include +#include + +/ { + compatible = "aruba,ap-175", "qca,ar7161"; + model = "Aruba AP-175"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + aliases { + led-boot = &led_power_amber; + led-failsafe = &led_power_amber; + led-upgrade = &led_power_amber; + label-mac-device = ð0; + }; + + leds { + compatible = "gpio-leds"; + + /* These internal LEDs cannot be seen when case is closed */ + internal_2g_green { + label = "green:internal_2g"; + gpios = <&gpio 3 GPIO_ACTIVE_HIGH>; + }; + + internal_5g_green { + label = "green:internal_5g"; + gpios = <&gpio 4 GPIO_ACTIVE_HIGH>; + }; + + /* These external LEDs are visible from the bottom panel */ + + led_power_amber: power_amber { + label = "amber:power"; + gpios = <&gpio_ext 5 GPIO_ACTIVE_HIGH>; + panic-indicator; + }; + + r1_act_blue { + label = "blue:r1_act"; + gpios = <&gpio_ext 0 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy1tpt"; + }; + + r1_rssi1_blue { + label = "blue:r1_rssi1"; + gpios = <&gpio_ext 1 GPIO_ACTIVE_HIGH>; + }; + + r1_rssi2_blue { + label = "blue:r1_rssi2"; + gpios = <&gpio_ext 2 GPIO_ACTIVE_HIGH>; + }; + + r1_rssi3_blue { + label = "blue:r1_rssi3"; + gpios = <&gpio_ext 3 GPIO_ACTIVE_HIGH>; + }; + + r1_rssi4_blue { + label = "blue:r1_rssi4"; + gpios = <&gpio_ext 4 GPIO_ACTIVE_HIGH>; + }; + + r0_act_amber { + label = "amber:r0_act"; + gpios = <&gpio_ext 8 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + + r0_rssi1_amber { + label = "amber:r0_rssi1"; + gpios = <&gpio_ext 9 GPIO_ACTIVE_HIGH>; + }; + + r0_rssi2_amber { + label = "amber:r0_rssi2"; + gpios = <&gpio_ext 10 GPIO_ACTIVE_HIGH>; + }; + + r0_rssi3_amber { + label = "amber:r0_rssi3"; + gpios = <&gpio_ext 11 GPIO_ACTIVE_HIGH>; + }; + + r0_rssi4_amber { + label = "amber:r0_rssi4"; + gpios = <&gpio_ext 12 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + }; + }; + + i2c0: i2c { + compatible = "i2c-gpio"; + i2c-gpio,delay-us = <10>; + i2c-gpio,timeout-ms = <1>; + sda-gpios = <&gpio 1 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + scl-gpios = <&gpio 2 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + + #address-cells = <1>; + #size-cells = <0>; + }; +}; + +&pcie0 { + status = "okay"; + + ath9k0: wifi@0,11 { + compatible = "pci168c,0029"; + nvmem-cells = <&macaddr_hwinfo_1c>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; + reg = <0x8800 0 0 0 0>; + #gpio-cells = <2>; + gpio-controller; + }; + + ath9k1: wifi@0,12 { + compatible = "pci168c,0029"; + nvmem-cells = <&macaddr_hwinfo_1c>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <2>; + reg = <0x9000 0 0 0 0>; + #gpio-cells = <2>; + gpio-controller; + }; +}; + +&mdio0 { + status = "okay"; + + phy1: ethernet-phy@1 { + reg = <0x1>; + }; +}; + +ð0 { + status = "okay"; + nvmem-cells = <&macaddr_hwinfo_1c>; + nvmem-cell-names = "mac-address"; + + phy-mode = "rgmii"; + phy-handle = <&phy1>; +}; + +&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>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x40000>; + read-only; + }; + + partition@40000 { + label = "firmware"; + reg = <0x40000 0xfa0000>; + compatible = "denx,uimage"; + }; + + hwinfo: partition@fe0000 { + label = "hwinfo"; + reg = <0xfe0000 0x10000>; + read-only; + }; + + partition@ff0000 { + label = "u-boot-env"; + reg = <0xff0000 0x10000>; + read-only; + }; + }; + }; +}; + +&hwinfo { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_hwinfo_1c: macaddr@1c { + reg = <0x1c 0x6>; + }; +}; + +&i2c0 { + gpio_ext: gpio@21 { + status = "okay"; + + compatible = "ti,tca6416"; + reg = <0x21>; + + #address-cells = <1>; + #size-cells = <0>; + + gpio-controller; + #gpio-cells = <2>; + }; + + temp-sensor@4a { + compatible = "national,lm75"; + reg = <0x4a>; + }; + + eeprom@50 { /* 24lc2561 */ + compatible = "atmel,24c256","at24"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x50>; + size = <256>; + }; + + ds1374c: rtc@68 { + status = "okay"; + + compatible = "dallas,ds1374"; + reg = <0x68>; + }; +}; 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 1e439b1e2f..c6284edafd 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 @@ -19,6 +19,7 @@ ath79_setup_interfaces() araknis,an-700-ap-i-ac|\ arduino,yun|\ aruba,ap-105|\ + aruba,ap-175|\ asus,rp-ac51|\ asus,rp-ac66|\ avm,fritz1750e|\ diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 608b51766f..328861de03 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -395,6 +395,15 @@ define Device/aruba_ap-105 endef TARGET_DEVICES += aruba_ap-105 +define Device/aruba_ap-175 + SOC := ar7161 + DEVICE_VENDOR := Aruba + DEVICE_MODEL := AP-175 + IMAGE_SIZE := 16000k + DEVICE_PACKAGES := kmod-gpio-pca953x kmod-hwmon-lm75 kmod-i2c-gpio kmod-rtc-ds1374 +endef +TARGET_DEVICES += aruba_ap-175 + define Device/asus_pl-ac56 SOC := qca9563 DEVICE_VENDOR := ASUS From ceac4ae3b403d52735f371b741f9fd6cbbe08b31 Mon Sep 17 00:00:00 2001 From: Aleksander Jan Bajkowski Date: Mon, 1 Nov 2021 22:52:21 +0100 Subject: [PATCH 09/16] lantiq: xway: add support for AVM FRITZ!Box 7330 The AVM FRITZ!Box 7330 shares hardware with the AVM Fritzbox 7320 except for the second ethernet port, which only supports 100M. Hardware: - SoC: Lantiq ARX 188 - CPU: 2x MIPS 34Kc 393 MHz - RAM: 64 MiB 196 MHz - Flash: 16 MiB NAND - Ethernet: Built-in Gigabit Ethernet switch, 1x 1GbE, 1x 100M - Wifi: Atheros AR9227-BC2A b/g/n with 2 pcb/internal antennas - USB: 2x USB 2.0 - DSL: Built-in ADSL2+ modem - DECT: Dialog SC14441 - LEDs: 1 two-color, 4 one-color - Buttons: 1x DECT, 1x WIFI - Telephone connectors: 1 FXS port via TAE or RJ11 connector Installation: The installation process is described on the wiki. Unsupported (same as AVM 7320): - VoIP (DECT and FXS), - Second Ethernet port. Signed-off-by: Aleksander Jan Bajkowski --- target/linux/lantiq/image/ar9.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/lantiq/image/ar9.mk b/target/linux/lantiq/image/ar9.mk index 4d9a008f6f..43f91d0ee4 100644 --- a/target/linux/lantiq/image/ar9.mk +++ b/target/linux/lantiq/image/ar9.mk @@ -17,6 +17,8 @@ define Device/avm_fritz7320 DEVICE_MODEL := FRITZ!Box 7320 DEVICE_ALT0_VENDOR := 1&1 DEVICE_ALT0_MODEL := HomeServer + DEVICE_ALT1_VENDOR := AVM + DEVICE_ALT1_MODEL := Fritz!box 7330 SOC := ar9 IMAGE_SIZE := 15744k LOADER_FLASH_OFFS := 0x31000 From b094c6976c161643d5c656b16738a65d28722b18 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Tue, 14 Mar 2023 05:03:24 -0400 Subject: [PATCH 10/16] tools/automake: verbose variable compatibility An old patch attempted to harmonize the way that both Openwrt and Automake uses the $(V) variable. However, it was reverted because of the side-effects. This method is more simple and just allows Automake to accept any string as part of the verbosity toggle, falling back to the default if null. Ref: e6901bf90 ("tools/automake: Revert "Do not use $(V) - force AM_V=1"") Ref: 43365ca66 ("Do not use $(V) - force AM_V=1") Signed-off-by: Michael Pratt --- .../200-other-V-values-for-verbosity.patch | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 tools/automake/patches/200-other-V-values-for-verbosity.patch diff --git a/tools/automake/patches/200-other-V-values-for-verbosity.patch b/tools/automake/patches/200-other-V-values-for-verbosity.patch new file mode 100644 index 0000000000..1ea9d38b0e --- /dev/null +++ b/tools/automake/patches/200-other-V-values-for-verbosity.patch @@ -0,0 +1,59 @@ +From: Bogdan Drozdowski +Date: Sat, 31 Dec 2022 20:17:35 +0100 +Subject: [PATCH] Allow other V values for verbosity + +--- + m4/silent.m4 | 2 +- + t/silent-gen.sh | 24 ++++++++++++++++++++++++ + 2 files changed, 25 insertions(+), 1 deletion(-) + +--- a/m4/silent.m4 ++++ b/m4/silent.m4 +@@ -43,7 +43,7 @@ else + fi]) + if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. +- AM_V='$(V)' ++ AM_V='$(shell if ( test "x$(V)" = "x0" ); then echo 0; elif ( test "x$(V)" = "x" ); then echo $(AM_DEFAULT_VERBOSITY); else echo 1; fi)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' + else + AM_V=$AM_DEFAULT_VERBOSITY +--- a/t/silent-gen.sh ++++ b/t/silent-gen.sh +@@ -54,6 +54,18 @@ grep 'cp ' stdout + grep 'echo ' stdout + + $MAKE clean ++run_make -O V=99 ++grep 'GEN ' stdout && exit 1 ++grep 'cp ' stdout ++grep 'echo ' stdout ++ ++$MAKE clean ++run_make -O V=vvv ++grep 'GEN ' stdout && exit 1 ++grep 'cp ' stdout ++grep 'echo ' stdout ++ ++$MAKE clean + run_make -O V=0 + grep 'GEN .*foo' stdout + grep 'cp ' stdout && exit 1 +@@ -78,5 +90,17 @@ run_make -O V=1 + grep 'GEN ' stdout && exit 1 + grep 'cp ' stdout + grep 'echo ' stdout ++ ++$MAKE clean ++run_make -O V=99 ++grep 'GEN ' stdout && exit 1 ++grep 'cp ' stdout ++grep 'echo ' stdout ++ ++$MAKE clean ++run_make -O V=v ++grep 'GEN ' stdout && exit 1 ++grep 'cp ' stdout ++grep 'echo ' stdout + + : From 83c1bf2cd43c89c6488cdae2891264593ee8c0c1 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Wed, 15 Mar 2023 21:22:37 -0400 Subject: [PATCH 11/16] autotools: remove specialized version of libtool Remove the specialized copy of libtool which was used for linking to uClibc++, which is now removed. Also remove references to the deprecated fixup targets that invoked this specialized libtool, which no package uses. Ref: 6b2ed6101 ("uclibc++: remove") Ref: c10515db6 ("re-enable the libtool PKG_BUILD_DEPENDS for PKG_FIXUP") Ref: 246a5b334 ("More libtool madness") Signed-off-by: Michael Pratt --- include/autotools.mk | 13 ------------- tools/libtool/Makefile | 2 -- 2 files changed, 15 deletions(-) diff --git a/include/autotools.mk b/include/autotools.mk index cba36ccd9f..c378efe6f9 100644 --- a/include/autotools.mk +++ b/include/autotools.mk @@ -124,13 +124,6 @@ ifneq ($(filter libtool-abiver,$(PKG_FIXUP)),) Hooks/Configure/Post += set_libtool_abiver endif -ifneq ($(filter libtool-ucxx,$(PKG_FIXUP)),) - PKG_BUILD_DEPENDS += libtool - ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),) - Hooks/Configure/Pre += autoreconf_target - endif -endif - ifneq ($(filter autoreconf,$(PKG_FIXUP)),) ifeq ($(filter autoreconf,$(Hooks/Configure/Pre)),) Hooks/Configure/Pre += autoreconf_target @@ -166,12 +159,6 @@ ifneq ($(filter libtool,$(HOST_FIXUP)),) endif endif -ifneq ($(filter libtool-ucxx,$(HOST_FIXUP)),) - ifeq ($(filter no-autoreconf,$(HOST_FIXUP)),) - Hooks/HostConfigure/Pre += autoreconf_host - endif -endif - ifneq ($(filter autoreconf,$(HOST_FIXUP)),) ifeq ($(filter autoreconf,$(Hooks/HostConfigure/Pre)),) Hooks/HostConfigure/Pre += autoreconf_host diff --git a/tools/libtool/Makefile b/tools/libtool/Makefile index 6626142294..cc9e8a68fb 100644 --- a/tools/libtool/Makefile +++ b/tools/libtool/Makefile @@ -35,8 +35,6 @@ endef define Host/Install $(MAKE) -C $(HOST_BUILD_DIR) install $(SED) 's,\(hardcode_into_libs\)=yes,\1=no,g' $(STAGING_DIR_HOST)/bin/libtool - $(CP) $(STAGING_DIR_HOST)/bin/libtool $(STAGING_DIR_HOST)/bin/libtool-ucxx - $(SED) 's,-lstdc++,-luClibc++,g' $(STAGING_DIR_HOST)/bin/libtool-ucxx endef define Host/Uninstall From 7c0727c26330d12253ec98463279a564ae0f9efa Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Wed, 15 Mar 2023 01:45:02 -0400 Subject: [PATCH 12/16] tools/libtool: clean up build recipes Host/Clean/Default is no longer defined. Use the uninstall makefile target to remove the obsolete m4 files, and more. Signed-off-by: Michael Pratt --- tools/libtool/Makefile | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tools/libtool/Makefile b/tools/libtool/Makefile index cc9e8a68fb..b4f3ecc36b 100644 --- a/tools/libtool/Makefile +++ b/tools/libtool/Makefile @@ -23,7 +23,7 @@ HOST_CONFIGURE_VARS += \ define Host/Prepare $(call Host/Prepare/Default) - (cd $(STAGING_DIR_HOST)/share/aclocal/ && rm -f libtool.m4 ltdl.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4) + $(call Host/Uninstall) $(if $(QUILT),,(cd $(HOST_BUILD_DIR); touch README-release; $(AM_TOOL_PATHS) ./bootstrap --skip-git --skip-po --force)) endef @@ -33,16 +33,13 @@ define Host/Configure endef define Host/Install - $(MAKE) -C $(HOST_BUILD_DIR) install + $(call Host/Compile/Default,install) $(SED) 's,\(hardcode_into_libs\)=yes,\1=no,g' $(STAGING_DIR_HOST)/bin/libtool endef define Host/Uninstall -$(call Host/Compile/Default,uninstall) -endef - -define Host/Clean - $(call Host/Clean/Default) + (cd $(STAGING_DIR_HOST)/share/aclocal/ && rm -f libtool.m4 ltdl.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4) endef $(eval $(call HostBuild)) From 2bb8e4a88149e09389b409517219b4ade4e7578e Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Tue, 14 Mar 2023 05:10:50 -0400 Subject: [PATCH 13/16] rules.mk: add FILECMD variable Some packages using Libtool have the possibility of using this environment variable if set, instead of the direct command for "file" using PATH, or the need to patch a hard-coded path. This is a new feature of Libtool 2.4.7 Ref: bf261073d ("tools/libtool: bump to 2.4.7") Signed-off-by: Michael Pratt --- rules.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/rules.mk b/rules.mk index a2f5bcca4b..57d7995d4f 100644 --- a/rules.mk +++ b/rules.mk @@ -252,6 +252,7 @@ TARGET_NM:=$(TARGET_CROSS)gcc-nm TARGET_CC:=$(TARGET_CROSS)gcc TARGET_CXX:=$(TARGET_CROSS)g++ KPATCH:=$(SCRIPT_DIR)/patch-kernel.sh +FILECMD:=$(STAGING_DIR_HOST)/bin/file SED:=$(STAGING_DIR_HOST)/bin/sed -i -e ESED:=$(STAGING_DIR_HOST)/bin/sed -E -i -e MKHASH:=$(STAGING_DIR_HOST)/bin/mkhash From 9215f556a0ad92727aa6a7bccb057c180f5ec18d Mon Sep 17 00:00:00 2001 From: Aleksander Jan Bajkowski Date: Sat, 11 Mar 2023 12:43:34 +0100 Subject: [PATCH 14/16] bcm47xx: refresh config This was done by executing these command: $ make kernel_oldconfig CONFIG_TARGET=subtarget Signed-off-by: Aleksander Jan Bajkowski --- target/linux/bcm47xx/legacy/config-default | 1 - target/linux/bcm47xx/mips74k/config-default | 15 ++++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/target/linux/bcm47xx/legacy/config-default b/target/linux/bcm47xx/legacy/config-default index 8a52e475c7..4cd487e74c 100644 --- a/target/linux/bcm47xx/legacy/config-default +++ b/target/linux/bcm47xx/legacy/config-default @@ -4,5 +4,4 @@ CONFIG_B44_PCICORE_AUTOSELECT=y CONFIG_B44_PCI_AUTOSELECT=y # CONFIG_BCM47XX_BCMA is not set # CONFIG_BCMA is not set -# CONFIG_MTD_NAND is not set # CONFIG_SSB_DRIVER_GIGE is not set diff --git a/target/linux/bcm47xx/mips74k/config-default b/target/linux/bcm47xx/mips74k/config-default index 2c3c40377a..96aecf0aa6 100644 --- a/target/linux/bcm47xx/mips74k/config-default +++ b/target/linux/bcm47xx/mips74k/config-default @@ -3,18 +3,15 @@ CONFIG_BGMAC=y CONFIG_BGMAC_BCMA=y CONFIG_BOUNCE=y +CONFIG_CPU_HAS_DIEI=y +CONFIG_CPU_HAS_RIXI=y # CONFIG_CPU_MIPS32_R1 is not set -# CONFIG_CPU_MIPSR1 is not set CONFIG_CPU_MIPS32_R2=y CONFIG_CPU_MIPSR2=y -# CONFIG_FIXED_PHY is not set +CONFIG_CPU_SUPPORTS_MSA=y # CONFIG_GPIO_WDT is not set CONFIG_HIGHMEM=y +CONFIG_KMAP_LOCAL=y +CONFIG_MIPS_SPRAM=y # CONFIG_SSB is not set -# CONFIG_SSB_DRIVER_EXTIF is not set -# CONFIG_SSB_DRIVER_GIGE is not set -# CONFIG_SSB_DRIVER_MIPS is not set -# CONFIG_SSB_EMBEDDED is not set -# CONFIG_SSB_PCICORE_HOSTMODE is not set -# CONFIG_SSB_SERIAL is not set -# CONFIG_SSB_SFLASH is not set +CONFIG_TARGET_ISA_REV=2 From 11c28cfceb5ec3cf734a155b45e5fb389e8fd422 Mon Sep 17 00:00:00 2001 From: Aleksander Jan Bajkowski Date: Sun, 18 Dec 2022 00:26:19 +0100 Subject: [PATCH 15/16] bcm47xx: enable adm6996 only on legacy subtarget The generic subtarget supports only a few devices. None of these devices are equipped with a ADM6996 switch. On the mips74k subtarget, the driver for the adm6996 switch is disabled. So it seems that the ADM6996 driver should be enabled only on the legacy subtarget. Support for ADM6996 switches was enabled in commit 68081fc1c8c7814b1c064431eb2e364f9226801a. At the time when this driver was enabled the bcm47xx target had only one subtarget. Switches used by individual devices suported by the generic subtarget are listed below. Device Switch Edimax PS-1208MFG int. SoC Linksys WRT300N v1.1 Broadcom BCM5325 Linksys WRT310N v1 Broadcom BCM5397 Linksys WRT350N v1 Broadcom BCM5397 Linksys WRT610N v1 Broadcom BCM53115 Linksys WRT610N v2 Broadcom BCM53115 Linksys E3000 v1 Broadcom BCM53115 Reduce uncompressed kernel size by 8320 Bytes. Signed-off-by: Aleksander Jan Bajkowski --- target/linux/bcm47xx/config-5.10 | 1 - target/linux/bcm47xx/config-5.15 | 1 - target/linux/bcm47xx/legacy/config-default | 1 + target/linux/bcm47xx/mips74k/config-default | 1 - 4 files changed, 1 insertion(+), 3 deletions(-) diff --git a/target/linux/bcm47xx/config-5.10 b/target/linux/bcm47xx/config-5.10 index 31d6d1de39..bee300d9c0 100644 --- a/target/linux/bcm47xx/config-5.10 +++ b/target/linux/bcm47xx/config-5.10 @@ -1,4 +1,3 @@ -CONFIG_ADM6996_PHY=y CONFIG_ARCH_BINFMT_ELF_STATE=y CONFIG_ARCH_CLOCKSOURCE_DATA=y CONFIG_ARCH_DISCARD_MEMBLOCK=y diff --git a/target/linux/bcm47xx/config-5.15 b/target/linux/bcm47xx/config-5.15 index 0714c9a57c..6f091c0e7f 100644 --- a/target/linux/bcm47xx/config-5.15 +++ b/target/linux/bcm47xx/config-5.15 @@ -1,4 +1,3 @@ -CONFIG_ADM6996_PHY=y CONFIG_ARCH_32BIT_OFF_T=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_KEEP_MEMBLOCK=y diff --git a/target/linux/bcm47xx/legacy/config-default b/target/linux/bcm47xx/legacy/config-default index 4cd487e74c..b80b03b5cb 100644 --- a/target/linux/bcm47xx/legacy/config-default +++ b/target/linux/bcm47xx/legacy/config-default @@ -1,3 +1,4 @@ +CONFIG_ADM6996_PHY=y CONFIG_B44=y CONFIG_B44_PCI=y CONFIG_B44_PCICORE_AUTOSELECT=y diff --git a/target/linux/bcm47xx/mips74k/config-default b/target/linux/bcm47xx/mips74k/config-default index 96aecf0aa6..3ba49507d4 100644 --- a/target/linux/bcm47xx/mips74k/config-default +++ b/target/linux/bcm47xx/mips74k/config-default @@ -1,4 +1,3 @@ -# CONFIG_ADM6996_PHY is not set # CONFIG_BCM47XX_SSB is not set CONFIG_BGMAC=y CONFIG_BGMAC_BCMA=y From dc79b51533cfe9a7806353f6c6fd6b22cd80d536 Mon Sep 17 00:00:00 2001 From: Alexey Bartenev <41exey@proton.me> Date: Fri, 10 Mar 2023 10:35:30 -0500 Subject: [PATCH 16/16] ramips: add support for Keenetic Lite III rev. A MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit General specification: SoC Type: MediaTek MT7620N (580MHz) ROM: 8 MB SPI-NOR (W25Q64FV) RAM: 64 MB DDR (EM6AB160TSD-5G) Switch: MediaTek MT7530 Ethernet: 5 ports - 5×100MbE (WAN, LAN1-4) Wireless: 2.4 GHz (MediaTek RT5390): b/g/n Buttons: 3 button (POWER, RESET, WPS) Slide switch: 4 position (BASE, ADAPTER, BOOSTER, ACCESS POINT) Bootloader: U-Boot 1.1.3 Power: 9 VDC, 0.6 A MAC in stock: |- + | | LAN | RF-EEPROM + 0x04 | | WLAN | RF-EEPROM + 0x04 | | WAN | RF-EEPROM + 0x28 | OEM easy installation 1. Use a PC to browse to http://my.keenetic.net. 2. Go to the System section and open the Files tab. 3. Under the Files tab, there will be a list of system files. Click on the Firmware file. 4. When a modal window appears, click on the Choose File button and upload the firmware image. 5. Wait for the router to flash and reboot. OEM installation using the TFTP method 1. Download the latest firmware image and rename it to klite3_recovery.bin. 2. Set up a Tftp server on a PC (e.g. Tftpd32) and place the firmware image to the root directory of the server. 3. Power off the router and use a twisted pair cable to connect the PC to any of the router's LAN ports. 4. Configure the network adapter of the PC to use IP address 192.168.1.2 and subnet mask 255.255.255.0. 5. Power up the router while holding the reset button pressed. 6. Wait approximately for 5 seconds and then release the reset button. 7. The router should download the firmware via TFTP and complete flashing in a few minutes. After flashing is complete, use the PC to browse to http://192.168.1.1 or ssh to proceed with the configuration. Signed-off-by: Alexey Bartenev <41exey@proton.me> --- package/boot/uboot-envtools/files/ramips | 3 +- .../dts/mt7620n_zyxel_keenetic-lite-iii-a.dts | 144 ++++++++++++++++++ target/linux/ramips/image/mt7620.mk | 12 ++ .../mt7620/base-files/etc/board.d/01_leds | 1 + .../mt7620/base-files/etc/board.d/02_network | 6 + 5 files changed, 165 insertions(+), 1 deletion(-) create mode 100644 target/linux/ramips/dts/mt7620n_zyxel_keenetic-lite-iii-a.dts diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index 6a0256c568..bc56210036 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -19,7 +19,8 @@ alfa-network,r36m-e4g|\ alfa-network,tube-e4g|\ engenius,epg600|\ engenius,esr600h|\ -sitecom,wlr-4100-v1-002) +sitecom,wlr-4100-v1-002|\ +zyxel,keenetic-lite-iii-a) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x1000" ;; arcadyan,we420223-99) diff --git a/target/linux/ramips/dts/mt7620n_zyxel_keenetic-lite-iii-a.dts b/target/linux/ramips/dts/mt7620n_zyxel_keenetic-lite-iii-a.dts new file mode 100644 index 0000000000..0d1c4696d7 --- /dev/null +++ b/target/linux/ramips/dts/mt7620n_zyxel_keenetic-lite-iii-a.dts @@ -0,0 +1,144 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7620n.dtsi" + +#include +#include +#include + +/ { + compatible = "zyxel,keenetic-lite-iii-a", "ralink,mt7620n-soc"; + model = "ZyXEL Keenetic Lite III (rev. A)"; + + aliases { + led-boot = &led_wan; + led-failsafe = &led_wan; + led-running = &led_wan; + led-upgrade = &led_wan; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; // #GPIO1 + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; // #GPIO2 + linux,code = ; + }; + + sw0 { + label = "sw0"; + gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; // #GPIO17 + linux,code = ; + }; + + sw1 { + label = "sw1"; + gpios = <&gpio0 20 GPIO_ACTIVE_LOW>; // #GPIO20 + linux,code = ; + }; + + sw2 { + label = "sw2"; + gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; // #GPIO21 + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_wan: wan { + label = "green:wan"; + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; // #GPIO38 + }; + + wifi { + label = "green:wifi"; + color = ; + function = LED_FUNCTION_WLAN; + gpios = <&gpio3 0 GPIO_ACTIVE_HIGH>; // #GPIO72 + }; + }; + +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <48000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "U-Boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "U-Config"; + reg = <0x30000 0x10000>; + }; + + factory: partition@40000 { + label = "RF-EEPROM"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x7a0000>; + }; + + partition@7f0000 { + label = "Config"; + reg = <0x7f0000 0x10000>; + }; + + partition@0_1 { + label = "Full"; + reg = <0x0 0x800000>; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c"; + function = "gpio"; + }; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0x0>; +}; diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index 6e528a930b..de84b232c1 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -1471,6 +1471,18 @@ define Device/zte_q7 endef TARGET_DEVICES += zte_q7 +define Device/zyxel_keenetic-lite-iii-a + SOC := mt7620n + IMAGE_SIZE := 7872k + DEVICE_VENDOR := ZyXEL + DEVICE_MODEL := Keenetic Lite III + DEVICE_VARIANT := A + IMAGES += factory.bin + IMAGE/factory.bin := $$(sysupgrade_bin) | pad-to 64k | check-size | \ + zyimage -d 2102018 -v "ZyXEL Keenetic Lite III" +endef +TARGET_DEVICES += zyxel_keenetic-lite-iii-a + define Device/zyxel_keenetic-omni SOC := mt7620n IMAGE_SIZE := 7872k 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 36e3045a38..2deda0861a 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 @@ -55,6 +55,7 @@ planex,mzk-ex300np|\ zbtlink,zbt-we826-16m|\ zbtlink,zbt-we826-32m|\ zbtlink,zbt-wr8305rt|\ +zyxel,keenetic-lite-iii-a|\ zyxel,keenetic-omni|\ zyxel,keenetic-omni-ii|\ zyxel,keenetic-viva) diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network index 992d8a9c40..787e123e31 100644 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network @@ -28,6 +28,7 @@ ramips_setup_interfaces() zbtlink,zbt-we826-32m|\ zbtlink,zbt-we826-e|\ zbtlink,zbt-wr8305rt|\ + zyxel,keenetic-lite-iii-a|\ zyxel,keenetic-omni) ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0" @@ -404,6 +405,11 @@ ramips_setup_macs() zbtlink,zbt-we1026-5g-16m) label_mac=$(mtd_get_mac_binary factory 0x4) ;; + zyxel,keenetic-lite-iii-a) + lan_mac=$(mtd_get_mac_binary RF-EEPROM 0x4) + wan_mac=$(mtd_get_mac_binary RF-EEPROM 0x28) + label_mac=$wan_mac + ;; zyxel,keenetic-omni|\ zyxel,keenetic-omni-ii|\ zyxel,keenetic-viva)