aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/probe.c11
-rw-r--r--drivers/pci/setup-res.c19
-rw-r--r--include/linux/ioport.h3
3 files changed, 27 insertions, 6 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 6a3c1e728900..1ae9c3f50ffa 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -649,6 +649,9 @@ static void pci_read_irq(struct pci_dev *dev)
649 * Returns 0 on success and -1 if unknown type of device (not normal, bridge 649 * Returns 0 on success and -1 if unknown type of device (not normal, bridge
650 * or CardBus). 650 * or CardBus).
651 */ 651 */
652
653#define LEGACY_IO_RESOURCE (IORESOURCE_IO | IORESOURCE_PCI_FIXED)
654
652static int pci_setup_device(struct pci_dev * dev) 655static int pci_setup_device(struct pci_dev * dev)
653{ 656{
654 u32 class; 657 u32 class;
@@ -692,18 +695,18 @@ static int pci_setup_device(struct pci_dev * dev)
692 if ((progif & 1) == 0) { 695 if ((progif & 1) == 0) {
693 dev->resource[0].start = 0x1F0; 696 dev->resource[0].start = 0x1F0;
694 dev->resource[0].end = 0x1F7; 697 dev->resource[0].end = 0x1F7;
695 dev->resource[0].flags = IORESOURCE_IO; 698 dev->resource[0].flags = LEGACY_IO_RESOURCE;
696 dev->resource[1].start = 0x3F6; 699 dev->resource[1].start = 0x3F6;
697 dev->resource[1].end = 0x3F6; 700 dev->resource[1].end = 0x3F6;
698 dev->resource[1].flags = IORESOURCE_IO; 701 dev->resource[1].flags = LEGACY_IO_RESOURCE;
699 } 702 }
700 if ((progif & 4) == 0) { 703 if ((progif & 4) == 0) {
701 dev->resource[2].start = 0x170; 704 dev->resource[2].start = 0x170;
702 dev->resource[2].end = 0x177; 705 dev->resource[2].end = 0x177;
703 dev->resource[2].flags = IORESOURCE_IO; 706 dev->resource[2].flags = LEGACY_IO_RESOURCE;
704 dev->resource[3].start = 0x376; 707 dev->resource[3].start = 0x376;
705 dev->resource[3].end = 0x376; 708 dev->resource[3].end = 0x376;
706 dev->resource[3].flags = IORESOURCE_IO; 709 dev->resource[3].flags = LEGACY_IO_RESOURCE;
707 } 710 }
708 } 711 }
709 break; 712 break;
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index ab78e4bbdd83..cb4ced3560e9 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -33,11 +33,22 @@ pci_update_resource(struct pci_dev *dev, struct resource *res, int resno)
33 u32 new, check, mask; 33 u32 new, check, mask;
34 int reg; 34 int reg;
35 35
36 /* Ignore resources for unimplemented BARs and unused resource slots 36 /*
37 for 64 bit BARs. */ 37 * Ignore resources for unimplemented BARs and unused resource slots
38 * for 64 bit BARs.
39 */
38 if (!res->flags) 40 if (!res->flags)
39 return; 41 return;
40 42
43 /*
44 * Ignore non-moveable resources. This might be legacy resources for
45 * which no functional BAR register exists or another important
46 * system resource we should better not move around in system address
47 * space.
48 */
49 if (res->flags & IORESOURCE_PCI_FIXED)
50 return;
51
41 pcibios_resource_to_bus(dev, &region, res); 52 pcibios_resource_to_bus(dev, &region, res);
42 53
43 pr_debug(" got res [%llx:%llx] bus [%lx:%lx] flags %lx for " 54 pr_debug(" got res [%llx:%llx] bus [%lx:%lx] flags %lx for "
@@ -212,6 +223,10 @@ pdev_sort_resources(struct pci_dev *dev, struct resource_list *head)
212 resource_size_t r_align; 223 resource_size_t r_align;
213 224
214 r = &dev->resource[i]; 225 r = &dev->resource[i];
226
227 if (r->flags & IORESOURCE_PCI_FIXED)
228 continue;
229
215 r_align = r->end - r->start; 230 r_align = r->end - r->start;
216 231
217 if (!(r->flags) || r->parent) 232 if (!(r->flags) || r->parent)
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index cf8696d4a138..15228d79c5bc 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -91,6 +91,9 @@ struct resource_list {
91#define IORESOURCE_ROM_COPY (1<<2) /* ROM is alloc'd copy, resource field overlaid */ 91#define IORESOURCE_ROM_COPY (1<<2) /* ROM is alloc'd copy, resource field overlaid */
92#define IORESOURCE_ROM_BIOS_COPY (1<<3) /* ROM is BIOS copy, resource field overlaid */ 92#define IORESOURCE_ROM_BIOS_COPY (1<<3) /* ROM is BIOS copy, resource field overlaid */
93 93
94/* PCI control bits. Shares IORESOURCE_BITS with above PCI ROM. */
95#define IORESOURCE_PCI_FIXED (1<<4) /* Do not move resource */
96
94/* PC/ISA/whatever - the normal PC address spaces: IO and memory */ 97/* PC/ISA/whatever - the normal PC address spaces: IO and memory */
95extern struct resource ioport_resource; 98extern struct resource ioport_resource;
96extern struct resource iomem_resource; 99extern struct resource iomem_resource;