From 1a235a7f0b6c71d09a3111d518421f889ba80f15 Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Thu, 24 Jul 2025 10:04:42 -0400 Subject: [PATCH 01/21] mediatek: filogic: Add support for Wavlink WL-WN551X3 Hardware -------- - SOC: MediaTek MT7981B - RAM: 256MB DDR3 - FLASH: 128MB SPI-NAND WinBond W25N01GVZEIG - NETWORK: 2x1Gb Lan 1x1Gb Wan - WIFI: MediaTek MT7981B 2x2 DBDC 802.11ax 2T2R (2.4/5) - LEDs: 3x WAN/LAN (green) 2x STATUS (red/blue) - USB: 1x XHCI Installation via Webinterface ----------------------------- 1. Rename OpenWrt sysupgrade bin to wavlink_wl-wn551X3-squashfs-sysupgrade.bin The uppercase chars 551X3 are essential and checked by web interface. 2. Logon to webinterface 3. Go to network configuration -> mode selection 4. Choose mode "LAN bridge/access point" 5. Save configuration (maybe network reconfig needed) 6. Go to system upgrade 7. Choose local upgrade and provide renamed sysupgrade file 8. Start upgrade and wait for completion 9. Logon to OpenWrt (network config is preserved during upgrade) Boot initramfs via TFTP & console --------------------------------- 1. Connect switch to network via LAN1 or LAN2 2. Power on switch 3. Press ESC until prompt reached "MT7981>" 4. Set own IP "setenv ipaddr 192.168.x.y" 5. Set TFTP IP "setenv serverip 192.168.a.b" 6. Set memory address "setenv loadaddr 0x46000000" 7. Download image "tftpboot openwrt-mediatek-filogic-wavlink_wl-wn551x3-initramfs.itb" 8. Boot image "bootm" Notes ----- - The red/blue LEDs give a background illumination to the top of the case. The red LED is totally disabled to avoid noisy blinking. - Aside from the design and the different LED colors & placements the hardware and partitioning matches the WAVLINK WL-WN586X3 Rev B. Therefor a common DTSI was prepared. MAC Addresses (same as stock) ----------------------------- LAN : 80:3F:5D:xx:xx:B1 (hw, 0x44e(text)) WAN : 80:3F:5D:xx:xx:B2 (hw, 0x460(text)) 2.4GHz: 80:3F:5D:xx:xx:B1 (Factory, 0x4 (hex)) 5GHz : driver auto generated Signed-off-by: Markus Stockhausen Link: https://github.com/openwrt/openwrt/pull/19515 Signed-off-by: Hauke Mehrtens --- ...7981b-wavlink-wl-3port-128nand-common.dtsi | 210 ++++++++++++++++++ .../dts/mt7981b-wavlink-wl-wn551x3.dts | 63 ++++++ .../filogic/base-files/etc/board.d/01_leds | 5 + .../filogic/base-files/etc/board.d/02_network | 1 + target/linux/mediatek/image/filogic.mk | 18 ++ 5 files changed, 297 insertions(+) create mode 100644 target/linux/mediatek/dts/mt7981b-wavlink-wl-3port-128nand-common.dtsi create mode 100644 target/linux/mediatek/dts/mt7981b-wavlink-wl-wn551x3.dts diff --git a/target/linux/mediatek/dts/mt7981b-wavlink-wl-3port-128nand-common.dtsi b/target/linux/mediatek/dts/mt7981b-wavlink-wl-3port-128nand-common.dtsi new file mode 100644 index 0000000000..f796a00810 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-wavlink-wl-3port-128nand-common.dtsi @@ -0,0 +1,210 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/dts-v1/; + +#include "mt7981b.dtsi" + +/ { + chosen { + stdout-path = "serial0:115200n8"; + }; + + gpio-keys { + compatible = "gpio-keys"; + + button-reset { + label = "reset"; + linux,code = ; + gpios = <&pio 11 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&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 = <8>; + bias-pull-up = <103>; + }; + + conf-pd { + pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; + drive-strength = <8>; + bias-pull-down = <103>; + }; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_flash_pins>; + status = "okay"; + + flash@0 { + #address-cells = <1>; + #size-cells = <1>; + + compatible = "spi-nand"; + reg = <0>; + + spi-max-frequency = <52000000>; + spi-tx-bus-width = <4>; + spi-rx-bus-width = <4>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bl2"; + reg = <0x0 0x100000>; + read-only; + }; + + partition@100000 { + label = "u-boot-env"; + reg = <0x100000 0x80000>; + read-only; + }; + + factory: partition@180000 { + label = "factory"; + reg = <0x180000 0x200000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory: eeprom@0 { + reg = <0x0 0x1000>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; + }; + + partition@380000 { + label = "fip"; + reg = <0x380000 0x200000>; + read-only; + }; + + partition@580000 { + label = "ubi"; + reg = <0x580000 0x4000000>; + }; + + partition@4580000 { + label = "hw"; + reg = <0x4580000 0x80000>; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_hw_44e: macaddr@44e { + compatible = "mac-base"; + reg = <0x44e 0x11>; + #nvmem-cell-cells = <1>; + }; + }; + }; + }; + }; +}; + +ð { + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_hw_44e 0>; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "gmii"; + phy-handle = <&int_gbe_phy>; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_hw_44e 1>; + }; +}; + +&mdio_bus { + switch: switch@1f { + compatible = "mediatek,mt7531"; + reg = <31>; + reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&pio>; + interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; + }; +}; + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@1 { + reg = <1>; + label = "lan2"; + }; + + port@2 { + reg = <2>; + label = "lan1"; + }; + + port@6 { + reg = <6>; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; +}; + +&wifi { + status = "okay"; + nvmem-cells = <&eeprom_factory 0>; + nvmem-cell-names = "eeprom"; +}; diff --git a/target/linux/mediatek/dts/mt7981b-wavlink-wl-wn551x3.dts b/target/linux/mediatek/dts/mt7981b-wavlink-wl-wn551x3.dts new file mode 100644 index 0000000000..0387c73dd1 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-wavlink-wl-wn551x3.dts @@ -0,0 +1,63 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/dts-v1/; + +#include "mt7981b-wavlink-wl-3port-128nand-common.dtsi" + +/ { + model = "WAVLINK WL-WN551X3"; + compatible = "wavlink,wl-wn551x3", "mediatek,mt7981b"; + + aliases { + label-mac-device = &wifi; + led-boot = &led_status_blue; + led-failsafe = &led_status_blue; + led-running = &led_status_blue; + led-upgrade = &led_status_blue; + serial0 = &uart0; + }; + + leds { + compatible = "gpio-leds"; + + led_status_blue: led-0 { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&pio 7 GPIO_ACTIVE_HIGH>; + }; + + led-1 { + color = ; + gpios = <&pio 8 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "none"; + }; + + led-2 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <1>; + gpios = <&pio 10 GPIO_ACTIVE_LOW>; + }; + + led-3 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <2>; + gpios = <&pio 9 GPIO_ACTIVE_LOW>; + }; + + led-4 { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&pio 25 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&usb_phy { + status = "okay"; +}; + +&xhci { + status = "okay"; +}; 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 6d4c7903bc..62a0161286 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 @@ -206,6 +206,11 @@ tplink,re6000xd) ucidef_set_led_netdev "lan-2" "lan-2" "blue:lan-1" "lan2" "link tx rx" ucidef_set_led_netdev "eth1" "lan-3" "blue:lan-2" "eth1" "link tx rx" ;; +wavlink,wl-wn551x3) + 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 "wan" "wan" "green:wan" "eth1" "link tx rx" + ;; wavlink,wl-wn586x3) ucidef_set_led_netdev "lan-1" "lan-1" "blue:lan-1" "lan1" "link tx rx" ucidef_set_led_netdev "lan-2" "lan-2" "blue: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 802df4608c..1f9d3c551c 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 @@ -139,6 +139,7 @@ mediatek_setup_interfaces() ucidef_set_interfaces_lan_wan "port1 port3 port4 port5 port6" "port2" ;; tplink,tl-xdr6086|\ + wavlink,wl-wn551x3|\ wavlink,wl-wn586x3) ucidef_set_interfaces_lan_wan "lan1 lan2" eth1 ;; diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index e9e74efa1f..2e03bb8e7e 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -1972,6 +1972,24 @@ define Device/unielec_u7981-01-nand endef TARGET_DEVICES += unielec_u7981-01-nand +define Device/wavlink_wl-wn551x3 + DEVICE_VENDOR := WAVLINK + DEVICE_MODEL := WL-WN551X3 + DEVICE_DTS := mt7981b-wavlink-wl-wn551x3 + DEVICE_DTS_DIR := ../dts + DEVICE_DTS_LOADADDR := 0x47000000 + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 65536k + KERNEL_INITRAMFS_SUFFIX := .itb + KERNEL_IN_UBI := 1 + DEVICE_PACKAGES := kmod-usb3 kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware + SUPPORTED_DEVICES += mediatek,mt7981-spim-snand-rfb + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += wavlink_wl-wn551x3 + define Device/wavlink_wl-wn586x3 DEVICE_VENDOR := WAVLINK DEVICE_MODEL := WL-WN586X3 From f6603de71de4d48d79fbb33b07b59bb5aaa233f5 Mon Sep 17 00:00:00 2001 From: Harshal Gohel Date: Tue, 15 Jul 2025 20:05:41 +0200 Subject: [PATCH 02/21] realtek: rtl93xx: Add learning and flooding enable/disable Both RTL930x and RTL931x were missing the code to support enabling and disabling MAC address learning and unknown unicast flooding on a per-port basis. * rtl93*x_enable_learning() allows toggling of dynamic MAC learning on individual ports by modifying the L2 learning constraint control register. * rtl93*x_enable_flood() provides the ability to control unknown unicast flooding behavior, disabling forwarding when set. If it is enabled, it will just forward it. If it is disabled, packets will simply be dropped. Signed-off-by: Harshal Gohel Signed-off-by: Sharadanand Karanjkar Link: https://github.com/openwrt/openwrt/pull/19581 Signed-off-by: Hauke Mehrtens --- .../drivers/net/dsa/rtl83xx/rtl838x.h | 2 ++ .../drivers/net/dsa/rtl83xx/rtl930x.c | 22 +++++++++++++++++++ .../drivers/net/dsa/rtl83xx/rtl931x.c | 22 +++++++++++++++++++ 3 files changed, 46 insertions(+) diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h index b8f543bd9e..749440f70b 100644 --- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h +++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h @@ -246,6 +246,8 @@ #define RTL838X_L2_LRN_CONSTRT_EN (0x3368) #define RTL838X_L2_PORT_LRN_CONSTRT (0x32A0) #define RTL839X_L2_PORT_LRN_CONSTRT (0x3914) +#define RTL930X_L2_LRN_PORT_CONSTRT_CTRL (0x90A4) +#define RTL931X_L2_LRN_PORT_CONSTRT_CTRL (0xC96C) #define RTL838X_L2_PORT_NEW_SALRN(p) (0x328c + (((p >> 4) << 2))) #define RTL839X_L2_PORT_NEW_SALRN(p) (0x38F0 + (((p >> 4) << 2))) diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c index 4116fe2008..dd1d3e5c17 100644 --- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c +++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c @@ -296,6 +296,26 @@ static void rtl930x_l2_learning_setup(void) sw_w32((0x7fff << 2) | 0, RTL930X_L2_LRN_CONSTRT_CTRL); } +static void rtldsa_930x_enable_learning(int port, bool enable) +{ + /* Limit learning to maximum: 32k entries */ + sw_w32_mask(GENMASK(17, 3), enable ? (0x7ffe << 3) : 0, + RTL930X_L2_LRN_PORT_CONSTRT_CTRL + port * 4); +} + +static void rtldsa_930x_enable_flood(int port, bool enable) +{ + /* 0: forward + * 1: drop + * 2: trap to local CPU + * 3: copy to local CPU + * 4: trap to master CPU + * 5: copy to master CPU + */ + sw_w32_mask(GENMASK(2, 0), enable ? 0 : 1, + RTL930X_L2_LRN_PORT_CONSTRT_CTRL + port * 4); +} + static void rtl930x_stp_get(struct rtl838x_switch_priv *priv, u16 msti, u32 port_state[]) { u32 cmd = 1 << 17 | /* Execute cmd */ @@ -2513,4 +2533,6 @@ const struct rtl838x_reg rtl930x_reg = { .set_l3_egress_intf = rtl930x_set_l3_egress_intf, .set_distribution_algorithm = rtl930x_set_distribution_algorithm, .led_init = rtl930x_led_init, + .enable_learning = rtldsa_930x_enable_learning, + .enable_flood = rtldsa_930x_enable_flood, }; diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl931x.c b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl931x.c index f6a098c701..a1d0101f47 100644 --- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl931x.c +++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl931x.c @@ -869,6 +869,26 @@ static void rtl931x_l2_learning_setup(void) sw_w32((0xffff << 3) | FORWARD, RTL931X_L2_LRN_CONSTRT_CTRL); } +static void rtldsa_931x_enable_learning(int port, bool enable) +{ + /* Limit learning to maximum: 64k entries */ + sw_w32_mask(GENMASK(18, 3), enable ? (0xfffe << 3) : 0, + RTL931X_L2_LRN_PORT_CONSTRT_CTRL + port * 4); +} + +static void rtldsa_931x_enable_flood(int port, bool enable) +{ + /* 0: forward + * 1: drop + * 2: trap to local CPU + * 3: copy to local CPU + * 4: trap to master CPU + * 5: copy to master CPU + */ + sw_w32_mask(GENMASK(2, 0), enable ? 0 : 1, + RTL931X_L2_LRN_PORT_CONSTRT_CTRL + port * 4); +} + static u64 rtl931x_read_mcast_pmask(int idx) { u64 portmask; @@ -1690,4 +1710,6 @@ const struct rtl838x_reg rtl931x_reg = { .l2_learning_setup = rtl931x_l2_learning_setup, .l3_setup = rtl931x_l3_setup, .led_init = rtldsa_931x_led_init, + .enable_learning = rtldsa_931x_enable_learning, + .enable_flood = rtldsa_931x_enable_flood, }; From 5f06b8ebbc4cf98dfa15708444460c3dc94cfdcb Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Tue, 5 Aug 2025 14:02:26 -0400 Subject: [PATCH 03/21] realtek: dsa: rename tagged_ports to member_ports The current variables tagged_ports and untagged_ports suggest that these are distinct and describe only the ports in each of these configuration types. That is wrong. The hardware is configured via member ports and untagged ports. The first one being a superset of the second. Rename the variables to reflect that. Signed-off-by: Markus Stockhausen Link: https://github.com/openwrt/openwrt/pull/19684 Signed-off-by: Hauke Mehrtens --- .../files-6.12/drivers/net/dsa/rtl83xx/dsa.c | 26 +++++++++---------- .../drivers/net/dsa/rtl83xx/rtl838x.c | 6 ++--- .../drivers/net/dsa/rtl83xx/rtl838x.h | 2 +- .../drivers/net/dsa/rtl83xx/rtl839x.c | 8 +++--- .../drivers/net/dsa/rtl83xx/rtl930x.c | 4 +-- .../drivers/net/dsa/rtl83xx/rtl931x.c | 10 +++---- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c index 17a8b46f0c..fbb1a4ba2f 100644 --- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c +++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c @@ -368,7 +368,7 @@ static void rtl83xx_vlan_setup(struct rtl838x_switch_priv *priv) info.hash_uc_fid = false; /* Do not build the L2 lookup hash with FID, but VID */ info.hash_mc_fid = false; /* Do the same for Multicast packets */ info.profile_id = 0; /* Use default Vlan Profile 0 */ - info.tagged_ports = 0; /* Initially no port members */ + info.member_ports = 0; /* Initially no port members */ if (priv->family_id == RTL9310_FAMILY_ID) { info.if_id = 0; info.multicast_grp_mask = 0; @@ -388,7 +388,7 @@ static void rtl83xx_vlan_setup(struct rtl838x_switch_priv *priv) */ for (int i = 0; i <= priv->cpu_port; i++) { rtl83xx_vlan_set_pvid(priv, i, 0); - info.tagged_ports |= BIT_ULL(i); + info.member_ports |= BIT_ULL(i); } priv->r->vlan_set_tagged(0, &info); @@ -1922,19 +1922,19 @@ static int rtl83xx_vlan_prepare(struct dsa_switch *ds, int port, priv->r->vlan_tables_read(0, &info); - pr_debug("VLAN 0: Tagged ports %llx, untag %llx, profile %d, MC# %d, UC# %d, FID %x\n", - info.tagged_ports, info.untagged_ports, info.profile_id, + pr_debug("VLAN 0: Member ports %llx, untag %llx, profile %d, MC# %d, UC# %d, FID %x\n", + info.member_ports, info.untagged_ports, info.profile_id, info.hash_mc_fid, info.hash_uc_fid, info.fid); priv->r->vlan_tables_read(1, &info); - pr_debug("VLAN 1: Tagged ports %llx, untag %llx, profile %d, MC# %d, UC# %d, FID %x\n", - info.tagged_ports, info.untagged_ports, info.profile_id, + pr_debug("VLAN 1: Member ports %llx, untag %llx, profile %d, MC# %d, UC# %d, FID %x\n", + info.member_ports, info.untagged_ports, info.profile_id, info.hash_mc_fid, info.hash_uc_fid, info.fid); priv->r->vlan_set_untagged(1, info.untagged_ports); pr_debug("SET: Untagged ports, VLAN %d: %llx\n", 1, info.untagged_ports); priv->r->vlan_set_tagged(1, &info); - pr_debug("SET: Tagged ports, VLAN %d: %llx\n", 1, info.tagged_ports); + pr_debug("SET: Member ports, VLAN %d: %llx\n", 1, info.member_ports); return 0; } @@ -1983,7 +1983,7 @@ static int rtl83xx_vlan_add(struct dsa_switch *ds, int port, priv->r->vlan_tables_read(vlan->vid, &info); /* new VLAN? */ - if (!info.tagged_ports) { + if (!info.member_ports) { info.fid = 0; info.hash_mc_fid = false; info.hash_uc_fid = false; @@ -1991,10 +1991,10 @@ static int rtl83xx_vlan_add(struct dsa_switch *ds, int port, } /* sanitize untagged_ports - must be a subset */ - if (info.untagged_ports & ~info.tagged_ports) + if (info.untagged_ports & ~info.member_ports) info.untagged_ports = 0; - info.tagged_ports |= BIT_ULL(port); + info.member_ports |= BIT_ULL(port); if (vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED) info.untagged_ports |= BIT_ULL(port); else @@ -2004,7 +2004,7 @@ static int rtl83xx_vlan_add(struct dsa_switch *ds, int port, pr_debug("Untagged ports, VLAN %d: %llx\n", vlan->vid, info.untagged_ports); priv->r->vlan_set_tagged(vlan->vid, &info); - pr_debug("Tagged ports, VLAN %d: %llx\n", vlan->vid, info.tagged_ports); + pr_debug("Member ports, VLAN %d: %llx\n", vlan->vid, info.member_ports); mutex_unlock(&priv->reg_mutex); @@ -2041,13 +2041,13 @@ static int rtl83xx_vlan_del(struct dsa_switch *ds, int port, /* remove port from both tables */ info.untagged_ports &= (~BIT_ULL(port)); - info.tagged_ports &= (~BIT_ULL(port)); + info.member_ports &= (~BIT_ULL(port)); priv->r->vlan_set_untagged(vlan->vid, info.untagged_ports); pr_debug("Untagged ports, VLAN %d: %llx\n", vlan->vid, info.untagged_ports); priv->r->vlan_set_tagged(vlan->vid, &info); - pr_debug("Tagged ports, VLAN %d: %llx\n", vlan->vid, info.tagged_ports); + pr_debug("Member ports, VLAN %d: %llx\n", vlan->vid, info.member_ports); mutex_unlock(&priv->reg_mutex); diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.c b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.c index ac4b962318..e0c8d73fa4 100644 --- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.c +++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.c @@ -155,9 +155,9 @@ static void rtl838x_vlan_tables_read(u32 vlan, struct rtl838x_vlan_info *info) struct table_reg *r = rtl_table_get(RTL8380_TBL_0, 0); rtl_table_read(r, vlan); - info->tagged_ports = sw_r32(rtl_table_data(r, 0)); + info->member_ports = sw_r32(rtl_table_data(r, 0)); v = sw_r32(rtl_table_data(r, 1)); - pr_debug("VLAN_READ %d: %016llx %08x\n", vlan, info->tagged_ports, v); + pr_debug("VLAN_READ %d: %016llx %08x\n", vlan, info->member_ports, v); rtl_table_release(r); info->profile_id = v & 0x7; @@ -178,7 +178,7 @@ static void rtl838x_vlan_set_tagged(u32 vlan, struct rtl838x_vlan_info *info) /* Access VLAN table (0) via register 0 */ struct table_reg *r = rtl_table_get(RTL8380_TBL_0, 0); - sw_w32(info->tagged_ports, rtl_table_data(r, 0)); + sw_w32(info->member_ports, rtl_table_data(r, 0)); v = info->profile_id; v |= info->hash_mc_fid ? 0x8 : 0; diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h index 749440f70b..544f693883 100644 --- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h +++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h @@ -709,7 +709,7 @@ struct rtl838x_pcs { struct rtl838x_vlan_info { u64 untagged_ports; - u64 tagged_ports; + u64 member_ports; u8 profile_id; bool hash_mc_fid; bool hash_uc_fid; diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl839x.c b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl839x.c index cec6e27c37..87ba9e0fbc 100644 --- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl839x.c +++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl839x.c @@ -172,8 +172,8 @@ static void rtl839x_vlan_tables_read(u32 vlan, struct rtl838x_vlan_info *info) w = sw_r32(rtl_table_data(r, 2)); rtl_table_release(r); - info->tagged_ports = u; - info->tagged_ports = (info->tagged_ports << 21) | ((v >> 11) & 0x1fffff); + info->member_ports = u; + info->member_ports = (info->member_ports << 21) | ((v >> 11) & 0x1fffff); info->profile_id = w >> 30 | ((v & 1) << 2); info->hash_mc_fid = !!(w & BIT(2)); info->hash_uc_fid = !!(w & BIT(3)); @@ -196,8 +196,8 @@ static void rtl839x_vlan_set_tagged(u32 vlan, struct rtl838x_vlan_info *info) /* Access VLAN table (0) via register 0 */ struct table_reg *r = rtl_table_get(RTL8390_TBL_0, 0); - u = info->tagged_ports >> 21; - v = info->tagged_ports << 11; + u = info->member_ports >> 21; + v = info->member_ports << 11; v |= ((u32)info->fid) << 3; v |= info->hash_uc_fid ? BIT(2) : 0; v |= info->hash_mc_fid ? BIT(1) : 0; diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c index dd1d3e5c17..034b5c09f0 100644 --- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c +++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c @@ -184,7 +184,7 @@ static void rtl930x_vlan_tables_read(u32 vlan, struct rtl838x_vlan_info *info) pr_debug("VLAN_READ %d: %08x %08x\n", vlan, v, w); rtl_table_release(r); - info->tagged_ports = v >> 3; + info->member_ports = v >> 3; info->profile_id = (w >> 24) & 7; info->hash_mc_fid = !!(w & BIT(27)); info->hash_uc_fid = !!(w & BIT(28)); @@ -205,7 +205,7 @@ static void rtl930x_vlan_set_tagged(u32 vlan, struct rtl838x_vlan_info *info) /* Access VLAN table (1) via register 0 */ struct table_reg *r = rtl_table_get(RTL9300_TBL_0, 1); - v = info->tagged_ports << 3; + v = info->member_ports << 3; v |= ((u32)info->fid) >> 3; w = ((u32)info->fid) << 29; diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl931x.c b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl931x.c index a1d0101f47..5a623cd31b 100644 --- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl931x.c +++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl931x.c @@ -198,7 +198,7 @@ static void rtl931x_vlan_tables_read(u32 vlan, struct rtl838x_vlan_info *info) rtl_table_release(r); pr_debug("VLAN_READ %d: %08x %08x %08x %08x\n", vlan, v, w, x, y); - info->tagged_ports = ((u64) v) << 25 | (w >> 7); + info->member_ports = ((u64) v) << 25 | (w >> 7); info->profile_id = (x >> 16) & 0xf; info->fid = w & 0x7f; /* AKA MSTI depending on context */ info->hash_uc_fid = !!(x & BIT(31)); @@ -209,8 +209,8 @@ static void rtl931x_vlan_tables_read(u32 vlan, struct rtl838x_vlan_info *info) info->l2_tunnel_list_id = y >> 18; else info->l2_tunnel_list_id = -1; - pr_debug("%s read tagged %016llx, profile-id %d, uc %d, mc %d, intf-id %d\n", __func__, - info->tagged_ports, info->profile_id, info->hash_uc_fid, info->hash_mc_fid, + pr_debug("%s read member %016llx, profile-id %d, uc %d, mc %d, intf-id %d\n", __func__, + info->member_ports, info->profile_id, info->hash_uc_fid, info->hash_mc_fid, info->if_id); /* Read UNTAG table via table register 3 */ @@ -227,8 +227,8 @@ static void rtl931x_vlan_set_tagged(u32 vlan, struct rtl838x_vlan_info *info) struct table_reg *r; u32 v, w, x, y; - v = info->tagged_ports >> 25; - w = (info->tagged_ports & GENMASK(24, 0)) << 7; + v = info->member_ports >> 25; + w = (info->member_ports & GENMASK(24, 0)) << 7; w |= info->fid & 0x7f; x = info->hash_uc_fid ? BIT(31) : 0; x |= info->hash_mc_fid ? BIT(30) : 0; From defce7cefdf3f98d9e48c5422b5f965db4465a19 Mon Sep 17 00:00:00 2001 From: Thomas Richard Date: Tue, 5 Aug 2025 09:32:48 +0200 Subject: [PATCH 04/21] kernel: usb: add kmod-usb-common package Move usb-common driver from usb-core package to a new usb-common package. The usb-common driver is needed by usb-gadget driver which can be used without host support. Signed-off-by: Thomas Richard Link: https://github.com/openwrt/openwrt/pull/19246 Signed-off-by: Hauke Mehrtens --- package/kernel/linux/modules/usb.mk | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk index 4155082901..445a8ff0a1 100644 --- a/package/kernel/linux/modules/usb.mk +++ b/package/kernel/linux/modules/usb.mk @@ -11,15 +11,24 @@ USBNET_DIR:=net/usb USBHID_DIR?=hid/usbhid USBINPUT_DIR?=input/misc +define KernelPackage/usb-common + TITLE:=USB common + HIDDEN:=1 + DEPENDS:=@(USB_SUPPORT||USB_GADGET_SUPPORT) + KCONFIG:=CONFIG_USB_COMMON + FILES:=$(LINUX_DIR)/drivers/usb/common/usb-common.ko + AUTOLOAD:=$(call AutoLoad,20,usb-common,1) +endef + +$(eval $(call KernelPackage,usb-common)) + define KernelPackage/usb-core SUBMENU:=$(USB_MENU) TITLE:=Support for USB - DEPENDS:=@USB_SUPPORT + DEPENDS:=@USB_SUPPORT +USB_SUPPORT:kmod-usb-common KCONFIG:=CONFIG_USB CONFIG_XPS_USB_HCD_XILINX=n CONFIG_USB_FHCI_HCD=n - FILES:= \ - $(LINUX_DIR)/drivers/usb/core/usbcore.ko \ - $(LINUX_DIR)/drivers/usb/common/usb-common.ko - AUTOLOAD:=$(call AutoLoad,20,usb-common usbcore,1) + FILES:=$(LINUX_DIR)/drivers/usb/core/usbcore.ko + AUTOLOAD:=$(call AutoLoad,20,usbcore,1) $(call AddDepends/nls) endef From 65aea930a5cf3b4a5beeeb45a46b4b26b94ce9b6 Mon Sep 17 00:00:00 2001 From: Thomas Richard Date: Fri, 27 Jun 2025 15:58:45 +0200 Subject: [PATCH 05/21] kernel: usb: gadget drivers do not depend on usb host support The usb gadget drivers don't depend on usb host support, so fix the package dependencies accordingly. Signed-off-by: Thomas Richard Link: https://github.com/openwrt/openwrt/pull/19246 Signed-off-by: Hauke Mehrtens --- package/kernel/linux/modules/usb.mk | 41 +++++++++++++++-------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk index 445a8ff0a1..239074de63 100644 --- a/package/kernel/linux/modules/usb.mk +++ b/package/kernel/linux/modules/usb.mk @@ -99,14 +99,15 @@ $(eval $(call KernelPackage,phy-ath79-usb)) define KernelPackage/usb-gadget + SUBMENU:=$(USB_MENU) TITLE:=USB Gadget support KCONFIG:=CONFIG_USB_GADGET HIDDEN:=1 FILES:=\ $(LINUX_DIR)/drivers/usb/gadget/udc/udc-core.ko AUTOLOAD:=$(call AutoLoad,21,udc-core,1) - DEPENDS:=@USB_GADGET_SUPPORT - $(call AddDepends/usb) + DEPENDS:=@USB_GADGET_SUPPORT +kmod-usb-common + $(call AddDepends/nls) endef define KernelPackage/usb-gadget/description @@ -115,14 +116,20 @@ endef $(eval $(call KernelPackage,usb-gadget)) + +define AddDepends/usbgadget + SUBMENU:=$(USB_MENU) + DEPENDS+=+kmod-usb-gadget $(1) +endef + + define KernelPackage/usb-lib-composite TITLE:=USB lib composite KCONFIG:=CONFIG_USB_LIBCOMPOSITE - DEPENDS:=+kmod-usb-gadget +kmod-fs-configfs HIDDEN:=1 FILES:=$(LINUX_DIR)/drivers/usb/gadget/libcomposite.ko AUTOLOAD:=$(call AutoLoad,50,libcomposite) - $(call AddDepends/usb) + $(call AddDepends/usbgadget,+kmod-fs-configfs) endef define KernelPackage/usb-lib-composite/description @@ -134,12 +141,11 @@ $(eval $(call KernelPackage,usb-lib-composite)) define KernelPackage/usb-gadget-hid TITLE:=USB HID Gadget Support KCONFIG:=CONFIG_USB_G_HID - DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite FILES:= \ $(LINUX_DIR)/drivers/usb/gadget/legacy/g_hid.ko \ $(LINUX_DIR)/drivers/usb/gadget/function/usb_f_hid.ko AUTOLOAD:=$(call AutoLoad,52,usb_f_hid) - $(call AddDepends/usb) + $(call AddDepends/usbgadget,+kmod-usb-lib-composite) endef define KernelPackage/usb-gadget-hid/description @@ -154,9 +160,8 @@ define KernelPackage/usb-gadget-ehci-debug CONFIG_USB_G_DBGP \ CONFIG_USB_G_DBGP_SERIAL=y \ CONFIG_USB_G_DBGP_PRINTK=n - DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite +kmod-usb-gadget-serial FILES:=$(LINUX_DIR)/drivers/usb/gadget/legacy/g_dbgp.ko - $(call AddDepends/usb) + $(call AddDepends/usbgadget,+kmod-usb-lib-composite +kmod-usb-gadget-serial) endef define KernelPackage/usb-gadget-ehci-debug/description @@ -171,7 +176,6 @@ define KernelPackage/usb-gadget-eth CONFIG_USB_ETH \ CONFIG_USB_ETH_RNDIS=y \ CONFIG_USB_ETH_EEM=n - DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite FILES:= \ $(LINUX_DIR)/drivers/usb/gadget/function/u_ether.ko \ $(LINUX_DIR)/drivers/usb/gadget/function/usb_f_ecm.ko \ @@ -179,7 +183,7 @@ define KernelPackage/usb-gadget-eth $(LINUX_DIR)/drivers/usb/gadget/function/usb_f_rndis.ko \ $(LINUX_DIR)/drivers/usb/gadget/legacy/g_ether.ko AUTOLOAD:=$(call AutoLoad,52,usb_f_ecm) - $(call AddDepends/usb) + $(call AddDepends/usbgadget,+kmod-usb-lib-composite) endef define KernelPackage/usb-gadget-eth/description @@ -191,13 +195,11 @@ $(eval $(call KernelPackage,usb-gadget-eth)) define KernelPackage/usb-gadget-ncm TITLE:=USB Network Control Model (NCM) Gadget support KCONFIG:=CONFIG_USB_G_NCM - DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite \ - +kmod-usb-gadget-eth FILES:= \ $(LINUX_DIR)/drivers/usb/gadget/function/usb_f_ncm.ko \ $(LINUX_DIR)/drivers/usb/gadget/legacy/g_ncm.ko AUTOLOAD:=$(call AutoLoad,52,usb_f_ncm) - $(call AddDepends/usb) + $(call AddDepends/usbgadget,+kmod-usb-lib-composite +kmod-usb-gadget-eth) endef define KernelPackage/usb-gadget-ncm/description @@ -209,7 +211,6 @@ $(eval $(call KernelPackage,usb-gadget-ncm)) define KernelPackage/usb-gadget-serial TITLE:=USB Serial Gadget support KCONFIG:=CONFIG_USB_G_SERIAL - DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite FILES:= \ $(LINUX_DIR)/drivers/usb/gadget/function/u_serial.ko \ $(LINUX_DIR)/drivers/usb/gadget/function/usb_f_acm.ko \ @@ -217,7 +218,7 @@ define KernelPackage/usb-gadget-serial $(LINUX_DIR)/drivers/usb/gadget/function/usb_f_serial.ko \ $(LINUX_DIR)/drivers/usb/gadget/legacy/g_serial.ko AUTOLOAD:=$(call AutoLoad,52,usb_f_acm) - $(call AddDepends/usb) + $(call AddDepends/usbgadget,+kmod-usb-lib-composite) endef define KernelPackage/usb-gadget-serial/description @@ -229,12 +230,11 @@ $(eval $(call KernelPackage,usb-gadget-serial)) define KernelPackage/usb-gadget-mass-storage TITLE:=USB Mass Storage support KCONFIG:=CONFIG_USB_MASS_STORAGE - DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite FILES:= \ $(LINUX_DIR)/drivers/usb/gadget/function/usb_f_mass_storage.ko \ $(LINUX_DIR)/drivers/usb/gadget/legacy/g_mass_storage.ko AUTOLOAD:=$(call AutoLoad,52,usb_f_mass_storage) - $(call AddDepends/usb) + $(call AddDepends/usbgadget,+kmod-usb-lib-composite) endef define KernelPackage/usb-gadget-mass-storage/description @@ -246,10 +246,11 @@ $(eval $(call KernelPackage,usb-gadget-mass-storage)) define KernelPackage/usb-gadget-cdc-composite TITLE:= USB CDC Composite (Ethernet + ACM) KCONFIG:=CONFIG_USB_CDC_COMPOSITE - DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite \ - +kmod-usb-gadget-eth +kmod-usb-gadget-serial FILES:= $(LINUX_DIR)/drivers/usb/gadget/legacy/g_cdc.ko - $(call AddDepends/usb) + $(call AddDepends/usbgadget, \ + +kmod-usb-lib-composite \ + +kmod-usb-gadget-eth \ + +kmod-usb-gadget-serial) endef define KernelPackage/usb-gadget-cdc-composite/description From 0f782fc2e9ed25767b4351047e815e9dc8ac8298 Mon Sep 17 00:00:00 2001 From: Thomas Richard Date: Fri, 27 Jun 2025 15:59:22 +0200 Subject: [PATCH 06/21] kernel: usb: fix dependencies for kmod-usb-roles package The usb role driver does not depend on the kernel config CONFIG_USB (host side support). It only depends on the kernel config CONFIG_USB_SUPPORT. Now it depends on the OpenWrt configurations USB_SUPPORT or USB_GADGET_SUPPORT (usb and usbgadget features). We can assume that if usb or usbgadget features are set, CONFIG_USB_SUPPORT has been set in the target/subtarget kernel config. Signed-off-by: Thomas Richard Link: https://github.com/openwrt/openwrt/pull/19246 Signed-off-by: Hauke Mehrtens --- package/kernel/linux/modules/usb.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk index 239074de63..d3b37311bc 100644 --- a/package/kernel/linux/modules/usb.mk +++ b/package/kernel/linux/modules/usb.mk @@ -1868,11 +1868,12 @@ endef $(eval $(call KernelPackage,usb-net2280)) define KernelPackage/usb-roles + SUBMENU:=$(USB_MENU) TITLE:=USB Role Switch Library Module + DEPENDS:=@USB_SUPPORT||USB_GADGET_SUPPORT KCONFIG:=CONFIG_USB_ROLE_SWITCH HIDDEN:=1 FILES:=$(LINUX_DIR)/drivers/usb/roles/roles.ko - $(call AddDepends/usb) endef define KernelPackage/usb-roles/description From 0546f8b74d5860b5a44f453b6842f51a58842cb9 Mon Sep 17 00:00:00 2001 From: Thomas Richard Date: Fri, 27 Jun 2025 10:28:08 +0200 Subject: [PATCH 07/21] kernel: usb: kmod-usb-dwc3: add gadget and dual-role modes support Build DWC3 driver in the right mode: - host mode if kernel have usb host support only. - gadget mode if kernel have usbgadget support only. - dual-role mode if kernel have both usb host and usbgadget support. Signed-off-by: Thomas Richard Link: https://github.com/openwrt/openwrt/pull/19246 Signed-off-by: Hauke Mehrtens --- package/kernel/linux/modules/usb.mk | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk index d3b37311bc..af9346775e 100644 --- a/package/kernel/linux/modules/usb.mk +++ b/package/kernel/linux/modules/usb.mk @@ -508,17 +508,28 @@ $(eval $(call KernelPackage,usb-cdns3)) define KernelPackage/usb-dwc3 + SUBMENU:=$(USB_MENU) TITLE:=DWC3 USB controller driver + DEPENDS:=+USB_GADGET_SUPPORT:kmod-usb-gadget \ + +USB_SUPPORT:kmod-usb-core \ + +kmod-usb-roles KCONFIG:= \ CONFIG_USB_DWC3 \ - CONFIG_USB_DWC3_HOST=y \ - CONFIG_USB_DWC3_GADGET=n \ - CONFIG_USB_DWC3_DUAL_ROLE=n \ CONFIG_USB_DWC3_DEBUG=n \ CONFIG_USB_DWC3_VERBOSE=n +ifeq ($(CONFIG_USB_SUPPORT)$(CONFIG_USB_GADGET_SUPPORT),yy) + KCONFIG+= \ + CONFIG_USB_DWC3_HOST=n \ + CONFIG_USB_DWC3_GADGET=n \ + CONFIG_USB_DWC3_DUAL_ROLE=y +else + KCONFIG+= \ + CONFIG_USB_DWC3_HOST=$(if $(CONFIG_USB_SUPPORT),y,n) \ + CONFIG_USB_DWC3_GADGET=$(if $(CONFIG_USB_GADGET_SUPPORT),y,n) \ + CONFIG_USB_DWC3_DUAL_ROLE=n +endif FILES:= $(LINUX_DIR)/drivers/usb/dwc3/dwc3.ko AUTOLOAD:=$(call AutoLoad,54,dwc3,1) - $(call AddDepends/usb) endef define KernelPackage/usb-dwc3/description From 96be6d4f8a9195a45aafbfb19047d1525206581e Mon Sep 17 00:00:00 2001 From: Thomas Richard Date: Fri, 27 Jun 2025 16:08:42 +0200 Subject: [PATCH 08/21] kernel: usb: fix dependencies for kmod-cdns3 and kmod-cdns The cdns3 driver can be built without usb host mode support. Fix dependencies to handle the case it is built with only gadget support. Signed-off-by: Thomas Richard Link: https://github.com/openwrt/openwrt/pull/19246 Signed-off-by: Hauke Mehrtens --- package/kernel/linux/modules/usb.mk | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk index af9346775e..8bf070a047 100644 --- a/package/kernel/linux/modules/usb.mk +++ b/package/kernel/linux/modules/usb.mk @@ -470,13 +470,15 @@ $(eval $(call KernelPackage,usb-dwc2-pci)) define KernelPackage/usb-cdns + SUBMENU:=$(USB_MENU) TITLE:=Cadence USB USB controller driver - DEPENDS:=+USB_GADGET_SUPPORT:kmod-usb-gadget +kmod-usb-roles + DEPENDS:=+USB_GADGET_SUPPORT:kmod-usb-gadget \ + +USB_SUPPORT:kmod-usb-core \ + +kmod-usb-roles KCONFIG:= \ CONFIG_USB_CDNS_SUPPORT FILES:= $(LINUX_DIR)/drivers/usb/cdns3/cdns-usb-common.ko AUTOLOAD:=$(call AutoLoad,50,cdns-usb-common,1) - $(call AddDepends/usb) endef define KernelPackage/usb-cdns/description @@ -488,15 +490,15 @@ $(eval $(call KernelPackage,usb-cdns)) define KernelPackage/usb-cdns3 + SUBMENU:=$(USB_MENU) TITLE:=Cadence USB3 USB controller driver DEPENDS:=+kmod-usb-cdns KCONFIG:= \ CONFIG_USB_CDNS3 \ - CONFIG_USB_CDNS3_GADGET=y \ - CONFIG_USB_CDNS3_HOST=y + CONFIG_USB_CDNS3_GADGET=$(if $(CONFIG_USB_GADGET_SUPPORT),y,n) \ + CONFIG_USB_CDNS3_HOST=$(if $(CONFIG_USB_SUPPORT),y,n) FILES:= $(LINUX_DIR)/drivers/usb/cdns3/cdns3.ko AUTOLOAD:=$(call AutoLoad,54,cdns3,1) - $(call AddDepends/usb) endef define KernelPackage/usb-cdns3/description From 2fea2ede6340650052cb9688bdea4592df7f551a Mon Sep 17 00:00:00 2001 From: Andrii Kuiukoff Date: Sat, 26 Jul 2025 16:34:22 +0300 Subject: [PATCH 09/21] mediatek: add support for CreatLentem CLT-R30B1 CreatLentem CLT-R30B1 is a wireless WiFi 6 router. This device uses the CLT-R30B1_0824_V1.1 board shared by EDUP RT2980, Dragonglass DXG21, and other diamond-shaped 5-antenna routers. Specification ------------- - SoC : MediaTek MT7981B dual-core ARM Cortex-A53 1.3 GHz - RAM : DDR3 256 MiB - Flash : SPI-NAND 128 MiB (ESMT F50L1G41LB) - WLAN : MediaTek MT7976CN dual-band WiFi 6 - 2.4 GHz : b/g/n/ax, MU-MIMO (2x 5 dBi antennas) - 5 GHz : a/n/ac/ax, MU-MIMO (3x 5 dBi antennas) - Ethernet : - LAN x3 : 10/100/1000 Mbps (MediaTek MT7531AE) - WAN x1 : 10/100/1000 Mbps (MT7981 internal PHY) - UART : through-hole on PCB - assignment : (RX), (TX), (GND), [3.3V] - settings : 115200n8 - Buttons x2 : Mesh/WPS, Reset - LEDs x2 : Status (Red, Green) - Power : 12 VDC, 1 A, 2.1*5.5 mm Important notes --------------- The device is supplied in two variants. The main difference is the size of the mtd5 (ubi) partition in the flash layout: 64M or 112M. 112M version: Has ImmortalWrt firmware installed with LuCI WebUI. 64M version: Has stock firmware based on OpenWrt, with the WaveLink/GL.iNet WebUI and older U-Boot compared to the 112M version. Flash instructions for 112M version ----------------------------------- Follow the standard OpenWrt sysupgrade procedure without saving data. Use the clt-r30b1-112m-squashfs-sysupgrade.bin image. All checks should pass - don't proceed if a "not supported" warning is issued. Flash instructions for 64M version ---------------------------------- WebUI Method: 1. Prepare the upgrade image with clt-r30b1-squashfs-sysupgrade.bin using the script: make_staged_upgrade_tar.sh or use the prepared image: staged_openwrt_upgrade.bin Downloaded from: https://github.com/andros-ua/owrt-misc/tree/main/clt-r30b1 2. Install the prepared image using the stock WebUI update page. 3. Press and hold the reset button after reboot to wipe the stock config and gain access. SSH Method: 1. Connect via SSH using dg:ivanlee credentials. 2. Upload the clt-r30b1-squashfs-sysupgrade.bin image. 3. Use the command: sysupgrade -n All checks should pass - don't proceed if a "not supported" warning is issued. Return to stock --------------- Flash a backup of the ubi mtdblock (mtd5) using the OpenWrt sysupgrade method. Recovery -------- Both variants: Connect UART and use the U-Boot menu to flash the firmware image or boot an OpenWrt initramfs image. 112M with newer U-Boot: Power on the router while pressing the mesh button for 3 seconds. The U-Boot Flash WebUI will be available at http://192.168.1.1 MAC Addresses: ------------------------------------------------------- | Interface | MAC | Source | ---------------|-------------------|------------------- | LAN | B4:4D:43:D1:xx:xx | Factory, 0x2A | | WAN | B4:4D:43:D1:xx:xx | Factory, 0x24 | | WLAN 2.4 GHz | B4:4D:43:D2:xx:xx | Factory, 0x4 | | WLAN 5 GHz | B4:4D:43:D2:xx:xx | Factory, 0x4 + 1 | ------------------------------------------------------- Signed-off-by: Andrii Kuiukoff Link: https://github.com/openwrt/openwrt/pull/19534 Signed-off-by: Hauke Mehrtens --- .../mt7981b-creatlentem-clt-r30b1-112m.dts | 15 + .../mt7981b-creatlentem-clt-r30b1-common.dtsi | 273 ++++++++++++++++++ .../dts/mt7981b-creatlentem-clt-r30b1.dts | 20 ++ .../filogic/base-files/etc/board.d/02_network | 2 + .../base-files/lib/upgrade/platform.sh | 2 + target/linux/mediatek/image/filogic.mk | 35 +++ 6 files changed, 347 insertions(+) create mode 100644 target/linux/mediatek/dts/mt7981b-creatlentem-clt-r30b1-112m.dts create mode 100644 target/linux/mediatek/dts/mt7981b-creatlentem-clt-r30b1-common.dtsi create mode 100644 target/linux/mediatek/dts/mt7981b-creatlentem-clt-r30b1.dts diff --git a/target/linux/mediatek/dts/mt7981b-creatlentem-clt-r30b1-112m.dts b/target/linux/mediatek/dts/mt7981b-creatlentem-clt-r30b1-112m.dts new file mode 100644 index 0000000000..36351565eb --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-creatlentem-clt-r30b1-112m.dts @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7981b-creatlentem-clt-r30b1-common.dtsi" + +/ { + model = "CreatLentem CLT-R30B1 (112M)"; + compatible = "creatlentem,clt-r30b1-112m", "mediatek,mt7981"; +}; + +&partitions { + partition@580000 { + label = "ubi"; + reg = <0x0580000 0x7000000>; + }; +}; diff --git a/target/linux/mediatek/dts/mt7981b-creatlentem-clt-r30b1-common.dtsi b/target/linux/mediatek/dts/mt7981b-creatlentem-clt-r30b1-common.dtsi new file mode 100644 index 0000000000..90d9ea04a1 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-creatlentem-clt-r30b1-common.dtsi @@ -0,0 +1,273 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include +#include +#include + +#include "mt7981b.dtsi" + +/ { + aliases { + led-boot = &led_status_red; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_status_green; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + gpio-keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + wps { + label = "wps"; + linux,code = ; + gpios = <&pio 0 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status_green: green { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&pio 11 GPIO_ACTIVE_LOW>; + }; + + led_status_red: red { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&pio 12 GPIO_ACTIVE_LOW>; + }; + }; + + memory { + reg = <0 0x40000000 0 0x10000000>; + }; +}; + +ð { + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_factory_24 0>; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + label = "wan"; + phy-mode = "gmii"; + phy-handle = <&int_gbe_phy>; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_factory_2a 0>; + }; + +}; + +&mdio_bus { + switch: switch@1f { + compatible = "mediatek,mt7531"; + reg = <31>; + 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@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spi-nand"; + reg = <0>; + + spi-max-frequency = <52000000>; + spi-tx-bus-width = <4>; + spi-rx-bus-width = <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 = <0x0 0x100000>; + read-only; + }; + + partition@100000 { + label = "u-boot-env"; + reg = <0x100000 0x80000>; + }; + + 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 { + reg = <0x4 0x6>; + compatible = "mac-base"; + #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>; + }; + }; + }; + + partition@380000 { + label = "FIP"; + reg = <0x380000 0x200000>; + read-only; + }; + }; + }; +}; + + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan1"; + }; + + port@1 { + reg = <1>; + label = "lan2"; + }; + + port@2 { + reg = <2>; + label = "lan3"; + }; + + 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 { + #address-cells = <1>; + #size-cells = <0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; + status = "okay"; + + 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/dts/mt7981b-creatlentem-clt-r30b1.dts b/target/linux/mediatek/dts/mt7981b-creatlentem-clt-r30b1.dts new file mode 100644 index 0000000000..941d0c3435 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-creatlentem-clt-r30b1.dts @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7981b-creatlentem-clt-r30b1-common.dtsi" + +/ { + model = "CreatLentem CLT-R30B1"; + compatible = "creatlentem,clt-r30b1", "mediatek,mt7981"; +}; + +&partitions { + partition@580000 { + label = "ubi"; + reg = <0x0580000 0x4000000>; + }; + partition@4580000 { + label = "data"; + reg = <0x4580000 0x2000000>; + }; + +}; 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 1f9d3c551c..64efde9155 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 @@ -39,6 +39,8 @@ mediatek_setup_interfaces() cmcc,a10-stock|\ cmcc,a10-ubootmod|\ confiabits,mt7981|\ + creatlentem,clt-r30b1|\ + creatlentem,clt-r30b1-112m|\ cudy,wr3000-v1|\ jcg,q30-pro|\ keenetic,kn-3811|\ 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 8138b8c0c7..4f29f2be42 100755 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -256,6 +256,8 @@ platform_check_image() { fit_check_image "$1" return $? ;; + creatlentem,clt-r30b1|\ + creatlentem,clt-r30b1-112m|\ nradio,c8-668gl) # tar magic `ustar` magic="$(dd if="$1" bs=1 skip=257 count=5 2>/dev/null)" diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 2e03bb8e7e..b1c3398014 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -711,6 +711,41 @@ define Device/confiabits_mt7981 endef TARGET_DEVICES += confiabits_mt7981 +define Device/creatlentem_clt-r30b1-common + DEVICE_VENDOR := CreatLentem + DEVICE_MODEL := CLT-R30B1 + DEVICE_ALT0_VENDOR := EDUP + DEVICE_ALT0_MODEL := RT2980 + DEVICE_ALT1_VENDOR := Dragonglass + DEVICE_ALT1_MODEL := DXG21 + 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 + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef + +define Device/creatlentem_clt-r30b1-112m + DEVICE_VARIANT := 112M + DEVICE_ALT0_VARIANT := 112M + DEVICE_ALT1_VARIANT := 112M + DEVICE_DTS := mt7981b-creatlentem-clt-r30b1-112m + SUPPORTED_DEVICES += clt,r30b1 clt,r30b1-112m + IMAGE_SIZE := 114688k + $(call Device/creatlentem_clt-r30b1-common) +endef +TARGET_DEVICES += creatlentem_clt-r30b1-112m + +define Device/creatlentem_clt-r30b1 + DEVICE_DTS := mt7981b-creatlentem-clt-r30b1 + SUPPORTED_DEVICES += mediatek,mt7981-spim-snand-rfb + IMAGE_SIZE := 65536k + $(call Device/creatlentem_clt-r30b1-common) +endef +TARGET_DEVICES += creatlentem_clt-r30b1 + define Device/cudy_ap3000outdoor-v1 DEVICE_VENDOR := Cudy DEVICE_MODEL := AP3000 Outdoor From ebee9462273d3d30dbd29434e4f715ce39f80efc Mon Sep 17 00:00:00 2001 From: Coia Prant Date: Sun, 26 Jan 2025 03:40:58 +0800 Subject: [PATCH 10/21] ramips: add support for Hongdian H7920 v40 This is an industrial 4G router equipped with OpenWrt SNAPSHOT OEM customized version WARNING: The original firmware device tree is modified from evb boards, and the device tree name is evb board. This submitted device tree is a modified version, which deletes the non-this-device parts and adds GPIO watchdog. Specification: - SoC: MediaTek MT7628NN - Flash: 16 MB - RAM: 128 MB - Power: DC 5V-36V 1.5A - Ethernet: 1x WAN [slot not install], 1x LAN (10/100 Mbps) - Wireless radio: 802.11n 2.4g-only [antenna not install] - LED: System/Power (RUN): GPIO/37 active-low Modem: GPIO/3 active-low RF (Modem Signal): GPIO/2 active-low - Button: WPS / RESET: GPIO/11 active-low - UART: 1x UART on PCB - 115200 8N1 - Serial / COM: 1X RS232/RS485 on board (GPIO/6 hi:RS485 lo:RS232) - GPIO Watchdog: GPIO/0 mode=toggle timeout=1s - Modem: 1x Built-in modem on board (Power: GPIO/4 active-high) - PCIe: 1x miniPCIe for modem [slot not install] - SIM Slots: 1x SIM Slots Issue: - Factory partition not store mac address on original firmware Flash instruction: Using SSH/Telnet: 1. Connect the board to the computer via RJ45 Ethernet 2. Login 192.168.8.1 with root password "superzxmn" (SSH Port 22, Telnet Port 5188) 3. Download openwrt firmware on the computer. 4. Use scp or sftp put firmware to board /tmp 5. Use command "mtd -r write openwrt-ramips-mt76x8-hongdian_h7920-v40-squashfs-sysupgrade.bin firmware" to flash Original Firmware Dump / More details: https://blog.gov.cooking/archives/research-hongdian-h7920-v40-and-flash.html Signed-off-by: Coia Prant Tested-by: Coia Prant Link: https://github.com/openwrt/openwrt/pull/17726 Signed-off-by: Hauke Mehrtens --- .../dts/mt7628an_hongdian_h7920-v40.dts | 171 ++++++++++++++++++ target/linux/ramips/image/mt76x8.mk | 9 + .../mt76x8/base-files/etc/board.d/02_network | 2 + .../base-files/etc/board.d/03_gpio_switches | 4 + 4 files changed, 186 insertions(+) create mode 100644 target/linux/ramips/dts/mt7628an_hongdian_h7920-v40.dts diff --git a/target/linux/ramips/dts/mt7628an_hongdian_h7920-v40.dts b/target/linux/ramips/dts/mt7628an_hongdian_h7920-v40.dts new file mode 100644 index 0000000000..76c395c382 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_hongdian_h7920-v40.dts @@ -0,0 +1,171 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7628an.dtsi" + +#include +#include +#include + +/ { + compatible = "hongdian,h7920-v40", "mediatek,mt7628an-soc"; + model = "Hongdian H7920 v40"; + + aliases { + led-boot = &led_sys; + led-failsafe = &led_sys; + led-running = &led_sys; + led-upgrade = &led_sys; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + leds { + compatible = "gpio-leds"; + + led-rf { + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + color = ; + function = "rf"; + }; + + led-net { + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_MOBILE; + }; + + led_sys: led-sys { + gpios = <&gpio 37 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_POWER; + default-state = "on"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + hw_algo = "toggle"; + hw_margin_ms = <600>; + always-running; + }; + + gpio-export { + compatible = "gpio-export"; + + gpio_modem_power { + gpio-export,name = "modem_power"; + gpio-export,output = <0>; + gpios = <&gpio 4 GPIO_ACTIVE_HIGH>; + }; + + gpio_serial_rs485_mode { + gpio-export,name = "serial_rs485_mode"; + gpio-export,output = <0>; + gpios = <&gpio 6 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&watchdog { + status = "disabled"; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "i2s", "gpio", "refclk"; + function = "gpio"; + }; +}; + +ðernet { + nvmem-cells = <&macaddr_factory_28>; + nvmem-cell-names = "mac-address"; +}; + +&esw { + mediatek,portmap = <0x3e>; + mediatek,portdisable = <0x3c>; +}; + +&wmac { + status = "okay"; + + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; +}; + +&uart1 { + status = "okay"; +}; + +&pcie { + status = "okay"; +}; diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 147acb81b7..ccd2c1ff23 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -339,6 +339,15 @@ define Device/hiwifi_hc5861b endef TARGET_DEVICES += hiwifi_hc5861b +define Device/hongdian_h7920-v40 + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Hongdian + DEVICE_MODEL := H7920 + DEVICE_VARIANT := v40 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi +endef +TARGET_DEVICES += hongdian_h7920-v40 + define Device/iptime_a3 IMAGE_SIZE := 7936k UIMAGE_NAME := a3 diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index 7bcd270982..76993a528a 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -109,6 +109,7 @@ ramips_setup_interfaces() ;; duzun,dm06|\ glinet,gl-mt300n-v2|\ + hongdian,h7920-v40|\ teltonika,rut200|\ teltonika,rut241) ucidef_add_switch "switch0" \ @@ -299,6 +300,7 @@ ramips_setup_macs() totolink,a3) wan_mac=$(mtd_get_mac_binary u-boot 0x1fc40) ;; + hongdian,h7920-v40|\ jotale,js76x8-8m|\ jotale,js76x8-16m|\ jotale,js76x8-32m|\ diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/03_gpio_switches b/target/linux/ramips/mt76x8/base-files/etc/board.d/03_gpio_switches index fc9f20d9d2..3277e1c882 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/03_gpio_switches @@ -9,6 +9,10 @@ board_config_update board=$(board_name) case "$board" in +hongdian,h7920-v40) + ucidef_add_gpio_switch "modem_enable" "Modem power" "modem_power" "1" + ucidef_add_gpio_switch "switch_serial_mode" "Switch RS232 to RS485" "serial_rs485_mode" "0" + ;; teltonika,rut200|\ teltonika,rut241) ucidef_add_gpio_switch "digital_output" "Digital output" "digital_output" "0" From 8eea85584633d6cf70c8a043629e09b1781d90f5 Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Wed, 6 Aug 2025 01:54:29 -0400 Subject: [PATCH 11/21] realtek: switch Zyxel GS1900 initramfs recipe to rt-loader These devices need a tiny (<8MB) initramfs. There are first occurrences where this fails with newer kernels and diagnostic packages. Switch the recipe over to use lzma compression and rt-loader. Signed-off-by: Markus Stockhausen Link: https://github.com/openwrt/openwrt/pull/19687 Signed-off-by: Hauke Mehrtens --- target/linux/realtek/image/common.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/linux/realtek/image/common.mk b/target/linux/realtek/image/common.mk index d68915ea90..39c97cd845 100644 --- a/target/linux/realtek/image/common.mk +++ b/target/linux/realtek/image/common.mk @@ -86,8 +86,9 @@ define Device/zyxel_gs1900 KERNEL_INITRAMFS := \ kernel-bin | \ append-dtb | \ - libdeflate-gzip | \ + rt-compress | \ zyxel-vers | \ - uImage gzip | \ + rt-loader | \ + uImage none | \ check-size 6976k endef From 3aee42001f493952b72a2ef3cd458bf9417c8940 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 8 Aug 2025 18:18:49 +0200 Subject: [PATCH 12/21] wifi-scripts: add modular wps button handler scripts Execute scripts in /etc/rc.wps until one of them returns a exit code of 0. Split up sta and ap handling of wps into separate scripts. Signed-off-by: Felix Fietkau --- .../wifi-scripts/files/etc/rc.button/wps | 6 +++ .../wifi-scripts/files/etc/rc.wps/40-wps_ap | 10 +++++ .../wifi-scripts/files/etc/rc.wps/50-wps_sta} | 42 +++++++------------ package/network/services/hostapd/Makefile | 2 - 4 files changed, 31 insertions(+), 29 deletions(-) create mode 100755 package/network/config/wifi-scripts/files/etc/rc.button/wps create mode 100755 package/network/config/wifi-scripts/files/etc/rc.wps/40-wps_ap rename package/network/{services/hostapd/files/wps-hotplug.sh => config/wifi-scripts/files/etc/rc.wps/50-wps_sta} (52%) mode change 100644 => 100755 diff --git a/package/network/config/wifi-scripts/files/etc/rc.button/wps b/package/network/config/wifi-scripts/files/etc/rc.button/wps new file mode 100755 index 0000000000..59b1aeff17 --- /dev/null +++ b/package/network/config/wifi-scripts/files/etc/rc.button/wps @@ -0,0 +1,6 @@ +#!/bin/sh +[ "$ACTION" = "pressed" ] && exit 5 +for script in /etc/rc.wps/*; do + [ -x "$script" ] || continue + "$script" && break +done diff --git a/package/network/config/wifi-scripts/files/etc/rc.wps/40-wps_ap b/package/network/config/wifi-scripts/files/etc/rc.wps/40-wps_ap new file mode 100755 index 0000000000..2cb7f6bec6 --- /dev/null +++ b/package/network/config/wifi-scripts/files/etc/rc.wps/40-wps_ap @@ -0,0 +1,10 @@ +#!/bin/sh + +[ "$SEEN" -ge 3 ] && exit 1 +wps_done=0 +ubusobjs="$( ubus -S list hostapd.* )" +for ubusobj in $ubusobjs; do + ubus -S call $ubusobj wps_start && wps_done=1 +done +[ $wps_done = 1 ] + diff --git a/package/network/services/hostapd/files/wps-hotplug.sh b/package/network/config/wifi-scripts/files/etc/rc.wps/50-wps_sta old mode 100644 new mode 100755 similarity index 52% rename from package/network/services/hostapd/files/wps-hotplug.sh rename to package/network/config/wifi-scripts/files/etc/rc.wps/50-wps_sta index 073bdd1868..67a21e357a --- a/package/network/services/hostapd/files/wps-hotplug.sh +++ b/package/network/config/wifi-scripts/files/etc/rc.wps/50-wps_sta @@ -1,4 +1,6 @@ #!/bin/sh +[ "$SEEN" -lt 3 ] && exit 1 +[ "$ACTION" = "released" ] || exit 1 wps_catch_credentials() { local iface ifaces ifc ifname ssid encryption key radio radios @@ -38,32 +40,18 @@ wps_catch_credentials() { done } -if [ "$ACTION" = "released" ] && [ "$BUTTON" = "wps" ]; then - # If the button was pressed for 3 seconds or more, trigger WPS on - # wpa_supplicant only, no matter if hostapd is running or not. If - # was pressed for less than 3 seconds, try triggering on - # hostapd. If there is no hostapd instance to trigger it on or WPS - # is not enabled on them, trigger it on wpa_supplicant. - if [ "$SEEN" -lt 3 ] ; then - wps_done=0 - ubusobjs="$( ubus -S list hostapd.* )" - for ubusobj in $ubusobjs; do - ubus -S call $ubusobj wps_start && wps_done=1 - done - [ $wps_done = 0 ] || return 0 +wps_done=0 +ubusobjs="$( ubus -S list wpa_supplicant.* )" +for ubusobj in $ubusobjs; do + ifname="$(echo $ubusobj | cut -d'.' -f2 )" + multi_ap="" + if [ -e "/var/run/wpa_supplicant-${ifname}.conf.is_multiap" ]; then + ubus -S call $ubusobj wps_start '{ "multi_ap": true }' && wps_done=1 + else + ubus -S call $ubusobj wps_start && wps_done=1 fi - wps_done=0 - ubusobjs="$( ubus -S list wpa_supplicant.* )" - for ubusobj in $ubusobjs; do - ifname="$(echo $ubusobj | cut -d'.' -f2 )" - multi_ap="" - if [ -e "/var/run/wpa_supplicant-${ifname}.conf.is_multiap" ]; then - ubus -S call $ubusobj wps_start '{ "multi_ap": true }' && wps_done=1 - else - ubus -S call $ubusobj wps_start && wps_done=1 - fi - done - [ $wps_done = 0 ] || wps_catch_credentials & -fi +done +[ $wps_done = 0 ] && exit 1 -return 0 +wps_catch_credentials & +exit 0 diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index cdaf636c4a..4522eec8d4 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -726,14 +726,12 @@ endef define Package/hostapd-common/install $(INSTALL_DIR) \ $(1)/etc/capabilities \ - $(1)/etc/rc.button \ $(1)/etc/hotplug.d/ieee80211 \ $(1)/etc/init.d $(1)/lib/netifd \ $(1)/usr/share/acl.d \ $(1)/usr/share/hostap $(INSTALL_BIN) ./files/dhcp-get-server.sh $(1)/lib/netifd/dhcp-get-server.sh $(INSTALL_BIN) ./files/wpad.init $(1)/etc/init.d/wpad - $(INSTALL_BIN) ./files/wps-hotplug.sh $(1)/etc/rc.button/wps $(INSTALL_DATA) ./files/wpad_acl.json $(1)/usr/share/acl.d $(INSTALL_DATA) ./files/wpad.json $(1)/etc/capabilities endef From f650f2975c073e9e15540fa7db91c50e2df77135 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 9 Aug 2025 09:24:42 +0200 Subject: [PATCH 13/21] netifd: add missing dependencies Fixes: https://github.com/openwrt/openwrt/issues/19704 Signed-off-by: Felix Fietkau --- package/network/config/netifd/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile index 0677d36da0..bc82ea70dd 100644 --- a/package/network/config/netifd/Makefile +++ b/package/network/config/netifd/Makefile @@ -21,7 +21,8 @@ include $(INCLUDE_DIR)/cmake.mk define Package/netifd SECTION:=base CATEGORY:=Base system - DEPENDS:=+libuci +libnl-tiny +libubus +ubus +ubusd +jshn +libubox +libudebug +ucode +ucode-mod-fs + DEPENDS:=+libuci +libnl-tiny +libubus +ubus +ubusd +jshn +libubox +libudebug \ + +ucode +ucode-mod-fs +ucode-mod-ubus +ucode-mod-uloop +ucode-mod-uci TITLE:=OpenWrt Network Interface Configuration Daemon endef From 7df4f7d7094e05468deb91ee43fbf0bec70a35cc Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 9 Aug 2025 15:56:11 +0200 Subject: [PATCH 14/21] rpcd: update to Git HEAD (2025-08-09) 1905e096a8b7 ucode: adjust for new ext resource type Fixes: https://github.com/openwrt/rpcd/issues/17 Fixes: https://github.com/openwrt/luci/issues/7878 Fixes: https://github.com/openwrt/openwrt/issues/19726 Signed-off-by: Felix Fietkau --- package/system/rpcd/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/system/rpcd/Makefile b/package/system/rpcd/Makefile index a885da0543..aecd21e367 100644 --- a/package/system/rpcd/Makefile +++ b/package/system/rpcd/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rpcd -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/rpcd.git -PKG_MIRROR_HASH:=51c77637b65dd3dbd0d39f902223678d190fb409a1293ac92bd5665ac790cab4 -PKG_SOURCE_DATE:=2025-06-22 -PKG_SOURCE_VERSION:=9389775ceb4702c82bd62b79cf17b0359c63e527 +PKG_MIRROR_HASH:=1628372b214012b2c1c686d03692ee84e04e033669a0269a06de6dac4d20e974 +PKG_SOURCE_DATE:=2025-08-09 +PKG_SOURCE_VERSION:=1905e096a8b722e67733cd4088026f571b27e521 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=ISC From 886c4f054e5e34bc3de23d65da76180eea358c4a Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 9 Aug 2025 16:47:45 +0200 Subject: [PATCH 15/21] mac80211: fix division by zero in expected throughput estimation Fixes: https://github.com/openwrt/openwrt/issues/19729 Fixes: f10732fb5632 ("mac80211: estimate expected throughput if not provided by driver/rc") Signed-off-by: Felix Fietkau --- ...c80211-estimate-expected-throughput-if-not-provide.patch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package/kernel/mac80211/patches/subsys/361-mac80211-estimate-expected-throughput-if-not-provide.patch b/package/kernel/mac80211/patches/subsys/361-mac80211-estimate-expected-throughput-if-not-provide.patch index 9bcaf86504..81cff9e7e8 100644 --- a/package/kernel/mac80211/patches/subsys/361-mac80211-estimate-expected-throughput-if-not-provide.patch +++ b/package/kernel/mac80211/patches/subsys/361-mac80211-estimate-expected-throughput-if-not-provide.patch @@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c -@@ -2621,6 +2621,27 @@ static inline u64 sta_get_stats_bytes(st +@@ -2621,6 +2621,29 @@ static inline u64 sta_get_stats_bytes(st return value; } @@ -33,6 +33,8 @@ Signed-off-by: Felix Fietkau + + duration = ieee80211_rate_expected_tx_airtime(hw, NULL, ri, band, true, 1024); + duration += duration >> 4; /* add assumed packet error rate of ~6% */ ++ if (!duration) ++ return 0; + + return ((1024 * USEC_PER_SEC) / duration) * 8; +} @@ -40,7 +42,7 @@ Signed-off-by: Felix Fietkau void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo, bool tidstats) { -@@ -2865,6 +2886,8 @@ void sta_set_sinfo(struct sta_info *sta, +@@ -2865,6 +2888,8 @@ void sta_set_sinfo(struct sta_info *sta, sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_TDLS_PEER); thr = sta_get_expected_throughput(sta); From aa0b5eb429fe62c6fae10d552be5e2461a40a5ab Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 10 Aug 2025 10:17:12 +0200 Subject: [PATCH 16/21] wifi-scripts: ucode: fix unencrypted sta connection add missing key_mgmt option Fixes: https://github.com/openwrt/openwrt/issues/17578 Signed-off-by: Felix Fietkau --- .../wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc index f2d51ed349..1c41e3c396 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc @@ -159,6 +159,8 @@ function setup_sta(data, config) { config.group = 'GCMP'; } + config.key_mgmt ??= 'NONE'; + config.basic_rate = ratelist(config.basic_rate); config.mcast_rate = ratestr(config.mcast_rate); From 7bc227b82d8cb0ce2d9f7262efba435b6cc6fb58 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Fri, 8 Aug 2025 14:31:18 +0200 Subject: [PATCH 17/21] gcc: 15.x: update to 15.2 Update GCC15 to 15.2 to include upstream bugfixes. Link: https://github.com/openwrt/openwrt/pull/19713 Signed-off-by: Robert Marko --- toolchain/gcc/Config.version | 2 +- toolchain/gcc/common.mk | 4 ++-- toolchain/gcc/patches-15.x/910-mbsd_multi.patch | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/toolchain/gcc/Config.version b/toolchain/gcc/Config.version index 34e8c17786..063a2dc9ce 100644 --- a/toolchain/gcc/Config.version +++ b/toolchain/gcc/Config.version @@ -15,7 +15,7 @@ config GCC_VERSION default EXTERNAL_GCC_VERSION if EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN default "12.3.0" if GCC_VERSION_12 default "13.3.0" if GCC_VERSION_13 - default "15.1.0" if GCC_VERSION_15 + default "15.2.0" if GCC_VERSION_15 default "14.3.0" config GCC_USE_DEFAULT_VERSION diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk index 23e337dc2f..3c1167724e 100644 --- a/toolchain/gcc/common.mk +++ b/toolchain/gcc/common.mk @@ -46,8 +46,8 @@ ifeq ($(PKG_VERSION),14.3.0) PKG_HASH:=e0dc77297625631ac8e50fa92fffefe899a4eb702592da5c32ef04e2293aca3a endif -ifeq ($(PKG_VERSION),15.1.0) - PKG_HASH:=e2b09ec21660f01fecffb715e0120265216943f038d0e48a9868713e54f06cea +ifeq ($(PKG_VERSION),15.2.0) + PKG_HASH:=438fd996826b0c82485a29da03a72d71d6e3541a83ec702df4271f6fe025d24e endif PATCH_DIR=../patches-$(GCC_MAJOR_VERSION).x diff --git a/toolchain/gcc/patches-15.x/910-mbsd_multi.patch b/toolchain/gcc/patches-15.x/910-mbsd_multi.patch index c5462e12c8..4b29ac01cc 100644 --- a/toolchain/gcc/patches-15.x/910-mbsd_multi.patch +++ b/toolchain/gcc/patches-15.x/910-mbsd_multi.patch @@ -40,7 +40,7 @@ Date: Tue Jul 31 00:52:27 2007 +0000 case OPT_fconstant_string_class_: constant_string_class_name = arg; break; -@@ -1359,6 +1368,47 @@ c_common_init (void) +@@ -1361,6 +1370,47 @@ c_common_init (void) return false; } From 7cf7f7c6b9091cd70024ee8cf680b970a21bf91c Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Thu, 7 Aug 2025 02:11:51 -0400 Subject: [PATCH 18/21] realtek: add NAND targets for RTL93xx Some known RTL93xx devices like the Linksys LGS328C or LGS352C are NAND based. These require additional drivers and packages (e.g. UBI). The current subtargets are already taylored down for devices with only 16MB flash. Adding features that are not used will only make the storage situation more complicated. Add two new subtargets for RTL93xx that include the basic NAND, UBI and MTD features. To achieve this do the following: - Create new subtarget folders - Copy the existing config and makefiles over - Add the basic additional features - Mark them as SOURCE-ONLY - Add empty image makefiles - Remove unneded NAND/MTD features from existing configs Signed-off-by: Markus Stockhausen Link: https://github.com/openwrt/openwrt/pull/19700 Signed-off-by: Robert Marko --- target/linux/realtek/Makefile | 4 +- target/linux/realtek/image/rtl930x_nand.mk | 1 + target/linux/realtek/image/rtl931x_nand.mk | 1 + target/linux/realtek/rtl930x/config-6.12 | 4 +- target/linux/realtek/rtl930x_nand/config-6.12 | 260 +++++++++++++++++ target/linux/realtek/rtl930x_nand/target.mk | 11 + target/linux/realtek/rtl931x/config-6.12 | 4 +- target/linux/realtek/rtl931x_nand/config-6.12 | 267 ++++++++++++++++++ target/linux/realtek/rtl931x_nand/target.mk | 11 + 9 files changed, 557 insertions(+), 6 deletions(-) create mode 100644 target/linux/realtek/image/rtl930x_nand.mk create mode 100644 target/linux/realtek/image/rtl931x_nand.mk create mode 100644 target/linux/realtek/rtl930x_nand/config-6.12 create mode 100644 target/linux/realtek/rtl930x_nand/target.mk create mode 100644 target/linux/realtek/rtl931x_nand/config-6.12 create mode 100644 target/linux/realtek/rtl931x_nand/target.mk diff --git a/target/linux/realtek/Makefile b/target/linux/realtek/Makefile index 5cd62e7c04..c9bfb880a3 100644 --- a/target/linux/realtek/Makefile +++ b/target/linux/realtek/Makefile @@ -7,12 +7,12 @@ BOARD:=realtek BOARDNAME:=Realtek MIPS DEVICE_TYPE:=basic FEATURES:=ramdisk squashfs -SUBTARGETS:=rtl838x rtl839x rtl930x rtl931x +SUBTARGETS:=rtl838x rtl839x rtl930x rtl930x_nand rtl931x rtl931x_nand KERNEL_PATCHVER:=6.12 define Target/Description - Build firmware images for Realtek RTL83xx based boards. + Build firmware images for Realtek RTL83xx/RTL93xx based boards. endef include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/realtek/image/rtl930x_nand.mk b/target/linux/realtek/image/rtl930x_nand.mk new file mode 100644 index 0000000000..a4e40e534e --- /dev/null +++ b/target/linux/realtek/image/rtl930x_nand.mk @@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-only diff --git a/target/linux/realtek/image/rtl931x_nand.mk b/target/linux/realtek/image/rtl931x_nand.mk new file mode 100644 index 0000000000..a4e40e534e --- /dev/null +++ b/target/linux/realtek/image/rtl931x_nand.mk @@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0-only diff --git a/target/linux/realtek/rtl930x/config-6.12 b/target/linux/realtek/rtl930x/config-6.12 index 76f1907503..47779f151d 100644 --- a/target/linux/realtek/rtl930x/config-6.12 +++ b/target/linux/realtek/rtl930x/config-6.12 @@ -143,7 +143,7 @@ CONFIG_MTD_CFI_ADV_OPTIONS=y CONFIG_MTD_CFI_GEOMETRY=y CONFIG_MTD_CMDLINE_PARTS=y CONFIG_MTD_JEDECPROBE=y -CONFIG_MTD_SPI_NAND=y +# CONFIG_MTD_SPI_NAND is not set CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPLIT_BRNIMAGE_FW=y CONFIG_MTD_SPLIT_EVA_FW=y @@ -219,7 +219,7 @@ CONFIG_SMP_UP=y CONFIG_SPI=y CONFIG_SPI_MASTER=y CONFIG_SPI_MEM=y -CONFIG_SPI_REALTEK_SNAND=y +# CONFIG_SPI_REALTEK_SNAND is not set CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y CONFIG_SWPHY=y CONFIG_SYNC_R4K=y diff --git a/target/linux/realtek/rtl930x_nand/config-6.12 b/target/linux/realtek/rtl930x_nand/config-6.12 new file mode 100644 index 0000000000..0f4294ac30 --- /dev/null +++ b/target/linux/realtek/rtl930x_nand/config-6.12 @@ -0,0 +1,260 @@ +CONFIG_AQUANTIA_PHY=y +CONFIG_ARCH_32BIT_OFF_T=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_KEEP_MEMBLOCK=y +CONFIG_ARCH_MMAP_RND_BITS_MAX=15 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15 +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=4096 +CONFIG_BOARD_SCACHE=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_COMMON_CLK=y +# CONFIG_COMMON_CLK_REALTEK is not set +CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 +CONFIG_COMPAT_32BIT_TIME=y +CONFIG_CONSOLE_LOGLEVEL_DEFAULT=15 +CONFIG_CPU_BIG_ENDIAN=y +CONFIG_CPU_GENERIC_DUMP_TLB=y +CONFIG_CPU_HAS_DIEI=y +CONFIG_CPU_HAS_PREFETCH=y +CONFIG_CPU_HAS_RIXI=y +CONFIG_CPU_HAS_SYNC=y +CONFIG_CPU_MIPS32=y +# CONFIG_CPU_MIPS32_R1 is not set +CONFIG_CPU_MIPS32_R2=y +CONFIG_CPU_MIPSR2=y +CONFIG_CPU_MIPSR2_IRQ_VI=y +CONFIG_CPU_MIPSR2_IRQ_EI=y +CONFIG_CPU_MITIGATIONS=y +CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y +CONFIG_CPU_R4K_CACHE_TLB=y +CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y +CONFIG_CPU_SUPPORTS_HIGHMEM=y +CONFIG_CPU_SUPPORTS_MSA=y +CONFIG_CRC_CCITT=y +CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y +CONFIG_CRYPTO_LIB_GF128MUL=y +CONFIG_CRYPTO_LIB_POLY1305_RSIZE=2 +CONFIG_CRYPTO_LIB_SHA1=y +CONFIG_CRYPTO_LIB_UTILS=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_SECTION_MISMATCH=y +CONFIG_DMA_NONCOHERENT=y +CONFIG_DTC=y +CONFIG_EARLY_PRINTK=y +CONFIG_EARLY_PRINTK_8250=y +CONFIG_EXCLUSIVE_SYSTEM_RAM=y +CONFIG_FIXED_PHY=y +CONFIG_FORCE_NR_CPUS=y +CONFIG_FS_IOMAP=y +CONFIG_FUNCTION_ALIGNMENT=0 +CONFIG_FWNODE_MDIO=y +CONFIG_FW_LOADER_PAGED_BUF=y +CONFIG_FW_LOADER_SYSFS=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_GETTIMEOFDAY=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IOMAP=y +CONFIG_GENERIC_IRQ_CHIP=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_LIB_ASHLDI3=y +CONFIG_GENERIC_LIB_ASHRDI3=y +CONFIG_GENERIC_LIB_CMPDI2=y +CONFIG_GENERIC_LIB_LSHRDI3=y +CONFIG_GENERIC_LIB_UCMPDI2=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_PHY=y +CONFIG_GENERIC_PINCONF=y +CONFIG_GENERIC_PINCTRL_GROUPS=y +CONFIG_GENERIC_PINMUX_FUNCTIONS=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GPIOLIB_IRQCHIP=y +CONFIG_GPIO_CDEV=y +CONFIG_GPIO_GENERIC=y +CONFIG_GPIO_PCA953X=y +CONFIG_GPIO_REALTEK_OTTO=y +CONFIG_GRO_CELLS=y +CONFIG_HARDWARE_WATCHPOINTS=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAS_IOPORT_MAP=y +CONFIG_HIGHMEM=y +CONFIG_HWMON=y +CONFIG_HZ_PERIODIC=y +CONFIG_I2C=y +CONFIG_I2C_ALGOBIT=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_GPIO=y +# CONFIG_I2C_GPIO_SHARED is not set +CONFIG_I2C_MUX=y +CONFIG_I2C_MUX_RTL9300=y +CONFIG_I2C_RTL9300=y +CONFIG_I2C_SMBUS=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_MIPS_CPU=y +CONFIG_IRQ_WORK=y +CONFIG_JFFS2_ZLIB=y +CONFIG_LEDS_GPIO=y +# CONFIG_LEDS_RTL8231 is not set +CONFIG_LIBFDT=y +CONFIG_LOCK_DEBUGGING_SUPPORT=y +CONFIG_MACH_REALTEK_RTL=y +CONFIG_MARVELL_PHY=y +CONFIG_MDIO_BUS=y +CONFIG_MDIO_DEVICE=y +CONFIG_MDIO_DEVRES=y +CONFIG_MDIO_I2C=y +CONFIG_MDIO_REALTEK_OTTO_AUX=y +CONFIG_MDIO_SMBUS=y +CONFIG_MFD_RTL8231=y +CONFIG_MFD_SYSCON=y +CONFIG_MIGRATION=y +CONFIG_MIPS=y +CONFIG_MIPS_ASID_BITS=8 +CONFIG_MIPS_ASID_SHIFT=0 +# CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER is not set +CONFIG_MIPS_CMDLINE_FROM_DTB=y +CONFIG_MIPS_CPU_SCACHE=y +CONFIG_MIPS_EXTERNAL_TIMER=y +CONFIG_MIPS_L1_CACHE_SHIFT=5 +CONFIG_MIPS_MT=y +# CONFIG_MIPS_MT_FPAFF is not set +CONFIG_MIPS_MT_SMP=y +# CONFIG_MIPS_NO_APPENDED_DTB is not set +CONFIG_MIPS_NR_CPU_NR_MAP=2 +CONFIG_MIPS_PERF_SHARED_TC_COUNTERS=y +CONFIG_MIPS_RAW_APPENDED_DTB=y +CONFIG_MIPS_SPRAM=y +CONFIG_MMU_LAZY_TLB_REFCOUNT=y +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_MTD_CFI_ADV_OPTIONS=y +CONFIG_MTD_CFI_GEOMETRY=y +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_JEDECPROBE=y +CONFIG_MTD_SPI_NAND=y +CONFIG_MTD_SPI_NOR=y +CONFIG_MTD_SPLIT_BRNIMAGE_FW=y +CONFIG_MTD_SPLIT_EVA_FW=y +CONFIG_MTD_SPLIT_FIRMWARE=y +CONFIG_MTD_SPLIT_TPLINK_FW=y +CONFIG_MTD_SPLIT_UIMAGE_FW=y +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_BEB_LIMIT=20 +CONFIG_MTD_UBI_BLOCK=y +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEED_PER_CPU_KM=y +CONFIG_NET_DEVLINK=y +CONFIG_NET_DSA=y +CONFIG_NET_DSA_RTL83XX=y +CONFIG_NET_DSA_TAG_TRAILER=y +CONFIG_NET_EGRESS=y +CONFIG_NET_FLOW_LIMIT=y +CONFIG_NET_INGRESS=y +CONFIG_NET_RTL838X=y +CONFIG_NET_SELFTESTS=y +CONFIG_NET_XGRESS=y +CONFIG_NO_EXCEPT_FILL=y +CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y +CONFIG_NR_CPUS=2 +CONFIG_NVMEM=y +CONFIG_NVMEM_LAYOUTS=y +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_PAGE_POOL=y +CONFIG_PAGE_SIZE_LESS_THAN_256KB=y +CONFIG_PAGE_SIZE_LESS_THAN_64KB=y +CONFIG_PCI_DRIVERS_LEGACY=y +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHYLIB=y +CONFIG_PHYLIB_LEDS=y +CONFIG_PHYLINK=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_RTL8231=y +CONFIG_POWER_RESET=y +CONFIG_POWER_RESET_GPIO_RESTART=y +CONFIG_POWER_RESET_SYSCON=y +CONFIG_PREEMPT_NONE_BUILD=y +CONFIG_PTP_1588_CLOCK_OPTIONAL=y +CONFIG_RANDSTRUCT_NONE=y +CONFIG_RATIONAL=y +CONFIG_REALTEK_OTTO_TIMER=y +CONFIG_REALTEK_OTTO_WDT=y +CONFIG_REALTEK_PHY=y +CONFIG_REALTEK_PHY_HWMON=y +CONFIG_REALTEK_SOC_PHY=y +CONFIG_REALTEK_THERMAL=y +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y +CONFIG_REGMAP_MDIO=y +CONFIG_REGMAP_MMIO=y +CONFIG_RESET_CONTROLLER=y +CONFIG_RFS_ACCEL=y +CONFIG_RPS=y +CONFIG_RTL8261N_PHY=y +# CONFIG_RTL838X is not set +# CONFIG_RTL839X is not set +CONFIG_RTL930X=y +# CONFIG_RTL931X is not set +CONFIG_SERIAL_MCTRL_GPIO=y +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SFP=y +CONFIG_SMP=y +CONFIG_SMP_UP=y +CONFIG_SPI=y +CONFIG_SPI_MASTER=y +CONFIG_SPI_MEM=y +CONFIG_SPI_REALTEK_SNAND=y +CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y +CONFIG_SWPHY=y +CONFIG_SYNC_R4K=y +CONFIG_SYSCTL_EXCEPTION_TRACE=y +CONFIG_SYS_HAS_CPU_MIPS32_R1=y +CONFIG_SYS_HAS_CPU_MIPS32_R2=y +CONFIG_SYS_HAS_EARLY_PRINTK=y +CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y +CONFIG_SYS_SUPPORTS_ARBIT_HZ=y +CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y +CONFIG_SYS_SUPPORTS_HIGHMEM=y +CONFIG_SYS_SUPPORTS_MIPS16=y +CONFIG_SYS_SUPPORTS_MULTITHREADING=y +CONFIG_SYS_SUPPORTS_SMP=y +CONFIG_SYS_SUPPORTS_SCHED_SMT=y +CONFIG_TARGET_ISA_REV=2 +CONFIG_THERMAL=y +# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set +CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y +# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set +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_TINY_SRCU=y +CONFIG_UBIFS_FS=y +CONFIG_USE_GENERIC_EARLY_PRINTK_8250=y +CONFIG_USE_OF=y +CONFIG_WATCHDOG_CORE=y +CONFIG_ZLIB_DEFLATE=y +CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/realtek/rtl930x_nand/target.mk b/target/linux/realtek/rtl930x_nand/target.mk new file mode 100644 index 0000000000..2ca02dd28d --- /dev/null +++ b/target/linux/realtek/rtl930x_nand/target.mk @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: GPL-2.0-only +ARCH:=mips +SUBTARGET:=rtl930x_nand +CPU_TYPE:=24kc +BOARD:=realtek +BOARDNAME:=Realtek MIPS RTL930X (NAND) +FEATURES+=nand source-only + +define Target/Description + Build firmware images for Realtek RTL930x based boards. +endef diff --git a/target/linux/realtek/rtl931x/config-6.12 b/target/linux/realtek/rtl931x/config-6.12 index 8d2a3553b4..5762ca139d 100644 --- a/target/linux/realtek/rtl931x/config-6.12 +++ b/target/linux/realtek/rtl931x/config-6.12 @@ -153,7 +153,7 @@ CONFIG_MTD_CFI_ADV_OPTIONS=y CONFIG_MTD_CFI_GEOMETRY=y CONFIG_MTD_CMDLINE_PARTS=y CONFIG_MTD_JEDECPROBE=y -CONFIG_MTD_SPI_NAND=y +# CONFIG_MTD_SPI_NAND is not set CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPLIT_BRNIMAGE_FW=y CONFIG_MTD_SPLIT_EVA_FW=y @@ -228,7 +228,7 @@ CONFIG_SOCK_RX_QUEUE_MAPPING=y CONFIG_SPI=y CONFIG_SPI_MASTER=y CONFIG_SPI_MEM=y -CONFIG_SPI_REALTEK_SNAND=y +# CONFIG_SPI_REALTEK_SNAND is not set CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y CONFIG_SWPHY=y CONFIG_SYNC_R4K=y diff --git a/target/linux/realtek/rtl931x_nand/config-6.12 b/target/linux/realtek/rtl931x_nand/config-6.12 new file mode 100644 index 0000000000..df7505522a --- /dev/null +++ b/target/linux/realtek/rtl931x_nand/config-6.12 @@ -0,0 +1,267 @@ +CONFIG_ARCH_32BIT_OFF_T=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_KEEP_MEMBLOCK=y +CONFIG_ARCH_MMAP_RND_BITS_MAX=15 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15 +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=4096 +CONFIG_BOARD_SCACHE=y +CONFIG_CLKSRC_MIPS_GIC=y +CONFIG_CLOCKSOURCE_WATCHDOG=y +CONFIG_CLOCKSOURCE_WATCHDOG_MAX_SKEW_US=125 +CONFIG_CLONE_BACKWARDS=y +CONFIG_COMMON_CLK=y +# CONFIG_COMMON_CLK_REALTEK is not set +CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 +CONFIG_COMPAT_32BIT_TIME=y +CONFIG_CONSOLE_LOGLEVEL_DEFAULT=15 +CONFIG_CONTEXT_TRACKING=y +CONFIG_CONTEXT_TRACKING_IDLE=y +CONFIG_CPU_BIG_ENDIAN=y +CONFIG_CPU_GENERIC_DUMP_TLB=y +CONFIG_CPU_HAS_DIEI=y +CONFIG_CPU_HAS_PREFETCH=y +CONFIG_CPU_HAS_RIXI=y +CONFIG_CPU_HAS_SYNC=y +CONFIG_CPU_MIPS32=y +# CONFIG_CPU_MIPS32_R1 is not set +CONFIG_CPU_MIPS32_R2=y +CONFIG_CPU_MIPSR2=y +CONFIG_CPU_MIPSR2_IRQ_EI=y +CONFIG_CPU_MIPSR2_IRQ_VI=y +CONFIG_CPU_MITIGATIONS=y +CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y +CONFIG_CPU_R4K_CACHE_TLB=y +CONFIG_CPU_RMAP=y +CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y +CONFIG_CPU_SUPPORTS_HIGHMEM=y +CONFIG_CPU_SUPPORTS_MSA=y +CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y +CONFIG_CRYPTO_LIB_GF128MUL=y +CONFIG_CRYPTO_LIB_POLY1305_RSIZE=2 +CONFIG_CRYPTO_LIB_SHA1=y +CONFIG_CRYPTO_LIB_UTILS=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_SECTION_MISMATCH=y +CONFIG_DMA_NONCOHERENT=y +CONFIG_DTC=y +CONFIG_EARLY_PRINTK=y +CONFIG_EARLY_PRINTK_8250=y +CONFIG_EXCLUSIVE_SYSTEM_RAM=y +CONFIG_FIXED_PHY=y +CONFIG_FS_IOMAP=y +CONFIG_FUNCTION_ALIGNMENT=0 +CONFIG_FWNODE_MDIO=y +CONFIG_FW_LOADER_PAGED_BUF=y +CONFIG_FW_LOADER_SYSFS=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_GETTIMEOFDAY=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IOMAP=y +CONFIG_GENERIC_IRQ_CHIP=y +CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_LIB_ASHLDI3=y +CONFIG_GENERIC_LIB_ASHRDI3=y +CONFIG_GENERIC_LIB_CMPDI2=y +CONFIG_GENERIC_LIB_LSHRDI3=y +CONFIG_GENERIC_LIB_UCMPDI2=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_PHY=y +CONFIG_GENERIC_PINCONF=y +CONFIG_GENERIC_PINCTRL_GROUPS=y +CONFIG_GENERIC_PINMUX_FUNCTIONS=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GPIOLIB_IRQCHIP=y +CONFIG_GPIO_CDEV=y +CONFIG_GPIO_GENERIC=y +CONFIG_GPIO_REALTEK_OTTO=y +CONFIG_GRO_CELLS=y +CONFIG_HARDWARE_WATCHPOINTS=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAS_IOPORT_MAP=y +CONFIG_HIGHMEM=y +CONFIG_HWMON=y +CONFIG_HZ_PERIODIC=y +CONFIG_I2C=y +CONFIG_I2C_ALGOBIT=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_GPIO=y +# CONFIG_I2C_GPIO_SHARED is not set +CONFIG_I2C_MUX=y +CONFIG_I2C_MUX_RTL9300=y +CONFIG_I2C_RTL9300=y +CONFIG_I2C_SMBUS=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_MIPS_CPU=y +CONFIG_IRQ_WORK=y +CONFIG_JFFS2_ZLIB=y +CONFIG_KMAP_LOCAL=y +CONFIG_LEDS_GPIO=y +CONFIG_LIBFDT=y +CONFIG_LOCK_DEBUGGING_SUPPORT=y +CONFIG_MACH_REALTEK_RTL=y +CONFIG_MARVELL_PHY=y +CONFIG_MDIO_BUS=y +CONFIG_MDIO_DEVICE=y +CONFIG_MDIO_DEVRES=y +CONFIG_MDIO_I2C=y +# CONFIG_MDIO_REALTEK_OTTO_AUX is not set +CONFIG_MDIO_SMBUS=y +# CONFIG_MFD_RTL8231 is not set +CONFIG_MFD_SYSCON=y +CONFIG_MIGRATION=y +CONFIG_MIPS=y +CONFIG_MIPS_ASID_BITS=8 +CONFIG_MIPS_ASID_SHIFT=0 +CONFIG_MIPS_CLOCK_VSYSCALL=y +CONFIG_MIPS_CM=y +# CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER is not set +CONFIG_MIPS_CMDLINE_FROM_DTB=y +CONFIG_MIPS_CPC=y +CONFIG_MIPS_CPS=y +# CONFIG_MIPS_CPS_NS16550_BOOL is not set +CONFIG_MIPS_CPU_SCACHE=y +CONFIG_MIPS_EXTERNAL_TIMER=y +CONFIG_MIPS_GIC=y +CONFIG_MIPS_L1_CACHE_SHIFT=5 +CONFIG_MIPS_MT=y +CONFIG_MIPS_MT_FPAFF=y +CONFIG_MIPS_MT_SMP=y +# CONFIG_MIPS_NO_APPENDED_DTB is not set +CONFIG_MIPS_NR_CPU_NR_MAP=2 +CONFIG_MIPS_PERF_SHARED_TC_COUNTERS=y +CONFIG_MIPS_RAW_APPENDED_DTB=y +CONFIG_MIPS_SPRAM=y +CONFIG_MMU_LAZY_TLB_REFCOUNT=y +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_MTD_CFI_ADV_OPTIONS=y +CONFIG_MTD_CFI_GEOMETRY=y +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_JEDECPROBE=y +CONFIG_MTD_SPI_NAND=y +CONFIG_MTD_SPI_NOR=y +CONFIG_MTD_SPLIT_BRNIMAGE_FW=y +CONFIG_MTD_SPLIT_EVA_FW=y +CONFIG_MTD_SPLIT_FIRMWARE=y +CONFIG_MTD_SPLIT_TPLINK_FW=y +CONFIG_MTD_SPLIT_UIMAGE_FW=y +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_BEB_LIMIT=20 +CONFIG_MTD_UBI_BLOCK=y +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEED_SRCU_NMI_SAFE=y +CONFIG_NET_DEVLINK=y +CONFIG_NET_DSA=y +CONFIG_NET_DSA_RTL83XX=y +CONFIG_NET_DSA_TAG_TRAILER=y +CONFIG_NET_EGRESS=y +CONFIG_NET_FLOW_LIMIT=y +CONFIG_NET_INGRESS=y +CONFIG_NET_RTL838X=y +CONFIG_NET_SELFTESTS=y +CONFIG_NET_XGRESS=y +CONFIG_NO_EXCEPT_FILL=y +CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y +CONFIG_NR_CPUS=4 +CONFIG_NVMEM=y +CONFIG_NVMEM_LAYOUTS=y +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_PADATA=y +CONFIG_PAGE_POOL=y +CONFIG_PAGE_SIZE_LESS_THAN_256KB=y +CONFIG_PAGE_SIZE_LESS_THAN_64KB=y +CONFIG_PCI_DRIVERS_LEGACY=y +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHYLIB=y +CONFIG_PHYLIB_LEDS=y +CONFIG_PHYLINK=y +CONFIG_PINCTRL=y +CONFIG_POWER_RESET=y +CONFIG_POWER_RESET_SYSCON=y +CONFIG_PREEMPT_NONE_BUILD=y +CONFIG_PTP_1588_CLOCK_OPTIONAL=y +CONFIG_QUEUED_RWLOCKS=y +CONFIG_QUEUED_SPINLOCKS=y +CONFIG_RANDSTRUCT_NONE=y +CONFIG_RATIONAL=y +CONFIG_REALTEK_OTTO_TIMER=y +CONFIG_REALTEK_OTTO_WDT=y +CONFIG_REALTEK_SOC_PHY=y +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y +CONFIG_REGMAP_MMIO=y +CONFIG_RESET_CONTROLLER=y +CONFIG_RFS_ACCEL=y +CONFIG_RPS=y +# CONFIG_RTL838X is not set +# CONFIG_RTL839X is not set +CONFIG_RTL930X=y +CONFIG_RTL931X=y +CONFIG_SENSORS_GPIO_FAN=y +CONFIG_SENSORS_LM75=y +CONFIG_SERIAL_MCTRL_GPIO=y +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SFP=y +CONFIG_SMP=y +CONFIG_SMP_UP=y +CONFIG_SOCK_RX_QUEUE_MAPPING=y +CONFIG_SPI=y +CONFIG_SPI_MASTER=y +CONFIG_SPI_MEM=y +CONFIG_SPI_REALTEK_SNAND=y +CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y +CONFIG_SWPHY=y +CONFIG_SYNC_R4K=y +CONFIG_SYSCTL_EXCEPTION_TRACE=y +CONFIG_SYS_HAS_CPU_MIPS32_R1=y +CONFIG_SYS_HAS_CPU_MIPS32_R2=y +CONFIG_SYS_HAS_EARLY_PRINTK=y +CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y +CONFIG_SYS_SUPPORTS_ARBIT_HZ=y +CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y +CONFIG_SYS_SUPPORTS_HIGHMEM=y +CONFIG_SYS_SUPPORTS_HOTPLUG_CPU=y +CONFIG_SYS_SUPPORTS_MIPS16=y +CONFIG_SYS_SUPPORTS_MIPS_CPS=y +CONFIG_SYS_SUPPORTS_MULTITHREADING=y +CONFIG_SYS_SUPPORTS_SCHED_SMT=y +CONFIG_SYS_SUPPORTS_SMP=y +CONFIG_SYS_SUPPORTS_VPE_LOADER=y +CONFIG_TARGET_ISA_REV=2 +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_USE_GENERIC_EARLY_PRINTK_8250=y +CONFIG_USE_OF=y +CONFIG_WATCHDOG_CORE=y +CONFIG_WEAK_ORDERING=y +CONFIG_XPS=y +CONFIG_ZLIB_DEFLATE=y +CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/realtek/rtl931x_nand/target.mk b/target/linux/realtek/rtl931x_nand/target.mk new file mode 100644 index 0000000000..ba2c3f2b8d --- /dev/null +++ b/target/linux/realtek/rtl931x_nand/target.mk @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: GPL-2.0-only +ARCH:=mips +SUBTARGET:=rtl931x_nand +CPU_TYPE:=24kc +BOARD:=realtek +BOARDNAME:=Realtek MIPS RTL931X (NAND) +FEATURES+=nand source-only + +define Target/Description + Build firmware images for Realtek RTL931x based boards. +endef From 07a04d8485a4437801569b2575e2ef1d3ee1b3fc Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Wed, 6 Aug 2025 06:42:00 -0400 Subject: [PATCH 19/21] realtek: RTL930x: reorganize mdio functions and SerDes register layout The RTL930x mdio functions are scattered around the code. Relocate them to the bus (still inside the ethernet driver). With this change the phy identification looks into the proper registers. The SerDes phy identifier (register 2/3) must be changed. Additionally provide a consistent SerDes register access through the mdio bus. Until now when a SerDes directly drives a SFP module there is no clear rule of how to handle its register set that consists of two parts: - c22 phy registers 0-15 live in the fiber page (2) of the SerDes - other SerDes specific registers exist in pages before and after The mdio bus and other SerDes functions are a wild mix of directly looking into page 2 or just using self defined methods to access data. Adapt the bus to the new consistent phy interface that mixes the SerDes register set like classic Realtek phys do it. - Use register 31 as page select (already in the bus) - Always keep the common registers 0-15 in place and read fiber page - Map the SerDes internal registers into the upper vendor specific registers 16-23 according to the page select register (31). That gives a register mapping as follows: +-----------------------+-----------------------+---------------+-------------+ | reg 0x00-0x0f | reg 0x10-0x17 | reg 0x18-0x1e | reg 0x1f | +-----------------------+-----------------------+---------------+-------------+ | SerDes fiber page (3) | real SerDes registers | zero | SerDes page | | registers 0 - 15 | in packages of 8 | | select reg | +-----------------------+-----------------------+---------------+-------------+ Example to make it as clear as possible. SerDes registers on a RTL930x show Page / Reg | 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B ... -------------+---------------------------------------------------------------- 0 - SDS | 0C03 0F00 7060 7106 074D 0EBF 0F0F 0359 5248 0000 0F80 0000 ... 1 - SDS_EXT | 0000 0000 85FA 8C6D 5CCC 0000 20D8 0003 79AA 8C64 00C3 1482 ... 2 - FIB | 1140 6189 001C CA40 01A0 0000 0000 0004 0000 0000 0000 0000 ... 3 - FIB_EXT | 1140 6109 001C CA40 01A0 0000 0000 0004 0000 0000 0000 0000 ... This translates to this phy layout | SerDes fiber registers normal SerDes registers zero p.sel Page / Reg | 0x00 0x01 0x02 0x03 ... 0x10 0x11 0x12 0x13 ... 0x18 ... 0x1f -------------+--------------------------------------------------------------- 0 | 1140 6189 001C CA40 ... 0C03 0F00 7060 7106 ... 0000 ... 0000 1 | 1140 6189 001C CA40 ... 5248 0000 0F80 0000 ... 0000 ... 0001 ... 4 | 1140 6189 001C CA40 ... 0000 0000 85FA 8C6D ... 0000 ... 0004 Signed-off-by: Markus Stockhausen Link: https://github.com/openwrt/openwrt/pull/19692 Signed-off-by: Robert Marko --- .../include/asm/mach-rtl838x/mach-rtl83xx.h | 7 - .../drivers/net/dsa/rtl83xx/rtl83xx.h | 3 - .../drivers/net/dsa/rtl83xx/rtl930x.c | 119 ------------- .../drivers/net/ethernet/rtl838x_eth.c | 168 +++++++++++++++--- .../files-6.12/drivers/net/phy/rtl83xx-phy.h | 2 +- 5 files changed, 140 insertions(+), 159 deletions(-) diff --git a/target/linux/realtek/files-6.12/arch/mips/include/asm/mach-rtl838x/mach-rtl83xx.h b/target/linux/realtek/files-6.12/arch/mips/include/asm/mach-rtl838x/mach-rtl83xx.h index 2946674036..808cbd245c 100644 --- a/target/linux/realtek/files-6.12/arch/mips/include/asm/mach-rtl838x/mach-rtl83xx.h +++ b/target/linux/realtek/files-6.12/arch/mips/include/asm/mach-rtl838x/mach-rtl83xx.h @@ -415,13 +415,6 @@ struct rtl83xx_soc_info { }; /* rtl83xx-related functions used across subsystems */ -int rtl838x_smi_wait_op(int timeout); -int rtl838x_read_phy(u32 port, u32 page, u32 reg, u32 *val); -int rtl838x_write_phy(u32 port, u32 page, u32 reg, u32 val); -int rtl839x_read_phy(u32 port, u32 page, u32 reg, u32 *val); -int rtl839x_write_phy(u32 port, u32 page, u32 reg, u32 val); -int rtl930x_read_phy(u32 port, u32 page, u32 reg, u32 *val); -int rtl930x_write_phy(u32 port, u32 page, u32 reg, u32 val); int rtl931x_read_phy(u32 port, u32 page, u32 reg, u32 *val); int rtl931x_write_phy(u32 port, u32 page, u32 reg, u32 val); diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl83xx.h b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl83xx.h index 07cd98572a..7dff91e3b7 100644 --- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl83xx.h +++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl83xx.h @@ -194,9 +194,6 @@ int rtl83xx_lag_del(struct dsa_switch *ds, int group, int port); /* phy functions that will need to be moved to the future mdio driver */ -int rtl930x_read_mmd_phy(u32 port, u32 devnum, u32 regnum, u32 *val); -int rtl930x_write_mmd_phy(u32 port, u32 devnum, u32 regnum, u32 val); - int rtl931x_read_mmd_phy(u32 port, u32 devnum, u32 regnum, u32 *val); int rtl931x_write_mmd_phy(u32 port, u32 devnum, u32 regnum, u32 val); diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c index 034b5c09f0..d7f611f943 100644 --- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c +++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c @@ -741,125 +741,6 @@ irqreturn_t rtldsa_930x_switch_irq(int irq, void *dev_id) return IRQ_HANDLED; } -int rtl930x_write_phy(u32 port, u32 page, u32 reg, u32 val) -{ - u32 v; - int err = 0; - - pr_debug("%s: port %d, page: %d, reg: %x, val: %x\n", __func__, port, page, reg, val); - - if (port > 63 || page > 4095 || reg > 31) - return -ENOTSUPP; - - val &= 0xffff; - mutex_lock(&smi_lock); - - sw_w32(BIT(port), RTL930X_SMI_ACCESS_PHY_CTRL_0); - sw_w32_mask(0xffff << 16, val << 16, RTL930X_SMI_ACCESS_PHY_CTRL_2); - v = reg << 20 | page << 3 | 0x1f << 15 | BIT(2) | BIT(0); - sw_w32(v, RTL930X_SMI_ACCESS_PHY_CTRL_1); - - do { - v = sw_r32(RTL930X_SMI_ACCESS_PHY_CTRL_1); - } while (v & 0x1); - - if (v & 0x2) - err = -EIO; - - mutex_unlock(&smi_lock); - - return err; -} - -int rtl930x_read_phy(u32 port, u32 page, u32 reg, u32 *val) -{ - u32 v; - int err = 0; - - if (port > 63 || page > 4095 || reg > 31) - return -ENOTSUPP; - - mutex_lock(&smi_lock); - - sw_w32_mask(0xffff << 16, port << 16, RTL930X_SMI_ACCESS_PHY_CTRL_2); - v = reg << 20 | page << 3 | 0x1f << 15 | 1; - sw_w32(v, RTL930X_SMI_ACCESS_PHY_CTRL_1); - - do { - v = sw_r32(RTL930X_SMI_ACCESS_PHY_CTRL_1); - } while ( v & 0x1); - - if (v & BIT(25)) { - pr_debug("Error reading phy %d, register %d\n", port, reg); - err = -EIO; - } - *val = (sw_r32(RTL930X_SMI_ACCESS_PHY_CTRL_2) & 0xffff); - - pr_debug("%s: port %d, page: %d, reg: %x, val: %x\n", __func__, port, page, reg, *val); - - mutex_unlock(&smi_lock); - - return err; -} - -/* Write to an mmd register of the PHY */ -int rtl930x_write_mmd_phy(u32 port, u32 devnum, u32 regnum, u32 val) -{ - int err = 0; - u32 v; - - mutex_lock(&smi_lock); - - /* Set PHY to access */ - sw_w32(BIT(port), RTL930X_SMI_ACCESS_PHY_CTRL_0); - - /* Set data to write */ - sw_w32_mask(0xffff << 16, val << 16, RTL930X_SMI_ACCESS_PHY_CTRL_2); - - /* Set MMD device number and register to write to */ - sw_w32(devnum << 16 | (regnum & 0xffff), RTL930X_SMI_ACCESS_PHY_CTRL_3); - - v = BIT(2) | BIT(1) | BIT(0); /* WRITE | MMD-access | EXEC */ - sw_w32(v, RTL930X_SMI_ACCESS_PHY_CTRL_1); - - do { - v = sw_r32(RTL930X_SMI_ACCESS_PHY_CTRL_1); - } while (v & BIT(0)); - - pr_debug("%s: port %d, regnum: %x, val: %x (err %d)\n", __func__, port, regnum, val, err); - mutex_unlock(&smi_lock); - return err; -} - -/* Read an mmd register of the PHY */ -int rtl930x_read_mmd_phy(u32 port, u32 devnum, u32 regnum, u32 *val) -{ - int err = 0; - u32 v; - - mutex_lock(&smi_lock); - - /* Set PHY to access */ - sw_w32_mask(0xffff << 16, port << 16, RTL930X_SMI_ACCESS_PHY_CTRL_2); - - /* Set MMD device number and register to write to */ - sw_w32(devnum << 16 | (regnum & 0xffff), RTL930X_SMI_ACCESS_PHY_CTRL_3); - - v = BIT(1) | BIT(0); /* MMD-access | EXEC */ - sw_w32(v, RTL930X_SMI_ACCESS_PHY_CTRL_1); - - do { - v = sw_r32(RTL930X_SMI_ACCESS_PHY_CTRL_1); - } while (v & BIT(0)); - /* There is no error-checking via BIT 25 of v, as it does not seem to be set correctly */ - *val = (sw_r32(RTL930X_SMI_ACCESS_PHY_CTRL_2) & 0xffff); - pr_debug("%s: port %d, regnum: %x, val: %x (err %d)\n", __func__, port, regnum, *val, err); - - mutex_unlock(&smi_lock); - - return err; -} - /* Calculate both the block 0 and the block 1 hash, and return in * lower and higher word of the return value since only 12 bit of * the hash are significant diff --git a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c index 66e06bbb31..66b808dba9 100644 --- a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c +++ b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c @@ -27,11 +27,6 @@ extern struct rtl83xx_soc_info soc_info; extern int rtl83xx_setup_tc(struct net_device *dev, enum tc_setup_type type, void *type_data); -extern int rtl930x_read_mmd_phy(u32 port, u32 devnum, u32 regnum, u32 *val); -extern int rtl930x_read_phy(u32 port, u32 page, u32 reg, u32 *val); -extern int rtl930x_write_mmd_phy(u32 port, u32 devnum, u32 regnum, u32 val); -extern int rtl930x_write_phy(u32 port, u32 page, u32 reg, u32 val); - extern int rtl931x_read_mmd_phy(u32 port, u32 devnum, u32 regnum, u32 *val); extern int rtl931x_read_phy(u32 port, u32 page, u32 reg, u32 *val); extern int rtl931x_read_sds_phy(int phy_addr, int page, int phy_reg); @@ -2276,6 +2271,127 @@ int rtmdio_930x_write_sds_phy(int sds, int page, int regnum, u16 val) return ret; } +/* RTL930x specific MDIO functions */ + +static int rtmdio_930x_write_phy(u32 port, u32 page, u32 reg, u32 val) +{ + u32 v; + int err = 0; + + pr_debug("%s: port %d, page: %d, reg: %x, val: %x\n", __func__, port, page, reg, val); + + if (port > 63 || page > 4095 || reg > 31) + return -ENOTSUPP; + + val &= 0xffff; + mutex_lock(&rtmdio_lock); + + sw_w32(BIT(port), RTL930X_SMI_ACCESS_PHY_CTRL_0); + sw_w32_mask(0xffff << 16, val << 16, RTL930X_SMI_ACCESS_PHY_CTRL_2); + v = reg << 20 | page << 3 | 0x1f << 15 | BIT(2) | BIT(0); + sw_w32(v, RTL930X_SMI_ACCESS_PHY_CTRL_1); + + do { + v = sw_r32(RTL930X_SMI_ACCESS_PHY_CTRL_1); + } while (v & 0x1); + + if (v & 0x2) + err = -EIO; + + mutex_unlock(&rtmdio_lock); + + return err; +} + +static int rtmdio_930x_read_phy(u32 port, u32 page, u32 reg, u32 *val) +{ + u32 v; + int err = 0; + + if (port > 63 || page > 4095 || reg > 31) + return -ENOTSUPP; + + mutex_lock(&rtmdio_lock); + + sw_w32_mask(0xffff << 16, port << 16, RTL930X_SMI_ACCESS_PHY_CTRL_2); + v = reg << 20 | page << 3 | 0x1f << 15 | 1; + sw_w32(v, RTL930X_SMI_ACCESS_PHY_CTRL_1); + + do { + v = sw_r32(RTL930X_SMI_ACCESS_PHY_CTRL_1); + } while ( v & 0x1); + + if (v & BIT(25)) { + pr_debug("Error reading phy %d, register %d\n", port, reg); + err = -EIO; + } + *val = (sw_r32(RTL930X_SMI_ACCESS_PHY_CTRL_2) & 0xffff); + + pr_debug("%s: port %d, page: %d, reg: %x, val: %x\n", __func__, port, page, reg, *val); + + mutex_unlock(&rtmdio_lock); + + return err; +} + +/* Write to an mmd register of the PHY */ +static int rtmdio_930x_write_mmd_phy(u32 port, u32 devnum, u32 regnum, u32 val) +{ + int err = 0; + u32 v; + + mutex_lock(&rtmdio_lock); + + /* Set PHY to access */ + sw_w32(BIT(port), RTL930X_SMI_ACCESS_PHY_CTRL_0); + + /* Set data to write */ + sw_w32_mask(0xffff << 16, val << 16, RTL930X_SMI_ACCESS_PHY_CTRL_2); + + /* Set MMD device number and register to write to */ + sw_w32(devnum << 16 | (regnum & 0xffff), RTL930X_SMI_ACCESS_PHY_CTRL_3); + + v = BIT(2) | BIT(1) | BIT(0); /* WRITE | MMD-access | EXEC */ + sw_w32(v, RTL930X_SMI_ACCESS_PHY_CTRL_1); + + do { + v = sw_r32(RTL930X_SMI_ACCESS_PHY_CTRL_1); + } while (v & BIT(0)); + + pr_debug("%s: port %d, regnum: %x, val: %x (err %d)\n", __func__, port, regnum, val, err); + mutex_unlock(&rtmdio_lock); + return err; +} + +/* Read an mmd register of the PHY */ +static int rtmdio_930x_read_mmd_phy(u32 port, u32 devnum, u32 regnum, u32 *val) +{ + int err = 0; + u32 v; + + mutex_lock(&rtmdio_lock); + + /* Set PHY to access */ + sw_w32_mask(0xffff << 16, port << 16, RTL930X_SMI_ACCESS_PHY_CTRL_2); + + /* Set MMD device number and register to write to */ + sw_w32(devnum << 16 | (regnum & 0xffff), RTL930X_SMI_ACCESS_PHY_CTRL_3); + + v = BIT(1) | BIT(0); /* MMD-access | EXEC */ + sw_w32(v, RTL930X_SMI_ACCESS_PHY_CTRL_1); + + do { + v = sw_r32(RTL930X_SMI_ACCESS_PHY_CTRL_1); + } while (v & BIT(0)); + /* There is no error-checking via BIT 25 of v, as it does not seem to be set correctly */ + *val = (sw_r32(RTL930X_SMI_ACCESS_PHY_CTRL_2) & 0xffff); + pr_debug("%s: port %d, regnum: %x, val: %x (err %d)\n", __func__, port, regnum, *val, err); + + mutex_unlock(&rtmdio_lock); + + return err; +} + /* These are the core functions of our new Realtek SoC MDIO bus. */ static int rtmdio_read_c45(struct mii_bus *bus, int addr, int devnum, int regnum) @@ -2347,7 +2463,7 @@ static int rtmdio_write_sds_phy(struct rtmdio_bus_priv *priv, int sds, int page, return ret; } -static int rtmdio_83xx_read(struct mii_bus *bus, int addr, int regnum) +static int rtmdio_read(struct mii_bus *bus, int addr, int regnum) { struct rtmdio_bus_priv *priv = bus->priv; int err, val; @@ -2388,12 +2504,8 @@ static int rtmdio_93xx_read(struct mii_bus *bus, int addr, int regnum) priv->raw[addr] = (priv->page[addr] == priv->rawpage); if (priv->phy_is_internal[addr]) { - if (priv->family_id == RTL9300_FAMILY_ID) - return rtmdio_930x_read_sds_phy(priv->sds_id[addr], - priv->page[addr], regnum); - else - return rtl931x_read_sds_phy(priv->sds_id[addr], - priv->page[addr], regnum); + return rtl931x_read_sds_phy(priv->sds_id[addr], + priv->page[addr], regnum); } err = (*priv->read_phy)(addr, priv->page[addr], regnum, &val); @@ -2419,7 +2531,7 @@ static int rtmdio_write_c45(struct mii_bus *bus, int addr, int devnum, int regnu return err; } -static int rtmdio_83xx_write(struct mii_bus *bus, int addr, int regnum, u16 val) +static int rtmdio_write(struct mii_bus *bus, int addr, int regnum, u16 val) { struct rtmdio_bus_priv *priv = bus->priv; int err, page; @@ -2480,12 +2592,8 @@ static int rtmdio_93xx_write(struct mii_bus *bus, int addr, int regnum, u16 val) if (!priv->raw[addr] && (regnum != RTMDIO_PAGE_SELECT || page == priv->rawpage)) { priv->raw[addr] = (page == priv->rawpage); if (priv->phy_is_internal[addr]) { - if (priv->family_id == RTL9300_FAMILY_ID) - return rtmdio_930x_write_sds_phy(priv->sds_id[addr], - page, regnum, val); - else - return rtl931x_write_sds_phy(priv->sds_id[addr], - page, regnum, val); + return rtl931x_write_sds_phy(priv->sds_id[addr], + page, regnum, val); } err = (*priv->write_phy)(addr, page, regnum, val); @@ -2767,8 +2875,8 @@ static int rtl838x_mdio_init(struct rtl838x_eth_priv *priv) switch(priv->family_id) { case RTL8380_FAMILY_ID: priv->mii_bus->name = "rtl838x-eth-mdio"; - priv->mii_bus->read = rtmdio_83xx_read; - priv->mii_bus->write = rtmdio_83xx_write; + priv->mii_bus->read = rtmdio_read; + priv->mii_bus->write = rtmdio_write; priv->mii_bus->reset = rtmdio_838x_reset; bus_priv->read_sds_phy = rtmdio_838x_read_sds_phy; bus_priv->write_sds_phy = rtmdio_838x_write_sds_phy; @@ -2781,8 +2889,8 @@ static int rtl838x_mdio_init(struct rtl838x_eth_priv *priv) break; case RTL8390_FAMILY_ID: priv->mii_bus->name = "rtl839x-eth-mdio"; - priv->mii_bus->read = rtmdio_83xx_read; - priv->mii_bus->write = rtmdio_83xx_write; + priv->mii_bus->read = rtmdio_read; + priv->mii_bus->write = rtmdio_write; priv->mii_bus->reset = rtmdio_839x_reset; bus_priv->read_sds_phy = rtmdio_839x_read_sds_phy; bus_priv->write_sds_phy = rtmdio_839x_write_sds_phy; @@ -2795,13 +2903,15 @@ static int rtl838x_mdio_init(struct rtl838x_eth_priv *priv) break; case RTL9300_FAMILY_ID: priv->mii_bus->name = "rtl930x-eth-mdio"; - priv->mii_bus->read = rtmdio_93xx_read; - priv->mii_bus->write = rtmdio_93xx_write; + priv->mii_bus->read = rtmdio_read; + priv->mii_bus->write = rtmdio_write; priv->mii_bus->reset = rtmdio_930x_reset; - bus_priv->read_mmd_phy = rtl930x_read_mmd_phy; - bus_priv->write_mmd_phy = rtl930x_write_mmd_phy; - bus_priv->read_phy = rtl930x_read_phy; - bus_priv->write_phy = rtl930x_write_phy; + bus_priv->read_sds_phy = rtmdio_930x_read_sds_phy; + bus_priv->write_sds_phy = rtmdio_930x_write_sds_phy; + bus_priv->read_mmd_phy = rtmdio_930x_read_mmd_phy; + bus_priv->write_mmd_phy = rtmdio_930x_write_mmd_phy; + bus_priv->read_phy = rtmdio_930x_read_phy; + bus_priv->write_phy = rtmdio_930x_write_phy; bus_priv->cpu_port = RTL930X_CPU_PORT; bus_priv->rawpage = 0xfff; break; diff --git a/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.h b/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.h index 7fca3bb8c5..f57eb50867 100644 --- a/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.h +++ b/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.h @@ -32,7 +32,7 @@ struct __attribute__ ((__packed__)) fw_header { #define PHY_ID_RTL8226 0x001cc838 #define PHY_ID_RTL8390_GENERIC 0x001ccab0 #define PHY_ID_RTL8393_I 0x001c8393 -#define PHY_ID_RTL9300_I 0x70d03106 +#define PHY_ID_RTL9300_I 0x338002a0 /* These PHYs share the same id (0x001cc981) */ #define PHY_IS_NOT_RTL821X 0 From 223c1de963df9414c298ac7ca6312ce799c9fd58 Mon Sep 17 00:00:00 2001 From: John Audia Date: Fri, 8 Aug 2025 19:43:20 -0400 Subject: [PATCH 20/21] openssl: update to 3.5.2 OpenSSL 3.5.2 is a bug fix release: This release incorporates the following bug fixes and mitigations: Miscellaneous minor bug fixes. The FIPS provider now performs a PCT on key import for RSA, EC and ECX. This is mandated by FIPS 140-3 IG 10.3.A additional comment 1. Build system: x86/64 Build-tested: x86/64-glibc Run-tested: x86/64-glibc (Intel N150 based box) Signed-off-by: John Audia Link: https://github.com/openwrt/openwrt/pull/19725 Signed-off-by: Hauke Mehrtens --- package/libs/openssl/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index 210afe0d62..c70dbd3004 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openssl -PKG_VERSION:=3.5.1 +PKG_VERSION:=3.5.2 PKG_RELEASE:=1 PKG_BUILD_FLAGS:=no-mips16 gc-sections no-lto @@ -21,7 +21,7 @@ PKG_SOURCE_URL:= \ https://www.openssl.org/source/old/$(PKG_BASE)/ \ https://github.com/openssl/openssl/releases/download/$(PKG_NAME)-$(PKG_VERSION)/ -PKG_HASH:=529043b15cffa5f36077a4d0af83f3de399807181d607441d734196d889b641f +PKG_HASH:=c53a47e5e441c930c3928cf7bf6fb00e5d129b630e0aa873b08258656e7345ec PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=LICENSE From 551a6cef582ce9eb342a826c3ac3e40bddba7580 Mon Sep 17 00:00:00 2001 From: Til Kaiser Date: Tue, 5 Aug 2025 15:56:16 +0200 Subject: [PATCH 21/21] x86: add Minisforum MS-A2 Mini PC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit renames the network ports of the Minisforum MS-A2 Mini PC: the two 2.5G RJ45 ports are now named lan1 and lan2, and the two 10G SFP+ ports sfp1 and sfp2. All four ports are also added to the default lan interface. --- Hardware Highlights --- AMD Ryzen™ 9 9955HX/7945HX Dual DDR5-5600MHz, up to 96GB 2x 10G SFP+, 2x 2.5G RJ45 WiFi 6E, Bluetooth 5.3 Built-in PCIe x16 Slot Signed-off-by: Til Kaiser Link: https://github.com/openwrt/openwrt/pull/19689 Signed-off-by: Hauke Mehrtens --- target/linux/x86/base-files/etc/board.d/02_network | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/target/linux/x86/base-files/etc/board.d/02_network b/target/linux/x86/base-files/etc/board.d/02_network index aa61cf32fb..c4b33e24ce 100644 --- a/target/linux/x86/base-files/etc/board.d/02_network +++ b/target/linux/x86/base-files/etc/board.d/02_network @@ -60,6 +60,13 @@ gowin-solution-co-ltd-gw-mb-u01) ucidef_set_interfaces_lan_wan "eth1 eth2 eth3 eth4 poe" "sfp1 sfp2" ;; +micro-computer-hk-tech-limited-ms-a2) + ucidef_set_network_device_path "lan1" "pci0000:00/0000:00:03.2/0000:04:00.0" + ucidef_set_network_device_path "lan2" "pci0000:00/0000:00:03.1/0000:03:00.0" + ucidef_set_network_device_path "sfp1" "pci0000:00/0000:00:02.1/0000:05:00.0" + ucidef_set_network_device_path "sfp2" "pci0000:00/0000:00:02.1/0000:05:00.1" + ucidef_set_interface_lan "lan1 lan2 sfp1 sfp2" + ;; pc-engines-apu1|pc-engines-apu2|pc-engines-apu3) ucidef_set_interfaces_lan_wan "eth1 eth2" "eth0" ;;