root 1 月之前
父節點
當前提交
e32c2e7aaf

+ 3 - 10
devices/common/patches/imagebuilder.patch

@@ -124,14 +124,7 @@
  BUILD_PACKAGES:=$(filter-out $(filter -%,$(BUILD_PACKAGES)) $(patsubst -%,%,$(filter -%,$(BUILD_PACKAGES))),$(BUILD_PACKAGES))
  PACKAGES:=
  
-@@ -155,14 +182,16 @@ _call_image: staging_dir/host/.prereq-build
- 	echo 'Building images for $(BOARD)$(if $($(USER_PROFILE)_NAME), - $($(USER_PROFILE)_NAME))'
- 	echo 'Packages: $(BUILD_PACKAGES)'
- 	echo
--	rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG)
- 	mkdir -p $(TARGET_DIR) $(BIN_DIR) $(TMP_DIR) $(DL_DIR)
- 	$(MAKE) package_reload
- 	$(MAKE) package_install
+@@ -162,7 +189,10 @@ _call_image: staging_dir/host/.prereq-build
  	$(MAKE) -s prepare_rootfs
  	$(MAKE) -s build_image
  	$(MAKE) -s json_overview_image_info
@@ -142,7 +135,7 @@
  
  _call_manifest: FORCE
  	rm -rf $(TARGET_DIR)
-@@ -230,9 +259,17 @@ package_install: FORCE
+@@ -230,9 +260,17 @@ package_install: FORCE
  	@echo
  	@echo Installing packages...
  ifeq ($(CONFIG_USE_APK),)
@@ -161,7 +154,7 @@
  else
  	$(APK) add --no-scripts $(firstword $(wildcard $(LINUX_DIR)/libc-*.apk $(PACKAGE_DIR)/libc-*.apk))
  	$(APK) add --no-scripts $(firstword $(wildcard $(LINUX_DIR)/kernel-*.apk $(PACKAGE_DIR)/kernel-*.apk))
-@@ -260,16 +297,19 @@ else
+@@ -260,16 +298,19 @@ else
  	)
  endif
  	$(call prepare_rootfs,$(TARGET_DIR),$(USER_FILES),$(DISABLED_SERVICES))

+ 0 - 134
devices/common/patches/ucode.revert.patch

@@ -1,134 +0,0 @@
-From 39972c47eb9e367ca8e8611b1d1de4669df2ff92 Mon Sep 17 00:00:00 2001
-From: Felix Fietkau <[email protected]>
-Date: Fri, 18 Jul 2025 12:22:10 +0200
-Subject: [PATCH] ucode: update to Git HEAD (2025-07-18)
-
-54b00e3b1fa9 ubus: fix double registry clear on disconnect
-69521b55855c ubus: fix use-after-free on deferred request reply() method
-f499de690c33 Merge pull request #298 from nbd168/ubus-fixes
-22e8c16d9deb debug: fix crash when passing tagged string to getinfo()
-2c9eea5174d6 ubus: use ucv_resource_create_ex for connections/channels
-0a4cf4b7e71a ubus: use ucv_resource_create_ex for for ubus.request resources
-99ee75a69cd3 ubus: use ucv_resource_create_ex for ubus.deferred resources
-f085a42b977f ubus: use ucv_resource_create_ex for objects
-94ad17d13a0d ubus: use ucv_resource_create_ex for ubus.notify resources
-a3fa47fdda3e ubus: use ucv_resource_create_ex for ubus.listener resources
-9ab5fa869dec ubus: use ucv_resource_create_ex for ubus.subscriber resources
-43dd5716db84 Merge pull request #300 from nbd168/ubus-gc
-be92ebd70633 CI: debian: install cmake package
-fd202fd40bd1 socket: respect port argument in sockinst.connect()
-767c209b917b socket: properly handle async `connect(2)` errors in socket.connect()
-37ac8f112af6 socket: improve port argument validation in sockinst.connect()
-5b3b6b789b9c ubus: fix refcount issue in uc_ubus_object_notify
-cdcd50ad0408 Merge pull request #305 from nbd168/ubus-fix
-f682ac2f6b82 program: add bytecode version to program header flags
-af411d8101b2 vm: implement PVAL opcode
-afdfffb61258 vm: support initiating method calls with I_CALL/I_QCALL opcodes
-5d680425db40 compiler: stop emitting I_MCALL/I_QMCALL opcodes
-a616feed39eb compiler, vm: rework optional chaining and function call semantics
-d29ec45ab107 Merge pull request #306 from jow-/optional-chaining-short-circuiting
-0946a4fb20b8 vm: adjust JMPNT opcode behavior
-6f8291f73757 compiler: improve assignment lhs expression checks
-22e1346a7bda Merge pull request #308 from jow-/compiler-lhs-check-fixes
-cf846c4a11d4 vm: properly handle modulo by zero
-4d81e6c13506 resolv: add documentation and fix clobbering ns strings
-20ee2dabd243 debian/changelog: v0.0.20250529
-82426d1a02e2 Merge pull request #314 from jow-/resolv-fix313
-50d303c8309d ubus: add support for automatically subscribing to objects
-fdbf73da4136 Merge pull request #312 from nbd168/ubus-subscribe
-5a0d21d59f88 vm: export function for converting exception to ucode value
-aaf712eb4fb4 uloop: add guard() function
-693af2b61b52 ubus: add guard() function
-
-Signed-off-by: Felix Fietkau <[email protected]>
-(cherry picked from commit c39a09686e3d562367ab3a47da6a005eebaf5ca2)
----
- package/utils/ucode/Makefile                  |  6 ++---
- ...-double-registry-clear-on-disconnect.patch | 26 ------------------
- ...er-free-on-deferred-request-reply-me.patch | 27 -------------------
- 3 files changed, 3 insertions(+), 56 deletions(-)
- delete mode 100644 package/utils/ucode/patches/010-ubus-fix-double-registry-clear-on-disconnect.patch
- delete mode 100644 package/utils/ucode/patches/020-ubus-fix-use-after-free-on-deferred-request-reply-me.patch
-
-diff --git a/package/utils/ucode/Makefile b/package/utils/ucode/Makefile
-index ed155af02f3d60..8ae1b91c1f213a 100644
---- a/package/utils/ucode/Makefile
-+++ b/package/utils/ucode/Makefile
-@@ -12,9 +12,9 @@ PKG_RELEASE:=1
- 
- PKG_SOURCE_PROTO:=git
- PKG_SOURCE_URL=https://github.com/jow-/ucode.git
--PKG_SOURCE_DATE:=2025-05-11
--PKG_SOURCE_VERSION:=d5b3a9dc1091dd28cf6f0f60cd34fc322ef27717
--PKG_MIRROR_HASH:=cd8af9d5ac28e2530b56015a3f2fcf6f36062546cac8b23a5f7b75b367209b54
-+PKG_SOURCE_DATE:=2025-07-18
-+PKG_SOURCE_VERSION:=3f64c8089bf3ea4847c96b91df09fbfcaec19e1d
-+PKG_MIRROR_HASH:=55fbff7c527e1fadbda2e038636f39419649841ee63a5f3cdb50b9714b13420c
- PKG_MAINTAINER:=Jo-Philipp Wich <[email protected]>
- PKG_LICENSE:=ISC
- 
-diff --git a/package/utils/ucode/patches/010-ubus-fix-double-registry-clear-on-disconnect.patch b/package/utils/ucode/patches/010-ubus-fix-double-registry-clear-on-disconnect.patch
-deleted file mode 100644
-index 70b6a99be7958b..00000000000000
---- a/package/utils/ucode/patches/010-ubus-fix-double-registry-clear-on-disconnect.patch
-+++ /dev/null
-@@ -1,26 +0,0 @@
--From: Felix Fietkau <[email protected]>
--Date: Fri, 9 May 2025 11:57:57 +0200
--Subject: [PATCH] ubus: fix double registry clear on disconnect
--
--Set c->registry_index to -1 in order to ensure that the resource free path
--does not clobber registry items of unrelated connections.
--
--Signed-off-by: Felix Fietkau <[email protected]>
-----
--
----- a/lib/ubus.c
--+++ b/lib/ubus.c
--@@ -2375,8 +2375,11 @@ uc_ubus_channel_disconnect_cb(struct ubu
-- 		c->ctx.sock.fd = -1;
-- 	}
-- 
---	if (c->registry_index >= 0)
---		connection_reg_clear(c->vm, c->registry_index);
--+	if (c->registry_index >= 0) {
--+		int idx = c->registry_index;
--+		c->registry_index = -1;
--+		connection_reg_clear(c->vm, idx);
--+	}
-- }
-- 
-- static uc_value_t *
-diff --git a/package/utils/ucode/patches/020-ubus-fix-use-after-free-on-deferred-request-reply-me.patch b/package/utils/ucode/patches/020-ubus-fix-use-after-free-on-deferred-request-reply-me.patch
-deleted file mode 100644
-index 142595a5bdbb5e..00000000000000
---- a/package/utils/ucode/patches/020-ubus-fix-use-after-free-on-deferred-request-reply-me.patch
-+++ /dev/null
-@@ -1,27 +0,0 @@
--From: Felix Fietkau <[email protected]>
--Date: Mon, 12 May 2025 12:43:44 +0200
--Subject: [PATCH] ubus: fix use-after-free on deferred request reply() method
--
--Hold a reference to the defer resource as long as it is still needed
--
--Signed-off-by: Felix Fietkau <[email protected]>
-----
--
----- a/lib/ubus.c
--+++ b/lib/ubus.c
--@@ -636,6 +636,7 @@ uc_ubus_call_user_cb(uc_ubus_deferred_t
-- 	uc_value_t *this, *func;
-- 
-- 	request_reg_get(defer->vm, defer->registry_index, &this, &func, NULL, NULL);
--+	ucv_get(this);
-- 
-- 	if (ucv_is_callable(func)) {
-- 		uc_vm_stack_push(defer->vm, ucv_get(this));
--@@ -648,6 +649,7 @@ uc_ubus_call_user_cb(uc_ubus_deferred_t
-- 	}
-- 
-- 	request_reg_clear(defer->vm, defer->registry_index);
--+	ucv_put(this);
-- }
-- 
-- static void

+ 221 - 0
devices/mediatek_filogic/diy/target/linux/mediatek/dts/mt7981b-airpi-ap3000m.dts

@@ -0,0 +1,221 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+#include "mt7981.dtsi"
+
+/ {
+	model = "Airpi AP3000M";
+	compatible = "airpi,ap3000m", "mediatek,mt7981b";
+
+	aliases {
+		ethernet0 = &gmac0;
+		ethernet1 = &gmac1;
+		serial0 = &uart0;
+
+		led-boot = &led_sys_blue;
+		led-failsafe = &led_sys_blue;
+		led-running = &led_sys_blue;
+		led-upgrade = &led_sys_blue;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs = "root=PARTLABEL=rootfs rootwait";
+	};
+
+	memory {
+		reg = <0 0x40000000 0 0x40000000>;
+	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			linux,code = <KEY_RESTART>;
+			gpios = <&pio 1 GPIO_ACTIVE_LOW>;
+		};
+
+		wps {
+			label = "wps";
+			linux,code = <KEY_WPS_BUTTON>;
+			gpios = <&pio 0 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		led_sys_blue: led-0 {
+			function = LED_FUNCTION_STATUS;
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&pio 13 GPIO_ACTIVE_LOW>;
+		};
+
+		led-1 {
+			function = LED_FUNCTION_WLAN_2GHZ;
+			color = <LED_COLOR_ID_ORANGE>;
+			gpios = <&pio 34 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy0tpt";
+		};
+
+		led-2 {
+			function = LED_FUNCTION_WLAN_5GHZ;
+			color = <LED_COLOR_ID_WHITE>;
+			gpios = <&pio 35 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy1tpt";
+		};
+	};
+
+	reg_3p3v: regulator-3p3v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-3.3V";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
+	reg_5v: regulator-5v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-5V";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+};
+
+&mmc0 {
+	pinctrl-names = "default", "state_uhs";
+	pinctrl-0 = <&mmc0_pins_default>;
+	pinctrl-1 = <&mmc0_pins_uhs>;
+	bus-width = <8>;
+	cap-mmc-highspeed;
+	max-frequency = <52000000>;
+	vmmc-supply = <&reg_3p3v>;
+	no-sd;
+	no-sdio;
+	non-removable;
+	status = "okay";
+
+	card@0 {
+		compatible = "mmc-card";
+		reg = <0>;
+
+		block {
+			compatible = "block-device";
+
+			partitions {
+				block-partition-factory {
+					partname = "factory";
+
+					nvmem-layout {
+						compatible = "fixed-layout";
+						#address-cells = <1>;
+						#size-cells = <1>;
+
+						eeprom_factory_0: eeprom@0 {
+							reg = <0x0 0x1000>;
+						};
+					};
+				};
+			};
+		};
+	};
+};
+
+&eth {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mdio_pins>;
+	status = "okay";
+
+	gmac0: mac@0 {
+		compatible = "mediatek,eth-mac";
+		reg = <0>;
+		phy-mode = "2500base-x";
+		phy-handle = <&phy1>;
+	};
+
+	gmac1: mac@1 {
+		compatible = "mediatek,eth-mac";
+		reg = <1>;
+		phy-mode = "gmii";
+		phy-handle = <&int_gbe_phy>;
+	};
+};
+
+&mdio_bus {
+	phy1: ethernet-phy@1 {
+		compatible = "ethernet-phy-ieee802.3-c45";
+		reg = <1>;
+		reset-assert-us = <100000>;
+		reset-deassert-us = <100000>;
+		reset-gpios = <&pio 39 GPIO_ACTIVE_LOW>;
+		interrupts = <38 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-parent = <&pio>;
+		realtek,aldps-enable;
+	};
+};
+
+&pio {
+	mmc0_pins_default: mmc0-pins-default {
+		mux {
+			function = "flash";
+			groups = "emmc_45";
+		};
+	};
+
+	mmc0_pins_uhs: mmc0-pins-uhs {
+		mux {
+			function = "flash";
+			groups = "emmc_45";
+		};
+	};
+
+	pwm2_pins: pwm2-pins {
+		mux {
+			function = "pwm";
+			groups = "pwm2";
+		};
+	};
+};
+
+&pwm {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pwm2_pins>;
+	status = "okay";
+};
+
+&fan {
+	pwms = <&pwm 2 40000 0>;
+	status = "okay";
+};
+
+&uart0 {
+	status = "okay";
+};
+
+&usb_phy {
+	status = "okay";
+};
+
+&watchdog {
+	status = "okay";
+};
+
+&xhci {
+	vbus-supply = <&reg_5v>;
+	status = "okay";
+};
+
+&wifi {
+	nvmem-cells = <&eeprom_factory_0>;
+	nvmem-cell-names = "eeprom";
+	status = "okay";
+};

+ 0 - 10
devices/mediatek_filogic/diy/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-emmc.dts

@@ -24,7 +24,6 @@
 
 &mmc0 {
 	bus-width = <8>;
-	cap-mmc-highspeed;
 	max-frequency = <26000000>;
 	non-removable;
 	pinctrl-names = "default", "state_uhs";
@@ -56,15 +55,11 @@
 						};
 
 						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>;
 						};
 					};
 				};
@@ -88,8 +83,3 @@
 		};
 	};
 };
-
-&wifi {
-	nvmem-cells = <&eeprom_factory_0>;
-	nvmem-cell-names = "eeprom";
-};

+ 0 - 4
devices/mediatek_filogic/diy/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-nand.dts

@@ -67,15 +67,11 @@
 					#size-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>;
 					};
 				};
 			};

+ 0 - 9
devices/mediatek_filogic/diy/target/linux/mediatek/dts/mt7981b-cmcc-xr30-emmc.dts

@@ -56,15 +56,11 @@
 						};
 
 						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>;
 						};
 					};
 				};
@@ -88,8 +84,3 @@
 		};
 	};
 };
-
-&wifi {
-	nvmem-cells = <&eeprom_factory_0>;
-	nvmem-cell-names = "eeprom";
-};

+ 3 - 1
devices/mediatek_filogic/patches/08-cmcc_rax3000m.patch

@@ -13,12 +13,14 @@
 
 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata
 +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata
-@@ -13,9 +13,14 @@ case "$FIRMWARE" in
+@@ -13,9 +13,16 @@ case "$FIRMWARE" in
  		ln -sf /tmp/tp_data/MT7981_EEPROM.bin \
  			/lib/firmware/$FIRMWARE
  		;;
 +        sl,3000-emmc|\
 +        umi,uax3000e|\
++        cmcc,rax3000m-emmc|\
++        cmcc,xr30-emmc|\
  	ubnt,unifi-6-plus)
  		caldata_extract_mmc "factory" 0x0 0x1000
  		;;

+ 70 - 1
devices/mediatek_filogic/patches/99-newland.patch

@@ -53,7 +53,7 @@
 
 --- a/target/linux/mediatek/image/filogic.mk
 +++ b/target/linux/mediatek/image/filogic.mk
-@@ -1426,6 +1426,38 @@ define Device/netis_nx31
+@@ -1426,6 +1426,51 @@ define Device/netis_nx31
  endef
  TARGET_DEVICES += netis_nx31
  
@@ -88,6 +88,19 @@
 +  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
 +endef
 +TARGET_DEVICES += umi_uax3000e
++
++define Device/airpi_ap3000m
++  DEVICE_VENDOR := Airpi
++  DEVICE_MODEL := AP3000M
++  DEVICE_DTS := mt7981b-airpi-ap3000m
++  DEVICE_DTS_DIR := ../dts
++  DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 f2fsck mkf2fs
++  KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
++  KERNEL_INITRAMFS := kernel-bin | lzma | \
++        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
++  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
++endef
++TARGET_DEVICES += airpi_ap3000m
 +
  define Device/nokia_ea0326gmp
    DEVICE_VENDOR := Nokia
@@ -103,3 +116,59 @@
  	smartrg,sdg-8734)
  		CI_KERNPART="kernel"
  		CI_ROOTPART="rootfs"
+
+--- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
++++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
+@@ -68,6 +68,7 @@ mediatek_setup_interfaces()
+ 	bananapi,bpi-r3)
+ 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 sfp2" "eth1 wan"
+ 		;;
++	airpi,ap3000m|\
+ 	bananapi,bpi-r3-mini|\
+ 	edgecore,eap111|\
+ 	huasifei,wh3000|\
+@@ -164,6 +165,10 @@ mediatek_setup_macs()
+ 		wan_mac=$(mmc_get_mac_ascii u-boot-env WANMAC)
+ 		lan_mac=$(mmc_get_mac_ascii u-boot-env LANMAC)
+ 		;;
++	airpi,ap3000m)
++		lan_mac=$(macaddr_generate_from_mmc_cid mmcblk0)
++		wan_mac=$(macaddr_add "$lan_mac" 1)
++		;;
+ 	bananapi,bpi-r3|\
+ 	bananapi,bpi-r3-mini|\
+ 	bananapi,bpi-r4)
+
+--- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
++++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
+@@ -27,6 +27,11 @@ case "$board" in
+ 		[ "$PHYNBR" = "0" ] && mmc_get_mac_ascii u-boot-env 2gMAC > /sys${DEVPATH}/macaddress
+ 		[ "$PHYNBR" = "1" ] && mmc_get_mac_ascii u-boot-env 5gMAC > /sys${DEVPATH}/macaddress
+ 		;;
++	airpi,ap3000m)
++		addr=$(macaddr_generate_from_mmc_cid mmcblk0)
++		[ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress
++		[ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress
++		;;
+ 	asus,rt-ax59u)
+ 		CI_UBIPART="UBI_DEV"
+ 		addr=$(mtd_get_mac_binary_ubi "Factory" 0x4)
+
+--- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
++++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
+@@ -100,6 +100,7 @@ platform_do_upgrade() {
+ 	acer,predator-w6|\
+ 	acer,predator-w6d|\
+ 	acer,vero-w6m|\
++	airpi,ap3000m|\
+ 	arcadyan,mozart|\
+ 	glinet,gl-mt2500|\
+ 	glinet,gl-mt6000|\
+@@ -226,6 +227,7 @@ platform_copy_config() {
+ 	acer,predator-w6|\
+ 	acer,predator-w6d|\
+ 	acer,vero-w6m|\
++ 	airpi,ap3000m|\
+ 	arcadyan,mozart|\
+ 	glinet,gl-mt2500|\
+ 	glinet,gl-mt6000|\

+ 0 - 13
devices/qualcommax_ipq50xx/.config

@@ -4,16 +4,3 @@ CONFIG_TARGET_qualcommax_ipq50xx=y
 CONFIG_TARGET_MULTI_PROFILE=y
 CONFIG_TARGET_ALL_PROFILES=y
 
-CONFIG_PACKAGE_kmod-qca-nss-drv-ipsecmgr=n
-CONFIG_PACKAGE_kmod-qca-nss-drv-ovpn-mgr=n
-CONFIG_PACKAGE_kmod-qca-nss-drv-ovpn-link=n
-CONFIG_PACKAGE_kmod-qca-nss-drv-match=n
-CONFIG_PACKAGE_kmod-qca-nss-drv-map-t=n
-CONFIG_PACKAGE_kmod-qca-nss-drv-tunipip6=n
-CONFIG_PACKAGE_kmod-qca-nss-drv-netlink=n
-
-CONFIG_PACKAGE_kmod-qca-nss-cfi-cryptoapi=n
-CONFIG_PACKAGE_kmod-qca-nss-crypto=n
-CONFIG_PACKAGE_kmod-qca-nss-drv-tlsmgr=n
-CONFIG_PACKAGE_kmod-qca-nss-drv-dtlsmgr=n
-

+ 9 - 8
devices/qualcommax_ipq50xx/diy.sh

@@ -4,16 +4,17 @@ shopt -s extglob
 
 SHELL_FOLDER=$(dirname $(readlink -f "$0"))
 
-rm -rf package/boot package/kernel/qca* package/firmware/ipq-wifi target/linux/qualcommax target/linux/generic package/devel/perf
+rm -rf package/boot package/firmware/ipq-wifi target/linux/qualcommax target/linux/generic package/kernel package/firmware/ath11k-firmware
 
-git_clone_path master https://github.com/coolsnowwolf/lede target/linux/qualcommax target/linux/generic package/boot package/qca package/firmware/ipq-wifi
+git_clone_path main https://github.com/openwrt/openwrt target/linux/qualcommax target/linux/generic package/kernel package/boot package/firmware/ipq-wifi package/firmware/ath11k-firmware
 
-wget -N https://github.com/coolsnowwolf/lede/raw/master/include/kernel-6.6 -P include/
+wget -N https://github.com/openwrt/openwrt/raw/refs/heads/main/include/kernel-version.mk -P include/
+wget -N https://raw.githubusercontent.com/openwrt/openwrt/refs/heads/main/include/image-commands.mk -P include/
+wget -N https://raw.githubusercontent.com/openwrt/openwrt/refs/heads/main/scripts/mkits-qsdk-ipq-image.sh -P scripts/
+wget -N https://raw.githubusercontent.com/openwrt/openwrt/refs/heads/main/config/Config-kernel.in -P config/
 
-sed -i -e "s/wpad-openssl/wpad-basic-mbedtls/" \
-	   -e "/KERNEL_TESTING_PATCHVER/d" \
-	   -e "s/KERNEL_PATCHVER:=6.12/KERNEL_PATCHVER:=6.6/" \
-target/linux/qualcommax/Makefile
+rm -rf feeds/kiddin9/xtables-wgobfs package/devel/perf package/feeds/packages/{ovpn-dco,xr_usb_serial_common,openvswitch,xtables-addons}
 
-sed -i "/ECM_INTERFACE_MAP_T_ENABLE/d"  package/qca/qca-nss-ecm/Makefile
+git_clone_path master https://github.com/coolsnowwolf/lede mv target/linux/generic/hack-6.12
+wget -N https://raw.githubusercontent.com/coolsnowwolf/lede/refs/heads/master/target/linux/generic/pending-6.12/613-netfilter_optional_tcp_window_check.patch -P target/linux/generic/pending-6.12/
 

+ 461 - 0
devices/qualcommax_ipq50xx/diy/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-re-cs-03.dts

@@ -0,0 +1,461 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+/dts-v1/;
+
+#include "ipq5018.dtsi"
+#include "ipq5018-ess.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	#address-cells = <0x2>;
+	#size-cells = <0x2>;
+	model = "JDCloud RE-CS-03";
+	compatible = "jdcloud,re-cs-03", "qcom,ipq5018";
+	interrupt-parent = <&intc>;
+
+	aliases {
+		sdhc1 = &sdhc_1;
+		serial0 = &blsp1_uart1;
+		ethernet0 = "/soc/dp1";
+		ethernet1 = "/soc/dp2";
+
+		led-boot = &led_red;
+		led-failsafe = &led_red;
+		led-running = &led_blue;
+		led-upgrade = &led_green;
+	};
+
+	chosen {
+		stdout-path = "serial0";
+		bootargs-append = " swiotlb=1 coherent_pool=2M";
+	};
+
+	reserved-memory {
+		q6_mem_regions: q6_mem_regions@4B000000 {
+			no-map;
+			reg = <0x0 0x4B000000 0x0 0x3900000>;
+		};
+
+		q6_code_data: q6_code_data@4B000000 {
+			no-map;
+			reg = <0x0 0x4B000000 0x0 01000000>;
+		};
+
+		q6_ipq5018_data: q6_ipq5018_data@4C000000 {
+			no-map;
+			reg = <0x0 0x4C000000 0x0 0xE00000>;
+		};
+
+		m3_dump: m3_dump@4CE00000 {
+			no-map;
+			reg = <0x0 0x4CE00000 0x0 0x100000>;
+		};
+
+		q6_etr_region: q6_etr_dump@4CF00000 {
+			no-map;
+			reg = <0x0 0x4CF00000 0x0 0x100000>;
+		};
+
+		q6_caldb_region: q6_caldb_region@4D000000 {
+			no-map;
+			reg = <0x0 0x4D000000 0x0 0x200000>;
+		};
+
+		q6_qcn6122_data1: q6_qcn6122_data1@4D200000 {
+			no-map;
+			reg = <0x0 0x4D200000 0x0 0x1000000>;
+		};
+
+		m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 {
+			no-map;
+			reg = <0x0 0x4E200000 0x0 0x100000>;
+		};
+
+		q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 {
+			no-map;
+			reg = <0x0 0x4E300000 0x0 0x100000>;
+		};
+
+		q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E400000 {
+			no-map;
+			reg = <0x0 0x4E400000 0x0 0x500000>;
+		};
+	};
+
+	soc {
+		ess-instance {
+			num_devices = <0x2>;
+
+			ess-switch@0x39c00000 {
+				compatible = "qcom,ess-switch-ipq50xx";
+				device_id = <0>;
+				switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/
+				cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/
+
+				qcom,port_phyinfo {
+					port@0 {
+						port_id = <1>;
+						phy_address = <7>;
+					};
+					port@1 {
+						port_id = <2>;
+						forced-speed = <1000>;
+						forced-duplex = <1>;
+					};
+				};
+			};
+
+			ess-switch1@1 {
+				compatible = "qcom,ess-switch-qca83xx";
+				device_id = <1>;
+				switch_access_mode = "mdio";
+				mdio-bus = <&mdio1>;
+				reset_gpio = <&tlmm 39 0>;
+				switch_cpu_bmp = <0x40>;  /* cpu port bitmap */
+				switch_lan_bmp = <0x1e>; /* lan port bitmap */
+				switch_wan_bmp = <0x0>;  /* wan port bitmap */
+
+				qca,ar8327-initvals = <
+						0x00004 0x7600000   /* PAD0_MODE */
+						0x00008 0x1000000   /* PAD5_MODE */
+						0x0000c 0x80        /* PAD6_MODE */
+						0x00010 0x2613a0    /* PORT6 FORCE MODE*/
+						0x000e4 0xaa545     /* MAC_POWER_SEL */
+						0x000e0 0xc74164de  /* SGMII_CTRL */
+						0x0007c 0x4e        /* PORT0_STATUS */
+						0x00094 0x4e        /* PORT6_STATUS */
+				>;
+				qcom,port_phyinfo {
+					port@0 {
+						port_id = <1>;
+						phy_address = <0>;
+					};
+					port@1 {
+						port_id = <2>;
+						phy_address = <1>;
+					};
+					port@2 {
+						port_id = <3>;
+						phy_address = <2>;
+					};
+					port@3 {
+						port_id = <4>;
+						phy_address = <3>;
+					};
+				};
+			};
+		};
+
+		dp1 {
+			device_type = "network";
+			compatible = "qcom,nss-dp";
+			clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>;
+			clock-names = "nss-snoc-gmac-axi-clk";
+			qcom,id = <1>;
+			reg = <0x39C00000 0x10000>;
+			interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
+			qcom,mactype = <2>;
+			qcom,link-poll = <1>;
+			qcom,phy-mdio-addr = <7>;
+			mdio-bus = <&mdio0>;
+			local-mac-address = [000000000000];
+			phy-mode = "sgmii";
+			qcom,rx-page-mode = <0>;
+		};
+
+		dp2 {
+			device_type = "network";
+			compatible = "qcom,nss-dp";
+			clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>;
+			clock-names = "nss-snoc-gmac-axi-clk";
+			qcom,id = <2>;
+			reg = <0x39D00000 0x10000>;
+			interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
+			qcom,mactype = <2>;
+			local-mac-address = [000000000000];
+			phy-mode = "sgmii";
+			qcom,rx-page-mode = <0>;
+		};
+	};
+
+	keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		reset {
+			label = "reset";
+			linux,code = <KEY_RESTART>;
+			gpios = <&tlmm 25 GPIO_ACTIVE_LOW>;
+			linux,input-type = <1>;
+			debounce-interval = <60>;
+		};
+
+		wps {
+			label = "wps";
+			linux,code = <KEY_WPS_BUTTON>;
+			gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
+			linux,input-type = <1>;
+			debounce-interval = <60>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&leds_pins>;
+		pinctrl-names = "default";
+
+		led_blue: status_blue {
+			label = "blue:status";
+			gpio = <&tlmm 31 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_green: status_green {
+			label = "green:status";
+			gpio = <&tlmm 32 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_red: status_red {
+			label = "red:status";
+			gpio = <&tlmm 33 GPIO_ACTIVE_HIGH>;
+		};
+	};
+};
+
+&blsp1_uart1 {
+	status = "ok";
+};
+
+&mdio0 {
+	status = "ok";
+
+	ethernet-phy@0 {
+		reg = <7>;
+	};
+};
+
+&mdio1 {
+	pinctrl-0 = <&mdio1_pins>;
+	pinctrl-names = "default";
+	phy-reset-gpio = <&tlmm 39 0>;
+	status = "ok";
+
+	ethernet-phy@0 {
+		reg = <0>;
+	};
+
+	ethernet-phy@1 {
+		reg = <1>;
+	};
+
+	ethernet-phy@2 {
+		reg = <2>;
+	};
+
+	ethernet-phy@3 {
+		reg = <3>;
+	};
+};
+
+&q6v5_wcss {
+	compatible = "qcom,ipq5018-q6-mpd";
+	firmware = "IPQ5018/q6_fw.mdt";
+	#address-cells = <1>;
+	#size-cells = <1>;
+	ranges;
+
+	reg = <0x0cd00000 0x4040>,
+	      <0x1938000 0x8>,
+	      <0x193d204 0x4>;
+	reg-names = "qdsp6",
+		    "tcsr-msip",
+		    "tcsr-q6";
+	resets = <&gcc GCC_WCSSAON_RESET>,
+		 <&gcc GCC_WCSS_Q6_BCR>;
+
+	reset-names = "wcss_aon_reset",
+		      "wcss_q6_reset";
+
+	clocks = <&gcc GCC_Q6_AXIS_CLK>,
+		 <&gcc GCC_WCSS_ECAHB_CLK>,
+		 <&gcc GCC_Q6_AXIM_CLK>,
+		 <&gcc GCC_Q6_AXIM2_CLK>,
+		 <&gcc GCC_Q6_AHB_CLK>,
+		 <&gcc GCC_Q6_AHB_S_CLK>,
+		 <&gcc GCC_WCSS_AXI_S_CLK>;
+	clock-names = "gcc_q6_axis_clk",
+		      "gcc_wcss_ecahb_clk",
+		      "gcc_q6_axim_clk",
+		      "gcc_q6_axim2_clk",
+		      "gcc_q6_ahb_clk",
+		      "gcc_q6_ahb_s_clk",
+		      "gcc_wcss_axi_s_clk";
+
+	memory-region = <&q6_mem_regions>, <&q6_etr_region>,
+			<&q6_caldb_region>;
+
+	qcom,rproc = <&q6v5_wcss>;
+	qcom,bootargs_smem = <507>;
+	boot-args = <0x1 0x4 0x3 0x0F 0x0 0x0>,
+		    <0x2 0x4 0x2 0x12 0x0 0x0>;
+
+	q6_wcss_pd1: remoteproc_pd1@4ab000 {
+		compatible = "qcom,ipq5018-wcss-ahb-mpd";
+		firmware = "IPQ5018/q6_fw.mdt";
+		m3_firmware = "IPQ5018/m3_fw.mdt";
+
+		reg = <0x4ab000 0x20>;
+		reg-names = "rmb";
+
+		interrupts-extended = <&wcss_smp2p_in 8 0>,
+				      <&wcss_smp2p_in 9 0>,
+				      <&wcss_smp2p_in 12 0>,
+				      <&wcss_smp2p_in 11 0>;
+		interrupt-names = "fatal",
+				  "ready",
+				  "spawn-ack",
+				  "stop-ack";
+
+		resets = <&gcc GCC_WCSSAON_RESET>,
+			 <&gcc GCC_WCSS_BCR>,
+			 <&gcc GCC_CE_BCR>;
+		reset-names = "wcss_aon_reset",
+			      "wcss_reset",
+			      "ce_reset";
+
+		clocks = <&gcc GCC_WCSS_AHB_S_CLK>,
+			 <&gcc GCC_WCSS_ACMT_CLK>,
+			 <&gcc GCC_WCSS_AXI_M_CLK>;
+		clock-names = "gcc_wcss_ahb_s_clk",
+			      "gcc_wcss_acmt_clk",
+			      "gcc_wcss_axi_m_clk";
+
+		// qcom,halt-regs = <&tcsr_q6_block 0xa000 0xd000 0x0>;
+
+		qcom,smem-states = <&wcss_smp2p_out 8>,
+				   <&wcss_smp2p_out 9>,
+				   <&wcss_smp2p_out 10>;
+		qcom,smem-state-names = "shutdown",
+					"stop",
+					"spawn";
+		memory-region = <&q6_ipq5018_data>, <&m3_dump>,
+				<&q6_etr_region>, <&q6_caldb_region>;
+	};
+
+	q6_wcss_pd2: remoteproc_pd2 {
+		compatible = "qcom,ipq5018-wcss-pcie-mpd";
+		firmware = "IPQ5018/q6_fw.mdt";
+		m3_firmware = "qcn6122/m3_fw.mdt";
+
+		interrupts-extended = <&wcss_smp2p_in 16 0>,
+				      <&wcss_smp2p_in 17 0>,
+				      <&wcss_smp2p_in 20 0>,
+				      <&wcss_smp2p_in 19 0>;
+		interrupt-names = "fatal",
+				  "ready",
+				  "spawn-ack",
+				  "stop-ack";
+
+		qcom,smem-states = <&wcss_smp2p_out 16>,
+				   <&wcss_smp2p_out 17>,
+				   <&wcss_smp2p_out 18>;
+		qcom,smem-state-names = "shutdown",
+					"stop",
+					"spawn";
+		memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>,
+				<&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>;
+	};
+};
+
+&sdhc_1 {
+	pinctrl-0 = <&emmc_pins>;
+	pinctrl-names = "default";
+	status = "ok";
+};
+
+&tlmm {
+	button_pins: button_pins {
+		mux {
+			pins = "gpio25", "gpio38";
+			function = "gpio";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+	};
+
+	leds_pins: leds_pins {
+		mux {
+			pins = "gpio31", "gpio32", "gpio33";
+			function = "gpio";
+			drive-strength = <8>;
+			bias-pull-down;
+			output-low;
+		};
+	};
+
+	mdio1_pins: mdio_pinmux {
+		mux_0 {
+			pins = "gpio36";
+			function = "mdc";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+		mux_1 {
+			pins = "gpio37";
+			function = "mdio";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+	};
+
+	emmc_pins: emmc_pins {
+		emmc_clk {
+			pins = "gpio9";
+			function = "sdc1_clk";
+			drive-strength = <8>;
+			bias-disable;
+		};
+
+		emmc_cmd {
+			pins = "gpio8";
+			function = "sdc1_cmd";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+
+		emmc_data {
+			pins = "gpio4", "gpio5", "gpio6", "gpio7";
+			function = "sdc1_data";
+			drive-strength = <8>;
+			bias-disable;
+		};
+	};
+};
+
+&wifi0 {
+	qcom,multipd_arch;
+	qcom,userpd-subsys-name = "q6v5_wcss_userpd1";
+	qcom,rproc = <&q6_wcss_pd1>;
+	qcom,board_id = <0x24>;
+	qcom,bdf-addr = <0x0 0x4C000000 0x4C000000 0x0 0x0>;
+	qcom,caldb-addr = <0x0 0x4D000000 0 0 0>;
+	mem-region = <&q6_ipq5018_data>;
+	qcom,caldb-size = <0x200000>;
+	status = "ok";
+};
+
+&wifi1 {
+	qcom,multipd_arch;
+	qcom,userpd-subsys-name = "q6v5_wcss_userpd2";
+	qcom,rproc = <&q6_wcss_pd2>;
+	qcom,tgt-mem-mode = <1>;
+	qcom,board_id = <0x60>;
+	qcom,bdf-addr = <0x0 0x4D200000 0x4CF00000 0x0 0x0>;
+	qcom,caldb-addr = <0x0 0x4E400000 0 0 0>;
+	mem-region = <&q6_qcn6122_data1>;
+	qcom,caldb-size = <0x500000>;
+	status = "ok";
+};

+ 91 - 10
devices/qualcommax_ipq50xx/patches/fix.patch

@@ -1,13 +1,94 @@
---- a/package/kernel/linux/modules/netfilter.mk
-+++ b/package/kernel/linux/modules/netfilter.mk
-@@ -330,7 +330,7 @@ define KernelPackage/ipt-ipopt
-   KCONFIG:=$(KCONFIG_IPT_IPOPT)
-   FILES:=$(foreach mod,$(IPT_IPOPT-m),$(LINUX_DIR)/net/$(mod).ko)
-   AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_IPOPT-m)))
--  $(call AddDepends/ipt)
-+  $(call AddDepends/ipt,+kmod-nf-conntrack)
- endef
+--- a/include/target.mk
++++ b/include/target.mk
+@@ -155,11 +155,12 @@ ifeq ($(TARGET_BUILD),1)
+   endif
+ endif
+ 
++GENERIC_PLATFORM_DIR := $(TOPDIR)/target/linux/generic
++
+ ifneq ($(TARGET_BUILD)$(if $(DUMP),,1),)
+   include $(INCLUDE_DIR)/kernel-version.mk
+ endif
  
- define KernelPackage/ipt-ipopt/description
+-GENERIC_PLATFORM_DIR := $(TOPDIR)/target/linux/generic
+ GENERIC_BACKPORT_DIR := $(GENERIC_PLATFORM_DIR)/backport$(if $(wildcard $(GENERIC_PLATFORM_DIR)/backport-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER))
+ GENERIC_PATCH_DIR := $(GENERIC_PLATFORM_DIR)/pending$(if $(wildcard $(GENERIC_PLATFORM_DIR)/pending-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER))
+ GENERIC_HACK_DIR := $(GENERIC_PLATFORM_DIR)/hack$(if $(wildcard $(GENERIC_PLATFORM_DIR)/hack-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER))
+diff --git a/target/linux/qualcommax/patches-6.12/999-fix-netdev-cacheline-size.patch b/target/linux/qualcommax/patches-6.12/999-fix-netdev-cacheline-size.patch
+new file mode 100644
+index 00000000000000..1481f8844bf45e
+--- /dev/null
++++ b/target/linux/qualcommax/patches-6.12/999-fix-netdev-cacheline-size.patch
+@@ -0,0 +1,11 @@
++--- a/net/core/dev.c
+++++ b/net/core/dev.c
++@@ -12060,7 +12060,7 @@ static void __init net_dev_struct_check(void)
++ #ifdef CONFIG_NET_XGRESS
++ 	CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, tcx_egress);
++ #endif
++-	CACHELINE_ASSERT_GROUP_SIZE(struct net_device, net_device_read_tx, 160);
+++	CACHELINE_ASSERT_GROUP_SIZE(struct net_device, net_device_read_tx, 192);
++ 
++ 	/* TXRX read-mostly hotpath */
++ 	CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_txrx, lstats);
 
+--- a/target/linux/qualcommax/image/ipq50xx.mk
++++ b/target/linux/qualcommax/image/ipq50xx.mk
+@@ -57,6 +57,18 @@ define Device/glinet_gl-b3000
+ endef
+ TARGET_DEVICES += glinet_gl-b3000
  
++define Device/jdcloud_re-cs-03
++	$(call Device/FitImage)
++	$(call Device/EmmcImage)
++	SOC := ipq5018
++	BLOCKSIZE := 64k
++	KERNEL_SIZE := 6144k
++	DEVICE_VENDOR := JDCloud
++	DEVICE_MODEL := AX3000
++	DEVICE_DTS_CONFIG := [email protected]
++endef
++TARGET_DEVICES += jdcloud_re-cs-03
++
+ define Device/iodata_wn-dax3000gr
+ 	$(call Device/FitImageLzma)
+ 	DEVICE_VENDOR := I-O DATA
+
+--- a/target/linux/qualcommax/ipq50xx/base-files/etc/board.d/02_network
++++ b/target/linux/qualcommax/ipq50xx/base-files/etc/board.d/02_network
+@@ -15,6 +15,7 @@ ipq50xx_setup_interfaces()
+ 	glinet,gl-b3000)
+ 		ucidef_set_interfaces_lan_wan "lan1 lan2" "wan"
+ 		;;
++	jdcloud,re-cs-03|\
+ 	linksys,mx2000|\
+ 	linksys,mx5500|\
+ 	linksys,spnmx56|\
+
+--- a/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh
++++ b/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh
+@@ -120,6 +120,11 @@ platform_do_upgrade() {
+ 	glinet,gl-b3000)
+ 		glinet_do_upgrade "$1"
+ 		;;
++  	jdcloud,re-cs-03)
++		CI_KERNPART="0:HLOS"
++		CI_ROOTPART="rootfs"
++		emmc_do_upgrade "$1"
++		;;
+ 	linksys,mr5500|\
+ 	linksys,mx2000|\
+ 	linksys,mx5500|\
+@@ -157,3 +162,12 @@ platform_do_upgrade() {
+ 		;;
+ 	esac
+ }
++
++platform_copy_config() {
++	case "$(board_name)" in
++	jdcloud,re-cs-03)
++		emmc_copy_config
++		;;
++	esac
++	return 0;
++}

+ 2 - 7
devices/qualcommax_ipq60xx/diy.sh

@@ -9,17 +9,12 @@ rm -rf package/boot package/firmware/ipq-wifi target/linux/qualcommax target/lin
 git_clone_path k6.12-nss https://github.com/LiBwrt/openwrt-6.x target/linux/qualcommax target/linux/generic package/kernel package/boot package/firmware/ipq-wifi package/firmware/ath11k-firmware
 
 wget -N https://github.com/openwrt/openwrt/raw/refs/heads/main/include/kernel-version.mk -P include/
-wget -N https://github.com/openwrt/openwrt/raw/refs/heads/main/include/target.mk -P include/
+wget -N https://raw.githubusercontent.com/openwrt/openwrt/refs/heads/main/config/Config-kernel.in -P config/
 wget -N https://github.com/LiBwrt/openwrt-6.x/raw/refs/heads/k6.12-nss/include/image-commands.mk -P include/
 wget -N https://github.com/LiBwrt/openwrt-6.x/raw/refs/heads/k6.12-nss/scripts/tplink-mkimage-2022.py -P scripts/
 wget -N https://github.com/LiBwrt/openwrt-6.x/raw/refs/heads/k6.12-nss/config/Config-ipq.in -P config/
 wget -N https://github.com/LiBwrt/openwrt-6.x/raw/refs/heads/k6.12-nss/Config.in -P ./
 
-sed -i "s/DEFAULT_PACKAGES:=/DEFAULT_PACKAGES:=luci-app-advancedplus luci-app-firewall luci-app-package-manager luci-app-upnp luci-app-syscontrol luci-proto-wireguard \
-luci-app-wizard luci-base luci-compat luci-lib-ipkg luci-lib-fs luci-app-log-viewer \
-coremark wget-ssl curl autocore htop nano zram-swap kmod-lib-zstd kmod-tcp-bbr bash openssh-sftp-server block-mount resolveip ds-lite swconfig luci-app-fan luci-app-filemanager /" include/target.mk
-sed -i "s/procd-ujail//" include/target.mk
-
 chmod +x scripts/tplink-mkimage-2022.py
 
 git clone https://github.com/qosmio/nss-packages.git package/nss-packages
@@ -27,6 +22,6 @@ git clone https://github.com/qosmio/sqm-scripts-nss.git package/sqm-scripts-nss
 
 sed -i "/ECM_INTERFACE_RAWIP_ENABLE/d"  package/nss-packages/qca-nss-ecm/Makefile
 
-rm -rf package/feeds/kiddin9/{xtables-wgobfs,shortcut-fe} package/devel/perf package/feeds/packages/{ovpn-dco,xr_usb_serial_common,openvswitch,xtables-addons}
+rm -rf feeds/kiddin9/{xtables-wgobfs,shortcut-fe} package/devel/perf package/feeds/packages/{ovpn-dco,xr_usb_serial_common,openvswitch,xtables-addons}
 
 sed -i "s/luci uboot-envtools wpad-openssl/luci uboot-envtools wpad-mbedtls/" target/linux/qualcommax/Makefile

+ 17 - 17
devices/qualcommax_ipq60xx/patches/fix.patch

@@ -18,20 +18,20 @@
  	KERNEL_SIZE := 6144k
  	BLOCKSIZE := 128k
  	SOC := ipq6010
-diff --git a/target/linux/qualcommax/patches-6.12/999-fix-netdev-cacheline-size.patch b/target/linux/qualcommax/patches-6.12/999-fix-netdev-cacheline-size.patch
-new file mode 100644
-index 00000000000000..1481f8844bf45e
---- /dev/null
-+++ b/target/linux/qualcommax/patches-6.12/999-fix-netdev-cacheline-size.patch
-@@ -0,0 +1,11 @@
-+--- a/net/core/dev.c
-++++ b/net/core/dev.c
-+@@ -12060,7 +12060,7 @@ static void __init net_dev_struct_check(void)
-+ #ifdef CONFIG_NET_XGRESS
-+ 	CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_tx, tcx_egress);
-+ #endif
-+-	CACHELINE_ASSERT_GROUP_SIZE(struct net_device, net_device_read_tx, 160);
-++	CACHELINE_ASSERT_GROUP_SIZE(struct net_device, net_device_read_tx, 192);
-+ 
-+ 	/* TXRX read-mostly hotpath */
-+ 	CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_txrx, lstats);
+
+--- a/include/target.mk
++++ b/include/target.mk
+@@ -155,11 +155,12 @@ ifeq ($(TARGET_BUILD),1)
+   endif
+ endif
+ 
++GENERIC_PLATFORM_DIR := $(TOPDIR)/target/linux/generic
++
+ ifneq ($(TARGET_BUILD)$(if $(DUMP),,1),)
+   include $(INCLUDE_DIR)/kernel-version.mk
+ endif
+ 
+-GENERIC_PLATFORM_DIR := $(TOPDIR)/target/linux/generic
+ GENERIC_BACKPORT_DIR := $(GENERIC_PLATFORM_DIR)/backport$(if $(wildcard $(GENERIC_PLATFORM_DIR)/backport-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER))
+ GENERIC_PATCH_DIR := $(GENERIC_PLATFORM_DIR)/pending$(if $(wildcard $(GENERIC_PLATFORM_DIR)/pending-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER))
+ GENERIC_HACK_DIR := $(GENERIC_PLATFORM_DIR)/hack$(if $(wildcard $(GENERIC_PLATFORM_DIR)/hack-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER))