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

Commit d646008f authored by Tao,Zhang's avatar Tao,Zhang
Browse files

coresight: csr: Set EOT on periodic flush



Set EOT on periodic flush for lagoon long periodic flush time issue
workaround. It could make USB flush in low rate not see a big
lantency.

Change-Id: I768fb04317b184212ccae4e2912b5c538ac970de
Signed-off-by: default avatarTao,Zhang <taozha@codeaurora.org>
parent f8b00cea
Loading
Loading
Loading
Loading
+18 −2
Original line number Original line Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
// SPDX-License-Identifier: GPL-2.0-only
/*
/*
 * Copyright (c) 2012-2013, 2015-2017, 2019 The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2013, 2015-2017, 2019-2020 The Linux Foundation. All rights reserved.
 */
 */


#include <linux/kernel.h>
#include <linux/kernel.h>
@@ -66,8 +66,11 @@ do { \
#define BLKSIZE_1024		2
#define BLKSIZE_1024		2
#define BLKSIZE_2048		3
#define BLKSIZE_2048		3


#define FLUSHPERIOD_1	    0x1
#define FLUSHPERIOD_2048	0x800
#define FLUSHPERIOD_2048	0x800


#define PERFLSHEOT_BIT	    BIT(18)

struct csr_drvdata {
struct csr_drvdata {
	void __iomem		*base;
	void __iomem		*base;
	phys_addr_t		pbase;
	phys_addr_t		pbase;
@@ -79,6 +82,7 @@ struct csr_drvdata {
	struct clk		*clk;
	struct clk		*clk;
	spinlock_t		spin_lock;
	spinlock_t		spin_lock;
	bool			usb_bam_support;
	bool			usb_bam_support;
	bool			perflsheot_set_support;
	bool			hwctrl_set_support;
	bool			hwctrl_set_support;
	bool			set_byte_cntr_support;
	bool			set_byte_cntr_support;
	bool			timestamp_support;
	bool			timestamp_support;
@@ -153,6 +157,8 @@ void msm_qdss_csr_enable_flush(struct coresight_csr *csr)


	usbflshctrl = csr_readl(drvdata, CSR_USBFLSHCTRL);
	usbflshctrl = csr_readl(drvdata, CSR_USBFLSHCTRL);
	usbflshctrl |= 0x2;
	usbflshctrl |= 0x2;
	if (drvdata->perflsheot_set_support)
		usbflshctrl |= PERFLSHEOT_BIT;
	csr_writel(drvdata, usbflshctrl, CSR_USBFLSHCTRL);
	csr_writel(drvdata, usbflshctrl, CSR_USBFLSHCTRL);


	CSR_LOCK(drvdata);
	CSR_LOCK(drvdata);
@@ -205,6 +211,8 @@ void msm_qdss_csr_disable_flush(struct coresight_csr *csr)


	usbflshctrl = csr_readl(drvdata, CSR_USBFLSHCTRL);
	usbflshctrl = csr_readl(drvdata, CSR_USBFLSHCTRL);
	usbflshctrl &= ~0x2;
	usbflshctrl &= ~0x2;
	if (drvdata->perflsheot_set_support)
		usbflshctrl &= ~PERFLSHEOT_BIT;
	csr_writel(drvdata, usbflshctrl, CSR_USBFLSHCTRL);
	csr_writel(drvdata, usbflshctrl, CSR_USBFLSHCTRL);


	CSR_LOCK(drvdata);
	CSR_LOCK(drvdata);
@@ -479,8 +487,16 @@ static int csr_probe(struct platform_device *pdev)
		dev_dbg(dev, "aodbg_csr_support operation not supported\n");
		dev_dbg(dev, "aodbg_csr_support operation not supported\n");
	else
	else
		dev_dbg(dev, "aodbg_csr_support operation supported\n");
		dev_dbg(dev, "aodbg_csr_support operation supported\n");
	drvdata->perflsheot_set_support = of_property_read_bool(
			pdev->dev.of_node, "qcom,perflsheot-set-support");
	if (!drvdata->perflsheot_set_support)
		dev_dbg(dev, "perflsheot_set_support handled by other subsystem\n");
	else
		dev_dbg(dev, "perflsheot_set_support operation supported\n");


	if (drvdata->usb_bam_support)
	if (drvdata->perflsheot_set_support)
		drvdata->flushperiod = FLUSHPERIOD_1;
	else if (drvdata->usb_bam_support)
		drvdata->flushperiod = FLUSHPERIOD_2048;
		drvdata->flushperiod = FLUSHPERIOD_2048;


	desc = devm_kzalloc(dev, sizeof(*desc), GFP_KERNEL);
	desc = devm_kzalloc(dev, sizeof(*desc), GFP_KERNEL);