Commit e55dea58 authored by Prarit Bhargava's avatar Prarit Bhargava Committed by Greg Kroah-Hartman

[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: default avatarPrarit Bhargava <prarit@sgi.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 427abfa2
...@@ -18,11 +18,13 @@ ...@@ -18,11 +18,13 @@
#include <linux/mutex.h> #include <linux/mutex.h>
#include <asm/sn/addrs.h> #include <asm/sn/addrs.h>
#include <asm/sn/geo.h>
#include <asm/sn/l1.h> #include <asm/sn/l1.h>
#include <asm/sn/module.h> #include <asm/sn/module.h>
#include <asm/sn/pcibr_provider.h> #include <asm/sn/pcibr_provider.h>
#include <asm/sn/pcibus_provider_defs.h> #include <asm/sn/pcibus_provider_defs.h>
#include <asm/sn/pcidev.h> #include <asm/sn/pcidev.h>
#include <asm/sn/sn_feature_sets.h>
#include <asm/sn/sn_sal.h> #include <asm/sn/sn_sal.h>
#include <asm/sn/types.h> #include <asm/sn/types.h>
...@@ -102,8 +104,7 @@ static struct hotplug_slot_attribute sn_slot_path_attr = __ATTR_RO(path); ...@@ -102,8 +104,7 @@ static struct hotplug_slot_attribute sn_slot_path_attr = __ATTR_RO(path);
static int sn_pci_slot_valid(struct pci_bus *pci_bus, int device) static int sn_pci_slot_valid(struct pci_bus *pci_bus, int device)
{ {
struct pcibus_info *pcibus_info; struct pcibus_info *pcibus_info;
int bricktype; u16 busnum, segment, ioboard_type;
int bus_num;
pcibus_info = SN_PCIBUS_BUSSOFT_INFO(pci_bus); pcibus_info = SN_PCIBUS_BUSSOFT_INFO(pci_bus);
...@@ -111,12 +112,14 @@ static int sn_pci_slot_valid(struct pci_bus *pci_bus, int device) ...@@ -111,12 +112,14 @@ static int sn_pci_slot_valid(struct pci_bus *pci_bus, int device)
if (!(pcibus_info->pbi_valid_devices & (1 << device))) if (!(pcibus_info->pbi_valid_devices & (1 << device)))
return -EPERM; return -EPERM;
bricktype = MODULE_GET_BTYPE(pcibus_info->pbi_moduleid); ioboard_type = sn_ioboard_to_pci_bus(pci_bus);
bus_num = pcibus_info->pbi_buscommon.bs_persist_busnum & 0xf; busnum = pcibus_info->pbi_buscommon.bs_persist_busnum;
segment = pci_domain_nr(pci_bus) & 0xf;
/* Do not allow hotplug operations on base I/O cards */ /* Do not allow hotplug operations on base I/O cards */
if ((bricktype == L1_BRICKTYPE_IX || bricktype == L1_BRICKTYPE_IA) && if ((ioboard_type == L1_BRICKTYPE_IX ||
(bus_num == 1 && device != 1)) ioboard_type == L1_BRICKTYPE_IA) &&
(segment == 1 && busnum == 0 && device != 1))
return -EPERM; return -EPERM;
return 1; return 1;
...@@ -125,23 +128,23 @@ static int sn_pci_slot_valid(struct pci_bus *pci_bus, int device) ...@@ -125,23 +128,23 @@ static int sn_pci_slot_valid(struct pci_bus *pci_bus, int device)
static int sn_pci_bus_valid(struct pci_bus *pci_bus) static int sn_pci_bus_valid(struct pci_bus *pci_bus)
{ {
struct pcibus_info *pcibus_info; struct pcibus_info *pcibus_info;
int asic_type; u32 asic_type;
int bricktype; u16 ioboard_type;
pcibus_info = SN_PCIBUS_BUSSOFT_INFO(pci_bus);
/* Don't register slots hanging off the TIOCA bus */ /* Don't register slots hanging off the TIOCA bus */
pcibus_info = SN_PCIBUS_BUSSOFT_INFO(pci_bus);
asic_type = pcibus_info->pbi_buscommon.bs_asic_type; asic_type = pcibus_info->pbi_buscommon.bs_asic_type;
if (asic_type == PCIIO_ASIC_TYPE_TIOCA) if (asic_type == PCIIO_ASIC_TYPE_TIOCA)
return -EPERM; return -EPERM;
/* Only register slots in I/O Bricks that support hotplug */ /* Only register slots in I/O Bricks that support hotplug */
bricktype = MODULE_GET_BTYPE(pcibus_info->pbi_moduleid); ioboard_type = sn_ioboard_to_pci_bus(pci_bus);
switch (bricktype) { switch (ioboard_type) {
case L1_BRICKTYPE_IX: case L1_BRICKTYPE_IX:
case L1_BRICKTYPE_PX: case L1_BRICKTYPE_PX:
case L1_BRICKTYPE_IA: case L1_BRICKTYPE_IA:
case L1_BRICKTYPE_PA: case L1_BRICKTYPE_PA:
case L1_BOARDTYPE_PCIX3SLOT:
return 1; return 1;
break; break;
default: default:
...@@ -175,14 +178,11 @@ static int sn_hp_slot_private_alloc(struct hotplug_slot *bss_hotplug_slot, ...@@ -175,14 +178,11 @@ static int sn_hp_slot_private_alloc(struct hotplug_slot *bss_hotplug_slot,
slot->pci_bus = pci_bus; slot->pci_bus = pci_bus;
sprintf(bss_hotplug_slot->name, "%04x:%02x:%02x", sprintf(bss_hotplug_slot->name, "%04x:%02x:%02x",
pci_domain_nr(pci_bus), pci_domain_nr(pci_bus),
((int)pcibus_info->pbi_buscommon.bs_persist_busnum) & 0xf, ((u16)pcibus_info->pbi_buscommon.bs_persist_busnum),
device + 1); device + 1);
sprintf(slot->physical_path, "module_%c%c%c%c%.2d",
'0'+RACK_GET_CLASS(MODULE_GET_RACK(pcibus_info->pbi_moduleid)), sn_generate_path(pci_bus, slot->physical_path);
'0'+RACK_GET_GROUP(MODULE_GET_RACK(pcibus_info->pbi_moduleid)),
'0'+RACK_GET_NUM(MODULE_GET_RACK(pcibus_info->pbi_moduleid)),
MODULE_GET_BTCHAR(pcibus_info->pbi_moduleid),
MODULE_GET_BPOS(pcibus_info->pbi_moduleid));
slot->hotplug_slot = bss_hotplug_slot; slot->hotplug_slot = bss_hotplug_slot;
list_add(&slot->hp_list, &sn_hp_list); list_add(&slot->hp_list, &sn_hp_list);
...@@ -553,8 +553,8 @@ static int sn_pci_hotplug_init(void) ...@@ -553,8 +553,8 @@ static int sn_pci_hotplug_init(void)
int rc; int rc;
int registered = 0; int registered = 0;
if (sn_sal_rev() < SGI_HOTPLUG_PROM_REV) { if (!sn_prom_feature_available(PRF_HOTPLUG_SUPPORT)) {
printk(KERN_ERR "%s: PROM version must be greater than 4.30\n", printk(KERN_ERR "%s: PROM version does not support hotplug.\n",
__FUNCTION__); __FUNCTION__);
return -EPERM; return -EPERM;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment