From e54f0353c20bd387da52daa6b604287c2c2b4b14 Mon Sep 17 00:00:00 2001 From: Grische Date: Wed, 17 Jun 2026 14:09:18 +0200 Subject: [PATCH 01/61] rockchip: add support for FriendlyARM NanoPi R2S Plus The NanoPi R2S Plus is a NanoPi R2S with on-board eMMC added. The device tree (rk3328-nanopi-r2s-plus.dts) is already present in kernel 6.12, and U-Boot support has been present since v2025.01, so neither a kernel DTS backport nor a U-Boot patch is required. Hardware -------- Rockchip RK3328 (4x Cortex-A53, up to 1.4 GHz) 1GB DDR4 RAM 32GB eMMC 5.1 microSD slot (up to 128GB) 1x 1000 Base-T (native, RTL8211F via GMAC) - WAN 1x 1000 Base-T (USB 3.0, RTL8153B) - LAN Optional M.2 SDIO Wi-Fi 2x USB 2.0 Type-A host 1x USB-C (5V power input, USB device for Maskrom update) 1x USB-C (onboard USB-to-UART debug console, 1500000 bps) 1x serial debug header / UART0 (3.3V TTL, 3-pin 2.54mm) 2 Buttons (GPIO key, Maskrom) 3 LEDs (SYS red, WAN green, LAN green) DC 5V/2A power Operating temperature 0 to 70 C The MAC addresses are derived from the eMMC CID, so they are stable regardless of whether the device boots from microSD or eMMC. Installation ------------ On RK3328 the BootROM boots the eMMC before the microSD slot, so the Maskrom button must be held to boot from microSD while stock firmware is still on the eMMC. How to boot from eMMC: 1. Write the uncompressed sysupgrade image to sdcard 2. Hold the "Mask" button while powering on the device 3. Wait until OpenWrt is fully booted 4. Copy the compressed .gz sysupgrade image to the machine's /tmp folder using scp 5. Run: gunzip -c /tmp/openwrt-...-friendlyarm_nanopi-r2s-plus-squashfs-sysupgrade.img.gz | dd of=/dev/mmcblk1 bs=4M conv=fsync 6. Power the device off, remove the sdcard and power it back on Tested: - microSD boot (via Maskrom button) and native eMMC boot - Both Ethernet ports (RTL8211F WAN, RTL8153B LAN) - eMMC-derived MAC addresses Signed-off-by: Grische Assisted-By: Claude Opus 4.8 (1M context) Link: https://github.com/openwrt/openwrt/pull/23854 Signed-off-by: Jonas Jelonek --- package/boot/uboot-rockchip/Makefile | 8 ++++++++ .../linux/rockchip/armv8/base-files/etc/board.d/01_leds | 1 + .../rockchip/armv8/base-files/etc/board.d/02_network | 2 ++ .../base-files/etc/hotplug.d/net/40-net-smp-affinity | 1 + target/linux/rockchip/image/armv8.mk | 8 ++++++++ 5 files changed, 20 insertions(+) diff --git a/package/boot/uboot-rockchip/Makefile b/package/boot/uboot-rockchip/Makefile index d174e8c98a..a054b7c3cf 100644 --- a/package/boot/uboot-rockchip/Makefile +++ b/package/boot/uboot-rockchip/Makefile @@ -71,6 +71,13 @@ define U-Boot/nanopi-r2s-rk3328 friendlyarm_nanopi-r2s endef +define U-Boot/nanopi-r2s-plus-rk3328 + $(U-Boot/rk3328/Default) + NAME:=NanoPi R2S Plus + BUILD_DEVICES:= \ + friendlyarm_nanopi-r2s-plus +endef + define U-Boot/orangepi-r1-plus-rk3328 $(U-Boot/rk3328/Default) NAME:=Orange Pi R1 Plus @@ -442,6 +449,7 @@ UBOOT_TARGETS := \ nanopi-r2c-rk3328 \ nanopi-r2c-plus-rk3328 \ nanopi-r2s-rk3328 \ + nanopi-r2s-plus-rk3328 \ orangepi-r1-plus-rk3328 \ orangepi-r1-plus-lts-rk3328 \ roc-cc-rk3328 \ diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds b/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds index 4a166ad46e..6cb8dfebb4 100644 --- a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds +++ b/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds @@ -12,6 +12,7 @@ friendlyarm,nanopi-m5|\ friendlyarm,nanopi-r2c|\ friendlyarm,nanopi-r2c-plus|\ friendlyarm,nanopi-r2s|\ +friendlyarm,nanopi-r2s-plus|\ friendlyarm,nanopi-r3s|\ friendlyarm,nanopi-r4s|\ friendlyarm,nanopi-r4s-enterprise|\ diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network index 8ce236b8e2..df457b2e08 100644 --- a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network +++ b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network @@ -12,6 +12,7 @@ rockchip_setup_interfaces() friendlyarm,nanopi-r2c|\ friendlyarm,nanopi-r2c-plus|\ friendlyarm,nanopi-r2s|\ + friendlyarm,nanopi-r2s-plus|\ friendlyarm,nanopi-r3s|\ friendlyarm,nanopi-r4s|\ friendlyarm,nanopi-r4s-enterprise|\ @@ -93,6 +94,7 @@ rockchip_setup_macs() lan_mac=$(macaddr_add "$wan_mac" 1) ;; friendlyarm,nanopi-r2c-plus|\ + friendlyarm,nanopi-r2s-plus|\ friendlyarm,nanopi-r4s|\ friendlyarm,nanopi-r5s|\ sinovoip,rk3568-bpi-r2pro) diff --git a/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity b/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity index 1bd35b1e3b..4d734e514d 100644 --- a/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity +++ b/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity @@ -45,6 +45,7 @@ sinovoip,rk3568-bpi-r2pro) friendlyarm,nanopi-r2c|\ friendlyarm,nanopi-r2c-plus|\ friendlyarm,nanopi-r2s|\ +friendlyarm,nanopi-r2s-plus|\ radxa,cm3-io|\ xunlong,orangepi-r1-plus|\ xunlong,orangepi-r1-plus-lts) diff --git a/target/linux/rockchip/image/armv8.mk b/target/linux/rockchip/image/armv8.mk index 5e99eec835..3c81e47d96 100644 --- a/target/linux/rockchip/image/armv8.mk +++ b/target/linux/rockchip/image/armv8.mk @@ -120,6 +120,14 @@ define Device/friendlyarm_nanopi-r2s endef TARGET_DEVICES += friendlyarm_nanopi-r2s +define Device/friendlyarm_nanopi-r2s-plus + $(Device/rk3328) + DEVICE_VENDOR := FriendlyARM + DEVICE_MODEL := NanoPi R2S Plus + DEVICE_PACKAGES := kmod-usb-net-rtl8152 +endef +TARGET_DEVICES += friendlyarm_nanopi-r2s-plus + define Device/friendlyarm_nanopi-r3s $(Device/rk3566) DEVICE_VENDOR := FriendlyARM From 673df8f6a9eddb5ce93c112003820c6dc95140ae Mon Sep 17 00:00:00 2001 From: Fil Dunsky Date: Fri, 5 Jun 2026 17:53:45 +0300 Subject: [PATCH 02/61] mediatek: add support Livinet Li320 This commit adds support for Livinet Li320 wireless router. Specification ------------- - SoC : MediaTek MT7981B dual-core ARM Cortex-A53 - RAM : 512MB - Flash : SPI-NAND Fudan Micro FM25S01BI3 - WLAN : MediaTek MT7976 dual-band Wi-Fi 6 - Ethernet : MediaTek MT7531 switch, 1x WAN + 3x LAN (2.5GbE uplink via gmac0) - Buttons : WPS, Reset - LEDs : 8xGreen, 1xRed - Power : Barrel DC 12v Installation ------------ The factory firmware is a compatible OpenWrt-based fork, allowing direct installation via the LuCI upgrade page using the sysupgrade image. MAC addresses ------------- | Interface | MAC source | |-----------|--------------------------| | LAN | Factory 0x4 (mac-base -1)| | WAN | Factory 0x4 (mac-base -2)| | WLAN 2.4G | Factory 0x4 (mac-base) | | WLAN 5G | Factory 0x4 (mac-base +1)| Signed-off-by: Fil Dunsky Link: https://github.com/openwrt/openwrt/pull/23744 Signed-off-by: Jonas Jelonek --- .../mediatek/dts/mt7981b-livinet-li320.dts | 326 ++++++++++++++++++ .../filogic/base-files/etc/board.d/01_leds | 9 + .../filogic/base-files/etc/board.d/02_network | 1 + target/linux/mediatek/image/filogic.mk | 11 + 4 files changed, 347 insertions(+) create mode 100644 target/linux/mediatek/dts/mt7981b-livinet-li320.dts diff --git a/target/linux/mediatek/dts/mt7981b-livinet-li320.dts b/target/linux/mediatek/dts/mt7981b-livinet-li320.dts new file mode 100644 index 0000000000..b443a06000 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-livinet-li320.dts @@ -0,0 +1,326 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include +#include +#include + +#include "mt7981b.dtsi" + +/ { + model = "Livinet Li320"; + compatible = "livinet,li320", "mediatek,mt7981"; + + aliases { + label-mac-device = &wan; + + led-boot = &led_power_green; + led-failsafe = &led_wan_red; + led-running = &led_power_green; + led-upgrade = &led_wan_red; + + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory@40000000 { + reg = <0 0x40000000 0 0x20000000>; + device_type = "memory"; + }; + + gpio-keys { + compatible = "gpio-keys"; + + button-0 { + label = "wps"; + /* Reassigned to RF_KILL */ + linux,code = ; + gpios = <&pio 0 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + button-1 { + label = "reset"; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led-0 { + color = ; + function = LED_FUNCTION_WLAN_5GHZ; + gpios = <&pio 2 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + led_wan_red: led-1 { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&pio 27 GPIO_ACTIVE_HIGH>; + }; + + led_power_green: led-2 { + color = ; + function = LED_FUNCTION_POWER; + gpios = <&pio 28 GPIO_ACTIVE_LOW>; + }; + + led-3 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <1>; + gpios = <&pio 9 GPIO_ACTIVE_LOW>; + }; + + led-4 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <2>; + gpios = <&pio 10 GPIO_ACTIVE_LOW>; + }; + + led-5 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <3>; + gpios = <&pio 11 GPIO_ACTIVE_LOW>; + }; + + led-6 { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&pio 29 GPIO_ACTIVE_LOW>; + }; + + led-7 { + color = ; + function = LED_FUNCTION_WLAN_2GHZ; + gpios = <&pio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led-8 { + color = ; + function = LED_FUNCTION_USB; + gpios = <&pio 31 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ð { + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_factory_4 (-1)>; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; +}; + +&mdio_bus { + switch: switch@1f { + compatible = "mediatek,mt7531"; + reg = <0x1f>; + reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&pio>; + interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_flash_pins>; + status = "okay"; + + spi_nand: flash@0 { + compatible = "spi-nand"; + reg = <0>; + + spi-max-frequency = <52000000>; + spi-tx-buswidth = <4>; + spi-rx-buswidth = <4>; + + spi-cal-enable; + spi-cal-mode = "read-data"; + spi-cal-datalen = <7>; + spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4e 0x41 0x4e 0x44>; + spi-cal-addrlen = <5>; + spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>; + + mediatek,nmbm; + mediatek,bmt-max-ratio = <1>; + mediatek,bmt-max-reserved-blocks = <64>; + + partitions: partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "BL2"; + reg = <0x00000 0x100000>; + read-only; + }; + + partition@100000 { + label = "u-boot-env"; + reg = <0x100000 0x80000>; + }; + + factory: partition@180000 { + label = "Factory"; + reg = <0x180000 0x200000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x1000>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@380000 { + label = "FIP"; + reg = <0x380000 0x200000>; + read-only; + }; + + ubi: partition@580000 { + label = "ubi"; + reg = <0x580000 0x6000000>; + }; + + partition@6580000 { + label = "zrsave"; + reg = <0x6580000 0x100000>; + }; + + partition@6680000 { + label = "config2"; + reg = <0x6680000 0x100000>; + read-only; + }; + }; + }; +}; + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan1"; + }; + + port@2 { + reg = <2>; + label = "lan2"; + }; + + port@3 { + reg = <3>; + label = "lan3"; + }; + + wan: port@4 { + reg = <4>; + label = "wan"; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_factory_4 (-2)>; + }; + + port@6 { + reg = <6>; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; +}; + +&pio { + spi0_flash_pins: spi0-pins { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + + conf-pu { + pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP"; + drive-strength = ; + bias-pull-up = ; + }; + + conf-pd { + pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; + drive-strength = ; + bias-pull-down = ; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&wifi { + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; + + band@0 { + reg = <0>; + nvmem-cells = <&macaddr_factory_4 (0)>; + nvmem-cell-names = "mac-address"; + }; + + band@1 { + reg = <1>; + nvmem-cells = <&macaddr_factory_4 (1)>; + nvmem-cell-names = "mac-address"; + }; +}; diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds index c27e41e73b..38812f9b3c 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds @@ -148,6 +148,15 @@ keenetic,kn-3711|\ keenetic,kn-3811) ucidef_set_led_netdev "internet" "internet" "green:wan" "wan" "link" ;; +livinet,li320) + ucidef_set_led_netdev "wlan2g" "WLAN2G" "green:wlan-2ghz" "phy0-ap0" + ucidef_set_led_netdev "wlan5g" "WLAN5G" "green:wlan-5ghz" "phy1-ap0" + ucidef_set_led_netdev "lan-1" "lan-1" "green:lan-1" "lan1" "link tx rx" + ucidef_set_led_netdev "lan-2" "lan-2" "green:lan-2" "lan2" "link tx rx" + ucidef_set_led_netdev "lan-3" "lan-3" "green:lan-3" "lan3" "link tx rx" + ucidef_set_led_netdev "wan-off" "wan-off" "red:wan" "wan" "link" + ucidef_set_led_netdev "wan" "wan" "green:wan" "wan" "link" + ;; mercusys,mr80x-v3) ucidef_set_led_netdev "lan1" "lan-1" "green:lan-1" "lan1" "link tx rx" ucidef_set_led_netdev "lan2" "lan-2" "green:lan-2" "lan2" "link tx rx" diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index 36d79b80d7..a33449f6cf 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -63,6 +63,7 @@ mediatek_setup_interfaces() jcg,q30-pro|\ keenetic,kn-3711|\ keenetic,kn-3811|\ + livinet,li320|\ netis,nx32u|\ qihoo,360t7|\ qihoo,360t7-ubi|\ diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 7d2eefbf7a..27b5d3e1b1 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -2218,6 +2218,17 @@ define Device/konka_komi-a31 endef TARGET_DEVICES += konka_komi-a31 +define Device/livinet_li320 + DEVICE_VENDOR := Livinet + DEVICE_MODEL := Li320 + DEVICE_DTS := mt7981b-livinet-li320 + DEVICE_DTS_DIR := ../dts + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + SUPPORTED_DEVICES += mediatek,mt7981-spim-snand-gsw-rfb +endef +TARGET_DEVICES += livinet_li320 + define Device/mediatek_mt7981-rfb DEVICE_VENDOR := MediaTek DEVICE_MODEL := MT7981 rfb From 0d747a8edbc48a72066feedfd937048874b19169 Mon Sep 17 00:00:00 2001 From: Florian Maurer Date: Sun, 31 May 2026 20:14:38 +0000 Subject: [PATCH 03/61] wifi-scripts: ucode: only set antenna when config changes mac80211's ieee80211_set_antenna() rejects calls with -EOPNOTSUPP once the radio is started (local->started == true). The spurious failure triggers a wpa_supplicant invocation in the error path, producing both a "command failed: Not supported (-122)" message and (where wpa_supplicant is not installed) a "/bin/sh: wpa_supplicant: not found" message in the log on every wifi reconfiguration. In this code path, reset_config() tears down all interfaces before the antenna is touched, so local->started is false exactly when the antenna config has changed. Skip the iw phy set antenna call otherwise, matching the behaviour of mainline OpenWrt's bash mac80211.sh. The trade-off is that we no longer re-assert the antenna mask on warm reconf if it was cleared out-of-band (e.g. by a driver reload); in practice drivers do not clear it mid-life. Also split the antenna details out of the generic "Configuring '${phy}' distance: ..." log line so it isn't claimed when the call was skipped. Assisted-by: Claude:claude-sonnet-4-6 Signed-off-by: Florian Maurer Link: https://github.com/openwrt/openwrt/pull/23607 Signed-off-by: Jonas Jelonek --- .../files-ucode/lib/netifd/wireless/mac80211.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh index 6230f90287..6f80b30d59 100755 --- a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh +++ b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh @@ -83,7 +83,9 @@ function setup_phy(phy, config, data) { if (config.rxantenna == 'all') config.rxantenna = 0xffffffff; - if (config.txantenna != data?.txantenna || config.rxantenna != data?.rxantenna) + let antenna_changed = (config.txantenna != data?.txantenna || config.rxantenna != data?.rxantenna); + + if (antenna_changed) reset_config(phy, config.radio); netifd.set_data({ @@ -98,8 +100,11 @@ function setup_phy(phy, config, data) { else config.txpower = 'auto'; - log(`Configuring '${phy}' txantenna: ${config.txantenna}, rxantenna: ${config.rxantenna} distance: ${config.distance}`); - system(`iw phy ${phy} set antenna ${config.txantenna} ${config.rxantenna}`); + log(`Configuring '${phy}' distance: ${config.distance}`); + if (antenna_changed) { + log(`Setting antenna for '${phy}' txantenna: ${config.txantenna}, rxantenna: ${config.rxantenna}`); + system(`iw phy ${phy} set antenna ${config.txantenna} ${config.rxantenna}`); + } system(`iw phy ${phy} set distance ${config.distance}`); system(`iw phy ${phy} set txpower ${config.txpower}`); From 010e8b731a98ab180a8a4826e2d03c19b244fe22 Mon Sep 17 00:00:00 2001 From: Florian Maurer Date: Sun, 31 May 2026 21:04:26 +0000 Subject: [PATCH 04/61] wifi-scripts: ucode: remove trailing whitespace Removes trailing whitespace from mac80211.sh Signed-off-by: Florian Maurer Link: https://github.com/openwrt/openwrt/pull/23607 Signed-off-by: Jonas Jelonek --- .../wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh index 6f80b30d59..3ed59fba16 100755 --- a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh +++ b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh @@ -217,7 +217,7 @@ function setup() { idx[mode] ??= 0; let mode_idx = idx[mode]++; - if (!v.config.ifname) + if (!v.config.ifname) v.config.ifname = data.ifname_prefix + mode + mode_idx; push(active_ifnames, v.config.ifname); From 946b820856057a801f596cc96df31c21eaa60f4f Mon Sep 17 00:00:00 2001 From: Florian Maurer Date: Sun, 31 May 2026 21:04:41 +0000 Subject: [PATCH 05/61] wifi-scripts: ucode: check wpa_supplicant exists before mesh probe The mesh capability check unconditionally ran wpa_supplicant -vmesh to detect driver support. On devices where wpa_supplicant is not installed, this produces a "/bin/sh: wpa_supplicant: not found" error in the logs on every wifi reconfiguration even when no mesh interface is configured. Guard the invocation with fs.access() so the binary is only executed when it is actually present, and use its absolute path to avoid relying on $PATH. Signed-off-by: Florian Maurer Link: https://github.com/openwrt/openwrt/pull/23607 Signed-off-by: Jonas Jelonek --- .../wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh index 3ed59fba16..fa924cb1db 100755 --- a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh +++ b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh @@ -250,7 +250,7 @@ function setup() { break; // fallthrough case 'mesh': - supplicant_mesh ??= !system("wpa_supplicant -vmesh"); + supplicant_mesh ??= (fs.access('/usr/sbin/wpa_supplicant', 'x') && !system("/usr/sbin/wpa_supplicant -vmesh")); if (mode == "mesh" && !supplicant_mesh) break; // fallthrough From 1ab6f5506ff97889b2fa5982dd0583261403f9cd Mon Sep 17 00:00:00 2001 From: David Yang Date: Fri, 1 May 2026 23:23:52 +0800 Subject: [PATCH 06/61] ramips: timecloud: increase SPI flash speed Thunder Timecloud uses MX25L12835FM2I-10G which supports fast read and up to 133MHz. Increase its speed. Signed-off-by: David Yang Link: https://github.com/openwrt/openwrt/pull/23182 Signed-off-by: Jonas Jelonek --- target/linux/ramips/dts/mt7621_thunder_timecloud.dts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/linux/ramips/dts/mt7621_thunder_timecloud.dts b/target/linux/ramips/dts/mt7621_thunder_timecloud.dts index 82efb0352e..c244612061 100644 --- a/target/linux/ramips/dts/mt7621_thunder_timecloud.dts +++ b/target/linux/ramips/dts/mt7621_thunder_timecloud.dts @@ -62,7 +62,8 @@ flash@0 { compatible = "jedec,spi-nor"; reg = <0>; - spi-max-frequency = <10000000>; + spi-max-frequency = <50000000>; + m25p,fast-read; partitions { compatible = "fixed-partitions"; From f2f8b83fdce7e2ef9e30183a5cfa7cad1b179049 Mon Sep 17 00:00:00 2001 From: David Yang Date: Fri, 1 May 2026 23:26:19 +0800 Subject: [PATCH 07/61] ramips: timecloud: fix eject button The 'BTN_0' is actually for safe hard drive removal and activated high. Fix it. Signed-off-by: David Yang Link: https://github.com/openwrt/openwrt/pull/23182 Signed-off-by: Jonas Jelonek --- target/linux/ramips/dts/mt7621_thunder_timecloud.dts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/linux/ramips/dts/mt7621_thunder_timecloud.dts b/target/linux/ramips/dts/mt7621_thunder_timecloud.dts index c244612061..e8527dd049 100644 --- a/target/linux/ramips/dts/mt7621_thunder_timecloud.dts +++ b/target/linux/ramips/dts/mt7621_thunder_timecloud.dts @@ -44,10 +44,10 @@ linux,code = ; }; - BTN_0 { - label = "BTN_0"; - gpios = <&gpio 4 GPIO_ACTIVE_LOW>; - linux,code = ; + eject { + label = "eject"; + gpios = <&gpio 4 GPIO_ACTIVE_HIGH>; + linux,code = ; }; }; }; From 6420c5f1e9e74aaa6289f4f8bdbb939af013ebf1 Mon Sep 17 00:00:00 2001 From: David Yang Date: Sat, 2 May 2026 01:21:08 +0800 Subject: [PATCH 08/61] ramips: timecloud: add label-mac-device The only MAC address of the device is labeled at the bottom. Signed-off-by: David Yang Link: https://github.com/openwrt/openwrt/pull/23182 Signed-off-by: Jonas Jelonek --- target/linux/ramips/dts/mt7621_thunder_timecloud.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/ramips/dts/mt7621_thunder_timecloud.dts b/target/linux/ramips/dts/mt7621_thunder_timecloud.dts index e8527dd049..e7aef36200 100644 --- a/target/linux/ramips/dts/mt7621_thunder_timecloud.dts +++ b/target/linux/ramips/dts/mt7621_thunder_timecloud.dts @@ -13,6 +13,7 @@ led-failsafe = &led_statuso; led-running = &led_statuso; led-upgrade = &led_statuso; + label-mac-device = &gmac0; }; chosen { From 3392fd35132fc46a8ea96bf4ee6856b44a7229cb Mon Sep 17 00:00:00 2001 From: David Yang Date: Sat, 2 May 2026 01:43:00 +0800 Subject: [PATCH 09/61] ramips: timecloud: fix LED configs The LED(s) does not have a label for status, ethernet, or whatsoever. These two LEDs, are used to form one dual-color indicator. On vendor firmware, the light is turned from orange to white, when external storage is detected and ready to use. However, if we use white for any other triggers (USB / SD card / ethernet), it is difficult to see while the orange is on. Thus, we change led-running to white to indicate a successful startup. Also add the missing pinmux config for uart3 since LEDs take GPIO 7 and 8. Signed-off-by: David Yang Link: https://github.com/openwrt/openwrt/pull/23182 Signed-off-by: Jonas Jelonek --- .../linux/ramips/dts/mt7621_thunder_timecloud.dts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/target/linux/ramips/dts/mt7621_thunder_timecloud.dts b/target/linux/ramips/dts/mt7621_thunder_timecloud.dts index e7aef36200..dfd5a70547 100644 --- a/target/linux/ramips/dts/mt7621_thunder_timecloud.dts +++ b/target/linux/ramips/dts/mt7621_thunder_timecloud.dts @@ -9,10 +9,10 @@ model = "Thunder Timecloud"; aliases { - led-boot = &led_statuso; - led-failsafe = &led_statuso; - led-running = &led_statuso; - led-upgrade = &led_statuso; + led-boot = &led_orange; + led-failsafe = &led_orange; + led-running = &led_white; + led-upgrade = &led_orange; label-mac-device = &gmac0; }; @@ -23,13 +23,13 @@ leds { compatible = "gpio-leds"; - statw { + led_white: white { function = LED_FUNCTION_STATUS; color = ; gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; }; - led_statuso: stato { + led_orange: orange { function = LED_FUNCTION_STATUS; color = ; gpios = <&gpio 8 GPIO_ACTIVE_HIGH>; @@ -124,7 +124,7 @@ &state_default { gpio { - groups = "i2c", "uart2", "jtag"; + groups = "i2c", "uart2", "uart3", "jtag"; function = "gpio"; }; }; From 002e7613e06fdc32e3b339b7a281528bd4106193 Mon Sep 17 00:00:00 2001 From: Dimitri Souza Date: Fri, 26 Jun 2026 19:59:43 -0300 Subject: [PATCH 10/61] mediatek: acer-predator-w6x: add LED boot status support Define led-boot, led-failsafe, led-running, and led-upgrade in the Acer Predator W6X DTSI so the system LED reflects the standard OpenWrt boot and runtime states. Signed-off-by: Dimitri Souza Link: https://github.com/openwrt/openwrt/pull/23958 Signed-off-by: Jonas Jelonek --- target/linux/mediatek/dts/mt7986a-acer-predator-w6x.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/linux/mediatek/dts/mt7986a-acer-predator-w6x.dtsi b/target/linux/mediatek/dts/mt7986a-acer-predator-w6x.dtsi index fb5b5d63c2..c97f30af0d 100644 --- a/target/linux/mediatek/dts/mt7986a-acer-predator-w6x.dtsi +++ b/target/linux/mediatek/dts/mt7986a-acer-predator-w6x.dtsi @@ -11,6 +11,10 @@ / { aliases { serial0 = &uart0; + led-boot = &led_status_rgb; + led-failsafe = &led_status_rgb; + led-running = &led_status_rgb; + led-upgrade = &led_status_rgb; }; chosen: chosen { From ab40696d6134c842a93112a7a0325a148b3b1a2b Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Fri, 26 Jun 2026 23:20:56 +0800 Subject: [PATCH 11/61] toolchain: gcc: update GCC 14 to 14.4 Changelog: https://gcc.gnu.org/gcc-14/changes.html Remove upstreamed patches: - patches-14.x/004-libcody-Make-it-buildable-by-C-11-to-C-26.patch[1] - patches-14.x/005-include-memory.patch[2] - patches-14.x/240-libsanitizer-fix-termio-glibc-2.40.patch[3] All other patches are automatically refreshed. [1] https://gcc.gnu.org/cgit/gcc/commit/?h=releases/gcc-14.4.0&id=daa3e1ead791bc58208043cfc4595ba1a78cdd34 [2] https://gcc.gnu.org/cgit/gcc/commit/?h=releases/gcc-14.4.0&id=046776dac7cc74bdbab36f450af80644a045858a [3] https://gcc.gnu.org/cgit/gcc/commit/?h=releases/gcc-14.4.0&id=f0feb51ff40553643c582ec9c3ca7f293721ddc8 Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/23950 Signed-off-by: Robert Marko --- toolchain/gcc/Config.version | 2 +- toolchain/gcc/common.mk | 4 +- ...dy-Make-it-buildable-by-C-11-to-C-26.patch | 250 ------------------ .../gcc/patches-14.x/005-include-memory.patch | 72 ----- ...0-libsanitizer-fix-termio-glibc-2.40.patch | 53 ---- .../gcc/patches-14.x/910-mbsd_multi.patch | 2 +- 6 files changed, 4 insertions(+), 379 deletions(-) delete mode 100644 toolchain/gcc/patches-14.x/004-libcody-Make-it-buildable-by-C-11-to-C-26.patch delete mode 100644 toolchain/gcc/patches-14.x/005-include-memory.patch delete mode 100644 toolchain/gcc/patches-14.x/240-libsanitizer-fix-termio-glibc-2.40.patch diff --git a/toolchain/gcc/Config.version b/toolchain/gcc/Config.version index d933661522..aaf0efbf3f 100644 --- a/toolchain/gcc/Config.version +++ b/toolchain/gcc/Config.version @@ -11,7 +11,7 @@ config GCC_VERSION default EXTERNAL_GCC_VERSION if EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN default "13.4.0" if GCC_VERSION_13 default "15.3.0" if GCC_VERSION_15 - default "14.3.0" + default "14.4.0" config GCC_USE_DEFAULT_VERSION bool diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk index 10bc7070bf..8a802dc531 100644 --- a/toolchain/gcc/common.mk +++ b/toolchain/gcc/common.mk @@ -34,8 +34,8 @@ ifeq ($(PKG_VERSION),13.4.0) PKG_HASH:=9c4ce6dbb040568fdc545588ac03c5cbc95a8dbf0c7aa490170843afb59ca8f5 endif -ifeq ($(PKG_VERSION),14.3.0) - PKG_HASH:=e0dc77297625631ac8e50fa92fffefe899a4eb702592da5c32ef04e2293aca3a +ifeq ($(PKG_VERSION),14.4.0) + PKG_HASH:=752b6f567beac83159c77a7680b1316bdd784738bff9a9d070112c09da90f6d9 endif ifeq ($(PKG_VERSION),15.3.0) diff --git a/toolchain/gcc/patches-14.x/004-libcody-Make-it-buildable-by-C-11-to-C-26.patch b/toolchain/gcc/patches-14.x/004-libcody-Make-it-buildable-by-C-11-to-C-26.patch deleted file mode 100644 index db25be919a..0000000000 --- a/toolchain/gcc/patches-14.x/004-libcody-Make-it-buildable-by-C-11-to-C-26.patch +++ /dev/null @@ -1,250 +0,0 @@ -From daa3e1ead791bc58208043cfc4595ba1a78cdd34 Mon Sep 17 00:00:00 2001 -From: Jakub Jelinek -Date: Fri, 21 Nov 2025 16:25:58 +0100 -Subject: [PATCH] libcody: Make it buildable by C++11 to C++26 - -The following builds with -std=c++11 and c++14 and c++17 and c++20 and c++23 -and c++26. - -I see the u8 string literals are mixed e.g. with strerror, so in --fexec-charset=IBM1047 there will still be garbage, so am not 100% sure if -the u8 literals everywhere are worth it either. - -2025-11-21 Jakub Jelinek - - * cody.hh (S2C): For __cpp_char8_t >= 201811 use char8_t instead of - char in argument type. - (MessageBuffer::Space): Revert 2025-11-15 change. - (MessageBuffer::Append): For __cpp_char8_t >= 201811 add overload - with char8_t const * type of first argument. - (Packet::Packet): Similarly for first argument. - * client.cc (CommunicationError, Client::ProcessResponse, - Client::Connect, ConnectResponse, PathnameResponse, OKResponse, - IncludeTranslateResponse): Cast u8 string literals to (const char *) - where needed. - * server.cc (Server::ProcessRequests, ConnectRequest): Likewise. - -(cherry picked from commit 07a767c7a50d1daae8ef7d4aba73fe53ad40c0b7) ---- - libcody/client.cc | 36 +++++++++++++++++++----------------- - libcody/cody.hh | 22 ++++++++++++++++++++++ - libcody/server.cc | 28 ++++++++++++++-------------- - 3 files changed, 55 insertions(+), 31 deletions(-) - ---- a/libcody/client.cc -+++ b/libcody/client.cc -@@ -97,7 +97,7 @@ int Client::CommunicateWithServer () - - static Packet CommunicationError (int err) - { -- std::string e {u8"communication error:"}; -+ std::string e {(const char *) u8"communication error:"}; - e.append (strerror (err)); - - return Packet (Client::PC_ERROR, std::move (e)); -@@ -110,33 +110,34 @@ Packet Client::ProcessResponse (std::vec - { - if (e == EINVAL) - { -- std::string msg (u8"malformed string '"); -+ std::string msg ((const char *) u8"malformed string '"); - msg.append (words[0]); -- msg.append (u8"'"); -+ msg.append ((const char *) u8"'"); - return Packet (Client::PC_ERROR, std::move (msg)); - } - else -- return Packet (Client::PC_ERROR, u8"missing response"); -+ return Packet (Client::PC_ERROR, (const char *) u8"missing response"); - } - - Assert (!words.empty ()); -- if (words[0] == u8"ERROR") -+ if (words[0] == (const char *) u8"ERROR") - return Packet (Client::PC_ERROR, -- words.size () == 2 ? words[1]: u8"malformed error response"); -+ words.size () == 2 ? words[1] -+ : (const char *) u8"malformed error response"); - - if (isLast && !read.IsAtEnd ()) - return Packet (Client::PC_ERROR, -- std::string (u8"unexpected extra response")); -+ std::string ((const char *) u8"unexpected extra response")); - - Assert (code < Detail::RC_HWM); - Packet result (responseTable[code] (words)); - result.SetRequest (code); - if (result.GetCode () == Client::PC_ERROR && result.GetString ().empty ()) - { -- std::string msg {u8"malformed response '"}; -+ std::string msg {(const char *) u8"malformed response '"}; - - read.LexedLine (msg); -- msg.append (u8"'"); -+ msg.append ((const char *) u8"'"); - result.GetString () = std::move (msg); - } - else if (result.GetCode () == Client::PC_CONNECT) -@@ -199,7 +200,7 @@ Packet Client::Connect (char const *agen - size_t alen, size_t ilen) - { - write.BeginLine (); -- write.AppendWord (u8"HELLO"); -+ write.AppendWord ((const char *) u8"HELLO"); - write.AppendInteger (Version); - write.AppendWord (agent, true, alen); - write.AppendWord (ident, true, ilen); -@@ -211,7 +212,8 @@ Packet Client::Connect (char const *agen - // HELLO $version $agent [$flags] - Packet ConnectResponse (std::vector &words) - { -- if (words[0] == u8"HELLO" && (words.size () == 3 || words.size () == 4)) -+ if (words[0] == (const char *) u8"HELLO" -+ && (words.size () == 3 || words.size () == 4)) - { - char *eptr; - unsigned long val = strtoul (words[1].c_str (), &eptr, 10); -@@ -247,7 +249,7 @@ Packet Client::ModuleRepo () - // PATHNAME $dir | ERROR - Packet PathnameResponse (std::vector &words) - { -- if (words[0] == u8"PATHNAME" && words.size () == 2) -+ if (words[0] == (const char *) u8"PATHNAME" && words.size () == 2) - return Packet (Client::PC_PATHNAME, std::move (words[1])); - - return Packet (Client::PC_ERROR, u8""); -@@ -256,7 +258,7 @@ Packet PathnameResponse (std::vector &words) - { -- if (words[0] == u8"OK") -+ if (words[0] == (const char *) u8"OK") - return Packet (Client::PC_OK); - else - return Packet (Client::PC_ERROR, -@@ -319,11 +321,11 @@ Packet Client::IncludeTranslate (char co - // PATHNAME $cmifile - Packet IncludeTranslateResponse (std::vector &words) - { -- if (words[0] == u8"BOOL" && words.size () == 2) -+ if (words[0] == (const char *) u8"BOOL" && words.size () == 2) - { -- if (words[1] == u8"FALSE") -- return Packet (Client::PC_BOOL, 0); -- else if (words[1] == u8"TRUE") -+ if (words[1] == (const char *) u8"FALSE") -+ return Packet (Client::PC_BOOL); -+ else if (words[1] == (const char *) u8"TRUE") - return Packet (Client::PC_BOOL, 1); - else - return Packet (Client::PC_ERROR, u8""); ---- a/libcody/cody.hh -+++ b/libcody/cody.hh -@@ -47,12 +47,21 @@ namespace Detail { - - // C++11 doesn't have utf8 character literals :( - -+#if __cpp_char8_t >= 201811 -+template -+constexpr char S2C (char8_t const (&s)[I]) -+{ -+ static_assert (I == 2, "only single octet strings may be converted"); -+ return s[0]; -+} -+#else - template - constexpr char S2C (char const (&s)[I]) - { - static_assert (I == 2, "only single octet strings may be converted"); - return s[0]; - } -+#endif - - /// Internal buffering class. Used to concatenate outgoing messages - /// and Lex incoming ones. -@@ -123,6 +132,13 @@ public: - Space (); - Append (str, maybe_quote, len); - } -+#if __cpp_char8_t >= 201811 -+ void AppendWord (char8_t const *str, bool maybe_quote = false, -+ size_t len = ~size_t (0)) -+ { -+ AppendWord ((const char *) str, maybe_quote, len); -+ } -+#endif - /// Add a word as with AppendWord - /// @param str the string to append - /// @param maybe_quote string might need quoting, as for Append -@@ -264,6 +280,12 @@ public: - : string (s), cat (STRING), code (c) - { - } -+#if __cpp_char8_t >= 201811 -+ Packet (unsigned c, const char8_t *s) -+ : string ((const char *) s), cat (STRING), code (c) -+ { -+ } -+#endif - Packet (unsigned c, std::vector &&v) - : vector (std::move (v)), cat (VECTOR), code (c) - { ---- a/libcody/server.cc -+++ b/libcody/server.cc -@@ -36,12 +36,12 @@ static RequestPair - const requestTable[Detail::RC_HWM] = - { - // Same order as enum RequestCode -- RequestPair {u8"HELLO", nullptr}, -- RequestPair {u8"MODULE-REPO", ModuleRepoRequest}, -- RequestPair {u8"MODULE-EXPORT", ModuleExportRequest}, -- RequestPair {u8"MODULE-IMPORT", ModuleImportRequest}, -- RequestPair {u8"MODULE-COMPILED", ModuleCompiledRequest}, -- RequestPair {u8"INCLUDE-TRANSLATE", IncludeTranslateRequest}, -+ RequestPair {(const char *) u8"HELLO", nullptr}, -+ RequestPair {(const char *) u8"MODULE-REPO", ModuleRepoRequest}, -+ RequestPair {(const char *) u8"MODULE-EXPORT", ModuleExportRequest}, -+ RequestPair {(const char *) u8"MODULE-IMPORT", ModuleImportRequest}, -+ RequestPair {(const char *) u8"MODULE-COMPILED", ModuleCompiledRequest}, -+ RequestPair {(const char *) u8"INCLUDE-TRANSLATE", IncludeTranslateRequest}, - }; - } - -@@ -135,21 +135,21 @@ void Server::ProcessRequests (void) - std::string msg; - - if (err > 0) -- msg = u8"error processing '"; -+ msg = (const char *) u8"error processing '"; - else if (ix >= Detail::RC_HWM) -- msg = u8"unrecognized '"; -+ msg = (const char *) u8"unrecognized '"; - else if (IsConnected () && ix == Detail::RC_CONNECT) -- msg = u8"already connected '"; -+ msg = (const char *) u8"already connected '"; - else if (!IsConnected () && ix != Detail::RC_CONNECT) -- msg = u8"not connected '"; -+ msg = (const char *) u8"not connected '"; - else -- msg = u8"malformed '"; -+ msg = (const char *) u8"malformed '"; - - read.LexedLine (msg); -- msg.append (u8"'"); -+ msg.append ((const char *) u8"'"); - if (err > 0) - { -- msg.append (u8" "); -+ msg.append ((const char *) u8" "); - msg.append (strerror (err)); - } - resolver->ErrorResponse (this, std::move (msg)); -@@ -176,7 +176,7 @@ Resolver *ConnectRequest (Server *s, Res - return nullptr; - - if (words.size () == 3) -- words.emplace_back (u8""); -+ words.emplace_back ((const char *) u8""); - unsigned version = ParseUnsigned (words[1]); - if (version == ~0u) - return nullptr; diff --git a/toolchain/gcc/patches-14.x/005-include-memory.patch b/toolchain/gcc/patches-14.x/005-include-memory.patch deleted file mode 100644 index 35bc780343..0000000000 --- a/toolchain/gcc/patches-14.x/005-include-memory.patch +++ /dev/null @@ -1,72 +0,0 @@ -From: Lars Gierth - -This patch backports a small but important part of the upstream commit: - -b3f1b9e2aa07 build: Remove INCLUDE_MEMORY [PR117737] - -Its original commit message fails to mention that the commit also moves -the `#include ` to an earlier position within system.h, -which is the actual change that we're after in this patch. - -Building our GCC 14.3 with host GCC 16, the inclusion order starts to matter, -which is an issue that was also touched upon by the upstream commits: - -9970b576b7e4 Include safe-ctype.h after C++ standard headers, to avoid over-poisoning -f6e00226a4ca build: Move sstream include above safe-ctype.h {PR117771] - -Error log: - - > gcc -v - Using built-in specs. - COLLECT_GCC=gcc - COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/16/lto-wrapper - OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa - OFFLOAD_TARGET_DEFAULT=1 - Target: x86_64-redhat-linux - Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,m2,cobol,algol68,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugzilla.redhat.com/ --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --enable-libstdcxx-backtrace --with-libstdcxx-zoneinfo=/usr/share/zoneinfo --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-16.0.1-build/gcc-16.0.1-20260321/obj-x86_64-redhat-linux/isl-install --enable-offload-targets=nvptx-none,amdgcn-amdhsa --enable-offload-defaulted --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-tls=gnu2 --with-arch_32=i686 --build=x86_64-redhat-linux --with-build-config=bootstrap-lto --enable-link-serialization=1 --disable-libssp - Thread model: posix - Supported LTO compression algorithms: zlib zstd - gcc version 16.0.1 20260321 (Red Hat 16.0.1-0) (GCC) - > git clean -fdx - > make defconfig - > make V=s - [...] - make[5]: Entering directory '/home/user/w/ow/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-14.3.0_musl/gcc-14.3.0-initial/gcc' - g++ -fno-PIE -c -DIN_GCC_FRONTEND -O2 -I/home/user/w/ow/openwrt/staging_dir/host/include -pipe -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -fno-PIE -I. -Ic -I/home/user/w/ow/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-14.3.0_musl/gcc-14.3.0/gcc -I/home/user/w/ow/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-14.3.0_musl/gcc-14.3.0/gcc/c -I/home/user/w/ow/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-14.3.0_musl/gcc-14.3.0/gcc/../include -I/home/user/w/ow/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-14.3.0_musl/gcc-14.3.0/gcc/../libcpp/include -I/home/user/w/ow/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-14.3.0_musl/gcc-14.3.0/gcc/../libcody -I/home/user/w/ow/openwrt/staging_dir/host/include -I/home/user/w/ow/openwrt/staging_dir/host/include -I/home/user/w/ow/openwrt/staging_dir/host/include -I/home/user/w/ow/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-14.3.0_musl/gcc-14.3.0/gcc/../libdecnumber -I/home/user/w/ow/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-14.3.0_musl/gcc-14.3.0/gcc/../libdecnumber/dpd -I../libdecnumber -I/home/user/w/ow/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-14.3.0_musl/gcc-14.3.0/gcc/../libbacktrace -o c/c-decl.o -MT c/c-decl.o -MMD -MP -MF c/.deps/c-decl.TPo /home/user/w/ow/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-14.3.0_musl/gcc-14.3.0/gcc/c/c-decl.cc - In file included from /usr/include/c++/16/bits/basic_ios.h:40, - from /usr/include/c++/16/ios:48, - from /usr/include/c++/16/bits/ostream.h:43, - from /usr/include/c++/16/bits/unique_ptr.h:42, - from /usr/include/c++/16/memory:80, - from /home/user/w/ow/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-14.3.0_musl/gcc-14.3.0/gcc/system.h:766, - from /home/user/w/ow/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-14.3.0_musl/gcc-14.3.0/gcc/c/c-decl.cc:30: - /usr/include/c++/16/bits/locale_facets.h:252:53: error: macro 'toupper' passed 2 arguments, but takes just 1 - 252 | toupper(char_type *__lo, const char_type* __hi) const - | ^ - [...] - - ---- a/gcc/system.h -+++ b/gcc/system.h -@@ -222,6 +222,7 @@ extern int fprintf_unlocked (FILE *, con - #ifdef INCLUDE_FUNCTIONAL - # include - #endif -+# include - # include - # include - # include -@@ -758,13 +759,6 @@ private: - #define LIKELY(x) (__builtin_expect ((x), 1)) - #define UNLIKELY(x) (__builtin_expect ((x), 0)) - --/* Some of the headers included by can use "abort" within a -- namespace, e.g. "_VSTD::abort();", which fails after we use the -- preprocessor to redefine "abort" as "fancy_abort" below. */ -- --#ifdef INCLUDE_MEMORY --# include --#endif - - #ifdef INCLUDE_MUTEX - # include diff --git a/toolchain/gcc/patches-14.x/240-libsanitizer-fix-termio-glibc-2.40.patch b/toolchain/gcc/patches-14.x/240-libsanitizer-fix-termio-glibc-2.40.patch deleted file mode 100644 index b2ceac73ce..0000000000 --- a/toolchain/gcc/patches-14.x/240-libsanitizer-fix-termio-glibc-2.40.patch +++ /dev/null @@ -1,53 +0,0 @@ -From: Backport from GCC 15 - -libsanitizer: remove struct termio and legacy ioctl interceptors for glibc - -glibc 2.43 no longer exposes struct termio (the old UNIX System V -terminal struct) through . The old TCGETA/TCSETA/TCSETAF/ -TCSETAW ioctls that operated on struct termio are legacy interfaces -superseded by the POSIX TCGETS/TCSETS family using struct termios. - -GCC 15 already dropped these; this patch backports that removal to GCC 14. - ---- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp -+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp -@@ -479,9 +479,6 @@ - unsigned struct_input_id_sz = sizeof(struct input_id); - unsigned struct_mtpos_sz = sizeof(struct mtpos); - unsigned struct_rtentry_sz = sizeof(struct rtentry); --#if SANITIZER_GLIBC || SANITIZER_ANDROID -- unsigned struct_termio_sz = sizeof(struct termio); --#endif - unsigned struct_vt_consize_sz = sizeof(struct vt_consize); - unsigned struct_vt_sizes_sz = sizeof(struct vt_sizes); - unsigned struct_vt_stat_sz = sizeof(struct vt_stat); ---- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h -+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h -@@ -1012,7 +1012,6 @@ - extern unsigned struct_input_absinfo_sz; - extern unsigned struct_input_id_sz; - extern unsigned struct_mtpos_sz; --extern unsigned struct_termio_sz; - extern unsigned struct_vt_consize_sz; - extern unsigned struct_vt_sizes_sz; - extern unsigned struct_vt_stat_sz; ---- a/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc -+++ b/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc -@@ -338,17 +338,9 @@ - _(SOUND_PCM_WRITE_CHANNELS, WRITE, sizeof(int)); - _(SOUND_PCM_WRITE_FILTER, WRITE, sizeof(int)); - _(TCFLSH, NONE, 0); --#if SANITIZER_GLIBC -- _(TCGETA, WRITE, struct_termio_sz); --#endif - _(TCGETS, WRITE, struct_termios_sz); - _(TCSBRK, NONE, 0); - _(TCSBRKP, NONE, 0); --#if SANITIZER_GLIBC -- _(TCSETA, READ, struct_termio_sz); -- _(TCSETAF, READ, struct_termio_sz); -- _(TCSETAW, READ, struct_termio_sz); --#endif - _(TCSETS, READ, struct_termios_sz); - _(TCSETSF, READ, struct_termios_sz); - _(TCSETSW, READ, struct_termios_sz); diff --git a/toolchain/gcc/patches-14.x/910-mbsd_multi.patch b/toolchain/gcc/patches-14.x/910-mbsd_multi.patch index 2a58df3cb6..5ae895c9c3 100644 --- a/toolchain/gcc/patches-14.x/910-mbsd_multi.patch +++ b/toolchain/gcc/patches-14.x/910-mbsd_multi.patch @@ -114,7 +114,7 @@ Date: Tue Jul 31 00:52:27 2007 +0000 ; On SVR4 targets, it also controls whether or not to emit a --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -10597,6 +10597,17 @@ This option is only supported for C and +@@ -10601,6 +10601,17 @@ This option is only supported for C and This warning is upgraded to an error by @option{-pedantic-errors}. From 257aee0cc0306de8bae6b3095908983c3db856d5 Mon Sep 17 00:00:00 2001 From: Shine <4c.fce2@proton.me> Date: Mon, 29 Jun 2026 09:23:45 +0200 Subject: [PATCH 12/61] scripts: dhcpv6: don't report custom ip6class if default odhcp6c returns delegated prefixes with a "class=" tag if a custom IAID was specified in the -P argument. This tag must then be used for any prefix filter ("network..ip6class") instead of the uplink i/f name. OpenWrt by default uses the first eight digits of the uplink i/f name's MD5 hash as IAID. Don't report a custom "class" tag for this default IAID. Fixes: f08cd5ce5d66d76fa6e282d6e3f29bab9cdf8023 Signed-off-by: Shine <4c.fce2@proton.me> Tested-by: Goetz Goerisch Link: https://github.com/openwrt/openwrt/pull/23989 Signed-off-by: Robert Marko --- package/network/ipv6/odhcp6c/files/dhcpv6.script | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script index 94f1952ecc..189bd4fea5 100755 --- a/package/network/ipv6/odhcp6c/files/dhcpv6.script +++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script @@ -1,10 +1,12 @@ #!/bin/sh [ -z "$2" ] && echo "Error: should be run by odhcpc6c" && exit 1 . /lib/functions.sh +. /lib/functions/network.sh . /lib/netifd/netifd-proto.sh setup_interface () { local device="$1" + local iaid local prefsig="" local addrsig="" @@ -42,7 +44,9 @@ setup_interface () { proto_add_dns_search "$domain" done + network_generate_iface_iaid iaid "$device" for prefix in $PREFIXES; do + prefix="${prefix/,class=$iaid/}" proto_add_ipv6_prefix "$prefix" prefsig="$prefsig ${prefix%%,*}" local entry="${prefix#*/}" From d083212e1105b56dec645108bc03bc3172eb7c81 Mon Sep 17 00:00:00 2001 From: Luiz Angelo Daros de Luca Date: Thu, 31 Mar 2022 01:15:44 -0300 Subject: [PATCH 13/61] ramips: ethernet: ralink: mt7620 enable jumbo frames mt7620 can forward jumbo frames up to 2048. The fe_change_mtu() was already compatible except for the GDM_FWD_CFG address. An MTU greater than 1500 is required to use DSA tags with a stacked switch chip. This patch enables jumbo frame support by default. Signed-off-by: Andrey Melnikov Signed-off-by: Luiz Angelo Daros de Luca Link: https://github.com/openwrt/openwrt/pull/23933 Signed-off-by: Robert Marko --- .../drivers/net/ethernet/ralink/gsw_mt7620.c | 8 ++++++ .../drivers/net/ethernet/ralink/gsw_mt7620.h | 7 +++++- .../drivers/net/ethernet/ralink/mtk_eth_soc.c | 25 ++++++++++++------- .../drivers/net/ethernet/ralink/soc_mt7620.c | 3 ++- 4 files changed, 32 insertions(+), 11 deletions(-) diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c index ac447ba7cb..8965f73211 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c @@ -178,6 +178,8 @@ static void mt7620_ephy_init(struct mt7620_gsw *gsw) static void mt7620_mac_init(struct mt7620_gsw *gsw) { + u32 val; + /* Internal ethernet requires PCIe RC mode */ rt_sysc_w32(rt_sysc_r32(SYSC_REG_CFG1) | PCIE_RC_MODE, SYSC_REG_CFG1); @@ -190,6 +192,12 @@ static void mt7620_mac_init(struct mt7620_gsw *gsw) /* Set Port 6 as CPU Port */ mtk_switch_w32(gsw, 0x7f7f7fe0, 0x0010); + val = mtk_switch_r32(gsw, GSW_REG_GMACCR); + val &= ~((GMACCR_JMB_LEN_MASK << GMACCR_JMB_LEN_SHIFT) | GMACCR_MAX_RX_PKT_LEN_MASK); + /* Set 2k max frame size and set MAX_RX_PKT_LEN to jumbo mode */ + val |= (2 << GMACCR_JMB_LEN_SHIFT) | GMACCR_MAX_RX_PKT_LEN_JUMBO; + mtk_switch_w32(gsw, val, GSW_REG_GMACCR); + /* Enable MIB stats */ mtk_switch_w32(gsw, mtk_switch_r32(gsw, GSW_REG_MIB_CNT_EN) | (1 << 1), GSW_REG_MIB_CNT_EN); } diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.h b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.h index 12cab39b77..4252bc22a6 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.h +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.h @@ -53,7 +53,12 @@ #define GSW_REG_MAC_P1_MCR 0x200 // Global MAC control register -#define GSW_REG_GMACCR 0x30E0 +#define GSW_REG_GMACCR 0x3FE0 /* correct address per MT7620A datasheet */ +#define GMACCR_JMB_LEN_MASK 0x0F +#define GMACCR_JMB_LEN_SHIFT 2 +// MAX_RX_PKT_LEN field (bits 0:1): 0=1518, 1=1536, 2=jumbo +#define GMACCR_MAX_RX_PKT_LEN_MASK 0x3 +#define GMACCR_MAX_RX_PKT_LEN_JUMBO 0x2 #define SYSC_REG_CHIP_REV_ID 0x0c #define SYSC_REG_CFG1 0x14 diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c index 928449ae98..9c8b34aac0 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c @@ -41,7 +41,14 @@ #include "mdio.h" #include "ethtool.h" +#if defined(CONFIG_SOC_MT7620) +#define DMA_FWD_REG MT7620A_GDMA1_FWD_CFG +#define MAX_RX_LENGTH 2048 +#else +#define DMA_FWD_REG FE_GDMA1_FWD_CFG #define MAX_RX_LENGTH 1536 +#endif + #define FE_RX_ETH_HLEN (VLAN_ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN) #define FE_RX_HLEN (NET_SKB_PAD + FE_RX_ETH_HLEN + NET_IP_ALIGN) #define DMA_DUMMY_DESC 0xffffffff @@ -1169,7 +1176,7 @@ void fe_fwd_config(struct fe_priv *priv) { u32 fwd_cfg; - fwd_cfg = fe_r32(FE_GDMA1_FWD_CFG); + fwd_cfg = fe_r32(DMA_FWD_REG); /* disable jumbo frame */ if (priv->flags & FE_FLAG_JUMBO_FRAME) @@ -1178,19 +1185,19 @@ void fe_fwd_config(struct fe_priv *priv) /* set unicast/multicast/broadcast frame to cpu */ fwd_cfg &= ~0xffff; - fe_w32(fwd_cfg, FE_GDMA1_FWD_CFG); + fe_w32(fwd_cfg, DMA_FWD_REG); } static void fe_rxcsum_config(bool enable) { if (enable) - fe_w32(fe_r32(FE_GDMA1_FWD_CFG) | (FE_GDM1_ICS_EN | + fe_w32(fe_r32(DMA_FWD_REG) | (FE_GDM1_ICS_EN | FE_GDM1_TCS_EN | FE_GDM1_UCS_EN), - FE_GDMA1_FWD_CFG); + DMA_FWD_REG); else - fe_w32(fe_r32(FE_GDMA1_FWD_CFG) & ~(FE_GDM1_ICS_EN | + fe_w32(fe_r32(DMA_FWD_REG) & ~(FE_GDM1_ICS_EN | FE_GDM1_TCS_EN | FE_GDM1_UCS_EN), - FE_GDMA1_FWD_CFG); + DMA_FWD_REG); } static void fe_txcsum_config(bool enable) @@ -1450,7 +1457,7 @@ static int fe_change_mtu(struct net_device *dev, int new_mtu) fe_stop(dev); if (!IS_ENABLED(CONFIG_SOC_MT7621)) { - fwd_cfg = fe_r32(FE_GDMA1_FWD_CFG); + fwd_cfg = fe_r32(DMA_FWD_REG); if (new_mtu <= ETH_DATA_LEN) { fwd_cfg &= ~FE_GDM1_JMB_EN; } else { @@ -1459,7 +1466,7 @@ static int fe_change_mtu(struct net_device *dev, int new_mtu) fwd_cfg |= (DIV_ROUND_UP(frag_size, 1024) << FE_GDM1_JMB_LEN_SHIFT) | FE_GDM1_JMB_EN; } - fe_w32(fwd_cfg, FE_GDMA1_FWD_CFG); + fe_w32(fwd_cfg, DMA_FWD_REG); } return fe_open(dev); @@ -1581,7 +1588,7 @@ static int fe_probe(struct platform_device *pdev) NETIF_F_HW_VLAN_CTAG_RX); netdev->features |= netdev->hw_features; - if (IS_ENABLED(CONFIG_SOC_MT7621)) + if (IS_ENABLED(CONFIG_SOC_MT7620) || IS_ENABLED(CONFIG_SOC_MT7621)) netdev->max_mtu = 2048; /* fake rx vlan filter func. to support tx vlan offload func */ diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c index e2b2aceff9..15c595df15 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c @@ -332,7 +332,8 @@ static void mt7620_init_data(struct fe_soc_data *data, struct fe_priv *priv = netdev_priv(netdev); priv->flags = FE_FLAG_PADDING_64B | FE_FLAG_RX_2B_OFFSET | - FE_FLAG_RX_SG_DMA | FE_FLAG_HAS_SWITCH; + FE_FLAG_RX_SG_DMA | FE_FLAG_HAS_SWITCH | + FE_FLAG_JUMBO_FRAME; netdev->hw_features = NETIF_F_IP_CSUM | NETIF_F_RXCSUM | NETIF_F_HW_VLAN_CTAG_TX; From a24bdc2e9f84622e7b86471a394e83ab96f2b09b Mon Sep 17 00:00:00 2001 From: Luiz Angelo Daros de Luca Date: Fri, 7 Jan 2022 01:47:06 -0300 Subject: [PATCH 14/61] ramips: ethernet: ralink: fix MT7620A_GDMA regs Registers in MT7620A_GDMA_OFFSET range were incorrect, except for the first one GDM_FWD_CFG (which is actually the only one in use). The next and last register is GDM_SHPR_CFG. All others are not mentioned in docs. Signed-off-by: Luiz Angelo Daros de Luca Link: https://github.com/openwrt/openwrt/pull/23933 Signed-off-by: Robert Marko --- .../ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h index 151caae1dc..95f4af2554 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h @@ -151,10 +151,7 @@ enum fe_work_flag { #define MT7620A_GDMA_OFFSET 0x0600 #endif #define MT7620A_GDMA1_FWD_CFG (MT7620A_GDMA_OFFSET + 0x00) -#define MT7620A_FE_GDMA1_SCH_CFG (MT7620A_GDMA_OFFSET + 0x04) -#define MT7620A_FE_GDMA1_SHPR_CFG (MT7620A_GDMA_OFFSET + 0x08) -#define MT7620A_FE_GDMA1_MAC_ADRL (MT7620A_GDMA_OFFSET + 0x0C) -#define MT7620A_FE_GDMA1_MAC_ADRH (MT7620A_GDMA_OFFSET + 0x10) +#define MT7620A_FE_GDMA1_SHPR_CFG (MT7620A_GDMA_OFFSET + 0x04) #define RT5350_TX_BASE_PTR0 (RT5350_PDMA_OFFSET + 0x00) #define RT5350_TX_MAX_CNT0 (RT5350_PDMA_OFFSET + 0x04) From 84aafc08d7346ee5c3d7b5e53d213d543d791517 Mon Sep 17 00:00:00 2001 From: Luiz Angelo Daros de Luca Date: Fri, 7 Jan 2022 02:24:03 -0300 Subject: [PATCH 15/61] ramips: ethernet: ralink: mtu change while interface is down fe_change_mtu didn't update the registers if the interface was down. DSA increases the CPU port MTU to accommodate the CPU tag. As this happens while the CPU port was still down, the chip regs didn't get updated and larger frames were dropped. Signed-off-by: Luiz Angelo Daros de Luca Link: https://github.com/openwrt/openwrt/pull/23933 Signed-off-by: Robert Marko --- .../files/drivers/net/ethernet/ralink/mtk_eth_soc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c index 9c8b34aac0..3fc8ce8530 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c @@ -1452,10 +1452,9 @@ static int fe_change_mtu(struct net_device *dev, int new_mtu) priv->rx_ring.frag_size = PAGE_SIZE; priv->rx_ring.rx_buf_size = fe_max_buf_size(priv->rx_ring.frag_size); - if (!netif_running(dev)) - return 0; + if (netif_running(dev)) + fe_stop(dev); - fe_stop(dev); if (!IS_ENABLED(CONFIG_SOC_MT7621)) { fwd_cfg = fe_r32(DMA_FWD_REG); if (new_mtu <= ETH_DATA_LEN) { @@ -1469,7 +1468,10 @@ static int fe_change_mtu(struct net_device *dev, int new_mtu) fe_w32(fwd_cfg, DMA_FWD_REG); } - return fe_open(dev); + if (netif_running(dev)) + return fe_open(dev); + + return 0; } static const struct net_device_ops fe_netdev_ops = { From 3c0a73b4d202f61b796a10551ed07ce55a7f90c0 Mon Sep 17 00:00:00 2001 From: Luiz Angelo Daros de Luca Date: Tue, 25 Jan 2022 10:20:23 -0300 Subject: [PATCH 16/61] ramips: ethernet: ralink: fix offload with diff dsa tag DSA copies the driver features to slave device, including offload capabilites. Once a packet is sent though a DSA slave interface, according to its features, the kernel does not calculate checksums, expecting that the HW will fill the gaps. DSA adds the defined DSA tag and sends the tagged packet through the master device. Ethertype DSA tags expect the driver to calculate checksum based on the csum_start/csum_offset. However, mtk_eth_soc does not use that info. mtk_eth_soc checks the network header and decides if the HW can manage that packet, unaware that mac layer now contains an extra DSA tag. When that tag is the Mediatek CPU tag, offload will work as expected. When it is an incompatible DSA tag (all but Mediatek) or if DSA is stacking two incompatible DSA tags, the driver will still count on the HW offload. In this case, packets go to the network with an incorrect checksum. This patch adds an extra check and disables offloading when DSA tag is in use and it is not Mediatek. Offloading is also disabled even when DSA tag is Mediatek but there is something else increasing the mac layer region (possibly another stacked tag). Mediatek tag can encode 802.1Q info and using vlan tags will still use offloading. Other mac layer protocols that are not supported by Mediatek will disable HW offloading. PPPoE was not tested but it is expected that it will disable offloading. This code is heuristically trying to keep HW offload enable with DSA tags. Anyway, in the worse case, offloading is disabled and there is an increase in overhead, which is better than packet with wrong checksum. Signed-off-by: Luiz Angelo Daros de Luca Link: https://github.com/openwrt/openwrt/pull/23933 Signed-off-by: Robert Marko --- .../drivers/net/ethernet/ralink/mtk_eth_soc.c | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c index 3fc8ce8530..7d601acd2f 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c @@ -41,6 +41,10 @@ #include "mdio.h" #include "ethtool.h" +#if IS_ENABLED(CONFIG_NET_DSA) +#include +#endif + #if defined(CONFIG_SOC_MT7620) #define DMA_FWD_REG MT7620A_GDMA1_FWD_CFG #define MAX_RX_LENGTH 2048 @@ -786,6 +790,41 @@ err_out: return -1; } +#if IS_ENABLED(CONFIG_NET_DSA) +#define MTK_HDR_LEN 4 + +static netdev_features_t fe_features_check(struct sk_buff *skb, + struct net_device *dev, + netdev_features_t features) +{ + /* No point in doing any of this if neither checksum nor GSO are + * being requested for this frame. We can rule out both by just + * checking for CHECKSUM_PARTIAL + */ + if (skb->ip_summed != CHECKSUM_PARTIAL) + return features; + + /* DSA tag might break existing offload checks as offload feature flags + * are copied to slave ports and this driver does not use csum_start. */ + if (netdev_uses_dsa(dev)) { + const struct dsa_device_ops *tag_ops = dev->dsa_ptr->tag_ops; + + /* If tag is Mediatek, checksum should work */ + if (tag_ops->proto == DSA_TAG_PROTO_MTK) + /* However, make sure that it is not stacking another + * L2 protocol, possibly a second incompatible DSA tag + * 802.1Q does not increase the mac header size because + * it is embedded inside mediatek tag */ + if (skb_mac_header_len(skb) <= ETH_HLEN + MTK_HDR_LEN) + return features; + + features &= ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK); + } + + return features; +} +#endif + static inline int fe_skb_padto(struct sk_buff *skb, struct fe_priv *priv) { unsigned int len; @@ -1491,6 +1530,9 @@ static const struct net_device_ops fe_netdev_ops = { #ifdef CONFIG_NET_POLL_CONTROLLER .ndo_poll_controller = fe_poll_controller, #endif +#if IS_ENABLED(CONFIG_NET_DSA) + .ndo_features_check = fe_features_check, +#endif }; static void fe_reset_pending(struct fe_priv *priv) From 0a64c7a7b6d9ca5805a9a5ff2067b6694dbc5010 Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Wed, 3 Jun 2026 16:51:29 +0200 Subject: [PATCH 17/61] ramips: ethernet: ralink: add mediatek,no-swconfig property Skip swconfig registration and disable MAC learning when the "mediatek,no-swconfig" property is set. This is needed for MT7620 devices using the internal switch as a transparent bridge to an external RGMII switch, where ports 0-4 are unused. The no-swconfig property itself is valid for both DSA and non-DSA setups. However, disabling MAC learning is only required for DSA, where multiple CPU-facing interfaces would otherwise cause an incorrect ARL table to be built. Non-DSA setups work correctly without disabling MAC learning. Signed-off-by: Mieczyslaw Nalewaj Link: https://github.com/openwrt/openwrt/pull/23933 Signed-off-by: Robert Marko --- .../drivers/net/ethernet/ralink/mt7530.c | 32 +++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mt7530.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/mt7530.c index 07f092a2f8..277a98cbe7 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mt7530.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mt7530.c @@ -84,9 +84,12 @@ enum { }; #define REG_ESW_PORT_PCR(x) (0x2004 | ((x) << 8)) +#define REG_ESW_PORT_PSC(x) (0x200C | ((x) << 8)) #define REG_ESW_PORT_PVC(x) (0x2010 | ((x) << 8)) #define REG_ESW_PORT_PPBV1(x) (0x2014 | ((x) << 8)) +#define REG_ESW_PORT_PSC_SA_DIS BIT(4) + #define REG_ESW_PORT_PCR_MIRROR_SRC_RX_BIT BIT(8) #define REG_ESW_PORT_PCR_MIRROR_SRC_TX_BIT BIT(9) #define REG_ESW_PORT_PCR_MIRROR_SRC_RX_MASK 0x0100 @@ -1008,6 +1011,7 @@ mt7530_probe(struct device *dev, void __iomem *base, struct mii_bus *bus, int vl struct mt7530_priv *mt7530; struct mt7530_mapping *map; int ret; + int i; mt7530 = devm_kzalloc(dev, sizeof(struct mt7530_priv), GFP_KERNEL); if (!mt7530) @@ -1030,18 +1034,26 @@ mt7530_probe(struct device *dev, void __iomem *base, struct mii_bus *bus, int vl swdev->vlans = MT7530_NUM_VLANS; swdev->ops = &mt7530_ops; - ret = register_switch(swdev, NULL); - if (ret) { - dev_err(dev, "failed to register mt7530\n"); - return ret; + if (!of_property_present(dev->of_node, "mediatek,no-swconfig")) { + ret = register_switch(swdev, NULL); + if (ret) { + dev_err(dev, "failed to register %s\n", swdev->name); + return ret; + } + + map = mt7530_find_mapping(dev->of_node); + if (map) + mt7530_apply_mapping(mt7530, map); + mt7530_apply_config(swdev); + } else { + pr_info("%s: swconfig disabled, MAC learning disabled on all ports\n", swdev->name); + + for (i = 0; i < MT7530_NUM_PORTS; i++) { + mt7530_w32(mt7530, REG_ESW_PORT_PSC(i), + mt7530_r32(mt7530, REG_ESW_PORT_PSC(i)) | REG_ESW_PORT_PSC_SA_DIS); + } } - - map = mt7530_find_mapping(dev->of_node); - if (map) - mt7530_apply_mapping(mt7530, map); - mt7530_apply_config(swdev); - /* magic vodoo */ if (bus && mt7530_r32(mt7530, REG_HWTRAP) != 0x1117edf) { dev_info(dev, "fixing up MHWTRAP register - bootloader probably played with it\n"); From f4ddf8d7efb7bdc27ee25f9a7753fe8d73ccac85 Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Sat, 6 Jun 2026 08:45:54 +0200 Subject: [PATCH 18/61] realtek: irq: backport upstream patches The interrupt driver downstream patches have been sent upstream and got accepted. Backport them and make the driver free of downstream hacks. Link: https://github.com/openwrt/openwrt/pull/23679 Signed-off-by: Markus Stockhausen --- ...tek-rtl-Add-simplify-register-helper.patch | 135 ++++++ ...rq-realtek-rtl-Add-multicore-support.patch | 184 ++++++++ ...ltek-rtl-Use-helper-for-parent-setup.patch | 106 +++++ ...tek-rtl-Add-interrupt-data-structure.patch | 117 +++++ ...tek-rtl-Add-mask-for-interrupt-handl.patch | 53 +++ ...rq-realtek-rtl-Add-a-select-function.patch | 81 ++++ ...tek-rtl-Allow-shuffled-interrupt-ord.patch | 66 +++ ...ealtek-rtl-Activate-multiple-parents.patch | 128 ++++++ ...chip-irq-realtek-rtl-add-VPE-support.patch | 428 ------------------ 9 files changed, 870 insertions(+), 428 deletions(-) create mode 100644 target/linux/realtek/patches-6.18/032-01-v7.2-irqchip-irq-realtek-rtl-Add-simplify-register-helper.patch create mode 100644 target/linux/realtek/patches-6.18/032-02-v7.2-irqchip-irq-realtek-rtl-Add-multicore-support.patch create mode 100644 target/linux/realtek/patches-6.18/032-03-v7.3-irqchip-irq-realtek-rtl-Use-helper-for-parent-setup.patch create mode 100644 target/linux/realtek/patches-6.18/032-04-v7.3-irqchip-irq-realtek-rtl-Add-interrupt-data-structure.patch create mode 100644 target/linux/realtek/patches-6.18/032-05-v7.3-irqchip-irq-realtek-rtl-Add-mask-for-interrupt-handl.patch create mode 100644 target/linux/realtek/patches-6.18/032-06-v7.3-irqchip-irq-realtek-rtl-Add-a-select-function.patch create mode 100644 target/linux/realtek/patches-6.18/032-07-v7.3-irqchip-irq-realtek-rtl-Allow-shuffled-interrupt-ord.patch create mode 100644 target/linux/realtek/patches-6.18/032-08-v7.3-irqchip-irq-realtek-rtl-Activate-multiple-parents.patch delete mode 100644 target/linux/realtek/patches-6.18/314-irqchip-irq-realtek-rtl-add-VPE-support.patch diff --git a/target/linux/realtek/patches-6.18/032-01-v7.2-irqchip-irq-realtek-rtl-Add-simplify-register-helper.patch b/target/linux/realtek/patches-6.18/032-01-v7.2-irqchip-irq-realtek-rtl-Add-simplify-register-helper.patch new file mode 100644 index 0000000000..92ac48d4fa --- /dev/null +++ b/target/linux/realtek/patches-6.18/032-01-v7.2-irqchip-irq-realtek-rtl-Add-simplify-register-helper.patch @@ -0,0 +1,135 @@ +From 167883f75f83088a2b32c85ce5e3d0cd1cef157b Mon Sep 17 00:00:00 2001 +From: Markus Stockhausen +Date: Thu, 4 Jun 2026 20:25:05 +0200 +Subject: [PATCH 1/8] irqchip/irq-realtek-rtl: Add/simplify register helpers + +The Realtek interrupt controller has two important registers that are used +by the driver in several places + + - GIMR: global interrupt mask register + - IRR: Interrupt routing registers + +The usage of these registers is very inconsistent. GIMR is addressed +directly while IRR has a helper that needs a macro as an input. Harmonize +this by providing consistent helpers that improve code readability. + +The callers of these helpers use classic lock/unlock functions and +sometimes use the wrong locking helper. E.g. irqsave variants are used in +mask/unmask although not needed. Adapt and fix the surrounding call +locations. + +Signed-off-by: Markus Stockhausen +Signed-off-by: Thomas Gleixner +Link: https://patch.msgid.link/20260604182506.1113440-2-markus.stockhausen@gmx.de +--- + drivers/irqchip/irq-realtek-rtl.c | 64 +++++++++++++++---------------- + 1 file changed, 32 insertions(+), 32 deletions(-) + +--- a/drivers/irqchip/irq-realtek-rtl.c ++++ b/drivers/irqchip/irq-realtek-rtl.c +@@ -37,10 +37,29 @@ static void __iomem *realtek_ictl_base; + #define IRR_OFFSET(idx) (4 * (3 - (idx * 4) / 32)) + #define IRR_SHIFT(idx) ((idx * 4) % 32) + +-static void write_irr(void __iomem *irr0, int idx, u32 value) ++static inline void enable_gimr(unsigned int hw_irq) + { +- unsigned int offset = IRR_OFFSET(idx); +- unsigned int shift = IRR_SHIFT(idx); ++ u32 gimr; ++ ++ gimr = readl(REG(RTL_ICTL_GIMR)); ++ gimr |= BIT(hw_irq); ++ writel(gimr, REG(RTL_ICTL_GIMR)); ++} ++ ++static inline void disable_gimr(unsigned int hw_irq) ++{ ++ u32 gimr; ++ ++ gimr = readl(REG(RTL_ICTL_GIMR)); ++ gimr &= ~BIT(hw_irq); ++ writel(gimr, REG(RTL_ICTL_GIMR)); ++} ++ ++static void write_irr(int hw_irq, u32 value) ++{ ++ void __iomem *irr0 = REG(RTL_ICTL_IRR0); ++ unsigned int offset = IRR_OFFSET(hw_irq); ++ unsigned int shift = IRR_SHIFT(hw_irq); + u32 irr; + + irr = readl(irr0 + offset) & ~(0xf << shift); +@@ -50,30 +69,14 @@ static void write_irr(void __iomem *irr0 + + static void realtek_ictl_unmask_irq(struct irq_data *i) + { +- unsigned long flags; +- u32 value; +- +- raw_spin_lock_irqsave(&irq_lock, flags); +- +- value = readl(REG(RTL_ICTL_GIMR)); +- value |= BIT(i->hwirq); +- writel(value, REG(RTL_ICTL_GIMR)); +- +- raw_spin_unlock_irqrestore(&irq_lock, flags); ++ guard(raw_spinlock)(&irq_lock); ++ enable_gimr(i->hwirq); + } + + static void realtek_ictl_mask_irq(struct irq_data *i) + { +- unsigned long flags; +- u32 value; +- +- raw_spin_lock_irqsave(&irq_lock, flags); +- +- value = readl(REG(RTL_ICTL_GIMR)); +- value &= ~BIT(i->hwirq); +- writel(value, REG(RTL_ICTL_GIMR)); +- +- raw_spin_unlock_irqrestore(&irq_lock, flags); ++ guard(raw_spinlock)(&irq_lock); ++ disable_gimr(i->hwirq); + } + + static struct irq_chip realtek_ictl_irq = { +@@ -84,13 +87,10 @@ static struct irq_chip realtek_ictl_irq + + static int intc_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw) + { +- unsigned long flags; +- + irq_set_chip_and_handler(irq, &realtek_ictl_irq, handle_level_irq); + +- raw_spin_lock_irqsave(&irq_lock, flags); +- write_irr(REG(RTL_ICTL_IRR0), hw, 1); +- raw_spin_unlock_irqrestore(&irq_lock, flags); ++ guard(raw_spinlock_irqsave)(&irq_lock); ++ write_irr(hw, 1); + + return 0; + } +@@ -127,7 +127,6 @@ static int __init realtek_rtl_of_init(st + { + struct of_phandle_args oirq; + struct irq_domain *domain; +- unsigned int soc_irq; + int parent_irq; + + realtek_ictl_base = of_iomap(node, 0); +@@ -135,9 +134,10 @@ static int __init realtek_rtl_of_init(st + return -ENXIO; + + /* Disable all cascaded interrupts and clear routing */ +- writel(0, REG(RTL_ICTL_GIMR)); +- for (soc_irq = 0; soc_irq < RTL_ICTL_NUM_INPUTS; soc_irq++) +- write_irr(REG(RTL_ICTL_IRR0), soc_irq, 0); ++ for (unsigned int hw_irq = 0; hw_irq < RTL_ICTL_NUM_INPUTS; hw_irq++) { ++ disable_gimr(hw_irq); ++ write_irr(hw_irq, 0); ++ } + + if (WARN_ON(!of_irq_count(node))) { + /* diff --git a/target/linux/realtek/patches-6.18/032-02-v7.2-irqchip-irq-realtek-rtl-Add-multicore-support.patch b/target/linux/realtek/patches-6.18/032-02-v7.2-irqchip-irq-realtek-rtl-Add-multicore-support.patch new file mode 100644 index 0000000000..598efbfc7e --- /dev/null +++ b/target/linux/realtek/patches-6.18/032-02-v7.2-irqchip-irq-realtek-rtl-Add-multicore-support.patch @@ -0,0 +1,184 @@ +From a1a35c09241f0577cc40f65d7372fed01138619d Mon Sep 17 00:00:00 2001 +From: Markus Stockhausen +Date: Thu, 4 Jun 2026 20:25:06 +0200 +Subject: [PATCH 2/8] irqchip/irq-realtek-rtl: Add multicore support + +The Realtek interrupt driver currently supports only single core +systems. So the higher end devices like RTL839x and RTL930x with +dual VPEs must be driven with NR_CPU=1. Enhance the driver to +support multicore (dual VPE) systems. For this: + + - Extend the register map for multiple cores + - Search for multiple CPU cores in the devicetree + - Improve the register helpers to support multiple cores + - Add an affinity setter + - Enhance the IRQ handler for multiple cores + +Signed-off-by: Markus Stockhausen +Signed-off-by: Thomas Gleixner +Link: https://patch.msgid.link/20260604182506.1113440-3-markus.stockhausen@gmx.de +--- + drivers/irqchip/irq-realtek-rtl.c | 82 ++++++++++++++++++++----------- + 1 file changed, 54 insertions(+), 28 deletions(-) + +--- a/drivers/irqchip/irq-realtek-rtl.c ++++ b/drivers/irqchip/irq-realtek-rtl.c +@@ -23,10 +23,10 @@ + + #define RTL_ICTL_NUM_INPUTS 32 + +-#define REG(x) (realtek_ictl_base + x) ++#define REG(cpu, x) (realtek_ictl_base[cpu] + x) + + static DEFINE_RAW_SPINLOCK(irq_lock); +-static void __iomem *realtek_ictl_base; ++static void __iomem *realtek_ictl_base[NR_CPUS]; + + /* + * IRR0-IRR3 store 4 bits per interrupt, but Realtek uses inverted numbering, +@@ -37,27 +37,27 @@ static void __iomem *realtek_ictl_base; + #define IRR_OFFSET(idx) (4 * (3 - (idx * 4) / 32)) + #define IRR_SHIFT(idx) ((idx * 4) % 32) + +-static inline void enable_gimr(unsigned int hw_irq) ++static inline void enable_gimr(unsigned int cpu, unsigned int hw_irq) + { + u32 gimr; + +- gimr = readl(REG(RTL_ICTL_GIMR)); ++ gimr = readl(REG(cpu, RTL_ICTL_GIMR)); + gimr |= BIT(hw_irq); +- writel(gimr, REG(RTL_ICTL_GIMR)); ++ writel(gimr, REG(cpu, RTL_ICTL_GIMR)); + } + +-static inline void disable_gimr(unsigned int hw_irq) ++static inline void disable_gimr(unsigned int cpu, unsigned int hw_irq) + { + u32 gimr; + +- gimr = readl(REG(RTL_ICTL_GIMR)); ++ gimr = readl(REG(cpu, RTL_ICTL_GIMR)); + gimr &= ~BIT(hw_irq); +- writel(gimr, REG(RTL_ICTL_GIMR)); ++ writel(gimr, REG(cpu, RTL_ICTL_GIMR)); + } + +-static void write_irr(int hw_irq, u32 value) ++static void write_irr(unsigned int cpu, int hw_irq, u32 value) + { +- void __iomem *irr0 = REG(RTL_ICTL_IRR0); ++ void __iomem *irr0 = REG(cpu, RTL_ICTL_IRR0); + unsigned int offset = IRR_OFFSET(hw_irq); + unsigned int shift = IRR_SHIFT(hw_irq); + u32 irr; +@@ -69,28 +69,51 @@ static void write_irr(int hw_irq, u32 va + + static void realtek_ictl_unmask_irq(struct irq_data *i) + { ++ unsigned int cpu; ++ + guard(raw_spinlock)(&irq_lock); +- enable_gimr(i->hwirq); ++ for_each_cpu(cpu, irq_data_get_effective_affinity_mask(i)) ++ enable_gimr(cpu, i->hwirq); + } + + static void realtek_ictl_mask_irq(struct irq_data *i) + { ++ unsigned int cpu; ++ + guard(raw_spinlock)(&irq_lock); +- disable_gimr(i->hwirq); ++ for_each_cpu(cpu, irq_data_get_effective_affinity_mask(i)) ++ disable_gimr(cpu, i->hwirq); ++} ++ ++static int realtek_ictl_irq_affinity(struct irq_data *i, const struct cpumask *dest, bool force) ++{ ++ if (!irqd_irq_masked(i)) ++ realtek_ictl_mask_irq(i); ++ ++ irq_data_update_effective_affinity(i, dest); ++ ++ if (!irqd_irq_masked(i)) ++ realtek_ictl_unmask_irq(i); ++ ++ return IRQ_SET_MASK_OK; + } + + static struct irq_chip realtek_ictl_irq = { +- .name = "realtek-rtl-intc", +- .irq_mask = realtek_ictl_mask_irq, +- .irq_unmask = realtek_ictl_unmask_irq, ++ .name = "realtek-rtl-intc", ++ .irq_mask = realtek_ictl_mask_irq, ++ .irq_unmask = realtek_ictl_unmask_irq, ++ .irq_set_affinity = realtek_ictl_irq_affinity, + }; + + static int intc_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw) + { ++ unsigned int cpu; ++ + irq_set_chip_and_handler(irq, &realtek_ictl_irq, handle_level_irq); + + guard(raw_spinlock_irqsave)(&irq_lock); +- write_irr(hw, 1); ++ for_each_present_cpu(cpu) ++ write_irr(cpu, hw, 1); + + return 0; + } +@@ -103,12 +126,13 @@ static const struct irq_domain_ops irq_d + static void realtek_irq_dispatch(struct irq_desc *desc) + { + struct irq_chip *chip = irq_desc_get_chip(desc); ++ unsigned int cpu = smp_processor_id(); + struct irq_domain *domain; + unsigned long pending; + unsigned int soc_int; + + chained_irq_enter(chip, desc); +- pending = readl(REG(RTL_ICTL_GIMR)) & readl(REG(RTL_ICTL_GISR)); ++ pending = readl(REG(cpu, RTL_ICTL_GIMR)) & readl(REG(cpu, RTL_ICTL_GISR)); + + if (unlikely(!pending)) { + spurious_interrupt(); +@@ -116,7 +140,7 @@ static void realtek_irq_dispatch(struct + } + + domain = irq_desc_get_handler_data(desc); +- for_each_set_bit(soc_int, &pending, 32) ++ for_each_set_bit(soc_int, &pending, RTL_ICTL_NUM_INPUTS) + generic_handle_domain_irq(domain, soc_int); + + out: +@@ -127,16 +151,18 @@ static int __init realtek_rtl_of_init(st + { + struct of_phandle_args oirq; + struct irq_domain *domain; +- int parent_irq; ++ int cpu, parent_irq; + +- realtek_ictl_base = of_iomap(node, 0); +- if (!realtek_ictl_base) +- return -ENXIO; +- +- /* Disable all cascaded interrupts and clear routing */ +- for (unsigned int hw_irq = 0; hw_irq < RTL_ICTL_NUM_INPUTS; hw_irq++) { +- disable_gimr(hw_irq); +- write_irr(hw_irq, 0); ++ for_each_present_cpu(cpu) { ++ realtek_ictl_base[cpu] = of_iomap(node, cpu); ++ if (!realtek_ictl_base[cpu]) ++ return -ENXIO; ++ ++ /* Disable all cascaded interrupts and clear routing */ ++ for (unsigned int hw_irq = 0; hw_irq < RTL_ICTL_NUM_INPUTS; hw_irq++) { ++ disable_gimr(cpu, hw_irq); ++ write_irr(cpu, hw_irq, 0); ++ } + } + + if (WARN_ON(!of_irq_count(node))) { diff --git a/target/linux/realtek/patches-6.18/032-03-v7.3-irqchip-irq-realtek-rtl-Use-helper-for-parent-setup.patch b/target/linux/realtek/patches-6.18/032-03-v7.3-irqchip-irq-realtek-rtl-Use-helper-for-parent-setup.patch new file mode 100644 index 0000000000..1919008877 --- /dev/null +++ b/target/linux/realtek/patches-6.18/032-03-v7.3-irqchip-irq-realtek-rtl-Use-helper-for-parent-setup.patch @@ -0,0 +1,106 @@ +From 62e8298a43e3f0de23cbd52e4ac2399356a724cc Mon Sep 17 00:00:00 2001 +From: Markus Stockhausen +Date: Fri, 5 Jun 2026 16:05:22 +0200 +Subject: [PATCH 3/8] irqchip/irq-realtek-rtl: Use helper for parent setup + +With the upcoming commits the parent interrupt setup will be extended. +Relocate it into a separate helper. Although it still works only +for a single interrupt prepare the coding so it can be easily +extended with a loop for multi parent support. For this reduce the +line lengths so that the upcoming indentation still leaves the +width below 100 characters. + +Signed-off-by: Markus Stockhausen +--- + drivers/irqchip/irq-realtek-rtl.c | 60 +++++++++++++++++-------------- + 1 file changed, 33 insertions(+), 27 deletions(-) + +--- a/drivers/irqchip/irq-realtek-rtl.c ++++ b/drivers/irqchip/irq-realtek-rtl.c +@@ -147,48 +147,35 @@ out: + chained_irq_exit(chip, desc); + } + +-static int __init realtek_rtl_of_init(struct device_node *node, struct device_node *parent) ++static int __init realtek_setup_parents(struct device_node *node) + { ++ int parent_irq, num_parents = of_irq_count(node); + struct of_phandle_args oirq; + struct irq_domain *domain; +- int cpu, parent_irq; + +- for_each_present_cpu(cpu) { +- realtek_ictl_base[cpu] = of_iomap(node, cpu); +- if (!realtek_ictl_base[cpu]) +- return -ENXIO; +- +- /* Disable all cascaded interrupts and clear routing */ +- for (unsigned int hw_irq = 0; hw_irq < RTL_ICTL_NUM_INPUTS; hw_irq++) { +- disable_gimr(cpu, hw_irq); +- write_irr(cpu, hw_irq, 0); +- } +- } +- +- if (WARN_ON(!of_irq_count(node))) { ++ if (WARN_ON(!num_parents)) { + /* +- * If DT contains no parent interrupts, assume MIPS CPU IRQ 2 +- * (HW0) is connected to the first output. This is the case for +- * all known hardware anyway. "interrupt-map" is deprecated, so +- * don't bother trying to parse that. ++ * If DT contains no parent interrupts, assume MIPS IRQ 2 (HW0) is ++ * connected to the first output. This is the case for all known hardware. + */ +- oirq.np = of_find_compatible_node(NULL, NULL, "mti,cpu-interrupt-controller"); ++ oirq.np = of_find_compatible_node(NULL, NULL, ++ "mti,cpu-interrupt-controller"); ++ if (!oirq.np) ++ return -EINVAL; ++ + oirq.args_count = 1; + oirq.args[0] = 2; +- + parent_irq = irq_create_of_mapping(&oirq); +- + of_node_put(oirq.np); + } else { + parent_irq = of_irq_get(node, 0); + } + +- if (parent_irq < 0) +- return parent_irq; +- else if (!parent_irq) +- return -ENODEV; ++ if (parent_irq <= 0) ++ return parent_irq ? parent_irq : -ENODEV; + +- domain = irq_domain_create_linear(of_fwnode_handle(node), RTL_ICTL_NUM_INPUTS, &irq_domain_ops, NULL); ++ domain = irq_domain_create_linear(of_fwnode_handle(node), RTL_ICTL_NUM_INPUTS, ++ &irq_domain_ops, NULL); + if (!domain) + return -ENOMEM; + +@@ -197,4 +184,23 @@ static int __init realtek_rtl_of_init(st + return 0; + } + ++static int __init realtek_rtl_of_init(struct device_node *node, struct device_node *parent) ++{ ++ unsigned int cpu; ++ ++ for_each_present_cpu(cpu) { ++ realtek_ictl_base[cpu] = of_iomap(node, cpu); ++ if (!realtek_ictl_base[cpu]) ++ return -ENXIO; ++ ++ /* Disable all cascaded interrupts and clear routing */ ++ for (unsigned int hw_irq = 0; hw_irq < RTL_ICTL_NUM_INPUTS; hw_irq++) { ++ disable_gimr(cpu, hw_irq); ++ write_irr(cpu, hw_irq, 0); ++ } ++ } ++ ++ return realtek_setup_parents(node); ++} ++ + IRQCHIP_DECLARE(realtek_rtl_intc, "realtek,rtl-intc", realtek_rtl_of_init); diff --git a/target/linux/realtek/patches-6.18/032-04-v7.3-irqchip-irq-realtek-rtl-Add-interrupt-data-structure.patch b/target/linux/realtek/patches-6.18/032-04-v7.3-irqchip-irq-realtek-rtl-Add-interrupt-data-structure.patch new file mode 100644 index 0000000000..778b608738 --- /dev/null +++ b/target/linux/realtek/patches-6.18/032-04-v7.3-irqchip-irq-realtek-rtl-Add-interrupt-data-structure.patch @@ -0,0 +1,117 @@ +From 1f922b06f4a1aa292af1c45d00de41f259cc7f17 Mon Sep 17 00:00:00 2001 +From: Markus Stockhausen +Date: Fri, 5 Jun 2026 18:07:24 +0200 +Subject: [PATCH 4/8] irqchip/irq-realtek-rtl: Add interrupt data structure + +To prepare for multiple parent interrupt domains add an intermediate +data structure. For now this will only host the link to the domain. +Additionally adapt a deviating variable name to driver standard "hw_irq". + +Signed-off-by: Markus Stockhausen +--- + drivers/irqchip/irq-realtek-rtl.c | 48 ++++++++++++++++++++++--------- + 1 file changed, 34 insertions(+), 14 deletions(-) + +--- a/drivers/irqchip/irq-realtek-rtl.c ++++ b/drivers/irqchip/irq-realtek-rtl.c +@@ -25,6 +25,10 @@ + + #define REG(cpu, x) (realtek_ictl_base[cpu] + x) + ++struct realtek_ictl_output { ++ struct irq_domain *domain; ++}; ++ + static DEFINE_RAW_SPINLOCK(irq_lock); + static void __iomem *realtek_ictl_base[NR_CPUS]; + +@@ -125,11 +129,11 @@ static const struct irq_domain_ops irq_d + + static void realtek_irq_dispatch(struct irq_desc *desc) + { ++ struct realtek_ictl_output *output = irq_desc_get_handler_data(desc); + struct irq_chip *chip = irq_desc_get_chip(desc); + unsigned int cpu = smp_processor_id(); +- struct irq_domain *domain; + unsigned long pending; +- unsigned int soc_int; ++ unsigned int hw_irq; + + chained_irq_enter(chip, desc); + pending = readl(REG(cpu, RTL_ICTL_GIMR)) & readl(REG(cpu, RTL_ICTL_GISR)); +@@ -139,9 +143,8 @@ static void realtek_irq_dispatch(struct + goto out; + } + +- domain = irq_desc_get_handler_data(desc); +- for_each_set_bit(soc_int, &pending, RTL_ICTL_NUM_INPUTS) +- generic_handle_domain_irq(domain, soc_int); ++ for_each_set_bit(hw_irq, &pending, RTL_ICTL_NUM_INPUTS) ++ generic_handle_domain_irq(output->domain, hw_irq); + + out: + chained_irq_exit(chip, desc); +@@ -149,10 +152,15 @@ out: + + static int __init realtek_setup_parents(struct device_node *node) + { +- int parent_irq, num_parents = of_irq_count(node); ++ int err, parent_irq, num_parents = of_irq_count(node); ++ struct realtek_ictl_output *output; + struct of_phandle_args oirq; + struct irq_domain *domain; + ++ output = kcalloc(1, sizeof(*output), GFP_KERNEL); ++ if (!output) ++ return -ENOMEM; ++ + if (WARN_ON(!num_parents)) { + /* + * If DT contains no parent interrupts, assume MIPS IRQ 2 (HW0) is +@@ -160,8 +168,10 @@ static int __init realtek_setup_parents( + */ + oirq.np = of_find_compatible_node(NULL, NULL, + "mti,cpu-interrupt-controller"); +- if (!oirq.np) +- return -EINVAL; ++ if (!oirq.np) { ++ err = -EINVAL; ++ goto err_out; ++ } + + oirq.args_count = 1; + oirq.args[0] = 2; +@@ -171,17 +181,27 @@ static int __init realtek_setup_parents( + parent_irq = of_irq_get(node, 0); + } + +- if (parent_irq <= 0) +- return parent_irq ? parent_irq : -ENODEV; ++ if (parent_irq <= 0) { ++ err = parent_irq ? parent_irq : -ENODEV; ++ goto err_out; ++ } + + domain = irq_domain_create_linear(of_fwnode_handle(node), RTL_ICTL_NUM_INPUTS, +- &irq_domain_ops, NULL); +- if (!domain) +- return -ENOMEM; ++ &irq_domain_ops, output); ++ if (!domain) { ++ err = -ENOMEM; ++ goto err_out; ++ } + +- irq_set_chained_handler_and_data(parent_irq, realtek_irq_dispatch, domain); ++ output->domain = domain; ++ irq_set_chained_handler_and_data(parent_irq, realtek_irq_dispatch, output); + + return 0; ++ ++err_out: ++ kfree(output); ++ ++ return err; + } + + static int __init realtek_rtl_of_init(struct device_node *node, struct device_node *parent) diff --git a/target/linux/realtek/patches-6.18/032-05-v7.3-irqchip-irq-realtek-rtl-Add-mask-for-interrupt-handl.patch b/target/linux/realtek/patches-6.18/032-05-v7.3-irqchip-irq-realtek-rtl-Add-mask-for-interrupt-handl.patch new file mode 100644 index 0000000000..0b990f31f0 --- /dev/null +++ b/target/linux/realtek/patches-6.18/032-05-v7.3-irqchip-irq-realtek-rtl-Add-mask-for-interrupt-handl.patch @@ -0,0 +1,53 @@ +From 79a2befb817a8bf5930d80ea6c2d237e74d16728 Mon Sep 17 00:00:00 2001 +From: Markus Stockhausen +Date: Fri, 5 Jun 2026 18:19:12 +0200 +Subject: [PATCH 5/8] irqchip/irq-realtek-rtl: Add mask for interrupt handling + +When using multiple domains for the Interrupt controller, each one +must know which hardware interrupts it serves. Add a mask that is +filled during setup and apply it during interrupt handling. + +Signed-off-by: Markus Stockhausen +--- + drivers/irqchip/irq-realtek-rtl.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +--- a/drivers/irqchip/irq-realtek-rtl.c ++++ b/drivers/irqchip/irq-realtek-rtl.c +@@ -27,6 +27,7 @@ + + struct realtek_ictl_output { + struct irq_domain *domain; ++ u32 mask; + }; + + static DEFINE_RAW_SPINLOCK(irq_lock); +@@ -109,15 +110,17 @@ static struct irq_chip realtek_ictl_irq + .irq_set_affinity = realtek_ictl_irq_affinity, + }; + +-static int intc_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw) ++static int intc_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw_irq) + { ++ struct realtek_ictl_output *output = d->host_data; + unsigned int cpu; + + irq_set_chip_and_handler(irq, &realtek_ictl_irq, handle_level_irq); + + guard(raw_spinlock_irqsave)(&irq_lock); ++ output->mask |= BIT(hw_irq); + for_each_present_cpu(cpu) +- write_irr(cpu, hw, 1); ++ write_irr(cpu, hw_irq, 1); + + return 0; + } +@@ -136,7 +139,7 @@ static void realtek_irq_dispatch(struct + unsigned int hw_irq; + + chained_irq_enter(chip, desc); +- pending = readl(REG(cpu, RTL_ICTL_GIMR)) & readl(REG(cpu, RTL_ICTL_GISR)); ++ pending = readl(REG(cpu, RTL_ICTL_GIMR)) & readl(REG(cpu, RTL_ICTL_GISR)) & output->mask; + + if (unlikely(!pending)) { + spurious_interrupt(); diff --git a/target/linux/realtek/patches-6.18/032-06-v7.3-irqchip-irq-realtek-rtl-Add-a-select-function.patch b/target/linux/realtek/patches-6.18/032-06-v7.3-irqchip-irq-realtek-rtl-Add-a-select-function.patch new file mode 100644 index 0000000000..8498d251ae --- /dev/null +++ b/target/linux/realtek/patches-6.18/032-06-v7.3-irqchip-irq-realtek-rtl-Add-a-select-function.patch @@ -0,0 +1,81 @@ +From 4be0e039e8456b0e3111072ac9c66c1e62d1d8df Mon Sep 17 00:00:00 2001 +From: Markus Stockhausen +Date: Fri, 5 Jun 2026 19:39:41 +0200 +Subject: [PATCH 6/8] irqchip/irq-realtek-rtl: Add a select function + +When working with multiple domains, the interrupt registration +must know to which domain it attaches. Add a select function that +takes care of the lookup. Logic is as follows. + +If a device needs explicit parent routing it can request it by +giving an index as a second argument in the device tree. E.g. + +intc: interrupt-controller@3000 { + ... + interrupts = <2>, <3>, <4>, <5>, <6>, <7>; +}; + +uart1: uart@2100 { + ... + interrupt-parent = <&intc>; + interrupts = <31 1>; +} + +This way the serial console with hardware interrupt 31 will be +routed via SoC interrupt 3. If the second argument is not given, +the first parent interrupt of the controller is selected. + +Signed-off-by: Markus Stockhausen +--- + drivers/irqchip/irq-realtek-rtl.c | 24 ++++++++++++++++++++++-- + 1 file changed, 22 insertions(+), 2 deletions(-) + +--- a/drivers/irqchip/irq-realtek-rtl.c ++++ b/drivers/irqchip/irq-realtek-rtl.c +@@ -26,7 +26,9 @@ + #define REG(cpu, x) (realtek_ictl_base[cpu] + x) + + struct realtek_ictl_output { ++ struct fwnode_handle *fwnode; + struct irq_domain *domain; ++ unsigned int index; + u32 mask; + }; + +@@ -125,9 +127,25 @@ static int intc_map(struct irq_domain *d + return 0; + } + ++static int intc_select(struct irq_domain *d, struct irq_fwspec *fwspec, ++ enum irq_domain_bus_token bus_token) ++{ ++ struct realtek_ictl_output *output = d->host_data; ++ unsigned int index = 0; ++ ++ if (fwspec->fwnode != output->fwnode) ++ return false; ++ ++ if (fwspec->param_count == 2) ++ index = fwspec->param[1]; ++ ++ return index == output->index; ++} ++ + static const struct irq_domain_ops irq_domain_ops = { +- .map = intc_map, +- .xlate = irq_domain_xlate_onecell, ++ .map = intc_map, ++ .select = intc_select, ++ .xlate = irq_domain_xlate_onecell, + }; + + static void realtek_irq_dispatch(struct irq_desc *desc) +@@ -197,6 +215,8 @@ static int __init realtek_setup_parents( + } + + output->domain = domain; ++ output->fwnode = of_fwnode_handle(node); ++ output->index = 0; + irq_set_chained_handler_and_data(parent_irq, realtek_irq_dispatch, output); + + return 0; diff --git a/target/linux/realtek/patches-6.18/032-07-v7.3-irqchip-irq-realtek-rtl-Allow-shuffled-interrupt-ord.patch b/target/linux/realtek/patches-6.18/032-07-v7.3-irqchip-irq-realtek-rtl-Allow-shuffled-interrupt-ord.patch new file mode 100644 index 0000000000..8908cbc04a --- /dev/null +++ b/target/linux/realtek/patches-6.18/032-07-v7.3-irqchip-irq-realtek-rtl-Allow-shuffled-interrupt-ord.patch @@ -0,0 +1,66 @@ +From 18652e0d0527bc17542699d7dbdc14e4054acb2f Mon Sep 17 00:00:00 2001 +From: Markus Stockhausen +Date: Fri, 5 Jun 2026 19:47:35 +0200 +Subject: [PATCH 7/8] irqchip/irq-realtek-rtl: Allow shuffled interrupt order + +The driver silently assumes that the first given interrupt in +the device tree is nailed to "2". Any deviation from this will +break the driver. Fix this by storing the given interrupt +in the domain data structure and writing the proper value +to the routing register. + +Signed-off-by: Markus Stockhausen +--- + drivers/irqchip/irq-realtek-rtl.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +--- a/drivers/irqchip/irq-realtek-rtl.c ++++ b/drivers/irqchip/irq-realtek-rtl.c +@@ -28,6 +28,8 @@ + struct realtek_ictl_output { + struct fwnode_handle *fwnode; + struct irq_domain *domain; ++ unsigned int parent_irq; ++ unsigned int parent_hwirq; + unsigned int index; + u32 mask; + }; +@@ -122,7 +124,7 @@ static int intc_map(struct irq_domain *d + guard(raw_spinlock_irqsave)(&irq_lock); + output->mask |= BIT(hw_irq); + for_each_present_cpu(cpu) +- write_irr(cpu, hw_irq, 1); ++ write_irr(cpu, hw_irq, output->parent_hwirq - 1); + + return 0; + } +@@ -175,6 +177,7 @@ static int __init realtek_setup_parents( + { + int err, parent_irq, num_parents = of_irq_count(node); + struct realtek_ictl_output *output; ++ struct irq_data *parent_data; + struct of_phandle_args oirq; + struct irq_domain *domain; + +@@ -207,6 +210,12 @@ static int __init realtek_setup_parents( + goto err_out; + } + ++ parent_data = irq_get_irq_data(parent_irq); ++ if (!parent_data) { ++ err = -EINVAL; ++ goto err_out; ++ } ++ + domain = irq_domain_create_linear(of_fwnode_handle(node), RTL_ICTL_NUM_INPUTS, + &irq_domain_ops, output); + if (!domain) { +@@ -217,6 +226,8 @@ static int __init realtek_setup_parents( + output->domain = domain; + output->fwnode = of_fwnode_handle(node); + output->index = 0; ++ output->parent_irq = parent_irq; ++ output->parent_hwirq = irqd_to_hwirq(parent_data); + irq_set_chained_handler_and_data(parent_irq, realtek_irq_dispatch, output); + + return 0; diff --git a/target/linux/realtek/patches-6.18/032-08-v7.3-irqchip-irq-realtek-rtl-Activate-multiple-parents.patch b/target/linux/realtek/patches-6.18/032-08-v7.3-irqchip-irq-realtek-rtl-Activate-multiple-parents.patch new file mode 100644 index 0000000000..8c2f5211b1 --- /dev/null +++ b/target/linux/realtek/patches-6.18/032-08-v7.3-irqchip-irq-realtek-rtl-Activate-multiple-parents.patch @@ -0,0 +1,128 @@ +From 3031d8f878219f446330088193d799a3e67122d5 Mon Sep 17 00:00:00 2001 +From: Markus Stockhausen +Date: Fri, 5 Jun 2026 20:49:47 +0200 +Subject: [PATCH 8/8] irqchip/irq-realtek-rtl: Activate multiple parents + +Until now the driver exactly registers a single parent interrupt. +Relax this to make use of all defined interrupts in the device tree. + +Signed-off-by: Markus Stockhausen +--- + drivers/irqchip/irq-realtek-rtl.c | 88 +++++++++++++++++-------------- + 1 file changed, 48 insertions(+), 40 deletions(-) + +--- a/drivers/irqchip/irq-realtek-rtl.c ++++ b/drivers/irqchip/irq-realtek-rtl.c +@@ -175,64 +175,72 @@ out: + + static int __init realtek_setup_parents(struct device_node *node) + { +- int err, parent_irq, num_parents = of_irq_count(node); ++ int p, cnt, err, parent_irq, num_parents = of_irq_count(node); + struct realtek_ictl_output *output; + struct irq_data *parent_data; + struct of_phandle_args oirq; + struct irq_domain *domain; + +- output = kcalloc(1, sizeof(*output), GFP_KERNEL); ++ cnt = max(1, num_parents); ++ output = kcalloc(cnt, sizeof(*output), GFP_KERNEL); + if (!output) + return -ENOMEM; + +- if (WARN_ON(!num_parents)) { +- /* +- * If DT contains no parent interrupts, assume MIPS IRQ 2 (HW0) is +- * connected to the first output. This is the case for all known hardware. +- */ +- oirq.np = of_find_compatible_node(NULL, NULL, +- "mti,cpu-interrupt-controller"); +- if (!oirq.np) { +- err = -EINVAL; +- goto err_out; ++ for (p = 0; p < cnt; p++) { ++ if (WARN_ON(!num_parents)) { ++ /* ++ * If DT contains no parent interrupts, assume MIPS IRQ 2 (HW0) is ++ * connected to the first output. This is the case for all known hardware. ++ */ ++ oirq.np = of_find_compatible_node(NULL, NULL, ++ "mti,cpu-interrupt-controller"); ++ if (!oirq.np) { ++ err = -EINVAL; ++ goto err_out; ++ } ++ ++ oirq.args_count = 1; ++ oirq.args[0] = 2; ++ parent_irq = irq_create_of_mapping(&oirq); ++ of_node_put(oirq.np); ++ } else { ++ parent_irq = of_irq_get(node, p); + } + +- oirq.args_count = 1; +- oirq.args[0] = 2; +- parent_irq = irq_create_of_mapping(&oirq); +- of_node_put(oirq.np); +- } else { +- parent_irq = of_irq_get(node, 0); +- } ++ if (parent_irq <= 0) { ++ err = parent_irq ? parent_irq : -ENODEV; ++ goto err_out; ++ } + +- if (parent_irq <= 0) { +- err = parent_irq ? parent_irq : -ENODEV; +- goto err_out; +- } ++ parent_data = irq_get_irq_data(parent_irq); ++ if (!parent_data) { ++ err = -EINVAL; ++ goto err_out; ++ } + +- parent_data = irq_get_irq_data(parent_irq); +- if (!parent_data) { +- err = -EINVAL; +- goto err_out; +- } ++ domain = irq_domain_create_linear(of_fwnode_handle(node), RTL_ICTL_NUM_INPUTS, ++ &irq_domain_ops, &output[p]); ++ if (!domain) { ++ err = -ENOMEM; ++ goto err_out; ++ } + +- domain = irq_domain_create_linear(of_fwnode_handle(node), RTL_ICTL_NUM_INPUTS, +- &irq_domain_ops, output); +- if (!domain) { +- err = -ENOMEM; +- goto err_out; ++ output[p].domain = domain; ++ output[p].fwnode = of_fwnode_handle(node); ++ output[p].index = p; ++ output[p].parent_irq = parent_irq; ++ output[p].parent_hwirq = irqd_to_hwirq(parent_data); ++ irq_set_chained_handler_and_data(parent_irq, realtek_irq_dispatch, &output[p]); + } + +- output->domain = domain; +- output->fwnode = of_fwnode_handle(node); +- output->index = 0; +- output->parent_irq = parent_irq; +- output->parent_hwirq = irqd_to_hwirq(parent_data); +- irq_set_chained_handler_and_data(parent_irq, realtek_irq_dispatch, output); +- + return 0; + + err_out: ++ while (p--) { ++ irq_set_chained_handler_and_data(output[p].parent_irq, NULL, NULL); ++ irq_domain_remove(output[p].domain); ++ } ++ + kfree(output); + + return err; diff --git a/target/linux/realtek/patches-6.18/314-irqchip-irq-realtek-rtl-add-VPE-support.patch b/target/linux/realtek/patches-6.18/314-irqchip-irq-realtek-rtl-add-VPE-support.patch deleted file mode 100644 index caa4e08ed3..0000000000 --- a/target/linux/realtek/patches-6.18/314-irqchip-irq-realtek-rtl-add-VPE-support.patch +++ /dev/null @@ -1,428 +0,0 @@ -From 6c18e9c491959ac0674ebe36b09f9ddc3f2c9bce Mon Sep 17 00:00:00 2001 -From: Birger Koblitz -Date: Fri, 31 Dec 2021 11:56:49 +0100 -Subject: [PATCH] realtek: Add VPE support for the IRQ driver - -In order to support VSMP, enable support for both VPEs of the RTL839X -and RTL930X SoCs in the irq-realtek-rtl driver. Add support for IRQ -affinity setting. - -Up to kernel 5.15 this patch was divided into two parts - -315-irqchip-irq-realtek-rtl-add-VPE-support.patch -319-irqchip-irq-realtek-rtl-fix-VPE-affinity.patch - -As both parts will only work in combination they have been merged into -one patch. - -Submitted-by: Birger Koblitz -Submitted-by: INAGAKI Hiroshi -Signed-off-by: Markus Stockhausen ---- - drivers/irqchip/irq-realtek-rtl.c | 296 +++++++++++++++++++++++++----- - 1 file changed, 249 insertions(+), 47 deletions(-) - ---- a/drivers/irqchip/irq-realtek-rtl.c -+++ b/drivers/irqchip/irq-realtek-rtl.c -@@ -22,22 +22,58 @@ - #define RTL_ICTL_IRR3 0x14 - - #define RTL_ICTL_NUM_INPUTS 32 -- --#define REG(x) (realtek_ictl_base + x) -+#define RTL_ICTL_NUM_OUTPUTS 15 - - static DEFINE_RAW_SPINLOCK(irq_lock); --static void __iomem *realtek_ictl_base; -+ -+#define REG(offset, cpu) (realtek_ictl_base[cpu] + offset) -+ -+static u32 realtek_ictl_unmask[NR_CPUS]; -+static void __iomem *realtek_ictl_base[NR_CPUS]; -+static cpumask_t realtek_ictl_cpu_configurable; -+ -+struct realtek_ictl_output { -+ /* IRQ controller data */ -+ struct fwnode_handle *fwnode; -+ /* Output specific data */ -+ unsigned int output_index; -+ struct irq_domain *domain; -+ u32 child_mask; -+}; - - /* -- * IRR0-IRR3 store 4 bits per interrupt, but Realtek uses inverted numbering, -- * placing IRQ 31 in the first four bits. A routing value of '0' means the -- * interrupt is left disconnected. Routing values {1..15} connect to output -- * lines {0..14}. -+ * Per CPU we have a set of 5 registers that determine interrupt handling for -+ * 32 external interrupts. GIMR (enable/disable interrupt) plus IRR0-IRR3 that -+ * contain "routing" or "priority" values. GIMR uses one bit for each interrupt -+ * and IRRx store 4 bits per interrupt. Realtek uses inverted numbering, -+ * placing IRQ 31 in the first four bits. The register combinations give the -+ * following results for a single interrupt in the wild: -+ * -+ * a) GIMR = 0 / IRRx > 0 -> no interrupts -+ * b) GIMR = 0 / IRRx = 0 -> no interrupts -+ * c) GIMR = 1 / IRRx > 0 -> interrupts -+ * d) GIMR = 1 / IRRx = 0 -> rare interrupts in SMP environment -+ * -+ * Combination d) seems to trigger interrupts only on a VPE if the other VPE -+ * has GIMR = 0 and IRRx > 0. E.g. busy without interrupts allowed. To provide -+ * IRQ balancing features in SMP this driver will handle the registers as -+ * follows: -+ * -+ * 1) set IRRx > 0 for VPE where the interrupt is desired -+ * 2) set IRRx = 0 for VPE where the interrupt is not desired -+ * 3) set both GIMR = 0 to mask (disabled) interrupt -+ * 4) set GIMR = 1 to unmask (enable) interrupt but only for VPE where IRRx > 0 - */ -+ - #define IRR_OFFSET(idx) (4 * (3 - (idx * 4) / 32)) - #define IRR_SHIFT(idx) ((idx * 4) % 32) - --static void write_irr(void __iomem *irr0, int idx, u32 value) -+static inline u32 read_irr(void __iomem *irr0, int idx) -+{ -+ return (readl(irr0 + IRR_OFFSET(idx)) >> IRR_SHIFT(idx)) & 0xf; -+} -+ -+static inline void write_irr(void __iomem *irr0, int idx, u32 value) - { - unsigned int offset = IRR_OFFSET(idx); - unsigned int shift = IRR_SHIFT(idx); -@@ -48,16 +84,33 @@ static void write_irr(void __iomem *irr0 - writel(irr, irr0 + offset); - } - -+static inline void enable_gimr(int hwirq, int cpu) -+{ -+ u32 value; -+ -+ value = readl(REG(RTL_ICTL_GIMR, cpu)); -+ value |= (BIT(hwirq) & realtek_ictl_unmask[cpu]); -+ writel(value, REG(RTL_ICTL_GIMR, cpu)); -+} -+ -+static inline void disable_gimr(int hwirq, int cpu) -+{ -+ u32 value; -+ -+ value = readl(REG(RTL_ICTL_GIMR, cpu)); -+ value &= ~BIT(hwirq); -+ writel(value, REG(RTL_ICTL_GIMR, cpu)); -+} -+ - static void realtek_ictl_unmask_irq(struct irq_data *i) - { - unsigned long flags; -- u32 value; -+ int cpu; - - raw_spin_lock_irqsave(&irq_lock, flags); - -- value = readl(REG(RTL_ICTL_GIMR)); -- value |= BIT(i->hwirq); -- writel(value, REG(RTL_ICTL_GIMR)); -+ for_each_cpu(cpu, &realtek_ictl_cpu_configurable) -+ enable_gimr(i->hwirq, cpu); - - raw_spin_unlock_irqrestore(&irq_lock, flags); - } -@@ -65,110 +118,261 @@ static void realtek_ictl_unmask_irq(stru - static void realtek_ictl_mask_irq(struct irq_data *i) - { - unsigned long flags; -- u32 value; -+ int cpu; - - raw_spin_lock_irqsave(&irq_lock, flags); - -- value = readl(REG(RTL_ICTL_GIMR)); -- value &= ~BIT(i->hwirq); -- writel(value, REG(RTL_ICTL_GIMR)); -+ for_each_cpu(cpu, &realtek_ictl_cpu_configurable) -+ disable_gimr(i->hwirq, cpu); - - raw_spin_unlock_irqrestore(&irq_lock, flags); - } - -+static int __maybe_unused realtek_ictl_irq_affinity(struct irq_data *i, -+ const struct cpumask *dest, -+ bool force) -+{ -+ struct realtek_ictl_output *output = i->domain->host_data; -+ cpumask_t cpu_configure; -+ cpumask_t cpu_disable; -+ cpumask_t cpu_enable; -+ unsigned long flags; -+ int cpu; -+ -+ raw_spin_lock_irqsave(&irq_lock, flags); -+ -+ cpumask_and(&cpu_configure, cpu_present_mask, &realtek_ictl_cpu_configurable); -+ -+ cpumask_and(&cpu_enable, &cpu_configure, dest); -+ cpumask_andnot(&cpu_disable, &cpu_configure, dest); -+ -+ for_each_cpu(cpu, &cpu_disable) { -+ write_irr(REG(RTL_ICTL_IRR0, cpu), i->hwirq, 0); -+ realtek_ictl_unmask[cpu] &= ~BIT(i->hwirq); -+ disable_gimr(i->hwirq, cpu); -+ } -+ -+ for_each_cpu(cpu, &cpu_enable) { -+ write_irr(REG(RTL_ICTL_IRR0, cpu), i->hwirq, output->output_index + 1); -+ realtek_ictl_unmask[cpu] |= BIT(i->hwirq); -+ enable_gimr(i->hwirq, cpu); -+ } -+ -+ irq_data_update_effective_affinity(i, &cpu_enable); -+ -+ raw_spin_unlock_irqrestore(&irq_lock, flags); -+ -+ return IRQ_SET_MASK_OK; -+} -+ - static struct irq_chip realtek_ictl_irq = { - .name = "realtek-rtl-intc", - .irq_mask = realtek_ictl_mask_irq, - .irq_unmask = realtek_ictl_unmask_irq, -+#ifdef CONFIG_SMP -+ .irq_set_affinity = realtek_ictl_irq_affinity, -+#endif - }; - - static int intc_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw) - { -+ struct realtek_ictl_output *output = d->host_data; - unsigned long flags; - - irq_set_chip_and_handler(irq, &realtek_ictl_irq, handle_level_irq); - - raw_spin_lock_irqsave(&irq_lock, flags); -- write_irr(REG(RTL_ICTL_IRR0), hw, 1); -+ -+ output->child_mask |= BIT(hw); -+ write_irr(REG(RTL_ICTL_IRR0, 0), hw, output->output_index + 1); -+ realtek_ictl_unmask[0] |= BIT(hw); -+ - raw_spin_unlock_irqrestore(&irq_lock, flags); - - return 0; - } - -+static int intc_select(struct irq_domain *d, struct irq_fwspec *fwspec, -+ enum irq_domain_bus_token bus_token) -+{ -+ struct realtek_ictl_output *output = d->host_data; -+ bool routed_elsewhere; -+ unsigned long flags; -+ u32 routing_old; -+ int cpu; -+ -+ if (fwspec->fwnode != output->fwnode) -+ return false; -+ -+ /* Original specifiers had only one parameter */ -+ if (fwspec->param_count < 2) -+ return true; -+ -+ raw_spin_lock_irqsave(&irq_lock, flags); -+ -+ /* -+ * Inputs can only be routed to one output, so they shouldn't be -+ * allowed to end up in multiple domains. -+ */ -+ for_each_cpu(cpu, &realtek_ictl_cpu_configurable) { -+ routing_old = read_irr(REG(RTL_ICTL_IRR0, cpu), fwspec->param[0]); -+ routed_elsewhere = routing_old && fwspec->param[1] != routing_old - 1; -+ if (routed_elsewhere) { -+ pr_warn("soc int %d already routed to output %d\n", -+ fwspec->param[0], routing_old - 1); -+ break; -+ } -+ } -+ -+ raw_spin_unlock_irqrestore(&irq_lock, flags); -+ -+ return !routed_elsewhere && fwspec->param[1] == output->output_index; -+} -+ - static const struct irq_domain_ops irq_domain_ops = { - .map = intc_map, -+ .select = intc_select, - .xlate = irq_domain_xlate_onecell, - }; - - static void realtek_irq_dispatch(struct irq_desc *desc) - { -+ struct realtek_ictl_output *output = irq_desc_get_handler_data(desc); - struct irq_chip *chip = irq_desc_get_chip(desc); -- struct irq_domain *domain; -+ int cpu = smp_processor_id(); - unsigned long pending; - unsigned int soc_int; - - chained_irq_enter(chip, desc); -- pending = readl(REG(RTL_ICTL_GIMR)) & readl(REG(RTL_ICTL_GISR)); -+ pending = readl(REG(RTL_ICTL_GIMR, cpu)) & readl(REG(RTL_ICTL_GISR, cpu)) -+ & output->child_mask; - - if (unlikely(!pending)) { - spurious_interrupt(); - goto out; - } - -- domain = irq_desc_get_handler_data(desc); -- for_each_set_bit(soc_int, &pending, 32) -- generic_handle_domain_irq(domain, soc_int); -+ for_each_set_bit(soc_int, &pending, RTL_ICTL_NUM_INPUTS) -+ generic_handle_domain_irq(output->domain, soc_int); - - out: - chained_irq_exit(chip, desc); - } - -+/* -+ * SoC interrupts are cascaded to MIPS CPU interrupts according to the -+ * interrupt-map in the device tree. Each SoC interrupt gets 4 bits for -+ * the CPU interrupt in an Interrupt Routing Register. Max 32 SoC interrupts -+ * thus go into 4 IRRs. A routing value of '0' means the interrupt is left -+ * disconnected. Routing values {1..15} connect to output lines {0..14}. -+ */ -+static int __init setup_parent_interrupts(struct device_node *node, int *parents, -+ unsigned int num_parents) -+{ -+ struct realtek_ictl_output *outputs; -+ struct realtek_ictl_output *output; -+ struct irq_domain *domain; -+ unsigned int p; -+ -+ outputs = kcalloc(num_parents, sizeof(*outputs), GFP_KERNEL); -+ if (!outputs) -+ return -ENOMEM; -+ -+ for (p = 0; p < num_parents; p++) { -+ output = outputs + p; -+ -+ domain = irq_domain_add_linear(node, RTL_ICTL_NUM_INPUTS, &irq_domain_ops, output); -+ if (!domain) -+ goto domain_err; -+ -+ output->fwnode = of_fwnode_handle(node); -+ output->output_index = p; -+ output->domain = domain; -+ -+ irq_set_chained_handler_and_data(parents[p], realtek_irq_dispatch, output); -+ } -+ -+ return 0; -+ -+domain_err: -+ while (p--) { -+ irq_set_chained_handler_and_data(parents[p], NULL, NULL); -+ irq_domain_remove(outputs[p].domain); -+ } -+ -+ kfree(outputs); -+ -+ return -ENOMEM; -+} -+ - static int __init realtek_rtl_of_init(struct device_node *node, struct device_node *parent) - { -+ int parent_irqs[RTL_ICTL_NUM_OUTPUTS]; - struct of_phandle_args oirq; -- struct irq_domain *domain; -+ unsigned int num_parents; - unsigned int soc_irq; -- int parent_irq; -+ unsigned int p; -+ int cpu; - -- realtek_ictl_base = of_iomap(node, 0); -- if (!realtek_ictl_base) -+ cpumask_clear(&realtek_ictl_cpu_configurable); -+ -+ for (cpu = 0; cpu < NR_CPUS; cpu++) { -+ realtek_ictl_base[cpu] = of_iomap(node, cpu); -+ if (realtek_ictl_base[cpu]) { -+ cpumask_set_cpu(cpu, &realtek_ictl_cpu_configurable); -+ -+ /* Disable all cascaded interrupts and clear routing */ -+ for (soc_irq = 0; soc_irq < RTL_ICTL_NUM_INPUTS; soc_irq++) { -+ write_irr(REG(RTL_ICTL_IRR0, cpu), soc_irq, 0); -+ realtek_ictl_unmask[cpu] &= ~BIT(soc_irq); -+ disable_gimr(soc_irq, cpu); -+ } -+ } -+ } -+ -+ if (cpumask_empty(&realtek_ictl_cpu_configurable)) - return -ENXIO; - -- /* Disable all cascaded interrupts and clear routing */ -- writel(0, REG(RTL_ICTL_GIMR)); -- for (soc_irq = 0; soc_irq < RTL_ICTL_NUM_INPUTS; soc_irq++) -- write_irr(REG(RTL_ICTL_IRR0), soc_irq, 0); -+ num_parents = of_irq_count(node); -+ if (num_parents > RTL_ICTL_NUM_OUTPUTS) { -+ pr_err("too many parent interrupts\n"); -+ return -EINVAL; -+ } -+ -+ for (p = 0; p < num_parents; p++) -+ parent_irqs[p] = of_irq_get(node, p); - -- if (WARN_ON(!of_irq_count(node))) { -+ if (WARN_ON(!num_parents)) { - /* - * If DT contains no parent interrupts, assume MIPS CPU IRQ 2 - * (HW0) is connected to the first output. This is the case for - * all known hardware anyway. "interrupt-map" is deprecated, so - * don't bother trying to parse that. -+ * Since this is to account for old devicetrees with one-cell -+ * interrupt specifiers, only one output domain is needed. - */ - oirq.np = of_find_compatible_node(NULL, NULL, "mti,cpu-interrupt-controller"); -- oirq.args_count = 1; -- oirq.args[0] = 2; - -- parent_irq = irq_create_of_mapping(&oirq); -+ if (oirq.np) { -+ oirq.args_count = 1; -+ oirq.args[0] = 2; -+ -+ parent_irqs[0] = irq_create_of_mapping(&oirq); -+ num_parents = 1; -+ } - - of_node_put(oirq.np); -- } else { -- parent_irq = of_irq_get(node, 0); - } - -- if (parent_irq < 0) -- return parent_irq; -- else if (!parent_irq) -- return -ENODEV; -- -- domain = irq_domain_create_linear(of_fwnode_handle(node), RTL_ICTL_NUM_INPUTS, &irq_domain_ops, NULL); -- if (!domain) -- return -ENOMEM; -- -- irq_set_chained_handler_and_data(parent_irq, realtek_irq_dispatch, domain); -+ /* Ensure we haven't collected any errors before proceeding */ -+ for (p = 0; p < num_parents; p++) { -+ if (parent_irqs[p] < 0) -+ return parent_irqs[p]; -+ if (!parent_irqs[p]) -+ return -ENODEV; -+ } - -- return 0; -+ return setup_parent_interrupts(node, &parent_irqs[0], num_parents); - } - - IRQCHIP_DECLARE(realtek_rtl_intc, "realtek,rtl-intc", realtek_rtl_of_init); From 55cf68c52c381776e0bcb05731996181f050ea2e Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Sun, 28 Jun 2026 09:21:37 +0200 Subject: [PATCH 19/61] realtek: l3: move host_route_use_bm to layer 3 This is another layer 3 specific attribute. Move it to its new home. Link: https://github.com/openwrt/openwrt/pull/23979 Signed-off-by: Markus Stockhausen --- .../linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c | 6 +++--- .../linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h | 3 +++ .../realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h | 2 -- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c index 1d8390da3c..deef903306 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c @@ -668,7 +668,7 @@ static void otto_l3_route_remove(struct otto_l3_ctrl *ctrl, struct otto_l3_route dev_dbg(ctrl->dev, "Got id for host route: %d\n", id); r->attr.valid = false; priv->r->host_route_write(id, r); - clear_bit(r->id - MAX_ROUTES, priv->host_route_use_bm); + clear_bit(r->id - MAX_ROUTES, ctrl->host_route_use_bm); } else { /* If there is a HW representation of the route, delete it */ if (ctrl->cfg->route_lookup_hw) { @@ -691,7 +691,7 @@ static struct otto_l3_route *otto_l3_host_route_alloc(struct otto_l3_ctrl *ctrl, mutex_lock(&priv->reg_mutex); - idx = find_first_zero_bit(priv->host_route_use_bm, MAX_HOST_ROUTES); + idx = find_first_zero_bit(ctrl->host_route_use_bm, MAX_HOST_ROUTES); dev_dbg(ctrl->dev, "id: %d, ip %pI4\n", idx, &ip); r = kzalloc(sizeof(*r), GFP_KERNEL); @@ -716,7 +716,7 @@ static struct otto_l3_route *otto_l3_host_route_alloc(struct otto_l3_ctrl *ctrl, goto out_free; } - set_bit(idx, priv->host_route_use_bm); + set_bit(idx, ctrl->host_route_use_bm); mutex_unlock(&priv->reg_mutex); diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h index 1440b7c0ed..f780e6e424 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h @@ -5,6 +5,8 @@ #include "rtl-otto.h" +#define MAX_HOST_ROUTES 1536 + /* An entry in the RTL93XX SoC's ROUTER_MAC tables setting up a termination point * for the L3 routing system. Packets arriving and matching an entry in this table * will be considered for routing. @@ -42,6 +44,7 @@ struct otto_l3_ctrl { struct notifier_block fib_nb; struct notifier_block ne_nb; struct rhltable routes; + unsigned long host_route_use_bm[MAX_HOST_ROUTES / 32]; }; struct otto_l3_route_attr { diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h index 393ad060cb..4f172a4835 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h @@ -871,7 +871,6 @@ typedef enum { #define N_FIXED_FIELDS_RTL931X 14 #define MAX_COUNTERS 2048 #define MAX_ROUTES 512 -#define MAX_HOST_ROUTES 1536 #define MAX_INTF_MTUS 8 #define DEFAULT_MTU 1536 #define MAX_INTERFACES 100 @@ -1485,7 +1484,6 @@ struct rtl838x_switch_priv { unsigned long octet_cntr_use_bm[MAX_COUNTERS >> 5]; unsigned long packet_cntr_use_bm[MAX_COUNTERS >> 4]; unsigned long route_use_bm[MAX_ROUTES >> 5]; - unsigned long host_route_use_bm[MAX_HOST_ROUTES >> 5]; struct rtl838x_l3_intf *interfaces[MAX_INTERFACES]; u16 intf_mtus[MAX_INTF_MTUS]; int intf_mtu_count[MAX_INTF_MTUS]; From 04ca93a8561f3909dfb2ccd5538cd9959c855906 Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Sun, 28 Jun 2026 09:36:35 +0200 Subject: [PATCH 20/61] realtek: l3: move host_route_write to layer 3 source Move another function from DSA to layer 3 coding. Link: https://github.com/openwrt/openwrt/pull/23979 Signed-off-by: Markus Stockhausen --- .../files-6.18/drivers/net/dsa/rtl83xx/l3.c | 62 +++++++++++++++++-- .../files-6.18/drivers/net/dsa/rtl83xx/l3.h | 1 + .../drivers/net/dsa/rtl83xx/rtl-otto.h | 1 - .../drivers/net/dsa/rtl83xx/rtl930x.c | 56 ----------------- 4 files changed, 59 insertions(+), 61 deletions(-) diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c index deef903306..2dbadb6067 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c @@ -95,6 +95,59 @@ static void otto_l3_839x_route_write(struct otto_l3_ctrl *ctrl, int idx, struct rtl_table_release(r); } +/* Write a host route entry from the table using its index. Only unicast routes supported */ +__maybe_unused +static void otto_l3_930x_host_route_write(struct otto_l3_ctrl *ctrl, int idx, struct otto_l3_route *rt) +{ + /* The table has a size of 5 (for UC, 11 for MC) registers */ + struct table_reg *r = rtl_table_get(RTL9300_TBL_1, 1); + u32 v; + + idx = ((idx / 6) * 8) + (idx % 6); + + dev_dbg(ctrl->dev, "index %d is valid: %d\n", idx, rt->attr.valid); + dev_dbg(ctrl->dev, "next_hop: %d, hit: %d, action :%d, ttl_dec %d, ttl_check %d, dst_null %d\n", + rt->nh.id, rt->attr.hit, rt->attr.action, rt->attr.ttl_dec, rt->attr.ttl_check, + rt->attr.dst_null); + dev_dbg(ctrl->dev, "GW: %pI4, prefix_len: %d\n", &rt->dst_ip, rt->prefix_len); + + v = BIT(31); /* Entry is valid */ + v |= (rt->attr.type & 0x3) << 29; + v |= rt->attr.hit ? BIT(20) : 0; + v |= rt->attr.dst_null ? BIT(19) : 0; + v |= (rt->attr.action & 0x3) << 17; + v |= (rt->nh.id & 0x7ff) << 6; + v |= rt->attr.ttl_dec ? BIT(5) : 0; + v |= rt->attr.ttl_check ? BIT(4) : 0; + v |= rt->attr.qos_as ? BIT(3) : 0; + v |= rt->attr.qos_prio & 0x7; + + sw_w32(v, rtl_table_data(r, 0)); + switch (rt->attr.type) { + case 0: /* IPv4 Unicast route */ + sw_w32(0, rtl_table_data(r, 1)); + sw_w32(0, rtl_table_data(r, 2)); + sw_w32(0, rtl_table_data(r, 3)); + sw_w32(rt->dst_ip, rtl_table_data(r, 4)); + break; + case 2: /* IPv6 Unicast route */ + sw_w32(rt->dst_ip6.s6_addr32[0], rtl_table_data(r, 1)); + sw_w32(rt->dst_ip6.s6_addr32[1], rtl_table_data(r, 2)); + sw_w32(rt->dst_ip6.s6_addr32[2], rtl_table_data(r, 3)); + sw_w32(rt->dst_ip6.s6_addr32[3], rtl_table_data(r, 4)); + break; + case 1: /* IPv4 Multicast route */ + case 3: /* IPv6 Multicast route */ + dev_warn(ctrl->dev, "route type not supported\n"); + goto out; + } + + rtl_table_write(r, idx); + +out: + rtl_table_release(r); +} + /* * Reads a MAC entry for L3 termination as entry point for routing from the hardware table. * idx is the index into the L3_ROUTER_MAC table @@ -591,7 +644,7 @@ static int otto_l3_nexthop_update(struct otto_l3_ctrl *ctrl, __be32 ip_addr, u64 int slot = priv->r->find_l3_slot(r, false); dev_info(ctrl->dev, "Got slot for route: %d\n", slot); - priv->r->host_route_write(slot, r); + ctrl->cfg->host_route_write(ctrl, slot, r); } else { ctrl->cfg->route_write(ctrl, r->id, r); r->pr.fwd_sel = true; @@ -667,7 +720,7 @@ static void otto_l3_route_remove(struct otto_l3_ctrl *ctrl, struct otto_l3_route id = priv->r->find_l3_slot(r, false); dev_dbg(ctrl->dev, "Got id for host route: %d\n", id); r->attr.valid = false; - priv->r->host_route_write(id, r); + ctrl->cfg->host_route_write(ctrl, id, r); clear_bit(r->id - MAX_ROUTES, ctrl->host_route_use_bm); } else { /* If there is a HW representation of the route, delete it */ @@ -812,7 +865,7 @@ static int otto_l3_fib_add_v4(struct otto_l3_ctrl *ctrl, struct fib_entry_notifi } /* Allocate route or host-route entry (if hardware supports this) */ - if (info->dst_len == 32 && priv->r->host_route_write) + if (info->dst_len == 32 && ctrl->cfg->host_route_write) route = otto_l3_host_route_alloc(ctrl, nh->fib_nh_gw4); else route = otto_l3_route_alloc(ctrl, nh->fib_nh_gw4); @@ -852,7 +905,7 @@ static int otto_l3_fib_add_v4(struct otto_l3_ctrl *ctrl, struct fib_entry_notifi slot = priv->r->find_l3_slot(route, false); dev_dbg(ctrl->dev, "Got slot for route: %d\n", slot); - priv->r->host_route_write(slot, route); + ctrl->cfg->host_route_write(ctrl, slot, route); } } @@ -1096,6 +1149,7 @@ const struct otto_l3_config otto_l3_839x_cfg = { const struct otto_l3_config otto_l3_930x_cfg = { #ifdef CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD + .host_route_write = otto_l3_930x_host_route_write, .get_router_mac = otto_l3_930x_get_router_mac, .set_router_mac = otto_l3_930x_set_router_mac, .get_nexthop = otto_l3_930x_get_nexthop, diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h index f780e6e424..276c19a80b 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h @@ -28,6 +28,7 @@ struct otto_l3_router_mac { struct otto_l3_config { + void (*host_route_write)(struct otto_l3_ctrl *ctrl, int idx, struct otto_l3_route *rt); void (*get_router_mac)(struct otto_l3_ctrl *ctrl, u32 idx, struct otto_l3_router_mac *m); void (*set_router_mac)(struct otto_l3_ctrl *ctrl, u32 idx, struct otto_l3_router_mac *m); void (*get_nexthop)(struct otto_l3_ctrl *ctrl, int idx, u16 *dmac_id, u16 *interface); diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h index 4f172a4835..dea01a6f72 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h @@ -1417,7 +1417,6 @@ struct rtldsa_config { void (*l2_learning_setup)(void); u32 (*packet_cntr_read)(int counter); void (*packet_cntr_clear)(int counter); - void (*host_route_write)(int idx, struct otto_l3_route *rt); int (*l3_setup)(struct rtl838x_switch_priv *priv); u64 (*get_l3_egress_mac)(u32 idx); void (*set_l3_egress_mac)(u32 idx, u64 mac); diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl930x.c b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl930x.c index a2acd1bf27..a07100cf9f 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl930x.c +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl930x.c @@ -1317,61 +1317,6 @@ out: rtl_table_release(r); } -/* Write a host route entry from the table using its index - * We currently only support IPv4 and IPv6 unicast route - */ -static void rtl930x_host_route_write(int idx, struct otto_l3_route *rt) -{ - u32 v; - /* Access L3_HOST_ROUTE_IPUC table (1) via register RTL9300_TBL_1 */ - struct table_reg *r = rtl_table_get(RTL9300_TBL_1, 1); - /* The table has a size of 5 (for UC, 11 for MC) registers */ - - idx = ((idx / 6) * 8) + (idx % 6); - - pr_debug("%s: index %d is valid: %d\n", __func__, idx, rt->attr.valid); - pr_debug("%s: next_hop: %d, hit: %d, action :%d, ttl_dec %d, ttl_check %d, dst_null %d\n", - __func__, rt->nh.id, rt->attr.hit, rt->attr.action, rt->attr.ttl_dec, rt->attr.ttl_check, - rt->attr.dst_null); - pr_debug("%s: GW: %pI4, prefix_len: %d\n", __func__, &rt->dst_ip, rt->prefix_len); - - v = BIT(31); /* Entry is valid */ - v |= (rt->attr.type & 0x3) << 29; - v |= rt->attr.hit ? BIT(20) : 0; - v |= rt->attr.dst_null ? BIT(19) : 0; - v |= (rt->attr.action & 0x3) << 17; - v |= (rt->nh.id & 0x7ff) << 6; - v |= rt->attr.ttl_dec ? BIT(5) : 0; - v |= rt->attr.ttl_check ? BIT(4) : 0; - v |= rt->attr.qos_as ? BIT(3) : 0; - v |= rt->attr.qos_prio & 0x7; - - sw_w32(v, rtl_table_data(r, 0)); - switch (rt->attr.type) { - case 0: /* IPv4 Unicast route */ - sw_w32(0, rtl_table_data(r, 1)); - sw_w32(0, rtl_table_data(r, 2)); - sw_w32(0, rtl_table_data(r, 3)); - sw_w32(rt->dst_ip, rtl_table_data(r, 4)); - break; - case 2: /* IPv6 Unicast route */ - sw_w32(rt->dst_ip6.s6_addr32[0], rtl_table_data(r, 1)); - sw_w32(rt->dst_ip6.s6_addr32[1], rtl_table_data(r, 2)); - sw_w32(rt->dst_ip6.s6_addr32[2], rtl_table_data(r, 3)); - sw_w32(rt->dst_ip6.s6_addr32[3], rtl_table_data(r, 4)); - break; - case 1: /* IPv4 Multicast route */ - case 3: /* IPv6 Multicast route */ - pr_warn("%s: route type not supported\n", __func__); - goto out; - } - - rtl_table_write(r, idx); - -out: - rtl_table_release(r); -} - static int rtl930x_find_l3_slot(struct otto_l3_route *rt, bool must_exist) { int slot_width, algorithm, addr, idx; @@ -2574,7 +2519,6 @@ const struct rtldsa_config rtldsa_930x_cfg = { .packet_cntr_read = rtl930x_packet_cntr_read, .packet_cntr_clear = rtl930x_packet_cntr_clear, #ifdef CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD - .host_route_write = rtl930x_host_route_write, .l3_setup = rtl930x_l3_setup, .get_l3_egress_mac = rtl930x_get_l3_egress_mac, .set_l3_egress_mac = rtl930x_set_l3_egress_mac, From e0377bf3827bfaaf081f9cf7dec9d76076b4b42e Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Sun, 28 Jun 2026 09:56:02 +0200 Subject: [PATCH 21/61] realtek: l3: relocate get_egress_mac() Move get_egress_mac() from DSA to layer 3 code. Link: https://github.com/openwrt/openwrt/pull/23979 Signed-off-by: Markus Stockhausen --- .../files-6.18/drivers/net/dsa/rtl83xx/l3.c | 23 ++++++++++++++++++- .../files-6.18/drivers/net/dsa/rtl83xx/l3.h | 1 + .../drivers/net/dsa/rtl83xx/rtl-otto.h | 1 - .../drivers/net/dsa/rtl83xx/rtl930x.c | 21 ----------------- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c index 2dbadb6067..19bc148961 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c @@ -95,6 +95,26 @@ static void otto_l3_839x_route_write(struct otto_l3_ctrl *ctrl, int idx, struct rtl_table_release(r); } +/* + * Get the Destination-MAC of an L3 egress interface or the Source MAC for routed packets + * from the SoC's L3_EGR_INTF_MAC table. Indexes 0-2047 are DMACs, 2048+ are SMACs + */ +__maybe_unused +static u64 otto_l3_930x_get_egress_mac(struct otto_l3_ctrl *ctrl, u32 idx) +{ + struct table_reg *r = rtl_table_get(RTL9300_TBL_2, 2); + u64 mac; + + rtl_table_read(r, idx); + /* The table has a size of 2 registers */ + mac = sw_r32(rtl_table_data(r, 0)); + mac <<= 32; + mac |= sw_r32(rtl_table_data(r, 1)); + rtl_table_release(r); + + return mac; +} + /* Write a host route entry from the table using its index. Only unicast routes supported */ __maybe_unused static void otto_l3_930x_host_route_write(struct otto_l3_ctrl *ctrl, int idx, struct otto_l3_route *rt) @@ -563,7 +583,7 @@ static int otto_l3_alloc_egress_intf(struct otto_l3_ctrl *ctrl, u64 mac, int vla mutex_lock(&priv->reg_mutex); for (int i = 0; i < MAX_SMACS; i++) { - m = priv->r->get_l3_egress_mac(L3_EGRESS_DMACS + i); + m = ctrl->cfg->get_egress_mac(ctrl, L3_EGRESS_DMACS + i); if (free_mac < 0 && !m) { free_mac = i; continue; @@ -1149,6 +1169,7 @@ const struct otto_l3_config otto_l3_839x_cfg = { const struct otto_l3_config otto_l3_930x_cfg = { #ifdef CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD + .get_egress_mac = otto_l3_930x_get_egress_mac, .host_route_write = otto_l3_930x_host_route_write, .get_router_mac = otto_l3_930x_get_router_mac, .set_router_mac = otto_l3_930x_set_router_mac, diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h index 276c19a80b..6445c1cad4 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h @@ -28,6 +28,7 @@ struct otto_l3_router_mac { struct otto_l3_config { + u64 (*get_egress_mac)(struct otto_l3_ctrl *ctrl, u32 idx); void (*host_route_write)(struct otto_l3_ctrl *ctrl, int idx, struct otto_l3_route *rt); void (*get_router_mac)(struct otto_l3_ctrl *ctrl, u32 idx, struct otto_l3_router_mac *m); void (*set_router_mac)(struct otto_l3_ctrl *ctrl, u32 idx, struct otto_l3_router_mac *m); diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h index dea01a6f72..c1abc0d347 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h @@ -1418,7 +1418,6 @@ struct rtldsa_config { u32 (*packet_cntr_read)(int counter); void (*packet_cntr_clear)(int counter); int (*l3_setup)(struct rtl838x_switch_priv *priv); - u64 (*get_l3_egress_mac)(u32 idx); void (*set_l3_egress_mac)(u32 idx, u64 mac); int (*find_l3_slot)(struct otto_l3_route *rt, bool must_exist); void (*set_l3_egress_intf)(int idx, struct rtl838x_l3_intf *intf); diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl930x.c b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl930x.c index a07100cf9f..c51de88454 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl930x.c +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl930x.c @@ -1999,26 +1999,6 @@ static void rtl930x_set_l3_egress_intf(int idx, struct rtl838x_l3_intf *intf) rtl_table_release(r); } -/* Get the Destination-MAC of an L3 egress interface or the Source MAC for routed packets - * from the SoC's L3_EGR_INTF_MAC table - * Indexes 0-2047 are DMACs, 2048+ are SMACs - */ -static u64 rtl930x_get_l3_egress_mac(u32 idx) -{ - u64 mac; - /* Read L3_EGR_INTF_MAC table (2) via register RTL9300_TBL_2 */ - struct table_reg *r = rtl_table_get(RTL9300_TBL_2, 2); - - rtl_table_read(r, idx); - /* The table has a size of 2 registers */ - mac = sw_r32(rtl_table_data(r, 0)); - mac <<= 32; - mac |= sw_r32(rtl_table_data(r, 1)); - rtl_table_release(r); - - return mac; -} - /* Set the Destination-MAC of a route or the Source MAC of an L3 egress interface * in the SoC's L3_EGR_INTF_MAC table * Indexes 0-2047 are DMACs, 2048+ are SMACs @@ -2520,7 +2500,6 @@ const struct rtldsa_config rtldsa_930x_cfg = { .packet_cntr_clear = rtl930x_packet_cntr_clear, #ifdef CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD .l3_setup = rtl930x_l3_setup, - .get_l3_egress_mac = rtl930x_get_l3_egress_mac, .set_l3_egress_mac = rtl930x_set_l3_egress_mac, .find_l3_slot = rtl930x_find_l3_slot, .set_l3_egress_intf = rtl930x_set_l3_egress_intf, From 4d8217345131a5dab98bd2c81afc1086c64e8499 Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Sun, 28 Jun 2026 10:18:04 +0200 Subject: [PATCH 22/61] realtek: l3: relocate set_egress_intf() Relocate set_egress_intf() to layer 3 code. While we are here change prefix of interface structure to otto_l3_ and move its definition to the new code too. Link: https://github.com/openwrt/openwrt/pull/23979 Signed-off-by: Markus Stockhausen --- .../files-6.18/drivers/net/dsa/rtl83xx/l3.c | 37 ++++++++++++++++++- .../files-6.18/drivers/net/dsa/rtl83xx/l3.h | 17 +++++++++ .../drivers/net/dsa/rtl83xx/rtl-otto.h | 18 --------- .../drivers/net/dsa/rtl83xx/rtl930x.c | 34 ----------------- 4 files changed, 52 insertions(+), 54 deletions(-) diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c index 19bc148961..5c95f06420 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c @@ -574,10 +574,42 @@ static int otto_l3_alloc_router_mac(struct otto_l3_ctrl *ctrl, u64 mac) return 0; } +/* + * Sets up an egress interface for L3 actions Actions for ip4/6_icmp_redirect, ip4/6_pbr_icmp_redirect are: + * 0: FORWARD, 1: DROP, 2: TRAP2CPU, 3: COPY2CPU, 4: TRAP2MASTERCPU, 5: COPY2MASTERCPU, 6: HARDDROP + * idx is the index in the HW interface table: idx < 0x80 + */ +__maybe_unused +static void otto_l3_930x_set_egress_intf(struct otto_l3_ctrl *ctrl, int idx, struct otto_l3_intf *intf) +{ + struct table_reg *r = rtl_table_get(RTL9300_TBL_1, 4); + u32 u, v; + + /* The table has 2 registers */ + u = (intf->vid & 0xfff) << 9; + u |= (intf->smac_idx & 0x3f) << 3; + u |= (intf->ip4_mtu_id & 0x7); + + v = (intf->ip6_mtu_id & 0x7) << 28; + v |= (intf->ttl_scope & 0xff) << 20; + v |= (intf->hl_scope & 0xff) << 12; + v |= (intf->ip4_icmp_redirect & 0x7) << 9; + v |= (intf->ip6_icmp_redirect & 0x7) << 6; + v |= (intf->ip4_pbr_icmp_redirect & 0x7) << 3; + v |= (intf->ip6_pbr_icmp_redirect & 0x7); + + sw_w32(u, rtl_table_data(r, 0)); + sw_w32(v, rtl_table_data(r, 1)); + + dev_dbg(ctrl->dev, "writing to index %d: %08x %08x\n", idx, u, v); + rtl_table_write(r, idx & 0x7f); + rtl_table_release(r); +} + static int otto_l3_alloc_egress_intf(struct otto_l3_ctrl *ctrl, u64 mac, int vlan) { struct rtl838x_switch_priv *priv = ctrl->priv; - struct rtl838x_l3_intf intf; + struct otto_l3_intf intf; int free_mac = -1; u64 m; @@ -608,7 +640,7 @@ static int otto_l3_alloc_egress_intf(struct otto_l3_ctrl *ctrl, u64 mac, int vla intf.hl_scope = 1; /* Hop Limit */ intf.ip4_icmp_redirect = intf.ip6_icmp_redirect = 2; /* FORWARD */ intf.ip4_pbr_icmp_redirect = intf.ip6_pbr_icmp_redirect = 2; /* FORWARD; */ - priv->r->set_l3_egress_intf(free_mac, &intf); + ctrl->cfg->set_egress_intf(ctrl, free_mac, &intf); priv->r->set_l3_egress_mac(L3_EGRESS_DMACS + free_mac, mac); @@ -1170,6 +1202,7 @@ const struct otto_l3_config otto_l3_839x_cfg = { const struct otto_l3_config otto_l3_930x_cfg = { #ifdef CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD .get_egress_mac = otto_l3_930x_get_egress_mac, + .set_egress_intf = otto_l3_930x_set_egress_intf, .host_route_write = otto_l3_930x_host_route_write, .get_router_mac = otto_l3_930x_get_router_mac, .set_router_mac = otto_l3_930x_set_router_mac, diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h index 6445c1cad4..8fb683e73f 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h @@ -6,6 +6,7 @@ #include "rtl-otto.h" #define MAX_HOST_ROUTES 1536 +#define MAX_INTERFACES 100 /* An entry in the RTL93XX SoC's ROUTER_MAC tables setting up a termination point * for the L3 routing system. Packets arriving and matching an entry in this table @@ -26,8 +27,23 @@ struct otto_l3_router_mac { u64 mac_mask; }; +struct otto_l3_intf { + u16 vid; + u8 smac_idx; + u8 ip4_mtu_id; + u8 ip6_mtu_id; + u16 ip4_mtu; + u16 ip6_mtu; + u8 ttl_scope; + u8 hl_scope; + u8 ip4_icmp_redirect; + u8 ip6_icmp_redirect; + u8 ip4_pbr_icmp_redirect; + u8 ip6_pbr_icmp_redirect; +}; struct otto_l3_config { + void (*set_egress_intf)(struct otto_l3_ctrl *ctrl, int idx, struct otto_l3_intf *intf); u64 (*get_egress_mac)(struct otto_l3_ctrl *ctrl, u32 idx); void (*host_route_write)(struct otto_l3_ctrl *ctrl, int idx, struct otto_l3_route *rt); void (*get_router_mac)(struct otto_l3_ctrl *ctrl, u32 idx, struct otto_l3_router_mac *m); @@ -47,6 +63,7 @@ struct otto_l3_ctrl { struct notifier_block ne_nb; struct rhltable routes; unsigned long host_route_use_bm[MAX_HOST_ROUTES / 32]; + struct otto_l3_intf *interfaces[MAX_INTERFACES]; }; struct otto_l3_route_attr { diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h index c1abc0d347..ff6ad3af73 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h @@ -873,7 +873,6 @@ typedef enum { #define MAX_ROUTES 512 #define MAX_INTF_MTUS 8 #define DEFAULT_MTU 1536 -#define MAX_INTERFACES 100 #define MAX_ROUTER_MACS 64 #define L3_EGRESS_DMACS 2048 #define MAX_SMACS 64 @@ -1269,21 +1268,6 @@ struct pie_rule { bool bypass_ibc_sc; /* Bypass Ingress Bandwidth Control and Storm Control */ }; -struct rtl838x_l3_intf { - u16 vid; - u8 smac_idx; - u8 ip4_mtu_id; - u8 ip6_mtu_id; - u16 ip4_mtu; - u16 ip6_mtu; - u8 ttl_scope; - u8 hl_scope; - u8 ip4_icmp_redirect; - u8 ip6_icmp_redirect; - u8 ip4_pbr_icmp_redirect; - u8 ip6_pbr_icmp_redirect; -}; - struct rtl838x_switch_priv; struct rtl83xx_flow { @@ -1420,7 +1404,6 @@ struct rtldsa_config { int (*l3_setup)(struct rtl838x_switch_priv *priv); void (*set_l3_egress_mac)(u32 idx, u64 mac); int (*find_l3_slot)(struct otto_l3_route *rt, bool must_exist); - void (*set_l3_egress_intf)(int idx, struct rtl838x_l3_intf *intf); void (*set_receive_management_action)(int port, rma_ctrl_t type, action_type_t action); void (*led_init)(struct rtl838x_switch_priv *priv); void (*qos_init)(struct rtl838x_switch_priv *priv); @@ -1482,7 +1465,6 @@ struct rtl838x_switch_priv { unsigned long octet_cntr_use_bm[MAX_COUNTERS >> 5]; unsigned long packet_cntr_use_bm[MAX_COUNTERS >> 4]; unsigned long route_use_bm[MAX_ROUTES >> 5]; - struct rtl838x_l3_intf *interfaces[MAX_INTERFACES]; u16 intf_mtus[MAX_INTF_MTUS]; int intf_mtu_count[MAX_INTF_MTUS]; diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl930x.c b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl930x.c index c51de88454..6ab23cd69f 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl930x.c +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl930x.c @@ -1966,39 +1966,6 @@ static void rtl930x_pie_init(struct rtl838x_switch_priv *priv) #ifdef CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD -/* Sets up an egress interface for L3 actions - * Actions for ip4/6_icmp_redirect, ip4/6_pbr_icmp_redirect are: - * 0: FORWARD, 1: DROP, 2: TRAP2CPU, 3: COPY2CPU, 4: TRAP2MASTERCPU 5: COPY2MASTERCPU - * 6: HARDDROP - * idx is the index in the HW interface table: idx < 0x80 - */ -static void rtl930x_set_l3_egress_intf(int idx, struct rtl838x_l3_intf *intf) -{ - u32 u, v; - /* Read L3_EGR_INTF table (4) via register RTL9300_TBL_1 */ - struct table_reg *r = rtl_table_get(RTL9300_TBL_1, 4); - - /* The table has 2 registers */ - u = (intf->vid & 0xfff) << 9; - u |= (intf->smac_idx & 0x3f) << 3; - u |= (intf->ip4_mtu_id & 0x7); - - v = (intf->ip6_mtu_id & 0x7) << 28; - v |= (intf->ttl_scope & 0xff) << 20; - v |= (intf->hl_scope & 0xff) << 12; - v |= (intf->ip4_icmp_redirect & 0x7) << 9; - v |= (intf->ip6_icmp_redirect & 0x7) << 6; - v |= (intf->ip4_pbr_icmp_redirect & 0x7) << 3; - v |= (intf->ip6_pbr_icmp_redirect & 0x7); - - sw_w32(u, rtl_table_data(r, 0)); - sw_w32(v, rtl_table_data(r, 1)); - - pr_debug("%s writing to index %d: %08x %08x\n", __func__, idx, u, v); - rtl_table_write(r, idx & 0x7f); - rtl_table_release(r); -} - /* Set the Destination-MAC of a route or the Source MAC of an L3 egress interface * in the SoC's L3_EGR_INTF_MAC table * Indexes 0-2047 are DMACs, 2048+ are SMACs @@ -2502,7 +2469,6 @@ const struct rtldsa_config rtldsa_930x_cfg = { .l3_setup = rtl930x_l3_setup, .set_l3_egress_mac = rtl930x_set_l3_egress_mac, .find_l3_slot = rtl930x_find_l3_slot, - .set_l3_egress_intf = rtl930x_set_l3_egress_intf, #endif .led_init = rtl930x_led_init, .enable_learning = rtldsa_930x_enable_learning, From 339db36d9727e9e5e69639856b3a5a4ae907723e Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Sun, 28 Jun 2026 10:46:49 +0200 Subject: [PATCH 23/61] realtek: l3: relocate find_slot() Move find_slot() and its helpers into the new layer 3 ecosystem. Link: https://github.com/openwrt/openwrt/pull/23979 Signed-off-by: Markus Stockhausen --- .../files-6.18/drivers/net/dsa/rtl83xx/l3.c | 118 +++++++++++++++++- .../files-6.18/drivers/net/dsa/rtl83xx/l3.h | 3 + .../drivers/net/dsa/rtl83xx/rtl-otto.h | 1 - .../drivers/net/dsa/rtl83xx/rtl930x.c | 115 ----------------- 4 files changed, 118 insertions(+), 119 deletions(-) diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c index 5c95f06420..f82e36ac20 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c @@ -95,6 +95,33 @@ static void otto_l3_839x_route_write(struct otto_l3_ctrl *ctrl, int idx, struct rtl_table_release(r); } +__maybe_unused +static u32 otto_l3_930x_hash4(u32 ip, int algorithm, bool move_dip) +{ + u32 s0, s1, pH; + u32 rows[4]; + u32 hash; + + memset(rows, 0, sizeof(rows)); + + rows[0] = HASH_PICK(ip, 27, 5); + rows[1] = HASH_PICK(ip, 18, 9); + rows[2] = HASH_PICK(ip, 9, 9); + + if (!move_dip) + rows[3] = HASH_PICK(ip, 0, 9); + + if (!algorithm) { + hash = rows[0] ^ rows[1] ^ rows[2] ^ rows[3]; + } else { + s0 = rows[0] + rows[1] + rows[2]; + s1 = (s0 & 0x1ff) + ((s0 & (0x1ff << 9)) >> 9); + pH = (s1 & 0x1ff) + ((s1 & (0x1ff << 9)) >> 9); + hash = pH ^ rows[3]; + } + return hash; +} + /* * Get the Destination-MAC of an L3 egress interface or the Source MAC for routed packets * from the SoC's L3_EGR_INTF_MAC table. Indexes 0-2047 are DMACs, 2048+ are SMACs @@ -115,6 +142,55 @@ static u64 otto_l3_930x_get_egress_mac(struct otto_l3_ctrl *ctrl, u32 idx) return mac; } +/* Read a host route entry from the table using its index. Only IPv4 and IPv6 unicast supported */ +__maybe_unused +static void otto_l3_930x_host_route_read(struct otto_l3_ctrl *ctrl, int idx, struct otto_l3_route *rt) +{ + struct table_reg *r = rtl_table_get(RTL9300_TBL_1, 1); + u32 v; + + idx = ((idx / 6) * 8) + (idx % 6); + + rtl_table_read(r, idx); + /* The table has a size of 5 (for UC, 11 for MC) registers */ + v = sw_r32(rtl_table_data(r, 0)); + rt->attr.valid = !!(v & BIT(31)); + if (!rt->attr.valid) + goto out; + rt->attr.type = (v >> 29) & 0x3; + switch (rt->attr.type) { + case 0: /* IPv4 Unicast route */ + rt->dst_ip = sw_r32(rtl_table_data(r, 4)); + break; + case 2: /* IPv6 Unicast route */ + ipv6_addr_set(&rt->dst_ip6, + sw_r32(rtl_table_data(r, 3)), sw_r32(rtl_table_data(r, 2)), + sw_r32(rtl_table_data(r, 1)), sw_r32(rtl_table_data(r, 0))); + break; + case 1: /* IPv4 Multicast route */ + case 3: /* IPv6 Multicast route */ + dev_warn(ctrl->dev, "route type not supported\n"); + goto out; + } + + rt->attr.hit = !!(v & BIT(20)); + rt->attr.dst_null = !!(v & BIT(19)); + rt->attr.action = (v >> 17) & 3; + rt->nh.id = (v >> 6) & 0x7ff; + rt->attr.ttl_dec = !!(v & BIT(5)); + rt->attr.ttl_check = !!(v & BIT(4)); + rt->attr.qos_as = !!(v & BIT(3)); + rt->attr.qos_prio = v & 0x7; + dev_dbg(ctrl->dev, "index %d is valid: %d\n", idx, rt->attr.valid); + dev_dbg(ctrl->dev, "next_hop: %d, hit: %d, action :%d, ttl_dec %d, ttl_check %d, dst_null %d\n", + rt->nh.id, rt->attr.hit, rt->attr.action, rt->attr.ttl_dec, rt->attr.ttl_check, + rt->attr.dst_null); + dev_dbg(ctrl->dev, "Destination: %pI4\n", &rt->dst_ip); + +out: + rtl_table_release(r); +} + /* Write a host route entry from the table using its index. Only unicast routes supported */ __maybe_unused static void otto_l3_930x_host_route_write(struct otto_l3_ctrl *ctrl, int idx, struct otto_l3_route *rt) @@ -168,6 +244,41 @@ out: rtl_table_release(r); } +__maybe_unused +static int otto_l3_930x_find_slot(struct otto_l3_ctrl *ctrl, struct otto_l3_route *rt, bool must_exist) +{ + int slot_width, algorithm, addr, idx; + struct otto_l3_route route_entry; + u32 hash; + + /* IPv6 entries take up 3 slots */ + slot_width = (rt->attr.type == 0) || (rt->attr.type == 2) ? 1 : 3; + + for (int t = 0; t < 2; t++) { + algorithm = (sw_r32(RTL930X_L3_HOST_TBL_CTRL) >> (2 + t)) & 0x1; + hash = otto_l3_930x_hash4(rt->dst_ip, algorithm, false); + + dev_dbg(ctrl->dev, "table %d, algorithm %d, hash %04x\n", t, algorithm, hash); + + for (int s = 0; s < 6; s += slot_width) { + addr = (t << 12) | ((hash & 0x1ff) << 3) | s; + dev_dbg(ctrl->dev, "physical address %d\n", addr); + idx = ((addr / 8) * 6) + (addr % 8); + dev_dbg(ctrl->dev, "logical address %d\n", idx); + + otto_l3_930x_host_route_read(ctrl, idx, &route_entry); + dev_dbg(ctrl->dev, "route valid %d, route dest: %pI4, hit %d\n", + rt->attr.valid, &rt->dst_ip, rt->attr.hit); + if (!must_exist && rt->attr.valid) + return idx; + if (must_exist && route_entry.dst_ip == rt->dst_ip) + return idx; + } + } + + return -1; +} + /* * Reads a MAC entry for L3 termination as entry point for routing from the hardware table. * idx is the index into the L3_ROUTER_MAC table @@ -693,7 +804,7 @@ static int otto_l3_nexthop_update(struct otto_l3_ctrl *ctrl, __be32 ip_addr, u64 r->pr.dip_m = inet_make_mask(r->prefix_len); if (r->is_host_route) { - int slot = priv->r->find_l3_slot(r, false); + int slot = ctrl->cfg->find_slot(ctrl, r, false); dev_info(ctrl->dev, "Got slot for route: %d\n", slot); ctrl->cfg->host_route_write(ctrl, slot, r); @@ -769,7 +880,7 @@ static void otto_l3_route_remove(struct otto_l3_ctrl *ctrl, struct otto_l3_route dev_warn(ctrl->dev, "Could not remove route\n"); if (r->is_host_route) { - id = priv->r->find_l3_slot(r, false); + id = ctrl->cfg->find_slot(ctrl, r, false); dev_dbg(ctrl->dev, "Got id for host route: %d\n", id); r->attr.valid = false; ctrl->cfg->host_route_write(ctrl, id, r); @@ -955,7 +1066,7 @@ static int otto_l3_fib_add_v4(struct otto_l3_ctrl *ctrl, struct fib_entry_notifi route->attr.action = ROUTE_ACT_TRAP2CPU; route->attr.type = 0; - slot = priv->r->find_l3_slot(route, false); + slot = ctrl->cfg->find_slot(ctrl, route, false); dev_dbg(ctrl->dev, "Got slot for route: %d\n", slot); ctrl->cfg->host_route_write(ctrl, slot, route); } @@ -1201,6 +1312,7 @@ const struct otto_l3_config otto_l3_839x_cfg = { const struct otto_l3_config otto_l3_930x_cfg = { #ifdef CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD + .find_slot = otto_l3_930x_find_slot, .get_egress_mac = otto_l3_930x_get_egress_mac, .set_egress_intf = otto_l3_930x_set_egress_intf, .host_route_write = otto_l3_930x_host_route_write, diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h index 8fb683e73f..ebdedcac20 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h @@ -8,6 +8,8 @@ #define MAX_HOST_ROUTES 1536 #define MAX_INTERFACES 100 +#define HASH_PICK(val, lsb, len) ((val & (((1 << len) - 1) << lsb)) >> lsb) + /* An entry in the RTL93XX SoC's ROUTER_MAC tables setting up a termination point * for the L3 routing system. Packets arriving and matching an entry in this table * will be considered for routing. @@ -43,6 +45,7 @@ struct otto_l3_intf { }; struct otto_l3_config { + int (*find_slot)(struct otto_l3_ctrl *ctrl, struct otto_l3_route *rt, bool must_exist); void (*set_egress_intf)(struct otto_l3_ctrl *ctrl, int idx, struct otto_l3_intf *intf); u64 (*get_egress_mac)(struct otto_l3_ctrl *ctrl, u32 idx); void (*host_route_write)(struct otto_l3_ctrl *ctrl, int idx, struct otto_l3_route *rt); diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h index ff6ad3af73..863c3603bf 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h @@ -1403,7 +1403,6 @@ struct rtldsa_config { void (*packet_cntr_clear)(int counter); int (*l3_setup)(struct rtl838x_switch_priv *priv); void (*set_l3_egress_mac)(u32 idx, u64 mac); - int (*find_l3_slot)(struct otto_l3_route *rt, bool must_exist); void (*set_receive_management_action)(int port, rma_ctrl_t type, action_type_t action); void (*led_init)(struct rtl838x_switch_priv *priv); void (*qos_init)(struct rtl838x_switch_priv *priv); diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl930x.c b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl930x.c index 6ab23cd69f..e2eb9a2e12 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl930x.c +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl930x.c @@ -1184,34 +1184,6 @@ static void rtl930x_init_eee(struct rtl838x_switch_priv *priv, bool enable) #ifdef CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD -#define HASH_PICK(val, lsb, len) ((val & (((1 << len) - 1) << lsb)) >> lsb) - -static u32 rtl930x_l3_hash4(u32 ip, int algorithm, bool move_dip) -{ - u32 rows[4]; - u32 hash; - u32 s0, s1, pH; - - memset(rows, 0, sizeof(rows)); - - rows[0] = HASH_PICK(ip, 27, 5); - rows[1] = HASH_PICK(ip, 18, 9); - rows[2] = HASH_PICK(ip, 9, 9); - - if (!move_dip) - rows[3] = HASH_PICK(ip, 0, 9); - - if (!algorithm) { - hash = rows[0] ^ rows[1] ^ rows[2] ^ rows[3]; - } else { - s0 = rows[0] + rows[1] + rows[2]; - s1 = (s0 & 0x1ff) + ((s0 & (0x1ff << 9)) >> 9); - pH = (s1 & 0x1ff) + ((s1 & (0x1ff << 9)) >> 9); - hash = pH ^ rows[3]; - } - return hash; -} - // Currently not used // static u32 rtl930x_l3_hash6(struct in6_addr *ip6, int algorithm, bool move_dip) // { @@ -1265,92 +1237,6 @@ static u32 rtl930x_l3_hash4(u32 ip, int algorithm, bool move_dip) // return hash; // } -/* Read a host route entry from the table using its index - * We currently only support IPv4 and IPv6 unicast route - */ -static void rtl930x_host_route_read(int idx, struct otto_l3_route *rt) -{ - u32 v; - /* Read L3_HOST_ROUTE_IPUC table (1) via register RTL9300_TBL_1 */ - struct table_reg *r = rtl_table_get(RTL9300_TBL_1, 1); - - idx = ((idx / 6) * 8) + (idx % 6); - - pr_debug("In %s, physical index %d\n", __func__, idx); - rtl_table_read(r, idx); - /* The table has a size of 5 (for UC, 11 for MC) registers */ - v = sw_r32(rtl_table_data(r, 0)); - rt->attr.valid = !!(v & BIT(31)); - if (!rt->attr.valid) - goto out; - rt->attr.type = (v >> 29) & 0x3; - switch (rt->attr.type) { - case 0: /* IPv4 Unicast route */ - rt->dst_ip = sw_r32(rtl_table_data(r, 4)); - break; - case 2: /* IPv6 Unicast route */ - ipv6_addr_set(&rt->dst_ip6, - sw_r32(rtl_table_data(r, 3)), sw_r32(rtl_table_data(r, 2)), - sw_r32(rtl_table_data(r, 1)), sw_r32(rtl_table_data(r, 0))); - break; - case 1: /* IPv4 Multicast route */ - case 3: /* IPv6 Multicast route */ - pr_warn("%s: route type not supported\n", __func__); - goto out; - } - - rt->attr.hit = !!(v & BIT(20)); - rt->attr.dst_null = !!(v & BIT(19)); - rt->attr.action = (v >> 17) & 3; - rt->nh.id = (v >> 6) & 0x7ff; - rt->attr.ttl_dec = !!(v & BIT(5)); - rt->attr.ttl_check = !!(v & BIT(4)); - rt->attr.qos_as = !!(v & BIT(3)); - rt->attr.qos_prio = v & 0x7; - pr_debug("%s: index %d is valid: %d\n", __func__, idx, rt->attr.valid); - pr_debug("%s: next_hop: %d, hit: %d, action :%d, ttl_dec %d, ttl_check %d, dst_null %d\n", - __func__, rt->nh.id, rt->attr.hit, rt->attr.action, rt->attr.ttl_dec, rt->attr.ttl_check, - rt->attr.dst_null); - pr_debug("%s: Destination: %pI4\n", __func__, &rt->dst_ip); - -out: - rtl_table_release(r); -} - -static int rtl930x_find_l3_slot(struct otto_l3_route *rt, bool must_exist) -{ - int slot_width, algorithm, addr, idx; - u32 hash; - struct otto_l3_route route_entry; - - /* IPv6 entries take up 3 slots */ - slot_width = (rt->attr.type == 0) || (rt->attr.type == 2) ? 1 : 3; - - for (int t = 0; t < 2; t++) { - algorithm = (sw_r32(RTL930X_L3_HOST_TBL_CTRL) >> (2 + t)) & 0x1; - hash = rtl930x_l3_hash4(rt->dst_ip, algorithm, false); - - pr_debug("%s: table %d, algorithm %d, hash %04x\n", __func__, t, algorithm, hash); - - for (int s = 0; s < 6; s += slot_width) { - addr = (t << 12) | ((hash & 0x1ff) << 3) | s; - pr_debug("%s physical address %d\n", __func__, addr); - idx = ((addr / 8) * 6) + (addr % 8); - pr_debug("%s logical address %d\n", __func__, idx); - - rtl930x_host_route_read(idx, &route_entry); - pr_debug("%s route valid %d, route dest: %pI4, hit %d\n", __func__, - rt->attr.valid, &rt->dst_ip, rt->attr.hit); - if (!must_exist && rt->attr.valid) - return idx; - if (must_exist && route_entry.dst_ip == rt->dst_ip) - return idx; - } - } - - return -1; -} - // Currently not used // static int rtl930x_l3_mtu_del(struct rtl838x_switch_priv *priv, int mtu) // { @@ -2468,7 +2354,6 @@ const struct rtldsa_config rtldsa_930x_cfg = { #ifdef CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD .l3_setup = rtl930x_l3_setup, .set_l3_egress_mac = rtl930x_set_l3_egress_mac, - .find_l3_slot = rtl930x_find_l3_slot, #endif .led_init = rtl930x_led_init, .enable_learning = rtldsa_930x_enable_learning, From 867afa0e0375d485d49ae7faf6b7aed6cf79981a Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Sun, 28 Jun 2026 11:05:02 +0200 Subject: [PATCH 24/61] realtek: l3: cleanup headers With all the code relocation it is time to clean the headers. - otto_l3_route_ht_params is internal and can be moved to l3.c - otto_l3_route is no longer needed in rtl-otto.h - additionally reorder structures to avoid forward declarations Link: https://github.com/openwrt/openwrt/pull/23979 Signed-off-by: Markus Stockhausen --- .../files-6.18/drivers/net/dsa/rtl83xx/l3.c | 6 +++ .../files-6.18/drivers/net/dsa/rtl83xx/l3.h | 52 ++++++++----------- .../drivers/net/dsa/rtl83xx/rtl-otto.h | 2 - 3 files changed, 29 insertions(+), 31 deletions(-) diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c index f82e36ac20..749f0d6edf 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c @@ -15,6 +15,12 @@ #include "l3.h" #include "rtl-otto.h" +static const struct rhashtable_params otto_l3_route_ht_params = { + .key_len = sizeof(u32), + .key_offset = offsetof(struct otto_l3_route, gw_ip), + .head_offset = offsetof(struct otto_l3_route, linkage), +}; + struct otto_l3_net_event_work { struct work_struct work; struct otto_l3_ctrl *ctrl; diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h index ebdedcac20..0b02bdace9 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h @@ -44,31 +44,6 @@ struct otto_l3_intf { u8 ip6_pbr_icmp_redirect; }; -struct otto_l3_config { - int (*find_slot)(struct otto_l3_ctrl *ctrl, struct otto_l3_route *rt, bool must_exist); - void (*set_egress_intf)(struct otto_l3_ctrl *ctrl, int idx, struct otto_l3_intf *intf); - u64 (*get_egress_mac)(struct otto_l3_ctrl *ctrl, u32 idx); - void (*host_route_write)(struct otto_l3_ctrl *ctrl, int idx, struct otto_l3_route *rt); - void (*get_router_mac)(struct otto_l3_ctrl *ctrl, u32 idx, struct otto_l3_router_mac *m); - void (*set_router_mac)(struct otto_l3_ctrl *ctrl, u32 idx, struct otto_l3_router_mac *m); - void (*get_nexthop)(struct otto_l3_ctrl *ctrl, int idx, u16 *dmac_id, u16 *interface); - void (*set_nexthop)(struct otto_l3_ctrl *ctrl, int idx, u16 dmac_id, u16 interface); - int (*route_lookup_hw)(struct otto_l3_ctrl *ctrl, struct otto_l3_route *rt); - void (*route_read)(struct otto_l3_ctrl *ctrl, int idx, struct otto_l3_route *rt); - void (*route_write)(struct otto_l3_ctrl *ctrl, int idx, struct otto_l3_route *rt); -}; - -struct otto_l3_ctrl { - const struct otto_l3_config *cfg; - struct device *dev; - struct rtl838x_switch_priv *priv; - struct notifier_block fib_nb; - struct notifier_block ne_nb; - struct rhltable routes; - unsigned long host_route_use_bm[MAX_HOST_ROUTES / 32]; - struct otto_l3_intf *interfaces[MAX_INTERFACES]; -}; - struct otto_l3_route_attr { bool valid; bool hit; @@ -108,10 +83,29 @@ struct otto_l3_route { struct otto_l3_route_attr attr; }; -static const struct rhashtable_params otto_l3_route_ht_params = { - .key_len = sizeof(u32), - .key_offset = offsetof(struct otto_l3_route, gw_ip), - .head_offset = offsetof(struct otto_l3_route, linkage), +struct otto_l3_config { + int (*find_slot)(struct otto_l3_ctrl *ctrl, struct otto_l3_route *rt, bool must_exist); + void (*set_egress_intf)(struct otto_l3_ctrl *ctrl, int idx, struct otto_l3_intf *intf); + u64 (*get_egress_mac)(struct otto_l3_ctrl *ctrl, u32 idx); + void (*host_route_write)(struct otto_l3_ctrl *ctrl, int idx, struct otto_l3_route *rt); + void (*get_router_mac)(struct otto_l3_ctrl *ctrl, u32 idx, struct otto_l3_router_mac *m); + void (*set_router_mac)(struct otto_l3_ctrl *ctrl, u32 idx, struct otto_l3_router_mac *m); + void (*get_nexthop)(struct otto_l3_ctrl *ctrl, int idx, u16 *dmac_id, u16 *interface); + void (*set_nexthop)(struct otto_l3_ctrl *ctrl, int idx, u16 dmac_id, u16 interface); + int (*route_lookup_hw)(struct otto_l3_ctrl *ctrl, struct otto_l3_route *rt); + void (*route_read)(struct otto_l3_ctrl *ctrl, int idx, struct otto_l3_route *rt); + void (*route_write)(struct otto_l3_ctrl *ctrl, int idx, struct otto_l3_route *rt); +}; + +struct otto_l3_ctrl { + const struct otto_l3_config *cfg; + struct device *dev; + struct rtl838x_switch_priv *priv; + struct notifier_block fib_nb; + struct notifier_block ne_nb; + struct rhltable routes; + unsigned long host_route_use_bm[MAX_HOST_ROUTES / 32]; + struct otto_l3_intf *interfaces[MAX_INTERFACES]; }; int otto_l3_probe(struct device *dev, struct rtl838x_switch_priv *priv); diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h index 863c3603bf..4072047bd1 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h @@ -896,8 +896,6 @@ typedef enum { */ #define RTLDSA_COUNTERS_FAST_POLL_INTERVAL (3 * HZ) -struct otto_l3_route; - enum pbvlan_type { PBVLAN_TYPE_INNER = 0, PBVLAN_TYPE_OUTER, From 658cdf86ada628b2f6fd2ad19b54d63322e4ce5c Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Sun, 28 Jun 2026 11:26:10 +0200 Subject: [PATCH 25/61] realtek: l3: add setup callback The existin setup calls must be migrated from the DSA code into the layer 3 code. Provide a new callback for that. Keep it empty for now. Link: https://github.com/openwrt/openwrt/pull/23979 Signed-off-by: Markus Stockhausen --- .../linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c | 6 ++++++ .../linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h | 1 + 2 files changed, 7 insertions(+) diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c index 749f0d6edf..dfa30fe42b 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c @@ -1375,6 +1375,12 @@ int otto_l3_probe(struct device *dev, struct rtl838x_switch_priv *priv) return dev_err_probe(dev, -EINVAL, "No compatible configuration found\n"); ctrl->cfg = match->data; + if (ctrl->cfg->setup) { + err = ctrl->cfg->setup(ctrl); + if (err) + return dev_err_probe(dev, err, "device specific L3 setup failed\n"); + } + /* Initialize hash table for L3 routing */ rhltable_init(&ctrl->routes, &otto_l3_route_ht_params); diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h index 0b02bdace9..b322cdea0a 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h @@ -95,6 +95,7 @@ struct otto_l3_config { int (*route_lookup_hw)(struct otto_l3_ctrl *ctrl, struct otto_l3_route *rt); void (*route_read)(struct otto_l3_ctrl *ctrl, int idx, struct otto_l3_route *rt); void (*route_write)(struct otto_l3_ctrl *ctrl, int idx, struct otto_l3_route *rt); + int (*setup)(struct otto_l3_ctrl *ctrl); }; struct otto_l3_ctrl { From 5fe67b988710441f9e1e02086c324f169bbdde08 Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Sun, 28 Jun 2026 11:51:27 +0200 Subject: [PATCH 26/61] realtek: l3: relocate RTL83xx setup Make use of the new layer 3 setup callback for RTL83xx. - RTL838x had no setup. Drtop it completely - RTL839x move the setup over to the layer 3 code. Link: https://github.com/openwrt/openwrt/pull/23979 Signed-off-by: Markus Stockhausen --- .../files-6.18/drivers/net/dsa/rtl83xx/l3.c | 26 +++++++++++++++++++ .../drivers/net/dsa/rtl83xx/rtl838x.c | 7 ----- .../drivers/net/dsa/rtl83xx/rtl839x.c | 25 ------------------ 3 files changed, 26 insertions(+), 32 deletions(-) diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c index dfa30fe42b..f9e8cf61b0 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c @@ -101,6 +101,31 @@ static void otto_l3_839x_route_write(struct otto_l3_ctrl *ctrl, int idx, struct rtl_table_release(r); } +static void otto_l3_839x_setup_port_macs(struct otto_l3_ctrl *ctrl) +{ + struct rtl838x_switch_priv *priv = ctrl->priv; + struct net_device *dev; + u64 mac; + + /* Configure the switch's own MAC addresses used when routing packets */ + dev_dbg(ctrl->dev, "got port %08x\n", (u32)priv->ports[priv->r->cpu_port].dp); + dev = priv->ports[priv->r->cpu_port].dp->user; + mac = ether_addr_to_u64(dev->dev_addr); + + for (int i = 0; i < 15; i++) { + mac++; /* BUG: VRRP for testing */ + sw_w32(mac >> 32, RTL839X_ROUTING_SA_CTRL + i * 8); + sw_w32(mac, RTL839X_ROUTING_SA_CTRL + i * 8 + 4); + } +} + +static int otto_l3_839x_setup(struct otto_l3_ctrl *ctrl) +{ + otto_l3_839x_setup_port_macs(ctrl); + + return 0; +} + __maybe_unused static u32 otto_l3_930x_hash4(u32 ip, int algorithm, bool move_dip) { @@ -1314,6 +1339,7 @@ const struct otto_l3_config otto_l3_838x_cfg = { const struct otto_l3_config otto_l3_839x_cfg = { .route_read = otto_l3_839x_route_read, .route_write = otto_l3_839x_route_write, + .setup = otto_l3_839x_setup, }; const struct otto_l3_config otto_l3_930x_cfg = { diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl838x.c b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl838x.c index 3dd1cc6f13..d614dcb3a6 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl838x.c +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl838x.c @@ -1628,12 +1628,6 @@ static void rtl838x_packet_cntr_clear(int counter) rtl_table_release(r); } -static int rtl838x_l3_setup(struct rtl838x_switch_priv *priv) -{ - /* Nothing to be done */ - return 0; -} - static void rtl838x_vlan_port_keep_tag_set(int port, bool keep_outer, bool keep_inner) { sw_w32(FIELD_PREP(RTL838X_VLAN_PORT_TAG_STS_CTRL_OTAG_STS_MASK, @@ -1847,7 +1841,6 @@ const struct rtldsa_config rtldsa_838x_cfg = { .l2_learning_setup = rtl838x_l2_learning_setup, .packet_cntr_read = rtl838x_packet_cntr_read, .packet_cntr_clear = rtl838x_packet_cntr_clear, - .l3_setup = rtl838x_l3_setup, .set_receive_management_action = rtl838x_set_receive_management_action, .qos_init = rtldsa_838x_qos_init, .lag_set_distribution_algorithm = rtldsa_838x_set_distribution_algorithm, diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl839x.c b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl839x.c index 857201be29..27959172d8 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl839x.c +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl839x.c @@ -1533,30 +1533,6 @@ static void rtl839x_packet_cntr_clear(int counter) rtl_table_release(r); } -/* Configure the switch's own MAC addresses used when routing packets */ -static void rtl839x_setup_port_macs(struct rtl838x_switch_priv *priv) -{ - struct net_device *dev; - u64 mac; - - pr_debug("%s: got port %08x\n", __func__, (u32)priv->ports[priv->r->cpu_port].dp); - dev = priv->ports[priv->r->cpu_port].dp->user; - mac = ether_addr_to_u64(dev->dev_addr); - - for (int i = 0; i < 15; i++) { - mac++; /* BUG: VRRP for testing */ - sw_w32(mac >> 32, RTL839X_ROUTING_SA_CTRL + i * 8); - sw_w32(mac, RTL839X_ROUTING_SA_CTRL + i * 8 + 4); - } -} - -static int rtl839x_l3_setup(struct rtl838x_switch_priv *priv) -{ - rtl839x_setup_port_macs(priv); - - return 0; -} - static void rtl839x_vlan_port_keep_tag_set(int port, bool keep_outer, bool keep_inner) { sw_w32(FIELD_PREP(RTL839X_VLAN_PORT_TAG_STS_CTRL_OTAG_STS_MASK, @@ -1756,7 +1732,6 @@ const struct rtldsa_config rtldsa_839x_cfg = { .l2_learning_setup = rtl839x_l2_learning_setup, .packet_cntr_read = rtl839x_packet_cntr_read, .packet_cntr_clear = rtl839x_packet_cntr_clear, - .l3_setup = rtl839x_l3_setup, .set_receive_management_action = rtl839x_set_receive_management_action, .qos_init = rtldsa_839x_qos_init, .lag_set_distribution_algorithm = rtldsa_839x_set_distribution_algorithm, From 649d926584f6e3959028d4dab31016b69f6196b0 Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Sun, 28 Jun 2026 12:10:00 +0200 Subject: [PATCH 27/61] realtek: l3: move RTL930x setup to layer 3 code Move the setup where it belongs and drop the no longer used l3_setup() callback in the DSA code. Link: https://github.com/openwrt/openwrt/pull/23979 Signed-off-by: Markus Stockhausen --- .../drivers/net/dsa/rtl83xx/common.c | 3 - .../files-6.18/drivers/net/dsa/rtl83xx/l3.c | 94 ++++++++++++++++++- .../files-6.18/drivers/net/dsa/rtl83xx/l3.h | 1 + .../drivers/net/dsa/rtl83xx/rtl-otto.h | 2 - .../drivers/net/dsa/rtl83xx/rtl930x.c | 88 ----------------- 5 files changed, 90 insertions(+), 98 deletions(-) diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/common.c b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/common.c index 75529ac5f5..6c6e454b71 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/common.c +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/common.c @@ -972,9 +972,6 @@ static int rtl83xx_sw_probe(struct platform_device *pdev) if (priv->r->qos_init) priv->r->qos_init(priv); - if (priv->r->l3_setup) - priv->r->l3_setup(priv); - /* Clear all destination ports for mirror groups */ for (int i = 0; i < 4; i++) priv->mirror_group_ports[i] = -1; diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c index f9e8cf61b0..59b2cb9989 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c @@ -173,6 +173,23 @@ static u64 otto_l3_930x_get_egress_mac(struct otto_l3_ctrl *ctrl, u32 idx) return mac; } +/* Set the Destination-MAC of a route or the Source MAC of an L3 egress interface + * in the SoC's L3_EGR_INTF_MAC table. Indexes 0-2047 are DMACs, 2048+ are SMACs + */ +__maybe_unused +static void otto_l3_930x_set_egress_mac(struct otto_l3_ctrl *ctrl, u32 idx, u64 mac) +{ + struct table_reg *r = rtl_table_get(RTL9300_TBL_2, 2); + + /* The table has a size of 2 registers */ + sw_w32(mac >> 32, rtl_table_data(r, 0)); + sw_w32(mac, rtl_table_data(r, 1)); + + dev_dbg(ctrl->dev, "setting index %d to %016llx\n", idx, mac); + rtl_table_write(r, idx); + rtl_table_release(r); +} + /* Read a host route entry from the table using its index. Only IPv4 and IPv6 unicast supported */ __maybe_unused static void otto_l3_930x_host_route_read(struct otto_l3_ctrl *ctrl, int idx, struct otto_l3_route *rt) @@ -748,6 +765,71 @@ static void otto_l3_930x_set_egress_intf(struct otto_l3_ctrl *ctrl, int idx, str rtl_table_release(r); } +/* Configure L3 routing settings of the device: + * - MTUs + * - Egress interface + * - The router's MAC address on which routed packets are expected + * - MAC addresses used as source macs of routed packets + */ +__maybe_unused +static int otto_l3_930x_setup(struct otto_l3_ctrl *ctrl) +{ + struct rtl838x_switch_priv *priv = ctrl->priv; + + /* Setup MTU with id 0 for default interface */ + for (int i = 0; i < MAX_INTF_MTUS; i++) + priv->intf_mtu_count[i] = priv->intf_mtus[i] = 0; + + priv->intf_mtu_count[0] = 0; /* Needs to stay forever */ + priv->intf_mtus[0] = DEFAULT_MTU; + sw_w32_mask(0xffff, DEFAULT_MTU, RTL930X_L3_IP_MTU_CTRL(0)); + sw_w32_mask(0xffff, DEFAULT_MTU, RTL930X_L3_IP6_MTU_CTRL(0)); + priv->intf_mtus[1] = DEFAULT_MTU; + sw_w32_mask(0xffff0000, DEFAULT_MTU << 16, RTL930X_L3_IP_MTU_CTRL(0)); + sw_w32_mask(0xffff0000, DEFAULT_MTU << 16, RTL930X_L3_IP6_MTU_CTRL(0)); + + sw_w32_mask(0xffff, DEFAULT_MTU, RTL930X_L3_IP_MTU_CTRL(1)); + sw_w32_mask(0xffff, DEFAULT_MTU, RTL930X_L3_IP6_MTU_CTRL(1)); + sw_w32_mask(0xffff0000, DEFAULT_MTU << 16, RTL930X_L3_IP_MTU_CTRL(1)); + sw_w32_mask(0xffff0000, DEFAULT_MTU << 16, RTL930X_L3_IP6_MTU_CTRL(1)); + + /* Clear all source port MACs */ + for (int i = 0; i < MAX_SMACS; i++) + otto_l3_930x_set_egress_mac(ctrl, L3_EGRESS_DMACS + i, 0ULL); + + /* Configure the default L3 hash algorithm */ + sw_w32_mask(BIT(2), 0, RTL930X_L3_HOST_TBL_CTRL); /* Algorithm selection 0 = 0 */ + sw_w32_mask(0, BIT(3), RTL930X_L3_HOST_TBL_CTRL); /* Algorithm selection 1 = 1 */ + + pr_debug("L3_IPUC_ROUTE_CTRL %08x, IPMC_ROUTE %08x, IP6UC_ROUTE %08x, IP6MC_ROUTE %08x\n", + sw_r32(RTL930X_L3_IPUC_ROUTE_CTRL), sw_r32(RTL930X_L3_IPMC_ROUTE_CTRL), + sw_r32(RTL930X_L3_IP6UC_ROUTE_CTRL), sw_r32(RTL930X_L3_IP6MC_ROUTE_CTRL)); + sw_w32_mask(0, 1, RTL930X_L3_IPUC_ROUTE_CTRL); + sw_w32_mask(0, 1, RTL930X_L3_IP6UC_ROUTE_CTRL); + sw_w32_mask(0, 1, RTL930X_L3_IPMC_ROUTE_CTRL); + sw_w32_mask(0, 1, RTL930X_L3_IP6MC_ROUTE_CTRL); + + sw_w32(0x00002001, RTL930X_L3_IPUC_ROUTE_CTRL); + sw_w32(0x00014581, RTL930X_L3_IP6UC_ROUTE_CTRL); + sw_w32(0x00000501, RTL930X_L3_IPMC_ROUTE_CTRL); + sw_w32(0x00012881, RTL930X_L3_IP6MC_ROUTE_CTRL); + + pr_debug("L3_IPUC_ROUTE_CTRL %08x, IPMC_ROUTE %08x, IP6UC_ROUTE %08x, IP6MC_ROUTE %08x\n", + sw_r32(RTL930X_L3_IPUC_ROUTE_CTRL), sw_r32(RTL930X_L3_IPMC_ROUTE_CTRL), + sw_r32(RTL930X_L3_IP6UC_ROUTE_CTRL), sw_r32(RTL930X_L3_IP6MC_ROUTE_CTRL)); + + /* Trap non-ip traffic to the CPU-port (e.g. ARP so we stay reachable) */ + sw_w32_mask(0x3 << 8, 0x1 << 8, RTL930X_L3_IP_ROUTE_CTRL); + pr_debug("L3_IP_ROUTE_CTRL %08x\n", sw_r32(RTL930X_L3_IP_ROUTE_CTRL)); + + /* PORT_ISO_RESTRICT_ROUTE_CTRL? */ + + /* Do not use prefix route 0 because of HW limitations */ + set_bit(0, priv->route_use_bm); + + return 0; +} + static int otto_l3_alloc_egress_intf(struct otto_l3_ctrl *ctrl, u64 mac, int vlan) { struct rtl838x_switch_priv *priv = ctrl->priv; @@ -784,7 +866,7 @@ static int otto_l3_alloc_egress_intf(struct otto_l3_ctrl *ctrl, u64 mac, int vla intf.ip4_pbr_icmp_redirect = intf.ip6_pbr_icmp_redirect = 2; /* FORWARD; */ ctrl->cfg->set_egress_intf(ctrl, free_mac, &intf); - priv->r->set_l3_egress_mac(L3_EGRESS_DMACS + free_mac, mac); + ctrl->cfg->set_egress_mac(ctrl, L3_EGRESS_DMACS + free_mac, mac); mutex_unlock(&priv->reg_mutex); @@ -819,8 +901,8 @@ static int otto_l3_nexthop_update(struct otto_l3_ctrl *ctrl, __be32 ip_addr, u64 r->nh.id = r->id; /* Do we need to explicitly add a DMAC entry with the route's nh index? */ - if (priv->r->set_l3_egress_mac) - priv->r->set_l3_egress_mac(r->id, mac); + if (ctrl->cfg->set_egress_mac) + ctrl->cfg->set_egress_mac(ctrl, r->id, mac); /* Update ROUTING table: map gateway-mac and switch-mac id to route id */ rtl83xx_l2_nexthop_add(priv, &r->nh); @@ -1221,7 +1303,7 @@ static int otto_l3_fib_notifier(struct notifier_block *this, unsigned long event return NOTIFY_DONE; /* ignore FIB events for HW with missing L3 offloading implementation */ - if (!priv->r->l3_setup) + if (!ctrl->cfg->setup) return NOTIFY_DONE; fib_work = kzalloc(sizeof(*fib_work), GFP_ATOMIC); @@ -1298,7 +1380,7 @@ static int otto_l3_netevent_notifier(struct notifier_block *this, unsigned long switch (event) { case NETEVENT_NEIGH_UPDATE: /* ignore events for HW with missing L3 offloading implementation */ - if (!priv->r->l3_setup) + if (!ctrl->cfg->setup) return NOTIFY_DONE; if (n->tbl != &arp_tbl) @@ -1346,6 +1428,7 @@ const struct otto_l3_config otto_l3_930x_cfg = { #ifdef CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD .find_slot = otto_l3_930x_find_slot, .get_egress_mac = otto_l3_930x_get_egress_mac, + .set_egress_mac = otto_l3_930x_set_egress_mac, .set_egress_intf = otto_l3_930x_set_egress_intf, .host_route_write = otto_l3_930x_host_route_write, .get_router_mac = otto_l3_930x_get_router_mac, @@ -1355,6 +1438,7 @@ const struct otto_l3_config otto_l3_930x_cfg = { .route_lookup_hw = otto_l3_930x_route_lookup_hw, .route_read = otto_l3_930x_route_read, .route_write = otto_l3_930x_route_write, + .setup = otto_l3_930x_setup, #endif }; diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h index b322cdea0a..1d5dc87dde 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h @@ -87,6 +87,7 @@ struct otto_l3_config { int (*find_slot)(struct otto_l3_ctrl *ctrl, struct otto_l3_route *rt, bool must_exist); void (*set_egress_intf)(struct otto_l3_ctrl *ctrl, int idx, struct otto_l3_intf *intf); u64 (*get_egress_mac)(struct otto_l3_ctrl *ctrl, u32 idx); + void (*set_egress_mac)(struct otto_l3_ctrl *ctrl, u32 idx, u64 mac); void (*host_route_write)(struct otto_l3_ctrl *ctrl, int idx, struct otto_l3_route *rt); void (*get_router_mac)(struct otto_l3_ctrl *ctrl, u32 idx, struct otto_l3_router_mac *m); void (*set_router_mac)(struct otto_l3_ctrl *ctrl, u32 idx, struct otto_l3_router_mac *m); diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h index 4072047bd1..318f590315 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h @@ -1399,8 +1399,6 @@ struct rtldsa_config { void (*l2_learning_setup)(void); u32 (*packet_cntr_read)(int counter); void (*packet_cntr_clear)(int counter); - int (*l3_setup)(struct rtl838x_switch_priv *priv); - void (*set_l3_egress_mac)(u32 idx, u64 mac); void (*set_receive_management_action)(int port, rma_ctrl_t type, action_type_t action); void (*led_init)(struct rtl838x_switch_priv *priv); void (*qos_init)(struct rtl838x_switch_priv *priv); diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl930x.c b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl930x.c index e2eb9a2e12..ad2f48af6c 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl930x.c +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl930x.c @@ -1850,90 +1850,6 @@ static void rtl930x_pie_init(struct rtl838x_switch_priv *priv) sw_w32(template_selectors, RTL930X_PIE_BLK_TMPLTE_CTRL(i)); } -#ifdef CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD - -/* Set the Destination-MAC of a route or the Source MAC of an L3 egress interface - * in the SoC's L3_EGR_INTF_MAC table - * Indexes 0-2047 are DMACs, 2048+ are SMACs - */ -static void rtl930x_set_l3_egress_mac(u32 idx, u64 mac) -{ - /* Access L3_EGR_INTF_MAC table (2) via register RTL9300_TBL_2 */ - struct table_reg *r = rtl_table_get(RTL9300_TBL_2, 2); - - /* The table has a size of 2 registers */ - sw_w32(mac >> 32, rtl_table_data(r, 0)); - sw_w32(mac, rtl_table_data(r, 1)); - - pr_debug("%s: setting index %d to %016llx\n", __func__, idx, mac); - rtl_table_write(r, idx); - rtl_table_release(r); -} - -/* Configure L3 routing settings of the device: - * - MTUs - * - Egress interface - * - The router's MAC address on which routed packets are expected - * - MAC addresses used as source macs of routed packets - */ -static int rtl930x_l3_setup(struct rtl838x_switch_priv *priv) -{ - /* Setup MTU with id 0 for default interface */ - for (int i = 0; i < MAX_INTF_MTUS; i++) - priv->intf_mtu_count[i] = priv->intf_mtus[i] = 0; - - priv->intf_mtu_count[0] = 0; /* Needs to stay forever */ - priv->intf_mtus[0] = DEFAULT_MTU; - sw_w32_mask(0xffff, DEFAULT_MTU, RTL930X_L3_IP_MTU_CTRL(0)); - sw_w32_mask(0xffff, DEFAULT_MTU, RTL930X_L3_IP6_MTU_CTRL(0)); - priv->intf_mtus[1] = DEFAULT_MTU; - sw_w32_mask(0xffff0000, DEFAULT_MTU << 16, RTL930X_L3_IP_MTU_CTRL(0)); - sw_w32_mask(0xffff0000, DEFAULT_MTU << 16, RTL930X_L3_IP6_MTU_CTRL(0)); - - sw_w32_mask(0xffff, DEFAULT_MTU, RTL930X_L3_IP_MTU_CTRL(1)); - sw_w32_mask(0xffff, DEFAULT_MTU, RTL930X_L3_IP6_MTU_CTRL(1)); - sw_w32_mask(0xffff0000, DEFAULT_MTU << 16, RTL930X_L3_IP_MTU_CTRL(1)); - sw_w32_mask(0xffff0000, DEFAULT_MTU << 16, RTL930X_L3_IP6_MTU_CTRL(1)); - - /* Clear all source port MACs */ - for (int i = 0; i < MAX_SMACS; i++) - rtl930x_set_l3_egress_mac(L3_EGRESS_DMACS + i, 0ULL); - - /* Configure the default L3 hash algorithm */ - sw_w32_mask(BIT(2), 0, RTL930X_L3_HOST_TBL_CTRL); /* Algorithm selection 0 = 0 */ - sw_w32_mask(0, BIT(3), RTL930X_L3_HOST_TBL_CTRL); /* Algorithm selection 1 = 1 */ - - pr_debug("L3_IPUC_ROUTE_CTRL %08x, IPMC_ROUTE %08x, IP6UC_ROUTE %08x, IP6MC_ROUTE %08x\n", - sw_r32(RTL930X_L3_IPUC_ROUTE_CTRL), sw_r32(RTL930X_L3_IPMC_ROUTE_CTRL), - sw_r32(RTL930X_L3_IP6UC_ROUTE_CTRL), sw_r32(RTL930X_L3_IP6MC_ROUTE_CTRL)); - sw_w32_mask(0, 1, RTL930X_L3_IPUC_ROUTE_CTRL); - sw_w32_mask(0, 1, RTL930X_L3_IP6UC_ROUTE_CTRL); - sw_w32_mask(0, 1, RTL930X_L3_IPMC_ROUTE_CTRL); - sw_w32_mask(0, 1, RTL930X_L3_IP6MC_ROUTE_CTRL); - - sw_w32(0x00002001, RTL930X_L3_IPUC_ROUTE_CTRL); - sw_w32(0x00014581, RTL930X_L3_IP6UC_ROUTE_CTRL); - sw_w32(0x00000501, RTL930X_L3_IPMC_ROUTE_CTRL); - sw_w32(0x00012881, RTL930X_L3_IP6MC_ROUTE_CTRL); - - pr_debug("L3_IPUC_ROUTE_CTRL %08x, IPMC_ROUTE %08x, IP6UC_ROUTE %08x, IP6MC_ROUTE %08x\n", - sw_r32(RTL930X_L3_IPUC_ROUTE_CTRL), sw_r32(RTL930X_L3_IPMC_ROUTE_CTRL), - sw_r32(RTL930X_L3_IP6UC_ROUTE_CTRL), sw_r32(RTL930X_L3_IP6MC_ROUTE_CTRL)); - - /* Trap non-ip traffic to the CPU-port (e.g. ARP so we stay reachable) */ - sw_w32_mask(0x3 << 8, 0x1 << 8, RTL930X_L3_IP_ROUTE_CTRL); - pr_debug("L3_IP_ROUTE_CTRL %08x\n", sw_r32(RTL930X_L3_IP_ROUTE_CTRL)); - - /* PORT_ISO_RESTRICT_ROUTE_CTRL? */ - - /* Do not use prefix route 0 because of HW limitations */ - set_bit(0, priv->route_use_bm); - - return 0; -} - -#endif /* CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD */ - static u32 rtl930x_packet_cntr_read(int counter) { u32 v; @@ -2351,10 +2267,6 @@ const struct rtldsa_config rtldsa_930x_cfg = { .l2_learning_setup = rtl930x_l2_learning_setup, .packet_cntr_read = rtl930x_packet_cntr_read, .packet_cntr_clear = rtl930x_packet_cntr_clear, -#ifdef CONFIG_NET_DSA_RTL83XX_RTL930X_L3_OFFLOAD - .l3_setup = rtl930x_l3_setup, - .set_l3_egress_mac = rtl930x_set_l3_egress_mac, -#endif .led_init = rtl930x_led_init, .enable_learning = rtldsa_930x_enable_learning, .enable_flood = rtldsa_930x_enable_flood, From efe23afc8b77d83e0239327c3bff34c4ff3fa1a5 Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Sun, 28 Jun 2026 18:45:08 +0200 Subject: [PATCH 28/61] realtek: l3: move route_use_bm to layer 3 This is another variable that belongs to the layer 3 code. Link: https://github.com/openwrt/openwrt/pull/23979 Signed-off-by: Markus Stockhausen --- .../realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c | 9 ++++----- .../realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h | 2 ++ .../files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h | 2 -- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c index 59b2cb9989..9ea70949d9 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c @@ -825,7 +825,7 @@ static int otto_l3_930x_setup(struct otto_l3_ctrl *ctrl) /* PORT_ISO_RESTRICT_ROUTE_CTRL? */ /* Do not use prefix route 0 because of HW limitations */ - set_bit(0, priv->route_use_bm); + set_bit(0, ctrl->route_use_bm); return 0; } @@ -986,7 +986,6 @@ static int otto_l3_port_ipv4_resolve(struct otto_l3_ctrl *ctrl, static void otto_l3_route_remove(struct otto_l3_ctrl *ctrl, struct otto_l3_route *r) { - struct rtl838x_switch_priv *priv = ctrl->priv; int id; if (rhltable_remove(&ctrl->routes, &r->linkage, otto_l3_route_ht_params)) @@ -1006,7 +1005,7 @@ static void otto_l3_route_remove(struct otto_l3_ctrl *ctrl, struct otto_l3_route r->attr.valid = false; ctrl->cfg->route_write(ctrl, id, r); } - clear_bit(r->id, priv->route_use_bm); + clear_bit(r->id, ctrl->route_use_bm); } kfree(r); @@ -1065,7 +1064,7 @@ static struct otto_l3_route *otto_l3_route_alloc(struct otto_l3_ctrl *ctrl, u32 mutex_lock(&priv->reg_mutex); - idx = find_first_zero_bit(priv->route_use_bm, MAX_ROUTES); + idx = find_first_zero_bit(ctrl->route_use_bm, MAX_ROUTES); dev_dbg(ctrl->dev, "id: %d, ip %pI4\n", idx, &ip); r = kzalloc(sizeof(*r), GFP_KERNEL); @@ -1086,7 +1085,7 @@ static struct otto_l3_route *otto_l3_route_alloc(struct otto_l3_ctrl *ctrl, u32 goto out_free; } - set_bit(idx, priv->route_use_bm); + set_bit(idx, ctrl->route_use_bm); mutex_unlock(&priv->reg_mutex); diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h index 1d5dc87dde..a318dbdaba 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h @@ -6,6 +6,7 @@ #include "rtl-otto.h" #define MAX_HOST_ROUTES 1536 +#define MAX_ROUTES 512 #define MAX_INTERFACES 100 #define HASH_PICK(val, lsb, len) ((val & (((1 << len) - 1) << lsb)) >> lsb) @@ -106,6 +107,7 @@ struct otto_l3_ctrl { struct notifier_block fib_nb; struct notifier_block ne_nb; struct rhltable routes; + unsigned long route_use_bm[MAX_ROUTES / 32]; unsigned long host_route_use_bm[MAX_HOST_ROUTES / 32]; struct otto_l3_intf *interfaces[MAX_INTERFACES]; }; diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h index 318f590315..4ff7bb50c3 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/rtl-otto.h @@ -870,7 +870,6 @@ typedef enum { #define N_FIXED_FIELDS 12 #define N_FIXED_FIELDS_RTL931X 14 #define MAX_COUNTERS 2048 -#define MAX_ROUTES 512 #define MAX_INTF_MTUS 8 #define DEFAULT_MTU 1536 #define MAX_ROUTER_MACS 64 @@ -1459,7 +1458,6 @@ struct rtl838x_switch_priv { unsigned long pie_use_bm[MAX_PIE_ENTRIES >> 5]; unsigned long octet_cntr_use_bm[MAX_COUNTERS >> 5]; unsigned long packet_cntr_use_bm[MAX_COUNTERS >> 4]; - unsigned long route_use_bm[MAX_ROUTES >> 5]; u16 intf_mtus[MAX_INTF_MTUS]; int intf_mtu_count[MAX_INTF_MTUS]; From cc697093b8104029f559fc3258f46556a8066c13 Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Sun, 28 Jun 2026 19:25:43 +0200 Subject: [PATCH 29/61] realtek: l3: reorganize lock access The layer 3 code shares the register access lock with the DSA driver. It is currently unclear to which extent this is really needed. To avoid permanent access to the DSA private structure reorganize the locking as follows: - create a lock pointer in the layer 3 control structure - link it to the DSA lock during probing - use the ctrl->lock pointer whenever needed. Link: https://github.com/openwrt/openwrt/pull/23979 Signed-off-by: Markus Stockhausen --- .../files-6.18/drivers/net/dsa/rtl83xx/l3.c | 34 +++++++++---------- .../files-6.18/drivers/net/dsa/rtl83xx/l3.h | 1 + 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c index 9ea70949d9..b87e59fc3f 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c @@ -694,11 +694,10 @@ static int otto_l3_port_dev_lower_find(struct net_device *dev, struct otto_l3_ct */ static int otto_l3_alloc_router_mac(struct otto_l3_ctrl *ctrl, u64 mac) { - struct rtl838x_switch_priv *priv = ctrl->priv; struct otto_l3_router_mac m; int free_mac = -1; - mutex_lock(&priv->reg_mutex); + mutex_lock(ctrl->lock); for (int i = 0; i < MAX_ROUTER_MACS; i++) { ctrl->cfg->get_router_mac(ctrl, i, &m); if (free_mac < 0 && !m.valid) { @@ -713,7 +712,7 @@ static int otto_l3_alloc_router_mac(struct otto_l3_ctrl *ctrl, u64 mac) if (free_mac < 0) { dev_err(ctrl->dev, "No free router MACs, cannot offload\n"); - mutex_unlock(&priv->reg_mutex); + mutex_unlock(ctrl->lock); return -1; } @@ -728,7 +727,7 @@ static int otto_l3_alloc_router_mac(struct otto_l3_ctrl *ctrl, u64 mac) m.action = L3_FORWARD; /* Route the packet */ ctrl->cfg->set_router_mac(ctrl, free_mac, &m); - mutex_unlock(&priv->reg_mutex); + mutex_unlock(ctrl->lock); return 0; } @@ -832,12 +831,11 @@ static int otto_l3_930x_setup(struct otto_l3_ctrl *ctrl) static int otto_l3_alloc_egress_intf(struct otto_l3_ctrl *ctrl, u64 mac, int vlan) { - struct rtl838x_switch_priv *priv = ctrl->priv; struct otto_l3_intf intf; int free_mac = -1; u64 m; - mutex_lock(&priv->reg_mutex); + mutex_lock(ctrl->lock); for (int i = 0; i < MAX_SMACS; i++) { m = ctrl->cfg->get_egress_mac(ctrl, L3_EGRESS_DMACS + i); if (free_mac < 0 && !m) { @@ -845,7 +843,7 @@ static int otto_l3_alloc_egress_intf(struct otto_l3_ctrl *ctrl, u64 mac, int vla continue; } if (m == mac) { - mutex_unlock(&priv->reg_mutex); + mutex_unlock(ctrl->lock); return i; } } @@ -868,7 +866,7 @@ static int otto_l3_alloc_egress_intf(struct otto_l3_ctrl *ctrl, u64 mac, int vla ctrl->cfg->set_egress_mac(ctrl, L3_EGRESS_DMACS + free_mac, mac); - mutex_unlock(&priv->reg_mutex); + mutex_unlock(ctrl->lock); return free_mac; } @@ -1013,18 +1011,17 @@ static void otto_l3_route_remove(struct otto_l3_ctrl *ctrl, struct otto_l3_route static struct otto_l3_route *otto_l3_host_route_alloc(struct otto_l3_ctrl *ctrl, u32 ip) { - struct rtl838x_switch_priv *priv = ctrl->priv; struct otto_l3_route *r; int idx = 0, err; - mutex_lock(&priv->reg_mutex); + mutex_lock(ctrl->lock); idx = find_first_zero_bit(ctrl->host_route_use_bm, MAX_HOST_ROUTES); dev_dbg(ctrl->dev, "id: %d, ip %pI4\n", idx, &ip); r = kzalloc(sizeof(*r), GFP_KERNEL); if (!r) { - mutex_unlock(&priv->reg_mutex); + mutex_unlock(ctrl->lock); return r; } @@ -1040,13 +1037,13 @@ static struct otto_l3_route *otto_l3_host_route_alloc(struct otto_l3_ctrl *ctrl, err = rhltable_insert(&ctrl->routes, &r->linkage, otto_l3_route_ht_params); if (err) { dev_err(ctrl->dev, "Could not insert new rule\n"); - mutex_unlock(&priv->reg_mutex); + mutex_unlock(ctrl->lock); goto out_free; } set_bit(idx, ctrl->host_route_use_bm); - mutex_unlock(&priv->reg_mutex); + mutex_unlock(ctrl->lock); return r; @@ -1058,18 +1055,17 @@ out_free: static struct otto_l3_route *otto_l3_route_alloc(struct otto_l3_ctrl *ctrl, u32 ip) { - struct rtl838x_switch_priv *priv = ctrl->priv; struct otto_l3_route *r; int idx = 0, err; - mutex_lock(&priv->reg_mutex); + mutex_lock(ctrl->lock); idx = find_first_zero_bit(ctrl->route_use_bm, MAX_ROUTES); dev_dbg(ctrl->dev, "id: %d, ip %pI4\n", idx, &ip); r = kzalloc(sizeof(*r), GFP_KERNEL); if (!r) { - mutex_unlock(&priv->reg_mutex); + mutex_unlock(ctrl->lock); return r; } @@ -1081,13 +1077,13 @@ static struct otto_l3_route *otto_l3_route_alloc(struct otto_l3_ctrl *ctrl, u32 err = rhltable_insert(&ctrl->routes, &r->linkage, otto_l3_route_ht_params); if (err) { dev_err(ctrl->dev, "Could not insert new rule\n"); - mutex_unlock(&priv->reg_mutex); + mutex_unlock(ctrl->lock); goto out_free; } set_bit(idx, ctrl->route_use_bm); - mutex_unlock(&priv->reg_mutex); + mutex_unlock(ctrl->lock); return r; @@ -1478,6 +1474,8 @@ int otto_l3_probe(struct device *dev, struct rtl838x_switch_priv *priv) priv->l3_ctrl = ctrl; ctrl->priv = priv; ctrl->dev = priv->dev; + /* For now share the register access lock with the DSA driver */ + ctrl->lock = &priv->reg_mutex; match = of_match_node(otto_l3_of_ids, dev->of_node); if (!match) diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h index a318dbdaba..494c850e80 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.h @@ -110,6 +110,7 @@ struct otto_l3_ctrl { unsigned long route_use_bm[MAX_ROUTES / 32]; unsigned long host_route_use_bm[MAX_HOST_ROUTES / 32]; struct otto_l3_intf *interfaces[MAX_INTERFACES]; + struct mutex *lock; /* protect register access */ }; int otto_l3_probe(struct device *dev, struct rtl838x_switch_priv *priv); From 106fd083bc98e94dc9eb923ac297b7c4efd7d145 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 29 Jun 2026 20:31:50 -0700 Subject: [PATCH 30/61] mediatek: qihoo: fix WMAC eeprom Wrong factory partition was used. Fixes: 53fa04d2619f ("mediatek: filogic: replace mtd-eeprom with nvmem") Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/23999 Signed-off-by: Robert Marko --- .../mediatek/dts/mt7981b-qihoo-360t7.dts | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/target/linux/mediatek/dts/mt7981b-qihoo-360t7.dts b/target/linux/mediatek/dts/mt7981b-qihoo-360t7.dts index 19b70578a4..5c35f413c1 100644 --- a/target/linux/mediatek/dts/mt7981b-qihoo-360t7.dts +++ b/target/linux/mediatek/dts/mt7981b-qihoo-360t7.dts @@ -14,10 +14,20 @@ read-only; }; - factory: partition@180000 { + partition@180000 { label = "Factory"; reg = <0x180000 0x200000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x1000>; + }; + }; }; partition@380000 { @@ -48,16 +58,6 @@ label = "factory"; reg = <0x7280000 0x80000>; read-only; - - nvmem-layout { - compatible = "fixed-layout"; - #address-cells = <1>; - #size-cells = <1>; - - eeprom_factory_0: eeprom@0 { - reg = <0x0 0x1000>; - }; - }; }; partition@7300000 { From 92143f94b6b35e5b3602c1f9d2cfb6e2f9a63085 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 24 Jun 2026 12:57:55 +0200 Subject: [PATCH 31/61] mac80211: notify driver on airtime weight changes Add a new sta_set_airtime_weight driver op so drivers can program the airtime fairness weight into hardware. Signed-off-by: Felix Fietkau --- ...tify-driver-on-airtime-weight-change.patch | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 package/kernel/mac80211/patches/subsys/390-wifi-mac80211-notify-driver-on-airtime-weight-change.patch diff --git a/package/kernel/mac80211/patches/subsys/390-wifi-mac80211-notify-driver-on-airtime-weight-change.patch b/package/kernel/mac80211/patches/subsys/390-wifi-mac80211-notify-driver-on-airtime-weight-change.patch new file mode 100644 index 0000000000..0de78a4b71 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/390-wifi-mac80211-notify-driver-on-airtime-weight-change.patch @@ -0,0 +1,143 @@ +From: Felix Fietkau +Date: Wed, 10 Jun 2026 11:22:25 +0000 +Subject: [PATCH] wifi: mac80211: notify driver on airtime weight changes + +Add a new sta_set_airtime_weight driver op so drivers can program the +airtime fairness weight into hardware. The op is called when the weight +is updated via sta_apply_parameters, and on station upload if a +non-default weight is already set. + +Signed-off-by: Felix Fietkau +--- + +--- a/include/net/mac80211.h ++++ b/include/net/mac80211.h +@@ -4484,6 +4484,8 @@ struct ieee80211_prep_tx_info { + * @set_sar_specs: Update the SAR (TX power) settings. + * @sta_set_decap_offload: Called to notify the driver when a station is allowed + * to use rx decapsulation offload ++ * @sta_set_airtime_weight: Called to notify the driver of a change to a ++ * station's airtime fairness weight, so it can be programmed in hardware. + * @add_twt_setup: Update hw with TWT agreement parameters received from the peer. + * This callback allows the hw to check if requested parameters + * are supported and if there is enough room for a new agreement. +@@ -4896,6 +4898,9 @@ struct ieee80211_ops { + void (*sta_set_decap_offload)(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, bool enabled); ++ void (*sta_set_airtime_weight)(struct ieee80211_hw *hw, ++ struct ieee80211_vif *vif, ++ struct ieee80211_sta *sta, u16 weight); + void (*add_twt_setup)(struct ieee80211_hw *hw, + struct ieee80211_sta *sta, + struct ieee80211_twt_setup *twt); +--- a/net/mac80211/cfg.c ++++ b/net/mac80211/cfg.c +@@ -2298,8 +2298,12 @@ static int sta_apply_parameters(struct i + if (ieee80211_vif_is_mesh(&sdata->vif)) + sta_apply_mesh_params(local, sta, params); + +- if (params->airtime_weight) ++ if (params->airtime_weight) { + sta->airtime_weight = params->airtime_weight; ++ if (sta->uploaded) ++ drv_sta_set_airtime_weight(local, sdata, &sta->sta, ++ sta->airtime_weight); ++ } + + /* set the STA state after all sta info from usermode has been set */ + if (test_sta_flag(sta, WLAN_STA_TDLS_PEER) || +--- a/net/mac80211/driver-ops.c ++++ b/net/mac80211/driver-ops.c +@@ -157,6 +157,10 @@ int drv_sta_state(struct ieee80211_local + sta->uploaded = true; + if (rcu_access_pointer(sta->sta.rates)) + drv_sta_rate_tbl_update(local, sdata, &sta->sta); ++ if (sta->airtime_weight != IEEE80211_DEFAULT_AIRTIME_WEIGHT) ++ drv_sta_set_airtime_weight(local, sdata, ++ &sta->sta, ++ sta->airtime_weight); + } + } else if (old_state == IEEE80211_STA_ASSOC && + new_state == IEEE80211_STA_AUTH) { +--- a/net/mac80211/driver-ops.h ++++ b/net/mac80211/driver-ops.h +@@ -1633,6 +1633,25 @@ static inline void drv_sta_set_decap_off + trace_drv_return_void(local); + } + ++static inline void drv_sta_set_airtime_weight(struct ieee80211_local *local, ++ struct ieee80211_sub_if_data *sdata, ++ struct ieee80211_sta *sta, ++ u16 weight) ++{ ++ sdata = get_bss_sdata(sdata); ++ ++ might_sleep(); ++ lockdep_assert_wiphy(local->hw.wiphy); ++ if (!check_sdata_in_driver(sdata)) ++ return; ++ ++ trace_drv_sta_set_airtime_weight(local, sdata, sta, weight); ++ if (local->ops->sta_set_airtime_weight) ++ local->ops->sta_set_airtime_weight(&local->hw, &sdata->vif, sta, ++ weight); ++ trace_drv_return_void(local); ++} ++ + static inline void drv_add_twt_setup(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata, + struct ieee80211_sta *sta, +--- a/net/mac80211/sta_info.c ++++ b/net/mac80211/sta_info.c +@@ -832,8 +832,13 @@ static int sta_info_insert_drv_state(str + * Drivers using legacy sta_add/sta_remove callbacks only + * get uploaded set to true after sta_add is called. + */ +- if (!local->ops->sta_add) ++ if (!local->ops->sta_add) { + sta->uploaded = true; ++ if (sta->airtime_weight != IEEE80211_DEFAULT_AIRTIME_WEIGHT) ++ drv_sta_set_airtime_weight(local, sdata, ++ &sta->sta, ++ sta->airtime_weight); ++ } + return 0; + } + +--- a/net/mac80211/trace.h ++++ b/net/mac80211/trace.h +@@ -2481,6 +2481,33 @@ DEFINE_EVENT(sta_flag_evt, drv_sta_set_d + TP_ARGS(local, sdata, sta, enabled) + ); + ++TRACE_EVENT(drv_sta_set_airtime_weight, ++ TP_PROTO(struct ieee80211_local *local, ++ struct ieee80211_sub_if_data *sdata, ++ struct ieee80211_sta *sta, u16 weight), ++ ++ TP_ARGS(local, sdata, sta, weight), ++ ++ TP_STRUCT__entry( ++ LOCAL_ENTRY ++ VIF_ENTRY ++ STA_ENTRY ++ __field(u16, weight) ++ ), ++ ++ TP_fast_assign( ++ LOCAL_ASSIGN; ++ VIF_ASSIGN; ++ STA_ASSIGN; ++ __entry->weight = weight; ++ ), ++ ++ TP_printk( ++ LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " weight:%u", ++ LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->weight ++ ) ++); ++ + TRACE_EVENT(drv_add_twt_setup, + TP_PROTO(struct ieee80211_local *local, + struct ieee80211_sta *sta, From b0b4bf6ea0927195631a3557d05f48f8e302d498 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Tue, 30 Jun 2026 18:38:58 +0200 Subject: [PATCH 32/61] build: don't store timestamps in APK packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit statically sets SOURCE_DATE_EPOCH to 0, which causes `apk mkpkg` to drop the date from generated packages. This improves reproducibility while leaving package specific SOURCE_DATE_EPOCH untouched. The latter can be interesting for i.e. packages like busybox, which prominently show that date on the login shell. Without this commit, packages that live inside feed repositories (openwrt.git, packages.git etc) like `mtd` or `attendedsysupgrade-common` would have random timestamps since no "full" git log was available. Below an example with different source dates (0, 1): │ 0755 root:wheel - - / │ 0755 root:wheel - - lib/ │ 0755 root:wheel - - lib/apk/ │ 0755 root:wheel - - lib/apk/packages/ │ -0644 root:wheel 1970-01-01T00:00:01Z 10 lib/apk/packages/mtd.list │ +0644 root:wheel - 10 lib/apk/packages/mtd.list │ 0755 root:wheel - - sbin/ │ -0755 root:wheel 1970-01-01T00:00:01Z 24595 sbin/mtd │ +0755 root:wheel - 24595 sbin/mtd Link: https://github.com/openwrt/openwrt/pull/24005 Signed-off-by: Paul Spooren --- include/package-pack.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/package-pack.mk b/include/package-pack.mk index 493619f7aa..5dc69139b3 100644 --- a/include/package-pack.mk +++ b/include/package-pack.mk @@ -605,7 +605,7 @@ else exit 1; \ fi - $(FAKEROOT) $(STAGING_DIR_HOST)/bin/apk mkpkg \ + SOURCE_DATE_EPOCH=0 $(FAKEROOT) $(STAGING_DIR_HOST)/bin/apk mkpkg \ --info "name:$(1)$$(ABIV_$(1))" \ --info "version:$(VERSION)" \ $$(if $$(APK_TAGS_$(1)),--info "tags:$$(APK_TAGS_$(1))") \ From 57116f660bd685f54c9da2fb14ea0b8eb55bc894 Mon Sep 17 00:00:00 2001 From: Yanase Yuki Date: Sat, 27 Jun 2026 18:44:26 +0900 Subject: [PATCH 33/61] mvebu: switch to kernel 6.18 and drop 6.12 Use kernel 6.18 instead of 6.12. Tested on Check Point V-80. Signed-off-by: Yanase Yuki Link: https://github.com/openwrt/openwrt/pull/23962 Signed-off-by: Jonas Jelonek --- target/linux/mvebu/Makefile | 3 +- target/linux/mvebu/config-6.12 | 445 ------- target/linux/mvebu/cortexa53/config-6.12 | 99 -- target/linux/mvebu/cortexa72/config-6.12 | 123 -- target/linux/mvebu/cortexa9/config-6.12 | 12 - ...7xx-propagate-error-from-armada_37xx.patch | 31 - .../100-aardvark-workaround-PCIe.patch | 81 -- ...set-linkstation-poweroff-add-ls220de.patch | 15 - ...Mangle-bootloader-s-kernel-arguments.patch | 279 ----- ...-mvebu-armada-38x-enable-libata-leds.patch | 10 - .../patches-6.12/302-add_powertables.patch | 770 ------------ .../patches-6.12/304-revert_i2c_delay.patch | 15 - .../305-armada-385-rd-mtd-partitions.patch | 19 - .../306-ARM-mvebu-385-ap-Add-partitions.patch | 35 - ...-armada-xp-linksys-mamba-broken-idle.patch | 10 - .../308-armada-xp-linksys-mamba-wan.patch | 11 - .../patches-6.12/309-linksys-status-led.patch | 50 - .../310-linksys-use-eth0-as-cpu-port.patch | 25 - .../311-adjust-compatible-for-linksys.patch | 68 -- ...da388-clearfog-emmc-on-clearfog-base.patch | 87 -- .../313-helios4-dts-status-led-alias.patch | 28 - ...vell-enable-heartbeat-LED-by-default.patch | 22 - ...rmada-xp-linksys-mamba-resize-kernel.patch | 37 - ...316-armada-370-dts-fix-crypto-engine.patch | 29 - ...armada-370-synology-ds213j-mtd-parts.patch | 134 --- ...l-reorder-ethernet-aliases-for-ESPRE.patch | 35 - ...l-specity-phy-mode-2500base-x-for-Me.patch | 29 - ...l-update-LED-and-partition-labels-fo.patch | 77 -- ...l-use-u-boot-part-label-for-Globalsc.patch | 24 - ...add-LED-aliases-and-USB-ports-to-Cte.patch | 121 -- ...dts-marvell-glinet-mv1000-fix-sdhci1.patch | 53 - ...l-armada-37xx-mark-EIP97-as-dma-cohe.patch | 46 - ...step_wise-add-support-for-hysteresis.patch | 62 - .../patches-6.12/400-find_active_root.patch | 60 - .../700-mvneta-tx-queue-workaround.patch | 43 - ...dicate-failure-to-enter-deeper-sleep.patch | 40 - ...-pci-mvebu-time-out-reset-on-link-up.patch | 60 - ...30-01-i2c-add-init_recovery-callback.patch | 189 --- ...ng-of-the-generic-recovery-init-code.patch | 224 ---- ...ly-Bus-Busy-condition-on-Armada-3700.patch | 309 ----- ...IEI-vendor-prefix-and-IEI-WT61P803-P.patch | 206 ---- ...a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch | 1035 ----------------- ...d-the-IEI-WT61P803-PUZZLE-HWMON-driv.patch | 498 -------- ...d-the-IEI-WT61P803-PUZZLE-LED-driver.patch | 207 ---- ...I-Add-iei-wt61p803-puzzle-driver-sys.patch | 82 -- ...mon-Add-iei-wt61p803-puzzle-hwmon-dr.patch | 74 -- ...an-entry-for-the-IEI-WT61P803-PUZZLE.patch | 41 - ...rs-leds-wt61p803-puzzle-improvements.patch | 271 ----- ...ivers-leds-wt61p803-puzzle-mcu-retry.patch | 63 - ...s-hwmon-wt61p803-puzzle-thermal-zone.patch | 10 - 50 files changed, 1 insertion(+), 6296 deletions(-) delete mode 100644 target/linux/mvebu/config-6.12 delete mode 100644 target/linux/mvebu/cortexa53/config-6.12 delete mode 100644 target/linux/mvebu/cortexa72/config-6.12 delete mode 100644 target/linux/mvebu/cortexa9/config-6.12 delete mode 100644 target/linux/mvebu/patches-6.12/0003-v6.16-pinctrl-armada-37xx-propagate-error-from-armada_37xx.patch delete mode 100644 target/linux/mvebu/patches-6.12/100-aardvark-workaround-PCIe.patch delete mode 100644 target/linux/mvebu/patches-6.12/105-power-reset-linkstation-poweroff-add-ls220de.patch delete mode 100644 target/linux/mvebu/patches-6.12/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch delete mode 100644 target/linux/mvebu/patches-6.12/301-mvebu-armada-38x-enable-libata-leds.patch delete mode 100644 target/linux/mvebu/patches-6.12/302-add_powertables.patch delete mode 100644 target/linux/mvebu/patches-6.12/304-revert_i2c_delay.patch delete mode 100644 target/linux/mvebu/patches-6.12/305-armada-385-rd-mtd-partitions.patch delete mode 100644 target/linux/mvebu/patches-6.12/306-ARM-mvebu-385-ap-Add-partitions.patch delete mode 100644 target/linux/mvebu/patches-6.12/307-armada-xp-linksys-mamba-broken-idle.patch delete mode 100644 target/linux/mvebu/patches-6.12/308-armada-xp-linksys-mamba-wan.patch delete mode 100644 target/linux/mvebu/patches-6.12/309-linksys-status-led.patch delete mode 100644 target/linux/mvebu/patches-6.12/310-linksys-use-eth0-as-cpu-port.patch delete mode 100644 target/linux/mvebu/patches-6.12/311-adjust-compatible-for-linksys.patch delete mode 100644 target/linux/mvebu/patches-6.12/312-ARM-dts-armada388-clearfog-emmc-on-clearfog-base.patch delete mode 100644 target/linux/mvebu/patches-6.12/313-helios4-dts-status-led-alias.patch delete mode 100644 target/linux/mvebu/patches-6.12/314-arm64-dts-marvell-enable-heartbeat-LED-by-default.patch delete mode 100644 target/linux/mvebu/patches-6.12/315-armada-xp-linksys-mamba-resize-kernel.patch delete mode 100644 target/linux/mvebu/patches-6.12/316-armada-370-dts-fix-crypto-engine.patch delete mode 100644 target/linux/mvebu/patches-6.12/320-arm-dts-armada-370-synology-ds213j-mtd-parts.patch delete mode 100644 target/linux/mvebu/patches-6.12/321-arm64-dts-marvell-reorder-ethernet-aliases-for-ESPRE.patch delete mode 100644 target/linux/mvebu/patches-6.12/322-arm64-dts-marvell-specity-phy-mode-2500base-x-for-Me.patch delete mode 100644 target/linux/mvebu/patches-6.12/323-arm64-dts-marvell-update-LED-and-partition-labels-fo.patch delete mode 100644 target/linux/mvebu/patches-6.12/324-arm64-dts-marvell-use-u-boot-part-label-for-Globalsc.patch delete mode 100644 target/linux/mvebu/patches-6.12/325-arm-dts-marvell-add-LED-aliases-and-USB-ports-to-Cte.patch delete mode 100644 target/linux/mvebu/patches-6.12/326-arm64-dts-marvell-glinet-mv1000-fix-sdhci1.patch delete mode 100644 target/linux/mvebu/patches-6.12/340-v7.2-arm64-dts-marvell-armada-37xx-mark-EIP97-as-dma-cohe.patch delete mode 100644 target/linux/mvebu/patches-6.12/350-drivers-thermal-step_wise-add-support-for-hysteresis.patch delete mode 100644 target/linux/mvebu/patches-6.12/400-find_active_root.patch delete mode 100644 target/linux/mvebu/patches-6.12/700-mvneta-tx-queue-workaround.patch delete mode 100644 target/linux/mvebu/patches-6.12/800-cpuidle-mvebu-indicate-failure-to-enter-deeper-sleep.patch delete mode 100644 target/linux/mvebu/patches-6.12/801-pci-mvebu-time-out-reset-on-link-up.patch delete mode 100644 target/linux/mvebu/patches-6.12/830-01-i2c-add-init_recovery-callback.patch delete mode 100644 target/linux/mvebu/patches-6.12/830-02-i2c-pxa-prevent-calling-of-the-generic-recovery-init-code.patch delete mode 100644 target/linux/mvebu/patches-6.12/830-03-i2c-pxa-handle-Early-Bus-Busy-condition-on-Armada-3700.patch delete mode 100644 target/linux/mvebu/patches-6.12/901-dt-bindings-Add-IEI-vendor-prefix-and-IEI-WT61P803-P.patch delete mode 100644 target/linux/mvebu/patches-6.12/902-drivers-mfd-Add-a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch delete mode 100644 target/linux/mvebu/patches-6.12/903-drivers-hwmon-Add-the-IEI-WT61P803-PUZZLE-HWMON-driv.patch delete mode 100644 target/linux/mvebu/patches-6.12/904-drivers-leds-Add-the-IEI-WT61P803-PUZZLE-LED-driver.patch delete mode 100644 target/linux/mvebu/patches-6.12/905-Documentation-ABI-Add-iei-wt61p803-puzzle-driver-sys.patch delete mode 100644 target/linux/mvebu/patches-6.12/906-Documentation-hwmon-Add-iei-wt61p803-puzzle-hwmon-dr.patch delete mode 100644 target/linux/mvebu/patches-6.12/907-MAINTAINERS-Add-an-entry-for-the-IEI-WT61P803-PUZZLE.patch delete mode 100644 target/linux/mvebu/patches-6.12/910-drivers-leds-wt61p803-puzzle-improvements.patch delete mode 100644 target/linux/mvebu/patches-6.12/911-drivers-leds-wt61p803-puzzle-mcu-retry.patch delete mode 100644 target/linux/mvebu/patches-6.12/912-drivers-hwmon-wt61p803-puzzle-thermal-zone.patch diff --git a/target/linux/mvebu/Makefile b/target/linux/mvebu/Makefile index ac7fae2aef..e2b1d5fd93 100644 --- a/target/linux/mvebu/Makefile +++ b/target/linux/mvebu/Makefile @@ -9,8 +9,7 @@ BOARDNAME:=Marvell EBU Armada FEATURES:=fpu usb pci pcie gpio nand squashfs ramdisk boot-part rootfs-part legacy-sdcard targz SUBTARGETS:=cortexa9 cortexa53 cortexa72 -KERNEL_PATCHVER:=6.12 -KERNEL_TESTING_PATCHVER:=6.18 +KERNEL_PATCHVER:=6.18 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/mvebu/config-6.12 b/target/linux/mvebu/config-6.12 deleted file mode 100644 index bb5fc5f048..0000000000 --- a/target/linux/mvebu/config-6.12 +++ /dev/null @@ -1,445 +0,0 @@ -CONFIG_AHCI_MVEBU=y -CONFIG_ALIGNMENT_TRAP=y -CONFIG_ARCH_32BIT_OFF_T=y -CONFIG_ARCH_HIBERNATION_POSSIBLE=y -CONFIG_ARCH_KEEP_MEMBLOCK=y -CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y -CONFIG_ARCH_MULTIPLATFORM=y -CONFIG_ARCH_MULTI_V6_V7=y -CONFIG_ARCH_MULTI_V7=y -CONFIG_ARCH_MVEBU=y -CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y -CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y -CONFIG_ARCH_SELECT_MEMORY_MODEL=y -CONFIG_ARCH_SPARSEMEM_ENABLE=y -CONFIG_ARCH_SUSPEND_POSSIBLE=y -CONFIG_ARM=y -CONFIG_ARMADA_370_CLK=y -CONFIG_ARMADA_370_XP_IRQ=y -CONFIG_ARMADA_370_XP_TIMER=y -# CONFIG_ARMADA_37XX_WATCHDOG is not set -CONFIG_ARMADA_38X_CLK=y -CONFIG_ARMADA_THERMAL=y -CONFIG_ARMADA_XP_CLK=y -CONFIG_ARM_APPENDED_DTB=y -# CONFIG_ARM_ARMADA_37XX_CPUFREQ is not set -# CONFIG_ARM_ARMADA_8K_CPUFREQ is not set -CONFIG_ARM_ATAG_DTB_COMPAT=y -# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER is not set -CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE=y -CONFIG_ARM_CPU_SUSPEND=y -CONFIG_ARM_ERRATA_720789=y -CONFIG_ARM_ERRATA_764369=y -CONFIG_ARM_GIC=y -CONFIG_ARM_GLOBAL_TIMER=y -CONFIG_ARM_GT_INITIAL_PRESCALER_VAL=1 -CONFIG_ARM_HEAVY_MB=y -CONFIG_ARM_L1_CACHE_SHIFT=6 -CONFIG_ARM_L1_CACHE_SHIFT_6=y -CONFIG_ARM_MVEBU_V7_CPUIDLE=y -CONFIG_ARM_PATCH_IDIV=y -CONFIG_ARM_PATCH_PHYS_VIRT=y -CONFIG_ARM_THUMB=y -CONFIG_ARM_UNWIND=y -CONFIG_ARM_VIRT_EXT=y -CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=y -CONFIG_ATA=y -CONFIG_ATAGS=y -CONFIG_ATA_LEDS=y -CONFIG_AUTO_ZRELADDR=y -CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_NVME=y -CONFIG_BLK_DEV_SD=y -CONFIG_BLK_MQ_PCI=y -CONFIG_BOUNCE=y -CONFIG_BUFFER_HEAD=y -# CONFIG_CACHE_FEROCEON_L2 is not set -CONFIG_CACHE_L2X0=y -CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK=y -CONFIG_CLKSRC_MMIO=y -CONFIG_CLONE_BACKWARDS=y -CONFIG_COMMON_CLK=y -CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 -CONFIG_COMPAT_32BIT_TIME=y -CONFIG_CONTEXT_TRACKING=y -CONFIG_CONTEXT_TRACKING_IDLE=y -CONFIG_CPUFREQ_DT=y -CONFIG_CPUFREQ_DT_PLATDEV=y -CONFIG_CPU_32v6K=y -CONFIG_CPU_32v7=y -CONFIG_CPU_ABRT_EV7=y -CONFIG_CPU_CACHE_V7=y -CONFIG_CPU_CACHE_VIPT=y -CONFIG_CPU_COPY_V6=y -CONFIG_CPU_CP15=y -CONFIG_CPU_CP15_MMU=y -CONFIG_CPU_FREQ=y -CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y -# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set -CONFIG_CPU_FREQ_GOV_ATTR_SET=y -CONFIG_CPU_FREQ_GOV_COMMON=y -# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set -CONFIG_CPU_FREQ_GOV_ONDEMAND=y -CONFIG_CPU_FREQ_GOV_PERFORMANCE=y -# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set -# CONFIG_CPU_FREQ_GOV_USERSPACE is not set -CONFIG_CPU_FREQ_STAT=y -CONFIG_CPU_HAS_ASID=y -CONFIG_CPU_IDLE=y -CONFIG_CPU_IDLE_GOV_MENU=y -CONFIG_CPU_LITTLE_ENDIAN=y -CONFIG_CPU_MITIGATIONS=y -CONFIG_CPU_PABRT_V7=y -CONFIG_CPU_PJ4B=y -CONFIG_CPU_PM=y -CONFIG_CPU_RMAP=y -CONFIG_CPU_SPECTRE=y -CONFIG_CPU_THERMAL=y -CONFIG_CPU_THUMB_CAPABLE=y -CONFIG_CPU_TLB_V7=y -CONFIG_CPU_V7=y -CONFIG_CRC16=y -CONFIG_CRYPTO_AES_ARM=y -CONFIG_CRYPTO_AES_ARM_BS=y -CONFIG_CRYPTO_AUTHENC=y -CONFIG_CRYPTO_CBC=y -CONFIG_CRYPTO_CRC32=y -CONFIG_CRYPTO_CRC32C=y -CONFIG_CRYPTO_CRYPTD=y -CONFIG_CRYPTO_DEFLATE=y -CONFIG_CRYPTO_DES=y -CONFIG_CRYPTO_DEV_MARVELL=y -CONFIG_CRYPTO_DEV_MARVELL_CESA=y -CONFIG_CRYPTO_ECB=y -CONFIG_CRYPTO_ESSIV=y -CONFIG_CRYPTO_HASH_INFO=y -CONFIG_CRYPTO_HW=y -CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y -CONFIG_CRYPTO_LIB_DES=y -CONFIG_CRYPTO_LIB_GF128MUL=y -CONFIG_CRYPTO_LIB_UTILS=y -CONFIG_CRYPTO_LZO=y -CONFIG_CRYPTO_SHA1=y -CONFIG_CRYPTO_SHA1_ARM=y -CONFIG_CRYPTO_SHA1_ARM_NEON=y -CONFIG_CRYPTO_SHA256_ARM=y -CONFIG_CRYPTO_SHA512_ARM=y -CONFIG_CRYPTO_SIMD=y -CONFIG_CRYPTO_ZSTD=y -CONFIG_DCACHE_WORD_ACCESS=y -CONFIG_DEBUG_ALIGN_RODATA=y -CONFIG_DEBUG_INFO=y -CONFIG_DEBUG_LL=y -CONFIG_DEBUG_LL_INCLUDE="debug/8250.S" -CONFIG_DEBUG_MVEBU_UART0=y -# CONFIG_DEBUG_MVEBU_UART0_ALTERNATE is not set -# CONFIG_DEBUG_MVEBU_UART1_ALTERNATE is not set -CONFIG_DEBUG_UART_8250=y -CONFIG_DEBUG_UART_8250_SHIFT=2 -CONFIG_DEBUG_UART_PHYS=0xd0012000 -CONFIG_DEBUG_UART_VIRT=0xfec12000 -CONFIG_DEBUG_USER=y -CONFIG_DMADEVICES=y -CONFIG_DMA_ENGINE=y -CONFIG_DMA_ENGINE_RAID=y -CONFIG_DMA_NEED_SYNC=y -CONFIG_DMA_OF=y -CONFIG_DMA_OPS_HELPERS=y -CONFIG_DTC=y -CONFIG_EARLY_PRINTK=y -CONFIG_EDAC_ATOMIC_SCRUB=y -CONFIG_EDAC_SUPPORT=y -CONFIG_EXCLUSIVE_SYSTEM_RAM=y -CONFIG_EXT4_FS=y -CONFIG_EXTCON=y -CONFIG_F2FS_FS=y -CONFIG_FIXED_PHY=y -CONFIG_FIX_EARLYCON_MEM=y -CONFIG_FS_IOMAP=y -CONFIG_FS_MBCACHE=y -CONFIG_FUNCTION_ALIGNMENT=0 -CONFIG_FWNODE_MDIO=y -CONFIG_FW_LOADER_PAGED_BUF=y -CONFIG_FW_LOADER_SYSFS=y -CONFIG_GENERIC_ALLOCATOR=y -CONFIG_GENERIC_ARCH_TOPOLOGY=y -CONFIG_GENERIC_BUG=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y -CONFIG_GENERIC_CPU_AUTOPROBE=y -CONFIG_GENERIC_CPU_VULNERABILITIES=y -CONFIG_GENERIC_EARLY_IOREMAP=y -CONFIG_GENERIC_GETTIMEOFDAY=y -CONFIG_GENERIC_IDLE_POLL_SETUP=y -CONFIG_GENERIC_IRQ_CHIP=y -CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y -CONFIG_GENERIC_IRQ_MIGRATION=y -CONFIG_GENERIC_IRQ_MULTI_HANDLER=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_GENERIC_IRQ_SHOW_LEVEL=y -CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y -CONFIG_GENERIC_MSI_IRQ=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_GENERIC_PHY=y -CONFIG_GENERIC_SCHED_CLOCK=y -CONFIG_GENERIC_SMP_IDLE_THREAD=y -CONFIG_GENERIC_STRNCPY_FROM_USER=y -CONFIG_GENERIC_STRNLEN_USER=y -CONFIG_GENERIC_TIME_VSYSCALL=y -CONFIG_GENERIC_VDSO_32=y -CONFIG_GLOB=y -CONFIG_GPIOLIB_IRQCHIP=y -CONFIG_GPIO_CDEV=y -CONFIG_GPIO_GENERIC=y -CONFIG_GPIO_GENERIC_PLATFORM=y -CONFIG_GPIO_MVEBU=y -CONFIG_GPIO_PCA953X=y -CONFIG_GPIO_PCA953X_IRQ=y -CONFIG_HARDEN_BRANCH_PREDICTOR=y -CONFIG_HARDIRQS_SW_RESEND=y -CONFIG_HAS_DMA=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT=y -CONFIG_HAS_IOPORT_MAP=y -CONFIG_HAVE_SMP=y -CONFIG_HIGHMEM=y -CONFIG_HIGHPTE=y -CONFIG_HOTPLUG_CORE_SYNC=y -CONFIG_HOTPLUG_CORE_SYNC_DEAD=y -CONFIG_HOTPLUG_CPU=y -CONFIG_HWBM=y -CONFIG_HWMON=y -CONFIG_HW_RANDOM=y -CONFIG_HZ_FIXED=0 -CONFIG_I2C=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_CHARDEV=y -CONFIG_I2C_MV64XXX=y -# CONFIG_I2C_PXA is not set -CONFIG_INITRAMFS_SOURCE="" -CONFIG_IRQCHIP=y -CONFIG_IRQ_DOMAIN=y -CONFIG_IRQ_DOMAIN_HIERARCHY=y -CONFIG_IRQ_FORCED_THREADING=y -CONFIG_IRQ_WORK=y -CONFIG_JBD2=y -CONFIG_KMAP_LOCAL=y -CONFIG_KMAP_LOCAL_NON_LINEAR_PTE_ARRAY=y -CONFIG_LEDS_GPIO=y -CONFIG_LEDS_PCA963X=y -CONFIG_LEDS_TLC591XX=y -CONFIG_LEDS_TRIGGER_DISK=y -CONFIG_LIBFDT=y -CONFIG_LOCK_DEBUGGING_SUPPORT=y -CONFIG_LOCK_SPIN_ON_OWNER=y -CONFIG_LZO_COMPRESS=y -CONFIG_LZO_DECOMPRESS=y -CONFIG_MACH_ARMADA_370=y -# CONFIG_MACH_ARMADA_375 is not set -CONFIG_MACH_ARMADA_38X=y -# CONFIG_MACH_ARMADA_39X is not set -CONFIG_MACH_ARMADA_XP=y -# CONFIG_MACH_DOVE is not set -CONFIG_MACH_MVEBU_ANY=y -CONFIG_MACH_MVEBU_V7=y -CONFIG_MAGIC_SYSRQ=y -CONFIG_MANGLE_BOOTARGS=y -CONFIG_MARVELL_PHY=y -CONFIG_MDIO_BUS=y -CONFIG_MDIO_DEVICE=y -CONFIG_MDIO_DEVRES=y -CONFIG_MDIO_I2C=y -CONFIG_MEMORY=y -CONFIG_MIGHT_HAVE_CACHE_L2X0=y -CONFIG_MIGRATION=y -CONFIG_MMC=y -CONFIG_MMC_BLOCK=y -CONFIG_MMC_MVSDIO=y -CONFIG_MMC_SDHCI=y -CONFIG_MMC_SDHCI_PLTFM=y -CONFIG_MMC_SDHCI_PXAV3=y -CONFIG_MMU_LAZY_TLB_REFCOUNT=y -CONFIG_MODULES_USE_ELF_REL=y -CONFIG_MTD_CFI_STAA=y -CONFIG_MTD_NAND_CORE=y -CONFIG_MTD_NAND_ECC=y -CONFIG_MTD_NAND_ECC_SW_HAMMING=y -CONFIG_MTD_NAND_MARVELL=y -CONFIG_MTD_RAW_NAND=y -CONFIG_MTD_SPI_NOR=y -CONFIG_MTD_SPI_NOR_USE_VARIABLE_ERASE=y -CONFIG_MTD_SPLIT_FIRMWARE=y -CONFIG_MTD_UBI=y -CONFIG_MTD_UBI_BEB_LIMIT=20 -CONFIG_MTD_UBI_BLOCK=y -CONFIG_MTD_UBI_WL_THRESHOLD=4096 -CONFIG_MUTEX_SPIN_ON_OWNER=y -CONFIG_MVEBU_CLK_COMMON=y -CONFIG_MVEBU_CLK_COREDIV=y -CONFIG_MVEBU_CLK_CPU=y -CONFIG_MVEBU_DEVBUS=y -CONFIG_MVEBU_MBUS=y -CONFIG_MVMDIO=y -CONFIG_MVNETA=y -CONFIG_MVNETA_BM=y -CONFIG_MVNETA_BM_ENABLE=y -# CONFIG_MVPP2 is not set -CONFIG_MV_XOR=y -CONFIG_NEED_DMA_MAP_STATE=y -CONFIG_NEED_SRCU_NMI_SAFE=y -CONFIG_NEON=y -CONFIG_NET_EGRESS=y -CONFIG_NET_FLOW_LIMIT=y -CONFIG_NET_INGRESS=y -CONFIG_NET_SELFTESTS=y -CONFIG_NET_XGRESS=y -CONFIG_NLS=y -CONFIG_NOP_USB_XCEIV=y -CONFIG_NO_HZ_COMMON=y -CONFIG_NO_HZ_IDLE=y -CONFIG_NR_CPUS=4 -CONFIG_NVMEM=y -CONFIG_NVMEM_LAYOUTS=y -CONFIG_NVME_CORE=y -# CONFIG_NVME_HWMON is not set -# CONFIG_NVME_MULTIPATH is not set -CONFIG_OF=y -CONFIG_OF_ADDRESS=y -CONFIG_OF_EARLY_FLATTREE=y -CONFIG_OF_FLATTREE=y -CONFIG_OF_GPIO=y -CONFIG_OF_IRQ=y -CONFIG_OF_KOBJ=y -CONFIG_OF_MDIO=y -CONFIG_OLD_SIGACTION=y -CONFIG_OLD_SIGSUSPEND3=y -CONFIG_ORION_WATCHDOG=y -CONFIG_OUTER_CACHE=y -CONFIG_OUTER_CACHE_SYNC=y -CONFIG_PADATA=y -CONFIG_PAGE_OFFSET=0xC0000000 -CONFIG_PAGE_POOL=y -CONFIG_PAGE_POOL_STATS=y -CONFIG_PAGE_SIZE_LESS_THAN_256KB=y -CONFIG_PAGE_SIZE_LESS_THAN_64KB=y -CONFIG_PCI=y -CONFIG_PCI_BRIDGE_EMUL=y -CONFIG_PCI_DOMAINS=y -CONFIG_PCI_DOMAINS_GENERIC=y -CONFIG_PCI_MSI=y -CONFIG_PCI_MVEBU=y -CONFIG_PERF_USE_VMALLOC=y -CONFIG_PER_VMA_LOCK=y -CONFIG_PGTABLE_LEVELS=2 -CONFIG_PHYLIB=y -CONFIG_PHYLINK=y -# CONFIG_PHY_MVEBU_A3700_COMPHY is not set -# CONFIG_PHY_MVEBU_A3700_UTMI is not set -# CONFIG_PHY_MVEBU_A38X_COMPHY is not set -# CONFIG_PHY_MVEBU_CP110_COMPHY is not set -CONFIG_PINCTRL=y -CONFIG_PINCTRL_ARMADA_370=y -CONFIG_PINCTRL_ARMADA_38X=y -CONFIG_PINCTRL_ARMADA_XP=y -CONFIG_PINCTRL_MVEBU=y -# CONFIG_PINCTRL_SINGLE is not set -CONFIG_PJ4B_ERRATA_4742=y -CONFIG_PL310_ERRATA_753970=y -CONFIG_PLAT_ORION=y -CONFIG_PM_OPP=y -CONFIG_POWER_RESET=y -CONFIG_POWER_RESET_GPIO=y -CONFIG_PTP_1588_CLOCK_OPTIONAL=y -CONFIG_PWM=y -CONFIG_RANDSTRUCT_NONE=y -CONFIG_RATIONAL=y -CONFIG_REGMAP=y -CONFIG_REGMAP_I2C=y -CONFIG_REGMAP_MMIO=y -CONFIG_REGULATOR=y -CONFIG_REGULATOR_FIXED_VOLTAGE=y -CONFIG_RFS_ACCEL=y -CONFIG_RPS=y -CONFIG_RTC_CLASS=y -CONFIG_RTC_DRV_ARMADA38X=y -# CONFIG_RTC_DRV_MV is not set -CONFIG_RTC_I2C_AND_SPI=y -CONFIG_RTC_MC146818_LIB=y -CONFIG_RWSEM_SPIN_ON_OWNER=y -CONFIG_SATA_AHCI_PLATFORM=y -CONFIG_SATA_HOST=y -CONFIG_SATA_MV=y -CONFIG_SATA_PMP=y -CONFIG_SCSI=y -CONFIG_SCSI_COMMON=y -CONFIG_SENSORS_PWM_FAN=y -CONFIG_SENSORS_TMP421=y -CONFIG_SERIAL_8250_DW=y -CONFIG_SERIAL_8250_DWLIB=y -CONFIG_SERIAL_8250_FSL=y -CONFIG_SERIAL_MCTRL_GPIO=y -CONFIG_SERIAL_MVEBU_CONSOLE=y -CONFIG_SERIAL_MVEBU_UART=y -CONFIG_SFP=y -CONFIG_SGL_ALLOC=y -CONFIG_SG_POOL=y -CONFIG_SMP=y -CONFIG_SMP_ON_UP=y -CONFIG_SOCK_RX_QUEUE_MAPPING=y -CONFIG_SOC_BUS=y -CONFIG_SOFTIRQ_ON_OWN_STACK=y -CONFIG_SPARSE_IRQ=y -CONFIG_SPI=y -# CONFIG_SPI_ARMADA_3700 is not set -CONFIG_SPI_MASTER=y -CONFIG_SPI_MEM=y -CONFIG_SPI_ORION=y -CONFIG_SPLIT_PTE_PTLOCKS=y -CONFIG_SRAM=y -CONFIG_SRAM_EXEC=y -CONFIG_SWPHY=y -CONFIG_SWP_EMULATE=y -CONFIG_SYS_SUPPORTS_APM_EMULATION=y -CONFIG_THERMAL=y -CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y -CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 -CONFIG_THERMAL_GOV_STEP_WISE=y -CONFIG_THERMAL_HWMON=y -CONFIG_THERMAL_OF=y -CONFIG_TICK_CPU_ACCOUNTING=y -CONFIG_TIMER_OF=y -CONFIG_TIMER_PROBE=y -CONFIG_TREE_RCU=y -CONFIG_TREE_SRCU=y -CONFIG_UBIFS_FS=y -CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" -CONFIG_UNWINDER_ARM=y -CONFIG_USB=y -CONFIG_USB_COMMON=y -CONFIG_USB_EHCI_HCD=y -CONFIG_USB_EHCI_HCD_ORION=y -CONFIG_USB_EHCI_HCD_PLATFORM=y -CONFIG_USB_LEDS_TRIGGER_USBPORT=y -CONFIG_USB_PHY=y -CONFIG_USB_STORAGE=y -CONFIG_USB_SUPPORT=y -CONFIG_USB_XHCI_HCD=y -CONFIG_USB_XHCI_MVEBU=y -CONFIG_USB_XHCI_PLATFORM=y -CONFIG_USE_OF=y -CONFIG_VFP=y -CONFIG_VFPv3=y -CONFIG_WATCHDOG_CORE=y -CONFIG_XPS=y -CONFIG_XXHASH=y -CONFIG_XZ_DEC_ARM=y -CONFIG_XZ_DEC_BCJ=y -CONFIG_ZBOOT_ROM_BSS=0x0 -CONFIG_ZBOOT_ROM_TEXT=0x0 -CONFIG_ZLIB_DEFLATE=y -CONFIG_ZLIB_INFLATE=y -CONFIG_ZSTD_COMMON=y -CONFIG_ZSTD_COMPRESS=y -CONFIG_ZSTD_DECOMPRESS=y diff --git a/target/linux/mvebu/cortexa53/config-6.12 b/target/linux/mvebu/cortexa53/config-6.12 deleted file mode 100644 index 15a63334a6..0000000000 --- a/target/linux/mvebu/cortexa53/config-6.12 +++ /dev/null @@ -1,99 +0,0 @@ -CONFIG_64BIT=y -CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS=y -CONFIG_ARCH_CORRECT_STACKTRACE_ON_KRETPROBE=y -CONFIG_ARCH_DMA_ADDR_T_64BIT=y -CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y -CONFIG_ARCH_MMAP_RND_BITS=18 -CONFIG_ARCH_MMAP_RND_BITS_MAX=24 -CONFIG_ARCH_MMAP_RND_BITS_MIN=18 -CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11 -CONFIG_ARCH_PROC_KCORE_TEXT=y -CONFIG_ARCH_STACKWALK=y -CONFIG_ARCH_WANTS_NO_INSTR=y -CONFIG_ARCH_WANTS_THP_SWAP=y -CONFIG_ARM64=y -CONFIG_ARM64_4K_PAGES=y -CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y -CONFIG_ARM64_PAGE_SHIFT=12 -CONFIG_ARM64_PA_BITS=48 -CONFIG_ARM64_PA_BITS_48=y -CONFIG_ARM64_PLATFORM_DEVICES=y -CONFIG_ARM64_TAGGED_ADDR_ABI=y -CONFIG_ARM64_VA_BITS=39 -CONFIG_ARM64_VA_BITS_39=y -CONFIG_ARMADA_37XX_CLK=y -CONFIG_ARMADA_37XX_RWTM_MBOX=y -CONFIG_ARMADA_37XX_WATCHDOG=y -CONFIG_ARMADA_AP806_SYSCON=y -CONFIG_ARMADA_AP_CP_HELPER=y -CONFIG_ARMADA_CP110_SYSCON=y -CONFIG_ARM_AMBA=y -CONFIG_ARM_ARCH_TIMER=y -# CONFIG_ARM_ARCH_TIMER_EVTSTREAM is not set -CONFIG_ARM_ARMADA_37XX_CPUFREQ=y -CONFIG_ARM_GIC_V2M=y -CONFIG_ARM_GIC_V3=y -CONFIG_ARM_GIC_V3_ITS=y -CONFIG_ARM_GIC_V3_ITS_PCI=y -# CONFIG_ARM_MHU_V2 is not set -# CONFIG_ARM_MHU_V3 is not set -# CONFIG_ARM_PL172_MPMC is not set -CONFIG_ARM_PSCI_FW=y -CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y -CONFIG_CC_HAVE_SHADOW_CALL_STACK=y -CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y -CONFIG_CPU_LITTLE_ENDIAN=y -CONFIG_DMA_DIRECT_REMAP=y -CONFIG_F2FS_FS_COMPRESSION=y -# CONFIG_F2FS_FS_LZ4 is not set -# CONFIG_F2FS_FS_LZO is not set -CONFIG_F2FS_FS_ZSTD=y -CONFIG_FRAME_POINTER=y -CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_REGS=y -CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y -CONFIG_GENERIC_CSUM=y -CONFIG_GENERIC_IOREMAP=y -CONFIG_GENERIC_PINCONF=y -CONFIG_GPIO_MOXTET=y -CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 -CONFIG_MAILBOX=y -# CONFIG_MAILBOX_TEST is not set -CONFIG_MFD_SYSCON=y -CONFIG_MMC_SDHCI_XENON=y -CONFIG_MODULES_USE_ELF_RELA=y -CONFIG_MOXTET=y -CONFIG_MVEBU_GICP=y -CONFIG_MVEBU_ICU=y -CONFIG_MVEBU_ODMI=y -CONFIG_MVEBU_PIC=y -CONFIG_MVEBU_SEI=y -CONFIG_NEED_SG_DMA_LENGTH=y -CONFIG_PARTITION_PERCPU=y -CONFIG_PCI_AARDVARK=y -CONFIG_PGTABLE_LEVELS=3 -CONFIG_PHYS_ADDR_T_64BIT=y -CONFIG_PHY_MVEBU_A3700_COMPHY=y -CONFIG_PHY_MVEBU_A3700_UTMI=y -CONFIG_PINCTRL_AC5=y -CONFIG_PINCTRL_ARMADA_37XX=y -CONFIG_PINCTRL_ARMADA_AP806=y -CONFIG_PINCTRL_ARMADA_CP110=y -CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y -CONFIG_POWER_SUPPLY=y -CONFIG_QUEUED_RWLOCKS=y -CONFIG_QUEUED_SPINLOCKS=y -CONFIG_REGULATOR_GPIO=y -CONFIG_RODATA_FULL_DEFAULT_ENABLED=y -CONFIG_SPARSEMEM=y -CONFIG_SPARSEMEM_EXTREME=y -CONFIG_SPARSEMEM_VMEMMAP=y -CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y -CONFIG_SPI_ARMADA_3700=y -CONFIG_SWIOTLB=y -CONFIG_SYSCTL_EXCEPTION_TRACE=y -CONFIG_THREAD_INFO_IN_TASK=y -CONFIG_TRACE_IRQFLAGS_NMI_SUPPORT=y -CONFIG_TURRIS_MOX_RWTM=y -CONFIG_UNMAP_KERNEL_AT_EL0=y -CONFIG_VMAP_STACK=y -CONFIG_ZONE_DMA32=y diff --git a/target/linux/mvebu/cortexa72/config-6.12 b/target/linux/mvebu/cortexa72/config-6.12 deleted file mode 100644 index 4080fe278a..0000000000 --- a/target/linux/mvebu/cortexa72/config-6.12 +++ /dev/null @@ -1,123 +0,0 @@ -CONFIG_64BIT=y -CONFIG_AQUANTIA_PHY=y -CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS=y -CONFIG_ARCH_CORRECT_STACKTRACE_ON_KRETPROBE=y -CONFIG_ARCH_DMA_ADDR_T_64BIT=y -CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y -CONFIG_ARCH_MMAP_RND_BITS=18 -CONFIG_ARCH_MMAP_RND_BITS_MAX=24 -CONFIG_ARCH_MMAP_RND_BITS_MIN=18 -CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11 -CONFIG_ARCH_PROC_KCORE_TEXT=y -CONFIG_ARCH_STACKWALK=y -CONFIG_ARCH_WANTS_NO_INSTR=y -CONFIG_ARCH_WANTS_THP_SWAP=y -CONFIG_ARM64=y -CONFIG_ARM64_4K_PAGES=y -CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y -CONFIG_ARM64_PAGE_SHIFT=12 -CONFIG_ARM64_PA_BITS=48 -CONFIG_ARM64_PA_BITS_48=y -CONFIG_ARM64_PLATFORM_DEVICES=y -CONFIG_ARM64_SVE=y -# CONFIG_ARM64_TAGGED_ADDR_ABI is not set -CONFIG_ARM64_VA_BITS=39 -CONFIG_ARM64_VA_BITS_39=y -CONFIG_ARMADA_37XX_CLK=y -CONFIG_ARMADA_AP806_SYSCON=y -CONFIG_ARMADA_AP_CPU_CLK=y -CONFIG_ARMADA_AP_CP_HELPER=y -CONFIG_ARMADA_CP110_SYSCON=y -CONFIG_ARM_AMBA=y -CONFIG_ARM_ARCH_TIMER=y -# CONFIG_ARM_ARCH_TIMER_EVTSTREAM is not set -CONFIG_ARM_ARMADA_8K_CPUFREQ=y -CONFIG_ARM_GIC_V2M=y -CONFIG_ARM_GIC_V3=y -CONFIG_ARM_GIC_V3_ITS=y -CONFIG_ARM_GIC_V3_ITS_PCI=y -# CONFIG_ARM_PL172_MPMC is not set -CONFIG_ARM_PSCI_FW=y -CONFIG_ARM_SBSA_WATCHDOG=y -CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y -CONFIG_CC_HAVE_SHADOW_CALL_STACK=y -CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y -CONFIG_CMDLINE_PARTITION=y -CONFIG_CPU_LITTLE_ENDIAN=y -CONFIG_CRC_CCITT=y -CONFIG_DMA_DIRECT_REMAP=y -CONFIG_EEPROM_AT24=y -CONFIG_FRAME_POINTER=y -CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_REGS=y -CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y -CONFIG_GENERIC_CSUM=y -CONFIG_GENERIC_IOREMAP=y -CONFIG_GENERIC_PINCONF=y -CONFIG_HW_RANDOM_OMAP=y -CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 -CONFIG_LEDS_IEI_WT61P803_PUZZLE=y -CONFIG_LEDS_IS31FL319X=y -CONFIG_MARVELL_10G_PHY=y -CONFIG_MFD_CORE=y -CONFIG_MFD_IEI_WT61P803_PUZZLE=y -CONFIG_MFD_SYSCON=y -CONFIG_MIKROTIK=y -CONFIG_MIKROTIK_RB_SYSFS=y -# CONFIG_MIKROTIK_WLAN_DECOMPRESS_LZ77 is not set -CONFIG_MMC_SDHCI_XENON=y -CONFIG_MODULES_USE_ELF_RELA=y -CONFIG_MTD_ROUTERBOOT_PARTS=y -CONFIG_MTD_SPI_NOR_USE_VARIABLE_ERASE=y -CONFIG_MVEBU_GICP=y -CONFIG_MVEBU_ICU=y -CONFIG_MVEBU_ODMI=y -CONFIG_MVEBU_PIC=y -CONFIG_MVEBU_SEI=y -CONFIG_MVPP2=y -CONFIG_MV_XOR_V2=y -CONFIG_NEED_SG_DMA_LENGTH=y -CONFIG_NVMEM_LAYOUTS=y -CONFIG_NVMEM_LAYOUT_MIKROTIK=y -CONFIG_NVMEM_LAYOUT_ONIE_TLV=y -CONFIG_NVMEM_LAYOUT_U_BOOT_ENV=y -CONFIG_NVMEM_SYSFS=y -CONFIG_PARTITION_PERCPU=y -CONFIG_PCIEAER=y -CONFIG_PCIEPORTBUS=y -CONFIG_PCIE_ARMADA_8K=y -CONFIG_PCIE_DW=y -CONFIG_PCIE_DW_HOST=y -# CONFIG_PCI_AARDVARK is not set -CONFIG_PGTABLE_LEVELS=3 -CONFIG_PHYLIB_LEDS=y -CONFIG_PHYS_ADDR_T_64BIT=y -CONFIG_PHY_MVEBU_CP110_COMPHY=y -CONFIG_PHY_MVEBU_CP110_UTMI=y -CONFIG_PINCTRL_AC5=y -CONFIG_PINCTRL_ARMADA_37XX=y -CONFIG_PINCTRL_ARMADA_AP806=y -CONFIG_PINCTRL_ARMADA_CP110=y -CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y -CONFIG_POWER_SUPPLY=y -CONFIG_QCA808X_PHY=y -CONFIG_QUEUED_RWLOCKS=y -CONFIG_QUEUED_SPINLOCKS=y -CONFIG_RAS=y -# CONFIG_RAVE_SP_CORE is not set -CONFIG_REGULATOR_GPIO=y -CONFIG_REGULATOR_USERSPACE_CONSUMER=y -# CONFIG_RODATA_FULL_DEFAULT_ENABLED is not set -CONFIG_SENSORS_IEI_WT61P803_PUZZLE_HWMON=y -CONFIG_SERIAL_DEV_BUS=y -CONFIG_SERIAL_DEV_CTRL_TTYPORT=y -CONFIG_SPARSEMEM=y -CONFIG_SPARSEMEM_EXTREME=y -CONFIG_SPARSEMEM_VMEMMAP=y -CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y -CONFIG_SWIOTLB=y -CONFIG_SYSCTL_EXCEPTION_TRACE=y -CONFIG_THREAD_INFO_IN_TASK=y -CONFIG_TRACE_IRQFLAGS_NMI_SUPPORT=y -CONFIG_UNMAP_KERNEL_AT_EL0=y -CONFIG_VMAP_STACK=y -CONFIG_ZONE_DMA32=y diff --git a/target/linux/mvebu/cortexa9/config-6.12 b/target/linux/mvebu/cortexa9/config-6.12 deleted file mode 100644 index 7f825a806b..0000000000 --- a/target/linux/mvebu/cortexa9/config-6.12 +++ /dev/null @@ -1,12 +0,0 @@ -CONFIG_ARM_HAS_GROUP_RELOCS=y -CONFIG_CPU_LITTLE_ENDIAN=y -CONFIG_CURRENT_POINTER_IN_TPIDRURO=y -CONFIG_IRQSTACKS=y -CONFIG_LED_TRIGGER_PHY=y -CONFIG_MTD_SPLIT_SEIL_FW=y -CONFIG_MTD_SPLIT_UIMAGE_FW=y -CONFIG_MTD_VIRT_CONCAT=y -CONFIG_PHY_MVEBU_A38X_COMPHY=y -CONFIG_POWER_RESET_QNAP=y -CONFIG_RTC_DRV_MV=y -CONFIG_THREAD_INFO_IN_TASK=y diff --git a/target/linux/mvebu/patches-6.12/0003-v6.16-pinctrl-armada-37xx-propagate-error-from-armada_37xx.patch b/target/linux/mvebu/patches-6.12/0003-v6.16-pinctrl-armada-37xx-propagate-error-from-armada_37xx.patch deleted file mode 100644 index 2d7b6b5176..0000000000 --- a/target/linux/mvebu/patches-6.12/0003-v6.16-pinctrl-armada-37xx-propagate-error-from-armada_37xx.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0396a8731efd17aec4719ad9981fefeaa13ffa56 Mon Sep 17 00:00:00 2001 -From: Gabor Juhos -Date: Wed, 14 May 2025 21:18:34 +0200 -Subject: [PATCH 3/7] pinctrl: armada-37xx: propagate error from - armada_37xx_gpio_direction_output() - -The regmap_update_bits() function can fail, so propagate its error -up to the stack instead of silently ignoring that. - -Signed-off-by: Imre Kaloz -Reviewed-by: Andrew Lunn -Signed-off-by: Gabor Juhos -Link: https://lore.kernel.org/20250514-pinctrl-a37xx-fixes-v2-3-07e9ac1ab737@gmail.com -Signed-off-by: Linus Walleij ---- - drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - ---- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c -+++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c -@@ -433,9 +433,7 @@ static int armada_37xx_gpio_direction_ou - reg = OUTPUT_EN; - armada_37xx_update_reg(®, &en_offset); - -- regmap_update_bits(info->regmap, reg, mask, mask); -- -- return 0; -+ return regmap_update_bits(info->regmap, reg, mask, mask); - } - - static int armada_37xx_gpio_get(struct gpio_chip *chip, unsigned int offset) diff --git a/target/linux/mvebu/patches-6.12/100-aardvark-workaround-PCIe.patch b/target/linux/mvebu/patches-6.12/100-aardvark-workaround-PCIe.patch deleted file mode 100644 index b2282a3684..0000000000 --- a/target/linux/mvebu/patches-6.12/100-aardvark-workaround-PCIe.patch +++ /dev/null @@ -1,81 +0,0 @@ -Subject: [PATCH v2] PCI: aardvark: Implement workaround for PCIe Completion Timeout -Date: Tue, 2 Aug 2022 14:38:16 +0200 -Message-Id: <20220802123816.21817-1-pali@kernel.org> -X-Mailer: git-send-email 2.20.1 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit -Precedence: bulk -List-ID: -X-Mailing-List: linux-pci@vger.kernel.org - -Marvell Armada 3700 Functional Errata, Guidelines, and Restrictions -document describes in erratum 3.12 PCIe Completion Timeout (Ref #: 251), -that PCIe IP does not support a strong-ordered model for inbound posted vs. -outbound completion. - -As a workaround for this erratum, DIS_ORD_CHK flag in Debug Mux Control -register must be set. It disables the ordering check in the core between -Completions and Posted requests received from the link. - -Marvell also suggests to do full memory barrier at the beginning of -aardvark summary interrupt handler before calling interrupt handlers of -endpoint drivers in order to minimize the risk for the race condition -documented in the Erratum between the DMA done status reading and the -completion of writing to the host memory. - -More details about this issue and suggested workarounds are in discussion: -https://lore.kernel.org/linux-pci/BN9PR18MB425154FE5019DCAF2028A1D5DB8D9@BN9PR18MB4251.namprd18.prod.outlook.com/t/#u - -It was reported that enabling this workaround fixes instability issues and -"Unhandled fault" errors when using 60 GHz WiFi 802.11ad card with Qualcomm -QCA6335 chip under significant load which were caused by interrupt status -stuck in the outbound CMPLT queue traced back to this erratum. - -This workaround fixes also kernel panic triggered after some minutes of -usage 5 GHz WiFi 802.11ax card with Mediatek MT7915 chip: - - Internal error: synchronous external abort: 96000210 [#1] SMP - Kernel panic - not syncing: Fatal exception in interrupt - -Signed-off-by: Thomas Petazzoni -Signed-off-by: Pali Rohár -Fixes: 8c39d710363c ("PCI: aardvark: Add Aardvark PCI host controller driver") -Cc: stable@vger.kernel.org ---- - drivers/pci/controller/pci-aardvark.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) - ---- a/drivers/pci/controller/pci-aardvark.c -+++ b/drivers/pci/controller/pci-aardvark.c -@@ -211,6 +211,8 @@ enum { - }; - - #define VENDOR_ID_REG (LMI_BASE_ADDR + 0x44) -+#define DEBUG_MUX_CTRL_REG (LMI_BASE_ADDR + 0x208) -+#define DIS_ORD_CHK BIT(30) - - /* PCIe core controller registers */ - #define CTRL_CORE_BASE_ADDR 0x18000 -@@ -559,6 +561,11 @@ static void advk_pcie_setup_hw(struct ad - PCIE_CORE_CTRL2_TD_ENABLE; - advk_writel(pcie, reg, PCIE_CORE_CTRL2_REG); - -+ /* Disable ordering checks, workaround for erratum 3.12 "PCIe completion timeout" */ -+ reg = advk_readl(pcie, DEBUG_MUX_CTRL_REG); -+ reg |= DIS_ORD_CHK; -+ advk_writel(pcie, reg, DEBUG_MUX_CTRL_REG); -+ - /* Set lane X1 */ - reg = advk_readl(pcie, PCIE_CORE_CTRL0_REG); - reg &= ~LANE_CNT_MSK; -@@ -1654,6 +1661,9 @@ static irqreturn_t advk_pcie_irq_handler - struct advk_pcie *pcie = arg; - u32 status; - -+ /* Full memory barrier (ARM dsb sy), workaround for erratum 3.12 "PCIe completion timeout" */ -+ mb(); -+ - status = advk_readl(pcie, HOST_CTRL_INT_STATUS_REG); - if (!(status & PCIE_IRQ_CORE_INT)) - return IRQ_NONE; diff --git a/target/linux/mvebu/patches-6.12/105-power-reset-linkstation-poweroff-add-ls220de.patch b/target/linux/mvebu/patches-6.12/105-power-reset-linkstation-poweroff-add-ls220de.patch deleted file mode 100644 index 3223861234..0000000000 --- a/target/linux/mvebu/patches-6.12/105-power-reset-linkstation-poweroff-add-ls220de.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/drivers/power/reset/linkstation-poweroff.c -+++ b/drivers/power/reset/linkstation-poweroff.c -@@ -142,6 +142,12 @@ static void linkstation_poweroff(void) - } - - static const struct of_device_id ls_poweroff_of_match[] = { -+ { .compatible = "buffalo,ls220d", -+ .data = &linkstation_power_off_cfg, -+ }, -+ { .compatible = "buffalo,ls220de", -+ .data = &linkstation_power_off_cfg, -+ }, - { .compatible = "buffalo,ls421d", - .data = &linkstation_power_off_cfg, - }, diff --git a/target/linux/mvebu/patches-6.12/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/mvebu/patches-6.12/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch deleted file mode 100644 index 3425e58d5c..0000000000 --- a/target/linux/mvebu/patches-6.12/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch +++ /dev/null @@ -1,279 +0,0 @@ -From 71270226b14733a4b1f2cde58ea9265caa50b38d Mon Sep 17 00:00:00 2001 -From: Adrian Panella -Date: Thu, 9 Mar 2017 09:37:17 +0100 -Subject: [PATCH 67/69] generic: Mangle bootloader's kernel arguments - -The command-line arguments provided by the boot loader will be -appended to a new device tree property: bootloader-args. -If there is a property "append-rootblock" in DT under /chosen -and a root= option in bootloaders command line it will be parsed -and added to DT bootargs with the form: XX. -Only command line ATAG will be processed, the rest of the ATAGs -sent by bootloader will be ignored. -This is usefull in dual boot systems, to get the current root partition -without afecting the rest of the system. - -Signed-off-by: Adrian Panella - -This patch has been modified to be mvebu specific. The original patch -did not pass the bootloader cmdline on if no append-rootblock stanza -was found, resulting in blank cmdline and failure to boot. - -Signed-off-by: Michael Gray ---- - arch/arm/Kconfig | 11 ++++ - arch/arm/boot/compressed/atags_to_fdt.c | 85 ++++++++++++++++++++++++- - init/main.c | 16 +++++ - 3 files changed, 111 insertions(+), 1 deletion(-) - ---- a/arch/arm/Kconfig -+++ b/arch/arm/Kconfig -@@ -1503,6 +1503,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN - The command-line arguments provided by the boot loader will be - appended to the the device tree bootargs property. - -+config ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE -+ bool "Append rootblock parsing bootloader's kernel arguments" -+ help -+ The command-line arguments provided by the boot loader will be -+ appended to a new device tree property: bootloader-args. -+ If there is a property "append-rootblock" in DT under /chosen -+ and a root= option in bootloaders command line it will be parsed -+ and added to DT bootargs with the form: XX. -+ Only command line ATAG will be processed, the rest of the ATAGs -+ sent by bootloader will be ignored. -+ - endchoice - - config CMDLINE ---- a/arch/arm/boot/compressed/atags_to_fdt.c -+++ b/arch/arm/boot/compressed/atags_to_fdt.c -@@ -6,6 +6,8 @@ - - #if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND) - #define do_extend_cmdline 1 -+#elif defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE) -+#define do_extend_cmdline 1 - #else - #define do_extend_cmdline 0 - #endif -@@ -21,6 +23,7 @@ static int node_offset(void *fdt, const - return offset; - } - -+#ifndef CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE - static int setprop(void *fdt, const char *node_path, const char *property, - void *val_array, int size) - { -@@ -29,6 +32,7 @@ static int setprop(void *fdt, const char - return offset; - return fdt_setprop(fdt, offset, property, val_array, size); - } -+#endif - - static int setprop_string(void *fdt, const char *node_path, - const char *property, const char *string) -@@ -39,6 +43,7 @@ static int setprop_string(void *fdt, con - return fdt_setprop_string(fdt, offset, property, string); - } - -+#ifndef CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE - static int setprop_cell(void *fdt, const char *node_path, - const char *property, uint32_t val) - { -@@ -47,6 +52,7 @@ static int setprop_cell(void *fdt, const - return offset; - return fdt_setprop_cell(fdt, offset, property, val); - } -+#endif - - static const void *getprop(const void *fdt, const char *node_path, - const char *property, int *len) -@@ -59,6 +65,7 @@ static const void *getprop(const void *f - return fdt_getprop(fdt, offset, property, len); - } - -+#ifndef CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE - static uint32_t get_cell_size(const void *fdt) - { - int len; -@@ -70,6 +77,74 @@ static uint32_t get_cell_size(const void - return cell_size; - } - -+#endif -+ -+#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE) -+ -+static char *append_rootblock(char *dest, const char *str, int len, void *fdt) -+{ -+ const char *ptr, *end; -+ const char *root="root="; -+ int i, l; -+ const char *rootblock; -+ -+ //ARM doesn't have __HAVE_ARCH_STRSTR, so search manually -+ ptr = str - 1; -+ -+ do { -+ //first find an 'r' at the begining or after a space -+ do { -+ ptr++; -+ ptr = strchr(ptr, 'r'); -+ if (!ptr) -+ goto no_append; -+ -+ } while (ptr != str && *(ptr-1) != ' '); -+ -+ //then check for the rest -+ for(i = 1; i <= 4; i++) -+ if(*(ptr+i) != *(root+i)) break; -+ -+ } while (i != 5); -+ -+ end = strchr(ptr, ' '); -+ end = end ? (end - 1) : (strchr(ptr, 0) - 1); -+ -+ //find partition number (assumes format root=/dev/mtdXX | /dev/mtdblockXX | yy:XX ) -+ for( i = 0; end >= ptr && *end >= '0' && *end <= '9'; end--, i++); -+ ptr = end + 1; -+ -+ /* if append-rootblock property is set use it to append to command line */ -+ rootblock = getprop(fdt, "/chosen", "append-rootblock", &l); -+ if (rootblock == NULL) -+ goto no_append; -+ -+ if (*dest != ' ') { -+ *dest = ' '; -+ dest++; -+ len++; -+ } -+ -+ if (len + l + i <= COMMAND_LINE_SIZE) { -+ memcpy(dest, rootblock, l); -+ dest += l - 1; -+ memcpy(dest, ptr, i); -+ dest += i; -+ } -+ -+ return dest; -+ -+no_append: -+ len = strlen(str); -+ if (len + 1 < COMMAND_LINE_SIZE) { -+ memcpy(dest, str, len); -+ dest += len; -+ } -+ -+ return dest; -+} -+#endif -+ - static void merge_fdt_bootargs(void *fdt, const char *fdt_cmdline) - { - char cmdline[COMMAND_LINE_SIZE]; -@@ -89,18 +164,28 @@ static void merge_fdt_bootargs(void *fdt - - /* and append the ATAG_CMDLINE */ - if (fdt_cmdline) { -+ -+#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE) -+ //save original bootloader args -+ //and append ubi.mtd with root partition number to current cmdline -+ setprop_string(fdt, "/chosen", "bootloader-args", fdt_cmdline); -+ ptr = append_rootblock(ptr, fdt_cmdline, len, fdt); -+ -+#else - len = strlen(fdt_cmdline); - if (ptr - cmdline + len + 2 < COMMAND_LINE_SIZE) { - *ptr++ = ' '; - memcpy(ptr, fdt_cmdline, len); - ptr += len; - } -+#endif - } - *ptr = '\0'; - - setprop_string(fdt, "/chosen", "bootargs", cmdline); - } - -+#ifndef CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE - static void hex_str(char *out, uint32_t value) - { - uint32_t digit; -@@ -118,6 +203,7 @@ static void hex_str(char *out, uint32_t - } - *out = '\0'; - } -+#endif - - /* - * Convert and fold provided ATAGs into the provided FDT. -@@ -132,9 +218,11 @@ int atags_to_fdt(void *atag_list, void * - struct tag *atag = atag_list; - /* In the case of 64 bits memory size, need to reserve 2 cells for - * address and size for each bank */ -+#ifndef CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE - __be32 mem_reg_property[2 * 2 * NR_BANKS]; -- int memcount = 0; -- int ret, memsize; -+ int memsize, memcount = 0; -+#endif -+ int ret; - - /* make sure we've got an aligned pointer */ - if ((u32)atag_list & 0x3) -@@ -169,7 +257,9 @@ int atags_to_fdt(void *atag_list, void * - else - setprop_string(fdt, "/chosen", "bootargs", - atag->u.cmdline.cmdline); -- } else if (atag->hdr.tag == ATAG_MEM) { -+ } -+#ifndef CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE -+ else if (atag->hdr.tag == ATAG_MEM) { - if (memcount >= sizeof(mem_reg_property)/4) - continue; - if (!atag->u.mem.size) -@@ -213,6 +303,10 @@ int atags_to_fdt(void *atag_list, void * - setprop(fdt, "/memory", "reg", mem_reg_property, - 4 * memcount * memsize); - } -+#else -+ -+ } -+#endif - - return fdt_pack(fdt); - } ---- a/init/main.c -+++ b/init/main.c -@@ -114,6 +114,10 @@ - - #include - -+#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE) -+#include -+#endif -+ - static int kernel_init(void *); - - /* -@@ -971,6 +975,18 @@ void start_kernel(void) - boot_cpu_hotplug_init(); - - pr_notice("Kernel command line: %s\n", saved_command_line); -+ -+#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE) -+ //Show bootloader's original command line for reference -+ if(of_chosen) { -+ const char *prop = of_get_property(of_chosen, "bootloader-args", NULL); -+ if(prop) -+ pr_notice("Bootloader command line (ignored): %s\n", prop); -+ else -+ pr_notice("Bootloader command line not present\n"); -+ } -+#endif -+ - /* parameters may set static keys */ - parse_early_param(); - after_dashes = parse_args("Booting kernel", diff --git a/target/linux/mvebu/patches-6.12/301-mvebu-armada-38x-enable-libata-leds.patch b/target/linux/mvebu/patches-6.12/301-mvebu-armada-38x-enable-libata-leds.patch deleted file mode 100644 index b75dcf596a..0000000000 --- a/target/linux/mvebu/patches-6.12/301-mvebu-armada-38x-enable-libata-leds.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/arch/arm/mach-mvebu/Kconfig -+++ b/arch/arm/mach-mvebu/Kconfig -@@ -66,6 +66,7 @@ config MACH_ARMADA_38X - select HAVE_ARM_TWD if SMP - select MACH_MVEBU_V7 - select PINCTRL_ARMADA_38X -+ select ARCH_WANT_LIBATA_LEDS - help - Say 'Y' here if you want your kernel to support boards based - on the Marvell Armada 380/385 SoC with device tree. diff --git a/target/linux/mvebu/patches-6.12/302-add_powertables.patch b/target/linux/mvebu/patches-6.12/302-add_powertables.patch deleted file mode 100644 index 19e6a5132e..0000000000 --- a/target/linux/mvebu/patches-6.12/302-add_powertables.patch +++ /dev/null @@ -1,770 +0,0 @@ ---- a/arch/arm/boot/dts/marvell/armada-385-linksys.dtsi -+++ b/arch/arm/boot/dts/marvell/armada-385-linksys.dtsi -@@ -212,11 +212,19 @@ - &pcie1 { - /* Marvell 88W8864, 5GHz-only */ - status = "okay"; -+ -+ mwlwifi { -+ marvell,2ghz = <0>; -+ }; - }; - - &pcie2 { - /* Marvell 88W8864, 2GHz-only */ - status = "okay"; -+ -+ mwlwifi { -+ marvell,5ghz = <0>; -+ }; - }; - - &pinctrl { ---- a/arch/arm/boot/dts/marvell/armada-385-linksys-caiman.dts -+++ b/arch/arm/boot/dts/marvell/armada-385-linksys-caiman.dts -@@ -142,3 +142,205 @@ - }; - }; - }; -+ -+&pcie1 { -+ mwlwifi { -+ marvell,chainmask = <2 2>; -+ marvell,powertable { -+ AU = -+ <36 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <40 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <44 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <48 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <52 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <56 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <60 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <64 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <100 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>, -+ <104 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>, -+ <108 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>, -+ <112 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>, -+ <116 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>, -+ <120 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>, -+ <124 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>, -+ <128 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>, -+ <132 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>, -+ <136 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>, -+ <140 0 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x15 0x17 0x17 0x17 0x14 0x17 0x17 0x17 0x14 0 0xf>, -+ <149 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>, -+ <153 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>, -+ <157 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>, -+ <161 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>, -+ <165 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x1a 0x1a 0x17 0x14 0 0xf>; -+ CA = -+ <36 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0 0xf>, -+ <40 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0 0xf>, -+ <44 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0 0xf>, -+ <48 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0 0xf>, -+ <52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <149 0 0x1a 0x1a 0x18 0x17 0x19 0x19 0x17 0x15 0x18 0x18 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>, -+ <153 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>, -+ <157 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>, -+ <161 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>, -+ <165 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>; -+ CN = -+ <36 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <40 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <44 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <48 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <52 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <56 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <60 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <64 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <100 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <104 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <108 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <112 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <116 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <120 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <124 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <128 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <132 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <136 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <140 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <149 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x11 0x11 0x11 0x11 0 0xf>, -+ <153 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0 0xf>, -+ <157 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0 0xf>, -+ <161 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0 0xf>, -+ <165 0 0x15 0x15 0x15 0x15 0x16 0x16 0x16 0x15 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0 0xf>; -+ ETSI = -+ <36 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <40 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <44 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <48 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <52 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <56 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <60 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <64 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <100 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <104 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <108 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <112 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <116 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <120 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <124 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <128 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <132 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <136 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <140 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>, -+ <149 0 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0 0xf>; -+ FCC = -+ <36 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <40 0 0x19 0x19 0x18 0x17 0x19 0x19 0x17 0x15 0x17 0x17 0x17 0x14 0x10 0x10 0x10 0x10 0 0xf>, -+ <44 0 0x19 0x19 0x18 0x17 0x19 0x19 0x17 0x15 0x17 0x17 0x17 0x14 0x10 0x10 0x10 0x10 0 0xf>, -+ <48 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x17 0x17 0x17 0x14 0x10 0x10 0x10 0x10 0 0xf>, -+ <52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <149 0 0x1a 0x1a 0x18 0x17 0x19 0x19 0x17 0x15 0x18 0x18 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>, -+ <153 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>, -+ <157 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>, -+ <161 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>, -+ <165 0 0x1a 0x1a 0x18 0x17 0x1a 0x1a 0x17 0x15 0x1a 0x1a 0x17 0x14 0x15 0x15 0x15 0x14 0 0xf>; -+ }; -+ }; -+}; -+ -+&pcie2 { -+ mwlwifi { -+ marvell,chainmask = <2 2>; -+ marvell,powertable { -+ AU = -+ <1 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <2 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <3 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <4 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <5 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <6 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <7 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <8 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <9 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <10 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <11 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>; -+ CA = -+ <1 0 0x19 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x10 0x10 0x10 0x10 0x00 0x00 0x00 0x00 0 0xf>, -+ <2 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>, -+ <3 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>, -+ <4 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>, -+ <5 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>, -+ <6 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>, -+ <7 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>, -+ <8 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>, -+ <9 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>, -+ <10 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x00 0x00 0x00 0x00 0 0xf>, -+ <11 0 0x19 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x00 0x00 0x00 0x00 0 0xf>; -+ CN = -+ <1 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <2 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <3 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <4 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <5 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <6 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <7 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <8 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <9 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <10 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <11 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <12 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <13 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <14 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>; -+ ETSI = -+ <1 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <2 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <3 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <4 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <5 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <6 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <7 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <8 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <9 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <10 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <11 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <12 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>, -+ <13 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0x0 0x0 0x0 0x0 0 0xf>; -+ FCC = -+ <1 0 0x19 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>, -+ <2 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>, -+ <3 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>, -+ <4 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>, -+ <5 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>, -+ <6 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>, -+ <7 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>, -+ <8 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>, -+ <9 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>, -+ <10 0 0x1a 0x19 0x18 0x17 0x19 0x19 0x17 0x16 0x14 0x14 0x14 0x14 0x0 0x0 0x0 0x0 0 0xf>, -+ <11 0 0x19 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x0 0x0 0x0 0x0 0 0xf>; -+ }; -+ }; -+}; ---- a/arch/arm/boot/dts/marvell/armada-385-linksys-cobra.dts -+++ b/arch/arm/boot/dts/marvell/armada-385-linksys-cobra.dts -@@ -142,3 +142,205 @@ - }; - }; - }; -+ -+&pcie1 { -+ mwlwifi { -+ marvell,chainmask = <4 4>; -+ marvell,powertable { -+ AU = -+ <36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <100 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <104 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <108 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <112 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <116 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <120 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <124 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <128 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <132 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <136 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <140 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <149 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>, -+ <153 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>, -+ <157 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>, -+ <161 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>, -+ <165 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>; -+ CA = -+ <36 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>, -+ <40 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>, -+ <44 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>, -+ <48 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>, -+ <52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <149 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, -+ <153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, -+ <157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, -+ <161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, -+ <165 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>; -+ CN = -+ <36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <100 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <104 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <108 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <112 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <116 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <120 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <124 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <128 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <132 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <136 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <140 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <149 0 0x14 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>, -+ <157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>, -+ <161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>, -+ <165 0 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>; -+ ETSI = -+ <36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <100 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <104 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <108 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <112 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <116 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <120 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <124 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <128 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <132 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <136 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <140 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <149 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>; -+ FCC = -+ <36 0 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0 0xf>, -+ <40 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>, -+ <44 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>, -+ <48 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>, -+ <52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <149 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, -+ <153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, -+ <157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, -+ <161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, -+ <165 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>; -+ }; -+ }; -+}; -+ -+&pcie2 { -+ mwlwifi { -+ marvell,chainmask = <4 4>; -+ marvell,powertable { -+ AU = -+ <1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>; -+ CA = -+ <1 0 0x17 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0xe 0xe 0xe 0xe 0x0 0x0 0x0 0x0 0 0xf>, -+ <2 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <3 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <4 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <5 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <6 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <7 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <8 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <9 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <10 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <11 0 0x17 0x12 0x12 0x12 0x13 0x13 0x13 0x13 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>; -+ CN = -+ <1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <12 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <13 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <14 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>; -+ ETSI = -+ <1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <12 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <13 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>; -+ FCC = -+ <1 0 0x17 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0xe 0xe 0xe 0xe 0x0 0x0 0x0 0x0 0 0xf>, -+ <2 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <3 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <4 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <5 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <6 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <7 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <8 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <9 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <10 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <11 0 0x17 0x12 0x12 0x12 0x13 0x13 0x13 0x13 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>; -+ }; -+ }; -+}; ---- a/arch/arm/boot/dts/marvell/armada-385-linksys-shelby.dts -+++ b/arch/arm/boot/dts/marvell/armada-385-linksys-shelby.dts -@@ -142,3 +142,205 @@ - }; - }; - }; -+ -+&pcie1 { -+ mwlwifi { -+ marvell,chainmask = <4 4>; -+ marvell,powertable { -+ AU = -+ <36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <100 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <104 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <108 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <112 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <116 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <120 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <124 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <128 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <132 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <136 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <140 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <149 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>, -+ <153 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>, -+ <157 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>, -+ <161 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>, -+ <165 0 0x19 0x19 0x19 0x17 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0x19 0x19 0x16 0x15 0 0xf>; -+ CA = -+ <36 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>, -+ <40 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>, -+ <44 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>, -+ <48 0 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>, -+ <52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <149 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, -+ <153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, -+ <157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, -+ <161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, -+ <165 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>; -+ CN = -+ <36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <100 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <104 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <108 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <112 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <116 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <120 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <124 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <128 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <132 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <136 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <140 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <149 0 0x14 0x14 0x14 0x14 0x13 0x13 0x13 0x13 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>, -+ <157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>, -+ <161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>, -+ <165 0 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x14 0x14 0x14 0x14 0x10 0x10 0x10 0x10 0 0xf>; -+ ETSI = -+ <36 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <40 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <44 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <48 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <52 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <56 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <60 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <64 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <100 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <104 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <108 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <112 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <116 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <120 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <124 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <128 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <132 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <136 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <140 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>, -+ <149 0 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xd 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0xe 0 0xf>; -+ FCC = -+ <36 0 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0 0xf>, -+ <40 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>, -+ <44 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>, -+ <48 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0xf 0xf 0xf 0xf 0 0xf>, -+ <52 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <56 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <60 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <64 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <100 0 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <104 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0 0xf>, -+ <108 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <112 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <116 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <120 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <124 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <128 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <132 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <136 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <140 0 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0 0xf>, -+ <149 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, -+ <153 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, -+ <157 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, -+ <161 0 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>, -+ <165 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0 0xf>; -+ }; -+ }; -+}; -+ -+&pcie2 { -+ mwlwifi { -+ marvell,chainmask = <4 4>; -+ marvell,powertable { -+ AU = -+ <1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>; -+ CA = -+ <1 0 0x17 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0xe 0xe 0xe 0xe 0x0 0x0 0x0 0x0 0 0xf>, -+ <2 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <3 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <4 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <5 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <6 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <7 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <8 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <9 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <10 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <11 0 0x17 0x12 0x12 0x12 0x13 0x13 0x13 0x13 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>; -+ CN = -+ <1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <12 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <13 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <14 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>; -+ ETSI = -+ <1 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <2 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <3 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <4 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <5 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <6 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <7 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <8 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <9 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <10 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <11 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <12 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>, -+ <13 0 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0xa 0x0 0x0 0x0 0x0 0 0xf>; -+ FCC = -+ <1 0 0x17 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0xe 0xe 0xe 0xe 0x0 0x0 0x0 0x0 0 0xf>, -+ <2 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <3 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <4 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <5 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <6 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <7 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <8 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <9 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <10 0 0x18 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x11 0x11 0x11 0x11 0x0 0x0 0x0 0x0 0 0xf>, -+ <11 0 0x17 0x12 0x12 0x12 0x13 0x13 0x13 0x13 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>; -+ }; -+ }; -+}; ---- a/arch/arm/boot/dts/marvell/armada-385-linksys-rango.dts -+++ b/arch/arm/boot/dts/marvell/armada-385-linksys-rango.dts -@@ -157,6 +157,18 @@ - }; - }; - -+&pcie1 { -+ mwlwifi { -+ marvell,chainmask = <4 4>; -+ }; -+}; -+ -+&pcie2 { -+ mwlwifi { -+ marvell,chainmask = <4 4>; -+ }; -+}; -+ - &sdhci { - pinctrl-names = "default"; - pinctrl-0 = <&sdhci_pins>; ---- a/arch/arm/boot/dts/marvell/armada-xp-linksys-mamba.dts -+++ b/arch/arm/boot/dts/marvell/armada-xp-linksys-mamba.dts -@@ -223,12 +223,100 @@ - pcie@2,0 { - /* Port 0, Lane 1 */ - status = "okay"; -+ -+ mwlwifi { -+ marvell,5ghz = <0>; -+ marvell,chainmask = <4 4>; -+ marvell,powertable { -+ FCC = -+ <1 0 0x17 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0xf 0xf 0xf 0xf 0x0 0x0 0x0 0x0 0 0xf>, -+ <2 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>, -+ <3 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>, -+ <4 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>, -+ <5 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>, -+ <6 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>, -+ <7 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>, -+ <8 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>, -+ <9 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>, -+ <10 0 0x17 0x16 0x16 0x16 0x16 0x16 0x16 0x14 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>, -+ <11 0 0x17 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x10 0x10 0x10 0x10 0x0 0x0 0x0 0x0 0 0xf>; -+ -+ ETSI = -+ <1 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>, -+ <2 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>, -+ <3 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>, -+ <4 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>, -+ <5 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>, -+ <6 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>, -+ <7 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>, -+ <8 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>, -+ <9 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>, -+ <10 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>, -+ <11 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>, -+ <12 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>, -+ <13 0 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0xb 0x0 0x0 0x0 0x0 0 0xf>; -+ }; -+ }; - }; - - /* Second mini-PCIe port */ - pcie@3,0 { - /* Port 0, Lane 3 */ - status = "okay"; -+ -+ mwlwifi { -+ marvell,2ghz = <0>; -+ marvell,chainmask = <4 4>; -+ marvell,powertable { -+ FCC = -+ <36 0 0x8 0x8 0x8 0x8 0x8 0x8 0x8 0x8 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>, -+ <40 0 0x8 0x8 0x8 0x8 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>, -+ <44 0 0x8 0x8 0x8 0x8 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>, -+ <48 0 0x8 0x8 0x8 0x8 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0x9 0 0xf>, -+ <52 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0 0xf>, -+ <56 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0 0xf>, -+ <60 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0 0xf>, -+ <64 0 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0xf 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0 0xf>, -+ <100 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <104 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <108 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <112 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <116 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <120 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <124 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <128 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <132 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <136 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <140 0 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0 0xf>, -+ <149 0 0x16 0x16 0x16 0x16 0x14 0x14 0x14 0x14 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>, -+ <153 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>, -+ <157 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>, -+ <161 0 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>, -+ <165 0 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x15 0x15 0x15 0x15 0x14 0x14 0x14 0x14 0 0xf>; -+ -+ ETSI = -+ <36 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, -+ <40 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, -+ <44 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, -+ <48 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, -+ <52 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, -+ <56 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, -+ <60 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, -+ <64 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, -+ <100 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, -+ <104 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, -+ <108 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, -+ <112 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, -+ <116 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, -+ <120 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, -+ <124 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, -+ <128 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, -+ <132 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, -+ <136 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, -+ <140 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>, -+ <149 0 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xc 0xd 0xd 0xd 0xd 0xc 0xc 0xc 0xc 0 0xf>; -+ }; -+ }; - }; - }; - diff --git a/target/linux/mvebu/patches-6.12/304-revert_i2c_delay.patch b/target/linux/mvebu/patches-6.12/304-revert_i2c_delay.patch deleted file mode 100644 index 3802b0f16e..0000000000 --- a/target/linux/mvebu/patches-6.12/304-revert_i2c_delay.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/arch/arm/boot/dts/marvell/armada-xp.dtsi -+++ b/arch/arm/boot/dts/marvell/armada-xp.dtsi -@@ -237,12 +237,10 @@ - }; - - &i2c0 { -- compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c"; - reg = <0x11000 0x100>; - }; - - &i2c1 { -- compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c"; - reg = <0x11100 0x100>; - }; - diff --git a/target/linux/mvebu/patches-6.12/305-armada-385-rd-mtd-partitions.patch b/target/linux/mvebu/patches-6.12/305-armada-385-rd-mtd-partitions.patch deleted file mode 100644 index 6fd4fa0e20..0000000000 --- a/target/linux/mvebu/patches-6.12/305-armada-385-rd-mtd-partitions.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/arch/arm/boot/dts/marvell/armada-388-rd.dts -+++ b/arch/arm/boot/dts/marvell/armada-388-rd.dts -@@ -103,6 +103,16 @@ - compatible = "st,m25p128", "jedec,spi-nor"; - reg = <0>; /* Chip select 0 */ - spi-max-frequency = <108000000>; -+ -+ partition@0 { -+ label = "uboot"; -+ reg = <0 0x400000>; -+ }; -+ -+ partition@1 { -+ label = "firmware"; -+ reg = <0x400000 0xc00000>; -+ }; - }; - }; - diff --git a/target/linux/mvebu/patches-6.12/306-ARM-mvebu-385-ap-Add-partitions.patch b/target/linux/mvebu/patches-6.12/306-ARM-mvebu-385-ap-Add-partitions.patch deleted file mode 100644 index fbdab2fb94..0000000000 --- a/target/linux/mvebu/patches-6.12/306-ARM-mvebu-385-ap-Add-partitions.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 9861f93a59142a3131870df2521eb2deb73026d7 Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Tue, 13 Jan 2015 11:14:09 +0100 -Subject: [PATCH 2/2] ARM: mvebu: 385-ap: Add partitions - -Signed-off-by: Maxime Ripard ---- - arch/arm/boot/dts/marvell/armada-385-db-ap.dts | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/arch/arm/boot/dts/marvell/armada-385-db-ap.dts -+++ b/arch/arm/boot/dts/marvell/armada-385-db-ap.dts -@@ -218,19 +218,19 @@ - #size-cells = <1>; - - partition@0 { -- label = "U-Boot"; -+ label = "u-boot"; - reg = <0x00000000 0x00800000>; - read-only; - }; - - partition@800000 { -- label = "uImage"; -+ label = "kernel"; - reg = <0x00800000 0x00400000>; - read-only; - }; - - partition@c00000 { -- label = "Root"; -+ label = "ubi"; - reg = <0x00c00000 0x3f400000>; - }; - }; diff --git a/target/linux/mvebu/patches-6.12/307-armada-xp-linksys-mamba-broken-idle.patch b/target/linux/mvebu/patches-6.12/307-armada-xp-linksys-mamba-broken-idle.patch deleted file mode 100644 index fd329d41ce..0000000000 --- a/target/linux/mvebu/patches-6.12/307-armada-xp-linksys-mamba-broken-idle.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/arch/arm/boot/dts/marvell/armada-xp-linksys-mamba.dts -+++ b/arch/arm/boot/dts/marvell/armada-xp-linksys-mamba.dts -@@ -481,3 +481,7 @@ - }; - }; - }; -+ -+&coherencyfab { -+ broken-idle; -+}; diff --git a/target/linux/mvebu/patches-6.12/308-armada-xp-linksys-mamba-wan.patch b/target/linux/mvebu/patches-6.12/308-armada-xp-linksys-mamba-wan.patch deleted file mode 100644 index c1f47ee15a..0000000000 --- a/target/linux/mvebu/patches-6.12/308-armada-xp-linksys-mamba-wan.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/arch/arm/boot/dts/marvell/armada-xp-linksys-mamba.dts -+++ b/arch/arm/boot/dts/marvell/armada-xp-linksys-mamba.dts -@@ -383,7 +383,7 @@ - - ethernet-port@4 { - reg = <4>; -- label = "internet"; -+ label = "wan"; - }; - - ethernet-port@5 { diff --git a/target/linux/mvebu/patches-6.12/309-linksys-status-led.patch b/target/linux/mvebu/patches-6.12/309-linksys-status-led.patch deleted file mode 100644 index 270937a924..0000000000 --- a/target/linux/mvebu/patches-6.12/309-linksys-status-led.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- a/arch/arm/boot/dts/marvell/armada-385-linksys.dtsi -+++ b/arch/arm/boot/dts/marvell/armada-385-linksys.dtsi -@@ -14,6 +14,13 @@ - compatible = "linksys,armada385", "marvell,armada385", - "marvell,armada380"; - -+ aliases { -+ led-boot = &led_power; -+ led-failsafe = &led_power; -+ led-running = &led_power; -+ led-upgrade = &led_power; -+ }; -+ - chosen { - stdout-path = "serial0:115200n8"; - }; -@@ -71,7 +78,7 @@ - pinctrl-0 = <&gpio_leds_pins>; - pinctrl-names = "default"; - -- led-power { -+ led_power: led-power { - gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>; - default-state = "on"; - }; ---- a/arch/arm/boot/dts/marvell/armada-xp-linksys-mamba.dts -+++ b/arch/arm/boot/dts/marvell/armada-xp-linksys-mamba.dts -@@ -26,6 +26,13 @@ - compatible = "linksys,mamba", "marvell,armadaxp-mv78230", - "marvell,armadaxp", "marvell,armada-370-xp"; - -+ aliases { -+ led-boot = &led_power; -+ led-failsafe = &led_power; -+ led-running = &led_power; -+ led-upgrade = &led_power; -+ }; -+ - chosen { - bootargs = "console=ttyS0,115200"; - stdout-path = &uart0; -@@ -195,7 +202,7 @@ - pinctrl-0 = <&power_led_pin>; - pinctrl-names = "default"; - -- led-power { -+ led_power: led-power { - label = "mamba:white:power"; - gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; - default-state = "on"; diff --git a/target/linux/mvebu/patches-6.12/310-linksys-use-eth0-as-cpu-port.patch b/target/linux/mvebu/patches-6.12/310-linksys-use-eth0-as-cpu-port.patch deleted file mode 100644 index 925149a3f4..0000000000 --- a/target/linux/mvebu/patches-6.12/310-linksys-use-eth0-as-cpu-port.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- a/arch/arm/boot/dts/marvell/armada-385-linksys.dtsi -+++ b/arch/arm/boot/dts/marvell/armada-385-linksys.dtsi -@@ -116,7 +116,7 @@ - }; - - ð2 { -- status = "okay"; -+ status = "disabled"; - phy-mode = "sgmii"; - buffer-manager = <&bm>; - bm,pool-long = <2>; -@@ -198,10 +198,10 @@ - label = "wan"; - }; - -- ethernet-port@5 { -- reg = <5>; -+ ethernet-port@6 { -+ reg = <6>; - phy-mode = "sgmii"; -- ethernet = <ð2>; -+ ethernet = <ð0>; - - fixed-link { - speed = <1000>; diff --git a/target/linux/mvebu/patches-6.12/311-adjust-compatible-for-linksys.patch b/target/linux/mvebu/patches-6.12/311-adjust-compatible-for-linksys.patch deleted file mode 100644 index 6722248df7..0000000000 --- a/target/linux/mvebu/patches-6.12/311-adjust-compatible-for-linksys.patch +++ /dev/null @@ -1,68 +0,0 @@ ---- a/arch/arm/boot/dts/marvell/armada-385-linksys-rango.dts -+++ b/arch/arm/boot/dts/marvell/armada-385-linksys-rango.dts -@@ -12,8 +12,8 @@ - - / { - model = "Linksys WRT3200ACM"; -- compatible = "linksys,rango", "linksys,armada385", "marvell,armada385", -- "marvell,armada380"; -+ compatible = "linksys,wrt3200acm", "linksys,rango", "linksys,armada385", -+ "marvell,armada385", "marvell,armada380"; - }; - - &expander0 { ---- a/arch/arm/boot/dts/marvell/armada-xp-linksys-mamba.dts -+++ b/arch/arm/boot/dts/marvell/armada-xp-linksys-mamba.dts -@@ -22,9 +22,10 @@ - #include "armada-xp-mv78230.dtsi" - - / { -- model = "Linksys WRT1900AC"; -- compatible = "linksys,mamba", "marvell,armadaxp-mv78230", -- "marvell,armadaxp", "marvell,armada-370-xp"; -+ model = "Linksys WRT1900AC v1"; -+ compatible = "linksys,wrt1900ac-v1", "linksys,mamba", -+ "marvell,armadaxp-mv78230", "marvell,armadaxp", -+ "marvell,armada-370-xp"; - - aliases { - led-boot = &led_power; ---- a/arch/arm/boot/dts/marvell/armada-385-linksys-cobra.dts -+++ b/arch/arm/boot/dts/marvell/armada-385-linksys-cobra.dts -@@ -9,8 +9,9 @@ - #include "armada-385-linksys.dtsi" - - / { -- model = "Linksys WRT1900ACv2"; -- compatible = "linksys,cobra", "linksys,armada385", "marvell,armada385", -+ model = "Linksys WRT1900AC v2"; -+ compatible = "linksys,wrt1900ac-v2", "linksys,cobra", -+ "linksys,armada385", "marvell,armada385", - "marvell,armada380"; - }; - ---- a/arch/arm/boot/dts/marvell/armada-385-linksys-caiman.dts -+++ b/arch/arm/boot/dts/marvell/armada-385-linksys-caiman.dts -@@ -10,8 +10,8 @@ - - / { - model = "Linksys WRT1200AC"; -- compatible = "linksys,caiman", "linksys,armada385", "marvell,armada385", -- "marvell,armada380"; -+ compatible = "linksys,wrt1200ac", "linksys,caiman", "linksys,armada385", -+ "marvell,armada385", "marvell,armada380"; - }; - - &expander0 { ---- a/arch/arm/boot/dts/marvell/armada-385-linksys-shelby.dts -+++ b/arch/arm/boot/dts/marvell/armada-385-linksys-shelby.dts -@@ -10,7 +10,8 @@ - - / { - model = "Linksys WRT1900ACS"; -- compatible = "linksys,shelby", "linksys,armada385", "marvell,armada385", -+ compatible = "linksys,wrt1900acs", "linksys,shelby", -+ "linksys,armada385", "marvell,armada385", - "marvell,armada380"; - }; - diff --git a/target/linux/mvebu/patches-6.12/312-ARM-dts-armada388-clearfog-emmc-on-clearfog-base.patch b/target/linux/mvebu/patches-6.12/312-ARM-dts-armada388-clearfog-emmc-on-clearfog-base.patch deleted file mode 100644 index 5f84a34769..0000000000 --- a/target/linux/mvebu/patches-6.12/312-ARM-dts-armada388-clearfog-emmc-on-clearfog-base.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 8137da20701c776ad3481115305a5e8e410871ba Mon Sep 17 00:00:00 2001 -From: Russell King -Date: Tue, 29 Nov 2016 10:15:45 +0000 -Subject: ARM: dts: armada388-clearfog: emmc on clearfog base - -Signed-off-by: Russell King ---- - .../arm/boot/dts/marvell/armada-388-clearfog-base.dts | 1 + - .../armada-38x-solidrun-microsom-emmc.dtsi | 62 +++++++++++++++++++ - 2 files changed, 63 insertions(+) - create mode 100644 arch/arm/boot/dts/marvell/armada-38x-solidrun-microsom-emmc.dtsi - ---- a/arch/arm/boot/dts/marvell/armada-388-clearfog-base.dts -+++ b/arch/arm/boot/dts/marvell/armada-388-clearfog-base.dts -@@ -7,6 +7,7 @@ - - /dts-v1/; - #include "armada-388-clearfog.dtsi" -+#include "armada-38x-solidrun-microsom-emmc.dtsi" - - / { - model = "SolidRun Clearfog Base A1"; ---- /dev/null -+++ b/arch/arm/boot/dts/marvell/armada-38x-solidrun-microsom-emmc.dtsi -@@ -0,0 +1,62 @@ -+/* -+ * Device Tree file for SolidRun Armada 38x Microsom add-on for eMMC -+ * -+ * Copyright (C) 2015 Russell King -+ * -+ * This board is in development; the contents of this file work with -+ * the A1 rev 2.0 of the board, which does not represent final -+ * production board. Things will change, don't expect this file to -+ * remain compatible info the future. -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * version 2 as published by the Free Software Foundation. -+ * -+ * This file is distributed in the hope that it will be useful -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+/ { -+ soc { -+ internal-regs { -+ sdhci@d8000 { -+ bus-width = <4>; -+ no-1-8-v; -+ non-removable; -+ pinctrl-0 = <µsom_sdhci_pins>; -+ pinctrl-names = "default"; -+ status = "okay"; -+ wp-inverted; -+ }; -+ }; -+ }; -+}; diff --git a/target/linux/mvebu/patches-6.12/313-helios4-dts-status-led-alias.patch b/target/linux/mvebu/patches-6.12/313-helios4-dts-status-led-alias.patch deleted file mode 100644 index 50b970aabb..0000000000 --- a/target/linux/mvebu/patches-6.12/313-helios4-dts-status-led-alias.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/arch/arm/boot/dts/marvell/armada-388-helios4.dts -+++ b/arch/arm/boot/dts/marvell/armada-388-helios4.dts -@@ -15,6 +15,13 @@ - model = "Helios4"; - compatible = "kobol,helios4", "marvell,armada388", - "marvell,armada385", "marvell,armada380"; -+ -+ aliases { -+ led-boot = &led_status; -+ led-failsafe = &led_status; -+ led-running = &led_status; -+ led-upgrade = &led_status; -+ }; - - memory { - device_type = "memory"; -@@ -73,10 +80,9 @@ - pinctrl-names = "default"; - pinctrl-0 = <&helios_system_led_pins>; - -- status-led { -+ led_status: status-led { - label = "helios4:green:status"; - gpios = <&gpio0 24 GPIO_ACTIVE_LOW>; -- linux,default-trigger = "heartbeat"; - default-state = "on"; - }; - diff --git a/target/linux/mvebu/patches-6.12/314-arm64-dts-marvell-enable-heartbeat-LED-by-default.patch b/target/linux/mvebu/patches-6.12/314-arm64-dts-marvell-enable-heartbeat-LED-by-default.patch deleted file mode 100644 index 7221e04de1..0000000000 --- a/target/linux/mvebu/patches-6.12/314-arm64-dts-marvell-enable-heartbeat-LED-by-default.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Tomasz Maciej Nowak -Date: Fri, 7 Jul 2023 19:06:05 +0200 -Subject: [PATCH] arm64: dts: marvell: enable heartbeat LED by default - -Some boards could be placed in an enclosure, so enable LED18 by default, -since that'll be the only visible indicator that the board is operating. - -Signed-off-by: Tomasz Maciej Nowak ---- - arch/arm64/boot/dts/marvell/armada-8040-mcbin-singleshot.dts | 1 + - 1 file changed, 1 insertion(+) - ---- a/arch/arm64/boot/dts/marvell/armada-8040-mcbin-singleshot.dts -+++ b/arch/arm64/boot/dts/marvell/armada-8040-mcbin-singleshot.dts -@@ -25,6 +25,7 @@ - function = LED_FUNCTION_HEARTBEAT; - color = ; - linux,default-trigger = "heartbeat"; -+ default-state = "on"; - }; - }; - }; diff --git a/target/linux/mvebu/patches-6.12/315-armada-xp-linksys-mamba-resize-kernel.patch b/target/linux/mvebu/patches-6.12/315-armada-xp-linksys-mamba-resize-kernel.patch deleted file mode 100644 index 21b0dd10a5..0000000000 --- a/target/linux/mvebu/patches-6.12/315-armada-xp-linksys-mamba-resize-kernel.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 258233f00bcd013050efee00c5d9128ef8cd62dd Mon Sep 17 00:00:00 2001 -From: Tad -Date: Fri, 5 Feb 2021 22:32:11 -0500 -Subject: [PATCH] ARM: dts: armada-xp-linksys-mamba: Increase kernel - partition to 4MB - -Signed-off-by: Tad Davanzo ---- - arch/arm/boot/dts/marvell/armada-xp-linksys-mamba.dts | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - ---- a/arch/arm/boot/dts/marvell/armada-xp-linksys-mamba.dts -+++ b/arch/arm/boot/dts/marvell/armada-xp-linksys-mamba.dts -@@ -452,9 +452,9 @@ - reg = <0xa00000 0x2800000>; /* 40MB */ - }; - -- partition@d00000 { -+ partition@e00000 { - label = "rootfs1"; -- reg = <0xd00000 0x2500000>; /* 37MB */ -+ reg = <0xe00000 0x2400000>; /* 36MB */ - }; - - /* kernel2 overlaps with rootfs2 by design */ -@@ -463,9 +463,9 @@ - reg = <0x3200000 0x2800000>; /* 40MB */ - }; - -- partition@3500000 { -+ partition@3600000 { - label = "rootfs2"; -- reg = <0x3500000 0x2500000>; /* 37MB */ -+ reg = <0x3600000 0x2400000>; /* 36MB */ - }; - - /* diff --git a/target/linux/mvebu/patches-6.12/316-armada-370-dts-fix-crypto-engine.patch b/target/linux/mvebu/patches-6.12/316-armada-370-dts-fix-crypto-engine.patch deleted file mode 100644 index 653c2b0a18..0000000000 --- a/target/linux/mvebu/patches-6.12/316-armada-370-dts-fix-crypto-engine.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/arch/arm/boot/dts/marvell/armada-370.dtsi -+++ b/arch/arm/boot/dts/marvell/armada-370.dtsi -@@ -254,7 +254,7 @@ - clocks = <&gateclk 23>; - clock-names = "cesa0"; - marvell,crypto-srams = <&crypto_sram>; -- marvell,crypto-sram-size = <0x7e0>; -+ marvell,crypto-sram-size = <0x800>; - }; - }; - -@@ -275,12 +275,17 @@ - * cpuidle workaround. - */ - idle-sram@0 { -+ status = "disabled"; - reg = <0x0 0x20>; - }; - }; - }; - }; - -+&coherencyfab { -+ broken-idle; -+}; -+ - /* - * Default UART pinctrl setting without RTS/CTS, can be overwritten on - * board level if a different configuration is used. diff --git a/target/linux/mvebu/patches-6.12/320-arm-dts-armada-370-synology-ds213j-mtd-parts.patch b/target/linux/mvebu/patches-6.12/320-arm-dts-armada-370-synology-ds213j-mtd-parts.patch deleted file mode 100644 index 83193fa7df..0000000000 --- a/target/linux/mvebu/patches-6.12/320-arm-dts-armada-370-synology-ds213j-mtd-parts.patch +++ /dev/null @@ -1,134 +0,0 @@ ---- a/arch/arm/boot/dts/marvell/armada-370-synology-ds213j.dts -+++ b/arch/arm/boot/dts/marvell/armada-370-synology-ds213j.dts -@@ -31,6 +31,7 @@ - - chosen { - stdout-path = "serial0:115200n8"; -+ append-rootblock = "nullparameter="; /* override the bootloader args */ - }; - - memory@0 { -@@ -94,6 +95,8 @@ - status = "okay"; - phy = <&phy1>; - phy-mode = "sgmii"; -+ nvmem-cells = <&macaddr_vendor_0>; -+ nvmem-cell-names = "mac-address"; - }; - - sata@a0000 { -@@ -175,6 +178,24 @@ - phy1: ethernet-phy@1 { /* Marvell 88E1512 */ - reg = <1>; - }; -+ -+ virtual_flash { -+ compatible = "mtd-concat"; -+ -+ devices = <&mtd_kernel &mtd_gap &mtd_gap2>; -+ -+ partitions { -+ compatible = "fixed-partitions"; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ -+ partition@0 { -+ compatible = "openwrt,uimage", "denx,uimage"; -+ label = "firmware"; -+ reg = <0x0 0x0>; -+ }; -+ }; -+ }; - }; - - &pinctrl { -@@ -259,48 +280,52 @@ - reg = <0>; /* Chip select 0 */ - spi-max-frequency = <20000000>; - -- /* -- * Warning! -- * -- * Synology u-boot uses its compiled-in environment -- * and it seems Synology did not care to change u-boot -- * default configuration in order to allow saving a -- * modified environment at a sensible location. So, -- * if you do a 'saveenv' under u-boot, your modified -- * environment will be saved at 1MB after the start -- * of the flash, i.e. in the middle of the uImage. -- * For that reason, it is strongly advised not to -- * change the default environment, unless you know -- * what you are doing. -- */ -- partition@0 { /* u-boot */ -- label = "RedBoot"; -- reg = <0x00000000 0x000c0000>; /* 768KB */ -- }; -+ partitions { -+ compatible = "fixed-partitions"; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ -+ partition@0 { /* u-boot */ -+ label = "u-boot"; -+ reg = <0x00000000 0x000c0000>; /* 768KB */ -+ read-only; -+ }; - -- partition@c0000 { /* uImage */ -- label = "zImage"; -- reg = <0x000c0000 0x002d0000>; /* 2880KB */ -- }; -+ mtd_gap: partition@c0000 { /* gap */ -+ label = "gap"; -+ reg = <0x000c0000 0x00040000>; /* 256KB */ -+ }; - -- partition@390000 { /* uInitramfs */ -- label = "rd.gz"; -- reg = <0x00390000 0x00440000>; /* 4250KB */ -- }; -+ partition@100000 { /* u-boot-env */ -+ label = "u-boot-env"; -+ reg = <0x00100000 0x00010000>; /* 64KB */ -+ }; - -- partition@7d0000 { /* MAC address and serial number */ -- label = "vendor"; -- reg = <0x007d0000 0x00010000>; /* 64KB */ -- }; -+ mtd_kernel: partition@110000 { -+ label = "kernel"; -+ reg = <0x00110000 0x006c0000>; /* 6912KB */ -+ }; - -- partition@7e0000 { -- label = "RedBoot config"; -- reg = <0x007e0000 0x00010000>; /* 64KB */ -- }; -+ partition@7d0000 { /* MAC address and serial number */ -+ reg = <0x007d0000 0x00010000>; /* 64KB */ -+ label = "vendor"; -+ read-only; -+ -+ nvmem-layout { -+ compatible = "fixed-layout"; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ -+ macaddr_vendor_0: macaddr@0 { -+ reg = <0x0 0x6>; -+ }; -+ }; -+ }; - -- partition@7f0000 { -- label = "FIS directory"; -- reg = <0x007f0000 0x00010000>; /* 64KB */ -+ mtd_gap2: partition@7e0000 { -+ label = "gap2"; -+ reg = <0x007e0000 0x00020000>; /* 128KB */ -+ }; - }; - }; - }; diff --git a/target/linux/mvebu/patches-6.12/321-arm64-dts-marvell-reorder-ethernet-aliases-for-ESPRE.patch b/target/linux/mvebu/patches-6.12/321-arm64-dts-marvell-reorder-ethernet-aliases-for-ESPRE.patch deleted file mode 100644 index 19817f2a25..0000000000 --- a/target/linux/mvebu/patches-6.12/321-arm64-dts-marvell-reorder-ethernet-aliases-for-ESPRE.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 2c80ae23905e16eb0e545d62cb5785faa0776cbd Mon Sep 17 00:00:00 2001 -From: Stefan Kalscheuer -Date: Fri, 15 Aug 2025 14:54:18 +0200 -Subject: [PATCH] arm64: dts: marvell: reorder ethernet aliases for ESPRESSObin - Ultra - -Reorder aliases, so "ethernet[1-5] = &switch0port[1-5]" are aligned -insead of overriding ethernet1 to the WAN port (5). - -Signed-off-by: Stefan Kalscheuer ---- - .../dts/marvell/armada-3720-espressobin-ultra.dts | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - ---- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts -+++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts -@@ -16,12 +16,12 @@ - "marvell,armada3720", "marvell,armada3700"; - - aliases { -- /* ethernet1 is WAN port */ -- ethernet1 = &switch0port5; -- ethernet2 = &switch0port1; -- ethernet3 = &switch0port2; -- ethernet4 = &switch0port3; -- ethernet5 = &switch0port4; -+ /* for dsa slave device */ -+ ethernet1 = &switch0port1; -+ ethernet2 = &switch0port2; -+ ethernet3 = &switch0port3; -+ ethernet4 = &switch0port4; -+ ethernet5 = &switch0port5; - }; - - /delete-node/ regulator; diff --git a/target/linux/mvebu/patches-6.12/322-arm64-dts-marvell-specity-phy-mode-2500base-x-for-Me.patch b/target/linux/mvebu/patches-6.12/322-arm64-dts-marvell-specity-phy-mode-2500base-x-for-Me.patch deleted file mode 100644 index c11be8e2e5..0000000000 --- a/target/linux/mvebu/patches-6.12/322-arm64-dts-marvell-specity-phy-mode-2500base-x-for-Me.patch +++ /dev/null @@ -1,29 +0,0 @@ -From cb1103762449c0d8097d58c701a06118e417a50e Mon Sep 17 00:00:00 2001 -From: Stefan Kalscheuer -Date: Fri, 15 Aug 2025 14:48:54 +0200 -Subject: [PATCH] arm64: dts: marvell: specity phy-mode "2500base-x" for - Methode uDPU - -In OpenWRT we used to have a copy of the DTS with "2500base-x" instead -of "sgmii" for both ethernet nodes. Apply this change to the upstream -DTS and omit the full-copy. - -Signed-off-by: Stefan Kalscheuer ---- - arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts | 11 ++++++++++- - 1 file changed, 10 insertions(+), 1 deletion(-) - ---- a/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts -+++ b/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts -@@ -37,6 +37,10 @@ - }; - - ð0 { -- phy-mode = "sgmii"; -+ phy-mode = "2500base-x"; - sfp = <&sfp_eth0>; - }; -+ -+ð1 { -+ phy-mode = "2500base-x"; -+}; diff --git a/target/linux/mvebu/patches-6.12/323-arm64-dts-marvell-update-LED-and-partition-labels-fo.patch b/target/linux/mvebu/patches-6.12/323-arm64-dts-marvell-update-LED-and-partition-labels-fo.patch deleted file mode 100644 index 2791192359..0000000000 --- a/target/linux/mvebu/patches-6.12/323-arm64-dts-marvell-update-LED-and-partition-labels-fo.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 1ee61a6dee4dedd071ea82535701d5ecf2ac6467 Mon Sep 17 00:00:00 2001 -From: Stefan Kalscheuer -Date: Fri, 15 Aug 2025 15:00:43 +0200 -Subject: [PATCH] arm64: dts: marvell: update LED and partition labels for - GL-MV1000 - -Migrate LED labels from label to function/color. -Adjust partition labels and regions for OpenWRT compatibility. - -Signed-off-by: Stefan Kalscheuer ---- - .../dts/marvell/armada-3720-gl-mv1000.dts | 23 ++++++++++++++----- - 1 file changed, 17 insertions(+), 6 deletions(-) - ---- a/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts -+++ b/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts -@@ -3,6 +3,7 @@ - /dts-v1/; - #include - #include -+#include - #include "armada-372x.dtsi" - - / { -@@ -63,12 +64,14 @@ - }; - - led-wan { -- label = "green:wan"; -+ function = LED_FUNCTION_WAN; -+ color = ; - gpios = <&gpionb 12 GPIO_ACTIVE_LOW>; - }; - - led_power: led-power { -- label = "green:power"; -+ function = LED_FUNCTION_POWER; -+ color = ; - gpios = <&gpionb 13 GPIO_ACTIVE_LOW>; - default-state = "on"; - }; -@@ -89,8 +92,9 @@ - #size-cells = <1>; - - partition@0 { -- label = "firmware"; -+ label = "u-boot"; - reg = <0 0xf0000>; -+ read-only; - }; - - partition@f0000 { -@@ -105,14 +109,21 @@ - }; - - partition@100000 { -- label = "dtb"; -+ label = "gl-firmware-dtb"; - reg = <0x100000 0x10000>; - read-only; - }; - - partition@110000 { -- label = "rescue"; -- reg = <0x110000 0x1000000>; -+ label = "gl-firmware"; -+ reg = <0x110000 0xef0000>; -+ read-only; -+ }; -+ -+ partition@ef0000 { -+ label = "gl-firmware-jffs2"; -+ reg = <0xef0000 0x110000>; -+ read-only; - }; - }; - }; diff --git a/target/linux/mvebu/patches-6.12/324-arm64-dts-marvell-use-u-boot-part-label-for-Globalsc.patch b/target/linux/mvebu/patches-6.12/324-arm64-dts-marvell-use-u-boot-part-label-for-Globalsc.patch deleted file mode 100644 index e7621193bf..0000000000 --- a/target/linux/mvebu/patches-6.12/324-arm64-dts-marvell-use-u-boot-part-label-for-Globalsc.patch +++ /dev/null @@ -1,24 +0,0 @@ -From b889bb6706b031a3ecee1179333ce5b540597ecc Mon Sep 17 00:00:00 2001 -From: Stefan Kalscheuer -Date: Fri, 15 Aug 2025 15:04:11 +0200 -Subject: [PATCH] arm64: dts: marvell: use "u-boot" part label for Globalscale - MOCHAbin - -Update partition label from "firmware" to "u-boot". - -Signed-off-by: Stefan Kalscheuer ---- - arch/arm64/boot/dts/marvell/armada-7040-mochabin.dts | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/arch/arm64/boot/dts/marvell/armada-7040-mochabin.dts -+++ b/arch/arm64/boot/dts/marvell/armada-7040-mochabin.dts -@@ -168,7 +168,7 @@ - #size-cells = <1>; - - partition@0 { -- label = "firmware"; -+ label = "u-boot"; - reg = <0x0 0x3e0000>; - read-only; - }; diff --git a/target/linux/mvebu/patches-6.12/325-arm-dts-marvell-add-LED-aliases-and-USB-ports-to-Cte.patch b/target/linux/mvebu/patches-6.12/325-arm-dts-marvell-add-LED-aliases-and-USB-ports-to-Cte.patch deleted file mode 100644 index 0fd602726f..0000000000 --- a/target/linux/mvebu/patches-6.12/325-arm-dts-marvell-add-LED-aliases-and-USB-ports-to-Cte.patch +++ /dev/null @@ -1,121 +0,0 @@ -From a926f75a98612349885528aef26beb6265eaa027 Mon Sep 17 00:00:00 2001 -From: Stefan Kalscheuer -Date: Fri, 15 Aug 2025 15:11:23 +0200 -Subject: [PATCH] arm: dts: marvell: add LED aliases and USB ports to Ctera - C200-V2 - -* add PCIe bridge nodes for USB ports -* add aliases and triggers for some LEDs -* update partition label from "rootfs" to "ubi" - -Signed-off-by: Stefan Kalscheuer ---- - .../boot/dts/marvell/armada-370-c200-v2.dts | 46 +++++++++++++++++-- - 1 file changed, 43 insertions(+), 3 deletions(-) - ---- a/arch/arm/boot/dts/marvell/armada-370-c200-v2.dts -+++ b/arch/arm/boot/dts/marvell/armada-370-c200-v2.dts -@@ -17,6 +17,13 @@ - model = "Ctera C200 V2"; - compatible = "ctera,c200-v2", "marvell,armada370", "marvell,armada-370-xp"; - -+ aliases { -+ led-boot = &led_status_green; -+ led-failsafe = &led_status_red; -+ led-running = &led_status_green; -+ led-upgrade = &led_status_red; -+ }; -+ - chosen { - bootargs = "console=ttyS0,115200"; - stdout-path = "serial0:115200n8"; -@@ -117,6 +124,8 @@ - function-enumerator = <2>; - color = ; - gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; -+ linux,default-trigger = "usbport"; -+ trigger-sources = <&usb1_port 1>, <&usb2_port 1>; - }; - - led-2 { -@@ -131,6 +140,8 @@ - function-enumerator = <1>; - color = ; - gpios = <&gpio0 16 GPIO_ACTIVE_LOW>; -+ linux,default-trigger = "usbport"; -+ trigger-sources = <&usb1_port 2>, <&usb2_port 2>; - }; - - led-4 { -@@ -138,6 +149,7 @@ - function-enumerator = <2>; - color = ; - gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; -+ linux,default-trigger = "ata2"; - }; - - led-5 { -@@ -172,7 +184,7 @@ - gpios = <&gpio1 23 GPIO_ACTIVE_LOW>; - }; - -- led-10 { -+ led_status_red: led-10 { - function = LED_FUNCTION_STATUS; - color = ; - gpios = <&gpio1 24 GPIO_ACTIVE_LOW>; -@@ -183,9 +195,10 @@ - function-enumerator = <1>; - color = ; - gpios = <&gpio1 25 GPIO_ACTIVE_LOW>; -+ linux,default-trigger = "ata1"; - }; - -- led-12 { -+ led_status_green: led-12 { - function = LED_FUNCTION_STATUS; - color = ; - gpios = <&gpio1 26 GPIO_ACTIVE_LOW>; -@@ -301,7 +314,7 @@ - }; - - partition@7a00000 { -- label = "rootfs"; -+ label = "ubi"; - reg = <0x7a00000 0x8600000>; - }; - }; -@@ -316,6 +329,33 @@ - pinctrl-names = "default"; - status = "okay"; - reset-gpios = <&gpio1 27 GPIO_ACTIVE_LOW>; -+ -+ /* -[0000:00]---01.0-[01]----00.0 */ -+ /* usbport trigger won't work */ -+ bridge@0,1 { -+ compatible = "pci11ab,6710"; -+ reg = <0x3800 0 0 0 0>; -+ #address-cells = <3>; -+ #size-cells = <2>; -+ -+ usb@1,0 { -+ /* Renesas uPD720202 */ -+ compatible = "pci1912,0015"; -+ reg = <0x1000 0 0 0 0>; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ usb1_port: port@1 { -+ reg = <1>; -+ #trigger-source-cells = <1>; -+ }; -+ -+ usb2_port: port@2 { -+ reg = <2>; -+ #trigger-source-cells = <1>; -+ }; -+ }; -+ }; - }; - }; - diff --git a/target/linux/mvebu/patches-6.12/326-arm64-dts-marvell-glinet-mv1000-fix-sdhci1.patch b/target/linux/mvebu/patches-6.12/326-arm64-dts-marvell-glinet-mv1000-fix-sdhci1.patch deleted file mode 100644 index 78fe52dcd4..0000000000 --- a/target/linux/mvebu/patches-6.12/326-arm64-dts-marvell-glinet-mv1000-fix-sdhci1.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 5f20749c2dbbbc0f4f3c5bd1c4067388ab760960 Mon Sep 17 00:00:00 2001 -From: Mikhail Zadorozhnyi -Date: Sat, 11 Oct 2025 20:22:07 +0300 -Subject: [PATCH] arm64: dts: marvell: fix sdhci1 controller for gl-mv1000 - -GL-MV1000 external SD controller was broken by a recent kernel update -due to a mistake in Device Tree: "regulator-gpio" was defined without -required "gpios" property. - -Since "no-1-8-v" property is also defined for this controller -a switchable vqmmc-supply regulator performs no function - a fixed 3.3V -IO voltage will always be used. - -This regulator definition was probably added by mistake from a Device -Tree from another device. - -Remove incomplete vcc_sd_reg1 regulator definition to fix this issue. - -Signed-off-by: Mikhail Zadorozhnyi ---- - .../boot/dts/marvell/armada-3720-gl-mv1000.dts | 14 -------------- - 1 file changed, 14 deletions(-) - ---- a/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts -+++ b/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts -@@ -26,19 +26,6 @@ - reg = <0x00000000 0x00000000 0x00000000 0x20000000>; - }; - -- vcc_sd_reg1: regulator { -- compatible = "regulator-gpio"; -- regulator-name = "vcc_sd1"; -- regulator-min-microvolt = <1800000>; -- regulator-max-microvolt = <3300000>; -- regulator-boot-on; -- -- gpios-states = <0>; -- states = <1800000 0x1 -- 3300000 0x0>; -- enable-active-high; -- }; -- - keys { - compatible = "gpio-keys"; - -@@ -135,7 +122,6 @@ - cd-gpios = <&gpionb 17 GPIO_ACTIVE_LOW>; - marvell,pad-type = "sd"; - no-1-8-v; -- vqmmc-supply = <&vcc_sd_reg1>; - status = "okay"; - }; - diff --git a/target/linux/mvebu/patches-6.12/340-v7.2-arm64-dts-marvell-armada-37xx-mark-EIP97-as-dma-cohe.patch b/target/linux/mvebu/patches-6.12/340-v7.2-arm64-dts-marvell-armada-37xx-mark-EIP97-as-dma-cohe.patch deleted file mode 100644 index 6080d01885..0000000000 --- a/target/linux/mvebu/patches-6.12/340-v7.2-arm64-dts-marvell-armada-37xx-mark-EIP97-as-dma-cohe.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 5dd98e0389545b302b0c46cef2264b5b09c01677 Mon Sep 17 00:00:00 2001 -From: Aleksander Jan Bajkowski -Date: Sun, 24 May 2026 14:44:53 +0200 -Subject: [PATCH] arm64: dts: marvell: armada-37xx: mark EIP97 as dma-coherent - -Armada 37xx has coherent bus, similar to Armada 7k/8k. Cache -synchronization consumes a lot of CPU cycles. Enabling coherent DMA -increases IOPS performance up to 4 times. Some numbers: - Data length -Algo MB 16 64 128 256 1024 1424 4096 -DES-ECB 1 +21 % +5 % +5 % +7 % +7 % +3 % +20 % -AES-ECB-128 1 +21 % +6 % +6 % +6 % +9 % +8 % +22 % -AES-CBC-128 1 +21 % +5 % +5 % +5 % +6 % +7 % +23 % -AES-CBC-256 1 +23 % +7 % +8 % +6 % +11 % +13 % +20 % - - Data length -Algo MB 16 64 256 512 1024 1420 4096 8192 -AES-GCM-128 1 +44 % +42 % +31 % +32 % +27 % +30 % +32 % +30 % -AES-GCM-128 8 +319 % +326 % +163 % +148 % +75 % +72 % +74 % +41 % -AES-GCM-128 4096 +123 % +128 % +90 % +83 % +116 % +59 % +38 % +28 % - - Data length -Algo MB 16 64 256 1024 2048 4096 8192 -MD5 1 +21 % +15 % +29 % +25 % +50 % +16 % +20 % -SHA1 1 +24 % +22 % +27 % +22 % +18 % +20 % +20 % -SHA256 1 +30 % +24 % +25 % +26 % +21 % +41 % +19 % -SHA512 1 +4 % +3 % +8 % +10 % +24 % +10 % +11 % - -Tested on Armada 3720. Platform passes testmgr selftests. - -Signed-off-by: Aleksander Jan Bajkowski -Signed-off-by: Gregory CLEMENT ---- - arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 1 + - 1 file changed, 1 insertion(+) - ---- a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi -+++ b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi -@@ -440,6 +440,7 @@ - interrupt-names = "ring0", "ring1", "ring2", - "ring3", "eip", "mem"; - clocks = <&nb_periph_clk 15>; -+ dma-coherent; - }; - - rwtm: mailbox@b0000 { diff --git a/target/linux/mvebu/patches-6.12/350-drivers-thermal-step_wise-add-support-for-hysteresis.patch b/target/linux/mvebu/patches-6.12/350-drivers-thermal-step_wise-add-support-for-hysteresis.patch deleted file mode 100644 index d98e585db5..0000000000 --- a/target/linux/mvebu/patches-6.12/350-drivers-thermal-step_wise-add-support-for-hysteresis.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 9685ce100f0d302501117113ef0a526ad1acca1d Mon Sep 17 00:00:00 2001 -From: Ram Chandrasekar -Date: Mon, 7 May 2018 11:54:08 -0600 -Subject: [PATCH] drivers: thermal: step_wise: add support for hysteresis - -Step wise governor increases the mitigation level when the temperature -goes above a threshold and will decrease the mitigation when the -temperature falls below the threshold. If it were a case, where the -temperature hovers around a threshold, the mitigation will be applied -and removed at every iteration. This reaction to the temperature is -inefficient for performance. - -The use of hysteresis temperature could avoid this ping-pong of -mitigation by relaxing the mitigation to happen only when the -temperature goes below this lower hysteresis value. - -Signed-off-by: Ram Chandrasekar -Signed-off-by: Lina Iyer -[forward-ported for Linux 6.6, as stop-gap downstream solution] -Signed-off-by: Daniel Golle ---- - drivers/thermal/gov_step_wise.c | 23 ++++++++++++++++------- - 1 file changed, 16 insertions(+), 7 deletions(-) - ---- a/drivers/thermal/gov_step_wise.c -+++ b/drivers/thermal/gov_step_wise.c -@@ -87,19 +87,28 @@ static void thermal_zone_trip_update(str - int trip_id = thermal_zone_trip_id(tz, trip); - struct thermal_instance *instance; - bool throttle = false; -+ int hyst_temp; - -- if (tz->temperature >= trip_threshold) { -- throttle = true; -- trace_thermal_zone_trip(tz, trip_id, trip->type); -- } -- -- dev_dbg(&tz->device, "Trip%d[type=%d,temp=%d]:trend=%d,throttle=%d\n", -- trip_id, trip->type, trip_threshold, trend, throttle); -+ hyst_temp = trip->temperature - trip->hysteresis; -+ dev_dbg(&tz->device, "Trip%d[type=%d,temp=%d,hyst=%d]:trend=%d,throttle=%d\n", -+ trip_id, trip->type, trip->temperature, hyst_temp, trend, throttle); - - list_for_each_entry(instance, &td->thermal_instances, trip_node) { - int old_target; - - old_target = instance->target; -+ throttle = false; -+ /* -+ * Lower the mitigation only if the temperature -+ * goes below the hysteresis temperature. -+ */ -+ if (tz->temperature >= trip->temperature || -+ (tz->temperature >= hyst_temp && -+ old_target != THERMAL_NO_TARGET)) { -+ throttle = true; -+ trace_thermal_zone_trip(tz, trip_id, trip->type); -+ } -+ - instance->target = get_target_state(instance, trend, throttle); - - dev_dbg(&instance->cdev->device, "old_target=%d, target=%ld\n", diff --git a/target/linux/mvebu/patches-6.12/400-find_active_root.patch b/target/linux/mvebu/patches-6.12/400-find_active_root.patch deleted file mode 100644 index 93c045b8b5..0000000000 --- a/target/linux/mvebu/patches-6.12/400-find_active_root.patch +++ /dev/null @@ -1,60 +0,0 @@ -The WRT1900AC among other Linksys routers uses a dual-firmware layout. -Dynamically rename the active partition to "ubi". - -Signed-off-by: Imre Kaloz - ---- a/drivers/mtd/parsers/ofpart_core.c -+++ b/drivers/mtd/parsers/ofpart_core.c -@@ -38,6 +38,8 @@ static bool node_has_compatible(struct d - return of_get_property(pp, "compatible", NULL); - } - -+static int mangled_rootblock; -+ - static int parse_fixed_partitions(struct mtd_info *master, - const struct mtd_partition **pparts, - struct mtd_part_parser_data *data) -@@ -48,6 +50,7 @@ static int parse_fixed_partitions(struct - struct device_node *mtd_node; - struct device_node *ofpart_node; - const char *partname; -+ const char *owrtpart = "ubi"; - struct device_node *pp; - int nr_parts, i, ret = 0; - bool dedicated = true; -@@ -159,9 +162,13 @@ static int parse_fixed_partitions(struct - parts[i].size = of_read_number(reg + a_cells, s_cells); - parts[i].of_node = pp; - -- partname = of_get_property(pp, "label", &len); -- if (!partname) -- partname = of_get_property(pp, "name", &len); -+ if (mangled_rootblock && (i == mangled_rootblock)) { -+ partname = owrtpart; -+ } else { -+ partname = of_get_property(pp, "label", &len); -+ if (!partname) -+ partname = of_get_property(pp, "name", &len); -+ } - parts[i].name = partname; - - if (of_property_read_bool(pp, "read-only")) -@@ -283,6 +290,18 @@ static int __init ofpart_parser_init(voi - return 0; - } - -+static int __init active_root(char *str) -+{ -+ get_option(&str, &mangled_rootblock); -+ -+ if (!mangled_rootblock) -+ return 1; -+ -+ return 1; -+} -+ -+__setup("mangled_rootblock=", active_root); -+ - static void __exit ofpart_parser_exit(void) - { - deregister_mtd_parser(&ofpart_parser); diff --git a/target/linux/mvebu/patches-6.12/700-mvneta-tx-queue-workaround.patch b/target/linux/mvebu/patches-6.12/700-mvneta-tx-queue-workaround.patch deleted file mode 100644 index 39112f23bb..0000000000 --- a/target/linux/mvebu/patches-6.12/700-mvneta-tx-queue-workaround.patch +++ /dev/null @@ -1,43 +0,0 @@ -From: Felix Fietkau -Subject: mvneta: tx queue workaround - -The hardware queue scheduling is apparently configured with fixed -priorities, which creates a nasty fairness issue where traffic from one -CPU can starve traffic from all other CPUs. - -Work around this issue by forcing all tx packets to go through one CPU, -until this issue is fixed properly. - -Ref: https://github.com/openwrt/openwrt/issues/5411 - -Signed-off-by: Felix Fietkau ---- ---- a/drivers/net/ethernet/marvell/mvneta.c -+++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -5303,6 +5303,16 @@ static int mvneta_setup_tc(struct net_de - } - } - -+#ifndef CONFIG_ARM64 -+static u16 mvneta_select_queue(struct net_device *dev, struct sk_buff *skb, -+ struct net_device *sb_dev) -+{ -+ /* XXX: hardware queue scheduling is broken, -+ * use only one queue until it is fixed */ -+ return 0; -+} -+#endif -+ - static const struct net_device_ops mvneta_netdev_ops = { - .ndo_open = mvneta_open, - .ndo_stop = mvneta_stop, -@@ -5313,6 +5323,9 @@ static const struct net_device_ops mvnet - .ndo_fix_features = mvneta_fix_features, - .ndo_get_stats64 = mvneta_get_stats64, - .ndo_eth_ioctl = mvneta_ioctl, -+#ifndef CONFIG_ARM64 -+ .ndo_select_queue = mvneta_select_queue, -+#endif - .ndo_bpf = mvneta_xdp, - .ndo_xdp_xmit = mvneta_xdp_xmit, - .ndo_setup_tc = mvneta_setup_tc, diff --git a/target/linux/mvebu/patches-6.12/800-cpuidle-mvebu-indicate-failure-to-enter-deeper-sleep.patch b/target/linux/mvebu/patches-6.12/800-cpuidle-mvebu-indicate-failure-to-enter-deeper-sleep.patch deleted file mode 100644 index 5df5aca5dc..0000000000 --- a/target/linux/mvebu/patches-6.12/800-cpuidle-mvebu-indicate-failure-to-enter-deeper-sleep.patch +++ /dev/null @@ -1,40 +0,0 @@ -From c28b2d367da8a471482e6a4aa8337ab6369a80c2 Mon Sep 17 00:00:00 2001 -From: Russell King -Date: Sat, 3 Oct 2015 09:13:05 +0100 -Subject: cpuidle: mvebu: indicate failure to enter deeper sleep states - -The cpuidle ->enter method expects the return value to be the sleep -state we entered. Returning negative numbers or other codes is not -permissible since coupled CPU idle was merged. - -At least some of the mvebu_v7_cpu_suspend() implementations return the -value from cpu_suspend(), which returns zero if the CPU vectors back -into the kernel via cpu_resume() (the success case), or the non-zero -return value of the suspend actor, or one (failure cases). - -We do not want to be returning the failure case value back to CPU idle -as that indicates that we successfully entered one of the deeper idle -states. Always return zero instead, indicating that we slept for the -shortest amount of time. - -Signed-off-by: Russell King ---- - drivers/cpuidle/cpuidle-mvebu-v7.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - ---- a/drivers/cpuidle/cpuidle-mvebu-v7.c -+++ b/drivers/cpuidle/cpuidle-mvebu-v7.c -@@ -42,8 +42,12 @@ static __cpuidle int mvebu_v7_enter_idle - - cpu_pm_exit(); - -+ /* -+ * If we failed to enter the desired state, indicate that we -+ * slept lightly. -+ */ - if (ret) -- return ret; -+ return 0; - - return index; - } diff --git a/target/linux/mvebu/patches-6.12/801-pci-mvebu-time-out-reset-on-link-up.patch b/target/linux/mvebu/patches-6.12/801-pci-mvebu-time-out-reset-on-link-up.patch deleted file mode 100644 index f1832c8940..0000000000 --- a/target/linux/mvebu/patches-6.12/801-pci-mvebu-time-out-reset-on-link-up.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 287b9df160b6159f8d385424904f8bac501280c1 Mon Sep 17 00:00:00 2001 -From: Russell King -Date: Sat, 9 Jul 2016 10:58:16 +0100 -Subject: pci: mvebu: time out reset on link up - -If the port reports that the link is up while we are resetting, there's -little point in waiting for the full duration. - -Signed-off-by: Russell King ---- - drivers/pci/controller/pci-mvebu.c | 20 ++++++++++++++------ - 1 file changed, 14 insertions(+), 6 deletions(-) - ---- a/drivers/pci/controller/pci-mvebu.c -+++ b/drivers/pci/controller/pci-mvebu.c -@@ -1397,6 +1397,7 @@ static int mvebu_pcie_powerup(struct mve - - if (port->reset_gpio) { - u32 reset_udelay = PCI_PM_D3COLD_WAIT * 1000; -+ unsigned int i; - - of_property_read_u32(port->dn, "reset-delay-us", - &reset_udelay); -@@ -1404,7 +1405,13 @@ static int mvebu_pcie_powerup(struct mve - udelay(100); - - gpiod_set_value_cansleep(port->reset_gpio, 0); -- msleep(reset_udelay / 1000); -+ for (i = 0; i < reset_udelay; i += 1000) { -+ if (mvebu_pcie_link_up(port)) -+ break; -+ msleep(1); -+ } -+ -+ printk("%s: reset completed in %dus\n", port->name, i); - } - - return 0; -@@ -1521,15 +1528,16 @@ static int mvebu_pcie_probe(struct platf - if (!child) - continue; - -- ret = mvebu_pcie_powerup(port); -- if (ret < 0) -- continue; -- - port->base = mvebu_pcie_map_registers(pdev, child, port); - if (IS_ERR(port->base)) { - dev_err(dev, "%s: cannot map registers\n", port->name); - port->base = NULL; -- mvebu_pcie_powerdown(port); -+ continue; -+ } -+ -+ ret = mvebu_pcie_powerup(port); -+ if (ret < 0) { -+ port->base = NULL; - continue; - } - diff --git a/target/linux/mvebu/patches-6.12/830-01-i2c-add-init_recovery-callback.patch b/target/linux/mvebu/patches-6.12/830-01-i2c-add-init_recovery-callback.patch deleted file mode 100644 index b82bb24a08..0000000000 --- a/target/linux/mvebu/patches-6.12/830-01-i2c-add-init_recovery-callback.patch +++ /dev/null @@ -1,189 +0,0 @@ -From patchwork Sun May 11 13:31:05 2025 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Gabor Juhos -X-Patchwork-Id: 14084055 -Return-Path: - -X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on - aws-us-west-2-korg-lkml-1.web.codeaurora.org -Received: from bombadil.infradead.org (bombadil.infradead.org - [198.137.202.133]) - (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) - (No client certificate requested) - by smtp.lore.kernel.org (Postfix) with ESMTPS id 0802BC3ABC3 - for ; - Sun, 11 May 2025 13:35:46 +0000 (UTC) -DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; - d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help - :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References - :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: - From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: - Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; - bh=n9RYlne5nhTN7kCu5Yc7zW4CF0YUJUWg2clQo/viA0M=; b=LBsqIvaHPjMCwZZfbGyry56BIg - sEpAZY6rWjqf0DWQjODfNe8G8EZOzfHbMRA8HElCRdUR54+uQkesdQ9CuQip0FUIEkRlfRHM8HYTB - iWLgZE6pnElndi/4uhAmfvgQFvMbDhxrsoAqAjLY4K+sPr53QSEGO7ygY+TPHmcpyVfD+kRqjMAv3 - wbypdxFC5lHAOvIiAdaKreajEf7HBqztprh/D1aE29TQdWILixJTAl5isgLzJyZUOEnqrefGvBQ9g - +zg0jQwLLnjnsCMzkjho6mjwi1Q7I3ERQVRnebKf9eslmNstr9apYy5yfz6BKzHGxBk3yC+Boyvde - FP62KNGQ==; -Received: from localhost ([::1] helo=bombadil.infradead.org) - by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) - id 1uE6qC-00000007Glw-1vse; - Sun, 11 May 2025 13:35:40 +0000 -Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) - by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) - id 1uE6mD-00000007GP8-397T - for linux-arm-kernel@lists.infradead.org; - Sun, 11 May 2025 13:31:34 +0000 -Received: by mail-ej1-x630.google.com with SMTP id - a640c23a62f3a-ad1f6aa2f84so764633466b.0 - for ; - Sun, 11 May 2025 06:31:33 -0700 (PDT) -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=gmail.com; s=20230601; t=1746970292; x=1747575092; - darn=lists.infradead.org; - h=cc:to:in-reply-to:references:message-id:content-transfer-encoding - :mime-version:subject:date:from:from:to:cc:subject:date:message-id - :reply-to; - bh=n9RYlne5nhTN7kCu5Yc7zW4CF0YUJUWg2clQo/viA0M=; - b=mK6aKMspWjttCQGv7A/DF5F1n7JFLuDEaCeCKlEp4FrClZQD6JhAlON6yEPPTc86q2 - XnRAAh8tIk3Gu/QyNYXIsrlBeqtv5b+sxUxV+ebyFg0AaMi+tbhf8koryKoVPDMQljmm - i/Rv5GrycEwvnGMNsTHc+xLCwkjAy15KoLGdsfc+Uw3HrPmX+/8UFaVCmxltLgEprwVA - drnzRzYh3IIFjsPYJIrp75cIMMXIHwm2IqKiGuzMaDeCsB3iA/En8PHWr2trxMV7K98g - 442ZOjY0CqX1mAIKQLXmN7X3fCbOHinxxy7HefUe2YNclBf6UHr3pT2i9UBsalEpUWUl - OQ7A== -X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=1e100.net; s=20230601; t=1746970292; x=1747575092; - h=cc:to:in-reply-to:references:message-id:content-transfer-encoding - :mime-version:subject:date:from:x-gm-message-state:from:to:cc - :subject:date:message-id:reply-to; - bh=n9RYlne5nhTN7kCu5Yc7zW4CF0YUJUWg2clQo/viA0M=; - b=HSWiBJsVViBeM5B5hMn4oUOZ7JTd6/O5/rjNuDl1Q//i4aFGGSy0L11zacjYVSLegk - 2j9UiS7yLaVSlnNJle+YrtIy/kbCayoNUrYXtU5v9MvYAHjS0WMYijekCDQ9+lDLpXwg - kpERQ/Tu1Fmqb+8Yv/XycWLCyTPR0XGXxVvGiAPs1KnXsuj71MK7/HXof0p3IDqS444Q - dBuRDx1xby4/806P/EPvdr4Xj0lVF3tkimKtaPpBdXp+kkJ8xyYlMhLHAUX16F8Xktqs - yuzG1OASvIocfiEiluOxqrM6727wJhtt8qiBxCiI/UBaEr5bUkIBvmvktYSVy+/N4Itf - +qAw== -X-Forwarded-Encrypted: i=1; - AJvYcCWF5SWWguUIUPp10Yp8M+dIc/7999B/vb7xwMluPb/Vj9FZyJ4hnhDgLC60CD9icfYXYWwLlHN06vKw5onkKXF5@lists.infradead.org -X-Gm-Message-State: AOJu0Yx7y5pv/+Mt1FmIK+MTvi1kVFAvXtKteYPDneNKNfNZuwqrLoNt - F6DpKLyTyp8r/NQFiROomu/JLI5qMM4JRr5VwmbDeYC0dWKD4xH1 -X-Gm-Gg: ASbGncttO+Rf69HYuAf22AOp+cMso2pjn2/z/ZJhaxvqOUUqzypHmtdf5RV1S1/NJt+ - 2U8XzEy/JHeASbx9scc+3q0mJPtPNp8qCQpF+0zPaU8cbrfcsiggtSVfMhZP6sxqoI2iJtnMdLF - JVZhFcynNHOqZYLBh8pWdnToMBYILJM7VhgFcJZIeDPaGbC5JDSKus+OUR31/TKl/K/+83r309I - dYCCeBcJgLPA+Z5pDDHhFh/tjag+5ID+tTI3hH7IrEjz0LCb3DFL0QEsrwm9yQn4xUtQ9ms+KST - 4DF3TYm4r0/Uqf8zWSPTbC4CL69YtYYBDCt22gKAW+PPDTQ4UBcDfIwI7MxiOOT2rnjfzWNtD+1 - 6uO29 -X-Google-Smtp-Source: - AGHT+IFAmDDIIuhS51ef1EGvEQpU//VoeH0fQBhRPIfrKUiYydYis8s+qNymb53gRE7q67J/kVk0HA== -X-Received: by 2002:a17:907:94d5:b0:acb:3acd:2845 with SMTP id - a640c23a62f3a-ad1fccfced9mr1181053766b.25.1746970291841; - Sun, 11 May 2025 06:31:31 -0700 (PDT) -Received: from [192.168.0.253] (5D59A51C.catv.pool.telekom.hu. [93.89.165.28]) - by smtp.googlemail.com with ESMTPSA id - a640c23a62f3a-ad2197bd398sm466765366b.152.2025.05.11.06.31.30 - (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); - Sun, 11 May 2025 06:31:31 -0700 (PDT) -From: Gabor Juhos -Date: Sun, 11 May 2025 15:31:05 +0200 -Subject: [PATCH 1/3] i2c: add init_recovery() callback -MIME-Version: 1.0 -Message-Id: - <20250511-i2c-pxa-fix-i2c-communication-v1-1-e9097d09a015@gmail.com> -References: - <20250511-i2c-pxa-fix-i2c-communication-v1-0-e9097d09a015@gmail.com> -In-Reply-To: - <20250511-i2c-pxa-fix-i2c-communication-v1-0-e9097d09a015@gmail.com> -To: Wolfram Sang , Andi Shyti , - Russell King , Andrew Lunn -Cc: Robert Marko , - Linus Walleij , - Russell King , linux-i2c@vger.kernel.org, - linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, - Gabor Juhos , Imre Kaloz , - stable@vger.kernel.org -X-Mailer: b4 0.14.2 -X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 -X-CRM114-CacheID: sfid-20250511_063133_790603_F3EAC078 -X-CRM114-Status: GOOD ( 20.27 ) -X-BeenThere: linux-arm-kernel@lists.infradead.org -X-Mailman-Version: 2.1.34 -Precedence: list -List-Id: -List-Unsubscribe: - , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: - , - -Sender: "linux-arm-kernel" -Errors-To: - linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org - -Add a new init_recovery() callback to struct 'i2c_bus_recovery_info' -and modify the i2c_init_recovery() function to call that if specified -instead of the generic i2c_gpio_init_recovery() function. - -This allows controller drivers to skip calling the generic code by -implementing a dummy callback function, or alternatively to run a -fine tuned custom implementation. - -This is needed for the 'i2c-pxa' driver in order to be able to fix -a long standing bug for which the fix will be implemented in a -followup patch. - -Cc: stable@vger.kernel.org # 6.3+ -Signed-off-by: Gabor Juhos -Signed-off-by: Imre Kaloz -Reviewed-by: Linus Walleij ---- - drivers/i2c/i2c-core-base.c | 8 +++++++- - include/linux/i2c.h | 4 ++++ - 2 files changed, 11 insertions(+), 1 deletion(-) - ---- a/drivers/i2c/i2c-core-base.c -+++ b/drivers/i2c/i2c-core-base.c -@@ -427,12 +427,18 @@ static int i2c_init_recovery(struct i2c_ - struct i2c_bus_recovery_info *bri = adap->bus_recovery_info; - bool is_error_level = true; - char *err_str; -+ int ret; - - if (!bri) - return 0; - -- if (i2c_gpio_init_recovery(adap) == -EPROBE_DEFER) -+ if (bri->init_recovery) { -+ ret = bri->init_recovery(adap); -+ if (ret) -+ return ret; -+ } else if (i2c_gpio_init_recovery(adap) == -EPROBE_DEFER) { - return -EPROBE_DEFER; -+ } - - if (!bri->recover_bus) { - err_str = "no suitable method provided"; ---- a/include/linux/i2c.h -+++ b/include/linux/i2c.h -@@ -635,6 +635,9 @@ struct i2c_timings { - * for generic GPIO recovery. - * @get_bus_free: Returns the bus free state as seen from the IP core in case it - * has a more complex internal logic than just reading SDA. Optional. -+ * @init_recovery: If specified, it will be called instead of the generic GPIO -+ * recovery initialization code. Platform may use a dummy callback to skip -+ * calling the generic code, or it may use a custom implementation. - * @prepare_recovery: This will be called before starting recovery. Platform may - * configure padmux here for SDA/SCL line or something else they want. - * @unprepare_recovery: This will be called after completing recovery. Platform -@@ -659,6 +662,7 @@ struct i2c_bus_recovery_info { - void (*set_sda)(struct i2c_adapter *adap, int val); - int (*get_bus_free)(struct i2c_adapter *adap); - -+ int (*init_recovery)(struct i2c_adapter *adap); - void (*prepare_recovery)(struct i2c_adapter *adap); - void (*unprepare_recovery)(struct i2c_adapter *adap); - diff --git a/target/linux/mvebu/patches-6.12/830-02-i2c-pxa-prevent-calling-of-the-generic-recovery-init-code.patch b/target/linux/mvebu/patches-6.12/830-02-i2c-pxa-prevent-calling-of-the-generic-recovery-init-code.patch deleted file mode 100644 index 6822eafc6a..0000000000 --- a/target/linux/mvebu/patches-6.12/830-02-i2c-pxa-prevent-calling-of-the-generic-recovery-init-code.patch +++ /dev/null @@ -1,224 +0,0 @@ -From patchwork Sun May 11 13:31:06 2025 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Gabor Juhos -X-Patchwork-Id: 14084056 -Return-Path: - -X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on - aws-us-west-2-korg-lkml-1.web.codeaurora.org -Received: from bombadil.infradead.org (bombadil.infradead.org - [198.137.202.133]) - (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) - (No client certificate requested) - by smtp.lore.kernel.org (Postfix) with ESMTPS id 72E7DC3ABC3 - for ; - Sun, 11 May 2025 13:37:50 +0000 (UTC) -DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; - d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help - :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References - :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: - From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: - Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; - bh=BySnXAIGhp18eRP0sg1mjpdXdHwBsus0rtjMi26U9uM=; b=ba0yGs/0cSs2cep9T3wjo3iDxy - VSaQu2j7YGuiAMJt8ERY5OVL7YiPC/6+MqGcLqkrGunZq/TEjXRGX9ztKqyko6KY9fLbiH1wXYBjK - /9yxbEyt9bPrIw/r64uaUOdRzZMF0i2oBn53RgZJJFaD4ou1E28BMc22AuVGshj99Dlz63ncr/Lz7 - M3/ptMOWGRp0SrImYRUdvnWj+LKyb4zqRFEYIQuq9WzyhhNuDZDaHFpdJn4go/eoS4kUvTFfixpwV - FevQupqdOn62R3ull5YYdI6BFQVL6dISjD34mjoNXJABSjuXmq8FRWuX/V3rPrvnVIflxOmzSrKrF - 8rdYY/fg==; -Received: from localhost ([::1] helo=bombadil.infradead.org) - by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) - id 1uE6sA-00000007GuC-0j29; - Sun, 11 May 2025 13:37:42 +0000 -Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) - by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) - id 1uE6mF-00000007GPb-1uOE - for linux-arm-kernel@lists.infradead.org; - Sun, 11 May 2025 13:31:36 +0000 -Received: by mail-ej1-x636.google.com with SMTP id - a640c23a62f3a-acae7e7587dso539429266b.2 - for ; - Sun, 11 May 2025 06:31:35 -0700 (PDT) -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=gmail.com; s=20230601; t=1746970294; x=1747575094; - darn=lists.infradead.org; - h=cc:to:in-reply-to:references:message-id:content-transfer-encoding - :mime-version:subject:date:from:from:to:cc:subject:date:message-id - :reply-to; - bh=BySnXAIGhp18eRP0sg1mjpdXdHwBsus0rtjMi26U9uM=; - b=QtIYufKg61b066knR9OpyawErNmkYyoP/2lIkHhyGY7qtGXkc1jJmC0TpPyhp0WGlm - xWP3K/PG23VcjEuGj/880thPietuKQuTF029WPfm+yrQ3uHLMzkHqyOiMYyiBR9N0Zjw - NICgywX4iqVHVBnXZTiBA7sRSjQqteatDPTGbKgZxpIHpg4ZJtfXZcCE8RiKVVgZCWsq - JgTJuTO/4J0cq5TWVOIGLrt0XOslaMmuISPbUDdArr5yKfGZqu51i747A0o0RBdEuH9Y - UPI8/GExcWWa+62KCVEwB9OmCZR81ieb8To/XdZO8hIQAlExOzKa3OOPCkS0PF0M9BBa - d++Q== -X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=1e100.net; s=20230601; t=1746970294; x=1747575094; - h=cc:to:in-reply-to:references:message-id:content-transfer-encoding - :mime-version:subject:date:from:x-gm-message-state:from:to:cc - :subject:date:message-id:reply-to; - bh=BySnXAIGhp18eRP0sg1mjpdXdHwBsus0rtjMi26U9uM=; - b=A+LfIVmyzogyr2akFoGR3PIbjd8E/TVXGlur91KBF7h2W8msMTeMyv0PDVjqEBxWFI - cqNLira3TWf9soXrRBGaJVB111/r5woARoN4aO5otCDrh3o5U2gJ5/eZLGbcX49TqJG5 - rbI1Eq0GGXFdidQ4T5CMLtooa6B5pg7j+o2gcyG/vQlHr6MbG4/2sIDPX0JbL08xibWC - 5LqP933W+yopGIbnp3YZ9pybbvOUA9x4cYkUm1Of3idmkTN0xUh8kmUWz7FJCH4R/PAN - 5CA/vn8q1myUvXisU0oAbC9y/WrlExPfvguXjru1LTx9AdPaC9+D3Qxmh2Raz9b4NrKl - ZlVw== -X-Forwarded-Encrypted: i=1; - AJvYcCWMm/Er5t6Xp05DMDNak7mbsqx8YZmOrqz9Y39eovLKPkbqcMhQwOzxqxCY8ZfQtETNpZ8X9NptEow+bBHo+z3t@lists.infradead.org -X-Gm-Message-State: AOJu0YwBTrjBcryZjqJBq66bcSYfV2AWsDAqAfMinxG8gRUJjpKq8RXn - kKSKTp2XvMObVTWx7cEMM5BBPWl7LfLwBkjVIusbgScQ8qW8YA9H -X-Gm-Gg: ASbGnctKtEUhBLJdOfPb7cKwM8a1ZTe5+8zPX9TaLdomZybHHeteF9o/ZyUNbunUsSK - fuMy3pPFmYcC4TZtPqfZPdpagbDpOb2R/9xbSTMd1TKDDj4vFnkTIzQHA9E1ZxX44Nw6JkxA0up - S94PBow9mEb3tkHLN9hbNe7W8ksyf7RZ25IGC4FYj/wEGQsMy2VidJsfG4bIeImZ8zj8ufUCNby - 7jIjmP1taNt5U8omPEWhFuRdJfiPqIXx85tIsGVFwG7VSr/JW8LwxBCJLGhWLUZhxYqV4cEfSRC - zYKj2qkuRfx5AxzN+JGtfcxYPijsy/rI51OnjOv2CQRPuE6rESamNJiR7pmnDgvHSRm5nps5chp - /HVXU -X-Google-Smtp-Source: - AGHT+IG8Y/7VNg8lhY275mIfLbq8EaG9jCRvvK1wX7rlbuoMvEUYYC3k7sZOxh3RPmKhAB94Kfvlwg== -X-Received: by 2002:a17:907:7b04:b0:ad1:fab8:88ab with SMTP id - a640c23a62f3a-ad219085c07mr897192766b.29.1746970293535; - Sun, 11 May 2025 06:31:33 -0700 (PDT) -Received: from [192.168.0.253] (5D59A51C.catv.pool.telekom.hu. [93.89.165.28]) - by smtp.googlemail.com with ESMTPSA id - a640c23a62f3a-ad2197bd398sm466765366b.152.2025.05.11.06.31.32 - (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); - Sun, 11 May 2025 06:31:33 -0700 (PDT) -From: Gabor Juhos -Date: Sun, 11 May 2025 15:31:06 +0200 -Subject: [PATCH 2/3] i2c: pxa: prevent calling of the generic recovery init - code -MIME-Version: 1.0 -Message-Id: - <20250511-i2c-pxa-fix-i2c-communication-v1-2-e9097d09a015@gmail.com> -References: - <20250511-i2c-pxa-fix-i2c-communication-v1-0-e9097d09a015@gmail.com> -In-Reply-To: - <20250511-i2c-pxa-fix-i2c-communication-v1-0-e9097d09a015@gmail.com> -To: Wolfram Sang , Andi Shyti , - Russell King , Andrew Lunn -Cc: Robert Marko , - Linus Walleij , - Russell King , linux-i2c@vger.kernel.org, - linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, - Gabor Juhos , Imre Kaloz , - stable@vger.kernel.org -X-Mailer: b4 0.14.2 -X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 -X-CRM114-CacheID: sfid-20250511_063135_499888_294068DC -X-CRM114-Status: GOOD ( 21.30 ) -X-BeenThere: linux-arm-kernel@lists.infradead.org -X-Mailman-Version: 2.1.34 -Precedence: list -List-Id: -List-Unsubscribe: - , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: - , - -Sender: "linux-arm-kernel" -Errors-To: - linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org - -The I2C communication is completely broken on the Armada 3700 platform -since commit 0b01392c18b9 ("i2c: pxa: move to generic GPIO recovery"). - -For example, on the Methode uDPU board, probing of the two onboard -temperature sensors fails ... - - [ 7.271713] i2c i2c-0: using pinctrl states for GPIO recovery - [ 7.277503] i2c i2c-0: PXA I2C adapter - [ 7.282199] i2c i2c-1: using pinctrl states for GPIO recovery - [ 7.288241] i2c i2c-1: PXA I2C adapter - [ 7.292947] sfp sfp-eth1: Host maximum power 3.0W - [ 7.299614] sfp sfp-eth0: Host maximum power 3.0W - [ 7.308178] lm75 1-0048: supply vs not found, using dummy regulator - [ 32.489631] lm75 1-0048: probe with driver lm75 failed with error -121 - [ 32.496833] lm75 1-0049: supply vs not found, using dummy regulator - [ 82.890614] lm75 1-0049: probe with driver lm75 failed with error -121 - -... and accessing the plugged-in SFP modules also does not work: - - [ 511.298537] sfp sfp-eth1: please wait, module slow to respond - [ 536.488530] sfp sfp-eth0: please wait, module slow to respond - ... - [ 1065.688536] sfp sfp-eth1: failed to read EEPROM: -EREMOTEIO - [ 1090.888532] sfp sfp-eth0: failed to read EEPROM: -EREMOTEIO - -After a discussion [1], there was an attempt to fix the problem by -reverting the offending change by commit 7b211c767121 ("Revert "i2c: -pxa: move to generic GPIO recovery""), but that only helped to fix -the issue in the 6.1.y stable tree. The reason behind the partial succes -is that there was another change in commit 20cb3fce4d60 ("i2c: Set i2c -pinctrl recovery info from it's device pinctrl") in the 6.3-rc1 cycle -which broke things further. - -The cause of the problem is the same in case of both offending commits -mentioned above. Namely, the I2C core code changes the pinctrl state to -GPIO while running the recovery initialization code. Although the PXA -specific initialization also does this, but the key difference is that -it happens before the conrtoller is getting enabled in i2c_pxa_reset(), -whereas in the case of the generic initialization it happens after that. - -To resolve the problem, provide an empty init_recovery() callback -function thus preventing the I2C core to call the generic recovery -initialization code. - -As the result this change restores the original behaviour, which in -turn makes the I2C communication to work again as it can be seen from -the following log: - - [ 7.305277] i2c i2c-0: PXA I2C adapter - [ 7.310198] i2c i2c-1: PXA I2C adapter - [ 7.315012] sfp sfp-eth1: Host maximum power 3.0W - [ 7.324061] lm75 1-0048: supply vs not found, using dummy regulator - [ 7.331738] sfp sfp-eth0: Host maximum power 3.0W - [ 7.337000] hwmon hwmon0: temp1_input not attached to any thermal zone - [ 7.343593] lm75 1-0048: hwmon0: sensor 'tmp75c' - [ 7.348526] lm75 1-0049: supply vs not found, using dummy regulator - [ 7.356858] hwmon hwmon1: temp1_input not attached to any thermal zone - [ 7.363463] lm75 1-0049: hwmon1: sensor 'tmp75c' - ... - [ 7.730315] sfp sfp-eth1: module Mikrotik S-RJ01 rev 1.0 sn 61B103C55C58 dc 201022 - [ 7.840318] sfp sfp-eth0: module MENTECHOPTO POS22-LDCC-KR rev 1.0 sn MNC208U90009 dc 200828 - [ 7.850083] mvneta d0030000.ethernet eth0: unsupported SFP module: no common interface modes - [ 7.990335] hwmon hwmon2: temp1_input not attached to any thermal zone - -[1] https://lore.kernel.org/r/20230926160255.330417-1-robert.marko@sartura.hr - -Cc: stable@vger.kernel.org # 6.3+ -Fixes: 20cb3fce4d60 ("i2c: Set i2c pinctrl recovery info from it's device pinctrl") -Signed-off-by: Gabor Juhos -Signed-off-by: Imre Kaloz ---- - drivers/i2c/busses/i2c-pxa.c | 7 +++++++ - 1 file changed, 7 insertions(+) - ---- a/drivers/i2c/busses/i2c-pxa.c -+++ b/drivers/i2c/busses/i2c-pxa.c -@@ -1336,6 +1336,12 @@ static void i2c_pxa_unprepare_recovery(s - i2c_pxa_enable(i2c); - } - -+static int i2c_pxa_init_recovery_cb(struct i2c_adapter *adap) -+{ -+ /* We have initialized everything already, so nothing to do here. */ -+ return 0; -+} -+ - static int i2c_pxa_init_recovery(struct pxa_i2c *i2c) - { - struct i2c_bus_recovery_info *bri = &i2c->recovery; -@@ -1404,6 +1410,7 @@ static int i2c_pxa_init_recovery(struct - return 0; - } - -+ bri->init_recovery = i2c_pxa_init_recovery_cb; - bri->prepare_recovery = i2c_pxa_prepare_recovery; - bri->unprepare_recovery = i2c_pxa_unprepare_recovery; - bri->recover_bus = i2c_generic_scl_recovery; diff --git a/target/linux/mvebu/patches-6.12/830-03-i2c-pxa-handle-Early-Bus-Busy-condition-on-Armada-3700.patch b/target/linux/mvebu/patches-6.12/830-03-i2c-pxa-handle-Early-Bus-Busy-condition-on-Armada-3700.patch deleted file mode 100644 index a03127bee4..0000000000 --- a/target/linux/mvebu/patches-6.12/830-03-i2c-pxa-handle-Early-Bus-Busy-condition-on-Armada-3700.patch +++ /dev/null @@ -1,309 +0,0 @@ -From patchwork Sun May 11 13:31:07 2025 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Gabor Juhos -X-Patchwork-Id: 14084057 -Return-Path: - -X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on - aws-us-west-2-korg-lkml-1.web.codeaurora.org -Received: from bombadil.infradead.org (bombadil.infradead.org - [198.137.202.133]) - (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) - (No client certificate requested) - by smtp.lore.kernel.org (Postfix) with ESMTPS id E1323C3ABC3 - for ; - Sun, 11 May 2025 13:39:50 +0000 (UTC) -DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; - d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help - :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References - :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: - From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: - Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; - bh=jCnitIQrLGML0v/ZGaz7m1EqKZaS5okX2gqREoZgqFA=; b=gjUPiYgZ9tzalLC8hdQSBahsEr - yHwsfVsfhm/onN8EySOnZ9iefbvCDb/y94s1ll7+f7UeDZ3epWr0Kl1WPgPVKwCa7AIYumKWi/l4S - rNqCfOmyVGO0CspTKlxvV/ZHk+jAJqKqHmd/QtVxJkMi4a9d1J8BMHWdltfYPvpkJkaKxx9WINZ5v - BftwJv2+35b3ZWGRWYXmCBFUXaV/w6I0+dE51I25k4NZcTMRbR1sGYEXTm5Eu2KBtJ/UbhiKKCk0b - +BTg/BJ/O7lSKl/W3DHnImYv6s65FMGxgHCaKZlN/IWCWLanqi2hg3hmGlDqyZUvezUrcuYEed2et - w6FrGCGg==; -Received: from localhost ([::1] helo=bombadil.infradead.org) - by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) - id 1uE6u7-00000007H4F-41sI; - Sun, 11 May 2025 13:39:43 +0000 -Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) - by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) - id 1uE6mG-00000007GQ2-3M7w - for linux-arm-kernel@lists.infradead.org; - Sun, 11 May 2025 13:31:37 +0000 -Received: by mail-ej1-x62e.google.com with SMTP id - a640c23a62f3a-ad1a87d93f7so576360566b.0 - for ; - Sun, 11 May 2025 06:31:36 -0700 (PDT) -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=gmail.com; s=20230601; t=1746970295; x=1747575095; - darn=lists.infradead.org; - h=cc:to:in-reply-to:references:message-id:content-transfer-encoding - :mime-version:subject:date:from:from:to:cc:subject:date:message-id - :reply-to; - bh=jCnitIQrLGML0v/ZGaz7m1EqKZaS5okX2gqREoZgqFA=; - b=dFmhAe55mI0ZYgTbA9z06jAcGpibU1yIvZWl8vsEWd0Cow+yYkQlcsnlJcoq22vUt+ - An87/vI28iqdwgYZpu+vabyC6ytUUqI5IuqTOlv/QtLak3Oi6cbHjoebb9cVfGhTpO16 - gN8BLLH5Lf9shCAy3lLQahAf3jiE41hB3YKxIusuBnm+DIMYVGMJID5Pt72YgU322uXW - hnMLbX75rnBu5DTGM12UT9+nOkBYjITOdnfEA+o3IVlzUEQRr/G7s9RNKTKnsjJDwaZb - 91UdhJBE/yz2fiFrtN6PGr1B90kJd+GAxRjrbQ8UunMu6C4ggE6aRazKcsQEZIWLa6tR - n/Vg== -X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=1e100.net; s=20230601; t=1746970295; x=1747575095; - h=cc:to:in-reply-to:references:message-id:content-transfer-encoding - :mime-version:subject:date:from:x-gm-message-state:from:to:cc - :subject:date:message-id:reply-to; - bh=jCnitIQrLGML0v/ZGaz7m1EqKZaS5okX2gqREoZgqFA=; - b=tlFtjTi8qCbMBXjF1lESzpnVH51JUuhJV5lirRh7dyHdWcVtBgKdnrbGpR+ZDHFvvV - 1FJUR377ZyrZPwleAZ8bfUcjMx1NSDhxGsHI+05Mpt7LzRZCCUE/nuTHROytYhalDR35 - yh8YprIJwMhZ9zFNNXrZ/GQCPbRMA0fkOJYWCfMRPsf+VGHsDniGzF9Dbsy3aq0hG+mw - 5r85WCALVE55cSW22kla9QPeOxpX6nheglHKz2svFKgo+nI9xXgcR2F9vsSah5DBTxkQ - WK1fEkdtF+6If4W/u3cZ1kQTbkrifLbpV8i+z6VqFq+iRZuf9eZjyyuMXP53A7PQGpW3 - BKKA== -X-Forwarded-Encrypted: i=1; - AJvYcCWtVH3IlKfQOiuwxLM94ic5Bi0XTfGdTLWK5BWhh9b026VHto4M4zjf8wBmIUmekjUFrgWvBcW3eJkv9VuD0NNu@lists.infradead.org -X-Gm-Message-State: AOJu0YxUrhwcNLQkyGCiTZ3Ci5GaLENJhrPiMNwOQ2HqRWQ5fFYTksDJ - 6eb+myA0GGrJOmcEortiBND+ipH4vXcxwtKOVyNjgBBJMq27NJBTQ16Asw== -X-Gm-Gg: ASbGncu1guGFlZm8KpI1qJ3LeFM8WO7ZvfanWSzK7lzUZES0sLxvvjBNy8SgeycdGUF - QifE6Z+xBPK9i0m0CRfzWuNm9a/dr/W14EAzBiSWq5pOW0fbH1rGo/FFbaUZ8T7OroQ0wipdZ9J - tIZJz+dbSRk4kRsYhhm4cJZh4GfKL8me6+8NM/db/a0oKAE0VMhHLmqDw0BFjgpwdWO4YnaUBLt - MU5Pu+S3TKwVV7SHRma2c7662QZ2pxXIngJdGW2qnrr1TejUMaK39IRBPm7sgzBCntS8fd9uVdb - 35NbstsZrboDcHBnDhFroXwe5QWwncAo1aJm/DVM39fE5OCOqNDp7iz6XZbPE/fzVdEDg00L9fR - x8yAy -X-Google-Smtp-Source: - AGHT+IFtWSfALiUVVnpFFz7ImelE+nmATZJYkY40gYG/szbhM9XPyGAl4heVD8RQkSCE7sXqGFzn6Q== -X-Received: by 2002:a17:907:d30e:b0:ad2:4cad:9824 with SMTP id - a640c23a62f3a-ad24cad9bd2mr198358366b.28.1746970294838; - Sun, 11 May 2025 06:31:34 -0700 (PDT) -Received: from [192.168.0.253] (5D59A51C.catv.pool.telekom.hu. [93.89.165.28]) - by smtp.googlemail.com with ESMTPSA id - a640c23a62f3a-ad2197bd398sm466765366b.152.2025.05.11.06.31.33 - (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); - Sun, 11 May 2025 06:31:34 -0700 (PDT) -From: Gabor Juhos -Date: Sun, 11 May 2025 15:31:07 +0200 -Subject: [PATCH 3/3] i2c: pxa: handle 'Early Bus Busy' condition on Armada - 3700 -MIME-Version: 1.0 -Message-Id: - <20250511-i2c-pxa-fix-i2c-communication-v1-3-e9097d09a015@gmail.com> -References: - <20250511-i2c-pxa-fix-i2c-communication-v1-0-e9097d09a015@gmail.com> -In-Reply-To: - <20250511-i2c-pxa-fix-i2c-communication-v1-0-e9097d09a015@gmail.com> -To: Wolfram Sang , Andi Shyti , - Russell King , Andrew Lunn -Cc: Robert Marko , - Linus Walleij , - Russell King , linux-i2c@vger.kernel.org, - linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, - Gabor Juhos , Imre Kaloz , - stable@vger.kernel.org -X-Mailer: b4 0.14.2 -X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 -X-CRM114-CacheID: sfid-20250511_063136_845554_2BF89522 -X-CRM114-Status: GOOD ( 32.59 ) -X-BeenThere: linux-arm-kernel@lists.infradead.org -X-Mailman-Version: 2.1.34 -Precedence: list -List-Id: -List-Unsubscribe: - , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: - , - -Sender: "linux-arm-kernel" -Errors-To: - linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org - -Under some circumstances I2C recovery fails on Armada 3700. At least -on the Methode uDPU board, removing and replugging an SFP module fails -often, like this: - - [ 36.953127] sfp sfp-eth1: module removed - [ 38.468549] i2c i2c-1: i2c_pxa: timeout waiting for bus free - [ 38.486960] sfp sfp-eth1: module MENTECHOPTO POS22-LDCC-KR rev 1.0 sn MNC208U90009 dc 200828 - [ 38.496867] mvneta d0040000.ethernet eth1: unsupported SFP module: no common interface modes - [ 38.521448] hwmon hwmon2: temp1_input not attached to any thermal zone - [ 39.249196] sfp sfp-eth1: module removed - ... - [ 292.568799] sfp sfp-eth1: please wait, module slow to respond - ... - [ 625.208814] sfp sfp-eth1: failed to read EEPROM: -EREMOTEIO - -Note that the 'unsupported SFP module' messages are not relevant. The -module is used only for testing the I2C recovery funcionality, because -the error can be triggered easily with this specific one. - -Enabling debug in the i2c-pxa driver reveals the following: - - [ 82.034678] sfp sfp-eth1: module removed - [ 90.008654] i2c i2c-1: slave_0x50 error: timeout with active message - [ 90.015112] i2c i2c-1: msg_num: 2 msg_idx: 0 msg_ptr: 0 - [ 90.020464] i2c i2c-1: IBMR: 00000003 IDBR: 000000a0 ICR: 000007e0 ISR: 00000802 - [ 90.027906] i2c i2c-1: log: - [ 90.030787] - -This continues until the retries are exhausted ... - - [ 110.192489] i2c i2c-1: slave_0x50 error: exhausted retries - [ 110.198012] i2c i2c-1: msg_num: 2 msg_idx: 0 msg_ptr: 0 - [ 110.203323] i2c i2c-1: IBMR: 00000003 IDBR: 000000a0 ICR: 000007e0 ISR: 00000802 - [ 110.210810] i2c i2c-1: log: - [ 110.213633] - -... then the whole sequence starts again ... - - [ 115.368641] i2c i2c-1: slave_0x50 error: timeout with active message - -... while finally the SFP core gives up: - - [ 671.975258] sfp sfp-eth1: failed to read EEPROM: -EREMOTEIO - -When we analyze the log, it can be seen that bit 1 and 11 is set in the -ISR (Interface Status Register). Bit 1 indicates the ACK/NACK status, but -the purpose of bit 11 is not documented in the driver code unfortunately. - -The 'Functional Specification' document of the Armada 3700 SoCs family -however says that this bit indicates an 'Early Bus Busy' condition. The -document also notes that whenever this bit is set, it is not possible to -initiate a transaction on the I2C bus. The observed behaviour corresponds -to this statement. - -Unfortunately, I2C recovery does not help as it never runs in this -special case. Although the driver checks the busyness of the bus at -several places, but since it does not consider the A3700 specific bit -in these checks it can't determine the actual status of the bus correctly -which results in the errors above. - -In order to fix the problem, add a new member to struct 'i2c_pxa' to -store a controller specific bitmask containing the bits indicating the -busy status, and use that in the code while checking the actual status -of the bus. This ensures that the correct status can be determined on -the Armada 3700 based devices without causing functional changes on -devices based on other SoCs. - -With the change applied, the driver detects the busy condition, and runs -the recovery process: - - [ 742.617312] i2c i2c-1: state:i2c_pxa_wait_bus_not_busy:449: ISR=00000802, ICR=000007e0, IBMR=03 - [ 742.626099] i2c i2c-1: i2c_pxa: timeout waiting for bus free - [ 742.631933] i2c i2c-1: recovery: resetting controller, ISR=0x00000802 - [ 742.638421] i2c i2c-1: recovery: IBMR 0x00000003 ISR 0x00000000 - -This clears the EBB bit in the ISR register, so it makes it possible to -initiate transactions on the I2C bus again. - -After this patch, the SFP module used for testing can be removed and -replugged numerous times without causing the error described at the -beginning. Previously, the error happened after a few such attempts. - -The patch has been tested also with the following kernel versions: -5.10.237, 5.15.182, 6.1.138, 6.6.90, 6.12.28, 6.14.6. It improves -recoverabilty on all of them. - -Cc: stable@vger.kernel.org # 5.8+ -Fixes: 7c9ec2c52518 ("i2c: pxa: implement generic i2c bus recovery") -Signed-off-by: Gabor Juhos -Signed-off-by: Imre Kaloz ---- -Note: the patch is included in this series for completeness however -it can be applied independently from the preceding patches. On kernels -6.3+, it restores I2C functionality even in itself because it recovers -the controller from the bad state described in the previous patch. ---- - drivers/i2c/busses/i2c-pxa.c | 18 ++++++++++++------ - 1 file changed, 12 insertions(+), 6 deletions(-) - ---- a/drivers/i2c/busses/i2c-pxa.c -+++ b/drivers/i2c/busses/i2c-pxa.c -@@ -71,6 +71,7 @@ - #define ISR_GCAD (1 << 8) /* general call address detected */ - #define ISR_SAD (1 << 9) /* slave address detected */ - #define ISR_BED (1 << 10) /* bus error no ACK/NAK */ -+#define ISR_A3700_EBB (1 << 11) /* early bus busy for armada 3700 */ - - #define ILCR_SLV_SHIFT 0 - #define ILCR_SLV_MASK (0x1FF << ILCR_SLV_SHIFT) -@@ -263,6 +264,7 @@ struct pxa_i2c { - bool highmode_enter; - u32 fm_mask; - u32 hs_mask; -+ u32 busy_mask; - - struct i2c_bus_recovery_info recovery; - struct pinctrl *pinctrl; -@@ -430,7 +432,7 @@ static int i2c_pxa_wait_bus_not_busy(str - - while (1) { - isr = readl(_ISR(i2c)); -- if (!(isr & (ISR_IBB | ISR_UB))) -+ if (!(isr & i2c->busy_mask)) - return 0; - - if (isr & ISR_SAD) -@@ -467,7 +469,7 @@ static int i2c_pxa_wait_master(struct px - * quick check of the i2c lines themselves to ensure they've - * gone high... - */ -- if ((readl(_ISR(i2c)) & (ISR_UB | ISR_IBB)) == 0 && -+ if ((readl(_ISR(i2c)) & i2c->busy_mask) == 0 && - readl(_IBMR(i2c)) == (IBMR_SCLS | IBMR_SDAS)) { - if (i2c_debug > 0) - dev_dbg(&i2c->adap.dev, "%s: done\n", __func__); -@@ -488,7 +490,7 @@ static int i2c_pxa_set_master(struct pxa - if (i2c_debug) - dev_dbg(&i2c->adap.dev, "setting to bus master\n"); - -- if ((readl(_ISR(i2c)) & (ISR_UB | ISR_IBB)) != 0) { -+ if ((readl(_ISR(i2c)) & i2c->busy_mask) != 0) { - dev_dbg(&i2c->adap.dev, "%s: unit is busy\n", __func__); - if (!i2c_pxa_wait_master(i2c)) { - dev_dbg(&i2c->adap.dev, "%s: error: unit busy\n", __func__); -@@ -514,7 +516,7 @@ static int i2c_pxa_wait_slave(struct pxa - dev_dbg(&i2c->adap.dev, "%s: %ld: ISR=%08x, ICR=%08x, IBMR=%02x\n", - __func__, (long)jiffies, readl(_ISR(i2c)), readl(_ICR(i2c)), readl(_IBMR(i2c))); - -- if ((readl(_ISR(i2c)) & (ISR_UB|ISR_IBB)) == 0 || -+ if ((readl(_ISR(i2c)) & i2c->busy_mask) == 0 || - (readl(_ISR(i2c)) & ISR_SAD) != 0 || - (readl(_ICR(i2c)) & ICR_SCLE) == 0) { - if (i2c_debug > 1) -@@ -1177,7 +1179,7 @@ static int i2c_pxa_pio_set_master(struct - /* - * Wait for the bus to become free. - */ -- while (timeout-- && readl(_ISR(i2c)) & (ISR_IBB | ISR_UB)) -+ while (timeout-- && readl(_ISR(i2c)) & i2c->busy_mask) - udelay(1000); - - if (timeout < 0) { -@@ -1322,7 +1324,7 @@ static void i2c_pxa_unprepare_recovery(s - * handing control of the bus back to avoid the bus changing state. - */ - isr = readl(_ISR(i2c)); -- if (isr & (ISR_UB | ISR_IBB)) { -+ if (isr & i2c->busy_mask) { - dev_dbg(&i2c->adap.dev, - "recovery: resetting controller, ISR=0x%08x\n", isr); - i2c_pxa_do_reset(i2c); -@@ -1486,6 +1488,10 @@ static int i2c_pxa_probe(struct platform - i2c->fm_mask = pxa_reg_layout[i2c_type].fm; - i2c->hs_mask = pxa_reg_layout[i2c_type].hs; - -+ i2c->busy_mask = ISR_UB | ISR_IBB; -+ if (i2c_type == REGS_A3700) -+ i2c->busy_mask |= ISR_A3700_EBB; -+ - if (i2c_type != REGS_CE4100) - i2c->reg_isar = i2c->reg_base + pxa_reg_layout[i2c_type].isar; - diff --git a/target/linux/mvebu/patches-6.12/901-dt-bindings-Add-IEI-vendor-prefix-and-IEI-WT61P803-P.patch b/target/linux/mvebu/patches-6.12/901-dt-bindings-Add-IEI-vendor-prefix-and-IEI-WT61P803-P.patch deleted file mode 100644 index 90ca8ee3c4..0000000000 --- a/target/linux/mvebu/patches-6.12/901-dt-bindings-Add-IEI-vendor-prefix-and-IEI-WT61P803-P.patch +++ /dev/null @@ -1,206 +0,0 @@ -From aa4a0ccc41997f2da172165c92803abace43bd1c Mon Sep 17 00:00:00 2001 -From: Luka Kovacic -Date: Tue, 24 Aug 2021 12:44:32 +0000 -Subject: [PATCH 1/7] dt-bindings: Add IEI vendor prefix and IEI WT61P803 - PUZZLE driver bindings - -Add the IEI WT61P803 PUZZLE Device Tree bindings for MFD, HWMON and LED -drivers. A new vendor prefix is also added accordingly for -IEI Integration Corp. - -Signed-off-by: Luka Kovacic -Signed-off-by: Pavo Banicevic -Cc: Luka Perkov -Cc: Robert Marko ---- - .../hwmon/iei,wt61p803-puzzle-hwmon.yaml | 53 ++++++++++++ - .../leds/iei,wt61p803-puzzle-leds.yaml | 39 +++++++++ - .../bindings/mfd/iei,wt61p803-puzzle.yaml | 82 +++++++++++++++++++ - 3 files changed, 174 insertions(+) - create mode 100644 Documentation/devicetree/bindings/hwmon/iei,wt61p803-puzzle-hwmon.yaml - create mode 100644 Documentation/devicetree/bindings/leds/iei,wt61p803-puzzle-leds.yaml - create mode 100644 Documentation/devicetree/bindings/mfd/iei,wt61p803-puzzle.yaml - ---- /dev/null -+++ b/Documentation/devicetree/bindings/hwmon/iei,wt61p803-puzzle-hwmon.yaml -@@ -0,0 +1,53 @@ -+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause -+%YAML 1.2 -+--- -+$id: http://devicetree.org/schemas/hwmon/iei,wt61p803-puzzle-hwmon.yaml# -+$schema: http://devicetree.org/meta-schemas/core.yaml# -+ -+title: IEI WT61P803 PUZZLE MCU HWMON module from IEI Integration Corp. -+ -+maintainers: -+ - Luka Kovacic -+ -+description: | -+ This module is a part of the IEI WT61P803 PUZZLE MFD device. For more details -+ see Documentation/devicetree/bindings/mfd/iei,wt61p803-puzzle.yaml. -+ -+ The HWMON module is a sub-node of the MCU node in the Device Tree. -+ -+properties: -+ compatible: -+ const: iei,wt61p803-puzzle-hwmon -+ -+ "#address-cells": -+ const: 1 -+ -+ "#size-cells": -+ const: 0 -+ -+patternProperties: -+ "^fan-group@[0-1]$": -+ type: object -+ properties: -+ reg: -+ minimum: 0 -+ maximum: 1 -+ description: -+ Fan group ID -+ -+ cooling-levels: -+ minItems: 1 -+ maxItems: 255 -+ description: -+ Cooling levels for the fans (PWM value mapping) -+ description: | -+ Properties for each fan group. -+ required: -+ - reg -+ -+required: -+ - compatible -+ - "#address-cells" -+ - "#size-cells" -+ -+additionalProperties: false ---- /dev/null -+++ b/Documentation/devicetree/bindings/leds/iei,wt61p803-puzzle-leds.yaml -@@ -0,0 +1,39 @@ -+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause -+%YAML 1.2 -+--- -+$id: http://devicetree.org/schemas/leds/iei,wt61p803-puzzle-leds.yaml# -+$schema: http://devicetree.org/meta-schemas/core.yaml# -+ -+title: IEI WT61P803 PUZZLE MCU LED module from IEI Integration Corp. -+ -+maintainers: -+ - Luka Kovacic -+ -+description: | -+ This module is a part of the IEI WT61P803 PUZZLE MFD device. For more details -+ see Documentation/devicetree/bindings/mfd/iei,wt61p803-puzzle.yaml. -+ -+ The LED module is a sub-node of the MCU node in the Device Tree. -+ -+properties: -+ compatible: -+ const: iei,wt61p803-puzzle-leds -+ -+ "#address-cells": -+ const: 1 -+ -+ "#size-cells": -+ const: 0 -+ -+ led@0: -+ type: object -+ $ref: common.yaml -+ description: | -+ Properties for a single LED. -+ -+required: -+ - compatible -+ - "#address-cells" -+ - "#size-cells" -+ -+additionalProperties: false ---- /dev/null -+++ b/Documentation/devicetree/bindings/mfd/iei,wt61p803-puzzle.yaml -@@ -0,0 +1,82 @@ -+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause -+%YAML 1.2 -+--- -+$id: http://devicetree.org/schemas/mfd/iei,wt61p803-puzzle.yaml# -+$schema: http://devicetree.org/meta-schemas/core.yaml# -+ -+title: IEI WT61P803 PUZZLE MCU from IEI Integration Corp. -+ -+maintainers: -+ - Luka Kovacic -+ -+description: | -+ IEI WT61P803 PUZZLE MCU is embedded in some IEI Puzzle series boards. -+ It's used for controlling system power states, fans, LEDs and temperature -+ sensors. -+ -+ For Device Tree bindings of other sub-modules (HWMON, LEDs) refer to the -+ binding documents under the respective subsystem directories. -+ -+properties: -+ compatible: -+ const: iei,wt61p803-puzzle -+ -+ current-speed: -+ description: -+ Serial bus speed in bps -+ maxItems: 1 -+ -+ enable-beep: true -+ -+ hwmon: -+ $ref: /schemas/hwmon/iei,wt61p803-puzzle-hwmon.yaml -+ -+ leds: -+ $ref: /schemas/leds/iei,wt61p803-puzzle-leds.yaml -+ -+required: -+ - compatible -+ - current-speed -+ -+additionalProperties: false -+ -+examples: -+ - | -+ #include -+ serial { -+ mcu { -+ compatible = "iei,wt61p803-puzzle"; -+ current-speed = <115200>; -+ enable-beep; -+ -+ leds { -+ compatible = "iei,wt61p803-puzzle-leds"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ led@0 { -+ reg = <0>; -+ function = LED_FUNCTION_POWER; -+ color = ; -+ }; -+ }; -+ -+ hwmon { -+ compatible = "iei,wt61p803-puzzle-hwmon"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ fan-group@0 { -+ #cooling-cells = <2>; -+ reg = <0x00>; -+ cooling-levels = <64 102 170 230 250>; -+ }; -+ -+ fan-group@1 { -+ #cooling-cells = <2>; -+ reg = <0x01>; -+ cooling-levels = <64 102 170 230 250>; -+ }; -+ }; -+ }; -+ }; diff --git a/target/linux/mvebu/patches-6.12/902-drivers-mfd-Add-a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch b/target/linux/mvebu/patches-6.12/902-drivers-mfd-Add-a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch deleted file mode 100644 index 1b2fcc5907..0000000000 --- a/target/linux/mvebu/patches-6.12/902-drivers-mfd-Add-a-driver-for-IEI-WT61P803-PUZZLE-MCU.patch +++ /dev/null @@ -1,1035 +0,0 @@ -From 692cfa85272dd12995b427c0a7a585ced5d54f32 Mon Sep 17 00:00:00 2001 -From: Luka Kovacic -Date: Tue, 24 Aug 2021 12:44:33 +0000 -Subject: [PATCH 2/7] drivers: mfd: Add a driver for IEI WT61P803 PUZZLE MCU - -Add a driver for the IEI WT61P803 PUZZLE microcontroller, used in some -IEI Puzzle series devices. The microcontroller controls system power, -temperature sensors, fans and LEDs. - -This driver implements the core functionality for device communication -over the system serial (serdev bus). It handles MCU messages and the -internal MCU properties. Some properties can be managed over sysfs. - -Signed-off-by: Luka Kovacic -Signed-off-by: Pavo Banicevic -Cc: Luka Perkov -Cc: Robert Marko ---- - drivers/mfd/Kconfig | 9 + - drivers/mfd/Makefile | 1 + - drivers/mfd/iei-wt61p803-puzzle.c | 908 ++++++++++++++++++++++++ - include/linux/mfd/iei-wt61p803-puzzle.h | 66 ++ - 4 files changed, 981 insertions(+) - create mode 100644 drivers/mfd/iei-wt61p803-puzzle.c - create mode 100644 include/linux/mfd/iei-wt61p803-puzzle.h - ---- a/drivers/mfd/Kconfig -+++ b/drivers/mfd/Kconfig -@@ -2367,6 +2367,15 @@ config SGI_MFD_IOC3 - If you have an SGI Origin, Octane, or a PCI IOC3 card, - then say Y. Otherwise say N. - -+config MFD_IEI_WT61P803_PUZZLE -+ tristate "IEI WT61P803 PUZZLE MCU driver" -+ depends on SERIAL_DEV_BUS -+ select MFD_CORE -+ help -+ IEI WT61P803 PUZZLE is a system power management microcontroller -+ used for fan control, temperature sensor reading, LED control -+ and system identification. -+ - config MFD_INTEL_M10_BMC_CORE - tristate - select MFD_CORE ---- a/drivers/mfd/Makefile -+++ b/drivers/mfd/Makefile -@@ -250,6 +250,7 @@ obj-$(CONFIG_MFD_RT4831) += rt4831.o - obj-$(CONFIG_MFD_RT5033) += rt5033.o - obj-$(CONFIG_MFD_RT5120) += rt5120.o - obj-$(CONFIG_MFD_SKY81452) += sky81452.o -+obj-$(CONFIG_MFD_IEI_WT61P803_PUZZLE) += iei-wt61p803-puzzle.o - - obj-$(CONFIG_INTEL_SOC_PMIC) += intel_soc_pmic_crc.o - obj-$(CONFIG_INTEL_SOC_PMIC_BXTWC) += intel_soc_pmic_bxtwc.o ---- /dev/null -+++ b/drivers/mfd/iei-wt61p803-puzzle.c -@@ -0,0 +1,909 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+/* IEI WT61P803 PUZZLE MCU Driver -+ * System management microcontroller for fan control, temperature sensor reading, -+ * LED control and system identification on IEI Puzzle series ARM-based appliances. -+ * -+ * Copyright (C) 2020 Sartura Ltd. -+ * Author: Luka Kovacic -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* start, payload and XOR checksum at end */ -+#define IEI_WT61P803_PUZZLE_MAX_COMMAND_LENGTH (1 + 20 + 1) -+#define IEI_WT61P803_PUZZLE_RESP_BUF_SIZE 512 -+ -+#define IEI_WT61P803_PUZZLE_MAC_LENGTH 17 -+#define IEI_WT61P803_PUZZLE_SN_LENGTH 36 -+#define IEI_WT61P803_PUZZLE_VERSION_LENGTH 6 -+#define IEI_WT61P803_PUZZLE_BUILD_INFO_LENGTH 16 -+#define IEI_WT61P803_PUZZLE_PROTOCOL_VERSION_LENGTH 8 -+#define IEI_WT61P803_PUZZLE_NB_MAC 8 -+ -+/* Use HZ as a timeout value throughout the driver */ -+#define IEI_WT61P803_PUZZLE_GENERAL_TIMEOUT HZ -+ -+enum iei_wt61p803_puzzle_attribute_type { -+ IEI_WT61P803_PUZZLE_VERSION, -+ IEI_WT61P803_PUZZLE_BUILD_INFO, -+ IEI_WT61P803_PUZZLE_BOOTLOADER_MODE, -+ IEI_WT61P803_PUZZLE_PROTOCOL_VERSION, -+ IEI_WT61P803_PUZZLE_SERIAL_NUMBER, -+ IEI_WT61P803_PUZZLE_MAC_ADDRESS, -+ IEI_WT61P803_PUZZLE_AC_RECOVERY_STATUS, -+ IEI_WT61P803_PUZZLE_POWER_LOSS_RECOVERY, -+ IEI_WT61P803_PUZZLE_POWER_STATUS, -+}; -+ -+struct iei_wt61p803_puzzle_device_attribute { -+ struct device_attribute dev_attr; -+ enum iei_wt61p803_puzzle_attribute_type type; -+ u8 index; -+}; -+ -+/** -+ * struct iei_wt61p803_puzzle_mcu_status - MCU flags state -+ * @ac_recovery_status_flag: AC Recovery Status Flag -+ * @power_loss_recovery: System recovery after power loss -+ * @power_status: System Power-on Method -+ */ -+struct iei_wt61p803_puzzle_mcu_status { -+ u8 ac_recovery_status_flag; -+ u8 power_loss_recovery; -+ u8 power_status; -+}; -+ -+/** -+ * struct iei_wt61p803_puzzle_reply - MCU reply -+ * @size: Size of the MCU reply -+ * @data: Full MCU reply buffer -+ * @state: Current state of the packet -+ * @received: Was the response fullfilled -+ */ -+struct iei_wt61p803_puzzle_reply { -+ size_t size; -+ unsigned char data[IEI_WT61P803_PUZZLE_RESP_BUF_SIZE]; -+ struct completion received; -+}; -+ -+/** -+ * struct iei_wt61p803_puzzle_mcu_version - MCU version status -+ * @version: Primary firmware version -+ * @build_info: Build date and time -+ * @bootloader_mode: Status of the MCU operation -+ * @protocol_version: MCU communication protocol version -+ * @serial_number: Device factory serial number -+ * @mac_address: Device factory MAC addresses -+ * -+ * Last element of arrays is reserved for '\0'. -+ */ -+struct iei_wt61p803_puzzle_mcu_version { -+ char version[IEI_WT61P803_PUZZLE_VERSION_LENGTH + 1]; -+ char build_info[IEI_WT61P803_PUZZLE_BUILD_INFO_LENGTH + 1]; -+ bool bootloader_mode; -+ char protocol_version[IEI_WT61P803_PUZZLE_PROTOCOL_VERSION_LENGTH + 1]; -+ char serial_number[IEI_WT61P803_PUZZLE_SN_LENGTH + 1]; -+ char mac_address[IEI_WT61P803_PUZZLE_NB_MAC][IEI_WT61P803_PUZZLE_MAC_LENGTH + 1]; -+}; -+ -+/** -+ * struct iei_wt61p803_puzzle - IEI WT61P803 PUZZLE MCU Driver -+ * @serdev: Pointer to underlying serdev device -+ * @dev: Pointer to underlying dev device -+ * @reply_lock: Reply mutex lock -+ * @reply: Pointer to the iei_wt61p803_puzzle_reply struct -+ * @version: MCU version related data -+ * @status: MCU status related data -+ * @response_buffer Command response buffer allocation -+ * @lock General member mutex lock -+ */ -+struct iei_wt61p803_puzzle { -+ struct serdev_device *serdev; -+ struct device *dev; -+ struct mutex reply_lock; /* lock to prevent multiple firmware calls */ -+ struct iei_wt61p803_puzzle_reply *reply; -+ struct iei_wt61p803_puzzle_mcu_version version; -+ struct iei_wt61p803_puzzle_mcu_status status; -+ unsigned char response_buffer[IEI_WT61P803_PUZZLE_BUF_SIZE]; -+ struct mutex lock; /* lock to protect response buffer */ -+}; -+ -+static unsigned char iei_wt61p803_puzzle_checksum(unsigned char *buf, size_t len) -+{ -+ unsigned char checksum = 0; -+ size_t i; -+ -+ for (i = 0; i < len; i++) -+ checksum ^= buf[i]; -+ return checksum; -+} -+ -+static size_t iei_wt61p803_puzzle_process_resp(struct iei_wt61p803_puzzle *mcu, -+ const u8 *raw_resp_data, size_t size) -+{ -+ unsigned char checksum; -+ -+ /* Check the incoming frame header */ -+ if (!(raw_resp_data[0] == IEI_WT61P803_PUZZLE_CMD_HEADER_START || -+ raw_resp_data[0] == IEI_WT61P803_PUZZLE_CMD_HEADER_START_OTHER || -+ (raw_resp_data[0] == IEI_WT61P803_PUZZLE_CMD_HEADER_EEPROM && -+ raw_resp_data[1] == IEI_WT61P803_PUZZLE_CMD_EEPROM_READ))) { -+ if (mcu->reply->size + size >= sizeof(mcu->reply->data)) -+ return -EIO; -+ -+ /* Append the frame to existing data */ -+ memcpy(mcu->reply->data + mcu->reply->size, raw_resp_data, size); -+ mcu->reply->size += size; -+ } else { -+ if (size >= sizeof(mcu->reply->data)) -+ return -EIO; -+ -+ /* Start processing a new frame */ -+ memcpy(mcu->reply->data, raw_resp_data, size); -+ mcu->reply->size = size; -+ } -+ -+ checksum = iei_wt61p803_puzzle_checksum(mcu->reply->data, mcu->reply->size - 1); -+ if (checksum != mcu->reply->data[mcu->reply->size - 1]) { -+ /* The checksum isn't matched yet, wait for new frames */ -+ return size; -+ } -+ -+ /* Received all the data */ -+ complete(&mcu->reply->received); -+ -+ return size; -+} -+ -+static size_t iei_wt61p803_puzzle_recv_buf(struct serdev_device *serdev, -+ const u8 *data, size_t size) -+{ -+ struct iei_wt61p803_puzzle *mcu = serdev_device_get_drvdata(serdev); -+ size_t ret; -+ -+ ret = iei_wt61p803_puzzle_process_resp(mcu, data, size); -+ /* Return the number of processed bytes if function returns error, -+ * discard the remaining incoming data, since the frame this data -+ * belongs to is broken anyway -+ */ -+ if (ret < 0) -+ return size; -+ -+ return ret; -+} -+ -+static const struct serdev_device_ops iei_wt61p803_puzzle_serdev_device_ops = { -+ .receive_buf = iei_wt61p803_puzzle_recv_buf, -+ .write_wakeup = serdev_device_write_wakeup, -+}; -+ -+/** -+ * iei_wt61p803_puzzle_write_command_watchdog() - Watchdog of the normal cmd -+ * @mcu: Pointer to the iei_wt61p803_puzzle core MFD struct -+ * @cmd: Pointer to the char array to send (size should be content + 1 (xor)) -+ * @size: Size of the cmd char array -+ * @reply_data: Pointer to the reply/response data array (should be allocated) -+ * @reply_size: Pointer to size_t (size of reply_data) -+ * @retry_count: Number of times to retry sending the command to the MCU -+ */ -+int iei_wt61p803_puzzle_write_command_watchdog(struct iei_wt61p803_puzzle *mcu, -+ unsigned char *cmd, size_t size, -+ unsigned char *reply_data, -+ size_t *reply_size, int retry_count) -+{ -+ struct device *dev = &mcu->serdev->dev; -+ int ret, i; -+ -+ for (i = 0; i < retry_count; i++) { -+ ret = iei_wt61p803_puzzle_write_command(mcu, cmd, size, -+ reply_data, reply_size); -+ if (ret != -ETIMEDOUT) -+ return ret; -+ } -+ -+ dev_err(dev, "Command response timed out. Retries: %d\n", retry_count); -+ -+ return -ETIMEDOUT; -+} -+EXPORT_SYMBOL_GPL(iei_wt61p803_puzzle_write_command_watchdog); -+ -+/** -+ * iei_wt61p803_puzzle_write_command() - Send a structured command to the MCU -+ * @mcu: Pointer to the iei_wt61p803_puzzle core MFD struct -+ * @cmd: Pointer to the char array to send (size should be content + 1 (xor)) -+ * @size: Size of the cmd char array -+ * @reply_data: Pointer to the reply/response data array (should be allocated) -+ * -+ * Sends a structured command to the MCU. -+ */ -+int iei_wt61p803_puzzle_write_command(struct iei_wt61p803_puzzle *mcu, -+ unsigned char *cmd, size_t size, -+ unsigned char *reply_data, -+ size_t *reply_size) -+{ -+ struct device *dev = &mcu->serdev->dev; -+ int ret; -+ -+ if (size <= 1 || size > IEI_WT61P803_PUZZLE_MAX_COMMAND_LENGTH) -+ return -EINVAL; -+ -+ mutex_lock(&mcu->reply_lock); -+ -+ cmd[size - 1] = iei_wt61p803_puzzle_checksum(cmd, size - 1); -+ -+ /* Initialize reply struct */ -+ reinit_completion(&mcu->reply->received); -+ mcu->reply->size = 0; -+ usleep_range(2000, 10000); -+ serdev_device_write_flush(mcu->serdev); -+ ret = serdev_device_write_buf(mcu->serdev, cmd, size); -+ if (ret < 0) -+ goto exit; -+ -+ serdev_device_wait_until_sent(mcu->serdev, IEI_WT61P803_PUZZLE_GENERAL_TIMEOUT); -+ ret = wait_for_completion_timeout(&mcu->reply->received, -+ IEI_WT61P803_PUZZLE_GENERAL_TIMEOUT); -+ if (ret == 0) { -+ dev_err(dev, "Command reply receive timeout\n"); -+ ret = -ETIMEDOUT; -+ goto exit; -+ } -+ -+ *reply_size = mcu->reply->size; -+ /* Copy the received data, as it will not be available after a new frame is received */ -+ memcpy(reply_data, mcu->reply->data, mcu->reply->size); -+ ret = 0; -+exit: -+ mutex_unlock(&mcu->reply_lock); -+ return ret; -+} -+EXPORT_SYMBOL_GPL(iei_wt61p803_puzzle_write_command); -+ -+static int iei_wt61p803_puzzle_buzzer(struct iei_wt61p803_puzzle *mcu, bool long_beep) -+{ -+ unsigned char *resp_buf = mcu->response_buffer; -+ unsigned char buzzer_cmd[4] = {}; -+ size_t reply_size; -+ int ret; -+ -+ buzzer_cmd[0] = IEI_WT61P803_PUZZLE_CMD_HEADER_START; -+ buzzer_cmd[1] = IEI_WT61P803_PUZZLE_CMD_FUNCTION_SINGLE; -+ buzzer_cmd[2] = long_beep ? '3' : '2'; /* Buzzer 1.5 / 0.5 second beep */ -+ -+ mutex_lock(&mcu->lock); -+ ret = iei_wt61p803_puzzle_write_command(mcu, buzzer_cmd, sizeof(buzzer_cmd), -+ resp_buf, &reply_size); -+ if (ret) -+ goto exit; -+ -+ if (reply_size != 3) { -+ ret = -EIO; -+ goto exit; -+ } -+ -+ if (!(resp_buf[0] == IEI_WT61P803_PUZZLE_CMD_HEADER_START && -+ resp_buf[1] == IEI_WT61P803_PUZZLE_CMD_RESPONSE_OK && -+ resp_buf[2] == IEI_WT61P803_PUZZLE_CHECKSUM_RESPONSE_OK)) { -+ ret = -EPROTO; -+ goto exit; -+ } -+exit: -+ mutex_unlock(&mcu->lock); -+ return ret; -+} -+ -+static int iei_wt61p803_puzzle_get_version(struct iei_wt61p803_puzzle *mcu) -+{ -+ unsigned char version_cmd[3] = { -+ IEI_WT61P803_PUZZLE_CMD_HEADER_START_OTHER, -+ IEI_WT61P803_PUZZLE_CMD_OTHER_VERSION, -+ }; -+ unsigned char build_info_cmd[3] = { -+ IEI_WT61P803_PUZZLE_CMD_HEADER_START_OTHER, -+ IEI_WT61P803_PUZZLE_CMD_OTHER_BUILD, -+ }; -+ unsigned char bootloader_mode_cmd[3] = { -+ IEI_WT61P803_PUZZLE_CMD_HEADER_START_OTHER, -+ IEI_WT61P803_PUZZLE_CMD_OTHER_BOOTLOADER_MODE, -+ }; -+ unsigned char protocol_version_cmd[3] = { -+ IEI_WT61P803_PUZZLE_CMD_HEADER_START_OTHER, -+ IEI_WT61P803_PUZZLE_CMD_OTHER_PROTOCOL_VERSION, -+ }; -+ unsigned char *rb = mcu->response_buffer; -+ size_t reply_size; -+ int ret; -+ -+ mutex_lock(&mcu->lock); -+ -+ ret = iei_wt61p803_puzzle_write_command(mcu, version_cmd, sizeof(version_cmd), -+ rb, &reply_size); -+ if (ret) -+ goto err; -+ if (reply_size < 7) { -+ ret = -EIO; -+ goto err; -+ } -+ sprintf(mcu->version.version, "v%c.%.3s", rb[2], &rb[3]); -+ -+ ret = iei_wt61p803_puzzle_write_command(mcu, build_info_cmd, -+ sizeof(build_info_cmd), rb, -+ &reply_size); -+ if (ret) -+ goto err; -+ if (reply_size < 15) { -+ ret = -EIO; -+ goto err; -+ } -+ sprintf(mcu->version.build_info, "%c%c/%c%c/%.4s %c%c:%c%c", -+ rb[8], rb[9], rb[6], rb[7], &rb[2], rb[10], rb[11], -+ rb[12], rb[13]); -+ -+ ret = iei_wt61p803_puzzle_write_command(mcu, bootloader_mode_cmd, -+ sizeof(bootloader_mode_cmd), rb, -+ &reply_size); -+ if (ret) -+ goto err; -+ if (reply_size < 4) { -+ ret = -EIO; -+ goto err; -+ } -+ if (rb[2] == IEI_WT61P803_PUZZLE_CMD_OTHER_MODE_APPS) -+ mcu->version.bootloader_mode = false; -+ else if (rb[2] == IEI_WT61P803_PUZZLE_CMD_OTHER_MODE_BOOTLOADER) -+ mcu->version.bootloader_mode = true; -+ -+ ret = iei_wt61p803_puzzle_write_command(mcu, protocol_version_cmd, -+ sizeof(protocol_version_cmd), rb, -+ &reply_size); -+ if (ret) -+ goto err; -+ if (reply_size < 9) { -+ ret = -EIO; -+ goto err; -+ } -+ sprintf(mcu->version.protocol_version, "v%c.%c%c%c%c%c", -+ rb[7], rb[6], rb[5], rb[4], rb[3], rb[2]); -+err: -+ mutex_unlock(&mcu->lock); -+ return ret; -+} -+ -+static int iei_wt61p803_puzzle_get_mcu_status(struct iei_wt61p803_puzzle *mcu) -+{ -+ unsigned char mcu_status_cmd[5] = { -+ IEI_WT61P803_PUZZLE_CMD_HEADER_START, -+ IEI_WT61P803_PUZZLE_CMD_FUNCTION_OTHER, -+ IEI_WT61P803_PUZZLE_CMD_FUNCTION_OTHER_STATUS, -+ IEI_WT61P803_PUZZLE_CMD_FUNCTION_OTHER_STATUS, -+ }; -+ unsigned char *resp_buf = mcu->response_buffer; -+ size_t reply_size; -+ int ret; -+ -+ mutex_lock(&mcu->lock); -+ ret = iei_wt61p803_puzzle_write_command(mcu, mcu_status_cmd, sizeof(mcu_status_cmd), -+ resp_buf, &reply_size); -+ if (ret) -+ goto exit; -+ if (reply_size < 20) { -+ ret = -EIO; -+ goto exit; -+ } -+ -+ /* Response format: -+ * (IDX RESPONSE) -+ * 0 @ -+ * 1 O -+ * 2 S -+ * 3 S -+ * ... -+ * 5 AC Recovery Status Flag -+ * ... -+ * 10 Power Loss Recovery -+ * ... -+ * 19 Power Status (system power on method) -+ * 20 XOR checksum -+ */ -+ if (resp_buf[0] == IEI_WT61P803_PUZZLE_CMD_HEADER_START && -+ resp_buf[1] == IEI_WT61P803_PUZZLE_CMD_FUNCTION_OTHER && -+ resp_buf[2] == IEI_WT61P803_PUZZLE_CMD_FUNCTION_OTHER_STATUS && -+ resp_buf[3] == IEI_WT61P803_PUZZLE_CMD_FUNCTION_OTHER_STATUS) { -+ mcu->status.ac_recovery_status_flag = resp_buf[5]; -+ mcu->status.power_loss_recovery = resp_buf[10]; -+ mcu->status.power_status = resp_buf[19]; -+ } -+exit: -+ mutex_unlock(&mcu->lock); -+ return ret; -+} -+ -+static int iei_wt61p803_puzzle_get_serial_number(struct iei_wt61p803_puzzle *mcu) -+{ -+ unsigned char *resp_buf = mcu->response_buffer; -+ unsigned char serial_number_cmd[5] = { -+ IEI_WT61P803_PUZZLE_CMD_HEADER_EEPROM, -+ IEI_WT61P803_PUZZLE_CMD_EEPROM_READ, -+ 0x00, /* EEPROM read address */ -+ 0x24, /* Data length */ -+ }; -+ size_t reply_size; -+ int ret; -+ -+ mutex_lock(&mcu->lock); -+ ret = iei_wt61p803_puzzle_write_command(mcu, serial_number_cmd, -+ sizeof(serial_number_cmd), -+ resp_buf, &reply_size); -+ if (ret) -+ goto err; -+ -+ if (reply_size < IEI_WT61P803_PUZZLE_SN_LENGTH + 4) { -+ ret = -EIO; -+ goto err; -+ } -+ -+ memcpy(mcu->version.serial_number, resp_buf + 4, IEI_WT61P803_PUZZLE_SN_LENGTH); -+err: -+ mutex_unlock(&mcu->lock); -+ return ret; -+} -+ -+static int iei_wt61p803_puzzle_write_serial_number(struct iei_wt61p803_puzzle *mcu, -+ unsigned char serial_number[36]) -+{ -+ unsigned char *resp_buf = mcu->response_buffer; -+ unsigned char serial_number_header[4] = { -+ IEI_WT61P803_PUZZLE_CMD_HEADER_EEPROM, -+ IEI_WT61P803_PUZZLE_CMD_EEPROM_WRITE, -+ 0x00, /* EEPROM write address */ -+ 0xC, /* Data length */ -+ }; -+ unsigned char serial_number_cmd[4 + 12 + 1]; /* header, serial number, XOR checksum */ -+ int ret, sn_counter; -+ size_t reply_size; -+ -+ /* The MCU can only handle 22 byte messages, send the S/N in 12 byte chunks */ -+ mutex_lock(&mcu->lock); -+ for (sn_counter = 0; sn_counter < 3; sn_counter++) { -+ serial_number_header[2] = 0x0 + 0xC * sn_counter; -+ -+ memcpy(serial_number_cmd, serial_number_header, sizeof(serial_number_header)); -+ memcpy(serial_number_cmd + sizeof(serial_number_header), -+ serial_number + 0xC * sn_counter, 0xC); -+ -+ ret = iei_wt61p803_puzzle_write_command(mcu, serial_number_cmd, -+ sizeof(serial_number_cmd), -+ resp_buf, &reply_size); -+ if (ret) -+ goto err; -+ if (reply_size != 3) { -+ ret = -EIO; -+ goto err; -+ } -+ if (!(resp_buf[0] == IEI_WT61P803_PUZZLE_CMD_HEADER_START && -+ resp_buf[1] == IEI_WT61P803_PUZZLE_CMD_RESPONSE_OK && -+ resp_buf[2] == IEI_WT61P803_PUZZLE_CHECKSUM_RESPONSE_OK)) { -+ ret = -EPROTO; -+ goto err; -+ } -+ } -+ -+ memcpy(mcu->version.serial_number, serial_number, IEI_WT61P803_PUZZLE_SN_LENGTH); -+err: -+ mutex_unlock(&mcu->lock); -+ return ret; -+} -+ -+static int iei_wt61p803_puzzle_get_mac_address(struct iei_wt61p803_puzzle *mcu, int index) -+{ -+ unsigned char *resp_buf = mcu->response_buffer; -+ unsigned char mac_address_cmd[5] = { -+ IEI_WT61P803_PUZZLE_CMD_HEADER_EEPROM, -+ IEI_WT61P803_PUZZLE_CMD_EEPROM_READ, -+ 0x00, /* EEPROM read address */ -+ 0x11, /* Data length */ -+ }; -+ size_t reply_size; -+ int ret; -+ -+ mutex_lock(&mcu->lock); -+ mac_address_cmd[2] = 0x24 + 0x11 * index; -+ -+ ret = iei_wt61p803_puzzle_write_command(mcu, mac_address_cmd, -+ sizeof(mac_address_cmd), -+ resp_buf, &reply_size); -+ if (ret) -+ goto err; -+ -+ if (reply_size < 22) { -+ ret = -EIO; -+ goto err; -+ } -+ -+ memcpy(mcu->version.mac_address[index], resp_buf + 4, IEI_WT61P803_PUZZLE_MAC_LENGTH); -+err: -+ mutex_unlock(&mcu->lock); -+ return ret; -+} -+ -+static int -+iei_wt61p803_puzzle_write_mac_address(struct iei_wt61p803_puzzle *mcu, -+ unsigned char mac_address[IEI_WT61P803_PUZZLE_MAC_LENGTH], -+ int mac_address_idx) -+{ -+ unsigned char mac_address_cmd[4 + IEI_WT61P803_PUZZLE_MAC_LENGTH + 1]; -+ unsigned char *resp_buf = mcu->response_buffer; -+ unsigned char mac_address_header[4] = { -+ IEI_WT61P803_PUZZLE_CMD_HEADER_EEPROM, -+ IEI_WT61P803_PUZZLE_CMD_EEPROM_WRITE, -+ 0x00, /* EEPROM write address */ -+ 0x11, /* Data length */ -+ }; -+ size_t reply_size; -+ int ret; -+ -+ if (mac_address_idx < 0 || mac_address_idx >= IEI_WT61P803_PUZZLE_NB_MAC) -+ return -EINVAL; -+ -+ mac_address_header[2] = 0x24 + 0x11 * mac_address_idx; -+ -+ /* Concat mac_address_header, mac_address to mac_address_cmd */ -+ memcpy(mac_address_cmd, mac_address_header, sizeof(mac_address_header)); -+ memcpy(mac_address_cmd + sizeof(mac_address_header), mac_address, -+ IEI_WT61P803_PUZZLE_MAC_LENGTH); -+ -+ mutex_lock(&mcu->lock); -+ ret = iei_wt61p803_puzzle_write_command(mcu, mac_address_cmd, -+ sizeof(mac_address_cmd), -+ resp_buf, &reply_size); -+ if (ret) -+ goto err; -+ if (reply_size != 3) { -+ ret = -EIO; -+ goto err; -+ } -+ if (!(resp_buf[0] == IEI_WT61P803_PUZZLE_CMD_HEADER_START && -+ resp_buf[1] == IEI_WT61P803_PUZZLE_CMD_RESPONSE_OK && -+ resp_buf[2] == IEI_WT61P803_PUZZLE_CHECKSUM_RESPONSE_OK)) { -+ ret = -EPROTO; -+ goto err; -+ } -+ -+ memcpy(mcu->version.mac_address[mac_address_idx], mac_address, -+ IEI_WT61P803_PUZZLE_MAC_LENGTH); -+err: -+ mutex_unlock(&mcu->lock); -+ return ret; -+} -+ -+static int iei_wt61p803_puzzle_write_power_loss_recovery(struct iei_wt61p803_puzzle *mcu, -+ int power_loss_recovery_action) -+{ -+ unsigned char *resp_buf = mcu->response_buffer; -+ unsigned char power_loss_recovery_cmd[5] = {}; -+ size_t reply_size; -+ int ret; -+ -+ if (power_loss_recovery_action < 0 || power_loss_recovery_action > 4) -+ return -EINVAL; -+ -+ power_loss_recovery_cmd[0] = IEI_WT61P803_PUZZLE_CMD_HEADER_START; -+ power_loss_recovery_cmd[1] = IEI_WT61P803_PUZZLE_CMD_FUNCTION_OTHER; -+ power_loss_recovery_cmd[2] = IEI_WT61P803_PUZZLE_CMD_FUNCTION_OTHER_POWER_LOSS; -+ power_loss_recovery_cmd[3] = hex_asc[power_loss_recovery_action]; -+ -+ mutex_lock(&mcu->lock); -+ ret = iei_wt61p803_puzzle_write_command(mcu, power_loss_recovery_cmd, -+ sizeof(power_loss_recovery_cmd), -+ resp_buf, &reply_size); -+ if (ret) -+ goto exit; -+ mcu->status.power_loss_recovery = power_loss_recovery_action; -+exit: -+ mutex_unlock(&mcu->lock); -+ return ret; -+} -+ -+#define to_puzzle_dev_attr(_attr) \ -+ container_of(_attr, struct iei_wt61p803_puzzle_device_attribute, dev_attr) -+ -+static ssize_t show_output(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ struct iei_wt61p803_puzzle *mcu = dev_get_drvdata(dev); -+ struct iei_wt61p803_puzzle_device_attribute *pattr = to_puzzle_dev_attr(attr); -+ int ret; -+ -+ switch (pattr->type) { -+ case IEI_WT61P803_PUZZLE_VERSION: -+ return scnprintf(buf, PAGE_SIZE, "%s\n", mcu->version.version); -+ case IEI_WT61P803_PUZZLE_BUILD_INFO: -+ return scnprintf(buf, PAGE_SIZE, "%s\n", mcu->version.build_info); -+ case IEI_WT61P803_PUZZLE_BOOTLOADER_MODE: -+ return scnprintf(buf, PAGE_SIZE, "%d\n", mcu->version.bootloader_mode); -+ case IEI_WT61P803_PUZZLE_PROTOCOL_VERSION: -+ return scnprintf(buf, PAGE_SIZE, "%s\n", mcu->version.protocol_version); -+ case IEI_WT61P803_PUZZLE_SERIAL_NUMBER: -+ ret = iei_wt61p803_puzzle_get_serial_number(mcu); -+ if (!ret) -+ ret = scnprintf(buf, PAGE_SIZE, "%s\n", mcu->version.serial_number); -+ else -+ ret = 0; -+ return ret; -+ case IEI_WT61P803_PUZZLE_MAC_ADDRESS: -+ ret = iei_wt61p803_puzzle_get_mac_address(mcu, pattr->index); -+ if (!ret) -+ ret = scnprintf(buf, PAGE_SIZE, "%s\n", -+ mcu->version.mac_address[pattr->index]); -+ else -+ ret = 0; -+ return ret; -+ case IEI_WT61P803_PUZZLE_AC_RECOVERY_STATUS: -+ case IEI_WT61P803_PUZZLE_POWER_LOSS_RECOVERY: -+ case IEI_WT61P803_PUZZLE_POWER_STATUS: -+ ret = iei_wt61p803_puzzle_get_mcu_status(mcu); -+ if (ret) -+ return ret; -+ -+ mutex_lock(&mcu->lock); -+ switch (pattr->type) { -+ case IEI_WT61P803_PUZZLE_AC_RECOVERY_STATUS: -+ ret = scnprintf(buf, PAGE_SIZE, "%x\n", -+ mcu->status.ac_recovery_status_flag); -+ break; -+ case IEI_WT61P803_PUZZLE_POWER_LOSS_RECOVERY: -+ ret = scnprintf(buf, PAGE_SIZE, "%x\n", mcu->status.power_loss_recovery); -+ break; -+ case IEI_WT61P803_PUZZLE_POWER_STATUS: -+ ret = scnprintf(buf, PAGE_SIZE, "%x\n", mcu->status.power_status); -+ break; -+ default: -+ ret = 0; -+ break; -+ } -+ mutex_unlock(&mcu->lock); -+ return ret; -+ default: -+ return 0; -+ } -+ -+ return 0; -+} -+ -+static ssize_t store_output(struct device *dev, -+ struct device_attribute *attr, -+ const char *buf, size_t len) -+{ -+ unsigned char serial_number[IEI_WT61P803_PUZZLE_SN_LENGTH]; -+ unsigned char mac_address[IEI_WT61P803_PUZZLE_MAC_LENGTH]; -+ struct iei_wt61p803_puzzle *mcu = dev_get_drvdata(dev); -+ struct iei_wt61p803_puzzle_device_attribute *pattr = to_puzzle_dev_attr(attr); -+ int power_loss_recovery_action = 0; -+ int ret; -+ -+ switch (pattr->type) { -+ case IEI_WT61P803_PUZZLE_SERIAL_NUMBER: -+ if (len != (size_t)(IEI_WT61P803_PUZZLE_SN_LENGTH + 1)) -+ return -EINVAL; -+ memcpy(serial_number, buf, sizeof(serial_number)); -+ ret = iei_wt61p803_puzzle_write_serial_number(mcu, serial_number); -+ if (ret) -+ return ret; -+ return len; -+ case IEI_WT61P803_PUZZLE_MAC_ADDRESS: -+ if (len != (size_t)(IEI_WT61P803_PUZZLE_MAC_LENGTH + 1)) -+ return -EINVAL; -+ -+ memcpy(mac_address, buf, sizeof(mac_address)); -+ -+ if (strlen(attr->attr.name) != 13) -+ return -EIO; -+ -+ ret = iei_wt61p803_puzzle_write_mac_address(mcu, mac_address, pattr->index); -+ if (ret) -+ return ret; -+ return len; -+ case IEI_WT61P803_PUZZLE_POWER_LOSS_RECOVERY: -+ ret = kstrtoint(buf, 10, &power_loss_recovery_action); -+ if (ret) -+ return ret; -+ ret = iei_wt61p803_puzzle_write_power_loss_recovery(mcu, -+ power_loss_recovery_action); -+ if (ret) -+ return ret; -+ return len; -+ default: -+ return -EINVAL; -+ } -+ -+ return 0; -+} -+ -+#define IEI_WT61P803_PUZZLE_ATTR(_name, _mode, _show, _store, _type, _index) \ -+ struct iei_wt61p803_puzzle_device_attribute dev_attr_##_name = \ -+ { .dev_attr = __ATTR(_name, _mode, _show, _store), \ -+ .type = _type, \ -+ .index = _index } -+ -+#define IEI_WT61P803_PUZZLE_ATTR_RO(_name, _type, _id) \ -+ IEI_WT61P803_PUZZLE_ATTR(_name, 0444, show_output, NULL, _type, _id) -+ -+#define IEI_WT61P803_PUZZLE_ATTR_RW(_name, _type, _id) \ -+ IEI_WT61P803_PUZZLE_ATTR(_name, 0644, show_output, store_output, _type, _id) -+ -+static IEI_WT61P803_PUZZLE_ATTR_RO(version, IEI_WT61P803_PUZZLE_VERSION, 0); -+static IEI_WT61P803_PUZZLE_ATTR_RO(build_info, IEI_WT61P803_PUZZLE_BUILD_INFO, 0); -+static IEI_WT61P803_PUZZLE_ATTR_RO(bootloader_mode, IEI_WT61P803_PUZZLE_BOOTLOADER_MODE, 0); -+static IEI_WT61P803_PUZZLE_ATTR_RO(protocol_version, IEI_WT61P803_PUZZLE_PROTOCOL_VERSION, 0); -+static IEI_WT61P803_PUZZLE_ATTR_RW(serial_number, IEI_WT61P803_PUZZLE_SERIAL_NUMBER, 0); -+static IEI_WT61P803_PUZZLE_ATTR_RW(mac_address_0, IEI_WT61P803_PUZZLE_MAC_ADDRESS, 0); -+static IEI_WT61P803_PUZZLE_ATTR_RW(mac_address_1, IEI_WT61P803_PUZZLE_MAC_ADDRESS, 1); -+static IEI_WT61P803_PUZZLE_ATTR_RW(mac_address_2, IEI_WT61P803_PUZZLE_MAC_ADDRESS, 2); -+static IEI_WT61P803_PUZZLE_ATTR_RW(mac_address_3, IEI_WT61P803_PUZZLE_MAC_ADDRESS, 3); -+static IEI_WT61P803_PUZZLE_ATTR_RW(mac_address_4, IEI_WT61P803_PUZZLE_MAC_ADDRESS, 4); -+static IEI_WT61P803_PUZZLE_ATTR_RW(mac_address_5, IEI_WT61P803_PUZZLE_MAC_ADDRESS, 5); -+static IEI_WT61P803_PUZZLE_ATTR_RW(mac_address_6, IEI_WT61P803_PUZZLE_MAC_ADDRESS, 6); -+static IEI_WT61P803_PUZZLE_ATTR_RW(mac_address_7, IEI_WT61P803_PUZZLE_MAC_ADDRESS, 7); -+static IEI_WT61P803_PUZZLE_ATTR_RO(ac_recovery_status, IEI_WT61P803_PUZZLE_AC_RECOVERY_STATUS, 0); -+static IEI_WT61P803_PUZZLE_ATTR_RW(power_loss_recovery, IEI_WT61P803_PUZZLE_POWER_LOSS_RECOVERY, 0); -+static IEI_WT61P803_PUZZLE_ATTR_RO(power_status, IEI_WT61P803_PUZZLE_POWER_STATUS, 0); -+ -+static struct attribute *iei_wt61p803_puzzle_attrs[] = { -+ &dev_attr_version.dev_attr.attr, -+ &dev_attr_build_info.dev_attr.attr, -+ &dev_attr_bootloader_mode.dev_attr.attr, -+ &dev_attr_protocol_version.dev_attr.attr, -+ &dev_attr_serial_number.dev_attr.attr, -+ &dev_attr_mac_address_0.dev_attr.attr, -+ &dev_attr_mac_address_1.dev_attr.attr, -+ &dev_attr_mac_address_2.dev_attr.attr, -+ &dev_attr_mac_address_3.dev_attr.attr, -+ &dev_attr_mac_address_4.dev_attr.attr, -+ &dev_attr_mac_address_5.dev_attr.attr, -+ &dev_attr_mac_address_6.dev_attr.attr, -+ &dev_attr_mac_address_7.dev_attr.attr, -+ &dev_attr_ac_recovery_status.dev_attr.attr, -+ &dev_attr_power_loss_recovery.dev_attr.attr, -+ &dev_attr_power_status.dev_attr.attr, -+ NULL -+}; -+ATTRIBUTE_GROUPS(iei_wt61p803_puzzle); -+ -+static int iei_wt61p803_puzzle_sysfs_create(struct device *dev, -+ struct iei_wt61p803_puzzle *mcu) -+{ -+ int ret; -+ -+ ret = sysfs_create_groups(&mcu->dev->kobj, iei_wt61p803_puzzle_groups); -+ if (ret) -+ mfd_remove_devices(mcu->dev); -+ -+ return ret; -+} -+ -+static int iei_wt61p803_puzzle_sysfs_remove(struct device *dev, -+ struct iei_wt61p803_puzzle *mcu) -+{ -+ /* Remove sysfs groups */ -+ sysfs_remove_groups(&mcu->dev->kobj, iei_wt61p803_puzzle_groups); -+ mfd_remove_devices(mcu->dev); -+ -+ return 0; -+} -+ -+static int iei_wt61p803_puzzle_probe(struct serdev_device *serdev) -+{ -+ struct device *dev = &serdev->dev; -+ struct iei_wt61p803_puzzle *mcu; -+ u32 baud; -+ int ret; -+ -+ /* Read the baud rate from 'current-speed', because the MCU supports different rates */ -+ if (device_property_read_u32(dev, "current-speed", &baud)) { -+ dev_err(dev, -+ "'current-speed' is not specified in device node\n"); -+ return -EINVAL; -+ } -+ dev_dbg(dev, "Driver baud rate: %d\n", baud); -+ -+ /* Allocate the memory */ -+ mcu = devm_kzalloc(dev, sizeof(*mcu), GFP_KERNEL); -+ if (!mcu) -+ return -ENOMEM; -+ -+ mcu->reply = devm_kzalloc(dev, sizeof(*mcu->reply), GFP_KERNEL); -+ if (!mcu->reply) -+ return -ENOMEM; -+ -+ /* Initialize device struct data */ -+ mcu->serdev = serdev; -+ mcu->dev = dev; -+ init_completion(&mcu->reply->received); -+ ret = devm_mutex_init(dev, &mcu->reply_lock); -+ if (ret) -+ return ret; -+ ret = devm_mutex_init(dev, &mcu->lock); -+ if (ret) -+ return ret; -+ -+ /* Setup UART interface */ -+ serdev_device_set_drvdata(serdev, mcu); -+ serdev_device_set_client_ops(serdev, &iei_wt61p803_puzzle_serdev_device_ops); -+ ret = devm_serdev_device_open(dev, serdev); -+ if (ret) -+ return ret; -+ serdev_device_set_baudrate(serdev, baud); -+ serdev_device_set_flow_control(serdev, false); -+ ret = serdev_device_set_parity(serdev, SERDEV_PARITY_NONE); -+ if (ret) { -+ dev_err(dev, "Failed to set parity\n"); -+ return ret; -+ } -+ -+ ret = iei_wt61p803_puzzle_get_version(mcu); -+ if (ret) -+ return ret; -+ -+ dev_dbg(dev, "MCU version: %s\n", mcu->version.version); -+ dev_dbg(dev, "MCU firmware build info: %s\n", mcu->version.build_info); -+ dev_dbg(dev, "MCU in bootloader mode: %s\n", -+ mcu->version.bootloader_mode ? "true" : "false"); -+ dev_dbg(dev, "MCU protocol version: %s\n", mcu->version.protocol_version); -+ -+ if (device_property_read_bool(dev, "enable-beep")) { -+ ret = iei_wt61p803_puzzle_buzzer(mcu, false); -+ if (ret) -+ return ret; -+ } -+ -+ ret = iei_wt61p803_puzzle_sysfs_create(dev, mcu); -+ if (ret) -+ return ret; -+ -+ return devm_of_platform_populate(dev); -+} -+ -+static void iei_wt61p803_puzzle_remove(struct serdev_device *serdev) -+{ -+ struct device *dev = &serdev->dev; -+ struct iei_wt61p803_puzzle *mcu = dev_get_drvdata(dev); -+ -+ iei_wt61p803_puzzle_sysfs_remove(dev, mcu); -+} -+ -+static const struct of_device_id iei_wt61p803_puzzle_dt_ids[] = { -+ { .compatible = "iei,wt61p803-puzzle" }, -+ { } -+}; -+ -+MODULE_DEVICE_TABLE(of, iei_wt61p803_puzzle_dt_ids); -+ -+static struct serdev_device_driver iei_wt61p803_puzzle_drv = { -+ .probe = iei_wt61p803_puzzle_probe, -+ .remove = iei_wt61p803_puzzle_remove, -+ .driver = { -+ .name = "iei-wt61p803-puzzle", -+ .of_match_table = iei_wt61p803_puzzle_dt_ids, -+ }, -+}; -+ -+module_serdev_device_driver(iei_wt61p803_puzzle_drv); -+ -+MODULE_LICENSE("GPL v2"); -+MODULE_AUTHOR("Luka Kovacic "); -+MODULE_DESCRIPTION("IEI WT61P803 PUZZLE MCU Driver"); ---- /dev/null -+++ b/include/linux/mfd/iei-wt61p803-puzzle.h -@@ -0,0 +1,66 @@ -+/* SPDX-License-Identifier: GPL-2.0-only */ -+/* IEI WT61P803 PUZZLE MCU Driver -+ * System management microcontroller for fan control, temperature sensor reading, -+ * LED control and system identification on IEI Puzzle series ARM-based appliances. -+ * -+ * Copyright (C) 2020 Sartura Ltd. -+ * Author: Luka Kovacic -+ */ -+ -+#ifndef _MFD_IEI_WT61P803_PUZZLE_H_ -+#define _MFD_IEI_WT61P803_PUZZLE_H_ -+ -+#define IEI_WT61P803_PUZZLE_BUF_SIZE 512 -+ -+/* Command magic numbers */ -+#define IEI_WT61P803_PUZZLE_CMD_HEADER_START 0x40 /* @ */ -+#define IEI_WT61P803_PUZZLE_CMD_HEADER_START_OTHER 0x25 /* % */ -+#define IEI_WT61P803_PUZZLE_CMD_HEADER_EEPROM 0xF7 -+ -+#define IEI_WT61P803_PUZZLE_CMD_RESPONSE_OK 0x30 /* 0 */ -+#define IEI_WT61P803_PUZZLE_CHECKSUM_RESPONSE_OK 0x70 -+ -+#define IEI_WT61P803_PUZZLE_CMD_EEPROM_READ 0xA1 -+#define IEI_WT61P803_PUZZLE_CMD_EEPROM_WRITE 0xA0 -+ -+#define IEI_WT61P803_PUZZLE_CMD_OTHER_VERSION 0x56 /* V */ -+#define IEI_WT61P803_PUZZLE_CMD_OTHER_BUILD 0x42 /* B */ -+#define IEI_WT61P803_PUZZLE_CMD_OTHER_BOOTLOADER_MODE 0x4D /* M */ -+#define IEI_WT61P803_PUZZLE_CMD_OTHER_MODE_BOOTLOADER 0x30 -+#define IEI_WT61P803_PUZZLE_CMD_OTHER_MODE_APPS 0x31 -+#define IEI_WT61P803_PUZZLE_CMD_OTHER_PROTOCOL_VERSION 0x50 /* P */ -+ -+#define IEI_WT61P803_PUZZLE_CMD_FUNCTION_SINGLE 0x43 /* C */ -+#define IEI_WT61P803_PUZZLE_CMD_FUNCTION_OTHER 0x4F /* O */ -+#define IEI_WT61P803_PUZZLE_CMD_FUNCTION_OTHER_STATUS 0x53 /* S */ -+#define IEI_WT61P803_PUZZLE_CMD_FUNCTION_OTHER_POWER_LOSS 0x41 /* A */ -+ -+#define IEI_WT61P803_PUZZLE_CMD_LED 0x52 /* R */ -+#define IEI_WT61P803_PUZZLE_CMD_LED_POWER 0x31 /* 1 */ -+ -+#define IEI_WT61P803_PUZZLE_CMD_TEMP 0x54 /* T */ -+#define IEI_WT61P803_PUZZLE_CMD_TEMP_ALL 0x41 /* A */ -+ -+#define IEI_WT61P803_PUZZLE_CMD_FAN 0x46 /* F */ -+#define IEI_WT61P803_PUZZLE_CMD_FAN_PWM_READ 0x5A /* Z */ -+#define IEI_WT61P803_PUZZLE_CMD_FAN_PWM_WRITE 0x57 /* W */ -+#define IEI_WT61P803_PUZZLE_CMD_FAN_PWM_BASE 0x30 -+#define IEI_WT61P803_PUZZLE_CMD_FAN_RPM_BASE 0x41 /* A */ -+ -+#define IEI_WT61P803_PUZZLE_CMD_FAN_PWM(x) (IEI_WT61P803_PUZZLE_CMD_FAN_PWM_BASE + (x)) /* 0 - 1 */ -+#define IEI_WT61P803_PUZZLE_CMD_FAN_RPM(x) (IEI_WT61P803_PUZZLE_CMD_FAN_RPM_BASE + (x)) /* 0 - 5 */ -+ -+struct iei_wt61p803_puzzle_mcu_version; -+struct iei_wt61p803_puzzle_reply; -+struct iei_wt61p803_puzzle; -+ -+int iei_wt61p803_puzzle_write_command_watchdog(struct iei_wt61p803_puzzle *mcu, -+ unsigned char *cmd, size_t size, -+ unsigned char *reply_data, size_t *reply_size, -+ int retry_count); -+ -+int iei_wt61p803_puzzle_write_command(struct iei_wt61p803_puzzle *mcu, -+ unsigned char *cmd, size_t size, -+ unsigned char *reply_data, size_t *reply_size); -+ -+#endif /* _MFD_IEI_WT61P803_PUZZLE_H_ */ diff --git a/target/linux/mvebu/patches-6.12/903-drivers-hwmon-Add-the-IEI-WT61P803-PUZZLE-HWMON-driv.patch b/target/linux/mvebu/patches-6.12/903-drivers-hwmon-Add-the-IEI-WT61P803-PUZZLE-HWMON-driv.patch deleted file mode 100644 index 9f23e72730..0000000000 --- a/target/linux/mvebu/patches-6.12/903-drivers-hwmon-Add-the-IEI-WT61P803-PUZZLE-HWMON-driv.patch +++ /dev/null @@ -1,498 +0,0 @@ -From e3310a638cd310bfd93dbbc6d2732ab6aea18dd2 Mon Sep 17 00:00:00 2001 -From: Luka Kovacic -Date: Tue, 24 Aug 2021 12:44:34 +0000 -Subject: [PATCH 3/7] drivers: hwmon: Add the IEI WT61P803 PUZZLE HWMON driver - -Add the IEI WT61P803 PUZZLE HWMON driver, that handles the fan speed -control via PWM, reading fan speed and reading on-board temperature -sensors. - -The driver registers a HWMON device and a simple thermal cooling device to -enable in-kernel fan management. - -This driver depends on the IEI WT61P803 PUZZLE MFD driver. - -Signed-off-by: Luka Kovacic -Signed-off-by: Pavo Banicevic -Acked-by: Guenter Roeck -Cc: Luka Perkov -Cc: Robert Marko ---- - drivers/hwmon/Kconfig | 8 + - drivers/hwmon/Makefile | 1 + - drivers/hwmon/iei-wt61p803-puzzle-hwmon.c | 445 ++++++++++++++++++++++ - 3 files changed, 454 insertions(+) - create mode 100644 drivers/hwmon/iei-wt61p803-puzzle-hwmon.c - ---- a/drivers/hwmon/Kconfig -+++ b/drivers/hwmon/Kconfig -@@ -828,6 +828,14 @@ config SENSORS_IBMPOWERNV - This driver can also be built as a module. If so, the module - will be called ibmpowernv. - -+config SENSORS_IEI_WT61P803_PUZZLE_HWMON -+ tristate "IEI WT61P803 PUZZLE MFD HWMON Driver" -+ depends on MFD_IEI_WT61P803_PUZZLE -+ help -+ The IEI WT61P803 PUZZLE MFD HWMON Driver handles reading fan speed -+ and writing fan PWM values. It also supports reading on-board -+ temperature sensors. -+ - config SENSORS_IIO_HWMON - tristate "Hwmon driver that uses channels specified via iio maps" - depends on IIO ---- a/drivers/hwmon/Makefile -+++ b/drivers/hwmon/Makefile -@@ -94,6 +94,7 @@ obj-$(CONFIG_SENSORS_HS3001) += hs3001.o - obj-$(CONFIG_SENSORS_ULTRA45) += ultra45_env.o - obj-$(CONFIG_SENSORS_I5500) += i5500_temp.o - obj-$(CONFIG_SENSORS_I5K_AMB) += i5k_amb.o -+obj-$(CONFIG_SENSORS_IEI_WT61P803_PUZZLE_HWMON) += iei-wt61p803-puzzle-hwmon.o - obj-$(CONFIG_SENSORS_IBMAEM) += ibmaem.o - obj-$(CONFIG_SENSORS_IBMPEX) += ibmpex.o - obj-$(CONFIG_SENSORS_IBMPOWERNV)+= ibmpowernv.o ---- /dev/null -+++ b/drivers/hwmon/iei-wt61p803-puzzle-hwmon.c -@@ -0,0 +1,442 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+/* IEI WT61P803 PUZZLE MCU HWMON Driver -+ * -+ * Copyright (C) 2020 Sartura Ltd. -+ * Author: Luka Kovacic -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#define IEI_WT61P803_PUZZLE_HWMON_MAX_PWM 2 -+#define IEI_WT61P803_PUZZLE_HWMON_MAX_PWM_VAL 255 -+ -+/** -+ * struct iei_wt61p803_puzzle_thermal_cooling_device - Thermal cooling device instance -+ * @mcu_hwmon: Parent driver struct pointer -+ * @tcdev: Thermal cooling device pointer -+ * @name: Thermal cooling device name -+ * @pwm_channel: Controlled PWM channel (0 or 1) -+ * @cur_level: Current cooling level -+ * @num_levels: Number of cooling levels -+ * @cooling_levels: Thermal cooling device cooling levels (DT) -+ */ -+struct iei_wt61p803_puzzle_thermal_cooling_device { -+ struct iei_wt61p803_puzzle_hwmon *mcu_hwmon; -+ struct thermal_cooling_device *tcdev; -+ char name[THERMAL_NAME_LENGTH]; -+ int pwm_channel; -+ int cur_level; -+ u8 num_levels; -+ u32 cooling_levels[] __counted_by(num_levels); -+}; -+ -+/** -+ * struct iei_wt61p803_puzzle_hwmon - MCU HWMON Driver -+ * @mcu: MCU struct pointer -+ * @response_buffer Global MCU response buffer -+ * @thermal_cooling_dev_present: Per-channel thermal cooling device control indicator -+ * @cdev: Per-channel thermal cooling device private structure -+ */ -+struct iei_wt61p803_puzzle_hwmon { -+ struct iei_wt61p803_puzzle *mcu; -+ unsigned char response_buffer[IEI_WT61P803_PUZZLE_BUF_SIZE]; -+ bool thermal_cooling_dev_present[IEI_WT61P803_PUZZLE_HWMON_MAX_PWM]; -+ struct iei_wt61p803_puzzle_thermal_cooling_device -+ *cdev[IEI_WT61P803_PUZZLE_HWMON_MAX_PWM]; -+ struct mutex lock; /* mutex to protect response_buffer array */ -+}; -+ -+#define raw_temp_to_milidegree_celsius(x) (((x) - 0x80) * 1000) -+static int iei_wt61p803_puzzle_read_temp_sensor(struct iei_wt61p803_puzzle_hwmon *mcu_hwmon, -+ int channel, long *value) -+{ -+ unsigned char *resp_buf = mcu_hwmon->response_buffer; -+ unsigned char temp_sensor_ntc_cmd[4] = { -+ IEI_WT61P803_PUZZLE_CMD_HEADER_START, -+ IEI_WT61P803_PUZZLE_CMD_TEMP, -+ IEI_WT61P803_PUZZLE_CMD_TEMP_ALL, -+ }; -+ size_t reply_size; -+ int ret; -+ -+ mutex_lock(&mcu_hwmon->lock); -+ ret = iei_wt61p803_puzzle_write_command(mcu_hwmon->mcu, temp_sensor_ntc_cmd, -+ sizeof(temp_sensor_ntc_cmd), resp_buf, -+ &reply_size); -+ if (ret) -+ goto exit; -+ -+ if (reply_size != 7) { -+ ret = -EIO; -+ goto exit; -+ } -+ -+ /* Check the number of NTC values */ -+ if (resp_buf[3] != '2') { -+ ret = -EIO; -+ goto exit; -+ } -+ -+ *value = raw_temp_to_milidegree_celsius(resp_buf[4 + channel]); -+exit: -+ mutex_unlock(&mcu_hwmon->lock); -+ return ret; -+} -+ -+#define raw_fan_val_to_rpm(x, y) ((((x) << 8 | (y)) / 2) * 60) -+static int iei_wt61p803_puzzle_read_fan_speed(struct iei_wt61p803_puzzle_hwmon *mcu_hwmon, -+ int channel, long *value) -+{ -+ unsigned char *resp_buf = mcu_hwmon->response_buffer; -+ unsigned char fan_speed_cmd[4] = {}; -+ size_t reply_size; -+ int ret; -+ -+ fan_speed_cmd[0] = IEI_WT61P803_PUZZLE_CMD_HEADER_START; -+ fan_speed_cmd[1] = IEI_WT61P803_PUZZLE_CMD_FAN; -+ fan_speed_cmd[2] = IEI_WT61P803_PUZZLE_CMD_FAN_RPM(channel); -+ -+ mutex_lock(&mcu_hwmon->lock); -+ ret = iei_wt61p803_puzzle_write_command(mcu_hwmon->mcu, fan_speed_cmd, -+ sizeof(fan_speed_cmd), resp_buf, -+ &reply_size); -+ if (ret) -+ goto exit; -+ -+ if (reply_size != 7) { -+ ret = -EIO; -+ goto exit; -+ } -+ -+ *value = raw_fan_val_to_rpm(resp_buf[3], resp_buf[4]); -+exit: -+ mutex_unlock(&mcu_hwmon->lock); -+ return ret; -+} -+ -+static int iei_wt61p803_puzzle_write_pwm_channel(struct iei_wt61p803_puzzle_hwmon *mcu_hwmon, -+ int channel, long pwm_set_val) -+{ -+ unsigned char *resp_buf = mcu_hwmon->response_buffer; -+ unsigned char pwm_set_cmd[6] = {}; -+ size_t reply_size; -+ int ret; -+ -+ pwm_set_cmd[0] = IEI_WT61P803_PUZZLE_CMD_HEADER_START; -+ pwm_set_cmd[1] = IEI_WT61P803_PUZZLE_CMD_FAN; -+ pwm_set_cmd[2] = IEI_WT61P803_PUZZLE_CMD_FAN_PWM_WRITE; -+ pwm_set_cmd[3] = IEI_WT61P803_PUZZLE_CMD_FAN_PWM(channel); -+ pwm_set_cmd[4] = pwm_set_val; -+ -+ mutex_lock(&mcu_hwmon->lock); -+ ret = iei_wt61p803_puzzle_write_command(mcu_hwmon->mcu, pwm_set_cmd, -+ sizeof(pwm_set_cmd), resp_buf, -+ &reply_size); -+ if (ret) -+ goto exit; -+ -+ if (reply_size != 3) { -+ ret = -EIO; -+ goto exit; -+ } -+ -+ if (!(resp_buf[0] == IEI_WT61P803_PUZZLE_CMD_HEADER_START && -+ resp_buf[1] == IEI_WT61P803_PUZZLE_CMD_RESPONSE_OK && -+ resp_buf[2] == IEI_WT61P803_PUZZLE_CHECKSUM_RESPONSE_OK)) { -+ ret = -EIO; -+ goto exit; -+ } -+exit: -+ mutex_unlock(&mcu_hwmon->lock); -+ return ret; -+} -+ -+static int iei_wt61p803_puzzle_read_pwm_channel(struct iei_wt61p803_puzzle_hwmon *mcu_hwmon, -+ int channel, long *value) -+{ -+ unsigned char *resp_buf = mcu_hwmon->response_buffer; -+ unsigned char pwm_get_cmd[5] = {}; -+ size_t reply_size; -+ int ret; -+ -+ pwm_get_cmd[0] = IEI_WT61P803_PUZZLE_CMD_HEADER_START; -+ pwm_get_cmd[1] = IEI_WT61P803_PUZZLE_CMD_FAN; -+ pwm_get_cmd[2] = IEI_WT61P803_PUZZLE_CMD_FAN_PWM_READ; -+ pwm_get_cmd[3] = IEI_WT61P803_PUZZLE_CMD_FAN_PWM(channel); -+ -+ ret = iei_wt61p803_puzzle_write_command(mcu_hwmon->mcu, pwm_get_cmd, -+ sizeof(pwm_get_cmd), resp_buf, -+ &reply_size); -+ if (ret) -+ return ret; -+ -+ if (reply_size != 5) -+ return -EIO; -+ -+ if (resp_buf[2] != IEI_WT61P803_PUZZLE_CMD_FAN_PWM_READ) -+ return -EIO; -+ -+ *value = resp_buf[3]; -+ -+ return 0; -+} -+ -+static int iei_wt61p803_puzzle_read(struct device *dev, enum hwmon_sensor_types type, -+ u32 attr, int channel, long *val) -+{ -+ struct iei_wt61p803_puzzle_hwmon *mcu_hwmon = dev_get_drvdata(dev->parent); -+ -+ switch (type) { -+ case hwmon_pwm: -+ return iei_wt61p803_puzzle_read_pwm_channel(mcu_hwmon, channel, val); -+ case hwmon_fan: -+ return iei_wt61p803_puzzle_read_fan_speed(mcu_hwmon, channel, val); -+ case hwmon_temp: -+ return iei_wt61p803_puzzle_read_temp_sensor(mcu_hwmon, channel, val); -+ default: -+ return -EINVAL; -+ } -+} -+ -+static int iei_wt61p803_puzzle_write(struct device *dev, enum hwmon_sensor_types type, -+ u32 attr, int channel, long val) -+{ -+ struct iei_wt61p803_puzzle_hwmon *mcu_hwmon = dev_get_drvdata(dev->parent); -+ -+ return iei_wt61p803_puzzle_write_pwm_channel(mcu_hwmon, channel, val); -+} -+ -+static umode_t iei_wt61p803_puzzle_is_visible(const void *data, enum hwmon_sensor_types type, -+ u32 attr, int channel) -+{ -+ const struct iei_wt61p803_puzzle_hwmon *mcu_hwmon = data; -+ -+ switch (type) { -+ case hwmon_pwm: -+ if (mcu_hwmon->thermal_cooling_dev_present[channel]) -+ return 0444; -+ if (attr == hwmon_pwm_input) -+ return 0644; -+ break; -+ case hwmon_fan: -+ if (attr == hwmon_fan_input) -+ return 0444; -+ break; -+ case hwmon_temp: -+ if (attr == hwmon_temp_input) -+ return 0444; -+ break; -+ default: -+ return 0; -+ } -+ -+ return 0; -+} -+ -+static const struct hwmon_ops iei_wt61p803_puzzle_hwmon_ops = { -+ .is_visible = iei_wt61p803_puzzle_is_visible, -+ .read = iei_wt61p803_puzzle_read, -+ .write = iei_wt61p803_puzzle_write, -+}; -+ -+static const struct hwmon_channel_info *iei_wt61p803_puzzle_info[] = { -+ HWMON_CHANNEL_INFO(pwm, -+ HWMON_PWM_INPUT, -+ HWMON_PWM_INPUT), -+ HWMON_CHANNEL_INFO(fan, -+ HWMON_F_INPUT, -+ HWMON_F_INPUT, -+ HWMON_F_INPUT, -+ HWMON_F_INPUT, -+ HWMON_F_INPUT), -+ HWMON_CHANNEL_INFO(temp, -+ HWMON_T_INPUT, -+ HWMON_T_INPUT), -+ NULL -+}; -+ -+static const struct hwmon_chip_info iei_wt61p803_puzzle_chip_info = { -+ .ops = &iei_wt61p803_puzzle_hwmon_ops, -+ .info = iei_wt61p803_puzzle_info, -+}; -+ -+static int iei_wt61p803_puzzle_get_max_state(struct thermal_cooling_device *tcdev, -+ unsigned long *state) -+{ -+ struct iei_wt61p803_puzzle_thermal_cooling_device *cdev = tcdev->devdata; -+ -+ if (!cdev) -+ return -EINVAL; -+ -+ *state = cdev->num_levels - 1; -+ return 0; -+} -+ -+static int iei_wt61p803_puzzle_get_cur_state(struct thermal_cooling_device *tcdev, -+ unsigned long *state) -+{ -+ struct iei_wt61p803_puzzle_thermal_cooling_device *cdev = tcdev->devdata; -+ -+ if (!cdev) -+ return -EINVAL; -+ -+ if (cdev->cur_level < 0) -+ return -EAGAIN; -+ -+ *state = cdev->cur_level; -+ return 0; -+} -+ -+static int iei_wt61p803_puzzle_set_cur_state(struct thermal_cooling_device *tcdev, -+ unsigned long state) -+{ -+ struct iei_wt61p803_puzzle_thermal_cooling_device *cdev = tcdev->devdata; -+ u8 pwm_level; -+ -+ if (!cdev) -+ return -EINVAL; -+ -+ if (state >= cdev->num_levels) -+ return -EINVAL; -+ -+ if (state == cdev->cur_level) -+ return 0; -+ -+ cdev->cur_level = state; -+ pwm_level = cdev->cooling_levels[state]; -+ -+ return iei_wt61p803_puzzle_write_pwm_channel(cdev->mcu_hwmon, cdev->pwm_channel, pwm_level); -+} -+ -+static const struct thermal_cooling_device_ops iei_wt61p803_puzzle_cooling_ops = { -+ .get_max_state = iei_wt61p803_puzzle_get_max_state, -+ .get_cur_state = iei_wt61p803_puzzle_get_cur_state, -+ .set_cur_state = iei_wt61p803_puzzle_set_cur_state, -+}; -+ -+static int -+iei_wt61p803_puzzle_enable_thermal_cooling_dev(struct device *dev, -+ struct fwnode_handle *child, -+ struct iei_wt61p803_puzzle_hwmon *mcu_hwmon) -+{ -+ struct iei_wt61p803_puzzle_thermal_cooling_device *cdev; -+ u32 pwm_channel; -+ u8 num_levels; -+ int i, ret; -+ -+ ret = fwnode_property_read_u32(child, "reg", &pwm_channel); -+ if (ret) -+ return ret; -+ -+ mcu_hwmon->thermal_cooling_dev_present[pwm_channel] = true; -+ -+ num_levels = fwnode_property_count_u32(child, "cooling-levels"); -+ if (!num_levels) -+ return -EINVAL; -+ -+ cdev = devm_kzalloc(dev, struct_size(cdev, cooling_levels, num_levels), GFP_KERNEL); -+ if (!cdev) -+ return -ENOMEM; -+ -+ cdev->num_levels = num_levels; -+ -+ ret = fwnode_property_read_u32_array(child, "cooling-levels", -+ cdev->cooling_levels, -+ num_levels); -+ if (ret) { -+ dev_err(dev, "Couldn't read property 'cooling-levels'\n"); -+ return ret; -+ } -+ -+ for (i = 0; i < num_levels; i++) { -+ if (cdev->cooling_levels[i] > -+ IEI_WT61P803_PUZZLE_HWMON_MAX_PWM_VAL) { -+ dev_err(dev, "iei_wt61p803_fan state[%d]:%d > %d\n", i, -+ cdev->cooling_levels[i], -+ IEI_WT61P803_PUZZLE_HWMON_MAX_PWM_VAL); -+ return -EINVAL; -+ } -+ } -+ -+ cdev->mcu_hwmon = mcu_hwmon; -+ cdev->pwm_channel = pwm_channel; -+ cdev->cur_level = -1; -+ mcu_hwmon->cdev[pwm_channel] = cdev; -+ -+ snprintf(cdev->name, THERMAL_NAME_LENGTH, "wt61p803_puzzle_%d", pwm_channel); -+ cdev->tcdev = devm_thermal_of_cooling_device_register(dev, to_of_node(child), cdev->name, -+ cdev, &iei_wt61p803_puzzle_cooling_ops); -+ if (IS_ERR(cdev->tcdev)) -+ return PTR_ERR(cdev->tcdev); -+ -+ return 0; -+} -+ -+static int iei_wt61p803_puzzle_hwmon_probe(struct platform_device *pdev) -+{ -+ struct device *dev = &pdev->dev; -+ struct iei_wt61p803_puzzle *mcu = dev_get_drvdata(dev->parent); -+ struct iei_wt61p803_puzzle_hwmon *mcu_hwmon; -+ struct device *hwmon_dev; -+ int ret; -+ -+ mcu_hwmon = devm_kzalloc(dev, sizeof(*mcu_hwmon), GFP_KERNEL); -+ if (!mcu_hwmon) -+ return -ENOMEM; -+ -+ mcu_hwmon->mcu = mcu; -+ platform_set_drvdata(pdev, mcu_hwmon); -+ ret = devm_mutex_init(dev, &mcu_hwmon->lock); -+ if (ret) -+ return ret; -+ -+ hwmon_dev = devm_hwmon_device_register_with_info(dev, "iei_wt61p803_puzzle", -+ mcu_hwmon, -+ &iei_wt61p803_puzzle_chip_info, -+ NULL); -+ if (IS_ERR(hwmon_dev)) -+ return PTR_ERR(hwmon_dev); -+ -+ /* Control fans via PWM lines via Linux Kernel */ -+ if (IS_ENABLED(CONFIG_THERMAL)) { -+ device_for_each_child_node_scoped(dev, child) { -+ ret = iei_wt61p803_puzzle_enable_thermal_cooling_dev(dev, child, mcu_hwmon); -+ if (ret) { -+ dev_err(dev, "Enabling the PWM fan failed\n"); -+ return ret; -+ } -+ } -+ } -+ return 0; -+} -+ -+static const struct of_device_id iei_wt61p803_puzzle_hwmon_id_table[] = { -+ { .compatible = "iei,wt61p803-puzzle-hwmon" }, -+ {} -+}; -+MODULE_DEVICE_TABLE(of, iei_wt61p803_puzzle_hwmon_id_table); -+ -+static struct platform_driver iei_wt61p803_puzzle_hwmon_driver = { -+ .driver = { -+ .name = "iei-wt61p803-puzzle-hwmon", -+ .of_match_table = iei_wt61p803_puzzle_hwmon_id_table, -+ }, -+ .probe = iei_wt61p803_puzzle_hwmon_probe, -+}; -+ -+module_platform_driver(iei_wt61p803_puzzle_hwmon_driver); -+ -+MODULE_DESCRIPTION("IEI WT61P803 PUZZLE MCU HWMON Driver"); -+MODULE_AUTHOR("Luka Kovacic "); -+MODULE_LICENSE("GPL v2"); diff --git a/target/linux/mvebu/patches-6.12/904-drivers-leds-Add-the-IEI-WT61P803-PUZZLE-LED-driver.patch b/target/linux/mvebu/patches-6.12/904-drivers-leds-Add-the-IEI-WT61P803-PUZZLE-LED-driver.patch deleted file mode 100644 index ae49291998..0000000000 --- a/target/linux/mvebu/patches-6.12/904-drivers-leds-Add-the-IEI-WT61P803-PUZZLE-LED-driver.patch +++ /dev/null @@ -1,207 +0,0 @@ -From f3b44eb69cc561cf05d00506dcec0dd9be003ed8 Mon Sep 17 00:00:00 2001 -From: Luka Kovacic -Date: Tue, 24 Aug 2021 12:44:35 +0000 -Subject: [PATCH 4/7] drivers: leds: Add the IEI WT61P803 PUZZLE LED driver - -Add support for the IEI WT61P803 PUZZLE LED driver. -Currently only the front panel power LED is supported, -since it is the only LED on this board wired through the -MCU. - -The LED is wired directly to the on-board MCU controller -and is toggled using an MCU command. - -Support for more LEDs is going to be added in case more -boards implement this microcontroller, as LEDs use many -different GPIOs. - -This driver depends on the IEI WT61P803 PUZZLE MFD driver. - -Signed-off-by: Luka Kovacic -Signed-off-by: Pavo Banicevic -Cc: Luka Perkov -Cc: Robert Marko ---- - drivers/leds/Kconfig | 8 ++ - drivers/leds/Makefile | 1 + - drivers/leds/leds-iei-wt61p803-puzzle.c | 147 ++++++++++++++++++++++++ - 3 files changed, 156 insertions(+) - create mode 100644 drivers/leds/leds-iei-wt61p803-puzzle.c - ---- a/drivers/leds/Kconfig -+++ b/drivers/leds/Kconfig -@@ -354,6 +354,14 @@ config LEDS_IPAQ_MICRO - Choose this option if you want to use the notification LED on - Compaq/HP iPAQ h3100 and h3600. - -+config LEDS_IEI_WT61P803_PUZZLE -+ tristate "LED Support for the IEI WT61P803 PUZZLE MCU" -+ depends on LEDS_CLASS -+ depends on MFD_IEI_WT61P803_PUZZLE -+ help -+ This option enables support for LEDs controlled by the IEI WT61P803 -+ M801 MCU. -+ - config LEDS_HP6XX - tristate "LED Support for the HP Jornada 6xx" - depends on LEDS_CLASS ---- a/drivers/leds/Makefile -+++ b/drivers/leds/Makefile -@@ -35,6 +35,7 @@ obj-$(CONFIG_LEDS_HP6XX) += leds-hp6xx. - obj-$(CONFIG_LEDS_INTEL_SS4200) += leds-ss4200.o - obj-$(CONFIG_LEDS_IP30) += leds-ip30.o - obj-$(CONFIG_LEDS_IPAQ_MICRO) += leds-ipaq-micro.o -+obj-$(CONFIG_LEDS_IEI_WT61P803_PUZZLE) += leds-iei-wt61p803-puzzle.o - obj-$(CONFIG_LEDS_IS31FL319X) += leds-is31fl319x.o - obj-$(CONFIG_LEDS_IS31FL32XX) += leds-is31fl32xx.o - obj-$(CONFIG_LEDS_LM3530) += leds-lm3530.o ---- /dev/null -+++ b/drivers/leds/leds-iei-wt61p803-puzzle.c -@@ -0,0 +1,147 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+/* IEI WT61P803 PUZZLE MCU LED Driver -+ * -+ * Copyright (C) 2020 Sartura Ltd. -+ * Author: Luka Kovacic -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+enum iei_wt61p803_puzzle_led_state { -+ IEI_LED_OFF = 0x30, -+ IEI_LED_ON = 0x31, -+ IEI_LED_BLINK_5HZ = 0x32, -+ IEI_LED_BLINK_1HZ = 0x33, -+}; -+ -+/** -+ * struct iei_wt61p803_puzzle_led - MCU LED Driver -+ * @cdev: LED classdev -+ * @mcu: MCU struct pointer -+ * @response_buffer Global MCU response buffer -+ * @lock: General mutex lock to protect simultaneous R/W access to led_power_state -+ * @led_power_state: State of the front panel power LED -+ */ -+struct iei_wt61p803_puzzle_led { -+ struct led_classdev cdev; -+ struct iei_wt61p803_puzzle *mcu; -+ unsigned char response_buffer[IEI_WT61P803_PUZZLE_BUF_SIZE]; -+ struct mutex lock; /* mutex to protect led_power_state */ -+ int led_power_state; -+}; -+ -+static inline struct iei_wt61p803_puzzle_led *cdev_to_iei_wt61p803_puzzle_led -+ (struct led_classdev *led_cdev) -+{ -+ return container_of(led_cdev, struct iei_wt61p803_puzzle_led, cdev); -+} -+ -+static int iei_wt61p803_puzzle_led_brightness_set_blocking(struct led_classdev *cdev, -+ enum led_brightness brightness) -+{ -+ struct iei_wt61p803_puzzle_led *priv = cdev_to_iei_wt61p803_puzzle_led(cdev); -+ unsigned char *resp_buf = priv->response_buffer; -+ unsigned char led_power_cmd[5] = {}; -+ size_t reply_size; -+ int ret; -+ -+ led_power_cmd[0] = IEI_WT61P803_PUZZLE_CMD_HEADER_START; -+ led_power_cmd[1] = IEI_WT61P803_PUZZLE_CMD_LED; -+ led_power_cmd[2] = IEI_WT61P803_PUZZLE_CMD_LED_POWER; -+ led_power_cmd[3] = brightness == LED_OFF ? IEI_LED_OFF : IEI_LED_ON; -+ -+ ret = iei_wt61p803_puzzle_write_command(priv->mcu, led_power_cmd, -+ sizeof(led_power_cmd), -+ resp_buf, -+ &reply_size); -+ if (ret) -+ return ret; -+ -+ if (reply_size != 3) -+ return -EIO; -+ -+ if (!(resp_buf[0] == IEI_WT61P803_PUZZLE_CMD_HEADER_START && -+ resp_buf[1] == IEI_WT61P803_PUZZLE_CMD_RESPONSE_OK && -+ resp_buf[2] == IEI_WT61P803_PUZZLE_CHECKSUM_RESPONSE_OK)) -+ return -EIO; -+ -+ mutex_lock(&priv->lock); -+ priv->led_power_state = brightness; -+ mutex_unlock(&priv->lock); -+ -+ return 0; -+} -+ -+static enum led_brightness iei_wt61p803_puzzle_led_brightness_get(struct led_classdev *cdev) -+{ -+ struct iei_wt61p803_puzzle_led *priv = cdev_to_iei_wt61p803_puzzle_led(cdev); -+ int led_state; -+ -+ mutex_lock(&priv->lock); -+ led_state = priv->led_power_state; -+ mutex_unlock(&priv->lock); -+ -+ return led_state; -+} -+ -+static int iei_wt61p803_puzzle_led_probe(struct platform_device *pdev) -+{ -+ struct device *dev = &pdev->dev; -+ struct iei_wt61p803_puzzle *mcu = dev_get_drvdata(dev->parent); -+ struct iei_wt61p803_puzzle_led *priv; -+ struct led_init_data init_data = {}; -+ struct fwnode_handle *child; -+ int ret; -+ -+ if (device_get_child_node_count(dev) != 1) -+ return -EINVAL; -+ -+ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); -+ if (!priv) -+ return -ENOMEM; -+ -+ priv->mcu = mcu; -+ priv->led_power_state = 1; -+ mutex_init(&priv->lock); -+ dev_set_drvdata(dev, priv); -+ -+ child = device_get_next_child_node(dev, NULL); -+ init_data.fwnode = child; -+ -+ priv->cdev.brightness_set_blocking = iei_wt61p803_puzzle_led_brightness_set_blocking; -+ priv->cdev.brightness_get = iei_wt61p803_puzzle_led_brightness_get; -+ priv->cdev.max_brightness = 1; -+ -+ ret = devm_led_classdev_register_ext(dev, &priv->cdev, &init_data); -+ if (ret) -+ dev_err(dev, "Could not register LED\n"); -+ -+ fwnode_handle_put(child); -+ return ret; -+} -+ -+static const struct of_device_id iei_wt61p803_puzzle_led_of_match[] = { -+ { .compatible = "iei,wt61p803-puzzle-leds" }, -+ { } -+}; -+MODULE_DEVICE_TABLE(of, iei_wt61p803_puzzle_led_of_match); -+ -+static struct platform_driver iei_wt61p803_puzzle_led_driver = { -+ .driver = { -+ .name = "iei-wt61p803-puzzle-led", -+ .of_match_table = iei_wt61p803_puzzle_led_of_match, -+ }, -+ .probe = iei_wt61p803_puzzle_led_probe, -+}; -+module_platform_driver(iei_wt61p803_puzzle_led_driver); -+ -+MODULE_DESCRIPTION("IEI WT61P803 PUZZLE front panel LED driver"); -+MODULE_AUTHOR("Luka Kovacic "); -+MODULE_LICENSE("GPL v2"); -+MODULE_ALIAS("platform:leds-iei-wt61p803-puzzle"); diff --git a/target/linux/mvebu/patches-6.12/905-Documentation-ABI-Add-iei-wt61p803-puzzle-driver-sys.patch b/target/linux/mvebu/patches-6.12/905-Documentation-ABI-Add-iei-wt61p803-puzzle-driver-sys.patch deleted file mode 100644 index b1d420ef0a..0000000000 --- a/target/linux/mvebu/patches-6.12/905-Documentation-ABI-Add-iei-wt61p803-puzzle-driver-sys.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 2fab3b4956c5b2f83c1e1abffc1df39de2933d83 Mon Sep 17 00:00:00 2001 -From: Luka Kovacic -Date: Tue, 24 Aug 2021 12:44:36 +0000 -Subject: [PATCH 5/7] Documentation/ABI: Add iei-wt61p803-puzzle driver sysfs - interface documentation - -Add the iei-wt61p803-puzzle driver sysfs interface documentation to allow -monitoring and control of the microcontroller from user space. - -Signed-off-by: Luka Kovacic -Signed-off-by: Pavo Banicevic -Cc: Luka Perkov -Cc: Robert Marko ---- - .../testing/sysfs-driver-iei-wt61p803-puzzle | 61 +++++++++++++++++++ - 1 file changed, 61 insertions(+) - create mode 100644 Documentation/ABI/testing/sysfs-driver-iei-wt61p803-puzzle - ---- /dev/null -+++ b/Documentation/ABI/testing/sysfs-driver-iei-wt61p803-puzzle -@@ -0,0 +1,61 @@ -+What: /sys/bus/serial/devices/.../mac_address_* -+Date: September 2020 -+Contact: Luka Kovacic -+Description: (RW) Internal factory assigned MAC address values -+ -+What: /sys/bus/serial/devices/.../serial_number -+Date: September 2020 -+Contact: Luka Kovacic -+Description: (RW) Internal factory assigned serial number -+ -+What: /sys/bus/serial/devices/.../version -+Date: September 2020 -+Contact: Luka Kovacic -+Description: (RO) Internal MCU firmware version -+ -+What: /sys/bus/serial/devices/.../protocol_version -+Date: September 2020 -+Contact: Luka Kovacic -+Description: (RO) Internal MCU communication protocol version -+ -+What: /sys/bus/serial/devices/.../power_loss_recovery -+Date: September 2020 -+Contact: Luka Kovacic -+Description: (RW) Host platform power loss recovery settings -+ Value mapping: 0 - Always-On, 1 - Always-Off, 2 - Always-AC, 3 - Always-WA -+ -+What: /sys/bus/serial/devices/.../bootloader_mode -+Date: September 2020 -+Contact: Luka Kovacic -+Description: (RO) Internal MCU bootloader mode status -+ Value mapping: -+ 0 - normal mode -+ 1 - bootloader mode -+ -+What: /sys/bus/serial/devices/.../power_status -+Date: September 2020 -+Contact: Luka Kovacic -+Description: (RO) Power status indicates the host platform power on method. -+ Value mapping (bitwise list): -+ 0x80 - Null -+ 0x40 - Firmware flag -+ 0x20 - Power loss detection flag (powered off) -+ 0x10 - Power loss detection flag (AC mode) -+ 0x08 - Button power on -+ 0x04 - Wake-on-LAN power on -+ 0x02 - RTC alarm power on -+ 0x01 - AC recover power on -+ -+What: /sys/bus/serial/devices/.../build_info -+Date: September 2020 -+Contact: Luka Kovacic -+Description: (RO) Internal MCU firmware build date -+ Format: yyyy/mm/dd hh:mm -+ -+What: /sys/bus/serial/devices/.../ac_recovery_status -+Date: September 2020 -+Contact: Luka Kovacic -+Description: (RO) Host platform AC recovery status value -+ Value mapping: -+ 0 - board has not been recovered from power down -+ 1 - board has been recovered from power down diff --git a/target/linux/mvebu/patches-6.12/906-Documentation-hwmon-Add-iei-wt61p803-puzzle-hwmon-dr.patch b/target/linux/mvebu/patches-6.12/906-Documentation-hwmon-Add-iei-wt61p803-puzzle-hwmon-dr.patch deleted file mode 100644 index 63a7552357..0000000000 --- a/target/linux/mvebu/patches-6.12/906-Documentation-hwmon-Add-iei-wt61p803-puzzle-hwmon-dr.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 0aff3e5923fecc6842473ad07a688d6e2f2c2d55 Mon Sep 17 00:00:00 2001 -From: Luka Kovacic -Date: Tue, 24 Aug 2021 12:44:37 +0000 -Subject: [PATCH 6/7] Documentation/hwmon: Add iei-wt61p803-puzzle hwmon driver - documentation - -Add the iei-wt61p803-puzzle driver hwmon driver interface documentation. - -Signed-off-by: Luka Kovacic -Signed-off-by: Pavo Banicevic -Cc: Luka Perkov -Cc: Robert Marko ---- - .../hwmon/iei-wt61p803-puzzle-hwmon.rst | 43 +++++++++++++++++++ - Documentation/hwmon/index.rst | 1 + - 2 files changed, 44 insertions(+) - create mode 100644 Documentation/hwmon/iei-wt61p803-puzzle-hwmon.rst - ---- /dev/null -+++ b/Documentation/hwmon/iei-wt61p803-puzzle-hwmon.rst -@@ -0,0 +1,43 @@ -+.. SPDX-License-Identifier: GPL-2.0-only -+ -+Kernel driver iei-wt61p803-puzzle-hwmon -+======================================= -+ -+Supported chips: -+ * IEI WT61P803 PUZZLE for IEI Puzzle M801 -+ -+ Prefix: 'iei-wt61p803-puzzle-hwmon' -+ -+Author: Luka Kovacic -+ -+ -+Description -+----------- -+ -+This driver adds fan and temperature sensor reading for some IEI Puzzle -+series boards. -+ -+Sysfs attributes -+---------------- -+ -+The following attributes are supported: -+ -+- IEI WT61P803 PUZZLE for IEI Puzzle M801 -+ -+/sys files in hwmon subsystem -+----------------------------- -+ -+================= == ===================================================== -+fan[1-5]_input RO files for fan speed (in RPM) -+pwm[1-2] RW files for fan[1-2] target duty cycle (0..255) -+temp[1-2]_input RO files for temperature sensors, in millidegree Celsius -+================= == ===================================================== -+ -+/sys files in thermal subsystem -+------------------------------- -+ -+================= == ===================================================== -+cur_state RW file for current cooling state of the cooling device -+ (0..max_state) -+max_state RO file for maximum cooling state of the cooling device -+================= == ===================================================== ---- a/Documentation/hwmon/index.rst -+++ b/Documentation/hwmon/index.rst -@@ -87,6 +87,7 @@ Hardware Monitoring Kernel Drivers - ibmaem - ibm-cffps - ibmpowernv -+ iei-wt61p803-puzzle-hwmon - ina209 - ina2xx - ina238 diff --git a/target/linux/mvebu/patches-6.12/907-MAINTAINERS-Add-an-entry-for-the-IEI-WT61P803-PUZZLE.patch b/target/linux/mvebu/patches-6.12/907-MAINTAINERS-Add-an-entry-for-the-IEI-WT61P803-PUZZLE.patch deleted file mode 100644 index 0bb50df389..0000000000 --- a/target/linux/mvebu/patches-6.12/907-MAINTAINERS-Add-an-entry-for-the-IEI-WT61P803-PUZZLE.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 12479baad28d2a08c6cb9e83471057635fa1635c Mon Sep 17 00:00:00 2001 -From: Luka Kovacic -Date: Tue, 24 Aug 2021 12:44:38 +0000 -Subject: [PATCH 7/7] MAINTAINERS: Add an entry for the IEI WT61P803 PUZZLE - driver - -Add an entry for the IEI WT61P803 PUZZLE driver (MFD, HWMON, LED drivers). - -Signed-off-by: Luka Kovacic -Signed-off-by: Pavo Banicevic -Cc: Luka Perkov -Cc: Robert Marko ---- - MAINTAINERS | 16 ++++++++++++++++ - 1 file changed, 16 insertions(+) - ---- a/MAINTAINERS -+++ b/MAINTAINERS -@@ -10978,6 +10978,22 @@ L: virtualization@lists.linux.dev - S: Supported - F: drivers/vdpa/ifcvf/ - -+IEI WT61P803 M801 MFD DRIVER -+M: Luka Kovacic -+M: Luka Perkov -+M: Goran Medic -+L: linux-kernel@vger.kernel.org -+S: Maintained -+F: Documentation/ABI/stable/sysfs-driver-iei-wt61p803-puzzle -+F: Documentation/devicetree/bindings/hwmon/iei,wt61p803-puzzle-hwmon.yaml -+F: Documentation/devicetree/bindings/leds/iei,wt61p803-puzzle-leds.yaml -+F: Documentation/devicetree/bindings/mfd/iei,wt61p803-puzzle.yaml -+F: Documentation/hwmon/iei-wt61p803-puzzle-hwmon.rst -+F: drivers/hwmon/iei-wt61p803-puzzle-hwmon.c -+F: drivers/leds/leds-iei-wt61p803-puzzle.c -+F: drivers/mfd/iei-wt61p803-puzzle.c -+F: include/linux/mfd/iei-wt61p803-puzzle.h -+ - IFE PROTOCOL - M: Yotam Gigi - M: Jamal Hadi Salim diff --git a/target/linux/mvebu/patches-6.12/910-drivers-leds-wt61p803-puzzle-improvements.patch b/target/linux/mvebu/patches-6.12/910-drivers-leds-wt61p803-puzzle-improvements.patch deleted file mode 100644 index 7535ecfc0d..0000000000 --- a/target/linux/mvebu/patches-6.12/910-drivers-leds-wt61p803-puzzle-improvements.patch +++ /dev/null @@ -1,271 +0,0 @@ ---- a/drivers/leds/leds-iei-wt61p803-puzzle.c -+++ b/drivers/leds/leds-iei-wt61p803-puzzle.c -@@ -9,9 +9,13 @@ - #include - #include - #include -+#include - #include - #include - #include -+#include -+ -+#define IEI_LEDS_MAX 4 - - enum iei_wt61p803_puzzle_led_state { - IEI_LED_OFF = 0x30, -@@ -33,7 +37,11 @@ struct iei_wt61p803_puzzle_led { - struct iei_wt61p803_puzzle *mcu; - unsigned char response_buffer[IEI_WT61P803_PUZZLE_BUF_SIZE]; - struct mutex lock; /* mutex to protect led_power_state */ -+ struct work_struct work; - int led_power_state; -+ int id; -+ u8 blinking; -+ bool active_low; - }; - - static inline struct iei_wt61p803_puzzle_led *cdev_to_iei_wt61p803_puzzle_led -@@ -51,10 +59,18 @@ static int iei_wt61p803_puzzle_led_brigh - size_t reply_size; - int ret; - -+ if (priv->blinking) { -+ if (brightness == LED_OFF) -+ priv->blinking = 0; -+ else -+ return 0; -+ } -+ - led_power_cmd[0] = IEI_WT61P803_PUZZLE_CMD_HEADER_START; - led_power_cmd[1] = IEI_WT61P803_PUZZLE_CMD_LED; -- led_power_cmd[2] = IEI_WT61P803_PUZZLE_CMD_LED_POWER; -- led_power_cmd[3] = brightness == LED_OFF ? IEI_LED_OFF : IEI_LED_ON; -+ led_power_cmd[2] = IEI_WT61P803_PUZZLE_CMD_LED_SET(priv->id); -+ led_power_cmd[3] = ((brightness == LED_OFF) ^ priv->active_low) ? -+ IEI_LED_OFF : priv->blinking?priv->blinking:IEI_LED_ON; - - ret = iei_wt61p803_puzzle_write_command(priv->mcu, led_power_cmd, - sizeof(led_power_cmd), -@@ -90,39 +106,166 @@ static enum led_brightness iei_wt61p803_ - return led_state; - } - -+static void iei_wt61p803_puzzle_led_apply_blink(struct work_struct *work) -+{ -+ struct iei_wt61p803_puzzle_led *priv = container_of(work, struct iei_wt61p803_puzzle_led, work); -+ unsigned char led_blink_cmd[5] = {}; -+ unsigned char resp_buf[IEI_WT61P803_PUZZLE_BUF_SIZE]; -+ size_t reply_size; -+ -+ led_blink_cmd[0] = IEI_WT61P803_PUZZLE_CMD_HEADER_START; -+ led_blink_cmd[1] = IEI_WT61P803_PUZZLE_CMD_LED; -+ led_blink_cmd[2] = IEI_WT61P803_PUZZLE_CMD_LED_SET(priv->id); -+ led_blink_cmd[3] = priv->blinking; -+ -+ iei_wt61p803_puzzle_write_command(priv->mcu, led_blink_cmd, -+ sizeof(led_blink_cmd), -+ resp_buf, -+ &reply_size); -+ -+ return; -+} -+ -+static int iei_wt61p803_puzzle_led_set_blink(struct led_classdev *cdev, -+ unsigned long *delay_on, -+ unsigned long *delay_off) -+{ -+ struct iei_wt61p803_puzzle_led *priv = cdev_to_iei_wt61p803_puzzle_led(cdev); -+ u8 blink_mode = 0; -+ int ret = 0; -+ -+ /* set defaults */ -+ if (!*delay_on && !*delay_off) { -+ *delay_on = 500; -+ *delay_off = 500; -+ } -+ -+ /* minimum delay for soft-driven blinking is 100ms to keep load low */ -+ if (*delay_on < 100) -+ *delay_on = 100; -+ -+ if (*delay_off < 100) -+ *delay_off = 100; -+ -+ /* offload blinking to hardware, if possible */ -+ if (*delay_on != *delay_off) { -+ ret = -EINVAL; -+ } else if (*delay_on == 100) { -+ blink_mode = IEI_LED_BLINK_5HZ; -+ *delay_on = 100; -+ *delay_off = 100; -+ } else if (*delay_on <= 500) { -+ blink_mode = IEI_LED_BLINK_1HZ; -+ *delay_on = 500; -+ *delay_off = 500; -+ } else { -+ ret = -EINVAL; -+ } -+ -+ mutex_lock(&priv->lock); -+ priv->blinking = blink_mode; -+ mutex_unlock(&priv->lock); -+ -+ if (blink_mode) -+ schedule_work(&priv->work); -+ -+ return ret; -+} -+ -+ -+static int iei_wt61p803_puzzle_led_set_dt_default(struct led_classdev *cdev, -+ struct device_node *np) -+{ -+ const char *state; -+ int ret = 0; -+ -+ state = of_get_property(np, "default-state", NULL); -+ if (state) { -+ if (!strcmp(state, "on")) { -+ ret = -+ iei_wt61p803_puzzle_led_brightness_set_blocking( -+ cdev, cdev->max_brightness); -+ } else { -+ ret = iei_wt61p803_puzzle_led_brightness_set_blocking( -+ cdev, LED_OFF); -+ } -+ } -+ -+ return ret; -+} -+ - static int iei_wt61p803_puzzle_led_probe(struct platform_device *pdev) - { - struct device *dev = &pdev->dev; -+ struct device_node *np = dev_of_node(dev); - struct iei_wt61p803_puzzle *mcu = dev_get_drvdata(dev->parent); - struct iei_wt61p803_puzzle_led *priv; -- struct led_init_data init_data = {}; -- struct fwnode_handle *child; - int ret; -+ u32 reg; - -- if (device_get_child_node_count(dev) != 1) -+ if (device_get_child_node_count(dev) > IEI_LEDS_MAX) - return -EINVAL; - -- priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); -- if (!priv) -- return -ENOMEM; -- -- priv->mcu = mcu; -- priv->led_power_state = 1; -- mutex_init(&priv->lock); -- dev_set_drvdata(dev, priv); -- -- child = device_get_next_child_node(dev, NULL); -- init_data.fwnode = child; -- -- priv->cdev.brightness_set_blocking = iei_wt61p803_puzzle_led_brightness_set_blocking; -- priv->cdev.brightness_get = iei_wt61p803_puzzle_led_brightness_get; -- priv->cdev.max_brightness = 1; -+ for_each_available_child_of_node_scoped(np, child) { -+ struct led_init_data init_data = {}; - -- ret = devm_led_classdev_register_ext(dev, &priv->cdev, &init_data); -- if (ret) -- dev_err(dev, "Could not register LED\n"); -+ ret = of_property_read_u32(child, "reg", ®); -+ if (ret) { -+ dev_err(dev, "Failed to read led 'reg' property\n"); -+ goto put_child_node; -+ } -+ -+ if (reg > IEI_LEDS_MAX) { -+ dev_err(dev, "Invalid led reg %u\n", reg); -+ ret = -EINVAL; -+ goto put_child_node; -+ } -+ -+ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); -+ if (!priv) { -+ ret = -ENOMEM; -+ goto put_child_node; -+ } -+ -+ ret = devm_mutex_init(dev, &priv->lock); -+ if (ret) -+ goto put_child_node; -+ -+ dev_set_drvdata(dev, priv); -+ -+ if (of_property_read_bool(child, "active-low")) -+ priv->active_low = true; -+ -+ priv->mcu = mcu; -+ priv->id = reg; -+ priv->led_power_state = 1; -+ priv->blinking = 0; -+ init_data.fwnode = of_fwnode_handle(of_node_get(child)); -+ -+ priv->cdev.brightness_set_blocking = iei_wt61p803_puzzle_led_brightness_set_blocking; -+ priv->cdev.brightness_get = iei_wt61p803_puzzle_led_brightness_get; -+ priv->cdev.blink_set = iei_wt61p803_puzzle_led_set_blink; -+ -+ priv->cdev.max_brightness = 1; -+ -+ INIT_WORK(&priv->work, iei_wt61p803_puzzle_led_apply_blink); -+ -+ ret = iei_wt61p803_puzzle_led_set_dt_default(&priv->cdev, child); -+ if (ret) { -+ dev_err(dev, "Could apply default from DT\n"); -+ goto put_child_node; -+ } -+ -+ ret = devm_led_classdev_register_ext(dev, &priv->cdev, &init_data); -+ if (ret) { -+ dev_err(dev, "Could not register LED\n"); -+ goto put_child_node; -+ } -+ } -+ -+ return ret; - -- fwnode_handle_put(child); -+put_child_node: - return ret; - } - ---- a/include/linux/mfd/iei-wt61p803-puzzle.h -+++ b/include/linux/mfd/iei-wt61p803-puzzle.h -@@ -36,7 +36,7 @@ - #define IEI_WT61P803_PUZZLE_CMD_FUNCTION_OTHER_POWER_LOSS 0x41 /* A */ - - #define IEI_WT61P803_PUZZLE_CMD_LED 0x52 /* R */ --#define IEI_WT61P803_PUZZLE_CMD_LED_POWER 0x31 /* 1 */ -+#define IEI_WT61P803_PUZZLE_CMD_LED_SET(n) (0x30 | (n)) - - #define IEI_WT61P803_PUZZLE_CMD_TEMP 0x54 /* T */ - #define IEI_WT61P803_PUZZLE_CMD_TEMP_ALL 0x41 /* A */ ---- a/drivers/mfd/iei-wt61p803-puzzle.c -+++ b/drivers/mfd/iei-wt61p803-puzzle.c -@@ -176,6 +176,9 @@ static size_t iei_wt61p803_puzzle_recv_b - struct iei_wt61p803_puzzle *mcu = serdev_device_get_drvdata(serdev); - size_t ret; - -+ print_hex_dump_debug("puzzle-mcu rx: ", DUMP_PREFIX_NONE, -+ 16, 1, data, size, false); -+ - ret = iei_wt61p803_puzzle_process_resp(mcu, data, size); - /* Return the number of processed bytes if function returns error, - * discard the remaining incoming data, since the frame this data -@@ -246,6 +249,9 @@ int iei_wt61p803_puzzle_write_command(st - - cmd[size - 1] = iei_wt61p803_puzzle_checksum(cmd, size - 1); - -+ print_hex_dump_debug("puzzle-mcu tx: ", DUMP_PREFIX_NONE, -+ 16, 1, cmd, size, false); -+ - /* Initialize reply struct */ - reinit_completion(&mcu->reply->received); - mcu->reply->size = 0; diff --git a/target/linux/mvebu/patches-6.12/911-drivers-leds-wt61p803-puzzle-mcu-retry.patch b/target/linux/mvebu/patches-6.12/911-drivers-leds-wt61p803-puzzle-mcu-retry.patch deleted file mode 100644 index 2f0b1788ff..0000000000 --- a/target/linux/mvebu/patches-6.12/911-drivers-leds-wt61p803-puzzle-mcu-retry.patch +++ /dev/null @@ -1,63 +0,0 @@ ---- a/drivers/mfd/iei-wt61p803-puzzle.c -+++ b/drivers/mfd/iei-wt61p803-puzzle.c -@@ -241,6 +241,7 @@ int iei_wt61p803_puzzle_write_command(st - { - struct device *dev = &mcu->serdev->dev; - int ret; -+ int retries; - - if (size <= 1 || size > IEI_WT61P803_PUZZLE_MAX_COMMAND_LENGTH) - return -EINVAL; -@@ -252,24 +253,36 @@ int iei_wt61p803_puzzle_write_command(st - print_hex_dump_debug("puzzle-mcu tx: ", DUMP_PREFIX_NONE, - 16, 1, cmd, size, false); - -+ retries = 3; - /* Initialize reply struct */ -- reinit_completion(&mcu->reply->received); -- mcu->reply->size = 0; -- usleep_range(2000, 10000); -- serdev_device_write_flush(mcu->serdev); -- ret = serdev_device_write_buf(mcu->serdev, cmd, size); -- if (ret < 0) -- goto exit; -- -- serdev_device_wait_until_sent(mcu->serdev, IEI_WT61P803_PUZZLE_GENERAL_TIMEOUT); -- ret = wait_for_completion_timeout(&mcu->reply->received, -- IEI_WT61P803_PUZZLE_GENERAL_TIMEOUT); -- if (ret == 0) { -- dev_err(dev, "Command reply receive timeout\n"); -- ret = -ETIMEDOUT; -- goto exit; -+ while (retries) { -+ reinit_completion(&mcu->reply->received); -+ mcu->reply->size = 0; -+ usleep_range(2000, 10000); -+ serdev_device_write_flush(mcu->serdev); -+ ret = serdev_device_write_buf(mcu->serdev, cmd, size); -+ if (ret < 0) -+ goto exit; -+ -+ serdev_device_wait_until_sent(mcu->serdev, IEI_WT61P803_PUZZLE_GENERAL_TIMEOUT); -+ ret = wait_for_completion_timeout(&mcu->reply->received, -+ IEI_WT61P803_PUZZLE_GENERAL_TIMEOUT); -+ retries--; -+ if (ret == 0) { -+ if (retries == 0) { -+ dev_err(dev, "Command reply receive timeout\n"); -+ ret = -ETIMEDOUT; -+ goto exit; -+ } -+ } -+ else { -+ if (mcu->reply->data[0] == IEI_WT61P803_PUZZLE_CMD_HEADER_START && -+ mcu->reply->data[1] == IEI_WT61P803_PUZZLE_CMD_RESPONSE_OK && -+ mcu->reply->data[2] == IEI_WT61P803_PUZZLE_CHECKSUM_RESPONSE_OK) { -+ break; -+ } -+ } - } -- - *reply_size = mcu->reply->size; - /* Copy the received data, as it will not be available after a new frame is received */ - memcpy(reply_data, mcu->reply->data, mcu->reply->size); diff --git a/target/linux/mvebu/patches-6.12/912-drivers-hwmon-wt61p803-puzzle-thermal-zone.patch b/target/linux/mvebu/patches-6.12/912-drivers-hwmon-wt61p803-puzzle-thermal-zone.patch deleted file mode 100644 index 4633c03855..0000000000 --- a/target/linux/mvebu/patches-6.12/912-drivers-hwmon-wt61p803-puzzle-thermal-zone.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/drivers/hwmon/iei-wt61p803-puzzle-hwmon.c -+++ b/drivers/hwmon/iei-wt61p803-puzzle-hwmon.c -@@ -251,6 +251,7 @@ static const struct hwmon_ops iei_wt61p8 - }; - - static const struct hwmon_channel_info *iei_wt61p803_puzzle_info[] = { -+ HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ), - HWMON_CHANNEL_INFO(pwm, - HWMON_PWM_INPUT, - HWMON_PWM_INPUT), From 21f3bf350dc40a8a4ae825f29d5f250ffb3e4708 Mon Sep 17 00:00:00 2001 From: Carlo Szelinsky Date: Tue, 9 Jun 2026 21:42:40 +0200 Subject: [PATCH 34/61] generic: net: phy: realtek: select rtl826x phy patch table by chip version The in-tree realtek 5G/10G driver picks the firmware patch table from the PHY ID (RTL8264 -> rtl8264b.bin). The vendor driver instead picks it from VEND1 0x104[2:0] (0 = RTL8264B, else RTL8261N-C), independent of PHY ID. On the S1300WP the RTL8264 dies read 0x104=0xf802 ([2:0]=2), so they need the RTL8261N-C table; the RTL8264B table leaves the PCS unlocked (0xA600 stuck 0x1000) and config_init fails with -ETIME. Read 0x104[2:0] and load rtl8261n.bin when non-zero. Boards with such a die must ship rtl8261n.bin. Fixes: 6369c9e5c799 ("generic: net: phy: realtek: add 5G and 10G PHY support") Co-authored-by: Sven Eckelmann Signed-off-by: Carlo Szelinsky Link: https://github.com/openwrt/openwrt/pull/23947 Signed-off-by: Jonas Jelonek --- ...y-realtek-add-5G-and-10G-PHY-support.patch | 70 ++++++++----------- ...altek-add-RTL8224-pair-order-support.patch | 4 +- ...realtek-add-RTL8224-polarity-support.patch | 2 +- ...-support-MDI-swapping-for-RTL8226-CG.patch | 4 +- ...743-net-realtek-serdes-configuration.patch | 4 +- 5 files changed, 37 insertions(+), 47 deletions(-) diff --git a/target/linux/generic/pending-6.18/742-net-phy-realtek-add-5G-and-10G-PHY-support.patch b/target/linux/generic/pending-6.18/742-net-phy-realtek-add-5G-and-10G-PHY-support.patch index 71b025eefe..0d6c7f4804 100644 --- a/target/linux/generic/pending-6.18/742-net-phy-realtek-add-5G-and-10G-PHY-support.patch +++ b/target/linux/generic/pending-6.18/742-net-phy-realtek-add-5G-and-10G-PHY-support.patch @@ -64,7 +64,7 @@ Signed-off-by: Balázs Triszka #include #include -@@ -205,10 +207,26 @@ +@@ -205,10 +207,27 @@ #define RTL_8221B_VM_CG 0x001cc84a #define RTL_8251B 0x001cc862 #define RTL_8261C 0x001cc890 @@ -81,6 +81,7 @@ Signed-off-by: Balázs Triszka + +#define RTL826X_VEND1_PKG_MODEL 0x103 +#define RTL826X_VEND1_VERSION_ID 0x104 ++#define RTL826X_VEND1_VERSION_ID_VARIANT GENMASK(2, 0) + +#define RTL826X_VND2_INER 0xA424 +#define RTL826X_VND2_INER_LINK_STATUS BIT(4) @@ -91,7 +92,7 @@ Signed-off-by: Balázs Triszka MODULE_DESCRIPTION("Realtek PHY driver"); MODULE_AUTHOR("Johnson Leung"); MODULE_LICENSE("GPL"); -@@ -1993,6 +2011,125 @@ static int rtl8251b_c45_match_phy_device +@@ -1993,6 +2012,125 @@ static int rtl8251b_c45_match_phy_device return rtlgen_is_c45_match(phydev, RTL_8251B, true); } @@ -217,14 +218,29 @@ Signed-off-by: Balázs Triszka static int rtlgen_resume(struct phy_device *phydev) { int ret = genphy_resume(phydev); -@@ -2214,6 +2351,493 @@ static int rtlgen_sfp_config_aneg(struct +@@ -2214,6 +2352,482 @@ static int rtlgen_sfp_config_aneg(struct return 0; } ++static int rtl826x_patch_db_init(struct phy_device *phydev) ++{ ++ int ver; ++ ++ ver = phy_read_mmd(phydev, MDIO_MMD_VEND1, RTL826X_VEND1_VERSION_ID); ++ if (ver < 0) ++ return ver; ++ ++ if (ver & RTL826X_VEND1_VERSION_ID_VARIANT) ++ return rtl8261n_phy_patch_db_init(phydev); ++ else ++ return rtl8264b_phy_patch_db_init(phydev); ++} ++ +static int rtl826x_probe(struct phy_device *phydev) +{ + struct device *dev = &phydev->mdio.dev; + struct rtl826x_priv *priv; ++ int ret; + + priv = devm_kzalloc(dev, sizeof(struct rtl826x_priv), GFP_KERNEL); + if (!priv) @@ -240,42 +256,16 @@ Signed-off-by: Balázs Triszka + phy_disable_eee_mode(phydev, ETHTOOL_LINK_MODE_100baseT_Full_BIT); + phy_disable_eee_mode(phydev, ETHTOOL_LINK_MODE_1000baseT_Full_BIT); + ++ ret = rtl826x_patch_db_init(phydev); ++ if (ret < 0) ++ return ret; ++ + if (IS_ENABLED(CONFIG_REALTEK_PHY_HWMON)) + return rtl822x_hwmon_init(phydev); + + return 0; +} + -+static int rtl8261n_probe(struct phy_device *phydev) -+{ -+ int ret; -+ -+ ret = rtl826x_probe(phydev); -+ if (ret < 0) -+ return ret; -+ -+ ret = rtl8261n_phy_patch_db_init(phydev); -+ if (ret < 0) -+ return ret; -+ -+ return 0; -+} -+ -+static int rtl8264b_probe(struct phy_device *phydev) -+{ -+ int ret; -+ -+ ret = rtl826x_probe(phydev); -+ if (ret < 0) -+ return ret; -+ -+ ret = rtl8264b_phy_patch_db_init(phydev); -+ if (ret < 0) -+ return ret; -+ -+ return 0; -+} -+ +static int rtl826x_config_serdes_polarity(struct phy_device *phydev) +{ + struct device *dev = &phydev->mdio.dev; @@ -711,14 +701,14 @@ Signed-off-by: Balázs Triszka static struct phy_driver realtek_drvs[] = { { PHY_ID_MATCH_EXACT(0x00008201), -@@ -2520,6 +3144,108 @@ static struct phy_driver realtek_drvs[] +@@ -2520,6 +3134,108 @@ static struct phy_driver realtek_drvs[] .resume = genphy_resume, .read_mmd = genphy_read_mmd_unsupported, .write_mmd = genphy_write_mmd_unsupported, + }, { + .name = "RTL8251L 5Gbps PHY", + .config_init = rtl826x_config_init, -+ .probe = rtl8261n_probe, ++ .probe = rtl826x_probe, + .get_features = rtl825xb_get_features, + .suspend = rtl826x_suspend, + .resume = rtlgen_c45_resume, @@ -735,7 +725,7 @@ Signed-off-by: Balázs Triszka + }, { + .name = "RTL8254B 5Gbps PHY", + .config_init = rtl826x_config_init, -+ .probe = rtl8264b_probe, ++ .probe = rtl826x_probe, + .get_features = rtl825xb_get_features, + .suspend = rtl826x_suspend, + .resume = rtlgen_c45_resume, @@ -752,7 +742,7 @@ Signed-off-by: Balázs Triszka + }, { + .name = "RTL8261BE 10Gbps PHY", + .config_init = rtl826x_config_init, -+ .probe = rtl8261n_probe, ++ .probe = rtl826x_probe, + .get_features = rtl826x_get_features, + .suspend = rtl826x_suspend, + .resume = rtlgen_c45_resume, @@ -769,7 +759,7 @@ Signed-off-by: Balázs Triszka + }, { + .name = "RTL8261N 10Gbps PHY", + .config_init = rtl826x_config_init, -+ .probe = rtl8261n_probe, ++ .probe = rtl826x_probe, + .get_features = rtl826x_get_features, + .suspend = rtl826x_suspend, + .resume = rtlgen_c45_resume, @@ -787,7 +777,7 @@ Signed-off-by: Balázs Triszka + PHY_ID_MATCH_EXACT(RTL_8264), + .name = "RTL8264 10Gbps PHY", + .config_init = rtl826x_config_init, -+ .probe = rtl8264b_probe, ++ .probe = rtl826x_probe, + .get_features = rtl826x_get_features, + .suspend = rtl826x_suspend, + .resume = rtlgen_c45_resume, @@ -803,7 +793,7 @@ Signed-off-by: Balázs Triszka + }, { + .name = "RTL8264B 10Gbps PHY", + .config_init = rtl826x_config_init, -+ .probe = rtl8264b_probe, ++ .probe = rtl826x_probe, + .get_features = rtl826x_get_features, + .suspend = rtl826x_suspend, + .resume = rtlgen_c45_resume, diff --git a/target/linux/realtek/patches-6.18/024-02-v7.1-net-phy-realtek-add-RTL8224-pair-order-support.patch b/target/linux/realtek/patches-6.18/024-02-v7.1-net-phy-realtek-add-RTL8224-pair-order-support.patch index 6f3758696a..d4df285594 100644 --- a/target/linux/realtek/patches-6.18/024-02-v7.1-net-phy-realtek-add-RTL8224-pair-order-support.patch +++ b/target/linux/realtek/patches-6.18/024-02-v7.1-net-phy-realtek-add-RTL8224-pair-order-support.patch @@ -54,7 +54,7 @@ Signed-off-by: Jakub Kicinski #define RTL8366RB_POWER_SAVE 0x15 #define RTL8366RB_POWER_SAVE_ON BIT(12) -@@ -1889,6 +1892,66 @@ static int rtl8224_cable_test_get_status +@@ -1890,6 +1893,66 @@ static int rtl8224_cable_test_get_status return rtl8224_cable_test_report(phydev, finished); } @@ -121,7 +121,7 @@ Signed-off-by: Jakub Kicinski static bool rtlgen_supports_2_5gbps(struct phy_device *phydev) { int val; -@@ -3096,6 +3159,8 @@ static struct phy_driver realtek_drvs[] +@@ -3086,6 +3149,8 @@ static struct phy_driver realtek_drvs[] PHY_ID_MATCH_EXACT(0x001ccad0), .name = "RTL8224 2.5Gbps PHY", .flags = PHY_POLL_CABLE_TEST, diff --git a/target/linux/realtek/patches-6.18/024-04-v7.1-net-phy-realtek-add-RTL8224-polarity-support.patch b/target/linux/realtek/patches-6.18/024-04-v7.1-net-phy-realtek-add-RTL8224-polarity-support.patch index fc84b74981..ca9205157e 100644 --- a/target/linux/realtek/patches-6.18/024-04-v7.1-net-phy-realtek-add-RTL8224-polarity-support.patch +++ b/target/linux/realtek/patches-6.18/024-04-v7.1-net-phy-realtek-add-RTL8224-polarity-support.patch @@ -32,7 +32,7 @@ Signed-off-by: Jakub Kicinski #define RTL8366RB_POWER_SAVE 0x15 #define RTL8366RB_POWER_SAVE_ON BIT(12) -@@ -1940,9 +1941,40 @@ static int rtl8224_mdi_config_order(stru +@@ -1941,9 +1942,40 @@ static int rtl8224_mdi_config_order(stru order ? BIT(port_offset) : 0); } diff --git a/target/linux/realtek/patches-6.18/030-v7.2-net-phy-realtek-support-MDI-swapping-for-RTL8226-CG.patch b/target/linux/realtek/patches-6.18/030-v7.2-net-phy-realtek-support-MDI-swapping-for-RTL8226-CG.patch index c711077409..510f3b25ce 100644 --- a/target/linux/realtek/patches-6.18/030-v7.2-net-phy-realtek-support-MDI-swapping-for-RTL8226-CG.patch +++ b/target/linux/realtek/patches-6.18/030-v7.2-net-phy-realtek-support-MDI-swapping-for-RTL8226-CG.patch @@ -60,7 +60,7 @@ Signed-off-by: Jakub Kicinski #define RTL8366RB_POWER_SAVE 0x15 #define RTL8366RB_POWER_SAVE_ON BIT(12) -@@ -1391,6 +1406,144 @@ static int rtl822x_init_phycr1(struct ph +@@ -1392,6 +1407,144 @@ static int rtl822x_init_phycr1(struct ph mask, val); } @@ -205,7 +205,7 @@ Signed-off-by: Jakub Kicinski static int rtl822x_set_serdes_option_mode(struct phy_device *phydev, bool gen1) { bool has_2500, has_sgmii; -@@ -3083,6 +3236,7 @@ static struct phy_driver realtek_drvs[] +@@ -3073,6 +3226,7 @@ static struct phy_driver realtek_drvs[] .soft_reset = rtl822x_c45_soft_reset, .get_features = rtl822x_c45_get_features, .config_aneg = rtl822x_c45_config_aneg, diff --git a/target/linux/realtek/patches-6.18/743-net-realtek-serdes-configuration.patch b/target/linux/realtek/patches-6.18/743-net-realtek-serdes-configuration.patch index 1fc138a465..d5c9bc7ab0 100644 --- a/target/linux/realtek/patches-6.18/743-net-realtek-serdes-configuration.patch +++ b/target/linux/realtek/patches-6.18/743-net-realtek-serdes-configuration.patch @@ -42,7 +42,7 @@ #define RTL8221B_PHYCR1 0xa430 #define RTL8221B_PHYCR1_ALDPS_EN BIT(2) #define RTL8221B_PHYCR1_ALDPS_XTAL_OFF_EN BIT(12) -@@ -2069,6 +2104,147 @@ exit: +@@ -2070,6 +2105,147 @@ exit: return ret; } @@ -190,7 +190,7 @@ static int rtl8224_mdi_config_order(struct phy_device *phydev) { struct device_node *np = phydev->mdio.dev.of_node; -@@ -2123,6 +2299,10 @@ static int rtl8224_config_init(struct ph +@@ -2124,6 +2300,10 @@ static int rtl8224_config_init(struct ph { int ret; From 4abe97b2bc2eaac4c523124f11139fee2cb7dd23 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 22 Jun 2026 15:10:38 +0200 Subject: [PATCH 35/61] rtl826x-firmware: ship rtl8261n and rtl8264b in single firmware package The firmware loading does not depend (solely) on the PHY id. The driver needs to read out the vendor version id of the PHY before it can decide which firmware file needs to be loaded. A split in an RTL8261N and an RTL8264B firmware package is therefore misleading. And it could even be that a product ships an RTL8264B but switches the revision of the chip in the middle of its product lifetime. In this case, the first identification based on the chip ID or the actual chip ID for the OpenWrt porter might fail for another user with a later/earlier produced device. Shipping both files in the same package avoids this problem. Only the "low power" firmware package is slightly misleading because there is only a RTL8261N firmware binary for low power but no corresponding RTL8264B version. It will ship simply the non-low power version for RTL8264B. Suggested-by: Jonas Jelonek Signed-off-by: Sven Eckelmann Link: https://github.com/openwrt/openwrt/pull/23947 Signed-off-by: Jonas Jelonek --- package/firmware/rtl826x-firmware/Makefile | 34 ++++++++-------------- target/linux/airoha/image/an7581.mk | 2 +- target/linux/mediatek/image/filogic.mk | 4 +-- target/linux/qualcommbe/image/ipq95xx.mk | 2 +- target/linux/realtek/image/rtl930x.mk | 12 ++++---- 5 files changed, 22 insertions(+), 32 deletions(-) diff --git a/package/firmware/rtl826x-firmware/Makefile b/package/firmware/rtl826x-firmware/Makefile index 494677a331..8cc54b69f1 100644 --- a/package/firmware/rtl826x-firmware/Makefile +++ b/package/firmware/rtl826x-firmware/Makefile @@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rtl826x-firmware PKG_SOURCE_DATE:=2026-01-24 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE_URL:=https://github.com/balika011/realtek_phy_firmware PKG_SOURCE_VERSION:=0cd4abe2b0bf197f75c27088f86a74c7ddb103b4 @@ -30,47 +30,37 @@ define Package/rtl826x-firmware/Default PKGARCH:=all endef -define Package/rtl8261n-firmware +define Package/rtl826x-firmware $(call Package/rtl826x-firmware/Default) - TITLE:=Realtek RTL8251L/RTL8261BE/RTL8261N firmware + TITLE:=Realtek RTL8251L/RTL8261BE/RTL8261N/RTL8254B/RTL8264/RTL8264B firmware VERSION:=20221115 endef -define Package/rtl8261n-lp-firmware +define Package/rtl826x-lp-firmware $(call Package/rtl826x-firmware/Default) - TITLE:=Realtek RTL8251L/RTL8261BE/RTL8261N low-power firmware + TITLE:=Realtek RTL8251L/RTL8261BE/RTL8261N/RTL8254B/RTL8264/RTL8264B low-power firmware VERSION:=20240729 - PROVIDES:=rtl8261n-firmware - CONFLICTS:=rtl8261n-firmware + PROVIDES:=rtl826x-firmware + CONFLICTS:=rtl826x-firmware endef -define Package/rtl8264b-firmware - $(call Package/rtl826x-firmware/Default) - TITLE:=Realtek RTL8254B/RTL8264/RTL8264B firmware - VERSION:=20221215 -endef - -define Package/rtl8261n-firmware/install +define Package/rtl826x-firmware/install $(INSTALL_DIR) $(1)/lib/firmware $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/rtl8261n.bin \ + $(PKG_BUILD_DIR)/rtl8264b.bin \ $(1)/lib/firmware/ endef -define Package/rtl8261n-lp-firmware/install +define Package/rtl826x-lp-firmware/install $(INSTALL_DIR) $(1)/lib/firmware $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/rtl8261n_lp.bin \ $(1)/lib/firmware/rtl8261n.bin -endef - -define Package/rtl8264b-firmware/install - $(INSTALL_DIR) $(1)/lib/firmware $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/rtl8264b.bin \ $(1)/lib/firmware/ endef -$(eval $(call BuildPackage,rtl8261n-firmware)) -$(eval $(call BuildPackage,rtl8261n-lp-firmware)) -$(eval $(call BuildPackage,rtl8264b-firmware)) +$(eval $(call BuildPackage,rtl826x-firmware)) +$(eval $(call BuildPackage,rtl826x-lp-firmware)) diff --git a/target/linux/airoha/image/an7581.mk b/target/linux/airoha/image/an7581.mk index cc94c7de53..87ed0e8164 100644 --- a/target/linux/airoha/image/an7581.mk +++ b/target/linux/airoha/image/an7581.mk @@ -103,7 +103,7 @@ define Device/gemtek_w1700k-ubi the end of flash. A reinstall including corrected chainloader is needed. DEVICE_PACKAGES := airoha-en7581-mt7996-npu-firmware fitblk kmod-i2c-an7581 \ kmod-hwmon-nct7802 kmod-mt7996-firmware wpad-basic-mbedtls \ - rtl8261n-firmware + rtl826x-firmware UBINIZE_OPTS := -E 5 BLOCKSIZE := 128k PAGESIZE := 2048 diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 27b5d3e1b1..3c035290b2 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -2107,7 +2107,7 @@ define Device/keenetic_kn-1812-common DEVICE_DTS_DIR := ../dts DEVICE_PACKAGES := kmod-mt7992-firmware kmod-usb3 \ mt7988-2p5g-phy-firmware mt7988-wo-firmware \ - kmod-phy-realtek rtl8261n-firmware + kmod-phy-realtek rtl826x-firmware UBINIZE_OPTS := -E 5 BLOCKSIZE := 128k PAGESIZE := 2048 @@ -3111,7 +3111,7 @@ define Device/tplink_be450 DEVICE_DTS_DIR := ../dts DEVICE_PACKAGES := kmod-mt7992-firmware kmod-usb3 \ mt7988-2p5g-phy-firmware mt7988-wo-firmware \ - kmod-phy-realtek rtl8261n-firmware + kmod-phy-realtek rtl826x-firmware UBINIZE_OPTS := -E 5 BLOCKSIZE := 128k PAGESIZE := 2048 diff --git a/target/linux/qualcommbe/image/ipq95xx.mk b/target/linux/qualcommbe/image/ipq95xx.mk index f2eb8ec114..0017ff41a8 100644 --- a/target/linux/qualcommbe/image/ipq95xx.mk +++ b/target/linux/qualcommbe/image/ipq95xx.mk @@ -9,7 +9,7 @@ define Device/8devices_kiwi-dvk SOC := ipq9570 DEVICE_PACKAGES := kmod-ath12k ath12k-firmware-qcn9274 \ ipq-wifi-8devices_kiwi f2fsck mkf2fs kmod-sfp \ - kmod-phy-maxlinear kmod-phy-realtek rtl8261n-firmware + kmod-phy-maxlinear kmod-phy-realtek rtl826x-firmware IMAGE/factory.bin := qsdk-ipq-factory-nor endef TARGET_DEVICES += 8devices_kiwi-dvk diff --git a/target/linux/realtek/image/rtl930x.mk b/target/linux/realtek/image/rtl930x.mk index e58020551b..53f3d32d69 100644 --- a/target/linux/realtek/image/rtl930x.mk +++ b/target/linux/realtek/image/rtl930x.mk @@ -17,7 +17,7 @@ define Device/sirivision_sr-st3408f UIMAGE_MAGIC := 0x93000000 DEVICE_VENDOR := Sirivision DEVICE_MODEL := SR-ST3408F - DEVICE_PACKAGES := kmod-phy-realtek rtl8261n-firmware + DEVICE_PACKAGES := kmod-phy-realtek rtl826x-firmware IMAGE_SIZE := 13312k $(Device/kernel-lzma) endef @@ -33,7 +33,7 @@ define Device/hasivo_f1100w-4sx-4xgt-common DEVICE_ALT1_MODEL := F1100WP-4SX-4XGT DEVICE_ALT2_VENDOR := Hasivo DEVICE_ALT2_MODEL := F1100WP-4SX-4XGT-SE - DEVICE_PACKAGES := kmod-phy-realtek rtl8261n-firmware + DEVICE_PACKAGES := kmod-phy-realtek rtl826x-firmware IMAGE_SIZE := 29696k $(Device/kernel-lzma) endef @@ -57,7 +57,7 @@ define Device/hasivo_s1100w-8xgt-se DEVICE_VENDOR := Hasivo DEVICE_MODEL := S1100W-8XGT-SE IMAGE_SIZE := 12288k - DEVICE_PACKAGES := rtl8264b-firmware + DEVICE_PACKAGES := rtl826x-firmware $(Device/kernel-lzma) endef TARGET_DEVICES += hasivo_s1100w-8xgt-se @@ -204,7 +204,7 @@ define Device/xikestor_sks8300-8t UIMAGE_MAGIC := 0x93000000 DEVICE_VENDOR := XikeStor DEVICE_MODEL := SKS8300-8T - DEVICE_PACKAGES := kmod-hwmon-lm75 rtl8261n-firmware + DEVICE_PACKAGES := kmod-hwmon-lm75 rtl826x-firmware IMAGE_SIZE := 20480k $(Device/kernel-lzma) IMAGE/sysupgrade.bin := \ @@ -238,7 +238,7 @@ define Device/xikestor_sks8300-12e2t2x UIMAGE_MAGIC := 0x93000000 DEVICE_VENDOR := XikeStor DEVICE_MODEL := SKS8300-12E2T2X - DEVICE_PACKAGES := rtl8261n-firmware + DEVICE_PACKAGES := rtl826x-firmware IMAGE_SIZE := 20480k $(Device/kernel-lzma) IMAGE/sysupgrade.bin := \ @@ -329,7 +329,7 @@ TARGET_DEVICES += zyxel_xgs1250-12-a1 define Device/zyxel_xgs1250-12-b1 $(Device/zyxel_xgs1250-12-common) DEVICE_VARIANT := B1 - DEVICE_PACKAGES += rtl8261n-firmware + DEVICE_PACKAGES += rtl826x-firmware endef TARGET_DEVICES += zyxel_xgs1250-12-b1 From 05f37579ad11e9304a9e204e1292fc746a04eb03 Mon Sep 17 00:00:00 2001 From: Dmitry Mostovoy Date: Sun, 17 May 2026 02:34:36 -0400 Subject: [PATCH 36/61] arm-trusted-firmware-mediatek: cudy-ddr3: reduce ram speed to 1866 MT/s Add DDR3_FREQ_1866 for DDR3 Cudy devices to reduce RAM speed to 1866 MT/s All known Cudy devices with DDR3 256/512 MB RAM use ESMT M15T2G16128A-DEB DDR3 1866 MT/s or ESMT M15T2G16256A-DEB DDR3 1866 MT/s Signed-off-by: Dmitry Mostovoy Link: https://github.com/openwrt/openwrt/pull/23274 Signed-off-by: Jonas Jelonek --- package/boot/arm-trusted-firmware-mediatek/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/boot/arm-trusted-firmware-mediatek/Makefile b/package/boot/arm-trusted-firmware-mediatek/Makefile index b837e16f8c..500551bd95 100644 --- a/package/boot/arm-trusted-firmware-mediatek/Makefile +++ b/package/boot/arm-trusted-firmware-mediatek/Makefile @@ -273,11 +273,12 @@ define Trusted-Firmware-A/mt7981-spim-nand-ubi-ddr4 endef define Trusted-Firmware-A/mt7981-cudy-ddr3 - NAME:=Cudy (SPI-NAND via SPIM, DDR3) + NAME:=Cudy (SPI-NAND via SPIM, DDR3 1866 MT/s) BOOT_DEVICE:=spim-nand BUILD_SUBTARGET:=filogic PLAT:=mt7981 DDR_TYPE:=ddr3 + DDR3_FREQ_1866:=1 FIP_OFFSET:=0x3c0000 FIP_SIZE:=0x200000 endef From 6a08c6594989ab13e773f60b2a18df930ced73c9 Mon Sep 17 00:00:00 2001 From: Dmitry Mostovoy Date: Sat, 9 May 2026 11:56:40 -0400 Subject: [PATCH 37/61] mediatek: add cudy m3000-v1 ubootmod RAM: ESMT M15T2G16128A-DEB DDR3 1866 MT/s This allows us to use the full size of nand, which extends ubi size from 64Mb to 122.25Mb. 1. Log in to the device and backup all the partitions, especially unique "Factory" and "bdinfo" partitions from System -> Backup / Flash Firmware -> Save mtdblock contents. 2. Install kmod-mtd-rw to unlock mtd partitions for writing apk update && apk add kmod-mtd-rw && insmod mtd-rw i_want_a_brick=1 3. Write new OpenWrt (U-Boot Layout) "BL2" and "FIP": mtd -e BL2 write openwrt-mediatek-filogic-cudy_m3000-v1-ubootmod-preloader.bin BL2 mtd -e FIP write openwrt-mediatek-filogic-cudy_m3000-v1-ubootmod-bl31-uboot.fip FIP 4. Set static IP on your PC: "192.168.1.254", gateway "192.168.1.1" 5. Serve openwrt-mediatek-filogic-cudy_m3000-v1-ubootmod-initramfs-recovery.itb using TFTP server. 6. Connect Router LAN with PC LAN. 7. Cut off the power and re-engage, wait for TFTP recovery to complete. 8. After OpenWrt initramfs recovery has booted, clean "/dev/mtd5" ubi partition to utilize maximum of free space: ubidetach -p /dev/mtd5; ubiformat /dev/mtd5 -y; ubiattach -p /dev/mtd5 ubimkvol /dev/ubi0 -n 0 -N ubootenv -s 128KiB ubimkvol /dev/ubi0 -n 1 -N ubootenv2 -s 128KiB 9. Perform sysupgrade. Signed-off-by: Dmitry Mostovoy Link: https://github.com/openwrt/openwrt/pull/23274 Signed-off-by: Jonas Jelonek --- package/boot/uboot-mediatek/Makefile | 13 + .../patches/468-add-cudy_m3000-v1.patch | 325 ++++++++++++++++++ .../uboot-envtools/files/mediatek_filogic | 1 + .../dts/mt7981b-cudy-m3000-v1-ubootmod.dts | 24 ++ .../mediatek/dts/mt7981b-cudy-m3000-v1.dts | 16 +- .../mediatek/dts/mt7981b-cudy-m3000-v1.dtsi | 17 + .../mediatek/dts/mt7981b-cudy-m3000.dtsi | 6 +- .../filogic/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/ieee80211/11_fix_wifi_mac | 1 + .../base-files/lib/upgrade/platform.sh | 2 + target/linux/mediatek/image/filogic.mk | 25 ++ 11 files changed, 415 insertions(+), 16 deletions(-) create mode 100644 package/boot/uboot-mediatek/patches/468-add-cudy_m3000-v1.patch create mode 100644 target/linux/mediatek/dts/mt7981b-cudy-m3000-v1-ubootmod.dts create mode 100644 target/linux/mediatek/dts/mt7981b-cudy-m3000-v1.dtsi diff --git a/package/boot/uboot-mediatek/Makefile b/package/boot/uboot-mediatek/Makefile index eb0a29ecc9..72891a471a 100644 --- a/package/boot/uboot-mediatek/Makefile +++ b/package/boot/uboot-mediatek/Makefile @@ -329,6 +329,18 @@ define U-Boot/mt7981_creatlentem_clt-r30b1-ubi DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ubi-ddr3-1866 endef +define U-Boot/mt7981_cudy_m3000-v1 + NAME:=Cudy M3000 v1/v2 + BUILD_SUBTARGET:=filogic + BUILD_DEVICES:=cudy_m3000-v1-ubootmod + UBOOT_CONFIG:=mt7981_cudy_m3000-v1 + UBOOT_IMAGE:=u-boot.fip + BL2_BOOTDEV:=cudy + BL2_SOC:=mt7981 + BL2_DDRTYPE:=ddr3 + DEPENDS:=+trusted-firmware-a-mt7981-cudy-ddr3 +endef + define U-Boot/mt7981_cudy_tr3000-v1 NAME:=Cudy TR3000 v1 BUILD_SUBTARGET:=filogic @@ -1260,6 +1272,7 @@ UBOOT_TARGETS := \ mt7981_cmcc_rax3000m-nand-ddr4 \ mt7981_comfast_cf-wr632ax \ mt7981_creatlentem_clt-r30b1-ubi \ + mt7981_cudy_m3000-v1 \ mt7981_cudy_tr3000-v1 \ mt7981_cudy_wbr3000uax-v1 \ mt7981_cudy_wr3000e-v1 \ diff --git a/package/boot/uboot-mediatek/patches/468-add-cudy_m3000-v1.patch b/package/boot/uboot-mediatek/patches/468-add-cudy_m3000-v1.patch new file mode 100644 index 0000000000..624b49d58f --- /dev/null +++ b/package/boot/uboot-mediatek/patches/468-add-cudy_m3000-v1.patch @@ -0,0 +1,325 @@ +--- /dev/null ++++ b/configs/mt7981_cudy_m3000-v1_defconfig +@@ -0,0 +1,112 @@ ++CONFIG_ARM=y ++CONFIG_ARM_SMCCC=y ++CONFIG_SYS_HAS_NONCACHED_MEMORY=y ++CONFIG_POSITION_INDEPENDENT=y ++CONFIG_ARCH_MEDIATEK=y ++CONFIG_TEXT_BASE=0x41e00000 ++CONFIG_SYS_MALLOC_F_LEN=0x4000 ++CONFIG_NR_DRAM_BANKS=1 ++CONFIG_DEFAULT_DEVICE_TREE="mt7981-cudy-m3000-v1" ++CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_TARGET_MT7981=y ++CONFIG_SYS_LOAD_ADDR=0x46000000 ++CONFIG_PRE_CON_BUF_ADDR=0x4007EF00 ++CONFIG_DEBUG_UART_BASE=0x11002000 ++CONFIG_DEBUG_UART_CLOCK=40000000 ++CONFIG_DEBUG_UART=y ++CONFIG_FIT=y ++CONFIG_BOOTDELAY=30 ++CONFIG_AUTOBOOT_KEYED=y ++CONFIG_AUTOBOOT_MENU_SHOW=y ++CONFIG_DEFAULT_FDT_FILE="mediatek/mt7981-cudy-m3000-v1.dtb" ++CONFIG_LOGLEVEL=7 ++CONFIG_PRE_CONSOLE_BUFFER=y ++CONFIG_LOG=y ++# CONFIG_BOARD_INIT is not set ++CONFIG_BOARD_LATE_INIT=y ++CONFIG_HUSH_PARSER=y ++CONFIG_SYS_PROMPT="MT7981> " ++CONFIG_CMD_CPU=y ++CONFIG_CMD_LICENSE=y ++CONFIG_CMD_BOOTMENU=y ++CONFIG_CMD_ASKENV=y ++CONFIG_CMD_ERASEENV=y ++CONFIG_CMD_ENV_FLAGS=y ++CONFIG_CMD_RNG=y ++CONFIG_CMD_STRINGS=y ++CONFIG_CMD_DM=y ++CONFIG_CMD_GPIO=y ++CONFIG_CMD_GPT=y ++CONFIG_CMD_MTD=y ++CONFIG_CMD_PART=y ++CONFIG_CMD_TFTPSRV=y ++CONFIG_CMD_RARP=y ++CONFIG_CMD_CDP=y ++CONFIG_CMD_SNTP=y ++CONFIG_CMD_LINK_LOCAL=y ++CONFIG_CMD_DHCP=y ++CONFIG_CMD_DNS=y ++CONFIG_CMD_PING=y ++CONFIG_CMD_PXE=y ++CONFIG_CMD_CACHE=y ++CONFIG_CMD_PSTORE=y ++CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000 ++CONFIG_CMD_UUID=y ++CONFIG_CMD_HASH=y ++CONFIG_CMD_SMC=y ++CONFIG_CMD_UBI=y ++CONFIG_CMD_UBI_RENAME=y ++CONFIG_OF_EMBED=y ++CONFIG_ENV_OVERWRITE=y ++CONFIG_ENV_IS_IN_UBI=y ++CONFIG_ENV_REDUNDANT=y ++CONFIG_ENV_UBI_PART="ubi" ++CONFIG_ENV_UBI_VOLUME="ubootenv" ++CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2" ++CONFIG_ENV_RELOC_GD_ENV_ADDR=y ++CONFIG_ENV_USE_DEFAULT_ENV_TEXT_FILE=y ++CONFIG_ENV_DEFAULT_ENV_TEXT_FILE="defenvs/cudy_m3000-v1_env" ++CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y ++CONFIG_VERSION_VARIABLE=y ++CONFIG_NETCONSOLE=y ++CONFIG_USE_IPADDR=y ++CONFIG_IPADDR="192.168.1.1" ++CONFIG_USE_SERVERIP=y ++CONFIG_SERVERIP="192.168.1.254" ++CONFIG_NET_RANDOM_ETHADDR=y ++CONFIG_REGMAP=y ++CONFIG_SYSCON=y ++CONFIG_BUTTON=y ++CONFIG_BUTTON_GPIO=y ++CONFIG_CLK=y ++CONFIG_GPIO_HOG=y ++CONFIG_LED=y ++CONFIG_LED_BLINK=y ++CONFIG_LED_GPIO=y ++# CONFIG_MMC is not set ++CONFIG_MTD=y ++CONFIG_DM_MTD=y ++CONFIG_MTD_SPI_NAND=y ++CONFIG_MTD_UBI_FASTMAP=y ++CONFIG_PHY_FIXED=y ++CONFIG_MEDIATEK_ETH=y ++CONFIG_PHY=y ++CONFIG_PINCTRL=y ++CONFIG_PINCONF=y ++CONFIG_PINCTRL_MT7981=y ++CONFIG_POWER_DOMAIN=y ++CONFIG_MTK_POWER_DOMAIN=y ++CONFIG_DM_REGULATOR=y ++CONFIG_DM_REGULATOR_FIXED=y ++CONFIG_DM_REGULATOR_GPIO=y ++CONFIG_RAM=y ++CONFIG_DM_RNG=y ++CONFIG_RNG_MTK_V2=y ++CONFIG_DM_SERIAL=y ++CONFIG_SERIAL_RX_BUFFER=y ++CONFIG_MTK_SERIAL=y ++CONFIG_SPI=y ++CONFIG_DM_SPI=y ++CONFIG_MTK_SPIM=y ++CONFIG_ZSTD=y ++CONFIG_HEXDUMP=y +--- /dev/null ++++ b/arch/arm/dts/mt7981-cudy-m3000-v1.dts +@@ -0,0 +1,150 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++ ++/dts-v1/; ++#include "mt7981.dtsi" ++#include ++#include ++ ++/ { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ model = "Cudy M3000 v1/v2"; ++ compatible = "mediatek,mt7981", "mediatek,mt7981-rfb"; ++ ++ chosen { ++ stdout-path = &uart0; ++ tick-timer = &timer0; ++ }; ++ ++ memory@40000000 { ++ device_type = "memory"; ++ reg = <0x40000000 0x10000000>; ++ }; ++ ++ gpio-keys { ++ compatible = "gpio-keys"; ++ ++ button-reset { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&pio 1 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ gpio-leds { ++ compatible = "gpio-leds"; ++ ++ led_status_white { ++ label = "white:status"; ++ gpios = <&pio 10 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led_wan_white { ++ label = "white:wan"; ++ gpios = <&pio 5 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++ð { ++ status = "okay"; ++ mediatek,gmac-id = <1>; ++ phy-mode = "gmii"; ++ phy-handle = <&phy0>; ++ ++ mdio { ++ phy0: ethernet-phy@0 { ++ compatible = "ethernet-phy-id03a2.9461"; ++ reg = <0x0>; ++ phy-mode = "gmii"; ++ }; ++ }; ++}; ++ ++&pio { ++ spi_flash_pins: spi0-pins-func-1 { ++ mux { ++ function = "flash"; ++ groups = "spi0", "spi0_wp_hold"; ++ }; ++ ++ conf-pu { ++ pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP"; ++ drive-strength = ; ++ bias-pull-up = ; ++ }; ++ ++ conf-pd { ++ pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; ++ drive-strength = ; ++ bias-pull-down = ; ++ }; ++ }; ++}; ++ ++&spi0 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spi_flash_pins>; ++ status = "okay"; ++ must_tx; ++ enhance_timing; ++ dma_ext; ++ ipm_design; ++ support_quad; ++ tick_dly = <2>; ++ sample_sel = <0>; ++ ++ spi_nand@0 { ++ compatible = "spi-nand"; ++ reg = <0>; ++ spi-max-frequency = <52000000>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "bl2"; ++ reg = <0x0 0x100000>; ++ }; ++ ++ partition@100000 { ++ label = "u-boot-env"; ++ reg = <0x100000 0x80000>; ++ }; ++ ++ partition@180000 { ++ label = "factory"; ++ reg = <0x180000 0x200000>; ++ }; ++ ++ partition@380000 { ++ label = "bdinfo"; ++ reg = <0x380000 0x40000>; ++ }; ++ ++ partition@3c0000 { ++ label = "fip"; ++ reg = <0x3c0000 0x200000>; ++ }; ++ ++ partition@5c0000 { ++ label = "ubi"; ++ reg = <0x5c0000 0x7a40000>; ++ compatible = "linux,ubi"; ++ }; ++ }; ++ }; ++}; ++ ++&uart0 { ++ mediatek,force-highspeed; ++ status = "okay"; ++}; ++ ++&watchdog { ++ status = "disabled"; ++}; +--- /dev/null ++++ b/defenvs/cudy_m3000-v1_env +@@ -0,0 +1,54 @@ ++ipaddr=192.168.1.1 ++serverip=192.168.1.254 ++loadaddr=0x46000000 ++console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0 ++bootcmd=if pstore check ; then run boot_recovery ; else run boot_ubi ; fi ++bootconf=config-1 ++bootdelay=0 ++bootfile=openwrt-mediatek-filogic-cudy_m3000-v1-ubootmod-initramfs-recovery.itb ++bootfile_bl2=openwrt-mediatek-filogic-cudy_m3000-v1-ubootmod-preloader.bin ++bootfile_fip=openwrt-mediatek-filogic-cudy_m3000-v1-ubootmod-bl31-uboot.fip ++bootfile_upg=openwrt-mediatek-filogic-cudy_m3000-v1-ubootmod-squashfs-sysupgrade.itb ++bootled_pwr=white:status ++bootled_rec=white:wan ++bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60 ++bootmenu_default=0 ++bootmenu_delay=0 ++bootmenu_title= ( ( ( OpenWrt ) ) ) ++bootmenu_0=Initialize environment.=run _firstboot ++bootmenu_0d=Run default boot command.=run boot_default ++bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return ++bootmenu_2=Boot production system from NAND.=run boot_production ; run bootmenu_confirm_return ++bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return ++bootmenu_4=Load production system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return ++bootmenu_5=Load recovery system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return ++bootmenu_6=Load BL31+U-Boot FIP via TFTP then write to NAND.=run boot_tftp_write_fip ; run bootmenu_confirm_return ++bootmenu_7=Load BL2 preloader via TFTP then write to NAND.=run boot_tftp_write_bl2 ; run bootmenu_confirm_return ++bootmenu_8=Reboot.=reset ++bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset ++boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu ++boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever ++boot_production=led $bootled_pwr on ; run ubi_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off ++boot_recovery=led $bootled_rec on ; run ubi_read_recovery && bootm $loadaddr#$bootconf ; led $bootled_rec off ++boot_ubi=run boot_production ; run boot_recovery ; run boot_tftp_forever ++boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp_recovery ; sleep 1 ; done ++boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run ubi_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi ++boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run ubi_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi ++boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf ++boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run mtd_write_fip && run reset_factory ++boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run mtd_write_bl2 ++reset_factory=ubi part ubi ; mw $loadaddr 0x0 0x800 ; ubi write $loadaddr ubootenv 0x800 ; ubi write $loadaddr ubootenv2 0x800 ++mtd_write_fip=mtd erase fip && mtd write fip $loadaddr ++mtd_write_bl2=mtd erase bl2 && mtd write bl2 $loadaddr ++ubi_create_env=ubi check ubootenv || ubi create ubootenv 0x100000 dynamic || run ubi_format ; ubi check ubootenv2 || ubi create ubootenv2 0x100000 dynamic || run ubi_format ++ubi_format=ubi detach ; mtd erase ubi && ubi part ubi ; reset ++ubi_prepare_rootfs=if ubi check rootfs_data ; then else if env exists rootfs_data_max ; then ubi create rootfs_data $rootfs_data_max dynamic || ubi create rootfs_data - dynamic ; else ubi create rootfs_data - dynamic ; fi ; fi ++ubi_read_production=ubi read $loadaddr fit && iminfo $loadaddr && run ubi_prepare_rootfs ++ubi_read_recovery=ubi check recovery && ubi read $loadaddr recovery ++ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data ++ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic && ubi write $loadaddr fit $filesize ++ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic && ubi write $loadaddr recovery $filesize ++_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv ++_firstboot=setenv _firstboot ; run _switch_to_menu ; run _init_env ; run boot_first ++_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title ++_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title $ver" diff --git a/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic index 21646b100a..8e181ed3ba 100644 --- a/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic +++ b/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic @@ -28,6 +28,7 @@ asus,zenwifi-bt8-ubootmod|\ cmcc,a10-ubootmod|\ comfast,cf-wr632ax-ubootmod|\ creatlentem,clt-r30b1-ubi|\ +cudy,m3000-v1-ubootmod|\ cudy,tr3000-v1-ubootmod|\ cudy,wbr3000uax-v1-ubootmod|\ cudy,wr3000e-v1-ubootmod|\ diff --git a/target/linux/mediatek/dts/mt7981b-cudy-m3000-v1-ubootmod.dts b/target/linux/mediatek/dts/mt7981b-cudy-m3000-v1-ubootmod.dts new file mode 100644 index 0000000000..4b9225e906 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-cudy-m3000-v1-ubootmod.dts @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/dts-v1/; +#include "mt7981b-cudy-m3000-v1.dtsi" + +/ { + model = "Cudy M3000 v1/v2 (OpenWrt U-Boot layout)"; + compatible = "cudy,m3000-v1-ubootmod", "mediatek,mt7981"; + + chosen { + bootargs = "root=/dev/fit0 rootwait"; + rootdisk = <&ubi_rootdisk>; + }; +}; + +&ubi { + reg = <0x5c0000 0x7a40000>; + + volumes { + ubi_rootdisk: ubi-volume-fit { + volname = "fit"; + }; + }; +}; diff --git a/target/linux/mediatek/dts/mt7981b-cudy-m3000-v1.dts b/target/linux/mediatek/dts/mt7981b-cudy-m3000-v1.dts index 885437e49a..6a86b5724c 100644 --- a/target/linux/mediatek/dts/mt7981b-cudy-m3000-v1.dts +++ b/target/linux/mediatek/dts/mt7981b-cudy-m3000-v1.dts @@ -2,21 +2,15 @@ /dts-v1/; -#include "mt7981b-cudy-m3000.dtsi" +#include "mt7981b-cudy-m3000-v1.dtsi" / { model = "Cudy M3000 v1/v2"; compatible = "cudy,m3000-v1", "mediatek,mt7981"; }; -&mdio_bus { - wan_phy: ethernet-phy@1 { - compatible = "ethernet-phy-ieee802.3-c45"; - reg = <1>; - reset-assert-us = <100000>; - reset-deassert-us = <100000>; - reset-gpios = <&pio 39 GPIO_ACTIVE_LOW>; - interrupts = <38 IRQ_TYPE_LEVEL_LOW>; - interrupt-parent = <&pio>; - }; +&spi_nand { + mediatek,nmbm; + mediatek,bmt-max-ratio = <1>; + mediatek,bmt-max-reserved-blocks = <64>; }; diff --git a/target/linux/mediatek/dts/mt7981b-cudy-m3000-v1.dtsi b/target/linux/mediatek/dts/mt7981b-cudy-m3000-v1.dtsi new file mode 100644 index 0000000000..69555a568f --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-cudy-m3000-v1.dtsi @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/dts-v1/; + +#include "mt7981b-cudy-m3000.dtsi" + +&mdio_bus { + wan_phy: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <1>; + reset-assert-us = <100000>; + reset-deassert-us = <100000>; + reset-gpios = <&pio 39 GPIO_ACTIVE_LOW>; + interrupts = <38 IRQ_TYPE_LEVEL_LOW>; + interrupt-parent = <&pio>; + }; +}; diff --git a/target/linux/mediatek/dts/mt7981b-cudy-m3000.dtsi b/target/linux/mediatek/dts/mt7981b-cudy-m3000.dtsi index 1d293c4ff7..32398fa4ff 100644 --- a/target/linux/mediatek/dts/mt7981b-cudy-m3000.dtsi +++ b/target/linux/mediatek/dts/mt7981b-cudy-m3000.dtsi @@ -110,10 +110,6 @@ spi-tx-bus-width = <4>; spi-rx-bus-width = <4>; - mediatek,nmbm; - mediatek,bmt-max-ratio = <1>; - mediatek,bmt-max-reserved-blocks = <64>; - partitions { compatible = "fixed-partitions"; #address-cells = <1>; @@ -170,7 +166,7 @@ read-only; }; - partition@5c0000 { + ubi: partition@5c0000 { label = "ubi"; reg = <0x05c0000 0x4000000>; }; diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index a33449f6cf..a14bc70252 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -149,6 +149,7 @@ mediatek_setup_interfaces() ;; bazis,ax3000wm|\ cudy,m3000-v1|\ + cudy,m3000-v1-ubootmod|\ cudy,m3000-v2-yt8821|\ cudy,tr3000-256mb-v1|\ cudy,tr3000-v1|\ diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index 8b2b865cb2..fbdad933f9 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -92,6 +92,7 @@ case "$board" in cudy,ap3000wall-v1|\ cudy,ap3000-v1|\ cudy,m3000-v1|\ + cudy,m3000-v1-ubootmod|\ cudy,m3000-v2-yt8821|\ cudy,re3000-v1|\ cudy,tr3000-256mb-v1|\ diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh index bc6d827174..b9e5316920 100644 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -148,6 +148,7 @@ platform_do_upgrade() { cmcc,rax3000m|\ comfast,cf-wr632ax-ubootmod|\ creatlentem,clt-r30b1-ubi|\ + cudy,m3000-v1-ubootmod|\ cudy,tr3000-v1-ubootmod|\ cudy,wbr3000uax-v1-ubootmod|\ cudy,wr3000e-v1-ubootmod|\ @@ -362,6 +363,7 @@ platform_check_image() { cmcc,rax3000m|\ comfast,cf-wr632ax-ubootmod|\ creatlentem,clt-r30b1-ubi|\ + cudy,m3000-v1-ubootmod|\ cudy,tr3000-v1-ubootmod|\ cudy,wbr3000uax-v1-ubootmod|\ cudy,wr3000e-v1-ubootmod|\ diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 3c035290b2..83bb7d7dc3 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -1197,6 +1197,31 @@ define Device/cudy_m3000-v1 endef TARGET_DEVICES += cudy_m3000-v1 +define Device/cudy_m3000-v1-ubootmod + DEVICE_VENDOR := Cudy + DEVICE_MODEL := M3000 + DEVICE_VARIANT := v1/v2 (OpenWrt U-Boot layout) + DEVICE_DTS := mt7981b-cudy-m3000-v1-ubootmod + DEVICE_DTS_DIR := ../dts + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_IN_UBI := 1 + UBOOTENV_IN_UBI := 1 + IMAGES := sysupgrade.itb + KERNEL_INITRAMFS_SUFFIX := -recovery.itb + KERNEL := kernel-bin | gzip + KERNEL_INITRAMFS := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k + IMAGE/sysupgrade.itb := append-kernel | \ + fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata + ARTIFACTS := preloader.bin bl31-uboot.fip + ARTIFACT/preloader.bin := mt7981-bl2 cudy-ddr3 + ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot cudy_m3000-v1 +endef +TARGET_DEVICES += cudy_m3000-v1-ubootmod + define Device/cudy_m3000-v2-yt8821 DEVICE_VENDOR := Cudy DEVICE_MODEL := M3000 From 395252be087bc960ad38173220085ccecb668db6 Mon Sep 17 00:00:00 2001 From: Dmitry Mostovoy Date: Sat, 9 May 2026 14:56:45 -0400 Subject: [PATCH 38/61] mediatek: add cudy m3000-v2-yt8821 ubootmod RAM: ESMT M15T2G16128A-DEB DDR3 1866 MT/s This allows us to use the full size of nand, which extends ubi size from 64Mb to 122.25Mb. 1. Log in to the device and backup all the partitions, especially unique "Factory" and "bdinfo" partitions from System -> Backup / Flash Firmware -> Save mtdblock contents. 2. Install kmod-mtd-rw to unlock mtd partitions for writing apk update && apk add kmod-mtd-rw && insmod mtd-rw i_want_a_brick=1 3. Write new OpenWrt (U-Boot Layout) "BL2" and "FIP": mtd -e BL2 write openwrt-mediatek-filogic-cudy_m3000-v2-yt8821-ubootmod-preloader.bin BL2 mtd -e FIP write openwrt-mediatek-filogic-cudy_m3000-v2-yt8821-ubootmod-bl31-uboot.fip FIP 4. Set static IP on your PC: "192.168.1.254", gateway "192.168.1.1" 5. Serve openwrt-mediatek-filogic-cudy_m3000-v2-yt8821-ubootmod-initramfs-recovery.itb using TFTP server. 6. Connect Router LAN with PC LAN. 7. Cut off the power and re-engage, wait for TFTP recovery to complete. 8. After OpenWrt initramfs recovery has booted, clean "/dev/mtd5" ubi partition to utilize maximum of free space: ubidetach -p /dev/mtd5; ubiformat /dev/mtd5 -y; ubiattach -p /dev/mtd5 ubimkvol /dev/ubi0 -n 0 -N ubootenv -s 128KiB ubimkvol /dev/ubi0 -n 1 -N ubootenv2 -s 128KiB 9. Perform sysupgrade. Signed-off-by: Dmitry Mostovoy Link: https://github.com/openwrt/openwrt/pull/23274 Signed-off-by: Jonas Jelonek --- package/boot/uboot-mediatek/Makefile | 13 + .../468-add-cudy_m3000-v2-yt8821.patch | 325 ++++++++++++++++++ .../uboot-envtools/files/mediatek_filogic | 1 + .../mt7981b-cudy-m3000-v2-yt8821-ubootmod.dts | 24 ++ .../dts/mt7981b-cudy-m3000-v2-yt8821.dts | 16 +- .../dts/mt7981b-cudy-m3000-v2-yt8821.dtsi | 17 + .../filogic/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/ieee80211/11_fix_wifi_mac | 1 + .../base-files/lib/upgrade/platform.sh | 2 + target/linux/mediatek/image/filogic.mk | 25 ++ 10 files changed, 414 insertions(+), 11 deletions(-) create mode 100644 package/boot/uboot-mediatek/patches/468-add-cudy_m3000-v2-yt8821.patch create mode 100644 target/linux/mediatek/dts/mt7981b-cudy-m3000-v2-yt8821-ubootmod.dts create mode 100644 target/linux/mediatek/dts/mt7981b-cudy-m3000-v2-yt8821.dtsi diff --git a/package/boot/uboot-mediatek/Makefile b/package/boot/uboot-mediatek/Makefile index 72891a471a..4b50e78234 100644 --- a/package/boot/uboot-mediatek/Makefile +++ b/package/boot/uboot-mediatek/Makefile @@ -341,6 +341,18 @@ define U-Boot/mt7981_cudy_m3000-v1 DEPENDS:=+trusted-firmware-a-mt7981-cudy-ddr3 endef +define U-Boot/mt7981_cudy_m3000-v2-yt8821 + NAME:=Cudy M3000 v2 with Motorcomm YT8821 + BUILD_SUBTARGET:=filogic + BUILD_DEVICES:=cudy_m3000-v2-yt8821-ubootmod + UBOOT_CONFIG:=mt7981_cudy_m3000-v2-yt8821 + UBOOT_IMAGE:=u-boot.fip + BL2_BOOTDEV:=cudy + BL2_SOC:=mt7981 + BL2_DDRTYPE:=ddr3 + DEPENDS:=+trusted-firmware-a-mt7981-cudy-ddr3 +endef + define U-Boot/mt7981_cudy_tr3000-v1 NAME:=Cudy TR3000 v1 BUILD_SUBTARGET:=filogic @@ -1273,6 +1285,7 @@ UBOOT_TARGETS := \ mt7981_comfast_cf-wr632ax \ mt7981_creatlentem_clt-r30b1-ubi \ mt7981_cudy_m3000-v1 \ + mt7981_cudy_m3000-v2-yt8821 \ mt7981_cudy_tr3000-v1 \ mt7981_cudy_wbr3000uax-v1 \ mt7981_cudy_wr3000e-v1 \ diff --git a/package/boot/uboot-mediatek/patches/468-add-cudy_m3000-v2-yt8821.patch b/package/boot/uboot-mediatek/patches/468-add-cudy_m3000-v2-yt8821.patch new file mode 100644 index 0000000000..4771966446 --- /dev/null +++ b/package/boot/uboot-mediatek/patches/468-add-cudy_m3000-v2-yt8821.patch @@ -0,0 +1,325 @@ +--- /dev/null ++++ b/configs/mt7981_cudy_m3000-v2-yt8821_defconfig +@@ -0,0 +1,112 @@ ++CONFIG_ARM=y ++CONFIG_ARM_SMCCC=y ++CONFIG_SYS_HAS_NONCACHED_MEMORY=y ++CONFIG_POSITION_INDEPENDENT=y ++CONFIG_ARCH_MEDIATEK=y ++CONFIG_TEXT_BASE=0x41e00000 ++CONFIG_SYS_MALLOC_F_LEN=0x4000 ++CONFIG_NR_DRAM_BANKS=1 ++CONFIG_DEFAULT_DEVICE_TREE="mt7981-cudy-m3000-v2-yt8821" ++CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_TARGET_MT7981=y ++CONFIG_SYS_LOAD_ADDR=0x46000000 ++CONFIG_PRE_CON_BUF_ADDR=0x4007EF00 ++CONFIG_DEBUG_UART_BASE=0x11002000 ++CONFIG_DEBUG_UART_CLOCK=40000000 ++CONFIG_DEBUG_UART=y ++CONFIG_FIT=y ++CONFIG_BOOTDELAY=30 ++CONFIG_AUTOBOOT_KEYED=y ++CONFIG_AUTOBOOT_MENU_SHOW=y ++CONFIG_DEFAULT_FDT_FILE="mediatek/mt7981-cudy-m3000-v2-yt8821.dtb" ++CONFIG_LOGLEVEL=7 ++CONFIG_PRE_CONSOLE_BUFFER=y ++CONFIG_LOG=y ++# CONFIG_BOARD_INIT is not set ++CONFIG_BOARD_LATE_INIT=y ++CONFIG_HUSH_PARSER=y ++CONFIG_SYS_PROMPT="MT7981> " ++CONFIG_CMD_CPU=y ++CONFIG_CMD_LICENSE=y ++CONFIG_CMD_BOOTMENU=y ++CONFIG_CMD_ASKENV=y ++CONFIG_CMD_ERASEENV=y ++CONFIG_CMD_ENV_FLAGS=y ++CONFIG_CMD_RNG=y ++CONFIG_CMD_STRINGS=y ++CONFIG_CMD_DM=y ++CONFIG_CMD_GPIO=y ++CONFIG_CMD_GPT=y ++CONFIG_CMD_MTD=y ++CONFIG_CMD_PART=y ++CONFIG_CMD_TFTPSRV=y ++CONFIG_CMD_RARP=y ++CONFIG_CMD_CDP=y ++CONFIG_CMD_SNTP=y ++CONFIG_CMD_LINK_LOCAL=y ++CONFIG_CMD_DHCP=y ++CONFIG_CMD_DNS=y ++CONFIG_CMD_PING=y ++CONFIG_CMD_PXE=y ++CONFIG_CMD_CACHE=y ++CONFIG_CMD_PSTORE=y ++CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000 ++CONFIG_CMD_UUID=y ++CONFIG_CMD_HASH=y ++CONFIG_CMD_SMC=y ++CONFIG_CMD_UBI=y ++CONFIG_CMD_UBI_RENAME=y ++CONFIG_OF_EMBED=y ++CONFIG_ENV_OVERWRITE=y ++CONFIG_ENV_IS_IN_UBI=y ++CONFIG_ENV_REDUNDANT=y ++CONFIG_ENV_UBI_PART="ubi" ++CONFIG_ENV_UBI_VOLUME="ubootenv" ++CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2" ++CONFIG_ENV_RELOC_GD_ENV_ADDR=y ++CONFIG_ENV_USE_DEFAULT_ENV_TEXT_FILE=y ++CONFIG_ENV_DEFAULT_ENV_TEXT_FILE="defenvs/cudy_m3000-v2-yt8821_env" ++CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y ++CONFIG_VERSION_VARIABLE=y ++CONFIG_NETCONSOLE=y ++CONFIG_USE_IPADDR=y ++CONFIG_IPADDR="192.168.1.1" ++CONFIG_USE_SERVERIP=y ++CONFIG_SERVERIP="192.168.1.254" ++CONFIG_NET_RANDOM_ETHADDR=y ++CONFIG_REGMAP=y ++CONFIG_SYSCON=y ++CONFIG_BUTTON=y ++CONFIG_BUTTON_GPIO=y ++CONFIG_CLK=y ++CONFIG_GPIO_HOG=y ++CONFIG_LED=y ++CONFIG_LED_BLINK=y ++CONFIG_LED_GPIO=y ++# CONFIG_MMC is not set ++CONFIG_MTD=y ++CONFIG_DM_MTD=y ++CONFIG_MTD_SPI_NAND=y ++CONFIG_MTD_UBI_FASTMAP=y ++CONFIG_PHY_FIXED=y ++CONFIG_MEDIATEK_ETH=y ++CONFIG_PHY=y ++CONFIG_PINCTRL=y ++CONFIG_PINCONF=y ++CONFIG_PINCTRL_MT7981=y ++CONFIG_POWER_DOMAIN=y ++CONFIG_MTK_POWER_DOMAIN=y ++CONFIG_DM_REGULATOR=y ++CONFIG_DM_REGULATOR_FIXED=y ++CONFIG_DM_REGULATOR_GPIO=y ++CONFIG_RAM=y ++CONFIG_DM_RNG=y ++CONFIG_RNG_MTK_V2=y ++CONFIG_DM_SERIAL=y ++CONFIG_SERIAL_RX_BUFFER=y ++CONFIG_MTK_SERIAL=y ++CONFIG_SPI=y ++CONFIG_DM_SPI=y ++CONFIG_MTK_SPIM=y ++CONFIG_ZSTD=y ++CONFIG_HEXDUMP=y +--- /dev/null ++++ b/arch/arm/dts/mt7981-cudy-m3000-v2-yt8821.dts +@@ -0,0 +1,150 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++ ++/dts-v1/; ++#include "mt7981.dtsi" ++#include ++#include ++ ++/ { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ model = "Cudy M3000 v2 with Motorcomm YT8821"; ++ compatible = "mediatek,mt7981", "mediatek,mt7981-rfb"; ++ ++ chosen { ++ stdout-path = &uart0; ++ tick-timer = &timer0; ++ }; ++ ++ memory@40000000 { ++ device_type = "memory"; ++ reg = <0x40000000 0x10000000>; ++ }; ++ ++ gpio-keys { ++ compatible = "gpio-keys"; ++ ++ button-reset { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&pio 1 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ gpio-leds { ++ compatible = "gpio-leds"; ++ ++ led_status_white { ++ label = "white:status"; ++ gpios = <&pio 10 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led_wan_white { ++ label = "white:wan"; ++ gpios = <&pio 5 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++ð { ++ status = "okay"; ++ mediatek,gmac-id = <1>; ++ phy-mode = "gmii"; ++ phy-handle = <&phy0>; ++ ++ mdio { ++ phy0: ethernet-phy@0 { ++ compatible = "ethernet-phy-id03a2.9461"; ++ reg = <0x0>; ++ phy-mode = "gmii"; ++ }; ++ }; ++}; ++ ++&pio { ++ spi_flash_pins: spi0-pins-func-1 { ++ mux { ++ function = "flash"; ++ groups = "spi0", "spi0_wp_hold"; ++ }; ++ ++ conf-pu { ++ pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP"; ++ drive-strength = ; ++ bias-pull-up = ; ++ }; ++ ++ conf-pd { ++ pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; ++ drive-strength = ; ++ bias-pull-down = ; ++ }; ++ }; ++}; ++ ++&spi0 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spi_flash_pins>; ++ status = "okay"; ++ must_tx; ++ enhance_timing; ++ dma_ext; ++ ipm_design; ++ support_quad; ++ tick_dly = <2>; ++ sample_sel = <0>; ++ ++ spi_nand@0 { ++ compatible = "spi-nand"; ++ reg = <0>; ++ spi-max-frequency = <52000000>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "bl2"; ++ reg = <0x0 0x100000>; ++ }; ++ ++ partition@100000 { ++ label = "u-boot-env"; ++ reg = <0x100000 0x80000>; ++ }; ++ ++ partition@180000 { ++ label = "factory"; ++ reg = <0x180000 0x200000>; ++ }; ++ ++ partition@380000 { ++ label = "bdinfo"; ++ reg = <0x380000 0x40000>; ++ }; ++ ++ partition@3c0000 { ++ label = "fip"; ++ reg = <0x3c0000 0x200000>; ++ }; ++ ++ partition@5c0000 { ++ label = "ubi"; ++ reg = <0x5c0000 0x7a40000>; ++ compatible = "linux,ubi"; ++ }; ++ }; ++ }; ++}; ++ ++&uart0 { ++ mediatek,force-highspeed; ++ status = "okay"; ++}; ++ ++&watchdog { ++ status = "disabled"; ++}; +--- /dev/null ++++ b/defenvs/cudy_m3000-v2-yt8821_env +@@ -0,0 +1,54 @@ ++ipaddr=192.168.1.1 ++serverip=192.168.1.254 ++loadaddr=0x46000000 ++console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0 ++bootcmd=if pstore check ; then run boot_recovery ; else run boot_ubi ; fi ++bootconf=config-1 ++bootdelay=0 ++bootfile=openwrt-mediatek-filogic-cudy_m3000-v2-yt8821-ubootmod-initramfs-recovery.itb ++bootfile_bl2=openwrt-mediatek-filogic-cudy_m3000-v2-yt8821-ubootmod-preloader.bin ++bootfile_fip=openwrt-mediatek-filogic-cudy_m3000-v2-yt8821-ubootmod-bl31-uboot.fip ++bootfile_upg=openwrt-mediatek-filogic-cudy_m3000-v2-yt8821-ubootmod-squashfs-sysupgrade.itb ++bootled_pwr=white:status ++bootled_rec=white:wan ++bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60 ++bootmenu_default=0 ++bootmenu_delay=0 ++bootmenu_title= ( ( ( OpenWrt ) ) ) ++bootmenu_0=Initialize environment.=run _firstboot ++bootmenu_0d=Run default boot command.=run boot_default ++bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return ++bootmenu_2=Boot production system from NAND.=run boot_production ; run bootmenu_confirm_return ++bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return ++bootmenu_4=Load production system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return ++bootmenu_5=Load recovery system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return ++bootmenu_6=Load BL31+U-Boot FIP via TFTP then write to NAND.=run boot_tftp_write_fip ; run bootmenu_confirm_return ++bootmenu_7=Load BL2 preloader via TFTP then write to NAND.=run boot_tftp_write_bl2 ; run bootmenu_confirm_return ++bootmenu_8=Reboot.=reset ++bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset ++boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu ++boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever ++boot_production=led $bootled_pwr on ; run ubi_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off ++boot_recovery=led $bootled_rec on ; run ubi_read_recovery && bootm $loadaddr#$bootconf ; led $bootled_rec off ++boot_ubi=run boot_production ; run boot_recovery ; run boot_tftp_forever ++boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp_recovery ; sleep 1 ; done ++boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run ubi_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi ++boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run ubi_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi ++boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf ++boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run mtd_write_fip && run reset_factory ++boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run mtd_write_bl2 ++reset_factory=ubi part ubi ; mw $loadaddr 0x0 0x800 ; ubi write $loadaddr ubootenv 0x800 ; ubi write $loadaddr ubootenv2 0x800 ++mtd_write_fip=mtd erase fip && mtd write fip $loadaddr ++mtd_write_bl2=mtd erase bl2 && mtd write bl2 $loadaddr ++ubi_create_env=ubi check ubootenv || ubi create ubootenv 0x100000 dynamic || run ubi_format ; ubi check ubootenv2 || ubi create ubootenv2 0x100000 dynamic || run ubi_format ++ubi_format=ubi detach ; mtd erase ubi && ubi part ubi ; reset ++ubi_prepare_rootfs=if ubi check rootfs_data ; then else if env exists rootfs_data_max ; then ubi create rootfs_data $rootfs_data_max dynamic || ubi create rootfs_data - dynamic ; else ubi create rootfs_data - dynamic ; fi ; fi ++ubi_read_production=ubi read $loadaddr fit && iminfo $loadaddr && run ubi_prepare_rootfs ++ubi_read_recovery=ubi check recovery && ubi read $loadaddr recovery ++ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data ++ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic && ubi write $loadaddr fit $filesize ++ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic && ubi write $loadaddr recovery $filesize ++_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv ++_firstboot=setenv _firstboot ; run _switch_to_menu ; run _init_env ; run boot_first ++_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title ++_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title $ver" diff --git a/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic index 8e181ed3ba..b65fff0724 100644 --- a/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic +++ b/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic @@ -29,6 +29,7 @@ cmcc,a10-ubootmod|\ comfast,cf-wr632ax-ubootmod|\ creatlentem,clt-r30b1-ubi|\ cudy,m3000-v1-ubootmod|\ +cudy,m3000-v2-yt8821-ubootmod|\ cudy,tr3000-v1-ubootmod|\ cudy,wbr3000uax-v1-ubootmod|\ cudy,wr3000e-v1-ubootmod|\ diff --git a/target/linux/mediatek/dts/mt7981b-cudy-m3000-v2-yt8821-ubootmod.dts b/target/linux/mediatek/dts/mt7981b-cudy-m3000-v2-yt8821-ubootmod.dts new file mode 100644 index 0000000000..977cad3602 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-cudy-m3000-v2-yt8821-ubootmod.dts @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/dts-v1/; +#include "mt7981b-cudy-m3000-v2-yt8821.dtsi" + +/ { + model = "Cudy M3000 v2 with Motorcomm YT8821 (OpenWrt U-Boot layout)"; + compatible = "cudy,m3000-v2-yt8821-ubootmod", "mediatek,mt7981"; + + chosen { + bootargs = "root=/dev/fit0 rootwait"; + rootdisk = <&ubi_rootdisk>; + }; +}; + +&ubi { + reg = <0x5c0000 0x7a40000>; + + volumes { + ubi_rootdisk: ubi-volume-fit { + volname = "fit"; + }; + }; +}; diff --git a/target/linux/mediatek/dts/mt7981b-cudy-m3000-v2-yt8821.dts b/target/linux/mediatek/dts/mt7981b-cudy-m3000-v2-yt8821.dts index 0922b318e1..79e8f2352c 100644 --- a/target/linux/mediatek/dts/mt7981b-cudy-m3000-v2-yt8821.dts +++ b/target/linux/mediatek/dts/mt7981b-cudy-m3000-v2-yt8821.dts @@ -2,21 +2,15 @@ /dts-v1/; -#include "mt7981b-cudy-m3000.dtsi" +#include "mt7981b-cudy-m3000-v2-yt8821.dtsi" / { model = "Cudy M3000 v2 with Motorcomm YT8821"; compatible = "cudy,m3000-v2-yt8821", "mediatek,mt7981"; }; -&mdio_bus { - wan_phy: ethernet-phy@1 { - compatible = "ethernet-phy-id4f51.ea19"; - reg = <1>; - reset-assert-us = <100000>; - reset-deassert-us = <100000>; - reset-gpios = <&pio 39 GPIO_ACTIVE_LOW>; - interrupts = <38 IRQ_TYPE_LEVEL_LOW>; - interrupt-parent = <&pio>; - }; +&spi_nand { + mediatek,nmbm; + mediatek,bmt-max-ratio = <1>; + mediatek,bmt-max-reserved-blocks = <64>; }; diff --git a/target/linux/mediatek/dts/mt7981b-cudy-m3000-v2-yt8821.dtsi b/target/linux/mediatek/dts/mt7981b-cudy-m3000-v2-yt8821.dtsi new file mode 100644 index 0000000000..9401c7a059 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-cudy-m3000-v2-yt8821.dtsi @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/dts-v1/; + +#include "mt7981b-cudy-m3000.dtsi" + +&mdio_bus { + wan_phy: ethernet-phy@1 { + compatible = "ethernet-phy-id4f51.ea19"; + reg = <1>; + reset-assert-us = <100000>; + reset-deassert-us = <100000>; + reset-gpios = <&pio 39 GPIO_ACTIVE_LOW>; + interrupts = <38 IRQ_TYPE_LEVEL_LOW>; + interrupt-parent = <&pio>; + }; +}; diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index a14bc70252..3acac5e675 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -151,6 +151,7 @@ mediatek_setup_interfaces() cudy,m3000-v1|\ cudy,m3000-v1-ubootmod|\ cudy,m3000-v2-yt8821|\ + cudy,m3000-v2-yt8821-ubootmod|\ cudy,tr3000-256mb-v1|\ cudy,tr3000-v1|\ cudy,tr3000-v1-ubootmod|\ diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index fbdad933f9..4c96df3121 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -94,6 +94,7 @@ case "$board" in cudy,m3000-v1|\ cudy,m3000-v1-ubootmod|\ cudy,m3000-v2-yt8821|\ + cudy,m3000-v2-yt8821-ubootmod|\ cudy,re3000-v1|\ cudy,tr3000-256mb-v1|\ cudy,tr3000-v1|\ diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh index b9e5316920..79e25abdf7 100644 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -149,6 +149,7 @@ platform_do_upgrade() { comfast,cf-wr632ax-ubootmod|\ creatlentem,clt-r30b1-ubi|\ cudy,m3000-v1-ubootmod|\ + cudy,m3000-v2-yt8821-ubootmod|\ cudy,tr3000-v1-ubootmod|\ cudy,wbr3000uax-v1-ubootmod|\ cudy,wr3000e-v1-ubootmod|\ @@ -364,6 +365,7 @@ platform_check_image() { comfast,cf-wr632ax-ubootmod|\ creatlentem,clt-r30b1-ubi|\ cudy,m3000-v1-ubootmod|\ + cudy,m3000-v2-yt8821-ubootmod|\ cudy,tr3000-v1-ubootmod|\ cudy,wbr3000uax-v1-ubootmod|\ cudy,wr3000e-v1-ubootmod|\ diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 83bb7d7dc3..8a611c36c7 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -1242,6 +1242,31 @@ define Device/cudy_m3000-v2-yt8821 endef TARGET_DEVICES += cudy_m3000-v2-yt8821 +define Device/cudy_m3000-v2-yt8821-ubootmod + DEVICE_VENDOR := Cudy + DEVICE_MODEL := M3000 + DEVICE_VARIANT := v2 with Motorcomm YT8821 (OpenWrt U-Boot layout) + DEVICE_DTS := mt7981b-cudy-m3000-v2-yt8821-ubootmod + DEVICE_DTS_DIR := ../dts + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-phy-motorcomm + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_IN_UBI := 1 + UBOOTENV_IN_UBI := 1 + IMAGES := sysupgrade.itb + KERNEL_INITRAMFS_SUFFIX := -recovery.itb + KERNEL := kernel-bin | gzip + KERNEL_INITRAMFS := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k + IMAGE/sysupgrade.itb := append-kernel | \ + fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata + ARTIFACTS := preloader.bin bl31-uboot.fip + ARTIFACT/preloader.bin := mt7981-bl2 cudy-ddr3 + ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot cudy_m3000-v2-yt8821 +endef +TARGET_DEVICES += cudy_m3000-v2-yt8821-ubootmod + define Device/cudy_re3000-v1 DEVICE_VENDOR := Cudy DEVICE_MODEL := RE3000 From c495d1061a0dbf5c551bcede36a4c88daeeac394 Mon Sep 17 00:00:00 2001 From: Dmitry Mostovoy Date: Sun, 10 May 2026 02:52:08 -0400 Subject: [PATCH 39/61] mediatek: remove extra space in bootargs cudy wr3000p/s/h/e v1 ubootmod Removes an extra space in "bootargs" property mistakenly added initially Signed-off-by: Dmitry Mostovoy Link: https://github.com/openwrt/openwrt/pull/23274 Signed-off-by: Jonas Jelonek --- target/linux/mediatek/dts/mt7981b-cudy-wr3000e-v1-ubootmod.dts | 2 +- target/linux/mediatek/dts/mt7981b-cudy-wr3000h-v1-ubootmod.dts | 2 +- target/linux/mediatek/dts/mt7981b-cudy-wr3000p-v1-ubootmod.dts | 2 +- target/linux/mediatek/dts/mt7981b-cudy-wr3000s-v1-ubootmod.dts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target/linux/mediatek/dts/mt7981b-cudy-wr3000e-v1-ubootmod.dts b/target/linux/mediatek/dts/mt7981b-cudy-wr3000e-v1-ubootmod.dts index c947783631..5d76413512 100644 --- a/target/linux/mediatek/dts/mt7981b-cudy-wr3000e-v1-ubootmod.dts +++ b/target/linux/mediatek/dts/mt7981b-cudy-wr3000e-v1-ubootmod.dts @@ -8,7 +8,7 @@ compatible = "cudy,wr3000e-v1-ubootmod", "mediatek,mt7981"; chosen { - bootargs = " root=/dev/fit0 rootwait"; + bootargs = "root=/dev/fit0 rootwait"; rootdisk = <&ubi_rootdisk>; }; }; diff --git a/target/linux/mediatek/dts/mt7981b-cudy-wr3000h-v1-ubootmod.dts b/target/linux/mediatek/dts/mt7981b-cudy-wr3000h-v1-ubootmod.dts index 0aed40243b..ebff573adc 100644 --- a/target/linux/mediatek/dts/mt7981b-cudy-wr3000h-v1-ubootmod.dts +++ b/target/linux/mediatek/dts/mt7981b-cudy-wr3000h-v1-ubootmod.dts @@ -8,7 +8,7 @@ compatible = "cudy,wr3000h-v1-ubootmod", "mediatek,mt7981"; chosen { - bootargs = " root=/dev/fit0 rootwait"; + bootargs = "root=/dev/fit0 rootwait"; rootdisk = <&ubi_rootdisk>; }; }; diff --git a/target/linux/mediatek/dts/mt7981b-cudy-wr3000p-v1-ubootmod.dts b/target/linux/mediatek/dts/mt7981b-cudy-wr3000p-v1-ubootmod.dts index 7e3e68777d..8d1e67c1b6 100644 --- a/target/linux/mediatek/dts/mt7981b-cudy-wr3000p-v1-ubootmod.dts +++ b/target/linux/mediatek/dts/mt7981b-cudy-wr3000p-v1-ubootmod.dts @@ -8,7 +8,7 @@ compatible = "cudy,wr3000p-v1-ubootmod", "mediatek,mt7981"; chosen { - bootargs = " root=/dev/fit0 rootwait"; + bootargs = "root=/dev/fit0 rootwait"; rootdisk = <&ubi_rootdisk>; }; }; diff --git a/target/linux/mediatek/dts/mt7981b-cudy-wr3000s-v1-ubootmod.dts b/target/linux/mediatek/dts/mt7981b-cudy-wr3000s-v1-ubootmod.dts index 3083c1b396..5754b8ae42 100644 --- a/target/linux/mediatek/dts/mt7981b-cudy-wr3000s-v1-ubootmod.dts +++ b/target/linux/mediatek/dts/mt7981b-cudy-wr3000s-v1-ubootmod.dts @@ -8,7 +8,7 @@ compatible = "cudy,wr3000s-v1-ubootmod", "mediatek,mt7981"; chosen { - bootargs = " root=/dev/fit0 rootwait"; + bootargs = "root=/dev/fit0 rootwait"; rootdisk = <&ubi_rootdisk>; }; }; From 8fd0289452a4e004d370f73dd5f953489d0554c1 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 28 Jun 2026 14:09:06 -0700 Subject: [PATCH 40/61] apm821xx: move PHY/DSA drivers to DEVICE_PACKAGES on nand boards Only the devices that actually have these PHYs and DSA switches should carry the kernel modules, instead of baking them into the kernel for all nand boards. These devices have no space constraints, so any size increase is meaningless. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/23985 Signed-off-by: Jonas Jelonek --- target/linux/apm821xx/image/nand.mk | 6 +++--- target/linux/apm821xx/nand/config-default | 11 ----------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/target/linux/apm821xx/image/nand.mk b/target/linux/apm821xx/image/nand.mk index a5506c7a16..d23ee815e1 100644 --- a/target/linux/apm821xx/image/nand.mk +++ b/target/linux/apm821xx/image/nand.mk @@ -23,7 +23,7 @@ endef define Device/meraki_mr24 DEVICE_VENDOR := Cisco Meraki DEVICE_MODEL := MR24 - DEVICE_PACKAGES := kmod-spi-gpio -swconfig + DEVICE_PACKAGES := kmod-spi-gpio kmod-phy-at803x -swconfig BOARD_NAME := mr24 IMAGES := sysupgrade.bin DEVICE_DTC_FLAGS := --space 64512 @@ -42,7 +42,7 @@ define Device/meraki_mx60 DEVICE_ALT0_VENDOR := Cisco Meraki DEVICE_ALT0_MODEL := MX60W DEVICE_PACKAGES := kmod-spi-gpio kmod-usb-ledtrig-usbport kmod-usb-dwc2 \ - kmod-usb-storage block-mount + kmod-usb-storage block-mount kmod-dsa-qca8k kmod-phy-qca83xx BLOCKSIZE := 128k IMAGES := sysupgrade.bin DEVICE_DTC_FLAGS := --space 20480 @@ -97,7 +97,7 @@ define Device/netgear_wndr4700 kmod-dm kmod-fs-ext4 kmod-fs-vfat kmod-usb-ledtrig-usbport \ kmod-md-mod kmod-nls-cp437 kmod-nls-iso8859-1 kmod-nls-iso8859-15 \ kmod-nls-utf8 kmod-usb-xhci-pci-renesas kmod-usb-dwc2 kmod-usb-storage \ - partx-utils kmod-ata-dwc + partx-utils kmod-ata-dwc kmod-dsa-qca8k kmod-phy-qca83xx BOARD_NAME := wndr4700 PAGESIZE := 2048 SUBPAGESIZE := 512 diff --git a/target/linux/apm821xx/nand/config-default b/target/linux/apm821xx/nand/config-default index ac91a82882..64897aaddf 100644 --- a/target/linux/apm821xx/nand/config-default +++ b/target/linux/apm821xx/nand/config-default @@ -1,8 +1,6 @@ -CONFIG_AT803X_PHY=y CONFIG_BCH=y CONFIG_CRYPTO_HASH_INFO=y CONFIG_CRYPTO_ZSTD=y -CONFIG_GRO_CELLS=y CONFIG_HWMON=y CONFIG_MTD_NAND_CORE=y CONFIG_MTD_NAND_ECC=y @@ -16,16 +14,7 @@ CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y CONFIG_MTD_UBI_NVMEM=y CONFIG_MTD_UBI_WL_THRESHOLD=4096 -CONFIG_NET_DEVLINK=y -CONFIG_NET_DSA=y -CONFIG_NET_DSA_QCA8K=y -CONFIG_NET_DSA_QCA8K_LEDS_SUPPORT=y -CONFIG_NET_DSA_TAG_QCA=y # CONFIG_PCI_DISABLE_COMMON_QUIRKS is not set -CONFIG_PHYLINK=y -CONFIG_QCA83XX_PHY=y -CONFIG_QCOM_NET_PHYLIB=y -CONFIG_REGMAP=y CONFIG_RTC_CLASS=y CONFIG_RTC_DRV_M48T86=y CONFIG_RTC_I2C_AND_SPI=y From aef2523de1d80717ef62f908d88cea5e166f0ef5 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 29 Jun 2026 16:49:00 -0700 Subject: [PATCH 41/61] apm821xx: only install swconfig for needed devices Only the wndap6x0 devices need swconfig because of the realtek switch. Place swconfig there instead of for every device. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/23985 Signed-off-by: Jonas Jelonek --- target/linux/apm821xx/image/nand.mk | 4 ++-- target/linux/apm821xx/nand/target.mk | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/target/linux/apm821xx/image/nand.mk b/target/linux/apm821xx/image/nand.mk index d23ee815e1..51bc1a41be 100644 --- a/target/linux/apm821xx/image/nand.mk +++ b/target/linux/apm821xx/image/nand.mk @@ -23,7 +23,7 @@ endef define Device/meraki_mr24 DEVICE_VENDOR := Cisco Meraki DEVICE_MODEL := MR24 - DEVICE_PACKAGES := kmod-spi-gpio kmod-phy-at803x -swconfig + DEVICE_PACKAGES := kmod-spi-gpio kmod-phy-at803x BOARD_NAME := mr24 IMAGES := sysupgrade.bin DEVICE_DTC_FLAGS := --space 64512 @@ -59,7 +59,7 @@ TARGET_DEVICES += meraki_mx60 define Device/netgear_wndap6x0 DEVICE_VENDOR := NETGEAR - DEVICE_PACKAGES := kmod-eeprom-at24 + DEVICE_PACKAGES := kmod-eeprom-at24 swconfig SUBPAGESIZE := 256 PAGESIZE := 512 BLOCKSIZE := 16k diff --git a/target/linux/apm821xx/nand/target.mk b/target/linux/apm821xx/nand/target.mk index 0cba949fa0..b82385ba55 100644 --- a/target/linux/apm821xx/nand/target.mk +++ b/target/linux/apm821xx/nand/target.mk @@ -1,7 +1,7 @@ BOARDNAME:=Devices with NAND flash (Routers) FEATURES += nand pcie -DEFAULT_PACKAGES += kmod-ath9k swconfig wpad-basic-mbedtls +DEFAULT_PACKAGES += kmod-ath9k wpad-basic-mbedtls define Target/Description Build firmware images for APM821XX boards with NAND flash. From 365c6232c0f3e6c96bc0683c192f15360bfb5456 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 1 Jul 2026 10:35:29 +0200 Subject: [PATCH 42/61] qosify: update to Git HEAD (2026-06-22) 298754f6ded2 map: add NQB DiffServ codepoint d26cc573f36c qosify: account for bytes in traffic class statistics 0edbc51af3b6 qosify: group traffic class stats under a "classes" table fe8491da8daf qosify: add per-DSCP traffic statistics 181a691407ee dns: track cname cache hit/miss statistics cece4e23a9df qosify: track per-DNS-pattern traffic statistics 6b4be193a6dd qosify: report eBPF map entry count and last reload time e57b34046341 qosify: account for GSO segment count in packet statistics c49e72a4a45d qosify-bpf: remove unused variable in classify() 44ce40f8e083 qosify: count all traffic in per-DSCP statistics beeb87ec1f16 qosify: expose default traffic classes in statistics Signed-off-by: Felix Fietkau --- package/network/config/qosify/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/config/qosify/Makefile b/package/network/config/qosify/Makefile index 3c53c81f19..31a69b356a 100644 --- a/package/network/config/qosify/Makefile +++ b/package/network/config/qosify/Makefile @@ -11,9 +11,9 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=qosify PKG_SOURCE_URL=$(PROJECT_GIT)/project/qosify.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2024-09-20 -PKG_SOURCE_VERSION:=1501e0935175d713ad229d88a8401dbfddc0a6b4 -PKG_MIRROR_HASH:=6d6e07285a6c46f040ba88555accc64c291837f9726944b9e41ec4efbaaf6c20 +PKG_SOURCE_DATE:=2026-06-22 +PKG_SOURCE_VERSION:=beeb87ec1f16aaf5d99ff8060c2455971d9d400e +PKG_MIRROR_HASH:=c9ef0ad68daedb7e18e4959884a40cc0c64849dbd17bf6fdadeed8bdd8d49358 PKG_RELEASE:=1 PKG_LICENSE:=GPL-2.0 From 638a1927b1a8ab4078c29a4941cb256945e2908f Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 1 Jul 2026 13:14:43 +0200 Subject: [PATCH 43/61] mt76: update to Git HEAD (2026-07-01) 50a0c3057575 firmware: update MT7986 firmware to version 20260515 6b7b98627bcc wifi: mt76: mt7915: HW ATF support for mt7986+ 910db36ae5b1 wifi: mt76: mt7996: HW ATF support f6cf5faff4b6 firmware: update MT7996 firmware to version 20260311 fe40221e05eb wifi: mt76: mt7996: fix EAPOL source BSS for non-MLD stations 59676919ea40 wifi: mt76: mt7996: fix non-MLD station num_sta leak Signed-off-by: Felix Fietkau --- package/kernel/mt76/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index b7a1bc2402..d880b9c104 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2026-06-23 -PKG_SOURCE_VERSION:=2dd6e4c8892f59b7943ee163afd6ced881bfb31b -PKG_MIRROR_HASH:=9cd490cc08ccbcdd1476edfefd689d01ba5ef43a4a0cc7e23f13ac3a1e1522c5 +PKG_SOURCE_DATE:=2026-07-01 +PKG_SOURCE_VERSION:=59676919ea408b0b13a9d23f2e2e1a1ab407fba1 +PKG_MIRROR_HASH:=8a6dc6dac37ed56fcbfd874359f5c25acb65bcfaa795d50494cba17c98405dd5 PKG_MAINTAINER:=Felix Fietkau PKG_USE_NINJA:=0 From 10631d244cdacd004ccfe74c691765f9beacd413 Mon Sep 17 00:00:00 2001 From: YaleiZang Date: Tue, 30 Jun 2026 16:13:01 +0800 Subject: [PATCH 44/61] airoha: remove KERNEL_LOADADDR from airoha_an7583-evb device definition Delete the KERNEL_LOADADDR assignment from the airoha_an7583-evb device definition. The kernel load address is now centrally managed in image Makefile with, just using default load address: loadaddr-$(CONFIG_TARGET_airoha_an7583) := 0x80200000 This ensures the load address configuration is maintained in a single location. Removing the duplicate assignment prevents confusion and potential misconfiguration. Signed-off-by: YaleiZang Link: https://github.com/openwrt/openwrt/pull/24000 Signed-off-by: Robert Marko --- target/linux/airoha/image/an7583.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/target/linux/airoha/image/an7583.mk b/target/linux/airoha/image/an7583.mk index bbc78c65ae..f51b79e27b 100644 --- a/target/linux/airoha/image/an7583.mk +++ b/target/linux/airoha/image/an7583.mk @@ -11,7 +11,6 @@ define Device/airoha_an7583-evb DEVICE_PACKAGES := kmod-phy-aeonsemi-as21xxx kmod-leds-pwm kmod-pwm-airoha kmod-input-gpio-keys-polled DEVICE_DTS := an7583-evb DEVICE_DTS_CONFIG := config@1 - KERNEL_LOADADDR := 0x80088000 IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | pad-rootfs | append-metadata endef TARGET_DEVICES += airoha_an7583-evb From 4b1a8835289415862db5a1497f3d4a75a40a4b95 Mon Sep 17 00:00:00 2001 From: Przemek Rudy Date: Mon, 23 Dec 2024 20:28:12 +0100 Subject: [PATCH 45/61] mvebu: rename generic rb5009 to rb5009ug Specialize RB5009UG model from generic RB5009. Signed-off-by: Przemek Rudy [carlo@common-net.org: fixed model name and backward compatibility ] Signed-off-by: Carlo Filippi Signed-off-by: Sm00shed Link: https://github.com/openwrt/openwrt/pull/23698 Signed-off-by: Jonas Jelonek --- package/boot/uboot-mvebu/Makefile | 2 +- .../mvebu/cortexa72/base-files/etc/board.d/01_leds | 3 ++- .../mvebu/cortexa72/base-files/etc/board.d/02_network | 2 +- .../cortexa72/base-files/lib/upgrade/platform.sh | 2 +- ...armada-7040-rb5009.dts => armada-7040-rb5009.dtsi} | 0 .../arm64/boot/dts/marvell/armada-7040-rb5009ug.dts | 11 +++++++++++ target/linux/mvebu/image/cortexa72.mk | 10 ++++++++-- 7 files changed, 24 insertions(+), 6 deletions(-) rename target/linux/mvebu/files/arch/arm64/boot/dts/marvell/{armada-7040-rb5009.dts => armada-7040-rb5009.dtsi} (100%) create mode 100644 target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-rb5009ug.dts diff --git a/package/boot/uboot-mvebu/Makefile b/package/boot/uboot-mvebu/Makefile index 9c90277595..34d9a21ee4 100644 --- a/package/boot/uboot-mvebu/Makefile +++ b/package/boot/uboot-mvebu/Makefile @@ -70,7 +70,7 @@ endef define U-Boot/rb5009 NAME:=MikroTik RB5009 BUILD_SUBTARGET:=cortexa72 - BUILD_DEVICES:=mikrotik_rb5009 + BUILD_DEVICES:=mikrotik_rb5009ug UBOOT_CONFIG:=mvebu_rb5009 UBOOT_IMAGE:=u-boot.elf endef diff --git a/target/linux/mvebu/cortexa72/base-files/etc/board.d/01_leds b/target/linux/mvebu/cortexa72/base-files/etc/board.d/01_leds index 2d18587a62..6e0d2711d7 100644 --- a/target/linux/mvebu/cortexa72/base-files/etc/board.d/01_leds +++ b/target/linux/mvebu/cortexa72/base-files/etc/board.d/01_leds @@ -13,7 +13,8 @@ iei,puzzle-m901) iei,puzzle-m902) ucidef_set_led_netdev "wan" "WAN" "white:network" "eth2" "link" ;; -mikrotik,rb5009) +mikrotik,rb5009ug|\ +mikrotik,rb5009upr) ucidef_set_led_netdev "sfp" "SFP" "green:sfp" "sfp" ucidef_set_led_netdev "wan-port-link" "WAN-PORT-LINK" "!cp0!config-space@f2000000!mdio@12a200!switch@0!mdio1:00:green:" "p1" "tx rx link_10 link_100 link_1000 link_2500" ;; diff --git a/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network b/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network index 6c8c6c171f..b8d1a3b41b 100644 --- a/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network +++ b/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network @@ -38,7 +38,7 @@ marvell,armada7040-db) marvell,armada8040-clearfog-gt-8k) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 eth2" "eth0 eth1" ;; -mikrotik,rb5009) +mikrotik,rb5009ug) ucidef_set_interfaces_lan_wan "p2 p3 p4 p5 p6 p7 p8 sfp" "p1" ;; solidrun,clearfog-pro) diff --git a/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh b/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh index b88b3c08ec..1c1233f826 100755 --- a/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh +++ b/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh @@ -83,7 +83,7 @@ platform_do_upgrade() { solidrun,clearfog-pro) legacy_sdcard_do_upgrade "$1" ;; - mikrotik,rb5009) + mikrotik,rb5009ug) nand_do_upgrade "$1" ;; *) diff --git a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-rb5009.dts b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-rb5009.dtsi similarity index 100% rename from target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-rb5009.dts rename to target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-rb5009.dtsi diff --git a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-rb5009ug.dts b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-rb5009ug.dts new file mode 100644 index 0000000000..bf2d805565 --- /dev/null +++ b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-rb5009ug.dts @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include "armada-7040-rb5009.dtsi" + +/ { + model = "MikroTik RB5009UG"; + compatible = "mikrotik,rb5009ug", "marvell,armada7040", + "marvell,armada-ap806-quad", "marvell,armada-ap806"; +}; diff --git a/target/linux/mvebu/image/cortexa72.mk b/target/linux/mvebu/image/cortexa72.mk index 20cf50064c..bc7ef452ab 100644 --- a/target/linux/mvebu/image/cortexa72.mk +++ b/target/linux/mvebu/image/cortexa72.mk @@ -106,12 +106,18 @@ define Device/mikrotik_rb5009 $(call Device/FitImage) $(call Device/UbiFit) DEVICE_VENDOR := MikroTik - DEVICE_MODEL := RB5009 SOC := armada-7040 KERNEL_LOADADDR := 0x22000000 DEVICE_PACKAGES += kmod-i2c-gpio yafut kmod-dsa-mv88e6xxx endef -TARGET_DEVICES += mikrotik_rb5009 + +define Device/mikrotik_rb5009ug + $(call Device/mikrotik_rb5009) + DEVICE_DTS := armada-7040-rb5009ug + DEVICE_MODEL := RB5009UG+S+IN + SUPPORTED_DEVICES += mikrotik,rb5009 +endef +TARGET_DEVICES += mikrotik_rb5009ug define Device/marvell_clearfog-gt-8k $(call Device/Default-arm64) From e6f5d04c52d97b2d4cc3973a5fa7787bcc278c2b Mon Sep 17 00:00:00 2001 From: Przemek Rudy Date: Mon, 23 Feb 2026 11:44:17 +0100 Subject: [PATCH 46/61] mvebu: MikroTik: add support for RB5009UPr+S+IN The MikroTik RB5009UPr+S+IN is a multigig router based on the Marvell Armada 7040 SoC, sharing the same hardware base as the RB5009UG+S+IN with added PoE-out support on all ethernet ports. Specification: - SoC : Marvell Armada 7040 (88F7040), 4x Cortex-A72 - CPU frequency : 350-1400 MHz - RAM : 1 GB - Flash : 16 MB SPI NOR + 1 GB NAND - Switch : Marvell MV88E6393X - Ethernet : 1x 2.5G (p1, QCA8081), 7x 1G (p2-p8), 1x SFP+ 10G - PoE-in : 802.3af/at on p1, 24-57V - PoE-out : 802.3af/at on p1-p8, 130 W total - Power : DC jack / 2-pin terminal / PoE-in, 24-57V - USB : 1x USB 3.0 type A, max 1.5 A - LEDs/Keys (GPIO): 4x/1x - UART : MikroTik SPI/UART combo header (10-pin, 2.0mm pitch) - assignment : GND Vcc Rx ? GND / CLK DO /CS Tx DI (top view) - settings : 115200n8 Flash instruction using initramfs image: RouterBOOT cannot boot the OpenWrt kernel directly. A U-Boot loader (u-boot.elf) is installed as an intermediary: RouterBOOT loads u-boot.elf, which then loads the OpenWrt initramfs image. 1. Rename the downloaded initramfs image, removing the version number, to: openwrt-mvebu-cortexa72-mikrotik_rb5009-initramfs-uImage.itb 2. Set up a BOOTP/TFTP server serving u-boot.elf, with the renamed initramfs image in the same directory 3. Power off the router, hold the reset button (front panel), power on and keep holding until the initramfs image has been served, then release 4. The router boots the initramfs image, reachable at 192.168.1.1 5. Log in via SSH, install U-Boot, wipe NAND and flash OpenWrt: . /lib/functions.sh yafut -d /dev/mtd$(find_mtd_index "YAFFS") -w -i /tmp/u-boot.elf -o kernel -T ubiformat /dev/mtd$(find_mtd_index "ubi") -y sysupgrade /tmp/openwrt-mvebu-cortexa72-mikrotik_rb5009upr-squashfs-sysupgrade.bin Recovery: Hold the reset button while U-Boot is booting to load the initramfs image again. To return to RouterOS, use MikroTik Netinstall. MAC Addresses: MAC addresses are read from the RouterBOOT hard_config in NOR via the macaddr_hard nvmem cell: offset +0 p1 (2.5G, label-mac-device) offset +1 p2 offset +2 p3 offset +3 p4 offset +4 p5 offset +5 p6 offset +6 p7 offset +7 p8 offset +8 sfp Tested-by: Sm00shed (RB5009UPr+S+IN, OpenWrt v25.12.4, kernel 6.12.87, mtpoe fw 65.21) Signed-off-by: Przemek Rudy [carlo@common-net.org: refactor RB5009UPr+S+IN support and fix sysupgrade path] Signed-off-by: Carlo Filippi [sm00shed@posteo.de: fix compatible indentation, remove mikrotik,rb5009, expand commit message] Signed-off-by: Sm00shed Link: https://github.com/openwrt/openwrt/pull/23698 Signed-off-by: Jonas Jelonek --- package/boot/uboot-mvebu/Makefile | 2 +- .../base-files/etc/board.d/02_network | 3 +- .../base-files/lib/upgrade/platform.sh | 3 +- .../boot/dts/marvell/armada-7040-rb5009.dtsi | 6 --- .../dts/marvell/armada-7040-rb5009upr.dts | 40 +++++++++++++++++++ target/linux/mvebu/image/cortexa72.mk | 7 ++++ ...vers_spi_add_mtpoe_device_compatible.patch | 30 ++++++++++++++ 7 files changed, 82 insertions(+), 9 deletions(-) create mode 100644 target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-rb5009upr.dts create mode 100644 target/linux/mvebu/patches-6.18/913-drivers_spi_add_mtpoe_device_compatible.patch diff --git a/package/boot/uboot-mvebu/Makefile b/package/boot/uboot-mvebu/Makefile index 34d9a21ee4..fa9c20b8ae 100644 --- a/package/boot/uboot-mvebu/Makefile +++ b/package/boot/uboot-mvebu/Makefile @@ -70,7 +70,7 @@ endef define U-Boot/rb5009 NAME:=MikroTik RB5009 BUILD_SUBTARGET:=cortexa72 - BUILD_DEVICES:=mikrotik_rb5009ug + BUILD_DEVICES:=mikrotik_rb5009ug mikrotik_rb5009upr UBOOT_CONFIG:=mvebu_rb5009 UBOOT_IMAGE:=u-boot.elf endef diff --git a/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network b/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network index b8d1a3b41b..9d0f6d538c 100644 --- a/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network +++ b/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network @@ -38,7 +38,8 @@ marvell,armada7040-db) marvell,armada8040-clearfog-gt-8k) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 eth2" "eth0 eth1" ;; -mikrotik,rb5009ug) +mikrotik,rb5009ug|\ +mikrotik,rb5009upr) ucidef_set_interfaces_lan_wan "p2 p3 p4 p5 p6 p7 p8 sfp" "p1" ;; solidrun,clearfog-pro) diff --git a/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh b/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh index 1c1233f826..7db50a9379 100755 --- a/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh +++ b/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh @@ -83,7 +83,8 @@ platform_do_upgrade() { solidrun,clearfog-pro) legacy_sdcard_do_upgrade "$1" ;; - mikrotik,rb5009ug) + mikrotik,rb5009ug|\ + mikrotik,rb5009upr) nand_do_upgrade "$1" ;; *) diff --git a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-rb5009.dtsi b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-rb5009.dtsi index 18b4703189..bd0fccef82 100644 --- a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-rb5009.dtsi +++ b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-rb5009.dtsi @@ -1,17 +1,11 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; - #include "armada-7040.dtsi" #include #include #include / { - model = "MikroTik RB5009"; - compatible = "mikrotik,rb5009", "marvell,armada7040", - "marvell,armada-ap806-quad", "marvell,armada-ap806"; - chosen { stdout-path = "serial0:115200n8"; }; diff --git a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-rb5009upr.dts b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-rb5009upr.dts new file mode 100644 index 0000000000..a25c3bf27a --- /dev/null +++ b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-rb5009upr.dts @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include "armada-7040-rb5009.dtsi" + +/ { + model = "MikroTik RB5009UPr"; + compatible = "mikrotik,rb5009upr", "marvell,armada7040", + "marvell,armada-ap806-quad", "marvell,armada-ap806"; +}; + +&cp0_gpio1 { + enable-poe-power { + gpio-hog; + gpios = <8 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "enable PoE power"; + }; +}; + +&cp0_pinctrl { + cp0_spi1_pins: cp0-spi1-pins { + marvell,pins = "mpp47", "mpp48", "mpp49", "mpp50"; + marvell,function = "spi1"; + }; +}; + +&cp0_spi1 { + status = "okay"; + + pinctrl-0 = <&cp0_spi1_pins>; + pinctrl-names = "default"; + + spidev@0 { + compatible = "mikrotik,mtpoe"; + reg = <0>; + spi-max-frequency = <2000000>; + }; +}; diff --git a/target/linux/mvebu/image/cortexa72.mk b/target/linux/mvebu/image/cortexa72.mk index bc7ef452ab..b6042bb60f 100644 --- a/target/linux/mvebu/image/cortexa72.mk +++ b/target/linux/mvebu/image/cortexa72.mk @@ -119,6 +119,13 @@ define Device/mikrotik_rb5009ug endef TARGET_DEVICES += mikrotik_rb5009ug +define Device/mikrotik_rb5009upr + $(call Device/mikrotik_rb5009) + DEVICE_DTS := armada-7040-rb5009upr + DEVICE_MODEL := RB5009UPr+S+IN +endef +TARGET_DEVICES += mikrotik_rb5009upr + define Device/marvell_clearfog-gt-8k $(call Device/Default-arm64) DEVICE_VENDOR := SolidRun diff --git a/target/linux/mvebu/patches-6.18/913-drivers_spi_add_mtpoe_device_compatible.patch b/target/linux/mvebu/patches-6.18/913-drivers_spi_add_mtpoe_device_compatible.patch new file mode 100644 index 0000000000..223098691a --- /dev/null +++ b/target/linux/mvebu/patches-6.18/913-drivers_spi_add_mtpoe_device_compatible.patch @@ -0,0 +1,30 @@ +From 14f37a22f520f963d4fbbd0ef99c073100029ac3 Mon Sep 17 00:00:00 2001 +From: Przemek Rudy +Date: Mon, 23 Dec 2024 17:29:32 +0100 +Subject: [PATCH] kernel: add compatible string for the mtpoe spi device + +Device listed in spidev allows referring it in DT. + +Signed-off-by: Przemek Rudy +--- + drivers/spi/spidev.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/spi/spidev.c ++++ b/drivers/spi/spidev.c +@@ -695,6 +695,7 @@ static const struct spi_device_id spidev + { .name = /* lwn */ "bk4-spi" }, + { .name = /* menlo */ "m53cpld" }, + { .name = /* micron */ "spi-authenta" }, ++ { .name = /* mikrotik */ "mtpoe" }, + { .name = /* rohm */ "bh2228fv" }, + { .name = /* rohm */ "dh2228fv" }, + { .name = /* semtech */ "sx1301" }, +@@ -728,6 +729,7 @@ static const struct of_device_id spidev_ + { .compatible = "lwn,bk4-spi", .data = &spidev_of_check }, + { .compatible = "menlo,m53cpld", .data = &spidev_of_check }, + { .compatible = "micron,spi-authenta", .data = &spidev_of_check }, ++ { .compatible = "mikrotik,mtpoe", .data = &spidev_of_check }, + { .compatible = "rohm,bh2228fv", .data = &spidev_of_check }, + { .compatible = "rohm,dh2228fv", .data = &spidev_of_check }, + { .compatible = "semtech,sx1301", .data = &spidev_of_check }, From 9a44d910cc1abef381efe691d2e5d78f65f09814 Mon Sep 17 00:00:00 2001 From: Dhimant Thanki Date: Wed, 1 Jul 2026 18:42:55 +0530 Subject: [PATCH 47/61] ath79: fix Ethernet auto-negotiation on Ruckus ZoneFlex 7025 On the ZoneFlex 7025 the uplink port (eth0) is connected to PHY 4 of the AR7240 built-in switch. This PHY erroneously advertises 1000baseT/Full capability, even though the AR7240 built-in switch only supports 10/100 Mbps. Because of the bogus gigabit capability, phylib performs 1000BASE-T master/slave resolution against the PHY's non-functional gigabit registers, which never completes. Auto-negotiation then fails: the link flaps between speeds or never comes up at all, while a manually forced fixed speed works fine. Cap the PHY at 100 Mbps so the gigabit capability is removed and the master/slave resolution path is skipped. eth0 then auto-negotiates reliably to 100 Mbps full-duplex. Signed-off-by: Dhimant Thanki Link: https://github.com/openwrt/openwrt/pull/24022 Signed-off-by: Robert Marko --- target/linux/ath79/dts/ar7240_ruckus_zf7025.dts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/target/linux/ath79/dts/ar7240_ruckus_zf7025.dts b/target/linux/ath79/dts/ar7240_ruckus_zf7025.dts index 8a540a0b1a..3e73314966 100644 --- a/target/linux/ath79/dts/ar7240_ruckus_zf7025.dts +++ b/target/linux/ath79/dts/ar7240_ruckus_zf7025.dts @@ -186,6 +186,16 @@ nvmem-cell-names = "mac-address"; }; +/* + * eth0 is connected to PHY 4 of the AR7240 built-in switch, which is + * 10/100 Mbps only, but the PHY erroneously advertises gigabit. This + * makes phylib attempt 1000BASE-T master/slave resolution that never + * completes, breaking auto-negotiation. Cap the PHY at 100 Mbps. + */ +&swphy4 { + max-speed = <100>; +}; + ð1 { status = "okay"; nvmem-cells = <&macaddr_board_data_6c>; From a6e1135d6d1d0b06ca2be99987f5e5fe2231ae8e Mon Sep 17 00:00:00 2001 From: solodecode Date: Sat, 20 Jun 2026 19:47:40 +0300 Subject: [PATCH 48/61] mediatek: filogic: fix Globitel BT-R320 FIT rootfs mapping Globitel BT-R320 boots the sysupgrade FIT from the eMMC production partition with root=/dev/fit0. The device tree did not describe the production GPT partition and /chosen/rootdisk did not point at the FIT container. fitblk then had no rootdisk match and the board stopped at: Waiting for root device /dev/fit0... Describe the eMMC GPT partitions, set /chosen/rootdisk to production, and use the FIT sysupgrade path. Fixes: a3105d3f9573 ("mediatek: filogic: add support for Globitel BT-R320") Signed-off-by: solodecode Link: https://github.com/openwrt/openwrt/pull/23895 Signed-off-by: Robert Marko --- .../mediatek/dts/mt7981b-globitel-bt-r320.dts | 49 ++++++++++--------- .../base-files/lib/upgrade/platform.sh | 3 +- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/target/linux/mediatek/dts/mt7981b-globitel-bt-r320.dts b/target/linux/mediatek/dts/mt7981b-globitel-bt-r320.dts index c35408f1e5..b3cad53c16 100644 --- a/target/linux/mediatek/dts/mt7981b-globitel-bt-r320.dts +++ b/target/linux/mediatek/dts/mt7981b-globitel-bt-r320.dts @@ -17,8 +17,9 @@ }; chosen { - bootargs = "root=PARTLABEL=rootfs rootwait"; + bootargs-override = "root=/dev/fit0 rootwait"; stdout-path = "serial0:115200n8"; + rootdisk = <&emmc_rootdisk>; }; memory@40000000 { @@ -149,36 +150,38 @@ compatible = "mmc-card"; reg = <0>; - block { - compatible = "block-device"; + partitions { + compatible = "gpt-partitions"; - partitions { - block-partition-factory { - partname = "factory"; + block-partition-factory { + partname = "factory"; - nvmem-layout { - compatible = "fixed-layout"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - eeprom_factory_0: eeprom@0 { - reg = <0x0 0x1000>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x1000>; + }; - macaddr_factory_24: macaddr@24 { - compatible = "mac-base"; - reg = <0x24 0x6>; - #nvmem-cell-cells = <1>; - }; + macaddr_factory_24: macaddr@24 { + compatible = "mac-base"; + reg = <0x24 0x6>; + #nvmem-cell-cells = <1>; + }; - macaddr_factory_2a: macaddr@2a { - compatible = "mac-base"; - reg = <0x2a 0x6>; - #nvmem-cell-cells = <1>; - }; + macaddr_factory_2a: macaddr@2a { + compatible = "mac-base"; + reg = <0x2a 0x6>; + #nvmem-cell-cells = <1>; }; }; }; + + emmc_rootdisk: block-partition-production { + partname = "production"; + }; }; }; }; diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh index 79e25abdf7..c1b7a33f29 100644 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -157,6 +157,7 @@ platform_do_upgrade() { cudy,wr3000h-v1-ubootmod|\ cudy,wr3000p-v1-ubootmod|\ gatonetworks,gdsp|\ + globitel,bt-r320|\ h3c,magic-nx30-pro|\ imou,hx21|\ jcg,q30-pro|\ @@ -200,7 +201,6 @@ platform_do_upgrade() { glinet,gl-mt6000|\ glinet,gl-x3000|\ glinet,gl-xe3000|\ - globitel,bt-r320|\ huasifei,wh3000|\ huasifei,wh3000-pro-emmc|\ smartrg,sdg-8612|\ @@ -373,6 +373,7 @@ platform_check_image() { cudy,wr3000h-v1-ubootmod|\ cudy,wr3000p-v1-ubootmod|\ gatonetworks,gdsp|\ + globitel,bt-r320|\ h3c,magic-nx30-pro|\ jcg,q30-pro|\ jdcloud,re-cp-03|\ From 54e70703a0bdcdb9d52fb9e0cd7d01cbaea59c2f Mon Sep 17 00:00:00 2001 From: Matthias Urlichs Date: Mon, 22 Jun 2026 11:44:20 +0200 Subject: [PATCH 49/61] ath79: add support for Ubiquiti NanoStation Loco M (XW v2) This commit adds support for the NanoStation Loco M2/M5 XW devices on the ath79 target with test date (label on the packaging, not the device) later than October 2017. To discover whether you have the new version, open a console on the stock web interface and run `dmesg | grep AR803`. New versions print AR8035, v1 shows AR8032. Specifications: - AR9342 (rev 3) SoC @ 535 MHz - 64 MB RAM - 8 MB SPI flash - 1x 10/100 Mbps Ethernet, 24 Vdc PoE-in - AR8035 switch - 2T2R 5 GHz radio, 22 dBm - 13 dBi built-in directional antenna - POWER/LAN green LEDs - 4x RSSI LEDs (red, orange, green, green) - UART (115200 8N1) on PCB Flashing via TFTP: - Use a pointy tool (e.g., pen cap, paper clip) and keep the reset button on the device pressed - Power on the device via PoE (keep reset button pressed) - Keep pressing until LEDs flash alternatively LED1+LED3 => LED2+LED4 => LED1+LED3, etc. - Release reset button - The device starts a TFTP server at 192.168.1.20 - Set a static IP on the computer (e.g., 192.168.1.21/24) - Upload via tftp the factory image: $ tftp 192.168.1.20 tftp> bin tftp> put openwrt-ath79-generic-xxxxx-ubnt_nanostation-loco-m-xw-v2-squashfs-factory.bin MAC addresses: stored on Flash, in the "art" partition. Signed-off-by: Matthias Urlichs Link: https://github.com/openwrt/openwrt/pull/23912 Signed-off-by: Robert Marko --- .../ar9342_ubnt_nanostation-loco-m-xw-v2.dts | 32 +++++++++++++++++++ .../generic/base-files/etc/board.d/01_leds | 1 + .../generic/base-files/etc/board.d/02_network | 1 + target/linux/ath79/image/generic-ubnt.mk | 8 +++++ 4 files changed, 42 insertions(+) create mode 100644 target/linux/ath79/dts/ar9342_ubnt_nanostation-loco-m-xw-v2.dts diff --git a/target/linux/ath79/dts/ar9342_ubnt_nanostation-loco-m-xw-v2.dts b/target/linux/ath79/dts/ar9342_ubnt_nanostation-loco-m-xw-v2.dts new file mode 100644 index 0000000000..0ffe4d2d76 --- /dev/null +++ b/target/linux/ath79/dts/ar9342_ubnt_nanostation-loco-m-xw-v2.dts @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9342_ubnt_xw_rssileds.dtsi" + +/ { + compatible = "ubnt,nanostation-loco-m-xw-v2", "ubnt,xw", "qca,ar9342"; + model = "Ubiquiti Nanostation Loco M (XW) v2"; +}; + +&mdio0 { + status = "okay"; + + phy4: ethernet-phy@4 { + reg = <4>; + }; +}; + +ð0 { + status = "okay"; + + /* default for ar934x, except for 1000M and 10M */ + pll-data = <0x02000000 0x00000101 0x00001313>; + + phy-mode = "rgmii-id"; + phy-handle = <&phy4>; + + gmac-config { + device = <&gmac>; + rxd-delay = <3>; + rxdv-delay = <3>; + }; +}; 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 d12d429b86..29c1198206 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -511,6 +511,7 @@ ubnt,powerbeam-5ac-gen2) ;; ubnt,bullet-m-xw|\ ubnt,nanostation-loco-m-xw|\ +ubnt,nanostation-loco-m-xw-v2|\ ubnt,nanostation-m-xw|\ ubnt,powerbeam-m2-xw|\ ubnt,powerbeam-m5-xw|\ 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 7194d16f24..5f67e47c0b 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 @@ -111,6 +111,7 @@ ath79_setup_interfaces() ubnt,nanobeam-ac-xc|\ ubnt,nanostation-ac-loco|\ ubnt,nanostation-loco-m-xw|\ + ubnt,nanostation-loco-m-xw-v2|\ ubnt,powerbeam-5ac-500|\ ubnt,powerbeam-5ac-gen2|\ ubnt,powerbeam-m2-xw|\ diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk index 51d0aaef03..933007fabe 100644 --- a/target/linux/ath79/image/generic-ubnt.mk +++ b/target/linux/ath79/image/generic-ubnt.mk @@ -143,6 +143,14 @@ define Device/ubnt_nanostation-loco-m-xw endef TARGET_DEVICES += ubnt_nanostation-loco-m-xw +define Device/ubnt_nanostation-loco-m-xw-v2 + $(Device/ubnt-xw) + DEVICE_MODEL := Nanostation Loco M + DEVICE_VARIANT := XW v2 + DEVICE_PACKAGES += rssileds -kmod-usb2 +endef +TARGET_DEVICES += ubnt_nanostation-loco-m-xw-v2 + define Device/ubnt_nanostation-m-xw $(Device/ubnt-xw) DEVICE_MODEL := Nanostation M From da28c7a67eba831cfa6af2d37c40c3539eb103f5 Mon Sep 17 00:00:00 2001 From: Richard Huynh Date: Thu, 16 Apr 2026 21:40:53 +1000 Subject: [PATCH 50/61] wifi-scripts: add EHT beamforming options to hostapd config Some EHT options like beamformer/beamformee are disabled by default in hostapd.conf Read the EHT Phy Cap structure and enable/disable switches within the hostapd.conf for capable hardware. Without this EHT SU beamformer/beamformee and MU beamformer capabilities are omitted from AP beacons, even if the driver reports the hardware as capable. Signed-off-by: Richard Huynh Link: https://github.com/openwrt/openwrt/pull/22956 Signed-off-by: Robert Marko --- .../usr/share/schema/wireless.wifi-device.json | 15 +++++++++++++++ .../files-ucode/usr/share/ucode/wifi/hostapd.uc | 17 ++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json index 291c97aaac..f6dac167aa 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json @@ -153,6 +153,21 @@ "type": "boolean", "default": true }, + "eht_mu_beamformer": { + "description": "EHT multiple user beamformer support", + "type": "boolean", + "default": true + }, + "eht_su_beamformee": { + "description": "EHT single user beamformee support", + "type": "boolean", + "default": true + }, + "eht_su_beamformer": { + "description": "EHT single user beamformer support", + "type": "boolean", + "default": true + }, "enable_background_radar": { "description": "This feature allows CAC to be run on dedicated radio RF chains", "type": "boolean" diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc index e23ea7f809..5f56e324e4 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc @@ -448,8 +448,21 @@ function device_htmode_append(config) { } if (wildcard(config.htmode, 'EHT*')) { + let eht_phy_cap = phy_capabilities.eht_phy_cap; + config.ieee80211be = true; - append_vars(config, [ 'ieee80211be' ]); + + if (!(eht_phy_cap[0] & 0x20)) + config.eht_su_beamformer = false; + if (!(eht_phy_cap[0] & 0x40)) + config.eht_su_beamformee = false; + if (!(eht_phy_cap[7] & 0x70)) + config.eht_mu_beamformer = false; + + append_vars(config, [ + 'ieee80211be', 'eht_su_beamformer', 'eht_su_beamformee', + 'eht_mu_beamformer', + ]); if (config.hw_mode == 'a') append_vars(config, [ 'eht_oper_chwidth', 'eht_oper_centr_freq_seg0_idx' ]); @@ -472,11 +485,13 @@ function device_capabilities(config) { phy_capabilities.vht_capa = band.vht_capa ?? 0; phy_capabilities.he_mac_cap = []; phy_capabilities.he_phy_cap = []; + phy_capabilities.eht_phy_cap = []; for (let iftype in band.iftype_data) { if (!iftype.iftypes.ap) continue; phy_capabilities.he_mac_cap = iftype.he_cap_mac; phy_capabilities.he_phy_cap = iftype.he_cap_phy; + phy_capabilities.eht_phy_cap = iftype.eht_cap_phy; } phy_features.ftm_responder = device_extended_features(phy.extended_features, NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER); From 0f54eda2dc49f6236514e29d5007a7bf4df47ee0 Mon Sep 17 00:00:00 2001 From: Lech Perczak Date: Tue, 14 Nov 2023 19:42:28 +0100 Subject: [PATCH 51/61] kernel: modules: video: package i.MX7 CSI driver Create a package for i.MX7 CSI driver module, together with it's common code for i.MX family. Signed-off-by: Lech Perczak Link: https://github.com/openwrt/openwrt/pull/17606 Signed-off-by: Robert Marko --- package/kernel/linux/modules/video.mk | 51 +++++++++++++++++++++++++++ target/linux/imx/config-6.12 | 1 + 2 files changed, 52 insertions(+) diff --git a/package/kernel/linux/modules/video.mk b/package/kernel/linux/modules/video.mk index ad7c533d71..b54fb8a00e 100644 --- a/package/kernel/linux/modules/video.mk +++ b/package/kernel/linux/modules/video.mk @@ -1593,6 +1593,57 @@ endef $(eval $(call KernelPackage,video-pxp)) +define KernelPackage/video-imx-mipi-csis + TITLE:=i.MX7/8 MIPI-CSI2 CSIS receiver + DEPENDS:=@TARGET_imx +kmod-video-async +kmod-video-fwnode + KCONFIG:=CONFIG_VIDEO_IMX_MIPI_CSIS + FILES:= \ + $(LINUX_DIR)/drivers/media/platform/nxp/imx-mipi-csis.ko + AUTOLOAD:=$(call AutoProbe,imx-mipi-csis) + $(call AddDepends/video) +endef + +define KernelPackage/video-imx-mipi-csis/description + Enable support for NXP MIPI CSI-2 CSIS receiver found on i.MX7 + and i.MX8 models +endef + +$(eval $(call KernelPackage,video-imx-mipi-csis)) + +define KernelPackage/video-imx7-csi + TITLE:=i.MX7 CSI interface + DEPENDS:=@TARGET_imx +kmod-video-dma-contig +kmod-video-fwnode + KCONFIG:=CONFIG_VIDEO_IMX7_CSI + FILES:= \ + $(LINUX_DIR)/drivers/media/platform/nxp/imx7-media-csi.ko + AUTOLOAD:=$(call AutoProbe,imx7-media-csi) + $(call AddDepends/video) +endef + +define KernelPackage/video-imx7-csi/description + Enable support for video4linux camera sensor interface driver + for i.MX6UL/L or i.MX7. +endef + +$(eval $(call KernelPackage,video-imx7-csi)) + +define KernelPackage/video-imx8mq-mipi-csi2 + TITLE:=i.MX8MQ MIPI CSI2 receiver + DEPENDS:=@TARGET_imx +kmod-video-fwnode + KCONFIG:=CONFIG_VIDEO_IMX8MQ_MIPI_CSI2 + FILES:= \ + $(LINUX_DIR)/drivers/media/platform/nxp/imx8mq-mipi-csi2.ko + AUTOLOAD:=$(call AutoProbe,imx8mq-mipi-csi2) + $(call AddDepends/video) +endef + +define KernelPackage/video-imx8mq-mipi-csi2/description + Enable support for video4linux camera sensor interface driver + for i.MX8M and P series. +endef + +$(eval $(call KernelPackage,video-imx8mq-mipi-csi2)) + define KernelPackage/video-tw686x TITLE:=TW686x support DEPENDS:=@PCIE_SUPPORT +kmod-video-dma-contig +kmod-video-dma-sg +kmod-sound-core diff --git a/target/linux/imx/config-6.12 b/target/linux/imx/config-6.12 index 1cff9bfada..26ef04dd96 100644 --- a/target/linux/imx/config-6.12 +++ b/target/linux/imx/config-6.12 @@ -479,6 +479,7 @@ CONFIG_VFPv3=y # CONFIG_VIDEO_IMX7_CSI is not set # CONFIG_VIDEO_IMX8MQ_MIPI_CSI2 is not set # CONFIG_VIDEO_IMX8_ISI is not set +# CONFIG_VIDEO_IMX_MEDIA is not set # CONFIG_VIDEO_IMX_MIPI_CSIS is not set # CONFIG_VIDEO_ROCKCHIP_ISP1 is not set CONFIG_VMSPLIT_2G=y From ac39016898818b9e2d1b729ab6a397cc139f8b89 Mon Sep 17 00:00:00 2001 From: Lech Perczak Date: Mon, 18 Dec 2023 02:16:49 +0100 Subject: [PATCH 52/61] kernel: modules: package MMIO mux driver Create a package for MMIO-based multiplexer driver, used as a backend by video-mux on i.MX7 SoCs. Signed-off-by: Lech Perczak Link: https://github.com/openwrt/openwrt/pull/17606 Signed-off-by: Robert Marko --- package/kernel/linux/modules/multiplexer.mk | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/package/kernel/linux/modules/multiplexer.mk b/package/kernel/linux/modules/multiplexer.mk index 135fc62c6d..cfd6797316 100644 --- a/package/kernel/linux/modules/multiplexer.mk +++ b/package/kernel/linux/modules/multiplexer.mk @@ -32,3 +32,18 @@ define KernelPackage/mux-gpio/description endef $(eval $(call KernelPackage,mux-gpio)) + +define KernelPackage/mux-mmio + SUBMENU:=$(OTHER_MENU) + TITLE:=MMIO/Regmap register bitfield-controlled Multiplexer controller + DEPENDS:=+kmod-mux-core + KCONFIG:=CONFIG_MUX_MMIO + FILES:=$(LINUX_DIR)/drivers/mux/mux-mmio.ko + AUTOLOAD:=$(call AutoProbe,mux-mmio) +endef + +define KernelPackage/mux-mmio/description + Kernel module for the MMIO/Regmap multiplexer driver. +endef + +$(eval $(call KernelPackage,mux-mmio)) From 16a7c79ae85cbf5819cd40f8052fdfbcc62e291e Mon Sep 17 00:00:00 2001 From: Lech Perczak Date: Tue, 14 Nov 2023 19:42:45 +0100 Subject: [PATCH 53/61] kernel: modules: video: package video-mux Package the video-mux module, required by PICO-PI-IMX7D board, to support included OV5645 camera. Signed-off-by: Lech Perczak Link: https://github.com/openwrt/openwrt/pull/17606 Signed-off-by: Robert Marko --- package/kernel/linux/modules/video.mk | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/package/kernel/linux/modules/video.mk b/package/kernel/linux/modules/video.mk index b54fb8a00e..4f9a44f53d 100644 --- a/package/kernel/linux/modules/video.mk +++ b/package/kernel/linux/modules/video.mk @@ -1644,6 +1644,21 @@ endef $(eval $(call KernelPackage,video-imx8mq-mipi-csi2)) +define KernelPackage/video-mux + TITLE:=Video Multiplexer + DEPENDS:=@(TARGET_imx&&TARGET_imx_cortexa7) +kmod-video-async +kmod-mux-core + KCONFIG:=CONFIG_VIDEO_MUX + FILES:=$(LINUX_DIR)/drivers/media/platform/video-mux.ko + AUTOLOAD:=$(call AutoProbe,video-mux) + $(call AddDepends/video) +endef + +define KernelPackage/video-mux/description + This driver provides support for N:1 video bus multiplexers. +endef + +$(eval $(call KernelPackage,video-mux)) + define KernelPackage/video-tw686x TITLE:=TW686x support DEPENDS:=@PCIE_SUPPORT +kmod-video-dma-contig +kmod-video-dma-sg +kmod-sound-core From 37bbeb1af4cef75550215c1917f950ad88a619a0 Mon Sep 17 00:00:00 2001 From: Lech Perczak Date: Tue, 14 Nov 2023 19:43:43 +0100 Subject: [PATCH 54/61] kernel: modules: video: package ov5645 driver Create a package for ov5645 kernel module, required to support camera on PICO-PI-IMX7D board. Currently limit the visibility to imx_cortexa7 subtarget, but this can be enabled on other platforms if needed. Signed-off-by: Lech Perczak Link: https://github.com/openwrt/openwrt/pull/17606 Signed-off-by: Robert Marko --- package/kernel/linux/modules/video.mk | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/package/kernel/linux/modules/video.mk b/package/kernel/linux/modules/video.mk index 4f9a44f53d..4eab4336bd 100644 --- a/package/kernel/linux/modules/video.mk +++ b/package/kernel/linux/modules/video.mk @@ -1659,6 +1659,25 @@ endef $(eval $(call KernelPackage,video-mux)) +define KernelPackage/video-ov5645 + TITLE:=OmniVision OV5645 sensor support + DEPENDS:=@(TARGET_imx&&TARGET_imx_cortexa7) +kmod-video-fwnode + KCONFIG:= \ + CONFIG_MEDIA_CAMERA_SUPPORT=y \ + CONFIG_VIDEO_CAMERA_SENSOR=y \ + CONFIG_VIDEO_OV5645 + FILES:=$(LINUX_DIR)/drivers/media/i2c/ov5645.ko + AUTOLOAD:=$(call AutoProbe,ov5645) + $(call AddDepends/video) +endef + +define KernelPackage/video-ov5645/description + This is a Video4Linux2 sensor driver for the OmniVision + OV5645 camera. +endef + +$(eval $(call KernelPackage,video-ov5645)) + define KernelPackage/video-tw686x TITLE:=TW686x support DEPENDS:=@PCIE_SUPPORT +kmod-video-dma-contig +kmod-video-dma-sg +kmod-sound-core From f640d4441f280e6da328d504f37aea732c2b6504 Mon Sep 17 00:00:00 2001 From: Lech Perczak Date: Tue, 14 Nov 2023 19:44:43 +0100 Subject: [PATCH 55/61] imx: cortexa7: support camera on TechNexion PICO-PI-IMX7D Enable device packages required for camera support and add relevant device tree nodes. The drivers probe and connect properly, but it currently only supports uncompressed UYVY in 2592x1944, 1920x1080 and 1280x960 resolutions, so I had to use ustreamer to get the stream over network: ustreamer -r 1920x1080 -m UYVY -d /dev/video0 -s 0.0.0.0 To get the camera working, the following extra packages are needed: kmod-mux-mmio kmod-video-imx7-csi kmod-video-imx-mipi-csis kmod-video-mux \ kmod-video-ov5645 To set up the capture, you need to set up the links and formats across the pipeline, for example: media-ctl -d /dev/media0 -l "'ov5645 3-003c':0 -> 'csis-30750000.mipi-csi':0[1]" media-ctl -d /dev/media0 -l "'csis-30750000.mipi-csi':1 -> 'csi-mux':1[1]" media-ctl -d /dev/media0 -l "'csi-mux':2 -> 'csi':0[1]" media-ctl -d /dev/media0 -l "'csi':1 -> 'csi capture':0[1]" media-ctl -d /dev/media0 -V "'ov5645 3-003c':0 [fmt:UYVY8_1X16/1920x1080 field:none]" media-ctl -d /dev/media0 -V "'csis-30750000.mipi-csi':0 [fmt:UYVY8_1X16/1920x1080 field:none]" media-ctl -d /dev/media0 -V "'csis-30750000.mipi-csi':1 [fmt:UYVY8_1X16/1920x1080 field:none]" media-ctl -d /dev/media0 -V "'csi-mux':1 [fmt:UYVY8_1X16/1920x1080 field:none]" media-ctl -d /dev/media0 -V "'csi-mux':2 [fmt:UYVY8_1X16/1920x1080 field:none]" media-ctl -d /dev/media0 -V "'csi':0 [fmt:UYVY8_1X16/1920x1080 field:none]" media-ctl -d /dev/media0 -V "'csi':1 [fmt:UYVY8_1X16/1920x1080 field:none]" Signed-off-by: Lech Perczak Link: https://github.com/openwrt/openwrt/pull/17606 Signed-off-by: Robert Marko --- ...7d-pico-pi-add-OV5645-camera-support.patch | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 target/linux/imx/patches-6.12/312-v7.2-ARM-dts-imx7d-pico-pi-add-OV5645-camera-support.patch diff --git a/target/linux/imx/patches-6.12/312-v7.2-ARM-dts-imx7d-pico-pi-add-OV5645-camera-support.patch b/target/linux/imx/patches-6.12/312-v7.2-ARM-dts-imx7d-pico-pi-add-OV5645-camera-support.patch new file mode 100644 index 0000000000..36d82ba4c4 --- /dev/null +++ b/target/linux/imx/patches-6.12/312-v7.2-ARM-dts-imx7d-pico-pi-add-OV5645-camera-support.patch @@ -0,0 +1,111 @@ +From fc2513c6ae9513d10c12e522b69be610f7e49910 Mon Sep 17 00:00:00 2001 +From: Lech Perczak +Date: Wed, 27 May 2026 12:19:12 +0200 +Subject: [PATCH] ARM: dts: imx7d-pico-pi: add OV5645 camera support + +Add OV5645 camera device node and enable relevant components in the +video capture data path, so output stream can be captured, and the +camera itself can be controlled over I2C bus. + +This is roughly based on descriptions found in downstream kernel tree [1], +adapted to match upstream bindings. + +Link: https://github.com/technexion-android/kernel_imx/blob/ce8fd74abf518dac0a09e8dcb37f3496f6375124/arch/arm/boot/dts/imx7d-pico.dtsi#L874 [1] + +Signed-off-by: Lech Perczak +Signed-off-by: Frank Li + +[Backport to 6.12] +Signed-off-by: Lech Perczak +--- + arch/arm/boot/dts/nxp/imx/imx7d-pico-pi.dts | 66 +++++++++++++++++++++ + 1 file changed, 66 insertions(+) + +--- a/arch/arm/boot/dts/nxp/imx/imx7d-pico-pi.dts ++++ b/arch/arm/boot/dts/nxp/imx/imx7d-pico-pi.dts +@@ -31,6 +31,13 @@ + }; + }; + ++ reg_1p5v: regulator-1p5v { ++ compatible = "regulator-fixed"; ++ regulator-name = "1P5V"; ++ regulator-min-microvolt = <1500000>; ++ regulator-max-microvolt = <1500000>; ++ }; ++ + sound { + compatible = "simple-audio-card"; + simple-audio-card,name = "imx7-sgtl5000"; +@@ -71,6 +78,33 @@ + touchscreen-size-x = <800>; + touchscreen-size-y = <480>; + }; ++ ++ camera@3c { ++ compatible = "ovti,ov5645"; ++ reg = <0x3c>; ++ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_camera>; ++ ++ clocks = <&clks IMX7D_CLKO1_ROOT_DIV>; ++ clock-names = "xclk"; ++ clock-frequency = <24000000>; ++ ++ enable-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; ++ reset-gpios = <&gpio1 5 GPIO_ACTIVE_LOW>; ++ ++ vdda-supply = <®_2p5v>; ++ vdddo-supply = <®_vref_1v8>; ++ vddd-supply = <®_1p5v>; ++ ++ port { ++ ov5645_to_mipi_csi2: endpoint { ++ remote-endpoint = <&mipi_csi2_in>; ++ clock-lanes = <0>; ++ data-lanes = <1 2>; ++ }; ++ }; ++ }; + }; + + &usdhc1 { +@@ -105,5 +139,37 @@ + MX7D_PAD_EPDC_DATA13__GPIO2_IO13 0x14 + >; + }; ++}; ++ ++&iomuxc_lpsr { ++ pinctrl_camera: cameragrp { ++ fsl,pins = < ++ MX7D_PAD_LPSR_GPIO1_IO04__GPIO1_IO4 0x15 ++ MX7D_PAD_LPSR_GPIO1_IO05__GPIO1_IO5 0x15 ++ MX7D_PAD_LPSR_GPIO1_IO02__CCM_CLKO1 0x7d ++ >; ++ }; ++}; ++ ++&csi { ++ status = "okay"; ++}; ++ ++&mipi_csi { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ ++ mipi_csi2_in: endpoint { ++ remote-endpoint = <&ov5645_to_mipi_csi2>; ++ data-lanes = <1 2>; ++ }; ++ }; ++ }; ++}; + ++&video_mux { ++ status = "okay"; + }; From 6f30f08d0e6da2f2126ed31e4665f6b4f0d91af9 Mon Sep 17 00:00:00 2001 From: Andy Chiang Date: Mon, 8 Jun 2026 07:58:47 +0700 Subject: [PATCH 56/61] dnsmasq: add fallback for default dhcpv4/dhcpv6 values The default dhcpv4/dhcpv6 in odhcpd is disabled. Add fallback for default values to keep consistency. Link: https://github.com/openwrt/odhcpd/blob/master/README.md Ref: https://github.com/openwrt/luci/pull/8642 Signed-off-by: Andy Chiang Link: https://github.com/openwrt/openwrt/pull/23445 Signed-off-by: Robert Marko --- package/network/services/dnsmasq/files/dnsmasq.init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 61dc396707..dd8353a386 100755 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -575,8 +575,8 @@ dhcp_add() { config_get_bool dynamicdhcpv4 "$cfg" dynamicdhcpv4 $dynamicdhcp config_get_bool dynamicdhcpv6 "$cfg" dynamicdhcpv6 $dynamicdhcp - config_get dhcpv4 "$cfg" dhcpv4 - config_get dhcpv6 "$cfg" dhcpv6 + config_get dhcpv4 "$cfg" dhcpv4 disabled + config_get dhcpv6 "$cfg" dhcpv6 disabled config_get ra "$cfg" ra config_get ra_management "$cfg" ra_management From 85767ac8fe8191d90f959e30d87f92ea3c75b4e1 Mon Sep 17 00:00:00 2001 From: Andy Chiang Date: Wed, 20 May 2026 12:34:45 +0700 Subject: [PATCH 57/61] dnsmasq: add some default values of dhcp.conf add ra/dhcpv4/dhcpv6 dhcpv6 service provided by dnsmasq without odhcpd Signed-off-by: Andy Chiang Link: https://github.com/openwrt/openwrt/pull/23445 Signed-off-by: Robert Marko --- package/network/services/dnsmasq/Makefile | 2 +- package/network/services/dnsmasq/files/dhcp.conf | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index 19ae7b7cd1..ac737f5105 100644 --- a/package/network/services/dnsmasq/Makefile +++ b/package/network/services/dnsmasq/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsmasq PKG_UPSTREAM_VERSION:=2.93 PKG_VERSION:=$(subst test,~~test,$(subst rc,~rc,$(PKG_UPSTREAM_VERSION))) -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_UPSTREAM_VERSION).tar.xz PKG_SOURCE_URL:=https://thekelleys.org.uk/dnsmasq/ diff --git a/package/network/services/dnsmasq/files/dhcp.conf b/package/network/services/dnsmasq/files/dhcp.conf index d5b9dfa018..415e63dffc 100644 --- a/package/network/services/dnsmasq/files/dhcp.conf +++ b/package/network/services/dnsmasq/files/dhcp.conf @@ -28,9 +28,12 @@ config dnsmasq config dhcp lan option interface lan - option start 100 + option start 100 option limit 150 option leasetime 12h + option ra server + option dhcpv4 server + option dhcpv6 server config dhcp wan option interface wan From 67ee9cf19dd6dc4e4d846da2ac97afaf745103da Mon Sep 17 00:00:00 2001 From: Erik Conijn Date: Sun, 10 May 2026 11:01:10 +0200 Subject: [PATCH 58/61] wireguard: add metric to routes maintainer: Felix Fietkau The metric field is not used when wireGuard routes are created. See: https://github.com/openwrt/openwrt/issues/23199 This patch is aimed at adding the metric field in the config to the created routes for WireGuard if the metric field is not empty and not 0 Compile tested: X86, Openwrt-main Run tested: X86 Please have a look and consider implementing Signed-off-by: Erik Conijn Link: https://github.com/openwrt/openwrt/pull/23280 Signed-off-by: Robert Marko --- package/network/utils/wireguard-tools/files/wireguard.uc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/network/utils/wireguard-tools/files/wireguard.uc b/package/network/utils/wireguard-tools/files/wireguard.uc index 9f99904812..2f3c69049e 100644 --- a/package/network/utils/wireguard-tools/files/wireguard.uc +++ b/package/network/utils/wireguard-tools/files/wireguard.uc @@ -111,6 +111,8 @@ function proto_setup(proto) { if (config.fwmark) wg_config += sprintf('FwMark=%s\n', config.fwmark); + let metric = int(config.metric); + let ipv4_routes = []; let ipv6_routes = []; @@ -136,6 +138,8 @@ function proto_setup(proto) { for (let allowed_ip in allowed_list) { let addr_info = parse_address(allowed_ip); let route = { target: addr_info.address, netmask: '' + addr_info.mask }; + if (metric) + route.metric = metric; if (addr_info.family == 6) push(ipv6_routes, route); else From 53389564b9348f8403514a043050d31304d18adc Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Wed, 1 Jul 2026 20:19:21 +0200 Subject: [PATCH 59/61] microchipsw: configure TAS port link speed On the TSN and RED variants of SparX-5 and LAN969x TAS (Time-Aware Shaper) is present in the silicon. Currently, the driver does not use configure it at all, which means that the TAS_PROFILE_CONFIG.LINK_SPEED[1] value is left at the default of 3 which means that its configured for 1 Gbps. So, running iperf between two 10G switch ports will result in only 940-ish Mbps while we should be getting around 9.3 Gbps. Correctly populating the TAS_PROFILE_CONFIG.LINK_SPEED[1] with the current port speed fixes this issue and we achieve around 9.4 Gbps between two 10G switch ports. So, port the TAS port link speed setting from the vendor BSP 6.18 kernel[2] [1] https://microchip-ung.github.io/lan969x-industrial_reginfo/reginfo_LAN969x-Industrial.html?select=hsch,tas_profile_cfg,tas_profile_config,link_speed [2] https://github.com/microchip-ung/linux/tree/bsp-6.18-2026 Signed-off-by: Robert Marko --- ...sparx5-configure-TAS-port-link-speed.patch | 199 ++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 target/linux/microchipsw/patches-6.18/131-net-sparx5-configure-TAS-port-link-speed.patch diff --git a/target/linux/microchipsw/patches-6.18/131-net-sparx5-configure-TAS-port-link-speed.patch b/target/linux/microchipsw/patches-6.18/131-net-sparx5-configure-TAS-port-link-speed.patch new file mode 100644 index 0000000000..713e0474d3 --- /dev/null +++ b/target/linux/microchipsw/patches-6.18/131-net-sparx5-configure-TAS-port-link-speed.patch @@ -0,0 +1,199 @@ +From 074d87ae70e2b549001c31f87f2a585225f2e99d Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Wed, 1 Jul 2026 15:37:32 +0200 +Subject: [PATCH] net: sparx5: configure TAS port link speed + +On the TSN and RED variants of SparX-5 and LAN969x TAS (Time-Aware Shaper) +is present in the silicon. + +Currently, the driver does not use configure it at all, which means that +the TAS_PROFILE_CONFIG.LINK_SPEED[1] value is left at the default of 3 +which means that its configured for 1 Gbps. + +So, running iperf between two 10G switch ports will result in only 940-ish +Mbps while we should be getting around 9.3 Gbps. + +Correctly populating the TAS_PROFILE_CONFIG.LINK_SPEED[1] with the current +port speed fixes this issue and we achieve around 9.4 Gbps between two 10G +switch ports. + +So, port the TAS port link speed setting from the vendor BSP 6.18 kernel[2] + +[1] https://microchip-ung.github.io/lan969x-industrial_reginfo/reginfo_LAN969x-Industrial.html?select=hsch,tas_profile_cfg,tas_profile_config,link_speed +[2] https://github.com/microchip-ung/linux/tree/bsp-6.18-2026 + +Signed-off-by: Robert Marko +--- + .../microchip/sparx5/lan969x/lan969x_regs.c | 3 ++ + .../microchip/sparx5/sparx5_main_regs.h | 12 +++++ + .../ethernet/microchip/sparx5/sparx5_port.c | 4 ++ + .../ethernet/microchip/sparx5/sparx5_qos.c | 49 +++++++++++++++++++ + .../ethernet/microchip/sparx5/sparx5_qos.h | 1 + + .../ethernet/microchip/sparx5/sparx5_regs.h | 3 ++ + 6 files changed, 72 insertions(+) + +--- a/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_regs.c ++++ b/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_regs.c +@@ -95,6 +95,7 @@ const unsigned int lan969x_gaddr[GADDR_L + [GA_HSCH_SYSTEM] = 37384, + [GA_HSCH_MMGT] = 36260, + [GA_HSCH_TAS_CONFIG] = 37696, ++ [GA_HSCH_TAS_PROFILE_CFG] = 37712, + [GA_PTP_PTP_CFG] = 512, + [GA_PTP_PTP_TOD_DOMAINS] = 528, + [GA_PTP_PHASE_DETECTOR_CTRL] = 628, +@@ -129,6 +130,7 @@ const unsigned int lan969x_gcnt[GCNT_LAS + [GC_GCB_SIO_CTRL] = 1, + [GC_HSCH_HSCH_CFG] = 1120, + [GC_HSCH_HSCH_DWRR] = 32, ++ [GC_HSCH_TAS_PROFILE_CFG] = 30, + [GC_PTP_PTP_PINS] = 8, + [GC_PTP_PHASE_DETECTOR_CTRL] = 8, + [GC_REW_PORT] = 35, +@@ -144,6 +146,7 @@ const unsigned int lan969x_gsize[GSIZE_L + [GW_FDMA_FDMA] = 448, + [GW_GCB_CHIP_REGS] = 180, + [GW_HSCH_TAS_CONFIG] = 16, ++ [GW_HSCH_TAS_PROFILE_CFG] = 68, + [GW_PTP_PHASE_DETECTOR_CTRL] = 12, + [GW_QSYS_PAUSE_CFG] = 988, + }; +--- a/drivers/net/ethernet/microchip/sparx5/sparx5_main_regs.h ++++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main_regs.h +@@ -5369,6 +5369,18 @@ extern const struct sparx5_regs *regs; + #define HSCH_TAS_STATEMACHINE_CFG_REVISIT_DLY_GET(x)\ + FIELD_GET(HSCH_TAS_STATEMACHINE_CFG_REVISIT_DLY, x) + ++/* HSCH:TAS_PROFILE_CFG:TAS_PROFILE_CONFIG */ ++#define HSCH_TAS_PROFILE_CONFIG(g) \ ++ __REG(TARGET_HSCH, 0, 1, regs->gaddr[GA_HSCH_TAS_PROFILE_CFG], g, \ ++ regs->gcnt[GC_HSCH_TAS_PROFILE_CFG], \ ++ regs->gsize[GW_HSCH_TAS_PROFILE_CFG], 32, 0, 1, 4) ++ ++#define HSCH_TAS_PROFILE_CONFIG_LINK_SPEED GENMASK(10, 8) ++#define HSCH_TAS_PROFILE_CONFIG_LINK_SPEED_SET(x)\ ++ FIELD_PREP(HSCH_TAS_PROFILE_CONFIG_LINK_SPEED, x) ++#define HSCH_TAS_PROFILE_CONFIG_LINK_SPEED_GET(x)\ ++ FIELD_GET(HSCH_TAS_PROFILE_CONFIG_LINK_SPEED, x) ++ + /* LAN969X ONLY */ + /* HSIOWRAP:XMII_CFG:XMII_CFG */ + #define HSIO_WRAP_XMII_CFG(g) \ +--- a/drivers/net/ethernet/microchip/sparx5/sparx5_port.c ++++ b/drivers/net/ethernet/microchip/sparx5/sparx5_port.c +@@ -11,6 +11,7 @@ + #include "sparx5_main_regs.h" + #include "sparx5_main.h" + #include "sparx5_port.h" ++#include "sparx5_qos.h" + + #define SPX5_ETYPE_TAG_C 0x8100 + #define SPX5_ETYPE_TAG_S 0x88a8 +@@ -1050,6 +1051,9 @@ int sparx5_port_config(struct sparx5 *sp + sparx5, + QFWD_SWITCH_PORT_MODE(port->portno)); + ++ /* Notify TAS about the speed. */ ++ sparx5_tas_speed(port, conf->speed); ++ + /* Save the new values */ + port->conf = *conf; + +--- a/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c ++++ b/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c +@@ -9,6 +9,17 @@ + #include "sparx5_main.h" + #include "sparx5_qos.h" + ++enum sparx5_tas_link_speed { ++ TAS_SPEED_NO_GB, ++ TAS_SPEED_10, ++ TAS_SPEED_100, ++ TAS_SPEED_1000, ++ TAS_SPEED_2500, ++ TAS_SPEED_5000, ++ TAS_SPEED_10000, ++ TAS_SPEED_25000, ++}; ++ + /* Calculate new base_time based on cycle_time. + * + * The hardware requires a base_time that is always in the future. +@@ -581,3 +592,41 @@ int sparx5_tc_ets_del(struct sparx5_port + + return sparx5_dwrr_conf_set(port, &dwrr); + } ++ ++void sparx5_tas_speed(struct sparx5_port *port, int speed) ++{ ++ struct sparx5 *sparx5 = port->sparx5; ++ u8 spd; ++ ++ switch (speed) { ++ case SPEED_10: ++ spd = TAS_SPEED_10; ++ break; ++ case SPEED_100: ++ spd = TAS_SPEED_100; ++ break; ++ case SPEED_1000: ++ spd = TAS_SPEED_1000; ++ break; ++ case SPEED_2500: ++ spd = TAS_SPEED_2500; ++ break; ++ case SPEED_5000: ++ spd = TAS_SPEED_5000; ++ break; ++ case SPEED_10000: ++ spd = TAS_SPEED_10000; ++ break; ++ case SPEED_25000: ++ spd = TAS_SPEED_25000; ++ break; ++ default: ++ netdev_err(port->ndev, "TAS: Unsupported speed: %d\n", speed); ++ return; ++ } ++ ++ spx5_rmw(HSCH_TAS_PROFILE_CONFIG_LINK_SPEED_SET(spd), ++ HSCH_TAS_PROFILE_CONFIG_LINK_SPEED, ++ sparx5, ++ HSCH_TAS_PROFILE_CONFIG(port->portno)); ++} +--- a/drivers/net/ethernet/microchip/sparx5/sparx5_qos.h ++++ b/drivers/net/ethernet/microchip/sparx5/sparx5_qos.h +@@ -60,6 +60,7 @@ struct sparx5_dwrr { + }; + + int sparx5_qos_init(struct sparx5 *sparx5); ++void sparx5_tas_speed(struct sparx5_port *port, int speed); + + /* Multi-Queue Priority */ + int sparx5_tc_mqprio_add(struct net_device *ndev, u8 num_tc); +--- a/drivers/net/ethernet/microchip/sparx5/sparx5_regs.h ++++ b/drivers/net/ethernet/microchip/sparx5/sparx5_regs.h +@@ -104,6 +104,7 @@ enum sparx5_gaddr_enum { + GA_HSCH_SYSTEM, + GA_HSCH_MMGT, + GA_HSCH_TAS_CONFIG, ++ GA_HSCH_TAS_PROFILE_CFG, + GA_PTP_PTP_CFG, + GA_PTP_PTP_TOD_DOMAINS, + GA_PTP_PHASE_DETECTOR_CTRL, +@@ -139,6 +140,7 @@ enum sparx5_gcnt_enum { + GC_GCB_SIO_CTRL, + GC_HSCH_HSCH_CFG, + GC_HSCH_HSCH_DWRR, ++ GC_HSCH_TAS_PROFILE_CFG, + GC_PTP_PTP_PINS, + GC_PTP_PHASE_DETECTOR_CTRL, + GC_REW_PORT, +@@ -155,6 +157,7 @@ enum sparx5_gsize_enum { + GW_FDMA_FDMA, + GW_GCB_CHIP_REGS, + GW_HSCH_TAS_CONFIG, ++ GW_HSCH_TAS_PROFILE_CFG, + GW_PTP_PHASE_DETECTOR_CTRL, + GW_QSYS_PAUSE_CFG, + GSIZE_LAST, From 75fad162df8e88d0b535cca83453b0ad05267349 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Wed, 1 Jul 2026 23:08:05 +0200 Subject: [PATCH 60/61] ead: Increase PKG_RELEASE Indicate that there are some changes. This should make sure that the package gets updated. Fixes: 63c0767f3d02 ("ead: fix integer underflow in handle_send_a()") Signed-off-by: Hauke Mehrtens --- package/network/services/ead/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/services/ead/Makefile b/package/network/services/ead/Makefile index a35ffdb974..02f633025d 100644 --- a/package/network/services/ead/Makefile +++ b/package/network/services/ead/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ead -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_BUILD_DEPENDS:=libpcap PKG_BUILD_DIR:=$(BUILD_DIR)/ead From 4b370c5097d62e7adb8bb94acdbc9b682f3bf75f Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Wed, 1 Jul 2026 23:10:44 +0200 Subject: [PATCH 61/61] odhcp6c: Increase PKG_RELEASE Indicate that there are some changes. This should make sure that the package gets updated. Fixes: 257aee0cc030 ("scripts: dhcpv6: don't report custom ip6class if default") Signed-off-by: Hauke Mehrtens --- package/network/ipv6/odhcp6c/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile index eddb1858d0..480c3e44d7 100644 --- a/package/network/ipv6/odhcp6c/Makefile +++ b/package/network/ipv6/odhcp6c/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=odhcp6c -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git