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.h205
1 files changed, 139 insertions, 66 deletions
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index 0da1dbd42e02..86055e598269 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -147,6 +147,10 @@ struct opal_sg_list {
147#define OPAL_SET_PARAM 90 147#define OPAL_SET_PARAM 90
148#define OPAL_DUMP_RESEND 91 148#define OPAL_DUMP_RESEND 91
149#define OPAL_DUMP_INFO2 94 149#define OPAL_DUMP_INFO2 94
150#define OPAL_PCI_EEH_FREEZE_SET 97
151#define OPAL_HANDLE_HMI 98
152#define OPAL_REGISTER_DUMP_REGION 101
153#define OPAL_UNREGISTER_DUMP_REGION 102
150 154
151#ifndef __ASSEMBLY__ 155#ifndef __ASSEMBLY__
152 156
@@ -170,7 +174,11 @@ enum OpalFreezeState {
170enum OpalEehFreezeActionToken { 174enum OpalEehFreezeActionToken {
171 OPAL_EEH_ACTION_CLEAR_FREEZE_MMIO = 1, 175 OPAL_EEH_ACTION_CLEAR_FREEZE_MMIO = 1,
172 OPAL_EEH_ACTION_CLEAR_FREEZE_DMA = 2, 176 OPAL_EEH_ACTION_CLEAR_FREEZE_DMA = 2,
173 OPAL_EEH_ACTION_CLEAR_FREEZE_ALL = 3 177 OPAL_EEH_ACTION_CLEAR_FREEZE_ALL = 3,
178
179 OPAL_EEH_ACTION_SET_FREEZE_MMIO = 1,
180 OPAL_EEH_ACTION_SET_FREEZE_DMA = 2,
181 OPAL_EEH_ACTION_SET_FREEZE_ALL = 3
174}; 182};
175 183
176enum OpalPciStatusToken { 184enum OpalPciStatusToken {
@@ -240,6 +248,7 @@ enum OpalMessageType {
240 OPAL_MSG_MEM_ERR, 248 OPAL_MSG_MEM_ERR,
241 OPAL_MSG_EPOW, 249 OPAL_MSG_EPOW,
242 OPAL_MSG_SHUTDOWN, 250 OPAL_MSG_SHUTDOWN,
251 OPAL_MSG_HMI_EVT,
243 OPAL_MSG_TYPE_MAX, 252 OPAL_MSG_TYPE_MAX,
244}; 253};
245 254
@@ -340,6 +349,12 @@ enum OpalMveEnableAction {
340 OPAL_ENABLE_MVE = 1 349 OPAL_ENABLE_MVE = 1
341}; 350};
342 351
352enum OpalM64EnableAction {
353 OPAL_DISABLE_M64 = 0,
354 OPAL_ENABLE_M64_SPLIT = 1,
355 OPAL_ENABLE_M64_NON_SPLIT = 2
356};
357
343enum OpalPciResetScope { 358enum OpalPciResetScope {
344 OPAL_PHB_COMPLETE = 1, OPAL_PCI_LINK = 2, OPAL_PHB_ERROR = 3, 359 OPAL_PHB_COMPLETE = 1, OPAL_PCI_LINK = 2, OPAL_PHB_ERROR = 3,
345 OPAL_PCI_HOT_RESET = 4, OPAL_PCI_FUNDAMENTAL_RESET = 5, 360 OPAL_PCI_HOT_RESET = 4, OPAL_PCI_FUNDAMENTAL_RESET = 5,
@@ -502,6 +517,50 @@ struct OpalMemoryErrorData {
502 } u; 517 } u;
503}; 518};
504 519
520/* HMI interrupt event */
521enum OpalHMI_Version {
522 OpalHMIEvt_V1 = 1,
523};
524
525enum OpalHMI_Severity {
526 OpalHMI_SEV_NO_ERROR = 0,
527 OpalHMI_SEV_WARNING = 1,
528 OpalHMI_SEV_ERROR_SYNC = 2,
529 OpalHMI_SEV_FATAL = 3,
530};
531
532enum OpalHMI_Disposition {
533 OpalHMI_DISPOSITION_RECOVERED = 0,
534 OpalHMI_DISPOSITION_NOT_RECOVERED = 1,
535};
536
537enum OpalHMI_ErrType {
538 OpalHMI_ERROR_MALFUNC_ALERT = 0,
539 OpalHMI_ERROR_PROC_RECOV_DONE,
540 OpalHMI_ERROR_PROC_RECOV_DONE_AGAIN,
541 OpalHMI_ERROR_PROC_RECOV_MASKED,
542 OpalHMI_ERROR_TFAC,
543 OpalHMI_ERROR_TFMR_PARITY,
544 OpalHMI_ERROR_HA_OVERFLOW_WARN,
545 OpalHMI_ERROR_XSCOM_FAIL,
546 OpalHMI_ERROR_XSCOM_DONE,
547 OpalHMI_ERROR_SCOM_FIR,
548 OpalHMI_ERROR_DEBUG_TRIG_FIR,
549 OpalHMI_ERROR_HYP_RESOURCE,
550};
551
552struct OpalHMIEvent {
553 uint8_t version; /* 0x00 */
554 uint8_t severity; /* 0x01 */
555 uint8_t type; /* 0x02 */
556 uint8_t disposition; /* 0x03 */
557 uint8_t reserved_1[4]; /* 0x04 */
558
559 __be64 hmer;
560 /* TFMR register. Valid only for TFAC and TFMR_PARITY error type. */
561 __be64 tfmr;
562};
563
505enum { 564enum {
506 OPAL_P7IOC_DIAG_TYPE_NONE = 0, 565 OPAL_P7IOC_DIAG_TYPE_NONE = 0,
507 OPAL_P7IOC_DIAG_TYPE_RGC = 1, 566 OPAL_P7IOC_DIAG_TYPE_RGC = 1,
@@ -513,40 +572,40 @@ enum {
513}; 572};
514 573
515struct OpalIoP7IOCErrorData { 574struct OpalIoP7IOCErrorData {
516 uint16_t type; 575 __be16 type;
517 576
518 /* GEM */ 577 /* GEM */
519 uint64_t gemXfir; 578 __be64 gemXfir;
520 uint64_t gemRfir; 579 __be64 gemRfir;
521 uint64_t gemRirqfir; 580 __be64 gemRirqfir;
522 uint64_t gemMask; 581 __be64 gemMask;
523 uint64_t gemRwof; 582 __be64 gemRwof;
524 583
525 /* LEM */ 584 /* LEM */
526 uint64_t lemFir; 585 __be64 lemFir;
527 uint64_t lemErrMask; 586 __be64 lemErrMask;
528 uint64_t lemAction0; 587 __be64 lemAction0;
529 uint64_t lemAction1; 588 __be64 lemAction1;
530 uint64_t lemWof; 589 __be64 lemWof;
531 590
532 union { 591 union {
533 struct OpalIoP7IOCRgcErrorData { 592 struct OpalIoP7IOCRgcErrorData {
534 uint64_t rgcStatus; /* 3E1C10 */ 593 __be64 rgcStatus; /* 3E1C10 */
535 uint64_t rgcLdcp; /* 3E1C18 */ 594 __be64 rgcLdcp; /* 3E1C18 */
536 }rgc; 595 }rgc;
537 struct OpalIoP7IOCBiErrorData { 596 struct OpalIoP7IOCBiErrorData {
538 uint64_t biLdcp0; /* 3C0100, 3C0118 */ 597 __be64 biLdcp0; /* 3C0100, 3C0118 */
539 uint64_t biLdcp1; /* 3C0108, 3C0120 */ 598 __be64 biLdcp1; /* 3C0108, 3C0120 */
540 uint64_t biLdcp2; /* 3C0110, 3C0128 */ 599 __be64 biLdcp2; /* 3C0110, 3C0128 */
541 uint64_t biFenceStatus; /* 3C0130, 3C0130 */ 600 __be64 biFenceStatus; /* 3C0130, 3C0130 */
542 601
543 uint8_t biDownbound; /* BI Downbound or Upbound */ 602 u8 biDownbound; /* BI Downbound or Upbound */
544 }bi; 603 }bi;
545 struct OpalIoP7IOCCiErrorData { 604 struct OpalIoP7IOCCiErrorData {
546 uint64_t ciPortStatus; /* 3Dn008 */ 605 __be64 ciPortStatus; /* 3Dn008 */
547 uint64_t ciPortLdcp; /* 3Dn010 */ 606 __be64 ciPortLdcp; /* 3Dn010 */
548 607
549 uint8_t ciPort; /* Index of CI port: 0/1 */ 608 u8 ciPort; /* Index of CI port: 0/1 */
550 }ci; 609 }ci;
551 }; 610 };
552}; 611};
@@ -578,60 +637,60 @@ struct OpalIoPhbErrorCommon {
578struct OpalIoP7IOCPhbErrorData { 637struct OpalIoP7IOCPhbErrorData {
579 struct OpalIoPhbErrorCommon common; 638 struct OpalIoPhbErrorCommon common;
580 639
581 uint32_t brdgCtl; 640 __be32 brdgCtl;
582 641
583 // P7IOC utl regs 642 // P7IOC utl regs
584 uint32_t portStatusReg; 643 __be32 portStatusReg;
585 uint32_t rootCmplxStatus; 644 __be32 rootCmplxStatus;
586 uint32_t busAgentStatus; 645 __be32 busAgentStatus;
587 646
588 // P7IOC cfg regs 647 // P7IOC cfg regs
589 uint32_t deviceStatus; 648 __be32 deviceStatus;
590 uint32_t slotStatus; 649 __be32 slotStatus;
591 uint32_t linkStatus; 650 __be32 linkStatus;
592 uint32_t devCmdStatus; 651 __be32 devCmdStatus;
593 uint32_t devSecStatus; 652 __be32 devSecStatus;
594 653
595 // cfg AER regs 654 // cfg AER regs
596 uint32_t rootErrorStatus; 655 __be32 rootErrorStatus;
597 uint32_t uncorrErrorStatus; 656 __be32 uncorrErrorStatus;
598 uint32_t corrErrorStatus; 657 __be32 corrErrorStatus;
599 uint32_t tlpHdr1; 658 __be32 tlpHdr1;
600 uint32_t tlpHdr2; 659 __be32 tlpHdr2;
601 uint32_t tlpHdr3; 660 __be32 tlpHdr3;
602 uint32_t tlpHdr4; 661 __be32 tlpHdr4;
603 uint32_t sourceId; 662 __be32 sourceId;
604 663
605 uint32_t rsv3; 664 __be32 rsv3;
606 665
607 // Record data about the call to allocate a buffer. 666 // Record data about the call to allocate a buffer.
608 uint64_t errorClass; 667 __be64 errorClass;
609 uint64_t correlator; 668 __be64 correlator;
610 669
611 //P7IOC MMIO Error Regs 670 //P7IOC MMIO Error Regs
612 uint64_t p7iocPlssr; // n120 671 __be64 p7iocPlssr; // n120
613 uint64_t p7iocCsr; // n110 672 __be64 p7iocCsr; // n110
614 uint64_t lemFir; // nC00 673 __be64 lemFir; // nC00
615 uint64_t lemErrorMask; // nC18 674 __be64 lemErrorMask; // nC18
616 uint64_t lemWOF; // nC40 675 __be64 lemWOF; // nC40
617 uint64_t phbErrorStatus; // nC80 676 __be64 phbErrorStatus; // nC80
618 uint64_t phbFirstErrorStatus; // nC88 677 __be64 phbFirstErrorStatus; // nC88
619 uint64_t phbErrorLog0; // nCC0 678 __be64 phbErrorLog0; // nCC0
620 uint64_t phbErrorLog1; // nCC8 679 __be64 phbErrorLog1; // nCC8
621 uint64_t mmioErrorStatus; // nD00 680 __be64 mmioErrorStatus; // nD00
622 uint64_t mmioFirstErrorStatus; // nD08 681 __be64 mmioFirstErrorStatus; // nD08
623 uint64_t mmioErrorLog0; // nD40 682 __be64 mmioErrorLog0; // nD40
624 uint64_t mmioErrorLog1; // nD48 683 __be64 mmioErrorLog1; // nD48
625 uint64_t dma0ErrorStatus; // nD80 684 __be64 dma0ErrorStatus; // nD80
626 uint64_t dma0FirstErrorStatus; // nD88 685 __be64 dma0FirstErrorStatus; // nD88
627 uint64_t dma0ErrorLog0; // nDC0 686 __be64 dma0ErrorLog0; // nDC0
628 uint64_t dma0ErrorLog1; // nDC8 687 __be64 dma0ErrorLog1; // nDC8
629 uint64_t dma1ErrorStatus; // nE00 688 __be64 dma1ErrorStatus; // nE00
630 uint64_t dma1FirstErrorStatus; // nE08 689 __be64 dma1FirstErrorStatus; // nE08
631 uint64_t dma1ErrorLog0; // nE40 690 __be64 dma1ErrorLog0; // nE40
632 uint64_t dma1ErrorLog1; // nE48 691 __be64 dma1ErrorLog1; // nE48
633 uint64_t pestA[OPAL_P7IOC_NUM_PEST_REGS]; 692 __be64 pestA[OPAL_P7IOC_NUM_PEST_REGS];
634 uint64_t pestB[OPAL_P7IOC_NUM_PEST_REGS]; 693 __be64 pestB[OPAL_P7IOC_NUM_PEST_REGS];
635}; 694};
636 695
637struct OpalIoPhb3ErrorData { 696struct OpalIoPhb3ErrorData {
@@ -758,6 +817,8 @@ int64_t opal_pci_eeh_freeze_status(uint64_t phb_id, uint64_t pe_number,
758 __be64 *phb_status); 817 __be64 *phb_status);
759int64_t opal_pci_eeh_freeze_clear(uint64_t phb_id, uint64_t pe_number, 818int64_t opal_pci_eeh_freeze_clear(uint64_t phb_id, uint64_t pe_number,
760 uint64_t eeh_action_token); 819 uint64_t eeh_action_token);
820int64_t opal_pci_eeh_freeze_set(uint64_t phb_id, uint64_t pe_number,
821 uint64_t eeh_action_token);
761int64_t opal_pci_shpc(uint64_t phb_id, uint64_t shpc_action, uint8_t *state); 822int64_t opal_pci_shpc(uint64_t phb_id, uint64_t shpc_action, uint8_t *state);
762 823
763 824
@@ -768,7 +829,7 @@ int64_t opal_pci_set_phb_mem_window(uint64_t phb_id, uint16_t window_type,
768 uint16_t window_num, 829 uint16_t window_num,
769 uint64_t starting_real_address, 830 uint64_t starting_real_address,
770 uint64_t starting_pci_address, 831 uint64_t starting_pci_address,
771 uint16_t segment_size); 832 uint64_t size);
772int64_t opal_pci_map_pe_mmio_window(uint64_t phb_id, uint16_t pe_number, 833int64_t opal_pci_map_pe_mmio_window(uint64_t phb_id, uint16_t pe_number,
773 uint16_t window_type, uint16_t window_num, 834 uint16_t window_type, uint16_t window_num,
774 uint16_t segment_num); 835 uint16_t segment_num);
@@ -860,6 +921,9 @@ int64_t opal_get_param(uint64_t token, uint32_t param_id, uint64_t buffer,
860int64_t opal_set_param(uint64_t token, uint32_t param_id, uint64_t buffer, 921int64_t opal_set_param(uint64_t token, uint32_t param_id, uint64_t buffer,
861 uint64_t length); 922 uint64_t length);
862int64_t opal_sensor_read(uint32_t sensor_hndl, int token, __be32 *sensor_data); 923int64_t opal_sensor_read(uint32_t sensor_hndl, int token, __be32 *sensor_data);
924int64_t opal_handle_hmi(void);
925int64_t opal_register_dump_region(uint32_t id, uint64_t start, uint64_t end);
926int64_t opal_unregister_dump_region(uint32_t id);
863 927
864/* Internal functions */ 928/* Internal functions */
865extern int early_init_dt_scan_opal(unsigned long node, const char *uname, 929extern int early_init_dt_scan_opal(unsigned long node, const char *uname,
@@ -902,6 +966,8 @@ extern void opal_msglog_init(void);
902 966
903extern int opal_machine_check(struct pt_regs *regs); 967extern int opal_machine_check(struct pt_regs *regs);
904extern bool opal_mce_check_early_recovery(struct pt_regs *regs); 968extern bool opal_mce_check_early_recovery(struct pt_regs *regs);
969extern int opal_hmi_exception_early(struct pt_regs *regs);
970extern int opal_handle_hmi_exception(struct pt_regs *regs);
905 971
906extern void opal_shutdown(void); 972extern void opal_shutdown(void);
907extern int opal_resync_timebase(void); 973extern int opal_resync_timebase(void);
@@ -912,6 +978,13 @@ struct opal_sg_list *opal_vmalloc_to_sg_list(void *vmalloc_addr,
912 unsigned long vmalloc_size); 978 unsigned long vmalloc_size);
913void opal_free_sg_list(struct opal_sg_list *sg); 979void opal_free_sg_list(struct opal_sg_list *sg);
914 980
981/*
982 * Dump region ID range usable by the OS
983 */
984#define OPAL_DUMP_REGION_HOST_START 0x80
985#define OPAL_DUMP_REGION_LOG_BUF 0x80
986#define OPAL_DUMP_REGION_HOST_END 0xFF
987
915#endif /* __ASSEMBLY__ */ 988#endif /* __ASSEMBLY__ */
916 989
917#endif /* __OPAL_H */ 990#endif /* __OPAL_H */