1*61f4d204SMD Danish Anwar /* SPDX-License-Identifier: GPL-2.0 */ 2*61f4d204SMD Danish Anwar /* Texas Instruments ICSSG Ethernet driver 3*61f4d204SMD Danish Anwar * 4*61f4d204SMD Danish Anwar * Copyright (C) 2022 Texas Instruments Incorporated - https://www.ti.com/ 5*61f4d204SMD Danish Anwar * 6*61f4d204SMD Danish Anwar */ 7*61f4d204SMD Danish Anwar 8*61f4d204SMD Danish Anwar #ifndef __NET_TI_ICSSG_SWITCH_MAP_H 9*61f4d204SMD Danish Anwar #define __NET_TI_ICSSG_SWITCH_MAP_H 10*61f4d204SMD Danish Anwar 11*61f4d204SMD Danish Anwar /************************* Ethernet Switch Constants *********************/ 12*61f4d204SMD Danish Anwar 13*61f4d204SMD Danish Anwar /* if bucket size is changed in firmware then this too should be changed 14*61f4d204SMD Danish Anwar * because it directly impacts FDB ageing calculation 15*61f4d204SMD Danish Anwar */ 16*61f4d204SMD Danish Anwar #define NUMBER_OF_FDB_BUCKET_ENTRIES (4) 17*61f4d204SMD Danish Anwar 18*61f4d204SMD Danish Anwar /* This is fixed in ICSSG */ 19*61f4d204SMD Danish Anwar #define SIZE_OF_FDB (2048) 20*61f4d204SMD Danish Anwar 21*61f4d204SMD Danish Anwar #define FW_LINK_SPEED_1G (0x00) 22*61f4d204SMD Danish Anwar #define FW_LINK_SPEED_100M (0x01) 23*61f4d204SMD Danish Anwar #define FW_LINK_SPEED_10M (0x02) 24*61f4d204SMD Danish Anwar #define FW_LINK_SPEED_HD (0x80) 25*61f4d204SMD Danish Anwar 26*61f4d204SMD Danish Anwar /* Time after which FDB entries are checked for aged out values. 27*61f4d204SMD Danish Anwar * Values are in nanoseconds 28*61f4d204SMD Danish Anwar */ 29*61f4d204SMD Danish Anwar #define FDB_AGEING_TIMEOUT_OFFSET 0x0014 30*61f4d204SMD Danish Anwar 31*61f4d204SMD Danish Anwar /* Default VLAN tag for Host Port */ 32*61f4d204SMD Danish Anwar #define HOST_PORT_DF_VLAN_OFFSET 0x001C 33*61f4d204SMD Danish Anwar 34*61f4d204SMD Danish Anwar /* Same as HOST_PORT_DF_VLAN_OFFSET */ 35*61f4d204SMD Danish Anwar #define EMAC_ICSSG_SWITCH_PORT0_DEFAULT_VLAN_OFFSET HOST_PORT_DF_VLAN_OFFSET 36*61f4d204SMD Danish Anwar 37*61f4d204SMD Danish Anwar /* Default VLAN tag for P1 Port */ 38*61f4d204SMD Danish Anwar #define P1_PORT_DF_VLAN_OFFSET 0x0020 39*61f4d204SMD Danish Anwar 40*61f4d204SMD Danish Anwar /* Same as P1_PORT_DF_VLAN_OFFSET */ 41*61f4d204SMD Danish Anwar #define EMAC_ICSSG_SWITCH_PORT1_DEFAULT_VLAN_OFFSET P1_PORT_DF_VLAN_OFFSET 42*61f4d204SMD Danish Anwar 43*61f4d204SMD Danish Anwar /* default VLAN tag for P2 Port */ 44*61f4d204SMD Danish Anwar #define P2_PORT_DF_VLAN_OFFSET 0x0024 45*61f4d204SMD Danish Anwar 46*61f4d204SMD Danish Anwar /* Same as P2_PORT_DF_VLAN_OFFSET */ 47*61f4d204SMD Danish Anwar #define EMAC_ICSSG_SWITCH_PORT2_DEFAULT_VLAN_OFFSET P2_PORT_DF_VLAN_OFFSET 48*61f4d204SMD Danish Anwar 49*61f4d204SMD Danish Anwar /* VLAN-FID Table offset. 4096 VIDs. 2B per VID = 8KB = 0x2000 */ 50*61f4d204SMD Danish Anwar #define VLAN_STATIC_REG_TABLE_OFFSET 0x0100 51*61f4d204SMD Danish Anwar 52*61f4d204SMD Danish Anwar /* VLAN-FID Table offset for EMAC */ 53*61f4d204SMD Danish Anwar #define EMAC_ICSSG_SWITCH_DEFAULT_VLAN_TABLE_OFFSET VLAN_STATIC_REG_TABLE_OFFSET 54*61f4d204SMD Danish Anwar 55*61f4d204SMD Danish Anwar /* Packet descriptor Q reserved memory */ 56*61f4d204SMD Danish Anwar #define PORT_DESC0_HI 0x2104 57*61f4d204SMD Danish Anwar 58*61f4d204SMD Danish Anwar /* Packet descriptor Q reserved memory */ 59*61f4d204SMD Danish Anwar #define PORT_DESC0_LO 0x2F6C 60*61f4d204SMD Danish Anwar 61*61f4d204SMD Danish Anwar /* Packet descriptor Q reserved memory */ 62*61f4d204SMD Danish Anwar #define PORT_DESC1_HI 0x3DD4 63*61f4d204SMD Danish Anwar 64*61f4d204SMD Danish Anwar /* Packet descriptor Q reserved memory */ 65*61f4d204SMD Danish Anwar #define PORT_DESC1_LO 0x4C3C 66*61f4d204SMD Danish Anwar 67*61f4d204SMD Danish Anwar /* Packet descriptor Q reserved memory */ 68*61f4d204SMD Danish Anwar #define HOST_DESC0_HI 0x5AA4 69*61f4d204SMD Danish Anwar 70*61f4d204SMD Danish Anwar /* Packet descriptor Q reserved memory */ 71*61f4d204SMD Danish Anwar #define HOST_DESC0_LO 0x5F0C 72*61f4d204SMD Danish Anwar 73*61f4d204SMD Danish Anwar /* Packet descriptor Q reserved memory */ 74*61f4d204SMD Danish Anwar #define HOST_DESC1_HI 0x6374 75*61f4d204SMD Danish Anwar 76*61f4d204SMD Danish Anwar /* Packet descriptor Q reserved memory */ 77*61f4d204SMD Danish Anwar #define HOST_DESC1_LO 0x67DC 78*61f4d204SMD Danish Anwar 79*61f4d204SMD Danish Anwar /* Special packet descriptor Q reserved memory */ 80*61f4d204SMD Danish Anwar #define HOST_SPPD0 0x7AAC 81*61f4d204SMD Danish Anwar 82*61f4d204SMD Danish Anwar /* Special acket descriptor Q reserved memory */ 83*61f4d204SMD Danish Anwar #define HOST_SPPD1 0x7EAC 84*61f4d204SMD Danish Anwar 85*61f4d204SMD Danish Anwar /* IEP count cycle counter*/ 86*61f4d204SMD Danish Anwar #define TIMESYNC_FW_WC_CYCLECOUNT_OFFSET 0x83EC 87*61f4d204SMD Danish Anwar 88*61f4d204SMD Danish Anwar /* IEP count hi roll over count */ 89*61f4d204SMD Danish Anwar #define TIMESYNC_FW_WC_HI_ROLLOVER_COUNT_OFFSET 0x83F4 90*61f4d204SMD Danish Anwar 91*61f4d204SMD Danish Anwar /* IEP count hi sw counter */ 92*61f4d204SMD Danish Anwar #define TIMESYNC_FW_WC_COUNT_HI_SW_OFFSET_OFFSET 0x83F8 93*61f4d204SMD Danish Anwar 94*61f4d204SMD Danish Anwar /* Set clock descriptor */ 95*61f4d204SMD Danish Anwar #define TIMESYNC_FW_WC_SETCLOCK_DESC_OFFSET 0x83FC 96*61f4d204SMD Danish Anwar 97*61f4d204SMD Danish Anwar /* IEP count syncout reduction factor */ 98*61f4d204SMD Danish Anwar #define TIMESYNC_FW_WC_SYNCOUT_REDUCTION_FACTOR_OFFSET 0x843C 99*61f4d204SMD Danish Anwar 100*61f4d204SMD Danish Anwar /* IEP count syncout reduction counter */ 101*61f4d204SMD Danish Anwar #define TIMESYNC_FW_WC_SYNCOUT_REDUCTION_COUNT_OFFSET 0x8440 102*61f4d204SMD Danish Anwar 103*61f4d204SMD Danish Anwar /* IEP count syncout start time cycle counter */ 104*61f4d204SMD Danish Anwar #define TIMESYNC_FW_WC_SYNCOUT_START_TIME_CYCLECOUNT_OFFSET 0x8444 105*61f4d204SMD Danish Anwar 106*61f4d204SMD Danish Anwar /* Control variable to generate SYNC1 */ 107*61f4d204SMD Danish Anwar #define TIMESYNC_FW_WC_ISOM_PIN_SIGNAL_EN_OFFSET 0x844C 108*61f4d204SMD Danish Anwar 109*61f4d204SMD Danish Anwar /* SystemTime Sync0 periodicity */ 110*61f4d204SMD Danish Anwar #define TIMESYNC_FW_ST_SYNCOUT_PERIOD_OFFSET 0x8450 111*61f4d204SMD Danish Anwar 112*61f4d204SMD Danish Anwar /* pktTxDelay for P1 = link speed dependent p1 mac delay + p1 phy delay */ 113*61f4d204SMD Danish Anwar #define TIMESYNC_FW_WC_PKTTXDELAY_P1_OFFSET 0x8454 114*61f4d204SMD Danish Anwar 115*61f4d204SMD Danish Anwar /* pktTxDelay for P2 = link speed dependent p2 mac delay + p2 phy delay */ 116*61f4d204SMD Danish Anwar #define TIMESYNC_FW_WC_PKTTXDELAY_P2_OFFSET 0x8458 117*61f4d204SMD Danish Anwar 118*61f4d204SMD Danish Anwar /* Set clock operation done signal for next task */ 119*61f4d204SMD Danish Anwar #define TIMESYNC_FW_SIG_PNFW_OFFSET 0x845C 120*61f4d204SMD Danish Anwar 121*61f4d204SMD Danish Anwar /* Set clock operation done signal for next task */ 122*61f4d204SMD Danish Anwar #define TIMESYNC_FW_SIG_TIMESYNCFW_OFFSET 0x8460 123*61f4d204SMD Danish Anwar 124*61f4d204SMD Danish Anwar /* New list is copied at this time */ 125*61f4d204SMD Danish Anwar #define TAS_CONFIG_CHANGE_TIME 0x000C 126*61f4d204SMD Danish Anwar 127*61f4d204SMD Danish Anwar /* config change error counter */ 128*61f4d204SMD Danish Anwar #define TAS_CONFIG_CHANGE_ERROR_COUNTER 0x0014 129*61f4d204SMD Danish Anwar 130*61f4d204SMD Danish Anwar /* TAS List update pending flag */ 131*61f4d204SMD Danish Anwar #define TAS_CONFIG_PENDING 0x0018 132*61f4d204SMD Danish Anwar 133*61f4d204SMD Danish Anwar /* TAS list update trigger flag */ 134*61f4d204SMD Danish Anwar #define TAS_CONFIG_CHANGE 0x0019 135*61f4d204SMD Danish Anwar 136*61f4d204SMD Danish Anwar /* List length for new TAS schedule */ 137*61f4d204SMD Danish Anwar #define TAS_ADMIN_LIST_LENGTH 0x001A 138*61f4d204SMD Danish Anwar 139*61f4d204SMD Danish Anwar /* Currently active TAS list index */ 140*61f4d204SMD Danish Anwar #define TAS_ACTIVE_LIST_INDEX 0x001B 141*61f4d204SMD Danish Anwar 142*61f4d204SMD Danish Anwar /* Cycle time for the new TAS schedule */ 143*61f4d204SMD Danish Anwar #define TAS_ADMIN_CYCLE_TIME 0x001C 144*61f4d204SMD Danish Anwar 145*61f4d204SMD Danish Anwar /* Cycle counts remaining till the TAS list update */ 146*61f4d204SMD Danish Anwar #define TAS_CONFIG_CHANGE_CYCLE_COUNT 0x0020 147*61f4d204SMD Danish Anwar 148*61f4d204SMD Danish Anwar /* Base Flow ID for sending Packets to Host for Slice0 */ 149*61f4d204SMD Danish Anwar #define PSI_L_REGULAR_FLOW_ID_BASE_OFFSET 0x0024 150*61f4d204SMD Danish Anwar 151*61f4d204SMD Danish Anwar /* Same as PSI_L_REGULAR_FLOW_ID_BASE_OFFSET */ 152*61f4d204SMD Danish Anwar #define EMAC_ICSSG_SWITCH_PSI_L_REGULAR_FLOW_ID_BASE_OFFSET PSI_L_REGULAR_FLOW_ID_BASE_OFFSET 153*61f4d204SMD Danish Anwar 154*61f4d204SMD Danish Anwar /* Base Flow ID for sending mgmt and Tx TS to Host for Slice0 */ 155*61f4d204SMD Danish Anwar #define PSI_L_MGMT_FLOW_ID_OFFSET 0x0026 156*61f4d204SMD Danish Anwar 157*61f4d204SMD Danish Anwar /* Same as PSI_L_MGMT_FLOW_ID_OFFSET */ 158*61f4d204SMD Danish Anwar #define EMAC_ICSSG_SWITCH_PSI_L_MGMT_FLOW_ID_BASE_OFFSET PSI_L_MGMT_FLOW_ID_OFFSET 159*61f4d204SMD Danish Anwar 160*61f4d204SMD Danish Anwar /* Queue number for Special Packets written here */ 161*61f4d204SMD Danish Anwar #define SPL_PKT_DEFAULT_PRIORITY 0x0028 162*61f4d204SMD Danish Anwar 163*61f4d204SMD Danish Anwar /* Express Preemptible Queue Mask */ 164*61f4d204SMD Danish Anwar #define EXPRESS_PRE_EMPTIVE_Q_MASK 0x0029 165*61f4d204SMD Danish Anwar 166*61f4d204SMD Danish Anwar /* Port1/Port2 Default Queue number for untagged Packets, only 1B is used */ 167*61f4d204SMD Danish Anwar #define QUEUE_NUM_UNTAGGED 0x002A 168*61f4d204SMD Danish Anwar 169*61f4d204SMD Danish Anwar /* Stores the table used for priority regeneration. 1B per PCP/Queue */ 170*61f4d204SMD Danish Anwar #define PORT_Q_PRIORITY_REGEN_OFFSET 0x002C 171*61f4d204SMD Danish Anwar 172*61f4d204SMD Danish Anwar /* For marking Packet as priority/express (this feature is disabled) or 173*61f4d204SMD Danish Anwar * cut-through/S&F. 174*61f4d204SMD Danish Anwar */ 175*61f4d204SMD Danish Anwar #define EXPRESS_PRE_EMPTIVE_Q_MAP 0x0034 176*61f4d204SMD Danish Anwar 177*61f4d204SMD Danish Anwar /* Stores the table used for priority mapping. 1B per PCP/Queue */ 178*61f4d204SMD Danish Anwar #define PORT_Q_PRIORITY_MAPPING_OFFSET 0x003C 179*61f4d204SMD Danish Anwar 180*61f4d204SMD Danish Anwar /* Used to notify the FW of the current link speed */ 181*61f4d204SMD Danish Anwar #define PORT_LINK_SPEED_OFFSET 0x00A8 182*61f4d204SMD Danish Anwar 183*61f4d204SMD Danish Anwar /* TAS gate mask for windows list0 */ 184*61f4d204SMD Danish Anwar #define TAS_GATE_MASK_LIST0 0x0100 185*61f4d204SMD Danish Anwar 186*61f4d204SMD Danish Anwar /* TAS gate mask for windows list1 */ 187*61f4d204SMD Danish Anwar #define TAS_GATE_MASK_LIST1 0x0350 188*61f4d204SMD Danish Anwar 189*61f4d204SMD Danish Anwar /* Memory to Enable/Disable Preemption on TX side */ 190*61f4d204SMD Danish Anwar #define PRE_EMPTION_ENABLE_TX 0x05A0 191*61f4d204SMD Danish Anwar 192*61f4d204SMD Danish Anwar /* Active State of Preemption on TX side */ 193*61f4d204SMD Danish Anwar #define PRE_EMPTION_ACTIVE_TX 0x05A1 194*61f4d204SMD Danish Anwar 195*61f4d204SMD Danish Anwar /* Memory to Enable/Disable Verify State Machine Preemption */ 196*61f4d204SMD Danish Anwar #define PRE_EMPTION_ENABLE_VERIFY 0x05A2 197*61f4d204SMD Danish Anwar 198*61f4d204SMD Danish Anwar /* Verify Status of State Machine */ 199*61f4d204SMD Danish Anwar #define PRE_EMPTION_VERIFY_STATUS 0x05A3 200*61f4d204SMD Danish Anwar 201*61f4d204SMD Danish Anwar /* Non Final Fragment Size supported by Link Partner */ 202*61f4d204SMD Danish Anwar #define PRE_EMPTION_ADD_FRAG_SIZE_REMOTE 0x05A4 203*61f4d204SMD Danish Anwar 204*61f4d204SMD Danish Anwar /* Non Final Fragment Size supported by Firmware */ 205*61f4d204SMD Danish Anwar #define PRE_EMPTION_ADD_FRAG_SIZE_LOCAL 0x05A6 206*61f4d204SMD Danish Anwar 207*61f4d204SMD Danish Anwar /* Time in ms the State machine waits for respond Packet */ 208*61f4d204SMD Danish Anwar #define PRE_EMPTION_VERIFY_TIME 0x05A8 209*61f4d204SMD Danish Anwar 210*61f4d204SMD Danish Anwar /* Memory used for R30 related management commands */ 211*61f4d204SMD Danish Anwar #define MGR_R30_CMD_OFFSET 0x05AC 212*61f4d204SMD Danish Anwar 213*61f4d204SMD Danish Anwar /* HW Buffer Pool0 base address */ 214*61f4d204SMD Danish Anwar #define BUFFER_POOL_0_ADDR_OFFSET 0x05BC 215*61f4d204SMD Danish Anwar 216*61f4d204SMD Danish Anwar /* 16B for Host Egress MSMC Q (Pre-emptible) context */ 217*61f4d204SMD Danish Anwar #define HOST_RX_Q_PRE_CONTEXT_OFFSET 0x0684 218*61f4d204SMD Danish Anwar 219*61f4d204SMD Danish Anwar /* Buffer for 8 FDB entries to be added by 'Add Multiple FDB entries IOCTL' */ 220*61f4d204SMD Danish Anwar #define FDB_CMD_BUFFER 0x0894 221*61f4d204SMD Danish Anwar 222*61f4d204SMD Danish Anwar /* TAS queue max sdu length list */ 223*61f4d204SMD Danish Anwar #define TAS_QUEUE_MAX_SDU_LIST 0x08FA 224*61f4d204SMD Danish Anwar 225*61f4d204SMD Danish Anwar /* Used by FW to generate random number with the SEED value */ 226*61f4d204SMD Danish Anwar #define HD_RAND_SEED_OFFSET 0x0934 227*61f4d204SMD Danish Anwar 228*61f4d204SMD Danish Anwar /* 16B for Host Egress MSMC Q (Express) context */ 229*61f4d204SMD Danish Anwar #define HOST_RX_Q_EXP_CONTEXT_OFFSET 0x0940 230*61f4d204SMD Danish Anwar 231*61f4d204SMD Danish Anwar /* Start of 32 bits PA_STAT counters */ 232*61f4d204SMD Danish Anwar #define PA_STAT_32b_START_OFFSET 0x0080 233*61f4d204SMD Danish Anwar 234*61f4d204SMD Danish Anwar #endif /* __NET_TI_ICSSG_SWITCH_MAP_H */ 235