diff mbox

[v2,1/2] include: Add PRD message definition

Message ID 20150211163923.1801.73462.stgit@localhost.localdomain
State Changes Requested
Headers show

Commit Message

Neelesh Gupta Feb. 11, 2015, 4:39 p.m. UTC
From: Jeremy Kerr <jk@ozlabs.org>

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
---
 include/opal.h  |   41 ++++++++++++++++++++++++++++++++++++++++-
 include/xscom.h |    8 ++++++++
 2 files changed, 48 insertions(+), 1 deletion(-)

Comments

Stewart Smith Feb. 12, 2015, 1:23 a.m. UTC | #1
Neelesh Gupta <neelegup@linux.vnet.ibm.com> writes:
> From: Jeremy Kerr <jk@ozlabs.org>
>
> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
> Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
> ---
>  include/opal.h  |   41 ++++++++++++++++++++++++++++++++++++++++-
>  include/xscom.h |    8 ++++++++
>  2 files changed, 48 insertions(+), 1 deletion(-)

Please also add something to doc/opal-api explaining the api.
Neelesh Gupta Feb. 12, 2015, 3:22 a.m. UTC | #2
On 02/12/2015 06:53 AM, Stewart Smith wrote:
> Neelesh Gupta <neelegup@linux.vnet.ibm.com> writes:
>> From: Jeremy Kerr <jk@ozlabs.org>
>>
>> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
>> Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
>> ---
>>   include/opal.h  |   41 ++++++++++++++++++++++++++++++++++++++++-
>>   include/xscom.h |    8 ++++++++
>>   2 files changed, 48 insertions(+), 1 deletion(-)
> Please also add something to doc/opal-api explaining the api.

Yes, will do.

Neelesh.
Joel Stanley Feb. 12, 2015, 5 a.m. UTC | #3
On Thu, Feb 12, 2015 at 3:09 AM, Neelesh Gupta
<neelegup@linux.vnet.ibm.com> wrote:
> From: Jeremy Kerr <jk@ozlabs.org>
>
> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
> Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>

Reviewed-by: Joel Stanley <joel@jms.id.au>

> diff --git a/include/opal.h b/include/opal.h
> index 6c9b13a..f9f502f 100644
> --- a/include/opal.h
> +++ b/include/opal.h

> @@ -754,6 +756,43 @@ typedef struct oppanel_line {
>         uint64_t        line_len;
>  } oppanel_line_t;
>
> +enum opal_prd_msg_type {
> +       OPAL_PRD_MSG_TYPE_INIT = 0,     /* RT --> FW */
> +       OPAL_PRD_MSG_TYPE_FINI,         /* RT --> FW */
> +       OPAL_PRD_MSG_TYPE_ATTN,         /* RT <-- FW */
> +       OPAL_PRD_MSG_TYPE_ATTN_ACK,     /* RT --> FW */
> +       OPAL_PRD_MSG_TYPE_OCC_ERROR,    /* RT <-- FW */
> +       OPAL_PRD_MSG_TYPE_OCC_RESET,    /* RT <-- FW */
> +       OPAL_PRD_MSG_TYPE_MAX,
> +};

I assume FW is firmware? What is RT?

> +
> +struct opal_prd_msg {
> +       uint8_t         type;
> +       uint8_t         pad[3];
> +       uint32_t        token;
> +       union {
> +               struct {
> +                       uint32_t        version;
> +                       uint64_t        ipoll;
> +               } init;
> +               struct {
> +                       uint64_t        proc;
> +                       uint64_t        ipoll_status;
> +                       uint64_t        ipoll_mask;
> +               } attn;
> +               struct {
> +                       uint64_t        proc;
> +                       uint64_t        ipoll_ack;
> +               } attn_ack;
> +               struct {
> +                       uint64_t        chip;
> +               } occ_error;
> +               struct {
> +                       uint64_t        chip;
> +               } occ_reset;
> +       };
> +};

Should we use __be64 and __be32 types for the integers here?

> +
>  /*
>   * SG entries used for code update
>   *
Stewart Smith Feb. 12, 2015, 6:45 a.m. UTC | #4
Joel Stanley <joel@jms.id.au> writes:
>> +struct opal_prd_msg {
>> +       uint8_t         type;
>> +       uint8_t         pad[3];
>> +       uint32_t        token;
>> +       union {
>> +               struct {
>> +                       uint32_t        version;
>> +                       uint64_t        ipoll;
>> +               } init;
>> +               struct {
>> +                       uint64_t        proc;
>> +                       uint64_t        ipoll_status;
>> +                       uint64_t        ipoll_mask;
>> +               } attn;
>> +               struct {
>> +                       uint64_t        proc;
>> +                       uint64_t        ipoll_ack;
>> +               } attn_ack;
>> +               struct {
>> +                       uint64_t        chip;
>> +               } occ_error;
>> +               struct {
>> +                       uint64_t        chip;
>> +               } occ_reset;
>> +       };
>> +};
>
> Should we use __be64 and __be32 types for the integers here?

Yes, good catch - we should!
diff mbox

Patch

diff --git a/include/opal.h b/include/opal.h
index 6c9b13a..f9f502f 100644
--- a/include/opal.h
+++ b/include/opal.h
@@ -154,7 +154,8 @@ 
 #define OPAL_IPMI_SEND				107
 #define OPAL_IPMI_RECV				108
 #define OPAL_I2C_REQUEST			109
-#define OPAL_LAST				109
+#define OPAL_PRD_MSG				110
+#define OPAL_LAST				110
 
 #ifndef __ASSEMBLY__
 
@@ -398,6 +399,7 @@  enum OpalMessageType {
 	OPAL_MSG_SHUTDOWN,
 	OPAL_MSG_HMI_EVT,
 	OPAL_MSG_DPO,
+	OPAL_MSG_PRD,
 	OPAL_MSG_TYPE_MAX,
 };
 
@@ -754,6 +756,43 @@  typedef struct oppanel_line {
 	uint64_t 	line_len;
 } oppanel_line_t;
 
+enum opal_prd_msg_type {
+	OPAL_PRD_MSG_TYPE_INIT = 0,	/* RT --> FW */
+	OPAL_PRD_MSG_TYPE_FINI,		/* RT --> FW */
+	OPAL_PRD_MSG_TYPE_ATTN,		/* RT <-- FW */
+	OPAL_PRD_MSG_TYPE_ATTN_ACK,	/* RT --> FW */
+	OPAL_PRD_MSG_TYPE_OCC_ERROR,	/* RT <-- FW */
+	OPAL_PRD_MSG_TYPE_OCC_RESET,	/* RT <-- FW */
+	OPAL_PRD_MSG_TYPE_MAX,
+};
+
+struct opal_prd_msg {
+	uint8_t		type;
+	uint8_t		pad[3];
+	uint32_t	token;
+	union {
+		struct {
+			uint32_t	version;
+			uint64_t	ipoll;
+		} init;
+		struct {
+			uint64_t	proc;
+			uint64_t	ipoll_status;
+			uint64_t	ipoll_mask;
+		} attn;
+		struct {
+			uint64_t	proc;
+			uint64_t	ipoll_ack;
+		} attn_ack;
+		struct {
+			uint64_t	chip;
+		} occ_error;
+		struct {
+			uint64_t	chip;
+		} occ_reset;
+	};
+};
+
 /*
  * SG entries used for code update
  *
diff --git a/include/xscom.h b/include/xscom.h
index 5eed85f..970840b 100644
--- a/include/xscom.h
+++ b/include/xscom.h
@@ -154,6 +154,14 @@ 
 #define EX_PM_IDLE_ST_HIST_PM_STATE_MASK	PPC_BITMASK(0, 2)
 #define EX_PM_IDLE_ST_HIST_PM_STATE_LSH		PPC_BITLSHIFT(2)
 
+/* PRD registers */
+#define PRD_IPOLL_MASK_REG	0x01020013
+#define PRD_ERROR_STATUS	0x01020014
+#define PRD_IPOLL_XSTOP		PPC_BIT(0) /* Xstop for host/core/millicode */
+#define PRD_IPOLL_RECOV		PPC_BIT(1) /* Recoverable */
+#define PRD_IPOLL_SPEC_ATTN	PPC_BIT(2) /* Special attention */
+#define PRD_IPOLL_HOST_ATTN	PPC_BIT(3) /* Host attention */
+#define PRD_IPOLL_MASK		PPC_BITMASK(0, 3)
 
 /*
  * Error handling: