aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/opal.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/include/asm/opal.h')
-rw-r--r--arch/powerpc/include/asm/opal.h122
1 files changed, 19 insertions, 103 deletions
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index 9124b0ede1fc..5cd8d2fddba9 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -154,6 +154,10 @@ struct opal_sg_list {
154#define OPAL_HANDLE_HMI 98 154#define OPAL_HANDLE_HMI 98
155#define OPAL_REGISTER_DUMP_REGION 101 155#define OPAL_REGISTER_DUMP_REGION 101
156#define OPAL_UNREGISTER_DUMP_REGION 102 156#define OPAL_UNREGISTER_DUMP_REGION 102
157#define OPAL_WRITE_TPO 103
158#define OPAL_READ_TPO 104
159#define OPAL_IPMI_SEND 107
160#define OPAL_IPMI_RECV 108
157 161
158#ifndef __ASSEMBLY__ 162#ifndef __ASSEMBLY__
159 163
@@ -284,62 +288,6 @@ enum OpalMessageType {
284 OPAL_MSG_TYPE_MAX, 288 OPAL_MSG_TYPE_MAX,
285}; 289};
286 290
287/* Machine check related definitions */
288enum OpalMCE_Version {
289 OpalMCE_V1 = 1,
290};
291
292enum OpalMCE_Severity {
293 OpalMCE_SEV_NO_ERROR = 0,
294 OpalMCE_SEV_WARNING = 1,
295 OpalMCE_SEV_ERROR_SYNC = 2,
296 OpalMCE_SEV_FATAL = 3,
297};
298
299enum OpalMCE_Disposition {
300 OpalMCE_DISPOSITION_RECOVERED = 0,
301 OpalMCE_DISPOSITION_NOT_RECOVERED = 1,
302};
303
304enum OpalMCE_Initiator {
305 OpalMCE_INITIATOR_UNKNOWN = 0,
306 OpalMCE_INITIATOR_CPU = 1,
307};
308
309enum OpalMCE_ErrorType {
310 OpalMCE_ERROR_TYPE_UNKNOWN = 0,
311 OpalMCE_ERROR_TYPE_UE = 1,
312 OpalMCE_ERROR_TYPE_SLB = 2,
313 OpalMCE_ERROR_TYPE_ERAT = 3,
314 OpalMCE_ERROR_TYPE_TLB = 4,
315};
316
317enum OpalMCE_UeErrorType {
318 OpalMCE_UE_ERROR_INDETERMINATE = 0,
319 OpalMCE_UE_ERROR_IFETCH = 1,
320 OpalMCE_UE_ERROR_PAGE_TABLE_WALK_IFETCH = 2,
321 OpalMCE_UE_ERROR_LOAD_STORE = 3,
322 OpalMCE_UE_ERROR_PAGE_TABLE_WALK_LOAD_STORE = 4,
323};
324
325enum OpalMCE_SlbErrorType {
326 OpalMCE_SLB_ERROR_INDETERMINATE = 0,
327 OpalMCE_SLB_ERROR_PARITY = 1,
328 OpalMCE_SLB_ERROR_MULTIHIT = 2,
329};
330
331enum OpalMCE_EratErrorType {
332 OpalMCE_ERAT_ERROR_INDETERMINATE = 0,
333 OpalMCE_ERAT_ERROR_PARITY = 1,
334 OpalMCE_ERAT_ERROR_MULTIHIT = 2,
335};
336
337enum OpalMCE_TlbErrorType {
338 OpalMCE_TLB_ERROR_INDETERMINATE = 0,
339 OpalMCE_TLB_ERROR_PARITY = 1,
340 OpalMCE_TLB_ERROR_MULTIHIT = 2,
341};
342
343enum OpalThreadStatus { 291enum OpalThreadStatus {
344 OPAL_THREAD_INACTIVE = 0x0, 292 OPAL_THREAD_INACTIVE = 0x0,
345 OPAL_THREAD_STARTED = 0x1, 293 OPAL_THREAD_STARTED = 0x1,
@@ -452,52 +400,15 @@ struct opal_msg {
452 __be64 params[8]; 400 __be64 params[8];
453}; 401};
454 402
455struct opal_machine_check_event { 403enum {
456 enum OpalMCE_Version version:8; /* 0x00 */ 404 OPAL_IPMI_MSG_FORMAT_VERSION_1 = 1,
457 uint8_t in_use; /* 0x01 */ 405};
458 enum OpalMCE_Severity severity:8; /* 0x02 */
459 enum OpalMCE_Initiator initiator:8; /* 0x03 */
460 enum OpalMCE_ErrorType error_type:8; /* 0x04 */
461 enum OpalMCE_Disposition disposition:8; /* 0x05 */
462 uint8_t reserved_1[2]; /* 0x06 */
463 uint64_t gpr3; /* 0x08 */
464 uint64_t srr0; /* 0x10 */
465 uint64_t srr1; /* 0x18 */
466 union { /* 0x20 */
467 struct {
468 enum OpalMCE_UeErrorType ue_error_type:8;
469 uint8_t effective_address_provided;
470 uint8_t physical_address_provided;
471 uint8_t reserved_1[5];
472 uint64_t effective_address;
473 uint64_t physical_address;
474 uint8_t reserved_2[8];
475 } ue_error;
476
477 struct {
478 enum OpalMCE_SlbErrorType slb_error_type:8;
479 uint8_t effective_address_provided;
480 uint8_t reserved_1[6];
481 uint64_t effective_address;
482 uint8_t reserved_2[16];
483 } slb_error;
484
485 struct {
486 enum OpalMCE_EratErrorType erat_error_type:8;
487 uint8_t effective_address_provided;
488 uint8_t reserved_1[6];
489 uint64_t effective_address;
490 uint8_t reserved_2[16];
491 } erat_error;
492 406
493 struct { 407struct opal_ipmi_msg {
494 enum OpalMCE_TlbErrorType tlb_error_type:8; 408 uint8_t version;
495 uint8_t effective_address_provided; 409 uint8_t netfn;
496 uint8_t reserved_1[6]; 410 uint8_t cmd;
497 uint64_t effective_address; 411 uint8_t data[];
498 uint8_t reserved_2[16];
499 } tlb_error;
500 } u;
501}; 412};
502 413
503/* FSP memory errors handling */ 414/* FSP memory errors handling */
@@ -819,6 +730,9 @@ int64_t opal_rtc_read(__be32 *year_month_day,
819 __be64 *hour_minute_second_millisecond); 730 __be64 *hour_minute_second_millisecond);
820int64_t opal_rtc_write(uint32_t year_month_day, 731int64_t opal_rtc_write(uint32_t year_month_day,
821 uint64_t hour_minute_second_millisecond); 732 uint64_t hour_minute_second_millisecond);
733int64_t opal_tpo_read(uint64_t token, __be32 *year_mon_day, __be32 *hour_min);
734int64_t opal_tpo_write(uint64_t token, uint32_t year_mon_day,
735 uint32_t hour_min);
822int64_t opal_cec_power_down(uint64_t request); 736int64_t opal_cec_power_down(uint64_t request);
823int64_t opal_cec_reboot(void); 737int64_t opal_cec_reboot(void);
824int64_t opal_read_nvram(uint64_t buffer, uint64_t size, uint64_t offset); 738int64_t opal_read_nvram(uint64_t buffer, uint64_t size, uint64_t offset);
@@ -963,6 +877,10 @@ int64_t opal_handle_hmi(void);
963int64_t opal_register_dump_region(uint32_t id, uint64_t start, uint64_t end); 877int64_t opal_register_dump_region(uint32_t id, uint64_t start, uint64_t end);
964int64_t opal_unregister_dump_region(uint32_t id); 878int64_t opal_unregister_dump_region(uint32_t id);
965int64_t opal_pci_set_phb_cxl_mode(uint64_t phb_id, uint64_t mode, uint64_t pe_number); 879int64_t opal_pci_set_phb_cxl_mode(uint64_t phb_id, uint64_t mode, uint64_t pe_number);
880int64_t opal_ipmi_send(uint64_t interface, struct opal_ipmi_msg *msg,
881 uint64_t msg_len);
882int64_t opal_ipmi_recv(uint64_t interface, struct opal_ipmi_msg *msg,
883 uint64_t *msg_len);
966 884
967/* Internal functions */ 885/* Internal functions */
968extern int early_init_dt_scan_opal(unsigned long node, const char *uname, 886extern int early_init_dt_scan_opal(unsigned long node, const char *uname,
@@ -992,8 +910,6 @@ extern int opal_async_wait_response(uint64_t token, struct opal_msg *msg);
992extern int opal_get_sensor_data(u32 sensor_hndl, u32 *sensor_data); 910extern int opal_get_sensor_data(u32 sensor_hndl, u32 *sensor_data);
993 911
994struct rtc_time; 912struct rtc_time;
995extern int opal_set_rtc_time(struct rtc_time *tm);
996extern void opal_get_rtc_time(struct rtc_time *tm);
997extern unsigned long opal_get_boot_time(void); 913extern unsigned long opal_get_boot_time(void);
998extern void opal_nvram_init(void); 914extern void opal_nvram_init(void);
999extern void opal_flash_init(void); 915extern void opal_flash_init(void);