From patchwork Thu Jul 21 06:59:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iyappan Subramanian X-Patchwork-Id: 9240999 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 32491602F0 for ; Thu, 21 Jul 2016 07:01:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2400A27BFC for ; Thu, 21 Jul 2016 07:01:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 18D4127D85; Thu, 21 Jul 2016 07:01:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C242B27BFC for ; Thu, 21 Jul 2016 07:01:56 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bQ7yD-0000Do-26; Thu, 21 Jul 2016 07:00:33 +0000 Received: from mail-pa0-x229.google.com ([2607:f8b0:400e:c03::229]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bQ7xE-00070V-MK for linux-arm-kernel@lists.infradead.org; Thu, 21 Jul 2016 06:59:34 +0000 Received: by mail-pa0-x229.google.com with SMTP id ks6so26257501pab.0 for ; Wed, 20 Jul 2016 23:59:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apm.com; s=apm; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kpGfv4FGWm/dyadrV9dQsWs5ln/zjUTB8Tq3cPe4ewE=; b=RR1GNud0pzP1bREYwCCa8cNe7lGOgIBKKEkgxJjEkf+sIB9CKt6wVua7riG3Y0/bcr pFKMVBBaRMfNjE/hZwEJJEgTBKuaiWC13t5r7mDNNVObHh5iz0lcEhSJjbQr77tCCudV MDWsNnYxl/h1jXbpbqQsDVLoxsOLDbse4qN6w= 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=kpGfv4FGWm/dyadrV9dQsWs5ln/zjUTB8Tq3cPe4ewE=; b=k2G7RMUCnjpV+5ZPEDVLHyWW5XvUOev+x6V4WPD2Ogv4PjSxItd30p3CJCBh9v7pd6 WSH1iXI2/oQYkmVdEeLOcT/yYK6lYdsL7h4nlj7xC/1mE/ikhuxeKEM22J3JNTFZHBz7 OOZZZ5slWNcOheTdhPiXVw9ksuW2LrQxUcNNy2akNIyre+JJy6qERhqMmu/MctrjPSlT Yphq24CYIjFrmYc8u29XsqB0NsX4dbwrNujOiSUxZkr3/XtbZzoP/3DNAKVJGdP+PCqS LpBcFpBhgd0BpQhTwRAqfO56qsi0kMArX9osBGL3k+aWOQd+526kl/LOifK/9JygWp+R CsxQ== X-Gm-Message-State: ALyK8tLlSK78Kx98drwL1bNH5zUe7ODDyy7kDGuoHfAFn6zUD2tBVDfncptHZoc3MLyKOvRG X-Received: by 10.66.180.80 with SMTP id dm16mr78805818pac.47.1469084351915; Wed, 20 Jul 2016 23:59:11 -0700 (PDT) Received: from isubrama-dev.amcc.com ([206.80.4.98]) by smtp.gmail.com with ESMTPSA id yo10sm9278188pab.4.2016.07.20.23.59.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Jul 2016 23:59:11 -0700 (PDT) From: Iyappan Subramanian To: davem@davemloft.net, netdev@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v6 07/12] drivers: net: xgene: Enable MDIO driver Date: Wed, 20 Jul 2016 23:59:25 -0700 Message-Id: <1469084370-16781-8-git-send-email-isubramanian@apm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1469084370-16781-1-git-send-email-isubramanian@apm.com> References: <1469084370-16781-1-git-send-email-isubramanian@apm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160720_235932_927437_89CEDB35 X-CRM114-Status: GOOD ( 14.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: patches@apm.com, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, Iyappan Subramanian MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch enables MDIO driver by, - Selecting MDIO_XGENE - Changed open and close to use phy_start and phy_stop - Changed to use mac_ops->tx(rx)_enable and tx(rx)_disable Signed-off-by: Iyappan Subramanian Tested-by: Fushen Chen Tested-by: Toan Le --- drivers/net/ethernet/apm/xgene/Kconfig | 1 + drivers/net/ethernet/apm/xgene/xgene_enet_hw.c | 8 ++++---- drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/apm/xgene/Kconfig b/drivers/net/ethernet/apm/xgene/Kconfig index 19e38af..300e3b5 100644 --- a/drivers/net/ethernet/apm/xgene/Kconfig +++ b/drivers/net/ethernet/apm/xgene/Kconfig @@ -3,6 +3,7 @@ config NET_XGENE depends on HAS_DMA depends on ARCH_XGENE || COMPILE_TEST select PHYLIB + select MDIO_XGENE help This is the Ethernet driver for the on-chip ethernet interface on the APM X-Gene SoC. diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c b/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c index b8b643f..27a7a1c 100644 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c @@ -794,13 +794,13 @@ static void xgene_enet_adjust_link(struct net_device *ndev) if (pdata->phy_speed != phydev->speed) { pdata->phy_speed = phydev->speed; mac_ops->set_speed(pdata); - xgene_gmac_rx_enable(pdata); - xgene_gmac_tx_enable(pdata); + mac_ops->rx_enable(pdata); + mac_ops->tx_enable(pdata); phy_print_status(phydev); } } else { - xgene_gmac_rx_disable(pdata); - xgene_gmac_tx_disable(pdata); + mac_ops->rx_disable(pdata); + mac_ops->tx_disable(pdata); pdata->phy_speed = SPEED_UNKNOWN; phy_print_status(phydev); } diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c index 6398337..d1d6b5e 100644 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c @@ -739,9 +739,9 @@ static int xgene_enet_open(struct net_device *ndev) if (ret) return ret; - if (pdata->phy_mode == PHY_INTERFACE_MODE_RGMII) + if (pdata->phy_dev) { phy_start(pdata->phy_dev); - else { + } else { schedule_delayed_work(&pdata->link_work, PHY_POLL_LINK_OFF); netif_carrier_off(ndev); }