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

Commit 7cd1fb78 authored by Mao Jinlong's avatar Mao Jinlong
Browse files

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: default avatarMao Jinlong <jinlmao@codeaurora.org>
parent b5b61d0f
Loading
Loading
Loading
Loading
+2 −22
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
 * Copyright (c) 2015-2017, 2020, The Linux Foundation. All rights reserved.
 *
 * Description: CoreSight System Trace Macrocell driver
 *
@@ -366,9 +366,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;

@@ -857,13 +854,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;
@@ -875,7 +865,6 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id)
	struct resource *res = &adev->res;
	struct resource ch_res;
	size_t bitmap_size;
	uint32_t val;
	struct coresight_desc desc = { 0 };

	desc.name = coresight_alloc_device_name(&stm_devs, dev);
@@ -909,13 +898,6 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id)
		return PTR_ERR(base);
	drvdata->chs.base = base;

	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)
@@ -969,9 +951,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 *)coresight_get_uci_data(id),
		       drvdata->master_enable ? "Enabled" : "Disabled");
	dev_info(dev, "%s initialized\n", (char *)coresight_get_uci_data(id));
	return 0;

stm_unregister:
+1 −3
Original line number Diff line number Diff line
/* 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_
@@ -83,8 +83,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;