aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc/kernel/pci.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-01-09 13:03:44 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-09 13:03:44 -0500
commit6150c32589d1976ca8a5c987df951088c05a7542 (patch)
tree94073696576323ff966e365d8c47b8ecd8372f97 /arch/ppc/kernel/pci.c
parent44637a12f80b80157d9c1bc5b7d6ef09c9e05713 (diff)
parentbe42d5fa3772241b8ecebd443f1fb36247959c54 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc-merge
Diffstat (limited to 'arch/ppc/kernel/pci.c')
-rw-r--r--arch/ppc/kernel/pci.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c
index f7fae5f153b2..50c75eec8874 100644
--- a/arch/ppc/kernel/pci.c
+++ b/arch/ppc/kernel/pci.c
@@ -815,8 +815,7 @@ EXPORT_SYMBOL(pci_device_to_OF_node);
815 * to set pci_assign_all_buses to 1 and still use RTAS for PCI 815 * to set pci_assign_all_buses to 1 and still use RTAS for PCI
816 * config cycles. 816 * config cycles.
817 */ 817 */
818struct pci_controller* 818struct pci_controller* pci_find_hose_for_OF_device(struct device_node* node)
819pci_find_hose_for_OF_device(struct device_node* node)
820{ 819{
821 if (!have_of) 820 if (!have_of)
822 return NULL; 821 return NULL;
@@ -942,7 +941,7 @@ pci_process_bridge_OF_ranges(struct pci_controller *hose,
942 while (ranges && (rlen -= np * sizeof(unsigned int)) >= 0) { 941 while (ranges && (rlen -= np * sizeof(unsigned int)) >= 0) {
943 res = NULL; 942 res = NULL;
944 size = ranges[na+4]; 943 size = ranges[na+4];
945 switch (ranges[0] >> 24) { 944 switch ((ranges[0] >> 24) & 0x3) {
946 case 1: /* I/O space */ 945 case 1: /* I/O space */
947 if (ranges[2] != 0) 946 if (ranges[2] != 0)
948 break; 947 break;
@@ -956,6 +955,8 @@ pci_process_bridge_OF_ranges(struct pci_controller *hose,
956 res = &hose->io_resource; 955 res = &hose->io_resource;
957 res->flags = IORESOURCE_IO; 956 res->flags = IORESOURCE_IO;
958 res->start = ranges[2]; 957 res->start = ranges[2];
958 DBG("PCI: IO 0x%lx -> 0x%lx\n",
959 res->start, res->start + size - 1);
959 break; 960 break;
960 case 2: /* memory space */ 961 case 2: /* memory space */
961 memno = 0; 962 memno = 0;
@@ -973,7 +974,11 @@ pci_process_bridge_OF_ranges(struct pci_controller *hose,
973 if (memno < 3) { 974 if (memno < 3) {
974 res = &hose->mem_resources[memno]; 975 res = &hose->mem_resources[memno];
975 res->flags = IORESOURCE_MEM; 976 res->flags = IORESOURCE_MEM;
977 if(ranges[0] & 0x40000000)
978 res->flags |= IORESOURCE_PREFETCH;
976 res->start = ranges[na+2]; 979 res->start = ranges[na+2];
980 DBG("PCI: MEM[%d] 0x%lx -> 0x%lx\n", memno,
981 res->start, res->start + size - 1);
977 } 982 }
978 break; 983 break;
979 } 984 }
@@ -1806,6 +1811,23 @@ void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
1806EXPORT_SYMBOL(pci_iomap); 1811EXPORT_SYMBOL(pci_iomap);
1807EXPORT_SYMBOL(pci_iounmap); 1812EXPORT_SYMBOL(pci_iounmap);
1808 1813
1814unsigned long pci_address_to_pio(phys_addr_t address)
1815{
1816 struct pci_controller* hose = hose_head;
1817
1818 for (; hose; hose = hose->next) {
1819 unsigned int size = hose->io_resource.end -
1820 hose->io_resource.start + 1;
1821 if (address >= hose->io_base_phys &&
1822 address < (hose->io_base_phys + size)) {
1823 unsigned long base =
1824 (unsigned long)hose->io_base_virt - _IO_BASE;
1825 return base + (address - hose->io_base_phys);
1826 }
1827 }
1828 return (unsigned int)-1;
1829}
1830EXPORT_SYMBOL(pci_address_to_pio);
1809 1831
1810/* 1832/*
1811 * Null PCI config access functions, for the case when we can't 1833 * Null PCI config access functions, for the case when we can't