board-generic.c 8.4 KB
Newer Older
1 2 3 4
/*
 * Copyright (C) 2005 Nokia Corporation
 * Author: Paul Mundt <paul.mundt@nokia.com>
 *
5
 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
6
 *
7 8
 * Modified from the original mach-omap/omap2/board-generic.c did by Paul
 * to support the OMAP2+ device tree boards with an unique board file.
9 10 11 12 13
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
14
#include <linux/io.h>
15
#include <linux/of_irq.h>
16 17
#include <linux/of_platform.h>
#include <linux/irqdomain.h>
18 19 20

#include <asm/mach/arch.h>

21
#include "common.h"
22

23
#if !(defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3))
24
#define intc_of_init	NULL
25 26 27 28 29
#endif
#ifndef CONFIG_ARCH_OMAP4
#define gic_of_init		NULL
#endif

30
static const struct of_device_id omap_dt_match_table[] __initconst = {
31 32 33
	{ .compatible = "simple-bus", },
	{ .compatible = "ti,omap-infra", },
	{ }
34 35
};

36 37
static void __init omap_generic_init(void)
{
38 39
	omapdss_early_init_of();

40
	pdata_quirks_init(omap_dt_match_table);
41 42

	omapdss_init_of();
43 44
}

45
#ifdef CONFIG_SOC_OMAP2420
46
static const char *const omap242x_boards_compat[] __initconst = {
47 48 49 50 51 52 53 54 55
	"ti,omap2420",
	NULL,
};

DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)")
	.reserve	= omap_reserve,
	.map_io		= omap242x_map_io,
	.init_early	= omap2420_init_early,
	.init_machine	= omap_generic_init,
S
Stephen Warren 已提交
56
	.init_time	= omap2_sync32k_timer_init,
57
	.dt_compat	= omap242x_boards_compat,
58
	.restart	= omap2xxx_restart,
59 60 61
MACHINE_END
#endif

62
#ifdef CONFIG_SOC_OMAP2430
63
static const char *const omap243x_boards_compat[] __initconst = {
64 65 66 67 68
	"ti,omap2430",
	NULL,
};

DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)")
69
	.reserve	= omap_reserve,
70 71
	.map_io		= omap243x_map_io,
	.init_early	= omap2430_init_early,
72
	.init_machine	= omap_generic_init,
S
Stephen Warren 已提交
73
	.init_time	= omap2_sync32k_timer_init,
74
	.dt_compat	= omap243x_boards_compat,
75
	.restart	= omap2xxx_restart,
76 77 78
MACHINE_END
#endif

79
#ifdef CONFIG_ARCH_OMAP3
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
/* Some boards need board name for legacy userspace in /proc/cpuinfo */
static const char *const n900_boards_compat[] __initconst = {
	"nokia,omap3-n900",
	NULL,
};

DT_MACHINE_START(OMAP3_N900_DT, "Nokia RX-51 board")
	.reserve	= omap_reserve,
	.map_io		= omap3_map_io,
	.init_early	= omap3430_init_early,
	.init_machine	= omap_generic_init,
	.init_late	= omap3_init_late,
	.init_time	= omap3_sync32k_timer_init,
	.dt_compat	= n900_boards_compat,
	.restart	= omap3xxx_restart,
MACHINE_END

/* Generic omap3 boards, most boards can use these */
98
static const char *const omap3_boards_compat[] __initconst = {
99
	"ti,omap3430",
100 101 102 103 104 105 106 107
	"ti,omap3",
	NULL,
};

DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
	.reserve	= omap_reserve,
	.map_io		= omap3_map_io,
	.init_early	= omap3430_init_early,
108
	.init_machine	= omap_generic_init,
109
	.init_late	= omap3_init_late,
S
Stephen Warren 已提交
110
	.init_time	= omap3_sync32k_timer_init,
111
	.dt_compat	= omap3_boards_compat,
112
	.restart	= omap3xxx_restart,
113
MACHINE_END
114

115
static const char *const omap36xx_boards_compat[] __initconst = {
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
	"ti,omap36xx",
	NULL,
};

DT_MACHINE_START(OMAP36XX_DT, "Generic OMAP36xx (Flattened Device Tree)")
	.reserve	= omap_reserve,
	.map_io		= omap3_map_io,
	.init_early	= omap3630_init_early,
	.init_machine	= omap_generic_init,
	.init_late	= omap3_init_late,
	.init_time	= omap3_sync32k_timer_init,
	.dt_compat	= omap36xx_boards_compat,
	.restart	= omap3xxx_restart,
MACHINE_END

131
static const char *const omap3_gp_boards_compat[] __initconst = {
132
	"ti,omap3-beagle",
133
	"timll,omap3-devkit8000",
134 135 136 137 138 139 140 141
	NULL,
};

DT_MACHINE_START(OMAP3_GP_DT, "Generic OMAP3-GP (Flattened Device Tree)")
	.reserve	= omap_reserve,
	.map_io		= omap3_map_io,
	.init_early	= omap3430_init_early,
	.init_machine	= omap_generic_init,
142
	.init_late	= omap3_init_late,
S
Stephen Warren 已提交
143
	.init_time	= omap3_secure_sync32k_timer_init,
144
	.dt_compat	= omap3_gp_boards_compat,
145
	.restart	= omap3xxx_restart,
146
MACHINE_END
147

148
static const char *const am3517_boards_compat[] __initconst = {
149 150 151 152 153 154 155 156 157 158 159 160 161 162
	"ti,am3517",
	NULL,
};

DT_MACHINE_START(AM3517_DT, "Generic AM3517 (Flattened Device Tree)")
	.reserve	= omap_reserve,
	.map_io		= omap3_map_io,
	.init_early	= am35xx_init_early,
	.init_machine	= omap_generic_init,
	.init_late	= omap3_init_late,
	.init_time	= omap3_gptimer_timer_init,
	.dt_compat	= am3517_boards_compat,
	.restart	= omap3xxx_restart,
MACHINE_END
163 164
#endif

165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
#ifdef CONFIG_SOC_TI81XX
static const char *const ti814x_boards_compat[] __initconst = {
	"ti,dm8148",
	"ti,dm814",
	NULL,
};

DT_MACHINE_START(TI81XX_DT, "Generic ti814x (Flattened Device Tree)")
	.reserve	= omap_reserve,
	.map_io		= ti81xx_map_io,
	.init_early	= ti814x_init_early,
	.init_machine	= omap_generic_init,
	.init_late	= ti81xx_init_late,
	.init_time	= omap3_gptimer_timer_init,
	.dt_compat	= ti814x_boards_compat,
	.restart	= ti81xx_restart,
MACHINE_END

static const char *const ti816x_boards_compat[] __initconst = {
	"ti,dm8168",
	"ti,dm816",
	NULL,
};

DT_MACHINE_START(TI816X_DT, "Generic ti816x (Flattened Device Tree)")
	.reserve	= omap_reserve,
	.map_io		= ti81xx_map_io,
	.init_early	= ti816x_init_early,
	.init_machine	= omap_generic_init,
	.init_late	= ti81xx_init_late,
	.init_time	= omap3_gptimer_timer_init,
	.dt_compat	= ti816x_boards_compat,
	.restart	= ti81xx_restart,
MACHINE_END
#endif

201
#ifdef CONFIG_SOC_AM33XX
202
static const char *const am33xx_boards_compat[] __initconst = {
203 204 205 206 207 208 209 210 211
	"ti,am33xx",
	NULL,
};

DT_MACHINE_START(AM33XX_DT, "Generic AM33XX (Flattened Device Tree)")
	.reserve	= omap_reserve,
	.map_io		= am33xx_map_io,
	.init_early	= am33xx_init_early,
	.init_machine	= omap_generic_init,
212
	.init_late	= am33xx_init_late,
213
	.init_time	= omap3_gptimer_timer_init,
214
	.dt_compat	= am33xx_boards_compat,
215
	.restart	= am33xx_restart,
216 217 218
MACHINE_END
#endif

219
#ifdef CONFIG_ARCH_OMAP4
220
static const char *const omap4_boards_compat[] __initconst = {
221 222
	"ti,omap4460",
	"ti,omap4430",
223 224 225 226 227
	"ti,omap4",
	NULL,
};

DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
228 229 230
	.l2c_aux_val	= OMAP_L2C_AUX_CTRL,
	.l2c_aux_mask	= 0xcf9fffff,
	.l2c_write_sec	= omap4_l2c310_write_sec,
231
	.reserve	= omap_reserve,
232
	.smp		= smp_ops(omap4_smp_ops),
233 234
	.map_io		= omap4_map_io,
	.init_early	= omap4430_init_early,
235
	.init_irq	= omap_gic_of_init,
236
	.init_machine	= omap_generic_init,
237
	.init_late	= omap4430_init_late,
S
Stephen Warren 已提交
238
	.init_time	= omap4_local_timer_init,
239
	.dt_compat	= omap4_boards_compat,
240
	.restart	= omap44xx_restart,
241
MACHINE_END
242
#endif
243 244

#ifdef CONFIG_SOC_OMAP5
245
static const char *const omap5_boards_compat[] __initconst = {
246 247
	"ti,omap5432",
	"ti,omap5430",
248 249 250 251 252 253
	"ti,omap5",
	NULL,
};

DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)")
	.reserve	= omap_reserve,
254
	.smp		= smp_ops(omap4_smp_ops),
255 256 257 258
	.map_io		= omap5_map_io,
	.init_early	= omap5_init_early,
	.init_irq	= omap_gic_of_init,
	.init_machine	= omap_generic_init,
259
	.init_late	= omap5_init_late,
S
Stephen Warren 已提交
260
	.init_time	= omap5_realtime_timer_init,
261
	.dt_compat	= omap5_boards_compat,
262
	.restart	= omap44xx_restart,
263 264
MACHINE_END
#endif
265 266

#ifdef CONFIG_SOC_AM43XX
267
static const char *const am43_boards_compat[] __initconst = {
268
	"ti,am4372",
269 270 271 272 273
	"ti,am43",
	NULL,
};

DT_MACHINE_START(AM43_DT, "Generic AM43 (Flattened Device Tree)")
274 275 276
	.l2c_aux_val	= OMAP_L2C_AUX_CTRL,
	.l2c_aux_mask	= 0xcf9fffff,
	.l2c_write_sec	= omap4_l2c310_write_sec,
277 278
	.map_io		= am33xx_map_io,
	.init_early	= am43xx_init_early,
279
	.init_late	= am43xx_init_late,
280 281
	.init_irq	= omap_gic_of_init,
	.init_machine	= omap_generic_init,
282
	.init_time	= omap3_gptimer_timer_init,
283
	.dt_compat	= am43_boards_compat,
284
	.restart	= omap44xx_restart,
285 286
MACHINE_END
#endif
287 288

#ifdef CONFIG_SOC_DRA7XX
289
static const char *const dra74x_boards_compat[] __initconst = {
290 291
	"ti,am5728",
	"ti,am5726",
292
	"ti,dra742",
293 294 295 296
	"ti,dra7",
	NULL,
};

297
DT_MACHINE_START(DRA74X_DT, "Generic DRA74X (Flattened Device Tree)")
298 299 300 301
	.reserve	= omap_reserve,
	.smp		= smp_ops(omap4_smp_ops),
	.map_io		= omap5_map_io,
	.init_early	= dra7xx_init_early,
302
	.init_late	= dra7xx_init_late,
303 304 305
	.init_irq	= omap_gic_of_init,
	.init_machine	= omap_generic_init,
	.init_time	= omap5_realtime_timer_init,
306 307 308 309
	.dt_compat	= dra74x_boards_compat,
	.restart	= omap44xx_restart,
MACHINE_END

310
static const char *const dra72x_boards_compat[] __initconst = {
311 312
	"ti,am5718",
	"ti,am5716",
313 314 315 316 317 318 319 320 321 322 323 324 325
	"ti,dra722",
	NULL,
};

DT_MACHINE_START(DRA72X_DT, "Generic DRA72X (Flattened Device Tree)")
	.reserve	= omap_reserve,
	.map_io		= omap5_map_io,
	.init_early	= dra7xx_init_early,
	.init_late	= dra7xx_init_late,
	.init_irq	= omap_gic_of_init,
	.init_machine	= omap_generic_init,
	.init_time	= omap5_realtime_timer_init,
	.dt_compat	= dra72x_boards_compat,
326
	.restart	= omap44xx_restart,
327 328
MACHINE_END
#endif