u-boot/arch/arm/mach-stm32mp
Marek Vasut 73f7fc944c ARM: stm32: Initialize TAMP_SMCR BKP..PROT fields on STM32MP15xx
In case of an OTP-CLOSED STM32MP15xx system, the CPU core 1 cannot be
released from endless loop in BootROM only by populating TAMP BKPxR 4
and 5 with magic and branch address and sending SGI0 interrupt from
core 0 to core 1 twice. TAMP_SMCR BKP..PROT fields must be initialized
as well to release the core 1 from endless loop during the second SGI0
handling on core 1. Initialize TAMP_SMCR to protect the first 32 backup
registers, the ones which contain the core 1 magic, branch address and
boot information.

This requirement seems to be undocumented, therefore it was necessary
to trace and analyze the STM32MP15xx BootROM using OpenOCD and objdump.
Ultimately, it turns out that a certain BootROM function reads out the
TAMP_SMCR register and tests whether the BKP..PROT fields are non-zero.
If they are zero, the BootROM code again waits for SGI0 using WFI, else
the execution moves forward until it reaches handoff to the TAMP BKPxR 5
branch address.

This fixes CPU core 1 release using U-Boot PSCI implementation on an
OTP-CLOSED system, i.e. system with fuse 0 bit 6 set.

Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2024-04-19 12:05:10 +02:00
..
cmd_stm32prog stm32mp: cmd_stm32prog: add dependencies with USB_GADGET_DOWNLOAD 2024-04-19 10:27:18 +02:00
include/mach stm32mp2: Fix CONFIG_STM32MP25X flag usage 2024-01-19 15:49:20 +01:00
stm32mp1 ARM: stm32: Initialize TAMP_SMCR BKP..PROT fields on STM32MP15xx 2024-04-19 12:05:10 +02:00
stm32mp2 smt32mp: add setup_mac_address for stm32mp25 2024-01-19 14:38:01 +01:00
boot_params.c treewide: unify the linker symbol reference format 2023-08-09 09:21:42 -04:00
bsec.c stm32mp: bsec: add support of stm32mp25 2024-01-19 14:19:42 +01:00
cmd_stm32key.c arm: Rename STM32MP15x 2024-01-19 14:38:59 +01:00
dram_init.c stm32mp: dram_init: Limit DDR usage under 4GB boundary for STM32MP 2023-11-13 10:55:38 +01:00
ecdsa_romapi.c ARM: stm32: Add missing header for save_boot_params 2023-06-16 11:13:55 +02:00
Kconfig stm32mp: Add dependencies on CMDLINE for command stm32key 2024-01-19 15:10:06 +01:00
Kconfig.13x arm: Rename STM32MP13x 2024-01-19 14:38:59 +01:00
Kconfig.15x arm: Rename STM32MP15x 2024-01-19 14:38:59 +01:00
Kconfig.25x stm32mp2: initial support 2023-11-13 10:55:38 +01:00
Makefile arm: Rename STM32MP15x 2024-01-19 14:38:59 +01:00
soc.c smt32mp: add setup_mac_address for stm32mp25 2024-01-19 14:38:01 +01:00
syscon.c stm32mp2: initial support 2023-11-13 10:55:38 +01:00