From 90a2b9b3512fe29b1b21f27783f5a560cdce04df Mon Sep 17 00:00:00 2001 From: Dean Sanner Date: Tue, 18 Feb 2014 15:23:25 -0600 Subject: Devtree updates for tod, nominal freq Change-Id: I296abaa2a033d3afbce1a6f05289637c953c5c3f RTC: 88002 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/8963 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III --- src/usr/devtree/bld_devtree.C | 21 ++++++++----- src/usr/hwpf/hwp/tod_init/TodHwpIntf.C | 19 +++++++++++- src/usr/hwpf/hwp/tod_init/tod_init.C | 2 +- .../targeting/common/xmltohb/attribute_types.xml | 34 ++++++++++++++++++++++ src/usr/targeting/common/xmltohb/target_types.xml | 2 ++ 5 files changed, 69 insertions(+), 9 deletions(-) (limited to 'src/usr') diff --git a/src/usr/devtree/bld_devtree.C b/src/usr/devtree/bld_devtree.C index 2124cae6b..b60190ccb 100644 --- a/src/usr/devtree/bld_devtree.C +++ b/src/usr/devtree/bld_devtree.C @@ -51,6 +51,7 @@ $ */ #include #include #include +#include trace_desc_t *g_trac_devtree = NULL; TRAC_INIT(&g_trac_devtree, "DEVTREE", 4096); @@ -155,9 +156,6 @@ void bld_xscom_node(devTree * i_dt, dtOffset_t & i_parentNode, uint64_t xscom_prop[2] = { l_xscomAddr, THIRTYTWO_GB}; i_dt->addPropertyCells64(xscomNode, "reg", xscom_prop, 2); - /*MVPD -- TODO RTC 88002 add full MVPD here*/ - //i_dt->addPropertyBytes(xscomNode, "ibm,module-vpd", ....); - /*PSI Host Bridge*/ uint32_t l_psiInfo = 0x2010900; /*PSI Host Bridge Scom addr*/ dtOffset_t psiNode = i_dt->addNode(xscomNode, "psihb", l_psiInfo); @@ -177,10 +175,19 @@ void bld_xscom_node(devTree * i_dt, dtOffset_t & i_parentNode, uint32_t tod_prop[2] = { l_todInfo, 0x34 }; //# of scoms in range i_dt->addPropertyCells32(todNode, "reg", tod_prop, 2); - if(i_chipid == 0x0) //Master chip + //Mark TOD pri/sec + uint8_t l_role = i_pProc->getAttr(); + if(l_role & TARGETING::TOD_ROLE_PRIMARY) + { + i_dt->addProperty(todNode, "primary"); + } + if(l_role & TARGETING::TOD_ROLE_SECONDARY) { - i_dt->addProperty(todNode, "primary"); //TODO RTC 88002 + i_dt->addProperty(todNode, "secondary"); + } + if(i_chipid == 0x0) //Master chip + { uint32_t l_lpcInfo = 0xB0020; /*ECCB FW addr*/ dtOffset_t lpcNode = i_dt->addNode(xscomNode,"lpc",l_lpcInfo); i_dt->addPropertyString(lpcNode, "compatible", "ibm,power8-lpc"); @@ -361,8 +368,8 @@ uint32_t bld_cpu_node(devTree * i_dt, dtOffset_t & i_parentNode, i_dt->addPropertyCell32(cpuNode, "ibm,purr", 1); i_dt->addPropertyCell32(cpuNode, "ibm,spurr", 1); - //TODO RTC88002 -- move this to nominal once HB has nominal freq - uint64_t freq = sys->getAttr(); + //Set Nominal freq + uint64_t freq = sys->getAttr(); freq *= MHZ; uint32_t ex_freq[2] = {static_cast(freq >> 32), diff --git a/src/usr/hwpf/hwp/tod_init/TodHwpIntf.C b/src/usr/hwpf/hwp/tod_init/TodHwpIntf.C index 6a4a08574..55ddd8c3f 100755 --- a/src/usr/hwpf/hwp/tod_init/TodHwpIntf.C +++ b/src/usr/hwpf/hwp/tod_init/TodHwpIntf.C @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013 */ +/* COPYRIGHT International Business Machines Corp. 2013,2014 */ /* */ /* p1 */ /* */ @@ -90,6 +90,23 @@ errlHndl_t todSetupHwp(const proc_tod_setup_tod_sel i_topologyType) l_pMDMT->getBusIn(), l_pMDMT->getBusOut()); break; } + + //Mark the MDMT role in ATTR. Note the same chip + //can be both primary/secondary. Attr is volatile + //init'ed to zero + TARGETING::Target * l_proc = + const_cast(l_pMDMT->getTarget()); + uint8_t l_role = l_proc->getAttr(); + if (TOD_PRIMARY == i_topologyType) + { + l_role |= TARGETING::TOD_ROLE_PRIMARY; + } + else //Secondary + { + l_role |= TARGETING::TOD_ROLE_SECONDARY; + } + l_proc->setAttr(l_role); + }while(0); TOD_EXIT("todSetupHwp. errHdl = %p", l_errHdl); diff --git a/src/usr/hwpf/hwp/tod_init/tod_init.C b/src/usr/hwpf/hwp/tod_init/tod_init.C index 3f7ea8290..4e2ecb44e 100644 --- a/src/usr/hwpf/hwp/tod_init/tod_init.C +++ b/src/usr/hwpf/hwp/tod_init/tod_init.C @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013 */ +/* COPYRIGHT International Business Machines Corp. 2013,2014 */ /* */ /* p1 */ /* */ diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml index 96d21449c..424a176cf 100644 --- a/src/usr/targeting/common/xmltohb/attribute_types.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types.xml @@ -13379,6 +13379,40 @@ firmware notes: Platforms should initialize this attribute to AUTO (0) + + + TOD_ROLE + + Enumeration indicating what role this chip has in tod topology + + + NON_MASTER + 0 + + + PRIMARY + 1 + + + SECONDARY + 2 + + NON_MASTER + + + + TOD_ROLE + + Bitmask indicating what role this chip has in tod topology + + + + + volatile-zeroed + + + + diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml index 2c5dec265..fb2db11cf 100644 --- a/src/usr/targeting/common/xmltohb/target_types.xml +++ b/src/usr/targeting/common/xmltohb/target_types.xml @@ -437,6 +437,8 @@ PROC_MEM_SIZES_ACK CPM_INFLECTION_POINTS PROC_SELECT_BOOT_SEEPROM_IMAGE + TOD_ROLE + -- cgit v1.2.1