ramips: add support for Netgear EAX12 series
authorWenli Looi <wlooi@ucalgary.ca>
Thu, 30 Mar 2023 22:28:23 +0000 (22:28 +0000)
committerRafał Miłecki <rafal@milecki.pl>
Tue, 9 Jul 2024 07:33:37 +0000 (09:33 +0200)
Netgear EAX12, EAX11v2, EAX15v2 are wall-plug 802.11ax (Wi-Fi 6)
extenders that share the SoC, WiFi chip, and image format with the
WAX202.

Specifications:
* MT7621, 256 MiB RAM, 128 MiB NAND
* MT7915: 2.4/5 GHz 2x2 802.11ax (DBDC)
* Ethernet: 1 port 10/100/1000
* UART: 115200 baud (labeled on board)

All LEDs and buttons appear to work without state_default.

Installation:
* Flash the factory image through the stock web interface, or TFTP to
  the bootloader. NMRP can be used to TFTP without opening the case.

Revert to stock firmware:
* Flash the stock firmware to the bootloader using TFTP/NMRP.

References in GPL source:
https://www.downloads.netgear.com/files/GPL/EAX12_EAX11v2_EAX15v2_GPL_V1.0.3.34_src.tar.gz

* target/linux/ramips/dts/mt7621-rfb-ax-nand.dts
  DTS file for this device.

Signed-off-by: Wenli Looi <wlooi@ucalgary.ca>
(cherry picked from commit 32ea8a9a7e4b1319607ae398e9bf7d8e3c4cd756)

package/boot/uboot-envtools/files/ramips
target/linux/ramips/dts/mt7621_netgear_eax12.dts [new file with mode: 0644]
target/linux/ramips/image/mt7621.mk
target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
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
target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh

index 8247798937c68884d6071e715ad09d3ffe5515b6..eccdd4255ab19d7f5808619f68f73bdb6dfe6a2f 100644 (file)
@@ -75,6 +75,7 @@ h3c,tx1801-plus|\
 h3c,tx1806|\
 jcg,q20|\
 linksys,e7350|\
+netgear,eax12|\
 netgear,wax202|\
 zyxel,wsm20)
        ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
diff --git a/target/linux/ramips/dts/mt7621_netgear_eax12.dts b/target/linux/ramips/dts/mt7621_netgear_eax12.dts
new file mode 100644 (file)
index 0000000..d5ad404
--- /dev/null
@@ -0,0 +1,189 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+       compatible = "netgear,eax12", "mediatek,mt7621-soc";
+       model = "Netgear EAX12";
+
+       aliases {
+               led-boot = &led_power_green;
+               led-failsafe = &led_power_red;
+               led-running = &led_power_green;
+               led-upgrade = &led_power_red;
+       };
+
+       chosen {
+               bootargs = "console=ttyS0,115200";
+       };
+
+       keys {
+               compatible = "gpio-keys";
+
+               reset {
+                       label = "reset";
+                       gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_RESTART>;
+               };
+
+               wps {
+                       label = "wps";
+                       gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_WPS_BUTTON>;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               led_power_green: power_green {
+                       label = "green:power";
+                       gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+               };
+
+               led_power_red: power_red {
+                       label = "red:power";
+                       gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
+               };
+
+               client_green {
+                       label = "green:client";
+                       gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+               };
+
+               client_red {
+                       label = "red:client";
+                       gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+               };
+
+               router_green {
+                       label = "green:router";
+                       gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
+               };
+
+               router_red {
+                       label = "red:router";
+                       gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
+               };
+
+               wps_green {
+                       label = "green:wps";
+                       gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
+               };
+
+               eth_green {
+                       label = "green:eth";
+                       gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
+               };
+
+               eth_yellow {
+                       label = "yellow:eth";
+                       gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+               };
+       };
+};
+
+&nand {
+       status = "okay";
+
+       partitions {
+               compatible = "fixed-partitions";
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               partition@0 {
+                       label = "Bootloader";
+                       reg = <0x0 0x80000>;
+                       read-only;
+               };
+
+               partition@80000 {
+                       label = "Config";
+                       reg = <0x80000 0x80000>;
+                       read-only;
+               };
+
+               factory: partition@100000 {
+                       label = "Factory";
+                       reg = <0x100000 0x80000>;
+                       read-only;
+               };
+
+               partition@180000 {
+                       label = "firmware";
+                       reg = <0x180000 0x3800000>;
+
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "kernel";
+                               reg = <0x0 0x400000>;
+                       };
+
+                       partition@400000 {
+                               label = "ubi";
+                               reg = <0x400000 0x3400000>;
+                       };
+               };
+
+               partition@2780000 {
+                       label = "firmware_backup";
+                       reg = <0x3980000 0x3800000>;
+                       read-only;
+               };
+
+               partition@4d80000 {
+                       label = "CFG";
+                       reg = <0x7180000 0x200000>;
+                       read-only;
+               };
+
+               partition@5580000 {
+                       label = "RAE";
+                       reg = <0x7380000 0x600000>;
+                       read-only;
+               };
+
+               partition@5980000 {
+                       label = "POT";
+                       reg = <0x7980000 0x020000>;
+                       read-only;
+               };
+
+               partition@6780000 {
+                       label = "LOG";
+                       reg = <0x79A0000 0x40000>;
+                       read-only;
+               };
+       };
+};
+
+&pcie {
+       status = "okay";
+};
+
+&pcie1 {
+       wifi@0,0 {
+               compatible = "mediatek,mt76";
+               reg = <0x0000 0 0 0 0>;
+               mediatek,mtd-eeprom = <&factory 0x0>;
+       };
+};
+
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan";
+               };
+       };
+};
+
+&xhci {
+       status = "disabled";
+};
index 1a8df617b5a88eb23937e6cf05ea0f5b2f6be7b4..c1fbc40b7ec911d7ee6172aafcfd20e647174849 100644 (file)
@@ -1712,6 +1712,32 @@ define Device/mts_wg430223
 endef
 TARGET_DEVICES += mts_wg430223
 
+define Device/netgear_eax12
+  $(Device/nand)
+  DEVICE_VENDOR := NETGEAR
+  DEVICE_MODEL := EAX12
+  DEVICE_ALT0_VENDOR := NETGEAR
+  DEVICE_ALT0_MODEL := EAX11
+  DEVICE_ALT0_VARIANT := v2
+  DEVICE_ALT1_VENDOR := NETGEAR
+  DEVICE_ALT1_MODEL := EAX15
+  DEVICE_ALT1_VARIANT := v2
+  DEVICE_PACKAGES := kmod-mt7915-firmware -uboot-envtools
+  NETGEAR_ENC_MODEL := EAX12
+  NETGEAR_ENC_REGION := US
+  NETGEAR_ENC_HW_ID_LIST := 1010000004540000_NETGEAR
+  NETGEAR_ENC_MODEL_LIST := EAX12;EAX11v2;EAX15v2
+  IMAGE_SIZE := 57344k
+  KERNEL_LOADADDR := 0x82000000
+  KERNEL := kernel-bin | relocate-kernel 0x80001000 | lzma | \
+       fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb | \
+       append-squashfs4-fakeroot
+  IMAGES += factory.img
+  IMAGE/factory.img := append-kernel | pad-to $$(KERNEL_SIZE) | \
+       append-ubi | check-size | netgear-encrypted-factory
+endef
+TARGET_DEVICES += netgear_eax12
+
 define Device/netgear_ex6150
   $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
index ae46ddb79fed72381d6b1aad22a15075155fa1b3..4ea07da8b0a074b774dc632276f182a48de57ed6 100644 (file)
@@ -157,6 +157,10 @@ mikrotik,routerboard-m11g)
 mtc,wr1201)
        ucidef_set_led_netdev "eth_link" "LAN link" "green:eth_link" "br-lan"
        ;;
+netgear,eax12)
+       ucidef_set_led_netdev "eth_act" "LAN act" "yellow:eth" "lan" "tx rx"
+       ucidef_set_led_netdev "eth_link" "LAN link" "green:eth" "lan" "link"
+       ;;
 netgear,r6220|\
 netgear,r6260|\
 netgear,r6350|\
index 9f7cc3510c36b7730eea7ba33a549eb624f95e93..71e6f9386205f238147c04b442eb09ccee7df70b 100644 (file)
@@ -42,6 +42,7 @@ ramips_setup_interfaces()
        linksys,re7000|\
        mikrotik,ltap-2hnd|\
        mikrotik,routerboard-m11g|\
+       netgear,eax12|\
        netgear,ex6150|\
        sercomm,na502|\
        sercomm,na502s|\
@@ -301,6 +302,10 @@ ramips_setup_macs()
                label_mac=$wan_mac
                lan_mac=$(macaddr_add "$wan_mac" 2)
                ;;
+       netgear,eax12)
+               lan_mac=$(mtd_get_mac_ascii Config mac)
+               label_mac=$lan_mac
+               ;;
        netgear,wax202)
                lan_mac=$(mtd_get_mac_ascii Config mac)
                wan_mac=$(macaddr_add "$lan_mac" 1)
index 0e4541a4218100f01a863b839cc28eabce3ba91f..c09203270c2b23f64a37469e4658675a0b94bd06 100644 (file)
@@ -130,6 +130,11 @@ case "$board" in
                [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress
                [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress
                ;;
+       netgear,eax12)
+               hw_mac_addr=$(mtd_get_mac_ascii Config mac)
+               [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress
+               [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress
+               ;;
        netgear,wax202)
                hw_mac_addr=$(mtd_get_mac_ascii Config mac)
                [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress
index 8b35b5d32a608c3c966d85c5c479bb369feb1296..5c3ad7336613943a5dc99372c7cc67621db63431 100755 (executable)
@@ -89,6 +89,7 @@ platform_do_upgrade() {
        linksys,ea8100-v1|\
        linksys,ea8100-v2|\
        mts,wg430223|\
+       netgear,eax12|\
        netgear,r6220|\
        netgear,r6260|\
        netgear,r6350|\