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

sanity.soc (9050B)


      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 # Script to run all available tests as quickly as possible.
      7 # For testing basic sanity of new drivers, simulators, chips, etc.
      8 
      9 echo "testsuite: started: sanity"
     10 
     11 # We need to print out port status since any cabling effects results.
     12 *:ps
     13 
     14 # Avoid link messages while testing
     15 linkscan off
     16 
     17 # Use expected COS configuration for tests
     18 config add bcm_num_cos=4
     19 
     20 init 
     21 init misc
     22 
     23 local done 'echo "   Done"'
     24 
     25 if $?slc "local sl 1"
     26 
     27 # Set run command script not to fail on errors reported by commands
     28 # this allows the script to continue if a test fails
     29 set rcerror=false
     30 
     31 # Set up test mode: don't stop on errors, show progress on each test
     32 tm -stoponerror +progress
     33 # Unselect all
     34 ts -*
     35 
     36 # Tests Start Here
     37 
     38 echo Running CPU benchmarks ...
     39 tr 21
     40 $done
     41 
     42 echo Running PCI tests ...
     43 tr 2
     44 $done
     45 
     46 # Register test currently includes some non-existent registers, and fails.
     47 #echo Running register tests ...
     48 #tr 3
     49 #$done
     50 
     51 echo Running S-Channel message buffer test ...
     52 tr 4
     53 $done
     54 
     55 echo Running BIST on CBP, ARL, and L3 tables ...
     56 tr 5
     57 $done
     58 
     59 echo Running ARL tests
     60 echo "   incrementing insert ..."
     61 tr 7
     62 echo "   decrementing insert ..."
     63 tr 8
     64 echo "   dma ..."
     65 tr 15
     66 echo "   overflow behavior ..."
     67 tr 16
     68 $done
     69 
     70 # Link status test requires Linkscan to be running
     71 rcload rc.soc
     72 
     73 echo Running Link Status tests ...
     74 tr 9
     75 $done
     76 
     77 echo Running GBP Available tests ...
     78 tr 10
     79 $done
     80 
     81 echo Running HOL Status tests ...
     82 tr 12
     83 $done
     84 
     85 echo Running COS Status tests ...
     86 tr 13
     87 $done
     88 
     89 echo Running Back Pressure Discard tests ...
     90 tr 14
     91 $done
     92 
     93 echo Running counter width verification test ...
     94 tr 30
     95 $done
     96 
     97 echo Running counter read/write test ...
     98 tr 31
     99 $done
    100 
    101 echo Running MDIO Linkscan test
    102 tr 60 readcount=10000
    103 $done
    104 
    105 echo Running Switching Memory tests
    106 # Note: Switching memory tests automatically put MMU in debug mode
    107 
    108 local arl_writable "$?gsl || $?BCM5615_A0"
    109 
    110 if $arl_writable \
    111 	'echo "   ARL";		tr 50 m=ARL; tr 51 m=ARL'
    112 echo "   MARL";			tr 50 m=MARL; tr 51 m=MARL
    113 echo "   PTABLE";		tr 50 m=PTABLE; tr 51 m=PTABLE
    114 echo "   VTABLE";		tr 50 m=VTABLE; tr 51 m=VTABLE
    115 if $?ul \
    116 	'echo "   STG";		tr 50 m=STG; tr 51 m=STG'
    117 
    118 # Turn off caching for trunk table memory tests.
    119 # init bcm turns on caching for these memories as a chip erratum workaround.
    120 
    121 cache -tbmap -ttr
    122 
    123 echo "   TBMAP";		tr 50 m=TBMAP; tr 51 m=TBMAP
    124 echo "   TTR";			tr 50 m=TTR; tr 51 m=TTR
    125 
    126 if !$?gsl '\
    127 	echo "   IMASK";	tr 50 m=IMASK; tr 51 m=IMASK; \
    128 	echo "   IRULE";	tr 50 m=IRULE; tr 51 m=IRULE'
    129 
    130 echo "   GIMASK";		tr 50 m=GIMASK; tr 51 m=GIMASK
    131 echo "   GIRULE";		tr 50 m=GIRULE; tr 51 m=GIRULE
    132 
    133 if $?sml || $?ul '\
    134 	echo "   METERING";	tr 50 m=METERING; tr 51 m=METERING; \
    135 				tr 50 m=GMETERING; tr 51 m=GMETERING; \
    136 	echo "   FFPCOUNTERS";	tr 50 m=FFPCOUNTERS; tr 51 m=FFPCOUNTERS; \
    137 				tr 50 m=GFFPCOUNTERS; tr 51 m=GFFPCOUNTERS; \
    138 	echo "   FFPPACKETCOUNTERS"; \
    139 				tr 50 m=FFPPACKETCOUNTERS; \
    140 				tr 51 m=FFPPACKETCOUNTERS; \
    141 				tr 50 m=GFFPPACKETCOUNTERS; \
    142 				tr 51 m=GFFPPACKETCOUNTERS'
    143 
    144 echo "   L3IF";			tr 50 m=L3IF; tr 51 m=L3IF
    145 echo "   L3";			tr 50 m=L3; tr 51 m=L3
    146 echo "   DEFIP";		tr 50 m=DEF_IP; tr 51 m=DEF_IP
    147 if $?sml || $?ul '\
    148 	echo "   L3_IPMC";	tr 50 m=L3_IPMC; tr 51 m=L3_IPMC'
    149 
    150 if !$?gsl '\
    151 	echo "   CAB 0-3";	tr 50 m=CAB0; tr 51 m=CAB0; \
    152 				tr 50 m=CAB1; tr 51 m=CAB1; \
    153 				tr 50 m=CAB2; tr 51 m=CAB2; \
    154 				tr 50 m=CAB3; tr 51 m=CAB3'
    155 
    156 echo "   CBPDATA 0-3";		tr 50 m=CBPDATA0; tr 51 m=CBPDATA0
    157 				tr 50 m=CBPDATA1; tr 51 m=CBPDATA1
    158 				tr 50 m=CBPDATA2; tr 51 m=CBPDATA2
    159 				tr 50 m=CBPDATA3; tr 51 m=CBPDATA3
    160 echo "   CBPHEADER";		tr 50 m=CBPHEADER; tr 51 m=CBPHEADER
    161 echo "   CCP";			tr 50 m=CCP; tr 51 m=CCP
    162 echo "   CFAP";			tr 50 m=CFAP; tr 51 m=CFAP
    163 
    164 if !$?gsl '\
    165 	echo "   PID";		tr 50 m=PID; tr 51 m=PID; \
    166 	echo "   PPP";		tr 50 m=PPP; tr 51 m=PPP; \
    167 	echo "   SFAP";		tr 50 m=SFAP; tr 51 m=SFAP'
    168 
    169 if  $?gsl "local max_xq 7"
    170 if !$?gsl "local max_xq 25"
    171 
    172 echo "   XQ 0-$max_xq,27"
    173 for xq=0,$max_xq		'tr 50 m=XQ$xq; tr 51 m=XQ$xq'
    174 				tr 50 m=XQ27; tr 51 m=XQ27
    175 $done
    176 
    177 # GBP Memory Test
    178 # Load rc.soc first to set up SDRAMCONTROL registers.
    179 
    180 local have_gbp !$?gsl
    181 
    182 if $have_gbp \
    183 	"echo Initializing for GBP test ...; \
    184 	 rcload rc.soc; \
    185 	 echo '   GBP (partial, every 8th address) ...'; \
    186 	 tr 50 m=GBP ii=8; \
    187 	 tr 51 m=GBP iter=10000"
    188 
    189 # Loopback Tests
    190 # Each test loads rc.soc in case a previous test failed
    191 
    192 # Re-initialize to clean up of various read/writes to memories
    193 rcload rc.soc
    194 linkscan off
    195 
    196 echo Testing CPU DMA loopback ...
    197 tr 17 c=5
    198 $done
    199 
    200 echo Testing CPU DMA, Scatter/Gather Reload ...
    201 tr 22
    202 $done
    203 
    204 echo Testing CPU DMA, Scatter/Gather Simple ...
    205 tr 23
    206 $done
    207 
    208 echo Testing CPU DMA, Scatter/Gather Random ...
    209 tr 24
    210 $done
    211 
    212 #--------- MAC Loopback ---------
    213 
    214 if !$?sl "echo Testing MAC Loopback - 10 Mb/s all ports; \
    215     tr 18 pbm=e speed=10; echo done"
    216 
    217 if !$?sl "echo Testing MAC Loopback - 100 Mb/s all ports; \
    218     tr 18 pbm=e speed=100; echo done"
    219 
    220 echo Testing MAC Loopback - 1000 Mb/s gigabit ports
    221 tr 18 pbm=ge speed=1000
    222 
    223 $done
    224 
    225 #--------- PHY Loopback ---------
    226 
    227 # If you have SERDES ports (two on 5680 or two on 5600/5605) then run
    228 #	setenv serdes 1
    229 # before running this script to avoid running 10/100 on SERDES ports.
    230 
    231 if $?sl "local slowable fe"
    232 if $?gsl && $?serdes "local slowable ge2-ge7"
    233 if $?gsl && !$?serdes "local slowable ge"
    234 if !$?sl && !$?gsl && $?serdes "local slowable fe"
    235 if !$?sl && !$?gsl && !$?serdes "local slowable e"
    236 
    237 echo Testing PHY Loopback - 10 Mb/s all capable ports
    238 tr 19 pbm=$slowable speed=10 count=1
    239 
    240 echo Testing PHY Loopback - 100 Mb/s all capable ports
    241 tr 19 pbm=$slowable speed=100 count=1
    242 
    243 echo Testing PHY Loopback - 1000 MB/s all capable ports
    244 tr 19 pbm=ge speed=1000
    245 
    246 $done
    247 
    248 #--------- EXT Loopback ---------
    249 
    250 # If you have external loopback cables connected as follows
    251 #	1-2, 3-4, 5-6, 7-8, [..., 23-24, 25-26]
    252 # then you can enable this script to perform external loopback at
    253 # different speeds.  Before running this script, use:
    254 #	setenv ext10 1
    255 #	setenv ext100 1
    256 #	setenv ext1000 1
    257 # or
    258 #	setenv extall 1
    259 # If you have SERDES ports (two on 5680 or two on 5600/5605) then run
    260 #	setenv serdes 1
    261 # before running this script to avoid running 10/100 on SERDES ports.
    262 
    263 if $?sl "local fwd_slow 0x555555;  local bwd_slow 0xaaaaaa; \
    264 	 local fwd_fast ge0;       local bwd_fast ge1"
    265 if $?gsl && $?serdes \
    266 	"local fwd_slow 0x54;      local bwd_slow 0xa8; \
    267 	 local fwd_fast 0x55;      local bwd_fast 0xaa"
    268 if $?gsl && !$?serdes \
    269 	"local fwd_slow 0x55;      local bwd_slow 0xaa; \
    270 	 local fwd_fast 0x55;      local bwd_fast 0xaa"
    271 if !$?sl && !$?gsl && $?serdes \
    272 	"local fwd_slow 0x555555;  local bwd_slow 0xaaaaaa; \
    273 	 local fwd_fast ge0;       local bwd_fast ge1"
    274 if !$?sl && !$?gsl && !$?serdes \
    275 	"local fwd_slow 0x1555555; local bwd_slow 0x2aaaaaa; \
    276 	 local fwd_fast ge0;       local bwd_fast ge1"
    277 
    278 if $?extall \
    279 	"local ext10 1; local ext100 1; local ext1000 1"
    280 
    281 if $?ext10 \
    282 	"echo Testing External Loopback - 10 MB/s forward; \
    283 		tr 20 tpbm=$fwd_slow di=1 speed=10 count=10; \
    284 	 echo Testing External Loopback - 10 MB/s reverse; \
    285 		tr 20 tpbm=$bwd_slow di=-1 speed=10 count=10"
    286 
    287 if $?ext100 \
    288 	"echo Testing External Loopback - 100 MB/s forward; \
    289 		tr 20 tpbm=$fwd_slow di=1 speed=100 count=10; \
    290 	 echo Testing External Loopback - 100 MB/s reverse; \
    291 		tr 20 tpbm=$bwd_slow di=-1 speed=100 count=10"
    292 
    293 if $?ext1000 \
    294 	"echo Testing External Loopback - 1000 MB/s forward; \
    295 		tr 20 tpbm=$fwd_fast di=1 speed=1000 count=10; \
    296 	 echo Testing External Loopback - 1000 MB/s reverse; \
    297 		tr 20 tpbm=$bwd_fast di=-1 speed=1000 count=10"
    298 
    299 
    300 #--------- MAC Loopback V2 ---------
    301 
    302 if !$?sl "echo Testing MAC Loopback V2 - 10 Mb/s all ports; \
    303     tr 48 pbm=e speed=10; echo done"
    304 
    305 if !$?sl "echo Testing MAC Loopback V2 - 100 Mb/s all ports; \
    306     tr 48 pbm=e speed=100; echo done"
    307 
    308 echo Testing MAC Loopback V2 - 1000 Mb/s gigabit ports
    309 tr 48 pbm=ge speed=1000
    310 
    311 $done
    312 
    313 #--------- PHY Loopback V2 ---------
    314 
    315 # If you have SERDES ports (two on 5680 or two on 5600/5605) then run
    316 #	setenv serdes 1
    317 # before running this script to avoid running 10/100 on SERDES ports.
    318 
    319 if $?sl "local slowable fe"
    320 if $?gsl && $?serdes "local slowable ge2-ge7"
    321 if $?gsl && !$?serdes "local slowable ge"
    322 if !$?sl && !$?gsl && $?serdes "local slowable fe"
    323 if !$?sl && !$?gsl && !$?serdes "local slowable e"
    324 
    325 echo Testing PHY Loopback V2 - 10 Mb/s all capable ports
    326 tr 49 pbm=$slowable speed=10 count=1
    327 
    328 echo Testing PHY Loopback V2 - 100 Mb/s all capable ports
    329 tr 49 pbm=$slowable speed=100 count=1
    330 
    331 echo Testing PHY Loopback V2 - 1000 MB/s all capable ports
    332 tr 49 pbm=ge speed=1000
    333 
    334 $done
    335 
    336 echo Testing Filters
    337 tr 70
    338 $done
    339 
    340 # Show status
    341 tl 
    342 local returnCode $?
    343 
    344 echo Tests Complete.  Reinitializing ...
    345 rcload rc.soc
    346 
    347 # We want to show the return code from the tl command which
    348 # lists the results. The automated test infrastructure keys off of this 
    349 # value
    350 echo "testsuite: finished: sanity: $returnCode"