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

Commit 9f4d99f3 authored by Xiaogang Cui's avatar Xiaogang Cui
Browse files

coresight: change flush input from pre_ares to flush_etr



Change flush input signal from pre_ares to flush_etr. For ETF
to be consistent with the usage model for both ETF and ETR.
Remove property reset-flush-race which is a workaround for
MSM8974v1.

Change-Id: I077f5215e75024e484abb3b68d67372ae6ccd154
Signed-off-by: default avatarXiaogang Cui <xiaogang@codeaurora.org>
parent 46086ca3
Loading
Loading
Loading
Loading
+0 −2
Original line number Original line Diff line number Diff line
@@ -124,8 +124,6 @@ Optional properties:
- qcom,memory-size : size of coherent memory to be allocated for tmc-etr buffer
- qcom,memory-size : size of coherent memory to be allocated for tmc-etr buffer
- qcom,round-robin : indicates if per core etms are allowed round-robin access
- qcom,round-robin : indicates if per core etms are allowed round-robin access
		     by the funnel
		     by the funnel
- qcom,reset-flush-race : indicates if a race exists between flushing and ddr
			  being put into self-refresh during watchdog reset
- qcom,write-64bit : only 64bit data writes supported by stm
- qcom,write-64bit : only 64bit data writes supported by stm
- <supply-name>-supply: phandle to the regulator device tree node. The required
- <supply-name>-supply: phandle to the regulator device tree node. The required
			<supply-name> is "vdd" for SD card and "vdd-io" for SD
			<supply-name> is "vdd" for SD card and "vdd-io" for SD
+16 −29
Original line number Original line Diff line number Diff line
@@ -155,7 +155,6 @@ struct tmc_drvdata {
	struct class		*byte_cntr_class;
	struct class		*byte_cntr_class;
	struct clk		*clk;
	struct clk		*clk;
	spinlock_t		spinlock;
	spinlock_t		spinlock;
	bool			reset_flush_race;
	struct coresight_cti	*cti_flush;
	struct coresight_cti	*cti_flush;
	struct coresight_cti	*cti_reset;
	struct coresight_cti	*cti_reset;
	struct mutex		read_lock;
	struct mutex		read_lock;
@@ -778,7 +777,7 @@ static int tmc_enable(struct tmc_drvdata *drvdata, enum tmc_mode mode)
	mutex_lock(&drvdata->usb_lock);
	mutex_lock(&drvdata->usb_lock);
	if (drvdata->config_type == TMC_CONFIG_TYPE_ETB) {
	if (drvdata->config_type == TMC_CONFIG_TYPE_ETB) {
		coresight_cti_map_trigout(drvdata->cti_flush, 1, 0);
		coresight_cti_map_trigout(drvdata->cti_flush, 1, 0);
		coresight_cti_map_trigin(drvdata->cti_reset, 0, 0);
		coresight_cti_map_trigin(drvdata->cti_reset, 2, 0);
	} else if (drvdata->config_type == TMC_CONFIG_TYPE_ETR) {
	} else if (drvdata->config_type == TMC_CONFIG_TYPE_ETR) {
		if (drvdata->out_mode == TMC_ETR_OUT_MODE_MEM) {
		if (drvdata->out_mode == TMC_ETR_OUT_MODE_MEM) {


@@ -801,12 +800,10 @@ static int tmc_enable(struct tmc_drvdata *drvdata, enum tmc_mode mode)
				goto err0;
				goto err0;


			tmc_etr_byte_cntr_start(drvdata);
			tmc_etr_byte_cntr_start(drvdata);
			if (!drvdata->reset_flush_race) {
			coresight_cti_map_trigout(drvdata->cti_flush,
			coresight_cti_map_trigout(drvdata->cti_flush,
						  3, 0);
						  3, 0);
			coresight_cti_map_trigin(drvdata->cti_reset,
			coresight_cti_map_trigin(drvdata->cti_reset,
						 2, 0);
						 2, 0);
			}
		} else if (drvdata->out_mode == TMC_ETR_OUT_MODE_USB) {
		} else if (drvdata->out_mode == TMC_ETR_OUT_MODE_USB) {
			drvdata->usbch = usb_qdss_open("qdss", drvdata,
			drvdata->usbch = usb_qdss_open("qdss", drvdata,
						       usb_notifier);
						       usb_notifier);
@@ -819,7 +816,7 @@ static int tmc_enable(struct tmc_drvdata *drvdata, enum tmc_mode mode)
	} else {
	} else {
		if (mode == TMC_MODE_CIRCULAR_BUFFER) {
		if (mode == TMC_MODE_CIRCULAR_BUFFER) {
			coresight_cti_map_trigout(drvdata->cti_flush, 1, 0);
			coresight_cti_map_trigout(drvdata->cti_flush, 1, 0);
			coresight_cti_map_trigin(drvdata->cti_reset, 0, 0);
			coresight_cti_map_trigin(drvdata->cti_reset, 2, 0);
		}
		}
	}
	}


@@ -1128,24 +1125,22 @@ static void tmc_disable(struct tmc_drvdata *drvdata, enum tmc_mode mode)
	spin_unlock_irqrestore(&drvdata->spinlock, flags);
	spin_unlock_irqrestore(&drvdata->spinlock, flags);


	if (drvdata->config_type == TMC_CONFIG_TYPE_ETB) {
	if (drvdata->config_type == TMC_CONFIG_TYPE_ETB) {
		coresight_cti_unmap_trigin(drvdata->cti_reset, 0, 0);
		coresight_cti_unmap_trigin(drvdata->cti_reset, 2, 0);
		coresight_cti_unmap_trigout(drvdata->cti_flush, 1, 0);
		coresight_cti_unmap_trigout(drvdata->cti_flush, 1, 0);
	} else if (drvdata->config_type == TMC_CONFIG_TYPE_ETR) {
	} else if (drvdata->config_type == TMC_CONFIG_TYPE_ETR) {
		if (drvdata->out_mode == TMC_ETR_OUT_MODE_MEM) {
		if (drvdata->out_mode == TMC_ETR_OUT_MODE_MEM) {
			tmc_etr_byte_cntr_stop(drvdata);
			tmc_etr_byte_cntr_stop(drvdata);
			if (!drvdata->reset_flush_race) {
			coresight_cti_unmap_trigin(drvdata->cti_reset,
			coresight_cti_unmap_trigin(drvdata->cti_reset,
						   2, 0);
						   2, 0);
			coresight_cti_unmap_trigout(drvdata->cti_flush,
			coresight_cti_unmap_trigout(drvdata->cti_flush,
						    3, 0);
						    3, 0);
			}
		} else if (drvdata->out_mode == TMC_ETR_OUT_MODE_USB) {
		} else if (drvdata->out_mode == TMC_ETR_OUT_MODE_USB) {
			tmc_etr_bam_disable(drvdata);
			tmc_etr_bam_disable(drvdata);
			usb_qdss_close(drvdata->usbch);
			usb_qdss_close(drvdata->usbch);
		}
		}
	} else {
	} else {
		if (mode == TMC_MODE_CIRCULAR_BUFFER) {
		if (mode == TMC_MODE_CIRCULAR_BUFFER) {
			coresight_cti_unmap_trigin(drvdata->cti_reset, 0, 0);
			coresight_cti_unmap_trigin(drvdata->cti_reset, 2, 0);
			coresight_cti_unmap_trigout(drvdata->cti_flush, 1, 0);
			coresight_cti_unmap_trigout(drvdata->cti_flush, 1, 0);
		}
		}
	}
	}
@@ -1837,10 +1832,8 @@ static ssize_t tmc_etr_store_out_mode(struct device *dev,
		drvdata->out_mode = TMC_ETR_OUT_MODE_MEM;
		drvdata->out_mode = TMC_ETR_OUT_MODE_MEM;
		spin_unlock_irqrestore(&drvdata->spinlock, flags);
		spin_unlock_irqrestore(&drvdata->spinlock, flags);


		if (!drvdata->reset_flush_race) {
		coresight_cti_map_trigout(drvdata->cti_flush, 3, 0);
		coresight_cti_map_trigout(drvdata->cti_flush, 3, 0);
		coresight_cti_map_trigin(drvdata->cti_reset, 2, 0);
		coresight_cti_map_trigin(drvdata->cti_reset, 2, 0);
		}


		tmc_etr_bam_disable(drvdata);
		tmc_etr_bam_disable(drvdata);
		usb_qdss_close(drvdata->usbch);
		usb_qdss_close(drvdata->usbch);
@@ -1862,10 +1855,8 @@ static ssize_t tmc_etr_store_out_mode(struct device *dev,
		drvdata->out_mode = TMC_ETR_OUT_MODE_USB;
		drvdata->out_mode = TMC_ETR_OUT_MODE_USB;
		spin_unlock_irqrestore(&drvdata->spinlock, flags);
		spin_unlock_irqrestore(&drvdata->spinlock, flags);


		if (!drvdata->reset_flush_race) {
		coresight_cti_unmap_trigin(drvdata->cti_reset, 2, 0);
		coresight_cti_unmap_trigin(drvdata->cti_reset, 2, 0);
		coresight_cti_unmap_trigout(drvdata->cti_flush, 3, 0);
		coresight_cti_unmap_trigout(drvdata->cti_flush, 3, 0);
		}


		drvdata->usbch = usb_qdss_open("qdss", drvdata,
		drvdata->usbch = usb_qdss_open("qdss", drvdata,
					       usb_notifier);
					       usb_notifier);
@@ -2402,10 +2393,6 @@ static int tmc_probe(struct platform_device *pdev)
	count++;
	count++;


	if (pdev->dev.of_node) {
	if (pdev->dev.of_node) {
		drvdata->reset_flush_race = of_property_read_bool(
						pdev->dev.of_node,
						"qcom,reset-flush-race");

		ctidata = of_get_coresight_cti_data(dev, pdev->dev.of_node);
		ctidata = of_get_coresight_cti_data(dev, pdev->dev.of_node);
		if (IS_ERR(ctidata)) {
		if (IS_ERR(ctidata)) {
			dev_err(dev, "invalid cti data\n");
			dev_err(dev, "invalid cti data\n");