From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0067.outbound.protection.outlook.com [104.47.36.67]) by dpdk.org (Postfix) with ESMTP id CA9F9D40A for ; Sat, 25 Mar 2017 07:26:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=yIz3nuq5gkVDH8Pk+Au6e0oXV8PGoQyH86cOkZZ+YAI=; b=hX/Apf9pnAooA2eXEzyto/8mstswzYDY9CbrlhabDCScnz7li//4LPzrDCXQ8hmukCJbFPc0PgYuDjQwVgq5ZZAizD6rNAM2x29L1/hjGRk9RoNTrTgSu2Dnl/nZ2bUEHBUoYM0zBv3QtcaKj8vAFtxST7RSqGDfVB1fkDLk0lg= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from lio357.in.caveonetworks.com (14.140.2.178) by CY1PR07MB2280.namprd07.prod.outlook.com (10.164.112.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.977.11; Sat, 25 Mar 2017 06:26:53 +0000 From: Shijith Thotton To: Ferruh Yigit Cc: dev@dpdk.org, Jerin Jacob , Derek Chickles , Venkat Koppula , Srisivasubramanian S , Mallesham Jatharakonda Date: Sat, 25 Mar 2017 11:54:13 +0530 Message-Id: <1490423097-6797-3-git-send-email-shijith.thotton@caviumnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1490423097-6797-1-git-send-email-shijith.thotton@caviumnetworks.com> References: <1488454371-3342-1-git-send-email-shijith.thotton@caviumnetworks.com> <1490423097-6797-1-git-send-email-shijith.thotton@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: BM1PR01CA0117.INDPRD01.PROD.OUTLOOK.COM (10.174.208.33) To CY1PR07MB2280.namprd07.prod.outlook.com (10.164.112.158) X-MS-Office365-Filtering-Correlation-Id: b09833ae-2dd0-41a5-6146-08d47347efac X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR07MB2280; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 3:nnmQ5Z5LduQ/7zAiGewKgPapEytpqCJoDb9xrg7XKfpdneNB+T+nZYe44CfywnAkRadFLFZ2jdAa3NtoLBvKsLISzi9/zkiit3oqx+LJq0nv4U/mZg0BDmm8gb+KlL/WN6m0UoT2Hy1mjBzNilslK6eEL4FAPUCdzcVNA0VYEMac5N5E4vrY99DyqJcmQWhjsZS212YZx9QILBm6y1NJw2hDeK+2YbGcCFxr0BtZ2UbR3HQASMU2j10nHfb8U9HUkrBmVsUu5hLZh4xbxBZ++w==; 25:ctRVXeqOQWpEnMBDR9y9JT7KTPMXEu1ps3Mr2Vaunx5lnxCdaKD2tgtK7K22Un0eCaINKXsMGWVWgdPLkIOLkFEvfkThQJ1uzKwKRJb7/itimD6+dUsmZ2nb3InFW0+5QwuZCVMghWt+YZRcT9LfniHK79A/SxLXpG8sSsUV4sIvQrZJNkz333SrUM2mUVRsAlQIyXKWTKkoEF0UEv5IYelJgv0LgXa9nvSYWpGoGWdq04WcTNk11kJP7Dr4SdoDu2KHlRc7YgCO5tX+ho2CHF8PRCjwO7lJBF4gU7ILcfabFCDEA3S4KHbPtFkJH4Gsy0m87Dm34jaULOy8IwxwtCP+/Yn36fzpP6c3jTI2isJMuV3uCCAEGM27V2ppI/rEVZe1Kdc43SVuH1ycHcnIGoHGVg/JyL54nGbH4TsIPcRjN/sJ9jm1osKQn5MjQPTPX4flMgjCTEU6sk5CCMlgKw== X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 31:cQayTu6S1vYIxG4hFvUEwBjI0glL35NT46/sQoRhm3xm9Ikeil1Os90v2AcfuCCK4MJub085gky6FJ/F6OqCLG7h5k+ugEs94qG02QeD8RGtAiHZ3RLuikYTgoiW8Wx2TViDMkRv6bP2QTURERLKqi3EEKOe417r2poeNmQaC2xx4q/u4omaIgNhGYrpCMc/R0aJCB+z1sCLEtgpEHT7w0gILDs72eu67vXOXs/AbUfdXb/f+xCr/AUuapiOGulc; 20:tecpnp5/wxewmNnmzZoYxxnbcleyiWBw3gOVJl4ednXmrUsOZZn6k9t3OJLWpua06AUFXD789n8aDk1UjE54Em+kqM6Qp57v9vmMe42X2ga9Ee3CAGLucF81EIgai1idqA/wr/vMI+zN52FhMIwGBfH3no9Ci6nH9AWVkd4IQjH2p0zBiJdNVLTfxtFOi9A8XUZpDgB1WVnBeECt7Db+Z67OhsozpmYITV45gR+oPMy5pCb7k7SZLD7TqWwPUHfGoBPOSTeRuGspPxaFxFejSFM1mv7G3dLt876I2gNdznlEi+o20jRzqBPu4TDmT1zQ4bBidAS2GR+TDpAEVSyYz6i/SYxTCjGAk9iru+6z76cgI5+Uqo3Sg9WbV23KHpuVzA+MT/aEA7IGNBf+vk3TDVtByLwe9vA0r3dPMAzuCC5vRjegDz7tLtXq2zRZ1xMJp2rn3mTMgmZ47+9e0odhrD9zZVehvqBBCKmVN7bnCaR04GzZJZ+XBvASX4ag6RGyfOxZydRrA+JHj24x+snVtgS+WBlhze06HIoPTYm76zh4s0fgcOaI9mbHbtCZuWPwJ5nK7zyIExeh9A17GvK8qNY8iLGdRTGjM5Ya1sWgy7Y= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123564025)(20161123560025)(20161123562025)(20161123558025)(20161123555025)(6072148); SRVR:CY1PR07MB2280; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2280; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 4:1Revlgb2+r3MqF1iNZbETKeMf6WmVtHggJEwcLh26T4OudEQGogw30FToqyt7hHkU/ZOMvDULye+gxaI0A07ilTf/MDCQBqQ0nmpeeBEu1MCC46jO46/G+hTEcJeVN57qvxtnOyGhbbuY+PMwk7bkdcZyHjmd816H1C3MH+TRF57Nl72OBYHsEHL9NJbaBWXB8XDzhTy1+Hv25AAKvumBgBLyKiPS2EfXH3m9ZZiWC/7zX4KRlAkB3P1OgA9y+KHitekpQ6LSLHG/ZiJZp8KV23AHzCGvARn5TZ3E2T5l6JkCnKbZoYCg6QQxuXXJukunoYm7DpBY7rOtAUpmCpLd5UB1wNQwKHLPcMv8zArRjSpPRUXboAH0UAk1stlE8/ju5LWDQhuaJNSR3gQliMF0VoZbk8nRWxJzqLf1rud7CS/YXZIO7bgRKCTpuVoQRQMqVQGjIbHSuu7AEqvbJ8FWkWjxTeH7xJ0hle0RuJ51XCabpFzFBk/Zyn9kSNO+ISezpkH+Mi100Nj8FUVU/em1N6aWsypOyHv1ie4d8y5LbHHZNmWepS1ElQ1Bc8VvjruNx5ayyu6Sj8EvcuX3X3c3oqRyxKaUd5Se1gZOhTi2ZE= X-Forefront-PRVS: 025796F161 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39410400002)(39830400002)(2906002)(2950100002)(5003940100001)(66066001)(42882006)(6916009)(50466002)(48376002)(47776003)(42186005)(53936002)(6512007)(68736007)(5009440100003)(54906002)(50226002)(38730400002)(6486002)(6666003)(25786009)(305945005)(81166006)(7736002)(6116002)(3846002)(4326008)(8676002)(6506006)(189998001)(36756003)(50986999)(76176999)(33646002)(4720700003)(5660300001)(110136004)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2280; H:lio357.in.caveonetworks.com; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2280; 23:tlV7GK3lqJzV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280; 7:ExEF3f6wXbS1d7u3DXjny7NDe8QFh10LZ0hUqjzPoEH1EHsSdE3ZWJNJ5DRHHae+oQKa7f328ZV3UekMNoblSghJjFIOLn/CNJ5CjiwjJXFyTRQbrc2RRjtm03yP9JrhC1RXORbgTr2PYXNdmatQheaxxXYicTBbllsyaQQ/TQl5zAqNNW74iTuxlsRjyjlQbV5hvY/QRAbHATzEKnKk8yUr2R6kpQnPey5sQ35VJ9+3zfMbC19xVWaIxNDVpAqb2bEXOXQSyQN2sWSt6MSS8A23N8OfJ82L7bEWR0u9b+zNCEXNjZP9md4llLvJCtC+AVzIjhrvWBSH6LJ3V2kCoQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2017 06:26:53.6492 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2280 Subject: [dpdk-dev] [PATCH v3 02/46] net/liquidio/base: hardware register definitions 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: Sat, 25 Mar 2017 06:26:59 -0000 Add HW register definitions for LiquidIO II CN23XX adapter. Signed-off-by: Shijith Thotton Signed-off-by: Jerin Jacob Signed-off-by: Derek Chickles Signed-off-by: Venkat Koppula Signed-off-by: Srisivasubramanian S Signed-off-by: Mallesham Jatharakonda --- drivers/net/liquidio/base/lio_23xx_reg.h | 194 +++++++++++++++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 drivers/net/liquidio/base/lio_23xx_reg.h diff --git a/drivers/net/liquidio/base/lio_23xx_reg.h b/drivers/net/liquidio/base/lio_23xx_reg.h new file mode 100644 index 0000000..794bc2c --- /dev/null +++ b/drivers/net/liquidio/base/lio_23xx_reg.h @@ -0,0 +1,194 @@ +/* + * BSD LICENSE + * + * Copyright(c) 2017 Cavium, Inc.. All rights reserved. + * 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 Cavium, 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 THE COPYRIGHT + * OWNER(S) OR CONTRIBUTORS 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 _LIO_23XX_REG_H_ +#define _LIO_23XX_REG_H_ + +/* ###################### REQUEST QUEUE ######################### */ + +/* 64 registers for Input Queues Start Addr - SLI_PKT(0..63)_INSTR_BADDR */ +#define CN23XX_SLI_PKT_INSTR_BADDR_START64 0x10010 + +/* 64 registers for Input Doorbell - SLI_PKT(0..63)_INSTR_BAOFF_DBELL */ +#define CN23XX_SLI_PKT_INSTR_BADDR_DBELL_START 0x10020 + +/* 64 registers for Input Queue size - SLI_PKT(0..63)_INSTR_FIFO_RSIZE */ +#define CN23XX_SLI_PKT_INSTR_FIFO_RSIZE_START 0x10030 + +/* 64 registers for Input Queue Instr Count - SLI_PKT_IN_DONE(0..63)_CNTS */ +#define CN23XX_SLI_PKT_IN_DONE_CNTS_START64 0x10040 + +/* 64 registers (64-bit) - ES, RO, NS, Arbitration for Input Queue Data & + * gather list fetches. SLI_PKT(0..63)_INPUT_CONTROL. + */ +#define CN23XX_SLI_PKT_INPUT_CONTROL_START64 0x10000 + +/* ------- Request Queue Macros --------- */ + +/* Each Input Queue register is at a 16-byte Offset in BAR0 */ +#define CN23XX_IQ_OFFSET 0x20000 + +#define CN23XX_SLI_IQ_PKT_CONTROL64(iq) \ + (CN23XX_SLI_PKT_INPUT_CONTROL_START64 + ((iq) * CN23XX_IQ_OFFSET)) + +#define CN23XX_SLI_IQ_BASE_ADDR64(iq) \ + (CN23XX_SLI_PKT_INSTR_BADDR_START64 + ((iq) * CN23XX_IQ_OFFSET)) + +#define CN23XX_SLI_IQ_SIZE(iq) \ + (CN23XX_SLI_PKT_INSTR_FIFO_RSIZE_START + ((iq) * CN23XX_IQ_OFFSET)) + +#define CN23XX_SLI_IQ_DOORBELL(iq) \ + (CN23XX_SLI_PKT_INSTR_BADDR_DBELL_START + ((iq) * CN23XX_IQ_OFFSET)) + +#define CN23XX_SLI_IQ_INSTR_COUNT64(iq) \ + (CN23XX_SLI_PKT_IN_DONE_CNTS_START64 + ((iq) * CN23XX_IQ_OFFSET)) + +/* Number of instructions to be read in one MAC read request. + * setting to Max value(4) + */ +#define CN23XX_PKT_INPUT_CTL_RDSIZE (3 << 25) +#define CN23XX_PKT_INPUT_CTL_IS_64B (1 << 24) +#define CN23XX_PKT_INPUT_CTL_RST (1 << 23) +#define CN23XX_PKT_INPUT_CTL_QUIET (1 << 28) +#define CN23XX_PKT_INPUT_CTL_RING_ENB (1 << 22) +#define CN23XX_PKT_INPUT_CTL_DATA_ES_64B_SWAP (1 << 6) +#define CN23XX_PKT_INPUT_CTL_USE_CSR (1 << 4) +#define CN23XX_PKT_INPUT_CTL_GATHER_ES_64B_SWAP (2) + +/* These bits[47:44] select the Physical function number within the MAC */ +#define CN23XX_PKT_INPUT_CTL_PF_NUM_POS 45 +/* These bits[43:32] select the function number within the PF */ +#define CN23XX_PKT_INPUT_CTL_VF_NUM_POS 32 + +#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN +#define CN23XX_PKT_INPUT_CTL_MASK \ + (CN23XX_PKT_INPUT_CTL_RDSIZE | \ + CN23XX_PKT_INPUT_CTL_DATA_ES_64B_SWAP | \ + CN23XX_PKT_INPUT_CTL_USE_CSR) +#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN +#define CN23XX_PKT_INPUT_CTL_MASK \ + (CN23XX_PKT_INPUT_CTL_RDSIZE | \ + CN23XX_PKT_INPUT_CTL_DATA_ES_64B_SWAP | \ + CN23XX_PKT_INPUT_CTL_USE_CSR | \ + CN23XX_PKT_INPUT_CTL_GATHER_ES_64B_SWAP) +#endif + +/* ############################ OUTPUT QUEUE ######################### */ + +/* 64 registers for Output queue control - SLI_PKT(0..63)_OUTPUT_CONTROL */ +#define CN23XX_SLI_PKT_OUTPUT_CONTROL_START 0x10050 + +/* 64 registers for Output queue buffer and info size + * SLI_PKT(0..63)_OUT_SIZE + */ +#define CN23XX_SLI_PKT_OUT_SIZE 0x10060 + +/* 64 registers for Output Queue Start Addr - SLI_PKT(0..63)_SLIST_BADDR */ +#define CN23XX_SLI_SLIST_BADDR_START64 0x10070 + +/* 64 registers for Output Queue Packet Credits + * SLI_PKT(0..63)_SLIST_BAOFF_DBELL + */ +#define CN23XX_SLI_PKT_SLIST_BAOFF_DBELL_START 0x10080 + +/* 64 registers for Output Queue size - SLI_PKT(0..63)_SLIST_FIFO_RSIZE */ +#define CN23XX_SLI_PKT_SLIST_FIFO_RSIZE_START 0x10090 + +/* 64 registers for Output Queue Packet Count - SLI_PKT(0..63)_CNTS */ +#define CN23XX_SLI_PKT_CNTS_START 0x100B0 + +/* Each Output Queue register is at a 16-byte Offset in BAR0 */ +#define CN23XX_OQ_OFFSET 0x20000 + +/* ------- Output Queue Macros --------- */ + +#define CN23XX_SLI_OQ_PKT_CONTROL(oq) \ + (CN23XX_SLI_PKT_OUTPUT_CONTROL_START + ((oq) * CN23XX_OQ_OFFSET)) + +#define CN23XX_SLI_OQ_BASE_ADDR64(oq) \ + (CN23XX_SLI_SLIST_BADDR_START64 + ((oq) * CN23XX_OQ_OFFSET)) + +#define CN23XX_SLI_OQ_SIZE(oq) \ + (CN23XX_SLI_PKT_SLIST_FIFO_RSIZE_START + ((oq) * CN23XX_OQ_OFFSET)) + +#define CN23XX_SLI_OQ_BUFF_INFO_SIZE(oq) \ + (CN23XX_SLI_PKT_OUT_SIZE + ((oq) * CN23XX_OQ_OFFSET)) + +#define CN23XX_SLI_OQ_PKTS_SENT(oq) \ + (CN23XX_SLI_PKT_CNTS_START + ((oq) * CN23XX_OQ_OFFSET)) + +#define CN23XX_SLI_OQ_PKTS_CREDIT(oq) \ + (CN23XX_SLI_PKT_SLIST_BAOFF_DBELL_START + ((oq) * CN23XX_OQ_OFFSET)) + +/* ------------------ Masks ---------------- */ +#define CN23XX_PKT_OUTPUT_CTL_IPTR (1 << 11) +#define CN23XX_PKT_OUTPUT_CTL_ES (1 << 9) +#define CN23XX_PKT_OUTPUT_CTL_NSR (1 << 8) +#define CN23XX_PKT_OUTPUT_CTL_ROR (1 << 7) +#define CN23XX_PKT_OUTPUT_CTL_DPTR (1 << 6) +#define CN23XX_PKT_OUTPUT_CTL_BMODE (1 << 5) +#define CN23XX_PKT_OUTPUT_CTL_ES_P (1 << 3) +#define CN23XX_PKT_OUTPUT_CTL_NSR_P (1 << 2) +#define CN23XX_PKT_OUTPUT_CTL_ROR_P (1 << 1) +#define CN23XX_PKT_OUTPUT_CTL_RING_ENB (1 << 0) + +/* Rings per Virtual Function [RO] */ +#define CN23XX_PKT_INPUT_CTL_RPVF_MASK 0x3F +#define CN23XX_PKT_INPUT_CTL_RPVF_POS 48 + +/* These bits[47:44][RO] give the Physical function + * number info within the MAC + */ +#define CN23XX_PKT_INPUT_CTL_PF_NUM_MASK 0x7 + +/* These bits[43:32][RO] give the virtual function + * number info within the PF + */ +#define CN23XX_PKT_INPUT_CTL_VF_NUM_MASK 0x1FFF + +/* ######################### Mailbox Reg Macros ######################## */ +#define CN23XX_SLI_PKT_PF_VF_MBOX_SIG_START 0x10200 +#define CN23XX_VF_SLI_PKT_MBOX_INT_START 0x10210 + +#define CN23XX_SLI_MBOX_OFFSET 0x20000 +#define CN23XX_SLI_MBOX_SIG_IDX_OFFSET 0x8 + +#define CN23XX_SLI_PKT_PF_VF_MBOX_SIG(q, idx) \ + (CN23XX_SLI_PKT_PF_VF_MBOX_SIG_START + \ + ((q) * CN23XX_SLI_MBOX_OFFSET + \ + (idx) * CN23XX_SLI_MBOX_SIG_IDX_OFFSET)) + +#define CN23XX_VF_SLI_PKT_MBOX_INT(q) \ + (CN23XX_VF_SLI_PKT_MBOX_INT_START + ((q) * CN23XX_SLI_MBOX_OFFSET)) + +#endif /* _LIO_23XX_REG_H_ */ -- 1.8.3.1