diff options
| author | Yijing Wang <wangyijing@huawei.com> | 2013-06-06 03:34:46 -0400 |
|---|---|---|
| committer | Tony Luck <tony.luck@intel.com> | 2013-06-18 12:41:49 -0400 |
| commit | c60fb074c0baef6b0ca259dafe2371a24f3f8c1f (patch) | |
| tree | c3cd8216f76186c5f152517b3664130e933be1d5 | |
| parent | 7d132055814ef17a6c7b69f342244c410a5e000f (diff) | |
PCI/IA64: SN: remove sn_pci_window_fixup()
Currently, pcibios_bus_to_resource() and pcibios_resource_to_bus()
functions use pci_host_bridge_window in pci_host_bridge to translate
bus side to/from cpu side addresses. Pci_window in pci_controller
under IA64 is no used again, so it's no need to use sn_pci_window_fixup()
to setup pci_window again, remove it.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Cc: John Keller <jpk@sgi.com>
Cc: Jay Lan <jlan@engr.sgi.com>
Cc: Jack Steiner <steiner@sgi.com>
Cc: Mark Maule <maule@sgi.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: linux-ia64@vger.kernel.org
Signed-off-by: Tony Luck <tony.luck@intel.com>
| -rw-r--r-- | arch/ia64/sn/kernel/io_init.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c index 238e2c511d94..06a172cb37f4 100644 --- a/arch/ia64/sn/kernel/io_init.c +++ b/arch/ia64/sn/kernel/io_init.c | |||
| @@ -149,48 +149,6 @@ sn_legacy_pci_window_fixup(struct pci_controller *controller, | |||
| 149 | } | 149 | } |
| 150 | 150 | ||
| 151 | /* | 151 | /* |
| 152 | * sn_pci_window_fixup() - Create a pci_window for each device resource. | ||
| 153 | * It will setup pci_windows for use by | ||
| 154 | * pcibios_bus_to_resource(), pcibios_resource_to_bus(), | ||
| 155 | * etc. | ||
| 156 | */ | ||
| 157 | static void | ||
| 158 | sn_pci_window_fixup(struct pci_dev *dev, unsigned int count, | ||
| 159 | s64 * pci_addrs) | ||
| 160 | { | ||
| 161 | struct pci_controller *controller = PCI_CONTROLLER(dev->bus); | ||
| 162 | unsigned int i; | ||
| 163 | unsigned int idx; | ||
| 164 | unsigned int new_count; | ||
| 165 | struct pci_window *new_window; | ||
| 166 | |||
| 167 | if (count == 0) | ||
| 168 | return; | ||
| 169 | idx = controller->windows; | ||
| 170 | new_count = controller->windows + count; | ||
| 171 | new_window = kcalloc(new_count, sizeof(struct pci_window), GFP_KERNEL); | ||
| 172 | BUG_ON(new_window == NULL); | ||
| 173 | if (controller->window) { | ||
| 174 | memcpy(new_window, controller->window, | ||
| 175 | sizeof(struct pci_window) * controller->windows); | ||
| 176 | kfree(controller->window); | ||
| 177 | } | ||
| 178 | |||
| 179 | /* Setup a pci_window for each device resource. */ | ||
| 180 | for (i = 0; i <= PCI_ROM_RESOURCE; i++) { | ||
| 181 | if (pci_addrs[i] == -1) | ||
| 182 | continue; | ||
| 183 | |||
| 184 | new_window[idx].offset = dev->resource[i].start - pci_addrs[i]; | ||
| 185 | new_window[idx].resource = dev->resource[i]; | ||
| 186 | idx++; | ||
| 187 | } | ||
| 188 | |||
| 189 | controller->windows = new_count; | ||
| 190 | controller->window = new_window; | ||
| 191 | } | ||
| 192 | |||
| 193 | /* | ||
| 194 | * sn_io_slot_fixup() - We are not running with an ACPI capable PROM, | 152 | * sn_io_slot_fixup() - We are not running with an ACPI capable PROM, |
| 195 | * and need to convert the pci_dev->resource | 153 | * and need to convert the pci_dev->resource |
| 196 | * 'start' and 'end' addresses to mapped addresses, | 154 | * 'start' and 'end' addresses to mapped addresses, |
| @@ -199,9 +157,7 @@ sn_pci_window_fixup(struct pci_dev *dev, unsigned int count, | |||
| 199 | void | 157 | void |
| 200 | sn_io_slot_fixup(struct pci_dev *dev) | 158 | sn_io_slot_fixup(struct pci_dev *dev) |
| 201 | { | 159 | { |
| 202 | unsigned int count = 0; | ||
| 203 | int idx; | 160 | int idx; |
| 204 | s64 pci_addrs[PCI_ROM_RESOURCE + 1]; | ||
| 205 | unsigned long addr, end, size, start; | 161 | unsigned long addr, end, size, start; |
| 206 | struct pcidev_info *pcidev_info; | 162 | struct pcidev_info *pcidev_info; |
| 207 | struct sn_irq_info *sn_irq_info; | 163 | struct sn_irq_info *sn_irq_info; |
| @@ -229,7 +185,6 @@ sn_io_slot_fixup(struct pci_dev *dev) | |||
| 229 | for (idx = 0; idx <= PCI_ROM_RESOURCE; idx++) { | 185 | for (idx = 0; idx <= PCI_ROM_RESOURCE; idx++) { |
| 230 | 186 | ||
| 231 | if (!pcidev_info->pdi_pio_mapped_addr[idx]) { | 187 | if (!pcidev_info->pdi_pio_mapped_addr[idx]) { |
| 232 | pci_addrs[idx] = -1; | ||
| 233 | continue; | 188 | continue; |
| 234 | } | 189 | } |
| 235 | 190 | ||
| @@ -237,11 +192,8 @@ sn_io_slot_fixup(struct pci_dev *dev) | |||
| 237 | end = dev->resource[idx].end; | 192 | end = dev->resource[idx].end; |
| 238 | size = end - start; | 193 | size = end - start; |
| 239 | if (size == 0) { | 194 | if (size == 0) { |
| 240 | pci_addrs[idx] = -1; | ||
| 241 | continue; | 195 | continue; |
| 242 | } | 196 | } |
| 243 | pci_addrs[idx] = start; | ||
| 244 | count++; | ||
| 245 | addr = pcidev_info->pdi_pio_mapped_addr[idx]; | 197 | addr = pcidev_info->pdi_pio_mapped_addr[idx]; |
| 246 | addr = ((addr << 4) >> 4) | __IA64_UNCACHED_OFFSET; | 198 | addr = ((addr << 4) >> 4) | __IA64_UNCACHED_OFFSET; |
| 247 | dev->resource[idx].start = addr; | 199 | dev->resource[idx].start = addr; |
| @@ -276,11 +228,6 @@ sn_io_slot_fixup(struct pci_dev *dev) | |||
| 276 | IORESOURCE_ROM_BIOS_COPY; | 228 | IORESOURCE_ROM_BIOS_COPY; |
| 277 | } | 229 | } |
| 278 | } | 230 | } |
| 279 | /* Create a pci_window in the pci_controller struct for | ||
| 280 | * each device resource. | ||
| 281 | */ | ||
| 282 | if (count > 0) | ||
| 283 | sn_pci_window_fixup(dev, count, pci_addrs); | ||
| 284 | 231 | ||
| 285 | sn_pci_fixup_slot(dev, pcidev_info, sn_irq_info); | 232 | sn_pci_fixup_slot(dev, pcidev_info, sn_irq_info); |
| 286 | } | 233 | } |
