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

Commit 13538105 authored by Tingwei Zhang's avatar Tingwei Zhang
Browse files

coresight: Add common header file



Add snapshot for coresight common header file from msm-4.19
commit 64be469bda3a ("power: smb1390-psy: Configure IREV and
main's ICL to prevent IREV condition").

Change-Id: I63e2c73ddc752bc7a2d7a632efa2d9779f304cf1
Signed-off-by: default avatarTingwei Zhang <tingwei@codeaurora.org>
parent 3178aaf4
Loading
Loading
Loading
Loading
+38 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2019, The Linux Foundation. All rights reserved.
 */

#ifndef _CORESIGHT_COMMON_H
#define _CORESIGHT_COMMON_H

#define BM(lsb, msb)		((BIT(msb) - BIT(lsb)) + BIT(msb))
#define BVAL(val, n)            ((val & BIT(n)) >> n)

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

#if IS_ENABLED(CONFIG_CORESIGHT_CSR)
extern void msm_qdss_csr_enable_bam_to_usb(struct coresight_csr *csr);
extern void msm_qdss_csr_disable_bam_to_usb(struct coresight_csr *csr);
extern void msm_qdss_csr_disable_flush(struct coresight_csr *csr);
extern int coresight_csr_hwctrl_set(struct coresight_csr *csr, uint64_t addr,
				 uint32_t val);
extern void coresight_csr_set_byte_cntr(struct coresight_csr *csr,
				 uint32_t count);
extern struct coresight_csr *coresight_csr_get(const char *name);
#else
static inline void msm_qdss_csr_enable_bam_to_usb(struct coresight_csr *csr) {}
static inline void msm_qdss_csr_disable_bam_to_usb(struct coresight_csr *csr) {}
static inline void msm_qdss_csr_disable_flush(struct coresight_csr *csr) {}
static inline int coresight_csr_hwctrl_set(struct coresight_csr *csr,
	uint64_t addr, uint32_t val) { return -EINVAL; }
static inline void coresight_csr_set_byte_cntr(struct coresight_csr *csr,
					   uint32_t count) {}
static inline struct coresight_csr *coresight_csr_get(const char *name)
					{ return NULL; }
#endif

#endif
+2 −1
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
 * Copyright (c) 2011-2012, 2019 The Linux Foundation. All rights reserved.
 */

#ifndef _CORESIGHT_PRIV_H
@@ -11,6 +11,7 @@
#include <linux/io.h>
#include <linux/coresight.h>
#include <linux/pm_runtime.h>
#include "coresight-common.h"

/*
 * Coresight management registers (0xf00-0xfcc)