From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0045.outbound.protection.outlook.com [104.47.32.45]) by dpdk.org (Postfix) with ESMTP id 755F658EC for ; Tue, 21 Feb 2017 10:27:52 +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=h+B+dxpD3f2AekCA02a3nuB8ULezJeUkfBeVGWVD6n8=; b=mgv/wYITEhWd9EAJ7wBpIOafa2az2uId21SrdgOBPe8ETwUKyngIH2ciCSVOvDK7cd57xiDsxxESZw4cKaSNoHQxYD4MhHyIS9Pm/MS8DlPm7F3CIYCUc3LDY1/8vtu6e9eh7HERIFfy07mbks34ER+PD1sRJj11CxBq5hX77xc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Shijith.Thotton@cavium.com; Received: from lio357.in.caveonetworks.com (14.140.2.178) by SN1PR07MB2285.namprd07.prod.outlook.com (10.164.47.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.919.13; Tue, 21 Feb 2017 09:27:48 +0000 From: Shijith Thotton To: dev@dpdk.org Cc: Jerin Jacob , Derek Chickles , Venkat Koppula , Mallesham Jatharakonda Date: Tue, 21 Feb 2017 14:56:16 +0530 Message-Id: <1487669225-30091-2-git-send-email-shijith.thotton@caviumnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1487669225-30091-1-git-send-email-shijith.thotton@caviumnetworks.com> References: <1487669225-30091-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: MA1PR01CA0089.INDPRD01.PROD.OUTLOOK.COM (10.174.56.29) To SN1PR07MB2285.namprd07.prod.outlook.com (10.164.47.155) X-MS-Office365-Filtering-Correlation-Id: b9f2fb04-e31a-44f3-0c0b-08d45a3be7e7 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:SN1PR07MB2285; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 3:wh+7olK8+n9xKmZm6VhCT35CJryEtRVPsgYxtD3PWmX3O+u1XO91cx7MMVnjchqw52bCo4QrTgX+8FtX9DB/Q3vYoB8p9J/anZ/yz68wl2uGTfeZv+wRsa5N9/U+8jW1MXDlon8Xxk6vKNLgkbxz7hS3FU7YIThL5j6Joo23Q3/OTgLJurxHV0I10afCCgP4XdvDqHioaB3bXKz6ZAYlztIMy8jyJj1mXkyYd2+77jAgEf/KS/4wKEwSQsq2cKHnhOAlXwOxSMvMN4NaQvZloA==; 25:61T33OoX+R1nA+/4muSqmx1BWwLNznqitqcVbgOoG1KNGmS1BEGAIoNlALJV7BR4aOrcgNYB14WefMtYabvqZtIqTTXgFeC0imahUXYLvkU72Za4/qdlKfmEtbATVHqxeMk5bFmBF2Z5rT9/oDdLnNnODBqVn9yhnE7gSL5OBA8soVbpDUN6Utvo2H4dp9qbQWuJwWPI01vsFmcmrEAqoCFkv8IOTTFWT2uNAa0yB01STdwX/2qgDpm5S7jKGp539N0tO7iUbCwW6fWZvLkQNNlC3nXz4/CBcil5fJ+Y7JNV5s0neXWt1E6Q95ASJTkAhmPriZoMt57zhinEu1k57nTDNjggTp8yncg/W6M0f+Ta8ubb1luEswMxoNHQoJzsFCaJXqe9+kT7g4o2xzx4S7o6cIDQ3X9nve/V4X9OWntKwHkrNoOzs/CcRlUBov0RpeKdCJjkFvnWbGW5CvzX2Q== X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 31:vzRQRtmovGd32baYJbTBzYtxwI+x2fQgi9JnEERNR2zu36GmLbRoxWoVlsEoA7Ec3cUIF1DkRHnlcMiHXdCdCy0zVaBE0MkEmVmNnD7RcmP02ipHcK3sgW/H8ldjWjjFj1jgEXOLTou4VPis8XRQMd6Mfmgb6X7JMEevHqy/cIFnVUL2w1EEUl5RMiiu77yF7lFbgkgK4cakaDXVweMHL8fMdeNul0YFKrsbUBJz18XeMujov5WLb+1VI/nLrXNA; 20:FTy9DDG+2C27ZBBZF6c7WDOeZUG7BZt3rJmYR8KwoE2hEvFaflMQUPMxb7BOvHEnUulD0PctcFIMi1YXGakxKeIb3aKstr1wa9XIIOwUCrFq2lPYk561M6j8yhQmTf5F0TkLQLGeN8JYgBj1ja+aF3fsvNZC7xHXxXOnRAq+d4TeVdpZYjeDB5u4EYOkGpyEdaCucmvH+nyLm4uHHpNrBt0l3zN0AJccT0FiEpjkwI+EE/zGEzk1CFRwZ82VJK3RMhRsVVXUtRLiK4zVVGKypXg2iGO/F/uJGfagqdJlgQs/L5fH8o1a30yHt7JMazMQjhNEUqUpH5Xh8lFhpcwbadizlPp3rRUapTwV3KpMH2/+r89vHmN2klZbMTdVbrURKBKKq/cHr81c9sYiOfFJAEt/zkha/powlXpiktolJIPNt/GbB9EfR9tSECephHUVgxaHvd+U2iuzdmJT0QFVWxkx1NY9UbScGLymWQUjP/X0zwSuzJmvqhz1tsGum/dBvIpYoCsyUWs6aevkBWxpsTirAFdBobqEgUkB2zelwWfy5GUYA6iRt/qMHdsiX4CtR9gXgtEZyz+qbLWff1fMNiTup2U51QUcor1JDQTTtfw= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123555025)(20161123564025)(20161123562025)(20161123560025)(20161123558025)(6072148); SRVR:SN1PR07MB2285; BCL:0; PCL:0; RULEID:; SRVR:SN1PR07MB2285; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 4:he38bttxkWAJCUOtOOG2P3NWAFtiVb/obXE4cFVGmqhpuIiJ/9qxakhUMRG//OtGBcPqhEyOBBWedY4662h36O0GQUSL/iJbWZlA1oOP0A103hxBHMxE0mGeHm8Srw/dxW1LwVFbmtxAjroPGJaAyGDMQx08LNqG6zN9JCdsS8F2KLUDkGg2TNMVa7G1P9kD0LPswtmsNMz1MHfbukKTATKU1FwoMykP4zjT9nJS3u9Ypx7hlLij+xVDnpDxDnwPFJ86lCfjv2zr05C+wDpFuGfnVuwyW5keKwqwzudRUAsKvKOogmkH7M8vmEcmNicbn3SmrgtS4x2x3JNi+rirORxIudW+uFiBdw4UuXs2SWWAX14ArA9SDnKgKlfx3sCsySdb4fZrw0XAnf8+RW7PI8CBBHcdbZyNQlL9E0s9iWFAQr9u+TGvnt2wMUYcHO5IdWUDn0HMpkX8DisP/uxG1uFQ0MSiKE5gbVb3YiggoWjNRv0mdpvK9Sox6B4Db9UofHRMnDBpILBguCeAbv2daZRiJNHEd/nPB/72mfa9X/tM9EfjB9MWreuAxsX0MEqFs1yty0wAr2gs6WhJZXDfdQMGc9MC8hxXiqckPzcRLCc= X-Forefront-PRVS: 0225B0D5BC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(39410400002)(39830400002)(189002)(199003)(50226002)(81166006)(42186005)(2361001)(101416001)(81156014)(305945005)(3846002)(6116002)(5009440100003)(8676002)(105586002)(7736002)(53936002)(36756003)(110136004)(106356001)(6506006)(25786008)(38730400002)(2351001)(92566002)(48376002)(6486002)(97736004)(50466002)(5003940100001)(189998001)(68736007)(2906002)(4326007)(33646002)(76176999)(54906002)(5660300001)(6666003)(6916009)(50986999)(2950100002)(6512007)(4720700003)(42882006)(66066001)(47776003)(7099028)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR07MB2285; H:lio357.in.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR07MB2285; 23:1D1Fl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HCSFK82hqVeVmRgsl6Z0iLVGa2tAZhBDHF7Qk73Ym7nX0nyIT/j6XZ/wQh3X+f+XdRMX5CxMeB3pMsuvA==; 24:9rNbOvbv+gbdpezzNdxzWsP0Ky5mf5vg4kQ9gZO3w7P8d9vQ0MozSnczr2VlIbUz0u1FjmGBFXdA2Sv3QppjCiCDWhwYYDh6h/YejnONYBg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 7:W8dPrSLAxwhlpSFQMZiZjKXXK920wu5eH8hgYGarMZ3iZfhPxIJQUxHFGHxkcJ6lOMNa0xCtxkwb9svnEHMZyzRBqwCcYWVotxsa3iYPFikdQ5i+5Wdh36LnrXNTy6BtKxPtfbVCN/pcPIQe0Jg9OblqUEJbVFDrim91rhpPkNyTZahcPk65BX6wD1MhrsHCkEhskqlFq6eRefODAfOWuzlrs0dugWGUvf/ZDt3gSbAZfWsKiryEm2iuQd3z5mDkVGUECxTxfhdvPcFI+NM9lknyYFokp6y/elVeYawl3Jio4+OYtzHgGL/NABj+DJrb0kTVhiRzN8zEyf67EX5ePw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2017 09:27:48.3987 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR07MB2285 Subject: [dpdk-dev] [PATCH 01/50] 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: Tue, 21 Feb 2017 09:27:52 -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: 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