From 2c22d7c3a4a7edcce1af656c8cddb1ab163e3d02 Mon Sep 17 00:00:00 2001 From: Sebastian Pflieger Date: Thu, 9 Jan 2025 18:10:38 +0100 Subject: [PATCH 1/8] lldpd: fix config for build without LLDP-MED The lldp_class and lldp_location config option are only valid when compiled with LLDP-MED support. If not they will cause lldpd not to start. Signed-off-by: Sebastian Pflieger Link: https://github.com/openwrt/openwrt/pull/17571 Signed-off-by: Robert Marko --- package/network/services/lldpd/Makefile | 4 +++- package/network/services/lldpd/files/lldpd.init | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package/network/services/lldpd/Makefile b/package/network/services/lldpd/Makefile index 6be9723a9b..3fbd0bf4f9 100644 --- a/package/network/services/lldpd/Makefile +++ b/package/network/services/lldpd/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=lldpd PKG_VERSION:=1.0.18 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/lldpd/lldpd/releases/download/$(PKG_VERSION)/ @@ -90,6 +90,8 @@ endif ifneq ($(CONFIG_LLDPD_WITH_LLDPMED),y) sed -i -e 's/CONFIG_LLDPD_WITH_LLDPMED=y/CONFIG_LLDPD_WITH_LLDPMED=n/g' $(1)/etc/init.d/lldpd sed -i -e '/agentxsocket/d' $(1)/etc/config/lldpd + sed -i -e '/lldp_class/d' $(1)/etc/config/lldpd + sed -i -e '/lldp_location/d' $(1)/etc/config/lldpd endif endef diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init index 3922b676b5..6c1c184bfa 100644 --- a/package/network/services/lldpd/files/lldpd.init +++ b/package/network/services/lldpd/files/lldpd.init @@ -39,7 +39,6 @@ get_config_restart_hash() { config_load 'lldpd' - config_get v 'config' 'lldp_class'; append _string "$v" "," if [ "$CONFIG_LLDPD_WITH_SNMP" = "y" ]; then config_get v 'config' 'agentxsocket'; append _string "$v" "," fi @@ -49,6 +48,7 @@ get_config_restart_hash() { config_get_bool v 'config' 'lldp_no_version'; append _string "$v" "," if [ "$CONFIG_LLDPD_WITH_LLDPMED" = "y" ]; then config_get_bool v 'config' 'lldpmed_no_inventory'; append _string "$v" "," + config_get v 'config' 'lldp_class'; append _string "$v" "," fi config_get_bool v 'config' 'enable_lldp' 1; append _string "$v" "," config_get_bool v 'config' 'force_lldp'; append _string "$v" "," @@ -243,10 +243,10 @@ start_service() { config_get_bool enable_edp 'config' 'enable_edp' 0 config_get_bool force_edp 'config' 'force_edp' 0 fi - config_get lldp_class 'config' 'lldp_class' config_get_bool lldp_no_version 'config' 'lldp_no_version' 0 if [ "$CONFIG_LLDPD_WITH_LLDPMED" = "y" ]; then config_get_bool lldpmed_no_inventory 'config' 'lldpmed_no_inventory' 0 + config_get lldp_class 'config' 'lldp_class' fi config_get_bool readonly_mode 'config' 'readonly_mode' 0 if [ "$CONFIG_LLDPD_WITH_SNMP" = "y" ]; then From 1c5ca24da6cd727f4fcb8edbe00fa66543a6c678 Mon Sep 17 00:00:00 2001 From: Luis Mita Date: Wed, 8 Jan 2025 18:10:04 -0400 Subject: [PATCH 2/8] ramips: mt7621: add support for Confiabits MT7621 v1 Hardware: - SoC: MediaTek MT7621DAT - Flash: 16 MiB cFeon - RAM: 128 MiB MT7621DAT - WLAN: 2.4 GHz (MT7603EN), 5 GHz (MT7613BEN 802.11ac) - Ethernet: 1x 10/100/1000 Mbps WAN, 3x 10/100/1000 LAN (MT7621DAT) - Buttons: 1 Reset button, 1 WPS button - LEDs: 5x Green (POWER/WAN/2.4G/5G/WPS), 1x Red (WAN) - Serial console: unpopulated header, 57600 8n1 - Power: 12 VDC, 1 A MAC: LAN MAC: label mac (eeprom@4) WAN MAC: label mac (eeprom@4) 2.4G MAC: label mac (eeprom@4) 5G MAC: label mac + 1 (eeprom@8004) Installation: The stock firmware is OpenWrt-based. If you can reach LuCI or SSH, just use the sysupgrade image with the 'Keep settings' option turned off. Signed-off-by: Luis Mita Link: https://github.com/openwrt/openwrt/pull/17534 Signed-off-by: Hauke Mehrtens --- .../dts/mt7621_confiabits_mt7621-v1.dts | 215 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 12 + .../mt7621/base-files/etc/board.d/01_leds | 7 +- .../mt7621/base-files/etc/board.d/02_network | 1 + 4 files changed, 232 insertions(+), 3 deletions(-) create mode 100644 target/linux/ramips/dts/mt7621_confiabits_mt7621-v1.dts diff --git a/target/linux/ramips/dts/mt7621_confiabits_mt7621-v1.dts b/target/linux/ramips/dts/mt7621_confiabits_mt7621-v1.dts new file mode 100644 index 0000000000..858747ecad --- /dev/null +++ b/target/linux/ramips/dts/mt7621_confiabits_mt7621-v1.dts @@ -0,0 +1,215 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include +#include + +/ { + compatible = "confiabits,mt7621-v1", "mediatek,mt7621-soc"; + model = "Confiabits MT7621 v1"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_green; + led-running = &led_power_green; + led-upgrade = &led_power_green; + }; + + chosen { + bootargs = "console=ttyS0,57600"; + }; + + keys { + compatible = "gpio-keys"; + + button-wps { + label = "wps"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + linux,code = ; + }; + + button-reset { + label = "reset"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power_green: led-power-green { + color = ; + function = LED_FUNCTION_POWER; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + led-wan-red { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + led-wlan5 { + color = ; + function = LED_FUNCTION_WLAN_5GHZ; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + led-wps { + color = ; + function = LED_FUNCTION_WPS; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + led-wlan24 { + color = ; + function = LED_FUNCTION_WLAN_2GHZ; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led-wan-green { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&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; + }; + + partition@40000 { + label = "radio"; + reg = <0x40000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_radio_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + macaddr_radio_8004: macaddr@8004 { + reg = <0x8004 0x6>; + }; + }; + }; + + partition@50000 { + label = "firmware"; + compatible = "denx,uimage"; + reg = <0x50000 0xfb0000>; + }; + }; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_radio_4>; + nvmem-cell-names = "mac-address"; +}; + +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + nvmem-cells = <&macaddr_radio_4>; + nvmem-cell-names = "mac-address"; +}; + +ðphy4 { + /delete-property/ interrupts; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + ieee80211-freq-limit = <2400000 2500000>; + + nvmem-cells = <&eeprom_radio_0>; + nvmem-cell-names = "eeprom"; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + ieee80211-freq-limit = <5000000 6000000>; + + nvmem-cells = <&eeprom_radio_8000>; + nvmem-cell-names = "eeprom"; + }; +}; + +&state_default { + gpio { + groups = "i2c", "jtag", "wdt"; + function = "gpio"; + }; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan1"; + }; + + port@1 { + status = "okay"; + label = "lan2"; + }; + + port@2 { + status = "okay"; + label = "lan3"; + }; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index aa38495224..08b3dcc64f 100755 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -687,6 +687,18 @@ define Device/comfast_cf-ew72-v2 endef TARGET_DEVICES += comfast_cf-ew72-v2 +define Device/confiabits_mt7621-v1 + $(Device/dsa-migration) + $(Device/uimage-lzma-loader) + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Confiabits + DEVICE_MODEL := MT7621 + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap \ + -uboot-envtools +endef +TARGET_DEVICES += confiabits_mt7621-v1 + define Device/cudy_m1800 $(Device/dsa-migration) DEVICE_VENDOR := Cudy diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index ec452ccd94..1542eed8f6 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -58,6 +58,10 @@ wifire,s1500-nbn) belkin,rt1800) ucidef_set_led_netdev "wan" "wan" "white:wan" "wan" ;; +confiabits,mt7621-v1|\ +netis,n6) + ucidef_set_led_netdev "wan" "wan" "green:wan" "wan" "link tx rx" + ;; cudy,wr2100) ucidef_set_led_netdev "lan1" "lan1" "green:lan1" "lan1" ucidef_set_led_netdev "lan2" "lan2" "green:lan2" "lan2" @@ -189,9 +193,6 @@ netgear,r7450) netgear,wax202) ucidef_set_led_netdev "internet" "Internet" "green:net" "wan" ;; -netis,n6) - ucidef_set_led_netdev "wan" "wan" "green:wan" "wan" "link tx rx" - ;; oraybox,x3a) ucidef_set_led_netdev "wan" "wan link" "red:status" "wan" ucidef_set_led_netdev "lan" "lan link" "green:status" "br-lan" diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index c780443c1c..f40e9616d0 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -13,6 +13,7 @@ ramips_setup_interfaces() asus,rt-ax53u|\ buffalo,wsr-2533dhpl2|\ buffalo,wsr-2533dhpls|\ + confiabits,mt7621-v1|\ gehua,ghl-r-001|\ h3c,tx1800-plus|\ h3c,tx1801-plus|\ From c9ebd4fb30773ca55cc2da6b2c1962046a2e0fff Mon Sep 17 00:00:00 2001 From: Mathew McBride Date: Thu, 22 Jun 2023 23:36:28 +0000 Subject: [PATCH 3/8] armsr: change image names to 'combined-efi' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit luci-app-attendedsysupgrade expects images to be named 'combined-efi' when the system is using EFI images. This came about as x86 has 'combined' images for legacy (BIOS) boot and 'combined-efi' for EFI systems. armsr images were originally named 'combined' only as there was no 'legacy' image type. To avoid special handling in the attendedsysupgrade code, name EFI images consistent with other targets. Signed-off-by: Mathew McBride Link: https://github.com/openwrt/luci/pull/6430 Link: https://github.com/openwrt/openwrt/pull/12963 Signed-off-by: Petr Štetiar --- target/linux/armsr/README | 4 ++-- target/linux/armsr/image/Makefile | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/target/linux/armsr/README b/target/linux/armsr/README index b4b9012826..04f01f8e30 100644 --- a/target/linux/armsr/README +++ b/target/linux/armsr/README @@ -49,7 +49,7 @@ With a EDKII or U-Boot binary for the QEMU ARM virtual machines, you can use the images in EFI mode: 32-bit: -gunzip -c bin/targets/armsr/armv7/openwrt-armsr-armv7-generic-ext4-combined.img.gz > openwrt-arm-32.img +gunzip -c bin/targets/armsr/armv7/openwrt-armsr-armv7-generic-ext4-combined-efi.img.gz > openwrt-arm-32.img qemu-system-arm -nographic \ -cpu cortex-a15 -machine virt \ -bios bin/targets/armsr/armv7/u-boot-qemu_armv7/u-boot.bin \ @@ -60,7 +60,7 @@ qemu-system-arm -nographic \ -netdev user,id=testwan -net nic,netdev=testwan 64-bit: -gunzip -c bin/targets/armsr/armv8/openwrt-armsr-armv8-generic-ext4-combined.img.gz > openwrt-arm-64.img +gunzip -c bin/targets/armsr/armv8/openwrt-armsr-armv8-generic-ext4-combined-efi.img.gz > openwrt-arm-64.img qemu-system-aarch64 -nographic \ -cpu cortex-a53 -machine virt \ -bios bin/targets/armsr/armv8/u-boot-qemu_armv8/u-boot.bin \ diff --git a/target/linux/armsr/image/Makefile b/target/linux/armsr/image/Makefile index 09c37beeec..b34c1f16e7 100644 --- a/target/linux/armsr/image/Makefile +++ b/target/linux/armsr/image/Makefile @@ -74,18 +74,18 @@ DEVICE_VARS += GRUB2_VARIANT UBOOT define Device/efi-default IMAGE/rootfs.img := append-rootfs | pad-to $(ROOTFS_PARTSIZE) IMAGE/rootfs.img.gz := append-rootfs | pad-to $(ROOTFS_PARTSIZE) | gzip - IMAGE/combined.img := grub-config efi | combined efi | grub-install efi | append-metadata - IMAGE/combined.img.gz := grub-config efi | combined efi | grub-install efi | gzip | append-metadata - IMAGE/combined.vmdk := grub-config efi | combined efi | grub-install efi | qemu-image vmdk + IMAGE/combined-efi.img := grub-config efi | combined efi | grub-install efi | append-metadata + IMAGE/combined-efi.img.gz := grub-config efi | combined efi | grub-install efi | gzip | append-metadata + IMAGE/combined-efi.vmdk := grub-config efi | combined efi | grub-install efi | qemu-image vmdk ifeq ($(CONFIG_TARGET_IMAGES_GZIP),y) IMAGES-y := rootfs.img.gz - IMAGES-y += combined.img.gz + IMAGES-y += combined-efi.img.gz else IMAGES-y := rootfs.img - IMAGES-y += combined.img + IMAGES-y += combined-efi.img endif ifeq ($(CONFIG_VMDK_IMAGES),y) - IMAGES-y += combined.vmdk + IMAGES-y += combined-efi.vmdk endif KERNEL := kernel-bin KERNEL_INSTALL := 1 From f64541db020ef5689186609e8b7b7a3bb9755160 Mon Sep 17 00:00:00 2001 From: Evan Jobling Date: Tue, 14 Jan 2025 12:13:21 +0000 Subject: [PATCH 4/8] realtek: HPE 1920 8G PoE+ 180W move fans to hwmon The GPIO numbering has changed and is not stable. As a result fan control via gpio_switch is broken, resulting in errors: "export_store: invalid GPIO 456" Move to using hwmon and gpio-fan. This is by adding gpio_fan_array to DTS and kmod-hwmon-gpiofan to DEVICE_PACKAGES. In combination with the new rtl8231 gpio driver the default fan behaviour will be maximum fan speed. Bump compat value to 1.1 due to existing config in /etc/config/system via gpio_switch. Also notify in device compat that fan is now going to be at bootloader setting (maximum in this case) by default unless turned down. Signed-off-by: Evan Jobling Link: https://github.com/openwrt/openwrt/pull/17605 Signed-off-by: Sander Vanheule --- .../realtek/base-files/etc/board.d/03_gpio_switches | 1 - .../realtek/base-files/etc/board.d/05_compat-version | 3 +++ .../realtek/dts/rtl8380_hpe_1920-8g-poe-180w.dts | 11 +++++++++++ target/linux/realtek/image/common.mk | 8 ++++++++ target/linux/realtek/image/rtl838x.mk | 3 ++- 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/target/linux/realtek/base-files/etc/board.d/03_gpio_switches b/target/linux/realtek/base-files/etc/board.d/03_gpio_switches index c869153e4c..c178bd4330 100644 --- a/target/linux/realtek/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/realtek/base-files/etc/board.d/03_gpio_switches @@ -6,7 +6,6 @@ board_config_update board=$(board_name) case "$board" in -hpe,1920-8g-poe-180w|\ hpe,1920-24g-poe-180w|\ hpe,1920-24g-poe-370w) ucidef_add_gpio_switch "fan_ctrl" "Fan control" "456" "0" diff --git a/target/linux/realtek/base-files/etc/board.d/05_compat-version b/target/linux/realtek/base-files/etc/board.d/05_compat-version index 5c4ecb9aae..687cbb32a5 100644 --- a/target/linux/realtek/base-files/etc/board.d/05_compat-version +++ b/target/linux/realtek/base-files/etc/board.d/05_compat-version @@ -8,6 +8,9 @@ board_config_update case "$(board_name)" in + hpe,1920-8g-poe-180w) + ucidef_set_compat_version "1.1" + ;; zyxel,gs1900-8 | \ zyxel,gs1900-8hp-v1 | \ zyxel,gs1900-8hp-v2 | \ diff --git a/target/linux/realtek/dts/rtl8380_hpe_1920-8g-poe-180w.dts b/target/linux/realtek/dts/rtl8380_hpe_1920-8g-poe-180w.dts index 6398e6d034..f15498354e 100644 --- a/target/linux/realtek/dts/rtl8380_hpe_1920-8g-poe-180w.dts +++ b/target/linux/realtek/dts/rtl8380_hpe_1920-8g-poe-180w.dts @@ -5,6 +5,17 @@ / { compatible = "hpe,1920-8g-poe-180w", "realtek,rtl838x-soc"; model = "HPE 1920-8G-PoE+ 180W (JG922A)"; + + gpio_fan_array { + compatible = "gpio-fan"; + + gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>; + gpio-fan,speed-map = <5000 0>, + <8200 1>; + + alarm-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; + #cooling-cells = <2>; + }; }; &uart1 { diff --git a/target/linux/realtek/image/common.mk b/target/linux/realtek/image/common.mk index d9647dbc07..e600b2347d 100644 --- a/target/linux/realtek/image/common.mk +++ b/target/linux/realtek/image/common.mk @@ -56,6 +56,14 @@ define Device/hpe_1920 append-metadata endef +define Device/hwmon-fan-migration + DEVICE_COMPAT_VERSION := 1.1 + DEVICE_COMPAT_MESSAGE := Fan control switched to hwmon. Your fans will retain \ + bootloader speed unless another control scheme is in place. \ + Config cannot be kept due to conflict in gpio_switch config 'fan_ctrl' under \ + /etc/config/system. +endef + define Device/zyxel_gs1900 DEVICE_COMPAT_VERSION := 2.0 DEVICE_COMPAT_MESSAGE := Dual firmware paritition merged due to size constraints. \ diff --git a/target/linux/realtek/image/rtl838x.mk b/target/linux/realtek/image/rtl838x.mk index 866659ad14..27dbc6ce59 100644 --- a/target/linux/realtek/image/rtl838x.mk +++ b/target/linux/realtek/image/rtl838x.mk @@ -120,9 +120,10 @@ TARGET_DEVICES += hpe_1920-8g-poe-65w define Device/hpe_1920-8g-poe-180w $(Device/hpe_1920) + $(Device/hwmon-fan-migration) SOC := rtl8380 DEVICE_MODEL := 1920-8G-PoE+ 180W (JG922A) - DEVICE_PACKAGES += realtek-poe + DEVICE_PACKAGES += realtek-poe kmod-hwmon-gpiofan H3C_DEVICE_ID := 0x00010025 SUPPORTED_DEVICES += hpe_1920-8g-poe endef From 07f8319d2d9166a41c2fd94ec1422bcd80ada991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Owoc?= Date: Sat, 17 Aug 2024 16:59:58 +0200 Subject: [PATCH 5/8] qualcommax: ipq807x: add support for Linksys HomeWRK MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hardware specification: ======== SoC: Qualcomm IPQ8174 Flash: 1GB (Micron MT29F8G08ABBCAH4 or AMD/Spansion S34MS08G2) RAM: 2GB (2x Kingston B5116ECMDXGJD or ESMT M15T2G16128A DDR3L) Ethernet: 4x 10/100/1000Mbps (Qualcomm QCA8075) WiFi1: 5GHz ax 2x2 (Qualcomm QCN5054 + Skyworks SKY85755-11) - channels 36-64 (low band) WiFi2: 2.4GHz ax 2x2 (Qualcomm QCN5024 + Skyworks SKY85340-11) WiFi3: 5GHz ax 4x4 (Qualcomm QCN5054 + Skyworks SKY85755-11) - channels 100-177 (high band) LED: 1x RGB status (NXP PCA9633) USB: 1x USB 3.0 Button: WPS, Reset Flash instructions: ======== 1. Installation from initramfs image using USB drive: Put the initramfs image on the USB drive: - dd bs=1M if=openwrt-qualcommax-ipq807x-linksys_homewrk-initramfs-uImage.itb of=/dev/sdX Connect serial console (JST PH 6-pin connector): - 1 - GND, 2 - TX, 4 - RX (115200, 8N1, 3.3V) Stop u-boot and run: - usb start && usbboot 44000000 0 && bootm 44000000 Write firmware to the flash from initramfs: - sysupgrade -n openwrt-qualcommax-ipq807x-linksys_homewrk-squashfs-sysupgrade.bin or - ubiformat /dev/mtd22 -y -f openwrt-qualcommax-ipq807x-linksys_homewrk-squashfs-factory.ubi 2. USB recovery: Put the initramfs image on the USB: - dd bs=1M if=openwrt-qualcommax-ipq807x-linksys_homewrk-initramfs-uImage.itb of=/dev/sdX Set u-boot env: - fw_setenv bootusb 'usb start && usbboot 44000000 0 && bootm 44000000' - fw_setenv bootcmd 'run bootusb; bootipq' Signed-off-by: Paweł Owoc Link: https://github.com/openwrt/openwrt/pull/17463 Signed-off-by: Robert Marko --- .../uboot-envtools/files/qualcommax_ipq807x | 5 ++ package/firmware/ipq-wifi/Makefile | 8 ++- .../arm64/boot/dts/qcom/ipq8174-homewrk.dts | 68 +++++++++++++++++++ target/linux/qualcommax/image/ipq807x.mk | 15 ++++ .../ipq807x/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/11-ath11k-caldata | 1 + .../base-files/lib/upgrade/platform.sh | 5 ++ 7 files changed, 100 insertions(+), 3 deletions(-) create mode 100644 target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-homewrk.dts diff --git a/package/boot/uboot-envtools/files/qualcommax_ipq807x b/package/boot/uboot-envtools/files/qualcommax_ipq807x index 49754338a5..0fcd55b601 100644 --- a/package/boot/uboot-envtools/files/qualcommax_ipq807x +++ b/package/boot/uboot-envtools/files/qualcommax_ipq807x @@ -29,6 +29,11 @@ edimax,cax1800) [ -n "$idx" ] && \ ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x20000" ;; +linksys,homewrk) + idx="$(find_mtd_index 0:appsblenv)" + [ -n "$idx" ] && \ + ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x40000" + ;; linksys,mx4200v1|\ linksys,mx4200v2|\ linksys,mx5300|\ diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 9821e39a85..da5fd5e23e 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -6,9 +6,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git -PKG_SOURCE_DATE:=2024-12-18 -PKG_SOURCE_VERSION:=4b849214b137b14a903112af3c2016ad9acf48c2 -PKG_MIRROR_HASH:=28162682fe7612460e42398ecc669e245fc0ece873361e3910c2dd8a56111f1c +PKG_SOURCE_DATE:=2025-01-15 +PKG_SOURCE_VERSION:=6e1801a4992fe72a98a2219f2dcd038194785971 +PKG_MIRROR_HASH:=569cf6894e21712ed6a5553b4fad0bbdeed14e0cc4b9292f5f86343f7897fc7e PKG_FLAGS:=nonshared include $(INCLUDE_DIR)/package.mk @@ -37,6 +37,7 @@ ALLWIFIBOARDS:= \ dynalink_dl-wrx36 \ edgecore_eap102 \ edimax_cax1800 \ + linksys_homewrk \ linksys_mr7350 \ linksys_mx4200 \ linksys_mx5300 \ @@ -168,6 +169,7 @@ $(eval $(call generate-ipq-wifi-package,compex_wpq873,Compex WPQ-873)) $(eval $(call generate-ipq-wifi-package,dynalink_dl-wrx36,Dynalink DL-WRX36)) $(eval $(call generate-ipq-wifi-package,edgecore_eap102,Edgecore EAP102)) $(eval $(call generate-ipq-wifi-package,edimax_cax1800,Edimax CAX1800)) +$(eval $(call generate-ipq-wifi-package,linksys_homewrk,Linksys HomeWRK)) $(eval $(call generate-ipq-wifi-package,linksys_mr7350,Linksys MR7350)) $(eval $(call generate-ipq-wifi-package,linksys_mx4200,Linksys MX4200)) $(eval $(call generate-ipq-wifi-package,linksys_mx5300,Linksys MX5300)) diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-homewrk.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-homewrk.dts new file mode 100644 index 0000000000..0e184452e3 --- /dev/null +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-homewrk.dts @@ -0,0 +1,68 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include "ipq8174-mx4x00.dtsi" + +/ { + model = "Linksys HomeWRK"; + compatible = "linksys,homewrk", "qcom,ipq8074"; + + aliases { + ethernet3 = &dp4; + ethernet4 = &dp5; + }; + + chosen { + bootargs-append = " root=/dev/ubiblock0_1"; + }; +}; + +&qpic_nand { + status = "okay"; + + nand@0 { + reg = <0>; + /* + * Some devices use Micron NAND with with 8 bit ECC + * other AMD/Spansion NAND with 4 bit ECC + *nand-ecc-strength = <4>; + *nand-ecc-step-size = <512>; + */ + nand-bus-width = <8>; + + partitions { + compatible = "qcom,smem-part"; + }; + }; +}; + +&dp2 { + status = "okay"; + phy-handle = <&qca8075_1>; + label = "wan"; +}; + +&dp3 { + status = "okay"; + phy-handle = <&qca8075_2>; + label = "lan3"; +}; + +&dp4 { + status = "okay"; + phy-handle = <&qca8075_3>; + label = "lan2"; +}; + +&dp5 { + status = "okay"; + phy-handle = <&qca8075_4>; + label = "lan1"; +}; + +&wifi { + status = "okay"; + + qcom,ath11k-calibration-variant = "Linksys-HomeWRK"; +}; diff --git a/target/linux/qualcommax/image/ipq807x.mk b/target/linux/qualcommax/image/ipq807x.mk index 260b358ce8..39fc63827c 100644 --- a/target/linux/qualcommax/image/ipq807x.mk +++ b/target/linux/qualcommax/image/ipq807x.mk @@ -156,6 +156,21 @@ define Device/edimax_cax1800 endef TARGET_DEVICES += edimax_cax1800 +define Device/linksys_homewrk + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Linksys + DEVICE_MODEL := HomeWRK + DEVICE_DTS_CONFIG := config@oak03 + BLOCKSIZE := 256k + PAGESIZE := 4096 + IMAGE_SIZE := 475m + NAND_SIZE := 1024m + SOC := ipq8174 + DEVICE_PACKAGES += kmod-leds-pca963x ipq-wifi-linksys_homewrk +endef +TARGET_DEVICES += linksys_homewrk + define Device/linksys_mx $(call Device/FitImage) DEVICE_VENDOR := Linksys diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network index 5bacbd7dee..af1d2dfebb 100644 --- a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network +++ b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network @@ -27,6 +27,7 @@ ipq807x_setup_interfaces() ucidef_set_interfaces_lan_wan "lan plc" "wan" ;; compex,wpq873|\ + linksys,homewrk|\ linksys,mx4200v1|\ linksys,mx4200v2|\ linksys,mx4300|\ diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata index 65e064ea4d..ec772de8eb 100644 --- a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata +++ b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata @@ -30,6 +30,7 @@ case "$FIRMWARE" in zte,mf269) caldata_extract "0:art" 0x1000 0x20000 ;; + linksys,homewrk|\ linksys,mx4200v1|\ linksys,mx8500) caldata_extract "0:art" 0x1000 0x20000 diff --git a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh index b53ec149fe..2d68ec62ed 100644 --- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh @@ -166,6 +166,11 @@ platform_do_upgrade() { fw_setenv upgrade_available 1 nand_do_upgrade "$1" ;; + linksys,homewrk) + CI_UBIPART="rootfs" + remove_oem_ubi_volume ubi_rootfs + nand_do_upgrade "$1" + ;; linksys,mx4200v1|\ linksys,mx4200v2|\ linksys,mx4300|\ From 9decfc82dcd0d9d90fbdbddebba053492c594ca4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Owoc?= Date: Fri, 10 Jan 2025 21:16:57 +0100 Subject: [PATCH 6/8] uboot-envtools: ipq807x: remove number of blocks and code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Envtools can automatically detect the number of blocks. Signed-off-by: Paweł Owoc Link: https://github.com/openwrt/openwrt/pull/17463 Signed-off-by: Robert Marko --- .../uboot-envtools/files/qualcommax_ipq807x | 76 +++++++++---------- 1 file changed, 34 insertions(+), 42 deletions(-) diff --git a/package/boot/uboot-envtools/files/qualcommax_ipq807x b/package/boot/uboot-envtools/files/qualcommax_ipq807x index 0fcd55b601..840e97fa10 100644 --- a/package/boot/uboot-envtools/files/qualcommax_ipq807x +++ b/package/boot/uboot-envtools/files/qualcommax_ipq807x @@ -7,79 +7,71 @@ touch /etc/config/ubootenv board=$(board_name) +ubootenv_add_mtd() { + local idx="$(find_mtd_index "${1}")" + [ -n "$idx" ] && \ + ubootenv_add_uci_config "/dev/mtd$idx" "${2}" "${3}" "${4}" +} + +ubootenv_add_sys_mtd() { + local idx="$(find_mtd_index "${1}")" + [ -n "$idx" ] && \ + ubootenv_add_uci_sys_config "/dev/mtd$idx" "${2}" "${3}" "${4}" +} + +ubootenv_add_mmc() { + local mmcpart="$(find_mmc_part "${1}")" + [ -n "$mmcpart" ] && \ + ubootenv_add_uci_config "$mmcpart" "${2}" "${3}" "${4}" "${5}" +} + case "$board" in dynalink,dl-wrx36|\ netgear,rax120v2|\ +netgear,sxr80|\ +netgear,sxs80|\ netgear,wax218|\ netgear,wax620|\ -netgear,wax630) - idx="$(find_mtd_index 0:appsblenv)" - [ -n "$idx" ] && \ - ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x20000" "2" +netgear,wax630|\ +tplink,eap620hd-v1|\ +tplink,eap660hd-v1) + ubootenv_add_mtd "0:appsblenv" "0x0" "0x40000" "0x20000" ;; compex,wpq873|\ edgecore,eap102|\ zyxel,nbg7815) - idx="$(find_mtd_index 0:appsblenv)" - [ -n "$idx" ] && \ - ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" "1" + ubootenv_add_mtd "0:appsblenv" "0x0" "0x10000" "0x10000" ;; edimax,cax1800) - idx="$(find_mtd_index 0:appsblenv)" - [ -n "$idx" ] && \ - ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x20000" + ubootenv_add_mtd "0:appsblenv" "0x0" "0x10000" "0x20000" ;; linksys,homewrk) - idx="$(find_mtd_index 0:appsblenv)" - [ -n "$idx" ] && \ - ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x40000" + ubootenv_add_mtd "0:appsblenv" "0x0" "0x40000" "0x40000" ;; linksys,mx4200v1|\ linksys,mx4200v2|\ linksys,mx5300|\ linksys,mx8500) - idx="$(find_mtd_index u_env)" - [ -n "$idx" ] && \ - ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x20000" "2" + ubootenv_add_mtd "u_env" "0x0" "0x40000" "0x20000" ;; linksys,mx4300) - idx="$(find_mtd_index u_env)" - [ -n "$idx" ] && \ - ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x40000" "1" - ;; -netgear,sxr80|\ -netgear,sxs80|\ -tplink,eap620hd-v1|\ -tplink,eap660hd-v1) - idx="$(find_mtd_index 0:appsblenv)" - [ -n "$idx" ] && \ - ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x20000" + ubootenv_add_mtd "u_env" "0x0" "0x40000" "0x40000" ;; redmi,ax6|\ xiaomi,ax3600|\ xiaomi,ax9000) - idx="$(find_mtd_index 0:appsblenv)" - [ -n "$idx" ] && \ - ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x20000" - idx2="$(find_mtd_index bdata)" - [ -n "$idx2" ] && \ - ubootenv_add_uci_sys_config "/dev/mtd$idx2" "0x0" "0x10000" "0x20000" + ubootenv_add_mtd "0:appsblenv" "0x0" "0x10000" "0x20000" + ubootenv_add_sys_mtd "bdata" "0x0" "0x10000" "0x20000" ;; prpl,haze) - mmcpart="$(find_mmc_part 0:APPSBLENV)" - [ -n "$mmcpart" ] && \ - ubootenv_add_uci_config "$mmcpart" "0x0" "0x40000" "0x400" "0x100" + ubootenv_add_mmc "0:APPSBLENV" "0x0" "0x40000" "0x400" "0x100" ;; asus,rt-ax89x|\ qnap,301w) - idx="$(find_mtd_index 0:appsblenv)" - [ -n "$idx" ] && \ - ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x20000" "0x20000" "1" + ubootenv_add_mtd "0:appsblenv" "0x0" "0x20000" "0x20000" ;; spectrum,sax1v1k) - mmcpart="$(find_mmc_part 0:APPSBLENV)" - [ -n "$mmcpart" ] && \ - ubootenv_add_uci_config "$mmcpart" "0x0" "0x40000" "0x40000" "1" + ubootenv_add_mmc "0:APPSBLENV" "0x0" "0x40000" "0x40000" "1" ;; esac From 67a4aeef6c63e5836bd6b82faf6cc15934869efb Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 15 Jan 2025 21:46:53 +0100 Subject: [PATCH 7/8] netifd: fix napi process name matching in packet steering script Fixes CPU usage imbalance on some devices using threaded NAPI Signed-off-by: Felix Fietkau --- .../config/netifd/files/usr/libexec/network/packet-steering.uc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/config/netifd/files/usr/libexec/network/packet-steering.uc b/package/network/config/netifd/files/usr/libexec/network/packet-steering.uc index a578e28879..b2229e5d79 100755 --- a/package/network/config/netifd/files/usr/libexec/network/packet-steering.uc +++ b/package/network/config/netifd/files/usr/libexec/network/packet-steering.uc @@ -87,7 +87,7 @@ function set_netdev_cpu(dev, cpu) { function task_device_match(name, device) { - let napi_match = match(name, /napi\/([^-+])-\d+/); + let napi_match = match(name, /napi\/([^-]*)-\d+/); if (!napi_match) napi_match = match(name, /mt76-tx (phy\d+)/); if (napi_match && From 0a7c8ed9d94930ba062c71df79f63c06eeab4543 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Wed, 15 Jan 2025 20:12:02 +0100 Subject: [PATCH 8/8] realtek: HPE 1920 24G PoE+ 180W/370W move fans to hwmon Apply the equivalent of commit f64541db020e ("realtek: HPE 1920 8G PoE+ 180W move fans to hwmon") to the 24-ports variants of the HPE 1920 PoE+ switches, with model numbers JG925A and JG926A. Copy from the original commit message: Move to using hwmon and gpio-fan. This is by adding gpio_fan_array to DTS and kmod-hwmon-gpiofan to DEVICE_PACKAGES. In combination with the new rtl8231 gpio driver the default fan behaviour will be maximum fan speed. Bump compat value to 1.1 due to existing config in /etc/config/system via gpio_switch. Also notify in device compat that fan is now going to be at bootloader setting (maximum in this case) by default unless turned down. As the init script 03_gpio_switches does not perform any action after removing these devices from it, the file can be dropped. Link: https://github.com/openwrt/openwrt/pull/17598 Signed-off-by: Fabian Groffen Signed-off-by: Sander Vanheule --- .../base-files/etc/board.d/03_gpio_switches | 17 ----------------- .../base-files/etc/board.d/05_compat-version | 4 +++- .../dts/rtl8382_hpe_1920-24g-poe-180w.dts | 11 +++++++++++ .../dts/rtl8382_hpe_1920-24g-poe-370w.dts | 11 +++++++++++ target/linux/realtek/image/rtl838x.mk | 6 ++++-- 5 files changed, 29 insertions(+), 20 deletions(-) delete mode 100644 target/linux/realtek/base-files/etc/board.d/03_gpio_switches diff --git a/target/linux/realtek/base-files/etc/board.d/03_gpio_switches b/target/linux/realtek/base-files/etc/board.d/03_gpio_switches deleted file mode 100644 index c178bd4330..0000000000 --- a/target/linux/realtek/base-files/etc/board.d/03_gpio_switches +++ /dev/null @@ -1,17 +0,0 @@ - -. /lib/functions/uci-defaults.sh - -board_config_update - -board=$(board_name) - -case "$board" in -hpe,1920-24g-poe-180w|\ -hpe,1920-24g-poe-370w) - ucidef_add_gpio_switch "fan_ctrl" "Fan control" "456" "0" - ;; -esac - -board_config_flush - -exit 0 diff --git a/target/linux/realtek/base-files/etc/board.d/05_compat-version b/target/linux/realtek/base-files/etc/board.d/05_compat-version index 687cbb32a5..9c27314b24 100644 --- a/target/linux/realtek/base-files/etc/board.d/05_compat-version +++ b/target/linux/realtek/base-files/etc/board.d/05_compat-version @@ -8,7 +8,9 @@ board_config_update case "$(board_name)" in - hpe,1920-8g-poe-180w) + hpe,1920-8g-poe-180w | \ + hpe,1920-24g-poe-180w | \ + hpe,1920-24g-poe-370w) ucidef_set_compat_version "1.1" ;; zyxel,gs1900-8 | \ diff --git a/target/linux/realtek/dts/rtl8382_hpe_1920-24g-poe-180w.dts b/target/linux/realtek/dts/rtl8382_hpe_1920-24g-poe-180w.dts index 4783cec15c..69e647c59a 100644 --- a/target/linux/realtek/dts/rtl8382_hpe_1920-24g-poe-180w.dts +++ b/target/linux/realtek/dts/rtl8382_hpe_1920-24g-poe-180w.dts @@ -5,6 +5,17 @@ / { compatible = "hpe,1920-24g-poe-180w", "realtek,rtl838x-soc"; model = "HPE 1920-24G-PoE+ 180W (JG925A)"; + + gpio_fan_array { + compatible = "gpio-fan"; + + gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>; + gpio-fan,speed-map = <5000 0>, + <8200 1>; + + alarm-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; + #cooling-cells = <2>; + }; }; &uart1 { diff --git a/target/linux/realtek/dts/rtl8382_hpe_1920-24g-poe-370w.dts b/target/linux/realtek/dts/rtl8382_hpe_1920-24g-poe-370w.dts index ccdcf71d1b..532f23ab2f 100644 --- a/target/linux/realtek/dts/rtl8382_hpe_1920-24g-poe-370w.dts +++ b/target/linux/realtek/dts/rtl8382_hpe_1920-24g-poe-370w.dts @@ -5,6 +5,17 @@ / { compatible = "hpe,1920-24g-poe-370w", "realtek,rtl838x-soc"; model = "HPE 1920-24G-PoE+ 370W (JG926A)"; + + gpio_fan_array { + compatible = "gpio-fan"; + + gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>; + gpio-fan,speed-map = <5000 0>, + <8200 1>; + + alarm-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; + #cooling-cells = <2>; + }; }; &uart1 { diff --git a/target/linux/realtek/image/rtl838x.mk b/target/linux/realtek/image/rtl838x.mk index 27dbc6ce59..34464316c7 100644 --- a/target/linux/realtek/image/rtl838x.mk +++ b/target/linux/realtek/image/rtl838x.mk @@ -147,18 +147,20 @@ TARGET_DEVICES += hpe_1920-24g define Device/hpe_1920-24g-poe-180w $(Device/hpe_1920) + $(Device/hwmon-fan-migration) SOC := rtl8382 DEVICE_MODEL := 1920-24G-PoE+ 180W (JG925A) - DEVICE_PACKAGES += realtek-poe + DEVICE_PACKAGES += realtek-poe kmod-hwmon-gpiofan H3C_DEVICE_ID := 0x00010028 endef TARGET_DEVICES += hpe_1920-24g-poe-180w define Device/hpe_1920-24g-poe-370w $(Device/hpe_1920) + $(Device/hwmon-fan-migration) SOC := rtl8382 DEVICE_MODEL := 1920-24G-PoE+ 370W (JG926A) - DEVICE_PACKAGES += realtek-poe + DEVICE_PACKAGES += realtek-poe kmod-hwmon-gpiofan H3C_DEVICE_ID := 0x00010029 endef TARGET_DEVICES += hpe_1920-24g-poe-370w