From f947010cb98574265b2e3c5bf8375c399216c4d3 Mon Sep 17 00:00:00 2001 From: Claus Michael Olsen Date: Wed, 15 Mar 2017 23:00:23 -0500 Subject: Centaur ring support - TOR API Key_Cronus_Test=XIP_REGRESS - Updates to TOR API codes to allow user codes to call TOR API function on a Centaur image. Note that the API no longer needs the caller to supply and XIP section ID. - Updates to TOR API codes to take advantage of the improved data and meta-data representation in the ring Id codes and the more self-contained ring image which now has the TOR magic header. - Updates to xip_tool to allow dissection of Centaur image. - Additional updates to TOR API codes and ring Id codes to continue improving overall clarity of data, data structures and flow through TOR API, incl name changes to related data variables and structures. Change-Id: I215ded7829e61f2731e35a5524e8e2348be0b7ab Original-Change-Id: I42891b9662cc0c443d2b16ce866ac945dc2c58dc Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/38018 Tested-by: Jenkins Server Tested-by: HWSV CI Tested-by: PPE CI Tested-by: Cronus HW CI Tested-by: FSP CI Jenkins Reviewed-by: Thi N. Tran Tested-by: Hostboot CI Reviewed-by: Jennifer A. Stofer --- import/chips/centaur/utils/imageProcs/cen_ringId.C | 76 +++++++++++++++++++++- .../chips/centaur/utils/imageProcs/cen_ringId.mk | 2 +- 2 files changed, 76 insertions(+), 2 deletions(-) (limited to 'import/chips/centaur/utils') diff --git a/import/chips/centaur/utils/imageProcs/cen_ringId.C b/import/chips/centaur/utils/imageProcs/cen_ringId.C index 9a4971e8..83b9fd5c 100644 --- a/import/chips/centaur/utils/imageProcs/cen_ringId.C +++ b/import/chips/centaur/utils/imageProcs/cen_ringId.C @@ -23,6 +23,9 @@ /* */ /* IBM_PROLOG_END_TAG */ +#include +#include + namespace CEN_RID { @@ -140,4 +143,75 @@ const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID }; }; // namespace CEN -}; // namespace CENTAUR +}; // namespace CEN_RID + + +using namespace CEN_RID; + +ChipletType_t CEN_RID::ringid_get_chiplet(RingId_t i_ringId) +{ + return RING_PROPERTIES[i_ringId].iv_type; +} + +void CEN_RID::ringid_get_chiplet_properties( + ChipletType_t i_chiplet, + ChipletData_t** o_cpltData, + GenRingIdList** o_ringComm, + GenRingIdList** o_ringInst, + RingVariantOrder** o_varOrder, + uint8_t* o_varNumb) +{ + switch (i_chiplet) + { + case CEN_TYPE : + *o_cpltData = (ChipletData_t*) &CEN::g_chipletData; + *o_ringComm = (GenRingIdList*) CEN::RING_ID_LIST_COMMON; + *o_ringInst = NULL; + *o_varOrder = (RingVariantOrder*) CEN::RING_VARIANT_ORDER; + *o_varNumb = (*(*o_cpltData)).iv_num_ring_variants; + break; + + default : + *o_cpltData = NULL; + *o_ringComm = NULL; + *o_ringInst = NULL; + *o_varOrder = NULL; + *o_varNumb = 0; + break; + } +} + +GenRingIdList* CEN_RID::ringid_get_ring_properties(RingId_t i_ringId) +{ + ChipletData_t* l_cpltData; + GenRingIdList* l_ringList[2]; // 0: common, 1: instance + RingVariantOrder* l_varOrder; + uint8_t l_varNumb; + int i, j, n; + + CEN_RID::ringid_get_chiplet_properties( + CEN_RID::ringid_get_chiplet(i_ringId), + &l_cpltData, &l_ringList[0], &l_ringList[1], &l_varOrder, &l_varNumb); + + if (!l_ringList[0]) + { + return NULL; + } + + for (j = 0; j < 2; j++) // 0: common, 1: instance + { + n = (j ? l_cpltData->iv_num_instance_rings + : l_cpltData->iv_num_common_rings); + + for (i = 0; i < n; i++) + { + if (!strcmp(l_ringList[j][i].ringName, + RING_PROPERTIES[i_ringId].iv_name)) + { + return &(l_ringList[j][i]); + } + } + } + + return NULL; +} diff --git a/import/chips/centaur/utils/imageProcs/cen_ringId.mk b/import/chips/centaur/utils/imageProcs/cen_ringId.mk index 7628b127..5fb7f36b 100644 --- a/import/chips/centaur/utils/imageProcs/cen_ringId.mk +++ b/import/chips/centaur/utils/imageProcs/cen_ringId.mk @@ -22,6 +22,6 @@ # permissions and limitations under the License. # # IBM_PROLOG_END_TAG -PROCEDURE = cen_ringId +PROCEDURE=cen_ringId $(call ADD_MODULE_INCDIR,$(PROCEDURE),$(ROOTPATH)/chips/common/utils/imageProcs) $(call BUILD_PROCEDURE) -- cgit v1.2.1