Skip to content

Commit

Permalink
Add chip base address to the OMI MMIO offset in p9a_mmio_util
Browse files Browse the repository at this point in the history
Change-Id: Iac0b3e3cbdeff703306013456663f77e4cfe6996
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/72418
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Joseph J. McGill <jmcgill@us.ibm.com>
Reviewed-by: Thi N. Tran <thi@us.ibm.com>
Reviewed-by: Matt K. Light <mklight@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/72437
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
  • Loading branch information
BenAtIBM authored and crgeddes committed Mar 1, 2019
1 parent c23e993 commit 5bfda17
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
26 changes: 22 additions & 4 deletions src/import/chips/p9/procedures/hwp/nest/p9a_mmio_util.C
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
// *HWP Consumed by: HB

#include <p9a_mmio_util.H>
#include <p9_fbc_utils.H>
#include <p9_adu_setup.H>
#include <p9_adu_access.H>
#include <p9_adu_coherent_utils.H>
Expand All @@ -42,16 +43,33 @@
fapi2::ReturnCode addOMIBase(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
uint64_t& io_mmioAddr)
{
uint64_t l_base_addr;
std::vector<uint64_t> l_base_addr_nm0;
std::vector<uint64_t> l_base_addr_nm1;
std::vector<uint64_t> l_base_addr_m;
uint64_t l_addr_offset;
uint64_t l_base_addr_mmio;

fapi2::Target<fapi2::TARGET_TYPE_OMI> l_omi_target = i_target.getParent<fapi2::TARGET_TYPE_OMI>();
fapi2::Target<fapi2::TARGET_TYPE_OMI> l_omi_target;
fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> l_chip_target;

l_omi_target = i_target.getParent<fapi2::TARGET_TYPE_OMI>();
l_chip_target = l_omi_target.getParent<fapi2::TARGET_TYPE_PROC_CHIP>();

// determine base address of chip MMIO range
FAPI_TRY(p9_fbc_utils_get_chip_base_address(l_chip_target,
EFF_FBC_GRP_CHIP_IDS,
l_base_addr_nm0,
l_base_addr_nm1,
l_base_addr_m,
l_base_addr_mmio),
"Error from p9_fbc_utils_get_chip_base_address");

FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_OMI_INBAND_BAR_BASE_ADDR_OFFSET,
l_omi_target,
l_base_addr),
l_addr_offset),
"Error from FAPI_ATTR_GET (ATTR_OMI_INBAND_BAR_BASE_ADDR_OFFSET)");

io_mmioAddr |= l_base_addr;
io_mmioAddr |= (l_base_addr_mmio | l_addr_offset);

fapi_try_exit:

Expand Down
2 changes: 2 additions & 0 deletions src/import/chips/p9/procedures/hwp/nest/p9a_mmio_util.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@
#
# IBM_PROLOG_END_TAG
PROCEDURE=p9a_mmio_util
OBJS+=p9_fbc_utils.o
$(call ADD_MODULE_INCDIR,$(PROCEDURE),$(ROOTPATH))
$(call BUILD_PROCEDURE)

0 comments on commit 5bfda17

Please sign in to comment.