feat(st-clock): add function to control MCU subsystem

Add a new function to control the MCU subsystem
security state.

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Change-Id: I070eec06fc93a1214227f25a6a4f1c40c66c86b0
This commit is contained in:
Lionel Debieve 2020-12-15 13:22:27 +01:00 committed by Yann Gautier
parent 57249e7758
commit 77b4ca0b2f
2 changed files with 15 additions and 2 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022, STMicroelectronics - All Rights Reserved
* Copyright (C) 2018-2024, STMicroelectronics - All Rights Reserved
*
* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
*/
@ -2326,6 +2326,17 @@ void stm32mp1_register_clock_parents_secure(unsigned long clock_id)
}
#endif /* STM32MP_SHARED_RESOURCES */
void stm32mp1_clk_mcuss_protect(bool enable)
{
uintptr_t rcc_base = stm32mp_rcc_base();
if (enable) {
mmio_setbits_32(rcc_base + RCC_TZCR, RCC_TZCR_MCKPROT);
} else {
mmio_clrbits_32(rcc_base + RCC_TZCR, RCC_TZCR_MCKPROT);
}
}
static void sync_earlyboot_clocks_state(void)
{
unsigned int idx;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2022, STMicroelectronics - All Rights Reserved
* Copyright (c) 2018-2024, STMicroelectronics - All Rights Reserved
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -32,6 +32,8 @@ bool stm32mp1_rcc_is_mckprot(void);
void stm32mp1_clk_rcc_regs_lock(void);
void stm32mp1_clk_rcc_regs_unlock(void);
void stm32mp1_clk_mcuss_protect(bool enable);
#ifdef STM32MP_SHARED_RESOURCES
void stm32mp1_register_clock_parents_secure(unsigned long id);
#endif