From 5d098669bd97ab54ce5add09460da4c7f11be56e Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Fri, 21 Dec 2007 15:50:09 +1100 Subject: [PATCH] --- yaml --- r: 81242 b: refs/heads/master c: 885b86e4e7ccc360f8ce4d7fb10dfdfb6e3c8650 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/powerpc/kernel/pci_dn.c | 5 ----- trunk/arch/powerpc/platforms/iseries/pci.c | 12 +++++++----- trunk/include/asm-powerpc/pci-bridge.h | 1 - 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/[refs] b/[refs] index 55fe0600757d..6a718cf8cb68 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b6ed42a794e1ca51fb46ff2bdc562315c46dd9a8 +refs/heads/master: 885b86e4e7ccc360f8ce4d7fb10dfdfb6e3c8650 diff --git a/trunk/arch/powerpc/kernel/pci_dn.c b/trunk/arch/powerpc/kernel/pci_dn.c index 85d4d8924b5c..1c67de52e3ce 100644 --- a/trunk/arch/powerpc/kernel/pci_dn.c +++ b/trunk/arch/powerpc/kernel/pci_dn.c @@ -56,11 +56,6 @@ static void * __devinit update_dn_pci_info(struct device_node *dn, void *data) pdn->busno = (regs[0] >> 16) & 0xff; pdn->devfn = (regs[0] >> 8) & 0xff; } - if (firmware_has_feature(FW_FEATURE_ISERIES)) { - const u32 *busp = of_get_property(dn, "linux,subbus", NULL); - if (busp) - pdn->bussubno = *busp; - } pdn->pci_ext_config_space = (type && *type == 1); return NULL; diff --git a/trunk/arch/powerpc/platforms/iseries/pci.c b/trunk/arch/powerpc/platforms/iseries/pci.c index 931941036b91..cc562e4c2f32 100644 --- a/trunk/arch/powerpc/platforms/iseries/pci.c +++ b/trunk/arch/powerpc/platforms/iseries/pci.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -70,7 +71,7 @@ static long current_iomm_table_entry; * Lookup Tables. */ static struct device_node *iomm_table[IOMM_TABLE_MAX_ENTRIES]; -static u8 iobar_table[IOMM_TABLE_MAX_ENTRIES]; +static u64 ds_addr_table[IOMM_TABLE_MAX_ENTRIES]; static DEFINE_SPINLOCK(iomm_table_lock); @@ -80,8 +81,9 @@ static DEFINE_SPINLOCK(iomm_table_lock); static inline u64 iseries_ds_addr(struct device_node *node) { struct pci_dn *pdn = PCI_DN(node); + const u32 *sbp = of_get_property(node, "linux,subbus", NULL); - return ((u64)pdn->busno << 48) + ((u64)pdn->bussubno << 40) + return ((u64)pdn->busno << 48) + ((u64)(sbp ? *sbp : 0) << 40) + ((u64)0x10 << 32); } @@ -333,7 +335,8 @@ static void __init iomm_table_allocate_entry(struct pci_dev *dev, int bar_num) */ while (bar_size > 0 ) { iomm_table[current_iomm_table_entry] = dev->sysdata; - iobar_table[current_iomm_table_entry] = bar_num; + ds_addr_table[current_iomm_table_entry] = + iseries_ds_addr(dev->sysdata) | (bar_num << 24); bar_size -= IOMM_TABLE_ENTRY_SIZE; ++current_iomm_table_entry; } @@ -598,8 +601,7 @@ static inline struct device_node *xlate_iomm_address( dn = iomm_table[ind]; if (dn != NULL) { - int barnum = iobar_table[ind]; - *dsaptr = iseries_ds_addr(dn) | (barnum << 24); + *dsaptr = ds_addr_table[ind]; *bar_offset = base_addr % IOMM_TABLE_ENTRY_SIZE; } else panic("PCI: Invalid PCI IO address detected!\n"); diff --git a/trunk/include/asm-powerpc/pci-bridge.h b/trunk/include/asm-powerpc/pci-bridge.h index 29324047779d..a6ea49eb680b 100644 --- a/trunk/include/asm-powerpc/pci-bridge.h +++ b/trunk/include/asm-powerpc/pci-bridge.h @@ -165,7 +165,6 @@ struct iommu_table; struct pci_dn { int busno; /* pci bus number */ - int bussubno; /* pci subordinate bus number */ int devfn; /* pci device and function number */ struct pci_controller *phb; /* for pci devices */