From 9b6f89c37fc9c2e23cc123bd7b5cf9a1f8dc301a Mon Sep 17 00:00:00 2001 From: Michal Cieslakiewicz Date: Thu, 31 Oct 2019 21:18:10 +0100 Subject: ath79: add support for Netgear WNDR4300 This patch adds ath79 support for Netgear WNDR4300. Router was previously supported by ar71xx target only. Note: device requires 'ar934x-nand' driver in kernel. Specification ============= * Description: Netgear WNDR4300 * 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_wndr4300=y CONFIG_ALL_KMODS=y CONFIG_DEVEL=y CONFIG_CCACHE=y CONFIG_COLLECT_KERNEL_DEBUG=y CONFIG_IMAGEOPT=y Signed-off-by: Michal Cieslakiewicz --- target/linux/ath79/nand/base-files/etc/board.d/01_leds | 3 +++ target/linux/ath79/nand/base-files/etc/board.d/02_network | 7 +++++++ .../nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom | 13 +++++++++++++ target/linux/ath79/nand/base-files/lib/upgrade/platform.sh | 1 + 4 files changed, 24 insertions(+) (limited to 'target/linux/ath79/nand') 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 59c35ed828..f851b3d886 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 @@ -11,6 +11,9 @@ case "$board" in glinet,gl-ar300m-nand) ucidef_set_led_netdev "lan" "LAN" "gl-ar300m:green:lan" "eth0" ;; +netgear,wndr4300) + ucidef_set_led_switch "wan-amber" "WAN (amber)" "netgear:amber:wan" "switch0" "0x20" + ;; esac board_config_flush 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 faf70218ac..9d7a19c2eb 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 @@ -11,6 +11,10 @@ ath79_setup_interfaces() aerohive,hiveap-121) ucidef_set_interface_lan "eth0" ;; + netgear,wndr4300) + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" + ;; zyxel,nbg6716) ucidef_add_switch "switch0" \ "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1" @@ -26,6 +30,9 @@ ath79_setup_macs() local board="$1" case "$board" in + netgear,wndr4300) + wan_mac=$(mtd_get_mac_binary caldata 0x6) + ;; zyxel,nbg6716) lan_mac=$(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +2) wan_mac=$(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +3) 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 88a40b5d41..ae1d3572a8 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 @@ -9,6 +9,9 @@ board=$(board_name) case "$FIRMWARE" in "ath9k-eeprom-ahb-18100000.wmac.bin") case $board in + netgear,wndr4300) + caldata_extract "caldata" 0x1000 0x440 + ;; zyxel,nbg6716) caldata_extract "art" 0x1000 0x440 ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env ethaddr) @@ -18,4 +21,14 @@ case "$FIRMWARE" in ;; esac ;; +"ath9k-eeprom-pci-0000:00:00.0.bin") + case $board in + netgear,wndr4300) + caldata_extract "caldata" 0x5000 0x440 + ;; + *) + caldata_die "board $board is not supported yet" + ;; + esac + ;; esac diff --git a/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh b/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh index 6f8c7d47ff..1b1ae0391e 100644 --- a/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh @@ -14,6 +14,7 @@ platform_do_upgrade() { case "$board" in aerohive,hiveap-121|\ + netgear,wndr4300|\ zyxel,nbg6716) nand_do_upgrade "$1" ;; -- cgit v1.2.3