Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0fb849b9 authored by Paul Mundt's avatar Paul Mundt
Browse files

sh: Integrate the SH-5 onchip_remap() more coherently.



Presently this is special-cased for early initialization. While there are
situations where these static early initializations are still necessary,
with minor changes it is possible to use this for the regular ioremap
implementation as well. This allows us to kill off the special-casing for
the remap completely and to start tidying up all of the SH-5
special-casing in drivers.

Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent ae318a14
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@ void init_cayman_irq(void)
{
	int i;

	epld_virt = onchip_remap(EPLD_BASE, 1024, "EPLD");
	epld_virt = (unsigned long)ioremap_nocache(EPLD_BASE, 1024);
	if (!epld_virt) {
		printk(KERN_ERR "Cayman IRQ: Unable to remap EPLD\n");
		return;
+1 −1
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ static int __init smsc_superio_setup(void)
{
	unsigned char devid, devrev;

	smsc_superio_virt = onchip_remap(SMSC_SUPERIO_BASE, 1024, "SMSC SuperIO");
	smsc_superio_virt = (unsigned long)ioremap_nocache(SMSC_SUPERIO_BASE, 1024);
	if (!smsc_superio_virt) {
		panic("Unable to remap SMSC SuperIO\n");
	}
+2 −2
Original line number Diff line number Diff line
@@ -119,12 +119,12 @@ static int __init sh5pci_init(void)
                return -EINVAL;
        }

	pcicr_virt = onchip_remap(SH5PCI_ICR_BASE, 1024, "PCICR");
	pcicr_virt = (unsigned long)ioremap_nocache(SH5PCI_ICR_BASE, 1024);
	if (!pcicr_virt) {
		panic("Unable to remap PCICR\n");
	}

	PCI_IO_AREA = onchip_remap(SH5PCI_IO_BASE, 0x10000, "PCIIO");
	PCI_IO_AREA = (unsigned long)ioremap_nocache(SH5PCI_IO_BASE, 0x10000);
	if (!PCI_IO_AREA) {
		panic("Unable to remap PCIIO\n");
	}
+0 −7
Original line number Diff line number Diff line
@@ -224,11 +224,6 @@ void __iomem *__ioremap(unsigned long offset, unsigned long size,
			unsigned long flags);
void __iounmap(void __iomem *addr);

/* arch/sh/mm/ioremap_64.c */
unsigned long onchip_remap(unsigned long addr, unsigned long size,
			   const char *name);
extern void onchip_unmap(unsigned long vaddr);

static inline void __iomem *
__ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags)
{
@@ -263,8 +258,6 @@ __ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags)
	return __ioremap(offset, size, flags);
}
#else
#define onchip_remap(addr, size, name)		(addr)
#define onchip_unmap(addr)			do { } while (0)
#define __ioremap_mode(offset, size, flags)	((void __iomem *)(offset))
#define __iounmap(addr)				do { } while (0)
#endif /* CONFIG_MMU */
+1 −1
Original line number Diff line number Diff line
@@ -188,7 +188,7 @@ void __init plat_irq_setup(void)
	unsigned long reg;
	int i;

	intc_virt = onchip_remap(INTC_BASE, 1024, "INTC");
	intc_virt = (unsigned long)ioremap_nocache(INTC_BASE, 1024);
	if (!intc_virt) {
		panic("Unable to remap INTC\n");
	}
Loading