From d7cdc9e8ac82c43fdcd4fde6b5b53d2dcba7f707 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Wed, 27 Sep 2006 15:16:42 +0900 Subject: sh: ioremap() overhaul. ioremap() overhaul. Add support for transparent PMB mapping, get rid of p3_ioremap(), etc. Also drop ioremap() and iounmap() routines from the machvec, as everyone can use the generic ioremap() API instead. For PCI memory apertures and other special cases, use the pci_iomap() API, as boards are already required to get the mapping right there. Signed-off-by: Paul Mundt --- arch/sh/drivers/pci/pci.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'arch/sh/drivers/pci') diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c index 1f5e23e8b163..285dffd12bd8 100644 --- a/arch/sh/drivers/pci/pci.c +++ b/arch/sh/drivers/pci/pci.c @@ -2,7 +2,7 @@ * arch/sh/drivers/pci/pci.c * * Copyright (c) 2002 M. R. Brown - * Copyright (c) 2004, 2005 Paul Mundt + * Copyright (c) 2004 - 2006 Paul Mundt * * These functions are collected here to reduce duplication of common * code amongst the many platform-specific PCI support code files. @@ -172,10 +172,23 @@ void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) return NULL; if (maxlen && len > maxlen) len = maxlen; - if (flags & IORESOURCE_IO) + + /* + * Presently the IORESOURCE_MEM case is a bit special, most + * SH7751 style PCI controllers have PCI memory at a fixed + * location in the address space where no remapping is desired + * (traditionally at 0xfd000000). Once this changes, the + * IORESOURCE_MEM case will have to switch to using ioremap() and + * more care will have to be taken to inhibit page table mapping + * for legacy cores. + * + * For now everything wraps to ioport_map(), since boards that + * have PCI will be able to check the address range properly on + * their own. + * -- PFM. + */ + if (flags & (IORESOURCE_IO | IORESOURCE_MEM)) return ioport_map(start, len); - if (flags & IORESOURCE_MEM) - return ioremap(start, len); return NULL; } -- cgit v1.2.3-55-g7522