summaryrefslogtreecommitdiffstats
path: root/src/build/simics/startup.simics
blob: bd7db5b3d102b6c87a905079b1b4bae901deeb29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Initialize HB search paths.
$hb_startup_path = (lookup-file hbfw/startup.simics)
$hb_script_location = (python "''.join(map('/'.__add__,\""+$hb_startup_path+"\"[1:].split('/')[0:-1]))")
python "os.environ['HB_TOOLPATH'] = \""+$hb_script_location+"\""

$hb_machine = (shell "env | grep 'GFW_P8_.*_PROC_EC' | sed 's/GFW_P8_\\(.*\\)_PROC_EC.*/\\1/'")
$hb_machine = (python "\""+$hb_machine+"\".lower()")
python "os.environ['HB_MACHINE'] = \""+$hb_machine+"\""


# Setup some common vars to use across machine types
$hb_masterproc = ""
@simenv.hb_masterproc = quiet_run_command("get-master-proc")[0]
echo "Master Proc is: "+$hb_masterproc

$hb_pnor = ""
@simenv.hb_pnor = quiet_run_command("get-master-pnor")[0]
try {
    @SIM_get_object(simenv.hb_pnor[0])
} except {
    try {
        # Attempt to use the Brazos name
        @SIM_get_object("cecdrawer0_fpga0")
        $hb_pnor = "cecdrawer0_fpga0"
    } except {
        # Default to Tuleta/Orlena name
        $hb_pnor = "fpga0"
    }
}
echo "Master PNOR is: "+$hb_pnor

# Choose a default core to start with
$hb_cpu = "system_cmp0.cpu0_0_04_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 p8_proc) {
    ($cc).procSBEPrimary_eeprom_image.set 0x300 0x5A5A5A5A 8 -l
    ($cc).procSBEBackup_eeprom_image.set  0x300 0x5A5A5A5A 8 -l
}

# Load HB debug tools.
try {
    run-python-file (lookup-file hbfw/simics-debug-framework.py)
    run-python-file (lookup-file hbfw/hb-simdebug.py)
} except { echo "ERROR: Failed to load Hostboot debug tools." }



########################### 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
OpenPOWER on IntegriCloud