coresight-pmu.h 933 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright(C) 2015 Linaro Limited. All rights reserved.
  4. * Author: Mathieu Poirier <mathieu.poirier@linaro.org>
  5. */
  6. #ifndef _LINUX_CORESIGHT_PMU_H
  7. #define _LINUX_CORESIGHT_PMU_H
  8. #define CORESIGHT_ETM_PMU_NAME "cs_etm"
  9. #define CORESIGHT_ETM_PMU_SEED 0x10
  10. /* ETMv3.5/PTM's ETMCR config bit */
  11. #define ETM_OPT_CYCACC 12
  12. #define ETM_OPT_TS 28
  13. #define ETM_OPT_RETSTK 29
  14. /* ETMv4 CONFIGR programming bits for the ETM OPTs */
  15. #define ETM4_CFG_BIT_CYCACC 4
  16. #define ETM4_CFG_BIT_TS 11
  17. #define ETM4_CFG_BIT_RETSTK 12
  18. static inline int coresight_get_trace_id(int cpu)
  19. {
  20. /*
  21. * A trace ID of value 0 is invalid, so let's start at some
  22. * random value that fits in 7 bits and go from there. Since
  23. * the common convention is to have data trace IDs be I(N) + 1,
  24. * set instruction trace IDs as a function of the CPU number.
  25. */
  26. return (CORESIGHT_ETM_PMU_SEED + (cpu * 2));
  27. }
  28. #endif