aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinas Vepstas <linas@linas.org>2005-11-03 19:53:20 -0500
committerPaul Mackerras <paulus@samba.org>2006-01-09 23:29:14 -0500
commit25e591f6dd07365cbf0b1c2454386ce597dd5e05 (patch)
treec5b2709d6eb012dd2a0816f69b4bf9c7b56a887a
parent5d5a0936b3ad9e3d3f6eaf61f1a06c62ea0e7a59 (diff)
[PATCH] powerpc: Add "partitionable endpoint" support
26-eeh-partition-endpoint.patch New versions of firmware introduce a new method by which the "partitionable endpoint" (the point at which the pci bus is cut) should be located. This code adds the support for this (mandatory) new feature. Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org> (cherry picked from 9fcfb5d35b5294659f9299aa9cae6fd16325c07e commit)
-rw-r--r--arch/powerpc/platforms/pseries/eeh.c26
-rw-r--r--include/asm-powerpc/pci-bridge.h1
2 files changed, 25 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index 57bef2c2f325..46ea4acd9906 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -82,6 +82,7 @@ static int ibm_set_slot_reset;
82static int ibm_read_slot_reset_state; 82static int ibm_read_slot_reset_state;
83static int ibm_read_slot_reset_state2; 83static int ibm_read_slot_reset_state2;
84static int ibm_slot_error_detail; 84static int ibm_slot_error_detail;
85static int ibm_get_config_addr_info;
85 86
86int eeh_subsystem_enabled; 87int eeh_subsystem_enabled;
87EXPORT_SYMBOL(eeh_subsystem_enabled); 88EXPORT_SYMBOL(eeh_subsystem_enabled);
@@ -457,6 +458,7 @@ eeh_slot_availability(struct pci_dn *pdn)
457static void 458static void
458rtas_pci_slot_reset(struct pci_dn *pdn, int state) 459rtas_pci_slot_reset(struct pci_dn *pdn, int state)
459{ 460{
461 int config_addr;
460 int rc; 462 int rc;
461 463
462 BUG_ON (pdn==NULL); 464 BUG_ON (pdn==NULL);
@@ -467,8 +469,13 @@ rtas_pci_slot_reset(struct pci_dn *pdn, int state)
467 return; 469 return;
468 } 470 }
469 471
472 /* Use PE configuration address, if present */
473 config_addr = pdn->eeh_config_addr;
474 if (pdn->eeh_pe_config_addr)
475 config_addr = pdn->eeh_pe_config_addr;
476
470 rc = rtas_call(ibm_set_slot_reset,4,1, NULL, 477 rc = rtas_call(ibm_set_slot_reset,4,1, NULL,
471 pdn->eeh_config_addr, 478 config_addr,
472 BUID_HI(pdn->phb->buid), 479 BUID_HI(pdn->phb->buid),
473 BUID_LO(pdn->phb->buid), 480 BUID_LO(pdn->phb->buid),
474 state); 481 state);
@@ -695,8 +702,22 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
695 eeh_subsystem_enabled = 1; 702 eeh_subsystem_enabled = 1;
696 pdn->eeh_mode |= EEH_MODE_SUPPORTED; 703 pdn->eeh_mode |= EEH_MODE_SUPPORTED;
697 pdn->eeh_config_addr = regs[0]; 704 pdn->eeh_config_addr = regs[0];
705
706 /* If the newer, better, ibm,get-config-addr-info is supported,
707 * then use that instead. */
708 pdn->eeh_pe_config_addr = 0;
709 if (ibm_get_config_addr_info != RTAS_UNKNOWN_SERVICE) {
710 unsigned int rets[2];
711 ret = rtas_call (ibm_get_config_addr_info, 4, 2, rets,
712 pdn->eeh_config_addr,
713 info->buid_hi, info->buid_lo,
714 0);
715 if (ret == 0)
716 pdn->eeh_pe_config_addr = rets[0];
717 }
698#ifdef DEBUG 718#ifdef DEBUG
699 printk(KERN_DEBUG "EEH: %s: eeh enabled\n", dn->full_name); 719 printk(KERN_DEBUG "EEH: %s: eeh enabled, config=%x pe_config=%x\n",
720 dn->full_name, pdn->eeh_config_addr, pdn->eeh_pe_config_addr);
700#endif 721#endif
701 } else { 722 } else {
702 723
@@ -748,6 +769,7 @@ void __init eeh_init(void)
748 ibm_read_slot_reset_state2 = rtas_token("ibm,read-slot-reset-state2"); 769 ibm_read_slot_reset_state2 = rtas_token("ibm,read-slot-reset-state2");
749 ibm_read_slot_reset_state = rtas_token("ibm,read-slot-reset-state"); 770 ibm_read_slot_reset_state = rtas_token("ibm,read-slot-reset-state");
750 ibm_slot_error_detail = rtas_token("ibm,slot-error-detail"); 771 ibm_slot_error_detail = rtas_token("ibm,slot-error-detail");
772 ibm_get_config_addr_info = rtas_token("ibm,get-config-addr-info");
751 773
752 if (ibm_set_eeh_option == RTAS_UNKNOWN_SERVICE) 774 if (ibm_set_eeh_option == RTAS_UNKNOWN_SERVICE)
753 return; 775 return;
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
index 1a08860e789e..a81bc363f350 100644
--- a/include/asm-powerpc/pci-bridge.h
+++ b/include/asm-powerpc/pci-bridge.h
@@ -68,6 +68,7 @@ struct pci_dn {
68#ifdef CONFIG_PPC_PSERIES 68#ifdef CONFIG_PPC_PSERIES
69 int eeh_mode; /* See eeh.h for possible EEH_MODEs */ 69 int eeh_mode; /* See eeh.h for possible EEH_MODEs */
70 int eeh_config_addr; 70 int eeh_config_addr;
71 int eeh_pe_config_addr; /* new-style partition endpoint address */
71 int eeh_check_count; /* # times driver ignored error */ 72 int eeh_check_count; /* # times driver ignored error */
72 int eeh_freeze_count; /* # times this device froze up. */ 73 int eeh_freeze_count; /* # times this device froze up. */
73 int eeh_is_bridge; /* device is pci-to-pci bridge */ 74 int eeh_is_bridge; /* device is pci-to-pci bridge */