1*f612b815SHariprasad Shenai /* 2*f612b815SHariprasad Shenai * This file is part of the Chelsio T4 Ethernet driver for Linux. 3*f612b815SHariprasad Shenai * 4*f612b815SHariprasad Shenai * Copyright (c) 2003-2014 Chelsio Communications, Inc. All rights reserved. 5*f612b815SHariprasad Shenai * 6*f612b815SHariprasad Shenai * This software is available to you under a choice of one of two 7*f612b815SHariprasad Shenai * licenses. You may choose to be licensed under the terms of the GNU 8*f612b815SHariprasad Shenai * General Public License (GPL) Version 2, available from the file 9*f612b815SHariprasad Shenai * COPYING in the main directory of this source tree, or the 10*f612b815SHariprasad Shenai * OpenIB.org BSD license below: 11*f612b815SHariprasad Shenai * 12*f612b815SHariprasad Shenai * Redistribution and use in source and binary forms, with or 13*f612b815SHariprasad Shenai * without modification, are permitted provided that the following 14*f612b815SHariprasad Shenai * conditions are met: 15*f612b815SHariprasad Shenai * 16*f612b815SHariprasad Shenai * - Redistributions of source code must retain the above 17*f612b815SHariprasad Shenai * copyright notice, this list of conditions and the following 18*f612b815SHariprasad Shenai * disclaimer. 19*f612b815SHariprasad Shenai * 20*f612b815SHariprasad Shenai * - Redistributions in binary form must reproduce the above 21*f612b815SHariprasad Shenai * copyright notice, this list of conditions and the following 22*f612b815SHariprasad Shenai * disclaimer in the documentation and/or other materials 23*f612b815SHariprasad Shenai * provided with the distribution. 24*f612b815SHariprasad Shenai * 25*f612b815SHariprasad Shenai * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 26*f612b815SHariprasad Shenai * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 27*f612b815SHariprasad Shenai * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 28*f612b815SHariprasad Shenai * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 29*f612b815SHariprasad Shenai * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 30*f612b815SHariprasad Shenai * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 31*f612b815SHariprasad Shenai * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 32*f612b815SHariprasad Shenai * SOFTWARE. 33*f612b815SHariprasad Shenai */ 34*f612b815SHariprasad Shenai 35*f612b815SHariprasad Shenai #ifndef __T4_VALUES_H__ 36*f612b815SHariprasad Shenai #define __T4_VALUES_H__ 37*f612b815SHariprasad Shenai 38*f612b815SHariprasad Shenai /* This file contains definitions for various T4 register value hardware 39*f612b815SHariprasad Shenai * constants. The types of values encoded here are predominantly those for 40*f612b815SHariprasad Shenai * register fields which control "modal" behavior. For the most part, we do 41*f612b815SHariprasad Shenai * not include definitions for register fields which are simple numeric 42*f612b815SHariprasad Shenai * metrics, etc. 43*f612b815SHariprasad Shenai */ 44*f612b815SHariprasad Shenai 45*f612b815SHariprasad Shenai /* SGE register field values. 46*f612b815SHariprasad Shenai */ 47*f612b815SHariprasad Shenai 48*f612b815SHariprasad Shenai /* CONTROL1 register */ 49*f612b815SHariprasad Shenai #define RXPKTCPLMODE_SPLIT_X 1 50*f612b815SHariprasad Shenai 51*f612b815SHariprasad Shenai #define INGPCIEBOUNDARY_SHIFT_X 5 52*f612b815SHariprasad Shenai #define INGPCIEBOUNDARY_32B_X 0 53*f612b815SHariprasad Shenai 54*f612b815SHariprasad Shenai #define INGPADBOUNDARY_SHIFT_X 5 55*f612b815SHariprasad Shenai 56*f612b815SHariprasad Shenai /* CONTROL2 register */ 57*f612b815SHariprasad Shenai #define INGPACKBOUNDARY_SHIFT_X 5 58*f612b815SHariprasad Shenai #define INGPACKBOUNDARY_16B_X 0 59*f612b815SHariprasad Shenai 60*f612b815SHariprasad Shenai /* GTS register */ 61*f612b815SHariprasad Shenai #define SGE_TIMERREGS 6 62*f612b815SHariprasad Shenai 63*f612b815SHariprasad Shenai /* T5 and later support a new BAR2-based doorbell mechanism for Egress Queues. 64*f612b815SHariprasad Shenai * The User Doorbells are each 128 bytes in length with a Simple Doorbell at 65*f612b815SHariprasad Shenai * offsets 8x and a Write Combining single 64-byte Egress Queue Unit 66*f612b815SHariprasad Shenai * (IDXSIZE_UNIT_X) Gather Buffer interface at offset 64. For Ingress Queues, 67*f612b815SHariprasad Shenai * we have a Going To Sleep register at offsets 8x+4. 68*f612b815SHariprasad Shenai * 69*f612b815SHariprasad Shenai * As noted above, we have many instances of the Simple Doorbell and Going To 70*f612b815SHariprasad Shenai * Sleep registers at offsets 8x and 8x+4, respectively. We want to use a 71*f612b815SHariprasad Shenai * non-64-byte aligned offset for the Simple Doorbell in order to attempt to 72*f612b815SHariprasad Shenai * avoid buffering of the writes to the Simple Doorbell and we want to use a 73*f612b815SHariprasad Shenai * non-contiguous offset for the Going To Sleep writes in order to avoid 74*f612b815SHariprasad Shenai * possible combining between them. 75*f612b815SHariprasad Shenai */ 76*f612b815SHariprasad Shenai #define SGE_UDB_SIZE 128 77*f612b815SHariprasad Shenai #define SGE_UDB_KDOORBELL 8 78*f612b815SHariprasad Shenai #define SGE_UDB_GTS 20 79*f612b815SHariprasad Shenai #define SGE_UDB_WCDOORBELL 64 80*f612b815SHariprasad Shenai 81*f612b815SHariprasad Shenai #endif /* __T4_VALUES_H__ */ 82