blob: 28d639f8f6cf4b731ca67c140315947cc9e019af [file] [log] [blame]
Alexander Shishkin183bd502009-12-01 14:03:31 +01001/*
2 * emu.c
3 *
4 * ETM and ETB CoreSight components' resources as found in OMAP3xxx.
5 *
6 * Copyright (C) 2009 Nokia Corporation.
7 * Alexander Shishkin
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/types.h>
17#include <linux/module.h>
18#include <linux/device.h>
19#include <linux/amba/bus.h>
20#include <linux/io.h>
21#include <linux/clk.h>
22#include <linux/err.h>
23
Tony Lindgrenee0839c2012-02-24 10:34:35 -080024#include "iomap.h"
25
Alexander Shishkin183bd502009-12-01 14:03:31 +010026MODULE_LICENSE("GPL");
27MODULE_AUTHOR("Alexander Shishkin");
28
29/* Cortex CoreSight components within omap3xxx EMU */
30#define ETM_BASE (L4_EMU_34XX_PHYS + 0x10000)
31#define DBG_BASE (L4_EMU_34XX_PHYS + 0x11000)
32#define ETB_BASE (L4_EMU_34XX_PHYS + 0x1b000)
33#define DAPCTL (L4_EMU_34XX_PHYS + 0x1d000)
34
35static struct amba_device omap3_etb_device = {
36 .dev = {
37 .init_name = "etb",
38 },
39 .res = {
40 .start = ETB_BASE,
41 .end = ETB_BASE + SZ_4K - 1,
42 .flags = IORESOURCE_MEM,
43 },
44 .periphid = 0x000bb907,
45};
46
47static struct amba_device omap3_etm_device = {
48 .dev = {
49 .init_name = "etm",
50 },
51 .res = {
52 .start = ETM_BASE,
53 .end = ETM_BASE + SZ_4K - 1,
54 .flags = IORESOURCE_MEM,
55 },
56 .periphid = 0x102bb921,
57};
58
59static int __init emu_init(void)
60{
Tony Lindgren4323e9f2010-02-12 12:26:48 -080061 if (!cpu_is_omap34xx())
62 return -ENODEV;
63
Alexander Shishkin183bd502009-12-01 14:03:31 +010064 amba_device_register(&omap3_etb_device, &iomem_resource);
65 amba_device_register(&omap3_etm_device, &iomem_resource);
66
67 return 0;
68}
69
70subsys_initcall(emu_init);
71