Merge branch 'linus' into x86/i8259
[sfrench/cifs-2.6.git] / arch / alpha / kernel / pci.c
index c107cc08daf47f130136fcb3dda342dac0926cdc..5cf45fc5134315bdc930d1a36dad08e4dc4c6dac 100644 (file)
@@ -73,14 +73,19 @@ quirk_cypress(struct pci_dev *dev)
 {
        /* The Notorious Cy82C693 chip.  */
 
-       /* The Cypress IDE controller doesn't support native mode, but it
-          has programmable addresses of IDE command/control registers.
-          This violates PCI specifications, confuses the IDE subsystem and
-          causes resource conflicts between the primary HD_CMD register and
-          the floppy controller.  Ugh.  Fix that.  */
+       /* The generic legacy mode IDE fixup in drivers/pci/probe.c
+          doesn't work correctly with the Cypress IDE controller as
+          it has non-standard register layout.  Fix that.  */
        if (dev->class >> 8 == PCI_CLASS_STORAGE_IDE) {
-               dev->resource[0].flags = 0;
-               dev->resource[1].flags = 0;
+               dev->resource[2].start = dev->resource[3].start = 0;
+               dev->resource[2].end = dev->resource[3].end = 0;
+               dev->resource[2].flags = dev->resource[3].flags = 0;
+               if (PCI_FUNC(dev->devfn) == 2) {
+                       dev->resource[0].start = 0x170;
+                       dev->resource[0].end = 0x177;
+                       dev->resource[1].start = 0x376;
+                       dev->resource[1].end = 0x376;
+               }
        }
 
        /* The Cypress bridge responds on the PCI bus in the address range
@@ -89,7 +94,7 @@ quirk_cypress(struct pci_dev *dev)
           BIOS ranges (disabled after power-up), and some consoles do turn
           them on.  So if we use a large direct-map window, or a large SG
           window, we must avoid the entire 0xfff00000-0xffffffff region.  */
-       else if (dev->class >> 8 == PCI_CLASS_BRIDGE_ISA) {
+       if (dev->class >> 8 == PCI_CLASS_BRIDGE_ISA) {
                if (__direct_map_base + __direct_map_size >= 0xfff00000UL)
                        __direct_map_size = 0xfff00000UL - __direct_map_base;
                else {
@@ -220,7 +225,7 @@ pdev_save_srm_config(struct pci_dev *dev)
 
        tmp = kmalloc(sizeof(*tmp), GFP_KERNEL);
        if (!tmp) {
-               printk(KERN_ERR "%s: kmalloc() failed!\n", __FUNCTION__);
+               printk(KERN_ERR "%s: kmalloc() failed!\n", __func__);
                return;
        }
        tmp->next = srm_saved_configs;
@@ -391,7 +396,7 @@ pcibios_set_master(struct pci_dev *dev)
        pci_write_config_byte(dev, PCI_LATENCY_TIMER, 64);
 }
 
-static void __init
+void __init
 pcibios_claim_one_bus(struct pci_bus *b)
 {
        struct pci_dev *dev;
@@ -405,7 +410,8 @@ pcibios_claim_one_bus(struct pci_bus *b)
 
                        if (r->parent || !r->start || !r->flags)
                                continue;
-                       pci_claim_resource(dev, i);
+                       if (pci_probe_only || (r->flags & IORESOURCE_PCI_FIXED))
+                               pci_claim_resource(dev, i);
                }
        }
 
@@ -444,8 +450,7 @@ common_init_pci(void)
                }
        }
 
-       if (pci_probe_only)
-               pcibios_claim_console_setup();
+       pcibios_claim_console_setup();
 
        pci_assign_unassigned_resources();
        pci_fixup_irqs(alpha_mv.pci_swizzle, alpha_mv.pci_map_irq);
@@ -526,8 +531,8 @@ sys_pciconfig_iobase(long which, unsigned long bus, unsigned long dfn)
 
 void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
 {
-       unsigned long start = pci_resource_start(dev, bar);
-       unsigned long len = pci_resource_len(dev, bar);
+       resource_size_t start = pci_resource_start(dev, bar);
+       resource_size_t len = pci_resource_len(dev, bar);
        unsigned long flags = pci_resource_flags(dev, bar);
 
        if (!len || !start)