summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorDean Sanner <dsanner@us.ibm.com>2013-01-03 10:16:18 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-08-09 13:43:19 -0500
commit97bd69daf028bec2f7d7f4fbd8feb49486fb4577 (patch)
tree3168aba491fb1cbdd181c40c3e3947410a47e28e /src/include
parent7b0dcb2cc3a80cb09aa2af5d4cd2f2673c7146a6 (diff)
downloadtalos-hostboot-97bd69daf028bec2f7d7f4fbd8feb49486fb4577.tar.gz
talos-hostboot-97bd69daf028bec2f7d7f4fbd8feb49486fb4577.zip
Basic devtree support
Simple devtree support for Sapphire in SPless mode Change-Id: I4a70bfc5cd3eb3dbd1b443869c046c789f98cc95 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3739 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/include')
-rw-r--r--src/include/kernel/misc.H2
-rw-r--r--src/include/sys/misc.h5
-rw-r--r--src/include/usr/devtree/devtree_reasoncodes.H43
-rw-r--r--src/include/usr/devtree/devtreeif.H51
-rw-r--r--src/include/usr/hbotcompid.H10
-rw-r--r--src/include/usr/initservice/initserviceif.H5
-rw-r--r--src/include/usr/intr/interrupt.H40
-rw-r--r--src/include/usr/isteps/istep21list.H1
8 files changed, 153 insertions, 4 deletions
diff --git a/src/include/kernel/misc.H b/src/include/kernel/misc.H
index 544df7c88..42cfd3fa0 100644
--- a/src/include/kernel/misc.H
+++ b/src/include/kernel/misc.H
@@ -45,6 +45,8 @@ namespace KernelMisc
extern uint64_t g_payload_base;
/** @brief Address from base of payload entry-point. */
extern uint64_t g_payload_entry;
+ /** @brief Address from base of payload data pointer. */
+ extern uint64_t g_payload_data;
/** @fn in_kernel_mode
* @brief Determine if the code is currently in kernel mode or not.
diff --git a/src/include/sys/misc.h b/src/include/sys/misc.h
index f3e89e4e7..a73398efa 100644
--- a/src/include/sys/misc.h
+++ b/src/include/sys/misc.h
@@ -95,10 +95,13 @@ extern "C"
* @param[in] i_payload_base The base address (target HRMOR) of the payload.
* @param[in] i_payload_entry The offset from base address of the payload
* entry-point.
+ * @param[in] i_payload_data Data pointer fo the payload. For standalone
+ * Saphire this is the devtree
*/
extern "C" void shutdown(uint64_t i_status,
uint64_t i_payload_base,
- uint64_t i_payload_entry);
+ uint64_t i_payload_entry,
+ uint64_t i_payload_data);
#endif
/** @enum ProcessorCoreType
diff --git a/src/include/usr/devtree/devtree_reasoncodes.H b/src/include/usr/devtree/devtree_reasoncodes.H
new file mode 100644
index 000000000..c996ebca3
--- /dev/null
+++ b/src/include/usr/devtree/devtree_reasoncodes.H
@@ -0,0 +1,43 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/devtree/devtree_reasoncodes.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012,2013 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+#ifndef __DEVTREE_REASONCODES_H
+#define __DEVTREE_REASONCODES_H
+
+#include <hbotcompid.H>
+
+namespace DEVTREE
+{
+ enum DevtreeModuleId
+ {
+ MOD_DEVTREE_INVALID = 0x00, /**< Zero is invalid module id */
+ MOD_DEVTREE_BLD_MEM = 0x01,
+ };
+
+ enum DevtreeReasonCode
+ {
+ RC_ATTR_MEMSIZE_GET_FAIL = DEVTREE_COMP_ID | 0x01,
+ RC_ATTR_MEMBASE_GET_FAIL = DEVTREE_COMP_ID | 0x02,
+ };
+};
+
+#endif
diff --git a/src/include/usr/devtree/devtreeif.H b/src/include/usr/devtree/devtreeif.H
new file mode 100644
index 000000000..e6c068e88
--- /dev/null
+++ b/src/include/usr/devtree/devtreeif.H
@@ -0,0 +1,51 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/devtree/devtreeif.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012,2013 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+#ifndef __DEVTREE_IF_H
+#define __DEVTREE_IF_H
+
+#include <errl/errlentry.H>
+
+
+namespace DEVTREE
+{
+
+ /**
+ * @brief Build flattened dev tree for Sapphire
+ *
+ * @return errlHndl_t NULL on success
+ */
+ errlHndl_t build_flatdevtree( void );
+
+ /**
+ * @brief Get the address of the flattened dev tree for Sapphire
+ *
+ * @return uint64_t - Address if valid, else NULL
+ */
+ uint64_t get_flatdevtree_phys_addr( void );
+
+
+
+
+}; // end namespace DEVTREE
+
+#endif
diff --git a/src/include/usr/hbotcompid.H b/src/include/usr/hbotcompid.H
index 0484715f1..994aac1de 100644
--- a/src/include/usr/hbotcompid.H
+++ b/src/include/usr/hbotcompid.H
@@ -265,6 +265,7 @@ const char KERNEL_COMP_NAME[] = "kernel";
//@{
const compId_t IBSCOM_COMP_ID = 0x1C00;
const char IBSCOM_COMP_NAME[] = "ibscom";
+//@}
/** @name VPD
@@ -291,7 +292,6 @@ const compId_t IPC_COMP_ID = 0x1F00;
const char IPC_COMP_NAME[] = "ipc";
//@}
-
/** @name HSVC
* Host Services component
* For the code running under PHYP
@@ -300,6 +300,14 @@ const char IPC_COMP_NAME[] = "ipc";
const compId_t HSVC_COMP_ID = 0x2000;
const char HSVC_COMP_NAME[] = "hsvc";
+/** @name DEVTREE
+ * DEVTREE component
+ */
+//@{
+const compId_t DEVTREE_COMP_ID = 0x2100;
+const char DEVTREE_COMP_NAME[] = "devtree";
+//@}
+
/** @name RESERVED
* Reserved component ID. x3100 is the component ID
* of FipS ERRL component. Due to our use of
diff --git a/src/include/usr/initservice/initserviceif.H b/src/include/usr/initservice/initserviceif.H
index f09433e15..77db81ea4 100644
--- a/src/include/usr/initservice/initserviceif.H
+++ b/src/include/usr/initservice/initserviceif.H
@@ -84,6 +84,7 @@ bool unregisterShutdownEvent(msg_q_t i_msgQ);
* payload.
* @param[in] i_payload_entry - The offset from base address of the
* payload entry-point.
+ * @param[in] i_payload_data - Pointer to payload data (if needed)
*
* @return Nothing
*
@@ -91,8 +92,8 @@ bool unregisterShutdownEvent(msg_q_t i_msgQ);
*/
void doShutdown ( uint64_t i_status,
uint64_t i_payload_base = 0,
- uint64_t i_payload_entry = 0 ) NO_RETURN;
-
+ uint64_t i_payload_entry = 0,
+ uint64_t i_payload_data = 0) NO_RETURN;
}
#endif
diff --git a/src/include/usr/intr/interrupt.H b/src/include/usr/intr/interrupt.H
index cf129712a..f41f8ccf6 100644
--- a/src/include/usr/intr/interrupt.H
+++ b/src/include/usr/intr/interrupt.H
@@ -33,6 +33,37 @@ namespace TARGETING
namespace INTR
{
+ /**
+ * cpu PIR register
+ */
+ struct PIR_t
+ {
+ union
+ {
+ uint32_t word;
+ struct
+ {
+ //P8:
+ uint32_t reserved:19; //!< zeros
+ uint32_t nodeId:3; //!< node (0-3)
+ uint32_t chipId:3; //!< chip pos on node (0-5)
+ uint32_t coreId:4; //!< Core number (1-6,9-14)?
+ uint32_t threadId:3; //!< Thread number (0-7)
+ } PACKED;
+ };
+ PIR_t(uint32_t i_word = 0) : word(i_word) {}
+
+ PIR_t operator= (uint32_t i_word)
+ {
+ word = i_word;
+ return word;
+ }
+
+ bool operator< (const PIR_t& r) const
+ {
+ return word < r.word;
+ }
+ };
/**
* External Interrupt Types (XISR)
@@ -165,6 +196,15 @@ namespace INTR
*/
errlHndl_t enablePsiIntr(TARGETING::Target * i_target);
+ /**
+ * Return the interrupt presenter for requested target/thread
+ * @param[in] i_ex The target EX
+ * @param[in] i_thread Which thread on EX (0-7)
+ * @return 64 bit address for the interrupt present addr
+ */
+ uint64_t getIntpAddr(const TARGETING::Target * i_ex,
+ uint8_t i_thread);
+
};
#endif
diff --git a/src/include/usr/isteps/istep21list.H b/src/include/usr/isteps/istep21list.H
index 0d0f6108a..7b4bfb8e1 100644
--- a/src/include/usr/isteps/istep21list.H
+++ b/src/include/usr/isteps/istep21list.H
@@ -107,6 +107,7 @@ const DepModInfo g_istep21Dependancies = {
{
DEP_LIB(libstart_payload.so),
DEP_LIB(libruntime.so),
+ DEP_LIB(libdevtree.so),
{ 0 },
}
};
OpenPOWER on IntegriCloud