1*3c838a9fSAndrew Rybchenko /*- 2*3c838a9fSAndrew Rybchenko * Copyright (c) 2012-2015 Solarflare Communications Inc. 3*3c838a9fSAndrew Rybchenko * All rights reserved. 4*3c838a9fSAndrew Rybchenko * 5*3c838a9fSAndrew Rybchenko * Redistribution and use in source and binary forms, with or without 6*3c838a9fSAndrew Rybchenko * modification, are permitted provided that the following conditions are met: 7*3c838a9fSAndrew Rybchenko * 8*3c838a9fSAndrew Rybchenko * 1. Redistributions of source code must retain the above copyright notice, 9*3c838a9fSAndrew Rybchenko * this list of conditions and the following disclaimer. 10*3c838a9fSAndrew Rybchenko * 2. Redistributions in binary form must reproduce the above copyright notice, 11*3c838a9fSAndrew Rybchenko * this list of conditions and the following disclaimer in the documentation 12*3c838a9fSAndrew Rybchenko * and/or other materials provided with the distribution. 13*3c838a9fSAndrew Rybchenko * 14*3c838a9fSAndrew Rybchenko * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15*3c838a9fSAndrew Rybchenko * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 16*3c838a9fSAndrew Rybchenko * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 17*3c838a9fSAndrew Rybchenko * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 18*3c838a9fSAndrew Rybchenko * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 19*3c838a9fSAndrew Rybchenko * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 20*3c838a9fSAndrew Rybchenko * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 21*3c838a9fSAndrew Rybchenko * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22*3c838a9fSAndrew Rybchenko * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 23*3c838a9fSAndrew Rybchenko * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 24*3c838a9fSAndrew Rybchenko * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25*3c838a9fSAndrew Rybchenko * 26*3c838a9fSAndrew Rybchenko * The views and conclusions contained in the software and documentation are 27*3c838a9fSAndrew Rybchenko * those of the authors and should not be interpreted as representing official 28*3c838a9fSAndrew Rybchenko * policies, either expressed or implied, of the FreeBSD Project. 29*3c838a9fSAndrew Rybchenko * 30*3c838a9fSAndrew Rybchenko * $FreeBSD$ 31*3c838a9fSAndrew Rybchenko */ 32*3c838a9fSAndrew Rybchenko 33*3c838a9fSAndrew Rybchenko /* These structures define the layouts for the TLV items stored in static and 34*3c838a9fSAndrew Rybchenko * dynamic configuration partitions in NVRAM for EF10 (Huntington etc.). 35*3c838a9fSAndrew Rybchenko * 36*3c838a9fSAndrew Rybchenko * They contain the same sort of information that was kept in the 37*3c838a9fSAndrew Rybchenko * siena_mc_static_config_hdr_t and siena_mc_dynamic_config_hdr_t structures 38*3c838a9fSAndrew Rybchenko * (defined in <ci/mgmt/mc_flash_layout.h> and <ci/mgmt/mc_dynamic_cfg.h>) for 39*3c838a9fSAndrew Rybchenko * Siena. 40*3c838a9fSAndrew Rybchenko * 41*3c838a9fSAndrew Rybchenko * These are used directly by the MC and should also be usable directly on host 42*3c838a9fSAndrew Rybchenko * systems which are little-endian and do not do strange things with structure 43*3c838a9fSAndrew Rybchenko * padding. (Big-endian host systems will require some byte-swapping.) 44*3c838a9fSAndrew Rybchenko * 45*3c838a9fSAndrew Rybchenko * ----- 46*3c838a9fSAndrew Rybchenko * 47*3c838a9fSAndrew Rybchenko * Please refer to SF-108797-SW for a general overview of the TLV partition 48*3c838a9fSAndrew Rybchenko * format. 49*3c838a9fSAndrew Rybchenko * 50*3c838a9fSAndrew Rybchenko * ----- 51*3c838a9fSAndrew Rybchenko * 52*3c838a9fSAndrew Rybchenko * The current tag IDs have a general structure: with the exception of the 53*3c838a9fSAndrew Rybchenko * special values defined in the document, they are of the form 0xLTTTNNNN, 54*3c838a9fSAndrew Rybchenko * where: 55*3c838a9fSAndrew Rybchenko * 56*3c838a9fSAndrew Rybchenko * - L is a location, indicating where this tag is expected to be found: 57*3c838a9fSAndrew Rybchenko * 0 for static configuration, or 1 for dynamic configuration. Other 58*3c838a9fSAndrew Rybchenko * values are reserved. 59*3c838a9fSAndrew Rybchenko * 60*3c838a9fSAndrew Rybchenko * - TTT is a type, which is just a unique value. The same type value 61*3c838a9fSAndrew Rybchenko * might appear in both locations, indicating a relationship between 62*3c838a9fSAndrew Rybchenko * the items (e.g. static and dynamic VPD below). 63*3c838a9fSAndrew Rybchenko * 64*3c838a9fSAndrew Rybchenko * - NNNN is an index of some form. Some item types are per-port, some 65*3c838a9fSAndrew Rybchenko * are per-PF, some are per-partition-type. 66*3c838a9fSAndrew Rybchenko * 67*3c838a9fSAndrew Rybchenko * ----- 68*3c838a9fSAndrew Rybchenko * 69*3c838a9fSAndrew Rybchenko * As with the previous Siena structures, each structure here is laid out 70*3c838a9fSAndrew Rybchenko * carefully: values are aligned to their natural boundary, with explicit 71*3c838a9fSAndrew Rybchenko * padding fields added where necessary. (No, technically this does not 72*3c838a9fSAndrew Rybchenko * absolutely guarantee portability. But, in practice, compilers are generally 73*3c838a9fSAndrew Rybchenko * sensible enough not to introduce completely pointless padding, and it works 74*3c838a9fSAndrew Rybchenko * well enough.) 75*3c838a9fSAndrew Rybchenko */ 76*3c838a9fSAndrew Rybchenko 77*3c838a9fSAndrew Rybchenko 78*3c838a9fSAndrew Rybchenko #ifndef CI_MGMT_TLV_LAYOUT_H 79*3c838a9fSAndrew Rybchenko #define CI_MGMT_TLV_LAYOUT_H 80*3c838a9fSAndrew Rybchenko 81*3c838a9fSAndrew Rybchenko 82*3c838a9fSAndrew Rybchenko /* ---------------------------------------------------------------------------- 83*3c838a9fSAndrew Rybchenko * General structure (defined by SF-108797-SW) 84*3c838a9fSAndrew Rybchenko * ---------------------------------------------------------------------------- 85*3c838a9fSAndrew Rybchenko */ 86*3c838a9fSAndrew Rybchenko 87*3c838a9fSAndrew Rybchenko 88*3c838a9fSAndrew Rybchenko /* The "end" tag. 89*3c838a9fSAndrew Rybchenko * 90*3c838a9fSAndrew Rybchenko * (Note that this is *not* followed by length or value fields: anything after 91*3c838a9fSAndrew Rybchenko * the tag itself is irrelevant.) 92*3c838a9fSAndrew Rybchenko */ 93*3c838a9fSAndrew Rybchenko 94*3c838a9fSAndrew Rybchenko #define TLV_TAG_END (0xEEEEEEEE) 95*3c838a9fSAndrew Rybchenko 96*3c838a9fSAndrew Rybchenko 97*3c838a9fSAndrew Rybchenko /* Other special reserved tag values. 98*3c838a9fSAndrew Rybchenko */ 99*3c838a9fSAndrew Rybchenko 100*3c838a9fSAndrew Rybchenko #define TLV_TAG_SKIP (0x00000000) 101*3c838a9fSAndrew Rybchenko #define TLV_TAG_INVALID (0xFFFFFFFF) 102*3c838a9fSAndrew Rybchenko 103*3c838a9fSAndrew Rybchenko 104*3c838a9fSAndrew Rybchenko /* TLV partition header. 105*3c838a9fSAndrew Rybchenko * 106*3c838a9fSAndrew Rybchenko * In a TLV partition, this must be the first item in the sequence, at offset 107*3c838a9fSAndrew Rybchenko * 0. 108*3c838a9fSAndrew Rybchenko */ 109*3c838a9fSAndrew Rybchenko 110*3c838a9fSAndrew Rybchenko #define TLV_TAG_PARTITION_HEADER (0xEF10DA7A) 111*3c838a9fSAndrew Rybchenko 112*3c838a9fSAndrew Rybchenko struct tlv_partition_header { 113*3c838a9fSAndrew Rybchenko uint32_t tag; 114*3c838a9fSAndrew Rybchenko uint32_t length; 115*3c838a9fSAndrew Rybchenko uint16_t type_id; 116*3c838a9fSAndrew Rybchenko uint16_t reserved; 117*3c838a9fSAndrew Rybchenko uint32_t generation; 118*3c838a9fSAndrew Rybchenko uint32_t total_length; 119*3c838a9fSAndrew Rybchenko }; 120*3c838a9fSAndrew Rybchenko 121*3c838a9fSAndrew Rybchenko 122*3c838a9fSAndrew Rybchenko /* TLV partition trailer. 123*3c838a9fSAndrew Rybchenko * 124*3c838a9fSAndrew Rybchenko * In a TLV partition, this must be the last item in the sequence, immediately 125*3c838a9fSAndrew Rybchenko * preceding the TLV_TAG_END word. 126*3c838a9fSAndrew Rybchenko */ 127*3c838a9fSAndrew Rybchenko 128*3c838a9fSAndrew Rybchenko #define TLV_TAG_PARTITION_TRAILER (0xEF101A57) 129*3c838a9fSAndrew Rybchenko 130*3c838a9fSAndrew Rybchenko struct tlv_partition_trailer { 131*3c838a9fSAndrew Rybchenko uint32_t tag; 132*3c838a9fSAndrew Rybchenko uint32_t length; 133*3c838a9fSAndrew Rybchenko uint32_t generation; 134*3c838a9fSAndrew Rybchenko uint32_t checksum; 135*3c838a9fSAndrew Rybchenko }; 136*3c838a9fSAndrew Rybchenko 137*3c838a9fSAndrew Rybchenko 138*3c838a9fSAndrew Rybchenko /* Appendable TLV partition header. 139*3c838a9fSAndrew Rybchenko * 140*3c838a9fSAndrew Rybchenko * In an appendable TLV partition, this must be the first item in the sequence, 141*3c838a9fSAndrew Rybchenko * at offset 0. (Note that, unlike the configuration partitions, there is no 142*3c838a9fSAndrew Rybchenko * trailer before the TLV_TAG_END word.) 143*3c838a9fSAndrew Rybchenko */ 144*3c838a9fSAndrew Rybchenko 145*3c838a9fSAndrew Rybchenko #define TLV_TAG_APPENDABLE_PARTITION_HEADER (0xEF10ADA7) 146*3c838a9fSAndrew Rybchenko 147*3c838a9fSAndrew Rybchenko struct tlv_appendable_partition_header { 148*3c838a9fSAndrew Rybchenko uint32_t tag; 149*3c838a9fSAndrew Rybchenko uint32_t length; 150*3c838a9fSAndrew Rybchenko uint16_t type_id; 151*3c838a9fSAndrew Rybchenko uint16_t reserved; 152*3c838a9fSAndrew Rybchenko }; 153*3c838a9fSAndrew Rybchenko 154*3c838a9fSAndrew Rybchenko 155*3c838a9fSAndrew Rybchenko /* ---------------------------------------------------------------------------- 156*3c838a9fSAndrew Rybchenko * Configuration items 157*3c838a9fSAndrew Rybchenko * ---------------------------------------------------------------------------- 158*3c838a9fSAndrew Rybchenko */ 159*3c838a9fSAndrew Rybchenko 160*3c838a9fSAndrew Rybchenko 161*3c838a9fSAndrew Rybchenko /* NIC global capabilities. 162*3c838a9fSAndrew Rybchenko */ 163*3c838a9fSAndrew Rybchenko 164*3c838a9fSAndrew Rybchenko #define TLV_TAG_GLOBAL_CAPABILITIES (0x00010000) 165*3c838a9fSAndrew Rybchenko 166*3c838a9fSAndrew Rybchenko struct tlv_global_capabilities { 167*3c838a9fSAndrew Rybchenko uint32_t tag; 168*3c838a9fSAndrew Rybchenko uint32_t length; 169*3c838a9fSAndrew Rybchenko uint32_t flags; 170*3c838a9fSAndrew Rybchenko }; 171*3c838a9fSAndrew Rybchenko 172*3c838a9fSAndrew Rybchenko 173*3c838a9fSAndrew Rybchenko /* Siena-style per-port MAC address allocation. 174*3c838a9fSAndrew Rybchenko * 175*3c838a9fSAndrew Rybchenko * There are <count> addresses, starting at <base_address> and incrementing 176*3c838a9fSAndrew Rybchenko * by adding <stride> to the low-order byte(s). 177*3c838a9fSAndrew Rybchenko * 178*3c838a9fSAndrew Rybchenko * (See also TLV_TAG_GLOBAL_MAC for an alternative, specifying a global pool 179*3c838a9fSAndrew Rybchenko * of contiguous MAC addresses for the firmware to allocate as it sees fit.) 180*3c838a9fSAndrew Rybchenko */ 181*3c838a9fSAndrew Rybchenko 182*3c838a9fSAndrew Rybchenko #define TLV_TAG_PORT_MAC(port) (0x00020000 + (port)) 183*3c838a9fSAndrew Rybchenko 184*3c838a9fSAndrew Rybchenko struct tlv_port_mac { 185*3c838a9fSAndrew Rybchenko uint32_t tag; 186*3c838a9fSAndrew Rybchenko uint32_t length; 187*3c838a9fSAndrew Rybchenko uint8_t base_address[6]; 188*3c838a9fSAndrew Rybchenko uint16_t reserved; 189*3c838a9fSAndrew Rybchenko uint16_t count; 190*3c838a9fSAndrew Rybchenko uint16_t stride; 191*3c838a9fSAndrew Rybchenko }; 192*3c838a9fSAndrew Rybchenko 193*3c838a9fSAndrew Rybchenko 194*3c838a9fSAndrew Rybchenko /* Static VPD. 195*3c838a9fSAndrew Rybchenko * 196*3c838a9fSAndrew Rybchenko * This is the portion of VPD which is set at manufacturing time and not 197*3c838a9fSAndrew Rybchenko * expected to change. It is formatted as a standard PCI VPD block. 198*3c838a9fSAndrew Rybchenko */ 199*3c838a9fSAndrew Rybchenko 200*3c838a9fSAndrew Rybchenko #define TLV_TAG_PF_STATIC_VPD(pf) (0x00030000 + (pf)) 201*3c838a9fSAndrew Rybchenko 202*3c838a9fSAndrew Rybchenko struct tlv_pf_static_vpd { 203*3c838a9fSAndrew Rybchenko uint32_t tag; 204*3c838a9fSAndrew Rybchenko uint32_t length; 205*3c838a9fSAndrew Rybchenko uint8_t bytes[]; 206*3c838a9fSAndrew Rybchenko }; 207*3c838a9fSAndrew Rybchenko 208*3c838a9fSAndrew Rybchenko 209*3c838a9fSAndrew Rybchenko /* Dynamic VPD. 210*3c838a9fSAndrew Rybchenko * 211*3c838a9fSAndrew Rybchenko * This is the portion of VPD which may be changed (e.g. by firmware updates). 212*3c838a9fSAndrew Rybchenko * It is formatted as a standard PCI VPD block. 213*3c838a9fSAndrew Rybchenko */ 214*3c838a9fSAndrew Rybchenko 215*3c838a9fSAndrew Rybchenko #define TLV_TAG_PF_DYNAMIC_VPD(pf) (0x10030000 + (pf)) 216*3c838a9fSAndrew Rybchenko 217*3c838a9fSAndrew Rybchenko struct tlv_pf_dynamic_vpd { 218*3c838a9fSAndrew Rybchenko uint32_t tag; 219*3c838a9fSAndrew Rybchenko uint32_t length; 220*3c838a9fSAndrew Rybchenko uint8_t bytes[]; 221*3c838a9fSAndrew Rybchenko }; 222*3c838a9fSAndrew Rybchenko 223*3c838a9fSAndrew Rybchenko 224*3c838a9fSAndrew Rybchenko /* "DBI" PCI config space changes. 225*3c838a9fSAndrew Rybchenko * 226*3c838a9fSAndrew Rybchenko * This is a set of edits made to the default PCI config space values before 227*3c838a9fSAndrew Rybchenko * the device is allowed to enumerate. 228*3c838a9fSAndrew Rybchenko */ 229*3c838a9fSAndrew Rybchenko 230*3c838a9fSAndrew Rybchenko #define TLV_TAG_PF_DBI(pf) (0x00040000 + (pf)) 231*3c838a9fSAndrew Rybchenko 232*3c838a9fSAndrew Rybchenko struct tlv_pf_dbi { 233*3c838a9fSAndrew Rybchenko uint32_t tag; 234*3c838a9fSAndrew Rybchenko uint32_t length; 235*3c838a9fSAndrew Rybchenko struct { 236*3c838a9fSAndrew Rybchenko uint16_t addr; 237*3c838a9fSAndrew Rybchenko uint16_t byte_enables; 238*3c838a9fSAndrew Rybchenko uint32_t value; 239*3c838a9fSAndrew Rybchenko } items[]; 240*3c838a9fSAndrew Rybchenko }; 241*3c838a9fSAndrew Rybchenko 242*3c838a9fSAndrew Rybchenko 243*3c838a9fSAndrew Rybchenko /* Partition subtype codes. 244*3c838a9fSAndrew Rybchenko * 245*3c838a9fSAndrew Rybchenko * A subtype may optionally be stored for each type of partition present in 246*3c838a9fSAndrew Rybchenko * the NVRAM. For example, this may be used to allow a generic firmware update 247*3c838a9fSAndrew Rybchenko * utility to select a specific variant of firmware for a specific variant of 248*3c838a9fSAndrew Rybchenko * board. 249*3c838a9fSAndrew Rybchenko * 250*3c838a9fSAndrew Rybchenko * The description[] field is an optional string which is returned in the 251*3c838a9fSAndrew Rybchenko * MC_CMD_NVRAM_METADATA response if present. 252*3c838a9fSAndrew Rybchenko */ 253*3c838a9fSAndrew Rybchenko 254*3c838a9fSAndrew Rybchenko #define TLV_TAG_PARTITION_SUBTYPE(type) (0x00050000 + (type)) 255*3c838a9fSAndrew Rybchenko 256*3c838a9fSAndrew Rybchenko struct tlv_partition_subtype { 257*3c838a9fSAndrew Rybchenko uint32_t tag; 258*3c838a9fSAndrew Rybchenko uint32_t length; 259*3c838a9fSAndrew Rybchenko uint32_t subtype; 260*3c838a9fSAndrew Rybchenko uint8_t description[]; 261*3c838a9fSAndrew Rybchenko }; 262*3c838a9fSAndrew Rybchenko 263*3c838a9fSAndrew Rybchenko 264*3c838a9fSAndrew Rybchenko /* Partition version codes. 265*3c838a9fSAndrew Rybchenko * 266*3c838a9fSAndrew Rybchenko * A version may optionally be stored for each type of partition present in 267*3c838a9fSAndrew Rybchenko * the NVRAM. This provides a standard way of tracking the currently stored 268*3c838a9fSAndrew Rybchenko * version of each of the various component images. 269*3c838a9fSAndrew Rybchenko */ 270*3c838a9fSAndrew Rybchenko 271*3c838a9fSAndrew Rybchenko #define TLV_TAG_PARTITION_VERSION(type) (0x10060000 + (type)) 272*3c838a9fSAndrew Rybchenko 273*3c838a9fSAndrew Rybchenko struct tlv_partition_version { 274*3c838a9fSAndrew Rybchenko uint32_t tag; 275*3c838a9fSAndrew Rybchenko uint32_t length; 276*3c838a9fSAndrew Rybchenko uint16_t version_w; 277*3c838a9fSAndrew Rybchenko uint16_t version_x; 278*3c838a9fSAndrew Rybchenko uint16_t version_y; 279*3c838a9fSAndrew Rybchenko uint16_t version_z; 280*3c838a9fSAndrew Rybchenko }; 281*3c838a9fSAndrew Rybchenko 282*3c838a9fSAndrew Rybchenko /* Global PCIe configuration */ 283*3c838a9fSAndrew Rybchenko 284*3c838a9fSAndrew Rybchenko #define TLV_TAG_GLOBAL_PCIE_CONFIG (0x10070000) 285*3c838a9fSAndrew Rybchenko 286*3c838a9fSAndrew Rybchenko struct tlv_pcie_config { 287*3c838a9fSAndrew Rybchenko uint32_t tag; 288*3c838a9fSAndrew Rybchenko uint32_t length; 289*3c838a9fSAndrew Rybchenko int16_t max_pf_number; /**< Largest PF RID (lower PFs may be hidden) */ 290*3c838a9fSAndrew Rybchenko uint16_t pf_aper; /**< BIU aperture for PF BAR2 */ 291*3c838a9fSAndrew Rybchenko uint16_t vf_aper; /**< BIU aperture for VF BAR0 */ 292*3c838a9fSAndrew Rybchenko uint16_t int_aper; /**< BIU aperture for PF BAR4 and VF BAR2 */ 293*3c838a9fSAndrew Rybchenko #define TLV_MAX_PF_DEFAULT (-1) /* Use FW default for largest PF RID */ 294*3c838a9fSAndrew Rybchenko #define TLV_APER_DEFAULT (0xFFFF) /* Use FW default for a given aperture */ 295*3c838a9fSAndrew Rybchenko }; 296*3c838a9fSAndrew Rybchenko 297*3c838a9fSAndrew Rybchenko /* Per-PF configuration. Note that not all these fields are necessarily useful 298*3c838a9fSAndrew Rybchenko * as the apertures are constrained by the BIU settings (the one case we do 299*3c838a9fSAndrew Rybchenko * use is to make BAR2 bigger than the BIU thinks to reserve space), but we can 300*3c838a9fSAndrew Rybchenko * tidy things up later */ 301*3c838a9fSAndrew Rybchenko 302*3c838a9fSAndrew Rybchenko #define TLV_TAG_PF_PCIE_CONFIG(pf) (0x10080000 + (pf)) 303*3c838a9fSAndrew Rybchenko 304*3c838a9fSAndrew Rybchenko struct tlv_per_pf_pcie_config { 305*3c838a9fSAndrew Rybchenko uint32_t tag; 306*3c838a9fSAndrew Rybchenko uint32_t length; 307*3c838a9fSAndrew Rybchenko uint8_t vfs_total; 308*3c838a9fSAndrew Rybchenko uint8_t port_allocation; 309*3c838a9fSAndrew Rybchenko uint16_t vectors_per_pf; 310*3c838a9fSAndrew Rybchenko uint16_t vectors_per_vf; 311*3c838a9fSAndrew Rybchenko uint8_t pf_bar0_aperture; 312*3c838a9fSAndrew Rybchenko uint8_t pf_bar2_aperture; 313*3c838a9fSAndrew Rybchenko uint8_t vf_bar0_aperture; 314*3c838a9fSAndrew Rybchenko uint8_t vf_base; 315*3c838a9fSAndrew Rybchenko uint16_t supp_pagesz; 316*3c838a9fSAndrew Rybchenko uint16_t msix_vec_base; 317*3c838a9fSAndrew Rybchenko }; 318*3c838a9fSAndrew Rybchenko 319*3c838a9fSAndrew Rybchenko 320*3c838a9fSAndrew Rybchenko /* Development ONLY. This is a single TLV tag for all the gubbins 321*3c838a9fSAndrew Rybchenko * that can be set through the MC command-line other than the PCIe 322*3c838a9fSAndrew Rybchenko * settings. This is a temporary measure. */ 323*3c838a9fSAndrew Rybchenko #define TLV_TAG_TMP_GUBBINS (0x10090000) 324*3c838a9fSAndrew Rybchenko 325*3c838a9fSAndrew Rybchenko struct tlv_tmp_gubbins { 326*3c838a9fSAndrew Rybchenko uint32_t tag; 327*3c838a9fSAndrew Rybchenko uint32_t length; 328*3c838a9fSAndrew Rybchenko /* Consumed by dpcpu.c */ 329*3c838a9fSAndrew Rybchenko uint64_t tx0_tags; /* Bitmap */ 330*3c838a9fSAndrew Rybchenko uint64_t tx1_tags; /* Bitmap */ 331*3c838a9fSAndrew Rybchenko uint64_t dl_tags; /* Bitmap */ 332*3c838a9fSAndrew Rybchenko uint32_t flags; 333*3c838a9fSAndrew Rybchenko #define TLV_DPCPU_TX_STRIPE (1) /* TX striping is on */ 334*3c838a9fSAndrew Rybchenko #define TLV_DPCPU_BIU_TAGS (2) /* Use BIU tag manager */ 335*3c838a9fSAndrew Rybchenko #define TLV_DPCPU_TX0_TAGS (4) /* tx0_tags is valid */ 336*3c838a9fSAndrew Rybchenko #define TLV_DPCPU_TX1_TAGS (8) /* tx1_tags is valid */ 337*3c838a9fSAndrew Rybchenko #define TLV_DPCPU_DL_TAGS (16) /* dl_tags is valid */ 338*3c838a9fSAndrew Rybchenko /* Consumed by features.c */ 339*3c838a9fSAndrew Rybchenko uint32_t dut_features; /* All 1s -> leave alone */ 340*3c838a9fSAndrew Rybchenko int8_t with_rmon; /* 0 -> off, 1 -> on, -1 -> leave alone */ 341*3c838a9fSAndrew Rybchenko /* Consumed by clocks_hunt.c */ 342*3c838a9fSAndrew Rybchenko int8_t clk_mode; /* 0 -> off, 1 -> on, -1 -> leave alone */ 343*3c838a9fSAndrew Rybchenko /* Consumed by sram.c */ 344*3c838a9fSAndrew Rybchenko int8_t rx_dc_size; /* -1 -> leave alone */ 345*3c838a9fSAndrew Rybchenko int8_t tx_dc_size; 346*3c838a9fSAndrew Rybchenko int16_t num_q_allocs; 347*3c838a9fSAndrew Rybchenko }; 348*3c838a9fSAndrew Rybchenko 349*3c838a9fSAndrew Rybchenko /* Global port configuration 350*3c838a9fSAndrew Rybchenko * 351*3c838a9fSAndrew Rybchenko * This is now deprecated in favour of a platform-provided default 352*3c838a9fSAndrew Rybchenko * and dynamic config override via tlv_global_port_options. 353*3c838a9fSAndrew Rybchenko */ 354*3c838a9fSAndrew Rybchenko #define TLV_TAG_GLOBAL_PORT_CONFIG (0x000a0000) 355*3c838a9fSAndrew Rybchenko 356*3c838a9fSAndrew Rybchenko struct tlv_global_port_config { 357*3c838a9fSAndrew Rybchenko uint32_t tag; 358*3c838a9fSAndrew Rybchenko uint32_t length; 359*3c838a9fSAndrew Rybchenko uint32_t ports_per_core; 360*3c838a9fSAndrew Rybchenko uint32_t max_port_speed; 361*3c838a9fSAndrew Rybchenko }; 362*3c838a9fSAndrew Rybchenko 363*3c838a9fSAndrew Rybchenko 364*3c838a9fSAndrew Rybchenko /* Firmware options. 365*3c838a9fSAndrew Rybchenko * 366*3c838a9fSAndrew Rybchenko * This is intended for user-configurable selection of optional firmware 367*3c838a9fSAndrew Rybchenko * features and variants. 368*3c838a9fSAndrew Rybchenko * 369*3c838a9fSAndrew Rybchenko * Initially, this consists only of the satellite CPU firmware variant 370*3c838a9fSAndrew Rybchenko * selection, but this tag could be extended in the future (using the 371*3c838a9fSAndrew Rybchenko * tag length to determine whether additional fields are present). 372*3c838a9fSAndrew Rybchenko */ 373*3c838a9fSAndrew Rybchenko 374*3c838a9fSAndrew Rybchenko #define TLV_TAG_FIRMWARE_OPTIONS (0x100b0000) 375*3c838a9fSAndrew Rybchenko 376*3c838a9fSAndrew Rybchenko struct tlv_firmware_options { 377*3c838a9fSAndrew Rybchenko uint32_t tag; 378*3c838a9fSAndrew Rybchenko uint32_t length; 379*3c838a9fSAndrew Rybchenko uint32_t firmware_variant; 380*3c838a9fSAndrew Rybchenko #define TLV_FIRMWARE_VARIANT_DRIVER_SELECTED (0xffffffff) 381*3c838a9fSAndrew Rybchenko 382*3c838a9fSAndrew Rybchenko /* These are the values for overriding the driver's choice; the definitions 383*3c838a9fSAndrew Rybchenko * are taken from MCDI so that they don't get out of step. Include 384*3c838a9fSAndrew Rybchenko * <ci/mgmt/mc_driver_pcol.h> or the equivalent from your driver's tree if 385*3c838a9fSAndrew Rybchenko * you need to use these constants. 386*3c838a9fSAndrew Rybchenko */ 387*3c838a9fSAndrew Rybchenko #define TLV_FIRMWARE_VARIANT_FULL_FEATURED MC_CMD_FW_FULL_FEATURED 388*3c838a9fSAndrew Rybchenko #define TLV_FIRMWARE_VARIANT_LOW_LATENCY MC_CMD_FW_LOW_LATENCY 389*3c838a9fSAndrew Rybchenko #define TLV_FIRMWARE_VARIANT_PACKED_STREAM MC_CMD_FW_PACKED_STREAM 390*3c838a9fSAndrew Rybchenko #define TLV_FIRMWARE_VARIANT_HIGH_TX_RATE MC_CMD_FW_HIGH_TX_RATE 391*3c838a9fSAndrew Rybchenko #define TLV_FIRMWARE_VARIANT_PACKED_STREAM_HASH_MODE_1 \ 392*3c838a9fSAndrew Rybchenko MC_CMD_FW_PACKED_STREAM_HASH_MODE_1 393*3c838a9fSAndrew Rybchenko }; 394*3c838a9fSAndrew Rybchenko 395*3c838a9fSAndrew Rybchenko /* Voltage settings 396*3c838a9fSAndrew Rybchenko * 397*3c838a9fSAndrew Rybchenko * Intended for boards with A0 silicon where the core voltage may 398*3c838a9fSAndrew Rybchenko * need tweaking. Most likely set once when the pass voltage is 399*3c838a9fSAndrew Rybchenko * determined. */ 400*3c838a9fSAndrew Rybchenko 401*3c838a9fSAndrew Rybchenko #define TLV_TAG_0V9_SETTINGS (0x000c0000) 402*3c838a9fSAndrew Rybchenko 403*3c838a9fSAndrew Rybchenko struct tlv_0v9_settings { 404*3c838a9fSAndrew Rybchenko uint32_t tag; 405*3c838a9fSAndrew Rybchenko uint32_t length; 406*3c838a9fSAndrew Rybchenko uint16_t flags; /* Boards with high 0v9 settings may need active cooling */ 407*3c838a9fSAndrew Rybchenko #define TLV_TAG_0V9_REQUIRES_FAN (1) 408*3c838a9fSAndrew Rybchenko uint16_t target_voltage; /* In millivolts */ 409*3c838a9fSAndrew Rybchenko /* Since the limits are meant to be centred to the target (and must at least 410*3c838a9fSAndrew Rybchenko * contain it) they need setting as well. */ 411*3c838a9fSAndrew Rybchenko uint16_t warn_low; /* In millivolts */ 412*3c838a9fSAndrew Rybchenko uint16_t warn_high; /* In millivolts */ 413*3c838a9fSAndrew Rybchenko uint16_t panic_low; /* In millivolts */ 414*3c838a9fSAndrew Rybchenko uint16_t panic_high; /* In millivolts */ 415*3c838a9fSAndrew Rybchenko }; 416*3c838a9fSAndrew Rybchenko 417*3c838a9fSAndrew Rybchenko 418*3c838a9fSAndrew Rybchenko /* Clock configuration */ 419*3c838a9fSAndrew Rybchenko 420*3c838a9fSAndrew Rybchenko #define TLV_TAG_CLOCK_CONFIG (0x000d0000) 421*3c838a9fSAndrew Rybchenko 422*3c838a9fSAndrew Rybchenko struct tlv_clock_config { 423*3c838a9fSAndrew Rybchenko uint32_t tag; 424*3c838a9fSAndrew Rybchenko uint32_t length; 425*3c838a9fSAndrew Rybchenko uint16_t clk_sys; /* MHz */ 426*3c838a9fSAndrew Rybchenko uint16_t clk_dpcpu; /* MHz */ 427*3c838a9fSAndrew Rybchenko uint16_t clk_icore; /* MHz */ 428*3c838a9fSAndrew Rybchenko uint16_t clk_pcs; /* MHz */ 429*3c838a9fSAndrew Rybchenko }; 430*3c838a9fSAndrew Rybchenko 431*3c838a9fSAndrew Rybchenko #define TLV_TAG_CLOCK_CONFIG_MEDFORD (0x00100000) 432*3c838a9fSAndrew Rybchenko 433*3c838a9fSAndrew Rybchenko struct tlv_clock_config_medford { 434*3c838a9fSAndrew Rybchenko uint32_t tag; 435*3c838a9fSAndrew Rybchenko uint32_t length; 436*3c838a9fSAndrew Rybchenko uint16_t clk_sys; /* MHz */ 437*3c838a9fSAndrew Rybchenko uint16_t clk_mc; /* MHz */ 438*3c838a9fSAndrew Rybchenko uint16_t clk_rmon; /* MHz */ 439*3c838a9fSAndrew Rybchenko uint16_t clk_vswitch; /* MHz */ 440*3c838a9fSAndrew Rybchenko uint16_t clk_dpcpu; /* MHz */ 441*3c838a9fSAndrew Rybchenko uint16_t clk_pcs; /* MHz */ 442*3c838a9fSAndrew Rybchenko }; 443*3c838a9fSAndrew Rybchenko 444*3c838a9fSAndrew Rybchenko 445*3c838a9fSAndrew Rybchenko /* EF10-style global pool of MAC addresses. 446*3c838a9fSAndrew Rybchenko * 447*3c838a9fSAndrew Rybchenko * There are <count> addresses, starting at <base_address>, which are 448*3c838a9fSAndrew Rybchenko * contiguous. Firmware is responsible for allocating addresses from this 449*3c838a9fSAndrew Rybchenko * pool to ports / PFs as appropriate. 450*3c838a9fSAndrew Rybchenko */ 451*3c838a9fSAndrew Rybchenko 452*3c838a9fSAndrew Rybchenko #define TLV_TAG_GLOBAL_MAC (0x000e0000) 453*3c838a9fSAndrew Rybchenko 454*3c838a9fSAndrew Rybchenko struct tlv_global_mac { 455*3c838a9fSAndrew Rybchenko uint32_t tag; 456*3c838a9fSAndrew Rybchenko uint32_t length; 457*3c838a9fSAndrew Rybchenko uint8_t base_address[6]; 458*3c838a9fSAndrew Rybchenko uint16_t reserved1; 459*3c838a9fSAndrew Rybchenko uint16_t count; 460*3c838a9fSAndrew Rybchenko uint16_t reserved2; 461*3c838a9fSAndrew Rybchenko }; 462*3c838a9fSAndrew Rybchenko 463*3c838a9fSAndrew Rybchenko #define TLV_TAG_ATB_0V9_TARGET (0x000f0000) 464*3c838a9fSAndrew Rybchenko 465*3c838a9fSAndrew Rybchenko /* The target value for the 0v9 power rail measured on-chip at the 466*3c838a9fSAndrew Rybchenko * analogue test bus */ 467*3c838a9fSAndrew Rybchenko struct tlv_0v9_atb_target { 468*3c838a9fSAndrew Rybchenko uint32_t tag; 469*3c838a9fSAndrew Rybchenko uint32_t length; 470*3c838a9fSAndrew Rybchenko uint16_t millivolts; 471*3c838a9fSAndrew Rybchenko uint16_t reserved; 472*3c838a9fSAndrew Rybchenko }; 473*3c838a9fSAndrew Rybchenko 474*3c838a9fSAndrew Rybchenko /* Global PCIe configuration, second revision. This represents the visible PFs 475*3c838a9fSAndrew Rybchenko * by a bitmap rather than having the number of the highest visible one. As such 476*3c838a9fSAndrew Rybchenko * it can (for a 16-PF chip) represent a superset of what TLV_TAG_GLOBAL_PCIE_CONFIG 477*3c838a9fSAndrew Rybchenko * can and it should be used in place of that tag in future (but compatibility with 478*3c838a9fSAndrew Rybchenko * the old tag will be left in the firmware indefinitely). */ 479*3c838a9fSAndrew Rybchenko 480*3c838a9fSAndrew Rybchenko #define TLV_TAG_GLOBAL_PCIE_CONFIG_R2 (0x10100000) 481*3c838a9fSAndrew Rybchenko 482*3c838a9fSAndrew Rybchenko struct tlv_pcie_config_r2 { 483*3c838a9fSAndrew Rybchenko uint32_t tag; 484*3c838a9fSAndrew Rybchenko uint32_t length; 485*3c838a9fSAndrew Rybchenko uint16_t visible_pfs; /**< Bitmap of visible PFs */ 486*3c838a9fSAndrew Rybchenko uint16_t pf_aper; /**< BIU aperture for PF BAR2 */ 487*3c838a9fSAndrew Rybchenko uint16_t vf_aper; /**< BIU aperture for VF BAR0 */ 488*3c838a9fSAndrew Rybchenko uint16_t int_aper; /**< BIU aperture for PF BAR4 and VF BAR2 */ 489*3c838a9fSAndrew Rybchenko }; 490*3c838a9fSAndrew Rybchenko 491*3c838a9fSAndrew Rybchenko /* Dynamic port mode. 492*3c838a9fSAndrew Rybchenko * 493*3c838a9fSAndrew Rybchenko * Allows selecting alternate port configuration for platforms that support it 494*3c838a9fSAndrew Rybchenko * (e.g. 1x40G vs 2x10G on Milano, 1x40G vs 4x10G on Medford). This affects the 495*3c838a9fSAndrew Rybchenko * number of externally visible ports (and, hence, PF to port mapping), so must 496*3c838a9fSAndrew Rybchenko * be done at boot time. 497*3c838a9fSAndrew Rybchenko * 498*3c838a9fSAndrew Rybchenko * This tag supercedes tlv_global_port_config. 499*3c838a9fSAndrew Rybchenko */ 500*3c838a9fSAndrew Rybchenko 501*3c838a9fSAndrew Rybchenko #define TLV_TAG_GLOBAL_PORT_MODE (0x10110000) 502*3c838a9fSAndrew Rybchenko 503*3c838a9fSAndrew Rybchenko struct tlv_global_port_mode { 504*3c838a9fSAndrew Rybchenko uint32_t tag; 505*3c838a9fSAndrew Rybchenko uint32_t length; 506*3c838a9fSAndrew Rybchenko uint32_t port_mode; 507*3c838a9fSAndrew Rybchenko #define TLV_PORT_MODE_DEFAULT (0xffffffff) /* Default for given platform */ 508*3c838a9fSAndrew Rybchenko #define TLV_PORT_MODE_10G (0) /* 10G, single SFP/10G-KR */ 509*3c838a9fSAndrew Rybchenko #define TLV_PORT_MODE_40G (1) /* 40G, single QSFP/40G-KR */ 510*3c838a9fSAndrew Rybchenko #define TLV_PORT_MODE_10G_10G (2) /* 2x10G, dual SFP/10G-KR or single QSFP */ 511*3c838a9fSAndrew Rybchenko #define TLV_PORT_MODE_40G_40G (3) /* 40G + 40G, dual QSFP/40G-KR (Greenport, Medford) */ 512*3c838a9fSAndrew Rybchenko #define TLV_PORT_MODE_10G_10G_10G_10G (4) /* 2x10G + 2x10G, quad SFP/10G-KR or dual QSFP (Greenport, Medford) */ 513*3c838a9fSAndrew Rybchenko #define TLV_PORT_MODE_10G_10G_10G_10G_Q (5) /* 4x10G, single QSFP, cage 0 (Medford) */ 514*3c838a9fSAndrew Rybchenko #define TLV_PORT_MODE_40G_10G_10G (6) /* 1x40G + 2x10G, dual QSFP (Greenport, Medford) */ 515*3c838a9fSAndrew Rybchenko #define TLV_PORT_MODE_10G_10G_40G (7) /* 2x10G + 1x40G, dual QSFP (Greenport, Medford) */ 516*3c838a9fSAndrew Rybchenko #define TLV_PORT_MODE_10G_10G_10G_10G_Q2 (8) /* 4x10G, single QSFP, cage 1 (Medford) */ 517*3c838a9fSAndrew Rybchenko #define TLV_PORT_MODE_MAX TLV_PORT_MODE_10G_10G_10G_10G_Q2 518*3c838a9fSAndrew Rybchenko }; 519*3c838a9fSAndrew Rybchenko 520*3c838a9fSAndrew Rybchenko /* Type of the v-switch created implicitly by the firmware */ 521*3c838a9fSAndrew Rybchenko 522*3c838a9fSAndrew Rybchenko #define TLV_TAG_VSWITCH_TYPE(port) (0x10120000 + (port)) 523*3c838a9fSAndrew Rybchenko 524*3c838a9fSAndrew Rybchenko struct tlv_vswitch_type { 525*3c838a9fSAndrew Rybchenko uint32_t tag; 526*3c838a9fSAndrew Rybchenko uint32_t length; 527*3c838a9fSAndrew Rybchenko uint32_t vswitch_type; 528*3c838a9fSAndrew Rybchenko #define TLV_VSWITCH_TYPE_DEFAULT (0xffffffff) /* Firmware default; equivalent to no TLV present for a given port */ 529*3c838a9fSAndrew Rybchenko #define TLV_VSWITCH_TYPE_NONE (0) 530*3c838a9fSAndrew Rybchenko #define TLV_VSWITCH_TYPE_VLAN (1) 531*3c838a9fSAndrew Rybchenko #define TLV_VSWITCH_TYPE_VEB (2) 532*3c838a9fSAndrew Rybchenko #define TLV_VSWITCH_TYPE_VEPA (3) 533*3c838a9fSAndrew Rybchenko #define TLV_VSWITCH_TYPE_MUX (4) 534*3c838a9fSAndrew Rybchenko #define TLV_VSWITCH_TYPE_TEST (5) 535*3c838a9fSAndrew Rybchenko }; 536*3c838a9fSAndrew Rybchenko 537*3c838a9fSAndrew Rybchenko /* A VLAN tag for the v-port created implicitly by the firmware */ 538*3c838a9fSAndrew Rybchenko 539*3c838a9fSAndrew Rybchenko #define TLV_TAG_VPORT_VLAN_TAG(pf) (0x10130000 + (pf)) 540*3c838a9fSAndrew Rybchenko 541*3c838a9fSAndrew Rybchenko struct tlv_vport_vlan_tag { 542*3c838a9fSAndrew Rybchenko uint32_t tag; 543*3c838a9fSAndrew Rybchenko uint32_t length; 544*3c838a9fSAndrew Rybchenko uint32_t vlan_tag; 545*3c838a9fSAndrew Rybchenko #define TLV_VPORT_NO_VLAN_TAG (0xFFFFFFFF) /* Default in the absence of TLV for a given PF */ 546*3c838a9fSAndrew Rybchenko }; 547*3c838a9fSAndrew Rybchenko 548*3c838a9fSAndrew Rybchenko /* Offset to be applied to the 0v9 setting, wherever it came from */ 549*3c838a9fSAndrew Rybchenko 550*3c838a9fSAndrew Rybchenko #define TLV_TAG_ATB_0V9_OFFSET (0x10140000) 551*3c838a9fSAndrew Rybchenko 552*3c838a9fSAndrew Rybchenko struct tlv_0v9_atb_offset { 553*3c838a9fSAndrew Rybchenko uint32_t tag; 554*3c838a9fSAndrew Rybchenko uint32_t length; 555*3c838a9fSAndrew Rybchenko int16_t offset_millivolts; 556*3c838a9fSAndrew Rybchenko uint16_t reserved; 557*3c838a9fSAndrew Rybchenko }; 558*3c838a9fSAndrew Rybchenko 559*3c838a9fSAndrew Rybchenko /* A privilege mask given on reset to all non-admin PCIe functions (that is other than first-PF-per-port). 560*3c838a9fSAndrew Rybchenko * The meaning of particular bits is defined in mcdi_ef10.yml under MC_CMD_PRIVILEGE_MASK, see also bug 44583. 561*3c838a9fSAndrew Rybchenko * TLV_TAG_PRIVILEGE_MASK_ADD specifies bits that should be added (ORed) to firmware default while 562*3c838a9fSAndrew Rybchenko * TLV_TAG_PRIVILEGE_MASK_REM specifies bits that should be removed (ANDed) from firmware default: 563*3c838a9fSAndrew Rybchenko * Initial_privilege_mask = (firmware_default_mask | privilege_mask_add) & ~privilege_mask_rem */ 564*3c838a9fSAndrew Rybchenko 565*3c838a9fSAndrew Rybchenko #define TLV_TAG_PRIVILEGE_MASK (0x10150000) /* legacy symbol - do not use */ 566*3c838a9fSAndrew Rybchenko 567*3c838a9fSAndrew Rybchenko struct tlv_privilege_mask { /* legacy structure - do not use */ 568*3c838a9fSAndrew Rybchenko uint32_t tag; 569*3c838a9fSAndrew Rybchenko uint32_t length; 570*3c838a9fSAndrew Rybchenko uint32_t privilege_mask; 571*3c838a9fSAndrew Rybchenko }; 572*3c838a9fSAndrew Rybchenko 573*3c838a9fSAndrew Rybchenko #define TLV_TAG_PRIVILEGE_MASK_ADD (0x10150000) 574*3c838a9fSAndrew Rybchenko 575*3c838a9fSAndrew Rybchenko struct tlv_privilege_mask_add { 576*3c838a9fSAndrew Rybchenko uint32_t tag; 577*3c838a9fSAndrew Rybchenko uint32_t length; 578*3c838a9fSAndrew Rybchenko uint32_t privilege_mask_add; 579*3c838a9fSAndrew Rybchenko }; 580*3c838a9fSAndrew Rybchenko 581*3c838a9fSAndrew Rybchenko #define TLV_TAG_PRIVILEGE_MASK_REM (0x10160000) 582*3c838a9fSAndrew Rybchenko 583*3c838a9fSAndrew Rybchenko struct tlv_privilege_mask_rem { 584*3c838a9fSAndrew Rybchenko uint32_t tag; 585*3c838a9fSAndrew Rybchenko uint32_t length; 586*3c838a9fSAndrew Rybchenko uint32_t privilege_mask_rem; 587*3c838a9fSAndrew Rybchenko }; 588*3c838a9fSAndrew Rybchenko 589*3c838a9fSAndrew Rybchenko /* Additional privileges given to all PFs. 590*3c838a9fSAndrew Rybchenko * This tag takes precedence over TLV_TAG_PRIVILEGE_MASK_REM. */ 591*3c838a9fSAndrew Rybchenko 592*3c838a9fSAndrew Rybchenko #define TLV_TAG_PRIVILEGE_MASK_ADD_ALL_PFS (0x10190000) 593*3c838a9fSAndrew Rybchenko 594*3c838a9fSAndrew Rybchenko struct tlv_privilege_mask_add_all_pfs { 595*3c838a9fSAndrew Rybchenko uint32_t tag; 596*3c838a9fSAndrew Rybchenko uint32_t length; 597*3c838a9fSAndrew Rybchenko uint32_t privilege_mask_add; 598*3c838a9fSAndrew Rybchenko }; 599*3c838a9fSAndrew Rybchenko 600*3c838a9fSAndrew Rybchenko /* Additional privileges given to a selected PF. 601*3c838a9fSAndrew Rybchenko * This tag takes precedence over TLV_TAG_PRIVILEGE_MASK_REM. */ 602*3c838a9fSAndrew Rybchenko 603*3c838a9fSAndrew Rybchenko #define TLV_TAG_PRIVILEGE_MASK_ADD_SINGLE_PF(pf) (0x101A0000 + (pf)) 604*3c838a9fSAndrew Rybchenko 605*3c838a9fSAndrew Rybchenko struct tlv_privilege_mask_add_single_pf { 606*3c838a9fSAndrew Rybchenko uint32_t tag; 607*3c838a9fSAndrew Rybchenko uint32_t length; 608*3c838a9fSAndrew Rybchenko uint32_t privilege_mask_add; 609*3c838a9fSAndrew Rybchenko }; 610*3c838a9fSAndrew Rybchenko 611*3c838a9fSAndrew Rybchenko /* Turning on/off the PFIOV mode. 612*3c838a9fSAndrew Rybchenko * This tag only takes effect if TLV_TAG_VSWITCH_TYPE is missing or set to DEFAULT. */ 613*3c838a9fSAndrew Rybchenko 614*3c838a9fSAndrew Rybchenko #define TLV_TAG_PFIOV(port) (0x10170000 + (port)) 615*3c838a9fSAndrew Rybchenko 616*3c838a9fSAndrew Rybchenko struct tlv_pfiov { 617*3c838a9fSAndrew Rybchenko uint32_t tag; 618*3c838a9fSAndrew Rybchenko uint32_t length; 619*3c838a9fSAndrew Rybchenko uint32_t pfiov; 620*3c838a9fSAndrew Rybchenko #define TLV_PFIOV_OFF (0) /* Default */ 621*3c838a9fSAndrew Rybchenko #define TLV_PFIOV_ON (1) 622*3c838a9fSAndrew Rybchenko }; 623*3c838a9fSAndrew Rybchenko 624*3c838a9fSAndrew Rybchenko /* Multicast filter chaining mode selection. 625*3c838a9fSAndrew Rybchenko * 626*3c838a9fSAndrew Rybchenko * When enabled, multicast packets are delivered to all recipients of all 627*3c838a9fSAndrew Rybchenko * matching multicast filters, with the exception that IP multicast filters 628*3c838a9fSAndrew Rybchenko * will steal traffic from MAC multicast filters on a per-function basis. 629*3c838a9fSAndrew Rybchenko * (New behaviour.) 630*3c838a9fSAndrew Rybchenko * 631*3c838a9fSAndrew Rybchenko * When disabled, multicast packets will always be delivered only to the 632*3c838a9fSAndrew Rybchenko * recipients of the highest priority matching multicast filter. 633*3c838a9fSAndrew Rybchenko * (Legacy behaviour.) 634*3c838a9fSAndrew Rybchenko * 635*3c838a9fSAndrew Rybchenko * The DEFAULT mode (which is the same as the tag not being present at all) 636*3c838a9fSAndrew Rybchenko * is equivalent to ENABLED in production builds, and DISABLED in eftest 637*3c838a9fSAndrew Rybchenko * builds. 638*3c838a9fSAndrew Rybchenko * 639*3c838a9fSAndrew Rybchenko * This option is intended to provide run-time control over this feature 640*3c838a9fSAndrew Rybchenko * while it is being stabilised and may be withdrawn at some point in the 641*3c838a9fSAndrew Rybchenko * future; the new behaviour is intended to become the standard behaviour. 642*3c838a9fSAndrew Rybchenko */ 643*3c838a9fSAndrew Rybchenko 644*3c838a9fSAndrew Rybchenko #define TLV_TAG_MCAST_FILTER_CHAINING (0x10180000) 645*3c838a9fSAndrew Rybchenko 646*3c838a9fSAndrew Rybchenko struct tlv_mcast_filter_chaining { 647*3c838a9fSAndrew Rybchenko uint32_t tag; 648*3c838a9fSAndrew Rybchenko uint32_t length; 649*3c838a9fSAndrew Rybchenko uint32_t mode; 650*3c838a9fSAndrew Rybchenko #define TLV_MCAST_FILTER_CHAINING_DEFAULT (0xffffffff) 651*3c838a9fSAndrew Rybchenko #define TLV_MCAST_FILTER_CHAINING_DISABLED (0) 652*3c838a9fSAndrew Rybchenko #define TLV_MCAST_FILTER_CHAINING_ENABLED (1) 653*3c838a9fSAndrew Rybchenko }; 654*3c838a9fSAndrew Rybchenko 655*3c838a9fSAndrew Rybchenko 656*3c838a9fSAndrew Rybchenko /* Pacer rate limit per PF */ 657*3c838a9fSAndrew Rybchenko #define TLV_TAG_RATE_LIMIT(pf) (0x101b0000 + (pf)) 658*3c838a9fSAndrew Rybchenko 659*3c838a9fSAndrew Rybchenko struct tlv_rate_limit { 660*3c838a9fSAndrew Rybchenko uint32_t tag; 661*3c838a9fSAndrew Rybchenko uint32_t length; 662*3c838a9fSAndrew Rybchenko uint32_t rate_mbps; 663*3c838a9fSAndrew Rybchenko }; 664*3c838a9fSAndrew Rybchenko 665*3c838a9fSAndrew Rybchenko 666*3c838a9fSAndrew Rybchenko /* OCSD Enable/Disable 667*3c838a9fSAndrew Rybchenko * 668*3c838a9fSAndrew Rybchenko * This setting allows OCSD to be disabled. This is a requirement for HP 669*3c838a9fSAndrew Rybchenko * servers to support PCI passthrough for virtualization. 670*3c838a9fSAndrew Rybchenko * 671*3c838a9fSAndrew Rybchenko * The DEFAULT mode (which is the same as the tag not being present) is 672*3c838a9fSAndrew Rybchenko * equivalent to ENABLED. 673*3c838a9fSAndrew Rybchenko * 674*3c838a9fSAndrew Rybchenko * This option is not used by the MCFW, and is entirely handled by the various 675*3c838a9fSAndrew Rybchenko * drivers that support OCSD, by reading the setting before they attempt 676*3c838a9fSAndrew Rybchenko * to enable OCSD. 677*3c838a9fSAndrew Rybchenko * 678*3c838a9fSAndrew Rybchenko * bit0: OCSD Disabled/Enabled 679*3c838a9fSAndrew Rybchenko */ 680*3c838a9fSAndrew Rybchenko 681*3c838a9fSAndrew Rybchenko #define TLV_TAG_OCSD (0x101C0000) 682*3c838a9fSAndrew Rybchenko 683*3c838a9fSAndrew Rybchenko struct tlv_ocsd { 684*3c838a9fSAndrew Rybchenko uint32_t tag; 685*3c838a9fSAndrew Rybchenko uint32_t length; 686*3c838a9fSAndrew Rybchenko uint32_t mode; 687*3c838a9fSAndrew Rybchenko #define TLV_OCSD_DISABLED 0 688*3c838a9fSAndrew Rybchenko #define TLV_OCSD_ENABLED 1 /* Default */ 689*3c838a9fSAndrew Rybchenko }; 690*3c838a9fSAndrew Rybchenko 691*3c838a9fSAndrew Rybchenko #endif /* CI_MGMT_TLV_LAYOUT_H */ 692