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

rcr.soc (2993B)


      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 # Reload script
      7 #
      8 #	A system reload is when the software is restarted from scratch
      9 #	*without* the hardware being reset in any way.  The software
     10 #	will read the current state out of the hardware and resume as if
     11 #	nothing had happened.
     12 #
     13 #	This script is the reload counterpart to the rc.soc script.
     14 #	It calls all the steps needed during the reload process to
     15 #	restore each subsystem.
     16 #
     17 #	To use reload mode, the boot flag must be set to indicate reload.
     18 #	In this mode, the BCM command monitor will attach all devices
     19 #	and come to the prompt non-destructively.  Then this script is
     20 #	run to bring all the software modules through reload initialization.
     21 #	
     22 #	Assumes the same board configuration config variables are set
     23 #	that rc.soc uses.
     24 
     25 if $?1 "echo reload: arguments not supported; exit"
     26 
     27 local echo echo
     28 
     29 echo "reload: unit $unit device $devname"
     30 
     31 #reload show
     32 
     33 # Set convenience local variables
     34 
     35 if $?quickturn || $?plisim \
     36 	"local simulator 1"
     37 
     38 # Chip-related
     39 
     40 if $?drac || $?drac15 \
     41 	"local drac_any 1"
     42 
     43 # Set software's wait for S-Channel response to 3 seconds for QuickTurn
     44 # (Recommend at least 10 seconds if the ARL is 100% busy with inserts.)
     45 if $?quickturn	"stimeout 3000000"
     46 if $?plisim	"stimeout 60000000"
     47 
     48 # Direct phy led programming: 5464 activity led becomes link/activity
     49 if $?lancelot && $?drac_any \
     50 	"config add phy_led_ctrl=0x18"
     51 
     52 # Direct phy led programming: 5464 led4 becomes energy/link
     53 if $?magnum \
     54 	"config add phy_led4_mode_ge=0xc"
     55 
     56 #
     57 # The following commands each do reinitialization instead of
     58 # initialization when the unit is in reload mode.
     59 #
     60 
     61 # Reinitialize SOC
     62 init soc
     63 
     64 # Reinitialize miscellaneous chip registers
     65 init misc
     66 
     67 # Reinitialize the StrataSwitch MMU registers
     68 init mmu
     69 
     70 #
     71 # Init CLI and BCM API
     72 #
     73 # This must be done after the raw register writes to avoid having state
     74 # clobbered.  NOTE: Tables are cleared by "init bcm" below.  If
     75 # table modifications are required, put them after "init bcm".  Some
     76 # registers might also be affected.
     77 #
     78 
     79 init bcm
     80 $echo rc: BCM driver reinitialized
     81 
     82 # Resume mirroring of hardware ARL operations into software ARL table.
     83 # The ARL table will be reloaded from hardware.
     84 
     85 if $?feature_arl_sorted \
     86 	"arlmode intr_dma; \
     87 	 $echo rc: ARL DMA shadowing enabled"
     88 
     89 if $?feature_arl_hashed && !$?simulator \
     90 	"l2mode interval=3000000; \
     91 	 $echo rc: L2 Table shadowing enabled"
     92 
     93 # If running BCM library, resume linkscan task
     94 
     95 linkscan interval=250000 spbm=e,hg
     96 
     97 # At this point the reload is completed.
     98 
     99 echo "Use the command 'reload done' to exit reload mode."
    100 
    101 # Restart statistics collection (zeroed)
    102 
    103 if $?plisim "local dma false"
    104 if !$?plisim "local dma true"
    105 
    106 counter Interval=1000 Pbm=all Dma=$dma
    107 
    108 # Resynchronize the saved values kept by the 'show counter' command.
    109 if !$?simulator "counter sync"