]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
mediatek: filogic: add support for Cudy AP3000 Wall v1 21890/head
authorDerek Denk <derek.denk@live.com>
Wed, 31 Dec 2025 00:34:47 +0000 (17:34 -0700)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 7 Feb 2026 16:30:03 +0000 (17:30 +0100)
This commit adds support for the Cudy AP3000 Wall v1.

SoC: MediaTek MT7981b
RAM: 256MiB
Flash: spi-nand spi0.0: 128 MiB
Wifi: MediaTek MT7981 2x2 DBDC 802.11ax 2T2R (2.4 / 5)
LEDs: 1 LED in two colors (red & white)
Buttons: 1 reset, 1 led on/off
Ethernet: 5x 1GbE
Power: PoE powered (standalone)

The stock firmware is a customized variant of OpenWrt, which implements
a signature check that only allows flashing official firmware. Cudy offers
intermediate OpenWrt firmware images on their website [1][2] which do not
implement the signature check. After flashing the intermediate image the
upstream official OpenWrt image can be installed.

The stock firmware can be recovered via TFTP using the U-Boot based boot
loader[3]. Set up a TFTP server on your computer with IP 192.168.1.88/24
serving the stock firmware from Cudy's website renamed to "recovery.bin".
Press and hold the reset button while powering on the device, wait for the
TFTP server to send the recovery.bin file, then release the reset button.
The router will take a couple of minutes to reboot and set up the stock
firmware.

[1] https://www.cudy.com/blogs/faq/openwrt-software-download
[2] https://drive.google.com/drive/folders/1BKVarlwlNxf7uJUtRhuMGUqeCa5KpMnj
[3] https://www.cudy.com/en-us/blogs/faq/how-to-recovery-the-cudy-router-from-openwrt-firmware-to-cudy-official-firmware

Signed-off-by: Derek Denk <derek.denk@live.com>
Link: https://github.com/openwrt/openwrt/pull/21266
(cherry picked from commit afad4c71f8d558ca86b997781ca0236f321cf1e9)
Link: https://github.com/openwrt/openwrt/pull/21890
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/mediatek/dts/mt7981b-cudy-ap3000wall-v1.dts [new file with mode: 0644]
target/linux/mediatek/filogic/base-files/etc/board.d/02_network
target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
target/linux/mediatek/image/filogic.mk

diff --git a/target/linux/mediatek/dts/mt7981b-cudy-ap3000wall-v1.dts b/target/linux/mediatek/dts/mt7981b-cudy-ap3000wall-v1.dts
new file mode 100644 (file)
index 0000000..adcbfdd
--- /dev/null
@@ -0,0 +1,276 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+/dts-v1/;
+
+#include <dt-bindings/leds/common.h>
+
+#include "mt7981b.dtsi"
+
+/ {
+       model = "Cudy AP3000 Wall v1";
+       compatible = "cudy,ap3000wall-v1", "mediatek,mt7981";
+
+       aliases {
+               label-mac-device = &gmac0;
+               led-boot = &led_status_white;
+               led-failsafe = &led_status_red;
+               led-running = &led_status_white;
+               led-upgrade = &led_status_red;
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+
+               reset {
+                       label = "reset";
+                       linux,code = <KEY_RESTART>;
+                       gpios = <&pio 1 GPIO_ACTIVE_LOW>;
+               };
+
+               lights_toggle {
+                       label = "lights_toggle";
+                       linux,code = <KEY_LIGHTS_TOGGLE>;
+                       gpios = <&pio 35 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+
+               led_status_red: led@0 {
+                       label = "red:status";
+                       function = LED_FUNCTION_POWER;
+                       color = <LED_COLOR_ID_RED>;
+                       gpios = <&pio 4 GPIO_ACTIVE_LOW>;
+               };
+
+               led_status_white: led@1 {
+                       label = "white:status";
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_WHITE>;
+                       gpios = <&pio 10 GPIO_ACTIVE_LOW>;
+               };
+
+       };
+
+       gpio_export {
+               compatible = "gpio-export";
+
+               poe_passthrough {
+                       gpio-export,name = "poe-passthrough";
+                       gpio-export,output = <0>;
+                       gpios = <&pio 12 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       watchdog-hw {
+               compatible = "linux,wdt-gpio";
+               gpios = <&pio 6 GPIO_ACTIVE_HIGH>;
+               hw_algo = "level";
+               hw_margin_ms = <10000>;
+               always-running;
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
+
+&watchdog {
+       status = "okay";
+};
+
+&eth {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mdio_pins>;
+       status = "okay";
+
+       gmac0: mac@0 {
+               compatible = "mediatek,eth-mac";
+               reg = <0>;
+               phy-mode = "2500base-x";
+               nvmem-cell-names = "mac-address";
+               nvmem-cells = <&macaddr_bdinfo_de00 0>;
+               fixed-link {
+                       speed = <2500>;
+                       full-duplex;
+                       pause;
+               };
+       };
+};
+
+&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: flash@0 {
+               compatible = "spi-nand";
+               reg = <0>;
+               spi-max-frequency = <52000000>;
+
+               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>;
+
+               spi-tx-bus-width = <4>;
+               spi-rx-bus-width = <4>;
+               mediatek,nmbm;
+               mediatek,bmt-max-ratio = <1>;
+               mediatek,bmt-max-reserved-blocks = <64>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "BL2";
+                               reg = <0x00000 0x0100000>;
+                               read-only;
+                       };
+
+                       partition@100000 {
+                               label = "u-boot-env";
+                               reg = <0x0100000 0x0080000>;
+                               read-only;
+                       };
+
+                       factory: partition@180000 {
+                               label = "Factory";
+                               reg = <0x180000 0x0200000>;
+                               read-only;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       eeprom_factory_0: eeprom@0 {
+                                               reg = <0x0 0x1000>;
+                                       };
+                               };
+                       };
+
+                       partition@380000 {
+                               label = "bdinfo";
+                               reg = <0x380000 0x0040000>;
+                               read-only;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       macaddr_bdinfo_de00: macaddr@de00 {
+                                               compatible = "mac-base";
+                                               reg = <0xde00 0x6>;
+                                               #nvmem-cell-cells = <1>;
+                                       };
+                               };
+                       };
+
+                       partition@3c0000 {
+                               label = "FIP";
+                               reg = <0x3c0000 0x0200000>;
+                               read-only;
+                       };
+
+                       partition@5c0000 {
+                               label = "ubi";
+                               reg = <0x5c0000 0x4000000>;
+                               compatible = "linux,ubi";
+                       };
+               };
+       };
+};
+
+&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 = <MTK_DRIVE_8mA>;
+                       bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
+               };
+               conf-pd {
+                       pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
+                       drive-strength = <MTK_DRIVE_8mA>;
+                       bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
+               };
+       };
+};
+
+&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@3 {
+                       reg = <3>;
+                       label = "lan4";
+               };
+
+               port@4 {
+                       reg = <4>;
+                       label = "lan5";
+               };
+
+               port@6 {
+                       reg = <6>;
+                       label = "cpu";
+                       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";
+};
index b57ac5e41fd680104be32b5f6e9315d30d8f07cc..fd7c159aab67caf43f46957cd72c31ff6916ab9d 100644 (file)
@@ -101,6 +101,9 @@ mediatek_setup_interfaces()
        comfast,cf-e393ax)
                ucidef_set_interfaces_lan_wan "lan1" eth1
                ;;
+       cudy,ap3000wall-v1)
+               ucidef_set_interface_lan "lan1 lan2 lan3 lan4 lan5"
+               ;;
        cudy,ap3000outdoor-v1|\
        cudy,ap3000-v1|\
        cudy,re3000-v1|\
index 08c11309affa7e2f69475855445e46425dcc8322..907dd00d364c028e76c23b527f41072a46e052b6 100644 (file)
@@ -89,6 +89,7 @@ case "$board" in
                [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress
                ;;
        cudy,ap3000outdoor-v1|\
+       cudy,ap3000wall-v1|\
        cudy,ap3000-v1|\
        cudy,m3000-v1|\
        cudy,re3000-v1|\
index 563ffed40b55d597f261eaf9419c6b71c6dd08ac..fe9563e5ea6779f382a82b8149651dac9ca927be 100644 (file)
@@ -1041,6 +1041,23 @@ define Device/cudy_ap3000outdoor-v1
 endef
 TARGET_DEVICES += cudy_ap3000outdoor-v1
 
+define Device/cudy_ap3000wall-v1
+  DEVICE_VENDOR := Cudy
+  DEVICE_MODEL := AP3000 Wall
+  DEVICE_VARIANT := v1
+  DEVICE_DTS := mt7981b-cudy-ap3000wall-v1
+  DEVICE_DTS_DIR := ../dts
+  SUPPORTED_DEVICES += R68
+  UBINIZE_OPTS := -E 5
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  IMAGE_SIZE := 65536k
+  KERNEL_IN_UBI := 1
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+  DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
+endef
+TARGET_DEVICES += cudy_ap3000wall-v1
+
 define Device/cudy_ap3000-v1
   DEVICE_VENDOR := Cudy
   DEVICE_MODEL := AP3000