From patchwork Thu May 19 18:20:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 624186 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (caladan.dune.hu [78.24.191.180]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3r9ffg3LZ2z9sdg for ; Fri, 20 May 2016 04:26:51 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=open-mesh-com.20150623.gappssmtp.com header.i=@open-mesh-com.20150623.gappssmtp.com header.b=0r3i/Xmv; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id D5136B9203F; Thu, 19 May 2016 20:22:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Thu, 19 May 2016 20:22:35 +0200 (CEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id CAB75B91FCA for ; Thu, 19 May 2016 20:21:57 +0200 (CEST) X-policyd-weight: using cached result; rate:hard: -7 Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Thu, 19 May 2016 20:21:57 +0200 (CEST) Received: by mail-wm0-f43.google.com with SMTP id n129so48254161wmn.1 for ; Thu, 19 May 2016 11:21:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=open-mesh-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Quuju1pM3hRiSHhy7P6Lua9t1qcXI7Z7ZsW/gDWFOsA=; b=0r3i/XmvakhS7P/w8GoiFtQOJudEdG+244Vx6BfBsOzA3EN42nzEMnNmbgYB4y31Mu G8tEhdnCbWyqXnuPumBYNuk3UqQPtAByeUpHR98yv1ok3uQBxq27x67VIlqP+sqeRgNH njvaZ2gsKaUTeGW7MCzSSlsFlrJiaWZGTJjuh51Sumq4YgwzjHFM0LKSxNPaal7SBK1L 4+zx/+PsGmGZ0EgPGjv/e7vllBL1oavlfHiH/zE8q8NHk6X0GhiOXfuo39RlniO1xBay KjLCbzjFucFqBFoX/7XxWlmrajktTws2WA9x7Fyn9Pf7ykUYE0Mnu3RlObiaZU6A4so0 +x3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Quuju1pM3hRiSHhy7P6Lua9t1qcXI7Z7ZsW/gDWFOsA=; b=KSy2kTXRu7hu/1j63//8hRgJZAnBQoWRcdKUsgPEjzy+AyMuBTfLOdKh21kCqvmb1s 4guMrPbhJss7uxEY466odpPTNSFEeIuI3BituF0r5zUvalHaNLldC1kAiurfYIPe8oOM 941xwSVfZm81ZKfb+RdJxoPnHwqK+68ilgC+btrzjRMlTJ2HBXgvFJaYkZtfa9KKdQp+ iZRzo24ojKzutDj67/RZS5vKqm/evMGdbqZY7ivz3bXpaXmxUHX3foDTu9rd+JlaZFN2 qcfFHFNsuptCEzmWNCh0AnB9rR0eQTj4E2jRKrdqzv92htLJfYVFuRoTqkPpyyO4EFEo 9UCg== X-Gm-Message-State: AOPr4FURI5ThHKXjCxa+RhVsU/rBj1tN+3zGkoa1hgzH2qAqDY32uqgJ5wk82DXEZCFC2AFb X-Received: by 10.195.11.197 with SMTP id ek5mr14829034wjd.58.1463682117434; Thu, 19 May 2016 11:21:57 -0700 (PDT) Received: from sven-desktop.home.narfation.org (p579E6DC9.dip0.t-ipconnect.de. [87.158.109.201]) by smtp.gmail.com with ESMTPSA id az2sm15701195wjc.6.2016.05.19.11.21.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 May 2016 11:21:56 -0700 (PDT) From: Sven Eckelmann To: openwrt-devel@lists.openwrt.org Date: Thu, 19 May 2016 20:20:58 +0200 Message-Id: <1463682077-19339-15-git-send-email-sven.eckelmann@open-mesh.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1463682077-19339-1-git-send-email-sven.eckelmann@open-mesh.com> References: <1463682077-19339-1-git-send-email-sven.eckelmann@open-mesh.com> Subject: [OpenWrt-Devel] [PATCH CC 15/34] ar71xx: Use PHY fixups for Open Mesh MR1750 X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sven Eckelmann MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" The delays of PHY/MAC on the MR1750 are done by u-boot and OpenWrt in different ways. u-boot only modifies the ETH_CFG of the QCA955x based on the link speed. But OpenWrt can only modify the PHY delays based on the link speed. This can lead to communication problems when u-boot initializes the ETH_CFG for a specific link speed (e.g. 10BASE-T) but then OpenWrt the sets the PHY delays to an incompatible value. Instead reset the ETH_CFG delay bits of the QCA955x to a specific value and only rely on the AT803x PHY settings. Signed-off-by: Sven Eckelmann Backport of r49031 --- .../ar71xx/files/arch/mips/ath79/mach-mr1750.c | 25 +++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c index 8ace02f..f9e45bd 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c @@ -22,6 +22,7 @@ #include #include +#include #include "common.h" #include "dev-ap9x-pci.h" @@ -92,14 +93,29 @@ static struct gpio_keys_button mr1750_gpio_keys[] __initdata = { }, }; +static struct at803x_platform_data mr1750_at803x_data = { + .disable_smarteee = 1, + .enable_rgmii_rx_delay = 1, + .enable_rgmii_tx_delay = 0, + .fixup_rgmii_tx_delay = 1, +}; + +static struct mdio_board_info mr1750_mdio0_info[] = { + { + .bus_id = "ag71xx-mdio.0", + .phy_addr = 5, + .platform_data = &mr1750_at803x_data, + }, +}; + static void __init mr1750_setup(void) { u8 *art = (u8 *)KSEG1ADDR(0x1fff0000); u8 mac[6]; - ath79_eth0_pll_data.pll_1000 = 0xbe000101; - ath79_eth0_pll_data.pll_100 = 0x80000101; - ath79_eth0_pll_data.pll_10 = 0x80001313; + ath79_eth0_pll_data.pll_1000 = 0xae000000; + ath79_eth0_pll_data.pll_100 = 0xa0000101; + ath79_eth0_pll_data.pll_10 = 0xa0001313; ath79_register_m25p80(NULL); @@ -116,6 +132,9 @@ static void __init mr1750_setup(void) ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN); ath79_register_mdio(0, 0x0); + mdiobus_register_board_info(mr1750_mdio0_info, + ARRAY_SIZE(mr1750_mdio0_info)); + ath79_init_mac(ath79_eth0_data.mac_addr, art + MR1750_MAC0_OFFSET, 0); /* GMAC0 is connected to the RMGII interface */