]> pilppa.org Git - linux-2.6-omap-h63xx.git/blob - arch/arm/mach-omap1/io.c
[PATCH] ARM: OMAP: FB support for OMAP2
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap1 / io.c
1 /*
2  * linux/arch/arm/mach-omap1/io.c
3  *
4  * OMAP1 I/O mapping code
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  */
10
11 #include <linux/config.h>
12 #include <linux/module.h>
13 #include <linux/kernel.h>
14 #include <linux/init.h>
15
16 #include <asm/mach/map.h>
17 #include <asm/io.h>
18 #include <asm/arch/mux.h>
19 #include <asm/arch/tc.h>
20
21 extern int omap1_clk_init(void);
22 extern void omap_check_revision(void);
23 extern void omap_sram_init(void);
24
25 /*
26  * The machine specific code may provide the extra mapping besides the
27  * default mapping provided here.
28  */
29 static struct map_desc omap_io_desc[] __initdata = {
30  { IO_VIRT,             IO_PHYS,             IO_SIZE,              MT_DEVICE },
31 };
32
33 #ifdef CONFIG_ARCH_OMAP730
34 static struct map_desc omap730_io_desc[] __initdata = {
35  { OMAP730_DSP_BASE,    OMAP730_DSP_START,    OMAP730_DSP_SIZE,    MT_DEVICE },
36  { OMAP730_DSPREG_BASE, OMAP730_DSPREG_START, OMAP730_DSPREG_SIZE, MT_DEVICE },
37 };
38 #endif
39
40 #ifdef CONFIG_ARCH_OMAP15XX
41 static struct map_desc omap1510_io_desc[] __initdata = {
42  { OMAP1510_DSP_BASE,    OMAP1510_DSP_START,    OMAP1510_DSP_SIZE,    MT_DEVICE },
43  { OMAP1510_DSPREG_BASE, OMAP1510_DSPREG_START, OMAP1510_DSPREG_SIZE, MT_DEVICE },
44 };
45 #endif
46
47 #if defined(CONFIG_ARCH_OMAP16XX)
48 static struct map_desc omap16xx_io_desc[] __initdata = {
49  { OMAP16XX_DSP_BASE,    OMAP16XX_DSP_START,    OMAP16XX_DSP_SIZE,    MT_DEVICE },
50  { OMAP16XX_DSPREG_BASE, OMAP16XX_DSPREG_START, OMAP16XX_DSPREG_SIZE, MT_DEVICE },
51 };
52 #endif
53
54 static int initialized = 0;
55
56 static void __init _omap_map_io(void)
57 {
58         initialized = 1;
59
60         /* We have to initialize the IO space mapping before we can run
61          * cpu_is_omapxxx() macros. */
62         iotable_init(omap_io_desc, ARRAY_SIZE(omap_io_desc));
63         omap_check_revision();
64
65 #ifdef CONFIG_ARCH_OMAP730
66         if (cpu_is_omap730()) {
67                 iotable_init(omap730_io_desc, ARRAY_SIZE(omap730_io_desc));
68         }
69 #endif
70 #ifdef CONFIG_ARCH_OMAP15XX
71         if (cpu_is_omap1510()) {
72                 iotable_init(omap1510_io_desc, ARRAY_SIZE(omap1510_io_desc));
73         }
74 #endif
75 #if defined(CONFIG_ARCH_OMAP16XX)
76         if (cpu_is_omap16xx()) {
77                 iotable_init(omap16xx_io_desc, ARRAY_SIZE(omap16xx_io_desc));
78         }
79 #endif
80
81         omap_sram_init();
82
83         /* REVISIT: Refer to OMAP5910 Errata, Advisory SYS_1: "Timeout Abort
84          * on a Posted Write in the TIPB Bridge".
85          */
86         omap_writew(0x0, MPU_PUBLIC_TIPB_CNTL);
87         omap_writew(0x0, MPU_PRIVATE_TIPB_CNTL);
88
89         /* Must init clocks early to assure that timer interrupt works
90          */
91         omap1_clk_init();
92 }
93
94 /*
95  * This should only get called from board specific init
96  */
97 void __init omap_map_common_io(void)
98 {
99         if (!initialized) {
100                 _omap_map_io();
101                 omap1_mux_init();
102         }
103 }
104