ath79/nand: add support for Netgear WNDR4300TN
authorDavy Hollevoet <github@natox.be>
Mon, 22 Jun 2020 12:45:14 +0000 (14:45 +0200)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Thu, 6 Aug 2020 14:56:07 +0000 (16:56 +0200)
This patch adds support for the WNDR4300TN, marketed by Belgian ISP
Telenet. The hardware is the same as the WNDR4300 v1, without the
fifth ethernet port (WAN) and the USB port. The circuit board has
the traces, but the components are missing.

Specifications:
* SoC: Atheros AR9344
* RAM: 128 MB
* Flash: 128 MB NAND flash
* WiFi: Atheros AR9580 (5 GHz) and AR9344 (2.4 GHz)
* Ethernet: 4x 1000Base-T
* LED: Power, LAN, WiFi 2.4GHz, WiFi 5GHz, WPS
* UART: on board, to the right of the RF shield at the top of the board

Installation:

* Flashing through the OEM web interface:
  + Connect your computer to the router with an ethernet cable and browse
    to http://192.168.0.51/
  + Log in with the default credentials are admin:password
  + Browse to Advanced > Administration > Firmware Upgrade in the Telenet
    interface
  + Upload the Openwrt firmware: openwrt-ath79-nand-netgear_wndr4300tn-squashfs-factory.img
  + Proceed with the firmware installation and give the device a few
    minutes to finish and reboot.

* Flashing through TFTP:
  + Configure your wired client with a static IP in the 192.168.1.x range,
    e.g. 192.168.1.10 and netmask 255.255.255.0.
  + Power off the router.
  + Press and hold the RESET button (the factory reset button on the bottom
    of the device, with the gray circle around it, next to the Telenet logo)
    and turn the router on while keeping the button pressed.
  + The power LED will start flashing orange. You can release the button
    once it switches to flashing green.
  + Transfer the image over TFTP:
    $ tftp 192.168.1.1 -m binary -c put openwrt-ath79-nand-netgear_wndr4300tn-squashfs-factory.img

Signed-off-by: Davy Hollevoet <github@natox.be>
[use DT label reference for adding LEDs in DTSI files]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
package/boot/uboot-envtools/files/ath79
target/linux/ath79/dts/ar9344_netgear_wndr.dtsi
target/linux/ath79/dts/ar9344_netgear_wndr3700-v4.dts
target/linux/ath79/dts/ar9344_netgear_wndr4300.dts
target/linux/ath79/dts/ar9344_netgear_wndr4300sw.dts
target/linux/ath79/dts/ar9344_netgear_wndr4300tn.dts [new file with mode: 0644]
target/linux/ath79/dts/ar9344_netgear_wndr_usb.dtsi [new file with mode: 0644]
target/linux/ath79/dts/ar9344_netgear_wndr_wan.dtsi [new file with mode: 0644]
target/linux/ath79/image/nand.mk
target/linux/ath79/nand/base-files/etc/board.d/02_network
target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom

index 0442e9e4855044628c429dd56f2532665889af21..aca8a089c37040c9f1ae332964ec6812e66a43fb 100644 (file)
@@ -64,6 +64,7 @@ netgear,wndrmac-v1)
        ;;
 netgear,wndr3700-v4|\
 netgear,wndr4300|\
+netgear,wndr4300tn|\
 netgear,wndr4300sw)
        ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
        ;;
index 90978fb99f27b15bf1f1b9c2bbafaaf175020272..f2909061da9abe3728e1dad20df43e8a17515bd5 100644 (file)
@@ -40,7 +40,7 @@
                };
        };
 
-       leds {
+       leds: leds {
                compatible = "gpio-leds";
 
                pinctrl-names = "default";
                        default-state = "keep";
                };
 
-               wan_green {
-                       label = "netgear:green:wan";
-                       gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
-               };
-
-               wan_amber {
-                       label = "netgear:amber:wan";
-                       gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
-               };
-
                wlan2g_green {
                        label = "netgear:green:wlan2g";
                        gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
                        label = "netgear:amber:wps";
                        gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
                };
-
-               usb_green {
-                       label = "netgear:green:usb";
-                       gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
-                       trigger-sources = <&hub_port>;
-                       linux,default-trigger = "usbport";
-               };
        };
 
        ubi-concat {
                qca,no-eeprom;
                #gpio-cells = <2>;
                gpio-controller;
-
-               usb_power {
-                       gpio-hog;
-                       line-name = "netgear:power:usb";
-                       gpios = <0 GPIO_ACTIVE_HIGH>;
-                       output-high;
-               };
-       };
-};
-
-&usb_phy {
-       status = "okay";
-};
-
-&usb {
-       status = "okay";
-       #address-cells = <1>;
-       #size-cells = <0>;
-
-       hub_port: port@1 {
-               reg = <1>;
-               #trigger-source-cells = <0>;
        };
 };
 
index 8a38aeab596c4910ddf4e62244de966a84f0257b..a7756f1d4467bf648ddaf8f94dd3aebb86fd31e5 100644 (file)
@@ -2,6 +2,8 @@
 /dts-v1/;
 
 #include "ar9344_netgear_wndr.dtsi"
+#include "ar9344_netgear_wndr_wan.dtsi"
+#include "ar9344_netgear_wndr_usb.dtsi"
 
 / {
        compatible = "netgear,wndr3700-v4", "qca,ar9344";
index 9b57bb88a6334bafcb3d971ccf7a2f637ed9bde6..235181d8d4fb12bd5585206461d5c3800d4379c3 100644 (file)
@@ -2,6 +2,8 @@
 /dts-v1/;
 
 #include "ar9344_netgear_wndr.dtsi"
+#include "ar9344_netgear_wndr_wan.dtsi"
+#include "ar9344_netgear_wndr_usb.dtsi"
 
 / {
        compatible = "netgear,wndr4300", "qca,ar9344";
index fb90eee550c6521792d814d7986ebb4757dae26b..7643b3c14041df9dd26fb5259ac50b4b6d3231dd 100644 (file)
@@ -2,6 +2,8 @@
 /dts-v1/;
 
 #include "ar9344_netgear_wndr.dtsi"
+#include "ar9344_netgear_wndr_wan.dtsi"
+#include "ar9344_netgear_wndr_usb.dtsi"
 
 / {
        compatible = "netgear,wndr4300sw", "qca,ar9344";
diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr4300tn.dts b/target/linux/ath79/dts/ar9344_netgear_wndr4300tn.dts
new file mode 100644 (file)
index 0000000..bed85a3
--- /dev/null
@@ -0,0 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include "ar9344_netgear_wndr.dtsi"
+
+/ {
+       compatible = "netgear,wndr4300tn", "qca,ar9344";
+       model = "Netgear WNDR4300TN";
+};
diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr_usb.dtsi b/target/linux/ath79/dts/ar9344_netgear_wndr_usb.dtsi
new file mode 100644 (file)
index 0000000..e378063
--- /dev/null
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+&leds {
+       usb_green {
+               label = "netgear:green:usb";
+               gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+               trigger-sources = <&hub_port>;
+               linux,default-trigger = "usbport";
+       };
+};
+
+&ath9k {
+       usb_power {
+               gpio-hog;
+               line-name = "netgear:power:usb";
+               gpios = <0 GPIO_ACTIVE_HIGH>;
+               output-high;
+       };
+};
+
+&usb_phy {
+       status = "okay";
+};
+
+&usb {
+       status = "okay";
+       #address-cells = <1>;
+       #size-cells = <0>;
+
+       hub_port: port@1 {
+               reg = <1>;
+               #trigger-source-cells = <0>;
+       };
+};
diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr_wan.dtsi b/target/linux/ath79/dts/ar9344_netgear_wndr_wan.dtsi
new file mode 100644 (file)
index 0000000..91c2971
--- /dev/null
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+&leds {
+       wan_green {
+               label = "netgear:green:wan";
+               gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
+       };
+
+       wan_amber {
+               label = "netgear:amber:wan";
+               gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
+       };
+};
index 2efe85d17fb964fe5b949aade06fb69a3b935141..c7f96eb6d49e9af8cc87b8bf0489f8b3a32599a8 100644 (file)
@@ -206,6 +206,16 @@ define Device/netgear_wndr4300sw
 endef
 TARGET_DEVICES += netgear_wndr4300sw
 
+define Device/netgear_wndr4300tn
+  SOC := ar9344
+  DEVICE_MODEL := WNDR4300TN
+  NETGEAR_KERNEL_MAGIC := 0x33373033
+  NETGEAR_BOARD_ID := WNDR4300TN
+  NETGEAR_HW_ID := 29763948+0+128+128+2x2+3x3
+  $(Device/netgear_ath79_nand)
+endef
+TARGET_DEVICES += netgear_wndr4300tn
+
 define Device/netgear_wndr4300-v2
   SOC := qca9563
   DEVICE_MODEL := WNDR4300
index daba0e96799b9eab57b7fc552de55a440a4c50c5..910df517aa307425c29070991ad515bb38aa7f07 100755 (executable)
@@ -29,6 +29,10 @@ ath79_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
                ;;
+       netgear,wndr4300tn)
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
+               ;;
        zyxel,nbg6716)
                ucidef_add_switch "switch0" \
                        "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
index 60defa5f8b88f1adef7684311a4616cadc5e1b22..cac955905af138d112182b0bd998a42b93eabdd1 100644 (file)
@@ -15,6 +15,7 @@ case "$FIRMWARE" in
        netgear,wndr3700-v4|\
        netgear,wndr4300|\
        netgear,wndr4300sw|\
+       netgear,wndr4300tn|\
        netgear,wndr4300-v2|\
        netgear,wndr4500-v3)
                caldata_extract "caldata" 0x1000 0x440
@@ -29,6 +30,7 @@ case "$FIRMWARE" in
        netgear,wndr3700-v4|\
        netgear,wndr4300|\
        netgear,wndr4300sw|\
+       netgear,wndr4300tn|\
        netgear,wndr4300-v2|\
        netgear,wndr4500-v3)
                caldata_extract "caldata" 0x5000 0x440