diff options
| author | Doug Gilbert <dgilbert@us.ibm.com> | 2013-09-16 16:13:27 -0500 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-10-17 11:26:40 -0500 |
| commit | 498291a1a22d35ffb27ba7d6665d9cec22d8d98e (patch) | |
| tree | cd4d2efcff399b2a91858f56e6a6654d91513c21 /src/usr/testcore/rtloader | |
| parent | 25a68ad9643b83001dbe80120f854221e65e9585 (diff) | |
| download | blackbird-hostboot-498291a1a22d35ffb27ba7d6665d9cec22d8d98e.tar.gz blackbird-hostboot-498291a1a22d35ffb27ba7d6665d9cec22d8d98e.zip | |
Hostboot runtime scom support
RTC: 79407
RTC: 79406
Change-Id: I8cbf1f21e8e9e205eb0130ce96187619647cf486
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/6350
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/rtloader')
| -rw-r--r-- | src/usr/testcore/rtloader/loader.H | 72 |
1 files changed, 71 insertions, 1 deletions
diff --git a/src/usr/testcore/rtloader/loader.H b/src/usr/testcore/rtloader/loader.H index 205522536..60272aa63 100644 --- a/src/usr/testcore/rtloader/loader.H +++ b/src/usr/testcore/rtloader/loader.H @@ -26,8 +26,11 @@ #include <pnor/pnorif.H> #include <util/align.H> #include <sys/mm.h> -#include <errl/errlentry.H> +#include <targeting/common/targetservice.H> +#include <targeting/common/attributes.H> +#include <targeting/common/utilFilter.H> #include <errl/errlmanager.H> +#include <map> #include <runtime/interface.h> @@ -100,6 +103,8 @@ class RuntimeLoaderTest : public CxxTest::TestSuite intf->realloc = realloc; intf->assert = rt_assert; intf->sendErrorLog = rt_logErr; + intf->scom_read = rt_scom_read; + intf->scom_write = rt_scom_write; // Call init. runtimeInterfaces_t* rtInterface = @@ -163,6 +168,62 @@ class RuntimeLoaderTest : public CxxTest::TestSuite assert(false); } + + + + static int rt_scom_read(uint32_t chipid, + uint32_t addr, + void* data) + { + int rc = 0; + + TRACFCOMP(g_trac_test, + "RUNTIME MSG: Scom read chipid: 0x%08x Address: 0x%08x", + chipid, + addr); + + uint64_t * data64 = static_cast<uint64_t *>(data); + + SCOM_KEY scomKey(chipid,addr); + SCOM_MAP::iterator it = cv_scomMap.find(scomKey); + + if(it != cv_scomMap.end()) + { + *data64 = it->second; + } + else + { + *data64 = 0; + } + + return rc; + } + + + + + static int rt_scom_write(uint32_t chipid, + uint32_t addr, + void* data) + { + int rc = 0; + + TRACFCOMP(g_trac_test, + "RUNTIME MSG: Scom write chipid: 0x%08x Address: 0x%08x", + chipid, + addr); + + uint64_t * data64 = static_cast<uint64_t *>(data); + + SCOM_KEY scomKey(chipid,addr); + cv_scomMap[scomKey] = *data64; + + return rc; + } + + + + static int rt_logErr(uint32_t plid, uint32_t data_len, void * data) @@ -185,5 +246,14 @@ class RuntimeLoaderTest : public CxxTest::TestSuite return rc; } + + + typedef std::pair<uint32_t,uint32_t> SCOM_KEY; + typedef std::map<SCOM_KEY,uint64_t> SCOM_MAP; + static SCOM_MAP cv_scomMap; }; + + +RuntimeLoaderTest::SCOM_MAP RuntimeLoaderTest::cv_scomMap; + #endif |

