xref: /freebsd/sys/dev/sfxge/common/ef10_tlv_layout.h (revision 6d522ee0fc012c8ce82cb2f54ee53f055b1fcf8e)
13c838a9fSAndrew Rybchenko /*-
2ba3049f9SAndrew Rybchenko  * Copyright (c) 2012-2016 Solarflare Communications Inc.
33c838a9fSAndrew Rybchenko  * All rights reserved.
43c838a9fSAndrew Rybchenko  *
53c838a9fSAndrew Rybchenko  * Redistribution and use in source and binary forms, with or without
63c838a9fSAndrew Rybchenko  * modification, are permitted provided that the following conditions are met:
73c838a9fSAndrew Rybchenko  *
83c838a9fSAndrew Rybchenko  * 1. Redistributions of source code must retain the above copyright notice,
93c838a9fSAndrew Rybchenko  *    this list of conditions and the following disclaimer.
103c838a9fSAndrew Rybchenko  * 2. Redistributions in binary form must reproduce the above copyright notice,
113c838a9fSAndrew Rybchenko  *    this list of conditions and the following disclaimer in the documentation
123c838a9fSAndrew Rybchenko  *    and/or other materials provided with the distribution.
133c838a9fSAndrew Rybchenko  *
143c838a9fSAndrew Rybchenko  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
153c838a9fSAndrew Rybchenko  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
163c838a9fSAndrew Rybchenko  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
173c838a9fSAndrew Rybchenko  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
183c838a9fSAndrew Rybchenko  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
193c838a9fSAndrew Rybchenko  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
203c838a9fSAndrew Rybchenko  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
213c838a9fSAndrew Rybchenko  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
223c838a9fSAndrew Rybchenko  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
233c838a9fSAndrew Rybchenko  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
243c838a9fSAndrew Rybchenko  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
253c838a9fSAndrew Rybchenko  *
263c838a9fSAndrew Rybchenko  * The views and conclusions contained in the software and documentation are
273c838a9fSAndrew Rybchenko  * those of the authors and should not be interpreted as representing official
283c838a9fSAndrew Rybchenko  * policies, either expressed or implied, of the FreeBSD Project.
293c838a9fSAndrew Rybchenko  *
303c838a9fSAndrew Rybchenko  * $FreeBSD$
313c838a9fSAndrew Rybchenko  */
323c838a9fSAndrew Rybchenko 
333c838a9fSAndrew Rybchenko /* These structures define the layouts for the TLV items stored in static and
343c838a9fSAndrew Rybchenko  * dynamic configuration partitions in NVRAM for EF10 (Huntington etc.).
353c838a9fSAndrew Rybchenko  *
363c838a9fSAndrew Rybchenko  * They contain the same sort of information that was kept in the
373c838a9fSAndrew Rybchenko  * siena_mc_static_config_hdr_t and siena_mc_dynamic_config_hdr_t structures
383c838a9fSAndrew Rybchenko  * (defined in <ci/mgmt/mc_flash_layout.h> and <ci/mgmt/mc_dynamic_cfg.h>) for
393c838a9fSAndrew Rybchenko  * Siena.
403c838a9fSAndrew Rybchenko  *
413c838a9fSAndrew Rybchenko  * These are used directly by the MC and should also be usable directly on host
423c838a9fSAndrew Rybchenko  * systems which are little-endian and do not do strange things with structure
433c838a9fSAndrew Rybchenko  * padding.  (Big-endian host systems will require some byte-swapping.)
443c838a9fSAndrew Rybchenko  *
453c838a9fSAndrew Rybchenko  *                                    -----
463c838a9fSAndrew Rybchenko  *
473c838a9fSAndrew Rybchenko  * Please refer to SF-108797-SW for a general overview of the TLV partition
483c838a9fSAndrew Rybchenko  * format.
493c838a9fSAndrew Rybchenko  *
503c838a9fSAndrew Rybchenko  *                                    -----
513c838a9fSAndrew Rybchenko  *
523c838a9fSAndrew Rybchenko  * The current tag IDs have a general structure: with the exception of the
533c838a9fSAndrew Rybchenko  * special values defined in the document, they are of the form 0xLTTTNNNN,
543c838a9fSAndrew Rybchenko  * where:
553c838a9fSAndrew Rybchenko  *
563c838a9fSAndrew Rybchenko  *   -  L is a location, indicating where this tag is expected to be found:
572d9312f6SAndrew Rybchenko  *        0: static configuration
582d9312f6SAndrew Rybchenko  *        1: dynamic configuration
592d9312f6SAndrew Rybchenko  *        2: firmware internal use
602d9312f6SAndrew Rybchenko  *        3: license partition
61*6d522ee0SAndrew Rybchenko  *        4: tsa configuration
623c838a9fSAndrew Rybchenko  *
633c838a9fSAndrew Rybchenko  *   -  TTT is a type, which is just a unique value.  The same type value
643c838a9fSAndrew Rybchenko  *      might appear in both locations, indicating a relationship between
653c838a9fSAndrew Rybchenko  *      the items (e.g. static and dynamic VPD below).
663c838a9fSAndrew Rybchenko  *
673c838a9fSAndrew Rybchenko  *   -  NNNN is an index of some form.  Some item types are per-port, some
683c838a9fSAndrew Rybchenko  *      are per-PF, some are per-partition-type.
693c838a9fSAndrew Rybchenko  *
703c838a9fSAndrew Rybchenko  *                                    -----
713c838a9fSAndrew Rybchenko  *
723c838a9fSAndrew Rybchenko  * As with the previous Siena structures, each structure here is laid out
733c838a9fSAndrew Rybchenko  * carefully: values are aligned to their natural boundary, with explicit
743c838a9fSAndrew Rybchenko  * padding fields added where necessary.  (No, technically this does not
753c838a9fSAndrew Rybchenko  * absolutely guarantee portability.  But, in practice, compilers are generally
763c838a9fSAndrew Rybchenko  * sensible enough not to introduce completely pointless padding, and it works
773c838a9fSAndrew Rybchenko  * well enough.)
783c838a9fSAndrew Rybchenko  */
793c838a9fSAndrew Rybchenko 
803c838a9fSAndrew Rybchenko 
813c838a9fSAndrew Rybchenko #ifndef CI_MGMT_TLV_LAYOUT_H
823c838a9fSAndrew Rybchenko #define CI_MGMT_TLV_LAYOUT_H
833c838a9fSAndrew Rybchenko 
843c838a9fSAndrew Rybchenko 
853c838a9fSAndrew Rybchenko /* ----------------------------------------------------------------------------
863c838a9fSAndrew Rybchenko  *  General structure (defined by SF-108797-SW)
873c838a9fSAndrew Rybchenko  * ----------------------------------------------------------------------------
883c838a9fSAndrew Rybchenko  */
893c838a9fSAndrew Rybchenko 
903c838a9fSAndrew Rybchenko 
913c838a9fSAndrew Rybchenko /* The "end" tag.
923c838a9fSAndrew Rybchenko  *
933c838a9fSAndrew Rybchenko  * (Note that this is *not* followed by length or value fields: anything after
943c838a9fSAndrew Rybchenko  * the tag itself is irrelevant.)
953c838a9fSAndrew Rybchenko  */
963c838a9fSAndrew Rybchenko 
973c838a9fSAndrew Rybchenko #define TLV_TAG_END                     (0xEEEEEEEE)
983c838a9fSAndrew Rybchenko 
993c838a9fSAndrew Rybchenko 
1003c838a9fSAndrew Rybchenko /* Other special reserved tag values.
1013c838a9fSAndrew Rybchenko  */
1023c838a9fSAndrew Rybchenko 
1033c838a9fSAndrew Rybchenko #define TLV_TAG_SKIP                    (0x00000000)
1043c838a9fSAndrew Rybchenko #define TLV_TAG_INVALID                 (0xFFFFFFFF)
1053c838a9fSAndrew Rybchenko 
1063c838a9fSAndrew Rybchenko 
1073c838a9fSAndrew Rybchenko /* TLV partition header.
1083c838a9fSAndrew Rybchenko  *
1093c838a9fSAndrew Rybchenko  * In a TLV partition, this must be the first item in the sequence, at offset
1103c838a9fSAndrew Rybchenko  * 0.
1113c838a9fSAndrew Rybchenko  */
1123c838a9fSAndrew Rybchenko 
1133c838a9fSAndrew Rybchenko #define TLV_TAG_PARTITION_HEADER        (0xEF10DA7A)
1143c838a9fSAndrew Rybchenko 
1153c838a9fSAndrew Rybchenko struct tlv_partition_header {
1163c838a9fSAndrew Rybchenko   uint32_t tag;
1173c838a9fSAndrew Rybchenko   uint32_t length;
1183c838a9fSAndrew Rybchenko   uint16_t type_id;
1198b18714dSAndrew Rybchenko /* 0 indicates the default segment (always located at offset 0), while other values
1208b18714dSAndrew Rybchenko  * are for RFID-selectable presets that should immediately follow the default segment.
1218b18714dSAndrew Rybchenko  * The default segment may also have preset > 0, which means that it is a preset
1228b18714dSAndrew Rybchenko  * selected through an RFID command and copied by FW to the location at offset 0. */
1238b18714dSAndrew Rybchenko   uint16_t preset;
1243c838a9fSAndrew Rybchenko   uint32_t generation;
1253c838a9fSAndrew Rybchenko   uint32_t total_length;
1263c838a9fSAndrew Rybchenko };
1273c838a9fSAndrew Rybchenko 
1283c838a9fSAndrew Rybchenko 
1293c838a9fSAndrew Rybchenko /* TLV partition trailer.
1303c838a9fSAndrew Rybchenko  *
1313c838a9fSAndrew Rybchenko  * In a TLV partition, this must be the last item in the sequence, immediately
1323c838a9fSAndrew Rybchenko  * preceding the TLV_TAG_END word.
1333c838a9fSAndrew Rybchenko  */
1343c838a9fSAndrew Rybchenko 
1353c838a9fSAndrew Rybchenko #define TLV_TAG_PARTITION_TRAILER       (0xEF101A57)
1363c838a9fSAndrew Rybchenko 
1373c838a9fSAndrew Rybchenko struct tlv_partition_trailer {
1383c838a9fSAndrew Rybchenko   uint32_t tag;
1393c838a9fSAndrew Rybchenko   uint32_t length;
1403c838a9fSAndrew Rybchenko   uint32_t generation;
1413c838a9fSAndrew Rybchenko   uint32_t checksum;
1423c838a9fSAndrew Rybchenko };
1433c838a9fSAndrew Rybchenko 
1443c838a9fSAndrew Rybchenko 
1453c838a9fSAndrew Rybchenko /* Appendable TLV partition header.
1463c838a9fSAndrew Rybchenko  *
1473c838a9fSAndrew Rybchenko  * In an appendable TLV partition, this must be the first item in the sequence,
1483c838a9fSAndrew Rybchenko  * at offset 0.  (Note that, unlike the configuration partitions, there is no
1493c838a9fSAndrew Rybchenko  * trailer before the TLV_TAG_END word.)
1503c838a9fSAndrew Rybchenko  */
1513c838a9fSAndrew Rybchenko 
1523c838a9fSAndrew Rybchenko #define TLV_TAG_APPENDABLE_PARTITION_HEADER (0xEF10ADA7)
1533c838a9fSAndrew Rybchenko 
1543c838a9fSAndrew Rybchenko struct tlv_appendable_partition_header {
1553c838a9fSAndrew Rybchenko   uint32_t tag;
1563c838a9fSAndrew Rybchenko   uint32_t length;
1573c838a9fSAndrew Rybchenko   uint16_t type_id;
1583c838a9fSAndrew Rybchenko   uint16_t reserved;
1593c838a9fSAndrew Rybchenko };
1603c838a9fSAndrew Rybchenko 
1613c838a9fSAndrew Rybchenko 
1623c838a9fSAndrew Rybchenko /* ----------------------------------------------------------------------------
1633c838a9fSAndrew Rybchenko  *  Configuration items
1643c838a9fSAndrew Rybchenko  * ----------------------------------------------------------------------------
1653c838a9fSAndrew Rybchenko  */
1663c838a9fSAndrew Rybchenko 
1673c838a9fSAndrew Rybchenko 
1683c838a9fSAndrew Rybchenko /* NIC global capabilities.
1693c838a9fSAndrew Rybchenko  */
1703c838a9fSAndrew Rybchenko 
1713c838a9fSAndrew Rybchenko #define TLV_TAG_GLOBAL_CAPABILITIES     (0x00010000)
1723c838a9fSAndrew Rybchenko 
1733c838a9fSAndrew Rybchenko struct tlv_global_capabilities {
1743c838a9fSAndrew Rybchenko   uint32_t tag;
1753c838a9fSAndrew Rybchenko   uint32_t length;
1763c838a9fSAndrew Rybchenko   uint32_t flags;
1773c838a9fSAndrew Rybchenko };
1783c838a9fSAndrew Rybchenko 
1793c838a9fSAndrew Rybchenko 
1803c838a9fSAndrew Rybchenko /* Siena-style per-port MAC address allocation.
1813c838a9fSAndrew Rybchenko  *
1823c838a9fSAndrew Rybchenko  * There are <count> addresses, starting at <base_address> and incrementing
1833c838a9fSAndrew Rybchenko  * by adding <stride> to the low-order byte(s).
1843c838a9fSAndrew Rybchenko  *
1853c838a9fSAndrew Rybchenko  * (See also TLV_TAG_GLOBAL_MAC for an alternative, specifying a global pool
1863c838a9fSAndrew Rybchenko  * of contiguous MAC addresses for the firmware to allocate as it sees fit.)
1873c838a9fSAndrew Rybchenko  */
1883c838a9fSAndrew Rybchenko 
1893c838a9fSAndrew Rybchenko #define TLV_TAG_PORT_MAC(port)          (0x00020000 + (port))
1903c838a9fSAndrew Rybchenko 
1913c838a9fSAndrew Rybchenko struct tlv_port_mac {
1923c838a9fSAndrew Rybchenko   uint32_t tag;
1933c838a9fSAndrew Rybchenko   uint32_t length;
1943c838a9fSAndrew Rybchenko   uint8_t  base_address[6];
1953c838a9fSAndrew Rybchenko   uint16_t reserved;
1963c838a9fSAndrew Rybchenko   uint16_t count;
1973c838a9fSAndrew Rybchenko   uint16_t stride;
1983c838a9fSAndrew Rybchenko };
1993c838a9fSAndrew Rybchenko 
2003c838a9fSAndrew Rybchenko 
2013c838a9fSAndrew Rybchenko /* Static VPD.
2023c838a9fSAndrew Rybchenko  *
2033c838a9fSAndrew Rybchenko  * This is the portion of VPD which is set at manufacturing time and not
2044d982a25SAndrew Rybchenko  * expected to change.  It is formatted as a standard PCI VPD block. There are
2054d982a25SAndrew Rybchenko  * global and per-pf TLVs for this, the global TLV is new for Medford and is
2064d982a25SAndrew Rybchenko  * used in preference to the per-pf TLV.
2073c838a9fSAndrew Rybchenko  */
2083c838a9fSAndrew Rybchenko 
2093c838a9fSAndrew Rybchenko #define TLV_TAG_PF_STATIC_VPD(pf)       (0x00030000 + (pf))
2103c838a9fSAndrew Rybchenko 
2113c838a9fSAndrew Rybchenko struct tlv_pf_static_vpd {
2123c838a9fSAndrew Rybchenko   uint32_t tag;
2133c838a9fSAndrew Rybchenko   uint32_t length;
2143c838a9fSAndrew Rybchenko   uint8_t  bytes[];
2153c838a9fSAndrew Rybchenko };
2163c838a9fSAndrew Rybchenko 
2174d982a25SAndrew Rybchenko #define TLV_TAG_GLOBAL_STATIC_VPD       (0x001f0000)
2184d982a25SAndrew Rybchenko 
2194d982a25SAndrew Rybchenko struct tlv_global_static_vpd {
2204d982a25SAndrew Rybchenko   uint32_t tag;
2214d982a25SAndrew Rybchenko   uint32_t length;
2224d982a25SAndrew Rybchenko   uint8_t  bytes[];
2234d982a25SAndrew Rybchenko };
2244d982a25SAndrew Rybchenko 
2253c838a9fSAndrew Rybchenko 
2263c838a9fSAndrew Rybchenko /* Dynamic VPD.
2273c838a9fSAndrew Rybchenko  *
2283c838a9fSAndrew Rybchenko  * This is the portion of VPD which may be changed (e.g. by firmware updates).
2294d982a25SAndrew Rybchenko  * It is formatted as a standard PCI VPD block. There are global and per-pf TLVs
2304d982a25SAndrew Rybchenko  * for this, the global TLV is new for Medford and is used in preference to the
2314d982a25SAndrew Rybchenko  * per-pf TLV.
2323c838a9fSAndrew Rybchenko  */
2333c838a9fSAndrew Rybchenko 
2343c838a9fSAndrew Rybchenko #define TLV_TAG_PF_DYNAMIC_VPD(pf)      (0x10030000 + (pf))
2353c838a9fSAndrew Rybchenko 
2363c838a9fSAndrew Rybchenko struct tlv_pf_dynamic_vpd {
2373c838a9fSAndrew Rybchenko   uint32_t tag;
2383c838a9fSAndrew Rybchenko   uint32_t length;
2393c838a9fSAndrew Rybchenko   uint8_t  bytes[];
2403c838a9fSAndrew Rybchenko };
2413c838a9fSAndrew Rybchenko 
2424d982a25SAndrew Rybchenko #define TLV_TAG_GLOBAL_DYNAMIC_VPD      (0x10200000)
2434d982a25SAndrew Rybchenko 
2444d982a25SAndrew Rybchenko struct tlv_global_dynamic_vpd {
2454d982a25SAndrew Rybchenko   uint32_t tag;
2464d982a25SAndrew Rybchenko   uint32_t length;
2474d982a25SAndrew Rybchenko   uint8_t  bytes[];
2484d982a25SAndrew Rybchenko };
2494d982a25SAndrew Rybchenko 
2503c838a9fSAndrew Rybchenko 
2513c838a9fSAndrew Rybchenko /* "DBI" PCI config space changes.
2523c838a9fSAndrew Rybchenko  *
2533c838a9fSAndrew Rybchenko  * This is a set of edits made to the default PCI config space values before
2544d982a25SAndrew Rybchenko  * the device is allowed to enumerate. There are global and per-pf TLVs for
2554d982a25SAndrew Rybchenko  * this, the global TLV is new for Medford and is used in preference to the
2564d982a25SAndrew Rybchenko  * per-pf TLV.
2573c838a9fSAndrew Rybchenko  */
2583c838a9fSAndrew Rybchenko 
2593c838a9fSAndrew Rybchenko #define TLV_TAG_PF_DBI(pf)              (0x00040000 + (pf))
2603c838a9fSAndrew Rybchenko 
2613c838a9fSAndrew Rybchenko struct tlv_pf_dbi {
2623c838a9fSAndrew Rybchenko   uint32_t tag;
2633c838a9fSAndrew Rybchenko   uint32_t length;
2643c838a9fSAndrew Rybchenko   struct {
2653c838a9fSAndrew Rybchenko     uint16_t addr;
2663c838a9fSAndrew Rybchenko     uint16_t byte_enables;
2673c838a9fSAndrew Rybchenko     uint32_t value;
2683c838a9fSAndrew Rybchenko   } items[];
2693c838a9fSAndrew Rybchenko };
2703c838a9fSAndrew Rybchenko 
2713c838a9fSAndrew Rybchenko 
2724d982a25SAndrew Rybchenko #define TLV_TAG_GLOBAL_DBI              (0x00210000)
2734d982a25SAndrew Rybchenko 
2744d982a25SAndrew Rybchenko struct tlv_global_dbi {
2754d982a25SAndrew Rybchenko   uint32_t tag;
2764d982a25SAndrew Rybchenko   uint32_t length;
2774d982a25SAndrew Rybchenko   struct {
2784d982a25SAndrew Rybchenko     uint16_t addr;
2794d982a25SAndrew Rybchenko     uint16_t byte_enables;
2804d982a25SAndrew Rybchenko     uint32_t value;
2814d982a25SAndrew Rybchenko   } items[];
2824d982a25SAndrew Rybchenko };
2834d982a25SAndrew Rybchenko 
2844d982a25SAndrew Rybchenko 
2853c838a9fSAndrew Rybchenko /* Partition subtype codes.
2863c838a9fSAndrew Rybchenko  *
2873c838a9fSAndrew Rybchenko  * A subtype may optionally be stored for each type of partition present in
2883c838a9fSAndrew Rybchenko  * the NVRAM.  For example, this may be used to allow a generic firmware update
2893c838a9fSAndrew Rybchenko  * utility to select a specific variant of firmware for a specific variant of
2903c838a9fSAndrew Rybchenko  * board.
2913c838a9fSAndrew Rybchenko  *
2923c838a9fSAndrew Rybchenko  * The description[] field is an optional string which is returned in the
2933c838a9fSAndrew Rybchenko  * MC_CMD_NVRAM_METADATA response if present.
2943c838a9fSAndrew Rybchenko  */
2953c838a9fSAndrew Rybchenko 
2963c838a9fSAndrew Rybchenko #define TLV_TAG_PARTITION_SUBTYPE(type) (0x00050000 + (type))
2973c838a9fSAndrew Rybchenko 
2983c838a9fSAndrew Rybchenko struct tlv_partition_subtype {
2993c838a9fSAndrew Rybchenko   uint32_t tag;
3003c838a9fSAndrew Rybchenko   uint32_t length;
3013c838a9fSAndrew Rybchenko   uint32_t subtype;
3023c838a9fSAndrew Rybchenko   uint8_t  description[];
3033c838a9fSAndrew Rybchenko };
3043c838a9fSAndrew Rybchenko 
3053c838a9fSAndrew Rybchenko 
3063c838a9fSAndrew Rybchenko /* Partition version codes.
3073c838a9fSAndrew Rybchenko  *
3083c838a9fSAndrew Rybchenko  * A version may optionally be stored for each type of partition present in
3093c838a9fSAndrew Rybchenko  * the NVRAM.  This provides a standard way of tracking the currently stored
3103c838a9fSAndrew Rybchenko  * version of each of the various component images.
3113c838a9fSAndrew Rybchenko  */
3123c838a9fSAndrew Rybchenko 
3133c838a9fSAndrew Rybchenko #define TLV_TAG_PARTITION_VERSION(type) (0x10060000 + (type))
3143c838a9fSAndrew Rybchenko 
3153c838a9fSAndrew Rybchenko struct tlv_partition_version {
3163c838a9fSAndrew Rybchenko   uint32_t tag;
3173c838a9fSAndrew Rybchenko   uint32_t length;
3183c838a9fSAndrew Rybchenko   uint16_t version_w;
3193c838a9fSAndrew Rybchenko   uint16_t version_x;
3203c838a9fSAndrew Rybchenko   uint16_t version_y;
3213c838a9fSAndrew Rybchenko   uint16_t version_z;
3223c838a9fSAndrew Rybchenko };
3233c838a9fSAndrew Rybchenko 
3243c838a9fSAndrew Rybchenko /* Global PCIe configuration */
3253c838a9fSAndrew Rybchenko 
3263c838a9fSAndrew Rybchenko #define TLV_TAG_GLOBAL_PCIE_CONFIG (0x10070000)
3273c838a9fSAndrew Rybchenko 
3283c838a9fSAndrew Rybchenko struct tlv_pcie_config {
3293c838a9fSAndrew Rybchenko   uint32_t tag;
3303c838a9fSAndrew Rybchenko   uint32_t length;
3313c838a9fSAndrew Rybchenko   int16_t max_pf_number;                        /**< Largest PF RID (lower PFs may be hidden) */
3323c838a9fSAndrew Rybchenko   uint16_t pf_aper;                             /**< BIU aperture for PF BAR2 */
3333c838a9fSAndrew Rybchenko   uint16_t vf_aper;                             /**< BIU aperture for VF BAR0 */
3343c838a9fSAndrew Rybchenko   uint16_t int_aper;                            /**< BIU aperture for PF BAR4 and VF BAR2 */
3353c838a9fSAndrew Rybchenko #define TLV_MAX_PF_DEFAULT (-1)                 /* Use FW default for largest PF RID  */
3363c838a9fSAndrew Rybchenko #define TLV_APER_DEFAULT (0xFFFF)               /* Use FW default for a given aperture */
3373c838a9fSAndrew Rybchenko };
3383c838a9fSAndrew Rybchenko 
3393c838a9fSAndrew Rybchenko /* Per-PF configuration. Note that not all these fields are necessarily useful
3403c838a9fSAndrew Rybchenko  * as the apertures are constrained by the BIU settings (the one case we do
3413c838a9fSAndrew Rybchenko  * use is to make BAR2 bigger than the BIU thinks to reserve space), but we can
3423c838a9fSAndrew Rybchenko  * tidy things up later */
3433c838a9fSAndrew Rybchenko 
3443c838a9fSAndrew Rybchenko #define TLV_TAG_PF_PCIE_CONFIG(pf)  (0x10080000 + (pf))
3453c838a9fSAndrew Rybchenko 
3463c838a9fSAndrew Rybchenko struct tlv_per_pf_pcie_config {
3473c838a9fSAndrew Rybchenko   uint32_t tag;
3483c838a9fSAndrew Rybchenko   uint32_t length;
3493c838a9fSAndrew Rybchenko   uint8_t vfs_total;
3503c838a9fSAndrew Rybchenko   uint8_t port_allocation;
3513c838a9fSAndrew Rybchenko   uint16_t vectors_per_pf;
3523c838a9fSAndrew Rybchenko   uint16_t vectors_per_vf;
3533c838a9fSAndrew Rybchenko   uint8_t pf_bar0_aperture;
3543c838a9fSAndrew Rybchenko   uint8_t pf_bar2_aperture;
3553c838a9fSAndrew Rybchenko   uint8_t vf_bar0_aperture;
3563c838a9fSAndrew Rybchenko   uint8_t vf_base;
3573c838a9fSAndrew Rybchenko   uint16_t supp_pagesz;
3583c838a9fSAndrew Rybchenko   uint16_t msix_vec_base;
3593c838a9fSAndrew Rybchenko };
3603c838a9fSAndrew Rybchenko 
3613c838a9fSAndrew Rybchenko 
3623c838a9fSAndrew Rybchenko /* Development ONLY. This is a single TLV tag for all the gubbins
3633c838a9fSAndrew Rybchenko  * that can be set through the MC command-line other than the PCIe
3643c838a9fSAndrew Rybchenko  * settings. This is a temporary measure. */
3654d982a25SAndrew Rybchenko #define TLV_TAG_TMP_GUBBINS (0x10090000)        /* legacy symbol - do not use */
3664d982a25SAndrew Rybchenko #define TLV_TAG_TMP_GUBBINS_HUNT TLV_TAG_TMP_GUBBINS
3673c838a9fSAndrew Rybchenko 
3683c838a9fSAndrew Rybchenko struct tlv_tmp_gubbins {
3693c838a9fSAndrew Rybchenko   uint32_t tag;
3703c838a9fSAndrew Rybchenko   uint32_t length;
3713c838a9fSAndrew Rybchenko   /* Consumed by dpcpu.c */
3723c838a9fSAndrew Rybchenko   uint64_t tx0_tags;     /* Bitmap */
3733c838a9fSAndrew Rybchenko   uint64_t tx1_tags;     /* Bitmap */
3743c838a9fSAndrew Rybchenko   uint64_t dl_tags;      /* Bitmap */
3753c838a9fSAndrew Rybchenko   uint32_t flags;
376501fe79dSAndrew Rybchenko #define TLV_DPCPU_TX_STRIPE (1) /* No longer used, has no effect */
3773c838a9fSAndrew Rybchenko #define TLV_DPCPU_BIU_TAGS  (2) /* Use BIU tag manager */
3783c838a9fSAndrew Rybchenko #define TLV_DPCPU_TX0_TAGS  (4) /* tx0_tags is valid */
3793c838a9fSAndrew Rybchenko #define TLV_DPCPU_TX1_TAGS  (8) /* tx1_tags is valid */
3803c838a9fSAndrew Rybchenko #define TLV_DPCPU_DL_TAGS  (16) /* dl_tags is valid */
3813c838a9fSAndrew Rybchenko   /* Consumed by features.c */
3823c838a9fSAndrew Rybchenko   uint32_t dut_features;        /* All 1s -> leave alone */
3833c838a9fSAndrew Rybchenko   int8_t with_rmon;             /* 0 -> off, 1 -> on, -1 -> leave alone */
3843c838a9fSAndrew Rybchenko   /* Consumed by clocks_hunt.c */
3853c838a9fSAndrew Rybchenko   int8_t clk_mode;             /* 0 -> off, 1 -> on, -1 -> leave alone */
3865a59cbc9SAndrew Rybchenko   /* No longer used, superseded by TLV_TAG_DESCRIPTOR_CACHE_CONFIG. */
3873c838a9fSAndrew Rybchenko   int8_t rx_dc_size;           /* -1 -> leave alone */
3883c838a9fSAndrew Rybchenko   int8_t tx_dc_size;
3893c838a9fSAndrew Rybchenko   int16_t num_q_allocs;
3903c838a9fSAndrew Rybchenko };
3913c838a9fSAndrew Rybchenko 
3923c838a9fSAndrew Rybchenko /* Global port configuration
3933c838a9fSAndrew Rybchenko  *
3943c838a9fSAndrew Rybchenko  * This is now deprecated in favour of a platform-provided default
3953c838a9fSAndrew Rybchenko  * and dynamic config override via tlv_global_port_options.
3963c838a9fSAndrew Rybchenko  */
3973c838a9fSAndrew Rybchenko #define TLV_TAG_GLOBAL_PORT_CONFIG      (0x000a0000)
3983c838a9fSAndrew Rybchenko 
3993c838a9fSAndrew Rybchenko struct tlv_global_port_config {
4003c838a9fSAndrew Rybchenko   uint32_t tag;
4013c838a9fSAndrew Rybchenko   uint32_t length;
4023c838a9fSAndrew Rybchenko   uint32_t ports_per_core;
4033c838a9fSAndrew Rybchenko   uint32_t max_port_speed;
4043c838a9fSAndrew Rybchenko };
4053c838a9fSAndrew Rybchenko 
4063c838a9fSAndrew Rybchenko 
4073c838a9fSAndrew Rybchenko /* Firmware options.
4083c838a9fSAndrew Rybchenko  *
4093c838a9fSAndrew Rybchenko  * This is intended for user-configurable selection of optional firmware
4103c838a9fSAndrew Rybchenko  * features and variants.
4113c838a9fSAndrew Rybchenko  *
4123c838a9fSAndrew Rybchenko  * Initially, this consists only of the satellite CPU firmware variant
4133c838a9fSAndrew Rybchenko  * selection, but this tag could be extended in the future (using the
4143c838a9fSAndrew Rybchenko  * tag length to determine whether additional fields are present).
4153c838a9fSAndrew Rybchenko  */
4163c838a9fSAndrew Rybchenko 
4173c838a9fSAndrew Rybchenko #define TLV_TAG_FIRMWARE_OPTIONS        (0x100b0000)
4183c838a9fSAndrew Rybchenko 
4193c838a9fSAndrew Rybchenko struct tlv_firmware_options {
4203c838a9fSAndrew Rybchenko   uint32_t tag;
4213c838a9fSAndrew Rybchenko   uint32_t length;
4223c838a9fSAndrew Rybchenko   uint32_t firmware_variant;
4233c838a9fSAndrew Rybchenko #define TLV_FIRMWARE_VARIANT_DRIVER_SELECTED (0xffffffff)
4243c838a9fSAndrew Rybchenko 
4253c838a9fSAndrew Rybchenko /* These are the values for overriding the driver's choice; the definitions
4263c838a9fSAndrew Rybchenko  * are taken from MCDI so that they don't get out of step.  Include
4273c838a9fSAndrew Rybchenko  * <ci/mgmt/mc_driver_pcol.h> or the equivalent from your driver's tree if
4283c838a9fSAndrew Rybchenko  * you need to use these constants.
4293c838a9fSAndrew Rybchenko  */
4303c838a9fSAndrew Rybchenko #define TLV_FIRMWARE_VARIANT_FULL_FEATURED   MC_CMD_FW_FULL_FEATURED
4313c838a9fSAndrew Rybchenko #define TLV_FIRMWARE_VARIANT_LOW_LATENCY     MC_CMD_FW_LOW_LATENCY
4323c838a9fSAndrew Rybchenko #define TLV_FIRMWARE_VARIANT_PACKED_STREAM   MC_CMD_FW_PACKED_STREAM
4333c838a9fSAndrew Rybchenko #define TLV_FIRMWARE_VARIANT_HIGH_TX_RATE    MC_CMD_FW_HIGH_TX_RATE
4343c838a9fSAndrew Rybchenko #define TLV_FIRMWARE_VARIANT_PACKED_STREAM_HASH_MODE_1 \
4353c838a9fSAndrew Rybchenko                                              MC_CMD_FW_PACKED_STREAM_HASH_MODE_1
4364af6e4dfSAndrew Rybchenko #define TLV_FIRMWARE_VARIANT_RULES_ENGINE    MC_CMD_FW_RULES_ENGINE
4373c838a9fSAndrew Rybchenko };
4383c838a9fSAndrew Rybchenko 
4393c838a9fSAndrew Rybchenko /* Voltage settings
4403c838a9fSAndrew Rybchenko  *
4413c838a9fSAndrew Rybchenko  * Intended for boards with A0 silicon where the core voltage may
4423c838a9fSAndrew Rybchenko  * need tweaking. Most likely set once when the pass voltage is
4433c838a9fSAndrew Rybchenko  * determined. */
4443c838a9fSAndrew Rybchenko 
4453c838a9fSAndrew Rybchenko #define TLV_TAG_0V9_SETTINGS (0x000c0000)
4463c838a9fSAndrew Rybchenko 
4473c838a9fSAndrew Rybchenko struct tlv_0v9_settings {
4483c838a9fSAndrew Rybchenko   uint32_t tag;
4493c838a9fSAndrew Rybchenko   uint32_t length;
4503c838a9fSAndrew Rybchenko   uint16_t flags; /* Boards with high 0v9 settings may need active cooling */
4513c838a9fSAndrew Rybchenko #define TLV_TAG_0V9_REQUIRES_FAN (1)
4523c838a9fSAndrew Rybchenko   uint16_t target_voltage; /* In millivolts */
4533c838a9fSAndrew Rybchenko   /* Since the limits are meant to be centred to the target (and must at least
4543c838a9fSAndrew Rybchenko    * contain it) they need setting as well. */
4553c838a9fSAndrew Rybchenko   uint16_t warn_low;       /* In millivolts */
4563c838a9fSAndrew Rybchenko   uint16_t warn_high;      /* In millivolts */
4573c838a9fSAndrew Rybchenko   uint16_t panic_low;      /* In millivolts */
4583c838a9fSAndrew Rybchenko   uint16_t panic_high;     /* In millivolts */
4593c838a9fSAndrew Rybchenko };
4603c838a9fSAndrew Rybchenko 
4613c838a9fSAndrew Rybchenko 
4623c838a9fSAndrew Rybchenko /* Clock configuration */
4633c838a9fSAndrew Rybchenko 
4644d982a25SAndrew Rybchenko #define TLV_TAG_CLOCK_CONFIG       (0x000d0000) /* legacy symbol - do not use */
4654d982a25SAndrew Rybchenko #define TLV_TAG_CLOCK_CONFIG_HUNT  TLV_TAG_CLOCK_CONFIG
4663c838a9fSAndrew Rybchenko 
4673c838a9fSAndrew Rybchenko struct tlv_clock_config {
4683c838a9fSAndrew Rybchenko   uint32_t tag;
4693c838a9fSAndrew Rybchenko   uint32_t length;
4703c838a9fSAndrew Rybchenko   uint16_t clk_sys;        /* MHz */
4713c838a9fSAndrew Rybchenko   uint16_t clk_dpcpu;      /* MHz */
4723c838a9fSAndrew Rybchenko   uint16_t clk_icore;      /* MHz */
4733c838a9fSAndrew Rybchenko   uint16_t clk_pcs;        /* MHz */
4743c838a9fSAndrew Rybchenko };
4753c838a9fSAndrew Rybchenko 
4763c838a9fSAndrew Rybchenko #define TLV_TAG_CLOCK_CONFIG_MEDFORD      (0x00100000)
4773c838a9fSAndrew Rybchenko 
4783c838a9fSAndrew Rybchenko struct tlv_clock_config_medford {
4793c838a9fSAndrew Rybchenko   uint32_t tag;
4803c838a9fSAndrew Rybchenko   uint32_t length;
4813c838a9fSAndrew Rybchenko   uint16_t clk_sys;        /* MHz */
4823c838a9fSAndrew Rybchenko   uint16_t clk_mc;         /* MHz */
4833c838a9fSAndrew Rybchenko   uint16_t clk_rmon;       /* MHz */
4843c838a9fSAndrew Rybchenko   uint16_t clk_vswitch;    /* MHz */
4853c838a9fSAndrew Rybchenko   uint16_t clk_dpcpu;      /* MHz */
4863c838a9fSAndrew Rybchenko   uint16_t clk_pcs;        /* MHz */
4873c838a9fSAndrew Rybchenko };
4883c838a9fSAndrew Rybchenko 
4893c838a9fSAndrew Rybchenko 
4903c838a9fSAndrew Rybchenko /* EF10-style global pool of MAC addresses.
4913c838a9fSAndrew Rybchenko  *
4923c838a9fSAndrew Rybchenko  * There are <count> addresses, starting at <base_address>, which are
4933c838a9fSAndrew Rybchenko  * contiguous.  Firmware is responsible for allocating addresses from this
4943c838a9fSAndrew Rybchenko  * pool to ports / PFs as appropriate.
4953c838a9fSAndrew Rybchenko  */
4963c838a9fSAndrew Rybchenko 
4973c838a9fSAndrew Rybchenko #define TLV_TAG_GLOBAL_MAC              (0x000e0000)
4983c838a9fSAndrew Rybchenko 
4993c838a9fSAndrew Rybchenko struct tlv_global_mac {
5003c838a9fSAndrew Rybchenko   uint32_t tag;
5013c838a9fSAndrew Rybchenko   uint32_t length;
5023c838a9fSAndrew Rybchenko   uint8_t  base_address[6];
5033c838a9fSAndrew Rybchenko   uint16_t reserved1;
5043c838a9fSAndrew Rybchenko   uint16_t count;
5053c838a9fSAndrew Rybchenko   uint16_t reserved2;
5063c838a9fSAndrew Rybchenko };
5073c838a9fSAndrew Rybchenko 
5084d982a25SAndrew Rybchenko #define TLV_TAG_ATB_0V9_TARGET     (0x000f0000) /* legacy symbol - do not use */
5094d982a25SAndrew Rybchenko #define TLV_TAG_ATB_0V9_TARGET_HUNT     TLV_TAG_ATB_0V9_TARGET
5103c838a9fSAndrew Rybchenko 
5113c838a9fSAndrew Rybchenko /* The target value for the 0v9 power rail measured on-chip at the
5123c838a9fSAndrew Rybchenko  * analogue test bus */
5133c838a9fSAndrew Rybchenko struct tlv_0v9_atb_target {
5143c838a9fSAndrew Rybchenko   uint32_t tag;
5153c838a9fSAndrew Rybchenko   uint32_t length;
5163c838a9fSAndrew Rybchenko   uint16_t millivolts;
5173c838a9fSAndrew Rybchenko   uint16_t reserved;
5183c838a9fSAndrew Rybchenko };
5193c838a9fSAndrew Rybchenko 
5203c838a9fSAndrew Rybchenko /* Global PCIe configuration, second revision. This represents the visible PFs
5213c838a9fSAndrew Rybchenko  * by a bitmap rather than having the number of the highest visible one. As such
5223c838a9fSAndrew Rybchenko  * it can (for a 16-PF chip) represent a superset of what TLV_TAG_GLOBAL_PCIE_CONFIG
5233c838a9fSAndrew Rybchenko  * can and it should be used in place of that tag in future (but compatibility with
5243c838a9fSAndrew Rybchenko  * the old tag will be left in the firmware indefinitely).  */
5253c838a9fSAndrew Rybchenko 
5263c838a9fSAndrew Rybchenko #define TLV_TAG_GLOBAL_PCIE_CONFIG_R2 (0x10100000)
5273c838a9fSAndrew Rybchenko 
5283c838a9fSAndrew Rybchenko struct tlv_pcie_config_r2 {
5293c838a9fSAndrew Rybchenko   uint32_t tag;
5303c838a9fSAndrew Rybchenko   uint32_t length;
5313c838a9fSAndrew Rybchenko   uint16_t visible_pfs;                         /**< Bitmap of visible PFs */
5323c838a9fSAndrew Rybchenko   uint16_t pf_aper;                             /**< BIU aperture for PF BAR2 */
5333c838a9fSAndrew Rybchenko   uint16_t vf_aper;                             /**< BIU aperture for VF BAR0 */
5343c838a9fSAndrew Rybchenko   uint16_t int_aper;                            /**< BIU aperture for PF BAR4 and VF BAR2 */
5353c838a9fSAndrew Rybchenko };
5363c838a9fSAndrew Rybchenko 
5373c838a9fSAndrew Rybchenko /* Dynamic port mode.
5383c838a9fSAndrew Rybchenko  *
5393c838a9fSAndrew Rybchenko  * Allows selecting alternate port configuration for platforms that support it
5403c838a9fSAndrew Rybchenko  * (e.g. 1x40G vs 2x10G on Milano, 1x40G vs 4x10G on Medford). This affects the
5413c838a9fSAndrew Rybchenko  * number of externally visible ports (and, hence, PF to port mapping), so must
5423c838a9fSAndrew Rybchenko  * be done at boot time.
5433c838a9fSAndrew Rybchenko  *
5449ed106d0SAndrew Rybchenko  * Port mode naming convention is
5459ed106d0SAndrew Rybchenko  *
5469ed106d0SAndrew Rybchenko  * [nports_on_cage0]x[port_lane_width]_[nports_on_cage1]x[port_lane_width]
5479ed106d0SAndrew Rybchenko  *
5489ed106d0SAndrew Rybchenko  * Port lane width determines the capabilities (speeds) of the ports, subject
5499ed106d0SAndrew Rybchenko  * to architecture capabilities (e.g. 25G support) and switch bandwidth
5509ed106d0SAndrew Rybchenko  * constraints:
5519ed106d0SAndrew Rybchenko  *  - single lane ports can do 25G/10G/1G
5529ed106d0SAndrew Rybchenko  *  - dual lane ports can do 50G/25G/10G/1G (with fallback to 1 lane)
5539ed106d0SAndrew Rybchenko  *  - quad lane ports can do 100G/40G/50G/25G/10G/1G (with fallback to 2 or 1 lanes)
5549ed106d0SAndrew Rybchenko 
5553c838a9fSAndrew Rybchenko  * This tag supercedes tlv_global_port_config.
5563c838a9fSAndrew Rybchenko  */
5573c838a9fSAndrew Rybchenko 
5583c838a9fSAndrew Rybchenko #define TLV_TAG_GLOBAL_PORT_MODE         (0x10110000)
5593c838a9fSAndrew Rybchenko 
5603c838a9fSAndrew Rybchenko struct tlv_global_port_mode {
5613c838a9fSAndrew Rybchenko   uint32_t tag;
5623c838a9fSAndrew Rybchenko   uint32_t length;
5633c838a9fSAndrew Rybchenko   uint32_t port_mode;
5643c838a9fSAndrew Rybchenko #define TLV_PORT_MODE_DEFAULT           (0xffffffff) /* Default for given platform */
5659ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_1x1_NA                     (0) /* Single 10G/25G on mdi0 */
5669ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_1x4_NA                     (1) /* Single 100G/40G on mdi0 */
5679ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_NA_1x4                     (22) /* Single 100G/40G on mdi1 */
5689ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_1x2_NA                     (10) /* Single 50G on mdi0 */
5699ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_NA_1x2                     (11) /* Single 50G on mdi1 */
5709ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_1x1_1x1                    (2) /* Single 10G/25G on mdi0, single 10G/25G on mdi1 */
5719ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_1x4_1x4                    (3) /* Single 40G on mdi0, single 40G on mdi1 */
5729ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_2x1_2x1                    (4) /* Dual 10G/25G on mdi0, dual 10G/25G on mdi1 - WARNING: bug3720: On Newport only, this is actually Quad 10G on mdi0 */
5739ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_4x1_NA                     (5) /* Quad 10G/25G on mdi0 */
5749ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_NA_4x1                     (8) /* Quad 10G/25G on mdi1 */
5759ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_1x4_2x1                    (6) /* Single 40G on mdi0, dual 10G/25G on mdi1 */
5769ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_2x1_1x4                    (7) /* Dual 10G/25G on mdi0, single 40G on mdi1 */
5779ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_1x2_1x2                    (12) /* Single 50G on mdi0, single 50G on mdi1 */
5789ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_2x2_NA                     (13) /* Dual 50G on mdi0 */
5799ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_NA_2x2                     (14) /* Dual 50G on mdi1 */
5809ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_1x4_1x2                    (15) /* Single 40G on mdi0, single 50G on mdi1 */
5819ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_1x2_1x4                    (16) /* Single 50G on mdi0, single 40G on mdi1 */
5829ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_1x2_2x1                    (17) /* Single 50G on mdi0, dual 10G/25G on mdi1 */
5839ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_2x1_1x2                    (18) /* Dual 10G/25G on mdi0, single 50G on mdi1 */
584*6d522ee0SAndrew Rybchenko /* Below modes are eftest only, to allow snapper explicit selection between multi-channel and LLPCS. In production, this selection is automatic and outside world should not care about LLPCS */
5859ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_2x1_2x1_LL                 (19) /* Dual 10G/25G on mdi0, dual 10G/25G on mdi1, low-latency PCS */
5869ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_4x1_NA_LL                  (20) /* Quad 10G/25G on mdi0, low-latency PCS */
5879ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_NA_4x1_LL                  (21) /* Quad 10G/25G on mdi1, low-latency PCS */
5889ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_1x1_NA_LL                  (23) /* Single 10G/25G on mdi0, low-latency PCS */
5899ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_1x1_1x1_LL                 (24) /* Single 10G/25G on mdi0, single 10G/25G on mdi1, low-latency PCS */
5909ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_BUG63720_DO_NOT_USE        (9) /* bug63720: Do not use */
5919ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_MAX TLV_PORT_MODE_1x1_1x1_LL
5929ed106d0SAndrew Rybchenko 
5939ed106d0SAndrew Rybchenko /* Deprecated aliases */
5949ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_10G                        TLV_PORT_MODE_1x1_NA
5959ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_40G                        TLV_PORT_MODE_1x4_NA
5969ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_10G_10G                    TLV_PORT_MODE_1x1_1x1
5979ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_40G_40G                    TLV_PORT_MODE_1x4_1x4
5989ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_10G_10G_10G_10G            TLV_PORT_MODE_2x1_2x1
5999ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_10G_10G_10G_10G_Q1         TLV_PORT_MODE_2x1_2x1 /* bug63720: Do not use */
6009ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_10G_10G_10G_10G_Q          TLV_PORT_MODE_4x1_NA
6019ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_40G_10G_10G                TLV_PORT_MODE_1x4_2x1
6029ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_10G_10G_40G                TLV_PORT_MODE_2x1_1x4
6039ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_10G_10G_10G_10G_Q2         TLV_PORT_MODE_NA_4x1
6049ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_10G_10G_10G_10G_Q1_Q2      TLV_PORT_MODE_BUG63720_DO_NOT_USE /* bug63720: Do not use */
6059ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_25G                        TLV_PORT_MODE_1x1_NA     /* Single 25G on mdi0 */
6069ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_100G_Q1                    TLV_PORT_MODE_1x4_NA     /* Single 100G on mdi0 */
6079ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_100G_Q2                    TLV_PORT_MODE_NA_1x4     /* Single 100G on mdi1 */
6089ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_50G_Q1                     TLV_PORT_MODE_1x2_NA     /* Single 50G on mdi0 */
6099ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_50G_Q2                     TLV_PORT_MODE_NA_1x2     /* Single 50G on mdi1 */
6109ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_25G_25G                    TLV_PORT_MODE_1x1_1x1    /* Single 25G on mdi0, single 25G on mdi1 */
6119ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_25G_25G_25G_25G_Q1_Q2      TLV_PORT_MODE_2x1_2x1    /* Dual 25G on mdi0, dual 25G on mdi1 */
6129ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_25G_25G_25G_25G_Q1         TLV_PORT_MODE_4x1_NA     /* Quad 25G on mdi0 */
6139ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_25G_25G_25G_25G_Q2         TLV_PORT_MODE_NA_4x1     /* Quad 25G on mdi1 */
6149ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_40G_25G_25G                TLV_PORT_MODE_1x4_2x1    /* Single 40G on mdi0, dual 25G on mdi1 */
6159ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_25G_25G_40G                TLV_PORT_MODE_2x1_1x4    /* Dual 25G on mdi0, single 40G on mdi1 */
6169ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_50G_50G_Q1_Q2              TLV_PORT_MODE_1x2_1x2    /* Single 50G on mdi0, single 50G on mdi1 */
6179ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_50G_50G_Q1                 TLV_PORT_MODE_2x2_NA     /* Dual 50G on mdi0 */
6189ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_50G_50G_Q2                 TLV_PORT_MODE_NA_2x2     /* Dual 50G on mdi1 */
6199ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_40G_50G                    TLV_PORT_MODE_1x4_1x2    /* Single 40G on mdi0, single 50G on mdi1 */
6209ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_50G_40G                    TLV_PORT_MODE_1x2_1x4    /* Single 50G on mdi0, single 40G on mdi1 */
6219ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_50G_25G_25G                TLV_PORT_MODE_1x2_2x1    /* Single 50G on mdi0, dual 25G on mdi1 */
6229ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_25G_25G_50G                TLV_PORT_MODE_2x1_1x2    /* Dual 25G on mdi0, single 50G on mdi1 */
623*6d522ee0SAndrew Rybchenko /* eftest only, see comments for _LL modes above */
6249ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_25G_25G_25G_25G_Q1_Q2_LL   TLV_PORT_MODE_2x1_2x1_LL /* Dual 25G on mdi0, dual 25G on mdi1, low-latency PCS */
6259ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_25G_25G_25G_25G_Q1_LL      TLV_PORT_MODE_4x1_NA_LL  /* Quad 25G on mdi0, low-latency PCS */
6269ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_25G_25G_25G_25G_Q2_LL      TLV_PORT_MODE_NA_4x1_LL  /* Quad 25G on mdi1, low-latency PCS */
6279ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_25G_LL                     TLV_PORT_MODE_1x1_NA_LL  /* Single 10G/25G on mdi0, low-latency PCS */
6289ed106d0SAndrew Rybchenko #define TLV_PORT_MODE_25G_25G_LL                 TLV_PORT_MODE_1x1_1x1_LL /* Single 10G/25G on mdi0, single 10G/25G on mdi1, low-latency PCS */
6293c838a9fSAndrew Rybchenko };
6303c838a9fSAndrew Rybchenko 
6313c838a9fSAndrew Rybchenko /* Type of the v-switch created implicitly by the firmware */
6323c838a9fSAndrew Rybchenko 
6333c838a9fSAndrew Rybchenko #define TLV_TAG_VSWITCH_TYPE(port)       (0x10120000 + (port))
6343c838a9fSAndrew Rybchenko 
6353c838a9fSAndrew Rybchenko struct tlv_vswitch_type {
6363c838a9fSAndrew Rybchenko   uint32_t tag;
6373c838a9fSAndrew Rybchenko   uint32_t length;
6383c838a9fSAndrew Rybchenko   uint32_t vswitch_type;
6393c838a9fSAndrew Rybchenko #define TLV_VSWITCH_TYPE_DEFAULT        (0xffffffff) /* Firmware default; equivalent to no TLV present for a given port */
6403c838a9fSAndrew Rybchenko #define TLV_VSWITCH_TYPE_NONE                    (0)
6413c838a9fSAndrew Rybchenko #define TLV_VSWITCH_TYPE_VLAN                    (1)
6423c838a9fSAndrew Rybchenko #define TLV_VSWITCH_TYPE_VEB                     (2)
6433c838a9fSAndrew Rybchenko #define TLV_VSWITCH_TYPE_VEPA                    (3)
6443c838a9fSAndrew Rybchenko #define TLV_VSWITCH_TYPE_MUX                     (4)
6453c838a9fSAndrew Rybchenko #define TLV_VSWITCH_TYPE_TEST                    (5)
6463c838a9fSAndrew Rybchenko };
6473c838a9fSAndrew Rybchenko 
6483c838a9fSAndrew Rybchenko /* A VLAN tag for the v-port created implicitly by the firmware */
6493c838a9fSAndrew Rybchenko 
6503c838a9fSAndrew Rybchenko #define TLV_TAG_VPORT_VLAN_TAG(pf)               (0x10130000 + (pf))
6513c838a9fSAndrew Rybchenko 
6523c838a9fSAndrew Rybchenko struct tlv_vport_vlan_tag {
6533c838a9fSAndrew Rybchenko   uint32_t tag;
6543c838a9fSAndrew Rybchenko   uint32_t length;
6553c838a9fSAndrew Rybchenko   uint32_t vlan_tag;
6563c838a9fSAndrew Rybchenko #define TLV_VPORT_NO_VLAN_TAG                    (0xFFFFFFFF) /* Default in the absence of TLV for a given PF */
6573c838a9fSAndrew Rybchenko };
6583c838a9fSAndrew Rybchenko 
6593c838a9fSAndrew Rybchenko /* Offset to be applied to the 0v9 setting, wherever it came from */
6603c838a9fSAndrew Rybchenko 
6613c838a9fSAndrew Rybchenko #define TLV_TAG_ATB_0V9_OFFSET           (0x10140000)
6623c838a9fSAndrew Rybchenko 
6633c838a9fSAndrew Rybchenko struct tlv_0v9_atb_offset {
6643c838a9fSAndrew Rybchenko   uint32_t tag;
6653c838a9fSAndrew Rybchenko   uint32_t length;
6663c838a9fSAndrew Rybchenko   int16_t  offset_millivolts;
6673c838a9fSAndrew Rybchenko   uint16_t reserved;
6683c838a9fSAndrew Rybchenko };
6693c838a9fSAndrew Rybchenko 
6703c838a9fSAndrew Rybchenko /* A privilege mask given on reset to all non-admin PCIe functions (that is other than first-PF-per-port).
6713c838a9fSAndrew Rybchenko  * The meaning of particular bits is defined in mcdi_ef10.yml under MC_CMD_PRIVILEGE_MASK, see also bug 44583.
6723c838a9fSAndrew Rybchenko  * TLV_TAG_PRIVILEGE_MASK_ADD specifies bits that should be added (ORed) to firmware default while
6733c838a9fSAndrew Rybchenko  * TLV_TAG_PRIVILEGE_MASK_REM specifies bits that should be removed (ANDed) from firmware default:
6743c838a9fSAndrew Rybchenko  * Initial_privilege_mask = (firmware_default_mask | privilege_mask_add) & ~privilege_mask_rem */
6753c838a9fSAndrew Rybchenko 
6763c838a9fSAndrew Rybchenko #define TLV_TAG_PRIVILEGE_MASK          (0x10150000) /* legacy symbol - do not use */
6773c838a9fSAndrew Rybchenko 
6783c838a9fSAndrew Rybchenko struct tlv_privilege_mask {                          /* legacy structure - do not use */
6793c838a9fSAndrew Rybchenko   uint32_t tag;
6803c838a9fSAndrew Rybchenko   uint32_t length;
6813c838a9fSAndrew Rybchenko   uint32_t privilege_mask;
6823c838a9fSAndrew Rybchenko };
6833c838a9fSAndrew Rybchenko 
6843c838a9fSAndrew Rybchenko #define TLV_TAG_PRIVILEGE_MASK_ADD      (0x10150000)
6853c838a9fSAndrew Rybchenko 
6863c838a9fSAndrew Rybchenko struct tlv_privilege_mask_add {
6873c838a9fSAndrew Rybchenko   uint32_t tag;
6883c838a9fSAndrew Rybchenko   uint32_t length;
6893c838a9fSAndrew Rybchenko   uint32_t privilege_mask_add;
6903c838a9fSAndrew Rybchenko };
6913c838a9fSAndrew Rybchenko 
6923c838a9fSAndrew Rybchenko #define TLV_TAG_PRIVILEGE_MASK_REM      (0x10160000)
6933c838a9fSAndrew Rybchenko 
6943c838a9fSAndrew Rybchenko struct tlv_privilege_mask_rem {
6953c838a9fSAndrew Rybchenko   uint32_t tag;
6963c838a9fSAndrew Rybchenko   uint32_t length;
6973c838a9fSAndrew Rybchenko   uint32_t privilege_mask_rem;
6983c838a9fSAndrew Rybchenko };
6993c838a9fSAndrew Rybchenko 
7003c838a9fSAndrew Rybchenko /* Additional privileges given to all PFs.
7013c838a9fSAndrew Rybchenko  * This tag takes precedence over TLV_TAG_PRIVILEGE_MASK_REM. */
7023c838a9fSAndrew Rybchenko 
7033c838a9fSAndrew Rybchenko #define TLV_TAG_PRIVILEGE_MASK_ADD_ALL_PFS         (0x10190000)
7043c838a9fSAndrew Rybchenko 
7053c838a9fSAndrew Rybchenko struct tlv_privilege_mask_add_all_pfs {
7063c838a9fSAndrew Rybchenko   uint32_t tag;
7073c838a9fSAndrew Rybchenko   uint32_t length;
7083c838a9fSAndrew Rybchenko   uint32_t privilege_mask_add;
7093c838a9fSAndrew Rybchenko };
7103c838a9fSAndrew Rybchenko 
7113c838a9fSAndrew Rybchenko /* Additional privileges given to a selected PF.
7123c838a9fSAndrew Rybchenko  * This tag takes precedence over TLV_TAG_PRIVILEGE_MASK_REM. */
7133c838a9fSAndrew Rybchenko 
7143c838a9fSAndrew Rybchenko #define TLV_TAG_PRIVILEGE_MASK_ADD_SINGLE_PF(pf)   (0x101A0000 + (pf))
7153c838a9fSAndrew Rybchenko 
7163c838a9fSAndrew Rybchenko struct tlv_privilege_mask_add_single_pf {
7173c838a9fSAndrew Rybchenko   uint32_t tag;
7183c838a9fSAndrew Rybchenko   uint32_t length;
7193c838a9fSAndrew Rybchenko   uint32_t privilege_mask_add;
7203c838a9fSAndrew Rybchenko };
7213c838a9fSAndrew Rybchenko 
7223c838a9fSAndrew Rybchenko /* Turning on/off the PFIOV mode.
7233c838a9fSAndrew Rybchenko  * This tag only takes effect if TLV_TAG_VSWITCH_TYPE is missing or set to DEFAULT. */
7243c838a9fSAndrew Rybchenko 
7253c838a9fSAndrew Rybchenko #define TLV_TAG_PFIOV(port)             (0x10170000 + (port))
7263c838a9fSAndrew Rybchenko 
7273c838a9fSAndrew Rybchenko struct tlv_pfiov {
7283c838a9fSAndrew Rybchenko   uint32_t tag;
7293c838a9fSAndrew Rybchenko   uint32_t length;
7303c838a9fSAndrew Rybchenko   uint32_t pfiov;
7313c838a9fSAndrew Rybchenko #define TLV_PFIOV_OFF                    (0) /* Default */
7323c838a9fSAndrew Rybchenko #define TLV_PFIOV_ON                     (1)
7333c838a9fSAndrew Rybchenko };
7343c838a9fSAndrew Rybchenko 
7353c838a9fSAndrew Rybchenko /* Multicast filter chaining mode selection.
7363c838a9fSAndrew Rybchenko  *
7373c838a9fSAndrew Rybchenko  * When enabled, multicast packets are delivered to all recipients of all
7383c838a9fSAndrew Rybchenko  * matching multicast filters, with the exception that IP multicast filters
7393c838a9fSAndrew Rybchenko  * will steal traffic from MAC multicast filters on a per-function basis.
7403c838a9fSAndrew Rybchenko  * (New behaviour.)
7413c838a9fSAndrew Rybchenko  *
7423c838a9fSAndrew Rybchenko  * When disabled, multicast packets will always be delivered only to the
7433c838a9fSAndrew Rybchenko  * recipients of the highest priority matching multicast filter.
7443c838a9fSAndrew Rybchenko  * (Legacy behaviour.)
7453c838a9fSAndrew Rybchenko  *
7463c838a9fSAndrew Rybchenko  * The DEFAULT mode (which is the same as the tag not being present at all)
7473c838a9fSAndrew Rybchenko  * is equivalent to ENABLED in production builds, and DISABLED in eftest
7483c838a9fSAndrew Rybchenko  * builds.
7493c838a9fSAndrew Rybchenko  *
7503c838a9fSAndrew Rybchenko  * This option is intended to provide run-time control over this feature
7513c838a9fSAndrew Rybchenko  * while it is being stabilised and may be withdrawn at some point in the
7523c838a9fSAndrew Rybchenko  * future; the new behaviour is intended to become the standard behaviour.
7533c838a9fSAndrew Rybchenko  */
7543c838a9fSAndrew Rybchenko 
7553c838a9fSAndrew Rybchenko #define TLV_TAG_MCAST_FILTER_CHAINING   (0x10180000)
7563c838a9fSAndrew Rybchenko 
7573c838a9fSAndrew Rybchenko struct tlv_mcast_filter_chaining {
7583c838a9fSAndrew Rybchenko   uint32_t tag;
7593c838a9fSAndrew Rybchenko   uint32_t length;
7603c838a9fSAndrew Rybchenko   uint32_t mode;
7613c838a9fSAndrew Rybchenko #define TLV_MCAST_FILTER_CHAINING_DEFAULT  (0xffffffff)
7623c838a9fSAndrew Rybchenko #define TLV_MCAST_FILTER_CHAINING_DISABLED (0)
7633c838a9fSAndrew Rybchenko #define TLV_MCAST_FILTER_CHAINING_ENABLED  (1)
7643c838a9fSAndrew Rybchenko };
7653c838a9fSAndrew Rybchenko 
7663c838a9fSAndrew Rybchenko /* Pacer rate limit per PF */
7673c838a9fSAndrew Rybchenko #define TLV_TAG_RATE_LIMIT(pf)    (0x101b0000 + (pf))
7683c838a9fSAndrew Rybchenko 
7693c838a9fSAndrew Rybchenko struct tlv_rate_limit {
7703c838a9fSAndrew Rybchenko   uint32_t tag;
7713c838a9fSAndrew Rybchenko   uint32_t length;
7723c838a9fSAndrew Rybchenko   uint32_t rate_mbps;
7733c838a9fSAndrew Rybchenko };
7743c838a9fSAndrew Rybchenko 
7753c838a9fSAndrew Rybchenko /* OCSD Enable/Disable
7763c838a9fSAndrew Rybchenko  *
7773c838a9fSAndrew Rybchenko  * This setting allows OCSD to be disabled. This is a requirement for HP
7783c838a9fSAndrew Rybchenko  * servers to support PCI passthrough for virtualization.
7793c838a9fSAndrew Rybchenko  *
7803c838a9fSAndrew Rybchenko  * The DEFAULT mode (which is the same as the tag not being present) is
7813c838a9fSAndrew Rybchenko  * equivalent to ENABLED.
7823c838a9fSAndrew Rybchenko  *
7833c838a9fSAndrew Rybchenko  * This option is not used by the MCFW, and is entirely handled by the various
7843c838a9fSAndrew Rybchenko  * drivers that support OCSD, by reading the setting before they attempt
7853c838a9fSAndrew Rybchenko  * to enable OCSD.
7863c838a9fSAndrew Rybchenko  *
7873c838a9fSAndrew Rybchenko  * bit0: OCSD Disabled/Enabled
7883c838a9fSAndrew Rybchenko  */
7893c838a9fSAndrew Rybchenko 
7903c838a9fSAndrew Rybchenko #define TLV_TAG_OCSD (0x101C0000)
7913c838a9fSAndrew Rybchenko 
7923c838a9fSAndrew Rybchenko struct tlv_ocsd {
7933c838a9fSAndrew Rybchenko   uint32_t tag;
7943c838a9fSAndrew Rybchenko   uint32_t length;
7953c838a9fSAndrew Rybchenko   uint32_t mode;
7963c838a9fSAndrew Rybchenko #define TLV_OCSD_DISABLED 0
7973c838a9fSAndrew Rybchenko #define TLV_OCSD_ENABLED 1 /* Default */
7983c838a9fSAndrew Rybchenko };
7993c838a9fSAndrew Rybchenko 
800501fe79dSAndrew Rybchenko /* Descriptor cache config.
801501fe79dSAndrew Rybchenko  *
802501fe79dSAndrew Rybchenko  * Sets the sizes of the TX and RX descriptor caches as a power of 2. It also
803501fe79dSAndrew Rybchenko  * sets the total number of VIs. When the number of VIs is reduced VIs are taken
804501fe79dSAndrew Rybchenko  * away from the highest numbered port first, so a vi_count of 1024 means 1024
805501fe79dSAndrew Rybchenko  * VIs on the first port and 0 on the second (on a Torino).
806501fe79dSAndrew Rybchenko  */
807501fe79dSAndrew Rybchenko 
808501fe79dSAndrew Rybchenko #define TLV_TAG_DESCRIPTOR_CACHE_CONFIG    (0x101d0000)
809501fe79dSAndrew Rybchenko 
810501fe79dSAndrew Rybchenko struct tlv_descriptor_cache_config {
811501fe79dSAndrew Rybchenko   uint32_t tag;
812501fe79dSAndrew Rybchenko   uint32_t length;
813501fe79dSAndrew Rybchenko   uint8_t rx_desc_cache_size;
814501fe79dSAndrew Rybchenko   uint8_t tx_desc_cache_size;
815501fe79dSAndrew Rybchenko   uint16_t vi_count;
816501fe79dSAndrew Rybchenko };
817501fe79dSAndrew Rybchenko #define TLV_DESC_CACHE_DEFAULT (0xff)
818501fe79dSAndrew Rybchenko #define TLV_VI_COUNT_DEFAULT   (0xffff)
819501fe79dSAndrew Rybchenko 
820501fe79dSAndrew Rybchenko /* RX event merging config (read batching).
821501fe79dSAndrew Rybchenko  *
822501fe79dSAndrew Rybchenko  * Sets the global maximum number of events for the merging bins, and the
823501fe79dSAndrew Rybchenko  * global timeout configuration for the bins.
824501fe79dSAndrew Rybchenko  */
825501fe79dSAndrew Rybchenko 
826501fe79dSAndrew Rybchenko #define TLV_TAG_RX_EVENT_MERGING_CONFIG    (0x101e0000)
827501fe79dSAndrew Rybchenko 
828501fe79dSAndrew Rybchenko struct tlv_rx_event_merging_config {
829501fe79dSAndrew Rybchenko   uint32_t  tag;
830501fe79dSAndrew Rybchenko   uint32_t  length;
831501fe79dSAndrew Rybchenko   uint32_t  max_events;
832501fe79dSAndrew Rybchenko #define TLV_RX_EVENT_MERGING_CONFIG_MAX_EVENTS_MAX ((1 << 4) - 1)
833501fe79dSAndrew Rybchenko   uint32_t  timeout_ns;
834501fe79dSAndrew Rybchenko };
83562242903SAndrew Rybchenko #define TLV_RX_EVENT_MERGING_MAX_EVENTS_DEFAULT (0xffffffff)
83662242903SAndrew Rybchenko #define TLV_RX_EVENT_MERGING_TIMEOUT_NS_DEFAULT (0xffffffff)
837501fe79dSAndrew Rybchenko 
83888cbf0f7SAndrew Rybchenko #define TLV_TAG_PCIE_LINK_SETTINGS (0x101f0000)
83988cbf0f7SAndrew Rybchenko struct tlv_pcie_link_settings {
84088cbf0f7SAndrew Rybchenko   uint32_t tag;
84188cbf0f7SAndrew Rybchenko   uint32_t length;
84288cbf0f7SAndrew Rybchenko   uint16_t gen;   /* Target PCIe generation: 1, 2, 3 */
84388cbf0f7SAndrew Rybchenko   uint16_t width; /* Number of lanes */
84488cbf0f7SAndrew Rybchenko };
84588cbf0f7SAndrew Rybchenko 
8467d17c52bSAndrew Rybchenko /* TX event merging config.
8477d17c52bSAndrew Rybchenko  *
8487d17c52bSAndrew Rybchenko  * Sets the global maximum number of events for the merging bins, and the
8497d17c52bSAndrew Rybchenko  * global timeout configuration for the bins, and the global timeout for
8507d17c52bSAndrew Rybchenko  * empty queues.
8517d17c52bSAndrew Rybchenko  */
8527d17c52bSAndrew Rybchenko #define TLV_TAG_TX_EVENT_MERGING_CONFIG    (0x10210000)
8537d17c52bSAndrew Rybchenko struct tlv_tx_event_merging_config {
8547d17c52bSAndrew Rybchenko   uint32_t  tag;
8557d17c52bSAndrew Rybchenko   uint32_t  length;
8567d17c52bSAndrew Rybchenko   uint32_t  max_events;
8577d17c52bSAndrew Rybchenko #define TLV_TX_EVENT_MERGING_CONFIG_MAX_EVENTS_MAX ((1 << 4) - 1)
8587d17c52bSAndrew Rybchenko   uint32_t  timeout_ns;
8597d17c52bSAndrew Rybchenko   uint32_t  qempty_timeout_ns; /* Medford only */
8607d17c52bSAndrew Rybchenko };
86162242903SAndrew Rybchenko #define TLV_TX_EVENT_MERGING_MAX_EVENTS_DEFAULT (0xffffffff)
86262242903SAndrew Rybchenko #define TLV_TX_EVENT_MERGING_TIMEOUT_NS_DEFAULT (0xffffffff)
86362242903SAndrew Rybchenko #define TLV_TX_EVENT_MERGING_QEMPTY_TIMEOUT_NS_DEFAULT (0xffffffff)
8647d17c52bSAndrew Rybchenko 
86562242903SAndrew Rybchenko /* BIU mode
86662242903SAndrew Rybchenko  *
86762242903SAndrew Rybchenko  * Medford2 tag for selecting VI window decode (see values below)
86862242903SAndrew Rybchenko  */
86962242903SAndrew Rybchenko #define TLV_TAG_BIU_VI_WINDOW_MODE       (0x10280000)
87062242903SAndrew Rybchenko struct tlv_biu_vi_window_mode {
87162242903SAndrew Rybchenko   uint32_t tag;
87262242903SAndrew Rybchenko   uint32_t length;
87362242903SAndrew Rybchenko   uint8_t  mode;
87462242903SAndrew Rybchenko #define TLV_BIU_VI_WINDOW_MODE_8K    0  /*  8k per VI, CTPIO not mapped, medford/hunt compatible */
87562242903SAndrew Rybchenko #define TLV_BIU_VI_WINDOW_MODE_16K   1  /* 16k per VI, CTPIO mapped */
87662242903SAndrew Rybchenko #define TLV_BIU_VI_WINDOW_MODE_64K   2  /* 64k per VI, CTPIO mapped, POWER-friendly */
87762242903SAndrew Rybchenko };
87862242903SAndrew Rybchenko 
8792d9312f6SAndrew Rybchenko #define TLV_TAG_LICENSE (0x30800000)
88088cbf0f7SAndrew Rybchenko 
88188cbf0f7SAndrew Rybchenko typedef struct tlv_license {
88288cbf0f7SAndrew Rybchenko   uint32_t  tag;
88388cbf0f7SAndrew Rybchenko   uint32_t  length;
88488cbf0f7SAndrew Rybchenko   uint8_t   data[];
88588cbf0f7SAndrew Rybchenko } tlv_license_t;
88688cbf0f7SAndrew Rybchenko 
887*6d522ee0SAndrew Rybchenko /* TSA NIC IP address configuration (DEPRECATED)
8887d17c52bSAndrew Rybchenko  *
8897d17c52bSAndrew Rybchenko  * Sets the TSA NIC IP address statically via configuration tool or dynamically
8907d17c52bSAndrew Rybchenko  * via DHCP via snooping based on the mode selection (0=Static, 1=DHCP, 2=Snoop)
8917d17c52bSAndrew Rybchenko  *
8927d17c52bSAndrew Rybchenko  * NOTE: This TAG is temporarily placed in the dynamic config partition and will
8937d17c52bSAndrew Rybchenko  * be moved to a private partition during TSA development. It is not used in any
8947d17c52bSAndrew Rybchenko  * released code yet.
8957d17c52bSAndrew Rybchenko  */
8967d17c52bSAndrew Rybchenko 
897*6d522ee0SAndrew Rybchenko #define TLV_TAG_TMP_TSAN_CONFIG         (0x10220000) /* DEPRECATED */
8987d17c52bSAndrew Rybchenko 
8997d17c52bSAndrew Rybchenko #define TLV_TSAN_IP_MODE_STATIC         (0)
9007d17c52bSAndrew Rybchenko #define TLV_TSAN_IP_MODE_DHCP           (1)
9017d17c52bSAndrew Rybchenko #define TLV_TSAN_IP_MODE_SNOOP          (2)
9027d17c52bSAndrew Rybchenko typedef struct tlv_tsan_config {
9037d17c52bSAndrew Rybchenko   uint32_t tag;
9047d17c52bSAndrew Rybchenko   uint32_t length;
9057d17c52bSAndrew Rybchenko   uint32_t mode;
9067d17c52bSAndrew Rybchenko   uint32_t ip;
9077d17c52bSAndrew Rybchenko   uint32_t netmask;
9087d17c52bSAndrew Rybchenko   uint32_t gateway;
9097d17c52bSAndrew Rybchenko   uint32_t port;
9104af6e4dfSAndrew Rybchenko   uint32_t bind_retry;  /* DEPRECATED */
9114af6e4dfSAndrew Rybchenko   uint32_t bind_bkout;  /* DEPRECATED */
9127d17c52bSAndrew Rybchenko } tlv_tsan_config_t;
9137d17c52bSAndrew Rybchenko 
914*6d522ee0SAndrew Rybchenko /* TSA Controller IP address configuration (DEPRECATED)
9157d17c52bSAndrew Rybchenko  *
9167d17c52bSAndrew Rybchenko  * Sets the TSA Controller IP address statically via configuration tool
9177d17c52bSAndrew Rybchenko  *
9187d17c52bSAndrew Rybchenko  * NOTE: This TAG is temporarily placed in the dynamic config partition and will
9197d17c52bSAndrew Rybchenko  * be moved to a private partition during TSA development. It is not used in any
9207d17c52bSAndrew Rybchenko  * released code yet.
9217d17c52bSAndrew Rybchenko  */
9227d17c52bSAndrew Rybchenko 
923*6d522ee0SAndrew Rybchenko #define TLV_TAG_TMP_TSAC_CONFIG         (0x10230000) /* DEPRECATED */
9247d17c52bSAndrew Rybchenko 
9257d17c52bSAndrew Rybchenko #define TLV_MAX_TSACS (4)
9267d17c52bSAndrew Rybchenko typedef struct tlv_tsac_config {
9277d17c52bSAndrew Rybchenko   uint32_t tag;
9287d17c52bSAndrew Rybchenko   uint32_t length;
9297d17c52bSAndrew Rybchenko   uint32_t num_tsacs;
9307d17c52bSAndrew Rybchenko   uint32_t ip[TLV_MAX_TSACS];
9317d17c52bSAndrew Rybchenko   uint32_t port[TLV_MAX_TSACS];
9327d17c52bSAndrew Rybchenko } tlv_tsac_config_t;
9337d17c52bSAndrew Rybchenko 
934*6d522ee0SAndrew Rybchenko /* Binding ticket (DEPRECATED)
9357d17c52bSAndrew Rybchenko  *
9367d17c52bSAndrew Rybchenko  * Sets the TSA NIC binding ticket used for binding process between the TSA NIC
9377d17c52bSAndrew Rybchenko  * and the TSA Controller
9387d17c52bSAndrew Rybchenko  *
9397d17c52bSAndrew Rybchenko  * NOTE: This TAG is temporarily placed in the dynamic config partition and will
9407d17c52bSAndrew Rybchenko  * be moved to a private partition during TSA development. It is not used in any
9417d17c52bSAndrew Rybchenko  * released code yet.
9427d17c52bSAndrew Rybchenko  */
9437d17c52bSAndrew Rybchenko 
944*6d522ee0SAndrew Rybchenko #define TLV_TAG_TMP_BINDING_TICKET      (0x10240000) /* DEPRECATED */
9457d17c52bSAndrew Rybchenko 
9467d17c52bSAndrew Rybchenko typedef struct tlv_binding_ticket {
9477d17c52bSAndrew Rybchenko   uint32_t tag;
9487d17c52bSAndrew Rybchenko   uint32_t length;
9497d17c52bSAndrew Rybchenko   uint8_t  bytes[];
9507d17c52bSAndrew Rybchenko } tlv_binding_ticket_t;
9517d17c52bSAndrew Rybchenko 
9524af6e4dfSAndrew Rybchenko /* Solarflare private key  (DEPRECATED)
9537d17c52bSAndrew Rybchenko  *
9547d17c52bSAndrew Rybchenko  * Sets the Solareflare private key used for signing during the binding process
9557d17c52bSAndrew Rybchenko  *
9567d17c52bSAndrew Rybchenko  * NOTE: This TAG is temporarily placed in the dynamic config partition and will
9577d17c52bSAndrew Rybchenko  * be moved to a private partition during TSA development. It is not used in any
9587d17c52bSAndrew Rybchenko  * released code yet.
9597d17c52bSAndrew Rybchenko  */
9607d17c52bSAndrew Rybchenko 
9614af6e4dfSAndrew Rybchenko #define TLV_TAG_TMP_PIK_SF              (0x10250000)    /* DEPRECATED */
9627d17c52bSAndrew Rybchenko 
9637d17c52bSAndrew Rybchenko typedef struct tlv_pik_sf {
9647d17c52bSAndrew Rybchenko   uint32_t tag;
9657d17c52bSAndrew Rybchenko   uint32_t length;
9667d17c52bSAndrew Rybchenko   uint8_t  bytes[];
9677d17c52bSAndrew Rybchenko } tlv_pik_sf_t;
9687d17c52bSAndrew Rybchenko 
969*6d522ee0SAndrew Rybchenko /* CA root certificate (DEPRECATED)
9707d17c52bSAndrew Rybchenko  *
9717d17c52bSAndrew Rybchenko  * Sets the CA root certificate used for TSA Controller verfication during
9727d17c52bSAndrew Rybchenko  * TLS connection setup between the TSA NIC and the TSA Controller
9737d17c52bSAndrew Rybchenko  *
9747d17c52bSAndrew Rybchenko  * NOTE: This TAG is temporarily placed in the dynamic config partition and will
9757d17c52bSAndrew Rybchenko  * be moved to a private partition during TSA development. It is not used in any
9767d17c52bSAndrew Rybchenko  * released code yet.
9777d17c52bSAndrew Rybchenko  */
9787d17c52bSAndrew Rybchenko 
979*6d522ee0SAndrew Rybchenko #define TLV_TAG_TMP_CA_ROOT_CERT        (0x10260000) /* DEPRECATED */
9807d17c52bSAndrew Rybchenko 
9817d17c52bSAndrew Rybchenko typedef struct tlv_ca_root_cert {
9827d17c52bSAndrew Rybchenko   uint32_t tag;
9837d17c52bSAndrew Rybchenko   uint32_t length;
9847d17c52bSAndrew Rybchenko   uint8_t  bytes[];
9857d17c52bSAndrew Rybchenko } tlv_ca_root_cert_t;
9867d17c52bSAndrew Rybchenko 
9874af6e4dfSAndrew Rybchenko /* Tx vFIFO Low latency configuration
9884af6e4dfSAndrew Rybchenko  *
9894af6e4dfSAndrew Rybchenko  * To keep the desired booting behaviour for the switch, it just requires to
9904af6e4dfSAndrew Rybchenko  * know if the low latency mode is enabled.
9914af6e4dfSAndrew Rybchenko  */
9924af6e4dfSAndrew Rybchenko 
9934af6e4dfSAndrew Rybchenko #define TLV_TAG_TX_VFIFO_ULL_MODE       (0x10270000)
9944af6e4dfSAndrew Rybchenko struct tlv_tx_vfifo_ull_mode {
9954af6e4dfSAndrew Rybchenko   uint32_t tag;
9964af6e4dfSAndrew Rybchenko   uint32_t length;
9974af6e4dfSAndrew Rybchenko   uint8_t  mode;
9984af6e4dfSAndrew Rybchenko #define TLV_TX_VFIFO_ULL_MODE_DEFAULT    0
9994af6e4dfSAndrew Rybchenko };
10004af6e4dfSAndrew Rybchenko 
10013c838a9fSAndrew Rybchenko #endif /* CI_MGMT_TLV_LAYOUT_H */
1002