]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - arch/arm/mach-omap2/io.c
Fix booting for 24xx
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap2 / io.c
1 /*
2  * linux/arch/arm/mach-omap2/io.c
3  *
4  * OMAP2 I/O mapping code
5  *
6  * Copyright (C) 2005 Nokia Corporation
7  * Author: Juha Yrjölä <juha.yrjola@nokia.com>
8  * Updated map desc to add 2430 support : <x0khasim@ti.com>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13  */
14
15 #include <linux/module.h>
16 #include <linux/kernel.h>
17 #include <linux/init.h>
18
19 #include <asm/tlb.h>
20 #include <asm/io.h>
21
22 #include <asm/mach/map.h>
23
24 #include <asm/arch/mux.h>
25 #include <asm/arch/omapfb.h>
26
27 extern void omap_sram_init(void);
28 extern int omap2_clk_init(void);
29 extern void omap2_check_revision(void);
30 extern void omap2_init_memory(void);
31 extern void gpmc_init(void);
32 extern void omapfb_reserve_sdram(void);
33
34 /*
35  * The machine specific code may provide the extra mapping besides the
36  * default mapping provided here.
37  */
38 static struct map_desc omap2_io_desc[] __initdata = {
39         {
40                 .virtual        = L3_24XX_VIRT,
41                 .pfn            = __phys_to_pfn(L3_24XX_PHYS),
42                 .length         = L3_24XX_SIZE,
43                 .type           = MT_DEVICE
44         },
45         {
46                 .virtual        = L4_24XX_VIRT,
47                 .pfn            = __phys_to_pfn(L4_24XX_PHYS),
48                 .length         = L4_24XX_SIZE,
49                 .type           = MT_DEVICE
50         },
51 #ifdef CONFIG_ARCH_OMAP2430
52         {
53                 .virtual        = L4_WK_243X_VIRT,
54                 .pfn            = __phys_to_pfn(L4_WK_243X_PHYS),
55                 .length         = L4_WK_243X_SIZE,
56                 .type           = MT_DEVICE
57         },
58         {
59                 .virtual        = OMAP243X_GPMC_VIRT,
60                 .pfn            = __phys_to_pfn(OMAP243X_GPMC_PHYS),
61                 .length         = OMAP243X_GPMC_SIZE,
62                 .type           = MT_DEVICE
63         },
64         {
65                 .virtual        = OMAP243X_SDRC_VIRT,
66                 .pfn            = __phys_to_pfn(OMAP243X_SDRC_PHYS),
67                 .length         = OMAP243X_SDRC_SIZE,
68                 .type           = MT_DEVICE
69         },
70         {
71                 .virtual        = OMAP243X_SMS_VIRT,
72                 .pfn            = __phys_to_pfn(OMAP243X_SMS_PHYS),
73                 .length         = OMAP243X_SMS_SIZE,
74                 .type           = MT_DEVICE
75         },
76 #endif
77         {
78                 .virtual        = DSP_MEM_24XX_VIRT,
79                 .pfn            = __phys_to_pfn(DSP_MEM_24XX_PHYS),
80                 .length         = DSP_MEM_24XX_SIZE,
81                 .type           = MT_DEVICE
82         },
83         {
84                 .virtual        = DSP_IPI_24XX_VIRT,
85                 .pfn            = __phys_to_pfn(DSP_IPI_24XX_PHYS),
86                 .length         = DSP_IPI_24XX_SIZE,
87                 .type           = MT_DEVICE
88         },
89         {
90                 .virtual        = DSP_MMU_24XX_VIRT,
91                 .pfn            = __phys_to_pfn(DSP_MMU_24XX_PHYS),
92                 .length         = DSP_MMU_24XX_SIZE,
93                 .type           = MT_DEVICE
94         },
95 #ifdef CONFIG_ARCH_OMAP2430
96         {
97                 .virtual        = L4_WK_243X_VIRT,
98                 .pfn            = __phys_to_pfn(L4_WK_243X_PHYS),
99                 .length         = L4_WK_243X_SIZE,
100                 .type           = MT_DEVICE
101         },
102         {
103                 .virtual        = OMAP243X_GPMC_VIRT,
104                 .pfn            = __phys_to_pfn(OMAP243X_GPMC_PHYS),
105                 .length         = OMAP243X_GPMC_SIZE,
106                 .type           = MT_DEVICE
107         },
108         {
109                 .virtual        = OMAP243X_SDRC_VIRT,
110                 .pfn            = __phys_to_pfn(OMAP243X_SDRC_PHYS),
111                 .length         = OMAP243X_SDRC_SIZE,
112                 .type           = MT_DEVICE
113         },
114         {
115                 .virtual        = OMAP243X_SMS_VIRT,
116                 .pfn            = __phys_to_pfn(OMAP243X_SMS_PHYS),
117                 .length         = OMAP243X_SMS_SIZE,
118                 .type           = MT_DEVICE
119         },
120 #endif
121         {
122                 .virtual        = DSP_MEM_24XX_VIRT,
123                 .pfn            = __phys_to_pfn(DSP_MEM_24XX_PHYS),
124                 .length         = DSP_MEM_24XX_SIZE,
125                 .type           = MT_DEVICE
126         },
127 #ifdef CONFIG_ARCH_OMAP2420
128         {
129                 .virtual        = DSP_IPI_24XX_VIRT,
130                 .pfn            = __phys_to_pfn(DSP_IPI_24XX_PHYS),
131                 .length         = DSP_IPI_24XX_SIZE,
132                 .type           = MT_DEVICE
133         },
134 #endif
135         {
136                 .virtual        = DSP_MMU_24XX_VIRT,
137                 .pfn            = __phys_to_pfn(DSP_MMU_24XX_PHYS),
138                 .length         = DSP_MMU_24XX_SIZE,
139                 .type           = MT_DEVICE
140         },
141 };
142
143 void __init omap2_map_common_io(void)
144 {
145         iotable_init(omap2_io_desc, ARRAY_SIZE(omap2_io_desc));
146
147         /* Normally devicemaps_init() would flush caches and tlb after
148          * mdesc->map_io(), but we must also do it here because of the CPU
149          * revision check below.
150          */
151         local_flush_tlb_all();
152         flush_cache_all();
153
154         omap2_check_revision();
155         omap_sram_init();
156         omapfb_reserve_sdram();
157 }
158
159 void __init omap2_init_common_hw(void)
160 {
161         omap2_mux_init();
162         omap2_clk_init();
163         omap2_init_memory();
164         gpmc_init();
165 }