From patchwork Sun Jul 19 21:24:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sander Vanheule X-Patchwork-Id: 1331953 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=svanheule.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=LpkZxDwa; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=svanheule.net header.i=@svanheule.net header.a=rsa-sha256 header.s=mail1707 header.b=z/aXLy7y; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B8ybc52FSz9sSn for ; Mon, 20 Jul 2020 07:26:36 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2YIJQU+rI7sQczCwNdWf48GUrJYYQIIcCMgqxC34ecw=; b=LpkZxDwaMkS6AgAPXIE+xQ8pJ avlDirG4lz5u1wgD8NOqQxXGrq38uWz1mSaM5nRh42yW71UlYJ9xgc8LQMX3Ha7N7q6LIxqTxBerG YLmOdJW4o9gvo4sxz2SMRXhPbuj2Smk6I9eHkMZqHKKj0tHH/f2s2oQ4DukJ5+2eLgx0YuX6Shvdq 9bII29SM5jES4Gf/eV15BxD3fMoxWD5T/jLeL/Wv+lVsEXaH8/BfJTwffHKI59L+YUZgVmBH9XcTI JHgWQihUc4XU7eLeuNWAU7H37khP8XtqbvRddONbC+PW64D2GrpXd+fMfJKgKQv/XQUUwUZFRA6WA jGfCW99yg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxGnb-0000Bn-3G; Sun, 19 Jul 2020 21:24:43 +0000 Received: from polaris.svanheule.net ([84.16.241.116]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxGnZ-0000BH-Bq for openwrt-devel@lists.openwrt.org; Sun, 19 Jul 2020 21:24:42 +0000 Received: from terra.local.svanheule.net (unknown [IPv6:2a02:a03f:5670:b301:4dd0:c870:d4d:e262]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id 437D416136C; Sun, 19 Jul 2020 23:24:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1595193878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=W7+pc3ME+SP+7jmvUw2sE7QnXmt+ca8md8y/27M5V6Q=; b=z/aXLy7yeCxR7s+A3cUt0iQTjdHIEs4FSmHfe9yyYk3A/bWY1vK2paDNRcMFSk/GSKKRUf 5hVYZ1TNkRxrb7zqmUZNDlxEoeTzMP0IZI/X4mJ1db7hmaDJ5Y0D7Ph3CBOAcBiYbf/hjr rWDaZwlPs3U4G+tjvA/bBuQ34cVI5VuvfrLksJ+U53NVpxoL+u2T/sUGi5t4eih0njRqX/ /YxWtDFipAcb207ZQ+zlW4064mK9Bf6kmTyM691zTZe99jBMtNNsgj86CaoNtFX5J+xkfW M3RWxTrKzHp0Ip69wyjPX8/hBBs4YX5Xh/Hapq83a4TKVtW/h9JeECQfr3az0Q== From: Sander Vanheule To: openwrt-devel@lists.openwrt.org Subject: [RFC PATCH v2 1/6] ath79: ensure QCA956x gmac0 mux selects sgmii Date: Sun, 19 Jul 2020 23:24:03 +0200 Message-Id: X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200719_172441_542918_7613CA14 X-CRM114-Status: GOOD ( 12.12 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [84.16.241.116 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sander Vanheule , David Bauer Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Some bootloaders do not set up gmac0 properly, leaving it disconnected from the sgmii interface. If the user specificies phy-mode sgmii, then use the gmac-config/device node to ensure the mux is configured correctly. Signed-off-by: Sander Vanheule Cc: David Bauer --- .../net/ethernet/atheros/ag71xx/ag71xx_main.c | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c index d611007a86..e86dbfffcf 100644 --- a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c +++ b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c @@ -665,6 +665,40 @@ out: of_node_put(np); } +static void ag71xx_mux_select_sgmii_qca956x(struct device_node *np) +{ + struct device_node *np_dev; + void __iomem *gmac_base; + int err = 0; + u32 serdes_cal; + u32 t; + + np = of_get_child_by_name(np, "gmac-config"); + if (!np) + return; + + np_dev = of_parse_phandle(np, "device", 0); + if (!np_dev) + goto out; + + gmac_base = of_iomap(np_dev, 0); + if (!gmac_base) { + pr_err("%pOF: can't map GMAC registers\n", np_dev); + err = -ENOMEM; + goto err_iomap; + } + + t = __raw_readl(gmac_base + QCA956X_GMAC_REG_ETH_CFG); + t |= QCA956X_ETH_CFG_GE0_SGMII; + __raw_writel(t, gmac_base + QCA956X_GMAC_REG_ETH_CFG); + + iounmap(gmac_base); +err_iomap: + of_node_put(np_dev); +out: + of_node_put(np); +} + static void ath79_mii_ctrl_set_if(struct ag71xx *ag, unsigned int mii_if) { u32 t; @@ -1566,6 +1600,10 @@ static int ag71xx_probe(struct platform_device *pdev) return ag->phy_if_mode; } + if (of_device_is_compatible(np, "qca,qca9560-eth") && + ag->phy_if_mode == PHY_INTERFACE_MODE_SGMII) + ag71xx_mux_select_sgmii_qca956x(np); + if (of_property_read_u32(np, "qca,mac-idx", &ag->mac_idx)) ag->mac_idx = -1; if (ag->mii_base) From patchwork Sun Jul 19 21:24:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sander Vanheule X-Patchwork-Id: 1331955 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=svanheule.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=WdxhjLs8; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=svanheule.net header.i=@svanheule.net header.a=rsa-sha256 header.s=mail1707 header.b=9MAnJ9fA; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B8ybc4Z02z9sSJ for ; Mon, 20 Jul 2020 07:26:36 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Ve24WHR/A59+3QVSt6S0ZD0BxgEwXccQ3eXWSdw3b40=; b=WdxhjLs8mbyiaBwfQ/P5lTFw3 nHnr6SfD761dGjA0qokJdxztpoTOgCJ5kFkTTf7sPFnHSBKtL9NjiZBkmMoJfpqTachaVoJZuQxWI bExW22d4oU9Ncjsf4VraGm8+qSHExcAV/lT13Fp3X3bkDJ/YxmS11U13eq+51S53iv+aoi6sYOjZL EvANlue7th6ZW6YVwypyt0OFwnogdcjPd8uGSbSRs1kFPJc3/WeZpx05QgTdws4LlhPBnQk3Fyz4I 0blSH7qJUPHdxP2uciFOoWkPKRANYJgmkLZN7s4FyU9wetP94L4rVe838OSn2JJ+TYxMV5fguSHvH 8GU1P9TtQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxGne-0000Cf-M4; Sun, 19 Jul 2020 21:24:46 +0000 Received: from polaris.svanheule.net ([84.16.241.116]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxGnc-0000Bw-8x for openwrt-devel@lists.openwrt.org; Sun, 19 Jul 2020 21:24:45 +0000 Received: from terra.local.svanheule.net (unknown [IPv6:2a02:a03f:5670:b301:4dd0:c870:d4d:e262]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id 0546C16136D; Sun, 19 Jul 2020 23:24:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1595193883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KZY7A9IYf2MVCpbeWEQxpKLM4jzeWaSFazQJY4QnWbw=; b=9MAnJ9fAJxueK3goctVO71vcX3kH1JgzPgdH8uIRo6f2JjFXbW5fxWcSSTuWtMXfA9tSH5 uH7VvSSPNglYNTqb7ibJPSX/XqGIAjimSNv1cth94iNBmPPsUOWDfq4JY1atSzo8L3UAGC VWcsZzL1zLRW81Z7BIcczju5zCPmgZdBpT3QS95yVInnYjrHP5Cs+uDJRYIxcTa2LTRvCn J8UxHXlMPgyPo4rhajXbi4PddXa6PcEVWW+pWCoVR95Tz5qYgFKm7t8IQN7XZpIlF0Ix7j nOUtN19do8ag3QjdxfON66CuQHBtblt/1qAHbwah1nhSqx3w6av3RklYgwuXCg== From: Sander Vanheule To: openwrt-devel@lists.openwrt.org Subject: [RFC PATCH v2 2/6] ath79: add QCA956x SERDES init workaround Date: Sun, 19 Jul 2020 23:24:04 +0200 Message-Id: <0580ec0fe299e6669b8e0744add37ac738874578.1595193767.git.sander@svanheule.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200719_172444_460598_C88D11DC X-CRM114-Status: GOOD ( 14.03 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [84.16.241.116 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sander Vanheule , Julien Dusser Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: Julien Dusser This commit add a workaround for non working SGMII link observed on some QCA956x SoCs. The workaround originates part from the U-Boot source code from QCA, part from the implementation from TP-Link found in the GPL tarball for the EAP245v1. Extends commit 0d416a8d3b990e3b78628f0e7546527709c877f7 for QCA956x. Note that reset is the same on QCA955x and QCA956x, same register offset and values. Auto calibration is done on u-boot, but always fall back to default value 0x7. Add a DTS entry serdes-cal in case a device require another value. Signed-off-by: Julien Dusser Signed-off-by: Sander Vanheule --- .../net/ethernet/atheros/ag71xx/ag71xx_main.c | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c index e86dbfffcf..8874a3440e 100644 --- a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c +++ b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c @@ -577,6 +577,79 @@ static void ag71xx_bit_clear(void __iomem *reg, u32 bit) __raw_readl(reg); } +/* Set SGMII VCO resistor value */ +static void ag71xx_serdes_cal_qca956x(struct device_node *np) +{ + struct device_node *np_dev; + void __iomem *gmac_base; + int err = 0; + u32 serdes_cal; + u32 t; + + np = of_get_child_by_name(np, "gmac-config"); + if (!np) + return; + + if(of_property_read_u32(np, "serdes-cal", &serdes_cal)) + /* By default, use middle value for resistor calibration */ + serdes_cal = 0x7; + + np_dev = of_parse_phandle(np, "device", 0); + if (!np_dev) + goto out; + + gmac_base = of_iomap(np_dev, 0); + if (!gmac_base) { + pr_err("%pOF: can't map GMAC registers\n", np_dev); + err = -ENOMEM; + goto err_iomap; + } + + pr_info("%pOF: fixup SERDES calibration to value %i\n", np_dev, serdes_cal); + t = __raw_readl(gmac_base + QCA956X_GMAC_REG_SGMII_SERDES); + t &= ~(QCA956X_SGMII_SERDES_RES_CALIBRATION_MASK + << QCA956X_SGMII_SERDES_RES_CALIBRATION_SHIFT); + t |= (serdes_cal & QCA956X_SGMII_SERDES_RES_CALIBRATION_MASK) + << QCA956X_SGMII_SERDES_RES_CALIBRATION_SHIFT; + __raw_writel(t, gmac_base + QCA956X_GMAC_REG_SGMII_SERDES); + + ath79_pll_wr(QCA956X_PLL_ETH_SGMII_SERDES_REG, + QCA956X_PLL_ETH_SGMII_SERDES_LOCK_DETECT + | QCA956X_PLL_ETH_SGMII_SERDES_EN_PLL); + + t = __raw_readl(gmac_base + QCA956X_GMAC_REG_SGMII_SERDES); + + /* missing in QCA u-boot code, clear before setting */ + t &= ~(QCA956X_SGMII_SERDES_CDR_BW_MASK + << QCA956X_SGMII_SERDES_CDR_BW_SHIFT | + QCA956X_SGMII_SERDES_TX_DR_CTRL_MASK + << QCA956X_SGMII_SERDES_TX_DR_CTRL_SHIFT | + QCA956X_SGMII_SERDES_VCO_REG_MASK + << QCA956X_SGMII_SERDES_VCO_REG_SHIFT); + + t |= (3 << QCA956X_SGMII_SERDES_CDR_BW_SHIFT) | + (1 << QCA956X_SGMII_SERDES_TX_DR_CTRL_SHIFT) | + QCA956X_SGMII_SERDES_PLL_BW | + QCA956X_SGMII_SERDES_EN_SIGNAL_DETECT | + QCA956X_SGMII_SERDES_FIBER_SDO | + (3 << QCA956X_SGMII_SERDES_VCO_REG_SHIFT); + + __raw_writel(t, gmac_base + QCA956X_GMAC_REG_SGMII_SERDES); + + ath79_device_reset_clear(QCA956X_RESET_SGMII_ANALOG); + ath79_device_reset_clear(QCA956X_RESET_SGMII); + + while (!(__raw_readl(gmac_base + QCA956X_GMAC_REG_SGMII_SERDES) + & QCA956X_SGMII_SERDES_LOCK_DETECT_STATUS)) + ; + + iounmap(gmac_base); +err_iomap: + of_node_put(np_dev); +out: + of_node_put(np); +} + static void ag71xx_sgmii_init_qca955x(struct device_node *np) { struct device_node *np_dev; @@ -1457,6 +1530,11 @@ static int ag71xx_probe(struct platform_device *pdev) if (!res) return -EINVAL; + if (of_property_read_bool(np, "qca956x-serdes-fixup")) { + ag71xx_serdes_cal_qca956x(np); + ag71xx_sgmii_init_qca955x(np); + } + err = ag71xx_setup_gmac(np); if (err) return err; From patchwork Sun Jul 19 21:24:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sander Vanheule X-Patchwork-Id: 1331957 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=svanheule.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=MTdLPSK0; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=svanheule.net header.i=@svanheule.net header.a=rsa-sha256 header.s=mail1707 header.b=J8Le/GMx; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B8ybc5GYxz9sSt for ; Mon, 20 Jul 2020 07:26:36 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lqIYT5+hmT+0U8U/ccxvqPPlAliDPexl2PwGJKhdv+g=; b=MTdLPSK0lqXd6r5p/NHAf1Qal IuL/fpkat/oQf9zKoiwoA6rlZ57n3VjfJLfNYBOn7SEV2WRrVmI3nGn5BqrMiaMyvXeyySnH9KBHS +0AcFk8DvG1M1SapSByN+aOeM7XhflmRRrIXmQUlRhaeLrrJjXjX37kRsVsflqaG+w58kWDmo8VSb vqFEkJGCFiWDLedddoz+EKIEmovxLwvSHvLyvtD5M7DzDIlKOqo1Z5AFO0M6YxQSMF7QO9IA768ap XTxn5vRAVLoJ1xPxJ0RTy+h8Os+qkHsUPTvuubqECe2IIHRkbTAcASzab8SVcwG6a1yHzDH3Y3e9h ESxZFcf+g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxGnk-0000FP-Lo; Sun, 19 Jul 2020 21:24:52 +0000 Received: from polaris.svanheule.net ([2a00:c98:2060:a004:1::200]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxGne-0000CI-T9 for openwrt-devel@lists.openwrt.org; Sun, 19 Jul 2020 21:24:49 +0000 Received: from terra.local.svanheule.net (unknown [IPv6:2a02:a03f:5670:b301:4dd0:c870:d4d:e262]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id 6A04A16136E; Sun, 19 Jul 2020 23:24:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1595193883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1zAFQBtRLyoovE0D8nGOGlX80/v3+A1aSESn2g1zc10=; b=J8Le/GMxEJjsUMCumQ8iHYDy5W4ydgQPPpOnFL7wvTQch/sHTXL3dfkboU42ih5CZzstz4 WKO8OmeShjiejQUOWNrpPKF14BQrZYOHrwCDx05AWEywcljOPdkXaAXRhHq9K+JweDdlr7 gAy1Odj26wQ7c7nsAIwFHLWL/SNZeVr527M2lecsRIzWZ7nwuBArZ6jaaT14zQUFux6+75 qBo9au08yuezr5HVvGbEJYpGs4peIQ+ILmleMPiy/XevTiov4W+eXxmsMstWlystNZREvo Ca1h3CwHHX+HoDqUCBV3KW4cKMQy50WebfBDvWcMamt33pmV6bGP/MZM8G8qlg== From: Sander Vanheule To: openwrt-devel@lists.openwrt.org Subject: [RFC PATCH v2 3/6] ath79: prepare for 1-port TP-Link EAP2x5 devices Date: Sun, 19 Jul 2020 23:24:05 +0200 Message-Id: X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200719_172447_249951_CAE5CA15 X-CRM114-Status: GOOD ( 12.90 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:c98:2060:a004:1:0:0:200 listed in] [list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sander Vanheule , Julien Dusser Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org TP-Link has developed a number of access points based on the AP152 reference board. In the EAP-series of 802.11ac access points, this includes the following devices with one ethernet port: * EAP225 v1/v2 * EAP225 v3 * EAP225-Outdoor v1 * EAP245 v1 Since the only differences between these devices are the ath10k wireless radios and LEDs, a common base is provided for the overlapping support requirements. Hardware commonalities: * SoC: QCA9563-AL3A MIPS 74kc v5.0 @ 775MHz, AHB @ 258MHz * RAM: 128MiB DDR2 @ 650MHz * Flash: 16MiB SPI NOR * Wi-Fi 2.4GHz: provided by SoC * Wi-Fi 5Ghz: ath10k chip on PCIe * Ethernet: AR8033-AL1A, one 1GbE port (802.3at PoE) This patch was originally developed by Julien Dusser for the EAP245 v1, and was adapted by Sander Vanheule to support more devices. Signed-off-by: Julien Dusser Signed-off-by: Sander Vanheule --- .../dts/qca9563_tplink_eap2x5_1port.dtsi | 139 ++++++++++++++++++ target/linux/ath79/image/generic-tp-link.mk | 10 ++ 2 files changed, 149 insertions(+) create mode 100644 target/linux/ath79/dts/qca9563_tplink_eap2x5_1port.dtsi diff --git a/target/linux/ath79/dts/qca9563_tplink_eap2x5_1port.dtsi b/target/linux/ath79/dts/qca9563_tplink_eap2x5_1port.dtsi new file mode 100644 index 0000000000..24f0b4f0ce --- /dev/null +++ b/target/linux/ath79/dts/qca9563_tplink_eap2x5_1port.dtsi @@ -0,0 +1,139 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include +#include + +#include "qca956x.dtsi" + +/ { + aliases { + label-mac-device = ð0; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x020000>; + read-only; + }; + + partition@20000 { + label = "partition-table"; + reg = <0x020000 0x010000>; + read-only; + }; + + info: partition@30000 { + label = "info"; + reg = <0x030000 0x010000>; + read-only; + }; + + partition@40000 { + compatible = "openwrt,elf"; + label = "firmware"; + reg = <0x040000 0xec0000>; + }; + + partition@f00000 { + label = "config"; + reg = <0xf00000 0x030000>; + read-only; + }; + + partition@f30000 { + label = "mutil-log"; + reg = <0xf30000 0x080000>; + read-only; + }; + + partition@fb0000 { + label = "oops"; + reg = <0xfb0000 0x040000>; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&pinmux { + mdio_pins: pinux_mdio_pins { + /* GPIO 8 as MDC(0x21), GPIO 10 as MDIO(0x20) */ + pinctrl-single,bits = <0x8 0x00000021 0x000000ff>, + <0x8 0x00200000 0x00ff0000>; + }; +}; + +&mdio0 { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>; + + phy-mask = <0x10>; + + phy4: ethernet-phy@4 { + reg = <4>; + reset-gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&phy4>; + phy-mode = "sgmii"; + + mtd-mac-address = <&info 0x8>; + + qca956x-serdes-fixup; + + gmac-config { + device = <&gmac>; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&info 0x8>; +}; diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk index 8a26e4bebe..d2cc8d09bd 100644 --- a/target/linux/ath79/image/generic-tp-link.mk +++ b/target/linux/ath79/image/generic-tp-link.mk @@ -362,6 +362,16 @@ define Device/tplink_cpe610-v2 endef TARGET_DEVICES += tplink_cpe610-v2 +define Device/tplink_eap2x5_1port + $(Device/tplink-safeloader) + SOC := qca9563 + IMAGE_SIZE := 15104k + LOADER_TYPE := elf + KERNEL := kernel-bin | append-dtb | lzma | loader-kernel + KERNEL_INITRAMFS := $$(KERNEL) + IMAGE/factory.bin := append-rootfs | tplink-safeloader factory | pad-extra 128 +endef + define Device/tplink_eap245-v3 $(Device/tplink-safeloader) SOC := qca9563 From patchwork Sun Jul 19 21:24:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sander Vanheule X-Patchwork-Id: 1331954 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=svanheule.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=OQRQ8V45; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=svanheule.net header.i=@svanheule.net header.a=rsa-sha256 header.s=mail1707 header.b=C5bHMYvo; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B8ybb0NJjz9sRk for ; Mon, 20 Jul 2020 07:26:34 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0LgvLm/GIcX7+uZuHarGJf2NoIKaZxj/awz1Ex3jRIo=; b=OQRQ8V45RM+ZLwYSOj4BimHek A/atB5NkDhawHZGs/1FJJfX0/kSmQaJZd8y/7wzceAervKqjBI7rzsht5WDdyYel/KVFTUb2bSDzm DXNP/qfp418LxXXA2JBVwIWC+NF2U79FS+hUJ3SJmeUVUPx5hJStazxS9DPrfUfd3tpnO7qjMlKC7 5h7eFLby4Yp5UmkMtdn4BQBNnzEaVY16Ib+KyjsnncdK+pqHw6B/4gctjUbRaJIntX6B5y5hmjkRQ e2I+y4kswaI7QDIaVtRM//OugPRtO/jyhV2S45XKq3Xy5ZAsaSA/UxNnLbdCiBdPrufkTb1ZaU8TA kzcOgGCuA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxGni-0000El-KD; Sun, 19 Jul 2020 21:24:50 +0000 Received: from polaris.svanheule.net ([84.16.241.116]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxGne-0000CM-3T for openwrt-devel@lists.openwrt.org; Sun, 19 Jul 2020 21:24:47 +0000 Received: from terra.local.svanheule.net (unknown [IPv6:2a02:a03f:5670:b301:4dd0:c870:d4d:e262]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id AD60D16136F; Sun, 19 Jul 2020 23:24:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1595193884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z/+9PIKoXIjFCVtr/MUUeA2By3BFABRpFuQG0/SFfUY=; b=C5bHMYvoml7hNQDKsQfwNyqF+j3LKQgwnzgPb4sapMNuOB7bx+C4LTsN/bc3ru+2G2IcoH XoPe9AtVreDZYCXRNRZ+Fx1FLf37p8YD7CmPZw6TKWDJrJ3pIo61owPa7Q5uqiCTmI6e/L itoGd0nNT5rgnulo3MmAyuiAKc5mPsu2PmQXOX5c9plZ2axqPZcdaqxMnExpUT5JYMAVjI rW1OYNKPkGkyyzD8/8spuXCHqV3TnzI0JmBKFnAj/+0vYyExu7dB0xVcei5ljufa/rZ5nt 3Qh6nHM4zKjsEdNp+iRyTNOciby+J39Tdiuv6AREaah8XWy9e90v91pUaZMnRA== From: Sander Vanheule To: openwrt-devel@lists.openwrt.org Subject: [RFC PATCH v2 4/6] ath79: support for TP-Link EAP245 v1 Date: Sun, 19 Jul 2020 23:24:06 +0200 Message-Id: <4ff630187f6fc154e24b88aae4b0ec501ea12e95.1595193767.git.sander@svanheule.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200719_172446_409474_7CCCBBEC X-CRM114-Status: GOOD ( 18.91 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [84.16.241.116 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sander Vanheule Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org TP-Link EAP245 v1 is an AC1750 (802.11ac Wave-1) ceiling mount access point. Device specifications: * SoC: QCA9563 @ 775MHz * RAM: 128MiB DDR2 * Flash: 16MiB SPI-NOR * Wireless 2.4GHz (SoC): b/g/n, 3x3 * Wireless 5Ghz (QCA9880): a/n/ac, 3x3 * Ethernet (AR8033): 1× 1GbE, 803.2at PoE Flashing instructions: * Extract /usr/bin/uclited from the device via ssh and apply the binary patch listed below. The patch is required to prevent `uclited -u` in the last step from crashing. * Exploit the user management page in the web interface to start telnetd by changing the username to `;/usr/sbin/telnetd -l/bin/sh&`. * Immediately change the malformed username back to something valid (e.g. 'admin') to make ssh work again. * Use the root shell via telnet to make /tmp world writeable (chmod 777) * Copy the patched uclited programme back to the device at /tmp/uclited (via ssh) * Upload the factory image to /tmp/upgrade.bin (via ssh) * Run `chmod +x /tmp/uclited && /tmp/uclited -u` to flash OpenWrt. --- xxd uclited +++ xxd uclited-patched @@ -53796,7 +53796,7 @@ 000d2240: 8c44 0000 0320 f809 0000 0000 8fbc 0010 .D... .......... 000d2250: 8fa6 0a4c 02c0 2821 8f82 87b8 0000 0000 ...L..(!........ -000d2260: 8c44 0000 0c13 45e0 27a7 0018 8fbc 0010 .D....E.'....... +000d2260: 8c44 0000 2402 0000 0000 0000 8fbc 0010 .D..$........... 000d2270: 1040 001d 0000 1821 8f99 8374 3c04 0058 .@.....!...t<..X 000d2280: 3c05 0056 2484 a898 24a5 9a30 0320 f809 <..V$...$..0. .. Debricking: * Serial port can be soldered on PCB J3 (1: TXD, 2: RXD, 3: GND, 4: VCC) * Bridge unpopulated resistors R225 (TXD) and R237 (RXD). Do NOT bridge R230. * Use 3.3V, 115200 baud, 8n1 * Interrupt bootloader by holding CTRL+B during boot * tftp initramfs to flash via the LuCI web interface Tested on the EAP245 v1 running the latest firmware (v1.4.0). The binary patch might not apply to uclited from other firmware versions. Signed-off-by: Sander Vanheule --- .../ath79/dts/qca9563_tplink_eap245-v1.dts | 36 +++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 1 + target/linux/ath79/image/generic-tp-link.mk | 9 +++++ tools/firmware-utils/src/tplink-safeloader.c | 28 +++++++++++++++ 5 files changed, 75 insertions(+) create mode 100644 target/linux/ath79/dts/qca9563_tplink_eap245-v1.dts diff --git a/target/linux/ath79/dts/qca9563_tplink_eap245-v1.dts b/target/linux/ath79/dts/qca9563_tplink_eap245-v1.dts new file mode 100644 index 0000000000..99c66db2b9 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_tplink_eap245-v1.dts @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9563_tplink_eap2x5_1port.dtsi" + +/ { + compatible = "tplink,eap245-v1", "qca,qca9563"; + model = "TP-Link EAP245 v1"; + + aliases { + led-boot = &led_status_green; + led-failsafe = &led_status_amber; + led-running = &led_status_green; + led-upgrade = &led_status_amber; + }; + + leds { + compatible = "gpio-leds"; + + led_status_green: status_green { + label = "tp-link:green:status"; + gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + led_status_amber: status_amber { + label = "tp-link:amber:status"; + gpios = <&gpio 9 GPIO_ACTIVE_HIGH>; + }; + + led_status_red: status_red { + label = "tp-link:red:status"; + gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; + }; + }; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 7524806d72..d19f885e27 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -38,6 +38,7 @@ ath79_setup_interfaces() pisen,wmb001n|\ pisen,wmm003n|\ siemens,ws-ap3610|\ + tplink,eap245-v1|\ tplink,cpe210-v2|\ tplink,cpe210-v3|\ tplink,cpe510-v2|\ diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 2926796d65..7f29c4c157 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -123,6 +123,7 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) -2) ;; + tplink,eap245-v1|\ tplink,re450-v2|\ tplink,re450-v3) caldata_extract "art" 0x5000 0x844 diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk index d2cc8d09bd..a4a14ed889 100644 --- a/target/linux/ath79/image/generic-tp-link.mk +++ b/target/linux/ath79/image/generic-tp-link.mk @@ -372,6 +372,15 @@ define Device/tplink_eap2x5_1port IMAGE/factory.bin := append-rootfs | tplink-safeloader factory | pad-extra 128 endef +define Device/tplink_eap245-v1 + $(Device/tplink_eap2x5_1port) + DEVICE_MODEL := EAP245 + DEVICE_VARIANT := v1 + TPLINK_BOARD_ID := EAP245-V1 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct +endef +TARGET_DEVICES += tplink_eap245-v1 + define Device/tplink_eap245-v3 $(Device/tplink-safeloader) SOC := qca9563 diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c index e9e6f01ebd..a20304150b 100644 --- a/tools/firmware-utils/src/tplink-safeloader.c +++ b/tools/firmware-utils/src/tplink-safeloader.c @@ -1291,6 +1291,34 @@ static struct device_info boards[] = { .last_sysupgrade_partition = "file-system" }, + /** Firmware layout for the EAP245 v1 */ + { + .id = "EAP245-V1", + .support_list = + "SupportList:\r\n" + "EAP245(TP-LINK|UN|AC1750-D):1.0\r\n", + .support_trail = '\xff', + .soft_ver = NULL, + + .partitions = { + {"fs-uboot", 0x00000, 0x20000}, + {"partition-table", 0x20000, 0x02000}, + {"default-mac", 0x30000, 0x01000}, + {"support-list", 0x31000, 0x00100}, + {"product-info", 0x31100, 0x00400}, + {"soft-version", 0x32000, 0x00100}, + {"firmware", 0x40000, 0xc00000}, + {"user-config", 0xdc0000, 0x10000}, + {"backup-config", 0xdd0000, 0x10000}, + {"log", 0xde0000, 0x10000}, + {"radio", 0xff0000, 0x10000}, + {NULL, 0, 0} + }, + + .first_sysupgrade_partition = "os-image", + .last_sysupgrade_partition = "file-system" + }, + /** Firmware layout for the EAP245 v3 */ { .id = "EAP245-V3", From patchwork Sun Jul 19 21:24:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sander Vanheule X-Patchwork-Id: 1331951 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=svanheule.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=nAxbBujZ; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=svanheule.net header.i=@svanheule.net header.a=rsa-sha256 header.s=mail1707 header.b=9Qb960RP; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B8ybZ70H2z9sRN for ; Mon, 20 Jul 2020 07:26:34 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gNFsR4FVexwyhIVhM56DlR1voGw133dpHirqWPwNaUM=; b=nAxbBujZGICTVmrXZzq7FoC5X eL46FujZomGByNwNdre+3pTZItHEGXaAvIQMryA0sEddZFxAlHr2ZAIV1KtZilfN5QxEUjlBabblV Yk3ol8PPSyeLQSImLpzEqK65D++65GLBvnskq9cg5XWBkONQZXelB3ZQ3/Mjr2j39uxHnqxJiGVFk r6kKuFihT/Q3rmR8vLqa5xCz1T9N/7j3C8SW/B+hklxRQYyLRL/vBP8HB4OIfyHporB4Om7UdyFVr //L9fIx14YvnxOKWN8rlpwOYeDZnhDDFL98RoYmh50XZBH9h/im0Xt3/RD0zBcIWvCmlGDQOqOPIQ MaFmY8hVw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxGnn-0000GR-Vi; Sun, 19 Jul 2020 21:24:56 +0000 Received: from polaris.svanheule.net ([2a00:c98:2060:a004:1::200]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxGne-0000CU-T6 for openwrt-devel@lists.openwrt.org; Sun, 19 Jul 2020 21:24:50 +0000 Received: from terra.local.svanheule.net (unknown [IPv6:2a02:a03f:5670:b301:4dd0:c870:d4d:e262]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id 34CA2161370; Sun, 19 Jul 2020 23:24:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1595193885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KDHmIrR0vteAM9z8Hg+SZQyn4jGy4wXIx55hs5nPwvk=; b=9Qb960RPHRy1i08vLBxQ+vKGXcgOJc4FusqON6qeiW7rchQcj0peJ9dgY9Xzsw4/sj5CRp LxdDmxdQDOnU+wWNkWoVrZrRCVeuxIJ1xS0RKy1TNN7qOBwiX607holVpwODs30b8nf5jv SQNeWSexeFwpUSvqZ4BZo9KESUYgX1PbK0mg5gjj6Bxq8KRQY6RsrZMnozhecFaD8V3Eyy zuLZLcrE3N0eREoyo89V8xtVSdym7yJ3VTM3wZmf6N10/4s45aQCEUI0qb8Ts/53UcUFdT mJvd6g1sWW+wI4P/wUwxsTpyapbHhTglFWGJZDM063dqnBm4jIBeM0qHWEMN0w== From: Sander Vanheule To: openwrt-devel@lists.openwrt.org Subject: [RFC PATCH v2 5/6] ath79: support for TP-Link EAP225-Outdoor v1 Date: Sun, 19 Jul 2020 23:24:07 +0200 Message-Id: <24afe59cf8bcca6a55c9276b68418e0ca5b39989.1595193767.git.sander@svanheule.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200719_172447_393002_AE1046A6 X-CRM114-Status: GOOD ( 15.61 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:c98:2060:a004:1:0:0:200 listed in] [list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sander Vanheule Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org TP-Link EAP225-Outdoor v1 is an AC1200 (802.11ac Wave-2) pole or wall mount access point. Device specifications: * SoC: QCA9563 @ 775MHz * Memory: 128MiB DDR2 * Flash: 16MiB SPI-NOR * Wireless 2.4GHz (SoC): b/g/n 2x2 * Wireless 5GHz (QCA9886): a/n/ac 2x2 MU-MIMO * Ethernet (AR8033): 1× 1GbE, PoE Flashing instructions: * ssh into target device with recent (>= v1.6.0) firmware * run `cliclientd stopcs` on target device * upload factory image via web interface MAC addresses: MAC address (as on device label) is stored in device info partition at an offset of 8 bytes. ath9k device has same address as ethernet, ath10k uses address incremented by 1. From stock ifconfig: ath0 Link encap:Ethernet HWaddr D8:...:2E ath10 Link encap:Ethernet HWaddr D8:...:2F br0 Link encap:Ethernet HWaddr D8:...:2E eth0 Link encap:Ethernet HWaddr D8:...:2E Tested by forum user PolynomialDivision on firmware v1.7.0. Signed-off-by: Sander Vanheule --- .../dts/qca9563_tplink_eap225-outdoor-v1.dts | 31 +++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 6 ++++ target/linux/ath79/image/generic-tp-link.mk | 9 ++++++ tools/firmware-utils/src/tplink-safeloader.c | 29 +++++++++++++++++ 5 files changed, 76 insertions(+) create mode 100644 target/linux/ath79/dts/qca9563_tplink_eap225-outdoor-v1.dts diff --git a/target/linux/ath79/dts/qca9563_tplink_eap225-outdoor-v1.dts b/target/linux/ath79/dts/qca9563_tplink_eap225-outdoor-v1.dts new file mode 100644 index 0000000000..0fa31dc53b --- /dev/null +++ b/target/linux/ath79/dts/qca9563_tplink_eap225-outdoor-v1.dts @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9563_tplink_eap2x5_1port.dtsi" + +/ { + compatible = "tplink,eap225-outdoor-v1", "qca,qca9563"; + model = "TP-Link EAP225-Outdoor v1"; + + aliases { + led-boot = &led_status_green; + led-failsafe = &led_status_amber; + led-running = &led_status_green; + led-upgrade = &led_status_amber; + }; + + leds { + compatible = "gpio-leds"; + + led_status_green: status_green { + label = "tp-link:green:status"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + led_status_amber: status_amber { + label = "tp-link:amber:status"; + gpios = <&gpio 9 GPIO_ACTIVE_LOW>; + }; + }; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index d19f885e27..b498282116 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -38,6 +38,7 @@ ath79_setup_interfaces() pisen,wmb001n|\ pisen,wmm003n|\ siemens,ws-ap3610|\ + tplink,eap225-outdoor-v1|\ tplink,eap245-v1|\ tplink,cpe210-v2|\ tplink,cpe210-v3|\ diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 7f29c4c157..22e358a16e 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -194,6 +194,12 @@ case "$FIRMWARE" in ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ /lib/firmware/ath10k/QCA9888/hw2.0/board.bin ;; + tplink,eap225-outdoor-v1) + caldata_extract "art" 0x5000 0x2f20 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +1) + ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ + /lib/firmware/ath10k/QCA9888/hw2.0/board.bin + ;; tplink,eap245-v3) caldata_extract "art" 0x5000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +1) diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk index a4a14ed889..55b5ddfbdf 100644 --- a/target/linux/ath79/image/generic-tp-link.mk +++ b/target/linux/ath79/image/generic-tp-link.mk @@ -372,6 +372,15 @@ define Device/tplink_eap2x5_1port IMAGE/factory.bin := append-rootfs | tplink-safeloader factory | pad-extra 128 endef +define Device/tplink_eap225-outdoor-v1 + $(Device/tplink_eap2x5_1port) + DEVICE_MODEL := EAP225-Outdoor + DEVICE_VARIANT := v1 + TPLINK_BOARD_ID := EAP225-OUTDOOR-V1 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct +endef +TARGET_DEVICES += tplink_eap225-outdoor-v1 + define Device/tplink_eap245-v1 $(Device/tplink_eap2x5_1port) DEVICE_MODEL := EAP245 diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c index a20304150b..6aa9674b30 100644 --- a/tools/firmware-utils/src/tplink-safeloader.c +++ b/tools/firmware-utils/src/tplink-safeloader.c @@ -1291,6 +1291,35 @@ static struct device_info boards[] = { .last_sysupgrade_partition = "file-system" }, + /** Firmware layout for the EAP225-Outdoor v1 */ + { + .id = "EAP225-OUTDOOR-V1", + .support_list = + "SupportList:\r\n" + "EAP225-Outdoor(TP-Link|UN|AC1200-D):1.0\r\n", + .support_trail = '\xff', + .soft_ver = NULL, + .soft_ver_compat_level = 1, + + .partitions = { + {"fs-uboot", 0x00000, 0x20000}, + {"partition-table", 0x20000, 0x02000}, + {"default-mac", 0x30000, 0x01000}, + {"support-list", 0x31000, 0x00100}, + {"product-info", 0x31100, 0x00400}, + {"soft-version", 0x32000, 0x00100}, + {"firmware", 0x40000, 0xd80000}, + {"user-config", 0xdc0000, 0x10000}, + {"mutil-log", 0xf30000, 0x80000}, + {"oops", 0xfb0000, 0x40000}, + {"radio", 0xff0000, 0x10000}, + {NULL, 0, 0} + }, + + .first_sysupgrade_partition = "os-image", + .last_sysupgrade_partition = "file-system" + }, + /** Firmware layout for the EAP245 v1 */ { .id = "EAP245-V1", From patchwork Sun Jul 19 21:24:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sander Vanheule X-Patchwork-Id: 1331952 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=svanheule.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=YKrFd6IS; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=svanheule.net header.i=@svanheule.net header.a=rsa-sha256 header.s=mail1707 header.b=Wf5hxvdE; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B8ybZ72T5z9sRf for ; Mon, 20 Jul 2020 07:26:34 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TI/X7pYlhARQqiHYiL4UzyMbSl/M5GUebBgrzeA7yxc=; b=YKrFd6ISCcDbxj7h+Z8Aha4tE bs+OnBemxr6YZF/BygE7FMXC0LqtitvnrKeXk+fr2nRUZRdmSu8kNuuhwR5u+cYAusVcv0Ox60lms v2IyU+S3I6g3PqgCdhQ2kMoi4J0lOyZOVxxiNJysAw/pZIsIvc1UYyXVJVV4c21Tj9hHRDG4z8fJA J5bw2hFh5iPXXe+GxRjWJP+KJlAB3NOREXQpoQxQJypWEEEVUotG1VbMGl7HeXjHCMEpN6lflWukR qJSIVPp2DD6Nz/Opdb/Ba5b/JZYQK8CMrWWW5FL9LD6o1sLRUy0broFh+QK7SBuJnMExqhZuNJ1B+ kBTFUvFtA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxGnm-0000Fv-LZ; Sun, 19 Jul 2020 21:24:54 +0000 Received: from polaris.svanheule.net ([2a00:c98:2060:a004:1::200]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxGne-0000CZ-T9 for openwrt-devel@lists.openwrt.org; Sun, 19 Jul 2020 21:24:49 +0000 Received: from terra.local.svanheule.net (unknown [IPv6:2a02:a03f:5670:b301:4dd0:c870:d4d:e262]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id 737A2161371; Sun, 19 Jul 2020 23:24:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1595193885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gcx/3WC1yOSGkdlNPVeSlxhRZ8o/48OM0cQ238JaRlk=; b=Wf5hxvdEsVXdRtyY0hc4xlYIwNJWebgdffGAps+8kkVJPNovInEMPQEetGvmznmPaXZfjK utaqFjeoFrL/9OMn1jTb+07aZKpKD9P38FLE2M15YCuzRg2NeixUpshKaEX1PmanQsQZ+F ZW2p4xcUeEMjhmHpVse0t+KX5DeyQjQWHMJjcqmWIzNJi2AEI3tydg9i29FZDsCvhN8wgs /1HJtZiWWG7EySpQERddUEzVp49dXz5W4veXH9rlkIglz8QrRz9kqC7BtXVXSTZ64r5x45 8rG6Ep1nyk5MQbpPPrWGW3C7r911mUWB1Pzy0wk9HwujfTZR14EGNxV1r72e3A== From: Sander Vanheule To: openwrt-devel@lists.openwrt.org Subject: [RFC PATCH v2 6/6] ath79: support for TP-Link EAP225 v3 Date: Sun, 19 Jul 2020 23:24:08 +0200 Message-Id: X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200719_172447_395653_8A890FFF X-CRM114-Status: GOOD ( 15.23 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:c98:2060:a004:1:0:0:200 listed in] [list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sander Vanheule Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org TP-Link EAP225 v3 is an AC1350 (802.11ac Wave-2) ceiling mount access point. Device specifications: * SoC: QCA9563 @ 775MHz * RAM: 128MiB DDR2 * Flash: 16MiB SPI-NOR * Wireless 2.4GHz (SoC): b/g/n, 3x3 * Wireless 5Ghz (QCA9886): a/n/ac, 2x2 MU-MINO * Ethernet (AR8033): 1× 1GbE, 803.2at PoE Flashing instructions: * ssh into target device and run `cliclientd stopcs` * Upgrade with factory image via web interface Debricking: * Serial port can be soldered on PCB J3 (1: TXD, 2: RXD, 3: GND, 4: VCC) * Bridge unpopulated resistors R225 (TXD) and R237 (RXD). Do NOT bridge R230. * Use 3.3V, 115200 baud, 8n1 * Interrupt bootloader by holding CTRL+B during boot * tftp initramfs to flash via LuCI web interface MAC addresses: MAC address (as on device label) is stored in device info partition at an offset of 8 bytes. ath9k device has same address as ethernet, ath10k uses address incremented by 1. From OEM boot log: Using interface ath0 with hwaddr b0:...:3e and ssid "..." Using interface ath10 with hwaddr b0:...:3f and ssid "..." Tested by forum user blinkstar88 Signed-off-by: Sander Vanheule --- .../ath79/dts/qca9563_tplink_eap225-v3.dts | 31 +++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 1 + target/linux/ath79/image/generic-tp-link.mk | 9 ++++++ tools/firmware-utils/src/tplink-safeloader.c | 28 +++++++++++++++++ 5 files changed, 70 insertions(+) create mode 100644 target/linux/ath79/dts/qca9563_tplink_eap225-v3.dts diff --git a/target/linux/ath79/dts/qca9563_tplink_eap225-v3.dts b/target/linux/ath79/dts/qca9563_tplink_eap225-v3.dts new file mode 100644 index 0000000000..37c8a3d849 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_tplink_eap225-v3.dts @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9563_tplink_eap2x5_1port.dtsi" + +/ { + compatible = "tplink,eap225-v3", "qca,qca9563"; + model = "TP-Link EAP225 v3"; + + aliases { + led-boot = &led_status_green; + led-failsafe = &led_status_amber; + led-running = &led_status_green; + led-upgrade = &led_status_amber; + }; + + leds { + compatible = "gpio-leds"; + + led_status_green: status_green { + label = "tp-link:green:status"; + gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + led_status_amber: status_amber { + label = "tp-link:amber:status"; + gpios = <&gpio 9 GPIO_ACTIVE_HIGH>; + }; + }; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index b498282116..f9e3af757c 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -38,6 +38,7 @@ ath79_setup_interfaces() pisen,wmb001n|\ pisen,wmm003n|\ siemens,ws-ap3610|\ + tplink,eap225-v3|\ tplink,eap225-outdoor-v1|\ tplink,eap245-v1|\ tplink,cpe210-v2|\ diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 22e358a16e..dd2b241ac4 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -194,6 +194,7 @@ case "$FIRMWARE" in ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ /lib/firmware/ath10k/QCA9888/hw2.0/board.bin ;; + tplink,eap225-v3|\ tplink,eap225-outdoor-v1) caldata_extract "art" 0x5000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +1) diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk index 55b5ddfbdf..120bba6a15 100644 --- a/target/linux/ath79/image/generic-tp-link.mk +++ b/target/linux/ath79/image/generic-tp-link.mk @@ -372,6 +372,15 @@ define Device/tplink_eap2x5_1port IMAGE/factory.bin := append-rootfs | tplink-safeloader factory | pad-extra 128 endef +define Device/tplink_eap225-v3 + $(Device/tplink_eap2x5_1port) + DEVICE_MODEL := EAP225 + DEVICE_VARIANT := v3 + TPLINK_BOARD_ID := EAP225-V3 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct +endef +TARGET_DEVICES += tplink_eap225-v3 + define Device/tplink_eap225-outdoor-v1 $(Device/tplink_eap2x5_1port) DEVICE_MODEL := EAP225-Outdoor diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c index 6aa9674b30..b70bb7e625 100644 --- a/tools/firmware-utils/src/tplink-safeloader.c +++ b/tools/firmware-utils/src/tplink-safeloader.c @@ -1291,6 +1291,34 @@ static struct device_info boards[] = { .last_sysupgrade_partition = "file-system" }, + /** Firmware layout for the EAP225 v3 */ + { + .id = "EAP225-V3", + .support_list = + "SupportList:\r\n" + "EAP225(TP-Link|UN|AC1350-D):3.0\r\n", + .soft_ver = NULL, + .soft_ver_compat_level = 1, + + .partitions = { + {"fs-uboot", 0x00000, 0x20000}, + {"partition-table", 0x20000, 0x02000}, + {"default-mac", 0x30000, 0x01000}, + {"support-list", 0x31000, 0x00100}, + {"product-info", 0x31100, 0x00400}, + {"soft-version", 0x32000, 0x00100}, + {"firmware", 0x40000, 0xd80000}, + {"user-config", 0xdc0000, 0x30000}, + {"mutil-log", 0xf30000, 0x80000}, + {"oops", 0xfb0000, 0x40000}, + {"radio", 0xff0000, 0x10000}, + {NULL, 0, 0} + }, + + .first_sysupgrade_partition = "os-image", + .last_sysupgrade_partition = "file-system" + }, + /** Firmware layout for the EAP225-Outdoor v1 */ { .id = "EAP225-OUTDOOR-V1",