summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2011-07-25 16:22:38 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2011-07-28 16:25:20 -0500
commitd7e9478f1de907b1b3d4923b507964222cb224fe (patch)
treee33c23c92e29eec270a7738c6286c03983584f23 /src/include
parent8d82f5f4dde24bb6f944607c59d314b9f5003ae9 (diff)
downloadtalos-hostboot-d7e9478f1de907b1b3d4923b507964222cb224fe.tar.gz
talos-hostboot-d7e9478f1de907b1b3d4923b507964222cb224fe.zip
PNOR Resource Provider (RTC:3387)
Change-Id: Ifa47ad581c7d403b927708497b565d858b31ee0f Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/213 Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Tested-by: Jenkins Server
Diffstat (limited to 'src/include')
-rw-r--r--src/include/sys/rp.h27
-rw-r--r--src/include/usr/devicefw/userif.H14
-rw-r--r--src/include/usr/hbotcompid.H8
-rw-r--r--src/include/usr/initservice/taskargs.H1
-rw-r--r--src/include/usr/pnor/pnor_reasoncodes.H19
-rw-r--r--src/include/usr/pnor/pnorif.H74
6 files changed, 142 insertions, 1 deletions
diff --git a/src/include/sys/rp.h b/src/include/sys/rp.h
new file mode 100644
index 000000000..d3ec0c772
--- /dev/null
+++ b/src/include/sys/rp.h
@@ -0,0 +1,27 @@
+/**
+ * Contains constants needed for the Resource Providers
+ */
+namespace RP
+{
+ /**
+ * Message IDs
+ */
+ enum Messages
+ {
+ /**
+ * Read 1 page of data from the RP
+ * data[0] = address to copy into (user buffer)
+ * data[1] = address to copy from (effective address)
+ */
+ READ_PAGE,
+
+ /**
+ * Write 1 page of data from the RP
+ * data[0] = address to copy from (user buffer)
+ * data[1] = address to copy into (effective address)
+ */
+ WRITE_PAGE,
+ };
+
+
+};
diff --git a/src/include/usr/devicefw/userif.H b/src/include/usr/devicefw/userif.H
index 464ab570e..794577312 100644
--- a/src/include/usr/devicefw/userif.H
+++ b/src/include/usr/devicefw/userif.H
@@ -23,7 +23,7 @@ namespace DeviceFW
SCOM = 0,
PNOR,
MAILBOX,
- PRESENT,
+ PRESENT,
LAST_ACCESS_TYPE,
};
@@ -39,6 +39,18 @@ namespace DeviceFW
#define DEVICE_PRESENT_ADDRESS() \
DeviceFW::PRESENT
+ /**
+ * Construct a PNOR DD address
+ * address = 0000_0000_0000_000c_aaaa_aaaa_aaaa_aaaa
+ * c=side, a=address
+ * @param[in] chip Chip Select
+ * @param[in] addr Offset (from zero) into selected flash chip
+ * @return 64-bit address to pass into PNOR device commands
+ */
+ #define DEVICE_PNOR_ADDRESS( chip, addr ) \
+ DeviceFW::PNOR, (((chip)<<32)|(addr))
+
+
/**
* @brief Perform a hardware read operation.
*
diff --git a/src/include/usr/hbotcompid.H b/src/include/usr/hbotcompid.H
index 5611fd69c..8567b41bc 100644
--- a/src/include/usr/hbotcompid.H
+++ b/src/include/usr/hbotcompid.H
@@ -69,4 +69,12 @@ const compId_t INITSVC_COMP_ID = 0x0500;
const char INITSVC_COMP_NAME[] = "initservice";
//@}
+/** @name PNOR
+ * PNOR component, includes RP and DD
+ */
+//@{
+const compId_t PNOR_COMP_ID = 0x0600;
+const char PNOR_COMP_NAME[] = "pnor";
+//@}
+
#endif
diff --git a/src/include/usr/initservice/taskargs.H b/src/include/usr/initservice/taskargs.H
index ea12f1800..095590153 100644
--- a/src/include/usr/initservice/taskargs.H
+++ b/src/include/usr/initservice/taskargs.H
@@ -30,6 +30,7 @@
#include <assert.h>
#include <sys/sync.h>
#include <trace/interface.H>
+#include <sys/task.h> //needed to make macro work
#include <errl/errlentry.H>
#include <errl/errlmanager.H>
diff --git a/src/include/usr/pnor/pnor_reasoncodes.H b/src/include/usr/pnor/pnor_reasoncodes.H
new file mode 100644
index 000000000..48ba21c00
--- /dev/null
+++ b/src/include/usr/pnor/pnor_reasoncodes.H
@@ -0,0 +1,19 @@
+#ifndef __PNOR_REASONCODES_H
+#define __PNOR_REASONCODES_H
+
+#include <hbotcompid.H>
+
+namespace PNOR
+{
+ enum PNORModuleId
+ {
+ PNORRP_WAITFORMESSAGE = 0x01,
+ };
+
+ enum PNORReasonCode
+ {
+ INVALID_MESSAGE = PNOR_COMP_ID | 0x01,
+ };
+};
+
+#endif
diff --git a/src/include/usr/pnor/pnorif.H b/src/include/usr/pnor/pnorif.H
new file mode 100644
index 000000000..1b551d8ee
--- /dev/null
+++ b/src/include/usr/pnor/pnorif.H
@@ -0,0 +1,74 @@
+#ifndef __PNOR_PNORIF_H
+#define __PNOR_PNORIF_H
+
+#include <stdint.h>
+#include <builtins.h>
+
+namespace PNOR
+{
+
+/**
+ * PNOR Sections
+ */
+enum SectionId
+{
+ TOC, /**< Table of Contents */
+ GLOBAL_DATA, /**< Global Data */
+ SBE_IPL, /**< Self-Boot Enginer IPL image */
+ HB_BASE_CODE, /**< Hostboot Base Image */
+ HB_DATA, /**< Hostboot Data */
+ HB_ERRLOGS, /**< Hostboot Error log Repository */
+ HB_EXT_CODE, /**< Hostboot Extended Image */
+ HB_RUNTIME, /**< Hostboot Runtime Image */
+ PAYLOAD, /**< HAL/OPAL */
+ PFW_LITE_CODE, /**< PFW-lite */
+ OCC_CODE, /**< OCC Code Image */
+ KVM_PART_INFO, /**< KVM Partition Information */
+ CODE_UPDATE, /**< Code Update Overhead */
+ NUM_SECTIONS, /**< Number of defined sections */
+
+ FIRST_SECTION = TOC, /**< First section (for looping) */
+ LAST_SECTION = CODE_UPDATE, /**< Last section (for looping) */
+ INVALID_SECTION = NUM_SECTIONS, /**< Used for error cases, initialization */
+};
+
+/**
+ * Information about a section of PNOR
+ */
+struct SectionInfo_t
+{
+ SectionId id; /**< Identifier for this section */
+ const char* name; /**< Name of the section */
+ uint64_t vaddr; /**< Virtual address for the start of the section */
+ uint64_t size; /**< Actual size of content in bytes */
+ bool eccProtected; /**< Section is ECC protected */
+};
+
+/**
+ * Select a side of flash to access
+ */
+enum SideSelect
+{
+ SIDE_A = 0xA, /**< A-side of flash */
+ SIDE_B = 0xB, /**< B-side of flash */
+ SIDELESS = 0xF, /**< Sideless data */
+};
+
+
+
+/**
+ * @brief Return the size and address of a given section of PNOR data
+ *
+ * @param[in] i_section PNOR section
+ * @param[in] i_side Side select
+ * @param[out] o_info Location and size information
+ *
+ * @return size_t Offset of section in bytes
+ */
+void getSectionInfo( SectionId i_section,
+ SideSelect i_side,
+ SectionInfo_t& o_info );
+
+
+}
+#endif
OpenPOWER on IntegriCloud