From 481bb168021173a65a6308526656f3c839a4ae06 Mon Sep 17 00:00:00 2001 From: Shashank Mittal Date: Fri, 15 Jan 2016 19:28:53 -0800 Subject: coresight: add STM driver support in upstream implementation Add STM driver in upstream implementation of Coresight driver. This change copies drivers/coresight/coresight-stm.c (commit : 90095b2ae1d987882f67c6d4a512baa98eecd6cb) to driver/hwtracing/coresight directory. Change-Id: Id023bf85df0345205ca8baa6a97ff340d5808aeb Signed-off-by: Shashank Mittal --- include/linux/coresight-stm.h | 35 +++++++++++++++++++++++++++++++++++ include/linux/coresight.h | 7 +++++++ include/uapi/linux/coresight-stm.h | 21 +++++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 include/linux/coresight-stm.h create mode 100644 include/uapi/linux/coresight-stm.h (limited to 'include') diff --git a/include/linux/coresight-stm.h b/include/linux/coresight-stm.h new file mode 100644 index 000000000000..375d96666f91 --- /dev/null +++ b/include/linux/coresight-stm.h @@ -0,0 +1,35 @@ +#ifndef __LINUX_CORESIGHT_STM_H_ +#define __LINUX_CORESIGHT_STM_H_ + +#include + +#define stm_log_inv(entity_id, proto_id, data, size) \ + stm_trace(STM_OPTION_NONE, entity_id, proto_id, data, size) + +#define stm_log_inv_ts(entity_id, proto_id, data, size) \ + stm_trace(STM_OPTION_TIMESTAMPED, entity_id, proto_id, \ + data, size) + +#define stm_log_gtd(entity_id, proto_id, data, size) \ + stm_trace(STM_OPTION_GUARANTEED, entity_id, proto_id, \ + data, size) + +#define stm_log_gtd_ts(entity_id, proto_id, data, size) \ + stm_trace(STM_OPTION_GUARANTEED | STM_OPTION_TIMESTAMPED, \ + entity_id, proto_id, data, size) + +#define stm_log(entity_id, data, size) \ + stm_log_inv_ts(entity_id, 0, data, size) + +#ifdef CONFIG_CORESIGHT_STM +extern int stm_trace(uint32_t options, uint8_t entity_id, uint8_t proto_id, + const void *data, uint32_t size); +#else +static inline int stm_trace(uint32_t options, uint8_t entity_id, + uint8_t proto_id, const void *data, uint32_t size) +{ + return 0; +} +#endif + +#endif diff --git a/include/linux/coresight.h b/include/linux/coresight.h index a7cabfa23b55..d22570d2a646 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -40,6 +40,13 @@ extern struct bus_type coresight_bustype; +enum coresight_clk_rate { + CORESIGHT_CLK_RATE_OFF, + CORESIGHT_CLK_RATE_TRACE = 1000, + CORESIGHT_CLK_RATE_HSTRACE = 2000, + CORESIGHT_CLK_RATE_FIXED = 3000, +}; + enum coresight_dev_type { CORESIGHT_DEV_TYPE_NONE, CORESIGHT_DEV_TYPE_SINK, diff --git a/include/uapi/linux/coresight-stm.h b/include/uapi/linux/coresight-stm.h new file mode 100644 index 000000000000..164890e6ca04 --- /dev/null +++ b/include/uapi/linux/coresight-stm.h @@ -0,0 +1,21 @@ +#ifndef __UAPI_CORESIGHT_STM_H_ +#define __UAPI_CORESIGHT_STM_H_ + +enum { + OST_ENTITY_NONE = 0x00, + OST_ENTITY_FTRACE_EVENTS = 0x01, + OST_ENTITY_TRACE_PRINTK = 0x02, + OST_ENTITY_TRACE_MARKER = 0x04, + OST_ENTITY_DEV_NODE = 0x08, + OST_ENTITY_DIAG = 0xEE, + OST_ENTITY_QVIEW = 0xFE, + OST_ENTITY_MAX = 0xFF, +}; + +enum { + STM_OPTION_NONE = 0x0, + STM_OPTION_TIMESTAMPED = 0x08, + STM_OPTION_GUARANTEED = 0x80, +}; + +#endif -- cgit v1.2.3