td2p_sanity.soc (9654B)
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 # Trident2+ 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 11 # Set run command script not to fail on errors reported by commands 12 # this allows the script to continue if a test fails 13 set rcerror=false 14 15 # Set up test mode: don't stop on errors, show progress on each test 16 tm -stoponerror +progress 17 # Unselect all 18 ts -* 19 20 if $?BCM56868_A0 || $?BCM56868_A1 \ 21 'local titan2plus 1' 22 23 if $?xgxs_tx_lane_map_core0_ce0 && $?xgxs_tx_lane_map_core0_ce1 \ 24 && $?xgxs_tx_lane_map_core0_ce2 && $?xgxs_tx_lane_map_core0_ce3 \ 25 && $?xgxs_tx_lane_map_core0_ce4 && $?xgxs_tx_lane_map_core0_ce5 \ 26 && $?xgxs_tx_lane_map_core0_ce6 && $?xgxs_tx_lane_map_core0_ce7 \ 27 'local all_ce 1' 28 29 if !$?all_ce && $?xgxs_tx_lane_map_core0_1 && $?xgxs_tx_lane_map_core0_2 \ 30 && $?xgxs_tx_lane_map_core0_3 && $?xgxs_tx_lane_map_core0_4 \ 31 && $?xgxs_tx_lane_map_core0_5 && $?xgxs_tx_lane_map_core0_6 \ 32 && $?xgxs_tx_lane_map_core0_7 && $?xgxs_tx_lane_map_core0_8 \ 33 'local all_ce 1' 34 35 if !$?all_ce && $?xgxs_tx_lane_map_core0_1 || $?xgxs_tx_lane_map_core0_2 \ 36 || $?xgxs_tx_lane_map_core0_3 || $?xgxs_tx_lane_map_core0_4 \ 37 || $?xgxs_tx_lane_map_core0_5 || $?xgxs_tx_lane_map_core0_6 \ 38 || $?xgxs_tx_lane_map_core0_7 || $?xgxs_tx_lane_map_core0_8 \ 39 'local ce_pbm 1' 40 41 if !$?all_ce && $?xgxs_tx_lane_map_core0_ce0 || $?xgxs_tx_lane_map_core0_ce1 \ 42 || $?xgxs_tx_lane_map_core0_ce2 || $?xgxs_tx_lane_map_core0_ce3 \ 43 || $?xgxs_tx_lane_map_core0_ce4 || $?xgxs_tx_lane_map_core0_ce5 \ 44 || $?xgxs_tx_lane_map_core0_ce6 || $?xgxs_tx_lane_map_core0_ce7 \ 45 'local ce_pbm 1' 46 47 echo "testsuite: started: sanity" 48 time 'rcload rc.soc' 49 counter off 50 l2mode off 51 52 # We need to print out port status since any cabling effects results. 53 *:ps 54 55 if $?1 'local full_test 1' 56 57 # Avoid link messages while testing 58 linkscan off 59 60 init soc 61 local done 'echo " Done"' 62 63 #Display some useful information 64 date 65 ver 66 soc 67 68 #Start Test 69 echo "Running PCI Compliance ..." 70 tr 2 71 $done 72 73 echo "Running PCI S-Channel Buf ..." 74 tr 4 75 $done 76 77 78 echo "Running Register reset defaults ..." 79 tr 1 80 $done 81 82 init soc 83 init misc 84 echo "Running Register read/write ..." 85 tr 3 mask64 86 $done 87 88 rcload rc.soc 89 counter off 90 l2mode off 91 linkscan off 92 memscan off 93 94 echo "Running CPU Benchmarks ..." 95 tr 21 96 $done 97 98 set rct=false 99 echo "Running memory tests ..." 100 if $?BCM56866_A0 || $?BCM56866_A1 \ 101 'rcload trall_bcm56866_a0.soc' 102 103 if $?BCM56860_A0 || $?BCM56861_A0 \ 104 || $?BCM56862_A0 || $?BCM56864_A0 \ 105 || $?BCM56865_A0 || $?BCM56860_A1 || $?BCM56861_A1 \ 106 || $?BCM56862_A1 || $?BCM56864_A1 || $?BCM56865_A1 \ 107 'rcload trall_bcm56860_a0.soc' 108 109 if $?BCM56867_A0 || $?BCM56867_A1 \ 110 'rcload trall_bcm56867_a0.soc' 111 112 if $?BCM56833_A0 || $?BCM56833_A1 \ 113 'rcload trall_bcm56833_a0.soc' 114 115 if $?BCM56832_A0 || $?BCM56832_A1 \ 116 'rcload trall_bcm56832_a0.soc' 117 118 if $?BCM56836_A0 || $?BCM56836_A1 \ 119 'rcload trall_bcm56836_a0.soc' 120 121 if $?BCM56868_A0 || $?BCM56868_A1 \ 122 'rcload trall_bcm56868_a0.soc' 123 $done 124 125 # Re-initialize to clean up of various read/wrires to MMU memories 126 set rct=true 127 rcload rc.soc 128 counter off 129 l2mode off 130 linkscan off 131 memscan off 132 133 echo "Running counter width verification test ..." 134 tr 30 135 $done 136 137 echo "Running counter read/write test ..." 138 tr 31 139 $done 140 141 #Hashing tests - TBD 142 #tr 55 143 144 echo "Running MDIO Linkscan test" 145 tr 60 146 $done 147 148 echo "Testing CPU DMA loopback ..." 149 tr 17 150 $done 151 152 #echo "Testing CPU DMA, Scatter/Gather Reload ..." 153 #tr 22 154 #$done 155 156 #echo "Testing CPU DMA, Scatter/Gather Simple ..." 157 #tr 23 158 #$done 159 160 #echo "Testing CPU DMA, Scatter/Gather Random ..." 161 #tr 24 162 #$done 163 164 #MAC Loopback 165 if !$?titan2plus && !$?all_ce \ 166 'echo "Testing MAC Loopback - 10 Gb/s all XE ports"' \ 167 'tr 18 PortBitMap=xe Speed=10G' \ 168 '$done' 169 170 if $?all_ce || $?ce_pbm \ 171 'echo "Testing MAC Loopback - 100 Gb/s all CE ports"' \ 172 'tr 18 PortBitMap=ce Speed=100G' \ 173 '$done' 174 175 if !$?all_ce \ 176 'echo "Testing MAC Loopback - 106 Gb/s all HG ports"' \ 177 'tr 18 PortBitMap=hg Speed=106G' \ 178 '$done' \ 179 180 #PHY Loopback 181 if !$?titan2plus && !$?all_ce \ 182 'echo "Testing PHY Loopback - 10 Gb/s all XE ports"' \ 183 'tr 19 PortBitMap=xe Speed=10G' \ 184 '$done' 185 186 if $?all_ce || $?ce_pbm \ 187 'echo "Testing PHY Loopback - 100 Gb/s all CE ports"' \ 188 'tr 19 PortBitMap=ce Speed=100G' \ 189 '$done' 190 191 if !$?all_ce \ 192 'echo "Testing PHY Loopback - 106 Gb/s all HG ports"' \ 193 'tr 19 PortBitMap=hg Speed=106G' \ 194 '$done' 195 196 echo "Running MAC loopback V2 on all ports ..." 197 tr 48 198 $done 199 200 echo "Running PHY loopback V2 on all ports ..." 201 tr 49 202 $done 203 204 #Internal snake Loopback 205 if !$?titan2plus && !$?all_ce \ 206 'echo "Running internal snake on all XE, MAC loopback ..."' \ 207 'tr 39 LoopbackMode=MAC snakepath=TWOways PortBitMap=xe' \ 208 '$done' 209 210 if !$?titan2plus && !$?all_ce \ 211 'echo "Running internal snake on all XE, PHY loopback ..."' \ 212 'tr 39 LoopbackMode=PHY snakepath=TWOways PortBitMap=xe' \ 213 '$done' 214 215 if !$?titan2plus && $?all_ce || $?ce_pbm \ 216 'echo "Running internal snake on all CE ports, MAC loopback ..."' \ 217 'tr 39 LoopbackMode=MAC snakepath=TWOways PortBitMap=ce' \ 218 '$done' 219 220 if !$?titan2plus && $?all_ce || $?ce_pbm \ 221 'echo "Running internal snake on all CE ports, PHY loopback ..."' \ 222 'tr 39 LoopbackMode=PHY snakepath=TWOways PortBitMap=ce' \ 223 '$done' 224 225 if $?titan2plus \ 226 'echo "Running internal snake on all HG ports, MAC loopback ..."' \ 227 'tr 39 LoopbackMode=MAC snakepath=TWOways PortBitMap=hg' \ 228 '$done' 229 230 if $?titan2plus \ 231 'echo "Running internal snake on all HG ports, PHY loopback ..."' \ 232 'tr 39 LoopbackMode=PHY snakepath=TWOways PortBitMap=hg' \ 233 '$done' 234 235 #Traffic Test 236 if !$?all_ce && !$?titan2plus \ 237 'echo "Running Traffic Test in MAC mode on XE ports..."' \ 238 'tr 72 RunMode=MAC PortBitMap=xe' \ 239 '$done' 240 241 if !$?all_ce && !$?titan2plus \ 242 'echo "Running Traffic Test in PHY mode on XE ports..."' \ 243 'tr 72 RunMode=PHY PortBitMap=xe' \ 244 '$done' 245 246 if $?all_ce || $?ce_pbm \ 247 'echo "Running Traffic Test in MAC mode on CE ports..."' \ 248 'tr 72 RunMode=MAC PortBitMap=ce' \ 249 '$done' 250 251 if $?all_ce || $?ce_pbm \ 252 'echo "Running Traffic Test in PHY mode on CE ports..."' \ 253 'tr 72 RunMode=PHY PortBitMap=ce' \ 254 '$done' 255 256 if !$?all_ce \ 257 'echo "Running Traffic Test in MAC mode on HG ports..."' \ 258 'tr 72 RunMode=MAC PortBitMap=hg' \ 259 '$done' 260 261 if !$?all_ce \ 262 'echo "Running Traffic Test in PHY mode on HG ports..."' \ 263 'tr 72 RunMode=PHY PortBitMap=hg' \ 264 '$done' 265 266 echo "Running Software BUS BUFFER Error Recovery Test ..." 267 linkscan off 268 tr 143 269 270 echo "Running Software Error Recovery Test ..." 271 linkscan off 272 tr 144 273 274 # if you have cable with following paring 275 # xe0-xe4, xe1-xe5, xe2-xe6, xe3-xe7 276 # xe8-xe12, xe9-xe13, xe10-xe14, xe11-xe15 277 # ... 278 # xe56-xe60, xe57-xe61, xe58-xe62, xe59-xe63 279 # 280 # tr 72 rm=external pbm=xe0,xe4 an=f sp=10g 281 # tr 72 rm=external pbm=xe1,xe5 an=f sp=10g 282 # tr 72 rm=external pbm=xe2,xe6 an=f sp=10g 283 # tr 72 rm=external pbm=xe3,xe7 an=f sp=10g 284 # tr 72 rm=external pbm=xe8,xe12 an=f sp=10g 285 # tr 72 rm=external pbm=xe9,xe13 an=f sp=10g 286 # tr 72 rm=external pbm=xe10,xe14 an=f sp=10g 287 # tr 72 rm=external pbm=xe11,xe15 an=f sp=10g 288 # ... 289 # tr 72 rm=external pbm=xe56,xe60 an=f sp=10g 290 # tr 72 rm=external pbm=xe57,xe61 an=f sp=10g 291 # tr 72 rm=external pbm=xe58,xe62 an=f sp=10g 292 # tr 72 rm=external pbm=xe59,xe63 an=f sp=10g 293 294 # if you have cable with following paring 295 # xe0-xe4, xe1-xe5, xem-xe6, xe3-xe7 296 # xe8-xe12, xe9-xe13, xe10-xe14, xe11-xe15 297 # ... 298 # xe56-xe60, xe57-xe61, xe58-xe62, xe59-xe63 299 # echo "Running external loopback ..." 300 # tr 20 tpbm=xe0-xe3 di=4 an=f s=10g 301 # tr 20 tpbm=xe8-xe11 di=4 an=f s=10g 302 # tr 20 tpbm=xe16-xe19 di=4 an=f s=10g 303 # tr 20 tpbm=xe24-xe27 di=4 an=f s=10g 304 # tr 20 tpbm=xe32-xe35 di=4 an=f s=10g 305 # tr 20 tpbm=xe40-xe43 di=4 an=f s=10g 306 # tr 20 tpbm=xe48-xe51 di=4 an=f s=10g 307 # tr 20 tpbm=xe56-xe59 di=4 an=f s=10g 308 # $done 309 310 # Show status 311 date 312 tl 313 local returnCode $? 314 315 echo Tests Complete. Reinitializing ... 316 config refresh 317 rcload rc.soc 318 counter off 319 l2mode off 320 321 # We want to show the return code from the tl command which 322 # lists the results. The automated test infrastructure keys off of this 323 # value 324 echo "testsuite: finished: sanity: $returnCode"