Browse Source

Merge changes from topic "st_mckprot_bl32" into integration

* changes:
  refactor(stm32mp1): move the MCU security to BL32
  feat(st-clock): add function to control MCU subsystem
pull/2000/merge
Madhukar Pappireddy 8 months ago
committed by TrustedFirmware Code Review
parent
commit
0487832050
  1. 13
      drivers/st/clk/stm32mp1_clk.c
  2. 4
      include/drivers/st/stm32mp1_clk.h
  3. 5
      plat/st/stm32mp1/bl2_plat_setup.c
  4. 5
      plat/st/stm32mp1/sp_min/sp_min_setup.c

13
drivers/st/clk/stm32mp1_clk.c

@ -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;

4
include/drivers/st/stm32mp1_clk.h

@ -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

5
plat/st/stm32mp1/bl2_plat_setup.c

@ -255,11 +255,6 @@ void bl2_el3_plat_arch_setup(void)
mmio_clrbits_32(rcc_base + RCC_BDCR, RCC_BDCR_VSWRST);
}
#if STM32MP15
/* Disable MCKPROT */
mmio_clrbits_32(rcc_base + RCC_TZCR, RCC_TZCR_MCKPROT);
#endif
/*
* Set minimum reset pulse duration to 31ms for discrete power
* supplied boards.

5
plat/st/stm32mp1/sp_min/sp_min_setup.c

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2015-2024, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -182,6 +182,9 @@ void sp_min_platform_setup(void)
stm32mp_gic_init();
/* Disable MCU subsystem protection */
stm32mp1_clk_mcuss_protect(false);
if (stm32_iwdg_init() < 0) {
panic();
}

Loading…
Cancel
Save