pci: Avoid assigning PCI resources that are below 0x1000
[oweals/u-boot.git] / drivers / pci / pci_auto_common.c
index 183787333e9a83e73e94c98baaa976e60685b97f..84908e6154c568a3382381aeda2baeaa3ebef01e 100644 (file)
@@ -21,9 +21,10 @@ void pciauto_region_init(struct pci_region *res)
        /*
         * 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.
+        * drivers to fail. Use a reasonable starting value of 0x1000 instead
+        * if the bus start address is below 0x1000.
         */
-       res->bus_lower = res->bus_start ? res->bus_start : 0x1000;
+       res->bus_lower = res->bus_start < 0x1000 ? 0x1000 : res->bus_start;
 }
 
 void pciauto_region_align(struct pci_region *res, pci_size_t size)