From patchwork Tue Jun 4 06:10:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mugunthan V N X-Patchwork-Id: 2657161 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 1AECB3FC8C for ; Tue, 4 Jun 2013 06:09:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759173Ab3FDGJt (ORCPT ); Tue, 4 Jun 2013 02:09:49 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:42906 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758801Ab3FDGJq (ORCPT ); Tue, 4 Jun 2013 02:09:46 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id r5469ebs024721; Tue, 4 Jun 2013 01:09:40 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r5469ea9028765; Tue, 4 Jun 2013 01:09:40 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.2.342.3; Tue, 4 Jun 2013 01:09:40 -0500 Received: from a0131834-linux.india.ti.com (dbdp20.itg.ti.com [172.24.170.38]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id r5469SKu009155; Tue, 4 Jun 2013 01:09:38 -0500 From: Mugunthan V N To: CC: , , , , , Mugunthan V N Subject: [net-next PATCH 3/8] drivers: net: phy: at803x: add interface mode support Date: Tue, 4 Jun 2013 11:40:06 +0530 Message-ID: <1370326212-17580-4-git-send-email-mugunthanvnm@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1370326212-17580-1-git-send-email-mugunthanvnm@ti.com> References: <1370326212-17580-1-git-send-email-mugunthanvnm@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org This patch adds support for RGMII TX delay configuration on Atheros 803X, this can be enabled in debug registers. With this patch, PHY_INTERFACE_MODE_RGMII_TXID modes are now supported. Signed-off-by: Mugunthan V N --- drivers/net/phy/at803x.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c index 63444b7..dda07ed 100644 --- a/drivers/net/phy/at803x.c +++ b/drivers/net/phy/at803x.c @@ -27,6 +27,10 @@ #define AT803X_MMD_ACCESS_CONTROL 0x0D #define AT803X_MMD_ACCESS_CONTROL_DATA 0x0E #define AT803X_FUNC_DATA 0x4003 +#define AT803X_DEBUG_ADDR 0x1D +#define AT803X_DEBUG_DATA 0x1E +#define AT803X_DEBUG_SYSTEM_MODE_CTRL 0x05 +#define AT803X_DEBUG_RGMII_TX_CLK_DLY BIT(8) MODULE_DESCRIPTION("Atheros 803x PHY driver"); MODULE_AUTHOR("Matus Ujhelyi"); @@ -99,6 +103,7 @@ static void at803x_get_wol(struct phy_device *phydev, static int at803x_config_init(struct phy_device *phydev) { int val; + int ret; u32 features; features = SUPPORTED_TP | SUPPORTED_MII | SUPPORTED_AUI | @@ -133,6 +138,17 @@ static int at803x_config_init(struct phy_device *phydev) phydev->supported = features; phydev->advertising = features; + if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) { + ret = phy_write(phydev, AT803X_DEBUG_ADDR, + AT803X_DEBUG_SYSTEM_MODE_CTRL); + if (ret) + return ret; + ret = phy_write(phydev, AT803X_DEBUG_DATA, + AT803X_DEBUG_RGMII_TX_CLK_DLY); + if (ret) + return ret; + } + return 0; }