summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf/hwp/occ
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2014-09-15 10:38:46 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-09-22 13:27:31 -0500
commit372fd2a64a4a45e98bd50f9041d3874e0fee2341 (patch)
tree75dcc1521d3c44508bb67e1d1198cdbe62f1ea76 /src/usr/hwpf/hwp/occ
parentfe787082ffbf72795dc3c58d09e0a7ed45600da2 (diff)
downloadtalos-hostboot-372fd2a64a4a45e98bd50f9041d3874e0fee2341.tar.gz
talos-hostboot-372fd2a64a4a45e98bd50f9041d3874e0fee2341.zip
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 <dgilbert@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/hwp/occ')
-rw-r--r--src/usr/hwpf/hwp/occ/occ.C21
-rw-r--r--src/usr/hwpf/hwp/occ/runtime/rt_occ.C21
2 files changed, 35 insertions, 7 deletions
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<ATTR_POSITION>();
tmpOffset = tmpPos*VMM_HOMER_INSTANCE_SIZE +
HOMER_OFFSET_TO_OCC_IMG;
targHomer = i_homerPhysAddrBase + tmpOffset;
- occVirt =
- reinterpret_cast<void *>
- (reinterpret_cast<uint64_t>(i_homerVirtAddrBase)
- + tmpOffset) ;
+ uint64_t occVirt64 =
+ reinterpret_cast<uint64_t>(i_homerVirtAddrBase)
+ + tmpOffset;
+ occVirt = reinterpret_cast<void *>(occVirt64);
+
+ // Remember where we put things
+ if( i_target )
+ {
+ i_target->setAttr<ATTR_HOMER_PHYS_ADDR>(targHomer);
+ i_target->setAttr<ATTR_HOMER_VIRT_ADDR>(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<ATTR_HOMER_PHYS_ADDR>(i_homer_addr_phys);
+ proc_target->setAttr<ATTR_HOMER_VIRT_ADDR>(i_homer_addr_va);
+
// Convert to fapi Target
fapi::Target fapiTarg( fapi::TARGET_TYPE_PROC_CHIP,
(const_cast<TARGETING::Target*>(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<ATTR_HOMER_PHYS_ADDR>();
+ (*itr)->setAttr<ATTR_HOMER_VIRT_ADDR>(addr);
+ }
}
};
OpenPOWER on IntegriCloud