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 99FBEA04F9; Fri, 10 Jan 2020 13:59:59 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6B1E71EA1E; Fri, 10 Jan 2020 13:59:59 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2067.outbound.protection.outlook.com [40.107.220.67]) by dpdk.org (Postfix) with ESMTP id D55391EA0D for ; Fri, 10 Jan 2020 13:59:57 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oE7JmYW9fcAv2PZkepTpzANq8Rsr9w67kKB9E1Ix7FKNXJk+Me0coagH3JiUfV5Dve0/78QhAnILaZP7lNY/BLDNGGn/fV+8S6JjSAXh72/z2JB+Ub+9qL/GS7vdxYFbn2tHfJmhnaaSW5+lX4aY3kkTkn86iSRZgkeOY4b37Sx92LHl1LnIxb8AaCxOB3Rcj7yEXtrM+ygu8Aga7tPpJXgVTcYnkl5LyBJYK9gHLlNmUhTu3UkVqkPNWWe3S4NbzWIx5kkRu7/tAhXzl4F5f9aRvSBFkF4YRYqWrcyhoaL5HeCugSxlx/BAn0Ew4uNyYcMegO3b2hK1bcwbmo1KVQ== 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=vTSXkYw+s2H67Y7froEyDDwgdhJm97/4Yms9/SXzpmM=; b=Isehr6dF4hfjcemu7HeGiXFTNt4E1N8lMGE9QOsKfYpvyPoNI/+hGI9lpKvYSBIFWXq/YEnbKBe5I+EflUUT/XhbKljlRIYQK50lC+XEQNf3vb7bgriClbABuuCoOuzL3ycHy4bV3lJEdiw4K5k9hNxgW3sgUfi0rP6NiurGotXQ8252dk6yDVh9UAgE20+NegSUSpYAvdUyyUjnbsxCq2Y8s35PEfhPRhXRUFscHyCN/1sguCHjJwG/8nr0/VfucsKrSMR8Fo5ljQ1P0KTz5toCRs3EFpEojx0yaSdfduFreK4lqGsc7rM8YVKErelqdU5b3fKmsBKzfN3KDgI1dQ== 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=vTSXkYw+s2H67Y7froEyDDwgdhJm97/4Yms9/SXzpmM=; b=ZIEXJFDJKxOlLDK0qTnI7FlHIIXPky1KU/Zlp51Gdj7WYSnpm7TBHh7DUi5T1gaDzaYswokLol0An6BckM4vvWSs+lYahUhoGHF3Ybwizi/d5es13b6d2TvhNU4M7dowqzFeCGdxoYM6O+emeCcYjxO832mszjsK71rCY0ZsP1s= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Girish.Nandibasappa@amd.com; Received: from DM6PR12MB3948.namprd12.prod.outlook.com (10.255.172.208) by DM6PR12MB3835.namprd12.prod.outlook.com (10.255.173.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.9; Fri, 10 Jan 2020 12:59:56 +0000 Received: from DM6PR12MB3948.namprd12.prod.outlook.com ([fe80::b84f:565d:8588:aade]) by DM6PR12MB3948.namprd12.prod.outlook.com ([fe80::b84f:565d:8588:aade%3]) with mapi id 15.20.2623.013; Fri, 10 Jan 2020 12:59:56 +0000 From: gnandiba@amd.com To: dev@dpdk.org Date: Fri, 10 Jan 2020 18:29:37 +0530 Message-Id: <20200110125937.6194-1-gnandiba@amd.com> X-Mailer: git-send-email 2.17.1 Content-Type: text/plain X-ClientProxiedBy: MAXPR01CA0092.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:49::34) To DM6PR12MB3948.namprd12.prod.outlook.com (2603:10b6:5:1c4::16) MIME-Version: 1.0 Received: from amar-Wallaby.amd.com (165.204.156.251) by MAXPR01CA0092.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:49::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.9 via Frontend Transport; Fri, 10 Jan 2020 12:59:55 +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: 5e4bfec2-31f0-4b02-e676-08d795ccfdb7 X-MS-TrafficTypeDiagnostic: DM6PR12MB3835: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2449; X-Forefront-PRVS: 02788FF38E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(39860400002)(346002)(136003)(396003)(366004)(189003)(199004)(2906002)(52116002)(7696005)(478600001)(66476007)(66556008)(66946007)(1076003)(186003)(36756003)(9686003)(16526019)(316002)(26005)(6486002)(6666004)(2616005)(8676002)(81156014)(956004)(5660300002)(6916009)(81166006)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR12MB3835; H:DM6PR12MB3948.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: PLq7osnqwJ+R/eeMoMmAxLC0QLyJfUIr89taJWkxTVCX7GVIV1CTbNolEcbkE49PjVUfmWGvTuvv30jF2Kxhb//xPUUaC8BICE6JIYJ9/GarYFf54qeRTXpPIxlZkLrlTnxuT817llyUrZRl+GAUueUO6hmKsPZR+TmUzAN2Vg5O31FTaA18jUeZs5LZG+pd5Nt6d2MFUaIFXbBPUMgdNgrYi91JMmXCngdkiqbtqDRc/zCv7O49PQkejb/AU35q5bEVXZQCocZxmFEyDCarKHVavDeRAS5m4kiJbqENFU6hb7hzuQOvx0STcNPzJsBGf6R3QTGcbGqzJIO5iKrcRvLw6QX9sSn+lLpvxns7xe3GNFoPosdDfuRzXihLn+8Y6Sx28iceV7jWoRdU77+SWjq/MDdI0wdv0Isjtm+iXw4hhe8OWa36lvEAvSqsjsDE X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5e4bfec2-31f0-4b02-e676-08d795ccfdb7 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2020 12:59:56.1267 (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: KRz7LSGSPjjTbm1le/6CJa/T8uNOewb5m3eMuxaYc9BvbuFw/jov1cDYHoq6jgKcdbzZdm7MaPOEnBMqMPJ+gg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3835 Subject: [dpdk-dev] [PATCH v2 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: Girish Nandibasappa Added support for 1Gbps and 2.5Gbps in axgbe dpdk driver Signed-off-by: Girish Nandibasappa --- 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