diff options
author | Doug Gilbert <dgilbert@us.ibm.com> | 2013-10-15 13:55:28 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-11-13 14:49:38 -0600 |
commit | dd2a474b7fc3a8937f45d1278e887b370ad81192 (patch) | |
tree | 00595698a572529ddcd00fc3c975b588b4ea67dc /src/usr/testcore | |
parent | 1aa8f7551005dd48078b91be173e8bcc7e339061 (diff) | |
download | blackbird-hostboot-dd2a474b7fc3a8937f45d1278e887b370ad81192.tar.gz blackbird-hostboot-dd2a474b7fc3a8937f45d1278e887b370ad81192.zip |
Add VPD support to HBRT
RTC: 79419
Change-Id: I6d00e52026084a68925691b96d7a491faaffb4ef
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/7004
Tested-by: Jenkins Server
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/testcore')
-rw-r--r-- | src/usr/testcore/rtloader/loader.H | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/src/usr/testcore/rtloader/loader.H b/src/usr/testcore/rtloader/loader.H index 89bc0d436..b60c830e2 100644 --- a/src/usr/testcore/rtloader/loader.H +++ b/src/usr/testcore/rtloader/loader.H @@ -32,8 +32,8 @@ #include <errl/errlmanager.H> #include <util/utillidmgr.H> #include <map> - #include <runtime/interface.h> +#include <vpd/vpd_if.H> trace_desc_t* g_trac_hbrt = NULL; TRAC_INIT(&g_trac_hbrt, "HBRT_TEST", 2*KILOBYTE); @@ -112,6 +112,7 @@ class RuntimeLoaderTest : public CxxTest::TestSuite intf->scom_write = rt_scom_write; intf->lid_load = rt_lid_load; intf->lid_unload = rt_lid_unload; + intf->get_vpd_image_addr = rt_get_vpd; // Call init. runtimeInterfaces_t* rtInterface = @@ -296,11 +297,52 @@ class RuntimeLoaderTest : public CxxTest::TestSuite return 0; } + + //-------------------------------------------------------------------- + static uint64_t rt_get_vpd() + { + if(cv_vpd_addr != 0) + { + return cv_vpd_addr; + } + + // runtime VPD area not setup yet. + // Need to map the area into virtual memory + + uint64_t phys_addr = 0; + errlHndl_t err = VPD::vpd_load_rt_image(phys_addr); + + if(!err) + { + + uint8_t * vpd_ptr = + reinterpret_cast<uint8_t *>(phys_addr); + + void * vptr = mm_block_map(vpd_ptr, VMM_RT_VPD_SIZE); + + assert(vptr != NULL,"rt_get_vpd. Could not map VPD memory"); + + + // Store the address in a class variable so we only + // need to load vpd once. + cv_vpd_addr = reinterpret_cast<uint64_t>(vptr); + } + else + { + errlCommit(err,CXXTEST_COMP_ID); + } + + return cv_vpd_addr; + + } + + static uint64_t cv_vpd_addr; }; RuntimeLoaderTest::SCOM_MAP RuntimeLoaderTest::cv_scomMap; std::map<void*, UtilLidMgr*> RuntimeLoaderTest::cv_loadedLids; +uint64_t RuntimeLoaderTest::cv_vpd_addr = 0; #endif |