summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2014-01-21 17:40:48 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-02-11 15:30:19 -0600
commit18bdf83d7705bd3c519b195ce095e39181214435 (patch)
tree5fac3905de3c887a375766446fc3935376516ed8 /src
parenta8796c565730ff18859ee037ae517afbfabd0d34 (diff)
downloadtalos-hostboot-18bdf83d7705bd3c519b195ce095e39181214435.tar.gz
talos-hostboot-18bdf83d7705bd3c519b195ce095e39181214435.zip
HBRT: Defer indirect scoms to Sapphire.
Change-Id: I252016d0bfe3fea15deba5968d0d8a6ff044cb22 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/8213 Tested-by: Jenkins Server Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/include/runtime/interface.h6
-rw-r--r--src/runtime/rt_stdlib.C8
-rw-r--r--src/usr/scom/scom.C16
-rw-r--r--src/usr/testcore/rtloader/loader.H11
-rw-r--r--src/usr/xscom/runtime/rt_xscom.C18
5 files changed, 28 insertions, 31 deletions
diff --git a/src/include/runtime/interface.h b/src/include/runtime/interface.h
index 0674ce697..dd744a27d 100644
--- a/src/include/runtime/interface.h
+++ b/src/include/runtime/interface.h
@@ -64,8 +64,6 @@ typedef struct hostInterfaces
void (*free)(void*);
/** realloc */
void* (*realloc)(void*, size_t);
- /** sleep */
- void (*sleep)(uint64_t sec, uint64_t nsec);
/** sendErrorLog
* @param[in] plid Platform Log identifier
@@ -81,7 +79,7 @@ typedef struct hostInterfaces
* @param[in] pointer to 8-byte data buffer
* @return 0 on success else return code
*/
- int (*scom_read)(uint32_t, uint32_t, void*);
+ int (*scom_read)(uint64_t, uint64_t, void*);
/** Scan communication write
* @param[in] chip_id (based on devtree defn)
@@ -89,7 +87,7 @@ typedef struct hostInterfaces
* @param[in] pointer to 8-byte data buffer
* @return 0 on success else return code
*/
- int (*scom_write)(uint32_t, uint32_t, void* );
+ int (*scom_write)(uint64_t, uint64_t, void* );
/** lid_load
* Load a LID from PNOR, FSP, etc.
diff --git a/src/runtime/rt_stdlib.C b/src/runtime/rt_stdlib.C
index ba1bc347a..7735cd230 100644
--- a/src/runtime/rt_stdlib.C
+++ b/src/runtime/rt_stdlib.C
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2013 */
+/* COPYRIGHT International Business Machines Corp. 2013,2014 */
/* */
/* p1 */
/* */
@@ -23,7 +23,6 @@
#include <stdlib.h>
#include <runtime/interface.h>
#include <string.h>
-#include <sys/time.h>
void* malloc(size_t s)
{
@@ -55,8 +54,3 @@ void* calloc(size_t num, size_t size)
return mem;
}
-
-void nanosleep( uint64_t sec, uint64_t nsec )
-{
- g_hostInterfaces->sleep(sec,nsec);
-}
diff --git a/src/usr/scom/scom.C b/src/usr/scom/scom.C
index b15f72406..8030d52b5 100644
--- a/src/usr/scom/scom.C
+++ b/src/usr/scom/scom.C
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2011,2013 */
+/* COPYRIGHT International Business Machines Corp. 2011,2014 */
/* */
/* p1 */
/* */
@@ -98,26 +98,31 @@ errlHndl_t checkIndirectAndDoScom(DeviceFW::OperationType i_opType,
{
errlHndl_t l_err = NULL;
- mutex_t* l_mutex = NULL;
- uint64_t elapsed_indScom_time_ns = 0;
- bool l_indScomError = false;
- uint64_t temp_io_buffer = 0;
enum { MAX_INDSCOM_TIMEOUT_NS = 100000 }; //=.1ms
+ // In HOSTBOOT_RUNTIME we always defer indirect scoms to Sapphire.
+#ifndef __HOSTBOOT_RUNTIME
// If the indirect scom bit is 0, then doing a regular scom
if( (i_addr & 0x8000000000000000) == 0)
{
+#endif // __HOSTBOOT_RUNTIME
l_err = doScomOp(i_opType,
i_target,
io_buffer,
io_buflen,
i_accessType,
i_addr);
+#ifndef __HOSTBOOT_RUNTIME
}
// We are performing an indirect scom.
else
{
+ mutex_t* l_mutex = NULL;
+ uint64_t elapsed_indScom_time_ns = 0;
+ bool l_indScomError = false;
+ uint64_t temp_io_buffer = 0;
+
uint64_t l_io_buffer = 0;
uint64_t temp_scomAddr = 0;
@@ -399,6 +404,7 @@ errlHndl_t checkIndirectAndDoScom(DeviceFW::OperationType i_opType,
}
} // end of write
}
+#endif // __HOSTBOOT_RUNTIME
return l_err;
}
diff --git a/src/usr/testcore/rtloader/loader.H b/src/usr/testcore/rtloader/loader.H
index eacb2b2af..a47a53664 100644
--- a/src/usr/testcore/rtloader/loader.H
+++ b/src/usr/testcore/rtloader/loader.H
@@ -108,7 +108,6 @@ class RuntimeLoaderTest : public CxxTest::TestSuite
intf->malloc = malloc;
intf->free = free;
intf->realloc = realloc;
- intf->sleep = nanosleep;
intf->assert = rt_assert;
intf->sendErrorLog = rt_logErr;
intf->scom_read = rt_scom_read;
@@ -179,8 +178,8 @@ class RuntimeLoaderTest : public CxxTest::TestSuite
assert(false);
}
- static int rt_scom_read(uint32_t chipid,
- uint32_t addr,
+ static int rt_scom_read(uint64_t chipid,
+ uint64_t addr,
void* data)
{
int rc = 0;
@@ -207,8 +206,8 @@ class RuntimeLoaderTest : public CxxTest::TestSuite
return rc;
}
- static int rt_scom_write(uint32_t chipid,
- uint32_t addr,
+ static int rt_scom_write(uint64_t chipid,
+ uint64_t addr,
void* data)
{
int rc = 0;
@@ -226,7 +225,7 @@ class RuntimeLoaderTest : public CxxTest::TestSuite
return rc;
}
- typedef std::pair<uint32_t,uint32_t> SCOM_KEY;
+ typedef std::pair<uint64_t,uint64_t> SCOM_KEY;
typedef std::map<SCOM_KEY,uint64_t> SCOM_MAP;
static SCOM_MAP cv_scomMap;
diff --git a/src/usr/xscom/runtime/rt_xscom.C b/src/usr/xscom/runtime/rt_xscom.C
index 7aa8669cb..13c2557ba 100644
--- a/src/usr/xscom/runtime/rt_xscom.C
+++ b/src/usr/xscom/runtime/rt_xscom.C
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2013 */
+/* COPYRIGHT International Business Machines Corp. 2013,2014 */
/* */
/* p1 */
/* */
@@ -43,7 +43,7 @@ namespace XSCOM
enum
{
CHIPID_NODE_SHIFT = 3, // CHIPID is 'NNNCCC'b, shift 3
- MEMBUF_ID_SHIFT = 4, // CHIPID for MEMBUF is 'NNNCCCMMMM'b
+ MEMBUF_ID_SHIFT = 4, // CHIPID for MEMBUF is 'NNNCCCMMMM'b
MEMBUF_ID_FLAG = 0x80000000, // MEMBUF chip id has MSbit on
};
@@ -71,11 +71,11 @@ DEVICE_REGISTER_ROUTE(DeviceFW::WILDCARD,
/**
* @brief Convert target into chipId that the hypervisor uses
* @param[in] i_target The HB TARGETING target
- * @param[out] o_chipId 32-bit chipid
+ * @param[out] o_chipId Chipid
* @return errlHndl_t Error handle if there was an error
*/
errlHndl_t get_rt_target(TARGETING::Target* i_target,
- uint32_t & o_chipId);
+ uint64_t & o_chipId);
/**
* @brief Internal routine that verifies the validity of input parameters
@@ -162,7 +162,7 @@ errlHndl_t xscomOpSanityCheck(const DeviceFW::OperationType i_opType,
errlHndl_t get_rt_target(TARGETING::Target* i_target,
- uint32_t &o_chipId)
+ uint64_t &o_chipId)
{
errlHndl_t l_err = NULL;
@@ -276,7 +276,7 @@ errlHndl_t get_rt_target(TARGETING::Target* i_target,
o_chipId = (fabId << CHIPID_NODE_SHIFT) + procPos;
}
} while(0);
-
+
return l_err;
}
@@ -286,12 +286,12 @@ errlHndl_t get_rt_target(TARGETING::Target* i_target,
*/
errlHndl_t xScomDoOp(DeviceFW::OperationType i_ioType,
TARGETING::Target * i_target,
- uint32_t i_scomAddr,
+ uint64_t i_scomAddr,
void * io_buffer)
{
errlHndl_t l_err = NULL;
int rc = 0;
- uint32_t proc_id = 0;
+ uint64_t proc_id = 0;
// Convert target to something Sapphire understands
l_err = get_rt_target(i_target,
@@ -398,7 +398,7 @@ errlHndl_t xscomPerformOp(DeviceFW::OperationType i_opType,
l_err = xScomDoOp(i_opType,
i_target,
- (uint32_t)l_addr,
+ l_addr,
io_buffer);
}
OpenPOWER on IntegriCloud