$hb_mode = 1 #Old Mode -- No simics internals changed $runsim_lookup = (lookup-file -query "%simics%/runsim") if ($runsim_lookup) { $hb_mode = 0 #New Mode -- Some simics internal changes } # $hb_script_to_run is only set in Axone Standalone and onwards # we need to add the script directory in the Axone standalone model # for the older models the directory is already in the path if defined hb_script_to_run { $hb_script_location = (python "''.join(map('/'.__add__,\""+$hb_script_to_run+"\"[1:].split('/')[0:-1]))") $script_dir = (python "''.join(map('/'.__add__,\""+$hb_script_location+"\"[1:].split('/')[0:-1]))") add-directory $script_dir } $hb_startup_path = (lookup-file hbfw/startup.simics) # if we are in older simics models (before Axone standalone) # we must now set $hb_script_location as it is not above if not defined hb_script_location { $hb_script_location = (python "''.join(map('/'.__add__,\""+$hb_startup_path+"\"[1:].split('/')[0:-1]))") } python "os.environ['HB_TOOLPATH'] = \""+$hb_script_location+"\"" # TODO RTC: 204842 Revist once we get way to read CEC_TYPE from simics if ($hb_mode == 1) { $model="" if(env -x CEC_TYPE) { $model = (env CEC_TYPE) } $machine_name="" if(env -x MACHINE) { $machine_name = (env MACHINE) } $hb_machine = "unknown" if ($model == "p9_zztop") {$hb_machine = "zztop"} if ($model == "p9_zeppelin") {$hb_machine = "zeppelin"} if ($model == "p9_fleetwood") {$hb_machine = "fleetwood"} if ($model == "p9_nimbus") {$hb_machine = "nimbus"} if ($model == "p9_cumulus") { if ($machine_name == "CUMULUS_CDIMM") { $hb_machine = "cumulus_cdimm" } if ($machine_name != "CUMULUS_CDIMM") { $hb_machine = "cumulus" } } }else{ # simics now provides us the chip type (starting w/ p9a ) $hb_machine = $proc_chip_type } python "os.environ['HB_MACHINE'] = \""+$hb_machine+"\"" echo "HB_MACHINE is: "+$hb_machine $hb_pnor = "" if( $hb_mode == 1) { # Setup some common vars to use across machine types $hb_masterproc = (get-master-proc) $hb_masterproc_cecchip = (get-master-cec-chip) $hb_pnor = (get-master-pnor) } else { $hb_masterproc = (get-master-procs)[0] $hb_masterproc_cecchip = (get-master-cec-chips)[0] $hb_pnor = (get-master-pnors)[0] } echo "Master Proc is: "+$hb_masterproc echo "Master Proc Cec-Chip is: "+$hb_masterproc_cecchip #New Simics flow can simply get the string from get-master-pnor command if ($hb_pnor == NIL) { try { @simenv.hb_pnor = quiet_run_command("get-master-pnor")[0] @SIM_get_object(simenv.hb_pnor[0]) } except { # Default to Nimbus name foreach $pnor in (get-object-list -all BmcCmp) { $hb_pnor = ($pnor) } $hb_pnor = $hb_pnor+".sfc_master_mem" } } echo "Master PNOR is: "+$hb_pnor # Choose a default core to start with $hb_cpu = "system_cmp0.cpu0_0_00_0" echo "Defaulting to CPU "+$hb_cpu+" for Hostboot tools" # Prevent SBE Updates from happening on an IPL echo "Altering SBE SEEPROM Versions to disable Update in IPL" if ($hb_mode == 1) { foreach $cc in (get-object-list p9_proc) { ($cc).seeprom1.seeprom1_image.set 0x3FED9 0x5A5A5A5A 8 -l ($cc).seeprom3.seeprom3_image.set 0x3FED9 0x5A5A5A5A 8 -l } } else { foreach $proc in (get-all-procs) { ($proc.get-seeprom 1).set 0x3FED9 0x5A5A5A5A 8 -l ($proc.get-seeprom 3).set 0x3FED9 0x5A5A5A5A 8 -l } } # Load HB debug tools. try { run-python-file (lookup-file hbfw/simics-debug-framework.py) } except { echo "ERROR: Failed to load Simics debug framework (simics-debug-framework.py)" } try { run-python-file (lookup-file hbfw/hb-simdebug.py) } except { echo "ERROR: Failed to load Hostboot debug tools (hb-simdebug.py)" } # Determine security state $hw_security=(shell "echo $SECURITY_HW_POLICY") if($hw_security == "") { # Assume default (no HW security) if not specified $hw_security = "0" } if(($hw_security != "1") and ($hw_security != "0")) { # Emit warning and assume default echo ("SECURITY: WARNING! Bad value "+ $hw_security+" for HW security policy, defaulting to 0") $hw_security = "0" } echo "SECURITY: HW security policy set to "+$hw_security # Translate security state to SIMICS jumper state $jumperApplied=TRUE if($hw_security == "1") { $jumperApplied=FALSE } if ($hb_machine == "p9a") { # Set logical jumper state in SIMICS based on HW policy # "TRUE"=jumper applied(security disabled, default) # "FALSE"=jumper removed(security enabled) # Load jumper state to the master processor $hb_masterproc.set-secure-jumper value = $jumperApplied # Load jumper state to all slave processors foreach $procS in ($hb_masterproc.get-slave-procs) { $procS.set-secure-jumper value = $jumperApplied } } else { # Load jumper state to each processor foreach $procX in (get-object-list p9_proc) { # Set logical jumper state in SIMICS based on HW policy # "TRUE"=jumper applied(security disabled, default) # "FALSE"=jumper removed(security enabled) (($procX)->secure_jumper=$jumperApplied) } } if ($hb_mode == 0) { run-command-file (lookup-file hbfw/standalone.simics) } ########################### WORKAROUNDS #################################### # Setup the mailbox. # for mbox on core 0 use: # proc_venicechip_cmp0.psi_hb->psihb_xivr_fsi=0x0140000000 #02010917 # for mbox on core 5 use: #proc_venicechip_cmp0.psi_hb->psihb_xivr_fsi=0x0000A00140000000 #02010917 #proc_venicechip_cmp0.psi_hb->psihb_irsn=0x00030003FFFF0000 #0201091b