summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/include/runtime/interface.h45
-rw-r--r--src/include/usr/hwpf/hwp/occ/occ.H27
-rw-r--r--src/include/usr/hwpf/hwpf_reasoncodes.H1
-rw-r--r--src/include/usr/targeting/common/util.H12
-rw-r--r--src/include/usr/util/utillidmgr.H12
-rw-r--r--src/makefile3
-rw-r--r--src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.mk77
-rw-r--r--src/usr/hwpf/hwp/build_winkle_images/makefile57
-rw-r--r--src/usr/hwpf/hwp/build_winkle_images/runtime/makefile36
-rw-r--r--src/usr/hwpf/hwp/occ/makefile58
-rw-r--r--src/usr/hwpf/hwp/occ/occ.C50
-rw-r--r--src/usr/hwpf/hwp/occ/occ.mk78
-rw-r--r--src/usr/hwpf/hwp/occ/runtime/makefile37
-rw-r--r--src/usr/hwpf/hwp/occ/runtime/rt_occ.C556
-rw-r--r--src/usr/hwpf/hwp/start_payload/start_payload.C4
-rw-r--r--src/usr/hwpf/test/runtime/makefile3
-rw-r--r--src/usr/hwpf/test/runtime/rt_occtest.H95
-rw-r--r--src/usr/runtime/makefile2
-rw-r--r--src/usr/targeting/common/util.C15
-rw-r--r--src/usr/util/runtime/utillidmgr_rt.C14
20 files changed, 1030 insertions, 152 deletions
diff --git a/src/include/runtime/interface.h b/src/include/runtime/interface.h
index 4ff5e0687..eccf39bbd 100644
--- a/src/include/runtime/interface.h
+++ b/src/include/runtime/interface.h
@@ -150,6 +150,51 @@ typedef struct runtimeInterfaces
*/
void (*cxxtestExecute)(void*);
+ /** Get a list of lids numbers of the lids known to HostBoot
+ *
+ * @param[out] o_num - the number of lids in the list
+ * @return a pointer to the list
+ */
+ const uint32_t * (*get_lid_list)(size_t * o_num);
+
+ /** Load OCC Image and common data into mainstore, also setup OCC BARSs
+ *
+ * @param[in] i_homer_addr_phys - The physical mainstore address of the
+ * start of the HOMER image
+ * @param[in] i_homer_addr_va - Virtual memory address of the HOMER image
+ * @param[in] i_common_addr_phys - The physical mainstore address of the
+ * OCC common area.
+ * @param[in] i_common_addr_va - Virtual memory address of the common area
+ * @param[in] i_proc_chip - The processor chip id
+ * @return 0 on success else return code
+ */
+ int(*loadOCC)(uint64_t i_homer_addr_phys,
+ uint64_t i_homer_addr_va,
+ uint64_t i_common_addr_phys,
+ uint64_t i_common_addr_va,
+ uint64_t i_proc_chip);
+
+ /** Start OCC on all chips, by module
+ *
+ * @param[in] i_proc_chip - Array of functional processor chip ids
+ * @Note The caller must include a complete modules worth of chips
+ * @param[in] i_num_chips - Number of chips in the array
+ * @return 0 on success else return code
+ */
+ int (*startOCCs)(uint64_t* i_proc_chip,
+ size_t i_num_chips);
+
+ /** Stop OCC hold OCCs in reset
+ *
+ * @param[in] i_proc_chip - Array of functional processor chip ids
+ * @Note The caller must include a complete modules worth of chips
+ * @param[in] i_num_chips - Number of chips in the array
+ * @return 0 on success else return code
+ */
+ int (*stopOCCs)(uint64_t* i_proc_chip,
+ size_t i_num_chips);
+
+
// Reserve some space for future growth.
void (*reserved[32])(void);
diff --git a/src/include/usr/hwpf/hwp/occ/occ.H b/src/include/usr/hwpf/hwp/occ/occ.H
index 3d1de46e0..f80c6411a 100644
--- a/src/include/usr/hwpf/hwp/occ/occ.H
+++ b/src/include/usr/hwpf/hwp/occ/occ.H
@@ -1,11 +1,11 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
-/* $Source: src/include/usr/hwpf/hwp/occ.H $ */
+/* $Source: src/include/usr/hwpf/hwp/occ/occ.H $ */
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2013 */
+/* COPYRIGHT International Business Machines Corp. 2013,2014 */
/* */
/* p1 */
/* */
@@ -23,8 +23,30 @@
#ifndef OCC_H_
#define OCC_H_
+#include <limits.h>
+#include <errl/errlentry.H>
+
namespace HBOCC {
+ struct occHostConfigDataArea_t
+ {
+ uint32_t version;
+ uint32_t nestFrequency;
+ };
+
+ enum
+ {
+ OccHostDataVersion = 1,
+ OCC_LIDID = 0x81e00430,
+ OCC_IBSCOM_RANGE_IN_MB = MEGABYTE,
+ };
+
+ enum occAction_t
+ {
+ OCC_START,
+ OCC_STOP,
+ };
+
/**
* @brief Starts OCCs on all Processors in the node
* This is intended to be used for AVP testing.
@@ -33,7 +55,6 @@ namespace HBOCC {
*/
errlHndl_t loadnStartAllOccs();
-
} //end OCC namespace
#endif
diff --git a/src/include/usr/hwpf/hwpf_reasoncodes.H b/src/include/usr/hwpf/hwpf_reasoncodes.H
index e3d41c75d..36b74686b 100644
--- a/src/include/usr/hwpf/hwpf_reasoncodes.H
+++ b/src/include/usr/hwpf/hwpf_reasoncodes.H
@@ -117,6 +117,7 @@ namespace fapi
RC_HOST_TIMER_EXPIRED = HWPF_COMP_ID | 0x2A,
RC_HOST_TIMER_THREAD_FAIL = HWPF_COMP_ID | 0x2B,
RC_NULL_POINTER = HWPF_COMP_ID | 0x2C,
+
RC_RT_WAKEUP_FAILED = HWPF_COMP_ID | 0x2D,
};
diff --git a/src/include/usr/targeting/common/util.H b/src/include/usr/targeting/common/util.H
index 34b95784e..090d3cfbb 100644
--- a/src/include/usr/targeting/common/util.H
+++ b/src/include/usr/targeting/common/util.H
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2013 */
+/* COPYRIGHT International Business Machines Corp. 2012,2014 */
/* */
/* p1 */
/* */
@@ -147,6 +147,16 @@ bool is_avp_load(void);
*/
uint64_t get_top_mem_addr(void);
+/**
+ * Order two processor targets by NODE_ID then CHIP_ID.
+ * @param[in] First processor target
+ * @param[in] Second processor target
+ * @return true if first target < second target
+ */
+bool orderByNodeAndPosition( Target* i_firstProc,
+ Target* i_secondProc);
+
+
}
#endif // __TARGETING_COMMON_UTIL_H
diff --git a/src/include/usr/util/utillidmgr.H b/src/include/usr/util/utillidmgr.H
index 53560faa8..93556c0ea 100644
--- a/src/include/usr/util/utillidmgr.H
+++ b/src/include/usr/util/utillidmgr.H
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2013 */
+/* COPYRIGHT International Business Machines Corp. 2013,2014 */
/* */
/* p1 */
/* */
@@ -129,6 +129,16 @@ class UtilLidMgr
*/
errlHndl_t getLid(void* i_dest, size_t i_destSize);
+#ifdef __HOSTBOOT_RUNTIME
+ /**
+ * @brief Get a list of LID numbers
+ * @param[out] number of entrees in the list
+ * @return pointer to the list
+ */
+ static
+ const uint32_t * getLidList(size_t * o_num);
+#endif
+
protected:
/**
diff --git a/src/makefile b/src/makefile
index 3b0cb94e8..62e9a3f0e 100644
--- a/src/makefile
+++ b/src/makefile
@@ -73,7 +73,8 @@ RUNTIME_OBJECTS = rt_start.o rt_main.o rt_console.o rt_stdlib.o rt_sync.o \
rt_assert.o rt_vfs.o rt_task.o
RUNTIME_MODULES = trace_rt errl_rt targeting_rt util_rt devicefw_rt \
- xscom_rt scom_rt vpd_rt ecmddatabuffer fapi_rt hwp_rt plat_rt
+ xscom_rt scom_rt vpd_rt ecmddatabuffer fapi_rt hwp_rt plat_rt \
+ build_winkle_images_rt occ_rt
RUNTIME_DATA_MODULES =
RUNTIME_TESTCASE_MODULES = cxxtest_rt testsyslib_rt testtargeting_rt \
diff --git a/src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.mk b/src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.mk
new file mode 100644
index 000000000..8c82a329b
--- /dev/null
+++ b/src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.mk
@@ -0,0 +1,77 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.mk $
+#
+# IBM CONFIDENTIAL
+#
+# COPYRIGHT International Business Machines Corp. 2014
+#
+# p1
+#
+# Object Code Only (OCO) source materials
+# Licensed Internal Code Source Materials
+# IBM HostBoot Licensed Internal Code
+#
+# The source code for this program is not published or otherwise
+# divested of its trade secrets, irrespective of what has been
+# deposited with the U.S. Copyright Office.
+#
+# Origin: 30
+#
+# IBM_PROLOG_END_TAG
+## support for Targeting and fapi
+EXTRAINCDIR += ${ROOTPATH}/src/include/usr/ecmddatabuffer
+EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/fapi
+EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/plat
+EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp
+
+## pointer to common HWP files
+EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/include
+
+## NOTE: add the base istep dir here.
+EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images
+EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/mvpd_accessors
+
+## Include sub dirs
+## NOTE: add a new EXTRAINCDIR when you add a new HWP
+## EXAMPLE:
+## EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/<HWP_dir>
+EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build
+EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar
+EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/occ/occ_procedures
+EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp/utility_procedures
+EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_block_wakeup_intr
+EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/proc_mailbox_utils
+
+CFLAGS += -D __FAPI
+
+## NOTE: add new object files when you add a new HWP
+OBJS += \
+ p8_image_help.o \
+ p8_scan_compression.o \
+ pore_inline_assembler.o \
+ p8_pba_bar_config.o \
+ sbe_xip_image.o \
+ p8_pore_table_static_data.o \
+ p8_pore_table_gen_api_fixed.o \
+ p8_pmc_deconfig_setup.o \
+ p8_poreslw_init.o \
+ p8_set_pore_bar.o \
+ p8_xip_customize.o \
+ p8_ring_identification.o \
+ p8_slw_build_fixed.o \
+ p8_image_help_base.o \
+ p8_pfet_init.o \
+ p8_pfet_control.o \
+ p8_block_wakeup_intr.o \
+ p8_mailbox_utils.o
+
+## NOTE: add a new directory onto the vpaths when you add a new HWP
+## EXAMPLE:
+# VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/<HWP_dir>
+VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build
+VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar
+VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_block_wakeup_intr
+VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/proc_mailbox_utils
+
diff --git a/src/usr/hwpf/hwp/build_winkle_images/makefile b/src/usr/hwpf/hwp/build_winkle_images/makefile
index 778151d15..4d3693c06 100644
--- a/src/usr/hwpf/hwp/build_winkle_images/makefile
+++ b/src/usr/hwpf/hwp/build_winkle_images/makefile
@@ -24,61 +24,14 @@ ROOTPATH = ../../../../..
MODULE = build_winkle_images
-## support for Targeting and fapi
-EXTRAINCDIR += ${ROOTPATH}/src/include/usr/ecmddatabuffer
-EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/fapi
-EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/plat
-EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp
+SUBDIRS = runtime.d
-## pointer to common HWP files
-EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/include
+# objects unique to HB IPL
+OBJS = build_winkle_images.o
-## NOTE: add the base istep dir here.
-EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images
-EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/mvpd_accessors
+# include objs common to HBRT and HB IPL
+include build_winkle_images.mk
-## Include sub dirs
-## NOTE: add a new EXTRAINCDIR when you add a new HWP
-## EXAMPLE:
-## EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/<HWP_dir>
-EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build
-EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar
-EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/occ/occ_procedures
-EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp/utility_procedures
-EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_block_wakeup_intr
-EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/proc_mailbox_utils
-
-CFLAGS += -D __FAPI
-
-
-## NOTE: add new object files when you add a new HWP
-OBJS = build_winkle_images.o \
- p8_image_help.o \
- p8_scan_compression.o \
- pore_inline_assembler.o \
- p8_pba_bar_config.o \
- sbe_xip_image.o \
- p8_pore_table_static_data.o \
- p8_pore_table_gen_api_fixed.o \
- p8_pmc_deconfig_setup.o \
- p8_poreslw_init.o \
- p8_set_pore_bar.o \
- p8_xip_customize.o \
- p8_ring_identification.o \
- p8_slw_build_fixed.o \
- p8_image_help_base.o \
- p8_pfet_init.o \
- p8_pfet_control.o \
- p8_block_wakeup_intr.o \
- p8_mailbox_utils.o
-
-## NOTE: add a new directory onto the vpaths when you add a new HWP
-## EXAMPLE:
-# VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/<HWP_dir>
-VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build
-VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar
-VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_block_wakeup_intr
-VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/proc_mailbox_utils
include ${ROOTPATH}/config.mk
diff --git a/src/usr/hwpf/hwp/build_winkle_images/runtime/makefile b/src/usr/hwpf/hwp/build_winkle_images/runtime/makefile
new file mode 100644
index 000000000..b52011db7
--- /dev/null
+++ b/src/usr/hwpf/hwp/build_winkle_images/runtime/makefile
@@ -0,0 +1,36 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/usr/hwpf/hwp/build_winkle_images/runtime/makefile $
+#
+# IBM CONFIDENTIAL
+#
+# COPYRIGHT International Business Machines Corp. 2012,2014
+#
+# p1
+#
+# Object Code Only (OCO) source materials
+# Licensed Internal Code Source Materials
+# IBM HostBoot Licensed Internal Code
+#
+# The source code for this program is not published or otherwise
+# divested of its trade secrets, irrespective of what has been
+# deposited with the U.S. Copyright Office.
+#
+# Origin: 30
+#
+# IBM_PROLOG_END_TAG
+ROOTPATH = ../../../../../..
+
+HOSTBOOT_RUNTIME = 1
+
+MODULE = build_winkle_images_rt
+
+# objects unique to HBRT - currently none
+# OBJS =
+
+# include objs common to HBRT and HB IPL
+include ../build_winkle_images.mk
+
+include ${ROOTPATH}/config.mk
+
diff --git a/src/usr/hwpf/hwp/occ/makefile b/src/usr/hwpf/hwp/occ/makefile
index c8c9178ea..5b96dff7e 100644
--- a/src/usr/hwpf/hwp/occ/makefile
+++ b/src/usr/hwpf/hwp/occ/makefile
@@ -24,60 +24,14 @@ ROOTPATH = ../../../../..
MODULE = occ
-## support for Targeting and fapi
-EXTRAINCDIR += ${ROOTPATH}/src/include/usr/ecmddatabuffer
-EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/fapi
-EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/plat
-EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp
+SUBDIRS = runtime.d
-## pointer to common HWP files
-EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/include
+include occ.mk
-## pointer to already consumed procedures.
-EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar
-EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp/utility_procedures
-
-## NOTE: add the base istep dir here.
-EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/occ
-
-## Include sub dirs
-## NOTE: add a new EXTRAINCDIR when you add a new HWP
-## EXAMPLE:
-## EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/occ/<HWP_dir>
-EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/occ/occ_procedures
-
-
-## NOTE: add new object files when you add a new HWP
-OBJS = occ.o \
- p8_pba_init.o \
- p8_pm_init.o \
- p8_pcbs_init.o \
- p8_pmc_init.o \
- p8_poregpe_init.o \
- p8_oha_init.o \
- p8_ocb_init.o \
- p8_pss_init.o \
- p8_occ_control.o \
- p8_occ_sram_init.o \
- p8_pm_firinit.o \
- p8_pm_oha_firinit.o \
- p8_pm_pcbs_firinit.o \
- p8_pm_occ_firinit.o \
- p8_pm_pba_firinit.o \
- p8_pm_pmc_firinit.o \
- p8_pm_utils.o
-
-#These procedures are included per Stradale's request so
-#they can implement OCC Reset.
-OBJS+= p8_pm_prep_for_reset.o \
- p8_pmc_force_vsafe.o \
- p8_ocb_indir_access.o \
- p8_ocb_indir_setup_linear.o
-
-## NOTE: add a new directory onto the vpaths when you add a new HWP
-## EXAMPLE:
-# VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/occ/<HWP_dir>
-VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/occ/occ_procedures
+## Objects unique to HB IPL
+OBJS = occ.o
+## Objects common to HB IPL and HBRT
+include occ.mk
include ${ROOTPATH}/config.mk
diff --git a/src/usr/hwpf/hwp/occ/occ.C b/src/usr/hwpf/hwp/occ/occ.C
index e39d1e73f..19a33de88 100644
--- a/src/usr/hwpf/hwp/occ/occ.C
+++ b/src/usr/hwpf/hwp/occ/occ.C
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2013 */
+/* COPYRIGHT International Business Machines Corp. 2013,2014 */
/* */
/* p1 */
/* */
@@ -23,6 +23,7 @@
#include <stdint.h>
+#include <occ/occ.H>
#include <initservice/taskargs.H>
#include <errl/errlentry.H>
@@ -62,26 +63,6 @@ extern trace_desc_t* g_fapiTd;
using namespace TARGETING;
-const uint32_t g_OCCLIDID = 0x81e00430;
-const uint64_t OCC_IBSCOM_RANGE_IN_MB = 0x100000; /*128*1024*8*/
-
-///////////////////////////////////////////////////////////////////////////////
-// compareNodeId
-///////////////////////////////////////////////////////////////////////////////
-bool compareNodeId( Target* t0,
- Target* t1)
-{
- uint8_t nodeId0 = t0->getAttr<ATTR_FABRIC_NODE_ID>();
- uint8_t nodeId1 = t1->getAttr<ATTR_FABRIC_NODE_ID>();
-
- if (nodeId0 == nodeId1)
- {
- return t0 < t1;
- }
- return nodeId0 < nodeId1;
-}
-
-
namespace HBOCC
{
@@ -104,14 +85,14 @@ namespace HBOCC
errlHndl_t l_errl = NULL;
size_t lidSize = 0;
do {
- UtilLidMgr lidMgr(g_OCCLIDID);
+ UtilLidMgr lidMgr(OCC_LIDID);
l_errl = lidMgr.getLidSize(lidSize);
if(l_errl)
{
TRACFCOMP( g_fapiImpTd,
ERR_MRK"loadOCCImageToHomer: Error getting lid size. lidId=0x%.8x",
- g_OCCLIDID);
+ OCC_LIDID);
break;
}
@@ -120,7 +101,7 @@ namespace HBOCC
{
TRACFCOMP( g_fapiImpTd,
ERR_MRK"loadOCCImageToHomer: Error getting lid.. lidId=0x%.8x",
- g_OCCLIDID);
+ OCC_LIDID);
break;
}
@@ -149,18 +130,11 @@ namespace HBOCC
errlHndl_t l_errl = NULL;
- struct occHostConfigDataArea_t
- {
- uint32_t version;
- uint32_t nestFrequency;
- };
-
- enum { OccHostDataVersion = 1 };
-
//Treat virtual address as starting pointer
//for config struct
- occHostConfigDataArea_t * config_data =
- reinterpret_cast<occHostConfigDataArea_t *>(i_occHostDataVirtAddr);
+ HBOCC::occHostConfigDataArea_t * config_data =
+ reinterpret_cast<HBOCC::occHostConfigDataArea_t *>
+ (i_occHostDataVirtAddr);
// Get top level system target
TARGETING::TargetService & tS = TARGETING::targetService();
@@ -170,7 +144,7 @@ namespace HBOCC
uint32_t nestFreq = sysTarget->getAttr<ATTR_FREQ_PB>();
- config_data->version = OccHostDataVersion;
+ config_data->version = HBOCC::OccHostDataVersion;
config_data->nestFrequency = nestFreq;
TRACUCOMP( g_fapiTd,
@@ -271,7 +245,7 @@ namespace HBOCC
l_fapiTarg,
1, //i_index
centaur_addr, //i_pba_bar_addr
- OCC_IBSCOM_RANGE_IN_MB, //i_pba_bar_size
+ (uint64_t)OCC_IBSCOM_RANGE_IN_MB, //i_pba_bar_size
PBA_CMD_SCOPE_NODAL ); //i_pba_cmd_scope
if ( l_errl != NULL )
@@ -602,7 +576,9 @@ namespace HBOCC
TRACUCOMP( g_fapiTd,
INFO_MRK"loadnStartAllOccs: Following DCM Path");
- std::sort(procChips.begin(), procChips.end(), compareNodeId);
+ std::sort(procChips.begin(),
+ procChips.end(),
+ orderByNodeAndPosition);
TRACUCOMP( g_fapiTd,
INFO_MRK"loadnStartAllOccs: procChips list sorted");
diff --git a/src/usr/hwpf/hwp/occ/occ.mk b/src/usr/hwpf/hwp/occ/occ.mk
new file mode 100644
index 000000000..79e93a4d7
--- /dev/null
+++ b/src/usr/hwpf/hwp/occ/occ.mk
@@ -0,0 +1,78 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/usr/hwpf/hwp/occ/occ.mk $
+#
+# IBM CONFIDENTIAL
+#
+# COPYRIGHT International Business Machines Corp. 2014
+#
+# p1
+#
+# Object Code Only (OCO) source materials
+# Licensed Internal Code Source Materials
+# IBM HostBoot Licensed Internal Code
+#
+# The source code for this program is not published or otherwise
+# divested of its trade secrets, irrespective of what has been
+# deposited with the U.S. Copyright Office.
+#
+# Origin: 30
+#
+# IBM_PROLOG_END_TAG
+## support for Targeting and fapi
+EXTRAINCDIR += ${ROOTPATH}/src/include/usr/ecmddatabuffer
+EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/fapi
+EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/plat
+EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp
+
+## pointer to common HWP files
+EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/include
+
+## pointer to already consumed procedures.
+EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar
+
+## NOTE: add the base istep dir here.
+EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/occ
+
+## Include sub dirs
+## NOTE: add a new EXTRAINCDIR when you add a new HWP
+## EXAMPLE:
+## EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/occ/<HWP_dir>
+EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/occ/occ_procedures
+EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp/utility_procedures
+
+## NOTE: add new object files when you add a new HWP
+OBJS += \
+ p8_pba_init.o \
+ p8_pm_init.o \
+ p8_pcbs_init.o \
+ p8_pmc_init.o \
+ p8_poregpe_init.o \
+ p8_oha_init.o \
+ p8_ocb_init.o \
+ p8_pss_init.o \
+ p8_occ_control.o \
+ p8_occ_sram_init.o \
+ p8_pm_firinit.o \
+ p8_pm_oha_firinit.o \
+ p8_pm_pcbs_firinit.o \
+ p8_pm_occ_firinit.o \
+ p8_pm_pba_firinit.o \
+ p8_pm_pmc_firinit.o \
+ p8_pm_utils.o
+
+
+#These procedures are included per Stradale's request so
+#they can implement OCC Reset.
+OBJS+= p8_pm_prep_for_reset.o \
+ p8_pmc_force_vsafe.o \
+ p8_ocb_indir_access.o \
+ p8_ocb_indir_setup_linear.o
+
+## NOTE: add a new directory onto the vpaths when you add a new HWP
+## EXAMPLE:
+# VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/occ/<HWP_dir>
+VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/occ/occ_procedures
+
+
diff --git a/src/usr/hwpf/hwp/occ/runtime/makefile b/src/usr/hwpf/hwp/occ/runtime/makefile
new file mode 100644
index 000000000..1d1e7ce06
--- /dev/null
+++ b/src/usr/hwpf/hwp/occ/runtime/makefile
@@ -0,0 +1,37 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/usr/hwpf/hwp/occ/runtime/makefile $
+#
+# IBM CONFIDENTIAL
+#
+# COPYRIGHT International Business Machines Corp. 2014
+#
+# p1
+#
+# Object Code Only (OCO) source materials
+# Licensed Internal Code Source Materials
+# IBM HostBoot Licensed Internal Code
+#
+# The source code for this program is not published or otherwise
+# divested of its trade secrets, irrespective of what has been
+# deposited with the U.S. Copyright Office.
+#
+# Origin: 30
+#
+# IBM_PROLOG_END_TAG
+
+HOSTBOOT_RUNTIME = 1
+
+ROOTPATH = ../../../../../..
+VPATH += ../
+
+MODULE = occ_rt
+
+## Objects unique to HBRT
+OBJS = rt_occ.o
+
+## Objects common to HBRT and HB IPL
+include ../occ.mk
+
+include ${ROOTPATH}/config.mk
diff --git a/src/usr/hwpf/hwp/occ/runtime/rt_occ.C b/src/usr/hwpf/hwp/occ/runtime/rt_occ.C
new file mode 100644
index 000000000..98faec0a2
--- /dev/null
+++ b/src/usr/hwpf/hwp/occ/runtime/rt_occ.C
@@ -0,0 +1,556 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/hwpf/hwp/occ/runteim/rt_occ.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2014 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+#include <runtime/interface.h>
+#include <kernel/console.H>
+#include <hwpf/hwp/occ/occ.H>
+#include <vmmconst.h>
+#include <sys/misc.h>
+#include <errno.h>
+#include <errl/errlentry.H>
+#include <errl/errlmanager.H>
+#include <util/utillidmgr.H>
+
+// targeting support
+#include <targeting/common/commontargeting.H>
+#include <targeting/common/utilFilter.H>
+#include <targeting/common/targetservice.H>
+#include <targeting/common/utilFilter.H>
+#include <targeting/common/util.H>
+
+#include <runtime/rt_targeting.H>
+
+// fapi support
+#include <fapi.H>
+#include <fapiPlatHwpInvoker.H>
+#include <hwpf/plat/fapiPlatTrace.H>
+#include <hwpf/hwpf_reasoncodes.H>
+
+// Procedures
+#include <p8_occ_control.H>
+#include <p8_pba_bar_config.H>
+#include <p8_pm_init.H>
+#include <p8_pm_prep_for_reset.H>
+
+using namespace TARGETING;
+// Trace
+
+extern trace_desc_t* g_fapiTd; // defined in rt_fapiPlatUtil.C
+
+// @TODO RTC 98547
+// There is potential to share more code with src/hwpf/hwp/occ/occ.C,
+// but would require refactoring the HB occ code and modifying the order and
+// sequence of some events.
+
+namespace RT_OCC
+{
+ typedef std::vector<TARGETING::Target *> target_list_t;
+
+ //------------------------------------------------------------------------
+
+ errlHndl_t addHostData(uint64_t i_hostdata_addr)
+ {
+ errlHndl_t err = NULL;
+ //Treat virtual address as starting pointer
+ //for config struct
+ HBOCC::occHostConfigDataArea_t * config_data =
+ reinterpret_cast<HBOCC::occHostConfigDataArea_t *>
+ (i_hostdata_addr);
+
+ // Get top level system target
+ TARGETING::TargetService & tS = TARGETING::targetService();
+ TARGETING::Target * sysTarget = NULL;
+ tS.getTopLevelTarget( sysTarget );
+ assert( sysTarget != NULL );
+
+ uint32_t nestFreq = sysTarget->getAttr<ATTR_FREQ_PB>();
+
+ config_data->version = HBOCC::OccHostDataVersion;
+ config_data->nestFrequency = nestFreq;
+
+ return err;
+ }
+
+ //------------------------------------------------------------------------
+
+ int executeLoadOCC(uint64_t i_homer_addr_phys,
+ uint64_t i_homer_addr_va,
+ uint64_t i_common_addr_phys,
+ uint64_t i_common_addr_va,
+ uint64_t i_proc_chip)
+ {
+ errlHndl_t err = NULL;
+ int rc = 0;
+
+ TRACFCOMP( g_fapiTd,
+ "LoadOCC: homer paddr=%016llx vaddr=%016llx. "
+ " common paddr=%016lx vaddr=%016llx. RtProcChip=%llx",
+ i_homer_addr_phys,
+ i_homer_addr_va,
+ i_common_addr_phys,
+ i_common_addr_va,
+ i_proc_chip);
+
+ do
+ {
+ // Utility to convert i_proc_chip to Target
+ TARGETING::Target* proc_target = NULL;
+ err = RT_TARG::getHbTarget(i_proc_chip, proc_target);
+ if(err)
+ {
+ rc = EINVAL;
+ break;
+ }
+
+ // Convert to fapi Target
+ fapi::Target fapiTarg( fapi::TARGET_TYPE_PROC_CHIP,
+ (const_cast<TARGETING::Target*>(proc_target)
+ ));
+
+ TRACFCOMP( g_fapiTd, "FapiTarget: %s",fapiTarg.toEcmdString());
+
+ // BAR0 is the Entire HOMER, Bar size is in MB
+ FAPI_INVOKE_HWP( err,
+ p8_pba_bar_config,
+ fapiTarg,
+ 0, //BAR0
+ i_homer_addr_phys,
+ VMM_HOMER_INSTANCE_SIZE_IN_MB,
+ PBA_CMD_SCOPE_NODAL );
+
+ if ( err )
+ {
+ TRACFCOMP( g_fapiTd,
+ ERR_MRK"Bar0 config failed!" );
+ err->collectTrace(FAPI_TRACE_NAME,256);
+ err->collectTrace(FAPI_IMP_TRACE_NAME,256);
+
+ break;
+ }
+
+ // BAR1 is what OCC uses to talk to the Centaur. Bar size is in MB
+ uint64_t centaur_addr =
+ proc_target->getAttr<ATTR_IBSCOM_PROC_BASE_ADDR>();
+
+ FAPI_INVOKE_HWP( err,
+ p8_pba_bar_config,
+ fapiTarg,
+ 1, //BAR1
+ centaur_addr, //i_pba_bar_addr
+ //i_pba_bar_size
+ (uint64_t)HBOCC::OCC_IBSCOM_RANGE_IN_MB,
+ PBA_CMD_SCOPE_NODAL ); //i_pba_cmd_scope
+
+ if ( err != NULL )
+ {
+ TRACFCOMP( g_fapiTd,
+ ERR_MRK"Bar1 config failed!" );
+ err->collectTrace(FAPI_TRACE_NAME,256);
+ err->collectTrace(FAPI_IMP_TRACE_NAME,256);
+
+ break;
+ }
+
+ // BAR3 is the OCC Common Area
+ // Bar size is in MB, obtained value of 8MB from Tim Hallett
+ FAPI_INVOKE_HWP( err,
+ p8_pba_bar_config,
+ fapiTarg,
+ 3, //BAR3
+ i_common_addr_phys,
+ VMM_OCC_COMMON_SIZE_IN_MB,
+ PBA_CMD_SCOPE_NODAL );
+
+ if ( err )
+ {
+ TRACFCOMP( g_fapiTd,
+ ERR_MRK"Bar3 config failed!" );
+ err->collectTrace(FAPI_TRACE_NAME,256);
+ err->collectTrace(FAPI_IMP_TRACE_NAME,256);
+
+ break;
+ }
+
+ // Load HOMER image
+ UtilLidMgr lidmgr(HBOCC::OCC_LIDID);
+
+ size_t lidSize = 0;
+ err = lidmgr.getLidSize(lidSize);
+ if( err )
+ {
+ break;
+ }
+
+ err = lidmgr.getLid(reinterpret_cast<void*>(i_homer_addr_va),
+ lidSize);
+ if( err )
+ {
+ break;
+ }
+
+ TRACFCOMP( g_fapiTd,
+ "OCC lid loaded. ID:%x size:%d",
+ HBOCC::OCC_LIDID,
+ lidSize);
+
+ // Setup Host Data area of HOMER
+ err = addHostData(i_homer_addr_va+HOMER_OFFSET_TO_OCC_HOST_DATA);
+ if( err )
+ {
+ break;
+ }
+
+ } while(0);
+
+ if ( err )
+ {
+ errlCommit( err, HWPF_COMP_ID );
+ if(rc == 0)
+ {
+ rc = -1;
+ }
+ }
+ return rc;
+ }
+
+ //------------------------------------------------------------------------
+
+ errlHndl_t start_occ(TARGETING::Target * i_target0,
+ TARGETING::Target * i_target1)
+ {
+ errlHndl_t err = NULL;
+ do
+ {
+ const fapi::Target
+ l_fapiTarg0(fapi::TARGET_TYPE_PROC_CHIP,
+ (const_cast<TARGETING::Target*>(i_target0)));
+
+ fapi::Target l_fapiTarg1;
+ if(i_target1)
+ {
+ l_fapiTarg1.setType(fapi::TARGET_TYPE_PROC_CHIP);
+ l_fapiTarg1.set(const_cast<TARGETING::Target*>(i_target1));
+
+ }
+ else
+ {
+ l_fapiTarg1.setType(fapi::TARGET_TYPE_NONE);
+ }
+
+ FAPI_INVOKE_HWP( err,
+ p8_pm_init,
+ l_fapiTarg0,
+ l_fapiTarg1,
+ PM_CONFIG );
+
+ if ( err != NULL )
+ {
+ TRACFCOMP( g_fapiTd,
+ ERR_MRK"p8_pm_init, config failed!" );
+ err->collectTrace(FAPI_TRACE_NAME,256);
+ err->collectTrace(FAPI_IMP_TRACE_NAME,256);
+
+ break;
+ }
+
+ // Init path
+ // p8_pm_init.C enum: PM_INIT
+ FAPI_INVOKE_HWP( err,
+ p8_pm_init,
+ l_fapiTarg0,
+ l_fapiTarg1,
+ PM_INIT );
+
+ if ( err != NULL )
+ {
+ TRACFCOMP( g_fapiTd,
+ ERR_MRK"p8_pm_init, init failed!" );
+ err->collectTrace(FAPI_TRACE_NAME,256);
+ err->collectTrace(FAPI_IMP_TRACE_NAME,256);
+
+ break;
+ }
+ TRACFCOMP( g_fapiTd,
+ INFO_MRK"OCC Finished: p8_pm_init.C enum: PM_INIT" );
+
+
+ //==============================
+ //Start the OCC on primary chip of DCM
+ //==============================
+ FAPI_INVOKE_HWP( err,
+ p8_occ_control,
+ l_fapiTarg0,
+ PPC405_RESET_OFF,
+ PPC405_BOOT_MEM );
+
+ if ( err != NULL )
+ {
+ TRACFCOMP( g_fapiTd,
+ ERR_MRK"occ_control failed!" );
+ err->collectTrace(FAPI_TRACE_NAME,256);
+ err->collectTrace(FAPI_IMP_TRACE_NAME,256);
+
+ break;
+ }
+
+ //==============================
+ // Start the OCC on slave chip of DCM
+ //==============================
+ if ( l_fapiTarg1.getType() != fapi::TARGET_TYPE_NONE )
+ {
+ FAPI_INVOKE_HWP( err,
+ p8_occ_control,
+ l_fapiTarg1,
+ PPC405_RESET_OFF,
+ PPC405_BOOT_MEM );
+
+ if ( err != NULL )
+ {
+ TRACFCOMP( g_fapiTd,
+ ERR_MRK"occ_control failed!" );
+ err->collectTrace(FAPI_TRACE_NAME,256);
+ err->collectTrace(FAPI_IMP_TRACE_NAME,256);
+
+ break;
+ }
+ }
+ } while(0);
+
+ return err;
+ }
+
+ //------------------------------------------------------------------------
+
+ errlHndl_t stop_occ(TARGETING::Target * i_target0,
+ TARGETING::Target * i_target1)
+ {
+ errlHndl_t err = NULL;
+ do
+ {
+ const fapi::Target
+ l_fapiTarg0(fapi::TARGET_TYPE_PROC_CHIP,
+ (const_cast<TARGETING::Target*>(i_target0)));
+
+ fapi::Target l_fapiTarg1;
+ if(i_target1)
+ {
+ l_fapiTarg1.setType(fapi::TARGET_TYPE_PROC_CHIP);
+ l_fapiTarg1.set(const_cast<TARGETING::Target*>(i_target1));
+
+ }
+ else
+ {
+ l_fapiTarg1.setType(fapi::TARGET_TYPE_NONE);
+ }
+
+ FAPI_INVOKE_HWP( err,
+ p8_pm_prep_for_reset,
+ l_fapiTarg0,
+ l_fapiTarg1,
+ PM_RESET );
+
+ if ( err != NULL )
+ {
+ TRACFCOMP( g_fapiTd,
+ ERR_MRK"p8_pm_prep_for_reset failed!" );
+ err->collectTrace(FAPI_TRACE_NAME,256);
+ err->collectTrace(FAPI_IMP_TRACE_NAME,256);
+
+ break;
+ }
+
+ } while(0);
+
+ return err;
+ }
+
+ //------------------------------------------------------------------------
+
+ int executeOnDcms(HBOCC::occAction_t i_action,
+ uint64_t * i_proc_chip,
+ size_t i_num_chips)
+ {
+ errlHndl_t err = NULL;
+ int rc = 0;
+
+ TRACFCOMP( g_fapiTd,
+ "Action=%d, number of procs = %d ",
+ i_action,
+ i_num_chips);
+
+ for(size_t i = 0; i < i_num_chips; ++i)
+ {
+ TRACFCOMP( g_fapiTd, "\tRtProcChip %llx", i_proc_chip[i]);
+ }
+
+ do
+ {
+ if(i_num_chips < 1 || i_proc_chip == NULL)
+ {
+ rc = EINVAL;
+ break;
+ }
+
+ // Convert chipIds to HB targets
+ target_list_t targets;
+ targets.reserve(i_num_chips);
+
+ for(size_t i = 0; i < i_num_chips; ++i)
+ {
+ TARGETING::Target* proc_target = NULL;
+ err = RT_TARG::getHbTarget(i_proc_chip[i], proc_target);
+ if( err )
+ {
+ rc = EINVAL;
+ break;
+ }
+ targets.push_back(proc_target);
+ }
+ if (err)
+ {
+ break;
+ }
+
+ // If there are no DCMs INSTALLED the do on each proc
+ target_list_t::iterator itarg = targets.begin();
+ if (0 == (*itarg)->getAttr<ATTR_PROC_DCM_INSTALLED>())
+ {
+ for(itarg = targets.begin();
+ itarg != targets.end();
+ ++itarg)
+ {
+ if(i_action == HBOCC::OCC_START)
+ {
+ err = start_occ(*itarg, NULL);
+ }
+ else if(i_action == HBOCC::OCC_STOP)
+ {
+ err = stop_occ(*itarg, NULL);
+ }
+
+ // TODO RTC 101156
+ // error handling still being designed
+ // Need new interface from Sapphire?
+ if( err )
+ {
+ errlCommit( err, HWPF_COMP_ID );
+ err = NULL;
+ rc = -1;
+ // keep going
+ }
+ }
+ break; // done
+ }
+
+ // continue here only if have DCMs
+ // Sort the target list by node then pos
+ std::sort(targets.begin(),
+ targets.end(),
+ orderByNodeAndPosition);
+
+ for(itarg = targets.begin();
+ itarg != targets.end();
+ ++itarg)
+ {
+ TARGETING::Target* t0 = *itarg;
+ TARGETING::Target* t1 = NULL;
+ if((itarg+1) != targets.end())
+ {
+ if((t0->getAttr<ATTR_FABRIC_NODE_ID>()) ==
+ ((*(itarg+1))->getAttr<ATTR_FABRIC_NODE_ID>()))
+ {
+ ++itarg;
+ t1 = *itarg;
+ }
+ }
+ if(i_action == HBOCC::OCC_START)
+ {
+ err = start_occ(t0,t1);
+ }
+ else if(i_action == HBOCC::OCC_STOP)
+ {
+ err = stop_occ(t0,t1);
+ }
+
+ // TODO RTC 101156 Error handling still being designed
+ // Need new interface from Sapphire?
+ if( err )
+ {
+ errlCommit( err, HWPF_COMP_ID );
+ err = NULL;
+ rc = -1;
+ // keep going
+ }
+ }
+ if( err )
+ {
+ break;
+ }
+
+ } while(0);
+
+
+ if( err )
+ {
+ errlCommit( err, HWPF_COMP_ID );
+ if(rc == 0)
+ {
+ rc = -1;
+ }
+ }
+
+ return rc;
+ }
+
+ int executeStartOCCs(uint64_t* i_proc_chip,
+ size_t i_num_chips)
+ {
+ return executeOnDcms(HBOCC::OCC_START,
+ i_proc_chip,
+ i_num_chips);
+ }
+
+ int executeStopOCCs(uint64_t* i_proc_chip,
+ size_t i_num_chips)
+ {
+ return executeOnDcms(HBOCC::OCC_STOP,
+ i_proc_chip,
+ i_num_chips);
+ }
+
+ //------------------------------------------------------------------------
+
+ struct registerOcc
+ {
+ registerOcc()
+ {
+ runtimeInterfaces_t * rt_intf = getRuntimeInterfaces();
+ rt_intf->get_lid_list = &UtilLidMgr::getLidList;
+ rt_intf->loadOCC = &executeLoadOCC;
+ rt_intf->startOCCs = &executeStartOCCs;
+ rt_intf->stopOCCs = &executeStopOCCs;
+ }
+ };
+
+ registerOcc g_registerOcc;
+}
+
diff --git a/src/usr/hwpf/hwp/start_payload/start_payload.C b/src/usr/hwpf/hwp/start_payload/start_payload.C
index 182bfd6d5..5bf0943a7 100644
--- a/src/usr/hwpf/hwp/start_payload/start_payload.C
+++ b/src/usr/hwpf/hwp/start_payload/start_payload.C
@@ -241,8 +241,8 @@ void* call_host_runtime_setup( void *io_pArgs )
break;
}
- //Start OCC in AVP (or Sapphire mode for now)
- if( is_avp_load() || is_sapphire_load() )
+ //Start OCC in AVP
+ if( is_avp_load() )
{
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "Starting OCC" );
diff --git a/src/usr/hwpf/test/runtime/makefile b/src/usr/hwpf/test/runtime/makefile
index e246a928b..bef3cfd42 100644
--- a/src/usr/hwpf/test/runtime/makefile
+++ b/src/usr/hwpf/test/runtime/makefile
@@ -27,7 +27,8 @@ MODULE = testhwpf_rt
include ../hwpftest.mk
-TESTS = ../fapiattrtest.H ../fapitargettest.H ../fapirctest.H ../hwpftest.H
+TESTS = ../fapiattrtest.H ../fapitargettest.H ../fapirctest.H ../hwpftest.H \
+ rt_occtest.H
# ../hwpMvpdAccessorTest.H ../hwpMBvpdAccessorTest.H
include ${ROOTPATH}/config.mk
diff --git a/src/usr/hwpf/test/runtime/rt_occtest.H b/src/usr/hwpf/test/runtime/rt_occtest.H
new file mode 100644
index 000000000..c7ae3a2e6
--- /dev/null
+++ b/src/usr/hwpf/test/runtime/rt_occtest.H
@@ -0,0 +1,95 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/hwpf/test/runtime/rt_occtest.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2014 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+#ifndef __RT_OCCTEST_H
+#define __RT_OCCTEST_H
+
+#include <cxxtest/TestSuite.H>
+#include <runtime/interface.h>
+#include <hwpf/hwp/occ/occ.H>
+#include <fapi.H>
+#include <targeting/common/commontargeting.H>
+#include <vmmconst.h>
+#include <sys/mm.h>
+
+class OccTest: public CxxTest::TestSuite
+{
+ public:
+
+ void testOccIntf()
+ {
+ FAPI_INF("testOccIntf");
+
+ runtimeInterfaces_t* rt_intf = getRuntimeInterfaces();
+ if(rt_intf == NULL)
+ {
+ TS_FAIL("runtimeIntfaces not set");
+ return;
+ }
+
+ if( rt_intf->get_lid_list == NULL )
+ {
+ TS_FAIL("runtimeInterfaces->get_lid_list not set");
+ }
+
+ if( rt_intf->loadOCC == NULL )
+ {
+ TS_FAIL("runtimeInterfaces->loadOCC not set");
+ }
+
+ if( rt_intf->startOCCs == NULL )
+ {
+ TS_FAIL("runtimeInterfaces->startOCCs not set");
+ }
+
+ if( rt_intf->stopOCCs == NULL )
+ {
+ TS_FAIL("runtimeInterfaces->stopOCCs not set");
+ }
+ }
+
+ void testGetLidList()
+ {
+ FAPI_INF("testGetLidList");
+ runtimeInterfaces_t* rt_intf = getRuntimeInterfaces();
+ if(rt_intf && rt_intf->get_lid_list)
+ {
+ size_t size = 0;
+ const uint32_t * list = rt_intf->get_lid_list(&size);
+ if(size > 1)
+ {
+ TS_FAIL("runtimeInterfaces->get_lid_list empty list");
+ }
+ else if (list[0] != HBOCC::OCC_LIDID)
+ {
+ TS_FAIL("runtimeInterface->get_list_list missing OCCLID");
+ }
+ }
+
+ }
+
+
+ private:
+
+};
+
+#endif
diff --git a/src/usr/runtime/makefile b/src/usr/runtime/makefile
index f8d69af3c..854e4da32 100644
--- a/src/usr/runtime/makefile
+++ b/src/usr/runtime/makefile
@@ -5,7 +5,7 @@
#
# IBM CONFIDENTIAL
#
-# COPYRIGHT International Business Machines Corp. 2012,2013
+# COPYRIGHT International Business Machines Corp. 2012,2014
#
# p1
#
diff --git a/src/usr/targeting/common/util.C b/src/usr/targeting/common/util.C
index 370e2c12a..2f7d3a7f0 100644
--- a/src/usr/targeting/common/util.C
+++ b/src/usr/targeting/common/util.C
@@ -245,4 +245,19 @@ uint64_t get_top_mem_addr(void)
}
+bool orderByNodeAndPosition( Target* i_firstProc,
+ Target* i_secondProc)
+{
+ uint8_t nodeId0 = i_firstProc->getAttr<ATTR_FABRIC_NODE_ID>();
+ uint8_t nodeId1 = i_secondProc->getAttr<ATTR_FABRIC_NODE_ID>();
+ uint8_t fabpos0 = i_firstProc->getAttr<ATTR_FABRIC_CHIP_ID>();
+ uint8_t fabpos1 = i_secondProc->getAttr<ATTR_FABRIC_CHIP_ID>();
+
+ if (nodeId0 == nodeId1)
+ {
+ return fabpos0 < fabpos1;
+ }
+ return nodeId0 < nodeId1;
+}
+
}
diff --git a/src/usr/util/runtime/utillidmgr_rt.C b/src/usr/util/runtime/utillidmgr_rt.C
index 397cc6074..c0518befb 100644
--- a/src/usr/util/runtime/utillidmgr_rt.C
+++ b/src/usr/util/runtime/utillidmgr_rt.C
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2013 */
+/* COPYRIGHT International Business Machines Corp. 2013,2014 */
/* */
/* p1 */
/* */
@@ -28,6 +28,7 @@
#include <errl/errlmanager.H>
#include <vfs/vfs.H>
#include <runtime/interface.h>
+#include <hwpf/hwp/occ/occ.H>
UtilLidMgr::UtilLidMgr(uint32_t i_lidId) :
iv_isPnor(false), iv_lidBuffer(NULL), iv_lidSize(0)
@@ -143,3 +144,14 @@ void UtilLidMgr::updateLid(uint32_t i_lidId)
return;
}
+
+const uint32_t * UtilLidMgr::getLidList(size_t * o_num)
+{
+ static uint32_t lidlist[] =
+ {
+ HBOCC::OCC_LIDID
+ // add SLW lids if ever needed
+ };
+ *o_num = sizeof(lidlist)/sizeof(lidlist[0]);
+ return lidlist;
+}
OpenPOWER on IntegriCloud