From bffaf5256dd9894b43c910ef4feff50976a29449 Mon Sep 17 00:00:00 2001 From: Mao Jinlong Date: Sun, 15 Mar 2020 11:13:53 +0800 Subject: [PATCH] coresight: stm: Remove debug fuse status check for stm STM should work on both non-secure and secure device. So remove the debug fuse check. Change-Id: If3ff461fec1dca2165ceaaf3750af7338332c486 Signed-off-by: Mao Jinlong --- drivers/hwtracing/coresight/coresight-ost.c | 5 +-- drivers/hwtracing/coresight/coresight-stm.c | 44 +-------------------- include/linux/coresight-stm.h | 4 +- 3 files changed, 4 insertions(+), 49 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-ost.c b/drivers/hwtracing/coresight/coresight-ost.c index de3513e3cc39..b1990fea15aa 100644 --- a/drivers/hwtracing/coresight/coresight-ost.c +++ b/drivers/hwtracing/coresight/coresight-ost.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2018, 2020 The Linux Foundation. All rights reserved. */ #include @@ -172,9 +172,6 @@ static inline int __stm_trace(uint32_t flags, uint8_t entity_id, uint32_t ch; void __iomem *ch_addr; - if (!(drvdata && drvdata->master_enable)) - return 0; - /* allocate channel and get the channel address */ ch = stm_channel_alloc(); if (unlikely(ch >= drvdata->numsp)) { diff --git a/drivers/hwtracing/coresight/coresight-stm.c b/drivers/hwtracing/coresight/coresight-stm.c index e835cf67d36a..4e8fd28a0ab4 100644 --- a/drivers/hwtracing/coresight/coresight-stm.c +++ b/drivers/hwtracing/coresight/coresight-stm.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* - * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. * * Description: CoreSight System Trace Macrocell driver * @@ -26,7 +26,6 @@ #include #include #include -#include #include "coresight-ost.h" #include "coresight-priv.h" @@ -73,9 +72,6 @@ /* Reserve the first 10 channels for kernel usage */ #define STM_CHANNEL_OFFSET 0 -#define APPS_NIDEN_SHIFT 17 -#define APPS_DBGEN_SHIFT 16 - static int boot_nr_channel; /* @@ -361,9 +357,6 @@ static ssize_t notrace stm_generic_packet(struct stm_data *stm_data, if (!(drvdata && local_read(&drvdata->mode))) return -EACCES; - if (!drvdata->master_enable) - return -EPERM; - if (channel >= drvdata->numsp) return -EINVAL; @@ -779,13 +772,6 @@ static void stm_init_generic_data(struct stm_drvdata *drvdata) drvdata->stm.set_options = stm_generic_set_options; } -static bool is_apps_debug_disabled(u32 val) -{ - val &= BIT(APPS_NIDEN_SHIFT); - - return val == 0; -} - static int stm_probe(struct amba_device *adev, const struct amba_id *id) { int ret; @@ -796,11 +782,9 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id) struct stm_drvdata *drvdata; struct resource *res = &adev->res; struct resource ch_res; - struct resource debug_ch_res; size_t res_size, bitmap_size; struct coresight_desc desc = { 0 }; struct device_node *np = adev->dev.of_node; - u32 val; if (np) { pdata = of_get_coresight_platform_data(dev, np); @@ -836,29 +820,6 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id) return PTR_ERR(base); drvdata->chs.base = base; - ret = stm_get_resource_byname(np, "stm-debug-status", &debug_ch_res); - /* - * By default, master enable is true, means not controlled - * by debug status register - */ - if (!ret) { - drvdata->debug_status_chs.phys = debug_ch_res.start; - base = devm_ioremap_resource(dev, &debug_ch_res); - if (!IS_ERR(base)) { - drvdata->debug_status_chs.base = base; - val = readl_relaxed(drvdata->debug_status_chs.base); - drvdata->master_enable = - !is_apps_debug_disabled(val); - } - } else { - ret = nvmem_cell_read_u32(&adev->dev, "debug_fuse", &val); - if (!ret) { - drvdata->master_enable = - !is_apps_debug_disabled(val); - } else - drvdata->master_enable = true; - } - drvdata->write_bytes = stm_fundamental_data_size(drvdata); if (boot_nr_channel) { @@ -907,8 +868,7 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id) pm_runtime_put(&adev->dev); - dev_info(dev, "%s initialized with master %s\n", (char *)id->data, - drvdata->master_enable ? "Enabled" : "Disabled"); + dev_info(dev, "%s initialized\n", (char *)id->data); return 0; stm_unregister: diff --git a/include/linux/coresight-stm.h b/include/linux/coresight-stm.h index 8221606d12d4..a1ddd672148c 100644 --- a/include/linux/coresight-stm.h +++ b/include/linux/coresight-stm.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* - * Copyright (c) 2011-2012, 2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2012, 2017, 2020 The Linux Foundation. All rights reserved. */ #ifndef __LINUX_CORESIGHT_STM_H_ #define __LINUX_CORESIGHT_STM_H_ @@ -84,8 +84,6 @@ struct stm_drvdata { spinlock_t spinlock; struct channel_space chs; bool enable; - struct channel_space debug_status_chs; - bool master_enable; DECLARE_BITMAP(entities, OST_ENTITY_MAX); struct stm_data stm; local_t mode;