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

bcm56340sanity.soc (6223B)


      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 # Helix4 BCM56340 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 # This sanity script supports 3 SKUs
     22 # 56340: 
     23 #       1. 12xF.QSGMII + 4xSGMII + 2xXFI + 2xHGd[21] + 1GE - Default
     24 #       2. 12xF.QSGMII + Flex[4x10] + 2xHG[21] + 1GE - bcm56340_4x10
     25 # 56342:
     26 #       1. 7xF.QSGMII + Flex[4x10] + 2xHG[21] + 1GE  - Default
     27 
     28 # Enabling all ports; bcm56340_4x10 SKU
     29 if $?BCM56340_A0 && !"expr $bcm56340_4x10 + 0" \
     30     'local pbmge 0x3fffffffffffe; local pbmmgmt 0x2000000000000; local pbmhg 0xc0000000000000; \
     31      local pbmport 0xfffffffffffffe; local pbmge25 0x0; local pbmxe 0x3c000000000000; \
     32      echo "*** 56340 *" '
     33 
     34 if $?BCM56340_A0 && "expr $bcm56340_4x10 + 0" \
     35     'local pbmge 0x3fffffffffffe; local pbmmgmt 0x2000000000000; local pbmhg 0x300000000000000; \
     36      local pbmport 0x37ffffffffffffe; local pbmge25 0x3c000000000000; local pbmxe 0x40000000000000; \
     37      echo "*** 56340 Base SKU *" '
     38 
     39 # local pbmport 0x3fffffffffffffe
     40 # local pbmxe 0xC0000000000000
     41 
     42 if $?BCM56342_A0 \
     43     'local pbmhg 0xc0000000000000; local pbmge 0x1ffffffe; local pbmxe 0x3c000000000000; \
     44      local pbmport 0xc600001ffffffe; local pbmmgmt 0x2000000000000; local pbmge25 0x0; \
     45      echo "*** 56342 *" '
     46 
     47 # Turn off Mem cache and Parity checks for mem tests
     48 config add mem_cache_enable=0
     49 config add parity_enable=0
     50 
     51 echo "testsuite: started: Helix4 sanity"
     52 rcload rc.soc
     53 counter off
     54 l2mode off
     55 
     56 # We need to print out port status since any cabling effects results.
     57 *:ps
     58 
     59 if $?1 'local full_test 1'
     60 
     61 # Avoid link messages while testing
     62 linkscan off
     63 
     64 init
     65 init misc
     66 
     67 local done 'echo "   Done"'
     68 
     69 #Display some useful information
     70 date
     71 ver
     72 soc
     73 
     74 #Start Test
     75 if !$?ihost_mode \
     76     'echo "Running PCI Compliance ...";\
     77      tr 2;\
     78      $done;'
     79 
     80 if !$?ihost_mode \
     81     'echo "Running PCI S-Channel Buf ...";\
     82      tr 4;\
     83      $done;'
     84 
     85 init soc
     86 debug -warn
     87 echo "Running Register reset defaults ..."
     88 tr 1
     89 $done
     90 
     91 echo "Running Register read/write ..."
     92 tr 3 mask64
     93 $done
     94 debug +warn
     95 
     96 rcload rc.soc
     97 counter off
     98 l2mode off
     99 echo "Running CPU Benchmarks (No Mem Cache) ..."
    100 tr 21
    101 $done
    102 
    103 hx4_mem.soc
    104 
    105 # Re-initialize to clean up of various read/writes to MMU memories
    106 rcload rc.soc
    107 counter off
    108 l2mode off
    109 linkscan off
    110 
    111 echo "Running counter width verification test ..."
    112 tr 30
    113 $done
    114 
    115 echo "Running counter read/write test ..."
    116 tr 31
    117 $done
    118 
    119 #Hashing tests
    120 echo "Running hash mem test ..."
    121 tr 55
    122 $done
    123 
    124 echo "Running MDIO Linkscan test"
    125 tr 60
    126 $done
    127 
    128 echo "Testing CPU DMA loopback ..."
    129 tr 17
    130 $done
    131 
    132 #echo "Testing CPU DMA, Scatter/Gather Reload ..."
    133 tr 22
    134 #$done
    135 
    136 echo "Testing CPU DMA, Scatter/Gather Simple ..."
    137 tr 23
    138 $done
    139 
    140 echo "Testing CPU DMA, Scatter/Gather Random ..."
    141 tr 24
    142 $done
    143 
    144 ps
    145 
    146 #MAC Loopback
    147 echo "Testing MAC Loopback - 1 Gb/s all GE ports"
    148 tr 18 PortBitMap=$pbmge Speed=1000
    149 $done
    150 
    151 echo "Testing MAC Loopback - 2.5 Gb/s GE 2.5 ports"
    152 tr 18 PortBitMap=$pbmge25 Speed=2500
    153 $done
    154 
    155 echo "Testing MAC Loopback - 10 Gb/s all XE ports"
    156 tr 18 PortBitMap=$pbmxe Speed=10G
    157 $done
    158 
    159 echo "Testing MAC Loopback - 21 Gb/s all HG ports"
    160 tr 18 PortBitMap=$pbmhg Speed=21G 
    161 $done
    162 
    163 echo "Testing PHY Loopback - 1 Gb/s all GE ports"
    164 tr 19 PortBitMap=$pbmge Speed=1000
    165 $done
    166 
    167 echo "Testing PHY Loopback - 2.5 Gb/s GE 2.5 ports"
    168 tr 19 PortBitMap=$pbmge25 Speed=2500
    169 $done
    170 
    171 echo "Testing PHY Loopback - 10 Gb/s all XE ports"
    172 tr 19 PortBitMap=$pbmxe Speed=10G
    173 $done
    174 
    175 echo "Testing PHY Loopback - 21 Gb/s all HG ports"
    176 tr 19 PortBitMap=$pbmhg Speed=21G
    177 $done
    178 
    179 # tr 48 does not work with mix of port types
    180 echo "Running MAC loopback V2 on GE ports..."
    181 tr 48 pbm=$pbmge speed=1000
    182 $done
    183 
    184 echo "Running MAC loopback V2 on XE ports ..."
    185 tr 48 pbm=$pbmxe speed=10G
    186 $done
    187 
    188 echo "Running MAC loopback V2 on HG ports ..."
    189 tr 48 pbm=$pbmhg speed=21G
    190 $done
    191 
    192 # tr 49 does not work with mix of port types
    193 echo "Running PHY loopback V2 on GE ports ..."
    194 tr 49 pbm=$pbmge speed=1000
    195 $done
    196 
    197 echo "Running PHY loopback V2 on XE ports ..."
    198 tr 49 pbm=$pbmxe speed=10G
    199 $done
    200 
    201 echo "Running PHY loopback V2 on HG ports ..."
    202 tr 49 pbm=$pbmhg speed=21G
    203 $done
    204 
    205 #Internal snake Loopback
    206 echo "Running internal snake on GE ports, MAC loopback ..."
    207 tr 39 LoopbackMode=MAC snakepath=TWOways PortBitMap=$pbmge
    208 $done
    209 
    210 echo "Running internal snake on GE ports, PHY loopback ..."
    211 tr 39 LoopbackMode=PHY snakepath=TWOways PortBitMap=$pbmge
    212 $done
    213 
    214 echo "Running internal snake on XE ports, MAC loopback ..."
    215 tr 39 LoopbackMode=MAC snakepath=TWOways PortBitMap=$pbmxe
    216 $done
    217 
    218 echo "Running internal snake on XE ports, PHY loopback ..."
    219 tr 39 LoopbackMode=PHY snakepath=TWOways PortBitMap=$pbmxe
    220 $done
    221 
    222 #Traffic Test
    223 echo "Running Traffic Test on GE ports in MAC mode ..."
    224 tr 72 RunMode=MAC PortBitMap=$pbmge c=10 sp=1000
    225 $done
    226 
    227 #Traffic Test
    228 echo "Running Traffic Test on GE 2.5 ports in MAC mode ..."
    229 tr 72 RunMode=MAC PortBitMap=$pbmge25 c=10 sp=2500
    230 $done
    231 
    232 echo "Running Traffic Test on GE ports in PHY mode ..."
    233 tr 72 RunMode=PHY PortBitMap=$pbmge c=10 sp=1000
    234 $done
    235 
    236 echo "Running Traffic Test on XE ports in MAC mode ..."
    237 tr 72 RunMode=MAC PortBitMap=$pbmxe c=10 sp=10G
    238 $done
    239 
    240 echo "Running Traffic Test on XE ports in PHY mode ..."
    241 tr 72 RunMode=PHY PortBitMap=$pbmxe c=10 sp=10G
    242 $done
    243 
    244 echo "Running Traffic Test on HG ports in MAC mode ..."
    245 tr 72 RunMode=MAC PortBitMap=$pbmhg c=10 sp=21G
    246 $done
    247 
    248 echo "Running Traffic Test on HG ports in PHY mode ..."
    249 tr 72 RunMode=PHY PortBitMap=$pbmhg c=10 sp=21G
    250 $done
    251 
    252 # Show status
    253 date
    254 tl
    255 local returnCode $?
    256 
    257 echo Tests Complete.  Reinitializing ...
    258 config refresh
    259 rcload rc.soc
    260 counter off
    261 l2mode off
    262 
    263 # We want to show the return code from the tl command which
    264 # lists the results. The automated test infrastructure keys off of this
    265 # value
    266 echo "testsuite: finished: sanity: $returnCode"