Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cef0bd8f authored by Mulu He's avatar Mulu He
Browse files

coresight: cti: Add snapshot of Coresight CTI driver



This is a snapshot of the coresight-cti driver as of msm-4.14
commit '7d42028b99d32ad6ec82aa429378fba0280a1c4a'.byte-cntr: Read 64bit rwp
TMC RWP has two 32bit registers which combine to one 64bit register.
Read correct RWP register in byte counter driver.

Change-Id: I2596a77f0df7b36c47a11800b3b922c014f81ed7
Signed-off-by: default avatarMulu He <muluhe@codeaurora.org>
parent efeb15f4
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -114,4 +114,11 @@ config CORESIGHT_CPU_DEBUG
	  properly, please refer Documentation/trace/coresight-cpu-debug.txt
	  for detailed description and the example for usage.

config CORESIGHT_CTI
	bool "CoreSight Cross Trigger Interface driver"
	help
	  This driver provides support for Cross Trigger Interface that is
	  used to input or output i.e. pass cross trigger events from one
	  hardware component to another. It can also be used to pass
	  software generated events.
endif
+1 −0
Original line number Diff line number Diff line
@@ -19,3 +19,4 @@ obj-$(CONFIG_CORESIGHT_DYNAMIC_REPLICATOR) += coresight-dynamic-replicator.o
obj-$(CONFIG_CORESIGHT_STM) += coresight-stm.o
obj-$(CONFIG_CORESIGHT_CPU_DEBUG) += coresight-cpu-debug.o
obj-$(CONFIG_CORESIGHT_CATU) += coresight-catu.o
obj-$(CONFIG_CORESIGHT_CTI) += coresight-cti.o
+1552 −0

File added.

Preview size limit exceeded, changes collapsed.

+87 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) 2013-2012, 2017, The Linux Foundation. All rights reserved.
 */

#ifndef _LINUX_CORESIGHT_CTI_H
#define _LINUX_CORESIGHT_CTI_H

#include <linux/pinctrl/consumer.h>
#include <linux/list.h>

struct coresight_cti_data {
	int nr_ctis;
	const char **names;
};

struct coresight_cti {
	const char *name;
	struct list_head link;
};

#ifdef CONFIG_CORESIGHT_CTI
extern struct coresight_cti *coresight_cti_get(const char *name);
extern void coresight_cti_put(struct coresight_cti *cti);
extern int coresight_cti_map_trigin(
			struct coresight_cti *cti, int trig, int ch);
extern int coresight_cti_map_trigout(
			struct coresight_cti *cti, int trig, int ch);
extern void coresight_cti_unmap_trigin(
			struct coresight_cti *cti, int trig, int ch);
extern void coresight_cti_unmap_trigout(
			struct coresight_cti *cti, int trig, int ch);
extern void coresight_cti_reset(struct coresight_cti *cti);
extern int coresight_cti_set_trig(struct coresight_cti *cti, int ch);
extern void coresight_cti_clear_trig(struct coresight_cti *cti, int ch);
extern int coresight_cti_pulse_trig(struct coresight_cti *cti, int ch);
extern int coresight_cti_enable_gate(struct coresight_cti *cti, int ch);
extern void coresight_cti_disable_gate(struct coresight_cti *cti, int ch);
extern void coresight_cti_ctx_save(void);
extern void coresight_cti_ctx_restore(void);
extern int coresight_cti_ack_trig(struct coresight_cti *cti, int trig);
#else
static inline struct coresight_cti *coresight_cti_get(const char *name)
{
	return NULL;
}
static inline void coresight_cti_put(struct coresight_cti *cti) {}
static inline int coresight_cti_map_trigin(
			struct coresight_cti *cti, int trig, int ch)
{
	return -ENODEV;
}
static inline int coresight_cti_map_trigout(
			struct coresight_cti *cti, int trig, int ch)
{
	return -ENODEV;
}
static inline void coresight_cti_unmap_trigin(
			struct coresight_cti *cti, int trig, int ch) {}
static inline void coresight_cti_unmap_trigout(
			struct coresight_cti *cti, int trig, int ch) {}
static inline void coresight_cti_reset(struct coresight_cti *cti) {}
static inline int coresight_cti_set_trig(struct coresight_cti *cti, int ch)
{
	return -ENODEV;
}
static inline void coresight_cti_clear_trig(struct coresight_cti *cti, int ch)
{}
static inline int coresight_cti_pulse_trig(struct coresight_cti *cti, int ch)
{
	return -ENODEV;
}
static inline int coresight_cti_enable_gate(struct coresight_cti *cti, int ch)
{
	return -ENODEV;
}
static inline void coresight_cti_disable_gate(struct coresight_cti *cti, int ch)
{}
static inline void coresight_cti_ctx_save(void){}
static inline void coresight_cti_ctx_restore(void){}
static inline int coresight_cti_ack_trig(struct coresight_cti *cti, int trig)
{
	return -ENODEV;
}
#endif

#endif