2 * linux/arch/arm/mach-omap1/io.c
4 * OMAP1 I/O mapping code
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.
11 #include <linux/config.h>
12 #include <linux/module.h>
13 #include <linux/kernel.h>
14 #include <linux/init.h>
16 #include <asm/mach/map.h>
18 #include <asm/arch/mux.h>
19 #include <asm/arch/tc.h>
21 extern int omap1_clk_init(void);
22 extern void omap_check_revision(void);
23 extern void omap_sram_init(void);
26 * The machine specific code may provide the extra mapping besides the
27 * default mapping provided here.
29 static struct map_desc omap_io_desc[] __initdata = {
32 .pfn = __phys_to_pfn(IO_PHYS),
38 #ifdef CONFIG_ARCH_OMAP730
39 static struct map_desc omap730_io_desc[] __initdata = {
41 .virtual = OMAP730_DSP_BASE,
42 .pfn = __phys_to_pfn(OMAP730_DSP_START),
43 .length = OMAP730_DSP_SIZE,
46 .virtual = OMAP730_DSPREG_BASE,
47 .pfn = __phys_to_pfn(OMAP730_DSPREG_START),
48 .length = OMAP730_DSPREG_SIZE,
54 #ifdef CONFIG_ARCH_OMAP15XX
55 static struct map_desc omap1510_io_desc[] __initdata = {
57 .virtual = OMAP1510_DSP_BASE,
58 .pfn = __phys_to_pfn(OMAP1510_DSP_START),
59 .length = OMAP1510_DSP_SIZE,
62 .virtual = OMAP1510_DSPREG_BASE,
63 .pfn = __phys_to_pfn(OMAP1510_DSPREG_START),
64 .length = OMAP1510_DSPREG_SIZE,
70 #if defined(CONFIG_ARCH_OMAP16XX)
71 static struct map_desc omap16xx_io_desc[] __initdata = {
73 .virtual = OMAP16XX_DSP_BASE,
74 .pfn = __phys_to_pfn(OMAP16XX_DSP_START),
75 .length = OMAP16XX_DSP_SIZE,
78 .virtual = OMAP16XX_DSPREG_BASE,
79 .pfn = __phys_to_pfn(OMAP16XX_DSPREG_START),
80 .length = OMAP16XX_DSPREG_SIZE,
86 static int initialized = 0;
88 static void __init _omap_map_io(void)
92 /* We have to initialize the IO space mapping before we can run
93 * cpu_is_omapxxx() macros. */
94 iotable_init(omap_io_desc, ARRAY_SIZE(omap_io_desc));
95 omap_check_revision();
97 #ifdef CONFIG_ARCH_OMAP730
98 if (cpu_is_omap730()) {
99 iotable_init(omap730_io_desc, ARRAY_SIZE(omap730_io_desc));
102 #ifdef CONFIG_ARCH_OMAP15XX
103 if (cpu_is_omap1510()) {
104 iotable_init(omap1510_io_desc, ARRAY_SIZE(omap1510_io_desc));
107 #if defined(CONFIG_ARCH_OMAP16XX)
108 if (cpu_is_omap16xx()) {
109 iotable_init(omap16xx_io_desc, ARRAY_SIZE(omap16xx_io_desc));
115 /* REVISIT: Refer to OMAP5910 Errata, Advisory SYS_1: "Timeout Abort
116 * on a Posted Write in the TIPB Bridge".
118 omap_writew(0x0, MPU_PUBLIC_TIPB_CNTL);
119 omap_writew(0x0, MPU_PRIVATE_TIPB_CNTL);
121 /* Must init clocks early to assure that timer interrupt works
127 * This should only get called from board specific init
129 void __init omap_map_common_io(void)