summaryrefslogtreecommitdiff
path: root/include/asm-generic
diff options
context:
space:
mode:
authorRussell King <rmk@flint.arm.linux.org.uk>2003-03-16 21:56:53 +0000
committerRussell King <rmk@flint.arm.linux.org.uk>2003-03-16 21:56:53 +0000
commit2ef9c88bfaee6fbd7f9d5da32f9b93794be49185 (patch)
treec09ef1129d46914b80fbbdc6e49703ad3e13b5ab /include/asm-generic
parent032d6c6ef2b24013633f987cdf2d8fb88eadc202 (diff)
[PCI] pci-8: pci_resource_to_bus()
Convert pcibios_fixup_pbus_ranges() into something more generic, namely pcibios_resource_to_bus() - we are really trying to convert resources to something to program into bus registers for bridge windows, and in fact, PCI device BARs. This is necessary since some architectures, namely Alpha, ARM and PARISC have an offset between PCI addressing and host-based addressing, so resources need to be adjusted when read or when written back to the bus. We provide a generic version in asm-generic/pci.h, which most architectures use. This patch finds the following architectures with something to think consider: - ppc, ppc64 adjusts resources for devices, but not buses. This is inconsistent, and leads to improperly programmed windows/BARs. PPC people (Anton) has a replacement PCI resource implementation which should do the right thing.
Diffstat (limited to 'include/asm-generic')
-rw-r--r--include/asm-generic/pci.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/asm-generic/pci.h b/include/asm-generic/pci.h
new file mode 100644
index 000000000000..df757d240e9a
--- /dev/null
+++ b/include/asm-generic/pci.h
@@ -0,0 +1,25 @@
+/*
+ * linux/include/asm-generic/pci.h
+ *
+ * Copyright (C) 2003 Russell King
+ */
+#ifndef _ASM_GENERIC_PCI_H
+#define _ASM_GENERIC_PCI_H
+
+/**
+ * pcibios_resource_to_bus - convert resource to PCI bus address
+ * @dev: device which owns this resource
+ * @region: converted bus-centric region (start,end)
+ * @res: resource to convert
+ *
+ * Convert a resource to a PCI device bus address or bus window.
+ */
+static inline void
+pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
+ struct resource *res)
+{
+ region->start = res->start;
+ region->end = res->end;
+}
+
+#endif