diff options
Diffstat (limited to 'arch/ia64/pci/pci.c')
-rw-r--r-- | arch/ia64/pci/pci.c | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 7de76dd352fe..df639db779f9 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c | |||
@@ -56,10 +56,13 @@ int raw_pci_read(unsigned int seg, unsigned int bus, unsigned int devfn, | |||
56 | if ((seg | reg) <= 255) { | 56 | if ((seg | reg) <= 255) { |
57 | addr = PCI_SAL_ADDRESS(seg, bus, devfn, reg); | 57 | addr = PCI_SAL_ADDRESS(seg, bus, devfn, reg); |
58 | mode = 0; | 58 | mode = 0; |
59 | } else { | 59 | } else if (sal_revision >= SAL_VERSION_CODE(3,2)) { |
60 | addr = PCI_SAL_EXT_ADDRESS(seg, bus, devfn, reg); | 60 | addr = PCI_SAL_EXT_ADDRESS(seg, bus, devfn, reg); |
61 | mode = 1; | 61 | mode = 1; |
62 | } else { | ||
63 | return -EINVAL; | ||
62 | } | 64 | } |
65 | |||
63 | result = ia64_sal_pci_config_read(addr, mode, len, &data); | 66 | result = ia64_sal_pci_config_read(addr, mode, len, &data); |
64 | if (result != 0) | 67 | if (result != 0) |
65 | return -EINVAL; | 68 | return -EINVAL; |
@@ -80,9 +83,11 @@ int raw_pci_write(unsigned int seg, unsigned int bus, unsigned int devfn, | |||
80 | if ((seg | reg) <= 255) { | 83 | if ((seg | reg) <= 255) { |
81 | addr = PCI_SAL_ADDRESS(seg, bus, devfn, reg); | 84 | addr = PCI_SAL_ADDRESS(seg, bus, devfn, reg); |
82 | mode = 0; | 85 | mode = 0; |
83 | } else { | 86 | } else if (sal_revision >= SAL_VERSION_CODE(3,2)) { |
84 | addr = PCI_SAL_EXT_ADDRESS(seg, bus, devfn, reg); | 87 | addr = PCI_SAL_EXT_ADDRESS(seg, bus, devfn, reg); |
85 | mode = 1; | 88 | mode = 1; |
89 | } else { | ||
90 | return -EINVAL; | ||
86 | } | 91 | } |
87 | result = ia64_sal_pci_config_write(addr, mode, len, value); | 92 | result = ia64_sal_pci_config_write(addr, mode, len, value); |
88 | if (result != 0) | 93 | if (result != 0) |
@@ -126,6 +131,7 @@ alloc_pci_controller (int seg) | |||
126 | } | 131 | } |
127 | 132 | ||
128 | struct pci_root_info { | 133 | struct pci_root_info { |
134 | struct acpi_device *bridge; | ||
129 | struct pci_controller *controller; | 135 | struct pci_controller *controller; |
130 | char *name; | 136 | char *name; |
131 | }; | 137 | }; |
@@ -292,9 +298,20 @@ static __devinit acpi_status add_window(struct acpi_resource *res, void *data) | |||
292 | window->offset = offset; | 298 | window->offset = offset; |
293 | 299 | ||
294 | if (insert_resource(root, &window->resource)) { | 300 | if (insert_resource(root, &window->resource)) { |
295 | printk(KERN_ERR "alloc 0x%llx-0x%llx from %s for %s failed\n", | 301 | dev_err(&info->bridge->dev, |
296 | window->resource.start, window->resource.end, | 302 | "can't allocate host bridge window %pR\n", |
297 | root->name, info->name); | 303 | &window->resource); |
304 | } else { | ||
305 | if (offset) | ||
306 | dev_info(&info->bridge->dev, "host bridge window %pR " | ||
307 | "(PCI address [%#llx-%#llx])\n", | ||
308 | &window->resource, | ||
309 | window->resource.start - offset, | ||
310 | window->resource.end - offset); | ||
311 | else | ||
312 | dev_info(&info->bridge->dev, | ||
313 | "host bridge window %pR\n", | ||
314 | &window->resource); | ||
298 | } | 315 | } |
299 | 316 | ||
300 | return AE_OK; | 317 | return AE_OK; |
@@ -314,8 +331,9 @@ pcibios_setup_root_windows(struct pci_bus *bus, struct pci_controller *ctrl) | |||
314 | (res->end - res->start < 16)) | 331 | (res->end - res->start < 16)) |
315 | continue; | 332 | continue; |
316 | if (j >= PCI_BUS_NUM_RESOURCES) { | 333 | if (j >= PCI_BUS_NUM_RESOURCES) { |
317 | printk("Ignoring range [%#llx-%#llx] (%lx)\n", | 334 | dev_warn(&bus->dev, |
318 | res->start, res->end, res->flags); | 335 | "ignoring host bridge window %pR (no space)\n", |
336 | res); | ||
319 | continue; | 337 | continue; |
320 | } | 338 | } |
321 | bus->resource[j++] = res; | 339 | bus->resource[j++] = res; |
@@ -359,6 +377,7 @@ pci_acpi_scan_root(struct acpi_device *device, int domain, int bus) | |||
359 | goto out3; | 377 | goto out3; |
360 | 378 | ||
361 | sprintf(name, "PCI Bus %04x:%02x", domain, bus); | 379 | sprintf(name, "PCI Bus %04x:%02x", domain, bus); |
380 | info.bridge = device; | ||
362 | info.controller = controller; | 381 | info.controller = controller; |
363 | info.name = name; | 382 | info.name = name; |
364 | acpi_walk_resources(device->handle, METHOD_NAME__CRS, | 383 | acpi_walk_resources(device->handle, METHOD_NAME__CRS, |
@@ -715,9 +734,6 @@ int ia64_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size) | |||
715 | return ret; | 734 | return ret; |
716 | } | 735 | } |
717 | 736 | ||
718 | /* It's defined in drivers/pci/pci.c */ | ||
719 | extern u8 pci_cache_line_size; | ||
720 | |||
721 | /** | 737 | /** |
722 | * set_pci_cacheline_size - determine cacheline size for PCI devices | 738 | * set_pci_cacheline_size - determine cacheline size for PCI devices |
723 | * | 739 | * |
@@ -726,7 +742,7 @@ extern u8 pci_cache_line_size; | |||
726 | * | 742 | * |
727 | * Code mostly taken from arch/ia64/kernel/palinfo.c:cache_info(). | 743 | * Code mostly taken from arch/ia64/kernel/palinfo.c:cache_info(). |
728 | */ | 744 | */ |
729 | static void __init set_pci_cacheline_size(void) | 745 | static void __init set_pci_dfl_cacheline_size(void) |
730 | { | 746 | { |
731 | unsigned long levels, unique_caches; | 747 | unsigned long levels, unique_caches; |
732 | long status; | 748 | long status; |
@@ -746,7 +762,7 @@ static void __init set_pci_cacheline_size(void) | |||
746 | "(status=%ld)\n", __func__, status); | 762 | "(status=%ld)\n", __func__, status); |
747 | return; | 763 | return; |
748 | } | 764 | } |
749 | pci_cache_line_size = (1 << cci.pcci_line_size) / 4; | 765 | pci_dfl_cache_line_size = (1 << cci.pcci_line_size) / 4; |
750 | } | 766 | } |
751 | 767 | ||
752 | u64 ia64_dma_get_required_mask(struct device *dev) | 768 | u64 ia64_dma_get_required_mask(struct device *dev) |
@@ -777,7 +793,7 @@ EXPORT_SYMBOL_GPL(dma_get_required_mask); | |||
777 | 793 | ||
778 | static int __init pcibios_init(void) | 794 | static int __init pcibios_init(void) |
779 | { | 795 | { |
780 | set_pci_cacheline_size(); | 796 | set_pci_dfl_cacheline_size(); |
781 | return 0; | 797 | return 0; |
782 | } | 798 | } |
783 | 799 | ||