diff options
author | Tanmay Jagdale <tanmay@marvell.com> | 2021-09-01 18:40:49 +0530 |
---|---|---|
committer | Mathieu Poirier <mathieu.poirier@linaro.org> | 2021-10-27 11:44:34 -0600 |
commit | 4d5d88baa6c838bf92ed6a63c50dd3167c5a4956 (patch) | |
tree | c17b75202049543d81790072af1a54a6367e98f1 /drivers/hwtracing/coresight/coresight-tmc-core.c | |
parent | 0ab47f8079f27edc44ea0bcc67078561bcfdf542 (diff) | |
download | linux-4d5d88baa6c838bf92ed6a63c50dd3167c5a4956.tar.gz linux-4d5d88baa6c838bf92ed6a63c50dd3167c5a4956.tar.bz2 linux-4d5d88baa6c838bf92ed6a63c50dd3167c5a4956.zip |
coresight: tmc: Configure AXI write burst size
The current driver sets the write burst size initiated by TMC-ETR on
AXI bus to a fixed value of 16. Make this configurable by reading the
value specified in fwnode. If not specified, then default to 16.
Introduced a "max_burst_size" variable in tmc_drvdata structure to
facilitate this change.
Signed-off-by: Tanmay Jagdale <tanmay@marvell.com>
Reviewed-by: Mike Leach <mike.leach@linaro.org>
Link: https://lore.kernel.org/r/20210901131049.1365367-3-tanmay@marvell.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Diffstat (limited to 'drivers/hwtracing/coresight/coresight-tmc-core.c')
-rw-r--r-- | drivers/hwtracing/coresight/coresight-tmc-core.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/hwtracing/coresight/coresight-tmc-core.c b/drivers/hwtracing/coresight/coresight-tmc-core.c index 74c6323d4d6a..d0276af82494 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-core.c +++ b/drivers/hwtracing/coresight/coresight-tmc-core.c @@ -432,6 +432,21 @@ static u32 tmc_etr_get_default_buffer_size(struct device *dev) return size; } +static u32 tmc_etr_get_max_burst_size(struct device *dev) +{ + u32 burst_size; + + if (fwnode_property_read_u32(dev->fwnode, "arm,max-burst-size", + &burst_size)) + return TMC_AXICTL_WR_BURST_16; + + /* Only permissible values are 0 to 15 */ + if (burst_size > 0xF) + burst_size = TMC_AXICTL_WR_BURST_16; + + return burst_size; +} + static int tmc_probe(struct amba_device *adev, const struct amba_id *id) { int ret = 0; @@ -469,10 +484,12 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id) /* This device is not associated with a session */ drvdata->pid = -1; - if (drvdata->config_type == TMC_CONFIG_TYPE_ETR) + if (drvdata->config_type == TMC_CONFIG_TYPE_ETR) { drvdata->size = tmc_etr_get_default_buffer_size(dev); - else + drvdata->max_burst_size = tmc_etr_get_max_burst_size(dev); + } else { drvdata->size = readl_relaxed(drvdata->base + TMC_RSZ) * 4; + } desc.dev = dev; desc.groups = coresight_tmc_groups; |