aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/ia64/sn/kernel/io_init.c29
-rw-r--r--arch/ia64/sn/kernel/tiocx.c10
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_provider.c17
-rw-r--r--include/asm-ia64/sn/l1.h3
-rw-r--r--include/asm-ia64/sn/pcibr_provider.h1
-rw-r--r--include/asm-ia64/sn/pcidev.h1
-rw-r--r--include/asm-ia64/sn/sn_feature_sets.h3
-rw-r--r--include/asm-ia64/sn/sn_sal.h26
8 files changed, 74 insertions, 16 deletions
diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c
index dfb3f2902379..5101ac462643 100644
--- a/arch/ia64/sn/kernel/io_init.c
+++ b/arch/ia64/sn/kernel/io_init.c
@@ -13,6 +13,8 @@
13#include <asm/sn/sn_feature_sets.h> 13#include <asm/sn/sn_feature_sets.h>
14#include <asm/sn/geo.h> 14#include <asm/sn/geo.h>
15#include <asm/sn/io.h> 15#include <asm/sn/io.h>
16#include <asm/sn/l1.h>
17#include <asm/sn/module.h>
16#include <asm/sn/pcibr_provider.h> 18#include <asm/sn/pcibr_provider.h>
17#include <asm/sn/pcibus_provider_defs.h> 19#include <asm/sn/pcibus_provider_defs.h>
18#include <asm/sn/pcidev.h> 20#include <asm/sn/pcidev.h>
@@ -710,9 +712,36 @@ cnodeid_get_geoid(cnodeid_t cnode)
710 return hubdev->hdi_geoid; 712 return hubdev->hdi_geoid;
711} 713}
712 714
715void sn_generate_path(struct pci_bus *pci_bus, char *address)
716{
717 nasid_t nasid;
718 cnodeid_t cnode;
719 geoid_t geoid;
720 moduleid_t moduleid;
721 u16 bricktype;
722
723 nasid = NASID_GET(SN_PCIBUS_BUSSOFT(pci_bus)->bs_base);
724 cnode = nasid_to_cnodeid(nasid);
725 geoid = cnodeid_get_geoid(cnode);
726 moduleid = geo_module(geoid);
727
728 sprintf(address, "module_%c%c%c%c%.2d",
729 '0'+RACK_GET_CLASS(MODULE_GET_RACK(moduleid)),
730 '0'+RACK_GET_GROUP(MODULE_GET_RACK(moduleid)),
731 '0'+RACK_GET_NUM(MODULE_GET_RACK(moduleid)),
732 MODULE_GET_BTCHAR(moduleid), MODULE_GET_BPOS(moduleid));
733
734 /* Tollhouse requires slot id to be displayed */
735 bricktype = MODULE_GET_BTYPE(moduleid);
736 if ((bricktype == L1_BRICKTYPE_191010) ||
737 (bricktype == L1_BRICKTYPE_1932))
738 sprintf(address, "%s^%d", address, geo_slot(geoid));
739}
740
713subsys_initcall(sn_pci_init); 741subsys_initcall(sn_pci_init);
714EXPORT_SYMBOL(sn_pci_fixup_slot); 742EXPORT_SYMBOL(sn_pci_fixup_slot);
715EXPORT_SYMBOL(sn_pci_unfixup_slot); 743EXPORT_SYMBOL(sn_pci_unfixup_slot);
716EXPORT_SYMBOL(sn_pci_controller_fixup); 744EXPORT_SYMBOL(sn_pci_controller_fixup);
717EXPORT_SYMBOL(sn_bus_store_sysdata); 745EXPORT_SYMBOL(sn_bus_store_sysdata);
718EXPORT_SYMBOL(sn_bus_free_sysdata); 746EXPORT_SYMBOL(sn_bus_free_sysdata);
747EXPORT_SYMBOL(sn_generate_path);
diff --git a/arch/ia64/sn/kernel/tiocx.c b/arch/ia64/sn/kernel/tiocx.c
index 99cb28e74295..feaf1a6e8101 100644
--- a/arch/ia64/sn/kernel/tiocx.c
+++ b/arch/ia64/sn/kernel/tiocx.c
@@ -369,9 +369,15 @@ static void tio_corelet_reset(nasid_t nasid, int corelet)
369 369
370static int is_fpga_tio(int nasid, int *bt) 370static int is_fpga_tio(int nasid, int *bt)
371{ 371{
372 int ioboard_type; 372 u16 ioboard_type;
373 s64 rc;
373 374
374 ioboard_type = ia64_sn_sysctl_ioboard_get(nasid); 375 rc = ia64_sn_sysctl_ioboard_get(nasid, &ioboard_type);
376 if (rc) {
377 printk(KERN_WARNING "ia64_sn_sysctl_ioboard_get failed: %ld\n",
378 rc);
379 return 0;
380 }
375 381
376 switch (ioboard_type) { 382 switch (ioboard_type) {
377 case L1_BRICKTYPE_SA: 383 case L1_BRICKTYPE_SA:
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_provider.c b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
index 98f716bd92f0..ab1211ef0176 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_provider.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
@@ -74,6 +74,22 @@ static int sal_pcibr_error_interrupt(struct pcibus_info *soft)
74 return (int)ret_stuff.v0; 74 return (int)ret_stuff.v0;
75} 75}
76 76
77u16 sn_ioboard_to_pci_bus(struct pci_bus *pci_bus)
78{
79 s64 rc;
80 u16 ioboard;
81 nasid_t nasid = NASID_GET(SN_PCIBUS_BUSSOFT(pci_bus)->bs_base);
82
83 rc = ia64_sn_sysctl_ioboard_get(nasid, &ioboard);
84 if (rc) {
85 printk(KERN_WARNING "ia64_sn_sysctl_ioboard_get failed: %ld\n",
86 rc);
87 return 0;
88 }
89
90 return ioboard;
91}
92
77/* 93/*
78 * PCI Bridge Error interrupt handler. Gets invoked whenever a PCI 94 * PCI Bridge Error interrupt handler. Gets invoked whenever a PCI
79 * bridge sends an error interrupt. 95 * bridge sends an error interrupt.
@@ -255,3 +271,4 @@ pcibr_init_provider(void)
255 271
256EXPORT_SYMBOL_GPL(sal_pcibr_slot_enable); 272EXPORT_SYMBOL_GPL(sal_pcibr_slot_enable);
257EXPORT_SYMBOL_GPL(sal_pcibr_slot_disable); 273EXPORT_SYMBOL_GPL(sal_pcibr_slot_disable);
274EXPORT_SYMBOL_GPL(sn_ioboard_to_pci_bus);
diff --git a/include/asm-ia64/sn/l1.h b/include/asm-ia64/sn/l1.h
index e3b819110d47..344bf44bb356 100644
--- a/include/asm-ia64/sn/l1.h
+++ b/include/asm-ia64/sn/l1.h
@@ -34,6 +34,8 @@
34#define L1_BRICKTYPE_IA 0x6b /* k */ 34#define L1_BRICKTYPE_IA 0x6b /* k */
35#define L1_BRICKTYPE_ATHENA 0x2b /* + */ 35#define L1_BRICKTYPE_ATHENA 0x2b /* + */
36#define L1_BRICKTYPE_DAYTONA 0x7a /* z */ 36#define L1_BRICKTYPE_DAYTONA 0x7a /* z */
37#define L1_BRICKTYPE_1932 0x2c /* . */
38#define L1_BRICKTYPE_191010 0x2e /* , */
37 39
38/* board type response codes */ 40/* board type response codes */
39#define L1_BOARDTYPE_IP69 0x0100 /* CA */ 41#define L1_BOARDTYPE_IP69 0x0100 /* CA */
@@ -46,5 +48,4 @@
46#define L1_BOARDTYPE_DAYTONA 0x0800 /* AD */ 48#define L1_BOARDTYPE_DAYTONA 0x0800 /* AD */
47#define L1_BOARDTYPE_INVAL (-1) /* invalid brick type */ 49#define L1_BOARDTYPE_INVAL (-1) /* invalid brick type */
48 50
49
50#endif /* _ASM_IA64_SN_L1_H */ 51#endif /* _ASM_IA64_SN_L1_H */
diff --git a/include/asm-ia64/sn/pcibr_provider.h b/include/asm-ia64/sn/pcibr_provider.h
index a601d3af39b6..51260ab70d91 100644
--- a/include/asm-ia64/sn/pcibr_provider.h
+++ b/include/asm-ia64/sn/pcibr_provider.h
@@ -144,4 +144,5 @@ extern int sal_pcibr_slot_enable(struct pcibus_info *soft, int device,
144 void *resp); 144 void *resp);
145extern int sal_pcibr_slot_disable(struct pcibus_info *soft, int device, 145extern int sal_pcibr_slot_disable(struct pcibus_info *soft, int device,
146 int action, void *resp); 146 int action, void *resp);
147extern u16 sn_ioboard_to_pci_bus(struct pci_bus *pci_bus);
147#endif 148#endif
diff --git a/include/asm-ia64/sn/pcidev.h b/include/asm-ia64/sn/pcidev.h
index 38cdffbc4c7b..eac3561574be 100644
--- a/include/asm-ia64/sn/pcidev.h
+++ b/include/asm-ia64/sn/pcidev.h
@@ -76,6 +76,7 @@ extern void sn_pci_controller_fixup(int segment, int busnum,
76 struct pci_bus *bus); 76 struct pci_bus *bus);
77extern void sn_bus_store_sysdata(struct pci_dev *dev); 77extern void sn_bus_store_sysdata(struct pci_dev *dev);
78extern void sn_bus_free_sysdata(void); 78extern void sn_bus_free_sysdata(void);
79extern void sn_generate_path(struct pci_bus *pci_bus, char *address);
79extern void sn_pci_fixup_slot(struct pci_dev *dev); 80extern void sn_pci_fixup_slot(struct pci_dev *dev);
80extern void sn_pci_unfixup_slot(struct pci_dev *dev); 81extern void sn_pci_unfixup_slot(struct pci_dev *dev);
81extern void sn_irq_lh_init(void); 82extern void sn_irq_lh_init(void);
diff --git a/include/asm-ia64/sn/sn_feature_sets.h b/include/asm-ia64/sn/sn_feature_sets.h
index ff33e3bd3f8e..30dcfa442e53 100644
--- a/include/asm-ia64/sn/sn_feature_sets.h
+++ b/include/asm-ia64/sn/sn_feature_sets.h
@@ -30,8 +30,7 @@ extern int sn_prom_feature_available(int id);
30 30
31#define PRF_PAL_CACHE_FLUSH_SAFE 0 31#define PRF_PAL_CACHE_FLUSH_SAFE 0
32#define PRF_DEVICE_FLUSH_LIST 1 32#define PRF_DEVICE_FLUSH_LIST 1
33 33#define PRF_HOTPLUG_SUPPORT 2
34
35 34
36/* --------------------- OS Features -------------------------------*/ 35/* --------------------- OS Features -------------------------------*/
37 36
diff --git a/include/asm-ia64/sn/sn_sal.h b/include/asm-ia64/sn/sn_sal.h
index e77f0c9b7d3d..246f43a796d7 100644
--- a/include/asm-ia64/sn/sn_sal.h
+++ b/include/asm-ia64/sn/sn_sal.h
@@ -907,18 +907,22 @@ ia64_sn_sysctl_tio_clock_reset(nasid_t nasid)
907/* 907/*
908 * Get the associated ioboard type for a given nasid. 908 * Get the associated ioboard type for a given nasid.
909 */ 909 */
910static inline int 910static inline s64
911ia64_sn_sysctl_ioboard_get(nasid_t nasid) 911ia64_sn_sysctl_ioboard_get(nasid_t nasid, u16 *ioboard)
912{ 912{
913 struct ia64_sal_retval rv; 913 struct ia64_sal_retval isrv;
914 SAL_CALL_REENTRANT(rv, SN_SAL_SYSCTL_OP, SAL_SYSCTL_OP_IOBOARD, 914 SAL_CALL_REENTRANT(isrv, SN_SAL_SYSCTL_OP, SAL_SYSCTL_OP_IOBOARD,
915 nasid, 0, 0, 0, 0, 0); 915 nasid, 0, 0, 0, 0, 0);
916 if (rv.v0 != 0) 916 if (isrv.v0 != 0) {
917 return (int)rv.v0; 917 *ioboard = isrv.v0;
918 if (rv.v1 != 0) 918 return isrv.status;
919 return (int)rv.v1; 919 }
920 920 if (isrv.v1 != 0) {
921 return 0; 921 *ioboard = isrv.v1;
922 return isrv.status;
923 }
924
925 return isrv.status;
922} 926}
923 927
924/** 928/**