diff options
author | Prarit Bhargava <prarit@sgi.com> | 2006-04-04 09:26:46 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-19 17:13:21 -0400 |
commit | e55dea58c5609aece6156a6cd2306b820a7794ef (patch) | |
tree | 23ed63d8920d473029b50b5de7e04a03e511b681 /drivers/pci/hotplug | |
parent | 427abfa28afedffadfca9dd8b067eb6d36bac53f (diff) |
[PATCH] PCI Hotplug: Tollhouse HP: SGI hotplug driver changes
SGI hotplug driver changes required to support Tollhouse system PCI
hotplug, and implements the PRF_HOTPLUG_SUPPORT feature bit.
Signed-off-by: Prarit Bhargava <prarit@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r-- | drivers/pci/hotplug/sgi_hotplug.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/pci/hotplug/sgi_hotplug.c b/drivers/pci/hotplug/sgi_hotplug.c index 8cb9abde736b..cfee9db52c49 100644 --- a/drivers/pci/hotplug/sgi_hotplug.c +++ b/drivers/pci/hotplug/sgi_hotplug.c | |||
@@ -18,11 +18,13 @@ | |||
18 | #include <linux/mutex.h> | 18 | #include <linux/mutex.h> |
19 | 19 | ||
20 | #include <asm/sn/addrs.h> | 20 | #include <asm/sn/addrs.h> |
21 | #include <asm/sn/geo.h> | ||
21 | #include <asm/sn/l1.h> | 22 | #include <asm/sn/l1.h> |
22 | #include <asm/sn/module.h> | 23 | #include <asm/sn/module.h> |
23 | #include <asm/sn/pcibr_provider.h> | 24 | #include <asm/sn/pcibr_provider.h> |
24 | #include <asm/sn/pcibus_provider_defs.h> | 25 | #include <asm/sn/pcibus_provider_defs.h> |
25 | #include <asm/sn/pcidev.h> | 26 | #include <asm/sn/pcidev.h> |
27 | #include <asm/sn/sn_feature_sets.h> | ||
26 | #include <asm/sn/sn_sal.h> | 28 | #include <asm/sn/sn_sal.h> |
27 | #include <asm/sn/types.h> | 29 | #include <asm/sn/types.h> |
28 | 30 | ||
@@ -102,8 +104,7 @@ static struct hotplug_slot_attribute sn_slot_path_attr = __ATTR_RO(path); | |||
102 | static int sn_pci_slot_valid(struct pci_bus *pci_bus, int device) | 104 | static int sn_pci_slot_valid(struct pci_bus *pci_bus, int device) |
103 | { | 105 | { |
104 | struct pcibus_info *pcibus_info; | 106 | struct pcibus_info *pcibus_info; |
105 | int bricktype; | 107 | u16 busnum, segment, ioboard_type; |
106 | int bus_num; | ||
107 | 108 | ||
108 | pcibus_info = SN_PCIBUS_BUSSOFT_INFO(pci_bus); | 109 | pcibus_info = SN_PCIBUS_BUSSOFT_INFO(pci_bus); |
109 | 110 | ||
@@ -111,12 +112,14 @@ static int sn_pci_slot_valid(struct pci_bus *pci_bus, int device) | |||
111 | if (!(pcibus_info->pbi_valid_devices & (1 << device))) | 112 | if (!(pcibus_info->pbi_valid_devices & (1 << device))) |
112 | return -EPERM; | 113 | return -EPERM; |
113 | 114 | ||
114 | bricktype = MODULE_GET_BTYPE(pcibus_info->pbi_moduleid); | 115 | ioboard_type = sn_ioboard_to_pci_bus(pci_bus); |
115 | bus_num = pcibus_info->pbi_buscommon.bs_persist_busnum & 0xf; | 116 | busnum = pcibus_info->pbi_buscommon.bs_persist_busnum; |
117 | segment = pci_domain_nr(pci_bus) & 0xf; | ||
116 | 118 | ||
117 | /* Do not allow hotplug operations on base I/O cards */ | 119 | /* Do not allow hotplug operations on base I/O cards */ |
118 | if ((bricktype == L1_BRICKTYPE_IX || bricktype == L1_BRICKTYPE_IA) && | 120 | if ((ioboard_type == L1_BRICKTYPE_IX || |
119 | (bus_num == 1 && device != 1)) | 121 | ioboard_type == L1_BRICKTYPE_IA) && |
122 | (segment == 1 && busnum == 0 && device != 1)) | ||
120 | return -EPERM; | 123 | return -EPERM; |
121 | 124 | ||
122 | return 1; | 125 | return 1; |
@@ -125,23 +128,23 @@ static int sn_pci_slot_valid(struct pci_bus *pci_bus, int device) | |||
125 | static int sn_pci_bus_valid(struct pci_bus *pci_bus) | 128 | static int sn_pci_bus_valid(struct pci_bus *pci_bus) |
126 | { | 129 | { |
127 | struct pcibus_info *pcibus_info; | 130 | struct pcibus_info *pcibus_info; |
128 | int asic_type; | 131 | u32 asic_type; |
129 | int bricktype; | 132 | u16 ioboard_type; |
130 | |||
131 | pcibus_info = SN_PCIBUS_BUSSOFT_INFO(pci_bus); | ||
132 | 133 | ||
133 | /* Don't register slots hanging off the TIOCA bus */ | 134 | /* Don't register slots hanging off the TIOCA bus */ |
135 | pcibus_info = SN_PCIBUS_BUSSOFT_INFO(pci_bus); | ||
134 | asic_type = pcibus_info->pbi_buscommon.bs_asic_type; | 136 | asic_type = pcibus_info->pbi_buscommon.bs_asic_type; |
135 | if (asic_type == PCIIO_ASIC_TYPE_TIOCA) | 137 | if (asic_type == PCIIO_ASIC_TYPE_TIOCA) |
136 | return -EPERM; | 138 | return -EPERM; |
137 | 139 | ||
138 | /* Only register slots in I/O Bricks that support hotplug */ | 140 | /* Only register slots in I/O Bricks that support hotplug */ |
139 | bricktype = MODULE_GET_BTYPE(pcibus_info->pbi_moduleid); | 141 | ioboard_type = sn_ioboard_to_pci_bus(pci_bus); |
140 | switch (bricktype) { | 142 | switch (ioboard_type) { |
141 | case L1_BRICKTYPE_IX: | 143 | case L1_BRICKTYPE_IX: |
142 | case L1_BRICKTYPE_PX: | 144 | case L1_BRICKTYPE_PX: |
143 | case L1_BRICKTYPE_IA: | 145 | case L1_BRICKTYPE_IA: |
144 | case L1_BRICKTYPE_PA: | 146 | case L1_BRICKTYPE_PA: |
147 | case L1_BOARDTYPE_PCIX3SLOT: | ||
145 | return 1; | 148 | return 1; |
146 | break; | 149 | break; |
147 | default: | 150 | default: |
@@ -175,14 +178,11 @@ static int sn_hp_slot_private_alloc(struct hotplug_slot *bss_hotplug_slot, | |||
175 | slot->pci_bus = pci_bus; | 178 | slot->pci_bus = pci_bus; |
176 | sprintf(bss_hotplug_slot->name, "%04x:%02x:%02x", | 179 | sprintf(bss_hotplug_slot->name, "%04x:%02x:%02x", |
177 | pci_domain_nr(pci_bus), | 180 | pci_domain_nr(pci_bus), |
178 | ((int)pcibus_info->pbi_buscommon.bs_persist_busnum) & 0xf, | 181 | ((u16)pcibus_info->pbi_buscommon.bs_persist_busnum), |
179 | device + 1); | 182 | device + 1); |
180 | sprintf(slot->physical_path, "module_%c%c%c%c%.2d", | 183 | |
181 | '0'+RACK_GET_CLASS(MODULE_GET_RACK(pcibus_info->pbi_moduleid)), | 184 | sn_generate_path(pci_bus, slot->physical_path); |
182 | '0'+RACK_GET_GROUP(MODULE_GET_RACK(pcibus_info->pbi_moduleid)), | 185 | |
183 | '0'+RACK_GET_NUM(MODULE_GET_RACK(pcibus_info->pbi_moduleid)), | ||
184 | MODULE_GET_BTCHAR(pcibus_info->pbi_moduleid), | ||
185 | MODULE_GET_BPOS(pcibus_info->pbi_moduleid)); | ||
186 | slot->hotplug_slot = bss_hotplug_slot; | 186 | slot->hotplug_slot = bss_hotplug_slot; |
187 | list_add(&slot->hp_list, &sn_hp_list); | 187 | list_add(&slot->hp_list, &sn_hp_list); |
188 | 188 | ||
@@ -553,8 +553,8 @@ static int sn_pci_hotplug_init(void) | |||
553 | int rc; | 553 | int rc; |
554 | int registered = 0; | 554 | int registered = 0; |
555 | 555 | ||
556 | if (sn_sal_rev() < SGI_HOTPLUG_PROM_REV) { | 556 | if (!sn_prom_feature_available(PRF_HOTPLUG_SUPPORT)) { |
557 | printk(KERN_ERR "%s: PROM version must be greater than 4.30\n", | 557 | printk(KERN_ERR "%s: PROM version does not support hotplug.\n", |
558 | __FUNCTION__); | 558 | __FUNCTION__); |
559 | return -EPERM; | 559 | return -EPERM; |
560 | } | 560 | } |