patch-2.4.0-test12 linux/arch/arm/kernel/bios32.c

Next file: linux/arch/arm/kernel/dec21285.c
Previous file: linux/arch/arm/def-configs/thinclient
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test11/linux/arch/arm/kernel/bios32.c linux/arch/arm/kernel/bios32.c
@@ -451,7 +451,6 @@
 	 */
 	pci_assign_unassigned_resources();
 	pci_fixup_irqs(hw_pci->swizzle, hw_pci->map_irq);
-	pci_set_bus_ranges();
 }
 
 char * __init pcibios_setup(char *str)
@@ -463,8 +462,29 @@
 	return str;
 }
 
+/*
+ * From arch/i386/kernel/pci-i386.c:
+ *
+ * We need to avoid collisions with `mirrored' VGA ports
+ * and other strange ISA hardware, so we always want the
+ * addresses to be allocated in the 0x000-0x0ff region
+ * modulo 0x400.
+ *
+ * Why? Because some silly external IO cards only decode
+ * the low 10 bits of the IO address. The 0x00-0xff region
+ * is reserved for motherboard devices that decode all 16
+ * bits, so it's ok to allocate at, say, 0x2800-0x28ff,
+ * but we want to try to avoid allocating at 0x2900-0x2bff
+ * which might have be mirrored at 0x0100-0x03ff..
+ */
 void pcibios_align_resource(void *data, struct resource *res, unsigned long size)
 {
+	if (res->flags & IORESOURCE_IO) {
+		unsigned long start = res->start;
+
+		if (start & 0x300)
+			res->start = (start + 0x3ff) & ~0x3ff;
+	}
 }
 
 /**

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)