emu.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. #include <linux/kernel.h>
  14. #include <linux/init.h>
  15. #include <linux/types.h>
  16. #include <linux/module.h>
  17. #include <linux/device.h>
  18. #include <linux/amba/bus.h>
  19. #include <linux/io.h>
  20. #include <linux/clk.h>
  21. #include <linux/err.h>
  22. #include "iomap.h"
  23. MODULE_LICENSE("GPL");
  24. MODULE_AUTHOR("Alexander Shishkin");
  25. /* Cortex CoreSight components within omap3xxx EMU */
  26. #define ETM_BASE (L4_EMU_34XX_PHYS + 0x10000)
  27. #define DBG_BASE (L4_EMU_34XX_PHYS + 0x11000)
  28. #define ETB_BASE (L4_EMU_34XX_PHYS + 0x1b000)
  29. #define DAPCTL (L4_EMU_34XX_PHYS + 0x1d000)
  30. static struct amba_device omap3_etb_device = {
  31. .dev = {
  32. .init_name = "etb",
  33. },
  34. .res = {
  35. .start = ETB_BASE,
  36. .end = ETB_BASE + SZ_4K - 1,
  37. .flags = IORESOURCE_MEM,
  38. },
  39. .periphid = 0x000bb907,
  40. };
  41. static struct amba_device omap3_etm_device = {
  42. .dev = {
  43. .init_name = "etm",
  44. },
  45. .res = {
  46. .start = ETM_BASE,
  47. .end = ETM_BASE + SZ_4K - 1,
  48. .flags = IORESOURCE_MEM,
  49. },
  50. .periphid = 0x102bb921,
  51. };
  52. static int __init emu_init(void)
  53. {
  54. if (!cpu_is_omap34xx())
  55. return -ENODEV;
  56. amba_device_register(&omap3_etb_device, &iomem_resource);
  57. amba_device_register(&omap3_etm_device, &iomem_resource);
  58. return 0;
  59. }
  60. subsys_initcall(emu_init);