emu.c 1.5 KB

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