aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pseries/eeh.c
diff options
context:
space:
mode:
authorLinas Vepstas <linas@austin.ibm.com>2007-03-19 15:54:21 -0400
committerPaul Mackerras <paulus@samba.org>2007-03-22 07:52:52 -0400
commit147d6a37500348b6bda5738453d84c46678209cf (patch)
treeccc101c3901dd915bdfe86e3feac659124b037b3 /arch/powerpc/platforms/pseries/eeh.c
parent2fd30be8dae25386fc5167c34c6d73201334a8d4 (diff)
[POWERPC] EEH: support ibm,get-config-addr-info2 RTAS call
Provide support for the new ibm,get-config-addr-info2 RTAS token, whenever it is actually available. Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/pseries/eeh.c')
-rw-r--r--arch/powerpc/platforms/pseries/eeh.c44
1 files changed, 35 insertions, 9 deletions
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index 2d0a43f1efb..44aae9193a9 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -83,6 +83,7 @@ static 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; 85static int ibm_get_config_addr_info;
86static int ibm_get_config_addr_info2;
86static int ibm_configure_bridge; 87static int ibm_configure_bridge;
87 88
88int eeh_subsystem_enabled; 89int eeh_subsystem_enabled;
@@ -744,6 +745,38 @@ struct eeh_early_enable_info {
744 unsigned int buid_lo; 745 unsigned int buid_lo;
745}; 746};
746 747
748static int get_pe_addr (int config_addr,
749 struct eeh_early_enable_info *info)
750{
751 unsigned int rets[3];
752 int ret;
753
754 /* Use latest config-addr token on power6 */
755 if (ibm_get_config_addr_info2 != RTAS_UNKNOWN_SERVICE) {
756 /* Make sure we have a PE in hand */
757 ret = rtas_call (ibm_get_config_addr_info2, 4, 2, rets,
758 config_addr, info->buid_hi, info->buid_lo, 1);
759 if (ret || (rets[0]==0))
760 return 0;
761
762 ret = rtas_call (ibm_get_config_addr_info2, 4, 2, rets,
763 config_addr, info->buid_hi, info->buid_lo, 0);
764 if (ret)
765 return 0;
766 return rets[0];
767 }
768
769 /* Use older config-addr token on power5 */
770 if (ibm_get_config_addr_info != RTAS_UNKNOWN_SERVICE) {
771 ret = rtas_call (ibm_get_config_addr_info, 4, 2, rets,
772 config_addr, info->buid_hi, info->buid_lo, 0);
773 if (ret)
774 return 0;
775 return rets[0];
776 }
777 return 0;
778}
779
747/* Enable eeh for the given device node. */ 780/* Enable eeh for the given device node. */
748static void *early_enable_eeh(struct device_node *dn, void *data) 781static void *early_enable_eeh(struct device_node *dn, void *data)
749{ 782{
@@ -810,15 +843,7 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
810 843
811 /* If the newer, better, ibm,get-config-addr-info is supported, 844 /* If the newer, better, ibm,get-config-addr-info is supported,
812 * then use that instead. */ 845 * then use that instead. */
813 pdn->eeh_pe_config_addr = 0; 846 pdn->eeh_pe_config_addr = get_pe_addr(pdn->eeh_config_addr, info);
814 if (ibm_get_config_addr_info != RTAS_UNKNOWN_SERVICE) {
815 ret = rtas_call (ibm_get_config_addr_info, 4, 2, rets,
816 pdn->eeh_config_addr,
817 info->buid_hi, info->buid_lo,
818 0);
819 if (ret == 0)
820 pdn->eeh_pe_config_addr = rets[0];
821 }
822 847
823 /* Some older systems (Power4) allow the 848 /* Some older systems (Power4) allow the
824 * ibm,set-eeh-option call to succeed even on nodes 849 * ibm,set-eeh-option call to succeed even on nodes
@@ -889,6 +914,7 @@ void __init eeh_init(void)
889 ibm_read_slot_reset_state = rtas_token("ibm,read-slot-reset-state"); 914 ibm_read_slot_reset_state = rtas_token("ibm,read-slot-reset-state");
890 ibm_slot_error_detail = rtas_token("ibm,slot-error-detail"); 915 ibm_slot_error_detail = rtas_token("ibm,slot-error-detail");
891 ibm_get_config_addr_info = rtas_token("ibm,get-config-addr-info"); 916 ibm_get_config_addr_info = rtas_token("ibm,get-config-addr-info");
917 ibm_get_config_addr_info2 = rtas_token("ibm,get-config-addr-info2");
892 ibm_configure_bridge = rtas_token ("ibm,configure-bridge"); 918 ibm_configure_bridge = rtas_token ("ibm,configure-bridge");
893 919
894 if (ibm_set_eeh_option == RTAS_UNKNOWN_SERVICE) 920 if (ibm_set_eeh_option == RTAS_UNKNOWN_SERVICE)