From patchwork Tue Oct 14 00:05:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iyappan Subramanian X-Patchwork-Id: 5077561 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9D5659F387 for ; Tue, 14 Oct 2014 00:08:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DA074201CD for ; Tue, 14 Oct 2014 00:08:56 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CEDF920179 for ; Tue, 14 Oct 2014 00:08:55 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XdpdR-0002dP-O1; Tue, 14 Oct 2014 00:06:41 +0000 Received: from exprod5og120.obsmtp.com ([64.18.0.137]) by bombadil.infradead.org with smtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xdpd7-0002Vv-Um for linux-arm-kernel@lists.infradead.org; Tue, 14 Oct 2014 00:06:22 +0000 Received: from mail-pa0-f47.google.com ([209.85.220.47]) (using TLSv1) by exprod5ob120.postini.com ([64.18.4.12]) with SMTP ID DSNKVDxo5hZB59/RXvnHr8mY0+/mHavM9yBu@postini.com; Mon, 13 Oct 2014 17:06:21 PDT Received: by mail-pa0-f47.google.com with SMTP id rd3so6730611pab.34 for ; Mon, 13 Oct 2014 17:05:58 -0700 (PDT) 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=ePTSUhwsUf5Gg+dqwUJQcjHil9UekM9CQv0bNrY9yZk=; b=aBF7QEDULorb/yyujA4WzyTwn+vp6sClyqrIibk5sWG3SLygy87tbLaYTOPen1BHUq P9yh/euFM/0zfKnZ0H1LeRxG4huJlbdCcEuxvL06jAw/S5z4mIbVNnhIWl4K4KywqcIB Db2IeV8Ogum+At1AH+tP3LnnttHkBStB047phcQWaMwTPHgIqSfvfPGFgp09OhglvBcv Zlak5Dnl13ySYLTXDmf7Z3UnFU6WQpkQbv588Vtie4jo3Jn1wvrezCtxXhkkS4GbxYtm SflpEpusmAHld/rwTZw1xh/U7qsWToY+A64zNhmcBAi532lZxdkrzvCw1jYX86HLk9wl 38hQ== X-Gm-Message-State: ALoCoQk1RDreBEBsmReKuY/LFX++kl31TDY55vmpPMJC5I7YUgSN3nXpq0clmufv9OLIoYeQys9d90ubh7e0Ds0nVoLOjqxoBfTbnFX89442KyEz00pD/vU3yTqjKdwNYcEWix1RduPWuqPdmSreu4oL+bWFe/3YydpDnLDbcEqGGEfXmzGl/ak= X-Received: by 10.70.45.129 with SMTP id n1mr31677pdm.11.1413245158421; Mon, 13 Oct 2014 17:05:58 -0700 (PDT) X-Received: by 10.70.45.129 with SMTP id n1mr31668pdm.11.1413245158362; Mon, 13 Oct 2014 17:05:58 -0700 (PDT) Received: from svdclab-13-11.amcc.com (67-207-112-226.static.wiline.com. [67.207.112.226]) by mx.google.com with ESMTPSA id xf9sm12430374pab.2.2014.10.13.17.05.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 13 Oct 2014 17:05:57 -0700 (PDT) From: Iyappan Subramanian To: davem@davemloft.net, romieu@fr.zoreil.com, netdev@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 4/4] drivers: net: xgene: Add SGMII based 1GbE ethtool support Date: Mon, 13 Oct 2014 17:05:35 -0700 Message-Id: <1413245135-2989-5-git-send-email-isubramanian@apm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1413245135-2989-1-git-send-email-isubramanian@apm.com> References: <1413245135-2989-1-git-send-email-isubramanian@apm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141013_170622_084282_3DF570ED X-CRM114-Status: GOOD ( 12.06 ) X-Spam-Score: -2.6 (--) Cc: kchudgar@apm.com, patches@apm.com, linux-arm-kernel@lists.infradead.org, Iyappan Subramanian X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Iyappan Subramanian Signed-off-by: Keyur Chudgar --- .../net/ethernet/apm/xgene/xgene_enet_ethtool.c | 25 +++++++++++++++------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c b/drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c index c1c997b..416d6eb 100644 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c @@ -64,16 +64,25 @@ static int xgene_get_settings(struct net_device *ndev, struct ethtool_cmd *cmd) return -ENODEV; return phy_ethtool_gset(phydev, cmd); + } else if (pdata->phy_mode == PHY_INTERFACE_MODE_SGMII) { + cmd->supported = SUPPORTED_1000baseT_Full | + SUPPORTED_Autoneg | SUPPORTED_MII; + cmd->advertising = cmd->supported; + ethtool_cmd_speed_set(cmd, SPEED_1000); + cmd->duplex = DUPLEX_FULL; + cmd->port = PORT_MII; + cmd->transceiver = XCVR_INTERNAL; + cmd->autoneg = AUTONEG_ENABLE; + } else { + cmd->supported = SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE; + cmd->advertising = cmd->supported; + ethtool_cmd_speed_set(cmd, SPEED_10000); + cmd->duplex = DUPLEX_FULL; + cmd->port = PORT_FIBRE; + cmd->transceiver = XCVR_INTERNAL; + cmd->autoneg = AUTONEG_DISABLE; } - cmd->supported = SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE; - cmd->advertising = cmd->supported; - ethtool_cmd_speed_set(cmd, SPEED_10000); - cmd->duplex = DUPLEX_FULL; - cmd->port = PORT_FIBRE; - cmd->transceiver = XCVR_EXTERNAL; - cmd->autoneg = AUTONEG_DISABLE; - return 0; }