patch-2.3.23 linux/arch/arm/kernel/bios32.c
Next file: linux/arch/arm/kernel/debug-armo.S
Previous file: linux/arch/arm/kernel/armksyms.c
Back to the patch index
Back to the overall index
- Lines: 47
- Date:
Wed Oct 20 16:29:08 1999
- Orig file:
v2.3.22/linux/arch/arm/kernel/bios32.c
- Orig date:
Tue Sep 7 12:14:06 1999
diff -u --recursive --new-file v2.3.22/linux/arch/arm/kernel/bios32.c linux/arch/arm/kernel/bios32.c
@@ -7,6 +7,7 @@
*/
#include <linux/kernel.h>
#include <linux/pci.h>
+#include <linux/errno.h>
#include <linux/init.h>
#include <asm/irq.h>
@@ -71,6 +72,38 @@
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_83C553, pci_fixup_83c553 },
{ 0 }
};
+
+/*
+ * Assign new address to PCI resource. We hope our resource information
+ * is complete. On the PC, we don't re-assign resources unless we are
+ * forced to do so.
+ *
+ * Expects start=0, end=size-1, flags=resource type.
+ */
+
+int __init pcibios_assign_resource(struct pci_dev *dev, int i)
+{
+ struct resource *r = &dev->resource[i];
+ struct resource *pr = pci_find_parent_resource(dev, r);
+ unsigned long size = r->end + 1;
+ unsigned long flags = 0;
+
+ if (!pr)
+ return -EINVAL;
+ if (r->flags & IORESOURCE_IO) {
+ if (size > 0x100)
+ return -EFBIG;
+ if (allocate_resource(pr, r, size, 0x9000, ~0, 1024))
+ return -EBUSY;
+ flags = PCI_BASE_ADDRESS_SPACE_IO;
+ } else {
+ if (allocate_resource(pr, r, size, 0x00100000, 0x7fffffff, size))
+ return -EBUSY;
+ }
+ if (i < 6)
+ pci_write_config_dword(dev, PCI_BASE_ADDRESS_0 + 4*i, r->start | flags);
+ return 0;
+}
/*
* Assign an address to an I/O range.
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)