hsanity.soc (6104B)
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 # Sanity script for BCM5670/BCM5671/BCM5675/BCM5676 7 # 8 # Note: on 5671/5676, only ports 1, 3, 6, 8 are valid (hg0, hg2, hg5, hg7) 9 # 10 # Note: if pbmp_valid is 0x14b because you are running BCM5670 as a 11 # BCM5671 or BCM5675 as a BCM5676, then set the following variable to tell 12 # this script that is what you are doing: 13 # 14 # setenv herc4 1 15 # 16 # External loopbacks are not done by default because external cabling 17 # is required. See below for variable settings that cause external 18 # loopbacks to be run. 19 # 20 21 echo "testsuite: started: sanity" 22 23 # We need to print out port status since any cabling effects results. 24 *:ps 25 26 linkscan off 27 set rcerror=f 28 29 local done 'echo " Done"' 30 31 if $?BCM5671_A0 || $?BCM5671_A1 \ 32 "local herc4 1" 33 34 if $?BCM5676_A0 || $?BCM5676_A1 \ 35 "local herc4_15 1" 36 37 if $?black_knight || $?white_knight \ 38 "local knight 1" 39 40 if $?knight || $?lancelot || $?merlin || $?guenevere \ 41 "local knightly 1" 42 43 if $?herc8_15 \ 44 "local herc8 1" 45 46 if $?herc4_15 \ 47 "local herc4 1" 48 49 if $?herc4 "echo NOTE: Assuming 4-port configuration" 50 51 # re-init 52 rcload rc.soc 53 54 if $?extall \ 55 "pause Please ensure external loopback cables are plugged in." 56 57 echo "Running CPU benchmarks ..." 58 tr 21 59 $done 60 61 echo "Running PCI tests ..." 62 tr 2 63 $done 64 65 echo "Running register tests ..." 66 tr 3 67 $done 68 69 echo "Running S-Channel message buffer test ..." 70 tr 4 71 $done 72 73 echo "Running Memory tests ..." 74 echo " XQ"; tr 50 m=XQ; tr 51 m=XQ 75 echo " LLA"; tr 50 m=LLA; tr 51 m=LLA 76 echo " MC"; tr 50 m=MC; tr 51 m=MC 77 echo " UC"; tr 50 m=UC; tr 51 m=UC 78 echo " VID"; tr 50 m=VID; tr 51 m=VID 79 echo " PP"; tr 50 m=PP; tr 51 m=PP 80 81 if $?herc15 'echo " EMODMAP"; tr 50 m=EMODMAP; tr 51 m=EMODMAP' 82 if $?herc15 'echo " IMODMAP"; tr 50 m=IMODMAP; tr 51 m=IMODMAP' 83 if $?herc15 'echo " MODBLK"; tr 50 m=MODBLK; tr 51 m=MODBLK' 84 if $?herc15 'echo " TRKPOOL"; tr 50 m=TRKPOOL; tr 51 m=TRKPOOL' 85 if $?herc15 'echo " IPMC"; tr 50 m=IPMC; tr 51 m=IPMC' 86 87 # Memories not yet tested by default 88 #if $?herc15 'echo " INGBUF"; tr 50 m=INGBUF; tr 51 m=INGBUF' 89 #if $?herc15 'echo " XQ_PTRS"; tr 50 m=XQ_PTRS; tr 51 m=XQ_PTRS' 90 $done 91 92 #set rctest=f 93 set rcerror=f 94 #debug +test 95 96 # Re-initialize to clean up of various read/writes to MMU memories 97 rcload rc.soc 98 linkscan off 99 100 101 echo Testing CPU DMA, Scatter/Gather Reload ... 102 tr 22 103 $done 104 105 echo Testing CPU DMA, Scatter/Gather Simple ... 106 tr 23 107 $done 108 109 echo Testing CPU DMA, Scatter/Gather Random ... 110 tr 24 111 $done 112 113 echo "Running MAC loopback on all ports ..." 114 tr 18 dmod=25 smi=47 dmi=23 pi=0x01010101 vl=14 115 $done 116 117 # Test PHY loopback, one port at a time. 118 echo "Running PHY loopback on all ports ..." 119 tr 19 dmod=13 smi=9 dmi=37 pi=0x01020304 vl=57 120 $done 121 122 echo "Running internal snake on all ports, MAC loopback ..." 123 tr 39 loopbackmode=mac snakepath=two 124 $done 125 126 echo "Running internal snake on all ports, PHY loopback ..." 127 tr 39 loopbackmode=phy snakepath=two 128 $done 129 130 echo "Running MAC loopback V2 on all ports ..." 131 tr 48 hgdmod=19 smi=103 dmi=42 pi=0x11335577 vl=427 sendm=single 132 $done 133 134 # Not ready for prime-time 135 #echo "Running PHY loopback V2 on all ports ..." 136 #tr 49 hgdmod=21 smi=52 dmi=83 pi=0x01204007 vl=39 sendm=array 137 #$done 138 139 #--------- EXT Loopback --------- 140 141 # If external Higig loopback cables are connected, external loopbacks 142 # may be performed by setting the extall variable: 143 # setenv extall 1 144 # The loopbacks that run are platform-dependent and are run on 145 # adjacent pairs of connectors: 146 # white_knight: one external cable 147 # merlin: one external cable 148 # lancelot: two external cables 149 # herc8, herc8_15: four external cables 150 # herc4, herc4_15: two external cables 151 # guenevere: one external cables 152 153 if $?extall \ 154 "rcload rc.soc" 155 156 if $?extall && $?herc8 "\ 157 echo 'External Loopback Port1->Port2 ...'; \ 158 tr 20 tpbm=hg0 di=1; \ 159 echo 'External Loopback Port2->Port1 ...'; \ 160 tr 20 tpbm=hg1 di=-1; \ 161 \ 162 echo 'External Loopback Port3->Port4 ...'; \ 163 tr 20 tpbm=hg2 di=1; \ 164 echo 'External Loopback Port4->Port3 ...'; \ 165 tr 20 tpbm=hg3 di=-1; \ 166 \ 167 echo 'External Loopback Port5->Port6 ...'; \ 168 tr 20 tpbm=hg4 di=1; \ 169 echo 'External Loopback Port6->Port5 ...'; \ 170 tr 20 tpbm=hg5 di=-1; \ 171 \ 172 echo 'External Loopback Port7->Port8 ...'; \ 173 tr 20 tpbm=hg6 di=1; \ 174 echo 'External Loopback Port8->Port7 ...'; \ 175 tr 20 tpbm=hg7 di=-1" 176 177 if $?extall && $?herc4 && !$?knightly "\ 178 echo 'External Loopback Port1->Port2 ...'; \ 179 tr 20 tpbm=hg0 di=1; \ 180 echo 'External Loopback Port2->Port1 ...'; \ 181 tr 20 tpbm=hg1 di=-1; \ 182 \ 183 echo 'External Loopback Port3->Port4 ...'; \ 184 tr 20 tpbm=hg2 di=1; \ 185 echo 'External Loopback Port4->Port3 ...'; \ 186 tr 20 tpbm=hg3 di=-1" 187 188 if $?extall && $?white_knight "\ 189 echo 'External Loopback Port2->Port3 ...'; \ 190 tr 20 tpbm=hg1 di=1; \ 191 echo 'External Loopback Port3->Port2 ...'; \ 192 tr 20 tpbm=hg2 di=-1" 193 194 if $?extall && $?merlin "\ 195 echo 'External Loopback Port2->Port3 ...'; \ 196 tr 20 tpbm=hg1 di=1; \ 197 echo 'External Loopback Port3->Port2 ...'; \ 198 tr 20 tpbm=hg2 di=-1" 199 200 if $?extall && $?lancelot "\ 201 echo 'External Loopback Port3->Port4 ...'; \ 202 tr 20 tpbm=hg2 di=1; \ 203 echo 'External Loopback Port4->Port3 ...'; \ 204 tr 20 tpbm=hg3 di=-1; \ 205 \ 206 echo 'External Loopback Port5->Port6 ...'; \ 207 tr 20 tpbm=hg4 di=1; \ 208 echo 'External Loopback Port6->Port5 ...'; \ 209 tr 20 tpbm=hg5 di=-1" 210 211 if $?extall && $?guenevere "\ 212 echo 'External Loopback Port3->Port4 ...'; \ 213 tr 20 tpbm=hg2 di=1; \ 214 echo 'External Loopback Port4->Port3 ...'; \ 215 tr 20 tpbm=hg3 di=-1" 216 217 # Traffic test 218 # (This test can be run in external mode but that is not currently done) 219 220 echo 'Running Traffic test on all ports for one minute in Phy Mode ...' 221 tr 72 TIS=60 CPI=5 RM=Phy SP=MAX L=1500 PBM=hg 222 223 rcload rc.soc 224 225 # Show status 226 tl 227 local returnCode $? 228 229 echo Tests Complete. Reinitializing ... 230 rcload rc.soc 231 232 # We want to show the return code from the tl command which 233 # lists the results. The automated test infrastructure keys off of this 234 # value 235 echo "testsuite: finished: sanity: $returnCode"