Path: blob/main/sys/contrib/ncsw/Peripherals/FM/Pcd/fm_kg.h
48524 views
/*1* Copyright 2008-2012 Freescale Semiconductor Inc.2*3* Redistribution and use in source and binary forms, with or without4* modification, are permitted provided that the following conditions are met:5* * Redistributions of source code must retain the above copyright6* notice, this list of conditions and the following disclaimer.7* * Redistributions in binary form must reproduce the above copyright8* notice, this list of conditions and the following disclaimer in the9* documentation and/or other materials provided with the distribution.10* * Neither the name of Freescale Semiconductor nor the11* names of its contributors may be used to endorse or promote products12* derived from this software without specific prior written permission.13*14*15* ALTERNATIVELY, this software may be distributed under the terms of the16* GNU General Public License ("GPL") as published by the Free Software17* Foundation, either version 2 of that License or (at your option) any18* later version.19*20* THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY21* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED22* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE23* DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY24* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES25* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;26* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND27* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT28* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS29* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.30*/313233/******************************************************************************34@File fm_kg.h3536@Description FM KG private header37*//***************************************************************************/38#ifndef __FM_KG_H39#define __FM_KG_H4041#include "std_ext.h"4243/***********************************************************************/44/* Keygen defines */45/***********************************************************************/46/* maskes */47#if (DPAA_VERSION >= 11)48#define KG_SCH_VSP_SHIFT_MASK 0x0003f00049#define KG_SCH_OM_VSPE 0x0000000150#define KG_SCH_VSP_NO_KSP_EN 0x800000005152#define MAX_SP_SHIFT 2353#define KG_SCH_VSP_MASK_SHIFT 1254#define KG_SCH_VSP_SHIFT 2455#endif /* (DPAA_VERSION >= 11) */5657typedef uint32_t t_KnownFieldsMasks;58#define KG_SCH_KN_PORT_ID 0x8000000059#define KG_SCH_KN_MACDST 0x4000000060#define KG_SCH_KN_MACSRC 0x2000000061#define KG_SCH_KN_TCI1 0x1000000062#define KG_SCH_KN_TCI2 0x0800000063#define KG_SCH_KN_ETYPE 0x0400000064#define KG_SCH_KN_PPPSID 0x0200000065#define KG_SCH_KN_PPPID 0x0100000066#define KG_SCH_KN_MPLS1 0x0080000067#define KG_SCH_KN_MPLS2 0x0040000068#define KG_SCH_KN_MPLS_LAST 0x0020000069#define KG_SCH_KN_IPSRC1 0x0010000070#define KG_SCH_KN_IPDST1 0x0008000071#define KG_SCH_KN_PTYPE1 0x0004000072#define KG_SCH_KN_IPTOS_TC1 0x0002000073#define KG_SCH_KN_IPV6FL1 0x0001000074#define KG_SCH_KN_IPSRC2 0x0000800075#define KG_SCH_KN_IPDST2 0x0000400076#define KG_SCH_KN_PTYPE2 0x0000200077#define KG_SCH_KN_IPTOS_TC2 0x0000100078#define KG_SCH_KN_IPV6FL2 0x0000080079#define KG_SCH_KN_GREPTYPE 0x0000040080#define KG_SCH_KN_IPSEC_SPI 0x0000020081#define KG_SCH_KN_IPSEC_NH 0x0000010082#define KG_SCH_KN_IPPID 0x0000008083#define KG_SCH_KN_L4PSRC 0x0000000484#define KG_SCH_KN_L4PDST 0x0000000285#define KG_SCH_KN_TFLG 0x000000018687typedef uint8_t t_GenericCodes;88#define KG_SCH_GEN_SHIM1 0x7089#define KG_SCH_GEN_DEFAULT 0x1090#define KG_SCH_GEN_PARSE_RESULT_N_FQID 0x2091#define KG_SCH_GEN_START_OF_FRM 0x4092#define KG_SCH_GEN_SHIM2 0x7193#define KG_SCH_GEN_IP_PID_NO_V 0x7294#define KG_SCH_GEN_ETH 0x0395#define KG_SCH_GEN_ETH_NO_V 0x7396#define KG_SCH_GEN_SNAP 0x0497#define KG_SCH_GEN_SNAP_NO_V 0x7498#define KG_SCH_GEN_VLAN1 0x0599#define KG_SCH_GEN_VLAN1_NO_V 0x75100#define KG_SCH_GEN_VLAN2 0x06101#define KG_SCH_GEN_VLAN2_NO_V 0x76102#define KG_SCH_GEN_ETH_TYPE 0x07103#define KG_SCH_GEN_ETH_TYPE_NO_V 0x77104#define KG_SCH_GEN_PPP 0x08105#define KG_SCH_GEN_PPP_NO_V 0x78106#define KG_SCH_GEN_MPLS1 0x09107#define KG_SCH_GEN_MPLS2 0x19108#define KG_SCH_GEN_MPLS3 0x29109#define KG_SCH_GEN_MPLS1_NO_V 0x79110#define KG_SCH_GEN_MPLS_LAST 0x0a111#define KG_SCH_GEN_MPLS_LAST_NO_V 0x7a112#define KG_SCH_GEN_IPV4 0x0b113#define KG_SCH_GEN_IPV6 0x1b114#define KG_SCH_GEN_L3_NO_V 0x7b115#define KG_SCH_GEN_IPV4_TUNNELED 0x0c116#define KG_SCH_GEN_IPV6_TUNNELED 0x1c117#define KG_SCH_GEN_MIN_ENCAP 0x2c118#define KG_SCH_GEN_IP2_NO_V 0x7c119#define KG_SCH_GEN_GRE 0x0d120#define KG_SCH_GEN_GRE_NO_V 0x7d121#define KG_SCH_GEN_TCP 0x0e122#define KG_SCH_GEN_UDP 0x1e123#define KG_SCH_GEN_IPSEC_AH 0x2e124#define KG_SCH_GEN_SCTP 0x3e125#define KG_SCH_GEN_DCCP 0x4e126#define KG_SCH_GEN_IPSEC_ESP 0x6e127#define KG_SCH_GEN_L4_NO_V 0x7e128#define KG_SCH_GEN_NEXTHDR 0x7f129/* shifts */130#define KG_SCH_PP_SHIFT_HIGH_SHIFT 27131#define KG_SCH_PP_SHIFT_LOW_SHIFT 12132#define KG_SCH_PP_MASK_SHIFT 16133#define KG_SCH_MODE_CCOBASE_SHIFT 24134#define KG_SCH_DEF_MAC_ADDR_SHIFT 30135#define KG_SCH_DEF_TCI_SHIFT 28136#define KG_SCH_DEF_ENET_TYPE_SHIFT 26137#define KG_SCH_DEF_PPP_SESSION_ID_SHIFT 24138#define KG_SCH_DEF_PPP_PROTOCOL_ID_SHIFT 22139#define KG_SCH_DEF_MPLS_LABEL_SHIFT 20140#define KG_SCH_DEF_IP_ADDR_SHIFT 18141#define KG_SCH_DEF_PROTOCOL_TYPE_SHIFT 16142#define KG_SCH_DEF_IP_TOS_TC_SHIFT 14143#define KG_SCH_DEF_IPV6_FLOW_LABEL_SHIFT 12144#define KG_SCH_DEF_IPSEC_SPI_SHIFT 10145#define KG_SCH_DEF_L4_PORT_SHIFT 8146#define KG_SCH_DEF_TCP_FLAG_SHIFT 6147#define KG_SCH_HASH_CONFIG_SHIFT_SHIFT 24148#define KG_SCH_GEN_MASK_SHIFT 16149#define KG_SCH_GEN_HT_SHIFT 8150#define KG_SCH_GEN_SIZE_SHIFT 24151#define KG_SCH_GEN_DEF_SHIFT 29152#define FM_PCD_KG_KGAR_NUM_SHIFT 16153154/* others */155#define NUM_OF_SW_DEFAULTS 3156#define MAX_PP_SHIFT 23157#define MAX_KG_SCH_SIZE 16158#define MASK_FOR_GENERIC_BASE_ID 0x20159#define MAX_HASH_SHIFT 40160#define MAX_KG_SCH_FQID_BIT_OFFSET 31161#define MAX_KG_SCH_PP_BIT_OFFSET 15162#define MAX_DIST_FQID_SHIFT 23163164#define GET_MASK_SEL_SHIFT(shift,i) \165switch (i) { \166case (0):shift = 26;break; \167case (1):shift = 20;break; \168case (2):shift = 10;break; \169case (3):shift = 4;break; \170default: \171RETURN_ERROR(MAJOR, E_INVALID_VALUE, NO_MSG); \172}173174#define GET_MASK_OFFSET_SHIFT(shift,i) \175switch (i) { \176case (0):shift = 16;break; \177case (1):shift = 0;break; \178case (2):shift = 28;break; \179case (3):shift = 24;break; \180default: \181RETURN_ERROR(MAJOR, E_INVALID_VALUE, NO_MSG); \182}183184#define GET_MASK_SHIFT(shift,i) \185switch (i) { \186case (0):shift = 24;break; \187case (1):shift = 16;break; \188case (2):shift = 8;break; \189case (3):shift = 0;break; \190default: \191RETURN_ERROR(MAJOR, E_INVALID_VALUE, NO_MSG); \192}193194/***********************************************************************/195/* Keygen defines */196/***********************************************************************/197198#define KG_DOUBLE_MEANING_REGS_OFFSET 0x100199#define NO_VALIDATION 0x70200#define KG_ACTION_REG_TO 1024201#define KG_MAX_PROFILE 255202#define SCHEME_ALWAYS_DIRECT 0xFFFFFFFF203204205#endif /* __FM_KG_H */206207208