From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 90DDAA04F9; Fri, 10 Jan 2020 09:36:01 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2867B1E8CF; Fri, 10 Jan 2020 09:35:55 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2049.outbound.protection.outlook.com [40.107.223.49]) by dpdk.org (Postfix) with ESMTP id 6C22D1E8BE for ; Fri, 10 Jan 2020 09:35:52 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EJ4p6BEaR/OzmcICFfp6tElqmcCEl7PJDdquT+OGzO0pf3sLztKvKYxIah6cWAY01geqKjDCmi+6iWvAhinscJiLoryv0ktmKIDqa4EzZCevO+CqlUW0H+6IO2RWdBuLA8E6BOrb1f34Sa0UAavSCKv+z9wvejWFvSLt69o0NP9EhhkGmgDCgRFz4RlhqYAnnUgJ8AnmiMAZ5Cst3T+U+difYRVY3r2RyJCPHIgxy15VjrdjrMCuxBMU0PKPdgaHiM3yshrRqyelmeM5pdaoDV9Bt4su5k5vIFbHLZlQ09u49jK1HoItr5IBV+9GqQxmyQifnXLZvSVqpCIlRfDHoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Sy34nfoq9yv38HiB206HgNuSYcRPkZmRWe4SigMlUZ4=; b=NKHn+W7xkxC9Ib/vrK5HJEoHkdWtmjx4dZylTRbdMQctD+XHjRPSO5sZ6pvotxVo+XKurRjLboRewFARMGVrYaxaT1bimjQVyzsg5hghmlX7ExLV2b9aF6mQMqgDBva1hs27IZhpP4I/niETPIC6PBIOYdzbo3tvhienUVVRoPeNqT9VoRn92bu4TOd1DZFVFr6/rnmgp3EBTx3ElNihb6HaDi73uQqlcU3wykxxPC4TqRpNTk8OZpxLX7q3Imrxwnb82sGitxj0wnGyfTvHROoyu3Cap9+K+w0XAi2oLPARp3QCDam+ejoRgavN6+OKhzLvweneXdpJzjnwvgqxAg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Sy34nfoq9yv38HiB206HgNuSYcRPkZmRWe4SigMlUZ4=; b=0cPcvsxskYyvcDpkvt55gvJfmO2BkDHJtWG1YXI6Mei3bpItwyNmpbmC3WZ6LmYKP8vmtU+O8LxNbUJDTVsZlxLS11iuHm6eXdqshYQXhqLUVCx1JguCKpJMaHLw3DFmOTH8OEGB81ZvRxiWB4bpb1cQeCkDgMXvyO/fntonivw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Shamshersingh.Sardar@amd.com; Received: from DM6PR12MB3193.namprd12.prod.outlook.com (20.179.105.159) by DM6PR12MB3706.namprd12.prod.outlook.com (10.255.174.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.12; Fri, 10 Jan 2020 08:35:50 +0000 Received: from DM6PR12MB3193.namprd12.prod.outlook.com ([fe80::a51f:f98a:4006:43d7]) by DM6PR12MB3193.namprd12.prod.outlook.com ([fe80::a51f:f98a:4006:43d7%2]) with mapi id 15.20.2623.010; Fri, 10 Jan 2020 08:35:50 +0000 From: ssardar@amd.com To: dev@dpdk.org Date: Fri, 10 Jan 2020 14:05:28 +0530 Message-Id: <20200110083528.25813-1-ssardar@amd.com> X-Mailer: git-send-email 2.17.1 Content-Type: text/plain X-ClientProxiedBy: MAXPR01CA0091.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:49::33) To DM6PR12MB3193.namprd12.prod.outlook.com (2603:10b6:5:186::31) MIME-Version: 1.0 Received: from amar-Wallaby.amd.com (165.204.156.251) by MAXPR01CA0091.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:49::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.10 via Frontend Transport; Fri, 10 Jan 2020 08:35:49 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [165.204.156.251] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 56566acd-ab5f-4349-109b-08d795a818b0 X-MS-TrafficTypeDiagnostic: DM6PR12MB3706: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2449; X-Forefront-PRVS: 02788FF38E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(396003)(39860400002)(376002)(136003)(346002)(199004)(189003)(956004)(2616005)(186003)(478600001)(16526019)(8936002)(52116002)(7696005)(66946007)(6916009)(66556008)(5660300002)(66476007)(2906002)(26005)(6666004)(81156014)(9686003)(6486002)(8676002)(316002)(1076003)(36756003)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR12MB3706; H:DM6PR12MB3193.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5U3sG6e2kZ/785BUmFxNyN33FQ6wJVDqYHh1sNs8a+dCqQc9hW7WZdegMpOTnLHnEocS2Afwf25TKM9v80vkSUU5k9HJrO/hiJ4jHjllIrLWbDsteOg5aoQpkdfEAeUAEOXryCZZ0AL0PHcq5GQ4BM2JuFRAAlNCD0rXsj/69hPVC1TceBvZYi0C7ndAaOJZzldcbxmkD/JaOiGN11nSNu/JlYUKMWWVYKbifV1CmE0cstNHdT9KPRCDZmC0rzCIvPsBgvCq2tWa9Hnkn5wCic796ymh3zUApna7w98sM5wUIXfGtVr1Jxn/UR3pFarp+mZv5NUgFnG0shSOB88J0yi1MoJXFqD7kS3gyJBnSjxOXcYrYF7cX+Bb06zliEC1dyZ/SptSBsByQL5QWHWc5rUgdmiI2LOufNmgTkF0NzDKFSF9Gg4EkHU9cPpdnYsV X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 56566acd-ab5f-4349-109b-08d795a818b0 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2020 08:35:49.9589 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: iBwFINqyOxi3v8CtWQi/7U2wa014efVyCVJys9FuFXoyDrd6Ors2vSs5ro67DgR8 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3706 Subject: [dpdk-dev] [PATCH v1 1/2] net/axgbe: 1/2.5Gbps support enabled for axgbe X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Sardar Shamsher Singh Added support for 1Gbps and 2.5Gbps in axgbe driver Signed-off-by: Sardar Shamsher Singh --- drivers/net/axgbe/axgbe_phy_impl.c | 50 ++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/drivers/net/axgbe/axgbe_phy_impl.c b/drivers/net/axgbe/axgbe_phy_impl.c index 2267c5f81..f0dc11695 100644 --- a/drivers/net/axgbe/axgbe_phy_impl.c +++ b/drivers/net/axgbe/axgbe_phy_impl.c @@ -610,8 +610,7 @@ static void axgbe_phy_sfp_parse_eeprom(struct axgbe_port *pdata) if (sfp_base[AXGBE_SFP_BASE_EXT_ID] != AXGBE_SFP_EXT_ID_SFP) return; - if (axgbe_phy_sfp_parse_quirks(pdata)) - return; + axgbe_phy_sfp_parse_quirks(pdata); /* Assume ACTIVE cable unless told it is PASSIVE */ if (sfp_base[AXGBE_SFP_BASE_CABLE] & AXGBE_SFP_BASE_CABLE_PASSIVE) { @@ -1238,6 +1237,47 @@ static void axgbe_phy_kr_mode(struct axgbe_port *pdata) phy_data->cur_mode = AXGBE_MODE_KR; } +static void axgbe_phy_kx_2500_mode(struct axgbe_port *pdata) +{ + struct axgbe_phy_data *phy_data = pdata->phy_data; + unsigned int s0; + + axgbe_phy_set_redrv_mode(pdata); + /* 2.5G/KX */ + axgbe_phy_start_ratechange(pdata); + s0 = 0; + XP_SET_BITS(s0, XP_DRIVER_SCRATCH_0, COMMAND, 2); + XP_SET_BITS(s0, XP_DRIVER_SCRATCH_0, SUB_COMMAND, 0); + + XP_IOWRITE(pdata, XP_DRIVER_SCRATCH_0, s0); + XP_IOWRITE(pdata, XP_DRIVER_SCRATCH_1, 0); + + XP_IOWRITE_BITS(pdata, XP_DRIVER_INT_REQ, REQUEST, 1); + + phy_data->cur_mode = AXGBE_MODE_KX_2500; +} + +static void axgbe_phy_sgmii_1000_mode(struct axgbe_port *pdata) +{ + struct axgbe_phy_data *phy_data = pdata->phy_data; + unsigned int s0; + + axgbe_phy_set_redrv_mode(pdata); + + /* 1G/SGMII */ + axgbe_phy_start_ratechange(pdata); + s0 = 0; + XP_SET_BITS(s0, XP_DRIVER_SCRATCH_0, COMMAND, 1); + XP_SET_BITS(s0, XP_DRIVER_SCRATCH_0, SUB_COMMAND, 2); + + XP_IOWRITE(pdata, XP_DRIVER_SCRATCH_0, s0); + XP_IOWRITE(pdata, XP_DRIVER_SCRATCH_1, 0); + + XP_IOWRITE_BITS(pdata, XP_DRIVER_INT_REQ, REQUEST, 1); + + phy_data->cur_mode = AXGBE_MODE_SGMII_1000; +} + static enum axgbe_mode axgbe_phy_cur_mode(struct axgbe_port *pdata) { struct axgbe_phy_data *phy_data = pdata->phy_data; @@ -1408,6 +1448,12 @@ static void axgbe_phy_set_mode(struct axgbe_port *pdata, enum axgbe_mode mode) case AXGBE_MODE_SFI: axgbe_phy_sfi_mode(pdata); break; + case AXGBE_MODE_KX_2500: + axgbe_phy_kx_2500_mode(pdata); + break; + case AXGBE_MODE_SGMII_1000: + axgbe_phy_sgmii_1000_mode(pdata); + break; default: break; } -- 2.17.1