From bee7f1cbcd5bf18acc539c9c9b6a14960dadea3d Mon Sep 17 00:00:00 2001 From: Dan Crowell Date: Mon, 14 Dec 2015 09:30:28 -0600 Subject: Update constants and comments for P9 PIR format Implemented a set of macros and constants that can be used everywhere to translate a PIR into its component parts and pull out individual pieces of data from a complete PIR. Also added and updated the references to the old ATTR_FABRIC_NODE_ID with ATTR_FABRIC_GROUP_ID. Change-Id: If9735f53940e5849a648729e4bf8ca0cfbb09f6e RTC: 88055 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/706 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell --- src/usr/xscom/xscom.C | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/usr/xscom') diff --git a/src/usr/xscom/xscom.C b/src/usr/xscom/xscom.C index a3d8e28dc..5eaad2237 100644 --- a/src/usr/xscom/xscom.C +++ b/src/usr/xscom/xscom.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2015 */ +/* Contributors Listed Below - COPYRIGHT 2011,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -46,6 +46,7 @@ #include #include #include +#include // Trace definition trace_desc_t* g_trac_xscom = NULL; @@ -347,7 +348,7 @@ errlHndl_t getTargetVirtualAddress(TARGETING::Target* i_target, // Get the target Node Id xscomNodeId = - i_target->getAttr(); + i_target->getAttr(); // Get the target Chip Id xscomChipId = @@ -548,12 +549,7 @@ uint64_t* getCpuIdVirtualAddress() uint64_t* o_virtAddr = 0; // Get the CPU core this thread is running on - uint32_t cpuid = task_getcpuid(); - - //NNNCCCPPPPTTT format fot the cpuid.. - // N = node, C = chip, P = proc, T = thread - uint32_t chipId = (cpuid & 0x0380)>>7; - uint32_t nodeId = (cpuid & 0x1C00)>>10; + PIR_t cpuid = task_getcpuid(); // Can change the above hardcoded values to either a macro or use // the info below to do the masking and shifting. @@ -566,8 +562,8 @@ uint64_t* getCpuIdVirtualAddress() // Target's XSCOM Base address XSComBase_t l_XSComBaseAddr = l_systemBaseAddr + - ( ( (g_xscomMaxChipsPerNode * nodeId) + - chipId ) * THIRTYTWO_GB); + ( ( (g_xscomMaxChipsPerNode * cpuid.groupId) + + cpuid.chipId ) * THIRTYTWO_GB); // Target's virtual address o_virtAddr = static_cast -- cgit v1.2.1