summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Cain <cjcain@us.ibm.com>2019-03-26 08:58:37 -0500
committerChristopher J. Cain <cjcain@us.ibm.com>2019-03-29 10:36:00 -0500
commit19b906f9c3a8c33a270e2ee4307a9ae03e1d19db (patch)
tree98c69d9223323f39c198b75f98a80e1a5e660731
parentde361c2a961fcbebac06b70af07515bf2f22620e (diff)
downloadtalos-occ-19b906f9c3a8c33a270e2ee4307a9ae03e1d19db.tar.gz
talos-occ-19b906f9c3a8c33a270e2ee4307a9ae03e1d19db.zip
Pick up new HCODE elog structure
Change-Id: Ia4c2f64790476da03384d501dd4f43839786d249 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/75192 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Martha Broyles <mbroyles@us.ibm.com> Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com>
-rw-r--r--src/include/pstate_pgpe_occ_api.h164
-rwxr-xr-xsrc/occ_405/cmdh/cmdh_fsp_cmds.c20
-rwxr-xr-xsrc/occ_405/main.c8
-rwxr-xr-xsrc/occ_405/occbuildname.c2
4 files changed, 81 insertions, 113 deletions
diff --git a/src/include/pstate_pgpe_occ_api.h b/src/include/pstate_pgpe_occ_api.h
index d6ee76c..a667854 100644
--- a/src/include/pstate_pgpe_occ_api.h
+++ b/src/include/pstate_pgpe_occ_api.h
@@ -1,19 +1,25 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
-/* $Source: chips/p9/common/pmlib/include/pstate_pgpe_occ_api.h $ */
+/* $Source: src/include/pstate_pgpe_occ_api.h $ */
/* */
-/* IBM CONFIDENTIAL */
+/* OpenPOWER OnChipController Project */
/* */
-/* EKB Project */
-/* */
-/* COPYRIGHT 2015,2019 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
-/* The source code for this program is not published or otherwise */
-/* divested of its trade secrets, irrespective of what has been */
-/* deposited with the U.S. Copyright Office. */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
/// @file p9_pstates_pgpe_occ_api.h
@@ -25,6 +31,7 @@
// *HWP Level : 1
// *HWP Consumed by : PGPE:OCC
+
#ifndef __P9_PSTATES_PGPE_API_H__
#define __P9_PSTATES_PGPE_API_H__
@@ -34,6 +41,7 @@
extern "C" {
#endif
+#define HCODE_OCC_SHARED_MAGIC_NUMBER 0x4F505330 //OPS0
//---------------
// IPC from 405
@@ -46,7 +54,7 @@ enum MESSAGE_ID_IPI2HI
MSGID_405_CLIPS = 2,
MSGID_405_SET_PMCR = 3,
MSGID_405_WOF_CONTROL = 4,
- MSGID_405_WOF_VRT = 5
+ MSGID_405_WOF_VFRT = 5
};
//
@@ -60,9 +68,9 @@ enum MESSAGE_ID_IPI2HI
// Active quad mismatch with requested active quads. PGPE did not switch
// to using the new VFRT. The original VFRT is still being used.
#define PGPE_WOF_RC_VFRT_QUAD_MISMATCH 0x20
-#define PGPE_RC_REQ_WHILE_PENDING_ACK 0x21
-#define PGPE_RC_NULL_VRT_POINTER 0x22
-#define PGPE_RC_INVALID_PMCR_OWNER 0x23
+#define PGPE_RC_REQ_WHILE_PENDING_ACK 0x21
+#define PGPE_RC_NULL_VFRT_POINTER 0x22
+#define PGPE_RC_INVALID_PMCR_OWNER 0x23
//
// PMCR Owner
@@ -135,12 +143,13 @@ typedef struct ipcmsg_wof_vfrt
HomerVFRTLayout_t* homer_vfrt_ptr;
} ipcmsg_wof_vfrt_t;
+
// -----------------------------------------------------------------------------
// Start Pstate Table
#define MAX_OCC_PSTATE_TABLE_ENTRIES 256
-/// Pstate Table produced by the PGPE for consumption by OCC Firmware
+/// Pstate Table produce by the PGPE for consumption by OCC Firmware
///
/// This structure defines the Pstate Table content
/// -- 16B structure
@@ -160,6 +169,9 @@ typedef struct
typedef struct
{
+ /// Number of Pstate Table entries
+ uint32_t entries;
+
/// Internal VDD voltage ID at the output of the PFET header
OCCPstateTable_entry_t table[MAX_OCC_PSTATE_TABLE_ENTRIES];
@@ -167,6 +179,8 @@ typedef struct
// End Pstate Table
// -----------------------------------------------------------------------------
+
+// -----------------------------------------------------------------------------
// Start FFDC
/// Scopes of the First Failure Data Capture (FFDC) registers
@@ -323,32 +337,6 @@ typedef union requested_active_quads
// End Quad State
// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-// Start Error Log Table
-
-#define MAX_HCODE_ELOG_ENTRIES 28
-
-typedef union hcode_elog_entry
-{
- uint64_t value;
- struct {
- uint8_t id;
- uint8_t source;
- uint16_t length;
- uint32_t address;
- } fields;
-} hcode_elog_entry_t;
-
-typedef struct pgpe_error_table
-{
- uint32_t magic; // "ELTC" (Error Log Table of Contents)
- uint8_t total_log_slots;
- uint8_t reserved[3];
- hcode_elog_entry_t elog[MAX_HCODE_ELOG_ENTRIES];
-} pgpe_error_table_t;
-
-// End Error Log Table
-// -----------------------------------------------------------------------------
typedef struct
{
union
@@ -418,6 +406,22 @@ typedef struct
} dw3;
} pgpe_wof_values_t;
+// -----------------------------------------------------------------------------
+// Start Error Log Table
+
+/// Maximum number of error log entries available
+#define MAX_HCODE_ELOG_ENTRIES 4
+
+/// Index into the array of error log entries
+enum elog_entry_index
+{
+ ELOG_PGPE_CRITICAL = 0,
+ ELOG_PGPE_INFO = 1,
+ ELOG_SGPE_CRITICAL = 2,
+ ELOG_SGPE_INFO = 3,
+};
+
+/// Structure of an individual error log entry
typedef struct
{
union
@@ -430,59 +434,17 @@ typedef struct
} words;
struct
{
- uint64_t magic_word : 32; //ELTC
- uint64_t total_log_slots : 8;
- uint64_t reserved : 24;
- } fields;
- } dw0;
- union
- {
- uint64_t value;
- struct
- {
- uint32_t high_order;
- uint32_t low_order;
- } words;
- struct
- {
uint64_t errlog_id : 8;
uint64_t errlog_src : 8;
uint64_t errlog_len : 16;
- uint64_t pgpe_critical_log_address : 32;
+ uint64_t errlog_addr : 32;
} fields;
- } dw1;
- union
- {
- uint64_t value;
- struct
- {
- uint32_t high_order;
- uint32_t low_order;
- } words;
- struct
- {
- uint64_t errlog_id : 8;
- uint64_t errlog_src : 8;
- uint64_t errlog_len : 16;
- uint64_t pgpe_info_log_address : 32;
- } fields;
- } dw2;
- union
- {
- uint64_t value;
- struct
- {
- uint32_t high_order;
- uint32_t low_order;
- } words;
- struct
- {
- uint64_t errlog_id : 8;
- uint64_t errlog_src : 8;
- uint64_t errlog_len : 16;
- uint64_t sgpe_critical_log_address : 32;
- } fields;
- } dw3;
+ } dw0;
+} hcode_elog_entry_t;
+
+/// Full Error Log Table
+typedef struct hcode_error_table
+{
union
{
uint64_t value;
@@ -493,13 +455,18 @@ typedef struct
} words;
struct
{
- uint64_t errlog_id : 8;
- uint64_t errlog_src : 8;
- uint64_t errlog_len : 16;
- uint64_t sgpe_info_log_address : 32;
+ uint64_t magic_word : 32; //ELTC
+ uint64_t total_log_slots : 8;
+ uint64_t reserved : 24;
} fields;
- } dw4;
-} errlog_idx_t;
+ } dw0;
+
+ /// Array of error log entries (index with enum elog_entry_index)
+ hcode_elog_entry_t elog[MAX_HCODE_ELOG_ENTRIES];
+} hcode_error_table_t;
+
+// End Error Log Table
+// -----------------------------------------------------------------------------
typedef struct
{
@@ -515,10 +482,10 @@ typedef struct
/// Actual Pstate 1 - Quads 4, 5
quad_state1_t quad_pstate_1;
- /// PGPE Produced WOF State
+ ///PGPE WOF State
pgpe_wof_state_t pgpe_wof_state;
- ///Requested Active Quads
+ ///Requested Active Quads
requested_active_quads_t req_active_quads;
//PGPE WOF Values
@@ -528,8 +495,7 @@ typedef struct
uint64_t reserved1;
/// Hcode Error Log Index
- errlog_idx_t errlog_idx;
- pgpe_error_table_t pgpe_error_table;
+ hcode_error_table_t errlog_idx;
//Reserved
uint64_t reserved2[24];
@@ -543,4 +509,4 @@ typedef struct
} // end extern C
#endif
-#endif /* __PSTATES_PGPE_OCC_API_H__ */
+#endif /* __P9_PSTATES_PGPE_API_H__ */
diff --git a/src/occ_405/cmdh/cmdh_fsp_cmds.c b/src/occ_405/cmdh/cmdh_fsp_cmds.c
index 042e71b..cd9e352 100755
--- a/src/occ_405/cmdh/cmdh_fsp_cmds.c
+++ b/src/occ_405/cmdh/cmdh_fsp_cmds.c
@@ -238,27 +238,27 @@ ERRL_RC cmdh_poll_v20(cmdh_fsp_rsp_t * o_rsp_ptr)
unsigned int index = 0;
for (; index < G_hcode_elog_table_slots; ++index)
{
- elog_entry.value = in64(&G_hcode_elog_table[index]);
- if (elog_entry.value != 0)
+ elog_entry.dw0.value = in64(&G_hcode_elog_table[index]);
+ if (elog_entry.dw0.value != 0)
{ // Found HCODE elog
- if (elog_entry.fields.source != ERRL_SOURCE_405)
+ if (elog_entry.dw0.fields.errlog_src != ERRL_SOURCE_405)
{
++L_num_hcode_elogs;
// Byte 8:
- l_poll_rsp->errl_id = elog_entry.fields.id;
+ l_poll_rsp->errl_id = elog_entry.dw0.fields.errlog_id;
// Byte 9 - 12:
- l_poll_rsp->errl_address = elog_entry.fields.address;
+ l_poll_rsp->errl_address = elog_entry.dw0.fields.errlog_addr;
// Byte 13 - 14:
- l_poll_rsp->errl_length = elog_entry.fields.length;
+ l_poll_rsp->errl_length = elog_entry.dw0.fields.errlog_len;
// Byte 15:
- l_poll_rsp->errl_source = elog_entry.fields.source;
+ l_poll_rsp->errl_source = elog_entry.dw0.fields.errlog_src;
check_405_elogs = false;
break;
}
else
{
TRAC_ERR("cmdh_poll_v20: ignoring HCODE error with 405 source (id:0x%02X, len:0x%04X, address:0x%08X)",
- elog_entry.fields.id, elog_entry.fields.length, elog_entry.fields.address);
+ elog_entry.dw0.fields.errlog_id, elog_entry.dw0.fields.errlog_len, elog_entry.dw0.fields.errlog_addr);
// Zero out error log entry in list so hcode can reuse
out64(&G_hcode_elog_table[index], 0);
G_htmgt_notified_of_error = false;
@@ -1132,8 +1132,8 @@ errlHndl_t cmdh_clear_elog (const cmdh_fsp_cmd_t * i_cmd_ptr,
for (; index < G_hcode_elog_table_slots; ++index)
{
hcode_elog_entry_t elog_entry;
- elog_entry.value = in64(&G_hcode_elog_table[index]);
- if ((elog_entry.fields.id == l_elog_id) && (elog_entry.fields.source == l_elog_source))
+ elog_entry.dw0.value = in64(&G_hcode_elog_table[index]);
+ if ((elog_entry.dw0.fields.errlog_id == l_elog_id) && (elog_entry.dw0.fields.errlog_src == l_elog_source))
{
CMDH_TRAC_INFO("cmdh_clear_elog: Clearing HCODE elog id 0x%02X from source 0x%02X",
l_elog_id, l_elog_source);
diff --git a/src/occ_405/main.c b/src/occ_405/main.c
index 7c1dc36..309edb4 100755
--- a/src/occ_405/main.c
+++ b/src/occ_405/main.c
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER OnChipController Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2018 */
+/* Contributors Listed Below - COPYRIGHT 2011,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -542,9 +542,11 @@ bool read_pgpe_header(void)
G_pgpe_header.pgpe_produced_wof_values_addr = in32(PGPE_HEADER_ADDR + PGPE_PRODUCED_WOF_VALUES_ADDR_OFFSET);
const uint32_t hcode_elog_table_addr = G_pgpe_header.shared_sram_addr + HCODE_ELOG_TABLE_SRAM_OFFSET;
- if (HCODE_ELOG_TABLE_MAGIC_NUMBER == in32(hcode_elog_table_addr))
+ hcode_error_table_t hcode_etable;
+ hcode_etable.dw0.value = in64(hcode_elog_table_addr);
+ if (HCODE_ELOG_TABLE_MAGIC_NUMBER == hcode_etable.dw0.fields.magic_word)
{
- G_hcode_elog_table_slots = (in32(hcode_elog_table_addr + 4) >> 24);
+ G_hcode_elog_table_slots = hcode_etable.dw0.fields.total_log_slots;
G_hcode_elog_table = (hcode_elog_entry_t*)(hcode_elog_table_addr + 8);
}
else
diff --git a/src/occ_405/occbuildname.c b/src/occ_405/occbuildname.c
index 9855c75..66530c2 100755
--- a/src/occ_405/occbuildname.c
+++ b/src/occ_405/occbuildname.c
@@ -34,6 +34,6 @@ volatile const char G_occ_buildname[16] __attribute__((section(".buildname"))) =
#else
-volatile const char G_occ_buildname[16] __attribute__((section(".buildname"))) = /*<BuildName>*/ "op_occ_190328a\0" /*</BuildName>*/ ;
+volatile const char G_occ_buildname[16] __attribute__((section(".buildname"))) = /*<BuildName>*/ "op_occ_190329a\0" /*</BuildName>*/ ;
#endif
OpenPOWER on IntegriCloud