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

tsanity.soc (8776B)


      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 init mmu
     23 
     24 local xqmax 55
     25 if $?magnum || $?BCM5650_B0 "local xqmax 29"
     26 
     27 local done 'echo "   Done"'
     28 
     29 # Set run command script not to fail on errors reported by commands
     30 # this allows the script to continue if a test fails
     31 set rcerror=false
     32 
     33 # Set up test mode: don't stop on errors, show progress on each test
     34 tm -stoponerror +progress
     35 # Unselect all
     36 ts -*
     37 
     38 # Tests Start Here
     39 
     40 echo Running CPU benchmarks ...
     41 tr 21
     42 $done
     43 
     44 echo Running PCI tests ...
     45 tr 2
     46 $done
     47 
     48 echo Running register tests ...
     49 tr 3
     50 $done
     51 
     52 echo Running S-Channel message buffer test ...
     53 tr 4
     54 $done
     55 
     56 echo Running Switching Memory tests
     57 # Note: Switching memory tests automatically put MMU in debug mode
     58 
     59 echo "   DEF_IP_HI";		tr 50 m=DEF_IP_HI; tr 51 m=DEF_IP_HI
     60 echo "   DEF_IP_HIT_HI";	tr 50 m=DEF_IP_HIT_HI; tr 51 m=DEF_IP_HIT_HI
     61 echo "   DEF_IP_HIT_LO";	tr 50 m=DEF_IP_HIT_LO; tr 51 m=DEF_IP_HIT_LO
     62 echo "   DEF_IP_LO";		tr 50 m=DEF_IP_LO; tr 51 m=DEF_IP_LO
     63 echo "   PORT_DSCP_PRI";	tr 50 m=PORT_DSCP_PRI; tr 51 m=PORT_DSCP_PRI
     64 echo "   EGRESS_MASK";		tr 50 m=EGRESS_MASK; tr 51 m=EGRESS_MASK
     65 echo "   FE_IPMC_VEC";		tr 50 m=FE_IPMC_VEC; tr 51 m=FE_IPMC_VEC
     66 echo "   FE_IPMC_VLAN";		tr 50 m=FE_IPMC_VLAN; tr 51 m=FE_IPMC_VLAN
     67 echo "   IMASK";		tr 50 m=IMASK; tr 51 m=IMASK
     68 echo "   IRULE";		tr 50 m=IRULE; tr 51 m=IRULE
     69 echo "   GE_IPMC_VEC";		tr 50 m=GE_IPMC_VEC; tr 51 m=GE_IPMC_VEC
     70 echo "   GE_IPMC_VLAN";		tr 50 m=GE_IPMC_VLAN; tr 51 m=GE_IPMC_VLAN
     71 echo "   GFFPCOUNTERS";		tr 50 m=GFFPCOUNTERS; tr 51 m=GFFPCOUNTERS
     72 echo "   GIMASK";		tr 50 m=GIMASK; tr 51 m=GIMASK
     73 echo "   GIRULE";		tr 50 m=GIRULE; tr 51 m=GIRULE
     74 echo "   GMETERING";		tr 50 m=GMETERING; tr 51 m=GMETERING
     75 echo "   L2_TABLE";		tr 50 m=L2_TABLE; tr 51 m=L2_TABLE
     76 echo "   L2_HIT_BITS";		tr 50 m=L2_HIT_BITS; tr 51 m=L2_HIT_BITS
     77 echo "   L2MC_TABLE";		tr 50 m=L2MC_TABLE; tr 51 m=L2MC_TABLE
     78 echo "   L2_STATIC_BITS";	tr 50 m=L2_STATIC_BITS; tr 51 m=L2_STATIC_BITS
     79 echo "   L2_VALID_BITS";	tr 50 m=L2_VALID_BITS; tr 51 m=L2_VALID_BITS
     80 echo "   L3_TABLE";		tr 50 m=L3_TABLE; tr 51 m=L3_TABLE
     81 echo "   L3_HIT_BITS";		tr 50 m=L3_HIT_BITS; tr 51 m=L3_HIT_BITS
     82 echo "   L3_VALID_BITS";	tr 50 m=L3_VALID_BITS; tr 51 m=L3_VALID_BITS
     83 echo "   L3INTF";		tr 50 m=L3INTF; tr 51 m=L3INTF
     84 echo "   L3_IPMC";		tr 50 m=L3_IPMC; tr 51 m=L3_IPMC
     85 echo "   PORT_MAC_BLOCK";	tr 50 m=PORT_MAC_BLOCK; tr 51 m=PORT_MAC_BLOCK
     86 echo "   IPMCREP";		tr 50 m=IPMCREP; tr 51 m=IPMCREP
     87 echo "   PORT";			tr 50 m=PORT; tr 51 m=PORT
     88 echo "   PORT1";		tr 50 m=PORT1; tr 51 m=PORT1
     89 echo "   VLAN_STG";		tr 50 m=VLAN_STG; tr 51 m=VLAN_STG
     90 echo "   TRUNK_BITMAP";		tr 50 m=TRUNK_BITMAP; tr 51 m=TRUNK_BITMAP
     91 echo "   PORT_TRUNK_EGRESS";	tr 50 m=PORT_TRUNK_EGRESS;
     92 				tr 51 m=PORT_TRUNK_EGRESS
     93 echo "   TRUNK_GROUP";		tr 50 m=TRUNK_GROUP; tr 51 m=TRUNK_GROUP
     94 echo "   VLAN";			tr 50 m=VLAN; tr 51 m=VLAN
     95 echo "   PORT_VPLS_BITMAP_TABLE";  tr 50 m=PORT_VPLS_BITMAP_TABLE;
     96 				tr 51 m=PORT_VPLS_BITMAP_TABLE
     97 echo "   CCP";			tr 50 m=CCP; tr 51 m=CCP
     98 echo "   CFAP";			tr 50 m=CFAP; tr 51 m=CFAP
     99 echo "   XQ 0-$xqmax"
    100 for xq=0,$xqmax 'tr 50 m=XQ$xq; tr 51 m=XQ$xq'
    101 $done
    102 
    103 echo Running Table DMA Tests
    104 # Specify a zero count for each test to indicate entire memory.
    105 # Otherwise the count from the previous invocation is used.
    106 echo "   DEF_IP_HI";		tr 71 m=DEF_IP_HI c=0
    107 echo "   DEF_IP_HIT_HI";	tr 71 m=DEF_IP_HIT_HI c=0
    108 echo "   DEF_IP_HIT_LO";	tr 71 m=DEF_IP_HIT_LO c=0
    109 echo "   DEF_IP_LO";		tr 71 m=DEF_IP_LO c=0
    110 echo "   EGRESS_MASK";		tr 71 m=EGRESS_MASK c=0
    111 echo "   FE_IPMC_VEC";		tr 71 m=FE_IPMC_VEC c=0
    112 echo "   FE_IPMC_VLAN";		tr 71 m=FE_IPMC_VLAN c=0
    113 echo "   GFFPCOUNTERS";		tr 71 m=GFFPCOUNTERS c=0
    114 echo "   GE_IPMC_VEC";		tr 71 m=GE_IPMC_VEC c=0
    115 echo "   GE_IPMC_VLAN";		tr 71 m=GE_IPMC_VLAN c=0
    116 echo "   GMETERING";		tr 71 m=GMETERING c=0
    117 echo "   L2_TABLE";		tr 71 m=L2_TABLE c=0
    118 echo "   L2_HIT_BITS";		tr 71 m=L2_HIT_BITS c=0
    119 echo "   L2MC_TABLE";		tr 71 m=L2MC_TABLE c=0
    120 echo "   L2_STATIC_BITS";	tr 71 m=L2_STATIC_BITS c=0
    121 echo "   L2_VALID_BITS";	tr 71 m=L2_VALID_BITS c=0
    122 echo "   L3_TABLE";		tr 71 m=L3_TABLE c=0
    123 echo "   L3_HIT_BITS";		tr 71 m=L3_HIT_BITS c=0
    124 echo "   L3_VALID_BITS";	tr 71 m=L3_VALID_BITS c=0
    125 echo "   L3INTF";		tr 71 m=L3INTF c=0
    126 echo "   PORT_MAC_BLOCK";	tr 71 m=PORT_MAC_BLOCK c=0
    127 echo "   PORT";			tr 71 m=PORT c=0
    128 echo "   PORT1";		tr 71 m=PORT1 c=0
    129 echo "   VLAN_STG";		tr 71 m=VLAN_STG c=0
    130 echo "   TRUNK_BITMAP";		tr 71 m=TRUNK_BITMAP c=0
    131 echo "   PORT_TRUNK_EGRESS";	tr 71 m=PORT_TRUNK_EGRESS c=0
    132 echo "   TRUNK_GROUP";		tr 71 m=TRUNK_GROUP c=0
    133 echo "   VLAN";			tr 71 m=VLAN c=0
    134 echo "   PORT_VPLS_BITMAP_TABLE"; tr 71 m=PORT_VPLS_BITMAP_TABLE c=0
    135 $done
    136 
    137 # Re-initialize to clean up of various read/writes to MMU memories
    138 rcload rc.soc
    139 linkscan off
    140 
    141 echo Running counter width verification test ...
    142 tr 30
    143 $done
    144 
    145 echo Running counter read/write test ...
    146 tr 31
    147 $done
    148 
    149 echo Running L2 insert/delete/lookup test ...
    150 tr 32
    151 $done
    152 
    153 echo Running L2 overflow insert test ...
    154 tr 33
    155 $done
    156 
    157 echo Running L2 hash test ...
    158 tr 34
    159 $done
    160 
    161 echo Running L2 delete by port test ...
    162 tr 35
    163 $done
    164 
    165 echo Running L2 delete by vlan test ...
    166 tr 36
    167 $done
    168 
    169 echo Running L3 overflow insert test ...
    170 tr 37
    171 $done
    172 
    173 echo Running L3 hash test ...
    174 tr 38
    175 $done
    176 
    177 echo Running MDIO Linkscan test
    178 tr 60 readcount=10000
    179 $done
    180 
    181 # Loopback Tests
    182 # Each test loads rc.soc in case a previous test failed
    183 
    184 echo Testing CPU DMA loopback ...
    185 tr 17 c=5
    186 $done
    187 
    188 echo Testing CPU DMA, Scatter/Gather Reload ...
    189 tr 22
    190 $done
    191 
    192 echo Testing CPU DMA, Scatter/Gather Simple ...
    193 tr 23
    194 $done
    195 
    196 echo Testing CPU DMA, Scatter/Gather Random ...
    197 tr 24
    198 $done
    199 
    200 #--------- MAC Loopback ---------
    201 
    202 echo Testing MAC Loopback - 100 Mb/s all FE/GE ports
    203 tr 18 pbm=fe,ge speed=100
    204 
    205 echo Testing MAC Loopback - 1000 Mb/s all GE ports
    206 tr 18 pbm=ge speed=1000
    207 
    208 echo Testing MAC Loopback - 10000 Mb/s all HG ports
    209 tr 18 pbm=hg speed=10G
    210 
    211 echo Testing MAC Loopback - 10 Mb/s all FE/GE ports
    212 tr 18 pbm=fe,ge speed=10 ppc=1 le=500
    213 
    214 $done
    215 
    216 #--------- PHY Loopback ---------
    217 
    218 echo Testing PHY Loopback - 100 Mb/s all FE/GE ports
    219 tr 19 pbm=fe,ge speed=100 count=1
    220 
    221 echo Testing PHY Loopback - 1000 MB/s all GE ports
    222 tr 19 pbm=ge speed=1000
    223 
    224 echo Testing PHY Loopback - 10000 MB/s all HG ports
    225 tr 19 pbm=hg speed=10G
    226 
    227 echo Testing PHY Loopback - 10 Mb/s all FE/GE ports
    228 tr 19 pbm=fe,ge speed=10 ppc=1 le=500 count=1
    229 
    230 $done
    231 
    232 #--------- EXT Loopback ---------
    233 
    234 #TBD
    235 
    236 # If you have external loopback cables connected as follows
    237 #	1-2, 3-4, 5-6, 7-8, 9-10, 11-12
    238 # then you can enable this script to perform external loopback at
    239 # different speeds.  Before running this script, use:
    240 #	setenv ext10 1
    241 #	setenv ext100 1
    242 #	setenv ext1000 1
    243 # or
    244 #	setenv extall 1
    245 
    246 local fwd 0x55555505555555
    247 local bwd 0xaaaaaa0aaaaaaa
    248 local fwdg 0x5000000
    249 local bwdg 0xa000000
    250 
    251 if $?extall \
    252 	"local ext10 1; local ext100 1; local ext1000 1"
    253 
    254 if $?ext10 \
    255 	"echo Testing External Loopback - 10 MB/s forward; \
    256 		tr 20 tpbm=$fwd di=1 speed=10 count=10; \
    257 	 echo Testing External Loopback - 10 MB/s reverse; \
    258 		tr 20 tpbm=$bwd di=-1 speed=10 count=10"
    259 
    260 if $?ext100 \
    261 	"echo Testing External Loopback - 100 MB/s forward; \
    262 		tr 20 tpbm=$fwd di=1 speed=100 count=10; \
    263 	 echo Testing External Loopback - 100 MB/s reverse; \
    264 		tr 20 tpbm=$bwd di=-1 speed=100 count=10"
    265 
    266 if $?ext1000 \
    267 	"echo Testing External Loopback - 1000 MB/s forward; \
    268 		tr 20 tpbm=$fwdg di=1 speed=1000 count=10; \
    269 	 echo Testing External Loopback - 1000 MB/s reverse; \
    270 		tr 20 tpbm=$bwdg di=-1 speed=1000 count=10"
    271 
    272 #--------- INT snake Loopback ---------
    273 
    274 echo "Running internal snake on all ports, MAC loopback ..."
    275 tr 39 loopbackmode=mac snakepath=two
    276 
    277 echo "Running internal snake on all ports, PHY loopback ..."
    278 tr 39 loopbackmode=phy snakepath=two
    279 
    280 echo "Running MAC loopback V2 on all ports ..."
    281 tr 48 smi=103 dmi=42 vlan=5 pi=0x11335577 sendm=single
    282 
    283 echo "Running PHY loopback V2 on all ports ..."
    284 tr 49 smi=52 dmi=83 vlan=23 pi=0x01204007 sendm=array
    285 
    286 echo "Testing Filters"
    287 rcload rc.soc
    288 tr 70
    289 
    290 # Show status
    291 tl 
    292 local returnCode $?
    293 
    294 echo Tests Complete.  Reinitializing ...
    295 rcload rc.soc
    296 
    297 # We want to show the return code from the tl command which
    298 # lists the results. The automated test infrastructure keys off of this 
    299 # value
    300 echo "testsuite: finished: sanity: $returnCode"