powerpc/powernv: Add opal-prd channel
authorJeremy Kerr <jk@ozlabs.org>
Thu, 4 Jun 2015 13:51:47 +0000 (21:51 +0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 4 Jun 2015 22:32:21 +0000 (08:32 +1000)
This change adds a char device to access the "PRD" (processor runtime
diagnostics) channel to OPAL firmware.

Includes contributions from Vaidyanathan Srinivasan, Neelesh Gupta &
Vishal Kulkarni.

Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/opal-api.h
arch/powerpc/include/asm/opal.h
arch/powerpc/include/uapi/asm/opal-prd.h [new file with mode: 0644]
arch/powerpc/platforms/powernv/Kconfig
arch/powerpc/platforms/powernv/Makefile
arch/powerpc/platforms/powernv/opal-prd.c [new file with mode: 0644]
arch/powerpc/platforms/powernv/opal-wrappers.S
arch/powerpc/platforms/powernv/opal.c

index a49e5fa..e9e4c52 100644 (file)
 #define OPAL_FLASH_READ                                110
 #define OPAL_FLASH_WRITE                       111
 #define OPAL_FLASH_ERASE                       112
-#define OPAL_LAST                              112
+#define OPAL_PRD_MSG                           113
+#define OPAL_LAST                              113
 
 /* Device tree flags */
 
@@ -359,6 +360,7 @@ enum opal_msg_type {
        OPAL_MSG_SHUTDOWN,              /* params[0] = 1 reboot, 0 shutdown */
        OPAL_MSG_HMI_EVT,
        OPAL_MSG_DPO,
+       OPAL_MSG_PRD,
        OPAL_MSG_TYPE_MAX,
 };
 
@@ -681,6 +683,23 @@ typedef struct oppanel_line {
        __be64 line_len;
 } oppanel_line_t;
 
+enum opal_prd_msg_type {
+       OPAL_PRD_MSG_TYPE_INIT = 0,     /* HBRT --> OPAL */
+       OPAL_PRD_MSG_TYPE_FINI,         /* HBRT/kernel --> OPAL */
+       OPAL_PRD_MSG_TYPE_ATTN,         /* HBRT <-- OPAL */
+       OPAL_PRD_MSG_TYPE_ATTN_ACK,     /* HBRT --> OPAL */
+       OPAL_PRD_MSG_TYPE_OCC_ERROR,    /* HBRT <-- OPAL */
+       OPAL_PRD_MSG_TYPE_OCC_RESET,    /* HBRT <-- OPAL */
+};
+
+struct opal_prd_msg_header {
+       uint8_t         type;
+       uint8_t         pad[1];
+       __be16          size;
+};
+
+struct opal_prd_msg;
+
 /*
  * SG entries
  *
Simple merge
Simple merge