omap3.c revision 1.4
1/* $OpenBSD: omap3.c,v 1.4 2017/03/01 05:10:05 jsg Exp $ */
2
3/*
4 * Copyright (c) 2011 Uwe Stuehler <uwe@openbsd.org>
5 *
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18
19#include <sys/types.h>
20#include <sys/param.h>
21
22#include <machine/bus.h>
23
24#include <armv7/armv7/armv7var.h>
25
26#define PRCM_ADDR	0x48004000
27#define PRCM_SIZE	0x2000
28
29#define INTC_ADDR	0x48200000
30#define INTC_SIZE	0x200
31
32#define GPTIMERx_SIZE	0x100
33#define GPTIMER1_ADDR	0x48318000
34#define GPTIMER1_IRQ	37
35#define GPTIMER2_ADDR	0x49032000
36#define GPTIMER2_IRQ	38
37
38#define USBTLL_ADDR	0x48062000
39#define USBTLL_SIZE	0x1000
40
41struct armv7_dev omap3_devs[] = {
42
43	/*
44	 * Power, Reset and Clock Manager
45	 */
46
47	{ .name = "prcm",
48	  .unit = 0,
49	  .mem = { { PRCM_ADDR, PRCM_SIZE } },
50	},
51
52	/*
53	 * Interrupt Controller
54	 */
55
56	{ .name = "intc",
57	  .unit = 0,
58	  .mem = { { INTC_ADDR, INTC_SIZE } },
59	},
60
61	/*
62	 * General Purpose Timers
63	 */
64
65	{ .name = "gptimer",
66	  .unit = 1,			/* XXX see gptimer.c */
67	  .mem = { { GPTIMER1_ADDR, GPTIMERx_SIZE } },
68	  .irq = { GPTIMER1_IRQ }
69	},
70
71	{ .name = "gptimer",
72	  .unit = 0,			/* XXX see gptimer.c */
73	  .mem = { { GPTIMER2_ADDR, GPTIMERx_SIZE } },
74	  .irq = { GPTIMER2_IRQ }
75	},
76
77	/*
78	 * USB
79	 */
80
81	{ .name = "omusbtll",
82	  .unit = 0,
83	  .mem = { { USBTLL_ADDR, USBTLL_SIZE } },
84	},
85
86	/* Terminator */
87	{ .name = NULL,
88	  .unit = 0,
89	}
90};
91
92void
93omap3_init(void)
94{
95	armv7_set_devs(omap3_devs);
96}
97