2 * Copyright (c) 2011 Picochip Ltd., Jamie Iles
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
8 * All enquiries to support@picochip.com
12 #include <linux/module.h>
15 #include <asm/mach/map.h>
18 #include <mach/picoxcell_soc.h>
22 void __init picoxcell_map_io(void)
24 struct map_desc io_map = {
25 .virtual = PHYS_TO_IO(PICOXCELL_PERIPH_BASE),
26 .pfn = __phys_to_pfn(PICOXCELL_PERIPH_BASE),
27 .length = PICOXCELL_PERIPH_LENGTH,
31 iotable_init(&io_map, 1);
34 void __iomem *picoxcell_ioremap(unsigned long p, size_t size,
37 if (unlikely(size == 0))
40 if (p >= PICOXCELL_PERIPH_BASE &&
41 p < PICOXCELL_PERIPH_BASE + PICOXCELL_PERIPH_LENGTH)
44 return __arm_ioremap_caller(p, size, type,
45 __builtin_return_address(0));
47 EXPORT_SYMBOL_GPL(picoxcell_ioremap);
49 void picoxcell_iounmap(volatile void __iomem *addr)
51 unsigned long virt = (unsigned long)addr;
53 if (virt >= VMALLOC_START && virt < VMALLOC_END)
56 EXPORT_SYMBOL_GPL(picoxcell_iounmap);