Skip to content

Commit

Permalink
Make RT_TARG id generation code common between IPL time and runtime
Browse files Browse the repository at this point in the history
For axone we are writing the OMI mmio bars into hdat so the hypervisor
know how to talk to the devices. IPL code needs to be able to lookup
the hbrt-style ids so we can use them to make hdat entries that the
hypervisor will be able to associate targets with. This commit also
move rt_targeting.H to the correct include directory and updates
everywhere that it is included.

Change-Id: I31deaa1a9c5a7523622a8b3b12ad459e2b2feed3
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/80419
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com>
  • Loading branch information
crgeddes authored and dcrowell77 committed Jan 22, 2020
1 parent 5820710 commit f32aff5
Show file tree
Hide file tree
Showing 33 changed files with 232 additions and 148 deletions.
6 changes: 3 additions & 3 deletions src/include/usr/runtime/customize_attrs_for_payload.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016 */
/* Contributors Listed Below - COPYRIGHT 2016,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -33,7 +33,7 @@
*/

#include <errl/errlentry.H>
#include <runtime/rt_targeting.H>
#include <targeting/runtime/rt_targeting.H>
#include <targeting/common/attributes.H>

namespace RUNTIME
Expand All @@ -42,7 +42,7 @@ namespace RUNTIME
static const TARGETING::ATTR_HBRT_HYP_ID_type HBRT_HYP_ID_UNKNOWN
= 0xFFFFFFFFFFFFFFFFULL;

static const RT_TARG::rtChipId_t RT_TYPE_UNKNOWN
static const TARGETING::rtChipId_t RT_TYPE_UNKNOWN
= 0xFFFFFFFFFFFFFFFFULL;

/**
Expand Down
45 changes: 45 additions & 0 deletions src/include/usr/targeting/common/hbrt_target.H
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/include/usr/targeting/common/hbrt_target.H $ */
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2019,2020 */
/* [+] 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 __HBRT_TARGET_H
#define __HBRT_TARGET_H

#include <errl/errlentry.H>

namespace TARGETING
{
typedef uint64_t rtChipId_t;
/**
* @brief Convert a TARGETING::Target to an unit ID that can be used
* in calls to the runtime host
* @param[in] The HB TARGETING::Target
* @param[out] Sapphire target id
* @return an error handle on error
*/
errlHndl_t getRtTarget(const TARGETING::Target* i_target,
rtChipId_t &o_targetId);

}

#endif
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/include/usr/runtime/rt_targeting.H $ */
/* $Source: src/include/usr/targeting/runtime/rt_targeting.H $ */
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2014,2018 */
/* Contributors Listed Below - COPYRIGHT 2014,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand All @@ -26,6 +26,7 @@
#define __RT_TARGETING_H

#include <errl/errlentry.H>
#include <targeting/common/hbrt_target.H>

namespace TARGETING
{
Expand All @@ -34,7 +35,6 @@ namespace TARGETING

namespace RT_TARG
{
typedef uint64_t rtChipId_t;

enum
{
Expand All @@ -43,23 +43,14 @@ namespace RT_TARG
};


/**
* @brief Convert a TARGETING::Target to an unit ID that can be used
* in calls to the runtime host
* @param[in] The HB TARGETING::Target
* @param[out] Sapphire target id
* @return an error handle on error
*/
errlHndl_t getRtTarget(const TARGETING::Target* i_target,
rtChipId_t &o_targetId);

/**
* @brief Convert a runtime chip_id (target) into a TARGETING::Target
* @param[in] The rt chipId
* @param[out] The TARGETING::Target pointer
* @return error log handle on error else NULL
*/
errlHndl_t getHbTarget(rtChipId_t i_rt_chip_id,
errlHndl_t getHbTarget(TARGETING::rtChipId_t i_rt_chip_id,
TARGETING::Target *& o_target);

/**
Expand Down
2 changes: 1 addition & 1 deletion src/usr/diag/attn/runtime/attn_rt.C
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "common/attnmem.H"
#include "common/attnbits.H"
#include <runtime/interface.h>
#include <runtime/rt_targeting.H>
#include <targeting/runtime/rt_targeting.H>
#include <targeting/common/target.H>
#include <targeting/common/targetservice.H>
#include <targeting/common/utilFilter.H>
Expand Down
10 changes: 5 additions & 5 deletions src/usr/diag/attn/runtime/test/attntestRtAttns.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2014,2016 */
/* Contributors Listed Below - COPYRIGHT 2014,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -38,7 +38,7 @@
#include "../../common/attntrace.H"
#include "../../common/attntarget.H"
#include <runtime/interface.h>
#include <runtime/rt_targeting.H>
#include <targeting/runtime/rt_targeting.H>
#include <targeting/common/targetservice.H>

using namespace ATTN;
Expand Down Expand Up @@ -79,8 +79,8 @@ class AttnCheckForRtAttentionsTest : public CxxTest::TestSuite
}
proc = procList[0];

RT_TARG::rtChipId_t chipId = 0;
errlHndl_t err = RT_TARG::getRtTarget( proc, chipId );
TARGETING::rtChipId_t chipId = 0;
errlHndl_t err = TARGETING::getRtTarget( proc, chipId );
if( NULL != err )
{
TS_FAIL("getRtTarget() failed for 0x%08X",
Expand Down Expand Up @@ -153,7 +153,7 @@ class AttnCheckForRtAttentionsTest : public CxxTest::TestSuite
break;
}

RT_TARG::rtChipId_t chipId = 0;
TARGETING::rtChipId_t chipId = 0;
errlHndl_t err = RT_TARG::getRtTarget( proc, chipId );
if( NULL != err )
{
Expand Down
4 changes: 2 additions & 2 deletions src/usr/fsi/runtime/rt_fsi.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand All @@ -24,7 +24,7 @@
/* IBM_PROLOG_END_TAG */

#include <stdlib.h>
#include <runtime/rt_targeting.H>
#include <targeting/runtime/rt_targeting.H>
#include <runtime/interface.h>

#include <targeting/common/targetservice.H>
Expand Down
4 changes: 2 additions & 2 deletions src/usr/htmgt/runtime/rt_occ.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2014,2018 */
/* Contributors Listed Below - COPYRIGHT 2014,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand All @@ -27,7 +27,7 @@
#include <htmgt/htmgt.H>
#include "../htmgt_utility.H"
#include <targeting/common/commontargeting.H>
#include <runtime/rt_targeting.H>
#include <targeting/runtime/rt_targeting.H>


using namespace TARGETING;
Expand Down
2 changes: 1 addition & 1 deletion src/usr/i2c/runtime/rt_eepromCache.C
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include <devicefw/driverif.H>
#include <i2c/eepromddreasoncodes.H>
#include <runtime/interface.h>
#include <runtime/rt_targeting.H>
#include <targeting/runtime/rt_targeting.H>
#include <targeting/common/utilFilter.H>
#include <targeting/attrrp.H>
#include <trace/interface.H>
Expand Down
8 changes: 4 additions & 4 deletions src/usr/i2c/runtime/rt_i2c.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* Contributors Listed Below - COPYRIGHT 2015,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -41,7 +41,7 @@
#include <devicefw/driverif.H>
#include <i2c/i2creasoncodes.H>
#include <runtime/interface.h>
#include <runtime/rt_targeting.H>
#include <targeting/runtime/rt_targeting.H>
#include "../errlud_i2c.H"

// ----------------------------------------------
Expand Down Expand Up @@ -146,10 +146,10 @@ errlHndl_t i2cPerformOp( DeviceFW::OperationType i_opType,

int rc = 0;
bool l_host_if_enabled = true;
RT_TARG::rtChipId_t proc_id = 0;
TARGETING::rtChipId_t proc_id = 0;

// Convert target to proc id
err = RT_TARG::getRtTarget( i_target,
err = TARGETING::getRtTarget( i_target,
proc_id);
if(err)
{
Expand Down
6 changes: 3 additions & 3 deletions src/usr/isteps/nvdimm/nvdimm.C
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#include <targeting/common/targetUtil.H>
#ifdef __HOSTBOOT_RUNTIME
#include <runtime/hbrt_utilities.H>
#include <usr/runtime/rt_targeting.H>
#include <targeting/runtime/rt_targeting.H>
#else
#include <initservice/istepdispatcherif.H>
#endif
Expand Down Expand Up @@ -3802,9 +3802,9 @@ errlHndl_t notifyNvdimmProtectionChange(Target* i_target,

// Send combined status notification
// Get the Proc Chip Id
RT_TARG::rtChipId_t l_chipId = 0;
TARGETING::rtChipId_t l_chipId = 0;

l_err = RT_TARG::getRtTarget(l_proc, l_chipId);
l_err = TARGETING::getRtTarget(l_proc, l_chipId);
if(l_err)
{
TRACFCOMP( g_trac_nvdimm,
Expand Down
2 changes: 1 addition & 1 deletion src/usr/isteps/nvdimm/runtime/nvdimm_rt.C
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#include <targeting/common/commontargeting.H>
#include <targeting/common/util.H>
#include <targeting/common/utilFilter.H>
#include <usr/runtime/rt_targeting.H>
#include <targeting/runtime/rt_targeting.H>
#include <runtime/interface.h>
#include <arch/ppc.H>
#include <isteps/nvdimm/nvdimmreasoncodes.H>
Expand Down
8 changes: 4 additions & 4 deletions src/usr/isteps/pm/runtime/rt_pm.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* Contributors Listed Below - COPYRIGHT 2016,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -37,7 +37,6 @@

#include <runtime/interface.h> // g_hostInterfaces
#include <runtime/rt_fwreq_helper.H> // firmware_request_helper
#include <runtime/rt_targeting.H>
#include <runtime/runtime_reasoncodes.H>

#include <initservice/isteps_trace.H>
Expand All @@ -46,6 +45,7 @@
#include <targeting/common/util.H>
#include <targeting/common/utilFilter.H>
#include <targeting/common/targetservice.H>
#include <targeting/runtime/rt_targeting.H>

#include <scom/scomif.H>
#include <scom/wakeup.H>
Expand Down Expand Up @@ -400,9 +400,9 @@ namespace RTPM
}

// Get the Proc Chip Id
RT_TARG::rtChipId_t l_chipId = 0;
TARGETING::rtChipId_t l_chipId = 0;

l_err = RT_TARG::getRtTarget(l_pChipTarget, l_chipId);
l_err = TARGETING::getRtTarget(l_pChipTarget, l_chipId);
if(l_err)
{
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
Expand Down
4 changes: 2 additions & 2 deletions src/usr/isteps/pm/runtime/test/pmtestRt.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2017,2018 */
/* Contributors Listed Below - COPYRIGHT 2017,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -33,7 +33,7 @@

#include <cxxtest/TestSuite.H>
#include <runtime/interface.h>
#include <runtime/rt_targeting.H>
#include <targeting/runtime/rt_targeting.H>
#include <targeting/common/utilFilter.H>
#include <errl/errlmanager.H>
#include <devicefw/userif.H>
Expand Down
6 changes: 3 additions & 3 deletions src/usr/pnor/runtime/rt_pnor.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2014,2019 */
/* Contributors Listed Below - COPYRIGHT 2014,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand All @@ -29,7 +29,7 @@
#include <initservice/taskargs.H>
#include <initservice/initserviceif.H>

#include <runtime/rt_targeting.H>
#include <targeting/runtime/rt_targeting.H>
#include <runtime/interface.h> // g_hostInterfaces, postInitCalls_t

#include <pnor/pnorif.H>
Expand Down Expand Up @@ -923,7 +923,7 @@ errlHndl_t RtPnor::getMasterProcId()
TRACFCOMP(g_trac_pnor, "RtPnor::getMasterProcId: queryMasterProcChipTargetHandle failed");
break;
}
l_err = RT_TARG::getRtTarget(l_masterProc, iv_masterProcId);
l_err = TARGETING::getRtTarget(l_masterProc, iv_masterProcId);
if (l_err)
{
TRACFCOMP(g_trac_pnor, "RtPnor::getMasterProcId: getRtTarget failed for master proc");
Expand Down

0 comments on commit f32aff5

Please sign in to comment.