Commit 63ca6bba authored by Zelalem's avatar Zelalem
Browse files

refactor(juno): disable non-invasive debug of secure state



Disable non-invasive debug of secure state for Juno
in release builds. This makes sure that PMU counts
only Non-secure events.
Signed-off-by: default avatarZelalem Aweke <zelalem.aweke@arm.com>
Change-Id: I0d1c3f96f3b4e48360a7211ae55851d65d291025
parent 57dde212
/* /*
* Copyright (c) 2015-2020, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2015-2021, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -137,6 +137,8 @@ ...@@ -137,6 +137,8 @@
#define SSC_DBGCFG_SET 0x14 #define SSC_DBGCFG_SET 0x14
#define SSC_DBGCFG_CLR 0x18 #define SSC_DBGCFG_CLR 0x18
#define SPNIDEN_INT_CLR_SHIFT 4
#define SPNIDEN_SEL_SET_SHIFT 5
#define SPIDEN_INT_CLR_SHIFT 6 #define SPIDEN_INT_CLR_SHIFT 6
#define SPIDEN_SEL_SET_SHIFT 7 #define SPIDEN_SEL_SET_SHIFT 7
......
/* /*
* Copyright (c) 2014-2020, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2014-2021, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -115,6 +115,14 @@ static void init_debug_cfg(void) ...@@ -115,6 +115,14 @@ static void init_debug_cfg(void)
/* Drive SPIDEN LOW to disable invasive debug of secure state. */ /* Drive SPIDEN LOW to disable invasive debug of secure state. */
mmio_write_32(SSC_REG_BASE + SSC_DBGCFG_CLR, mmio_write_32(SSC_REG_BASE + SSC_DBGCFG_CLR,
1U << SPIDEN_INT_CLR_SHIFT); 1U << SPIDEN_INT_CLR_SHIFT);
/* Set internal drive selection for SPNIDEN. */
mmio_write_32(SSC_REG_BASE + SSC_DBGCFG_SET,
1U << SPNIDEN_SEL_SET_SHIFT);
/* Drive SPNIDEN LOW to disable non-invasive debug of secure state. */
mmio_write_32(SSC_REG_BASE + SSC_DBGCFG_CLR,
1U << SPNIDEN_INT_CLR_SHIFT);
#endif #endif
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment