From 4141b5f5fef2ba4b444aabbda1677e7f583cd4e8 Mon Sep 17 00:00:00 2001 From: Andres Lugo-Reyes Date: Mon, 19 Dec 2016 14:22:12 -0600 Subject: [PATCH] Initial Wof commit Contains initial WOF directory structure Change-Id: I24ec77ca11dc711ff44c0b378f64d96696838ee1 RTC:130216 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/34298 Tested-by: FSP CI Jenkins Reviewed-by: Martha Broyles Reviewed-by: William A. Bryan --- src/occ_405/Makefile | 3 ++- src/occ_405/amec/amec_slave_smh.c | 37 +++++++++++++++++++++++++++- src/occ_405/img_defs.mk | 1 + src/occ_405/incl/comp_ids.h | 6 ++++- src/occ_405/occLinkInputFile | 3 ++- src/occ_405/topfiles.mk | 3 ++- src/occ_405/wof/wof.c | 31 ++++++++++++++++++++++++ src/occ_405/wof/wof.h | 40 +++++++++++++++++++++++++++++++ 8 files changed, 119 insertions(+), 5 deletions(-) create mode 100644 src/occ_405/wof/wof.c create mode 100644 src/occ_405/wof/wof.h diff --git a/src/occ_405/Makefile b/src/occ_405/Makefile index ccd0c8bf..3fb12501 100755 --- a/src/occ_405/Makefile +++ b/src/occ_405/Makefile @@ -68,7 +68,8 @@ LIB_DIRS = -L$(OBJDIR) \ -L$(OBJDIR)/proc \ -L$(OBJDIR)/firdata \ -L$(OBJDIR)/cent \ - -L$(OBJDIR)/mem + -L$(OBJDIR)/mem \ + -L$(OBJDIR)/wof #default target is to make a binary application image .PHONY : all diff --git a/src/occ_405/amec/amec_slave_smh.c b/src/occ_405/amec/amec_slave_smh.c index dd356520..1385e8b8 100755 --- a/src/occ_405/amec/amec_slave_smh.c +++ b/src/occ_405/amec/amec_slave_smh.c @@ -5,7 +5,7 @@ /* */ /* OpenPOWER OnChipController Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2016 */ +/* Contributors Listed Below - COPYRIGHT 2011,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -55,6 +55,7 @@ #include #include #include +#include //************************************************************************* // Externs @@ -517,6 +518,40 @@ void amec_slv_state_4(void) //------------------------------------------------------- amec_update_centaur_sensors(CENTAUR_4); */ + + //------------------------------------------------------- + // Run WOF Algorithm + //------------------------------------------------------- + if( IS_OCC_STATE_ACTIVE() ) + { + /* TODO: RTC: 166301 - Logic to determine if WOF algorithm should run. + static bool run_wof_algoritm = true; + + if( !run_wof_algorithm ) + { + // When false, the last invocation decided we need to wait 2 ms + // run wof algo next time. + run_wof_algorithm = true; + } + else + { + //if IPC command is idle and ready to go + //{ + //wof_main(); + run_wof_algorithm = false; + //} + //else if IPC command is still waiting + //make thread wait another 2 ms + //{ + // run_wof_algorithm = true; + //} + //else if IPC command is returning an error + //{ + // flag the error, request a reset + //} + } + */ + } } diff --git a/src/occ_405/img_defs.mk b/src/occ_405/img_defs.mk index 529bdf21..abdef459 100644 --- a/src/occ_405/img_defs.mk +++ b/src/occ_405/img_defs.mk @@ -238,6 +238,7 @@ APP_INCLUDES = -I$(IMAGE_SRCDIR)/rtls \ -I$(IMAGE_SRCDIR)/dimm \ -I$(IMAGE_SRCDIR)/mem \ -I$(IMAGE_SRCDIR)/lock \ + -I$(IMAGE_SRCDIR)/wof \ -I$(IMAGE_SRCDIR)/../common \ INCLUDES += $(IMG_INCLUDES) $(GLOBAL_INCLUDES) $(APP_INCLUDES) \ diff --git a/src/occ_405/incl/comp_ids.h b/src/occ_405/incl/comp_ids.h index 08457542..893b9f9c 100755 --- a/src/occ_405/incl/comp_ids.h +++ b/src/occ_405/incl/comp_ids.h @@ -5,7 +5,7 @@ /* */ /* OpenPOWER OnChipController Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2015 */ +/* Contributors Listed Below - COPYRIGHT 2011,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -87,5 +87,9 @@ // MEMORY Control #define MEM_COMP_ID 0x1000 #define MEM_COMP_NAME "MEM" + +// Workload Optimize Frequency +#define WOF_COMP_ID 0x1100 +#define WOF_COMP_NAME "WOF" #endif diff --git a/src/occ_405/occLinkInputFile b/src/occ_405/occLinkInputFile index acca23c8..16dbd5fa 100644 --- a/src/occ_405/occLinkInputFile +++ b/src/occ_405/occLinkInputFile @@ -94,4 +94,5 @@ INPUT ( amec_amester.o state.o threadSch.o timer.o - trac_interface.o) + trac_interface.o + wof.o) diff --git a/src/occ_405/topfiles.mk b/src/occ_405/topfiles.mk index 575b9b32..c5c16a07 100644 --- a/src/occ_405/topfiles.mk +++ b/src/occ_405/topfiles.mk @@ -89,7 +89,8 @@ TOP-C-SOURCES = amec/amec_analytics.c \ thread/chom.c \ thread/threadSch.c \ timer/timer.c \ - trac/trac_interface.c + trac/trac_interface.c \ + wof/wof.c TOP-S-SOURCES = cmdh/ll_ffdc.S \ diff --git a/src/occ_405/wof/wof.c b/src/occ_405/wof/wof.c new file mode 100644 index 00000000..2adde1fd --- /dev/null +++ b/src/occ_405/wof/wof.c @@ -0,0 +1,31 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/occ_405/wof/wof.c $ */ +/* */ +/* OpenPOWER OnChipController Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* [+] 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 */ +#include +#include +#include "wof.h" + + + + diff --git a/src/occ_405/wof/wof.h b/src/occ_405/wof/wof.h new file mode 100644 index 00000000..ba193833 --- /dev/null +++ b/src/occ_405/wof/wof.h @@ -0,0 +1,40 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/occ_405/wof/wof.h $ */ +/* */ +/* OpenPOWER OnChipController Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* [+] 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 _WOF_H +#define _WOF_H + + + + + +//****************************************************************************** +// Globals +//****************************************************************************** + +//****************************************************************************** +// Function Prototypes +//****************************************************************************** + +#endif