aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-picoxcell/io.c
diff options
context:
space:
mode:
authorJamie Iles <jamie@jamieiles.com>2011-07-25 12:36:42 -0400
committerJamie Iles <jamie@jamieiles.com>2011-09-26 11:11:56 -0400
commitaf75655c066621352c419646ec0775e9523dc720 (patch)
treeae3895ab4f9d8ce7823f4ef4dcbdbb8f838f3073 /arch/arm/mach-picoxcell/io.c
parentc6a389f123b9f68d605bb7e0f9b32ec1e3e14132 (diff)
picoxcell: support for Picochip picoxcell devices
picoXcell is a family of femtocell devices with an ARM application processor and picoArray DSP processor array. This patch adds support for picoXcell boards to be booted using the device tree registering the VIC's, UART's and timers. v3: - fixup vic compatible string in binding v2: - cleanup empty mach headers - convert to of_platform_populate() - simplify uncompress.h - split vic node into 2 devices - add missing __initconst attributes Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Diffstat (limited to 'arch/arm/mach-picoxcell/io.c')
-rw-r--r--arch/arm/mach-picoxcell/io.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/arch/arm/mach-picoxcell/io.c b/arch/arm/mach-picoxcell/io.c
new file mode 100644
index 000000000000..935a2fae62e6
--- /dev/null
+++ b/arch/arm/mach-picoxcell/io.c
@@ -0,0 +1,56 @@
1/*
2 * Copyright (c) 2011 Picochip Ltd., Jamie Iles
3 *
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.
7 *
8 * All enquiries to support@picochip.com
9 */
10#include <linux/io.h>
11#include <linux/mm.h>
12#include <linux/module.h>
13#include <linux/of.h>
14
15#include <asm/mach/map.h>
16
17#include <mach/map.h>
18#include <mach/picoxcell_soc.h>
19
20#include "common.h"
21
22void __init picoxcell_map_io(void)
23{
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,
28 .type = MT_DEVICE,
29 };
30
31 iotable_init(&io_map, 1);
32}
33
34void __iomem *picoxcell_ioremap(unsigned long p, size_t size,
35 unsigned int type)
36{
37 if (unlikely(size == 0))
38 return NULL;
39
40 if (p >= PICOXCELL_PERIPH_BASE &&
41 p < PICOXCELL_PERIPH_BASE + PICOXCELL_PERIPH_LENGTH)
42 return IO_ADDRESS(p);
43
44 return __arm_ioremap_caller(p, size, type,
45 __builtin_return_address(0));
46}
47EXPORT_SYMBOL_GPL(picoxcell_ioremap);
48
49void picoxcell_iounmap(volatile void __iomem *addr)
50{
51 unsigned long virt = (unsigned long)addr;
52
53 if (virt >= VMALLOC_START && virt < VMALLOC_END)
54 __iounmap(addr);
55}
56EXPORT_SYMBOL_GPL(picoxcell_iounmap);