diff options
Diffstat (limited to 'arch/arm/mach-ixp4xx/common.c')
-rw-r--r-- | arch/arm/mach-ixp4xx/common.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c index a6329a0a8ec4..c60e7b86192c 100644 --- a/arch/arm/mach-ixp4xx/common.c +++ b/arch/arm/mach-ixp4xx/common.c | |||
@@ -31,6 +31,7 @@ | |||
31 | 31 | ||
32 | #include <mach/udc.h> | 32 | #include <mach/udc.h> |
33 | #include <mach/hardware.h> | 33 | #include <mach/hardware.h> |
34 | #include <mach/io.h> | ||
34 | #include <asm/uaccess.h> | 35 | #include <asm/uaccess.h> |
35 | #include <asm/pgtable.h> | 36 | #include <asm/pgtable.h> |
36 | #include <asm/page.h> | 37 | #include <asm/page.h> |
@@ -517,3 +518,35 @@ void ixp4xx_restart(char mode, const char *cmd) | |||
517 | *IXP4XX_OSWE = IXP4XX_WDT_RESET_ENABLE | IXP4XX_WDT_COUNT_ENABLE; | 518 | *IXP4XX_OSWE = IXP4XX_WDT_RESET_ENABLE | IXP4XX_WDT_COUNT_ENABLE; |
518 | } | 519 | } |
519 | } | 520 | } |
521 | |||
522 | #ifdef CONFIG_IXP4XX_INDIRECT_PCI | ||
523 | /* | ||
524 | * In the case of using indirect PCI, we simply return the actual PCI | ||
525 | * address and our read/write implementation use that to drive the | ||
526 | * access registers. If something outside of PCI is ioremap'd, we | ||
527 | * fallback to the default. | ||
528 | */ | ||
529 | |||
530 | static void __iomem *ixp4xx_ioremap_caller(unsigned long addr, size_t size, | ||
531 | unsigned int mtype, void *caller) | ||
532 | { | ||
533 | if (!is_pci_memory(addr)) | ||
534 | return __arm_ioremap_caller(addr, size, mtype, caller); | ||
535 | |||
536 | return (void __iomem *)addr; | ||
537 | } | ||
538 | |||
539 | static void ixp4xx_iounmap(void __iomem *addr) | ||
540 | { | ||
541 | if (!is_pci_memory((__force u32)addr)) | ||
542 | __iounmap(addr); | ||
543 | } | ||
544 | |||
545 | void __init ixp4xx_init_early(void) | ||
546 | { | ||
547 | arch_ioremap_caller = ixp4xx_ioremap_caller; | ||
548 | arch_iounmap = ixp4xx_iounmap; | ||
549 | } | ||
550 | #else | ||
551 | void __init ixp4xx_init_early(void) {} | ||
552 | #endif | ||