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

th3_sanity.soc (6180B)


      1 # 
      2 # This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      3 # 
      4 # Copyright 2007-2019 Broadcom Inc. All rights reserved.
      5 #
      6 # Tomahawk3 Sanity
      7 #
      8 # Script to run all available tests as quickly as possible.
      9 # For testing basic sanity of new drivers, simulators, chips, etc.
     10 # Port config assumes few 10G XE ports (including mgmt), 
     11 # few 400G CD ports.
     12 # By default use config: $SDK/rc/config_th3_32x400.bcm
     13 
     14 # Set run command script not to fail on errors reported by commands
     15 # this allows the script to continue if a test fails
     16 set rcerror=false
     17 
     18 # Set up test mode: don't stop on errors, show progress on each test
     19 tm -stoponerror +progress
     20 # Unselect all
     21 ts -*
     22 
     23 echo "testsuite: started: sanity"
     24 time 'rcload rc.soc'
     25 counter off
     26 l2mode off
     27 
     28 # We need to print out port status since any cabling effects results.
     29 *:ps
     30 
     31 if $?1 'local full_test 1'
     32 
     33 # Avoid link messages while testing
     34 linkscan off
     35 
     36 init soc
     37 if $?parity_enable 'local parity_old_state $parity_enable'
     38 local done 'echo "   Done"'
     39 
     40 #Display some useful information
     41 date
     42 ver
     43 soc
     44 
     45 #Start Test
     46 echo "Running PCI Compliance ..."
     47 tr 2
     48 $done
     49 
     50 echo "Running PCI S-Channel Buf ..."
     51 tr 4
     52 $done
     53 
     54 
     55 echo "Running Register reset defaults ..."
     56 tr 1
     57 $done
     58 
     59 init soc
     60 init misc
     61 echo "Running Register read/write ..."
     62 tr 3 mask64
     63 $done
     64 
     65 rcload rc.soc
     66 counter off
     67 l2mode off
     68 linkscan off
     69 memscan off
     70 
     71 echo "Running CPU Benchmarks ..."
     72 tr 21
     73 $done
     74 
     75 #Memory tests
     76 set rct=false
     77 counter off
     78 l2mode off
     79 linkscan off
     80 memscan off
     81 config add parity_enable=0
     82 # Usage: BCM.0>th3_sanity w x y z
     83 # (w,x,y,z can be 50,51,52,71) and in any combination
     84 # By default ie. if no arguments provided, only TR 50, 52,71 are run
     85 echo "Running memory tests ..."
     86 if !"expr $1+0 == 50" || !"expr $2+0 == 50" || !"expr $3+0 == 50" || !"expr $4+0 == 50" \
     87     'init soc;init misc;' \
     88     'rcload tr50_bcm56980_a0.soc'
     89 if !"expr $1+0 == 51" || !"expr $2+0 == 51" || !"expr $3+0 == 51" || !"expr $4+0 == 51" \
     90     'init soc;init misc;' \
     91     'rcload tr51_bcm56980_a0.soc'
     92 if !"expr $1+0 == 52" || !"expr $2+0 == 52" || !"expr $3+0 == 52" || !"expr $4+0 == 52" \
     93     'init soc;init misc;' \
     94     'rcload tr52_bcm56980_a0.soc'
     95 if !"expr $1+0 == 71" || !"expr $2+0 == 71" || !"expr $3+0 == 71" || !"expr $4+0 == 71" \
     96     'init soc;init misc;' \
     97     'rcload tr71_bcm56980_a0.soc'
     98 if !"expr $1+0 == 0" && !"expr $2+0 == 0" && !"expr $3+0 == 0" && !"expr $4+0 == 0" \
     99     'init soc;init misc;' \
    100     'rcload tr50_bcm56980_a0.soc' \
    101     'init soc;init misc;' \
    102     'rcload tr52_bcm56980_a0.soc' \
    103     'init soc;init misc;' \
    104     'rcload tr71_bcm56980_a0.soc'
    105 $done
    106 
    107 if $?parity_old_state 'config add parity_enable=$parity_old_state' \
    108 else 'config delete parity_enable'
    109 
    110 # Re-initialize to clean up of various read/wrires to MMU memories
    111 set rct=true
    112 rcload rc.soc
    113 counter off
    114 l2mode off
    115 linkscan off
    116 memscan off
    117 
    118 echo "Running counter width verification test ..."
    119 tr 30
    120 $done
    121 
    122 echo "Running counter read/write test ..."
    123 tr 31
    124 $done
    125 
    126 #Hashing tests - TBD
    127 #tr 55
    128 
    129 #echo "Running MDIO Linkscan test" - TBD
    130 #tr 60
    131 #$done
    132 
    133 echo "Testing CPU DMA loopback ..."
    134 tr 17
    135 $done
    136 
    137 #echo "Testing CPU DMA, Scatter/Gather Reload ..."
    138 #tr 22
    139 #$done
    140 
    141 #echo "Testing CPU DMA, Scatter/Gather Simple ..."
    142 #tr 23
    143 #$done
    144 
    145 #echo "Testing CPU DMA, Scatter/Gather Random ..."
    146 #tr 24
    147 #$done
    148 
    149 #MAC Loopback
    150 echo "Testing MAC Loopback - 400 Gb/s all CD ports"
    151 tr 18 PortBitMap=cd Speed=400G
    152 $done
    153 
    154 #PHY Loopback
    155 echo "Testing PHY Loopback - 400 Gb/s all CD ports"
    156 tr 19 PortBitMap=cd Speed=400G
    157 $done
    158 
    159 echo "Running MAC loopback V2 on all ports ..."
    160 tr 48 PortBitMap=cd
    161 $done
    162 
    163 echo "Running PHY loopback V2 on all ports ..."
    164 tr 49 PortBitMap=cd
    165 $done
    166 
    167 #Internal snake Loopback
    168 echo "Running internal snake on all CD ports, MAC loopback ..."
    169 tr 39 LoopbackMode=MAC snakepath=TWOways PortBitMap=cd
    170 $done
    171 
    172 echo "Running internal snake on all CD ports, PHY loopback ..."
    173 tr 39 LoopbackMode=PHY snakepath=TWOways PortBitMap=cd
    174 $done
    175 
    176 #Traffic Test
    177 echo "Running Traffic Test in MAC mode on CD ports..."
    178 tr 72 RunMode=MAC PortBitMap=cd
    179 $done
    180 
    181 echo "Running Traffic Test in PHY mode on Cd ports..."
    182 tr 72 RunMode=PHY PortBitMap=cd
    183 $done
    184 
    185 config add parity_enable=1
    186 config add parity_correction=1
    187 config add mem_cache_enable=1
    188 rc
    189 
    190 echo "Running Software BUS BUFFER Error Recovery Test ..."
    191 linkscan off
    192 tr 143
    193 $done
    194 
    195 echo "Running Software Error Recovery Test ..."
    196 linkscan off
    197 tr 144 testType=1stHalf
    198 $done
    199 
    200 tr 144 testType=2ndHalf
    201 $done
    202 
    203 config add parity_enable=0;
    204 config add parity_correction=0
    205 config add mem_cache_enable=0
    206 # if you have cable with following paring
    207 #    xe0-xe4, xe1-xe5, xe2-xe6, xe3-xe7
    208 #    xe8-xe12, xe9-xe13, xe10-xe14, xe11-xe15
    209 #    ...
    210 #    xe56-xe60, xe57-xe61, xe58-xe62, xe59-xe63
    211 #
    212 # tr 72 rm=external pbm=xe0,xe4 an=f sp=10g
    213 # tr 72 rm=external pbm=xe1,xe5 an=f sp=10g
    214 # tr 72 rm=external pbm=xe2,xe6 an=f sp=10g
    215 # tr 72 rm=external pbm=xe3,xe7 an=f sp=10g
    216 # tr 72 rm=external pbm=xe8,xe12 an=f sp=10g
    217 # tr 72 rm=external pbm=xe9,xe13 an=f sp=10g
    218 # tr 72 rm=external pbm=xe10,xe14 an=f sp=10g
    219 # tr 72 rm=external pbm=xe11,xe15 an=f sp=10g
    220 # ...
    221 # tr 72 rm=external pbm=xe56,xe60 an=f sp=10g
    222 # tr 72 rm=external pbm=xe57,xe61 an=f sp=10g
    223 # tr 72 rm=external pbm=xe58,xe62 an=f sp=10g
    224 # tr 72 rm=external pbm=xe59,xe63 an=f sp=10g
    225 
    226 # if you have cable with following paring
    227 #    xe0-xe4, xe1-xe5, xem-xe6, xe3-xe7
    228 #    xe8-xe12, xe9-xe13, xe10-xe14, xe11-xe15
    229 #    ...
    230 #    xe56-xe60, xe57-xe61, xe58-xe62, xe59-xe63
    231 # echo "Running external loopback ..."
    232 # tr 20 tpbm=xe0-xe3 di=4 an=f s=10g
    233 # tr 20 tpbm=xe8-xe11 di=4 an=f s=10g
    234 # tr 20 tpbm=xe16-xe19 di=4 an=f s=10g
    235 # tr 20 tpbm=xe24-xe27 di=4 an=f s=10g
    236 # tr 20 tpbm=xe32-xe35 di=4 an=f s=10g
    237 # tr 20 tpbm=xe40-xe43 di=4 an=f s=10g
    238 # tr 20 tpbm=xe48-xe51 di=4 an=f s=10g
    239 # tr 20 tpbm=xe56-xe59 di=4 an=f s=10g
    240 # $done
    241 
    242 # Show status
    243 date
    244 tl
    245 local returnCode $?
    246 
    247 echo Tests Complete.  Reinitializing ...
    248 config refresh
    249 rcload rc.soc
    250 counter off
    251 l2mode off
    252 
    253 # We want to show the return code from the tl command which
    254 # lists the results. The automated test infrastructure keys off of this
    255 # value
    256 echo "testsuite: finished: sanity: $returnCode"
    257