Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
common.c
Go to the documentation of this file.
1 /*
2  * linux/arch/arm/mach-omap2/common.c
3  *
4  * Code common to all OMAP2+ machines.
5  *
6  * Copyright (C) 2009 Texas Instruments
7  * Copyright (C) 2010 Nokia Corporation
8  * Tony Lindgren <[email protected]>
9  * Added OMAP4 support - Santosh Shilimkar <[email protected]>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License version 2 as
13  * published by the Free Software Foundation.
14  */
15 #include <linux/kernel.h>
16 #include <linux/init.h>
17 #include <linux/clk.h>
18 #include <linux/io.h>
19 
20 #include <plat/clock.h>
21 
22 #include "soc.h"
23 #include "iomap.h"
24 #include "common.h"
25 #include "sdrc.h"
26 #include "control.h"
27 
28 /* Global address base setup code */
29 
30 static void __init __omap2_set_globals(struct omap_globals *omap2_globals)
31 {
32  omap2_set_globals_tap(omap2_globals);
33  omap2_set_globals_sdrc(omap2_globals);
34  omap2_set_globals_control(omap2_globals);
35  omap2_set_globals_prcm(omap2_globals);
36 }
37 
38 #if defined(CONFIG_SOC_OMAP2420)
39 
40 static struct omap_globals omap242x_globals = {
42  .tap = OMAP2_L4_IO_ADDRESS(0x48014000),
48 };
49 
51 {
52  __omap2_set_globals(&omap242x_globals);
53 }
54 
55 void __init omap242x_map_io(void)
56 {
57  omap242x_map_common_io();
58 }
59 #endif
60 
61 #if defined(CONFIG_SOC_OMAP2430)
62 
63 static struct omap_globals omap243x_globals = {
65  .tap = OMAP2_L4_IO_ADDRESS(0x4900a000),
71 };
72 
74 {
75  __omap2_set_globals(&omap243x_globals);
76 }
77 
78 void __init omap243x_map_io(void)
79 {
80  omap243x_map_common_io();
81 }
82 #endif
83 
84 #if defined(CONFIG_ARCH_OMAP3)
85 
86 static struct omap_globals omap3_globals = {
88  .tap = OMAP2_L4_IO_ADDRESS(0x4830A000),
94 };
95 
97 {
98  __omap2_set_globals(&omap3_globals);
99 }
100 
101 void __init omap3_map_io(void)
102 {
103  omap34xx_map_common_io();
104 }
105 
106 /*
107  * Adjust TAP register base such that omap3_check_revision accesses the correct
108  * TI81XX register for checking device ID (it adds 0x204 to tap base while
109  * TI81XX DEVICE ID register is at offset 0x600 from control base).
110  */
111 #define TI81XX_TAP_BASE (TI81XX_CTRL_BASE + \
112  TI81XX_CONTROL_DEVICE_ID - 0x204)
113 
114 static struct omap_globals ti81xx_globals = {
116  .tap = OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE),
120 };
121 
123 {
124  __omap2_set_globals(&ti81xx_globals);
125 }
126 
127 void __init ti81xx_map_io(void)
128 {
129  omapti81xx_map_common_io();
130 }
131 #endif
132 
133 #if defined(CONFIG_SOC_AM33XX)
134 #define AM33XX_TAP_BASE (AM33XX_CTRL_BASE + \
135  TI81XX_CONTROL_DEVICE_ID - 0x204)
136 
137 static struct omap_globals am33xx_globals = {
138  .class = AM335X_CLASS,
139  .tap = AM33XX_L4_WK_IO_ADDRESS(AM33XX_TAP_BASE),
143 };
144 
146 {
147  __omap2_set_globals(&am33xx_globals);
148 }
149 
150 void __init am33xx_map_io(void)
151 {
152  omapam33xx_map_common_io();
153 }
154 #endif
155 
156 #if defined(CONFIG_ARCH_OMAP4)
157 static struct omap_globals omap4_globals = {
166 };
167 
169 {
170  __omap2_set_globals(&omap4_globals);
171 }
172 
173 void __init omap4_map_io(void)
174 {
175  omap44xx_map_common_io();
176 }
177 #endif
178 
179 #if defined(CONFIG_SOC_OMAP5)
180 static struct omap_globals omap5_globals = {
189 };
190 
192 {
193  omap2_set_globals_tap(&omap5_globals);
194  omap2_set_globals_control(&omap5_globals);
195  omap2_set_globals_prcm(&omap5_globals);
196 }
197 
198 void __init omap5_map_io(void)
199 {
200  omap5_map_common_io();
201 }
202 #endif