From patchwork Thu May 19 18:21:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 624188 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 3r9fgM6hywz9sdg for ; Fri, 20 May 2016 04:27:27 +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=vQBwplFl; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id CE464B92060; Thu, 19 May 2016 20:22:42 +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:42 +0200 (CEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 9F441B91FCD for ; Thu, 19 May 2016 20:22:00 +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:22:00 +0200 (CEST) Received: by mail-wm0-f43.google.com with SMTP id w143so437098wmw.0 for ; Thu, 19 May 2016 11:22:00 -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=fUeRYxiLkEkXKvfH/fu0I2EtkofuWyh81fzDGq9uTwY=; b=vQBwplFlOP0utd5zTDlILctKl9zKOh8N0Y5D/txj1dPoo8JLGUo3NqBrrniB3nM3Wi 3h3BCnzurfhRbQb/PIQ6iXwIVOXLECXNnX/W3HwM8fqyhgdbJa0BJWQM0eiPjN78/aOH VX64joj9S5IDidLINA3dlBtstGpmF2Ta0vdvIAhWAEScm4SggMRfAzmEKW1PNDJ3P7qv nVpcK9aksFE+wqtCjpidxYMh1i6XWia7z0lO0Bapvw46HznOY6cifp/xFM50rd7nzvm7 J11sK1dvWJNLNXeOc1yy7ccSebAnn3iTdetAwN/6hYmbcA9+SCwoT7HiNusiYh22hsKU q2zg== 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=fUeRYxiLkEkXKvfH/fu0I2EtkofuWyh81fzDGq9uTwY=; b=MJxXFre0uW4jX7M6rf6aYBcVBcZalW57GdWwPbwsOvdJiTbHU4yveJyOAYXUgjllSe JFL3IPAIK0o45y0dvenCB5pjVI48R4xrKIPj/TXqqcT3meQvzjRn13MegjjYmBtYzXPe EfVTz1RAmuNKfLL+GJ5Encbnpc7VE02oAApNShoYmuEWIhQDmbU4Nb5pige0L6scmbC3 KpVzmy4weMOqLNT98jix5pZBPaPPpcIXAmuKCPu7TJ3R4Vn1xkrzbpSDZld6PCiBvRrw nZK4318kqyFQnhcJ+28YGcXGJOwMzTcuAPp/aLlArgp0k/h4hbqPKHlFBjBeT277ke41 kAjQ== X-Gm-Message-State: AOPr4FUAic0j+QjEVYfMtAM40+AAnM4duCPA2uvBMVF9aAUNuDVzHU/hTzc2jtZs+e+/ZLqq X-Received: by 10.194.117.164 with SMTP id kf4mr3236723wjb.3.1463682120281; Thu, 19 May 2016 11:22:00 -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 e8sm527891wma.2.2016.05.19.11.21.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 May 2016 11:21:59 -0700 (PDT) From: Sven Eckelmann To: openwrt-devel@lists.openwrt.org Date: Thu, 19 May 2016 20:21:00 +0200 Message-Id: <1463682077-19339-17-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 17/34] ar71xx: Use private version of ath79_setup_qca955x_eth_cfg for 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 MR1750 must unset some bits in ETH_CFG which were set by u-boot to work correctly under OpenWrt. But the global function ath79_setup_qca955x_eth_cfg will not unset all of them to increase the backward compatiblity with older mach-* files. A private (simplified) version for MR1750 can be used instead. Signed-off-by: Sven Eckelmann Backport of r49070 --- .../ar71xx/files/arch/mips/ath79/mach-mr1750.c | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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 f9e45bd..e3c04e7 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c @@ -108,6 +108,28 @@ static struct mdio_board_info mr1750_mdio0_info[] = { }, }; +static void __init mr1750_setup_qca955x_eth_cfg(u32 mask, + unsigned int rxd, + unsigned int rxdv, + unsigned int txd, + unsigned int txe) +{ + void __iomem *base; + u32 t; + + base = ioremap(QCA955X_GMAC_BASE, QCA955X_GMAC_SIZE); + + t = mask; + t |= rxd << QCA955X_ETH_CFG_RXD_DELAY_SHIFT; + t |= rxdv << QCA955X_ETH_CFG_RDV_DELAY_SHIFT; + t |= txd << QCA955X_ETH_CFG_TXD_DELAY_SHIFT; + t |= txe << QCA955X_ETH_CFG_TXE_DELAY_SHIFT; + + __raw_writel(t, base + QCA955X_GMAC_REG_ETH_CFG); + + iounmap(base); +} + static void __init mr1750_setup(void) { u8 *art = (u8 *)KSEG1ADDR(0x1fff0000); @@ -129,7 +151,7 @@ static void __init mr1750_setup(void) ath79_register_wmac(art + MR1750_WMAC_CALDATA_OFFSET, mac); ath79_register_pci(); - ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN); + mr1750_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN, 3, 3, 0, 0); ath79_register_mdio(0, 0x0); mdiobus_register_board_info(mr1750_mdio0_info,