openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

xlm_tsc_doc.h (23664B)


      1 /*
      2 /*
      3    This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      4    
      5    Copyright 2007-2019 Broadcom Inc. All rights reserved.
      6 */
      7 /*!
      8 \page XLMAC-TSCE-doc MAC-PHY (PM4X10) Interface Documentation
      9 
     10 \tableofcontents
     11 
     12 XLMAC-TSCE Interface
     13 
     14 \section tsc-mac-intr Introduction
     15 
     16 The physical interface of TDM based SerDes Controller (TSC) and Media Access
     17 Controller (MAC) is a Broadcom proprietary Reconciliation Sublayer (RS). But
     18 logically this interface complies with IEEE RS specification. RS function is
     19 implemented in the MAC. XLMAC is a 40G Ethernet MAC and TSCE is the 28nm TSC
     20 PHY with the Eagle (12.5G) PMA/PMD.
     21 
     22 \section tsc-mac-clk CLOCKS
     23 
     24 In the MAC-TSC interface (MSI) the PHY sends clocks to the MAC. This clock is
     25 called the TSC_CLK_O. The PHY is provided with an external clock called the
     26 REF_CLK. The PLL in the PMD sublayer of the PHY generates a TSC_CLK. If the PLL
     27 is still waking up or is quisced for some other reason, the TSC_CLK is set to
     28 REF_CLK. This ensures the TXP and RXP (etc.) can be controlled, reset, etc.,
     29 with a running clock. Once the PLL is up and running, the TSC_CLK is
     30 glitchlessly switched to the standard frequency which is the PLL_FREQ/16 (also
     31 called VCO/16). If the PLL goes down for whatever reason, the TSC_CLK will
     32 revert to REF_CLK, again glitchlessly.
     33 
     34 In XLMAC-TSC design there is no source synchronous data/clock. XLMAC and TSC
     35 (PCS portion) are synthesized with the same TSC_CLK.
     36 
     37 The TSC_CLK also clocks the 8051 uController and associated logic within the PMD
     38 sublayer.
     39 
     40 \section tsc-mac-tdm TX_TDM & TX_PORT_NUMBER
     41 
     42 TSC generates a free running TDM. It is a 2 bit counter, continuously rotating
     43 through 0,1,2,3 - 0,1,2,3
     44 In single port mode all these TDM slots are assigned to the same port. But in
     45 multi-port mode the TDM slots are distributed as follow:
     46 - 1 port mode:
     47         -# Port0 is assigned to TDM0-TDM3
     48 - 4 port mode:
     49         -# Port0 is assigned to TDM0
     50         -# Port1 is assigned to TDM1
     51         -# Port2 is assigned to TDM2
     52         -# Port3 is assigned to TDM3
     53 - 2 two port mode:
     54         -# Port0 gets assigned to TDM0-TDM1
     55         -# Port2 gets TDM2-TDM3 slots.
     56 - 3 port mode(TRI1):
     57         -# Port0 gets TDM0-TDM1
     58         -# Port2 gets TDM2
     59         -# Port3 gets TDM3
     60 - 3 port mode(TRI2):
     61         -# Port0 gets TDM0
     62         -# Port1 gets TDM1
     63         -# Port2 getsTDM2-TDM3
     64 
     65 XLMAC will map the TDM numbers (slots) to the port number indicated by TSC. When
     66 XLMAC transmits data, it will use the same TDM numbers (mac_tx_tdm[1:0]) for the
     67 corresponding port (mac_tx_port_number[1:0]). Because of this any time TSC port
     68 mode changes, XLMAC will need a complete reset.  XLMAC continues to respond back
     69 mac_tx_tdm and mac_tx_port_number even when XLMAC is in soft reset to avoid any
     70 interruption in TSC pipeline.
     71 
     72 \section tsc-mac-cred CREDITS
     73 
     74 The TSCE sends credits to XLMAC to controls the rate at which the XLMAC sends
     75 data to the line. Therefore setting the speed mode in the XLAMC is for
     76 information only, it does not have any logical impact. Each credit tells the
     77 XLMAC to send data (IDLEs/Remote FAULTs or packet data depending on the state of
     78 the link) to the TSCE. Credits (port_n_credit[3:0]) are generated per port
     79 without any relationship to the tx_port_number[1:0] and tx_tdm[1:0].
     80 Port_n_credit[3:0] is 4 bit signal. Each bit is assigned for each port.
     81 
     82 - Port_n_credit[0] : port0
     83 - Port_n_credit[1] : port1
     84 - Port_n_credit[2] : port2
     85 - Port_n_credit[3] : port3
     86 
     87 Depending on the port configuration TSCE provides tx_port_number[1:0]. XLMAC
     88 ignores any credits to unused ports. Ideally TSCE will generate credits only for
     89 the ports assigned.
     90 
     91 The XLMAC transfers data to the TSCE with some pipeline delay once it has
     92 accumulated a credit from TSCE.
     93 
     94 The TSCE sends data to the XLMAC based on the data rate arrives on the line
     95 side. When the link is active, the TSCE sends data received on the wire (after
     96 PCS processing) to the XLMAC. If the link is not active, the TSCE sends either
     97 IDLEs (for CL36) or Local FAULTs for other speeds.
     98 
     99 \section tsc-mac-mmod MAC MODES
    100 
    101 The MAC can have one of the following physical interfaces with the PHY.
    102 - GMII
    103 - XGMII
    104 - XLGMII
    105 - CGMII
    106 Note that for CGMII three sets of MSBUSs are used to communicate between the
    107 12-lane TSC (TSC_12) and the CMAC.  TSC output TX_FORAMAT[1:0] indicates the
    108 msbus format. Based on the TX_FORMAT, MAC will now how to decode the data. In
    109 GMII mode all 10 bits of each Byte group are used. In GMII/XLGMII/CGMII 9 bits
    110 are used. In XGMII mode SOP can arrive at multiple of 4 bytes (lane0 or lane4)
    111 and in XLGMII/CGMII mode SOP will arrive in 8 lane boundaries (lane0). But BRCM
    112 XLGMII SOP can arrive at 4 Byte boundaries as special mode.
    113 - 00: GMII
    114 - 01: XGMII
    115 - 10: XLGMII/CGMII
    116 
    117 \section tsc-mac-rxlf RX_LOCAL_FAULT
    118 
    119 This is out of band per port link fault signaling mechanism in TSCE. If TSCE
    120 receive link is not up or even CDR is not locked, this signal will go high. This
    121 signal stays low if PCS link is up. Other than rx_local_fault signal, TSCE sends
    122 local fault control sequence to the XLMAC through msbus_rx. RX_LOCAL_FAULT
    123 signals are low if the port speed is 1G or lower or if TSCE is configured in any
    124 cl36 speed mode (like 2.5G).
    125 
    126 Operation of Local Fault/Remote Fault: If link is down or CDR is not locked, PHY
    127 generates local fault to the MAC. MAC in response will generate remote fault
    128 signals to the PHY. Remote PHY will transmit IDLES in response to the remote
    129 fault signals being received. Any PHY receiver can have link up based on Remote
    130 Fault Signal or IDLEs. When local PHY's PCS link is up, it will stop sending
    131 fault signaling to the MAC and instead PHY sends IDLES to the MAC. Once Local
    132 MAC receives IDLEs from the local PHY, it will stop transmitting remote fault
    133 and MAC will start transmitting regular IDLEs or Data.
    134 
    135 Note: This out of band rx_local_fault signals were defined in TSCE because TSCE
    136 can't reliably generate local fault sequence on msbus_rx when CDR is not
    137 locked.
    138 
    139 Note: TSCE supports in band Fault signaling as well. In 10G XGMII mode, TSCE
    140 generates 4 Bytes of Sequence Ordered (0x9C, 0x00, 0x00, 0x01) for fault
    141 signaling. In XLGMII/CGMII mode TSCE generates 8 Byte Sequence Ordered Set
    142 (0x9C, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00) for fault signaling.
    143 
    144 \section tsc-mac-msbusrx MSBUS_RX, MSBUS_RX_VALID, RX_PORT_NUMBER
    145 
    146 TSCE receives serial data from the line and provides decoded parallel data to
    147 the XLMAC. This data bus 80 bits wide representing 8 bytes of data.
    148 msbus_rx[79:0] is valid when MSBUS_RX_VALID is high for the corresponding
    149 rx_port_number[1:0] indicated. All these data are transferred with respect to
    150 tsc_clk.
    151 In msbus_rx[79:0], out of each 10 bits:
    152 - Bit9: rx_error for 8b10b and ignore for other encoder.
    153 - Bit8: data_valid (cl36) or control bit for others (1: control, 0: data)
    154 - Bit7:0: 8bit data
    155 
    156 \section tsc-mac-msbustx MSBUS_TX, MSBUS_TX_VALID, MAC_TX_PORT_NUMBER
    157 
    158 XLMAC transfers data to TSCE through msbus_tx[79:0]. Data is valid if
    159 msbus_tx_valid is high for the corresponding mac_tx_port_number[1:0]. Every port
    160 is assigned to 1 or 2 or 4 tdm slots set by the TSCE. XLMAC binds the tdm slots
    161 to the port numbers and transmits data on msbus_tx with the previously bind tdm
    162 slots for that port.
    163 In msbus_tx[79:0], out of each 10 bits:
    164 - Bit9: tx_error for 8b10b encode and ignore for other decoder.
    165 - Bit8: data_valid (cl36) or control bit for others clauses (1: control, 0: data)
    166 - Bit7:0: 8bit data
    167 
    168 \section tsc-mac-xlmactx XLMAC Transmit
    169 
    170 XLMAC transmit rate is controlled by the credit generated by the TSCE thru
    171 port_n_credit[3:0]. Each bit is dedicated for one port i.e. 4 bits for 4 ports.
    172 XMLAC will accumulate these credits for each port with no relations to
    173 tx_port_number[1:0] and tx_tdm[1:0].
    174 XLMAC gets tx_port_number[1:0] and tx_tdm[1:0] from TSCE and transmits those
    175 back to TSC as mac_tx_port_number[1:0] and mac_tx_tdm[1:0] maintaining
    176 tx_port_number and tx_tdm partitioning for each port. If XLMAC had any credit
    177 accumulated for that port, it will assert msbus_tx_valid along with the
    178 corresponding data msbus_tx[79:0].
    179 
    180 \section tsc-mac-macphy XLMAC<->TSCE INTERACTION
    181 
    182 The first independent operation is for the PHY to transmit idles. The MAC must
    183 provide idles to the PHY. MAC will only send idles if it gets credits. Hence the
    184 following sequence must happen.
    185 
    186 -# PHY is brought out of reset. PLL is stable. Clocks are humming
    187 -# PHY sends credits at line rate and information (portnum, TDM, format) to MAC
    188 -# MAC sends Idles to the PHY. (data and data_valid)
    189 -# PHY transmits IDLES to the wire.
    190 
    191 \section tsc-mac-lpbk XLMAC loopback
    192 
    193 Line Local Loopback mode: XLMAC routes the TX packets back to the RX, just
    194 before the packets are driven to the TSC interface. This loopback is implemented
    195 from the last pipeline stage in the TX block to the first pipeline stage in the
    196 RX block. The loopback takes place in the line clock after clock domain
    197 crossing, and data completely traverses the TX & RX pipeline stages.
    198 
    199 This loopback can be enabled for a port by setting the LINE_LOCAL_LPBK bits. The
    200 transmit packet stats vector (TPSV) & receive packet stats vector (RPSV) will
    201 account for these packets.  In order for this loopback to work, the credits from
    202 the TSC must be available for the port that is put in loopback.
    203 
    204 For XLMAC Line Local loopback to work, credits need to be flowing from TSCE.
    205 Therefore Speed Control function of TSCE will be utilized to set the speed for
    206 appropriate credits. To set a particular speed, desired speed is set at sw_speed
    207 (sc_x4_control_control[7:0]) and then toggle sw_speed_change. i.e. Set
    208 (sc_x4_control_control[8]) to 0 and then 1).
    209 Then program XLMAC active port/ports, set XLMAC in Line Loopback mode, release
    210 soft reset from the XLMAC. Assert TX_EN and RX_EN.
    211 
    212 To turn off line loopback first apply XLMAC.SOFT_RESET, de-asset TX_EN and RX_EN
    213 and then turn off Line Loopback. After that release XLMAC.SOFT_RESET, assert
    214 TX_EN and RX_EN.
    215 Once XLMAC and TSCE is completely programmed for any specific speed mode:
    216 Set XLMAC loopback:
    217 -# Set, in this order
    218   -# XLMAC.SOFT_RESET=1
    219   -# set TX_EN=0
    220   -# RX_EN=0
    221   -# XLMAC.LINE_LOCAL_LOOPBACK=1
    222 -# Clear EP FIFO
    223 -#  Release soft reset and enable TX and RX
    224   -# XLMAC.SOFT_RESET=0
    225   -# TX_EN=1
    226   -# then RX_EN=1
    227 Now XLMAC is ready for MAC loopback. Run the tests.
    228 
    229 To Release XLMAC loopback:
    230 -# Set, in this order
    231   -# XLMAC.SOFT_RESET=1
    232   -# set TX_EN=0
    233   -# RX_EN=0
    234 -# XLMAC.LINE_LOCAL_LOOPBACK=0
    235 -# Clear EP FIFO
    236 -#  Release
    237   -# XLMAC.SOFT_RESET=0
    238   -# set TX_EN=1
    239   -# RX_EN=1
    240 At this time XLMAC is ready for normal operation.
    241 
    242 \section tsc-mac-xlmisc XLMAC Misc
    243 
    244 -# On TX direction XLMAC contains a Clock Domain Crossing (CDC) FIFO. Anytime a
    245 soft reset is applied to any port, subsequently a reset needs to be applied to
    246   the corresponding CDC-FIFO.
    247 -# While XLMAC is in soft reset, TSCE credits are acknowledged.
    248 -# In GMII mode variable preamble mode need to be programmed to accept packets
    249   preamble + SFD less than 8 Bytes.
    250 
    251 \section tsc-mac-pm4x10 Port Macro, PM4X10
    252 
    253 Port Macro is a hard macro that integrates MAC, RS, PCS and PMA/PMD layers.
    254 PM4X10 contains MIB statistics and other ancillary logic.  MAC (XLMAC) can be
    255 configured into single/dual/triple/quad port modes. It can handle 10Mbps to
    256 42Gbps data rate. PCS can perform CL36, CL48, CL49, CL82, CL37 (AN), CL73 (AN),
    257 BRCM64b66b, CL74 (FEC) etc.  PMA/PMD supports per lane 1.25Gbps to 12.5Gbps.
    258 The PM4X10 consists of TSC_4_E and PM4X10_Core. PM4X10_Core consists of XLMAC
    259 and PORT glue logic. The TSC_4_E is based on the 28 nm Eagle Analog block. This
    260 ANA_WARPCORE11G analog supports up to 10.3125G on a single lane. The Eagle DSC
    261 design is used in the PMA_PMD for the TSC_4_E. This design uses a XLMAC since
    262 support of speeds of only up to 1X40GE is required. The glue logic in the PORT
    263 MACRO integrates the designs together, implements the MIB and EEE counters. The
    264 glue logic also provides a mechanism to access the registers in XLMAC and
    265 TSC_4_E. Here is block diagram of Port Macro, PM4X10.
    266 
    267 @image html pm4x10.jpg "Basic Block diagram for PM4x10"
    268 
    269 \section tsc-mac-bup PM4X10 bring up Sequence
    270 
    271 This section describes general sequence of powering up a port macro.
    272 
    273 -# Apply Digital power supply and then apply Analog power supply. At this time
    274 TSCE, and XLMAC are in hard reset (core_rst_l). All MIB statistics are clear.
    275 -# Once power supply is stable and a stable clock is applied, take PM4x10 out of
    276 hard reset, then take XLMAC out of hard reset. Then when a stable reference
    277 clock is applied, release the hard reset to TSCE. XLMAC is still at soft_reset.
    278 -# Program the appropriate port mode in the PortMacro. This port information
    279 will be sent to XLMAC.
    280 -# Clear all MIB counters.
    281 -# Initialize TSCE in proper sequence. See TEMod doc. for more details.
    282   -# bring up PLL
    283   -# program for lane_swap, (both PMD and PCS)
    284   -# load microcode
    285   -# program PMD core and lanes. TX settings, OS, polarity, and media type etc.
    286   -# program PCS through Speed Control register.
    287 
    288 At this time PLL is up and TSC_CLOCK is stable.  Tx_format, port_n_credit,
    289 tx_tdm, and tx_port_number are chugging on in the correct sequence.  MAC still
    290 is in soft-reset. But XLMAC does respond to credits with tx_format appropriate
    291 IDLES or remote_fault signals to the TSCE. At this time TSCE should link up with
    292 link partner if partner is also enabled.
    293 
    294 -# When PHY link up is seen, Initialize MAC for the packet format, port speed
    295 and the feature specific registers (eg. IPG, preamble, runt_threshold, pad_en,
    296 PAUSE/PFC/LLFC/E2EFC/E2ECC, 1588 and EEE registers).
    297 
    298 -# Take MAC out of soft reset. MAC_CTRL.SOFT_RESET, and enable MAC RX_EN and TX_EN.
    299 
    300 Note: Flexporting may never need hard reset.
    301 
    302 \section tsc-mac-prog PM4X10 Detail programming sequence
    303 
    304 Programming sequence starts at lower level and then moves up. First Eagle
    305 (PMA/PMD) is configured, then PCS_TSC4E (PCS) portion is configured, then XLMAC
    306 is programmed and then finally other associated blocks like Clock Domain
    307 Crossing FIFO (CDC FIFO) and MIB counters are cleared.
    308 To start with apply stable power supply and reference clock (typically 156.25MHz)
    309 and then its resets are released.
    310 -# Apply Digital power supply and then apply Analog power supply. At this time
    311 TSCE, XLMAC are at hard reset (core_rst_l).
    312 -# Core clock to PORT MACRO is toggling and stable.
    313 -# De-assert PM4x10 hard reset core_rst_l. This brings all PORT logic out of reset.
    314 -# XLMAC has a secondary soft reset. The default condition is that this reset is
    315 asserted, keeping MACs in reset.
    316 -# De-assert MAC hard reset. Clear PORT_MAC_CONTROL.XMAC0_RESET=0.
    317 -# De-assert TSC hard reset. Set PORT_XGXS0_CTRL_REG.RSTB_HW=1.
    318 -# Program the appropriate port mode in the PortMacro. This port information
    319 will be sent to XLMAC.
    320 -# Clear all MIB counters.
    321 -# Initialize PMD Core of Eagle
    322   -# Clear the PMD power down pins (PCS bits: pmd_x4_control.ln_tx_h_pwrdn and
    323   pmd_x4_control.ln_rx_h_pwrdn)
    324   -# Take PMD core out of reset (PCS bits: pmd_x1_control.por_h_rstb and
    325   pmd_x1_control.core_dp_h_rstb). This will release pmd__por_h_rstb and
    326   pmd_por_h_rstb pins of PMD.
    327   -# Program PMD bits: hearbeat_count_1us (0x271 for 156.25MHz refclk),
    328   refclk_divcnt (0x186A for 156.25MHz refclk), refclk_divcnt_sel (0x2 for
    329   156.25MHz refclk). Note: At reset, all other timer/register fields are loaded
    330   with normal operating values.
    331   -# Load Micro code and verify. Use API.
    332     -# Set uc_active=1
    333     -# De-assert 8051 reset (micro_mdio_dw8051_reset_n=1)
    334     -# After 10ms, poll for uc_dsc_ready_for_cmd=1 for all lanes (minimum wait
    335     time will be refined in next document version)
    336   -# Lane Swap and Polarity inversion related configurations at PMD level.
    337   (Note: lane swap involves programming at PMD and PCS both).
    338   -# Configure PLL using API: pll_mode (0xA/0x2 for 10.3125G/6.25G VCO)
    339   -# Configure Core level micro RAM variables: core_cfg_from_pcs and vco_rate
    340   -# Release core_dp_s_rstb in PMD
    341   -# Do Lane Confgurations: Media Type (use default), TXFIR (use default)
    342   -# Release ln_dp_s_rstb.
    343 Note: At this time initial PMD core initialization is done.
    344 -# Release PMD lane reset
    345   -# Write 1 to pmd_x4_control.ln_h_rstb. This will deassert PMD pin
    346   pmd_ln_h_rstb[i] and enable register access to lane associated registers.
    347   -# Write 1 to pmd_x4_control.ln_dp_h_rstb. This will allow the Speed Control
    348   FSM to manage PMD lane datapath resets- pmd_ln_dp_h_rstb[i].
    349   -# Program PMD lane level registers and memories as required, the set of
    350   configuration will depend on usage of canned speeds and presence of firmware.
    351   This step may include: setting the over-sample mode, TX and RX lane
    352   polarity, cl72_ieee_training_enable, transmitter configuration, baud rate DFE,
    353   scrambler_dis, media_type, cl72_mode, etc.
    354   -# SW writes to PMD registers to release ln_dp_s_rstb - lane DP datapath soft
    355   resets.
    356 -# At this point the PMD was taken out of POR and lane hard resets were release,
    357   PMD is fully configured by software and the firmware is waiting for
    358   pmd_core_dp_h_rstb and pmd_ln_dp_h_rstb release.
    359 -# Take PCS pipeline out of reset and allow the Speed Control to manage PCS
    360   pipeline. [SW]
    361   -# Set the following bits: TX_X4_Control0_misc. rstb_tx_lane,
    362   TX_X4_Control0_misc.enable_tx_lane and RX_X4_Control0_pma_control_0. rstb_lane
    363 -# Check for Master Port considerations.
    364   -# If configuring first port, or if change in VCO is required: select the
    365   master port that will perform PMD core configuration, bring down all the ports
    366   by clearing  sc_x4_control_control.sw_speed_change bit and reset by setting
    367   Main0_setup.master_port_num, then set Main0_setup.pll_reset_en bit. This will
    368   indicate to the Speed Control FSM to control PMD core resets. [SW]
    369   -# For AN and only if a single port is being enable set
    370   Main0_setup.single_port_enable instead of Main0_setup.pll_reset_en bit. [SW]
    371 -# The firmware is waiting for PCS FSM to provide core and lane configuration
    372   information, *dp_h_rstb signals are used to indicate to FW that the
    373   configuration provided by PCS is valid. [FW]
    374 -# Providing PCS configuration information to PMD and starting firmware.
    375   -# Forced speed/Autoneg considerations
    376     -# For Forced speed write desired speed ID to sc_x4_control_control.speed
    377     field and set the sc_x4_control_control.sw_speed_change bit. [SW]
    378     -#  For AN configure the abilities and enable AN. [SW]
    379   -# The Speed Control FSM sets pmd_core_mode signal and deasserts
    380   pmd_core_dp_h_rstb reset after <256> cycles delay. [HW]
    381   -# The Speed Control FSM drives pmd_lane_mode_i signals and deasserts
    382   pmd_ln_dp_h_rstb after <256> cycles delay. Note: The FSM does not wait for
    383   any indication from PMD before deasserting lane datapath resets, so core and
    384   lane resets will be deasserted simultaneously. The assumption is that PMD will
    385   internally handle this and lane configuration by firmware will be done only
    386   ofter the PLL is locked. [HW]
    387 -# Once the pmd_core_dp_h_rstb and pmd_ln_dp_h_rstb resets are deasserted; the
    388 firmware wakes up and uses configuration provided by PCS over the pmd_core_mode
    389 and pmd_lane_mode_i signals to finish the configuration of PMD core and
    390 lanes and enabling of the lanes. [FW]
    391 -# Wait for link to come up. [SW]
    392 -# Repeat for additional ports; make sure to not to set the
    393 Main0_setup.pll_reset_en bit, so the Speed Control logic does not reset PMD core
    394 again.
    395 -# Initialize MAC for the packet format, port speed and the feature specific
    396 registers (eg. IPG, preamble, runt_threshold, pad_en, 1588, EEE,
    397 PAUSE/PFC/LLFC/E2EFC/E2ECC registers, etc.)
    398 -# Remove soft reset and enable  MAC
    399   -# XLMAC_CTRL.SOFT_RESET=0
    400   -# enable MAC RX_EN
    401   -# enable MAC TX_EN
    402 
    403 \section tsc-mac-flex PM4X10 Flex-porting Sequence
    404 
    405 -# At the beginning of time: configure to a port mode, do all initialization and
    406 send traffic over relevant lanes.
    407 -# Apply XLMAC Dynamic Speed Change Sequence over ports that need to change:
    408   -# Assert EP_DISCARD, TX_DISCARD and SOFT_RESET
    409   -# Deassert RX_EN and TX_EN
    410 -# Initialize port :
    411   -# Only those ports that are changing run through the init sequence. Remaining
    412   ports are untouched.
    413   -# For XLPORT: if there are no ports common between previous and current
    414   configuration, issue a reset to XLMAC using xlport_mac_control_reset.
    415 -# Program TSCE:
    416   -# If VCO does not match, reset the global vars from TSC : tsc_touched,
    417   pcs_lane_swap_touched, pmd_touched
    418   -# Reset all changing ports per lane
    419   -# Configure all changing ports with regular TSCE init routine to bring link up
    420 -# Initialize XLMAC per port
    421   -# If vco has changed, all active ports are configured
    422   -# If VCO changes, but there are no common ports between previous and current
    423   configuration, all active ports are configured.
    424   -# For same VCO if any ports are common between previous and current
    425   configuration, they will be in reset due to step (2). These will be brought
    426   out of reset and configured. The remaining ports remain uninterrupted and
    427   continue sending traffic.
    428 
    429 \section tsc-mac-flexprog PM4X10 Flex-porting detail Sequence
    430 
    431 Flexport consists of changing the speed or number of ports after the device has
    432 been configured.  When changing the PORT_MODE register, it is required to not
    433 bring down sub-ports, if any, unaffected by the port mode change, while
    434 selectively updating the affected ports. The tsc_clk frequency will not change
    435 during a flexport change.  An example of a flexport change is 4x10G to 2x20G,
    436 1x40G for a given XLMAC. If flexporting from two dual 2x20G port mode to
    437 tri-port mode {1x20G, 2x10g}, 1x20G port data should not be interrupted.
    438 
    439 This sequence also applies when one or more links go down.  After a link goes
    440 down, it is possible that the links can come up in a completely different speed
    441 mode.
    442 
    443 -# SW disables MAC RX_EN and initiates a flush on the ports affected by the
    444 flexport change using MAC_TX_CTRL.DISCARD and MAC_TX_CTRL.EP_DISCARD.  SW
    445 determines the affected subports are idle by polling MAC tx fifo, mmu and
    446 edatabuf.
    447 -# SW disables MAC TX_EN.
    448 -# SW asserts one or more of per-port register MAC_CTRL.SOFT_RESET to prepare
    449 the ports which will soon be active. Only those ports that are changing will be
    450 configured. Remaining ports are not touched.
    451 -# SW sets the new port mode by programming register PORT_MODE_REG, and the
    452 other per-port type port registers.
    453 -# Configure TSC with the regular TSC init routine to bring up the link.
    454 -# Program MAC for the packet format, port speed and the feature specific
    455 registers (eg. IPG, preamble, runt_threshold, pad_en,
    456 PAUSE/PFC/LLFC/E2EFC/E2ECC, 1588 and EEE registers).
    457 -# SW removes soft reset to the MAC:  MAC_CTRL.SOFT_RESET, and enables MAC RX_EN
    458 and TX_EN.
    459 -# SW can program the TSC registers to save the power if the corresponding PORT
    460 will not be in use.
    461 
    462 \section tsc-mac-portdwn Port Down
    463 To bring down a port the following sequence should be applied.
    464 -# Force Transmit Electrical Idle at TSCE.
    465 -# SW disables XLMAC RX_EN to the specific port.
    466 -# SW initiates a flush on the port/ports coming down: using MAC_TX_CTRL.DISCARD
    467 and MAC_TX_CTRL.EP_DISCARD.  Poll until TX FIFO is empty.
    468 -# Disable MAC transmit XLMAC TX_EN=0
    469 -# Clear speed
    470 
    471 -# SW disables MAC RX_EN and initiates a flush on the ports affected by the
    472 flexport change using MAC_TX_CTRL.DISCARD MAC_TX_CTRL.EP_DISCARD.  SW determines
    473 the affected subports are idle by polling MAC tx fifo, mmu and edatabuf.
    474 -# SW disables MAC TX_EN.
    475 -# SW asserts one or more of per-port register MAC_CTRL.SOFT_RESET to prepare
    476 the ports which will soon be active. Only those ports that are changing will be
    477 configured. Remaining ports are not touched.
    478 */