From 372fd2a64a4a45e98bd50f9041d3874e0fee2341 Mon Sep 17 00:00:00 2001 From: Dan Crowell Date: Mon, 15 Sep 2014 10:38:46 -0500 Subject: Add attributes to track HOMER address Change-Id: Ia82ddcc83a52778a6b4c91d005c78c67973aad41 RTC: 108816 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/13380 Tested-by: Jenkins Server Reviewed-by: Douglas R. Gilbert Reviewed-by: A. Patrick Williams III --- src/usr/hwpf/hwp/occ/occ.C | 21 +++++++++++++++------ src/usr/hwpf/hwp/occ/runtime/rt_occ.C | 21 ++++++++++++++++++++- 2 files changed, 35 insertions(+), 7 deletions(-) (limited to 'src/usr/hwpf/hwp/occ') diff --git a/src/usr/hwpf/hwp/occ/occ.C b/src/usr/hwpf/hwp/occ/occ.C index 1f3bc509f..ea9d97076 100644 --- a/src/usr/hwpf/hwp/occ/occ.C +++ b/src/usr/hwpf/hwp/occ/occ.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,2014 */ +/* [+] 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. */ @@ -183,15 +185,22 @@ namespace HBOCC do{ //Figure out OCC image offset for Target //OCC image offset = HOMER_SIZE*ProcPosition + - // OCC offset within HOMR (happens to be zero) + // OCC offset within HOMER (happens to be zero) uint8_t tmpPos = i_target->getAttr(); tmpOffset = tmpPos*VMM_HOMER_INSTANCE_SIZE + HOMER_OFFSET_TO_OCC_IMG; targHomer = i_homerPhysAddrBase + tmpOffset; - occVirt = - reinterpret_cast - (reinterpret_cast(i_homerVirtAddrBase) - + tmpOffset) ; + uint64_t occVirt64 = + reinterpret_cast(i_homerVirtAddrBase) + + tmpOffset; + occVirt = reinterpret_cast(occVirt64); + + // Remember where we put things + if( i_target ) + { + i_target->setAttr(targHomer); + i_target->setAttr(occVirt64); + } //Figure out OCC Host Data offset for Target //OCC host data offset = HOMER_SIZE*ProcPosition + diff --git a/src/usr/hwpf/hwp/occ/runtime/rt_occ.C b/src/usr/hwpf/hwp/occ/runtime/rt_occ.C index e8025e9ed..d76d403d4 100644 --- a/src/usr/hwpf/hwp/occ/runtime/rt_occ.C +++ b/src/usr/hwpf/hwp/occ/runtime/rt_occ.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2014 */ +/* Contributors Listed Below - COPYRIGHT 2014 */ +/* [+] 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. */ @@ -122,6 +124,10 @@ namespace RT_OCC break; } + // Remember where we put things + proc_target->setAttr(i_homer_addr_phys); + proc_target->setAttr(i_homer_addr_va); + // Convert to fapi Target fapi::Target fapiTarg( fapi::TARGET_TYPE_PROC_CHIP, (const_cast(proc_target) @@ -609,6 +615,19 @@ namespace RT_OCC rt_intf->loadOCC = &executeLoadOCC; rt_intf->startOCCs = &executeStartOCCs; rt_intf->stopOCCs = &executeStopOCCs; + + // If we already loaded OCC during the IPL we need to fix up + // the virtual address because we're now not using virtual + // memory + TargetHandleList procChips; + getAllChips(procChips, TYPE_PROC, true); + for (TargetHandleList::iterator itr = procChips.begin(); + itr != procChips.end(); + ++itr) + { + uint64_t addr = (*itr)->getAttr(); + (*itr)->setAttr(addr); + } } }; -- cgit v1.2.1