From patchwork Sun Sep 3 05:44:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weijie Gao X-Patchwork-Id: 809227 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="g9wHfBT7"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="LZykIxsg"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xlMPX5sWzz9s7C for ; Sun, 3 Sep 2017 15:44:48 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:Message-Id: Date:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=CPbcOIcwScHzpwnQtDeNu9vqfDGQrYdqTdealeG2hXA=; b=g9wHfBT7q61vpC PWLXHeImzEk2s7LmFyogWJ+U6V3bb6wgStXfKiHyIM39O2XjKkiCeGNX9YszqF6FL+qdgSo7Gxk/t y5977ovlR2klQX/eApHo+s7WxOSsvJv21Ap0oGUfwCjuw1kIqRpo8xqGUv8ekptfPUKFtjV0A2PRC lJ0KmHAFK4aDzPxgFQm7B2/SvrhnxrXGl2zz7yoj9afLcN3Z7TXNlSZO09ib+D8dxvx5shTmPY6Gh 6quY48oBNcXJ4HFgfCJ1qCtjQOT3Wfu+O781TvJ4I4nBIQPllTS+PSBrWyK+IYQ16tO8qBkLel6Kj 8Ja0l5ZNEDBpYkJ7RNCg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1doNi5-0007C7-Te; Sun, 03 Sep 2017 05:44:41 +0000 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1doNhy-0006pJ-Rw for lede-dev@lists.infradead.org; Sun, 03 Sep 2017 05:44:40 +0000 Received: by mail-pf0-x244.google.com with SMTP id r25so2506645pfk.0 for ; Sat, 02 Sep 2017 22:44:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=kXzmMGLuAidMp2TPU1/n4fvtFXstSGqewlvhtuISoEI=; b=LZykIxsgp4NDEjwkwQ11CmaDqK21pqlMkNCP+fVlKMSOPF0ePN2Qx6pPEH/78CNEtz B+xE7GbW+89KIx0Ppqh4ralYOivnWgCjtq05oLoJR7Fur+35wMG/szvUpWJZvIlrq05d IYmxvJf+gP9EM8sj3dnpHhkx8d+nqEgLUgZMA8Ts5bG8Qa47JB51gv+sxhvjqepClXVr OHFJYNgX+5NIcQzQXz3zE+vASP3fGwvusRuYQFIiXpN2Ku9xe+cU11oDHl8xkFxYeABX 3zRsoStFq3lPvcPStkxWVxtnW+n4jtUtz33/x9u63yjH9HSW+Tg9UA67cIAndhRedJQo R8jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=kXzmMGLuAidMp2TPU1/n4fvtFXstSGqewlvhtuISoEI=; b=EfzJmwfVtygMLTGrEAn4HHen8YQjv+/auHsMA4EEroMGrzXY6yzHwDbdoLpDBpqjbq nnT8JCSbmvdbRryZkUQnnEeGk4CrwJ339elO21oYsfUb0gEkWdjrtWyfHLdsNyQ0wXEW dk8eTsemUChufADEQIL9M8rrqEnW9y6nlJQnv4RXMMhrRXGHOh5TFZIXQcc14GtxiUmY vQx9XvJ2NdFertIWrqTO7tgAzKuhcYRjQA8QIR8iDq3ozECv1BRWxhMT8etO5MHSjU5A uSFSnHa3PcUQIaJjRk6cMSM/iVFxVrALbydpMqSPi8pif345cCV07r6ZWXUsoOW/0o/t oLTA== X-Gm-Message-State: AHPjjUhyCChZ7Ejgbk3Ewt5qhPx4Lnz8pg4uE2jYoN+ZWYR7tO5I0Inp 5W6o8+Lbno/MLOvL X-Google-Smtp-Source: ADKCNb66eG/6VM9PfQ4u47EPY/MQPEchkR5w7x1DfghB82YhV5lOtAsuDNRfVo3sC3jk5W5NopEGCQ== X-Received: by 10.101.77.66 with SMTP id j2mr8297304pgt.314.1504417454277; Sat, 02 Sep 2017 22:44:14 -0700 (PDT) Received: from localhost ([182.148.31.147]) by smtp.gmail.com with ESMTPSA id b8sm5850410pfl.16.2017.09.02.22.44.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Sep 2017 22:44:13 -0700 (PDT) From: hackpascal To: lede-dev@lists.infradead.org Date: Sun, 3 Sep 2017 13:44:09 +0800 Message-Id: <20170903054409.4176-1-hackpascal@gmail.com> X-Mailer: git-send-email 2.11.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170902_224435_338693_6B1B52AB X-CRM114-Status: GOOD ( 16.08 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:400e:c00:0:0:0:244 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (hackpascal[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain Subject: [LEDE-DEV] [PATCHv2 4/4] ar71xx: add netgear wndr4500v3 support X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Weijie Gao MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Weijie Gao Netgear WNDR4500v3 uses one SPI-NOR and one SPI-NAND. The bootloader and caldata are on the SPI-NOR flash, and the firmware is on the SPI-NAND flash. Hardware specification: CPU: QCA9563 Switch: QCA8337N 5.8GHz Wifi: AR9580 SPI-NOR: 2MB SPI-NAND: 128MB DDR2: 128MB WNDR4300v2 is similar to WNDR4500v3 but not tested and not included here. Signed-off-by: Weijie Gao --- target/linux/ar71xx/base-files/etc/board.d/01_leds | 6 + .../linux/ar71xx/base-files/etc/board.d/02_network | 1 + target/linux/ar71xx/base-files/etc/diag.sh | 1 + target/linux/ar71xx/base-files/lib/ar71xx.sh | 3 + .../ar71xx/base-files/lib/upgrade/platform.sh | 3 +- .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt | 11 + target/linux/ar71xx/files/arch/mips/ath79/Makefile | 1 + .../files/arch/mips/ath79/mach-wndr4500-v3.c | 233 +++++++++++++++++++++ .../linux/ar71xx/files/arch/mips/ath79/machtypes.h | 1 + target/linux/ar71xx/image/legacy.mk | 2 + target/linux/ar71xx/image/nand.mk | 6 + target/linux/ar71xx/nand/config-default | 3 + 12 files changed, 270 insertions(+), 1 deletion(-) create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-wndr4500-v3.c diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds index 84b1a7dfd9..b4ebbd6173 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/01_leds +++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds @@ -828,6 +828,12 @@ wndr4300) ucidef_set_led_wlan "wlan2g" "WLAN2G" "netgear:green:wlan2g" "phy0tpt" ucidef_set_led_wlan "wlan5g" "WLAN5G" "netgear:blue:wlan5g" "phy1tpt" ;; +wndr4500-v3) + ucidef_set_led_netdev "wan" "WAN (green)" "netgear:green:wan" "eth0.2" + ucidef_set_led_usbdev "usb1" "USB1" "netgear:green:usb1" "1-1" + ucidef_set_led_usbdev "usb2" "USB2" "netgear:green:usb2" "2-1" + ucidef_set_led_wlan "wlan2g" "WLAN2G" "netgear:green:wlan2g" "phy0tpt" + ;; whr-g301n|\ whr-hp-g300n|\ whr-hp-gn) diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network index ba54d89b8f..d455afad69 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/02_network +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network @@ -262,6 +262,7 @@ ar71xx_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2" ;; + wndr4500-v3|\ cr5000|\ dgl-5500-a1|\ dhp-1565-a1|\ diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index 7753a7156d..6a392e790a 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -471,6 +471,7 @@ get_status_led() { wndr3700|\ wndr3700v4|\ wndr4300|\ + wndr4500-v3|\ wnr2000|\ wnr2000-v3|\ wnr2200|\ diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index 7fd5fb4522..e44fa0d09a 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -1249,6 +1249,9 @@ ar71xx_board_detect() { *"WNDR4300") name="wndr4300" ;; + *"WNDR4500v3") + name="wndr4500-v3" + ;; *"WNR1000 V2") name="wnr1000-v2" ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index 05b5634aa5..12e920f46d 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -533,7 +533,8 @@ platform_check_image() { r6100|\ rambutan|\ wndr3700v4|\ - wndr4300) + wndr4300|\ + wndr4500-v3) nand_do_platform_check $board $1 return $? ;; diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt index ff9c3037a1..68fdd4db66 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt +++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt @@ -1061,6 +1061,17 @@ config ATH79_MACH_WNDR4300 select ATH79_DEV_USB select ATH79_DEV_WMAC +config ATH79_MACH_WNDR4500_V3 + bool "NETGEAR WNDR4300v2/WNDR4500v3 board support" + select SOC_QCA956X + select ATH79_DEV_AP9X_PCI if PCI + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_USB + select ATH79_DEV_M25P80 + select ATH79_DEV_WMAC + config ATH79_MACH_WNR2000 bool "NETGEAR WNR2000 board support" select SOC_AR913X diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile index 469b6a794c..01848846d7 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile +++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile @@ -232,6 +232,7 @@ obj-$(CONFIG_ATH79_MACH_WLR8100) += mach-wlr8100.o obj-$(CONFIG_ATH79_MACH_WNDAP360) += mach-wndap360.o obj-$(CONFIG_ATH79_MACH_WNDR3700) += mach-wndr3700.o obj-$(CONFIG_ATH79_MACH_WNDR4300) += mach-wndr4300.o +obj-$(CONFIG_ATH79_MACH_WNDR4500_V3) += mach-wndr4500-v3.o obj-$(CONFIG_ATH79_MACH_WNR2000) += mach-wnr2000.o obj-$(CONFIG_ATH79_MACH_WNR2000_V3) += mach-wnr2000-v3.o obj-$(CONFIG_ATH79_MACH_WNR2000_V4) += mach-wnr2000-v4.o diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wndr4500-v3.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-wndr4500-v3.c new file mode 100644 index 0000000000..51a56308ab --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wndr4500-v3.c @@ -0,0 +1,233 @@ +/* + * NETGEAR WNDR4300v2/WNDR4500v3 board support + * + * Copyright (C) 2017 Weijie Gao + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "common.h" +#include "dev-ap9x-pci.h" +#include "dev-eth.h" +#include "dev-gpio-buttons.h" +#include "dev-leds-gpio.h" +#include "dev-spi.h" +#include "dev-m25p80.h" +#include "dev-nfc.h" +#include "dev-usb.h" +#include "dev-wmac.h" +#include "machtypes.h" + +/* QCA9563 GPIOs */ +#define WNDR4500V3_GPIO_LED_POWER_GREEN 5 +#define WNDR4500V3_GPIO_LED_POWER_AMBER 6 +#define WNDR4500V3_GPIO_LED_USB1 7 +#define WNDR4500V3_GPIO_LED_USB2 8 +#define WNDR4500V3_GPIO_LED_WPS 15 +#define WNDR4500V3_GPIO_LED_WAN_AMBER 16 +#define WNDR4500V3_GPIO_LED_WAN_GREEN 17 +#define WNDR4500V3_GPIO_LED_WLAN2G 19 + +#define WNDR4500V3_GPIO_BTN_WPS 1 +#define WNDR4500V3_GPIO_BTN_RESET 2 + +#define WNDR4500V3_GPIO_SPI_CS1 14 + +/* AR9580 GPIOs */ +#define WNDR4500V3_WGPIO_LED_WLAN5G 7 + +#define WNDR4500V3_WGPIO_BTN_WIRELESS 9 + +#define WNDR4500V3_KEYS_POLL_INTERVAL 20 /* msecs */ +#define WNDR4500V3_KEYS_DEBOUNCE_INTERVAL (3 * WNDR4500V3_KEYS_POLL_INTERVAL) + +#define WNDR4500V3_LAN_MAC_OFFSET 0 +#define WNDR4500V3_WAN_MAC_OFFSET 6 +#define WNDR4500V3_WLAN_MAC_OFFSET 12 +#define WNDR4500V3_WMAC_CALDATA_OFFSET 0x1000 +#define WNDR4500V3_PCIE_CALDATA_OFFSET 0x5000 + +static struct gpio_led wndr4500v3_leds_gpio[] __initdata = { + { + .name = "netgear:green:power", + .gpio = WNDR4500V3_GPIO_LED_POWER_GREEN, + .active_low = 1, + }, + { + .name = "netgear:amber:power", + .gpio = WNDR4500V3_GPIO_LED_POWER_AMBER, + .active_low = 1, + }, + { + .name = "netgear:green:wan", + .gpio = WNDR4500V3_GPIO_LED_WAN_GREEN, + .active_low = 1, + }, + { + .name = "netgear:amber:wan", + .gpio = WNDR4500V3_GPIO_LED_WAN_AMBER, + .active_low = 1, + }, + { + .name = "netgear:green:usb1", + .gpio = WNDR4500V3_GPIO_LED_USB1, + .active_low = 1, + }, + { + .name = "netgear:green:usb2", + .gpio = WNDR4500V3_GPIO_LED_USB2, + .active_low = 1, + }, + { + .name = "netgear:green:wps", + .gpio = WNDR4500V3_GPIO_LED_WPS, + .active_low = 1, + }, + { + .name = "netgear:green:wlan2g", + .gpio = WNDR4500V3_GPIO_LED_WLAN2G, + .active_low = 1, + } +}; + +static struct gpio_keys_button wndr4500v3_gpio_keys[] __initdata = { + { + .desc = "Reset button", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = WNDR4500V3_KEYS_DEBOUNCE_INTERVAL, + .gpio = WNDR4500V3_GPIO_BTN_RESET, + .active_low = 1, + }, + { + .desc = "WPS button", + .type = EV_KEY, + .code = KEY_WPS_BUTTON, + .debounce_interval = WNDR4500V3_KEYS_DEBOUNCE_INTERVAL, + .gpio = WNDR4500V3_GPIO_BTN_WPS, + .active_low = 1, + } +}; + +static struct gpio_keys_button wndr4500v3_wmac_gpio_keys[] = { + { + .desc = "Wireless button", + .type = EV_KEY, + .code = KEY_RFKILL, + .debounce_interval = WNDR4500V3_KEYS_DEBOUNCE_INTERVAL, + .gpio = WNDR4500V3_WGPIO_BTN_WIRELESS, + .active_low = 1, + } +}; + +static struct ar8327_pad_cfg wndr4500v3_qca8337n_pad0_cfg = { + .mode = AR8327_PAD_MAC_SGMII, + .sgmii_delay_en = true, +}; + +static struct ar8327_led_cfg wndr4500v3_qca8337n_led_cfg = { + .led_ctrl0 = 0xcc35cc35, + .led_ctrl1 = 0xcb37cb37, + .led_ctrl2 = 0x00000000, + .led_ctrl3 = 0x00f3cf00, + .open_drain = true, +}; + +static struct ar8327_platform_data wndr4500v3_qca8337n_data = { + .pad0_cfg = &wndr4500v3_qca8337n_pad0_cfg, + .port0_cfg = { + .force_link = 1, + .speed = AR8327_PORT_SPEED_1000, + .duplex = 1, + .txpause = 1, + .rxpause = 1, + }, + .led_cfg = &wndr4500v3_qca8337n_led_cfg, +}; + +static struct mdio_board_info wndr4500v3_mdio0_info[] = { + { + .bus_id = "ag71xx-mdio.0", + .phy_addr = 0, + .platform_data = &wndr4500v3_qca8337n_data, + }, +}; + +static struct spi_board_info wndr4500v3_spi_info[] = { + { + .bus_num = 0, + .chip_select = 0, + .max_speed_hz = 25000000, + .modalias = "m25p80", + }, + { + .bus_num = 0, + .chip_select = 1, + .max_speed_hz = 50000000, + .modalias = "gd5f", + }, +}; + +static struct ath79_spi_platform_data wndr4500v3_spi_data = { + .bus_num = 0, + .num_chipselect = 2, +}; + +static void __init wndr4500v3_setup(void) +{ + u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); + u8 tmpmac[ETH_ALEN]; + + ath79_register_spi(&wndr4500v3_spi_data, wndr4500v3_spi_info, 2); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(wndr4500v3_leds_gpio), + wndr4500v3_leds_gpio); + + ath79_register_gpio_keys_polled(-1, WNDR4500V3_KEYS_POLL_INTERVAL, + ARRAY_SIZE(wndr4500v3_gpio_keys), + wndr4500v3_gpio_keys); + + ap9x_pci_setup_wmac_btns(0, wndr4500v3_wmac_gpio_keys, + ARRAY_SIZE(wndr4500v3_wmac_gpio_keys), + WNDR4500V3_KEYS_POLL_INTERVAL); + + ath79_init_mac(tmpmac, art + WNDR4500V3_WLAN_MAC_OFFSET, 0); + ath79_register_wmac(art + WNDR4500V3_WMAC_CALDATA_OFFSET, tmpmac); + + ap9x_pci_setup_wmac_led_pin(0, WNDR4500V3_WGPIO_LED_WLAN5G); + ath79_init_mac(tmpmac, art + WNDR4500V3_WLAN_MAC_OFFSET, 1); + ap91_pci_init(art + WNDR4500V3_PCIE_CALDATA_OFFSET, tmpmac); + + mdiobus_register_board_info(wndr4500v3_mdio0_info, + ARRAY_SIZE(wndr4500v3_mdio0_info)); + + ath79_register_mdio(0, 0x0); + + ath79_init_mac(ath79_eth0_data.mac_addr, art + WNDR4500V3_LAN_MAC_OFFSET, 0); + + /* GMAC0 is connected to a QCA8337N switch */ + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_SGMII; + ath79_eth0_data.speed = SPEED_1000; + ath79_eth0_data.duplex = DUPLEX_FULL; + ath79_eth0_data.phy_mask = BIT(0); + ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; + ath79_register_eth(0); + + ath79_register_usb(); +} + +MIPS_MACHINE(ATH79_MACH_WNDR4500_V3, "WNDR4500_V3", "NETGEAR WNDR4500v3", + wndr4500v3_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h index 5bc50a42ff..a4aa197e35 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h @@ -303,6 +303,7 @@ enum ath79_mach_type { ATH79_MACH_WNDR3700, /* NETGEAR WNDR3700/WNDR3800/WNDRMAC */ ATH79_MACH_WNDR3700_V4, /* NETGEAR WNDR3700v4 */ ATH79_MACH_WNDR4300, /* NETGEAR WNDR4300 */ + ATH79_MACH_WNDR4500_V3, /* NETGEAR WNDR4500 v3 */ ATH79_MACH_WNR1000_V2, /* NETGEAR WNR1000 v2 */ ATH79_MACH_WNR2000, /* NETGEAR WNR2000 */ ATH79_MACH_WNR2000_V3, /* NETGEAR WNR2000 v3 */ diff --git a/target/linux/ar71xx/image/legacy.mk b/target/linux/ar71xx/image/legacy.mk index b400e5ddbb..2808516ea0 100644 --- a/target/linux/ar71xx/image/legacy.mk +++ b/target/linux/ar71xx/image/legacy.mk @@ -274,6 +274,7 @@ wnr2000v4_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,3776k(firmw r6100_mtdlayout=mtdparts=ar934x-nfc:128k(u-boot)ro,256k(caldata)ro,256k(caldata-backup),512k(config),512k(pot),2048k(kernel),122240k(ubi),25600k@0x1a0000(firmware),2048k(language),3072k(traffic_meter) tew823dru_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro wndr4300_mtdlayout=mtdparts=ar934x-nfc:256k(u-boot)ro,256k(u-boot-env)ro,256k(caldata)ro,512k(pot),2048k(language),512k(config),3072k(traffic_meter),2048k(kernel),23552k(ubi),25600k@0x6c0000(firmware),256k(caldata_backup),-(reserved) +wndr4500v3_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(caldata_backup),64k(config),64k(traffic_meter),64k(pot),1408k(reserved),64k(caldata);spi0.1:2048k(kernel),23552k(ubi),25600k@0x0(firmware),2048k(language),128k(mtdoops),-(reserved) nofwsplit zcn1523h_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6208k(rootfs),1472k(kernel),64k(configure)ro,64k(mfg)ro,64k(art)ro,7680k@0x50000(firmware) mynet_rext_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,7808k(firmware),64k(nvram)ro,64k(ART)ro zyx_nbg6716_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(env)ro,64k(RFdata)ro,-(nbu);ar934x-nfc:2048k(zyxel_rfsd),2048k(romd),1024k(header),2048k(kernel),-(ubi) @@ -1016,6 +1017,7 @@ ifeq ($(SUBTARGET),nand) $(eval $(call SingleProfile,NetgearNAND,64k,WNDR3700V4,wndr3700v4,WNDR3700_V4,ttyS0,115200,$$(wndr4300_mtdlayout),0x33373033,WNDR3700v4,"",-H 29763948+128+128,wndr4300)) $(eval $(call SingleProfile,NetgearNAND,64k,WNDR4300V1,wndr4300,WNDR4300,ttyS0,115200,$$(wndr4300_mtdlayout),0x33373033,WNDR4300,"",-H 29763948+0+128+128+2x2+3x3,wndr4300)) +$(eval $(call SingleProfile,NetgearNAND,64k,WNDR4500V3,wndr4500v3,WNDR4500_V3,ttyS0,115200,$$(wndr4500v3_mtdlayout),0x27051956,WNDR4500series,"",-H 29764821+2+128+128+3x3+3x3+5508012173,wndr4300)) $(eval $(call SingleProfile,NetgearNAND,64k,R6100,r6100,R6100,ttyS0,115200,$$(r6100_mtdlayout),0x36303030,R6100,"",-H 29764434+0+128+128+2x2+2x2,wndr4300)) $(eval $(call SingleProfile,ZyXELNAND,128k,NBG6716,nbg6716,NBG6716,ttyS0,115200,NBG6716,$$(zyx_nbg6716_mtdlayout),mem=256M)) diff --git a/target/linux/ar71xx/image/nand.mk b/target/linux/ar71xx/image/nand.mk index fafccb9b77..b4ae6c21d9 100644 --- a/target/linux/ar71xx/image/nand.mk +++ b/target/linux/ar71xx/image/nand.mk @@ -115,6 +115,12 @@ define LegacyDevice/WNDR4300V1 endef LEGACY_DEVICES += WNDR4300V1 +define LegacyDevice/WNDR4500V3 + DEVICE_TITLE := NETGEAR WNDR4500v3 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport +endef +LEGACY_DEVICES += WNDR4500V3 + define LegacyDevice/NBG6716 DEVICE_TITLE := Zyxel NBG 6716 DEVICE_PACKAGES := kmod-rtc-pcf8563 kmod-ath10k ath10k-firmware-qca988x diff --git a/target/linux/ar71xx/nand/config-default b/target/linux/ar71xx/nand/config-default index 57318b38e8..6c50d6c071 100644 --- a/target/linux/ar71xx/nand/config-default +++ b/target/linux/ar71xx/nand/config-default @@ -183,6 +183,7 @@ CONFIG_ATH79_MACH_RAMBUTAN=y # CONFIG_ATH79_MACH_WNDAP360 is not set # CONFIG_ATH79_MACH_WNDR3700 is not set CONFIG_ATH79_MACH_WNDR4300=y +CONFIG_ATH79_MACH_WNDR4500_V3=y # CONFIG_ATH79_MACH_WNR2000 is not set # CONFIG_ATH79_MACH_WNR2000_V3 is not set # CONFIG_ATH79_MACH_WNR2000_V4 is not set @@ -230,6 +231,8 @@ CONFIG_MTD_NAND_BCH=y CONFIG_MTD_NAND_ECC=y CONFIG_MTD_NAND_ECC_BCH=y # CONFIG_MTD_REDBOOT_PARTS is not set +CONFIG_MTD_SPI_NAND=y +CONFIG_MTD_SPI_NAND_DEVICES=y # CONFIG_MTD_SPLIT_EVA_FW is not set # CONFIG_MTD_SPLIT_SEAMA_FW is not set # CONFIG_MTD_SPLIT_TPLINK_FW is not set