diff options
34 files changed, 291 insertions, 2705 deletions
diff --git a/src/occApplet/productApplet/Makefile b/src/occApplet/productApplet/Makefile deleted file mode 100755 index ab233e1..0000000 --- a/src/occApplet/productApplet/Makefile +++ /dev/null @@ -1,94 +0,0 @@ -# IBM_PROLOG_BEGIN_TAG -# This is an automatically generated prolog. -# -# $Source: src/occApplet/productApplet/Makefile $ -# -# OpenPOWER OnChipController Project -# -# Contributors Listed Below - COPYRIGHT 2011,2014 -# [+] Google Inc. -# [+] International Business Machines Corp. -# -# 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 - -ifndef ROOTPATH -ROOTPATH = $(shell pwd)/../../ -export OCCROOT = $(ROOTPATH) -endif - -#******************************************************************************* -# Variables -#******************************************************************************* -OCC = ../../occ -BOOTLOADER = ../../occBootLoader -SSX = ../../ssx -PRODUCTAPPLET = . -LIB = ../../lib - -# New product applet source files must be listed in productappletfiles.mk -# New applets must also be given an ID in src/occ/aplt/incl/appletId. -LDFLAGS = -L $(SSX)/ssx -L $(SSX)/ppc32 -L $(SSX)/ppc405 -L $(SSX)/pgp \ --L $(OCC) -L $(LIB) -lssx -lppc32 --oformat=elf32-powerpc -melf32ppc - -buildImage = $(LD) -R $(OCC)/occ.out $(obj) -Tlinkscript $(LDFLAGS) \ --Map $(basename $(obj)).map -Bstatic -o $(basename $(obj)).out && \ -$(OBJCOPY) -I elf32-powerpc -O binary $(basename $(obj)).out $(basename $(obj)).bin && \ -$(OBJDUMP) -d $(basename $(obj)).out > $(basename $(obj)).dis && \ -$(BOOTLOADER)/imageHdrScript $(basename $(obj)).bin `md5sum $(OCC)/occ.out | cut -c 1-4` - -image = $(BOOTLOADER)/imageHdrScript $(basename $(obj)).bin combineImage && \ -$(BOOTLOADER)/imageHdrScript $(basename $(obj)).out displaySize - -#******************************************************************************* -# Includes -#******************************************************************************* -include $(SSX)/pgp/ssx.mk -include productappletfiles.mk - -INCLUDES = -I. -I$(OCC)/incl -I$(OCC)/errl -I$(OCC)/trac -I$(LIB) -I$(SSX)/ssx \ --I$(OCC)/sensor -I$(OCC) -I$(OCC)/rtls -I$(OCC)/cmdh -I$(OCC)/pss -I$(OCC)/gpe \ --I$(OCC)/aplt/incl -I$(OCC)/aplt -I$(OCC)/cent -I$(OCC)/proc -I$(OCC)/thread \ --I$(SSX)/ppc405 -I$(SSX)/pgp -I$(SSX)/ppc32 -I$(SSX)/pgp/registers - -#******************************************************************************* -# Defs -#******************************************************************************* -DEFS += $(D) -DEFS += -DAPPLET_BUILD=1 -DEFS += -DUSE_SSX_APP_CFG_H=1 - -# Note: Do not use SDA sections for product applets -GCC-CFLAGS = -c -g -Wall -fsigned-char -msoft-float -pipe \ --Wa,-m405 -mbig-endian -m32 -mcpu=405 -mmultiple -mstring -meabi -ffreestanding -Os -mno-sdata - -#******************************************************************************* -# Compilation -#******************************************************************************* -all: $(PRDTAPLT_OBJECTS) - $(CPP) -P $(DEFS) < linkProductApplet.cmd > linkscript - $(foreach obj,$(PRDTAPLT_OBJECTS),$(buildImage) &&) true - -#******************************************************************************* -# combineImage -#******************************************************************************* -.PHONY : combineImage -combineImage: - $(foreach obj,$(PRDTAPLT_OBJECTS),$(image) &&) true - -#******************************************************************************* -# Clean -#******************************************************************************* -clean: - rm -f *.o *.out *.bin *.dis *.map *.hash linkscript diff --git a/src/occApplet/productApplet/apssInitApplet.c b/src/occApplet/productApplet/apssInitApplet.c deleted file mode 100755 index 06421fd..0000000 --- a/src/occApplet/productApplet/apssInitApplet.c +++ /dev/null @@ -1,306 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/occApplet/productApplet/apssInitApplet.c $ */ -/* */ -/* OpenPOWER OnChipController Project */ -/* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ -/* [+] Google Inc. */ -/* [+] International Business Machines Corp. */ -/* */ -/* 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 */ - -//************************************************************************* -// Includes -//************************************************************************* -#include <common_types.h> // imageHdr_t declaration and image header macro -#include <errl.h> // For error handle -#include <trac.h> // For traces -#include <occ_service_codes.h> // for SSX_GENERIC_FAILURE -#include <pss_service_codes.h> // APSS module ids -#include <apss.h> // APSS defines -#include <appletId.h> // For applet ID num -#include "ssx_io.h" // For printf -#include <state.h> -#include "occhw_async.h" //async (GPE, OCB, etc) interfaces - -//************************************************************************* -// Externs -//************************************************************************* -//extern PoreEntryPoint GPE_apss_initialize_gpio; -//extern PoreEntryPoint GPE_apss_set_composite_mode; -extern GpeRequest G_meas_start_request; -extern GpeRequest G_meas_cont_request; -extern GpeRequest G_meas_complete_request; -extern apss_start_args_t G_gpe_start_pwr_meas_read_args; -extern apss_continue_args_t G_gpe_continue_pwr_meas_read_args; -extern apss_complete_args_t G_gpe_complete_pwr_meas_read_args; - -//************************************************************************* -// Macros -//************************************************************************* - -//************************************************************************* -// Defines/Enums -//************************************************************************* -#define APSS_INITIALIZE_ID "APSS Init Aplt\0" - -//************************************************************************* -// Structures -//************************************************************************* - -//************************************************************************* -// Globals -//************************************************************************* - -//************************************************************************* -// Function Prototypes -//************************************************************************* - -//************************************************************************* -// Functions -//************************************************************************* - -// Function Specification -// -// Name: apss_initialize -// -// Description: Completes all APSS initialization including GPIOs, altitude and -// mode -// -// End Function Specification -errlHndl_t apss_initialize() -{ - errlHndl_t l_err = NULL; - GpeRequest request; - - // Setup the GPIO init structure to pass to the GPE program - G_gpe_apss_initialize_gpio_args.error.error = 0; - G_gpe_apss_initialize_gpio_args.error.ffdc = 0; - G_gpe_apss_initialize_gpio_args.config0.direction - = G_gpio_config[0].direction; - G_gpe_apss_initialize_gpio_args.config0.drive - = G_gpio_config[0].drive; - G_gpe_apss_initialize_gpio_args.config0.interrupt - = G_gpio_config[0].interrupt; - G_gpe_apss_initialize_gpio_args.config1.direction - = G_gpio_config[1].direction; - G_gpe_apss_initialize_gpio_args.config1.drive = G_gpio_config[1].drive; - G_gpe_apss_initialize_gpio_args.config1.interrupt - = G_gpio_config[1].interrupt; - - // Create/schedule GPE_apss_initialize_gpio and wait for it to complete (BLOCKING) - TRAC_INFO("Creating request for GPE_apss_initialize_gpio"); - gpe_request_create(&request, // request - &G_async_gpe_queue0, // queue - (void*)GPE_apss_initialize_gpio, // GPE entry_point - (uint32_t)&G_gpe_apss_initialize_gpio_args,// GPE argument_ptr - SSX_SECONDS(5), // timeout - NULL, // callback - NULL, // callback arg - ASYNC_REQUEST_BLOCKING); // options - // Schedule the request to be executed - gpe_request_schedule(&request); - - // Check for a timeout, will create the error log later - // NOTE: As of 2013/07/16, simics will still fail here on a OCC reset - - if(ASYNC_REQUEST_STATE_TIMED_OUT == request.request.completion_state) - { - // For whatever reason, we hit a timeout. It could be either - // that the HW did not work, or the request didn't ever make - // it to the front of the queue. - // Let's log an error, and include the FFDC data if it was - // generated. - TRAC_ERR("Timeout communicating with PORE-GPE for APSS Init"); - } - - TRAC_INFO("GPE_apss_initialize_gpio completed w/rc=0x%08x\n", - request.request.completion_state); - - // Only continue if completed without errors... - if (ASYNC_REQUEST_STATE_COMPLETE == request.request.completion_state) - { - // Setup the composite mode structure to pass to the GPE program - G_gpe_apss_set_composite_mode_args.error.error = 0; - G_gpe_apss_set_composite_mode_args.error.ffdc = 0; - G_gpe_apss_set_composite_mode_args.config.numAdcChannelsToRead = - G_apss_composite_config.numAdcChannelsToRead; - G_gpe_apss_set_composite_mode_args.config.numGpioPortsToRead = - G_apss_composite_config.numGpioPortsToRead; - - // Create/schedule GPE_apss_set_composite_mode and wait for it to complete (BLOCKING) - TRAC_INFO("Creating request for GPE_apss_set_composite_mode"); - gpe_request_create(&request, // request - &G_async_gpe_queue0, // queue - (void*)GPE_apss_set_composite_mode, // GPE entry_point - (uint32_t)&G_gpe_apss_set_composite_mode_args,// GPE argument_ptr - SSX_SECONDS(5), // timeout - NULL, // callback - NULL, // callback arg - ASYNC_REQUEST_BLOCKING); // options - gpe_request_schedule(&request); - - // Check for a timeout, will create the error log later - if(ASYNC_REQUEST_STATE_TIMED_OUT == request.request.completion_state) - { - // For whatever reason, we hit a timeout. It could be either - // that the HW did not work, or the request didn't ever make - // it to the front of the queue. - // Let's log an error, and include the FFDC data if it was - // generated. - TRAC_ERR("Timeout communicating with PORE-GPE for APSS Init"); - } - - TRAC_INFO("GPE_apss_set_composite_mode completed w/rc=0x%08x", - request.request.completion_state); - - if (ASYNC_REQUEST_STATE_COMPLETE != request.request.completion_state) - { - /* - * @errortype - * @moduleid PSS_MID_APSS_INIT - * @reasoncode INTERNAL_FAILURE - * @userdata1 GPE returned rc code - * @userdata2 GPE returned abort code - * @userdata4 ERC_PSS_COMPOSITE_MODE_FAIL - * @devdesc Failure from GPE for setting composite mode on - * APSS - */ - l_err = createErrl(PSS_MID_APSS_INIT, // i_modId, - INTERNAL_FAILURE, // i_reasonCode, - ERC_PSS_COMPOSITE_MODE_FAIL, // extended reason code - ERRL_SEV_UNRECOVERABLE, // i_severity - NULL, // i_trace, - 0x0000, // i_traceSz, - request.request.completion_state, // i_userData1, - request.request.abort_state); // i_userData2 - addUsrDtlsToErrl(l_err, - (uint8_t*)&G_gpe_apss_set_composite_mode_args, - sizeof(G_gpe_apss_set_composite_mode_args), - ERRL_STRUCT_VERSION_1, - ERRL_USR_DTL_TRACE_DATA); - - // Returning an error log will cause us to go to safe - // state so we can report error to FSP - } - - - TRAC_INFO("apss_initialize: Creating request G_meas_start_request."); - //Create the request for measure start. Scheduling will happen in apss.c - gpe_request_create(&G_meas_start_request, - &G_async_gpe_queue0, // queue - IPC_ST_APSS_START_PWR_MEAS_READ_FUNCID, // entry_point - (uint32_t)&G_gpe_start_pwr_meas_read_args, // entry_point arg - SSX_WAIT_FOREVER, // no timeout - NULL, // callback - NULL, // callback arg - ASYNC_CALLBACK_IMMEDIATE); // options - - TRAC_INFO("apss_initialize: Creating request G_meas_cont_request."); - //Create the request for measure continue. Scheduling will happen in apss.c - gpe_request_create(&G_meas_cont_request, - &G_async_gpe_queue0, // request - IPC_ST_APSS_CONTINUE_PWR_MEAS_READ_FUNCID, // entry_point - (uint32_t)&G_gpe_continue_pwr_meas_read_args, // entry_point arg - SSX_WAIT_FOREVER, // no timeout - NULL, // callback - NULL, // callback arg - ASYNC_CALLBACK_IMMEDIATE); // options - - TRAC_INFO("apss_initialize: Creating request G_meas_complete_request."); - //Create the request for measure complete. Scheduling will happen in apss.c - gpe_request_create(&G_meas_complete_request, - &G_async_gpe_queue0, // queue - IPC_ST_APSS_COMPLETE_PWR_MEAS_READ_FUNCID, // entry_point - (uint32_t)&G_gpe_complete_pwr_meas_read_args, // entry_point arg - SSX_WAIT_FOREVER, // no timeout - (AsyncRequestCallback)reformat_meas_data, // callback, - (void*)NULL, // callback arg - ASYNC_CALLBACK_IMMEDIATE); // options - - } - else - { - /* - * @errortype - * @moduleid PSS_MID_APSS_INIT - * @reasoncode INTERNAL_FAILURE - * @userdata1 GPE returned rc code - * @userdata2 GPE returned abort code - * @userdata4 ERC_PSS_GPIO_INIT_FAIL - * @devdesc Failure from GPE for gpio initialization on APSS - */ - l_err = createErrl(PSS_MID_APSS_INIT, // i_modId, - INTERNAL_FAILURE, // i_reasonCode, - ERC_PSS_GPIO_INIT_FAIL, // extended reason code - ERRL_SEV_UNRECOVERABLE, // i_severity - NULL, // tracDesc_t i_trace, - 0x0000, // i_traceSz, - request.request.completion_state, // i_userData1, - request.request.abort_state); // i_userData2 - addUsrDtlsToErrl(l_err, - (uint8_t*)&G_gpe_apss_initialize_gpio_args, - sizeof(G_gpe_apss_initialize_gpio_args), - ERRL_STRUCT_VERSION_1, - ERRL_USR_DTL_TRACE_DATA); - - // Returning an error log will cause us to go to safe - // state so we can report error to FSP - } - - return l_err; -} - - -// Function Specification -// -// Name: apssInitApplet -// -// Description: Entry point function -// -// End Function Specification -errlHndl_t apssInitApplet(void * i_arg) -{ - errlHndl_t l_err = NULL; - - // Initialize APSS - l_err = apss_initialize(); - - if(NULL != l_err) - { - TRAC_ERR("APSS Init failed! (retrying) ErrLog[%p]", l_err); - setErrlSevToInfo(l_err); - // commit & delete - commitErrl(&l_err); - - // Retry one more time - l_err = apss_initialize(); - - if(NULL != l_err) - { - TRAC_ERR("APSS Init failed again! ErrLog[%p]",l_err); - } - } - - return l_err; -} - -/*****************************************************************************/ -// Image Header -/*****************************************************************************/ -IMAGE_HEADER(G_apss_initialize, apssInitApplet, APSS_INITIALIZE_ID, OCC_APLT_APSS_INIT); - diff --git a/src/occApplet/productApplet/linkProductApplet.cmd b/src/occApplet/productApplet/linkProductApplet.cmd deleted file mode 100755 index 934dfe2..0000000 --- a/src/occApplet/productApplet/linkProductApplet.cmd +++ /dev/null @@ -1,76 +0,0 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/occApplet/productApplet/linkProductApplet.cmd $ -// -// OpenPOWER OnChipController Project -// -// Contributors Listed Below - COPYRIGHT 2011,2014 -// [+] Google Inc. -// [+] International Business Machines Corp. -// -// 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 - -// This linker script for the product applet. - -#define APP_IMAGE_SRAM_START_ADDR 0xFFFF8000 -#define WORD_ALIGN 4 -#define BYTE_ALIGN 1024 -#ifdef OCCMK -INCLUDE occLinkInputFile -#endif - -MEMORY -{ - AppMem : ORIGIN = APP_IMAGE_SRAM_START_ADDR, LENGTH = 0x4000 -} - -SECTIONS -{ - . = APP_IMAGE_SRAM_START_ADDR; - - __START_ADDR__ = .; - - //////////////////////////////// - // start read-only section - //////////////////////////////// - imageHeader . : { *(imageHeader) } > AppMem - - //////////////////////////////// - // text section 1024 byte aligned - //////////////////////////////// - .text . : { *(.text) . = ALIGN(1024);} > AppMem - // NOTE: rodata section needs to be 1k aligned as it is used for setting - // mmu permission druing applet execution - .rodata . : { *(.rodata) *(.got2) *(.rodata.str1.4) *(.rodata.str1.1). = ALIGN(BYTE_ALIGN); } > AppMem - __READ_ONLY_DATA_LEN__ = . - APP_IMAGE_SRAM_START_ADDR ; - - //////////////////////////////// - // start writeable section - //////////////////////////////// - __WRITEABLE_DATA_ADDR__ = .; - - //////////////////////////////// - // read-write section 1024 byte aligned - //////////////////////////////// - .rela . : { *(.rela*) . = ALIGN(WORD_ALIGN);} > AppMem - // NOTE: rwdata section needs to be 1024 bytes aligned for setting mmu - // permission, so that applet total size is 1024 bytes aligned. - // It is needed for doing DMA copy of the applet. - .rwdata . : { *(.data) *(.bss) *(COMMON) . = ALIGN(BYTE_ALIGN);} > AppMem - - __WRITEABLE_DATA_LEN__ = . - __WRITEABLE_DATA_ADDR__; - -} diff --git a/src/occApplet/productApplet/occLinkInputFile b/src/occApplet/productApplet/occLinkInputFile deleted file mode 100644 index 50bf09c..0000000 --- a/src/occApplet/productApplet/occLinkInputFile +++ /dev/null @@ -1,25 +0,0 @@ -# IBM_PROLOG_BEGIN_TAG -# This is an automatically generated prolog. -# -# $Source: src/occApplet/productApplet/occLinkInputFile $ -# -# OpenPOWER OnChipController Project -# -# Contributors Listed Below - COPYRIGHT 2011,2014 -# [+] Google Inc. -# [+] International Business Machines Corp. -# -# 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 -INPUT ( cmdhDbugCmd.o ) diff --git a/src/occApplet/productApplet/productappletfiles.mk b/src/occApplet/productApplet/productappletfiles.mk deleted file mode 100755 index 9f88ff5..0000000 --- a/src/occApplet/productApplet/productappletfiles.mk +++ /dev/null @@ -1,31 +0,0 @@ -# IBM_PROLOG_BEGIN_TAG -# This is an automatically generated prolog. -# -# $Source: src/occApplet/productApplet/productappletfiles.mk $ -# -# OpenPOWER OnChipController Project -# -# Contributors Listed Below - COPYRIGHT 2011,2014 -# [+] Google Inc. -# [+] International Business Machines Corp. -# -# 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 - -C-SOURCES = apssInitApplet.c sensorQueryList.c cmdhDbugCmd.c -PRDTAPLT_OBJECTS = $(C-SOURCES:.c=.o) - -apssInitApplet_OFILES = apssInitApplet.o -sensorQueryList_OFILES = sensorQueryList.o -cmdhDbugCmd_OFILES = cmdhDbugCmd.o diff --git a/src/occ_405/Makefile b/src/occ_405/Makefile index 2d9da64..cfe7af0 100755 --- a/src/occ_405/Makefile +++ b/src/occ_405/Makefile @@ -45,19 +45,19 @@ LINK_OBJS = $(OBJS) $(SSXLIB) $(COMMONLIB) $(OCCLIB) $(PPC405LIB) LINK_SCRIPT = $(addprefix $(OBJDIR)/, linkscript) LINK_CMD_SCRIPT = linkocc.cmd LDFLAGS += --oformat=elf32-powerpc -melf32ppc -LIB_DIRS = -L$(OBJDIR)/ssx \ +LIB_DIRS = -L$(OBJDIR) \ + -L$(OBJDIR)/ssx \ -L$(OBJDIR)/ssx/ppc405 \ -L$(OBJDIR)/ssx/ppc32 \ -L$(OBJDIR)/commonlib \ -L$(OBJDIR)/occlib \ -L$(OBJDIR)/ppc405lib \ - -L$(OBJDIR) \ - -L$(OBJDIR)/aplt \ -L$(OBJDIR)/cmdh \ -L$(OBJDIR)/dcom \ -L$(OBJDIR)/errl \ -L$(OBJDIR)/pss \ -L$(OBJDIR)/rtls \ + -L$(OBJDIR)/sensor \ -L$(OBJDIR)/thread \ -L$(OBJDIR)/timer \ -L$(OBJDIR)/trac \ diff --git a/src/occ_405/amec/amec_amester.c b/src/occ_405/amec/amec_amester.c index c565912..cc672cd 100755 --- a/src/occ_405/amec/amec_amester.c +++ b/src/occ_405/amec/amec_amester.c @@ -23,9 +23,9 @@ /* */ /* IBM_PROLOG_END_TAG */ -//************************************************************************* +//*************************************************************************/ // Includes -//************************************************************************* +//*************************************************************************/ #include <occ_common.h> #include <ssx.h> #include <errl.h> // Error logging @@ -37,25 +37,24 @@ #include <amec_amester.h> #include <amec_sys.h> #include <trac.h> // For traces -#include <appletManager.h> -#include <sensorQueryList.h> +#include <sensor_query_list.h> #include <proc_data.h> #include <amec_parm.h> #include <string.h> #include <occ_sys_config.h> #include <dcom.h> -//************************************************************************* +//*************************************************************************/ // Externs -//************************************************************************* +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Macros -//************************************************************************* +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Defines/Enums -//************************************************************************* +//*************************************************************************/ ///Maximum size of trace buffer #define AMEC_TB_2MS_SIZE_BYTES 8192 @@ -69,13 +68,13 @@ #define AMEC_TB_CONFIG_SIZE (MAX_SENSOR_NAME_SZ + 4) #define MAX_NUM_CHIPS MAX_NUM_OCC -//************************************************************************* +//*************************************************************************/ // Structures -//************************************************************************* +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Globals -//************************************************************************* +//*************************************************************************/ // Each trace buffer should be aligned to 128 bytes in main memory because the // block copy engine only copies multiples of 128 byte units. @@ -127,13 +126,13 @@ UINT8 g_amec_tb_record=0; ///=1 signals continuous tracing UINT8 g_amec_tb_continuous=0; //CL273 -//************************************************************************* +//*************************************************************************/ // Function Prototypes -//************************************************************************* +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Functions -//************************************************************************* +//*************************************************************************/ // Function Specification // // Name: amester_get_sensor_info @@ -150,7 +149,6 @@ static uint8_t amester_get_sensor_info( uint8_t* o_resp, uint16_t* io_resp_lengt uint16_t l_numOfSensors = 1; sensor_info_t l_sensorInfo; errlHndl_t l_err = NULL; - OCC_APLT_STATUS_CODES l_status = 0; uint16_t l_resp_length = 0; do @@ -180,7 +178,7 @@ static uint8_t amester_get_sensor_info( uint8_t* o_resp, uint16_t* io_resp_lengt break; } - querySensorListAppletArg_t l_querySensorListAppletArg = { + querySensorListArg_t l_qsl_arg = { i_sensor, // i_startGsid 0, // i_present SENSOR_TYPE_ALL, // i_type @@ -190,19 +188,13 @@ static uint8_t amester_get_sensor_info( uint8_t* o_resp, uint16_t* io_resp_lengt &l_sensorInfo // o_sensorInfoPtr }; - - //Call sensor query list applet - runApplet(OCC_APLT_SNSR_QUERY, // Applet enum Name - &l_querySensorListAppletArg, // Applet arguments - TRUE, // Blocking call? - NULL, // Applet finished semaphore - &l_err, // Error log handle - &l_status); // Error status + // Get sensor list + l_err = querySensorList(&l_qsl_arg); if( NULL != l_err) { // Query failure, it should not happens - TRAC_ERR("Failed to run OCC_APLT_SNSR_QUERY applet. Error status is : 0x%x", l_status); + TRAC_ERR("amester_get_sensor_info: Failed to get sensor list. Error status is : 0x%x", l_err->iv_reasonCode); // commit error log commitErrl( &l_err ); diff --git a/src/occ_405/aplt/aplt_service_codes.h b/src/occ_405/aplt/aplt_service_codes.h deleted file mode 100755 index daa2273..0000000 --- a/src/occ_405/aplt/aplt_service_codes.h +++ /dev/null @@ -1,72 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/occ_405/aplt/aplt_service_codes.h $ */ -/* */ -/* OpenPOWER OnChipController Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2011,2015 */ -/* [+] International Business Machines Corp. */ -/* */ -/* */ -/* 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 */ - -#ifndef _APLT_SERVICE_CODES_H_ -#define _APLT_SERVICE_CODES_H_ - -//************************************************************************* -// Includes -//************************************************************************* -#include <comp_ids.h> -//************************************************************************* -// Externs -//************************************************************************* - -//************************************************************************* -// Macros -//************************************************************************* - -//************************************************************************* -// Defines/Enums -//************************************************************************* -enum apltModuleId -{ - APLT_MID_INIT_APPLET_MNGR = APLT_COMP_ID | 0x00, - APLT_MID_RUN_APPLET = APLT_COMP_ID | 0x01, - APLT_MID_START_APPLET = APLT_COMP_ID | 0x02, - APLT_MNGR_THREAD = APLT_COMP_ID | 0x03, - APLT_MID_INIT_APPLET_ADDR = APLT_COMP_ID | 0x04, - - TEST_APLT_MODID_ERRLTEST = APLT_COMP_ID | 0xF0, - TEST_APLT_MODID_SENSORTEST = APLT_COMP_ID | 0xF1, -}; - -//************************************************************************* -// Structures -//************************************************************************* - -//************************************************************************* -// Globals -//************************************************************************* - -//************************************************************************* -// Function Prototypes -//************************************************************************* - -//************************************************************************* -// Functions -//************************************************************************* - -#endif /* #ifndef _APLT_SERVICE_CODES_H_ */ diff --git a/src/occ_405/aplt/appletManager.c b/src/occ_405/aplt/appletManager.c deleted file mode 100755 index e0f57ee..0000000 --- a/src/occ_405/aplt/appletManager.c +++ /dev/null @@ -1,1357 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/occ/aplt/appletManager.c $ */ -/* */ -/* OpenPOWER OnChipController Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2011,2015 */ -/* [+] International Business Machines Corp. */ -/* */ -/* */ -/* 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 */ - -//*************************************************************************/ -// Includes -//*************************************************************************/ -#include "ssx.h" -#include <trac_interface.h> -#include <appletManager.h> -#include <aplt_service_codes.h> -#include <occ_service_codes.h> -#include <occ_common.h> -#include <comp_ids.h> -#include <thread.h> -#include <trac.h> -#include <errl.h> -#include <state.h> -#include "pba_firmware_registers.h" -#include "occhw_pba.h" -#include "occhw_async.h" -#if PPC405_MMU_SUPPORT -#include "ppc405_mmu.h" -#endif -#include "occhw.h" -#include "cmdh_fsp.h" - -//*************************************************************************/ -// Externs -//*************************************************************************/ - -//*************************************************************************/ -// Macros -//*************************************************************************/ - -//*************************************************************************/ -// Defines/Enums -//*************************************************************************/ -#define TEST_APPLET_ADDR (uint32_t)&_APPLET1_SECTION_BASE -#define PRDT_APPLET_ADDR (uint32_t)&_APPLET0_SECTION_BASE -#define TEST_APPLET_MAX_SIZE (uint32_t)&_APPLET1_SECTION_SIZE -#define PRDT_APPLET_MAX_SIZE (uint32_t)&_APPLET0_SECTION_SIZE -#define APPLET_IMG_SIZE_ALIGN 256 -#define APPLET_RO_SIZE_ALIGN 1024 -#define SRAM_START_ADDRESS 0xFFF80000 - -//************************************************************************* -// Structures -//************************************************************************* -typedef struct -{ - // Running Semaphore (tells user if there is an applet running) - SsxSemaphore Running; - // Wake up Semaphore (wakes up the applet manager thread) - SsxSemaphore Wakeup; - // Finished Semaphore (tells caller, if blocking, when applet is done) - SsxSemaphore Finished; -} ApltSem_t; - -// Applet information structure -// -// Added callerSem to hold caller semaphore parameter to the -// runApplet call. This semaphore will be used by startApplet to notify -// user of completion of the applet execution. -// Added status to get back error status from startApplet and -// return it to the caller for the blocking call. -struct ApltInfo -{ - void * param; - bool isBlocking; - OCC_APLT appId; - OCC_APLT previousAppId; - errlHndl_t errorHandle; - // Applet has readonly and writable sections - Ppc405MmuMap mmuMapWritePermission; - Ppc405MmuMap mmuMapReadPermission; - SsxSemaphore * callerSem; - OCC_APLT_STATUS_CODES status; -} __attribute__ ((__packed__)); - -typedef struct ApltInfo ApltInfo_t; - -//************************************************************************* -// Globals -//************************************************************************* -// Global semaphores for product and test applet -ApltSem_t G_ApltSemaphore; -ApltSem_t G_TestApltSemaphore; - -// Applet Id global array -ApltAddress_t G_ApltAddressTable[ OCC_APLT_LAST]; - -// Global product applet information with defaults -ApltInfo_t G_ApltInfo = -{ - .param = NULL, - .isBlocking = FALSE, - .appId = OCC_APLT_INVALID, - .previousAppId = OCC_APLT_INVALID, - .errorHandle = NULL, - .mmuMapWritePermission = 0, - .mmuMapReadPermission = 0, - .callerSem = NULL, - .status = OCC_APLT_SUCCESS -}; - -// Global test applet information with defaults -ApltInfo_t G_TestApltInfo = -{ - .param = NULL, - .isBlocking = FALSE, - .appId = OCC_APLT_INVALID, - .previousAppId = OCC_APLT_INVALID, - .errorHandle = NULL, - .mmuMapWritePermission = 0, - .mmuMapReadPermission = 0, - .callerSem = NULL, - .status = OCC_APLT_SUCCESS -}; - -//************************************************************************* -// Function Prototypes -//************************************************************************* -// Have to have this declaration here so the pre-processor handles the -// section attribute correctly. -errlHndl_t initAppletAddr( void ) INIT_SECTION; - -//************************************************************************* -// Functions -//************************************************************************* - -// Function Specification -// -// Name: initAppletAddr -// -// Description: initialize the Applet address by traversing through OCC signed -// image in main memory -// -// End Function Specification -// - -// NOTE: Optimization of O1 is needed for this function due to the l_bootLoaderHeader pointer -// pointing to a 0 address (which is considered NULL by the compiler) and thus with newer -// gcc compilers (4.9.0 and above), a new optimization flag issolate-erroneous-paths-dereference -// the compiler will set a trap in the code that will stop it from running. -// Setting the Optimization to 1 will disable this flag when compiling with gcc 4.9 and above. - -errlHndl_t __attribute__((optimize("O1"))) initAppletAddr( void ) -{ - errlHndl_t l_err = NULL; - // 1. Applets count = OCC_APLT_TEST - // 2. Start reading header addresses - // 3. Skip first 2 ( boot, main ) addresses - imageHdr_t *l_bootLoaderHeader = (void *) 0; - imageHdr_t *l_mainAppHeader = (void *)l_bootLoaderHeader + - l_bootLoaderHeader->image_size; - imageHdr_t *l_appHeader = (void *) l_mainAppHeader + - l_mainAppHeader->image_size; - - // 4. Save off each applet start address and size to global applet array - // 5. Verify before saving off info (save off only valid addresses) - uint32_t l_cnt = 0; - bool l_foundInvalid = FALSE; - - for (; l_cnt < OCC_APLT_TEST ; l_cnt++ ) - { - // Enable if debug is neeed: - // TRAC_INFO("%s: Validating applet %d; address: %p", __FUNCTION__, l_cnt, l_appHeader); - - // 5a. Value of l_appHeader should be reasonable. - // Means that image sizes should be non-zero. - // TODO: Check l_appHeader vs. max. sane memory address. - if( l_bootLoaderHeader->image_size == 0 ) - { - l_foundInvalid = TRUE; - TRAC_ERR("Bad image size in boot loader header. applet count: %d", l_cnt); - break; - } - else if( l_mainAppHeader->image_size == 0 ) - { - l_foundInvalid = TRUE; - TRAC_ERR("Bad image size in main app header. applet count: %d", l_cnt); - break; - } - - // 5b. sram_repair_reserved holds APLT_MAGIC_NUMBER - uint8_t l_magic_num[SRAM_REPAIR_RESERVE_SZ] = APLT_MAGIC_NUMBER; // Identifies this as a production applet - int i=0; - - for(; i < SRAM_REPAIR_RESERVE_SZ; i++) - { - if(l_appHeader->sram_repair_reserved[i] != l_magic_num[i]) - { - l_foundInvalid = TRUE; - break; - } - } - if(l_foundInvalid == TRUE) - { -#ifndef NO_TRAC_STRINGS - uint32_t l_srr_0 = CONVERT_UINT8_ARRAY_UINT32(l_appHeader->sram_repair_reserved[0], - l_appHeader->sram_repair_reserved[1], - l_appHeader->sram_repair_reserved[2], - l_appHeader->sram_repair_reserved[3]); - - uint32_t l_srr_1 = CONVERT_UINT8_ARRAY_UINT32(l_appHeader->sram_repair_reserved[4], - l_appHeader->sram_repair_reserved[5], - l_appHeader->sram_repair_reserved[6], - l_appHeader->sram_repair_reserved[7]); - - uint32_t l_srr_2 = CONVERT_UINT8_ARRAY_UINT32(l_appHeader->sram_repair_reserved[8], - l_appHeader->sram_repair_reserved[9], - l_appHeader->sram_repair_reserved[10], - l_appHeader->sram_repair_reserved[11]); - - uint32_t l_srr_3 = CONVERT_UINT8_ARRAY_UINT32(l_appHeader->sram_repair_reserved[12], - l_appHeader->sram_repair_reserved[13], - l_appHeader->sram_repair_reserved[14], - l_appHeader->sram_repair_reserved[15]); - - // TEMP -- SSX ONLY SUPPORTS MAX OF 5 PARAMS - //TRAC_ERR("wrong magic number. applet count: %d, header addr: %p, magic no: 0x%08x%08x%08x%08x", - // l_cnt, l_appHeader, l_srr_0, l_srr_1, l_srr_2, l_srr_3); -#endif - break; - } - - // 5c. verify that aplt_id < OCC_APLT_TEST - if( l_appHeader->aplt_id >= OCC_APLT_TEST ) - { - l_foundInvalid = TRUE; -// TEMP -- ERROR TRACING THE POINTER FOR SOME REASON -// TRAC_ERR("applet ID out of range. applet count: %d, header addr: %p, id: %d", -// l_cnt, l_appHeader, l_appHeader->aplt_id); - break; - } - - // 5d. 0 < image_size <= PRDT_APPLET_MAX_SIZE - if( (l_appHeader->image_size == 0) || (l_appHeader->image_size > PRDT_APPLET_MAX_SIZE) ) - { - l_foundInvalid = TRUE; -// TEMP --- TRACE ERRORS -// TRAC_ERR("bad image_size. applet count: %d, applet ID: 0x%02x, header addr: %p, image_size: %d, avail space: %d", -// l_cnt, l_appHeader->aplt_id, l_appHeader, l_appHeader->image_size, PRDT_APPLET_MAX_SIZE); - break; - } - - // 5e. image_size is APPLET_IMG_SIZE_ALIGN byte aligned - if( (l_appHeader->image_size % APPLET_IMG_SIZE_ALIGN) > 0 ) - { - l_foundInvalid = TRUE; - TRAC_ERR("image size not aligned. applet count: %d, applet ID: 0x%02x, header addr: %p, image_size: %d", - l_cnt, l_appHeader->aplt_id, l_appHeader, l_appHeader->image_size); - break; - } - - // 5f. readonly_size is APPLET_RO_SIZE_ALIGN byte aligned - if( (l_appHeader->readonly_size % APPLET_RO_SIZE_ALIGN) > 0 ) - { - l_foundInvalid = TRUE; - TRAC_ERR("readonly size not aligned. applet count: %d, applet ID: 0x%02x, header addr: %p, readonly_size: %d", - l_cnt, l_appHeader->aplt_id, l_appHeader, l_appHeader->readonly_size); - break; - } - - // Each applet is loaded at address PRDT_APPLET_ADDR, and executed on-demand. - - // 5g. start_addr == the applet load address in SRAM - if( l_appHeader->start_addr != PRDT_APPLET_ADDR ) - { - l_foundInvalid = TRUE; -// TEMP -- TRACE ERROR -// TRAC_ERR("bad start_addr. applet count: %d, applet ID: 0x%02x, header addr: %p, expected addr: 0x%08x, actual addr: 0x%08x", -// l_cnt, l_appHeader->aplt_id, l_appHeader, PRDT_APPLET_ADDR, l_appHeader->start_addr); - break; - } - - // 5h. ep_addr is between the header and the end of the applet image - uint32_t l_ep_addr_min = PRDT_APPLET_ADDR + sizeof(imageHdr_t); // Lowest entry point an applet can reference - uint32_t l_ep_addr_max = PRDT_APPLET_ADDR + l_appHeader->image_size; // Upper bound on applet entry point - - if( (l_appHeader->ep_addr < l_ep_addr_min) || (l_appHeader->ep_addr >= l_ep_addr_max) ) - { - l_foundInvalid = TRUE; -// TEMP -- TOO MANY ARGS FOR TRACE -// TRAC_ERR("entry point out of range. applet count: %d, applet ID: 0x%02x, header addr: %p, ep_addr: 0x%08x, ep_range: 0x%08x - 0x%08x", -// l_cnt, l_appHeader->aplt_id, l_appHeader, l_appHeader->ep_addr, l_ep_addr_min, l_ep_addr_max); - break; - } - - // 5i. we haven't already seen this applet before - // (note the '!' at the start of the test condition) - if( !((G_ApltAddressTable[l_appHeader->aplt_id].iv_aplt_address == 0x00000000) && - (G_ApltAddressTable[l_appHeader->aplt_id].iv_size == 0x00000000)) ) - { - // This entry in the global table is not in its initialized state. - l_foundInvalid = TRUE; - TRAC_ERR("Duplicate applet. applet count: %d, applet ID: 0x%02x, header addr: %p", - l_cnt, l_appHeader->aplt_id, l_appHeader); - break; - } - - // The gauntlet is run. This image is good. - - // Load the G_ApltAddressTable. - G_ApltAddressTable[l_appHeader->aplt_id].iv_aplt_address = (uint32_t)l_appHeader; - G_ApltAddressTable[l_appHeader->aplt_id].iv_size = l_appHeader->image_size; - - // Jump to the next applet. - l_appHeader = (void *) l_appHeader + l_appHeader->image_size; - - } // end for loop - - // did we find any problems? - if ( l_foundInvalid ) - { - // We will want to return the ID of the failing applet in our error log, - // if that ID exists. Otherwise, return the "invalid" ID. - uint16_t l_errApltId = OCC_APLT_INVALID; - - if( l_appHeader ) - { - l_errApltId = l_appHeader->aplt_id; - } - - /* - * @errortype - * @moduleid APLT_MID_INIT_APPLET_ADDR - * @reasoncode INTERNAL_FAILURE - * @userdata1 failing applet ID - * @userdata2 failing applet main store address - * @userdata4 ERC_APLT_INIT_FAILURE - * @devdesc Internal initialization failure in energy management - */ - l_err = createErrl(APLT_MID_INIT_APPLET_ADDR, //modId - INTERNAL_FAILURE, //reasoncode - ERC_APLT_INIT_FAILURE, //Extended reason code - ERRL_SEV_UNRECOVERABLE, //Severity - NULL, //Trace Buf - DEFAULT_TRACE_SIZE, //Trace Size - l_errApltId, //userdata1 - (uint32_t)l_appHeader); //userdata2 - - // Callout to firmware - addCalloutToErrl(l_err, - ERRL_CALLOUT_TYPE_COMPONENT_ID, - ERRL_COMPONENT_ID_FIRMWARE, - ERRL_CALLOUT_PRIORITY_HIGH); - } - else - { - // No problems with any production applets. - // 6. Save off the test applet start address and size to global applet array - G_ApltAddressTable[OCC_APLT_TEST].iv_aplt_address = (uint32_t)l_appHeader; - G_ApltAddressTable[OCC_APLT_TEST].iv_size = TEST_APPLET_MAX_SIZE; - } - - // copy SSX mmu map to ApltInfo structure - // startApplet() will use it to clear tlb entry -#if PPC405_MMU_SUPPORT - G_ApltInfo.mmuMapWritePermission = G_applet0_mmu_map; - G_TestApltInfo.mmuMapWritePermission = G_applet1_mmu_map; - - // Clear SSX mmu map. - // The original tlb indexes may point to different SRAM regions when OCC runs - // mmu map/unmap several times. - G_applet0_mmu_map = 0; - G_applet1_mmu_map = 0; -#endif - return l_err; -} - -// Function Specification -// -// Name: initAppletManager -// -// Description: initialize the Applet Manager, called by main -// -// End Function Specification -void initAppletManager( void ) -{ - errlHndl_t l_rc = NULL; - Ppc405MmuMap l_mmuMap; - bool l_mmuUnmap = FALSE; - do - { - // initialized all the semaphores applet manager controls - // create the Running Semaphore, starting at 1 with a max count of 1 - int l_ssxrc1 = ssx_semaphore_create(&G_ApltSemaphore.Running, 1, 1); - // create the Wake Up Semaphore, starting at 0 with a max count of 1 - int l_ssxrc2 = ssx_semaphore_create(&G_ApltSemaphore.Wakeup, 0, 1); - // create the Finished Semaphore, starting at 0 with a max count of 1 - int l_ssxrc3 = ssx_semaphore_create(&G_ApltSemaphore.Finished, 0, 1); - // create the Running Semaphore, starting at 1 with a max count of 1 - int l_ssxrc4 = ssx_semaphore_create(&G_TestApltSemaphore.Running, 1, 1); - // create the Wake Up Semaphore, starting at 0 with a max count of 1 - int l_ssxrc5 = ssx_semaphore_create(&G_TestApltSemaphore.Wakeup, 0, 1); - // create the Finished Semaphore, starting at 0 with a max count of 1 - int l_ssxrc6 = ssx_semaphore_create(&G_TestApltSemaphore.Finished, 0,1); - // check for any errors from initializing our semaphores - // NOTE: Applet Global Array list is left empty if semaphores - // are not initialized correctly - if (( l_ssxrc1 != SSX_OK ) || ( l_ssxrc2 != SSX_OK ) || - ( l_ssxrc3 != SSX_OK ) || ( l_ssxrc4 != SSX_OK ) || - ( l_ssxrc5 != SSX_OK ) || ( l_ssxrc6 != SSX_OK )) - { - TRAC_INFO("Running Semaphore SsxRc[0x%08X]", -l_ssxrc1 ); - TRAC_INFO("Wakeup Semaphore SsxRc[0x%08X]", -l_ssxrc2 ); - TRAC_INFO("Finished Semaphore SsxRc[0x%08X]", -l_ssxrc3 ); - TRAC_INFO("Running Test Semaphore SsxRc[0x%08X]", -l_ssxrc4); - TRAC_INFO("Wakeup Test Semaphore SsxRc[0x%08X]", -l_ssxrc5 ); - TRAC_INFO("Finished Test Semaphore SsxRc[0x%08X]", -l_ssxrc6 ); - - /* - * @errortype - * @moduleid APLT_MID_INIT_APPLET_MNGR - * @reasoncode SSX_GENERIC_FAILURE - * @userdata1 Create Running product aplt semaphore rc - * @userdata2 Create Finished product aplt semaphore rc - * @userdata4 ERC_CREATE_SEM_FAILURE - * @devdesc SSX semaphore related failure - */ - l_rc = createErrl(APLT_MID_INIT_APPLET_MNGR, //modId - SSX_GENERIC_FAILURE, //reasoncode - ERC_CREATE_SEM_FAILURE, //Extended reason code - ERRL_SEV_UNRECOVERABLE, //Severity - NULL, //Trace Buf - DEFAULT_TRACE_SIZE, //Trace Size - l_ssxrc1, //userdata1 - l_ssxrc3); //userdata2 - break; - } - - CHECKPOINT(APP_SEMS_CREATED); -#if PPC405_MMU_SUPPORT - // Map mainstore to oci space so that we can walk through - // OCC signed image to get applet addresses - int l_ssxRc = ppc405_mmu_map(0, //Mainstore address 0x0 - 0, //OCI address 0x0 - 1048576, //Max size = 1 Mb - 0, // TLB hi flags - 0, // TLB lo flags - &l_mmuMap);// map pointer - - if ( l_ssxRc != SSX_OK ) - { - TRAC_ERR("mmu map failure SsxRc[0x%08X]", -l_ssxRc ); - - /* - * @errortype - * @moduleid APLT_MID_INIT_APPLET_MNGR - * @reasoncode SSX_GENERIC_FAILURE - * @userdata1 MMU map return code - * @userdata4 ERC_MMU_MAP_FAILURE - * @devdesc Failure mapping OCI space - */ - l_rc = createErrl(APLT_MID_INIT_APPLET_MNGR, //modId - SSX_GENERIC_FAILURE, //reasoncode - ERC_MMU_MAP_FAILURE, //Extended reason code - ERRL_SEV_UNRECOVERABLE, //Severity - NULL, //Trace Buf - DEFAULT_TRACE_SIZE, //Trace Size - l_ssxRc, //userdata1 - 0); //userdata2 - break; - } -#endif /* PPC405_MMU_SUPPORT */ - CHECKPOINT(APP_MEM_MAPPED); - - // set to indicate to do mmu unmap after we are done using it. - l_mmuUnmap = TRUE; - - // Traverse through OCC signed image to get applet address - // TEMP: Not Ready, SIMICS code doesn't handle applet address initialization properly -// l_rc = initAppletAddr(); - - CHECKPOINT(APP_ADDR_INITIALIZED); - - if( NULL != l_rc) - { - TRAC_ERR("Failure initializing applet addresses"); - break; - } - - }while(FALSE); - - if( TRUE == l_mmuUnmap) - { - CHECKPOINT(APP_MEM_UNMAP); - -#if PPC405_MMU_SUPPORT - - // Unmap mmu mapping for main store to oci space. - // NOTE: This needs to be unmapped because 1) PowerBus disruptions - // could leave OCC hung for several uS if main memory accessed at - // some later point. 2) Any thing accessing address 0 should result - // in 405 exception so need to unmap it. - int l_ssxRc = ppc405_mmu_unmap(&l_mmuMap); - - if ( l_ssxRc != SSX_OK ) - { - TRAC_ERR("mmu unmap failure SsxRc[0x%08X]", -l_ssxRc ); - - /* - * @errortype - * @moduleid APLT_MID_INIT_APPLET_MNGR - * @reasoncode SSX_GENERIC_FAILURE - * @userdata1 MMU unmap return code - * @userdata4 ERC_MMU_UNMAP_FAILURE - * @devdesc Failure unmapping OCI space - */ - errlHndl_t l_err = createErrl(APLT_MID_INIT_APPLET_MNGR, //modId - SSX_GENERIC_FAILURE, //reasoncode - ERC_MMU_UNMAP_FAILURE, //Extended reason code - ERRL_SEV_UNRECOVERABLE, //Severity - NULL, //Trace Buf - DEFAULT_TRACE_SIZE, //Trace Size - l_ssxRc, //userdata1 - 0); //userdata2 - // If there were not previous errors, return this error to the - // caller. Otherwise, log this error and return previous error to - // the caller. - if( l_rc == NULL) - { - l_rc = l_err; - deleteErrl(&l_err); - } - else - { - commitErrl(&l_err); - } - } -#endif /* PPC405_MMU_SUPPORT */ - } - - if( NULL != l_rc ) - { - REQUEST_RESET(l_rc); - } - -} - - -// Function Specification -// -// Name: runApplet -// -// Description: run an Applet -// -// End Function Specification -void runApplet( OCC_APLT i_applet, - void * i_parms, - bool i_block, - SsxSemaphore *io_appletComplete, - errlHndl_t *o_errHndl, - OCC_APLT_STATUS_CODES *o_status ) -{ - uint32_t l_reasonCode = 0; - uint32_t l_extReasonCode = 0; - int l_ssxrc = 0; - bool l_postStartFailure = FALSE; - - // Depending on applet id use product or test applet globals - ApltSem_t * l_sem = - (i_applet == OCC_APLT_TEST? &G_TestApltSemaphore : &G_ApltSemaphore); - ApltInfo_t * l_info = - (i_applet == OCC_APLT_TEST? &G_TestApltInfo : &G_ApltInfo); - - //Block other runApplet caller until this request is complete - l_ssxrc = ssx_semaphore_pend(&l_sem->Running, SSX_WAIT_FOREVER); - - if ( l_ssxrc != SSX_OK ) - { - /* - * @errortype - * @moduleid APLT_MID_RUN_APPLET - * @reasoncode SSX_GENERIC_FAILURE - * @userdata1 Failing applet ID - * @userdata2 Caller parameter to determine block or not. - * @userdata4 ERC_RUNNING_SEM_PENDING_FAILURE - * @devdesc SSX semaphore related failure - */ - TRAC_ERR("Running Semaphore Pending Failure on blocking caller: SsxRc[0x%08X]", -l_ssxrc ); - l_reasonCode = SSX_GENERIC_FAILURE; - l_extReasonCode = ERC_RUNNING_SEM_PENDING_FAILURE; - l_info->status = OCC_APLT_PRE_START_FAILURE; - } - else - { - // First save off all the Globals - - // Save off the current Applet user wants to run - l_info->appId = i_applet; - - // Save off whether or not we are blocking on this applet execution - l_info->isBlocking = i_block; - - // save off pointer to parameters - l_info->param = i_parms; - - // Point callerSem to the caller passed in semaphore - l_info->callerSem = io_appletComplete; - - // clean out the handle - l_info->errorHandle = NULL; - - l_info->status = OCC_APLT_SUCCESS; - - // This happens too often, we cannot trace it - // TRAC_INFO("Waking up the Applet Manager Thread" ); - - // Post wakeup semaphore so that applet manager can start - // applet - l_ssxrc = ssx_semaphore_post( &l_sem->Wakeup ); - if ( l_ssxrc != SSX_OK ) - { - /* - * @errortype - * @moduleid APLT_MID_RUN_APPLET - * @reasoncode SSX_GENERIC_FAILURE - * @userdata1 Failing applet ID - * @userdata2 Caller parameter to determine block or not. - * @userdata4 ERC_WAKEUP_SEM_POSTING_FAILURE - * @devdesc SSX semaphore related failure - */ - TRAC_ERR("Wakeup Semaphore Post Failure: SsxRc[0x%08X]", -l_ssxrc ); - l_reasonCode = SSX_GENERIC_FAILURE; - l_extReasonCode = ERC_WAKEUP_SEM_POSTING_FAILURE; - - //post on Running Semaphore so that user can retry - l_ssxrc = ssx_semaphore_post( &l_sem->Running ); - if ( l_ssxrc != SSX_OK ) - { - /* - * @errortype - * @moduleid APLT_MID_RUN_APPLET - * @reasoncode SSX_GENERIC_FAILURE - * @userdata1 Failing applet ID - * @userdata2 Caller parameter to determine block or not. - * @userdata4 ERC_RUNNING_SEM_POSTING_FAILURE - * @devdesc SSX semaphore related failure - */ - TRAC_ERR("Error posting the Applet running semaphore rc=[%08X]",l_ssxrc); - l_reasonCode = SSX_GENERIC_FAILURE; - l_extReasonCode = ERC_RUNNING_SEM_POSTING_FAILURE; - } - // set rc to failed to start - l_info->status = OCC_APLT_PRE_START_FAILURE; - } - // is caller expecting us to block then wait for finished semaphore - // to be posted. Finished semaphore is posted after applet execution - // is done. - else if ( i_block ) - { - l_ssxrc = ssx_semaphore_pend(&l_sem->Finished, SSX_WAIT_FOREVER); - if ( l_ssxrc != SSX_OK ) - { - /* - * @errortype - * @moduleid APLT_MID_RUN_APPLET - * @reasoncode SSX_GENERIC_FAILURE - * @userdata1 Failing applet ID - * @userdata2 Caller parameter to determine block or not. - * @userdata4 ERC_FINISHED_SEM_PENDING_FAILURE - * @devdesc SSX semaphore related failure - */ - TRAC_ERR("Finished Semaphore Pending Failure: SsxRc[0x%08X]", -l_ssxrc ); - l_reasonCode = SSX_GENERIC_FAILURE; - l_extReasonCode = ERC_FINISHED_SEM_PENDING_FAILURE; - // set flag to return post start failure status - l_postStartFailure = TRUE; - } - } - } - - if ( (l_reasonCode != 0) && (o_errHndl != NULL)) - { - // TODO use correct trace - tracDesc_t l_trace = NULL; - // Error from runApplet - *o_errHndl = createErrl(APLT_MID_RUN_APPLET, //modId - l_reasonCode, //reasoncode - l_extReasonCode, //Extended reason code - ERRL_SEV_UNRECOVERABLE, //Severity - l_trace, //Trace Buf - DEFAULT_TRACE_SIZE, //Trace Size - i_applet, //userdata1 - i_block); //userdata2 - - // Callout firmware - addCalloutToErrl(*o_errHndl, - ERRL_CALLOUT_TYPE_COMPONENT_ID, - ERRL_COMPONENT_ID_FIRMWARE, - ERRL_CALLOUT_PRIORITY_HIGH); - - } - else if ( (l_info->errorHandle) && (o_errHndl != NULL)) - { - // Error handle from start applet - *o_errHndl = l_info->errorHandle; - } - - // set the status if requested by caller. - if( o_status != NULL ) - { - if(l_postStartFailure == TRUE ) - { - *o_status = OCC_APLT_POST_START_FAILURE; - } - else - { - // Return status to the caller - *o_status = l_info->status; - } - } - - //Running, Finished/user passed in semaphore is posted by start applet -}; - - -// Function Specification -// -// Name: startApplet -// -// Description: Start Applet -// -// End Function Specification -void startApplet( const OCC_APLT_TYPE i_isTestAplt ) -{ - errlHndl_t l_rc = NULL; - int l_ssxrc = 0; - uint32_t l_reasonCode = 0; - uint32_t l_extReasonCode = 0; - // Depending on i_isTestAplt use product or test applet globals - ApltInfo_t * l_info = - (i_isTestAplt == TRUE ? &G_TestApltInfo : &G_ApltInfo); - ApltSem_t * l_sem = - (i_isTestAplt == TRUE ? &G_TestApltSemaphore : &G_ApltSemaphore); - - OCC_APLT_STATUS_CODES l_status = OCC_APLT_SUCCESS; - - // Get default applet section size for mmu - size_t l_applet_section_size = - (i_isTestAplt == TRUE ? (size_t)&_APPLET1_SECTION_SIZE : (size_t)&_APPLET0_SECTION_SIZE); - - // For storing applet readonly size, this value is located in applet header in SRAM. - // The value should be stored in another place before unmapping the applet memory region. - size_t l_applet_readonly_size = 0; - - // 1. set tlb protection to write to SRAM: - // currently already writable - - do - { - // Get SRAM applet address depending on the applet type - uint32_t l_apltSramAddress = - (i_isTestAplt == TRUE? TEST_APPLET_ADDR: PRDT_APPLET_ADDR); - - // Set header to point to SRAM address - imageHdr_t * l_apltHeader = (void *) l_apltSramAddress; - imageHdr_t *l_mainAppHeader = (void *) SRAM_START_ADDRESS; - - // This happens too often, we cannot trace it - //TRAC_INFO("Attempting to run applet at address [0x%08X], size: 0x%x", - // G_ApltAddressTable[l_info->appId].iv_aplt_address, - // G_ApltAddressTable[l_info->appId].iv_size); - - // check that we are not calling what is already saved off - // re-load the test applet every time since they all use the same applet ID. - if ( (l_info->appId == OCC_APLT_TEST) || (l_info->appId != l_info->previousAppId) ) - { - -#if PPC405_MMU_SUPPORT - - // 1a. check applet read-only/executable permissions, unmap it if existed. - // whole applet memory region in SRAM should be free first, then set it to - // writable for copyimage and calculate checksum. - if ( l_info->mmuMapReadPermission != 0 ) - { - l_ssxrc = ppc405_mmu_unmap(&l_info->mmuMapReadPermission); - - if(l_ssxrc) - { - TRAC_ERR("Error unmapping/changing permissions on applet text/data section rc=[%08X]", -l_ssxrc); - - /* - * @errortype - * @moduleid APLT_MID_START_APPLET - * @reasoncode SSX_GENERIC_FAILURE - * @userdata1 Applet start status - * @userdata4 ERC_MMU_UNMAP_APPLET_READ_FAILURE - * @devdesc Failure unmapping applet read-only/executable permissions - */ - l_reasonCode = SSX_GENERIC_FAILURE; - l_extReasonCode = ERC_MMU_UNMAP_APPLET_READ_FAILURE; - - // bail out - break; - } - } - - // 1b. check applet writable section permissions, unmap it if existed - // whole applet memory region in SRAM should be free first, then set it to - // writable for copyimage and calculate checksum. - if ( l_info->mmuMapWritePermission != 0 ) - { - l_ssxrc = ppc405_mmu_unmap(&l_info->mmuMapWritePermission); - - if(l_ssxrc) - { - TRAC_ERR("Error unmapping/changing permissions on applet text/data section rc=[%08X]", -l_ssxrc); - - /* - * @errortype - * @moduleid APLT_MID_START_APPLET - * @reasoncode SSX_GENERIC_FAILURE - * @userdata1 Applet start status - * @userdata4 ERC_MMU_UNMAP_APPLET_WRITE_FAILURE - * @devdesc Failure unmapping applet rwdata section permissions - */ - l_reasonCode = SSX_GENERIC_FAILURE; - l_extReasonCode = ERC_MMU_UNMAP_APPLET_WRITE_FAILURE; - - // bail out - break; - } - } - - //1c. set SRAM applet region to writable for copying image and calculating checksum - - l_ssxrc = ppc405_mmu_map( - l_apltSramAddress, // - l_apltSramAddress, // - l_applet_section_size, // set whole applet including writable section - 0, // - TLBLO_WR, - &l_info->mmuMapWritePermission - ); - if(l_ssxrc != SSX_OK) - { - TRAC_ERR("Error mapping SRAM with execute permissions rc=[%08X]",l_ssxrc); - - /* - * @errortype - * @moduleid APLT_MID_START_APPLET - * @reasoncode SSX_GENERIC_FAILURE - * @userdata1 Applet start status - * @userdata4 ERC_MMU_MAP_APPLET_OVERWRITE_FAILURE - * @devdesc Failure mapping applet memory region permissions - */ - l_reasonCode = SSX_GENERIC_FAILURE; - l_extReasonCode = ERC_MMU_MAP_APPLET_OVERWRITE_FAILURE; - break; - } - -#endif /* PPC405_MMU_SUPPORT */ - - // 2. read applet header info - // 3. copy applet image to SRAM using DMA - - BceRequest pba_copy; - l_ssxrc = bce_request_create(&pba_copy, // block copy object - &G_pba_bcde_queue, // mainstore to sram copy engine - G_ApltAddressTable[l_info->appId].iv_aplt_address, // mainstore applet address - l_apltSramAddress, // sram applet starting address - G_ApltAddressTable[l_info->appId].iv_size, // size of applet - SSX_WAIT_FOREVER, // no timeout - 0, // no call back - 0, // no call back arguments - ASYNC_REQUEST_BLOCKING); // blocking request - - if(l_ssxrc != SSX_OK) - { - TRAC_ERR("PBA request create failure rc=[%08X]",l_ssxrc); - - /* - * @errortype - * @moduleid APLT_MID_START_APPLET - * @reasoncode SSX_GENERIC_FAILURE - * @userdata1 Applet start status - * @userdata4 ERC_BCE_REQUEST_CREATE_FAILURE - * @devdesc SSX BCE related failure - */ - l_reasonCode = SSX_GENERIC_FAILURE; - l_extReasonCode = ERC_BCE_REQUEST_CREATE_FAILURE; - break; - } - - // actual copying - l_ssxrc = bce_request_schedule(&pba_copy); - - if(l_ssxrc != SSX_OK) - { - TRAC_ERR("PBA request schedule failure rc=[%08X]",l_ssxrc); - - /* - * @errortype - * @moduleid APLT_MID_START_APPLET - * @reasoncode SSX_GENERIC_FAILURE - * @userdata1 Applet start status - * @userdata4 ERC_BCE_REQUEST_SCHEDULE_FAILURE - * @devdesc Failure to copy applet image using DMA - */ - l_reasonCode = SSX_GENERIC_FAILURE; - l_extReasonCode = ERC_BCE_REQUEST_SCHEDULE_FAILURE; - break; - } - - // -------------------------------------------------- - // Verify the applet version matches the main version - // -------------------------------------------------- - if(l_mainAppHeader->version != l_apltHeader->version) - { - TRAC_ERR("Applet not loaded b/c of version mismatch Main[%08x]:Applet[%08x]", - l_mainAppHeader->version, l_apltHeader->version); - /* - * @errortype - * @moduleid APLT_MID_START_APPLET - * @reasoncode INTERNAL_FAILURE - * @userdata1 Applet start status - * @userdata4 ERC_APLT_START_VERSION_MISMATCH - * @devdesc Internal failure in energy management - */ - l_reasonCode = INTERNAL_FAILURE; - l_extReasonCode = ERC_APLT_START_VERSION_MISMATCH; - break; - - } - - // 3b. invalidate the data cache - // ie: clean up data cache in case stuff is left - // from previous applet - dcache_invalidate((void *) l_apltHeader, l_applet_section_size); - - // 4. Verify checksum of applet - uint32_t l_counter = 0; - uint8_t * l_srcPtr = (uint8_t *) (l_apltHeader); - uint32_t l_checksum = 0; - uint32_t l_headerChecksum = l_apltHeader->checksum; - - while (l_counter < l_apltHeader->image_size ) - { - l_checksum += (*(l_srcPtr + l_counter)); - l_counter = l_counter + 1; - if( l_counter == (uint32_t)(offsetof(imageHdr_t,checksum))) - { - l_counter = ((uint32_t)(offsetof(imageHdr_t,checksum)) + - sizeof(l_apltHeader->checksum)); - } - }//end while loop - - if ( l_checksum != l_headerChecksum ) - { - //error - TRAC_ERR("Checksum verification failure header chksum=[%08X] calculated chksum =[%08X] ", - l_headerChecksum, l_checksum); - - /* - * @errortype - * @moduleid APLT_MID_START_APPLET - * @reasoncode INTERNAL_FAILURE - * @userdata1 Applet start status - * @userdata4 ERC_APLT_START_CHECKSUM_MISMATCH - * @devdesc Internal failure in energy management - */ - l_reasonCode = INTERNAL_FAILURE; - l_extReasonCode = ERC_APLT_START_CHECKSUM_MISMATCH; - break; - } - - // 5. flush complete I cache - // ie: ensure execution of current applet is clean - icache_invalidate_all(); - - - // 5a. flush part of data cache - // ie: clean up data cache in case stuff is left - // from previous applet - // TODO: need to ensure this will work correctly on HW - // may require tweaking, based on results - dcache_invalidate((void *)l_apltHeader->zero_data_addr, - l_apltHeader->zero_data_size ); - - // size of readonly section is located in applet memory section - // get it for next step to protect text and data section - l_applet_readonly_size = l_apltHeader->readonly_size; - -#if PPC405_MMU_SUPPORT - - // 5b. unmap (remove permissions) on SRAM applet after copying applet image. - // permissions should be set correctly in SRAM rodata/rwdata section in next step. - if ( l_info->mmuMapWritePermission != 0 ) - { - l_ssxrc = ppc405_mmu_unmap(&(l_info->mmuMapWritePermission)); - - if(l_ssxrc) - { - TRAC_ERR("Error unmapping/changing permissions on SRAM applet section rc=[%08X]", -l_ssxrc); - - /* - * @errortype - * @moduleid APLT_MID_START_APPLET - * @reasoncode SSX_GENERIC_FAILURE - * @userdata1 Applet start status - * @userdata4 ERC_MMU_UNMAP_APPLET_OVERWRITE_FAILURE - * @devdesc Failure unmapping applet memory region permissions - */ - l_reasonCode = SSX_GENERIC_FAILURE; - l_extReasonCode = ERC_MMU_UNMAP_APPLET_OVERWRITE_FAILURE; - - // bail out - break; - } - } - - // 6 mapping mmu tlb permission (read-only section and writable section) - // 6a. protect applet text in SRAM (tlbie) - l_ssxrc = ppc405_mmu_map( - l_apltSramAddress, - l_apltSramAddress, - l_applet_readonly_size, // protect the text and data section - 0, - TLBLO_EX, - &(l_info->mmuMapReadPermission) - ); - if(l_ssxrc != SSX_OK) - { - TRAC_ERR("Error mapping SRAM with execute permissions rc=[%08X]",l_ssxrc); - - /* - * @errortype - * @moduleid APLT_MID_START_APPLET - * @reasoncode SSX_GENERIC_FAILURE - * @userdata1 Applet start status - * @userdata4 ERC_MMU_MAP_APPLET_READ_FAILURE - * @devdesc Failure mapping applet read-only/executable permissions - */ - l_reasonCode = SSX_GENERIC_FAILURE; - l_extReasonCode = ERC_MMU_MAP_APPLET_READ_FAILURE; - break; - } - - // 6b. map applet rwdata section in SRAM as writable (tlbie) - if(0 != l_apltHeader->boot_writeable_size) - { - l_ssxrc = ppc405_mmu_map( - l_apltHeader->boot_writeable_addr, - l_apltHeader->boot_writeable_addr, - l_apltHeader->boot_writeable_size, - 0, - TLBLO_WR, // set rwdata section to write permission - &(l_info->mmuMapWritePermission) - ); - if(l_ssxrc != SSX_OK) - { - TRAC_ERR("Error mapping SRAM with execute permissions rc=[%08X]",l_ssxrc); - - /* - * @errortype - * @moduleid APLT_MID_START_APPLET - * @reasoncode SSX_GENERIC_FAILURE - * @userdata1 Applet start status - * @userdata4 ERC_MMU_MAP_APPLET_WRITE_FAILURE - * @devdesc Failure mapping applet rwdata section permissions - */ - l_reasonCode = SSX_GENERIC_FAILURE; - l_extReasonCode = ERC_MMU_MAP_APPLET_WRITE_FAILURE; - break; - } - } - -#endif /* PPC405_MMU_SUPPORT */ - - // save off current applet being run (already copied) into previous - // ie: cache applet id - // NOTE: This is done here, to ensure the full set up is always completed - // before saving off the current applet id into previous applet id var - l_info->previousAppId = l_info->appId; - - }//end if - - // 7. Copy entry point address from applet header - // and start executing from that address - errlHndl_t (*execute_app)(void *) =(void *) l_apltHeader->ep_addr; - errlHndl_t l_applog = (*execute_app)(l_info->param); - // check if applet return an error log - if ( l_applog ) - { - TRAC_ERR("Error found from applet function see error @%p",l_applog); - - if ( l_info->isBlocking ) - { - // if applet caller wanted us to block - // save off the error and status - l_info->errorHandle = l_applog; - l_info->status = OCC_APLT_EXECUTE_FAILURE; - } - else - { - // non blocker, so commit the error - commitErrl(&l_applog); - } - } - - }while(0); // end of do while loop - - // All the error at this point setting reason code is before executing - // applet so set the status to pre start failure. - if( l_reasonCode != 0) - { - l_status = OCC_APLT_PRE_START_FAILURE; - // TODO use correct trace - tracDesc_t l_trace = NULL; - - l_rc = createErrl(APLT_MID_START_APPLET, //modId - l_reasonCode, //reasoncode - l_extReasonCode, //Extended reason code - ERRL_SEV_UNRECOVERABLE, //Severity - l_trace, //Trace Buf - DEFAULT_TRACE_SIZE, //Trace Size - l_status, //userdata1 - 0); //userdata2 - - // Callout to firmware - addCalloutToErrl(l_rc, - ERRL_CALLOUT_TYPE_COMPONENT_ID, - ERRL_COMPONENT_ID_FIRMWARE, - ERRL_CALLOUT_PRIORITY_HIGH); - - if ((l_info->isBlocking ) && (l_info->errorHandle == NULL)) - { - // Return error to caller for blocking call and - // there is no error executing applet - l_info->errorHandle = l_rc; - l_rc = NULL; - } - else - { - // commit log for the non-blocking call OR there is - // error executing applet - commitErrl(&l_rc); - } - } - - if( (l_info->isBlocking) && (l_info->status == OCC_APLT_SUCCESS)) - { - // Get status only if call is blocking AND no error executing applet - l_info->status = l_status; - } - // Moved posting of semaphores outside of while loop so that - // in the error paths semaphores gets posted and not blocked forever. - // 8. post on Finished Semaphore if caller wanted us to block them - if ( l_info->isBlocking ) - { - l_ssxrc = ssx_semaphore_post( &l_sem->Finished ); - - if ( l_ssxrc != SSX_OK ) - { - /* - * @errortype - * @moduleid APLT_MID_START_APPLET - * @reasoncode SSX_GENERIC_FAILURE - * @userdata4 ERC_FINISHED_SEM_POSTING_FAILURE - * @devdesc SSX semaphore related failure - */ - TRAC_ERR("Error posting the Applet finished semaphore rc=[%08X]",l_ssxrc); - l_reasonCode = SSX_GENERIC_FAILURE; - l_extReasonCode = ERC_FINISHED_SEM_POSTING_FAILURE; - } - } - // If caller passed in semaphore post it as caller might be blocked on - // this semaphore. - else if( l_info->callerSem != NULL) - { - l_ssxrc = ssx_semaphore_post( l_info->callerSem); - - if ( l_ssxrc != SSX_OK ) - { - /* - * @errortype - * @moduleid APLT_MID_START_APPLET - * @reasoncode SSX_GENERIC_FAILURE - * @userdata4 ERC_CALLER_SEM_POSTING_FAILURE - * @devdesc SSX semaphore related failure - */ - TRAC_ERR("Error posting the Applet complete semaphore rc=[%08X]",l_ssxrc); - l_reasonCode = SSX_GENERIC_FAILURE; - l_extReasonCode = ERC_CALLER_SEM_POSTING_FAILURE; - } - } - - // 8a. post on Running Semaphore - l_ssxrc = ssx_semaphore_post( &l_sem->Running ); - if ( l_ssxrc != SSX_OK ) - { - /* - * @errortype - * @moduleid APLT_MID_START_APPLET - * @reasoncode SSX_GENERIC_FAILURE - * @userdata4 ERC_RUNNING_SEM_POSTING_FAILURE - * @devdesc SSX semaphore related failure - */ - TRAC_ERR("Error posting the Applet running semaphore rc=[%08X]",l_ssxrc); - l_reasonCode = SSX_GENERIC_FAILURE; - l_extReasonCode = ERC_RUNNING_SEM_POSTING_FAILURE; - } - - if( l_reasonCode != 0) - { - // TODO use correct trace - tracDesc_t l_trace = NULL; - - l_rc = createErrl(APLT_MID_START_APPLET, //modId - l_reasonCode, //reasoncode - l_extReasonCode, //Extended reason code - ERRL_SEV_UNRECOVERABLE, //Severity - l_trace, //Trace Buf - DEFAULT_TRACE_SIZE, //Trace Size - 0, //userdata1 - 0); //userdata2 - - // Callout to firmware - addCalloutToErrl(l_rc, - ERRL_CALLOUT_TYPE_COMPONENT_ID, - ERRL_COMPONENT_ID_FIRMWARE, - ERRL_CALLOUT_PRIORITY_HIGH); - - // Error posting semaphores so commit it. - commitErrl(&l_rc); - } -} - - -// Function Specification -// -// Name: App_thread_routine -// -// Description: Applet Thread -// -// End Function Specification -void App_thread_routine(void *i_arg) -{ - // This happens too often, we cannot trace it - //TRAC_INFO("Started ..."); - - errlHndl_t l_errl = NULL; - OCC_APLT_TYPE l_type = APLT_TYPE_INVALID; - // TODO use correct trace - tracDesc_t l_trace = NULL; - - if( i_arg == NULL) - { - TRAC_ERR("Invalid parameter"); - /* - * @errortype - * @moduleid APLT_MNGR_THREAD - * @reasoncode INTERNAL_FAILURE - * @userdata1 APLT_TYPE_INVALID - * @userdata4 ERC_INVALID_INPUT_DATA - * @devdesc Internal failure in energy management - */ - l_errl = createErrl(APLT_MNGR_THREAD, //modId - INTERNAL_FAILURE, //reasoncode - ERC_INVALID_INPUT_DATA, //Extended reason code - ERRL_SEV_UNRECOVERABLE, //Severity - l_trace, //Trace Buf - DEFAULT_TRACE_SIZE, //Trace Size - l_type, //userdata1 - 0); //userdata2 - - // Callout to firmware - addCalloutToErrl(l_errl, - ERRL_CALLOUT_TYPE_COMPONENT_ID, - ERRL_COMPONENT_ID_FIRMWARE, - ERRL_CALLOUT_PRIORITY_HIGH); - // commit log - commitErrl( &l_errl ); - //TODO: should we reset OCC? - } - else - { - l_type = *((OCC_APLT_TYPE*)i_arg); - - while( 1 ) - { - // This happens too often, we cannot trace it - //TRAC_INFO("ApltType: [0x%x] Waiting ...", l_type); - - int l_ssxrc = SSX_OK; - - if( APLT_TYPE_PRODUCT == l_type) - { - l_ssxrc = ssx_semaphore_pend(&G_ApltSemaphore.Wakeup, - SSX_WAIT_FOREVER); - } - else - { - l_ssxrc = ssx_semaphore_pend(&G_TestApltSemaphore.Wakeup, - SSX_WAIT_FOREVER); - - } - - if ( l_ssxrc != SSX_OK ) - { - TRAC_ERR("WakeUp Semaphore Failure SsxRc[0x%08X]", -l_ssxrc ); - - /* - * @errortype - * @moduleid APLT_MNGR_THREAD - * @reasoncode SSX_GENERIC_FAILURE - * @userdata1 Semaphore pend return code - * @userdata2 Applet type input from caller - * @userdata4 ERC_WAKEUP_SEM_PENDING_FAILURE - * @devdesc SSX semaphore related failure - */ - l_errl = createErrl(APLT_MNGR_THREAD, //modId - SSX_GENERIC_FAILURE, //reasoncode - ERC_WAKEUP_SEM_PENDING_FAILURE, //Extended reason code - ERRL_SEV_UNRECOVERABLE, //Severity - l_trace, //Trace Buf - DEFAULT_TRACE_SIZE, //Trace Size - -l_ssxrc, //userdata1 - l_type); //userdata2 - - // commit log - REQUEST_RESET(l_errl); - break; - } - - startApplet(l_type); - - } // end while loop - } - - TRAC_IMP("Applet Thread Routine [%d] Ended Unexpectedly.", l_type); -} diff --git a/src/occ_405/aplt/appletManager.h b/src/occ_405/aplt/appletManager.h deleted file mode 100755 index 4d42602..0000000 --- a/src/occ_405/aplt/appletManager.h +++ /dev/null @@ -1,107 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/occ_405/aplt/appletManager.h $ */ -/* */ -/* OpenPOWER OnChipController Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2011,2015 */ -/* [+] International Business Machines Corp. */ -/* */ -/* */ -/* 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 */ - -#ifndef _appletManager_H -#define _appletManager_H - -//************************************************************************* -// Includes -//************************************************************************* -#include <occ_common.h> -#include "errl.h" -#include <appletId.h> - -//************************************************************************* -// Externs -//************************************************************************* - -//************************************************************************* -// Macros -//************************************************************************* - -//************************************************************************* -// Defines/Enums -//************************************************************************* -// These are the status codes that the applet manager code may return. -typedef enum -{ - OCC_APLT_SUCCESS = 0x00, - OCC_APLT_PRE_START_FAILURE = 0x01, - OCC_APLT_POST_START_FAILURE = 0x02, - OCC_APLT_EXECUTE_FAILURE = 0x03, - -} OCC_APLT_STATUS_CODES; - -// Applet types -typedef enum -{ - APLT_TYPE_PRODUCT = 0x00, - APLT_TYPE_TEST = 0x01, - APLT_TYPE_INVALID = 0xFF -}OCC_APLT_TYPE; - -//************************************************************************* -// Structures -//************************************************************************* -// Applet address/size structure -typedef struct -{ - uint32_t iv_aplt_address; - uint32_t iv_size; - -} ApltAddress_t; - -//************************************************************************* -// Globals -//************************************************************************* -// Currently NOT externalized, only used in appletManager.c - -// Used as a way to pass in parameters to each applet -// Applet Manager will copy arguments passed in into this -// global and pass them to applet -//extern void * G_ApltParms; - -extern ApltAddress_t G_ApltAddressTable[ OCC_APLT_LAST ]; - -//************************************************************************* -// Function Prototypes -//************************************************************************* -/* run an applet */ -void runApplet( - const OCC_APLT i_applet, - void * i_parms, - const bool i_block, - SsxSemaphore *io_appletComplete, - errlHndl_t *o_errHndl, - OCC_APLT_STATUS_CODES * o_status); - -/* initialize the applet manager */ -void initAppletManager( void ) INIT_SECTION; - -//************************************************************************* -// Functions -//************************************************************************* - -#endif //_appletManager_H diff --git a/src/occ_405/aplt/incl/appletId.h b/src/occ_405/aplt/incl/appletId.h deleted file mode 100755 index 96bdba3..0000000 --- a/src/occ_405/aplt/incl/appletId.h +++ /dev/null @@ -1,73 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/occ_405/aplt/incl/appletId.h $ */ -/* */ -/* OpenPOWER OnChipController Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2011,2015 */ -/* [+] International Business Machines Corp. */ -/* */ -/* */ -/* 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 */ - -#ifndef _APPLET_ID_H -#define _APPLET_ID_H - -//************************************************************************* -// Includes -//************************************************************************* -#include <occ_common.h> - -//************************************************************************* -// Externs -//************************************************************************* - -//************************************************************************* -// Macros -//************************************************************************* - -//************************************************************************* -// Defines/Enums -//************************************************************************* -// Original code & comments from occ/aplt/appletManager.h -// These are the current applets which exist. -typedef enum -{ - OCC_APLT_APSS_INIT = 0x00, - OCC_APLT_SNSR_QUERY = 0x01, - OCC_APLT_CMDH_DBUG = 0x02, - OCC_APLT_TEST, - OCC_APLT_LAST, - OCC_APLT_INVALID = 0xFF -} OCC_APLT; - -//************************************************************************* -// Structures -//************************************************************************* - -//************************************************************************* -// Globals -//************************************************************************* - -//************************************************************************* -// Function Prototypes -//************************************************************************* - -//************************************************************************* -// Functions -//************************************************************************* - -#endif // _APPLET_ID_H diff --git a/src/occApplet/productApplet/cmdhDbugCmd.c b/src/occ_405/cmdh/cmdh_dbug_cmd.c index 03a6153..29bd5b0 100755 --- a/src/occApplet/productApplet/cmdhDbugCmd.c +++ b/src/occ_405/cmdh/cmdh_dbug_cmd.c @@ -1,14 +1,14 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/occApplet/productApplet/cmdhDbugCmd.c $ */ +/* $Source: src/occ_405/cmdh/cmdh_dbug_cmd.c $ */ /* */ /* OpenPOWER OnChipController Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ -/* [+] Google Inc. */ +/* Contributors Listed Below - COPYRIGHT 2015 */ /* [+] International Business Machines Corp. */ /* */ +/* */ /* 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 */ @@ -23,52 +23,49 @@ /* */ /* IBM_PROLOG_END_TAG */ -//************************************************************************* +//*************************************************************************/ // Includes -//************************************************************************* +//*************************************************************************/ #include <common_types.h> // imageHdr_t declaration and image header macro #include <occ_service_codes.h> // For reason code -#include <aplt_service_codes.h> // For test applet module ID #include <errl.h> // For error handle #include <trac.h> // For traces #include <state.h> -#include <appletId.h> -#include <cmdhDbugCmd.h> +#include <cmdh_dbug_cmd.h> #include <cmdh_fsp.h> #include <cmdh_fsp_cmds.h> #include <centaur_data.h> -#include <gpe_data.h> +//#include <gpe_data.h> #include <proc_data.h> #include <apss.h> -//************************************************************************* +//*************************************************************************/ // Externs -//************************************************************************* +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Macros -//************************************************************************* +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Defines/Enums -//************************************************************************* -#define CMDH_DBUG_APPLET_ID "Cmdh_Dbug_Aplt\0" +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Structures -//************************************************************************* +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Globals -//************************************************************************* +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Function Prototypes -//************************************************************************* +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Functions -//************************************************************************* +//*************************************************************************/ // Function Specification // @@ -89,7 +86,7 @@ void dbug_err_inject(const cmdh_fsp_cmd_t * i_cmd_ptr, if(!strncmp(l_cmd_ptr->comp, "RST", OCC_TRACE_NAME_SIZE)) { - l_err = createErrl(TEST_APLT_MODID_ERRLTEST, //modId + l_err = createErrl(CMDH_DBUG_MID, //modId INTERNAL_FAILURE, //reasoncode OCC_NO_EXTENDED_RC, //Extended reason code ERRL_SEV_PREDICTIVE, //Severity @@ -112,7 +109,7 @@ void dbug_err_inject(const cmdh_fsp_cmd_t * i_cmd_ptr, } else { - l_err = createErrl(TEST_APLT_MODID_ERRLTEST, //modId + l_err = createErrl(CMDH_DBUG_MID, //modId INTERNAL_FAILURE, //reasoncode OCC_NO_EXTENDED_RC, //Extended reason code ERRL_SEV_UNRECOVERABLE, //Severity @@ -152,6 +149,8 @@ void dbug_err_inject(const cmdh_fsp_cmd_t * i_cmd_ptr, void dbug_centaur_dump(const cmdh_fsp_cmd_t * i_cmd_ptr, cmdh_fsp_rsp_t * i_rsp_ptr) { +/* TEMP -- NOT SUPPORTED (Don't have MemData structure anymore */ +#if 0 uint16_t l_datalen = 0; uint8_t l_jj=0; @@ -173,7 +172,7 @@ void dbug_centaur_dump(const cmdh_fsp_cmd_t * i_cmd_ptr, i_rsp_ptr->data_length[0] = CONVERT_UINT16_UINT8_HIGH(l_datalen); i_rsp_ptr->data_length[1] = CONVERT_UINT16_UINT8_LOW(l_datalen); i_rsp_ptr->rc = ERRL_RC_SUCCESS; - +#endif return; } @@ -214,6 +213,8 @@ void dbug_apss_dump(const cmdh_fsp_cmd_t * i_cmd_ptr, void dbug_proc_data_dump(const cmdh_fsp_cmd_t * i_cmd_ptr, cmdh_fsp_rsp_t * i_rsp_ptr) { +/* TEMP -- NOT SUPPORTED (Don't have CoreData structure anymore) */ +#if 0 uint16_t l_datalen = 0; uint8_t l_jj=0; @@ -235,7 +236,7 @@ void dbug_proc_data_dump(const cmdh_fsp_cmd_t * i_cmd_ptr, i_rsp_ptr->data_length[0] = CONVERT_UINT16_UINT8_HIGH(l_datalen); i_rsp_ptr->data_length[1] = CONVERT_UINT16_UINT8_LOW(l_datalen); i_rsp_ptr->rc = ERRL_RC_SUCCESS; - +#endif return; } @@ -249,7 +250,7 @@ void dbug_proc_data_dump(const cmdh_fsp_cmd_t * i_cmd_ptr, errlHndl_t cmdhDbugCmd(void * i_arg) { errlHndl_t l_errl = NULL; - cmdhDbugCmdAppletArg_t * l_arg = (cmdhDbugCmdAppletArg_t *) i_arg; + cmdhDbugCmdArg_t * l_arg = (cmdhDbugCmdArg_t *) i_arg; cmdh_fsp_cmd_t * l_cmd_ptr = l_arg->i_cmd_ptr; cmdh_fsp_rsp_t * l_rsp_ptr = l_arg->io_rsp_ptr; uint8_t l_sub_cmd = 0; @@ -258,7 +259,7 @@ errlHndl_t cmdhDbugCmd(void * i_arg) l_sub_cmd = l_cmd_ptr->data[0]; // Trace that a debug command was run - TRAC_INFO("Debug Command via Applet: Sub:0x%02x\n", l_sub_cmd); + TRAC_INFO("Debug Command: Sub:0x%02x\n", l_sub_cmd); // Build up a successful default response l_rsp_ptr->rc = ERRL_RC_SUCCESS; @@ -312,8 +313,3 @@ errlHndl_t cmdhDbugCmd(void * i_arg) return l_errl; } - -/*****************************************************************************/ -// Image Header -/*****************************************************************************/ -IMAGE_HEADER(G_cmdhDbugCmd, cmdhDbugCmd, CMDH_DBUG_APPLET_ID, OCC_APLT_CMDH_DBUG); diff --git a/src/occ_405/aplt/incl/cmdhDbugCmd.h b/src/occ_405/cmdh/cmdh_dbug_cmd.h index 10fc75f..fc46db3 100755 --- a/src/occ_405/aplt/incl/cmdhDbugCmd.h +++ b/src/occ_405/cmdh/cmdh_dbug_cmd.h @@ -1,7 +1,7 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/occ_405/aplt/incl/cmdhDbugCmd.h $ */ +/* $Source: src/occ_405/cmdh/cmdh_dbug_cmd.h $ */ /* */ /* OpenPOWER OnChipController Project */ /* */ @@ -26,40 +26,40 @@ #ifndef _CMDHDBUGCMD_H #define _CMDHDBUGCMD_H -//************************************************************************* +//*************************************************************************/ // Includes -//************************************************************************* +//*************************************************************************/ #include <occ_common.h> #include <cmdh_fsp.h> #include <cmdh_fsp_cmds.h> -//************************************************************************* +//*************************************************************************/ // Externs -//************************************************************************* +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Macros -//************************************************************************* +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Defines/Enums -//************************************************************************* +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Structures -//************************************************************************* -// Structure that is passed into cmdhDbugcmd applet +//*************************************************************************/ +// Structure that is passed into cmdhDbugcmd function // when it is called typedef struct { cmdh_fsp_cmd_t * i_cmd_ptr; cmdh_fsp_rsp_t * io_rsp_ptr; -} cmdhDbugCmdAppletArg_t; +} cmdhDbugCmdArg_t; /** * struct cmdh_dbug_inject_errl_query_t; - * Used by debug applet to create elog, version 0. + * Used by debug command to create elog, version 0. */ typedef struct __attribute__ ((packed)) { diff --git a/src/occ_405/cmdh/cmdh_fsp_cmds.c b/src/occ_405/cmdh/cmdh_fsp_cmds.c index 2b8284e..0b9728f 100755 --- a/src/occ_405/cmdh/cmdh_fsp_cmds.c +++ b/src/occ_405/cmdh/cmdh_fsp_cmds.c @@ -32,8 +32,7 @@ #include "occ_common.h" #include "state.h" #include "cmdh_fsp_cmds.h" -#include "cmdhDbugCmd.h" -#include "appletManager.h" +#include "cmdh_dbug_cmd.h" //#include "gpsm.h" //#include "pstates.h" #include "proc_pstate.h" @@ -45,26 +44,12 @@ #include "amec_freq.h" #include "amec_sys.h" #include "sensor.h" -#include "sensorQueryList.h" +#include "sensor_query_list.h" #include "chom.h" #include "amec_master_smh.h" #include "thrm_thread.h" #include <proc_data.h> -// We need to have a small structure in non-Applet space to keep track -// of success & failures when running test applets. This needs to be -// kept as small as possible. -typedef struct -{ - uint16_t successful; // Number of Sucessful Test Applets - uint16_t failed; // Number of Failed Test Applets - uint16_t total; // Total Number of Test Applets - SsxTimebase duration; // Total Duration of Test Applets - errlHndl_t errlHndl; // Holds the first failure's errlHndl -} testAppletStats_t; - -testAppletStats_t G_testAppletStats = {0}; - // This table contains tunable parameter information that can be exposed to // customers (only Master OCC should access/control this table) cmdh_tunable_param_table_t G_mst_tunable_parameter_table[CMDH_DEFAULT_TUNABLE_PARAM_NUM] = @@ -112,12 +97,13 @@ extern thrm_fru_data_t G_thrm_fru_data[DATA_FRU_MAX]; // system mode, error log ID, etc. // // End Function Specification -/* TEMP -- NOT YET SUPPORTED (NEED AMEC/DCOM) errlHndl_t cmdh_tmgt_poll (const cmdh_fsp_cmd_t * i_cmd_ptr, cmdh_fsp_rsp_t * o_rsp_ptr) { - cmdh_poll_query_t * l_poll_cmd = (cmdh_poll_query_t *) i_cmd_ptr; errlHndl_t l_errlHndl = NULL; +/* TEMP -- NOT YET SUPPORTED (NEED AMEC/DCOM) */ +#if 0 + cmdh_poll_query_t * l_poll_cmd = (cmdh_poll_query_t *) i_cmd_ptr; ERRL_RC l_rc = ERRL_RC_INTERNAL_FAIL; uint8_t k = 0; @@ -209,10 +195,9 @@ errlHndl_t cmdh_tmgt_poll (const cmdh_fsp_cmd_t * i_cmd_ptr, cmdh_build_errl_rsp(i_cmd_ptr, o_rsp_ptr, l_rc, &l_errlHndl); } - +#endif // #if 0 return l_errlHndl; } -*/ // Function Specification // @@ -221,11 +206,12 @@ errlHndl_t cmdh_tmgt_poll (const cmdh_fsp_cmd_t * i_cmd_ptr, // Description: Used for version 0x10 poll calls from BMC/HTMGT. // // End Function Specification -/* TEMP -- NOT SUPPORTED YET (NEED DCOM/AMEC) ERRL_RC cmdh_poll_v10(cmdh_fsp_rsp_t * o_rsp_ptr) { ERRL_RC l_rc = ERRL_RC_INTERNAL_FAIL; uint8_t k = 0; +/* TEMP -- NOT SUPPORTED YET (NEED DCOM/AMEC) */ +#if 0 cmdh_poll_sensor_db_t l_sensorHeader; // Clear response buffer @@ -507,10 +493,9 @@ ERRL_RC cmdh_poll_v10(cmdh_fsp_rsp_t * o_rsp_ptr) l_poll_rsp->data_length[1] = CONVERT_UINT16_UINT8_LOW(l_rsp_index); l_rc = ERRL_RC_SUCCESS; l_poll_rsp->rc = ERRL_RC_SUCCESS; - +#endif // #if 0 return l_rc; } -*/ @@ -546,12 +531,13 @@ void cmdh_tmgt_query_fw (const cmdh_fsp_cmd_t * i_cmd_ptr, // Description: TODO -- Add description // // End Function Specification -/* TEMP -- NOT ENABLED YET (NEED DCOM) errlHndl_t cmdh_reset_prep (const cmdh_fsp_cmd_t * i_cmd_ptr, cmdh_fsp_rsp_t * o_rsp_ptr) { - cmdh_reset_prep_t * l_cmd_ptr = (cmdh_reset_prep_t *) i_cmd_ptr; errlHndl_t l_errlHndl = NULL; +/* TEMP -- NOT ENABLED YET (NEED DCOM) */ +#if 0 + cmdh_reset_prep_t * l_cmd_ptr = (cmdh_reset_prep_t *) i_cmd_ptr; ERRL_RC l_rc = ERRL_RC_SUCCESS; bool l_ffdc = FALSE; @@ -621,7 +607,7 @@ errlHndl_t cmdh_reset_prep (const cmdh_fsp_cmd_t * i_cmd_ptr, * @userdata2 0 * @userdata4 0 * @devdesc Generate error log for ResetPrep command - */ /* + */ l_errlHndl = createErrl( DATA_GET_RESET_PREP_ERRL, //modId PREP_FOR_RESET, //reasoncode @@ -677,10 +663,9 @@ errlHndl_t cmdh_reset_prep (const cmdh_fsp_cmd_t * i_cmd_ptr, // Build Error Response packet cmdh_build_errl_rsp(i_cmd_ptr, o_rsp_ptr, l_rc, &l_errlHndl); } - +#endif // #if 0 return l_errlHndl; } -*/ // Function Specification // @@ -766,10 +751,11 @@ void cmdh_dbug_get_trace (const cmdh_fsp_cmd_t * i_cmd_ptr, // Description: TODO Add description // // End Function Specification -/* TEMP -- NOT ENABLED YET (NEED AMEC / SENSORS) void cmdh_dbug_get_ame_sensor (const cmdh_fsp_cmd_t * i_cmd_ptr, cmdh_fsp_rsp_t * o_rsp_ptr) { +/* TEMP -- NOT ENABLED YET (NEED AMEC / SENSORS) */ +#if 0 uint8_t l_rc = ERRL_RC_SUCCESS; uint16_t l_type = 0; uint16_t l_location = 0; @@ -781,7 +767,6 @@ void cmdh_dbug_get_ame_sensor (const cmdh_fsp_cmd_t * i_cmd_ptr, sensorQueryList_t l_sensor_list[CMDH_DBUG_MAX_NUM_SENSORS]; sensor_t *l_sensor_ptr = NULL; errlHndl_t l_err = NULL; - OCC_APLT_STATUS_CODES l_status = 0; do { @@ -799,8 +784,8 @@ void cmdh_dbug_get_ame_sensor (const cmdh_fsp_cmd_t * i_cmd_ptr, l_type, l_location); - // Initialize the Applet arguments - querySensorListAppletArg_t l_applet_arg = { + // Initialize the arguments to query sensor list + querySensorListArg_t l_qsl_arg = { 0, // i_startGsid - start with sensor 0x0000 0, // i_present l_type, // i_type - passed by the caller @@ -810,19 +795,14 @@ void cmdh_dbug_get_ame_sensor (const cmdh_fsp_cmd_t * i_cmd_ptr, NULL // o_sensorInfoPtr }; - // Call the sensor query list applet - runApplet(OCC_APLT_SNSR_QUERY, - &l_applet_arg, - TRUE, - NULL, - &l_err, - &l_status); + // Get the sensors + l_err = querySensorList(&l_qsl_arg); if (NULL != l_err) { // Query failure, this should not happen - TRAC_ERR("dbug_get_ame_sensor: Failed to run OCC_APLT_SNSR_QUERY applet. Error status is: 0x%x", - l_status); + TRAC_ERR("dbug_get_ame_sensor: Failed to query sensors. Error status is: 0x%x", + l_err->iv_reasonCode); // Commit error log commitErrl(&l_err); @@ -876,8 +856,8 @@ void cmdh_dbug_get_ame_sensor (const cmdh_fsp_cmd_t * i_cmd_ptr, o_rsp_ptr->rc = l_rc; o_rsp_ptr->data_length[0] = ((uint8_t *)&l_resp_data_length)[0]; o_rsp_ptr->data_length[1] = ((uint8_t *)&l_resp_data_length)[1]; +#endif // #if 0 } -*/ // Function Specification // @@ -1024,10 +1004,11 @@ errlHndl_t cmdh_get_elog (const cmdh_fsp_cmd_t * i_cmd_ptr, // Description: TODO Add description // // End Function Specification -/* TEMP -- NOT ENABLED YET (NEED DCOM / AMEC) void cmdh_dbug_get_apss_data (const cmdh_fsp_cmd_t * i_cmd_ptr, cmdh_fsp_rsp_t * o_rsp_ptr) { +/* TEMP -- NOT ENABLED YET (NEED DCOM / AMEC) */ +#if 0 uint8_t l_rc = ERRL_RC_SUCCESS; uint16_t i = 0; uint16_t l_resp_data_length = 0; @@ -1070,8 +1051,8 @@ void cmdh_dbug_get_apss_data (const cmdh_fsp_cmd_t * i_cmd_ptr, o_rsp_ptr->rc = l_rc; o_rsp_ptr->data_length[0] = ((uint8_t *)&l_resp_data_length)[0]; o_rsp_ptr->data_length[1] = ((uint8_t *)&l_resp_data_length)[1]; +#endif // #if 0 } -*/ // Function Specification // @@ -1088,8 +1069,7 @@ void cmdh_dbug_cmd (const cmdh_fsp_cmd_t * i_cmd_ptr, uint8_t l_block_num = 0; errl_generic_resp_t * l_err_rsp_ptr = (errl_generic_resp_t *) o_rsp_ptr; errlHndl_t l_errl = NULL; - OCC_APLT_STATUS_CODES l_status = OCC_APLT_SUCCESS; - cmdhDbugCmdAppletArg_t l_applet_args; + cmdhDbugCmdArg_t l_cmdh_dbug_args; // Sub Command for debug is always first byte of data l_sub_cmd = i_cmd_ptr->data[0]; @@ -1116,21 +1096,15 @@ void cmdh_dbug_cmd (const cmdh_fsp_cmd_t * i_cmd_ptr, // Act on Debug Sub-Command switch ( l_sub_cmd ) { - // ------------------------------------------------ - // Run debug sub-commands that **cannot** use applets - // ------------------------------------------------ -/* TEMP -- NOT SUPPORTED YET +/* TEMP -- NOT SUPPORTED YET */ +#if 0 case DBUG_GET_AME_SENSOR: - // This can't use an applet because it needs to run - // an applet to get the data cmdh_dbug_get_ame_sensor(i_cmd_ptr, o_rsp_ptr); break; case DBUG_FSP_ATTN: - // This is so small that we don't need to run it from an - // applet break; -*/ +#endif case DBUG_GET_TRACE: // Get trace buffer SRAM address cmdh_dbug_get_trace(i_cmd_ptr, o_rsp_ptr); @@ -1141,14 +1115,13 @@ void cmdh_dbug_cmd (const cmdh_fsp_cmd_t * i_cmd_ptr, TRAC_reset_buf(); o_rsp_ptr->rc = ERRL_RC_SUCCESS; break; -/* TEMP -- NOT YET SUPPORTED +/* TEMP -- NOT YET SUPPORTED */ +#if 0 case DBUG_PEEK: cmdh_dbug_peek(i_cmd_ptr, o_rsp_ptr); break; case DBUG_FLUSH_DCACHE: - // This is so small that we don't need to run it from an - // applet dcache_flush_all(); break; @@ -1156,122 +1129,6 @@ void cmdh_dbug_cmd (const cmdh_fsp_cmd_t * i_cmd_ptr, chom_force_gen_log(); break; - case 0xE0: // Run Test Applet - // TODO: Come in and clean this up later -#define TEST_APPLET_MAX_BLOCK_NUMBER 8 -#define TEST_APPLET_START_APPLET 0xFF -#define TEST_APPLET_GET_STATS 0xFE -#define TEST_APPLET_RESET_STATS 0xFD - - // We need to waste the OCC SRAM space to start these applets, but - // lets try to use up as little code as possible - - // Get the 2kB "Block Number" as passed in as the second data - // byte of the command. - l_block_num = i_cmd_ptr->data[1]; - - // If the block number that was passed is a valid data block, - // then copy the passed data into Main Memory - if(l_block_num < TEST_APPLET_MAX_BLOCK_NUMBER) - { - BceRequest pba_copy; - int l_ssxrc = SSX_OK; - - // Calculate Address in Main Memory where we will put this block - uint32_t l_addr_in_mem = ( G_ApltAddressTable[OCC_APLT_TEST].iv_aplt_address - + (l_block_num*2048)); - - // Can't copy to last 1024 bytes of SRAM - size_t l_size = (l_block_num == 0x07) ? 1024 : 2048; - - TRAC_INFO("uploading %d bytes of test applet block %d from 0x%08x to 0x%08x", - l_size, l_block_num, &i_cmd_ptr->data[124], l_addr_in_mem); - - // Set up copy request - l_ssxrc = bce_request_create( - &pba_copy, // block copy object - &G_pba_bcue_queue, // mainstore to sram copy engine - l_addr_in_mem, // mainstore address - (uint32_t) &i_cmd_ptr->data[124], // sram starting address - (size_t) l_size, // size of copy - SSX_SECONDS(5), // no timeout - NULL, // call back - NULL, // call back arguments - ASYNC_REQUEST_BLOCKING // callback mask - ); - - // Don't log error. We are in a debug path, not product code. - if(l_ssxrc != SSX_OK) - { - TRAC_ERR("CMDH Test Applet: PBA request create failure rc=[%08X]",l_ssxrc); - l_rc = ERRL_RC_INTERNAL_FAIL; - break; - } - - // Do actual copying - l_ssxrc = bce_request_schedule(&pba_copy); - - // Don't log error. We are in a debug path, not product code. - if(l_ssxrc != SSX_OK) - { - TRAC_ERR("CMDH Test Applet: PBA request schedule failure rc=[%08X]",l_ssxrc); - l_rc = ERRL_RC_INTERNAL_FAIL; - break; - } - } - else if(l_block_num == TEST_APPLET_START_APPLET) - { - TRAC_INFO("Starting test applet"); - OCC_APLT_STATUS_CODES l_status = OCC_APLT_SUCCESS; - errlHndl_t l_errl = NULL; - - // ------------------------------------------ - // Start Applet, and return - // Applet will auto-checksum itself, and - // fail w/ errlHndl if it doesn't match - // ------------------------------------------ - runApplet(OCC_APLT_TEST, // Applet enum Name - NULL, // Applet arguments - FALSE, // Blocking call? - NULL, // Applet finished semaphore - &l_errl, // Error log handle - &l_status); // Error status - - if( (NULL != l_errl) || (l_status != OCC_APLT_SUCCESS)) - { - TRAC_ERR("Test applet failure. status=%d", l_status); - l_rc = ERRL_RC_INTERNAL_FAIL; - } - else - { - TRAC_INFO("Test applet started"); - } - } - else if(l_block_num == TEST_APPLET_GET_STATS) - { - TRAC_INFO("Get applet stats"); - } - else if(l_block_num == TEST_APPLET_RESET_STATS) - { - TRAC_INFO("Resetting applet stats"); - - // Reset Applet Test Stats - G_testAppletStats.total = 0; - G_testAppletStats.duration = 0; - G_testAppletStats.failed = 0; - G_testAppletStats.errlHndl = NULL; - G_testAppletStats.successful = 0; - } - else - { - TRAC_ERR("Unrecognized applet command. l_block_num = %d", l_block_num); - l_rc = ERRL_RC_INVALID_DATA; - } - break; - - // ------------------------------------------------ - // Run debug sub-commands that can use applets - // ------------------------------------------------ case DBUG_READ_SCOM: case DBUG_PUT_SCOM: case DBUG_POKE: @@ -1297,27 +1154,22 @@ void cmdh_dbug_cmd (const cmdh_fsp_cmd_t * i_cmd_ptr, case DBUG_CENTAUR_SENSOR_CACHE: case DBUG_DUMP_PROC_DATA: - l_applet_args.i_cmd_ptr = (cmdh_fsp_cmd_t *) i_cmd_ptr; - l_applet_args.io_rsp_ptr = o_rsp_ptr; - - runApplet(OCC_APLT_CMDH_DBUG, // Applet enum Name - &l_applet_args, // Applet arguments - TRUE, // Blocking call? - NULL, // Applet finished semaphore - &l_errl, // Error log handle - &l_status); // Error status - - if( (NULL != l_errl) || (l_status != OCC_APLT_SUCCESS)) - { - TRAC_ERR("Debug command applet returned error: l_status: 0x%x", l_status); - commitErrl( &l_errl ); - } + l_cmdh_dbug_args.i_cmd_ptr = (cmdh_fsp_cmd_t *) i_cmd_ptr; + l_cmdh_dbug_args.io_rsp_ptr = o_rsp_ptr; + + l_errl = cmdhDbugCmd(&l_cmdh_dbug_args); + + if(NULL != l_errl) + { + TRAC_ERR("Debug command returned error: RC: 0x%x", l_errl->iv_reasonCode); + commitErrl( &l_errl ); + } break; case DBUG_DUMP_APSS_DATA: cmdh_dbug_get_apss_data(i_cmd_ptr, o_rsp_ptr); break; -*/ +#endif // #if 0 default: l_rc = ERRL_RC_INVALID_DATA; //should NEVER get here... break; @@ -1342,11 +1194,12 @@ void cmdh_dbug_cmd (const cmdh_fsp_cmd_t * i_cmd_ptr, // Description: TODO Add description // // End Function Specification -/* NOT YET SUPPORTED -- NEED MODE AND STATES errlHndl_t cmdh_tmgt_setmodestate(const cmdh_fsp_cmd_t * i_cmd_ptr, cmdh_fsp_rsp_t * o_rsp_ptr) { errlHndl_t l_errlHndl = NULL; +/* NOT YET SUPPORTED -- NEED MODE AND STATES */ +#if 0 smgr_setmodestate_v0_query_t* l_cmd_ptr = (smgr_setmodestate_v0_query_t *)i_cmd_ptr; ERRL_RC l_rc = ERRL_RC_INTERNAL_FAIL; SsxInterval l_timeout = SSX_SECONDS(15); @@ -1461,7 +1314,7 @@ errlHndl_t cmdh_tmgt_setmodestate(const cmdh_fsp_cmd_t * i_cmd_ptr, * @userdata2 OCC succeeded bitmap * @userdata4 OCC_NO_EXTENDED_RC * @devdesc Timed out trying to reach requested power mode/state - */ /* + */ l_errlHndl = createErrl( CMDH_GENERIC_CMD_FAILURE, //modId INTERNAL_FAILURE, //reasoncode @@ -1498,9 +1351,10 @@ errlHndl_t cmdh_tmgt_setmodestate(const cmdh_fsp_cmd_t * i_cmd_ptr, cmdh_build_errl_rsp(i_cmd_ptr, o_rsp_ptr, l_rc, &l_errlHndl); } +#endif // #if 0 + return l_errlHndl; } -*/ // Function Specification // @@ -1509,11 +1363,12 @@ errlHndl_t cmdh_tmgt_setmodestate(const cmdh_fsp_cmd_t * i_cmd_ptr, // Description: TODO Add description // // End Function Specification -/* TEMP -- NOT YET SUPPORTED (NEED AMEC) errlHndl_t cmdh_amec_pass_through(const cmdh_fsp_cmd_t * i_cmd_ptr, cmdh_fsp_rsp_t * o_rsp_ptr) { errlHndl_t l_errlHndl = NULL; +/* TEMP -- NOT YET SUPPORTED (NEED AMEC) */ +#if 0 IPMIMsg_t l_IPMImsg; uint8_t l_rc = 0; uint16_t l_rsp_data_length = CMDH_FSP_RSP_DATA_SIZE; @@ -1568,7 +1423,7 @@ errlHndl_t cmdh_amec_pass_through(const cmdh_fsp_cmd_t * i_cmd_ptr, * @userdata2 max data length * @userdata4 OCC_NO_EXTENDED_RC * @devdesc amester_entry_point returned too much data. - */ /* + */ l_errlHndl = createErrl( AMEC_AMESTER_INTERFACE, //modId INTERNAL_FAILURE, //reasoncode @@ -1605,10 +1460,10 @@ errlHndl_t cmdh_amec_pass_through(const cmdh_fsp_cmd_t * i_cmd_ptr, l_err_resp_ptr->log_id = 0; } } - +#endif return l_errlHndl; } -*/ + // Function Specification // @@ -1617,17 +1472,17 @@ errlHndl_t cmdh_amec_pass_through(const cmdh_fsp_cmd_t * i_cmd_ptr, // Description: TODO Add description // // End Function Specification -/* TEMP -- NOT YET SUPPORTED (NEED SENSORS) errlHndl_t cmdh_tmgt_get_field_debug_data(const cmdh_fsp_cmd_t * i_cmd_ptr, cmdh_fsp_rsp_t * o_rsp_ptr) { + errlHndl_t l_err = NULL; +/* TEMP -- NOT YET SUPPORTED (NEED SENSORS) */ +#if 0 uint16_t i = 0; UINT l_rtLen = 0; uint16_t l_num_of_sensors = CMDH_FIELD_MAX_NUM_SENSORS; sensorQueryList_t l_sensor_list[CMDH_FIELD_MAX_NUM_SENSORS]; sensor_t *l_sensor_ptr = NULL; - errlHndl_t l_err = NULL; - OCC_APLT_STATUS_CODES l_status = 0; cmdh_get_field_debug_data_resp_t *l_resp_ptr = (cmdh_get_field_debug_data_resp_t*) o_rsp_ptr; uint16_t l_rsp_data_length = 0; ERRL_RC l_rc = ERRL_RC_SUCCESS; @@ -1654,9 +1509,8 @@ errlHndl_t cmdh_tmgt_get_field_debug_data(const cmdh_fsp_cmd_t * i_cmd_ptr, l_rtLen = CMDH_FIELD_TRACE_DATA_SIZE; TRAC_get_buffer_partial(TRAC_get_td("INF"), l_resp_ptr->trace_inf, &l_rtLen); - // Initialize the Applet arguments // TODO: Set "present" to 0 for testing (since no sensor presented now) - querySensorListAppletArg_t l_applet_arg = { + querySensorListArg_t l_qsl_arg = { 0, // i_startGsid - start with sensor 0x0000 0, // i_present (AMEC_SENSOR_TYPE_POWER| // i_type @@ -1667,19 +1521,14 @@ errlHndl_t cmdh_tmgt_get_field_debug_data(const cmdh_fsp_cmd_t * i_cmd_ptr, NULL // o_sensorInfoPtr }; - // Call the sensor query list applet - runApplet(OCC_APLT_SNSR_QUERY, - &l_applet_arg, - TRUE, - NULL, - &l_err, - &l_status); + // Get sensor list + l_err = querySensorList(&l_qsl_arg); if (NULL != l_err) { // Query failure, this should not happen - TRAC_ERR("get_field_debug_data: Failed to run OCC_APLT_SNSR_QUERY applet. Error status is: 0x%x", - l_status); + TRAC_ERR("get_field_debug_data: Failed to get sensor list. Error status is: 0x%x", + l_err->iv_reasonCode); // Commit error log commitErrl(&l_err); @@ -1729,10 +1578,9 @@ errlHndl_t cmdh_tmgt_get_field_debug_data(const cmdh_fsp_cmd_t * i_cmd_ptr, // Build Error Response packet cmdh_build_errl_rsp(i_cmd_ptr, o_rsp_ptr, l_rc, &l_err); } - +#endif return l_err; } -*/ // Function Specification // diff --git a/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c b/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c index 2e8c703..c3d44f6 100755 --- a/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c +++ b/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c @@ -33,8 +33,7 @@ #include "occ_common.h" #include "state.h" #include "cmdh_fsp_cmds.h" -#include "cmdhDbugCmd.h" -#include "appletManager.h" +#include "cmdh_dbug_cmd.h" //#include "gpsm.h" //#include "pstates.h" #include "proc_pstate.h" @@ -1185,6 +1184,8 @@ errlHndl_t data_store_role(const cmdh_fsp_cmd_t * i_cmd_ptr, // If this is a backup master occ, we need to be checking the APSS health if(OCC_BACKUP_MASTER == l_new_role) { +// TEMP / TODO : NEED TO CHANGE THIS TO NOT BE USING AN APPLET +#if 0 // Start OCC_APLT_STATUS_CODES l_status = OCC_APLT_SUCCESS; // Initialize APSS communication on the backup OCC (retries internally) @@ -1201,7 +1202,7 @@ errlHndl_t data_store_role(const cmdh_fsp_cmd_t * i_cmd_ptr, TRAC_ERR("APSS init applet returned error: l_status: 0x%x", l_status); commitErrl(&l_errlHndl); } - +#endif // End // Allow APSS tasks to run on OCC backup rtl_clr_run_mask_deferred(RTL_FLAG_APSS_NOT_INITD); TRAC_IMP("OCC Role set to Backup Master via TMGT"); diff --git a/src/occ_405/cmdh/cmdh_mnfg_intf.c b/src/occ_405/cmdh/cmdh_mnfg_intf.c index 98b3f71..a952f1b 100755 --- a/src/occ_405/cmdh/cmdh_mnfg_intf.c +++ b/src/occ_405/cmdh/cmdh_mnfg_intf.c @@ -29,7 +29,7 @@ #include "dcom.h" #include "amec_oversub.h" #include "amec_sys.h" -#include "sensorQueryList.h" +#include "sensor_query_list.h" #include "amec_smh.h" #include "amec_master_smh.h" #include "centaur_data.h" @@ -406,7 +406,6 @@ uint8_t cmdh_mnfg_list_sensors(const cmdh_fsp_cmd_t * i_cmd_ptr, (cmdh_mfg_list_sensors_resp_t*) o_rsp_ptr; sensorQueryList_t l_sensor_list[MFG_MAX_NUM_SENSORS + 1]; errlHndl_t l_err = NULL; - OCC_APLT_STATUS_CODES l_status = 0; do { @@ -452,8 +451,8 @@ uint8_t cmdh_mnfg_list_sensors(const cmdh_fsp_cmd_t * i_cmd_ptr, l_type, l_location); - // Initialize the Applet arguments - querySensorListAppletArg_t l_applet_arg = + // Initialize the sensor query arguments + const querySensorListArg_t l_qsl_arg = { l_start_gsid, // i_startGsid - passed by the caller l_cmd_ptr->present, // i_present - passed by the caller @@ -464,19 +463,14 @@ uint8_t cmdh_mnfg_list_sensors(const cmdh_fsp_cmd_t * i_cmd_ptr, NULL // o_sensorInfoPtr - not needed }; - // Call the sensor query list applet - runApplet(OCC_APLT_SNSR_QUERY, - &l_applet_arg, - TRUE, - NULL, - &l_err, - &l_status); + // Get the list of sensors + l_err = querySensorList(&l_qsl_arg); if (NULL != l_err) { // Query failure - TRAC_ERR("cmdh_mnfg_list_sensors: Failed to run OCC_APLT_SNSR_QUERY applet. Error status is: 0x%x", - l_status); + TRAC_ERR("cmdh_mnfg_list_sensors: Failed to query sensor list. Error status is: 0x%x", + l_err->iv_reasonCode); // Commit error log commitErrl(&l_err); @@ -549,7 +543,6 @@ uint8_t cmdh_mnfg_get_sensor(const cmdh_fsp_cmd_t * i_cmd_ptr, (cmdh_mfg_get_sensor_resp_t*) o_rsp_ptr; sensor_info_t l_sensor_info; errlHndl_t l_err = NULL; - OCC_APLT_STATUS_CODES l_status = 0; sensor_t* l_sensor_ptr; do @@ -592,8 +585,8 @@ uint8_t cmdh_mnfg_get_sensor(const cmdh_fsp_cmd_t * i_cmd_ptr, TRAC_INFO("cmdh_mnfg_get_sensor: gsid[0x%04x]", l_gsid); - // Initialize the Applet arguments - querySensorListAppletArg_t l_applet_arg = + // Initialize the sensor query arguments + querySensorListArg_t l_qsl_arg = { l_gsid, // i_startGsid - passed by the caller 0, // i_present - passed by the caller @@ -604,19 +597,14 @@ uint8_t cmdh_mnfg_get_sensor(const cmdh_fsp_cmd_t * i_cmd_ptr, &l_sensor_info // o_sensorInfoPtr }; - // Call the sensor query list applet - runApplet(OCC_APLT_SNSR_QUERY, - &l_applet_arg, - TRUE, - NULL, - &l_err, - &l_status); + // Get the sensor list + l_err = querySensorList(&l_qsl_arg); if (NULL != l_err) { // Query failure - TRAC_ERR("cmdh_mnfg_get_sensor: Failed to run OCC_APLT_SNSR_QUERY applet. Error status is: 0x%x", - l_status); + TRAC_ERR("cmdh_mnfg_get_sensor: Failed to get sensor list. Error status is: 0x%x", + l_err->iv_reasonCode); // Commit error log commitErrl(&l_err); diff --git a/src/occ_405/cmdh/ll_ffdc.S b/src/occ_405/cmdh/ll_ffdc.S index 2fd6d78..1ad6730 100644 --- a/src/occ_405/cmdh/ll_ffdc.S +++ b/src/occ_405/cmdh/ll_ffdc.S @@ -173,10 +173,9 @@ # 404 (x194) 32 Thread stack trace # # 436 (x1b4) 64 Command thread dump -# 500 (x1f4) 64 App thread dump -# 564 (x234) 64 DCOM thread dump -# 628 (x274) 32 Stack trace -# 660 (x294) 4 xffdcffdc End of buffer marker +# 500 (x1f4) 64 DCOM thread dump +# 564 (x234) 32 Stack trace +# 596 (x254) 4 xffdcffdc End of buffer marker # ----------------------------------------------------------------------------- # Total size: 664 - 8 + 3 = 659 # @@ -390,8 +389,6 @@ MAIN_THREAD_DUMP: .byte .struct MAIN_THREAD_DUMP + 64 CMD_THREAD_DUMP: .byte .struct CMD_THREAD_DUMP + 64 -APP_THREAD_DUMP: .byte - .struct APP_THREAD_DUMP + 64 DCOM_THREAD_DUMP: .byte .struct DCOM_THREAD_DUMP + 64 STACK_TRACE: .byte @@ -933,11 +930,6 @@ __save_ffdc_regs: _liwa %r4, CMD_THREAD_DUMP bl ffdc_thread_dumper - # Add the App thread dump - _liw %r3, App_thread - _liwa %r4, APP_THREAD_DUMP - bl ffdc_thread_dumper - # Add the DCOM thread dump _liw %r3, Dcom_thread _liwa %r4, DCOM_THREAD_DUMP diff --git a/src/occ_405/incl/common_types.h b/src/occ_405/incl/common_types.h index 51ea3ed..40fbc11 100755 --- a/src/occ_405/incl/common_types.h +++ b/src/occ_405/incl/common_types.h @@ -74,10 +74,6 @@ typedef enum #define TRAP_INST 0x7FE00004 #define ID_NUM_INVALID 0xFFFF -// Magic number set for applet headers -#define APLT_MAGIC_NUMBER {0x1A,0x2B,0x3C,0x4D, 0x5E,0x6F,0x7A,0x8B, 0x9C,0xAD,0xAE,0x9F, 0x8A,0x7B,0x6C,0x5D, 0x4E,0x3F,0x2A,0x1B,\ - 0x1A,0x2B,0x3C,0x4D, 0x5E,0x6F,0x7A,0x8B, 0x9C,0xAD,0xAE,0x9F, 0x8A,0x7B,0x6C,0x5D, 0x4E,0x3F,0x2A,0x1B,\ - 0x1A,0x2B,0x3C,0x4D, 0x5E,0x6F,0x7A,0x8B, 0x9C,0xAD,0xAE,0x9F, 0x8A,0x7B,0x6C,0x5D, 0x4E,0x3F,0x2A,0x1B, 0x12,0x34,0xAB,0xCD} #define SRAM_HEADER_HACK 0x48000042 #ifndef __ASSEMBLER__ diff --git a/src/occ_405/linkocc.cmd b/src/occ_405/linkocc.cmd index 29385b9..457d53b 100755 --- a/src/occ_405/linkocc.cmd +++ b/src/occ_405/linkocc.cmd @@ -583,7 +583,7 @@ SECTIONS // FIR data heap section //////////////////////////////// __CUR_COUNTER__ = .; - _FIR_HEAP_SECTION_BASE = 0xfffb1000; + _FIR_HEAP_SECTION_BASE = 0xfffb9000; _FIR_HEAP_SECTION_SIZE = 0x3000; . = _FIR_HEAP_SECTION_BASE; .firHeap . : {*(firHeap) . = ALIGN(1024);} > sram @@ -593,7 +593,7 @@ SECTIONS // FIR data parms section //////////////////////////////// __CUR_COUNTER__ = .; - _FIR_PARMS_SECTION_BASE = 0xfffb4000; + _FIR_PARMS_SECTION_BASE = 0xfffbc000; _FIR_PARMS_SECTION_SIZE = 0x1000; . = _FIR_PARMS_SECTION_BASE; .firParms . : {*(firParms) . = ALIGN(1024);} > sram @@ -604,9 +604,9 @@ SECTIONS //////////////////////////////// __CUR_COUNTER__ = .; - _LINEAR_WR_WINDOW_SECTION_BASE = 0xfffb5000; + _LINEAR_WR_WINDOW_SECTION_BASE = 0xfffbd000; _LINEAR_WR_WINDOW_SECTION_SIZE = 0x1000; - _LINEAR_RD_WINDOW_SECTION_BASE = 0xfffb6000; + _LINEAR_RD_WINDOW_SECTION_BASE = 0xfffbe000; _LINEAR_RD_WINDOW_SECTION_SIZE = 0x1000; . = _LINEAR_WR_WINDOW_SECTION_BASE; .linear_wr . : {*(linear_wr) . = ALIGN(_LINEAR_WR_WINDOW_SECTION_SIZE);} > sram @@ -615,20 +615,24 @@ SECTIONS . = __CUR_COUNTER__; //////////////////////////////// - // Applet areas + // TEMP/TODO: Previously, we were able to reclaim this space + // by loading applets over init data. The init data + // takes up much more than 4K, but as we stand now (pre-sensors) + // it should be fine. However, we either need to + // put these sections back into the normal area + // with the rest of the code or figure out what to + // do with it to regain the space. //////////////////////////////// __CUR_COUNTER__ = .; - _APPLET0_SECTION_BASE = 0xfffb8000; - . = _APPLET0_SECTION_BASE; + INIT_SECTION_BASE = 0xfffbf000; + . = INIT_SECTION_BASE; + // Section aligned to 128 to make occ main application image 128 bytes // aligned which is requirement for applet manager when traversing through // all the image headers initSection . : { *(initSection) init_text . = ALIGN(128);} > sram . = __CUR_COUNTER__; - _APPLET0_SECTION_SIZE = 0x00004000; - _APPLET1_SECTION_BASE = 0xfffbc000; - _APPLET1_SECTION_SIZE = 0x00003c00; ////////////////////////////// // End Of Memory diff --git a/src/occ_405/main.c b/src/occ_405/main.c index 7401b77..4217085 100755 --- a/src/occ_405/main.c +++ b/src/occ_405/main.c @@ -1,3 +1,4 @@ + /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ @@ -34,7 +35,6 @@ #include <threadSch.h> #include <errl.h> #include <apss.h> -#include <appletManager.h> #include <trac.h> #include <occ_service_codes.h> #include <occ_sys_config.h> @@ -66,7 +66,6 @@ extern uint8_t G_occ_interrupt_type; // Remove the next LOC when dcom_initialize_roles() is un-commented uint8_t G_occ_role = OCC_MASTER; // TEMP -// TEMP Remove next 6 LOC when apssInitApplet.c is added extern GpeRequest G_meas_start_request; extern GpeRequest G_meas_cont_request; extern GpeRequest G_meas_complete_request; @@ -149,7 +148,7 @@ void pmc_hw_error_isr(void *private, SsxIrqId irq, int priority) // dump a bunch of FFDC registers //fill_pmc_ffdc_buffer(&l_pmc_ffdc); - TRAC_ERR("PMC Failure detected through OISR0[9]!!!"); + MAIN_TRAC_ERR("PMC Failure detected through OISR0[9]!!!"); /* @ * @moduleid PMC_HW_ERROR_ISR * @reasonCode PMC_FAILURE @@ -225,9 +224,7 @@ void occ_hw_error_isr(void *private, SsxIrqId irq, int priority) _putscom(OCB_OCCLFIR_OR, OCC_LFIR_SPARE_BIT50, SCOM_TIMEOUT); //Halt occ so that hardware will enter safe mode - TRAC_ERR("Should have halted here..."); -// TEMP -- NOT SUPPORTED IN PHASE1 -// OCC_HALT(ERRL_RC_OCC_HW_ERROR); + OCC_HALT(ERRL_RC_OCC_HW_ERROR); } // Enable and register any ISR's that need to be set up as early as possible. @@ -250,7 +247,7 @@ void occ_irq_setup() SSX_IRQ_TRIGGER_EDGE_SENSITIVE); if(l_rc) { - TRAC_ERR("occ_irq_setup: ssx_irq_setup(OCCHW_IRQ_OCC_ERROR) failed with rc=0x%08x", l_rc); + MAIN_TRAC_ERR("occ_irq_setup: ssx_irq_setup(OCCHW_IRQ_OCC_ERROR) failed with rc=0x%08x", l_rc); break; } @@ -261,7 +258,7 @@ void occ_irq_setup() SSX_CRITICAL); if(l_rc) { - TRAC_ERR("occ_irq_setup: ssx_irq_handler_set(OCCHW_IRQ_OCC_ERROR) failed with rc=0x%08x", l_rc); + MAIN_TRAC_ERR("occ_irq_setup: ssx_irq_handler_set(OCCHW_IRQ_OCC_ERROR) failed with rc=0x%08x", l_rc); break; } @@ -282,7 +279,7 @@ void occ_irq_setup() SSX_IRQ_TRIGGER_EDGE_SENSITIVE); if(l_rc) { - TRAC_ERR("occ_irq_setup: ssx_irq_setup(OCCHW_IRQ_PMC_ERROR) failed with rc=0x%08x", l_rc); + MAIN_TRAC_ERR("occ_irq_setup: ssx_irq_setup(OCCHW_IRQ_PMC_ERROR) failed with rc=0x%08x", l_rc); break; } @@ -293,7 +290,7 @@ void occ_irq_setup() SSX_NONCRITICAL); if(l_rc) { - TRAC_ERR("occ_irq_setup: ssx_irq_handler_set(OCCHW_IRQ_PMC_ERROR) failed with rc=0x%08x", l_rc); + MAIN_TRAC_ERR("occ_irq_setup: ssx_irq_handler_set(OCCHW_IRQ_PMC_ERROR) failed with rc=0x%08x", l_rc); break; } @@ -380,7 +377,7 @@ void occ_ipc_setup() l_rc = ipc_init(); if(l_rc) { - TRAC_ERR("ipc_init failed with rc=0x%08x", l_rc); + MAIN_TRAC_ERR("ipc_init failed with rc=0x%08x", l_rc); break; } @@ -388,26 +385,26 @@ void occ_ipc_setup() l_rc = ipc_enable(); if(l_rc) { - TRAC_ERR("ipc_enable failed with rc = 0x%08x", l_rc); + MAIN_TRAC_ERR("ipc_enable failed with rc = 0x%08x", l_rc); break; } - TRAC_INFO("Calling IPC disable on all GPE's"); + MAIN_TRAC_INFO("Calling IPC disable on all GPE's"); // disable all of the GPE cbufs. They will enable them once // they are ready to communicate. ipc_disable(OCCHW_INST_ID_GPE0); ipc_disable(OCCHW_INST_ID_GPE1); - TRAC_INFO("IPC initialization completed"); + MAIN_TRAC_INFO("IPC initialization completed"); // start GPE's 0 and 1 - TRAC_INFO("Starting GPE0"); + MAIN_TRAC_INFO("Starting GPE0"); gpe_reset(OCCHW_INST_ID_GPE0); - TRAC_INFO("Starting GPE1"); + MAIN_TRAC_INFO("Starting GPE1"); gpe_reset(OCCHW_INST_ID_GPE1); - TRAC_INFO("GPE's taken out of reset"); + MAIN_TRAC_INFO("GPE's taken out of reset"); }while(0); @@ -468,7 +465,7 @@ void hmon_routine() if(L_critical_phantom_count != G_occ_phantom_critical_count) { L_critical_phantom_count = G_occ_phantom_critical_count; - TRAC_INFO("hmon_routine: critical phantom irq occurred! count[%d]", L_critical_phantom_count); + MAIN_TRAC_INFO("hmon_routine: critical phantom irq occurred! count[%d]", L_critical_phantom_count); //log a critical phantom error once if(!L_c_phantom_logged) @@ -480,7 +477,7 @@ void hmon_routine() if(L_noncritical_phantom_count != G_occ_phantom_noncritical_count) { L_noncritical_phantom_count = G_occ_phantom_noncritical_count; - TRAC_INFO("hmon_routine: non-critical phantom irq occurred! count[%d]", L_noncritical_phantom_count); + MAIN_TRAC_INFO("hmon_routine: non-critical phantom irq occurred! count[%d]", L_noncritical_phantom_count); //log a non-critical phantom error once if(!L_nc_phantom_logged) @@ -550,7 +547,6 @@ void master_occ_init() errlHndl_t l_err = NULL; GpeRequest l_request; //Used once here to initialize apss. - // TODO: Move the APSS initialization code back to an applet once applets are running on P9. // Initialize APSS // Setup the GPIO init structure to pass to the PPE program @@ -570,7 +566,7 @@ void master_occ_init() = G_gpio_config[1].interrupt; // Create/schedule IPC_ST_APSS_INIT_GPIO_FUNCID and wait for it to complete (BLOCKING) - TRAC_INFO("master_occ_init: Creating request for GPE_apss_initialize_gpio"); + MAIN_TRAC_INFO("master_occ_init: Creating request for GPE_apss_initialize_gpio"); gpe_request_create(&l_request, // request &G_async_gpe_queue0, // queue IPC_ST_APSS_INIT_GPIO_FUNCID, // Function ID @@ -581,7 +577,7 @@ void master_occ_init() ASYNC_REQUEST_BLOCKING); // options // Schedule the request to be executed - TRAC_INFO("master_occ_init: Scheduling request for IPC_ST_APSS_INIT_GPIO_FUNCID"); + MAIN_TRAC_INFO("master_occ_init: Scheduling request for IPC_ST_APSS_INIT_GPIO_FUNCID"); gpe_request_schedule(&l_request); // Check for a timeout only; will create the error below. @@ -592,11 +588,11 @@ void master_occ_init() // it to the front of the queue. // Let's log an error, and include the FFDC data if it was // generated. - TRAC_ERR("master_occ_init: Timeout communicating with PPE for APSS Init."); + MAIN_TRAC_ERR("master_occ_init: Timeout communicating with PPE for APSS Init."); } - TRAC_INFO("master_occ_init: GPE_apss_initialize_gpio completed w/rc=0x%08x\n", + MAIN_TRAC_INFO("master_occ_init: GPE_apss_initialize_gpio completed w/rc=0x%08x\n", l_request.request.completion_state); @@ -618,7 +614,7 @@ void master_occ_init() = G_apss_mode_config.numGpioPortsToRead; // Create/schedule GPE_apss_set_mode and wait for it to complete (BLOCKING) - TRAC_INFO("master_occ_init: Creating request for GPE_apss_set_mode"); + MAIN_TRAC_INFO("master_occ_init: Creating request for GPE_apss_set_mode"); gpe_request_create(&l_request, // request &G_async_gpe_queue0, // queue IPC_ST_APSS_INIT_MODE_FUNCID, // Function ID @@ -638,17 +634,17 @@ void master_occ_init() // it to the front of the queue. // Let's log an error, and include the FFDC data if it was // generated. - TRAC_ERR("master_occ_init: Timeout communicating with PPE for APSS Init"); + MAIN_TRAC_ERR("master_occ_init: Timeout communicating with PPE for APSS Init"); } - TRAC_INFO("master_occ_init: GPE_apss_set_mode completed w/rc=0x%08x", + MAIN_TRAC_INFO("master_occ_init: GPE_apss_set_mode completed w/rc=0x%08x", l_request.request.completion_state); //Continue only if mode set was successful. if ((ASYNC_REQUEST_STATE_COMPLETE == l_request.request.completion_state) && (G_gpe_apss_set_mode_args.error.rc == ERRL_RC_SUCCESS)) { - TRAC_INFO("master_occ_init: Creating request G_meas_start_request."); + MAIN_TRAC_INFO("master_occ_init: Creating request G_meas_start_request."); //Create the request for measure start. Scheduling will happen in apss.c gpe_request_create(&G_meas_start_request, &G_async_gpe_queue0, // queue @@ -659,7 +655,7 @@ void master_occ_init() NULL, // callback arg ASYNC_CALLBACK_IMMEDIATE); // options - TRAC_INFO("master_occ_init: Creating request G_meas_cont_request."); + MAIN_TRAC_INFO("master_occ_init: Creating request G_meas_cont_request."); //Create the request for measure continue. Scheduling will happen in apss.c gpe_request_create(&G_meas_cont_request, &G_async_gpe_queue0, // request @@ -670,7 +666,7 @@ void master_occ_init() NULL, // callback arg ASYNC_CALLBACK_IMMEDIATE); // options - TRAC_INFO("master_occ_init: Creating request G_meas_complete_request."); + MAIN_TRAC_INFO("master_occ_init: Creating request G_meas_complete_request."); //Create the request for measure complete. Scheduling will happen in apss.c gpe_request_create(&G_meas_complete_request, &G_async_gpe_queue0, // queue @@ -743,10 +739,9 @@ void master_occ_init() if( (NULL != l_err)) { - TRAC_ERR("APSS init applet returned error"); + MAIN_TRAC_ERR("master_occ_init: Error initializing APSS"); // commit & delete. CommitErrl handles NULL error log handle - // TEMP -- NO ERRL / RESET YET - //REQUEST_RESET(l_err); + REQUEST_RESET(l_err); } // Reinitialize the PBAX Queues @@ -774,7 +769,7 @@ void slave_occ_init() if( l_errl ) { // Trace and commit error - TRAC_ERR("Initialization of Oversubscription IRQ handler failed"); + MAIN_TRAC_ERR("Initialization of Oversubscription IRQ handler failed"); // commit log ... log should be deleted by reader mechanism // TEMP -- NO ERRL YET @@ -782,7 +777,7 @@ void slave_occ_init() } else { - TRAC_INFO("Oversubscription IRQ initialized"); + MAIN_TRAC_INFO("Oversubscription IRQ initialized"); } //Set up doorbell queues @@ -822,7 +817,7 @@ void mainThrdTimerCallback(void * i_argPtr) if ( l_rc != SSX_OK ) { - TRAC_ERR("Failure posting thermal semaphore: rc: 0x%x", l_rc); + MAIN_TRAC_ERR("Failure posting thermal semaphore: rc: 0x%x", l_rc); break; } @@ -833,7 +828,7 @@ void mainThrdTimerCallback(void * i_argPtr) if ( l_rc != SSX_OK ) { - TRAC_ERR("Failure posting HlTH monitor semaphore: rc: 0x%x", l_rc); + MAIN_TRAC_ERR("Failure posting HlTH monitor semaphore: rc: 0x%x", l_rc); break; } @@ -844,7 +839,7 @@ void mainThrdTimerCallback(void * i_argPtr) if ( l_rc != SSX_OK ) { - TRAC_ERR("Failure posting FFDC semaphore: rc: 0x%x", l_rc); + MAIN_TRAC_ERR("Failure posting FFDC semaphore: rc: 0x%x", l_rc); break; } @@ -917,7 +912,7 @@ void initMainThrdSemAndTimer() } else { - TRAC_ERR("Error creating main thread timer: RC: %d", l_timerRc); + MAIN_TRAC_ERR("Error creating main thread timer: RC: %d", l_timerRc); } // Failure creating semaphore or creating/scheduling timer, create @@ -927,7 +922,7 @@ void initMainThrdSemAndTimer() ( l_ffdcSemRc != SSX_OK ) || ( l_timerRc != SSX_OK)) { - TRAC_ERR("Semaphore/timer create failure: thrmSemRc: 0x%08x, " + MAIN_TRAC_ERR("Semaphore/timer create failure: thrmSemRc: 0x%08x, " "hmonSemRc: 0x08%x, ffdcSemRc: 0x%08x, l_timerRc: 0x%08x", -l_thrmSemRc,-l_hmonSemRc,-l_ffdcSemRc, l_timerRc ); @@ -968,7 +963,7 @@ void Main_thread_routine(void *private) { CHECKPOINT(MAIN_THREAD_STARTED); - TRAC_INFO("Main Thread Started ... " ); + MAIN_TRAC_INFO("Main Thread Started ... " ); // NOTE: At present, we are not planning to use any config data from @@ -1014,7 +1009,7 @@ void Main_thread_routine(void *private) // start rtl to make sure timer doesn't timeout. This timer is being // reset from the rtl task. // TEMP -- watchdog timers not enabled yet -// TRAC_INFO("Initializing watchdog timers."); +// MAIN_TRAC_INFO("Initializing watchdog timers."); // initWatchdogTimers(); CHECKPOINT(WATCHDOG_INITIALIZED); @@ -1027,14 +1022,6 @@ void Main_thread_routine(void *private) initMainThrdSemAndTimer(); CHECKPOINT(SEMS_AND_TIMERS_INITIALIZED); - //Initialize the Applet Manager - // This needs to be done before initThreadScheduler because command line - // handler thread might start using applet as soon as it starts. Command - // line handler thread is started as part of the initThreadScheduler along - // with product and test applet thread. - initAppletManager(); - CHECKPOINT(APPLETS_INITIALIZED); - //Initialize the thread scheduler. //Other thread initialization is done here so that don't have to handle // blocking commnad handler thread as FSP might start communicating @@ -1102,7 +1089,7 @@ void Main_thread_routine(void *private) */ if ( l_ssxrc != SSX_OK ) { - TRAC_ERR("thermal Semaphore pending failure RC[0x%08X]", -l_ssxrc ); + MAIN_TRAC_ERR("thermal Semaphore pending failure RC[0x%08X]", -l_ssxrc ); } else { @@ -1118,7 +1105,7 @@ void Main_thread_routine(void *private) if( l_ssxrc != SSX_OK) { - TRAC_ERR("health monitor Semaphore pending failure RC[0x%08X]", + MAIN_TRAC_ERR("health monitor Semaphore pending failure RC[0x%08X]", -l_ssxrc ); } else @@ -1136,7 +1123,7 @@ void Main_thread_routine(void *private) if( l_ssxrc != SSX_OK) { - TRAC_ERR("FFDC Semaphore pending failure RC[0x%08X]",-l_ssxrc ); + MAIN_TRAC_ERR("FFDC Semaphore pending failure RC[0x%08X]",-l_ssxrc ); } else { @@ -1323,12 +1310,12 @@ int main(int argc, char **argv) CHECKPOINT(TRACE_INITIALIZED); - TRAC_INFO("Inside OCC Main"); + MAIN_TRAC_INFO("Inside OCC Main"); // Trace what happened before ssx initialization - TRAC_INFO("HOMER accessed, rc=%d, version=%d, ssx_rc=%d", + MAIN_TRAC_INFO("HOMER accessed, rc=%d, version=%d, ssx_rc=%d", l_homerrc, l_homer_version, l_ssxrc); - TRAC_INFO("HOMER accessed, rc=%d, nest_freq=%d, ssx_rc=%d", + MAIN_TRAC_INFO("HOMER accessed, rc=%d, nest_freq=%d, ssx_rc=%d", l_homerrc2, l_tb_freq_hz, l_ssxrc2); // Handle any errors from the version access @@ -1366,7 +1353,7 @@ int main(int argc, char **argv) G_occ_interrupt_type = PSIHB_INTERRUPT; } - TRAC_INFO("HOMER accessed, rc=%d, host interrupt type=%d, ssx_rc=%d", + MAIN_TRAC_INFO("HOMER accessed, rc=%d, host interrupt type=%d, ssx_rc=%d", l_homerrc, l_occ_int_type, l_ssxrc); // Handle any errors from the interrupt type access @@ -1395,7 +1382,7 @@ int main(int argc, char **argv) OCC_SET_FIR_MASTER(FIR_OCC_NOT_FIR_MASTER); } - TRAC_INFO("HOMER accessed, rc=%d, FIR master=%d, ssx_rc=%d", + MAIN_TRAC_INFO("HOMER accessed, rc=%d, FIR master=%d, ssx_rc=%d", l_homerrc, l_fir_master, l_ssxrc); // Handle any errors from the FIR master access @@ -1406,14 +1393,14 @@ int main(int argc, char **argv) // If this OCC is the FIR master read in the FIR collection parms if (OCC_IS_FIR_MASTER()) { - TRAC_IMP("I am the FIR master"); + MAIN_TRAC_IMP("I am the FIR master"); // Read the FIR parms buffer l_homerrc = homer_hd_map_read_unmap(HOMER_FIR_PARMS, &G_fir_data_parms[0], &l_ssxrc); - TRAC_INFO("HOMER accessed, rc=%d, FIR parms buffer 0x%x, ssx_rc=%d", + MAIN_TRAC_INFO("HOMER accessed, rc=%d, FIR parms buffer 0x%x, ssx_rc=%d", l_homerrc, &G_fir_data_parms[0], l_ssxrc); // Handle any errors from the FIR master access @@ -1455,7 +1442,7 @@ int main(int argc, char **argv) if( SSX_OK != l_rc) { - TRAC_ERR("Failure creating/resuming main thread: rc: 0x%x", -l_rc); + MAIN_TRAC_ERR("Failure creating/resuming main thread: rc: 0x%x", -l_rc); /* @ * @errortype * @moduleid MAIN_MID diff --git a/src/occ_405/occLinkInputFile b/src/occ_405/occLinkInputFile index 0055a07..a3070a1 100644 --- a/src/occ_405/occLinkInputFile +++ b/src/occ_405/occLinkInputFile @@ -1,6 +1,6 @@ INPUT ( - appletManager.o apss.o + cmdh_dbug_cmd.o cmdh_fsp.o cmdh_fsp_cmds.o cmdh_fsp_cmds_datacnfg.o @@ -20,6 +20,7 @@ INPUT ( timer.o trac_interface.o scom.o + sensor_query_list.o state.o ssx_core.o ssx_init.o diff --git a/src/occ_405/occ_service_codes.h b/src/occ_405/occ_service_codes.h index a26cdce..fad1ecf 100644 --- a/src/occ_405/occ_service_codes.h +++ b/src/occ_405/occ_service_codes.h @@ -140,13 +140,6 @@ enum occExtReasonCode ERC_PROC_CONTROL_TASK_FAILURE = 0x0000001a, - ERC_MMU_MAP_APPLET_READ_FAILURE = 0x0000001b, - ERC_MMU_MAP_APPLET_WRITE_FAILURE = 0x0000001c, - ERC_MMU_MAP_APPLET_OVERWRITE_FAILURE = 0x0000001d, - ERC_MMU_UNMAP_APPLET_READ_FAILURE = 0x0000001e, - ERC_MMU_UNMAP_APPLET_WRITE_FAILURE = 0x0000001f, - ERC_MMU_UNMAP_APPLET_OVERWRITE_FAILURE = 0x00000020, - ERC_CENTAUR_PORE_FLEX_CREATE_FAILURE = 0x00000021, ERC_CENTAUR_PORE_FLEX_SCHEDULE_FAILURE = 0x00000022, ERC_CENTAUR_INTERNAL_FAILURE = 0x00000023, @@ -218,6 +211,7 @@ enum occModuleId HMON_ROUTINE_MID = MAIN_COMP_ID | 0x0c, AMEC_VERIFY_FREQ_MID = MAIN_COMP_ID | 0x0d, FIR_DATA_MID = MAIN_COMP_ID | 0x0e, + CMDH_DBUG_MID = MAIN_COMP_ID | 0x0f, }; enum occUserDataType diff --git a/src/occ_405/proc/proc_data.c b/src/occ_405/proc/proc_data.c index 8b0bda8..f1ce85c 100755 --- a/src/occ_405/proc/proc_data.c +++ b/src/occ_405/proc/proc_data.c @@ -753,7 +753,6 @@ void print_core_data_sensors(uint8_t core) PROC_DBG("\n-------------------------------\n"); PROC_DBG("Core [%x] Sensors Data \n", core); // TODO: Commented these out b/c they take too long to run in task. - // Consider moving this to an applet //dumpHexString(&l_core_data->sensors_tod, sizeof(l_core_data->sensors_tod), "Sensor TOD"); //dumpHexString(&l_core_data->sensors_v0, sizeof(l_core_data->sensors_v0), "Sensor VO"); //dumpHexString(&l_core_data->sensors_v1, sizeof(l_core_data->sensors_v1), "Sensor V1"); @@ -785,7 +784,6 @@ void print_core_status(uint8_t core) PROC_DBG("\n-------------------------\n"); PROC_DBG("Core [%x] status \n", core); // TODO: Commented these out b/c they take too long to run in task. - // Consider moving this to an applet //dumpHexString(&l_core_data->core_tod, sizeof(l_core_data->core_tod), "Core TOD"); //dumpHexString(&l_core_data->core_raw_cycles, sizeof(l_core_data->core_raw_cycles), "Core Raw Cycles"); //dumpHexString(&l_core_data->core_run_cycles, sizeof(l_core_data->core_run_cycles), "Run Cycles"); @@ -822,7 +820,6 @@ void print_fast_core_data(void) { PROC_DBG("\n---------------------------\n"); // TODO: Commented these out b/c they take too long to run in task. - // Consider moving this to an applet //dumpHexString(&l_fast_core_data->tod, sizeof(l_fast_core_data->tod), "Fast Core Data TOD"); //dumpHexString(&l_fast_core_data->core_data, sizeof(fast_core_data_t) * MAX_NUM_HW_CORES, "Fast Core Data"); PROC_DBG("\n"); diff --git a/src/occ_405/proc/proc_pstate.c b/src/occ_405/proc/proc_pstate.c index ab225e6..870e1b4 100755 --- a/src/occ_405/proc/proc_pstate.c +++ b/src/occ_405/proc/proc_pstate.c @@ -32,8 +32,7 @@ #include "occ_common.h" #include "state.h" #include "cmdh_fsp_cmds.h" -#include "cmdhDbugCmd.h" -#include "appletManager.h" +#include "cmdh_cbug_cmd.h" #include "gpsm.h" #include "pstates.h" #include "proc_data.h" diff --git a/src/occ_405/proc/proc_pstate.h b/src/occ_405/proc/proc_pstate.h index 928dec5..f775bd2 100755 --- a/src/occ_405/proc/proc_pstate.h +++ b/src/occ_405/proc/proc_pstate.h @@ -27,15 +27,14 @@ #define PROC_PSTATE_H #include "ssx.h" -//#include "cmdh_service_codes.h" +#include "cmdh_service_codes.h" #include "errl.h" #include "trac.h" #include "rtls.h" #include "occ_common.h" #include "state.h" -//#include "cmdh_fsp_cmds.h" -//#include "cmdhDbugCmd.h" -#include "appletManager.h" +#include "cmdh_fsp_cmds.h" +#include "cmdh_dbug_cmd.h" //#include "gpsm.h" //#include "pstates.h" diff --git a/src/occApplet/productApplet/dpssInitApplet.c b/src/occ_405/pss/dpss_init.c index ef9c777..a0fe31c 100755 --- a/src/occApplet/productApplet/dpssInitApplet.c +++ b/src/occ_405/pss/dpss_init.c @@ -1,14 +1,14 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/occApplet/productApplet/dpssInitApplet.c $ */ +/* $Source: src/occ_405/pss/dpss_init.c $ */ /* */ /* OpenPOWER OnChipController Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ -/* [+] Google Inc. */ +/* Contributors Listed Below - COPYRIGHT 2015 */ /* [+] International Business Machines Corp. */ /* */ +/* */ /* 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 */ @@ -23,9 +23,9 @@ /* */ /* IBM_PROLOG_END_TAG */ -//************************************************************************* +//*************************************************************************/ // Includes -//************************************************************************* +//*************************************************************************/ #include <common_types.h> // imageHdr_t declaration and image header macro #include <errl.h> // For error handle #include <dpss.h> @@ -34,39 +34,37 @@ #include <occ_service_codes.h> // for SSX_GENERIC_FAILURE #include <pss_service_codes.h> #include <state.h> -#include <appletId.h> // For applet ID num -//************************************************************************* +//*************************************************************************/ // Externs -//************************************************************************* +//*************************************************************************/ extern PoreEntryPoint GPE_dpss_send_command_stream; extern PoreFlex G_dpss_read_status_request; extern gpeDpssCommandStream_t G_gpe_dpss_read_status; -//************************************************************************* +//*************************************************************************/ // Macros -//************************************************************************* +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Defines/Enums -//************************************************************************* -#define DPSSINITAPPLET_ID "DPSS_Init_Aplt\0" +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Structures -//************************************************************************* +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Globals -//************************************************************************* +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Function Prototypes -//************************************************************************* +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Functions -//************************************************************************* +//*************************************************************************/ // Function Specification // @@ -285,8 +283,3 @@ errlHndl_t dpssInitApplet(void * i_arg) return l_errl; } -/*****************************************************************************/ -// Image Header -/*****************************************************************************/ -IMAGE_HEADER(G_dpssInitApplet, dpssInitApplet, DPSSINITAPPLET_ID, OCC_APLT_INVALID); - diff --git a/src/occ_405/sensor/sensor_info.c b/src/occ_405/sensor/sensor_info.c index d23f2aa..89d7578 100755 --- a/src/occ_405/sensor/sensor_info.c +++ b/src/occ_405/sensor/sensor_info.c @@ -23,11 +23,6 @@ /* */ /* IBM_PROLOG_END_TAG */ -#ifndef APPLET_BUILD -#warning "This file is only in OCC App Source Tree for convenience of updating sensors in one place." -#error "This file can only be included and built into an applet due to large table size" -#endif - #include <occ_common.h> // STATIC_ASSERT macro #include <sensor.h> // For Sensor defines diff --git a/src/occApplet/productApplet/sensorQueryList.c b/src/occ_405/sensor/sensor_query_list.c index cbc2493..b7cede7 100755 --- a/src/occApplet/productApplet/sensorQueryList.c +++ b/src/occ_405/sensor/sensor_query_list.c @@ -1,14 +1,14 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/occApplet/productApplet/sensorQueryList.c $ */ +/* $Source: src/occ_405/sensor/sensor_query_list.c $ */ /* */ /* OpenPOWER OnChipController Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ -/* [+] Google Inc. */ +/* Contributors Listed Below - COPYRIGHT 2015 */ /* [+] International Business Machines Corp. */ /* */ +/* */ /* 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 */ @@ -23,9 +23,9 @@ /* */ /* IBM_PROLOG_END_TAG */ -//************************************************************************* +//*************************************************************************/ // Includes -//************************************************************************* +//*************************************************************************/ #include <common_types.h> // imageHdr_t declaration and image header macro #include <occ_common.h> // imageHdr_t declaration and image header macro #include <errl.h> // For error handle @@ -34,43 +34,41 @@ #include <sensor_service_codes.h> // sensor module ids #include <occ_service_codes.h> // sensor module ids #include <sensor.h> // For Sensor defines -#include <sensorQueryList.h> // For args to applet -#include <appletId.h> // For applet ID num +#include <sensor_query_list.h> // For args to command /*****************************************************************************/ -// C Source File Includes for this Applet -// Must be done to give this applet access to the G_sensor_info sensor list +// C Source File Includes +// Must be done to give access to the G_sensor_info sensor list /*****************************************************************************/ #include "sensor_info.c" -//************************************************************************* +//*************************************************************************/ // Externs -//************************************************************************* +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Macros -//************************************************************************* +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Defines/Enums -//************************************************************************* -#define SENSOR_QUERY_ID "SNSR QueryList\0" +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Structures -//************************************************************************* +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Globals -//************************************************************************* +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Function Prototypes -//************************************************************************* +//*************************************************************************/ -//************************************************************************* +//*************************************************************************/ // Functions -//************************************************************************* +//*************************************************************************/ // Function Specification // @@ -81,6 +79,8 @@ // End Function Specification void printSensorInfo(uint16_t i_gsid) { +/* TEMP -- NOT SUPPORTED (NEED AMEC/DCOM) */ +#if 0 // Initialize variable j and k with NULL and then // point to sensor to avoid compilation error when SNSR_DEBUG is not // defined. j and k are only used with SNSR_DBG which is no-op statement @@ -112,6 +112,7 @@ void printSensorInfo(uint16_t i_gsid) (uint32_t)k->mini_sensor, (NULL != j) ? *j : 0 ); +#endif } // Function Specification @@ -143,13 +144,14 @@ void printAllSensors(void) // Description: Query sensor list // // End Function Specification -errlHndl_t querySensorList(const querySensorListAppletArg_t * i_argPtr) +errlHndl_t querySensorList(const querySensorListArg_t * i_argPtr) { errlHndl_t l_err = NULL; - +/* TEMP -- NOT SUPPORTED ( NEED AMEC/DCOM ) */ +#if 0 if (i_argPtr != NULL) { - uint16_t i_startGsid = i_argPtr->i_startGsid; + uint16_t i_startGsid = i_argPtr->i_startGsid; uint8_t i_present = i_argPtr->i_present; uint16_t i_type = i_argPtr->i_type; uint16_t i_loc = i_argPtr->i_loc; @@ -162,7 +164,7 @@ errlHndl_t querySensorList(const querySensorListAppletArg_t * i_argPtr) ((o_sensors == NULL) && (o_sensorInfoPtrs ==NULL)) || (io_numOfSensors == NULL)) { - TRAC_ERR("Invalid input pointers OR start GSID is out of range: " + TRAC_ERR("querySensorList: Invalid input pointers OR start GSID is out of range: " "i_startGsid: 0x%x, G_amec_sensor_count: 0x%x", i_startGsid,G_amec_sensor_count); @@ -183,7 +185,7 @@ errlHndl_t querySensorList(const querySensorListAppletArg_t * i_argPtr) * @userdata1 i_startGsid -- passed in Global Sensor ID * @userdata2 G_amec_sensor_count -- number of OCC sensors * @userdata4 OCC_NO_EXTENDED_RC - * @devdesc NULL pointer passed for querySensorList applet output args + * @devdesc NULL pointer passed for querySensorList output args */ l_err = createErrl(SENSOR_QUERY_LIST, //modId ((i_startGsid >= NUMBER_OF_SENSORS_IN_LIST) ? INTERNAL_INVALID_INPUT_DATA : INTERNAL_FAILURE), //reasoncode @@ -252,7 +254,7 @@ errlHndl_t querySensorList(const querySensorListAppletArg_t * i_argPtr) } else { - TRAC_ERR("Invalid applet argument pointer = NULL"); + TRAC_ERR("querySensorList: Invalid argument pointer = NULL"); /* @ * @errortype @@ -274,11 +276,6 @@ errlHndl_t querySensorList(const querySensorListAppletArg_t * i_argPtr) 0 // UserData 2 ); } - +#endif return l_err; } - -/*****************************************************************************/ -// Image Header -/*****************************************************************************/ -IMAGE_HEADER(G_querySensorList, querySensorList, SENSOR_QUERY_ID, OCC_APLT_SNSR_QUERY); diff --git a/src/occ_405/aplt/incl/sensorQueryList.h b/src/occ_405/sensor/sensor_query_list.h index e582633..4e9f82b 100755 --- a/src/occ_405/aplt/incl/sensorQueryList.h +++ b/src/occ_405/sensor/sensor_query_list.h @@ -1,7 +1,7 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/occ_405/aplt/incl/sensorQueryList.h $ */ +/* $Source: src/occ_405/sensor/sensor_query_list.h $ */ /* */ /* OpenPOWER OnChipController Project */ /* */ @@ -46,7 +46,7 @@ //************************************************************************* // Structures //************************************************************************* -// Structure that is passed into querySensorList applet +// Structure that is passed into querySensorList command // when it is called typedef struct { @@ -57,7 +57,7 @@ typedef struct uint16_t * io_numOfSensors; sensorQueryList_t * o_sensors; sensor_info_t * o_sensorInfoPtrs; -} querySensorListAppletArg_t; +} querySensorListArg_t; //************************************************************************* // Globals @@ -66,6 +66,7 @@ typedef struct //************************************************************************* // Function Prototypes //************************************************************************* +errlHndl_t querySensorList(const querySensorListArg_t * i_argPtr); //************************************************************************* // Functions diff --git a/src/occ_405/ssx_app_cfg.h b/src/occ_405/ssx_app_cfg.h index 9ab733a..f210acf 100755 --- a/src/occ_405/ssx_app_cfg.h +++ b/src/occ_405/ssx_app_cfg.h @@ -162,7 +162,7 @@ do { \ #ifndef SIMICS_ENVIRONMENT #define SIMICS_ENVIRONMENT 1 -#warning Building for Simics! +#pragma message "Building for Simics!" #endif #ifndef USE_SIMICS_IO diff --git a/src/occ_405/thread/thread.h b/src/occ_405/thread/thread.h index 3106a7c..7ed96a9 100755 --- a/src/occ_405/thread/thread.h +++ b/src/occ_405/thread/thread.h @@ -53,8 +53,6 @@ typedef enum extern uint8_t main_thread_stack[THREAD_STACK_SIZE]; extern uint8_t Cmd_hndl_thread_stack[THREAD_STACK_SIZE]; -extern uint8_t App_thread_stack[THREAD_STACK_SIZE]; -extern uint8_t testAppletThreadStack[THREAD_STACK_SIZE]; /*----------------------------------------------------------*/ /* SsxThread Declaration */ @@ -67,22 +65,12 @@ extern SsxThread Main_thread; extern SsxThread Cmd_Hndl_thread; // Application manager thread -extern SsxThread App_thread; - -// Test applet thread -extern SsxThread TestAppletThread; - -// Application manager thread extern SsxThread Dcom_thread; void Main_thread_routine(void *private); void Cmd_Hndl_thread_routine(void *arg); -void App_thread_routine(void *arg); - void Dcom_thread_routine(void *arg); -void testAppletThreadRoutine(void *arg); - #endif //_THREAD_H diff --git a/src/occ_405/thread/threadSch.c b/src/occ_405/thread/threadSch.c index c91c91f..47df432 100755 --- a/src/occ_405/thread/threadSch.c +++ b/src/occ_405/thread/threadSch.c @@ -28,7 +28,6 @@ #include "ssx.h" #include "thread_service_codes.h" #include "occ_service_codes.h" -#include <appletManager.h> #include <trac.h> #include <state.h> #include "cmdh_snapshot.h" @@ -51,23 +50,15 @@ SsxThread* G_scheduledThreads[] = { &Main_thread, &Cmd_Hndl_thread, - &App_thread, - &TestAppletThread, // &Dcom_thread, }; // Error log counter for the callback so that only 1 error log is created uint8_t G_threadSwapErrlCounter = 0; -// Global for the parameter to the applet thread routine -OCC_APLT_TYPE G_apltPdtType = APLT_TYPE_PRODUCT; -OCC_APLT_TYPE G_apltTestType = APLT_TYPE_TEST; - //Thread Stacks uint8_t main_thread_stack[THREAD_STACK_SIZE]; uint8_t Cmd_hndl_thread_stack[THREAD_STACK_SIZE]; -uint8_t App_thread_stack[THREAD_STACK_SIZE]; -uint8_t testAppletThreadStack[THREAD_STACK_SIZE]; uint8_t dcomThreadStack[THREAD_STACK_SIZE]; // Our idle thread. See main_thread_routine @@ -76,12 +67,6 @@ SsxThread Main_thread; // Command handler thread SsxThread Cmd_Hndl_thread; -// Application manager thread -SsxThread App_thread; - -// Test applet thread -SsxThread TestAppletThread; - // Dcom thread SsxThread Dcom_thread; @@ -114,7 +99,7 @@ int createAndResumeThreadHelper(SsxThread *io_thread, //check for errors creating a thread if(l_rc != SSX_OK) { - TRAC_ERR("Failure creating thread. rc: 0x%x", -l_rc); + MAIN_TRAC_ERR("Failure creating thread. rc: 0x%x", -l_rc); } else { @@ -137,10 +122,8 @@ int createAndResumeThreadHelper(SsxThread *io_thread, void initThreadScheduler(void) { // Locals - int l_appThreadRc = SSX_OK; int l_cmdThreadRc = SSX_OK; int l_timerRc = SSX_OK; - int l_testAppletThreadRc = SSX_OK; int l_dcomThreadRc = SSX_OK; int l_snapshotTimerRc = SSX_OK; @@ -156,19 +139,6 @@ void initThreadScheduler(void) THREAD_STACK_SIZE, THREAD_PRIORITY_3); - l_appThreadRc = createAndResumeThreadHelper(&App_thread, - App_thread_routine, - (void *)&G_apltPdtType, - (SsxAddress)App_thread_stack, - THREAD_STACK_SIZE, - THREAD_PRIORITY_4); - - l_testAppletThreadRc = createAndResumeThreadHelper(&TestAppletThread, - App_thread_routine, - (void *)&G_apltTestType, - (SsxAddress)testAppletThreadStack, - THREAD_STACK_SIZE, - THREAD_PRIORITY_5); /* TEMP -- NOT USED IN PHASE1 l_dcomThreadRc = createAndResumeThreadHelper(&Dcom_thread, Dcom_thread_routine, @@ -183,13 +153,13 @@ void initThreadScheduler(void) // Check for errors creating the timer if(l_timerRc == SSX_OK) { - TRAC_INFO("timer created and scheduled"); + MAIN_TRAC_INFO("timer created and scheduled"); //schedule the timer so that it runs every THREAD_TIME_SLICE l_timerRc = ssx_timer_schedule(&G_threadSchTimer, 1, THREAD_TIME_SLICE); } else { - TRAC_INFO("Error creating timer: RC: %d", l_timerRc); + MAIN_TRAC_INFO("Error creating timer: RC: %d", l_timerRc); } /* TEMP -- NOT USED IN PHASE1 @@ -202,31 +172,27 @@ void initThreadScheduler(void) l_snapshotTimerRc = ssx_timer_schedule(&G_snapshotTimer, 0, SSX_SECONDS(30)); if (l_snapshotTimerRc != SSX_OK) { - TRAC_ERR("cmdh_snapshot_sync: reseting the snapshot timer failed."); + MAIN_TRAC_ERR("cmdh_snapshot_sync: reseting the snapshot timer failed."); } } else { - TRAC_INFO("Error creating timer: RC: %d", l_snapshotTimerRc); + MAIN_TRAC_INFO("Error creating timer: RC: %d", l_snapshotTimerRc); } */ // If there are any errors creating the threads or starting the // timer create an error log to pass back. - if( l_appThreadRc - || l_testAppletThreadRc - || l_cmdThreadRc + if( l_cmdThreadRc || l_dcomThreadRc || l_timerRc || l_snapshotTimerRc ) { - TRAC_ERR("Error creating thread: l_appThreadRc: %d, " - "l_testAppletThreadRc: %d, l_cmdThreadRc: %d, " - "l_dcomThreadRc: %d", l_appThreadRc,l_testAppletThreadRc, - l_timerRc,l_cmdThreadRc,l_dcomThreadRc); + MAIN_TRAC_ERR("Error creating thread: snapshopTimerTc: %d, " + "timerRc: %d, cmdThreadRc: %d, dcomThreadRc: %d" + l_snapshotTimerRc, l_timerRc, + l_cmdThreadRc,l_dcomThreadRc); - TRAC_ERR("Error starting timers: timerRc: %d, snapshotTimerRc: %d.", - l_timerRc, l_snapshotTimerRc); // Create error log and log it // TODO use correct trace tracDesc_t l_trace = NULL; diff --git a/src/occ_405/topfiles.mk b/src/occ_405/topfiles.mk index 5648f37..920a81c 100644 --- a/src/occ_405/topfiles.mk +++ b/src/occ_405/topfiles.mk @@ -22,7 +22,7 @@ # permissions and limitations under the License. # # IBM_PROLOG_END_TAG -TOP-C-SOURCES = aplt/appletManager.c \ +TOP-C-SOURCES = cmdh/cmdh_dbug_cmd.c \ cmdh/cmdh_fsp.c \ cmdh/cmdh_fsp_cmds.c \ cmdh/cmdh_fsp_cmds_datacnfg.c \ @@ -41,6 +41,9 @@ TOP-C-SOURCES = aplt/appletManager.c \ rtls/rtls.c \ rtls/rtls_tables.c \ scom.c \ + sensor/sensor.c \ + sensor/sensor_query_list.c \ + sensor/sensor_table.c \ state.c \ thread/threadSch.c \ thread/thrm_thread.c \ diff --git a/src/occ_405/trac/trac.h b/src/occ_405/trac/trac.h index 42d2e8a..bec77b3 100755 --- a/src/occ_405/trac/trac.h +++ b/src/occ_405/trac/trac.h @@ -136,16 +136,6 @@ extern void dumpHexString(const void *i_data, const unsigned int len, const char #define SNPS_TRAC_IMP(frmt,args...) \ TRAC_IMP(SNPS_MRK frmt, ##args) -// Tracing for applets -#define APLT_TRAC_ERR(frmt,args...) \ - TRAC_ERR(APLT_MRK frmt, ##args) - -#define APLT_TRAC_INFO(frmt,args...) \ - TRAC_INFO(APLT_MRK frmt, ##args) - -#define APLT_TRAC_IMP(frmt,args...) \ - TRAC_IMP(APLT_MRK frmt, ##args) - // Tracing for interrupts (RTL, oversubscription, etc) #define INTR_TRAC_ERR(frmt,args...) \ TRAC_ERR(INTR_MRK frmt, ##args) |