Merge git://git.infradead.org/iommu-2.6
[pandora-kernel.git] / arch / arm / mach-mxc91231 / mm.c
1 /*
2  *  Copyright (C) 1999,2000 Arm Limited
3  *  Copyright (C) 2000 Deep Blue Solutions Ltd
4  *  Copyright (C) 2002 Shane Nay (shane@minirl.com)
5  *  Copyright 2004-2005 Freescale Semiconductor, Inc. All Rights Reserved.
6  *    - add MXC specific definitions
7  *  Copyright 2006 Motorola, Inc.
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  */
19
20 #include <linux/mm.h>
21 #include <linux/init.h>
22 #include <mach/hardware.h>
23 #include <mach/common.h>
24 #include <asm/pgtable.h>
25 #include <asm/mach/map.h>
26
27 /*
28  * This structure defines the MXC memory map.
29  */
30 static struct map_desc mxc_io_desc[] __initdata = {
31         {
32                 .virtual        = MXC91231_L2CC_BASE_ADDR_VIRT,
33                 .pfn            = __phys_to_pfn(MXC91231_L2CC_BASE_ADDR),
34                 .length         = MXC91231_L2CC_SIZE,
35                 .type           = MT_DEVICE,
36         }, {
37                 .virtual        = MXC91231_X_MEMC_BASE_ADDR_VIRT,
38                 .pfn            = __phys_to_pfn(MXC91231_X_MEMC_BASE_ADDR),
39                 .length         = MXC91231_X_MEMC_SIZE,
40                 .type           = MT_DEVICE,
41         }, {
42                 .virtual        = MXC91231_ROMP_BASE_ADDR_VIRT,
43                 .pfn            = __phys_to_pfn(MXC91231_ROMP_BASE_ADDR),
44                 .length         = MXC91231_ROMP_SIZE,
45                 .type           = MT_DEVICE,
46         }, {
47                 .virtual        = MXC91231_AVIC_BASE_ADDR_VIRT,
48                 .pfn            = __phys_to_pfn(MXC91231_AVIC_BASE_ADDR),
49                 .length         = MXC91231_AVIC_SIZE,
50                 .type           = MT_DEVICE,
51         }, {
52                 .virtual        = MXC91231_AIPS1_BASE_ADDR_VIRT,
53                 .pfn            = __phys_to_pfn(MXC91231_AIPS1_BASE_ADDR),
54                 .length         = MXC91231_AIPS1_SIZE,
55                 .type           = MT_DEVICE,
56         }, {
57                 .virtual        = MXC91231_SPBA0_BASE_ADDR_VIRT,
58                 .pfn            = __phys_to_pfn(MXC91231_SPBA0_BASE_ADDR),
59                 .length         = MXC91231_SPBA0_SIZE,
60                 .type           = MT_DEVICE,
61         }, {
62                 .virtual        = MXC91231_SPBA1_BASE_ADDR_VIRT,
63                 .pfn            = __phys_to_pfn(MXC91231_SPBA1_BASE_ADDR),
64                 .length         = MXC91231_SPBA1_SIZE,
65                 .type           = MT_DEVICE,
66         }, {
67                 .virtual        = MXC91231_AIPS2_BASE_ADDR_VIRT,
68                 .pfn            = __phys_to_pfn(MXC91231_AIPS2_BASE_ADDR),
69                 .length         = MXC91231_AIPS2_SIZE,
70                 .type           = MT_DEVICE,
71         },
72 };
73
74 /*
75  * This function initializes the memory map. It is called during the
76  * system startup to create static physical to virtual memory map for
77  * the IO modules.
78  */
79 void __init mxc91231_map_io(void)
80 {
81         mxc_set_cpu_type(MXC_CPU_MXC91231);
82
83         iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc));
84 }
85
86 int mxc91231_register_gpios(void);
87
88 void __init mxc91231_init_irq(void)
89 {
90         mxc91231_register_gpios();
91         mxc_init_irq(MXC91231_IO_ADDRESS(MXC91231_AVIC_BASE_ADDR));
92 }