Index: linux-2.6.27.y/drivers/pci/bus.c =================================================================== --- linux-2.6.27.y.orig/drivers/pci/bus.c +++ linux-2.6.27.y/drivers/pci/bus.c @@ -41,6 +41,7 @@ pci_bus_alloc_resource(struct pci_bus *b void *alignf_data) { int i, ret = -ENOMEM; + resource_size_t max = -1; type_mask |= IORESOURCE_IO | IORESOURCE_MEM; @@ -59,10 +60,15 @@ pci_bus_alloc_resource(struct pci_bus *b !(res->flags & IORESOURCE_PREFETCH)) continue; + /* Limit address to 32 bits when requested */ + if ((res->flags & IORESOURCE_MEM) && + (res->flags & IORESOURCE_PCI_32BIT)) + max = (u32) -1; + /* Ok, try it out.. */ ret = allocate_resource(r, res, size, r->start ? : min, - -1, align, + max, align, alignf, alignf_data); if (ret == 0) break; Index: linux-2.6.27.y/drivers/pci/setup-bus.c =================================================================== --- linux-2.6.27.y.orig/drivers/pci/setup-bus.c +++ linux-2.6.27.y/drivers/pci/setup-bus.c @@ -433,19 +433,23 @@ static void pci_bus_size_cardbus(struct * If we have prefetchable memory support, allocate * two regions. Otherwise, allocate one region of * twice the size. + * Avoid 64bit address space, as cardbus devices can't handle it. */ if (ctrl & PCI_CB_BRIDGE_CTL_PREFETCH_MEM0) { b_res[2].start = 0; b_res[2].end = pci_cardbus_mem_size - 1; - b_res[2].flags |= IORESOURCE_MEM | IORESOURCE_PREFETCH | IORESOURCE_SIZEALIGN; + b_res[2].flags |= IORESOURCE_MEM | IORESOURCE_PREFETCH | + IORESOURCE_SIZEALIGN | IORESOURCE_PCI_32BIT; b_res[3].start = 0; b_res[3].end = pci_cardbus_mem_size - 1; - b_res[3].flags |= IORESOURCE_MEM | IORESOURCE_SIZEALIGN; + b_res[3].flags |= IORESOURCE_MEM | IORESOURCE_SIZEALIGN | + IORESOURCE_PCI_32BIT; } else { b_res[3].start = 0; b_res[3].end = pci_cardbus_mem_size * 2 - 1; - b_res[3].flags |= IORESOURCE_MEM | IORESOURCE_SIZEALIGN; + b_res[3].flags |= IORESOURCE_MEM | IORESOURCE_SIZEALIGN | + IORESOURCE_PCI_32BIT; } } Index: linux-2.6.27.y/include/linux/ioport.h =================================================================== --- linux-2.6.27.y.orig/include/linux/ioport.h +++ linux-2.6.27.y/include/linux/ioport.h @@ -101,6 +101,7 @@ struct resource_list { /* PCI control bits. Shares IORESOURCE_BITS with above PCI ROM. */ #define IORESOURCE_PCI_FIXED (1<<4) /* Do not move resource */ +#define IORESOURCE_PCI_32BIT (1<<5) /* Do not use 64bit address space (for cardbus devices) */ /* PC/ISA/whatever - the normal PC address spaces: IO and memory */ extern struct resource ioport_resource;