From patchwork Thu Apr 11 15:59:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Bauer X-Patchwork-Id: 1084136 X-Patchwork-Delegate: mail@david-bauer.net 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=david-bauer.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FeB4RVXj"; 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 44g5N55tHLz9s47 for ; Fri, 12 Apr 2019 02:00:37 +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: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:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=GZZYyzk3jSclhlG2iUIo7exUG92aOTxtNJny5N7a8ec=; b=FeB4RVXjLCZJ1JIHZVRTkUdltg G8qBbxEy3qZ/9/FgHm8/MLe4bx+Fcg9hxE6rd9pKYeshRlWArzbflXL4YxH2KsWMn2vMFYmfUfeF/ v+wz+5b8Tirw1bqgo+o+i2rH1Seehi8kaAVy6HW2Cdw3HgW3dTSu0vp91+Rb8cHOoBh2azoKZofj4 Ovn/RJNqKD/Ij0WWTc7Di0jxPVr8rElOWv644yViVkwgWHgKWizPhHUEcke0qImlEUkT5DXN4p6ef u5zeYAlLaI8tiPBbCq/U7G64pLTPcfh80LIUTekB1Bpy5TukyBRVCh9NtUijzgpjdkk5LpKvPJnxh xzxrnEng==; 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 1hEc7n-0003YV-Fq; Thu, 11 Apr 2019 16:00:27 +0000 Received: from mars.blocktrron.ovh ([2001:41d0:401:3000::cbd] helo=mail.blocktrron.ovh) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEc7L-0001iX-60 for openwrt-devel@lists.openwrt.org; Thu, 11 Apr 2019 16:00:02 +0000 Received: from localhost.localdomain (p200300E53F099C0093B6E161A050D22A.dip0.t-ipconnect.de [IPv6:2003:e5:3f09:9c00:93b6:e161:a050:d22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.blocktrron.ovh (Postfix) with ESMTPSA id 423D9221E0 for ; Thu, 11 Apr 2019 17:59:54 +0200 (CEST) From: David Bauer To: openwrt-devel@lists.openwrt.org Date: Thu, 11 Apr 2019 17:59:44 +0200 Message-Id: <20190411155945.28600-3-mail@david-bauer.net> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190411155945.28600-1-mail@david-bauer.net> References: <20190411155945.28600-1-mail@david-bauer.net> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190411_085959_365889_794167AE X-CRM114-Status: GOOD ( 11.11 ) 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 SPF_PASS SPF: sender matches SPF record Subject: [OpenWrt-Devel] [PATCH 3/4] ath79: allow to override AR8033 SGMII aneg status 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: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org In order to make the QCA955x SGMII workaround work, the unsuccessful SGMII autonegotiation on the AR8033 should not block the PHY state-machine. Otherwise, the ag71xx driver never becomes aware of the copper-side link-establishment and the workaround is never executed. Signed-off-by: David Bauer --- .../425-at803x-allow-sgmii-aneg-override.patch | 16 ++++++++++++++++ .../425-at803x-allow-sgmii-aneg-override.patch | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 target/linux/ath79/patches-4.14/425-at803x-allow-sgmii-aneg-override.patch create mode 100644 target/linux/ath79/patches-4.19/425-at803x-allow-sgmii-aneg-override.patch diff --git a/target/linux/ath79/patches-4.14/425-at803x-allow-sgmii-aneg-override.patch b/target/linux/ath79/patches-4.14/425-at803x-allow-sgmii-aneg-override.patch new file mode 100644 index 0000000000..0ac6af38f3 --- /dev/null +++ b/target/linux/ath79/patches-4.14/425-at803x-allow-sgmii-aneg-override.patch @@ -0,0 +1,16 @@ +--- a/drivers/net/phy/at803x.c ++++ b/drivers/net/phy/at803x.c +@@ -484,6 +484,13 @@ static int at803x_aneg_done(struct phy_d + if (!(phy_read(phydev, AT803X_PSSR) & AT803X_PSSR_MR_AN_COMPLETE)) { + pr_warn("803x_aneg_done: SGMII link is not ok\n"); + aneg_done = 0; ++#ifdef CONFIG_OF_MDIO ++ if (phydev->mdio.dev.of_node && ++ of_property_read_bool(phydev->mdio.dev.of_node, ++ "at803x-override-sgmii-link-check")) { ++ aneg_done = 1; ++ } ++#endif + } + /* switch back to copper page */ + phy_write(phydev, AT803X_REG_CHIP_CONFIG, ccr | AT803X_BT_BX_REG_SEL); diff --git a/target/linux/ath79/patches-4.19/425-at803x-allow-sgmii-aneg-override.patch b/target/linux/ath79/patches-4.19/425-at803x-allow-sgmii-aneg-override.patch new file mode 100644 index 0000000000..0ac6af38f3 --- /dev/null +++ b/target/linux/ath79/patches-4.19/425-at803x-allow-sgmii-aneg-override.patch @@ -0,0 +1,16 @@ +--- a/drivers/net/phy/at803x.c ++++ b/drivers/net/phy/at803x.c +@@ -484,6 +484,13 @@ static int at803x_aneg_done(struct phy_d + if (!(phy_read(phydev, AT803X_PSSR) & AT803X_PSSR_MR_AN_COMPLETE)) { + pr_warn("803x_aneg_done: SGMII link is not ok\n"); + aneg_done = 0; ++#ifdef CONFIG_OF_MDIO ++ if (phydev->mdio.dev.of_node && ++ of_property_read_bool(phydev->mdio.dev.of_node, ++ "at803x-override-sgmii-link-check")) { ++ aneg_done = 1; ++ } ++#endif + } + /* switch back to copper page */ + phy_write(phydev, AT803X_REG_CHIP_CONFIG, ccr | AT803X_BT_BX_REG_SEL);