Skip to content

Commit

Permalink
Fix issues w/ axone updates to simics scripts
Browse files Browse the repository at this point in the history
Simics teams were hitting a problem trying to boot older simics models
because our scripts relied on $MACHINE being set to CEC_MODEL. This
value gets set by linux so we cannot rely on it. Instead use the old
way to lookup MODEL for older version of simics, and for new way,
(axone and beyond) just force MODEL to be "AXONE" for now. Eventually
simics team needs to provide interface to lookup MODEL. Also in this
commit we need to write "0x5A5A5A5A" to the SBE seeprom images to avoid
updates, update the simics backing build, and change the CLI args for
hb startsimics in axone to no longer use -o and always pass in the path
to the combined SBE image/ HBBL image

Change-Id: Ib477e86b0b8aa1a4d44545c62b16fc2cbed2034b
CQ: SW453806
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/71323
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: CALEB SCHLOSSIN <calebs@us.ibm.com>
Reviewed-by: VIJAY F. LOBO <vflobo@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Matt Derksen <mderkse1@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
crgeddes authored and dcrowell77 committed Feb 13, 2019
1 parent c47875e commit eee3508
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/build/citest/etc/simbuild
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/gsa/ausgsa/projects/s/simics_published_builds//p10/ee1d839dc9ba0290c0886bc956656b8989446e44/simics.tar.gz
/gsa/ausgsa/projects/h/hostboot/simbuild/02_07_19_ab9492_simics.tar.gz
4 changes: 2 additions & 2 deletions src/build/debug/simics-debug-framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2011,2018
# Contributors Listed Below - COPYRIGHT 2011,2019
# [+] Google Inc.
# [+] International Business Machines Corp.
#
Expand Down Expand Up @@ -731,7 +731,7 @@ def magic_instruction_callback(user_arg, cpu, arg):

cmd3 = ""
if (simenv.hb_mode == 0): #new mode (Axone + beyond)
cmd3 = "(get-master-proc).reset-fsimbox-reg index=0x104"
cmd3 = "(get-master-procs)[0].reset-fsimbox-reg index=0x104"
else:
#old mode (Cumulus + prior)
cmd3 = "(get-master-proc %d).proc_fsi2host_mbox->regs[95][1] = 0"%(node_num)
Expand Down
63 changes: 47 additions & 16 deletions src/build/simics/startup.simics
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@

$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
Expand All @@ -18,20 +24,44 @@ if not defined hb_script_location {

python "os.environ['HB_TOOLPATH'] = \""+$hb_script_location+"\""

$machine_name = (shell "printenv MACHINE")
$hb_machine = $machine_name
# TODO RTC: 204842 Revist once we get way to read CEC_TYPE from simics
if ($hb_mode == 1) {
$model = (env CEC_TYPE)
$machine_name = (shell "printenv 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{
$hb_machine = "AXONE"
}

python "os.environ['HB_MACHINE'] = \""+$hb_machine+"\""
echo "HB_MACHINE is: "+$hb_machine

# Setup some common vars to use across machine types
$hb_masterproc = (get-master-proc)
$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
$hb_masterproc_cecchip = (get-master-cec-chip)
echo "Master Proc Cec-Chip is: "+$hb_masterproc_cecchip

#New Simics flow can simply get the string from get-master-pnor command
$hb_pnor = ""
$hb_pnor = (get-master-pnor)

if ($hb_pnor == NIL) {
try {
Expand All @@ -47,21 +77,22 @@ if ($hb_pnor == NIL) {
}
echo "Master PNOR is: "+$hb_pnor

$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
}

# 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"
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
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 $cc in (get-object-list proc_hb_standalone) {
($cc).seeprom1_image.set 0x3FED9 0x5A5A5A5A 8 -l
($cc).seeprom3_image.set 0x3FED9 0x5A5A5A5A 8 -l
}
}

# Load HB debug tools.
Expand Down
4 changes: 2 additions & 2 deletions src/build/tools/hb
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ hb_startsimics()
#export MYDIR=$bb/obj/ppc/hbfw/simics/startup.simics
#then /runsim -m axone -o hb_script_to_run=$MYDIR
export MY_DIR="${SANDBOXBASE}/obj/ppc/simu/scripts/hbfw"
echo "cd ${SANDBOXBASE}/simics/ && ./runsim -m ${MACHINE} hb_script_to_run=${MY_DIR}/startup.simics pnor_img=${MY_DIR}/../../../hbfw/img/axone.pnor"
execute_in_sandbox "cd ${SANDBOXBASE}/simics/ && ./runsim -m ${MACHINE} hb_script_to_run=${MY_DIR}/startup.simics pnor_img=${MY_DIR}/../../../hbfw/img/axone.pnor" "ppc"
echo "cd ${SANDBOXBASE}/simics/ && ./runsim -m ${MACHINE} hb_script_to_run=${MY_DIR}/startup.simics pnor_img=${MY_DIR}/../../../hbfw/img/axone.pnor sbe_seeprom_img=${SANDBOXBASE}/images/ppc/lab/flash/sbe_seeprom_p9a_10.bin.ecc num_procs=1"
execute_in_sandbox "cd ${SANDBOXBASE}/simics/ && ./runsim -m ${MACHINE} hb_script_to_run=${MY_DIR}/startup.simics pnor_img=${MY_DIR}/../../../hbfw/img/axone.pnor sbe_seeprom_img=${SANDBOXBASE}/images/ppc/lab/flash/sbe_seeprom_p9a_10.bin.ecc num_procs=1" "ppc"
else
execute_in_sandbox \
"start_simics -machine ${MACHINE} ${SIMICSOPTIONS} $*" "ppc"
Expand Down

0 comments on commit eee3508

Please sign in to comment.