// send the sync complete message errlHndl_t AttributeSync::sendSyncCompleteMessage( ) { TARG_INF("sending sync complete message"); errlHndl_t l_err = NULL; msg_t * msg = msg_allocate(); // initialize msg buffer memset( msg, 0, sizeof(msg_t) ); msg->type = ATTR_SYNC_COMPLETE_TO_FSP; ATTR_SYNC_ADD_PAGE_COUNT( iv_total_pages, msg->data[0] ); l_err = sendMboxMessage( SYNCHRONOUS, msg ); if( l_err == NULL ) { // see if there was an error on the other end ATTR_SYNC_RC return_code = ATTR_SYNC_GET_RC( msg->data[0] ); if ( return_code ) { TARG_ERR("Attribute sync failed with return code: 0x%x", return_code ); TARG_ERR("Failed syncing iv_total_pages: 0x%x from iv_section_to_sync: 0x%x", iv_total_pages,iv_section_to_sync ); /*@ * @errortype * @moduleid TARG_MOD_ATTR_SYNC * @reasoncode TARG_RC_ATTR_SYNC_TO_FSP_FAIL * @userdata1 return code from FSP attribute sync * @userdata2[0:31] page count for this section * @userdata2[31:63] section ID of for section being sync'd * * @devdesc The attribute synchronization code on the * FSP side was unable to complete the sync * operation successfully. * * @custdesc A problem occurred during the IPL of the * system: Attributes were not fully * syncronized between the host firmware and * service processor. * */ l_err = new ErrlEntry(ERRL_SEV_UNRECOVERABLE, TARG_MOD_ATTR_SYNC, TARG_RC_ATTR_SYNC_TO_FSP_FAIL, return_code, TWO_UINT32_TO_UINT64( iv_total_pages,iv_section_to_sync)); } } // for a syncronous message we need to free the message msg_free( msg ); return l_err; }
// send a request to FSP to sync to Hostboot errlHndl_t AttributeSync::sendSyncToHBRequestMessage() { TARG_INF( ENTER_MRK "AttributeSync::sendSyncToHBRequestMessage" ); errlHndl_t l_err = NULL; // allocate message buffer // buffer will be initialized to zero by msg_allocate() msg_t * l_pMsg = msg_allocate(); l_pMsg->type = ATTR_SYNC_REQUEST_TO_HB; ATTR_SYNC_ADD_SECTION_ID( iv_section_to_sync, l_pMsg->data[0] ); l_err = sendMboxMessage( SYNCHRONOUS, l_pMsg ); if( l_err == NULL ) { // see if there was an error on the other end ATTR_SYNC_RC return_code = ATTR_SYNC_GET_RC( l_pMsg->data[0] ); if ( return_code ) { TARG_ERR( "rc 0x%x received from FSP for Sync to HB request", return_code ); /*@ * @errortype * @moduleid TARG_MOD_ATTR_SYNC * @reasoncode TARG_RC_ATTR_SYNC_REQUEST_TO_HB_FAIL * @userdata1 return code from FSP * @userdata2 section to sync * @devdesc The attribute synchronization code on the * FSP side was unable to fulfill the sync to * HostBoot request. */ l_err = new ErrlEntry(ERRL_SEV_UNRECOVERABLE, TARG_MOD_ATTR_SYNC, TARG_RC_ATTR_SYNC_REQUEST_TO_HB_FAIL, return_code, iv_section_to_sync); } } else { TARG_ERR( "Failed to send request to FSP to sync section type %u " "to Hostboot.", iv_section_to_sync ); } // for a syncronous message we need to free the message msg_free( l_pMsg ); l_pMsg = NULL; TARG_INF( EXIT_MRK "AttributeSync::sendSyncToHBRequestMessage" ); return l_err; }
// send the sync complete message errlHndl_t AttributeSync::sendSyncCompleteMessage( ) { TRACFCOMP(g_trac_targeting, "sending sync complete message"); errlHndl_t l_err = NULL; msg_t * msg = msg_allocate(); // initialize msg buffer memset( msg, 0, sizeof(msg_t) ); msg->type = ATTR_SYNC_COMPLETE_TO_FSP; ATTR_SYNC_ADD_PAGE_COUNT( iv_total_pages, msg->data[0] ); l_err = sendMboxMessage( SYNCHRONOUS, msg ); if( l_err == NULL ) { // see if there was an error on the other end ATTR_SYNC_RC return_code = ATTR_SYNC_GET_RC( msg->data[0] ); if ( return_code ) { TRACFCOMP(g_trac_targeting, "return code: 0x%x", return_code ); /*@ * @errortype * @moduleid TARG_MOD_ATTR_SYNC * @reasoncode TARG_RC_ATTR_SYNC_TO_FSP_FAIL * @userdata1 return code from FSP attribute sync * @userdata2 section ID of for section being sync'd * * @devdesc The Attribute synchronization code on the * FSP side was unable to complete the sync * operation successfully. */ l_err = new ErrlEntry(ERRL_SEV_UNRECOVERABLE, TARG_MOD_ATTR_SYNC, TARG_RC_ATTR_SYNC_TO_FSP_FAIL, return_code, (uint64_t)iv_section_to_sync); } } // for a syncronous message we need to free the message msg_free( msg ); return l_err; }
errlHndl_t AttributeSync::syncSectionToFsp( TARGETING::SECTION_TYPE i_section_to_sync ) { errlHndl_t l_errl = NULL; msg_t * msg = NULL; iv_section_to_sync = i_section_to_sync; do{ // set up the pointers to the data area getSectionData(); for( iv_current_page = 0; iv_current_page < iv_total_pages; iv_current_page++ ) { msg = msg_allocate(); msg->type = ATTR_SYNC_SECTION_TO_FSP; msg->data[0] = 0; ATTR_SYNC_ADD_SECTION_ID( iv_section_to_sync, msg->data[0] ); ATTR_SYNC_ADD_PAGE_NUMBER( iv_current_page, msg->data[0] ); // set the 2nd data word to the buffer size msg->data[1] = PAGESIZE; // allocated storage will always be 4k msg->extra_data = MBOX::allocate( PAGESIZE ); // copy the attributes from mem to our buffer. memcpy( msg->extra_data, iv_pages[iv_current_page].dataPtr, PAGESIZE ); TARG_INF("syncSectionToFsp() - copy %d bytes from %p to %p", PAGESIZE, iv_pages[iv_current_page].dataPtr, msg->extra_data); // mailbox code will free both the msg and the extra data // we allocated above for an async message. l_errl = sendMboxMessage( ASYNCHRONOUS, msg ); if( l_errl ) { TARG_ERR("failed sending sync message"); break; } } if(( l_errl == NULL ) && ( iv_total_pages != 0 )) { // tell fsp to commit the last section of data we sent l_errl = sendSyncCompleteMessage(); if( l_errl ) { TARG_ERR("failed sending sync complete message"); } } }while(0); return l_errl; }