Loading drivers/hwtracing/coresight/coresight-tmc-etf.c +9 −0 Original line number Diff line number Diff line Loading @@ -179,6 +179,12 @@ static int tmc_enable_etf_sink_sysfs(struct coresight_device *csdev) if (!used) kfree(buf); if (!ret) { coresight_cti_map_trigin(drvdata->cti_reset, 2, 0); coresight_cti_map_trigout(drvdata->cti_flush, 1, 0); dev_info(drvdata->dev, "TMC-ETB/ETF enabled\n"); } return ret; } Loading Loading @@ -256,6 +262,9 @@ static void tmc_disable_etf_sink(struct coresight_device *csdev) spin_unlock_irqrestore(&drvdata->spinlock, flags); coresight_cti_unmap_trigin(drvdata->cti_reset, 2, 0); coresight_cti_unmap_trigout(drvdata->cti_flush, 1, 0); dev_info(drvdata->dev, "TMC-ETB/ETF disabled\n"); } Loading drivers/hwtracing/coresight/coresight-tmc-etr.c +9 −2 Original line number Diff line number Diff line Loading @@ -1050,6 +1050,11 @@ static int tmc_enable_etr_sink_sysfs(struct coresight_device *csdev) spin_lock_irqsave(&drvdata->spinlock, flags); } if (drvdata->out_mode == TMC_ETR_OUT_MODE_MEM) { coresight_cti_map_trigout(drvdata->cti_flush, 3, 0); coresight_cti_map_trigin(drvdata->cti_reset, 2, 0); } if (drvdata->reading || drvdata->mode == CS_MODE_PERF) { ret = -EBUSY; goto out; Loading Loading @@ -1138,9 +1143,11 @@ static void tmc_disable_etr_sink(struct coresight_device *csdev) spin_unlock_irqrestore(&drvdata->spinlock, flags); if (drvdata->out_mode == TMC_ETR_OUT_MODE_MEM) if (drvdata->out_mode == TMC_ETR_OUT_MODE_MEM) { tmc_etr_byte_cntr_stop(drvdata->byte_cntr); coresight_cti_unmap_trigin(drvdata->cti_reset, 2, 0); coresight_cti_unmap_trigout(drvdata->cti_flush, 3, 0); } mutex_unlock(&drvdata->mem_lock); dev_info(drvdata->dev, "TMC-ETR disabled\n"); } Loading drivers/hwtracing/coresight/coresight-tmc.c +22 −0 Original line number Diff line number Diff line Loading @@ -358,6 +358,10 @@ static ssize_t out_mode_store(struct device *dev, tmc_etr_enable_hw(drvdata); drvdata->out_mode = TMC_ETR_OUT_MODE_MEM; spin_unlock_irqrestore(&drvdata->spinlock, flags); coresight_cti_map_trigout(drvdata->cti_flush, 3, 0); coresight_cti_map_trigin(drvdata->cti_reset, 2, 0); } else if (!strcmp(str, str_tmc_etr_out_mode[TMC_ETR_OUT_MODE_USB])) { if (drvdata->out_mode == TMC_ETR_OUT_MODE_USB) goto out; Loading @@ -375,6 +379,10 @@ static ssize_t out_mode_store(struct device *dev, tmc_etr_disable_hw(drvdata); drvdata->out_mode = TMC_ETR_OUT_MODE_USB; spin_unlock_irqrestore(&drvdata->spinlock, flags); coresight_cti_unmap_trigout(drvdata->cti_flush, 3, 0); coresight_cti_unmap_trigin(drvdata->cti_reset, 2, 0); } out: mutex_unlock(&drvdata->mem_lock); Loading Loading @@ -562,6 +570,7 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id) struct resource *res = &adev->res; struct coresight_desc desc = { 0 }; struct device_node *np = adev->dev.of_node; struct coresight_cti_data *ctidata; pdata = of_get_coresight_platform_data(dev, np); if (IS_ERR(pdata)) { Loading Loading @@ -617,6 +626,19 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id) } } ctidata = of_get_coresight_cti_data(dev, adev->dev.of_node); if (IS_ERR(ctidata)) { dev_err(dev, "invalid cti data\n"); } else if (ctidata && ctidata->nr_ctis == 2) { drvdata->cti_flush = coresight_cti_get(ctidata->names[0]); if (IS_ERR(drvdata->cti_flush)) dev_err(dev, "failed to get flush cti\n"); drvdata->cti_reset = coresight_cti_get(ctidata->names[1]); if (IS_ERR(drvdata->cti_reset)) dev_err(dev, "failed to get reset cti\n"); } desc.pdata = pdata; desc.dev = dev; ret = tmc_config_desc(drvdata, &desc); Loading drivers/hwtracing/coresight/coresight-tmc.h +3 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ #include <asm/cacheflush.h> #include <linux/of_address.h> #include <linux/amba/bus.h> #include <linux/coresight-cti.h> #include "coresight-byte-cntr.h" Loading Loading @@ -222,6 +223,8 @@ struct tmc_drvdata { struct coresight_csr *csr; const char *csr_name; bool enable; struct coresight_cti *cti_flush; struct coresight_cti *cti_reset; enum tmc_etr_out_mode out_mode; struct byte_cntr *byte_cntr; }; Loading Loading
drivers/hwtracing/coresight/coresight-tmc-etf.c +9 −0 Original line number Diff line number Diff line Loading @@ -179,6 +179,12 @@ static int tmc_enable_etf_sink_sysfs(struct coresight_device *csdev) if (!used) kfree(buf); if (!ret) { coresight_cti_map_trigin(drvdata->cti_reset, 2, 0); coresight_cti_map_trigout(drvdata->cti_flush, 1, 0); dev_info(drvdata->dev, "TMC-ETB/ETF enabled\n"); } return ret; } Loading Loading @@ -256,6 +262,9 @@ static void tmc_disable_etf_sink(struct coresight_device *csdev) spin_unlock_irqrestore(&drvdata->spinlock, flags); coresight_cti_unmap_trigin(drvdata->cti_reset, 2, 0); coresight_cti_unmap_trigout(drvdata->cti_flush, 1, 0); dev_info(drvdata->dev, "TMC-ETB/ETF disabled\n"); } Loading
drivers/hwtracing/coresight/coresight-tmc-etr.c +9 −2 Original line number Diff line number Diff line Loading @@ -1050,6 +1050,11 @@ static int tmc_enable_etr_sink_sysfs(struct coresight_device *csdev) spin_lock_irqsave(&drvdata->spinlock, flags); } if (drvdata->out_mode == TMC_ETR_OUT_MODE_MEM) { coresight_cti_map_trigout(drvdata->cti_flush, 3, 0); coresight_cti_map_trigin(drvdata->cti_reset, 2, 0); } if (drvdata->reading || drvdata->mode == CS_MODE_PERF) { ret = -EBUSY; goto out; Loading Loading @@ -1138,9 +1143,11 @@ static void tmc_disable_etr_sink(struct coresight_device *csdev) spin_unlock_irqrestore(&drvdata->spinlock, flags); if (drvdata->out_mode == TMC_ETR_OUT_MODE_MEM) if (drvdata->out_mode == TMC_ETR_OUT_MODE_MEM) { tmc_etr_byte_cntr_stop(drvdata->byte_cntr); coresight_cti_unmap_trigin(drvdata->cti_reset, 2, 0); coresight_cti_unmap_trigout(drvdata->cti_flush, 3, 0); } mutex_unlock(&drvdata->mem_lock); dev_info(drvdata->dev, "TMC-ETR disabled\n"); } Loading
drivers/hwtracing/coresight/coresight-tmc.c +22 −0 Original line number Diff line number Diff line Loading @@ -358,6 +358,10 @@ static ssize_t out_mode_store(struct device *dev, tmc_etr_enable_hw(drvdata); drvdata->out_mode = TMC_ETR_OUT_MODE_MEM; spin_unlock_irqrestore(&drvdata->spinlock, flags); coresight_cti_map_trigout(drvdata->cti_flush, 3, 0); coresight_cti_map_trigin(drvdata->cti_reset, 2, 0); } else if (!strcmp(str, str_tmc_etr_out_mode[TMC_ETR_OUT_MODE_USB])) { if (drvdata->out_mode == TMC_ETR_OUT_MODE_USB) goto out; Loading @@ -375,6 +379,10 @@ static ssize_t out_mode_store(struct device *dev, tmc_etr_disable_hw(drvdata); drvdata->out_mode = TMC_ETR_OUT_MODE_USB; spin_unlock_irqrestore(&drvdata->spinlock, flags); coresight_cti_unmap_trigout(drvdata->cti_flush, 3, 0); coresight_cti_unmap_trigin(drvdata->cti_reset, 2, 0); } out: mutex_unlock(&drvdata->mem_lock); Loading Loading @@ -562,6 +570,7 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id) struct resource *res = &adev->res; struct coresight_desc desc = { 0 }; struct device_node *np = adev->dev.of_node; struct coresight_cti_data *ctidata; pdata = of_get_coresight_platform_data(dev, np); if (IS_ERR(pdata)) { Loading Loading @@ -617,6 +626,19 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id) } } ctidata = of_get_coresight_cti_data(dev, adev->dev.of_node); if (IS_ERR(ctidata)) { dev_err(dev, "invalid cti data\n"); } else if (ctidata && ctidata->nr_ctis == 2) { drvdata->cti_flush = coresight_cti_get(ctidata->names[0]); if (IS_ERR(drvdata->cti_flush)) dev_err(dev, "failed to get flush cti\n"); drvdata->cti_reset = coresight_cti_get(ctidata->names[1]); if (IS_ERR(drvdata->cti_reset)) dev_err(dev, "failed to get reset cti\n"); } desc.pdata = pdata; desc.dev = dev; ret = tmc_config_desc(drvdata, &desc); Loading
drivers/hwtracing/coresight/coresight-tmc.h +3 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ #include <asm/cacheflush.h> #include <linux/of_address.h> #include <linux/amba/bus.h> #include <linux/coresight-cti.h> #include "coresight-byte-cntr.h" Loading Loading @@ -222,6 +223,8 @@ struct tmc_drvdata { struct coresight_csr *csr; const char *csr_name; bool enable; struct coresight_cti *cti_flush; struct coresight_cti *cti_reset; enum tmc_etr_out_mode out_mode; struct byte_cntr *byte_cntr; }; Loading