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/tc.h>
20 extern void omap_check_revision(void);
23 * The machine specific code may provide the extra mapping besides the
24 * default mapping provided here.
26 static struct map_desc omap_io_desc[] __initdata = {
27 { IO_VIRT, IO_PHYS, IO_SIZE, MT_DEVICE },
30 #ifdef CONFIG_ARCH_OMAP730
31 static struct map_desc omap730_io_desc[] __initdata = {
32 { OMAP730_DSP_BASE, OMAP730_DSP_START, OMAP730_DSP_SIZE, MT_DEVICE },
33 { OMAP730_DSPREG_BASE, OMAP730_DSPREG_START, OMAP730_DSPREG_SIZE, MT_DEVICE },
34 { OMAP730_SRAM_BASE, OMAP730_SRAM_START, OMAP730_SRAM_SIZE, MT_DEVICE }
38 #ifdef CONFIG_ARCH_OMAP1510
39 static struct map_desc omap1510_io_desc[] __initdata = {
40 { OMAP1510_DSP_BASE, OMAP1510_DSP_START, OMAP1510_DSP_SIZE, MT_DEVICE },
41 { OMAP1510_DSPREG_BASE, OMAP1510_DSPREG_START, OMAP1510_DSPREG_SIZE, MT_DEVICE },
42 { OMAP1510_SRAM_BASE, OMAP1510_SRAM_START, OMAP1510_SRAM_SIZE, MT_DEVICE }
46 #if defined(CONFIG_ARCH_OMAP16XX)
47 static struct map_desc omap1610_io_desc[] __initdata = {
48 { OMAP16XX_DSP_BASE, OMAP16XX_DSP_START, OMAP16XX_DSP_SIZE, MT_DEVICE },
49 { OMAP16XX_DSPREG_BASE, OMAP16XX_DSPREG_START, OMAP16XX_DSPREG_SIZE, MT_DEVICE },
50 { OMAP16XX_SRAM_BASE, OMAP16XX_SRAM_START, OMAP1610_SRAM_SIZE, MT_DEVICE }
53 static struct map_desc omap5912_io_desc[] __initdata = {
54 { OMAP16XX_DSP_BASE, OMAP16XX_DSP_START, OMAP16XX_DSP_SIZE, MT_DEVICE },
55 { OMAP16XX_DSPREG_BASE, OMAP16XX_DSPREG_START, OMAP16XX_DSPREG_SIZE, MT_DEVICE },
57 * The OMAP5912 has 250kByte internal SRAM. Because the mapping is baseed on page
58 * size (4kByte), it seems that the last 2kByte (=0x800) of the 250kByte are not mapped.
59 * Add additional 2kByte (0x800) so that the last page is mapped and the last 2kByte
62 { OMAP16XX_SRAM_BASE, OMAP16XX_SRAM_START, OMAP5912_SRAM_SIZE + 0x800, MT_DEVICE }
66 static int initialized = 0;
68 static void __init _omap_map_io(void)
72 /* We have to initialize the IO space mapping before we can run
73 * cpu_is_omapxxx() macros. */
74 iotable_init(omap_io_desc, ARRAY_SIZE(omap_io_desc));
75 omap_check_revision();
77 #ifdef CONFIG_ARCH_OMAP730
78 if (cpu_is_omap730()) {
79 iotable_init(omap730_io_desc, ARRAY_SIZE(omap730_io_desc));
82 #ifdef CONFIG_ARCH_OMAP1510
83 if (cpu_is_omap1510()) {
84 iotable_init(omap1510_io_desc, ARRAY_SIZE(omap1510_io_desc));
87 #if defined(CONFIG_ARCH_OMAP16XX)
88 if (cpu_is_omap1610() || cpu_is_omap1710()) {
89 iotable_init(omap1610_io_desc, ARRAY_SIZE(omap1610_io_desc));
91 if (cpu_is_omap5912()) {
92 iotable_init(omap5912_io_desc, ARRAY_SIZE(omap5912_io_desc));
96 /* REVISIT: Refer to OMAP5910 Errata, Advisory SYS_1: "Timeout Abort
97 * on a Posted Write in the TIPB Bridge".
99 omap_writew(0x0, MPU_PUBLIC_TIPB_CNTL);
100 omap_writew(0x0, MPU_PRIVATE_TIPB_CNTL);
102 /* Must init clocks early to assure that timer interrupt works
108 * This should only get called from board specific init
110 void omap_map_common_io(void)