a57140e9a8
Converted bridge code to a platform driver using the PCI generic driver framework and use adding platform devices during xtalk scan. This allows easier sharing bridge driver for other SGI platforms like IP30 (Octane) and IP35 (Origin 3k, Fuel, Tezro). Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de> [paul.burton@mips.com: - Leave __phys_to_dma(), __dma_to_phys() & pcibus_to_node() in arch/mips/pci/pci-ip27.c since the motivation for moving them disappeared when the driver stopped being moved to drivers/pci.] Signed-off-by: Paul Burton <paul.burton@mips.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: James Hogan <jhogan@kernel.org> Cc: linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org
34 lines
886 B
C
34 lines
886 B
C
/*
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
* License. See the file "COPYING" in the main directory of this archive
|
|
* for more details.
|
|
*
|
|
* Copyright (C) 2003 Christoph Hellwig (hch@lst.de)
|
|
* Copyright (C) 1999, 2000, 04 Ralf Baechle (ralf@linux-mips.org)
|
|
* Copyright (C) 1999, 2000 Silicon Graphics, Inc.
|
|
*/
|
|
#include <asm/pci/bridge.h>
|
|
|
|
dma_addr_t __phys_to_dma(struct device *dev, phys_addr_t paddr)
|
|
{
|
|
struct pci_dev *pdev = to_pci_dev(dev);
|
|
struct bridge_controller *bc = BRIDGE_CONTROLLER(pdev->bus);
|
|
|
|
return bc->baddr + paddr;
|
|
}
|
|
|
|
phys_addr_t __dma_to_phys(struct device *dev, dma_addr_t dma_addr)
|
|
{
|
|
return dma_addr & ~(0xffUL << 56);
|
|
}
|
|
|
|
#ifdef CONFIG_NUMA
|
|
int pcibus_to_node(struct pci_bus *bus)
|
|
{
|
|
struct bridge_controller *bc = BRIDGE_CONTROLLER(bus);
|
|
|
|
return bc->nasid;
|
|
}
|
|
EXPORT_SYMBOL(pcibus_to_node);
|
|
#endif /* CONFIG_NUMA */
|