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

bcm56540sanity.soc (6479B)


      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 # Triumph3 BCM56540, BCM56545 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 
     12 # Set run command script not to fail on errors reported by commands
     13 # this allows the script to continue if a test fails
     14 set rcerror=false
     15 
     16 # Set up test mode: don't stop on errors, show progress on each test
     17 tm -stoponerror +progress
     18 # Unselect all
     19 ts -*
     20 
     21 local pbmge 0x3fffffffffffe
     22 if "expr $bcm56540_4x10_2x42 + 0" \
     23     'local pbmhg 0x3c000000000000; local testhg20 1; local pbmhg20 0x30000000000000; \
     24      local pbmhg42 0xc000000000000; local pbmport 0x3ffffffffffffe'
     25 if !"expr $bcm56540_4x10_2x42 + 0" \
     26     'local testxe 1; local pbmxe 0x3c000000000000; local pbmhg 0xc0000000000000; \
     27      local pbmhg42 0xc0000000000000; local pbmport 0xfffffffffffffe'
     28 
     29 # Turn off Mem cache and Parity checks for mem tests
     30 config add mem_cache_enable=0
     31 config add parity_enable=0
     32 
     33 echo "testsuite: started: sanity"
     34 rcload rc.soc
     35 counter off
     36 l2mode off
     37 
     38 # We need to print out port status since any cabling effects results.
     39 *:ps
     40 
     41 if $?1 'local full_test 1'
     42 
     43 # Avoid link messages while testing
     44 linkscan off
     45 ibodsync off
     46 init
     47 init misc
     48 
     49 local done 'echo "   Done"'
     50 
     51 #Display some useful information
     52 date
     53 ver
     54 soc
     55 
     56 #Start Test
     57 echo "Running PCI Compliance ..."
     58 tr 2
     59 $done
     60 
     61 echo "Running PCI S-Channel Buf ..."
     62 tr 4
     63 $done
     64 
     65 init soc
     66 debug -warn
     67 echo "Running Register reset defaults ..."
     68 tr 1
     69 $done
     70 
     71 echo "Running Register read/write ..."
     72 tr 3 mask64
     73 $done
     74 debug +warn
     75 
     76 rcload rc.soc
     77 counter off
     78 l2mode off
     79 echo "Running CPU Benchmarks (No Mem Cache) ..."
     80 tr 21
     81 $done
     82 
     83 fb4_mem.soc
     84 
     85 # Re-initialize to clean up of various read/writes to MMU memories
     86 rcload rc.soc
     87 counter off
     88 l2mode off
     89 linkscan off
     90 
     91 echo "Running counter width verification test ..."
     92 tr 30
     93 $done
     94 
     95 echo "Running counter read/write test ..."
     96 tr 31
     97 $done
     98 
     99 #Hashing tests - TBD
    100 #tr 55
    101 
    102 echo "Running MDIO Linkscan test"
    103 tr 60
    104 $done
    105 
    106 #echo "Testing CPU DMA loopback ..."
    107 #tr 17
    108 $done
    109 
    110 #echo "Testing CPU DMA, Scatter/Gather Reload ..."
    111 #tr 22
    112 #$done
    113 
    114 #echo "Testing CPU DMA, Scatter/Gather Simple ..."
    115 #tr 23
    116 $done
    117 
    118 #echo "Testing CPU DMA, Scatter/Gather Random ..."
    119 #tr 24
    120 $done
    121 
    122 #MAC Loopback
    123 echo "Testing MAC Loopback - 1 Gb/s all GE ports"
    124 tr 18 PortBitMap=$pbmge Speed=1000
    125 $done
    126 
    127 if !"expr $testxe + 0" \
    128         'echo "Testing MAC Loopback - 10 Gb/s all XE ports"; \
    129          tr 18 PortBitMap=$pbmxe Speed=10G; $done'
    130 
    131 echo "Testing MAC Loopback - 21 Gb/s all HG21 ports"
    132 tr 18 PortBitMap=$pbmhg Speed=20G
    133 $done
    134 
    135 echo "Testing MAC Loopback - 42 Gb/s all HG42 ports"
    136 tr 18 PortBitMap=$pbmhg42 Speed=42G
    137 $done
    138 
    139 #PHY Loopback
    140 echo "Testing PHY Loopback - 1 Gb/s all GE ports"
    141 tr 19 PortBitMap=$pbmge Speed=1000
    142 $done
    143 
    144 if !"expr $testxe + 0" \
    145         'echo "Testing PHY Loopback - 10 Gb/s all XE ports"; \
    146          tr 19 PortBitMap=$pbmxe Speed=10G; $done'
    147 
    148 if !"expr $testhg20 + 0" \
    149         'echo "Testing PHY Loopback - 21 Gb/s all HG21 ports"; \
    150          tr 19 PortBitMap=$pbmhg20 speed=21G; $done'
    151 
    152 echo "Testing PHY Loopback - 42 Gb/s all HG42 ports"
    153 tr 19 PortBitMap=$pbmhg42 Speed=42G
    154 $done
    155 
    156 echo "Running MAC loopback V2 on all ports ..."
    157 tr 48 pbm=$pbmport
    158 $done
    159 
    160 echo "Running PHY loopback V2 on all ports ..."
    161 tr 49 pbm=$pbmport
    162 $done
    163 
    164 #Internal snake Loopback
    165 echo "Running internal snake on GE ports, MAC loopback ..."
    166 tr 39 LoopbackMode=MAC snakepath=TWOways PortBitMap=$pbmge
    167 $done
    168 
    169 echo "Running internal snake on GE ports, PHY loopback ..."
    170 tr 39 LoopbackMode=PHY snakepath=TWOways PortBitMap=$pbmge
    171 $done
    172 
    173 if !"expr $testxe + 0" \
    174         'echo "Running internal snake on XE ports, MAC loopback ..."; \
    175          tr 39 LoopbackMode=MAC snakepath=TWOways PortBitMap=$pbmxe; $done'
    176 
    177 if !"expr $testxe + 0" \
    178         'echo "Running internal snake on XE ports, PHY loopback ..."; \
    179          tr 39 LoopbackMode=PHY snakepath=TWOways PortBitMap=$pbmxe; $done'
    180 
    181 #Traffic Test
    182 echo "Running Traffic Test on GE ports in MAC mode ..."
    183 tr 72 RunMode=MAC PortBitMap=$pbmge c=10 sp=1000
    184 $done
    185 
    186 echo "Running Traffic Test on GE ports in PHY mode ..."
    187 tr 72 RunMode=PHY PortBitMap=$pbmge c=10 sp=1000
    188 $done
    189 
    190 if !"expr $testxe + 0" \
    191         'echo "Running Traffic Test on XE ports in MAC mode ..."; \
    192          tr 72 RunMode=MAC PortBitMap=$pbmxe c=10 sp=10G; $done'
    193 
    194 if !"expr $testxe + 0" \
    195         'echo "Running Traffic Test on XE ports in PHY mode ..."; \
    196          tr 72 RunMode=PHY PortBitMap=$pbmxe c=10 sp=10G; $done'
    197 
    198 echo "Running Traffic Test on HG ports in MAC mode ..."
    199 tr 72 RunMode=MAC PortBitMap=$pbmhg c=10 sp=max
    200 $done
    201 
    202 echo "Running Traffic Test on HG ports in PHY mode ..."
    203 tr 72 RunMode=PHY PortBitMap=$pbmhg c=10 sp=max
    204 $done
    205 
    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"