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.h131
1 files changed, 127 insertions, 4 deletions
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index 2893e8f5406d..a4b28f165b6c 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -109,6 +109,14 @@ extern int opal_enter_rtas(struct rtas_args *args,
109#define OPAL_PCI_MAP_PE_DMA_WINDOW 44 109#define OPAL_PCI_MAP_PE_DMA_WINDOW 44
110#define OPAL_PCI_MAP_PE_DMA_WINDOW_REAL 45 110#define OPAL_PCI_MAP_PE_DMA_WINDOW_REAL 45
111#define OPAL_PCI_RESET 49 111#define OPAL_PCI_RESET 49
112#define OPAL_PCI_GET_HUB_DIAG_DATA 50
113#define OPAL_PCI_GET_PHB_DIAG_DATA 51
114#define OPAL_PCI_FENCE_PHB 52
115#define OPAL_PCI_REINIT 53
116#define OPAL_PCI_MASK_PE_ERROR 54
117#define OPAL_SET_SLOT_LED_STATUS 55
118#define OPAL_GET_EPOW_STATUS 56
119#define OPAL_SET_SYSTEM_ATTENTION_LED 57
112 120
113#ifndef __ASSEMBLY__ 121#ifndef __ASSEMBLY__
114 122
@@ -169,7 +177,11 @@ enum OpalPendingState {
169 OPAL_EVENT_NVRAM = 0x2, 177 OPAL_EVENT_NVRAM = 0x2,
170 OPAL_EVENT_RTC = 0x4, 178 OPAL_EVENT_RTC = 0x4,
171 OPAL_EVENT_CONSOLE_OUTPUT = 0x8, 179 OPAL_EVENT_CONSOLE_OUTPUT = 0x8,
172 OPAL_EVENT_CONSOLE_INPUT = 0x10 180 OPAL_EVENT_CONSOLE_INPUT = 0x10,
181 OPAL_EVENT_ERROR_LOG_AVAIL = 0x20,
182 OPAL_EVENT_ERROR_LOG = 0x40,
183 OPAL_EVENT_EPOW = 0x80,
184 OPAL_EVENT_LED_STATUS = 0x100
173}; 185};
174 186
175/* Machine check related definitions */ 187/* Machine check related definitions */
@@ -258,13 +270,49 @@ enum OpalPeAction {
258 OPAL_MAP_PE = 1 270 OPAL_MAP_PE = 1
259}; 271};
260 272
273enum OpalPeltvAction {
274 OPAL_REMOVE_PE_FROM_DOMAIN = 0,
275 OPAL_ADD_PE_TO_DOMAIN = 1
276};
277
278enum OpalMveEnableAction {
279 OPAL_DISABLE_MVE = 0,
280 OPAL_ENABLE_MVE = 1
281};
282
261enum OpalPciResetAndReinitScope { 283enum OpalPciResetAndReinitScope {
262 OPAL_PHB_COMPLETE = 1, OPAL_PCI_LINK = 2, OPAL_PHB_ERROR = 3, 284 OPAL_PHB_COMPLETE = 1, OPAL_PCI_LINK = 2, OPAL_PHB_ERROR = 3,
263 OPAL_PCI_HOT_RESET = 4, OPAL_PCI_FUNDAMENTAL_RESET = 5, 285 OPAL_PCI_HOT_RESET = 4, OPAL_PCI_FUNDAMENTAL_RESET = 5,
264 OPAL_PCI_IODA_RESET = 6, 286 OPAL_PCI_IODA_TABLE_RESET = 6,
287};
288
289enum OpalPciResetState {
290 OPAL_DEASSERT_RESET = 0,
291 OPAL_ASSERT_RESET = 1
265}; 292};
266 293
267enum OpalPciResetState { OPAL_DEASSERT_RESET = 0, OPAL_ASSERT_RESET = 1 }; 294enum OpalPciMaskAction {
295 OPAL_UNMASK_ERROR_TYPE = 0,
296 OPAL_MASK_ERROR_TYPE = 1
297};
298
299enum OpalSlotLedType {
300 OPAL_SLOT_LED_ID_TYPE = 0,
301 OPAL_SLOT_LED_FAULT_TYPE = 1
302};
303
304enum OpalLedAction {
305 OPAL_TURN_OFF_LED = 0,
306 OPAL_TURN_ON_LED = 1,
307 OPAL_QUERY_LED_STATE_AFTER_BUSY = 2
308};
309
310enum OpalEpowStatus {
311 OPAL_EPOW_NONE = 0,
312 OPAL_EPOW_UPS = 1,
313 OPAL_EPOW_OVER_AMBIENT_TEMP = 2,
314 OPAL_EPOW_OVER_INTERNAL_TEMP = 3
315};
268 316
269struct opal_machine_check_event { 317struct opal_machine_check_event {
270 enum OpalMCE_Version version:8; /* 0x00 */ 318 enum OpalMCE_Version version:8; /* 0x00 */
@@ -314,8 +362,74 @@ struct opal_machine_check_event {
314 } u; 362 } u;
315}; 363};
316 364
365/**
366 * This structure defines the overlay which will be used to store PHB error
367 * data upon request.
368 */
369enum {
370 OPAL_P7IOC_NUM_PEST_REGS = 128,
371};
372
373struct OpalIoP7IOCPhbErrorData {
374 uint32_t brdgCtl;
375
376 // P7IOC utl regs
377 uint32_t portStatusReg;
378 uint32_t rootCmplxStatus;
379 uint32_t busAgentStatus;
380
381 // P7IOC cfg regs
382 uint32_t deviceStatus;
383 uint32_t slotStatus;
384 uint32_t linkStatus;
385 uint32_t devCmdStatus;
386 uint32_t devSecStatus;
387
388 // cfg AER regs
389 uint32_t rootErrorStatus;
390 uint32_t uncorrErrorStatus;
391 uint32_t corrErrorStatus;
392 uint32_t tlpHdr1;
393 uint32_t tlpHdr2;
394 uint32_t tlpHdr3;
395 uint32_t tlpHdr4;
396 uint32_t sourceId;
397
398 uint32_t rsv3;
399
400 // Record data about the call to allocate a buffer.
401 uint64_t errorClass;
402 uint64_t correlator;
403
404 //P7IOC MMIO Error Regs
405 uint64_t p7iocPlssr; // n120
406 uint64_t p7iocCsr; // n110
407 uint64_t lemFir; // nC00
408 uint64_t lemErrorMask; // nC18
409 uint64_t lemWOF; // nC40
410 uint64_t phbErrorStatus; // nC80
411 uint64_t phbFirstErrorStatus; // nC88
412 uint64_t phbErrorLog0; // nCC0
413 uint64_t phbErrorLog1; // nCC8
414 uint64_t mmioErrorStatus; // nD00
415 uint64_t mmioFirstErrorStatus; // nD08
416 uint64_t mmioErrorLog0; // nD40
417 uint64_t mmioErrorLog1; // nD48
418 uint64_t dma0ErrorStatus; // nD80
419 uint64_t dma0FirstErrorStatus; // nD88
420 uint64_t dma0ErrorLog0; // nDC0
421 uint64_t dma0ErrorLog1; // nDC8
422 uint64_t dma1ErrorStatus; // nE00
423 uint64_t dma1FirstErrorStatus; // nE08
424 uint64_t dma1ErrorLog0; // nE40
425 uint64_t dma1ErrorLog1; // nE48
426 uint64_t pestA[OPAL_P7IOC_NUM_PEST_REGS];
427 uint64_t pestB[OPAL_P7IOC_NUM_PEST_REGS];
428};
429
317typedef struct oppanel_line { 430typedef struct oppanel_line {
318 /* XXX */ 431 const char * line;
432 uint64_t line_len;
319} oppanel_line_t; 433} oppanel_line_t;
320 434
321/* API functions */ 435/* API functions */
@@ -413,6 +527,15 @@ int64_t opal_pci_map_pe_dma_window_real(uint64_t phb_id, uint16_t pe_number,
413 uint64_t pci_mem_size); 527 uint64_t pci_mem_size);
414int64_t opal_pci_reset(uint64_t phb_id, uint8_t reset_scope, uint8_t assert_state); 528int64_t opal_pci_reset(uint64_t phb_id, uint8_t reset_scope, uint8_t assert_state);
415 529
530int64_t opal_pci_get_hub_diag_data(uint64_t hub_id, void *diag_buffer, uint64_t diag_buffer_len);
531int64_t opal_pci_get_phb_diag_data(uint64_t phb_id, void *diag_buffer, uint64_t diag_buffer_len);
532int64_t opal_pci_fence_phb(uint64_t phb_id);
533int64_t opal_pci_reinit(uint64_t phb_id, uint8_t reinit_scope);
534int64_t opal_pci_mask_pe_error(uint64_t phb_id, uint16_t pe_number, uint8_t error_type, uint8_t mask_action);
535int64_t opal_set_slot_led_status(uint64_t phb_id, uint64_t slot_id, uint8_t led_type, uint8_t led_action);
536int64_t opal_get_epow_status(uint64_t *status);
537int64_t opal_set_system_attention_led(uint8_t led_action);
538
416/* Internal functions */ 539/* Internal functions */
417extern int early_init_dt_scan_opal(unsigned long node, const char *uname, int depth, void *data); 540extern int early_init_dt_scan_opal(unsigned long node, const char *uname, int depth, void *data);
418 541