Alexander Shishkin | 183bd50 | 2009-12-01 14:03:31 +0100 | [diff] [blame] | 1 | /* |
| 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 | |
| 24 | MODULE_LICENSE("GPL"); |
| 25 | MODULE_AUTHOR("Alexander Shishkin"); |
| 26 | |
| 27 | /* Cortex CoreSight components within omap3xxx EMU */ |
| 28 | #define ETM_BASE (L4_EMU_34XX_PHYS + 0x10000) |
| 29 | #define DBG_BASE (L4_EMU_34XX_PHYS + 0x11000) |
| 30 | #define ETB_BASE (L4_EMU_34XX_PHYS + 0x1b000) |
| 31 | #define DAPCTL (L4_EMU_34XX_PHYS + 0x1d000) |
| 32 | |
Russell King | e911ff1 | 2011-12-18 15:13:47 +0000 | [diff] [blame] | 33 | static AMBA_APB_DEVICE(omap3_etb, "etb", 0x000bb907, ETB_BASE, { }, NULL); |
| 34 | static AMBA_APB_DEVICE(omap3_etm, "etm", 0x102bb921, ETM_BASE, { }, NULL); |
Alexander Shishkin | 183bd50 | 2009-12-01 14:03:31 +0100 | [diff] [blame] | 35 | |
| 36 | static int __init emu_init(void) |
| 37 | { |
Tony Lindgren | 4323e9f | 2010-02-12 12:26:48 -0800 | [diff] [blame] | 38 | if (!cpu_is_omap34xx()) |
| 39 | return -ENODEV; |
| 40 | |
Alexander Shishkin | 183bd50 | 2009-12-01 14:03:31 +0100 | [diff] [blame] | 41 | amba_device_register(&omap3_etb_device, &iomem_resource); |
| 42 | amba_device_register(&omap3_etm_device, &iomem_resource); |
| 43 | |
| 44 | return 0; |
| 45 | } |
| 46 | |
| 47 | subsys_initcall(emu_init); |