]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
ramips: mt7621: add support for Arcadyan WE410443 17981/head
authorSander van Deijck <sander@vandeijck.com>
Sat, 15 Feb 2025 22:06:08 +0000 (23:06 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 7 Jun 2025 19:04:53 +0000 (21:04 +0200)
The Arcadyan WE410443 is a WiFi AC access point distributed by various ISPs
under various names, including KPN SuperWifi and BT Whole Home Wi-Fi. It
features one ethernet port, dual MT7615N radios and four internal antennas.

Hardware:
- SoC: Mediatek MT7621AT
- Flash: 32 MB
- RAM: 128 MB
- Ethernet: 1x 10/100/1000 Mbps, built into the SoC
- WLAN: 2x MediaTek MT7615N
- Buttons: 1 Reset button, 1 WPS button
- LEDs: 1x Green, 1x Blue, 1x Red, all unmarked
- Power: 12 VDC, 1.5A barrel plug

Installation:
The bootloader is locked with a password, so the image needs to be written
directly to the SPI flash chip. To do this, you need to open up the case,
remove the heatsink and connect the flash chip to a Raspberry Pi. Use the
following connections:

Flash chip --> Raspberry Pi

VCC --> 3v3
RESET --> 3v3
/CS --> GPIO 8
DO --> GPIO 9
CLK --> GPIO 11
DI --> GPIO 10
GND --> Ground

You can solder wires to the flash chip, or use a SOIC16 clip. More details on
the Raspberry Pi and SPI chip pinouts are available on the wiki [1]
When you have the Raspberry Pi connected to the flash chip, boot your Pi and
follow the instructions:

1) Make sure your Pi has SPI enabled with sudo raspi-config

2) Install necessary tools: sudo apt install xxd libubootenv-tool mtd-utils

3) Upload overlay and execute:
sudo dtc -@ -I dts -O dtb -o
/boot/overlays/we410443.dtbo we410443-overlay.dts

4) Enable in /boot/firmware/config.txt by adding a new line containing
dtoverlay=we410443

5) Reboot your Pi and verify the mtd partitions with
cat /proc/mtd, you should see:

dev:    size   erasesize  name
mtd0: 02000000 00001000 "all"
mtd1: 00030000 00001000 "u-boot"
mtd2: 00010000 00001000 "u-boot-env"
mtd3: 00010000 00001000 "factory"
mtd4: 01f60000 00001000 "firmware"
mtd5: 00010000 00001000 "glbcfg"
mtd6: 00010000 00001000 "config"
mtd7: 00010000 00001000 "glbcfg2"
mtd8: 00010000 00001000 "config2"

6) Optionally (but recommended), make a backup:
sudo dd if=/dev/mtd0 of=backup.bin
It can be restored with: sudo flashcp backup.bin /dev/mtd0

7) Set the variables for the bootloader:
echo '/dev/mtd2 0x0 0x1000 0x1000' > fw_env.config
sudo fw_setenv -c fw_env.config bootpartition 0

8) Finally, flash the image:
sudo flashcp openwrt-ramips-mt7621-arcadyan_we410443-
squashfs-sysupgrade.bin /dev/mtd4

MAC addresses
The label address is stored in ASCII in the config partition

Use --> Address

Device --> label
Ethernet --> label
WLAN 2g --> + 1
WLAN 5g --> + 2

References:
[1] https://openwrt.org/toh/arcadyan/astoria/we410443

Signed-off-by: Sander van Deijck <sander@vandeijck.com>
Link: https://github.com/openwrt/openwrt/pull/17981
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/ramips/dts/mt7621_arcadyan_we410443.dts [new file with mode: 0755]
target/linux/ramips/image/mt7621.mk
target/linux/ramips/mt7621/base-files/etc/board.d/02_network
target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac

diff --git a/target/linux/ramips/dts/mt7621_arcadyan_we410443.dts b/target/linux/ramips/dts/mt7621_arcadyan_we410443.dts
new file mode 100755 (executable)
index 0000000..ddcf37f
--- /dev/null
@@ -0,0 +1,197 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT\r
+\r
+#include "mt7621.dtsi"\r
+\r
+#include <dt-bindings/gpio/gpio.h>\r
+#include <dt-bindings/input/input.h>\r
+#include <dt-bindings/leds/common.h>\r
+\r
+/ {\r
+       model = "Arcadyan WE410443";\r
+       compatible = "arcadyan,we410443", "mediatek,mt7621-soc";\r
+\r
+       aliases {\r
+               led-boot = &led_status_green;\r
+               led-failsafe = &led_status_red;\r
+               led-running = &led_status_green;\r
+               led-upgrade = &led_status_blue;\r
+       };\r
+\r
+       keys {\r
+               compatible = "gpio-keys";\r
+\r
+               wps {\r
+                       label = "wps";\r
+                       gpios = <&gpio 3 GPIO_ACTIVE_LOW>;\r
+                       linux,code = <KEY_WPS_BUTTON>;\r
+               };\r
+\r
+               reset {\r
+                       label = "reset";\r
+                       gpios = <&gpio 18 GPIO_ACTIVE_LOW>;\r
+                       linux,code = <KEY_RESTART>;\r
+               };\r
+       };\r
+\r
+       leds {\r
+               compatible = "gpio-leds";\r
+\r
+               led_status_blue: blue {\r
+                       color = <LED_COLOR_ID_BLUE>;\r
+                       function = LED_FUNCTION_STATUS;\r
+                       gpios = <&gpio 41 GPIO_ACTIVE_HIGH>;\r
+               };\r
+\r
+               led_status_green: green {\r
+                       color = <LED_COLOR_ID_GREEN>;\r
+                       function = LED_FUNCTION_STATUS;\r
+                       gpios = <&gpio 42 GPIO_ACTIVE_HIGH>;\r
+               };\r
+\r
+               led_status_red: red {\r
+                       color = <LED_COLOR_ID_RED>;\r
+                       function = LED_FUNCTION_STATUS;\r
+                       gpios = <&gpio 44 GPIO_ACTIVE_HIGH>;\r
+               };\r
+       };\r
+};\r
+\r
+&spi0 {\r
+       status = "okay";\r
+\r
+       flash@0 {\r
+               compatible = "jedec,spi-nor";\r
+               reg = <0>;\r
+               spi-max-frequency = <50000000>;\r
+\r
+               partitions {\r
+                       compatible = "fixed-partitions";\r
+                       #address-cells = <1>;\r
+                       #size-cells = <1>;\r
+\r
+                       partition@0 {\r
+                               label = "all";\r
+                               reg = <0x0 0x2000000>;\r
+                               read-only;\r
+                       };\r
+\r
+                       partition@1 {\r
+                               label = "u-boot";\r
+                               reg = <0x0 0x30000>;\r
+                               read-only;\r
+                       };\r
+\r
+                       partition@30000 {\r
+                               label = "u-boot-env";\r
+                               reg = <0x30000 0x10000>;\r
+                               read-only;\r
+                       };\r
+\r
+                       partition@40000 {\r
+                               label = "factory";\r
+                               reg = <0x40000 0x10000>;\r
+                               read-only;\r
+\r
+                               nvmem-layout {\r
+                                       compatible = "fixed-layout";\r
+                                       #address-cells = <1>;\r
+                                       #size-cells = <1>;\r
+\r
+                                       eeprom_factory_0: eeprom@0 {\r
+                                               reg = <0x0 0x4da8>;\r
+                                       };\r
+\r
+                                       eeprom_factory_8000: eeprom@8000 {\r
+                                               reg = <0x8000 0x4da8>;\r
+                                       };\r
+                               };\r
+                       };\r
+\r
+                       partition@50000 {\r
+                               compatible = "fixed-partitions";\r
+                               label = "firmware";\r
+                               reg = <0x50000 0x1f60000>;\r
+                               #address-cells = <1>;\r
+                               #size-cells = <1>;\r
+\r
+                               partition@0 {\r
+                                       label = "kernel";\r
+                                       reg = <0x0 0x440000>;\r
+                               };\r
+\r
+                               partition@400000 {\r
+                                       label = "rootfs";\r
+                                       reg = <0x440000 0x1b20000>;\r
+                               };\r
+                       };\r
+\r
+                       partition@1fb0000 {\r
+                               label = "glbcfg";\r
+                               reg = <0x1fb0000 0x10000>;\r
+                               read-only;\r
+                       };\r
+\r
+                       partition@1fc0000 {\r
+                               label = "config";\r
+                               reg = <0x1fc0000 0x10000>;\r
+                               read-only;\r
+                       };\r
+\r
+                       partition@1fd0000 {\r
+                               label = "glbcfg2";\r
+                               reg = <0x1fd0000 0x10000>;\r
+                               read-only;\r
+                       };\r
+\r
+                       partition@1fe0000 {\r
+                               label = "config2";\r
+                               reg = <0x1fe0000 0x10000>;\r
+                               read-only;\r
+                       };\r
+               };\r
+       };\r
+};\r
+\r
+&pcie {\r
+       status = "okay";\r
+};\r
+\r
+&pcie0 {\r
+       wifi@0,0 {\r
+               compatible = "mediatek,mt76";\r
+               reg = <0x0000 0 0 0 0>;\r
+               nvmem-cells = <&eeprom_factory_0>;\r
+               nvmem-cell-names = "eeprom";\r
+               ieee80211-freq-limit = <2400000 2500000>;\r
+       };\r
+};\r
+\r
+&pcie1 {\r
+       wifi@0,0 {\r
+               compatible = "mediatek,mt76";\r
+               reg = <0x0000 0 0 0 0>;\r
+               nvmem-cells = <&eeprom_factory_8000>;\r
+               nvmem-cell-names = "eeprom";\r
+               ieee80211-freq-limit = <5000000 6000000>;\r
+       };\r
+};\r
+\r
+&state_default {\r
+       gpio {\r
+               groups = "i2c", "wdt", "sdhci";\r
+               function = "gpio";\r
+       };\r
+};\r
+\r
+&switch0 {\r
+       ports {\r
+               port@0 {\r
+                       status = "okay";\r
+                       label = "lan";\r
+               };\r
+       };\r
+};\r
+\r
+&xhci {\r
+       status = "disabled";\r
+};\r
index a47e36af8df797e49751b1ff65a06499c0688979..28b5c3f31acd8c2850aed223292fd26f7520e9d6 100644 (file)
@@ -314,6 +314,23 @@ define Device/ampedwireless_ally-00x19k
 endef
 TARGET_DEVICES += ampedwireless_ally-00x19k
 
+define Device/arcadyan_we410443
+  $(Device/dsa-migration)
+  $(Device/uimage-lzma-loader)
+  DEVICE_VENDOR := Arcadyan
+  DEVICE_MODEL := WE410443
+  IMAGE_SIZE := 32128k
+  KERNEL_SIZE := 4352k
+  KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | \
+       uImage none | arcadyan-trx 0x746f435d
+  KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | loader-kernel | \
+       uImage none
+  IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | \
+       append-rootfs | pad-rootfs | check-size | append-metadata
+  DEVICE_PACKAGES := kmod-mt7615-firmware -uboot-envtools
+endef
+TARGET_DEVICES += arcadyan_we410443
+
 define Device/arcadyan_we420223-99
   $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
index 2a4d1e6ce35cbfa0534abf4597fca37c4f5fb99b..a274dd0d994e08af3ee1ad0795b79b4b31cc4fc3 100644 (file)
@@ -37,6 +37,7 @@ ramips_setup_interfaces()
                ucidef_set_interface_lan "swp0 swp1"
                ;;
        ampedwireless,ally-00x19k|\
+       arcadyan,we410443|\
        asus,rp-ac56|\
        asus,rp-ac87|\
        dlink,dap-1620-b1|\
@@ -213,6 +214,10 @@ ramips_setup_macs()
                wan_mac=$(mtd_get_mac_ascii hwconfig HW.WAN.MAC.Address)
                label_mac=$lan_mac
                ;;
+       arcadyan,we410443)
+               label_mac=$(mtd_get_mac_ascii config mac)
+               lan_mac=$label_mac
+               ;;
        arcadyan,we420223-99)
                label_mac=$(mtd_get_mac_ascii board_data mac)
                lan_mac=$label_mac
index 4f19e2a4eb8c36336db23f324adf471747f02bd1..c1c6ec749bce690accacd1847ffe42f08e296c32 100644 (file)
@@ -10,6 +10,13 @@ PHYNBR=${DEVPATH##*/phy}
 board=$(board_name)
 
 case "$board" in
+       arcadyan,we410443)
+               label_mac=$(mtd_get_mac_ascii config mac)
+               [ "$PHYNBR" = "0" ] && \
+                       macaddr_add $label_mac 1 > /sys${DEVPATH}/macaddress
+               [ "$PHYNBR" = "1" ] && \
+                       macaddr_add $label_mac 2 > /sys${DEVPATH}/macaddress
+               ;;
        arcadyan,we420223-99)
                if [ "$PHYNBR" = "0" ]; then
                        mac24=$(macaddr_add "$(get_mac_label)" "0xf00001")