[Skiboot] [PATCH v2 1/2] opal-prd: Add get_interface_capabilities to host interfaces

Jeremy Kerr jk at ozlabs.org
Thu Sep 15 11:52:31 AEST 2016


We need a way to indicate behaviour changes & fixes in the prd
interface, without requiring a major version bump.

This change introduces the get_interface_capabilities callback,
returning a bitmask of capability flags, pertaining to 'sets' of
capabilities. We currently return 0 for all.

Signed-off-by: Jeremy Kerr <jk at ozlabs.org>
---
 external/opal-prd/hostboot-interface.h | 16 +++++++++++++++-
 external/opal-prd/opal-prd.c           |  5 +++++
 external/opal-prd/thunk.S              |  3 ++-
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/external/opal-prd/hostboot-interface.h b/external/opal-prd/hostboot-interface.h
index 05fe052..36d53a6 100644
--- a/external/opal-prd/hostboot-interface.h
+++ b/external/opal-prd/hostboot-interface.h
@@ -41,6 +41,11 @@ enum MemoryError_t
 	MEMORY_ERROR_UE = 1,
 };
 
+/* Capability sets, for get_interface_capabilities */
+#define HBRT_CAPS_SET0_COMMON		0
+#define HBRT_CAPS_SET1_OPAL		1
+#define HBRT_CAPS_SET2_PHYP		2
+
 struct host_interfaces {
 	/** Interface version. */
 	uint64_t interface_version;
@@ -277,8 +282,17 @@ struct host_interfaces {
 	int (*memory_error)( uint64_t i_startAddr, uint64_t i_endAddr,
 					  enum MemoryError_t i_errorType );
 
+	/**
+	 * @brief Query the prd infrastructure for interface capabilities.
+	 * @param[in] i_set The set of capabilites to retrieve
+	 *
+	 * @return a bitmask containing the relevant HBRT_CAPS_* for
+	 *	this implementation and the specified set.
+	 */
+	uint64_t (*get_interface_capabilities)(uint64_t i_set);
+
 	/* Reserve some space for future growth. */
-	void (*reserved[32])(void);
+	void (*reserved[31])(void);
 };
 
 struct runtime_interfaces {
diff --git a/external/opal-prd/opal-prd.c b/external/opal-prd/opal-prd.c
index 18c6e49..245c957 100644
--- a/external/opal-prd/opal-prd.c
+++ b/external/opal-prd/opal-prd.c
@@ -649,6 +649,11 @@ int hservice_memory_error(uint64_t i_start_addr, uint64_t i_endAddr,
 	return 0;
 }
 
+uint64_t hservice_get_interface_capabilities(uint64_t set)
+{
+	return 0;
+}
+
 int hservices_init(struct opal_prd_ctx *ctx, void *code)
 {
 	uint64_t *s, *d;
diff --git a/external/opal-prd/thunk.S b/external/opal-prd/thunk.S
index f25afde..f355158 100644
--- a/external/opal-prd/thunk.S
+++ b/external/opal-prd/thunk.S
@@ -186,10 +186,11 @@ hinterface:
 	CALLBACK_THUNK(hservice_i2c_write)
 	CALLBACK_THUNK(hservice_ipmi_msg)
 	CALLBACK_THUNK(hservice_memory_error)
+	CALLBACK_THUNK(hservice_get_interface_capabilities)
 .globl __hinterface_pad
 __hinterface_pad:
 	/* Reserved space for future growth */
-	.space 32*8,0
+	.space 31*8,0
 .globl __hinterface_end
 __hinterface_end:
 	/* Eye catcher for debugging */
-- 
2.7.4



More information about the Skiboot mailing list