mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-16 17:44:19 +00:00

STM32MP_EMMC_BOOT allowed placing SSBL into the eMMC boot partition along with FSBL. This allows atomic update of both FSBL and SSBL at the same time. Previously, this was only possible for the FSBL, as the eMMC layout expected by TF-A had a single SSBL GPT partition in the eMMC user area. TEE binaries remained in dedicated GPT partitions whether STM32MP_EMMC_BOOT was on or off. The new FIP format collects SSBL and TEE partitions into a single binary placed into a GPT partition. Extend STM32MP_EMMC_BOOT, so eMMC-booted TF-A first uses a FIP image placed at offset 256K into the active eMMC boot partition. If no FIP magic is detected at that offset or if STM32MP_EMMC_BOOT is disabled, the GPT on the eMMC user area will be consulted as before. This allows power fail-safe update of all firmware using the built-in eMMC boot selector mechanism, provided it fits into the boot partition - SZ_256K. SZ_256K was chosen because it's the same offset used with the legacy format and because it's the size of the on-chip SRAM, where the STM32MP15x BootROM loads TF-A into. As such, TF-A may not exceed this size limit for existing SoCs. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Change-Id: Id7bec45652b3a289ca632d38d4b51316c5efdf8d
107 lines
3.2 KiB
C
107 lines
3.2 KiB
C
/*
|
|
* Copyright (C) 2021-2022, STMicroelectronics - All Rights Reserved
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#ifndef STM32MP1_FIP_DEF_H
|
|
#define STM32MP1_FIP_DEF_H
|
|
|
|
#define STM32MP_DDR_S_SIZE U(0x01E00000) /* 30 MB */
|
|
#define STM32MP_DDR_SHMEM_SIZE U(0x00200000) /* 2 MB */
|
|
|
|
#if STM32MP13
|
|
#define STM32MP_BL2_RO_SIZE U(0x00015000) /* 84 KB */
|
|
#define STM32MP_BL2_SIZE U(0x00017000) /* 92 KB for BL2 */
|
|
#define STM32MP_BL2_DTB_SIZE U(0x00004000) /* 16 KB for DTB */
|
|
#endif /* STM32MP13 */
|
|
#if STM32MP15
|
|
#define STM32MP_BL2_RO_SIZE U(0x00011000) /* 68 KB */
|
|
#define STM32MP_BL2_SIZE U(0x00016000) /* 88 KB for BL2 */
|
|
#define STM32MP_BL2_DTB_SIZE U(0x00007000) /* 28 KB for DTB */
|
|
#endif /* STM32MP15 */
|
|
#define STM32MP_BL32_SIZE U(0x0001B000) /* 108 KB for BL32 */
|
|
#define STM32MP_BL32_DTB_SIZE U(0x00005000) /* 20 KB for DTB */
|
|
#define STM32MP_FW_CONFIG_MAX_SIZE PAGE_SIZE /* 4 KB for FCONF DTB */
|
|
#define STM32MP_HW_CONFIG_MAX_SIZE U(0x40000) /* 256 KB for HW config DTB */
|
|
|
|
#if STM32MP13
|
|
#define STM32MP_BL2_BASE (STM32MP_BL2_DTB_BASE + \
|
|
STM32MP_BL2_DTB_SIZE)
|
|
#endif /* STM32MP13 */
|
|
#if STM32MP15
|
|
#define STM32MP_BL2_BASE (STM32MP_SEC_SYSRAM_BASE + \
|
|
STM32MP_SEC_SYSRAM_SIZE - \
|
|
STM32MP_BL2_SIZE)
|
|
#endif /* STM32MP15 */
|
|
|
|
#define STM32MP_BL2_RO_BASE STM32MP_BL2_BASE
|
|
|
|
#define STM32MP_BL2_RW_BASE (STM32MP_BL2_RO_BASE + \
|
|
STM32MP_BL2_RO_SIZE)
|
|
|
|
#if STM32MP13
|
|
#define STM32MP_BL2_RW_SIZE (STM32MP_SYSRAM_BASE + \
|
|
STM32MP_SYSRAM_SIZE - \
|
|
STM32MP_BL2_RW_BASE)
|
|
|
|
#define STM32MP_BL2_DTB_BASE STM32MP_SEC_SYSRAM_BASE
|
|
#endif /* STM32MP13 */
|
|
#if STM32MP15
|
|
#define STM32MP_BL2_RW_SIZE (STM32MP_SEC_SYSRAM_BASE + \
|
|
STM32MP_SEC_SYSRAM_SIZE - \
|
|
STM32MP_BL2_RW_BASE)
|
|
|
|
#define STM32MP_BL2_DTB_BASE (STM32MP_BL2_BASE - \
|
|
STM32MP_BL2_DTB_SIZE)
|
|
#endif /* STM32MP15 */
|
|
|
|
#define STM32MP_BL32_DTB_BASE STM32MP_SYSRAM_BASE
|
|
|
|
#define STM32MP_BL32_BASE (STM32MP_BL32_DTB_BASE + \
|
|
STM32MP_BL32_DTB_SIZE)
|
|
|
|
|
|
#if defined(IMAGE_BL2)
|
|
#define STM32MP_DTB_SIZE STM32MP_BL2_DTB_SIZE
|
|
#define STM32MP_DTB_BASE STM32MP_BL2_DTB_BASE
|
|
#endif
|
|
#if defined(IMAGE_BL32)
|
|
#define STM32MP_DTB_SIZE STM32MP_BL32_DTB_SIZE
|
|
#define STM32MP_DTB_BASE STM32MP_BL32_DTB_BASE
|
|
#endif
|
|
|
|
#ifdef AARCH32_SP_OPTEE
|
|
#define STM32MP_OPTEE_BASE STM32MP_SEC_SYSRAM_BASE
|
|
|
|
#define STM32MP_OPTEE_SIZE (STM32MP_BL2_DTB_BASE - \
|
|
STM32MP_OPTEE_BASE)
|
|
#endif
|
|
|
|
#if STM32MP13
|
|
#define STM32MP_FW_CONFIG_BASE SRAM3_BASE
|
|
#endif /* STM32MP13 */
|
|
#if STM32MP15
|
|
#define STM32MP_FW_CONFIG_BASE (STM32MP_SYSRAM_BASE + \
|
|
STM32MP_SYSRAM_SIZE - \
|
|
PAGE_SIZE)
|
|
#endif /* STM32MP15 */
|
|
#define STM32MP_HW_CONFIG_BASE (STM32MP_BL33_BASE + \
|
|
STM32MP_BL33_MAX_SIZE)
|
|
|
|
/*
|
|
* MAX_MMAP_REGIONS is usually:
|
|
* BL stm32mp1_mmap size + mmap regions in *_plat_arch_setup
|
|
*/
|
|
#if defined(IMAGE_BL32)
|
|
#define MAX_MMAP_REGIONS 10
|
|
#endif
|
|
|
|
/*******************************************************************************
|
|
* STM32MP1 RAW partition offset for devices without GPT
|
|
******************************************************************************/
|
|
#define STM32MP_EMMC_BOOT_FIP_OFFSET U(0x00040000)
|
|
#define STM32MP_NOR_FIP_OFFSET U(0x00080000)
|
|
#define STM32MP_NAND_FIP_OFFSET U(0x00200000)
|
|
|
|
#endif /* STM32MP1_FIP_DEF_H */
|