diff options
Diffstat (limited to 'src/occ_405')
-rwxr-xr-x | src/occ_405/proc/proc_pstate.c | 23 | ||||
-rwxr-xr-x | src/occ_405/proc/proc_pstate.h | 8 |
2 files changed, 29 insertions, 2 deletions
diff --git a/src/occ_405/proc/proc_pstate.c b/src/occ_405/proc/proc_pstate.c index 5f0cad7..484518f 100755 --- a/src/occ_405/proc/proc_pstate.c +++ b/src/occ_405/proc/proc_pstate.c @@ -52,6 +52,11 @@ extern OCCPstateParmBlock G_oppb; //Trace flags extern uint16_t G_allow_trace_flags; +// Indicates if we have determined GPU presence +extern bool G_gpu_config_done; +// GPU Present bit mask +extern uint32_t G_first_proc_gpu_config; + //Holds Fmax for ease of proc_freq2pstate calculation = max(fturbo,futurbo) uint16_t G_proc_fmax_mhz; @@ -226,6 +231,15 @@ void populate_opal_dynamic_data() // Dynamic OPAL runtime data G_opal_dynamic_table.dynamic.occ_state = CURRENT_STATE(); + // Add GPUs presence if this is a system that has GPUs OCC would monitor + if(G_gpu_config_done) + { + // set minor version to indicate OCC determined GPU presence, this is so + // OPAL can tell the difference between no GPUs present and fw that didn't support + G_opal_dynamic_table.dynamic.dynamic_minor_version = DYNAMIC_MINOR_V_GPU_PRESENCE; + G_opal_dynamic_table.dynamic.gpus_present = G_first_proc_gpu_config; + } + //If safe state is requested then that overrides anything from amec if(isSafeStateRequested()) { @@ -600,6 +614,15 @@ void check_for_opal_updates(void) G_opal_dynamic_table.dynamic.power_shift_ratio, G_sysConfigData.psr, G_opal_dynamic_table.dynamic.power_cap_type, G_sysConfigData.pcap.source); } + + // check if GPU presence was determined + if( (G_opal_dynamic_table.dynamic.dynamic_minor_version != DYNAMIC_MINOR_V_GPU_PRESENCE) && + (G_gpu_config_done) ) + { + dynamic_data_change = true; + TRAC_INFO("check_for_opal_updates: GPU presence determined = 0x%04X", + G_first_proc_gpu_config); + } } // else check for changes // If there was a change copy to main memory and notify host when BCE finishes diff --git a/src/occ_405/proc/proc_pstate.h b/src/occ_405/proc/proc_pstate.h index 0126d1d..4e47aa1 100755 --- a/src/occ_405/proc/proc_pstate.h +++ b/src/occ_405/proc/proc_pstate.h @@ -5,7 +5,7 @@ /* */ /* OpenPOWER OnChipController Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2017 */ +/* Contributors Listed Below - COPYRIGHT 2011,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -85,7 +85,10 @@ typedef struct __attribute__ ((packed)) typedef struct __attribute__ ((packed)) { uint8_t occ_state; - uint8_t reserved[4]; + uint8_t dynamic_major_version; + uint8_t dynamic_minor_version; + uint8_t gpus_present; + uint8_t reserved[1]; uint8_t proc_throt_status; uint8_t mem_throt_status; uint8_t quick_power_drop; @@ -105,6 +108,7 @@ typedef struct __attribute__ ((packed)) } opal_dynamic_table_t __attribute__ ((aligned (128))); #define PSTATE_ENTRIES 256 // number of generated PSTATES entries in OPAL table +#define DYNAMIC_MINOR_V_GPU_PRESENCE 1 // OPAL Dynamic minor version for GPU support // This size must be a multiple of 128 typedef struct __attribute__ ((packed)) |