summaryrefslogtreecommitdiffstats
path: root/src/occ_405
diff options
context:
space:
mode:
authorWael El-Essawy <welessa@us.ibm.com>2016-04-05 12:03:34 -0500
committerWael El-Essawy <welessa@us.ibm.com>2016-05-03 18:55:23 -0400
commitdb69c499974c1aaa961bfde439e2fd770123a27b (patch)
tree74b17ef73c5b497df15cac62e52b985b6987cadc /src/occ_405
parent8a7f3c6739f022df1c128b9d5a479e7abfac0ec1 (diff)
downloadtalos-occ-db69c499974c1aaa961bfde439e2fd770123a27b.tar.gz
talos-occ-db69c499974c1aaa961bfde439e2fd770123a27b.zip
Change attention type default to FSP
Change-Id: I6661e64e2bb29762ba038bddcebd9e6b4afcf85e RTC: 147814 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/23618 Tested-by: FSP CI Jenkins Reviewed-by: William A. Bryan <wilbryan@us.ibm.com> Reviewed-by: Wael El-Essawy <welessa@us.ibm.com>
Diffstat (limited to 'src/occ_405')
-rwxr-xr-xsrc/occ_405/cmdh/cmdh_fsp.c472
-rwxr-xr-xsrc/occ_405/cmdh/cmdh_fsp.h91
-rwxr-xr-xsrc/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c12
-rwxr-xr-xsrc/occ_405/cmdh/cmdh_service_codes.h2
-rw-r--r--src/occ_405/cmdh/cmdh_thread.c46
-rwxr-xr-xsrc/occ_405/incl/occ_common.h3
-rwxr-xr-xsrc/occ_405/main.c6
7 files changed, 13 insertions, 619 deletions
diff --git a/src/occ_405/cmdh/cmdh_fsp.c b/src/occ_405/cmdh/cmdh_fsp.c
index 2729bbb..20578fa 100755
--- a/src/occ_405/cmdh/cmdh_fsp.c
+++ b/src/occ_405/cmdh/cmdh_fsp.c
@@ -50,9 +50,6 @@ const int ALLOW_UNTRUSTED_ACCESS = 1;
// to be expressed as a Log
const int LOG_SIZEOF_FSP_CMD_BUFFER = 12; // 4096 = 2**12
-// Given to OCC from HWSV team, sent in FSI2Host Mailbox1 Message
-const uint32_t OCC_MSG_QUEUE_ID = 0x80000007;
-
// The OCB Device Driver request that OCC uses to receive a doorbell from FSP
OcbRequest G_fsp_doorbell_ocb_request;
@@ -73,9 +70,6 @@ fsp_msg_t G_fsp_msg = {
.rsp = (fsp_rsp_t *) CMDH_OCC_RESPONSE_BASE_ADDRESS,
};
-// This determines whether or not OCC can use MBOX for attentions
-eFsi2HostMboxState G_fsi2host_mbox_ready = FSI2HOST_MBOX_NOT_USEABLE;
-
// Temporary storage used by our SSX_PANIC macro
uint32_t __occ_panic_save_r3;
uint32_t __occ_panic_save_r4;
@@ -124,13 +118,13 @@ void clearCmdhWakeupCondition(eCmdhWakeupThreadMask i_cond)
G_cmdh_thread_wakeup_mask &= ~i_cond;
}
-
// Function Specification
//
// Name: notifyFspDoorbellReceived
//
-// Description: Notifies the command handler thread that a
-// command from the FSP has been received
+// Description: Notifies the command handler thread that a command
+// from the FSP has been received by releasing the
+// G_cmdh_fsp_wakeup_thread semaphore.
//
// End Function Specification
void notifyFspDoorbellReceived(void * i_arg)
@@ -166,192 +160,6 @@ int cmdh_thread_wait_for_wakeup(void)
return l_rc;
}
-
-// Function Specification
-//
-// Name: cmdh_fsp_fsi2host_mbox_wait4free
-//
-// Description: Checks the OR of all of the SCRATCH7 core scoms on the
-// processor, and waits up to 90 <TBD> seconds for hostboot
-// to signal they are off the fsi2host mbox by clearing the
-// SCRATCH7 scom from 'hostboot' to all zeros.
-//
-// Moving the mbox check from scratch register 7 to scratch register 3.
-//
-// End Function Specification
-int cmdh_fsp_fsi2host_mbox_wait4free(void)
-{
-// Scratch register 3
-#define PC_SCR3 0x10013286
-
-// Hostboot writes 'hostboot' as its magic number
-#define HOSTBOOT_RUNNING 0x686f7374626f6f74ULL
-
-// Use at least 1 min to be safe
-#define FSI2HOST_TIMEOUT_IN_SECONDS 90
-
-#define SWAKEUP_TIMEOUT_MS 25 //use 25ms timeout (same as used in gpsm code)
-
- uint64_t l_payload = 0;
- int rc,rc2 = 0;
- int l_do_once = 0;
- int l_timeout = FSI2HOST_TIMEOUT_IN_SECONDS;
- ChipConfigCores l_cores, l_swup_timedout = 0;
- pmc_core_deconfiguration_reg_t l_pcdr;
- bool l_disable_swup;
- errlHndl_t l_errl;
- bool l_swakeup_failure = FALSE;
-
-
- // query configured cores for special wakeup
- l_pcdr.value = in32(PMC_CORE_DECONFIGURATION_REG);
- l_cores = ~l_pcdr.fields.core_chiplet_deconf_vector;
-
- while(0 != l_timeout)
- {
- // Decrement Timeout Timer
- l_timeout--;
-
- l_disable_swup = FALSE;
- // Enable special wakeup so following getscom doesn't
- // fail with CHIPLET_OFFLINE error on sleeping cores
-// TEMP -- NO special_wakeup.h anymore!
-/* rc2 = occ_special_wakeup(TRUE,
- l_cores,
- SWAKEUP_TIMEOUT_MS,
- &l_swup_timedout);
-*/
- if(rc2 || l_swup_timedout)
- {
- CMDH_TRAC_ERR("cmdh_fsp_fsi2host_mbox_wait4free: enable occ_special_wakeup failed with rc=%d, timeout=0x%04x, cores=0x%04x",
- rc2, l_swup_timedout, l_cores);
-
- l_swakeup_failure = TRUE;
- break;
- }
-
- l_disable_swup = TRUE;
-
- // Read from all cores & OR together so we don't have
- // to figure out which is the hostboot 'master'
- rc = getscom_ffdc(MC_ADDRESS(PC_SCR3,
- MC_GROUP_EX_CORE, PCB_MULTICAST_OR),
- &l_payload, NULL); //errors committed internally
-
- if (rc) {
- CMDH_TRAC_INFO("PC_SCR3 getscom fail rc=%x",rc);
- break;
- }
-
- if (HOSTBOOT_RUNNING == l_payload)
- {
- // Hostboot is still running on the Mailbox
- if(0 == l_do_once)
- {
- l_do_once = 1;
- CMDH_TRAC_INFO("HostBoot is on FSI2HOST mailbox...waiting for them to get off");
- }
- }
- else if(0 == l_payload)
- {
- // Hostboot is off the mailbox
- rc = 0;
- break;
- }
- else
- {
- // This is maybe an error, but probably not. Especially in AVP mode.
- CMDH_TRAC_INFO("Hostboot is off FSI2HOST mbox, but PC_SCR3 = 0x%08x_%08x",
- (uint32_t) ((l_payload & 0xFFFFFFFF00000000ULL) >> 32),
- (uint32_t) ((l_payload & 0x00000000FFFFFFFFULL) >> 0));
-
- // Return success
- rc = 0;
- break;
- }
-
- if(l_disable_swup)
- {
- l_disable_swup = FALSE;
- // clear special wakeup while we sleep
-// TEMP -- NO special_wakeup.h anymore!
-/* rc2 = occ_special_wakeup(FALSE,
- l_cores,
- SWAKEUP_TIMEOUT_MS,
- &l_swup_timedout);
-*/
- if(rc2)
- {
- CMDH_TRAC_ERR("cmdh_fsp_fsi2host_mbox_wait4free: clear occ_special_wakeup failed with rc=%d, cores=0x%04x",
- rc2, l_cores);
- l_swakeup_failure = TRUE;
- break;
- }
- }
-
-
- // Wait for 1 second until we try again
- ssx_sleep(SSX_SECONDS(1));
- }
-
- //make sure we clear special wakeup before exiting this function
- if(l_disable_swup)
- {
-// TEMP -- NO special_wakeup.h anymore
-/*
- rc2 = occ_special_wakeup(FALSE,
- l_cores,
- SWAKEUP_TIMEOUT_MS,
- &l_swup_timedout);
-*/
- if(rc2)
- {
- CMDH_TRAC_ERR("cmdh_fsp_fsi2host_mbox_wait4free: clear occ_special_wakeup failed with rc=%d, cores=0x%04x",
- rc2, l_cores);
- l_swakeup_failure = TRUE;
- }
- }
-
- if( 0 == l_timeout )
- {
- rc = -1;
- }
-
- //Since cores can be left in an unknown state after special wakeup fails
- //Log an error and request a reset to possibly clean up the special wakeup
- if(l_swakeup_failure)
- {
- /* @
- * @errortype
- * @moduleid CMDH_FSP_FSI2HOST_MBOX_WAIT4FREE
- * @reasoncode INTERNAL_HW_FAILURE
- * @userdata1 rc - Return code of failing function
- * @userdata2 bitmap of cores that timed out
- * @userdata4 0
- * @devdesc Failed to enable OCC special wakeup
- */
- l_errl = createErrl(
- CMDH_FSP_FSI2HOST_MBOX_WAIT4FREE, // modId
- INTERNAL_HW_FAILURE, // reasoncode
- OCC_NO_EXTENDED_RC, // Extended reason code
- ERRL_SEV_UNRECOVERABLE, // Severity
- NULL, // Trace Buf
- DEFAULT_TRACE_SIZE, // Trace Size
- rc2, // userdata1
- l_swup_timedout // userdata2
- );
-
- REQUEST_RESET(l_errl);
- if(!rc)
- {
- rc = -1;
- }
- }
-
- return rc;
-}
-
-
// Function Specification
//
// Name: cmdh_fsp_init
@@ -361,9 +169,7 @@ int cmdh_fsp_fsi2host_mbox_wait4free(void)
// End Function Specification
errlHndl_t cmdh_fsp_init(void)
{
- int l_rc;
- errlHndl_t l_errlHndl = NULL;
- mbox_data_area_regs_t l_mbox_msg;
+ errlHndl_t l_errlHndl = NULL;
CHECKPOINT(INIT_OCB);
@@ -394,144 +200,8 @@ errlHndl_t cmdh_fsp_init(void)
// Open Up Linear Window for FSP Communication
// ----------------------------------------------------
- if(G_occ_interrupt_type == FSP_SUPPORTED_OCC)
- {
- // ----------------------------------------------------
- // Initialize FSI2Host Mailbox1 -- Attentions to FSP
- // ----------------------------------------------------
- l_rc = cmdh_fsp_fsi2host_mbox_wait4free();
- if(l_rc)
- {
- CHECKPOINT_FLAG(CF_FSI_MB_TIMEOUT);
-
- G_fsi2host_mbox_ready = FSI2HOST_MBOX_NOT_USEABLE;
-
- CMDH_TRAC_ERR("Timeout waiting for HostBoot to get off FSI2HOST mailbox. rc=%d", l_rc);
-
- /* @
- * @errortype
- * @moduleid CMDH_FSI2HOST_MBOX_UNAVAIL
- * @reasoncode EXTERNAL_INTERFACE_FAILURE
- * @userdata1 l_rc - Return code of failing function
- * @userdata2 0
- * @userdata4 ERC_CMDH_MBOX_REQST_FAILURE
- * @devdesc Failed to get permission to use fsi2host mbox
- */
- l_errlHndl = createErrl(
- CMDH_FSI2HOST_MBOX_UNAVAIL, // modId
- EXTERNAL_INTERFACE_FAILURE, // reasoncode
- ERC_CMDH_MBOX_REQST_FAILURE, // Extended reason code
- ERRL_SEV_PREDICTIVE, // Severity
- NULL, // Trace Buf
- DEFAULT_TRACE_SIZE, // Trace Size
- l_rc, // userdata1
- 0 // userdata2
- );
- }
- else
- {
- CHECKPOINT(INIT_FSI_HOST_MBOX);
- CMDH_TRAC_INFO("HostBoot is off FSI2HOST mailbox.");
-
- /// Initialize the FSI2HOST MBOX
- memset(&l_mbox_msg.word[0],0,sizeof(l_mbox_msg));
- l_mbox_msg.fields.msg_id = 0;
- l_mbox_msg.fields.msg_queue_id = OCC_MSG_QUEUE_ID;
- l_mbox_msg.fields.msg_payload.fsp_cmd_buffer_addr = CMDH_LINEAR_WINDOW_BASE_ADDRESS;
- l_mbox_msg.fields.msg_payload.fsp_rsp_buffer_addr = CMDH_OCC_RESPONSE_BASE_ADDRESS;
-
- l_mbox_msg.fields.msg_payload.occ_id = G_pbax_id.chip_id;
-
- do
- {
- // Initialize Headers -- Hardware Provided Header Area not used
- // scom errors will be committed internally
- l_rc = putscom_ffdc(MAILBOX_1_HEADER_COMMAND_0_A_REGADDR, 0x0000000000000000ull, NULL);
- if(l_rc)
- {
- break;
- }
- l_rc = putscom_ffdc(MAILBOX_1_HEADER_COMMAND_1_A_REGADDR, 0x0000000000000000ull, NULL);
- if(l_rc)
- {
- break;
- }
- l_rc = putscom_ffdc(MAILBOX_1_HEADER_COMMAND_2_A_REGADDR, 0x0000000000000000ull, NULL);
- if(l_rc)
- {
- break;
- }
-
- // Initialize Data Area -- 64 bytes
- // Message ID & Message Queue ID
- l_rc = putscom_ffdc(MAILBOX_1_DATA_AREA_A_0_REGADDR, ((uint64_t) l_mbox_msg.fields.msg_id << 32), NULL);
- if(l_rc)
- {
- break;
- }
- // Command Type & Flags
- l_rc = putscom_ffdc(MAILBOX_1_DATA_AREA_A_1_REGADDR, ((uint64_t) l_mbox_msg.fields.msg_queue_id << 32), NULL);
- if(l_rc)
- {
- break;
- }
- // Data[0]
- l_rc = putscom_ffdc(MAILBOX_1_DATA_AREA_A_2_REGADDR, ((uint64_t) l_mbox_msg.fields.msg_payload.type << 32), NULL);
- if(l_rc)
- {
- break;
- }
- // Data[1]
- l_rc = putscom_ffdc(MAILBOX_1_DATA_AREA_A_3_REGADDR, ((uint64_t) l_mbox_msg.fields.msg_payload.flags << 32), NULL);
- if(l_rc)
- {
- break;
- }
- // (Void *) Extra Data
- l_rc = putscom_ffdc(MAILBOX_1_DATA_AREA_A_4_REGADDR, ((uint64_t) l_mbox_msg.fields.msg_payload.fsp_cmd_buffer_addr << 32), NULL);
- if(l_rc)
- {
- break;
- }
- // Unused
- l_rc = putscom_ffdc(MAILBOX_1_DATA_AREA_A_5_REGADDR, ((uint64_t) l_mbox_msg.fields.msg_payload.fsp_rsp_buffer_addr << 32), NULL);
- if(l_rc)
- {
- break;
- }
- l_rc = putscom_ffdc(MAILBOX_1_DATA_AREA_A_6_REGADDR, ((uint64_t) l_mbox_msg.fields.msg_payload.occ_id << 32), NULL);
- if(l_rc)
- {
- break;
- }
- l_rc = putscom_ffdc(MAILBOX_1_DATA_AREA_A_7_REGADDR, 0x0000000000000000ull, NULL);
- if(l_rc)
- {
- break;
- }
- l_rc = putscom_ffdc(MAILBOX_1_DATA_AREA_A_8_REGADDR, 0x0000000000000000ull, NULL);
- if(l_rc)
- {
- break;
- }
- l_rc = putscom_ffdc(MAILBOX_1_DATA_AREA_A_9_REGADDR, 0x0000000000000000ull, NULL);
- if(l_rc)
- {
- break;
- }
-
- G_fsi2host_mbox_ready = FSI2HOST_MBOX_INITIALIZED;
- CHECKPOINT(FSI_HOST_MBOX_INITIALIZED);
- }while(0);
- }
- }
- else if(G_occ_interrupt_type == PSIHB_INTERRUPT)
- {
- // For systems like Habanero, OCC will use the PSIHB complex to
- // send an interrupt to Host. This is done via a simple SCOM
- // register, so there is nothing to initialize here.
- }
- else
+ if(G_occ_interrupt_type != PSIHB_INTERRUPT &&
+ G_occ_interrupt_type != FSP_SUPPORTED_OCC)
{
// Invalid interrupt type
CMDH_TRAC_ERR("cmdh_fsp_init: Invalid OCC interrupt type was detected! interrupt_type[%d]",
@@ -561,136 +231,6 @@ errlHndl_t cmdh_fsp_init(void)
return l_errlHndl;
}
-
-// Function Specification
-//
-// Name: cmdh_fsp_attention
-//
-// Description: TODO -- Add description
-//
-// End Function Specification
-int cmdh_fsp_attention_withRetry(uint32_t i_type, int i_timeout_in_ms)
-{
-#define CMDH_RETRY_ATTENTION_INTERVAL_MS 10
- int l_timeoutLimit = (i_timeout_in_ms / CMDH_RETRY_ATTENTION_INTERVAL_MS);
- int l_timeout = 0;
- int l_alert_rc = 0;
- int l_rc = 0;
-
- // Try to send an alert to FSP every second until timeout is
- // reached, or alert is successfully sent.
- for(l_timeout=0; l_timeout < l_timeoutLimit; l_timeout++)
- {
- // Signal to TMGT that OCC has a response ready
- l_alert_rc = cmdh_fsp_attention( OCC_ALERT_FSP_RESP_READY );
-
- if(OCC_ALERT_SUCCESS == l_alert_rc)
- {
- // Attention successfully sent
- break;
- }
- else if(OCC_ALERT_LAST_ATTN_NOT_COMPLETE == l_alert_rc)
- {
- // If we couldn't send the alert b/c FSP hasn't processed the last
- // one, wait one second, then try again.
- ssx_sleep(SSX_MILLISECONDS(CMDH_RETRY_ATTENTION_INTERVAL_MS));
- }
- else
- {
- // Must have been a PIB Error
- CMDH_TRAC_ERR("PIB Error on Attention (Type %d) to FSP. rc=0x%x",
- i_type, l_alert_rc);
- // TODO: Create Error Log?
- break;
- }
- }
- if(l_timeoutLimit == l_timeout)
- {
- CMDH_TRAC_INFO("Timeout on Attention (Type %d) to FSP. rc=0x%x",
- i_type, l_alert_rc);
- l_rc = -1;
- }
-
- return l_rc;
-}
-
-// Function Specification
-//
-// Name: cmdh_fsp_attention
-//
-// Description: TODO -- Add description
-//
-// End Function Specification
-int cmdh_fsp_attention(uint32_t i_type)
-{
- doorbl_stsctrl_reg_t l_status;
- mbox_data_area_regs_t l_mbox_msg;
- int l_rc = OCC_ALERT_SUCCESS;
- errlHndl_t l_err = NULL;
-
- do
- {
- // Don't send attentions if the FSI2HOST Mailbox isn't ours
- if( FSI2HOST_MBOX_NOT_USEABLE == G_fsi2host_mbox_ready ){break;}
-
- // Read Status Register for checks below
- l_rc = getscom_ffdc(MAILBOX_1_DOORBELL_STS_CTRL_REGADDR, (uint64_t *) &l_status.doubleword, &l_err);
- if(l_rc)
- {
- break;
- }
-
- if (l_status.lbus_slaveA_pending)
- {
- // Can't send alert, FSP hasn't handled last attention yet
- l_rc = OCC_ALERT_LAST_ATTN_NOT_COMPLETE;
-
- // Return from function with error rc, and let caller try again.
- break;
- }
- else
- {
- // No attention in progress to FSP, we are allowed send one
- if (0 == l_status.xup)
- {
- // FSP should have set this, but didn't...
- // TODO: Ignore? Log Error? Valid Case? Abort sending another attention?
- }
-
- // Set Attention Command Type = OCC_ALERT_FSP_SERVICE_REQD, Flags = 0
- l_mbox_msg.fields.msg_payload.type = i_type;
-
- // Send Command Type & Flags to Mailbox Register
- l_rc = putscom_ffdc(MAILBOX_1_DATA_AREA_A_2_REGADDR, ((uint64_t) l_mbox_msg.fields.msg_payload.type << 32), &l_err);
- if(l_rc){break;}
-
- // Set Attention Interrupt by setting "LBUS slave-A Pending (bit 28, intel notation)"
- l_status.lbus_slaveA_pending = 1;
- l_status.lbus_slaveA_data_cnt = 0x28;
-
- // Clear Xup bit, it is set by FSP when it reads the OCC interrupt Mailbox
- l_status.xup = 0;
-
- // Write Status out to Doorbell Status/Control 1
- l_rc = putscom_ffdc(MAILBOX_1_DOORBELL_STS_CTRL_REGADDR, (uint64_t) l_status.doubleword, &l_err);
- if(l_rc){break;}
-
- CMDH_DBG("Sent Attention to FSP: Type[0x%x]\n",i_type);
- }
- }while(0);
-
- if(l_err)
- {
- // TODO
- //can't commit errors from this function since committing an error will
- //cause another call to raise an attention and we could eventually run
- //out of stack space
- deleteErrl(&l_err);
- }
- return l_rc;
-}
-
-
// Function Specification
//
// Name: checksum16
diff --git a/src/occ_405/cmdh/cmdh_fsp.h b/src/occ_405/cmdh/cmdh_fsp.h
index 27e2baa..486f447 100755
--- a/src/occ_405/cmdh/cmdh_fsp.h
+++ b/src/occ_405/cmdh/cmdh_fsp.h
@@ -95,35 +95,14 @@
// OCC/HTMGT response buffer offset in HOMER
#define OCC_HTMGT_RSP_OFFSET_HOMER 0x001EF000
-// Typedef of the various alerts that OCC can send TMGT
-typedef enum
-{
- //OCC has a response ready for TMGT to come get
- OCC_ALERT_FSP_RESP_READY = 1,
- //OCC alert to TMGT that it needs to poll OCC
- OCC_ALERT_FSP_SERVICE_REQD = 2,
- //OCC alert to TMGT that it sees a checkstop
- OCC_ALERT_SYS_CHECKSTOP = 3,
-} eFspAlertType;
-
-// States for OCC using the Mailbox for Attn
-typedef enum
-{
- FSI2HOST_MBOX_NOT_USEABLE = 0,
- FSI2HOST_MBOX_INITIALIZED = 1,
-} eFsi2HostMboxState;
-
// Typedef of the various reasons why the cmdh thread wakes up
typedef enum
{
// Success, alert was sent
CMDH_WAKEUP_REASON_NONE = 0x00000000,
CMDH_WAKEUP_FSP_COMMAND = 0x00000001,
- CMDH_WAKEUP_FSP_ATTENTION_ALERT = 0x00000002,
- CMDH_WAKEUP_FSP_CHECKSTOP_ALERT = 0x00000004,
} eCmdhWakeupThreadMask;
-
// Typedef of the various errors that can happen on alerts
typedef enum
{
@@ -331,81 +310,11 @@ typedef struct
};
} doorbl_stsctrl_reg_t;
-// Breakdown of the Mailbox1 Data, which OCC uses to alert TMGT.
-// This is the actual data that TMGT can get from the mailbox
-// when it is notified of an alert.
-typedef struct mbox_payload
-{
- // This is the command type OCC uses to tell TMGT if this was a
- // Response Ready, or Service Required (eFspAlertType)
- uint32_t type;
- union
- {
- struct
- {
- // Unused: 0 -> async, 1 -> sync.
- uint32_t __reserved__async:1;
- // Unused: This is for internal hostboot use.
- uint32_t __reserved__mbox_sync:1;
- // Unused
- uint32_t __reserved__unused:30;
- };
- uint32_t flags;
- };
- union
- {
- struct
- {
- // "Write" Buffer Address (from TMGT perspective)
- uint32_t fsp_cmd_buffer_addr;
- // "Read" Buffer Address (from TMGT perspective)
- uint32_t fsp_rsp_buffer_addr;
- // Unused
- uint8_t _reserved[7];
- // Sanity check on OCC Id (should match up with HUID)
- uint8_t occ_id;
- };
- uint64_t data[2];
- };
- // If extra_data != NULL, data[1] is required to have size of extra_data (in bytes)
- uint64_t extra_data;
-} mbox_payload_t;
-
-// Breakdown of the Full Mailbox1, which OCC uses to alert TMGT.
-// This is the actual data that HWSV gets from the PIB, which it
-// then uses to notify TMGT of an alert, and sends TMGT the msg_payload
-typedef struct
-{
- // Unused: Identifier assigned by originating endpoint for correlating
- // sync message responses.
- uint32_t msg_id;
- // FSI2HOST Assigned Queue ID. 0x80000000 - 0xFFFFFFFF = FSP msg_queue,
- // 0x0 - 0x80000000 = Hostboot msg_queue. 0x80000007 = OCC
- uint32_t msg_queue_id;
- // Message Payload (what TMGT gets)
- mbox_payload_t msg_payload;
-} mbox_msg_t;
-
-// Union of the Full Mailbox1, which OCC uses to alert TMGT.
-// Since the data is SCOM'd, we want to parse it by uint64_t's
-// to do the scom, and fill it out using the mbox_msg_t.
-typedef union
-{
- // Parsed out fields the way OCC & TMGT interpret them
- mbox_msg_t fields;
- // Words used in putscoms
- uint64_t word[8];
-} mbox_data_area_regs_t;
-
-extern eFsi2HostMboxState G_fsi2host_mbox_ready;
extern eCmdhWakeupThreadMask G_cmdh_thread_wakeup_mask;
extern fsp_cmd_t G_htmgt_cmd_buffer;
extern fsp_rsp_t G_htmgt_rsp_buffer;
extern uint8_t G_rsp_status;
-int cmdh_fsp_attention(uint32_t i_type);
-int cmdh_fsp_attention_withRetry(uint32_t i_type, int i_timeout_in_ms);
-
void notifyCmdhWakeupCondition(eCmdhWakeupThreadMask i_cond);
void clearCmdhWakeupCondition(eCmdhWakeupThreadMask i_cond);
int cmdh_thread_wait_for_wakeup(void);
diff --git a/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c b/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c
index 34fcd67..00c041b 100755
--- a/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c
+++ b/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c
@@ -2211,18 +2211,6 @@ errlHndl_t DATA_store_cnfgdata (const cmdh_fsp_cmd_t * i_cmd_ptr,
if((!l_errlHndl) && (l_new_data))
{
- // Don't send a poll if we just received one or our periodic data
- // packets like supernova, dimm, or p5ioc temperatures. This causes
- // TMGT to wrap their trace with our attentions
- // For simplicity, don't poll if we don't have any new data to
- // request
- if(DATA_request_cnfgdata() != 0)
- {
- // Poll after we get new data to either inform the FSP that we need more,
- // or inform the FSP that we have everything needed for a new state.
- cmdh_fsp_attention(OCC_ALERT_FSP_SERVICE_REQD);
- }
-
// Notify AMEC component of new data
AMEC_data_change(l_new_data);
}
diff --git a/src/occ_405/cmdh/cmdh_service_codes.h b/src/occ_405/cmdh/cmdh_service_codes.h
index 93d422c..ad4434a 100755
--- a/src/occ_405/cmdh/cmdh_service_codes.h
+++ b/src/occ_405/cmdh/cmdh_service_codes.h
@@ -33,11 +33,9 @@ enum occCmdhModuleId
DATA_STORE_GENERIC_DATA = CMDH_COMP_ID | 0x00,
DATA_STORE_FREQ_DATA = CMDH_COMP_ID | 0x01,
DATA_STORE_PCAP_DATA = CMDH_COMP_ID | 0x02,
- CMDH_FSI2HOST_MBOX_UNAVAIL = CMDH_COMP_ID | 0x03,
CMDH_GENERIC_CMD_FAILURE = CMDH_COMP_ID | 0x04,
DATA_STORE_SYS_DATA = CMDH_COMP_ID | 0x05,
DATA_STORE_APSS_DATA = CMDH_COMP_ID | 0x06,
- CMDH_FSP_FSI2HOST_MBOX_WAIT4FREE = CMDH_COMP_ID | 0x07,
DATA_GET_THRM_THRESHOLDS = CMDH_COMP_ID | 0x08,
DATA_STORE_IPS_DATA = CMDH_COMP_ID | 0x09,
DATA_GET_IPS_DATA = CMDH_COMP_ID | 0x0A,
diff --git a/src/occ_405/cmdh/cmdh_thread.c b/src/occ_405/cmdh/cmdh_thread.c
index 00b8d77..01e8b17 100644
--- a/src/occ_405/cmdh/cmdh_thread.c
+++ b/src/occ_405/cmdh/cmdh_thread.c
@@ -33,10 +33,10 @@
#include "state.h"
#include <cmdh_fsp.h>
-eCmdhWakeupThreadMask G_cmdh_thread_wakeup_mask;
-
extern uint8_t G_occ_interrupt_type;
+eCmdhWakeupThreadMask G_cmdh_thread_wakeup_mask;
+
// Function Specification
//
// Name: Cmd_Hndl_thread_routine
@@ -67,18 +67,6 @@ void Cmd_Hndl_thread_routine(void *arg)
CHECKPOINT(FSP_COMM_INITIALIZED);
- // Only send this first attention if FSP is present
- if(G_occ_interrupt_type == FSP_SUPPORTED_OCC)
- {
- // ------------------------------------------------
- // Send 'Service' Attention to signal that we are
- // ready to accept commands from FSP.
- // ------------------------------------------------
- cmdh_fsp_attention( OCC_ALERT_FSP_SERVICE_REQD );
-
- CHECKPOINT(FIRST_FSP_ATTN_SENT);
- }
-
// ------------------------------------------------
// Loop forever, handling FSP commands
// ------------------------------------------------
@@ -94,11 +82,12 @@ void Cmd_Hndl_thread_routine(void *arg)
// ------------------------------------------------
if(SSX_OK == l_rc)
{
+ // Handle the command that TMGT just sent to OCC
if( CMDH_WAKEUP_FSP_COMMAND & G_cmdh_thread_wakeup_mask )
{
clearCmdhWakeupCondition(CMDH_WAKEUP_FSP_COMMAND);
- // Handle the command that TMGT just sent to OCC
+
l_errlHndl = cmdh_fsp_cmd_hndler();
// Commit an error if we get one passed back, do it before
@@ -107,34 +96,7 @@ void Cmd_Hndl_thread_routine(void *arg)
{
commitErrl(&l_errlHndl);
}
-
- // Check if the sender is FSP based
- if (G_occ_interrupt_type == FSP_SUPPORTED_OCC)
- {
- // Tell the FSP we have a response ready for them.
- // Try to send this for 500ms before giving up
- cmdh_fsp_attention_withRetry(OCC_ALERT_FSP_RESP_READY, 500);
- }
- }
-
- if (CMDH_WAKEUP_FSP_ATTENTION_ALERT & G_cmdh_thread_wakeup_mask)
- {
- clearCmdhWakeupCondition(CMDH_WAKEUP_FSP_ATTENTION_ALERT);
-
- // Tell the FSP we have something they need to come check on.
- // Try to send this for 500ms, before giving up
- cmdh_fsp_attention_withRetry(OCC_ALERT_FSP_SERVICE_REQD, 500);
}
-
- if (CMDH_WAKEUP_FSP_CHECKSTOP_ALERT & G_cmdh_thread_wakeup_mask)
- {
- clearCmdhWakeupCondition(CMDH_WAKEUP_FSP_CHECKSTOP_ALERT);
-
- // Tell the FSP we have something they need to come check on.
- // Try to send this for 500ms, before giving up
- cmdh_fsp_attention_withRetry(OCC_ALERT_SYS_CHECKSTOP, 500);
- }
-
}
}
diff --git a/src/occ_405/incl/occ_common.h b/src/occ_405/incl/occ_common.h
index 8dee795..ceb3757 100755
--- a/src/occ_405/incl/occ_common.h
+++ b/src/occ_405/incl/occ_common.h
@@ -261,11 +261,8 @@ enum
CMDH_THREAD_STARTED = 0x0dff,
INIT_OCB = 0x0e05,
OCB_INITIALIZED = 0x0e07,
- INIT_FSI_HOST_MBOX = 0x0e10,
- FSI_HOST_MBOX_INITIALIZED = 0x0e20,
FSP_COMM_INITIALIZED = 0x0eff,
ABOUT_TO_HALT = 0x0f00,
- FIRST_FSP_ATTN_SENT = 0xffff,
};
// Checkpoint flags (one byte bitmap)
diff --git a/src/occ_405/main.c b/src/occ_405/main.c
index 3f87870..f45e5c8 100755
--- a/src/occ_405/main.c
+++ b/src/occ_405/main.c
@@ -1143,9 +1143,9 @@ int main(int argc, char **argv)
}
else
{
- // For Simics we are assuming the BMC communication path
- //G_occ_interrupt_type = FSP_SUPPORTED_OCC;
- G_occ_interrupt_type = PSIHB_INTERRUPT;
+ // For Simics we are assuming the FSP communication path as the default
+ G_occ_interrupt_type = FSP_SUPPORTED_OCC;
+ //G_occ_interrupt_type = PSIHB_INTERRUPT;
}
MAIN_TRAC_INFO("HOMER accessed, rc=%d, host interrupt type=%d, ssx_rc=%d",
OpenPOWER on IntegriCloud