ath79: add support for Netgear WNDR3700v4
authorPaul Blazejowski <paulb@blazebox.homeip.net>
Wed, 13 Nov 2019 19:19:32 +0000 (14:19 -0500)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Thu, 14 Nov 2019 22:14:15 +0000 (23:14 +0100)
This patch adds ath79 support for Netgear WNDR3700v4.
Router was previously supported by ar71xx target only.
Note: device requires 'ar934x-nand' driver in kernel.

Specification
=============
  * Description: Netgear WNDR3700v4
  * Loader: U-boot
  * SOC: Atheros AR9344 (560 MHz)
  * RAM: 128 MiB
  * Flash: 128 MiB (NAND)
    - U-boot binary: 256 KiB
    - U-boot environment: 256 KiB
    - ART: 256 KiB
    - POT: 512 KiB
    - Language: 2 MiB
    - Config: 512 KiB
    - Traffic Meter: 3 MiB
    - Firmware: 25 MiB
    - ART Backup: 256 KiB
    - Reserved: 96 MiB
  * Ethernet: 5 x 10/100/1000 (4 x LAN, 1 x WAN) (AR8327)
  * Wireless:
    - 2.4 GHz b/g/n (internal)
    - 5 GHz a/n (AR9580)
  * USB: yes, 1 x USB 2.0
  * Buttons:
    - Reset
    - WiFi (rfkill)
    - WPS
  * LEDs:
    - Power (amber/green)
    - WAN (amber/green)
    - WLAN 2G (green)
    - WLAN 5G (blue)
    - 4 x LAN (amber/green)
    - USB (green)
    - WPS (amber/green)
  * UART: 4-pin connector JP1, 3.3V (Vcc, TX, RX, GND), 115200 8N1
  * Power supply: DC 12V 2.5A
  * MAC addresses: LAN=WLAN2G on case label, WAN +1, WLAN5G +2

Installation
============
  * TFTP recovery
  * TFTP via U-boot prompt
  * sysupgrade
  * Web interface

Note about partitioning: firmware partition offset (0x6c0000) is
hardcoded into vendor's u-boot, so this partition cannot be moved
and resized to include Netgear-specific flash areas (pot, language,
config, traffic_meter) not used by OpenWrt.

Test build configuration
========================
CONFIG_TARGET_ath79=y
CONFIG_TARGET_ath79_nand=y
CONFIG_TARGET_ath79_nand_DEVICE_netgear_wndr3700-v4=y
CONFIG_ALL_KMODS=y
CONFIG_DEVEL=y
CONFIG_CCACHE=y
CONFIG_COLLECT_KERNEL_DEBUG=y
CONFIG_IMAGEOPT=y

Signed-off-by: Paul Blazejowski <paulb@blazebox.homeip.net>
package/boot/uboot-envtools/files/ath79
target/linux/ath79/dts/ar9344_netgear_wndr3700-v4.dts [new file with mode: 0644]
target/linux/ath79/image/nand.mk
target/linux/ath79/nand/base-files/etc/board.d/01_leds
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 e31100877ed6a1b8cc93ab90f290489a43ff91b8..bab5fa556fd3d41499c3979e28e4760de2b22705 100644 (file)
@@ -42,6 +42,7 @@ buffalo,wzr-hp-ag300h)
 netgear,wndr3700)
        ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x10000"
        ;;
+netgear,wndr3700-v4|\
 netgear,wndr4300)
        ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
        ;;
diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr3700-v4.dts b/target/linux/ath79/dts/ar9344_netgear_wndr3700-v4.dts
new file mode 100644 (file)
index 0000000..8a38aea
--- /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,wndr3700-v4", "qca,ar9344";
+       model = "Netgear WNDR3700 v4";
+};
index 614a693285fe4adf1d0c203c73f1f6c357b9c55e..19c2d421425a1f859ad32ea31675adb431a92157 100644 (file)
@@ -125,6 +125,18 @@ define Device/netgear_ath79_nand
   UBINIZE_OPTS := -E 5
 endef
 
+define Device/netgear_wndr3700-v4
+  ATH_SOC := ar9344
+  DEVICE_MODEL := WNDR3700
+  DEVICE_VARIANT := v4
+  NETGEAR_KERNEL_MAGIC := 0x33373033
+  NETGEAR_BOARD_ID := WNDR3700v4
+  NETGEAR_HW_ID := 29763948+128+128
+  SUPPORTED_DEVICES += wndr3700v4
+  $(Device/netgear_ath79_nand)
+endef
+TARGET_DEVICES += netgear_wndr3700-v4
+
 define Device/netgear_wndr4300
   ATH_SOC := ar9344
   DEVICE_MODEL := WNDR4300
index f58527d87e2edf2a4bad3ac1ec781eb7693b5b9e..49d4005495c5650aaee2e0d7c62330fa63a0c15e 100755 (executable)
@@ -12,6 +12,7 @@ glinet,gl-ar300m-nand|\
 glinet,gl-ar300m-nor)
        ucidef_set_led_netdev "lan" "LAN" "gl-ar300m:green:lan" "eth0"
        ;;
+netgear,wndr3700-v4|\
 netgear,wndr4300)
        ucidef_set_led_switch "wan-amber" "WAN (amber)" "netgear:amber:wan" "switch0" "0x20"
        ;;
index 36ddb5e83a438c6747c97c28af955e204914966d..f7e43addc1abd0434c2068e96fd1a0b95b540ee8 100755 (executable)
@@ -16,6 +16,7 @@ ath79_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "0@eth0" "2:lan:2" "3:lan:1" "1:wan"
                ;;
+       netgear,wndr3700-v4|\
        netgear,wndr4300)
                ucidef_add_switch "switch0" \
                        "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
@@ -35,6 +36,7 @@ ath79_setup_macs()
        local board="$1"
 
        case "$board" in
+       netgear,wndr3700-v4|\
        netgear,wndr4300)
                wan_mac=$(mtd_get_mac_binary caldata 0x6)
                ;;
index ae1d3572a84c1e40f3675b8bba642371491e055b..25bafe67ac5fa7c8a4f2bb1266a61f4577be9f32 100644 (file)
@@ -9,6 +9,7 @@ board=$(board_name)
 case "$FIRMWARE" in
 "ath9k-eeprom-ahb-18100000.wmac.bin")
        case $board in
+       netgear,wndr3700-v4|\
        netgear,wndr4300)
                caldata_extract "caldata" 0x1000 0x440
                ;;
@@ -23,6 +24,7 @@ case "$FIRMWARE" in
        ;;
 "ath9k-eeprom-pci-0000:00:00.0.bin")
        case $board in
+       netgear,wndr3700-v4|\
        netgear,wndr4300)
                caldata_extract "caldata" 0x5000 0x440
                ;;