From a736f394323689dbbfbe548f93e6aa620016a64a Mon Sep 17 00:00:00 2001 From: Michal Cieslakiewicz Date: Sun, 22 Dec 2019 21:55:54 +0100 Subject: [PATCH] ath79: add support for Netgear WNDR4500 v3 This patch introduces support for Netgear WNDR4500v3. Router is very similar to WNDR4300v2 and is based on the same PCB. Information gathered from various Internet sources (including https://patchwork.ozlabs.org/patch/809227/) shows following differences to WNDR4300v2: * two USB 2.0 ports with separate LEDs * USB LEDs soldered to secondary pads * WPS and RFKILL buttons soldered to secondary pads * described as N900 device with 3x3:3 MIMO for 2.4GHz radio * power supply requirement is DC 12V 2.5A * vendor HW ID suffix differs in one digit * bigger chassis Signed-off-by: Michal Cieslakiewicz --- package/boot/uboot-envtools/files/ath79 | 1 + .../ath79/dts/qca9563_netgear_wndr4500-v3.dts | 41 +++++++++++++++++++ target/linux/ath79/image/nand.mk | 11 +++++ .../ath79/nand/base-files/etc/board.d/01_leds | 3 +- .../nand/base-files/etc/board.d/02_network | 6 ++- .../etc/hotplug.d/firmware/10-ath9k-eeprom | 6 ++- 6 files changed, 63 insertions(+), 5 deletions(-) create mode 100644 target/linux/ath79/dts/qca9563_netgear_wndr4500-v3.dts diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 85a0342a60..aafced98db 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -27,6 +27,7 @@ librerouter,librerouter-v1|\ netgear,ex6400|\ netgear,ex7300|\ netgear,wndr4300-v2|\ +netgear,wndr4500-v3|\ netgear,wnr1000-v2|\ netgear,wnr2000-v3|\ netgear,wnr2200-8m|\ diff --git a/target/linux/ath79/dts/qca9563_netgear_wndr4500-v3.dts b/target/linux/ath79/dts/qca9563_netgear_wndr4500-v3.dts new file mode 100644 index 0000000000..95e30ea84b --- /dev/null +++ b/target/linux/ath79/dts/qca9563_netgear_wndr4500-v3.dts @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include "qca9563_netgear_wndr.dtsi" + +/ { + compatible = "netgear,wndr4500-v3", "qca,qca9563"; + model = "Netgear WNDR4500 v3"; +}; + +&leds { + usb1_green { + label = "netgear:green:usb1"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + trigger-sources = <&hub_port0>; + linux,default-trigger = "usbport"; + }; + + usb2_green { + label = "netgear:green:usb2"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + trigger-sources = <&hub_port1>; + linux,default-trigger = "usbport"; + }; +}; + +&usb_phy1 { + status = "okay"; +}; + +&usb1 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + hub_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk index d5213523e4..f6929cd88e 100644 --- a/target/linux/ath79/image/nand.mk +++ b/target/linux/ath79/image/nand.mk @@ -165,6 +165,17 @@ define Device/netgear_wndr4300-v2 endef TARGET_DEVICES += netgear_wndr4300-v2 +define Device/netgear_wndr4500-v3 + SOC := qca9563 + DEVICE_MODEL := WNDR4500 + DEVICE_VARIANT := v3 + NETGEAR_KERNEL_MAGIC := 0x27051956 + NETGEAR_BOARD_ID := WNDR4500series + NETGEAR_HW_ID := 29764821+2+128+128+3x3+3x3+5508012173 + $(Device/netgear_ath79_nand) +endef +TARGET_DEVICES += netgear_wndr4500-v3 + define Device/zyxel_nbg6716 SOC := qca9558 DEVICE_VENDOR := ZyXEL diff --git a/target/linux/ath79/nand/base-files/etc/board.d/01_leds b/target/linux/ath79/nand/base-files/etc/board.d/01_leds index 0376b7cfc6..d9989ec538 100755 --- a/target/linux/ath79/nand/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/nand/base-files/etc/board.d/01_leds @@ -14,7 +14,8 @@ glinet,gl-ar300m-nor) ;; netgear,wndr3700-v4|\ netgear,wndr4300|\ -netgear,wndr4300-v2) +netgear,wndr4300-v2|\ +netgear,wndr4500-v3) ucidef_set_led_switch "wan-amber" "WAN (amber)" "netgear:amber:wan" "switch0" "0x20" ;; esac diff --git a/target/linux/ath79/nand/base-files/etc/board.d/02_network b/target/linux/ath79/nand/base-files/etc/board.d/02_network index 135a06d44b..bd02a4b383 100755 --- a/target/linux/ath79/nand/base-files/etc/board.d/02_network +++ b/target/linux/ath79/nand/base-files/etc/board.d/02_network @@ -18,7 +18,8 @@ ath79_setup_interfaces() ;; netgear,wndr3700-v4|\ netgear,wndr4300|\ - netgear,wndr4300-v2) + netgear,wndr4300-v2|\ + netgear,wndr4500-v3) ucidef_add_switch "switch0" \ "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" ;; @@ -39,7 +40,8 @@ ath79_setup_macs() case "$board" in netgear,wndr3700-v4|\ netgear,wndr4300|\ - netgear,wndr4300-v2) + netgear,wndr4300-v2|\ + netgear,wndr4500-v3) wan_mac=$(mtd_get_mac_binary caldata 0x6) ;; zyxel,nbg6716) diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 7ee291d109..d2f8bae1ca 100644 --- a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -11,7 +11,8 @@ case "$FIRMWARE" in case $board in netgear,wndr3700-v4|\ netgear,wndr4300|\ - netgear,wndr4300-v2) + netgear,wndr4300-v2|\ + netgear,wndr4500-v3) caldata_extract "caldata" 0x1000 0x440 ;; zyxel,nbg6716) @@ -27,7 +28,8 @@ case "$FIRMWARE" in case $board in netgear,wndr3700-v4|\ netgear,wndr4300|\ - netgear,wndr4300-v2) + netgear,wndr4300-v2|\ + netgear,wndr4500-v3) caldata_extract "caldata" 0x5000 0x440 ;; *) -- 2.25.1