]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/pci_auto.c
Merge with /home/stefan/git/u-boot/bamboo-nand
[karo-tx-uboot.git] / drivers / pci_auto.c
index 15f74328f0a6a011c58cd425c56cb3a561dd1c98..f170c2db89e066420771a5fbb813385905c9baf2 100644 (file)
 
 void pciauto_region_init(struct pci_region* res)
 {
-       res->bus_lower = res->bus_start;
+       /*
+        * Avoid allocating PCI resources from address 0 -- this is illegal
+        * according to PCI 2.1 and moreover, this is known to cause Linux IDE
+        * drivers to fail. Use a reasonable starting value of 0x1000 instead.
+        */
+       res->bus_lower = res->bus_start ? res->bus_start : 0x1000;
 }
 
 void pciauto_region_align(struct pci_region *res, unsigned long size)
@@ -102,7 +107,8 @@ void pciauto_setup_device(struct pci_controller *hose,
 
                /* Check the BAR type and set our address mask */
                if (bar_response & PCI_BASE_ADDRESS_SPACE) {
-                       bar_size = ~(bar_response & PCI_BASE_ADDRESS_IO_MASK) + 1;
+                       bar_size = ((~(bar_response & PCI_BASE_ADDRESS_IO_MASK))
+                                  & 0xffff) + 1;
                        bar_res = io;
 
                        DEBUGF("PCI Autoconfig: BAR %d, I/O, size=0x%x, ", bar_nr, bar_size);
@@ -186,7 +192,7 @@ static void pciauto_prescan_setup_bridge(struct pci_controller *hose,
        } else {
                /* We don't support prefetchable memory for now, so disable */
                pci_hose_write_config_word(hose, dev, PCI_PREF_MEMORY_BASE, 0x1000);
-               pci_hose_write_config_word(hose, dev, PCI_PREF_MEMORY_LIMIT, 0x1000);
+               pci_hose_write_config_word(hose, dev, PCI_PREF_MEMORY_LIMIT, 0x0);
        }
 
        if (pci_io) {