diff options
Diffstat (limited to 'src/build/simics')
-rwxr-xr-x | src/build/simics/standalone.simics | 92 | ||||
-rwxr-xr-x | src/build/simics/startup.simics | 32 |
2 files changed, 112 insertions, 12 deletions
diff --git a/src/build/simics/standalone.simics b/src/build/simics/standalone.simics index 39a382303..c785dfc44 100755 --- a/src/build/simics/standalone.simics +++ b/src/build/simics/standalone.simics @@ -9,10 +9,17 @@ if not defined hb_skip_vpd_preload {$hb_skip_vpd_preload = 0} if ($hb_mode == 0) { # Axone and beyond - # this number is no longer provided we have to look it up - $num_dimms = (dec (list-length((get-master-procs)[0].get-dimms))) + # There is no VPD cache on Axone + $hb_skip_vpd_preload = 1; } +# Load up the pnor parsing function +try { + add-directory $hb_pnor_dir + run-python-file (lookup-file simpnor.py) + echo "Loaded simpnor.py" +} except { "No simpnor.py found, using hardcoding PNOR offsets." } + # Preload VPD in PNOR unless told not to if ($hb_skip_vpd_preload == 0) { @@ -24,8 +31,7 @@ if ($hb_skip_vpd_preload == 0) { $procChipType=(get-object-list p9_proc)[0]->chip_type python "os.environ['HB_PROC_CHIP_TYPE'] = \""+$procChipType+"\"" } else { - $procChipType=($hb_masterproc)->chip_type - python "os.environ['HB_PROC_CHIP_TYPE'] = \""+$procChipType+"\"" + python "os.environ['HB_PROC_CHIP_TYPE'] = \""+$proc_chip_type+"\"" } @@ -54,6 +60,36 @@ if ($hb_skip_vpd_preload == 0) { } except { echo "ERROR: Failed to preload VPD into PNOR." } } +if ($hb_mode == 0) { + $eccPreload = (lookup-file "%simics%/eecache_prebuilt.bin.ecc") + # NOTE must change offset if PNOR layout changes EECACHE offsets + echo " - Loading prebuilt EECACHE "+$eccPreload+" at 0x2C000 in PNOR" + ($hb_pnor).load-file $eccPreload 0x2C000 +} + +# Look for attribute overrides to load +try { + $attr_tmp = (lookup-file "ATTR_TMP") + try { + @simenv.attr_tmp_addr = hb_get_pnor_offset("ATTR_TMP") + } except { + $attr_tmp_addr = 0x000B2000 + } + echo " - Loading ATTR_TMP "+$attr_tmp+" at "+$attr_tmp_addr+" in PNOR" + ($hb_pnor).load-file $attr_tmp $attr_tmp_addr +} except { echo "No attribute overrides found." } + +# Look for a guard file to load +try { + $guard = (lookup-file "GUARD") + try { + @simenv.guard_addr = hb_get_pnor_offset("GUARD") + } except { + $guard_addr = 0x000AC000 + } + echo " - Loading GUARD "+$guard+" at "+$guard_addr+" in PNOR" + ($hb_pnor).load-file $guard $guard_addr +} except { echo "No gard records found." } # Turn on all processor cec-chips if ($hb_mode == 1) { @@ -108,3 +144,51 @@ if ($hb_mode == 1) { ($hb_masterproc_cecchip).invoke parallel_store FSIMBOX 0x01 "80000000" 32 ($hb_masterproc_cecchip).invoke parallel_store FSIMBOX 0x08 "00080000" 32 } + +############################### +#Initialize Explorer Registers +############################### +if ($hb_mode == 0) { #Only do this on Axone and later models that have Explorer chip + + # IDEC register consumed by Hostboot + # UCHIP(0x2134)=0x110600D2 + # TODO RTC: 215621 Remove workarounds after simics gets updated + set-class-attr ocmb mscc_regs_xcbi_chip_info 0x110600D2 + + # Loop over all explorer chips + foreach $obj in (get-object-list ocmb -all){ + + # RAM1 image ID consumed by Hostboot + # UCHIP(0x2200)=0x00000000 + $obj->mscc_regs_xcbi_ram1[0] = 0x00000000 + + # RAM1 hash value registers consumed by Hostboot + # This matches the hash of zero-filled 4k file. + $obj->mscc_regs_xcbi_ram1[1] = 0x2D23913D + $obj->mscc_regs_xcbi_ram1[2] = 0x3759EF01 + $obj->mscc_regs_xcbi_ram1[3] = 0x704A86B4 + $obj->mscc_regs_xcbi_ram1[4] = 0xBEE3AC8A + $obj->mscc_regs_xcbi_ram1[5] = 0x29002313 + $obj->mscc_regs_xcbi_ram1[6] = 0xECC98A74 + $obj->mscc_regs_xcbi_ram1[7] = 0x24425A78 + $obj->mscc_regs_xcbi_ram1[8] = 0x170F2195 + $obj->mscc_regs_xcbi_ram1[9] = 0x77822FD7 + $obj->mscc_regs_xcbi_ram1[10] = 0x7E4AE963 + $obj->mscc_regs_xcbi_ram1[11] = 0x13547696 + $obj->mscc_regs_xcbi_ram1[12] = 0xAD7D5949 + $obj->mscc_regs_xcbi_ram1[13] = 0xB58E12D5 + $obj->mscc_regs_xcbi_ram1[14] = 0x063EF2EE + $obj->mscc_regs_xcbi_ram1[15] = 0x063B5957 + $obj->mscc_regs_xcbi_ram1[16] = 0x40A3A12D + + # Allow for testing MMIO HW failures + # Forces write access to TRACE_TRDATA_CONFIG_0 to fail + # in src/usr/mmio/test/mmiotest.H + # NOTE: address is left shifted 3 and has MMIO + # offset (0x100000000) added. + $obj->mmio_regs_mmioerr = 0x0000000140082018 + + } +} + + diff --git a/src/build/simics/startup.simics b/src/build/simics/startup.simics index a6534be01..440e9562b 100755 --- a/src/build/simics/startup.simics +++ b/src/build/simics/startup.simics @@ -48,7 +48,8 @@ if ($hb_mode == 1) { } }else{ - $hb_machine = "AXONE" + # simics now provides us the chip type (starting w/ p9a ) + $hb_machine = $proc_chip_type } python "os.environ['HB_MACHINE'] = \""+$hb_machine+"\"" @@ -98,9 +99,9 @@ if ($hb_mode == 1) { ($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 + foreach $proc in (get-all-procs) { + ($proc.get-seeprom 1).set 0x3FED9 0x5A5A5A5A 8 -l + ($proc.get-seeprom 3).set 0x3FED9 0x5A5A5A5A 8 -l } } @@ -112,6 +113,7 @@ 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 == "") { @@ -133,13 +135,27 @@ if($hw_security == "1") { $jumperApplied=FALSE } -# Load jumper state to each processor -foreach $procX in (get-object-list p9_proc) { - +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) - (($procX)->secure_jumper=$jumperApplied) + + # 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) { |