summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormbroyles <mbroyles@us.ibm.com>2018-03-08 09:53:50 -0600
committerMartha Broyles <mbroyles@us.ibm.com>2018-03-12 15:42:05 -0400
commitc8538f3c894d5f28f688f7a081507c3ef14d6c24 (patch)
tree3e8beb661390e8fb0753884cc6ba2356d54f41b3
parent768466b31e853cb11dfa90dbfc1565a21ee9646e (diff)
downloadtalos-occ-c8538f3c894d5f28f688f7a081507c3ef14d6c24.tar.gz
talos-occ-c8538f3c894d5f28f688f7a081507c3ef14d6c24.zip
Regulator N mode support
Change-Id: Ieac1aa5e608a7ff778c71363756ac6c5ddeead89 RTC: 166206 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/55252 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com> Reviewed-by: Andres A. Lugo-Reyes <aalugore@us.ibm.com> Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com> Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
-rwxr-xr-xsrc/occ_405/amec/amec_freq.c10
-rw-r--r--src/occ_405/amec/amec_freq.h1
-rw-r--r--src/occ_405/amec/amec_init.c3
-rwxr-xr-xsrc/occ_405/amec/amec_sys.h3
-rwxr-xr-xsrc/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c82
-rwxr-xr-xsrc/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.h12
-rwxr-xr-xsrc/occ_405/cmdh/cmdh_service_codes.h1
-rwxr-xr-xsrc/occ_405/dcom/dcom.c3
-rwxr-xr-xsrc/occ_405/mode.h1
9 files changed, 112 insertions, 4 deletions
diff --git a/src/occ_405/amec/amec_freq.c b/src/occ_405/amec/amec_freq.c
index 51b04dc..496be9f 100755
--- a/src/occ_405/amec/amec_freq.c
+++ b/src/occ_405/amec/amec_freq.c
@@ -159,7 +159,6 @@ errlHndl_t amec_set_freq_range(const OCC_MODE i_mode)
// if (redundant ps policy is being enforced)
if (G_sysConfigData.system_type.non_redund_ps == false)
{
- // OVERSUB is actually TURBO
// check if need to lower max frequency due to being in oversubscription. 0 oversub freq means no freq limitation
if( AMEC_INTF_GET_OVERSUBSCRIPTION() && (G_sysConfigData.sys_mode_freq.table[OCC_MODE_OVERSUB]) &&
(G_sysConfigData.sys_mode_freq.table[OCC_MODE_OVERSUB] < l_freq_max) )
@@ -310,6 +309,15 @@ void amec_slv_proc_voting_box(void)
// This function implements the voting box to decide which input gets the right
// to actuate the system.
+ // If there is an active VRM fault and a defined VRM N frequency less than max use it
+ if( (g_amec->sys.vrm_fault_status) &&
+ (G_sysConfigData.sys_mode_freq.table[OCC_MODE_VRM_N]) &&
+ (G_sysConfigData.sys_mode_freq.table[OCC_MODE_VRM_N] < l_chip_fmax) )
+ {
+ l_chip_fmax = G_sysConfigData.sys_mode_freq.table[OCC_MODE_VRM_N];
+ l_chip_reason = AMEC_VOTING_REASON_VRM_N;
+ }
+
// PPB_FMAX
if(g_amec->proc[0].pwr_votes.ppb_fmax < l_chip_fmax)
{
diff --git a/src/occ_405/amec/amec_freq.h b/src/occ_405/amec/amec_freq.h
index 2cf3c85..6d183c8 100644
--- a/src/occ_405/amec/amec_freq.h
+++ b/src/occ_405/amec/amec_freq.h
@@ -82,6 +82,7 @@ typedef enum
AMEC_VOTING_REASON_IPS = 0x00040000,
AMEC_VOTING_REASON_APSS_PMAX = 0x00080000,
AMEC_VOTING_REASON_VDD_THRM = 0x00100000,
+ AMEC_VOTING_REASON_VRM_N = 0x00200000,
}amec_freq_voting_reason_t;
diff --git a/src/occ_405/amec/amec_init.c b/src/occ_405/amec/amec_init.c
index e6c40f2..9f57117 100644
--- a/src/occ_405/amec/amec_init.c
+++ b/src/occ_405/amec/amec_init.c
@@ -341,6 +341,9 @@ void amec_init_gamec_struct(void)
// update memory control registers only if new ips/default memory power control is different
g_amec->sys.current_mem_pwr_ctl = MEM_PWR_CTL_NO_SUPPORT;
+ // Initialize to no VRM faults
+ g_amec->sys.vrm_fault_status = 0;
+
// Initialize wof_disabled
g_amec->wof.wof_disabled = WOF_RC_OCC_WOF_DISABLED;
diff --git a/src/occ_405/amec/amec_sys.h b/src/occ_405/amec/amec_sys.h
index 2d26547..bcb11b8 100755
--- a/src/occ_405/amec/amec_sys.h
+++ b/src/occ_405/amec/amec_sys.h
@@ -392,6 +392,9 @@ typedef struct
// Current Memory Power Control values (applied last through GPE1)
uint8_t current_mem_pwr_ctl;
+
+ // Current VRM Fault status as recieved from VRM fault config data packet
+ uint8_t vrm_fault_status;
} amec_systemwide_t;
diff --git a/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c b/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c
index 0bfa8f6..0a54511 100755
--- a/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c
+++ b/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c
@@ -51,7 +51,7 @@
#define FREQ_FORMAT_20_NUM_FREQS 6
#define DATA_FREQ_VERSION_20 0x20
-#define FREQ_FORMAT_21_NUM_FREQS 7
+#define FREQ_FORMAT_21_NUM_FREQS 8
#define DATA_FREQ_VERSION_21 0x21
#define DATA_PCAP_VERSION_20 0x20
@@ -71,6 +71,8 @@
#define DATA_MEM_THROT_VERSION_20 0x20
+#define DATA_VRM_FAULT_VERSION 0x01
+
extern uint8_t G_occ_interrupt_type;
extern uint16_t G_proc_fmax_mhz; // Maximum frequency (uturbo if WOF enabled, otherwise turbo)
@@ -475,14 +477,19 @@ errlHndl_t data_store_freq_data(const cmdh_fsp_cmd_t * i_cmd_ptr,
// Bytes 15-16 Oversubscription Max Frequency
l_freq = (l_buf[12] << 8 | l_buf[13]);
l_table[OCC_MODE_OVERSUB] = l_freq;
+ // Bytes 17-18 VRM N mode Max Frequency
+ l_freq = (l_buf[14] << 8 | l_buf[15]);
+ l_table[OCC_MODE_VRM_N] = l_freq;
}
else
{
- // Version 0x20 limit oversubscription frequency to turbo
+ // Version 0x20 limit oversubscription and VRM N mode frequency to turbo
l_table[OCC_MODE_OVERSUB] = l_table[OCC_MODE_TURBO];
+ l_table[OCC_MODE_VRM_N] = l_table[OCC_MODE_TURBO];
}
CMDH_TRAC_INFO("Oversubscription max frequency = %d MHz", l_table[OCC_MODE_OVERSUB]);
+ CMDH_TRAC_INFO("VRM N mode max frequency = %d MHz", l_table[OCC_MODE_VRM_N]);
// inconsistent Frequency Points?
if((l_table[OCC_MODE_UTURBO] < l_table[OCC_MODE_TURBO] && l_table[OCC_MODE_UTURBO]) ||
@@ -2487,6 +2494,67 @@ errlHndl_t data_store_ips_config(const cmdh_fsp_cmd_t * i_cmd_ptr,
// Function Specification
//
+// Name: data_store_vrm_fault
+//
+// Description: Store VRM fault status from TMGT
+//
+// End Function Specification
+errlHndl_t data_store_vrm_fault(const cmdh_fsp_cmd_t * i_cmd_ptr,
+ cmdh_fsp_rsp_t * o_rsp_ptr)
+{
+ errlHndl_t l_err = NULL;
+ cmdh_vrm_fault_t *l_cmd_ptr = (cmdh_vrm_fault_t *)i_cmd_ptr; // Cast the command to the struct for this format
+ uint16_t l_data_length = CMDH_DATALEN_FIELD_UINT16(l_cmd_ptr);
+ uint32_t l_data_sz = sizeof(cmdh_vrm_fault_t) - sizeof(cmdh_fsp_cmd_header_t);
+
+
+ // Check length and version
+ if((l_cmd_ptr->version != DATA_VRM_FAULT_VERSION) ||
+ ( l_data_sz != l_data_length) )
+ {
+ CMDH_TRAC_ERR("data_store_vrm_fault: Invalid version[%d] expected[%d] or length[%d] expected[%d]",
+ l_cmd_ptr->version, DATA_VRM_FAULT_VERSION, l_data_length, l_data_sz);
+
+ /* @
+ * @errortype
+ * @moduleid DATA_STORE_VRM_FAULT
+ * @reasoncode INVALID_INPUT_DATA
+ * @userdata1 data size
+ * @userdata2 packet version
+ * @userdata4 OCC_NO_EXTENDED_RC
+ * @devdesc OCC recieved an invalid VRM fault data packet from the FSP
+ */
+ l_err = createErrl(DATA_STORE_VRM_FAULT,
+ INVALID_INPUT_DATA,
+ OCC_NO_EXTENDED_RC,
+ ERRL_SEV_UNRECOVERABLE,
+ NULL,
+ DEFAULT_TRACE_SIZE,
+ l_data_length,
+ (uint32_t)l_cmd_ptr->version);
+
+ // Callout firmware
+ addCalloutToErrl(l_err,
+ ERRL_CALLOUT_TYPE_COMPONENT_ID,
+ ERRL_COMPONENT_ID_FIRMWARE,
+ ERRL_CALLOUT_PRIORITY_HIGH);
+ }
+ else
+ {
+ // Save the VRM fault status
+ g_amec->sys.vrm_fault_status = l_cmd_ptr->vrm_fault_status;
+
+ // Change Data Request Mask to indicate we got this data
+ G_data_cnfg->data_mask |= DATA_MASK_VRM_FAULT;
+
+ CMDH_TRAC_IMP("Got VRM fault status = 0x%02X", g_amec->sys.vrm_fault_status);
+ }
+
+ return l_err;
+} // end data_store_vrm_fault()
+
+// Function Specification
+//
// Name: DATA_store_cnfgdata
//
// Description: Process Set Configuration Data cmd based on format (type) byte
@@ -2623,6 +2691,16 @@ errlHndl_t DATA_store_cnfgdata (const cmdh_fsp_cmd_t * i_cmd_ptr,
}
break;
+ case DATA_FORMAT_VRM_FAULT:
+ // Handle VRM fault status
+ l_errlHndl = data_store_vrm_fault(i_cmd_ptr, o_rsp_ptr);
+
+ if(NULL == l_errlHndl)
+ {
+ l_new_data = DATA_MASK_VRM_FAULT;
+ }
+ break;
+
default:
// Build Error Response packet, we are calling this here
// to generate the error log, it will get called again, below but
diff --git a/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.h b/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.h
index 5dac7fa..8c2f103 100755
--- a/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.h
+++ b/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.h
@@ -53,6 +53,7 @@ typedef enum
DATA_FORMAT_THRM_THRESHOLDS = 0x13,
DATA_FORMAT_AVSBUS_CONFIG = 0x14,
DATA_FORMAT_GPU = 0x15,
+ DATA_FORMAT_VRM_FAULT = 0x21,
} eConfigDataFormatVersion;
// Enum of the various Cnfg Data Masks that are used
@@ -70,6 +71,7 @@ typedef enum
DATA_MASK_MEM_CFG = 0x00000200,
DATA_MASK_MEM_THROT = 0x00000400,
DATA_MASK_GPU = 0x00000800,
+ DATA_MASK_VRM_FAULT = 0x00001000,
} eConfigDataPriorityMask;
typedef enum
@@ -447,6 +449,16 @@ typedef struct __attribute__ ((packed))
cmdh_mem_throt_data_set_t data_set[1];
} cmdh_mem_throt_t;
+// Used by TMGT to send OCC VRM Fault status
+typedef struct __attribute__ ((packed))
+{
+ struct cmdh_fsp_cmd_header;
+ uint8_t format;
+ uint8_t version;
+ uint8_t vrm_fault_status;
+ uint8_t reserved;
+}cmdh_vrm_fault_t;
+
// Used to mark present the config data TMGT has sent us.
typedef struct data_cnfg
{
diff --git a/src/occ_405/cmdh/cmdh_service_codes.h b/src/occ_405/cmdh/cmdh_service_codes.h
index e0a84e7..ef90ca6 100755
--- a/src/occ_405/cmdh/cmdh_service_codes.h
+++ b/src/occ_405/cmdh/cmdh_service_codes.h
@@ -41,5 +41,6 @@ enum occCmdhModuleId
DATA_GET_IPS_DATA = CMDH_COMP_ID | 0x0A,
DATA_GET_RESET_PREP_ERRL = CMDH_COMP_ID | 0x0B,
CMDH_OCC_INTERRUPT_TYPE = CMDH_COMP_ID | 0x0C,
+ DATA_STORE_VRM_FAULT = CMDH_COMP_ID | 0x0D,
};
#endif
diff --git a/src/occ_405/dcom/dcom.c b/src/occ_405/dcom/dcom.c
index 8db1337..a3f11f1 100755
--- a/src/occ_405/dcom/dcom.c
+++ b/src/occ_405/dcom/dcom.c
@@ -513,9 +513,10 @@ void task_dcom_parse_occfwmsg(task_t *i_self)
{
for(l_mode =0; l_mode<OCC_MODE_COUNT; l_mode++)
{
- // Don't trust a frequency of 0x0000 except for oversubscription and Ultra Turbo
+ // Don't trust a frequency of 0x0000 except for oversubscription, VRM N and Ultra Turbo
if( (0 != G_dcom_slv_inbox_rx.sys_mode_freq.table[l_mode]) ||
(l_mode == OCC_MODE_OVERSUB) ||
+ (l_mode == OCC_MODE_VRM_N) ||
(l_mode == OCC_MODE_UTURBO) )
{
if(G_sysConfigData.sys_mode_freq.table[l_mode]
diff --git a/src/occ_405/mode.h b/src/occ_405/mode.h
index 740abd8..225d28e 100755
--- a/src/occ_405/mode.h
+++ b/src/occ_405/mode.h
@@ -57,6 +57,7 @@ typedef enum
OCC_MODE_FFO = 0x0B,
OCC_MODE_FMF = 0x0C,
OCC_MODE_UTURBO = 0x0D, // not a settable mode, just used to store UT freq
+ OCC_MODE_VRM_N = 0x0E, // not a settable mode, just used to store VRM N mode max freq
// Make sure this is after the last valid mode
OCC_MODE_COUNT,
OpenPOWER on IntegriCloud