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

Commit 71c8ee1e authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "coresight: add the authentication logic for coresight etm"

parents 7b122b4a 570fa783
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
/* Copyright (c) 2011-2012, 2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2012, 2016, 2018, The Linux Foundation. All rights reserved.
 *
 * Description: CoreSight Program Flow Trace driver
 *
@@ -39,6 +39,7 @@

#include "coresight-etm.h"
#include "coresight-etm-perf.h"
#include "coresight-priv.h"

/*
 * Not really modular but using module_param is the easiest way to
@@ -711,6 +712,10 @@ static void etm_init_arch_data(void *info)

	CS_UNLOCK(drvdata->base);

	/* check the state of the fuse */
	if (!coresight_authstatus_enabled(drvdata->base))
		goto out;

	/* First dummy read */
	(void)etm_readl(drvdata, ETMPDSR);
	/* Provide power to ETM: ETMPDCR[3] == 1 */
@@ -742,6 +747,7 @@ static void etm_init_arch_data(void *info)

	etm_set_pwrdwn(drvdata);
	etm_clr_pwrup(drvdata);
out:
	CS_LOCK(drvdata->base);
}

+7 −1
Original line number Diff line number Diff line
/* Copyright (c) 2014, 2016-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014, 2016-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -38,6 +38,7 @@

#include "coresight-etm4x.h"
#include "coresight-etm-perf.h"
#include "coresight-priv.h"

static int boot_enable;
module_param_named(boot_enable, boot_enable, int, 0444);
@@ -436,6 +437,9 @@ static void etm4_init_arch_data(void *info)

	CS_UNLOCK(drvdata->base);

	if (!coresight_authstatus_enabled(drvdata->base))
		goto out;

	/* find all capabilities of the tracing unit */
	etmidr0 = readl_relaxed(drvdata->base + TRCIDR0);

@@ -582,6 +586,8 @@ static void etm4_init_arch_data(void *info)
	drvdata->nrseqstate = BMVAL(etmidr5, 25, 27);
	/* NUMCNTR, bits[30:28] number of counters available for tracing */
	drvdata->nr_cntr = BMVAL(etmidr5, 28, 30);

out:
	CS_LOCK(drvdata->base);
}