From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0045.outbound.protection.outlook.com [104.47.42.45]) by dpdk.org (Postfix) with ESMTP id EB4882B9E for ; Thu, 30 Nov 2017 14:11:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=8pMlHulP1iOKSAEx+mnoHAIIJrIiySTYVVwbkOPHV6Y=; b=yGx9bMtJoFRemMqx4rf4neB+a+LY0/M5us5djIpLtRNm/TS/u2vCIORZ4SYURxpTKPBp5ZynatB1Dqt3wVvFr4oIgF2t30BfxXXld7WHSQg8q8qJWfP8hCwCbAGb3Lj8TUyzlEFmwwSPdOFE4QjXhazjtH3DJ3vQjvivzVSST5s= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by DM5PR12MB1514.namprd12.prod.outlook.com (10.172.39.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Thu, 30 Nov 2017 13:11:43 +0000 From: Ravi Kumar To: dev@dpdk.org Date: Thu, 30 Nov 2017 08:10:59 -0500 Message-Id: <1512047472-118050-3-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512047472-118050-1-git-send-email-Ravi1.kumar@amd.com> References: <1512047472-118050-1-git-send-email-Ravi1.kumar@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [202.56.249.162] X-ClientProxiedBy: MA1PR01CA0077.INDPRD01.PROD.OUTLOOK.COM (10.174.56.17) To DM5PR12MB1514.namprd12.prod.outlook.com (10.172.39.146) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 39deaf71-6808-410b-26a4-08d537f3e795 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603286); SRVR:DM5PR12MB1514; X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1514; 3:qw+o8myH7LV8dn9R7FA3lhLbqGjD61in4YpqLt/q5BdI5vLrCOVjfKjOJAYiXU299/7+S+UOLflllU0U4AMJ1Js4Sy6EYzXoCtTZtKK26e9vQHDJZJDlbzXaqVFXU9WzXTMxytdQkxSQmiiSNuzl+zhla4H59mT4OHVWDRh2aGeLj+GPPETDkwpcjjb/aRACojAkY8sAUAO911A5ubYF9PtsA/UQSi5h8zKSjL5JgakrLi+DAfMA9KaFA9KqGqQ4; 25:mvNfhtxgSDvW329slGven3UiIxjMu6t5lRTigDDR5ivSU1GSly3g8mEJknyT4u1h0FE8TuEYBtXjrgm331V/dWqUki5UopU6RxUl5iGzojxpFF4rim/imrHEzgsXP4H58UT7qLE0ceA4f2tkj8zJM9TFFIOV5l9UZ8UA9exEyIVhTeFopGmXVVY+rv8K9ehoKKVT5fTEoJesqHM+dVYqmbaVotDWVEufB45pPH9idjlqp8VXMB1GYA/yUdw3Z+30pe7zvekieknngc7jFLp+nlhrLnqw6NJBOakK1xnYP2ncoKXSf9PWrbmflP62uwo2lvqQ4qEir0V/QXBRC7guDw==; 31:S2ir9rh4+lmfhVR9mIbLJaRGQ8K/IoH3digqEM5yKKx5I+vBRIg45S2u38R2WBF1Wq6tWxYcMyBwjXithuddqPzWYEt6/ZJ1OVF3mGoLVl/IKQ1mke/Cl1zuZ8P4+wph1LZmP1AblpmcJ/XU/8Y2znBx6kwclSTVv7EHQsb7itWxPkaWzcEJqQFMNfkMO2lnnwGEZrrRxx4HvEyE2slUYvw/mfYB0VFaTxfLx/CLFFs= X-MS-TrafficTypeDiagnostic: DM5PR12MB1514: X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1514; 20:HVCnGdjQQO05s5qd7gCpjH7dB99+z6OGZdUFSmVeJRCpaebPuAvT5MZY+Cuw2EcftW/6XVLdUdKzLpDBIPVyso7o0+/JE6VRs+SlZ3StMpvrvhCD8hXXINCv7WywvofGiad30OtPwt7kptBAtgBVUbkF9tHQWvbQZIAtxrbiwwE8ap6TkfXLCG8U+Y9bF7qf4EmC0u0b/Lkj99b/VlZ5wKO89lwjgzig0LNuF6cOWhp4L121sHnRTiz7JGGrODhi8PwTUBuVxVilZUvwbJlZL8oKtdIHChUzj4RbWku4d+Ffkb2PuMGYEtgGbZx9lDKlETW4t4NkAYSzOonTbVrjF4aKeWYymcj4c4xWJcdGrQDM2g8FOj+u8TsO7p6GX2JJ4wqOICwWrujziBH9EunjaemnGs9id7199Qh/CKHhponEOXMlOGeN/mIknOCsNP5w5JikR2DfRlfq/l7wAS9HjV90upLnh5Ez5yB/CkexRSTuZ8GRfUF1Dm3MXrRiDcIi; 4:p1Xyey538Cw4V9QomxlUx3AYO2NECLlkvJPSlsncrj4Z+lt9arUcsQjAhLW8WyryiaxPz8C1csBkri7hN65VdeoVMfh4cNaWgD9cSzAZ6L/BzOWwDfU0n6mYejfHg7M3PTnGFCeRi6y0chmrC1s+3ICq5kwwHasb7S45ojOeVMPYFoRzfBda+hU2u8/rAPNcUgqIPNKsA2xT8JaHcXY7icC+3wlEKuPvemGN2CjVoDqNee4HjVRy1KANWpcGDVQQzEh2DoiHf08pC6J+xS6QDX9464dRMRWByxUxRZm/2twYb/jMQOeWrpoCS0lIfL6IMlzzX0t70F+nKU9ne85UZoeYFvWiRQETUGJeBqGeQT1MBntmxJMA0K2gwObEjI6r X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(250305191791016)(22074186197030)(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231022)(3002001)(10201501046)(6055026)(6041248)(20161123555025)(20161123562025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011); SRVR:DM5PR12MB1514; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR12MB1514; X-Forefront-PRVS: 05079D8470 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(366004)(346002)(39860400002)(376002)(199003)(189002)(48376002)(16586007)(5890100001)(6666003)(68736007)(86362001)(316002)(575784001)(101416001)(2906002)(50466002)(8676002)(51416003)(6486002)(72206003)(50226002)(16526018)(50986010)(76176010)(53416004)(189998001)(7696005)(52116002)(97736004)(53936002)(6916009)(2351001)(2950100002)(105586002)(66066001)(106356001)(3846002)(25786009)(2361001)(81156014)(5660300001)(36756003)(6116002)(47776003)(305945005)(478600001)(8936002)(7736002)(6306002)(81166006)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1514; H:wallaby-smavila.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR12MB1514; 23:TyZ1p4z//YlwAJJEwfxZNyEy5X+KNvjZYl8TsoiVE?= =?us-ascii?Q?ekViVg81ity+PXTKuTdedsVFBE9ieOebsSXov33x1SoCH/ia41EjYiTu4lKh?= =?us-ascii?Q?BnzmNTPHYEULvdDG9w9qHhUG41PAY65nlb6AKaAsdcs/ejFG7OHGuE5AT61u?= =?us-ascii?Q?NcZxp8mTeY0gSl7uT7RwT5TWHvVIb5CMaYwpZDzvJWJZF1wvUP01l2PXTfu1?= =?us-ascii?Q?zTT7nq/lJ2T+HQibx63m1aH1vRfCwZQpMwRJccdPrfSmXXbKhy9B8bVC+nFX?= =?us-ascii?Q?AomS25HNKHhnmo3w/3ZLC7itu8Bkdiez9X0WIKIBKWRn83xAUQRLJ6YHNLKv?= =?us-ascii?Q?lTJvGCpWS5XVEugrLsTOv4k+A7SEiQNXlaJaQzQ0kHQ3iSDBywltWEu02ogN?= =?us-ascii?Q?3kp5bseqSd9mS9xka+h9QnwDZ6KgH4efJRxxAWdMHEf00CnPSf7nOEmye4LV?= =?us-ascii?Q?n4l5FRKevz+bzEW4ClQWwNfLHICZ10BTmCXdzB6MST6kSx/1N+MPQm6JjE75?= =?us-ascii?Q?WlakWH9/3ZXL9c5RxCzhXRuSzqB2OWLRhYc0cuIdVyAB1hml1CPmlYuFelnJ?= =?us-ascii?Q?4ZnbBkxOeZbkJqQHPSDCkYvmghvlc2wRSRDpJss3euCI8OTrd1X7x1MfQZV3?= =?us-ascii?Q?wQh2FIF7i+3dBRvUD2jtoU2s0y9WwSTskCe6nQhWvFOkVX8I/j7U+wwUSnJ0?= =?us-ascii?Q?U1PzsjpSX+m7a3Yl8MSwmw/10hiyRuE93hBVWy1A863A0PdQKa2lUro5rpRV?= =?us-ascii?Q?NX2dVAq3fp8l/dgoKO3q5felUzLNFRn/UhK9H5OyhOspyCBms3wfUoVXDeDH?= =?us-ascii?Q?kJUUBddWiw8FTVty09p1FG7RCCzOQTckrXSFP7QFRcQplseaIopjS+p60HNu?= =?us-ascii?Q?WPVW/q0DaFilNOQvsYiZuA79i65R8osX61ROeVZgBf/Lp2yOMQjXpibjDBo0?= =?us-ascii?Q?d/mytCR7uIk5XdjW3FChbju6DFzdsQHryW7mwCnjNFGLRyI4Bj+qa13gQLgF?= =?us-ascii?Q?VpkcplmjAHPeIhBYkhtCvoTnCsc4K2Nuy5ZzuYiHiPXWxwL170Hza1gwDi7m?= =?us-ascii?Q?1gjzIhbjRwPqi64dsXvFTjP71kWdNcR3iJqg7o7tLMipzw0cBmL2xEnZIFdq?= =?us-ascii?Q?kLXpaGL2WUrhzD83TK2NkPC6rBHeSf0m84puqfuLf6zk0geaoJRY33+TfTlh?= =?us-ascii?Q?gDYjp2FSsCdNEKuY9r9PDLSixnjedZFltcWNC09s51XU3/Aa19zGUVOrw=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1514; 6:UMRwly1YDgKtjgybUzu5VTRRzbk6v6jkwZmKsNZ5f0S90MLUzoDIz7WEbLTy0UFD+jV/kUNJ1XRomBbmmhqKygfsAFbP+VLzCaJbQxMgL99cLf7LVp3K1CBFNzMR9t2FlcQlQRsFbv6bAkknp6mCWM35vgVPCZoasd27v7rTE22vqtSLofDWp99wMXKlBJOBe1xP7ZhA6dcaH6PsGrJqBYQywDVXDHhPnxCMvq6MaEF2PespV3O7ta0nMgXkdtT/hw3Gnnkz531EV+YKhEIFSYt7cXg7dVkKOv+DoggB+yGjKi9kp3V7L6Hlcz+gelrhtrRpxvhamIS/nYvF9mU93tfllHiYvybL1jVr0eznl4k=; 5:HfNAnGCqTkLZtX6nI8byheyD+ScJ7Q4dQkFY9EGLhtty46K1NMZsxpiYO5tAtiq3Hs9/dzAEMz5hDJwij9V1s1ByjrSc1vNWOiuGFNC22NDM6DBhWxMNxedbElBg3VaDJlaeOisJAZOf64LhQSJCOuT7tBiVMdvs5z5KtjACz9w=; 24:QXOc/nS68pMgaHh85GzQ9/fO2sc0b+ttcC9OODKGKXkUIlZBqlwxx34XOSJeXG6inzkdnN5ujl1wlTkzQ3/jtz/PtIwE+9RZjKXC1sAHAi8=; 7:+Ez4wQQI2KU3dPfMbBqtP+/totHOFuHwIOC3LnFa99RKlgraSIWh4DvxYPPBUuc/X4yv6lhLobRt1BM7bi1/lWPLAveGBw49unFSX9eZebO8SBEAAO/+7PZvGXvebv/svkcxsWQq0V4i6YyRwV79AXV+FQsU+5LsvSPXGpeAI6VwmbsdYv1kCLXa6rcEjcli7F8k+QmLiS1iNU0C9PTtWeeUNnQuQNMnbIe3614VLq2+PRwJQy86D5Ybp5uJ6iOy SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1514; 20:nhmHOUMdBqGwbzLpl0TDVUul0S5t+9/wNVoJSrxY0XjQ9wkjrnHyPNRaw6JIVikkT360luRcDV0leyY6n9G+wSSEer3RWeI2hhhYNX73uHdrmhSrsHWYXg0T/nKlvitgjMFIyuwk4Sos40ZyKHIGS680UUSOvZYZ6nkMF2gyoG7UWyVXB06RmKi7NovjlGhokoWL9SIpglRDbmBfeNtYSXB5h3/oXi05E5O/9baT36QOZiEM15bsGHIjTD6x3uSg X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2017 13:11:43.6716 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 39deaf71-6808-410b-26a4-08d537f3e795 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1514 Subject: [dpdk-dev] [PATCH 03/16] net/axgbe: add phy register map and helper macros 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: , X-List-Received-Date: Thu, 30 Nov 2017 13:11:46 -0000 Signed-off-by: Ravi Kumar --- drivers/net/axgbe/axgbe_phy.h | 314 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 314 insertions(+) create mode 100644 drivers/net/axgbe/axgbe_phy.h diff --git a/drivers/net/axgbe/axgbe_phy.h b/drivers/net/axgbe/axgbe_phy.h new file mode 100644 index 0000000..f7c8a88 --- /dev/null +++ b/drivers/net/axgbe/axgbe_phy.h @@ -0,0 +1,314 @@ +/*- + * Copyright(c) 2017 Advanced Micro Devices, Inc. + * All rights reserved. + * + * AMD 10Gb Ethernet driver + * + * This file is available to you under your choice of the following two + * licenses: + * + * License 1: GPLv2 + * + * Copyright (c) 2017 Advanced Micro Devices, Inc. + * + * This file is free software; you may copy, redistribute and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * This file incorporates work covered by the following copyright and + * permission notice: + * + * Copyright (c) 2013 Synopsys, Inc. + * + * The Synopsys DWC ETHER XGMAC Software Driver and documentation + * (hereinafter "Software") is an unsupported proprietary work of Synopsys, + * Inc. unless otherwise expressly agreed to in writing between Synopsys + * and you. + * + * The Software IS NOT an item of Licensed Software or Licensed Product + * under any End User Software License Agreement or Agreement for Licensed + * Product with Synopsys or any supplement thereto. Permission is hereby + * granted, free of charge, to any person obtaining a copy of this software + * annotated with this license and the Software, to deal in the Software + * without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is furnished + * to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" + * BASIS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + * + * License 2: Modified BSD + * + * Copyright (c) 2017 Advanced Micro Devices, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Advanced Micro Devices, Inc. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * This file incorporates work covered by the following copyright and + * permission notice: + * + * Copyright (c) 2013 Synopsys, Inc. + * + * The Synopsys DWC ETHER XGMAC Software Driver and documentation + * (hereinafter "Software") is an unsupported proprietary work of Synopsys, + * Inc. unless otherwise expressly agreed to in writing between Synopsys + * and you. + * + * The Software IS NOT an item of Licensed Software or Licensed Product + * under any End User Software License Agreement or Agreement for Licensed + * Product with Synopsys or any supplement thereto. Permission is hereby + * granted, free of charge, to any person obtaining a copy of this software + * annotated with this license and the Software, to deal in the Software + * without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is furnished + * to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" + * BASIS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __AXGBE_PHY_H__ +#define __AXGBE_PHY_H__ + +#define SPEED_10 10 +#define SPEED_100 100 +#define SPEED_1000 1000 +#define SPEED_2500 2500 +#define SPEED_10000 10000 + + +/* Or MII_ADDR_C45 into regnum for read/write on mii_bus to enable the 21 bit + * IEEE 802.3ae clause 45 addressing mode used by 10GIGE phy chips. + */ +#define MII_ADDR_C45 (1 << 30) + +/* Basic mode status register. */ +#define BMSR_LSTATUS 0x0004 /* Link status */ + +/* Status register 1. */ +#define MDIO_STAT1_LSTATUS BMSR_LSTATUS + +/* Generic MII registers. */ +#define MII_BMCR 0x00 /* Basic mode control register */ +#define MII_BMSR 0x01 /* Basic mode status register */ +#define MII_PHYSID1 0x02 /* PHYS ID 1 */ +#define MII_PHYSID2 0x03 /* PHYS ID 2 */ +#define MII_ADVERTISE 0x04 /* Advertisement control reg */ +#define MII_LPA 0x05 /* Link partner ability reg */ +#define MII_EXPANSION 0x06 /* Expansion register */ +#define MII_CTRL1000 0x09 /* 1000BASE-T control */ +#define MII_STAT1000 0x0a /* 1000BASE-T status */ +#define MII_MMD_CTRL 0x0d /* MMD Access Control Register */ +#define MII_MMD_DATA 0x0e /* MMD Access Data Register */ +#define MII_ESTATUS 0x0f /* Extended Status */ +#define MII_DCOUNTER 0x12 /* Disconnect counter */ +#define MII_FCSCOUNTER 0x13 /* False carrier counter */ +#define MII_NWAYTEST 0x14 /* N-way auto-neg test reg */ +#define MII_RERRCOUNTER 0x15 /* Receive error counter */ +#define MII_SREVISION 0x16 /* Silicon revision */ +#define MII_RESV1 0x17 /* Reserved... */ +#define MII_LBRERROR 0x18 /* Lpback, rx, bypass error */ +#define MII_PHYADDR 0x19 /* PHY address */ +#define MII_RESV2 0x1a /* Reserved... */ +#define MII_TPISTATUS 0x1b /* TPI status for 10mbps */ +#define MII_NCONFIG 0x1c /* Network interface config */ + +/* Basic mode control register. */ +#define BMCR_RESV 0x003f /* Unused... */ +#define BMCR_SPEED1000 0x0040 /* MSB of Speed (1000) */ +#define BMCR_CTST 0x0080 /* Collision test */ +#define BMCR_FULLDPLX 0x0100 /* Full duplex */ +#define BMCR_ANRESTART 0x0200 /* Auto negotiation restart */ +#define BMCR_ISOLATE 0x0400 /* Isolate data paths from MII */ +#define BMCR_PDOWN 0x0800 /* Enable low power state */ +#define BMCR_ANENABLE 0x1000 /* Enable auto negotiation */ +#define BMCR_SPEED100 0x2000 /* Select 100Mbps */ +#define BMCR_LOOPBACK 0x4000 /* TXD loopback bits */ +#define BMCR_RESET 0x8000 /* Reset to default state */ +#define BMCR_SPEED10 0x0000 /* Select 10Mbps */ + + +/* MDIO Manageable Devices (MMDs). */ +#define MDIO_MMD_PMAPMD 1 /* Physical Medium Attachment + * Physical Medium Dependent + */ +#define MDIO_MMD_WIS 2 /* WAN Interface Sublayer */ +#define MDIO_MMD_PCS 3 /* Physical Coding Sublayer */ +#define MDIO_MMD_PHYXS 4 /* PHY Extender Sublayer */ +#define MDIO_MMD_DTEXS 5 /* DTE Extender Sublayer */ +#define MDIO_MMD_TC 6 /* Transmission Convergence */ +#define MDIO_MMD_AN 7 /* Auto-Negotiation */ +#define MDIO_MMD_C22EXT 29 /* Clause 22 extension */ +#define MDIO_MMD_VEND1 30 /* Vendor specific 1 */ +#define MDIO_MMD_VEND2 31 /* Vendor specific 2 */ + +/* Generic MDIO registers. */ +#define MDIO_CTRL1 MII_BMCR +#define MDIO_STAT1 MII_BMSR +#define MDIO_DEVID1 MII_PHYSID1 +#define MDIO_DEVID2 MII_PHYSID2 +#define MDIO_SPEED 4 /* Speed ability */ +#define MDIO_DEVS1 5 /* Devices in package */ +#define MDIO_DEVS2 6 +#define MDIO_CTRL2 7 /* 10G control 2 */ +#define MDIO_STAT2 8 /* 10G status 2 */ +#define MDIO_PMA_TXDIS 9 /* 10G PMA/PMD transmit disable */ +#define MDIO_PMA_RXDET 10 /* 10G PMA/PMD receive signal detect */ +#define MDIO_PMA_EXTABLE 11 /* 10G PMA/PMD extended ability */ +#define MDIO_PKGID1 14 /* Package identifier */ +#define MDIO_PKGID2 15 +#define MDIO_AN_ADVERTISE 16 /* AN advertising (base page) */ +#define MDIO_AN_LPA 19 /* AN LP abilities (base page) */ +#define MDIO_PCS_EEE_ABLE 20 /* EEE Capability register */ +#define MDIO_PCS_EEE_WK_ERR 22 /* EEE wake error counter */ +#define MDIO_PHYXS_LNSTAT 24 /* PHY XGXS lane state */ +#define MDIO_AN_EEE_ADV 60 /* EEE advertisement */ +#define MDIO_AN_EEE_LPABLE 61 /* EEE link partner ability */ + +/* Media-dependent registers. */ +#define MDIO_PMA_10GBT_SWAPPOL 130 /* 10GBASE-T pair swap & polarity */ +#define MDIO_PMA_10GBT_TXPWR 131 /* 10GBASE-T TX power control */ +#define MDIO_PMA_10GBT_SNR 133 /* 10GBASE-T SNR margin, lane A. + * Lanes B-D are numbered 134-136. + */ +#define MDIO_PMA_10GBR_FECABLE 170 /* 10GBASE-R FEC ability */ +#define MDIO_PCS_10GBX_STAT1 24 /* 10GBASE-X PCS status 1 */ +#define MDIO_PCS_10GBRT_STAT1 32 /* 10GBASE-R/-T PCS status 1 */ +#define MDIO_PCS_10GBRT_STAT2 33 /* 10GBASE-R/-T PCS status 2 */ +#define MDIO_AN_10GBT_CTRL 32 /* 10GBASE-T auto-negotiation control */ +#define MDIO_AN_10GBT_STAT 33 /* 10GBASE-T auto-negotiation status */ + +/* Control register 1. */ +/* Enable extended speed selection */ +#define MDIO_CTRL1_SPEEDSELEXT (BMCR_SPEED1000 | BMCR_SPEED100) +/* All speed selection bits */ +#define MDIO_CTRL1_SPEEDSEL (MDIO_CTRL1_SPEEDSELEXT | 0x003c) +#define MDIO_CTRL1_FULLDPLX BMCR_FULLDPLX +#define MDIO_CTRL1_LPOWER BMCR_PDOWN +#define MDIO_CTRL1_RESET BMCR_RESET +#define MDIO_PMA_CTRL1_LOOPBACK 0x0001 +#define MDIO_PMA_CTRL1_SPEED1000 BMCR_SPEED1000 +#define MDIO_PMA_CTRL1_SPEED100 BMCR_SPEED100 +#define MDIO_PCS_CTRL1_LOOPBACK BMCR_LOOPBACK +#define MDIO_PHYXS_CTRL1_LOOPBACK BMCR_LOOPBACK +#define MDIO_AN_CTRL1_RESTART BMCR_ANRESTART +#define MDIO_AN_CTRL1_ENABLE BMCR_ANENABLE +#define MDIO_AN_CTRL1_XNP 0x2000 /* Enable extended next page */ +#define MDIO_PCS_CTRL1_CLKSTOP_EN 0x400 /* Stop the clock during LPI */ + + + + + +/* PMA 10GBASE-R FEC ability register. */ +#define MDIO_PMA_10GBR_FECABLE_ABLE 0x0001 /* FEC ability */ +#define MDIO_PMA_10GBR_FECABLE_ERRABLE 0x0002 /* FEC error indic. ability */ + + +/* Autoneg related */ +#define ADVERTISED_Autoneg (1 << 6) +#define SUPPORTED_Autoneg (1 << 6) +#define AUTONEG_DISABLE 0x00 +#define AUTONEG_ENABLE 0x01 + +#define ADVERTISED_Pause (1 << 13) +#define ADVERTISED_Asym_Pause (1 << 14) + +#define SUPPORTED_Pause (1 << 13) +#define SUPPORTED_Asym_Pause (1 << 14) + +#define SUPPORTED_Backplane (1 << 16) +#define SUPPORTED_TP (1 << 7) + +#define ADVERTISED_10000baseR_FEC (1 << 20) + +#define SUPPORTED_10000baseR_FEC (1 << 20) + +#define SUPPORTED_FIBRE (1 << 10) + +#define ADVERTISED_10000baseKR_Full (1 << 19) +#define ADVERTISED_10000baseT_Full (1 << 12) +#define ADVERTISED_2500baseX_Full (1 << 15) +#define ADVERTISED_1000baseKX_Full (1 << 17) +#define ADVERTISED_1000baseT_Full (1 << 5) +#define ADVERTISED_100baseT_Full (1 << 3) +#define ADVERTISED_TP (1 << 7) +#define ADVERTISED_FIBRE (1 << 10) +#define ADVERTISED_Backplane (1 << 16) + +#define SUPPORTED_1000baseKX_Full (1 << 17) +#define SUPPORTED_10000baseKR_Full (1 << 19) +#define SUPPORTED_2500baseX_Full (1 << 15) +#define SUPPORTED_100baseT_Full (1 << 2) +#define SUPPORTED_1000baseT_Full (1 << 5) +#define SUPPORTED_10000baseT_Full (1 << 12) +#define SUPPORTED_2500baseX_Full (1 << 15) + + +#define SPEED_UNKNOWN -1 + +/* Duplex, half or full. */ +#define DUPLEX_HALF 0x00 +#define DUPLEX_FULL 0x01 +#define DUPLEX_UNKNOWN 0xff + +#endif +/* PHY */ -- 2.7.4