From dd2a474b7fc3a8937f45d1278e887b370ad81192 Mon Sep 17 00:00:00 2001 From: Doug Gilbert Date: Tue, 15 Oct 2013 13:55:28 -0500 Subject: 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 Reviewed-by: A. Patrick Williams III --- src/usr/testcore/rtloader/loader.H | 44 +++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) (limited to 'src/usr/testcore') 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 #include #include - #include +#include 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(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(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 RuntimeLoaderTest::cv_loadedLids; +uint64_t RuntimeLoaderTest::cv_vpd_addr = 0; #endif -- cgit v1.2.3