From patchwork Mon Dec 10 22:46:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 1010757 X-Patchwork-Delegate: openwrt@kresin.me Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=true.cz Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="O5nrEBYP"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::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 43DJ9K6nxTz9s0t for ; Tue, 11 Dec 2018 09:47:01 +1100 (AEDT) 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pdm8iHh/hLHeo1mAxTrrCW2mM6U+jE5jxvZqHM4WnoY=; b=O5nrEBYPmaj9Ph UWgjkCgb29JCjitnAg56za6sDlhI9EAjUO2XZOwZLtmaQFLtJ2v19GHpjYUtj51g9IFXRrtWW+6UH m3qruMqVud1B/B83yHuhQquoKNxxLGMV6Y6HoMX8mrvLfT6RezOh9ngM933znKLpehJ+gT2F4s6Lk w32ehAkPzzzCR3/ztPt4N98EsRerPB3Q6MLJbcOXKjHY2aDc8ev6PChWqdKqQNMgHzC83D6QGv2E8 8snodjwyB+VvTqfkISmPy9UHwO8Ec5Va3VpC6aXCSU0gvHhSglbWl04I86po2wKznUzFibRamOWSZ iyFW2/gKze1CEU69NJEg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWUKI-000831-JY; Mon, 10 Dec 2018 22:46:58 +0000 Received: from smtp-out.xnet.cz ([178.217.244.18]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWUK6-0007ro-F3 for openwrt-devel@lists.openwrt.org; Mon, 10 Dec 2018 22:46:48 +0000 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id 3D6BA4B5A; Mon, 10 Dec 2018 23:46:38 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by meh.true.cz (OpenSMTPD) with ESMTP id 733f7ef0; Mon, 10 Dec 2018 23:46:36 +0100 (CET) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Date: Mon, 10 Dec 2018 23:46:24 +0100 Message-Id: <1544481988-30032-2-git-send-email-ynezz@true.cz> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1544481988-30032-1-git-send-email-ynezz@true.cz> References: <1544481988-30032-1-git-send-email-ynezz@true.cz> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181210_144646_662244_7A80AED5 X-CRM114-Status: UNSURE ( 9.55 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [178.217.244.18 listed in list.dnswl.org] Subject: [OpenWrt-Devel] [PATCH 1/5] ath79: ubnt-xw: Add LED aliases for diag and status LED support X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Petr_=C5=A0tetiar?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Currently there is no LED signalization for various system states implemented in diag.sh, so this patch adds support for it. Tested-by: Joe Ayers Signed-off-by: Petr Štetiar --- target/linux/ath79/dts/ar9342_ubnt_xw.dtsi | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi b/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi index b104bc6..742df11 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi +++ b/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi @@ -9,15 +9,22 @@ compatible = "ubnt,xw", "qca,ar9342"; model = "Ubiquiti Networks XW board"; + aliases { + led-boot = &boot; + led-failsafe = &failsafe; + led-running = &boot; + led-upgrade = &upgrade; + }; + gpio-leds { compatible = "gpio-leds"; - link1 { + upgrade: link1 { label = "ubnt:red:link1"; gpios = <&gpio 11 GPIO_ACTIVE_LOW>; }; - link2 { + failsafe: link2 { label = "ubnt:orange:link2"; gpios = <&gpio 16 GPIO_ACTIVE_LOW>; }; @@ -27,7 +34,7 @@ gpios = <&gpio 13 GPIO_ACTIVE_LOW>; }; - link4 { + boot: link4 { label = "ubnt:green:link4"; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; }; From patchwork Mon Dec 10 22:46:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 1010759 X-Patchwork-Delegate: openwrt@kresin.me Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=true.cz Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="eehNvn3N"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::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 43DJ9r0TfZz9s0t for ; Tue, 11 Dec 2018 09:47:28 +1100 (AEDT) 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Xtz4sSSqx8a/k4XHfOmrCq5Svg3d7DcdUm0kehLPh5M=; b=eehNvn3NJXEi8b wRhrGdiOuGZB0pVPK12XJCY5sh7g2JbmdQPkaQuadHf8FUTrht0X7DgVucLaUK2qLD+3Ko6vZM+rM sb7fP/XLVd9lBLmUWWaKeWi8EEV2mDXoAF8fJkwPPzIdO9fUVd0WL0fE2n+7C8IsZVw4ousDvBpsj vvxn8JCz3a5ApnaGT4Z+3pO9vRTxArxZNczQzH/n/oprnP2QPRGvcdJSQEYoWeUB6oydrzPMqV6HF +HLiu7Pipp198lcImQyGTiouL8GV9WNSHVVM71+OGToja3lPgHQOmhg3bQwafsjq4wZuliFNVeRWV uZAVB24OxPV+xjwoEsmw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWUKi-00006w-RZ; Mon, 10 Dec 2018 22:47:24 +0000 Received: from smtp-out.xnet.cz ([178.217.244.18]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWUK6-0007rp-F2 for openwrt-devel@lists.openwrt.org; Mon, 10 Dec 2018 22:46:49 +0000 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id 66CD84B5B; Mon, 10 Dec 2018 23:46:39 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by meh.true.cz (OpenSMTPD) with ESMTP id 20b65856; Mon, 10 Dec 2018 23:46:38 +0100 (CET) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Date: Mon, 10 Dec 2018 23:46:25 +0100 Message-Id: <1544481988-30032-3-git-send-email-ynezz@true.cz> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1544481988-30032-1-git-send-email-ynezz@true.cz> References: <1544481988-30032-1-git-send-email-ynezz@true.cz> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181210_144646_666152_719335E5 X-CRM114-Status: UNSURE ( 9.88 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [178.217.244.18 listed in list.dnswl.org] Subject: [OpenWrt-Devel] [PATCH 2/5] ath79: ubnt-bullet-m-xw: Move common DTS bits into XW include file X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Petr_=C5=A0tetiar?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Most of the M/XW platform settings can be shared so move those common DTS bits into include file. Tested-by: Joe Ayers Signed-off-by: Petr Štetiar --- target/linux/ath79/dts/ar9342_ubnt_bullet-m-xw.dts | 11 +++-------- target/linux/ath79/dts/ar9342_ubnt_xw.dtsi | 8 ++++++++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/target/linux/ath79/dts/ar9342_ubnt_bullet-m-xw.dts b/target/linux/ath79/dts/ar9342_ubnt_bullet-m-xw.dts index ad98075..7e4862e 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_bullet-m-xw.dts +++ b/target/linux/ath79/dts/ar9342_ubnt_bullet-m-xw.dts @@ -15,20 +15,19 @@ status = "okay"; phy-mask = <4>; + phy4: ethernet-phy@4 { - phy-mode = "rgmii"; reg = <4>; + phy-mode = "rgmii"; }; }; ð0 { status = "okay"; - pll-data = <0x06000000 0x00000101 0x00001313>; - mtd-mac-address = <&eeprom 0x0>; - phy-mode = "rgmii"; phy-handle = <&phy4>; + mtd-mac-address = <&eeprom 0x0>; gmac-config { device = <&gmac>; @@ -36,7 +35,3 @@ rxdv-delay = <3>; }; }; - -ð1 { - status = "disabled"; -}; diff --git a/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi b/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi index 742df11..812810f 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi +++ b/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi @@ -117,3 +117,11 @@ mtd-cal-data = <&eeprom 0x1000>; mtd-mac-address = <&eeprom 0x1002>; }; + +&mdio1 { + status = "disabled"; +}; + +ð1 { + status = "disabled"; +}; From patchwork Mon Dec 10 22:46:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 1010758 X-Patchwork-Delegate: openwrt@kresin.me Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=true.cz Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WFZBxnqB"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::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 43DJ9d0nxPz9s3q for ; Tue, 11 Dec 2018 09:47:17 +1100 (AEDT) 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HDEcvGsAa5yy9nUR4QMT02nAaSgT4tdPVrr6xmOm0yY=; b=WFZBxnqBN2rZXN kIJcPi2hKNdg3zufw+AYTh1icBtviNDhwg6ymKuNDrk5tep6ptaatN392dTpdIDIX1m4BOXbj8WS+ MgOJRquoTYJPpH8p9WZkdi5IjEflifuimW+lw9AHJho2mXX5MjERifIiO2FvLc8UeDIs7Qc+8THa4 JN+phjgS7EnOTUZndiC1EcuJaqXG2SoOeLug6t9iNdw6iX4yb6GIktHZ2ThNVsgpcuBnZ2RfaUIJy ozZMXkGEp88EaKrhWoMzYMJNzBIsjAvTs3ccjUNAqNKhYmc734DVAgltZIBdy6ABfF+WnM4y9uYyK gUDJfQdTM9neY/GHyXxA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWUKW-0008J5-5O; Mon, 10 Dec 2018 22:47:12 +0000 Received: from smtp-out.xnet.cz ([178.217.244.18]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWUK6-0007rt-F7 for openwrt-devel@lists.openwrt.org; Mon, 10 Dec 2018 22:46:49 +0000 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id 97AC14B5C; Mon, 10 Dec 2018 23:46:41 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by meh.true.cz (OpenSMTPD) with ESMTP id 7f187db5; Mon, 10 Dec 2018 23:46:40 +0100 (CET) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Date: Mon, 10 Dec 2018 23:46:26 +0100 Message-Id: <1544481988-30032-4-git-send-email-ynezz@true.cz> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1544481988-30032-1-git-send-email-ynezz@true.cz> References: <1544481988-30032-1-git-send-email-ynezz@true.cz> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181210_144646_680259_F8D3AA19 X-CRM114-Status: UNSURE ( 9.03 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [178.217.244.18 listed in list.dnswl.org] Subject: [OpenWrt-Devel] [PATCH 3/5] ath79: gmac: ar934x: Add parser for mii-gmac0-slave X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Petr_=C5=A0tetiar?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org In ar71xx/mach-ubnt-xm.c there's following code: static void __init ubnt_xw_init(void) { ... ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_MII_GMAC0 | AR934X_ETH_CFG_MII_GMAC0_SLAVE); ... } But I couldn't find a way how to set it up via DTS. Tested-by: Joe Ayers Signed-off-by: Petr Štetiar --- .../linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_gmac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_gmac.c b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_gmac.c index e69abb6..cc0a15d 100644 --- a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_gmac.c +++ b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_gmac.c @@ -53,6 +53,7 @@ static void ag71xx_setup_gmac_934x(struct device_node *np, void __iomem *base) ag71xx_of_bit(np, "rgmii-gmac0", &val, AR934X_ETH_CFG_RGMII_GMAC0); ag71xx_of_bit(np, "mii-gmac0", &val, AR934X_ETH_CFG_MII_GMAC0); + ag71xx_of_bit(np, "mii-gmac0-slave", &val, AR934X_ETH_CFG_MII_GMAC0_SLAVE); ag71xx_of_bit(np, "gmii-gmac0", &val, AR934X_ETH_CFG_GMII_GMAC0); ag71xx_of_bit(np, "switch-phy-swap", &val, AR934X_ETH_CFG_SW_PHY_SWAP); ag71xx_of_bit(np, "switch-only-mode", &val, From patchwork Mon Dec 10 22:46:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 1010760 X-Patchwork-Delegate: openwrt@kresin.me Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=true.cz Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Fvg0LtbD"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::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 43DJB55txYz9s0t for ; Tue, 11 Dec 2018 09:47:41 +1100 (AEDT) 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lN1wqmjgStgfMa4ZKDLH1minDecTMb25NkGRfyQqQb0=; b=Fvg0LtbDABEbq7 dDyoVZgV8zagGgIpLe2bg6cLa08WCR78nQD5AJSzMoiOlFiumH2DX4YOCbZgVP5Tt+eH1KycD7xLx nmKeW5rkOWsLVX6R4cDCCH9y5T+GRuktPy08koJ1i4JcWCLMJ4Lf+TqPfx4HLHfX/XJn2QEegoac9 6Pe3ToJmRH/lUvTC/NaRTGS7F4yROQoZ2AKRIDKsAWWSLZtrE8NGdTkqtqKvInpx7gGfzjQOx+CYC tU2/COmdCluvXSPvbF5M9QVO4VxobD6gBQkK8L94yCQbw9MnOX+HqqAGBCAqcxdCh7lfnU3rVCSPc X2qX5l4BZ6N6BNzstFZA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWUKu-0000LJ-6I; Mon, 10 Dec 2018 22:47:36 +0000 Received: from smtp-out.xnet.cz ([178.217.244.18]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWUK6-0007ru-F6 for openwrt-devel@lists.openwrt.org; Mon, 10 Dec 2018 22:46:49 +0000 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id C50614B60; Mon, 10 Dec 2018 23:46:43 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by meh.true.cz (OpenSMTPD) with ESMTP id e4fa7223; Mon, 10 Dec 2018 23:46:42 +0100 (CET) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Date: Mon, 10 Dec 2018 23:46:27 +0100 Message-Id: <1544481988-30032-5-git-send-email-ynezz@true.cz> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1544481988-30032-1-git-send-email-ynezz@true.cz> References: <1544481988-30032-1-git-send-email-ynezz@true.cz> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181210_144646_678508_DC762E6B X-CRM114-Status: GOOD ( 12.50 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [178.217.244.18 listed in list.dnswl.org] Subject: [OpenWrt-Devel] [PATCH 4/5] ath79: ag71xx: Ensure that appending of CRC to frames is always disabled X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Petr_=C5=A0tetiar?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org There seems to be some strange behaviour between snapshot ar71xx and ath79 kernels on Nanostation M5 XW where each kernel has different init values in ag71xx_probe: ar71xx: (running r8651-452b840) ( boot ) eth%d: mac_cfg1=00000000, mac_cfg2=00007000, ipg=40605060, hdx=00a1f037, mfl=00000600 ( ag71xx_hw_setup ) eth%d: mac_cfg1=0000000f, mac_cfg2=00007014, ipg=40605060, hdx=00a1f037, mfl=00000000 ath79: (running r8651-452b840) ( boot ) eth%d: mac_cfg1=0000000f, mac_cfg2=00007117, ipg=40605060, hdx=00a1f037, mfl=00000600 ( ag71xx_hw_setup ) eth%d: mac_cfg1=0000000f, mac_cfg2=00007117, ipg=40605060, hdx=00a1f037, mfl=00000000 Note the boot/init values of AG71XX_REG_MAC_CFG2 on ar71xx and ath79. On ar71xx we've the cfg2=0x7000 after the boot, which corresponds to the state in the datasheet, but on ath79 it's set to 0x7117 which unfortunately enables CRC in the frames, making the networking disfuctional on Nanostation M5 XW. This is happening on the same hardware, same U-Boot, network setup etc. the only difference in the mix are the kernels. So the fix seems to be always clearing the MAC_CFG2_CRC_EN bit in AG71XX_REG_MAC_CFG2 upon boot. I don't want to fix it by writing init/reset value of 0x7000 to AG71XX_REG_MAC_CFG2 as it's being done with AG71XX_REG_MAC_CFG1 register, since I only have datasheet for ar9344 so I don't know what this forced 0x7000 initial value might cause on other ar934x SoCs. Tested-by: Joe Ayers Signed-off-by: Petr Štetiar --- .../ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 70ca024..0ca0d18 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 @@ -425,14 +425,18 @@ static void ag71xx_hw_setup(struct ag71xx *ag) { struct device_node *np = ag->pdev->dev.of_node; u32 init = MAC_CFG1_INIT; + u32 cfg2; /* setup MAC configuration registers */ if (of_property_read_bool(np, "flow-control")) init |= MAC_CFG1_TFC | MAC_CFG1_RFC; ag71xx_wr(ag, AG71XX_REG_MAC_CFG1, init); - ag71xx_sb(ag, AG71XX_REG_MAC_CFG2, - MAC_CFG2_PAD_CRC_EN | MAC_CFG2_LEN_CHECK); + /* ensure that CRC is disabled and not appended to frames */ + cfg2 = ag71xx_rr(ag, AG71XX_REG_MAC_CFG2); + cfg2 &= ~(MAC_CFG2_CRC_EN); + cfg2 |= MAC_CFG2_PAD_CRC_EN | MAC_CFG2_LEN_CHECK; + ag71xx_wr(ag, AG71XX_REG_MAC_CFG2, cfg2); /* setup max frame length to zero */ ag71xx_wr(ag, AG71XX_REG_MAC_MFL, 0); From patchwork Mon Dec 10 22:46:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 1010762 X-Patchwork-Delegate: openwrt@kresin.me Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=true.cz Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OSw2BmFb"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::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 43DJBM5hffz9s0t for ; Tue, 11 Dec 2018 09:47:55 +1100 (AEDT) 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FgwBQXbWKyT/9HFQ83HUs2ID3GSHUX7QdViy0DT8NkI=; b=OSw2BmFbaFMw4o TBm8E2MNyJZX6uT7kaSlH6dQyKNvBBhdVBI70+q0/KGBXfhl2gDuIV2oP4rAgtoQa1/ejZWIDAMbL n8FryAVzDHQAKeq8ignwKM4cxmQBvVBYrSBwIR7QbsTEJ6UODfbe1D8+5B4lj9vTuzKalgUfMZ9e6 ZXiOFjrehxAdYyaVobD/dxl2XI76kgTLJSB1fTDGTSUB5298vdIA5wCz9nZMlXbBl4MBmDmchT54g a/XO7P1dntCzOJ55H25f2OBjx2IkrjCxEnyZUQdpT+8yNkD/ZLzgCDZtYJSfF4wU2MChJ2703iAfD /sQ5XX1DDCLKSbW4/lsA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWUL7-0000aw-3U; Mon, 10 Dec 2018 22:47:49 +0000 Received: from smtp-out.xnet.cz ([178.217.244.18]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWUKJ-0007t0-Gp for openwrt-devel@lists.openwrt.org; Mon, 10 Dec 2018 22:47:03 +0000 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id 13DE14B61; Mon, 10 Dec 2018 23:46:45 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by meh.true.cz (OpenSMTPD) with ESMTP id 5c3bd799; Mon, 10 Dec 2018 23:46:43 +0100 (CET) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Date: Mon, 10 Dec 2018 23:46:28 +0100 Message-Id: <1544481988-30032-6-git-send-email-ynezz@true.cz> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1544481988-30032-1-git-send-email-ynezz@true.cz> References: <1544481988-30032-1-git-send-email-ynezz@true.cz> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181210_144700_603178_2A5E1319 X-CRM114-Status: GOOD ( 13.05 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [178.217.244.18 listed in list.dnswl.org] Subject: [OpenWrt-Devel] [PATCH 5/5] ath79: Add support for Ubiquiti Nanostation M (XW) X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Petr_=C5=A0tetiar?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org CPU: AR9342 SoC RAM: 64 MB DDR2 Flash: 8 MB NOR SPI Ports: 2x100 MBit (24V PoE in, 24V PoE out), AR8236 switch WLAN: 2.4/5 GHz UART: 1 UART LEDs: Power, 2x Ethernet, 4x RSSI LEDs (orange, red, 2x green) Buttons: Reset Flashing instructions using recovery method over TFTP 1. Unplug the ethernet cable from the router. 2. Using paper clip press and hold the router's reset button. Make sure you can feel it depressed by the paper clip. Do not release the button until step 4. 3. While keeping the reset button pressed in, plug the ethernet cable back into the AP. Keep the reset button depressed until you see the device's LEDs flashing in upgrade mode (alternating LED1/LED3 and LED2/LED4), this may take up to 25 seconds. 4. You may release the reset button, now the device should be in TFTP transfer mode. 5. Set a static IP on your Computer's NIC. A static IP of 192.168.1.25/24 should work. 6. Plug the PoE injector's LAN cable directly to your computer. 7. Start tftp client and issue following commands: tftp> binary tftp> connect 192.168.1.20 tftp> put openwrt-ath79-generic-ubnt-nano-m-xw-squashfs-factory.bin Tested-by: Joe Ayers Signed-off-by: Petr Štetiar --- target/linux/ath79/base-files/etc/board.d/01_leds | 1 + .../linux/ath79/base-files/etc/board.d/02_network | 4 +++ target/linux/ath79/dts/ar9342_ubnt_nano-m-xw.dts | 38 ++++++++++++++++++++++ target/linux/ath79/image/generic-ubnt.mk | 7 ++++ 4 files changed, 50 insertions(+) create mode 100644 target/linux/ath79/dts/ar9342_ubnt_nano-m-xw.dts diff --git a/target/linux/ath79/base-files/etc/board.d/01_leds b/target/linux/ath79/base-files/etc/board.d/01_leds index 06fb8f4..0f725c0 100755 --- a/target/linux/ath79/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/base-files/etc/board.d/01_leds @@ -104,6 +104,7 @@ tplink,tl-wr841-v11) ubnt,bullet-m|\ ubnt,bullet-m-xw|\ ubnt,nano-m|\ +ubnt,nano-m-xw|\ ubnt,rocket-m) ucidef_set_rssimon "wlan0" "200000" "1" ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:red:link1" "wlan0" "1" "100" diff --git a/target/linux/ath79/base-files/etc/board.d/02_network b/target/linux/ath79/base-files/etc/board.d/02_network index fa7a618..7e1ec4c 100755 --- a/target/linux/ath79/base-files/etc/board.d/02_network +++ b/target/linux/ath79/base-files/etc/board.d/02_network @@ -188,6 +188,10 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1" ;; + ubnt,nano-m-xw) + ucidef_add_switch "switch0" \ + "0@eth0" "5:lan" "1:wan" + ;; ubnt,nanostation-ac|\ ubnt,unifiac-mesh-pro|\ ubnt,unifiac-pro) diff --git a/target/linux/ath79/dts/ar9342_ubnt_nano-m-xw.dts b/target/linux/ath79/dts/ar9342_ubnt_nano-m-xw.dts new file mode 100644 index 0000000..eb5f0b4 --- /dev/null +++ b/target/linux/ath79/dts/ar9342_ubnt_nano-m-xw.dts @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar9342_ubnt_xw.dtsi" + +/ { + compatible = "ubnt,nano-m-xw", "ubnt,xw"; + model = "Ubiquiti Nanostation M (XW)"; +}; + +&mdio0 { + status = "okay"; + + phy4-mii-enable; + phy-mask = <0x23>; + + phy4: ethernet-phy@4 { + reg = <0>; + phy-mode = "mii"; + }; +}; + +ð0 { + status = "okay"; + + phy-mode = "mii"; + phy-handle = <&phy4>; + mtd-mac-address = <&eeprom 0x0>; + + gmac-config { + device = <&gmac>; + mii-gmac0 = <1>; + mii-gmac0-slave = <1>; + }; +}; diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk index cb65aed..e1ba72c 100644 --- a/target/linux/ath79/image/generic-ubnt.mk +++ b/target/linux/ath79/image/generic-ubnt.mk @@ -113,6 +113,13 @@ define Device/ubnt_nano-m endef TARGET_DEVICES += ubnt_nano-m +define Device/ubnt_nano-m-xw + $(Device/ubnt-xw) + DEVICE_TITLE := Ubiquiti Nanostation M (XW) + SUPPORTED_DEVICES += nano-m-xw nanostation-m-xw +endef +TARGET_DEVICES += ubnt_nano-m-xw + define Device/ubnt_lap-120 $(Device/ubnt-wa) DEVICE_TITLE := Ubiquiti LiteAP ac (LAP-120)