blob: 8bae56ae5f21fd0312b80faa4ac3b22e9ebc2f4f [file] [log] [blame]
Yann Gautier0ed7b2a2021-05-19 18:48:16 +02001/*
2 * Copyright (C) 2021, STMicroelectronics - All Rights Reserved
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef STM32MP1_STM32IMAGE_DEF_H
8#define STM32MP1_STM32IMAGE_DEF_H
9
10#define STM32MP_BL2_SIZE U(0x0001C000) /* 112 KB for BL2 */
11#define STM32MP_DTB_SIZE U(0x00006000) /* 24 KB for DTB */
12
13#ifdef AARCH32_SP_OPTEE
14#define STM32MP_BL32_BASE STM32MP_SEC_SYSRAM_BASE
15
16#define STM32MP_BL2_BASE (STM32MP_SEC_SYSRAM_BASE + \
17 STM32MP_SEC_SYSRAM_SIZE - \
18 STM32MP_BL2_SIZE)
19
20/* OP-TEE loads from SYSRAM base to BL2 DTB start address */
21#define STM32MP_OPTEE_BASE STM32MP_BL32_BASE
22#define STM32MP_OPTEE_SIZE (STM32MP_SEC_SYSRAM_SIZE - \
23 STM32MP_BL2_SIZE - STM32MP_DTB_SIZE)
24#define STM32MP_BL32_SIZE STM32MP_OPTEE_SIZE
25#else /* AARCH32_SP_OPTEE */
26#define STM32MP_BL32_SIZE U(0x00019000) /* 96 KB for BL32 */
27
28#define STM32MP_BL32_BASE (STM32MP_SEC_SYSRAM_BASE + \
29 STM32MP_SEC_SYSRAM_SIZE - \
30 STM32MP_BL32_SIZE)
31
32#define STM32MP_BL2_BASE (STM32MP_BL32_BASE - \
33 STM32MP_BL2_SIZE)
34#endif /* AARCH32_SP_OPTEE */
35
36/* DTB initialization value */
37#define STM32MP_DTB_BASE (STM32MP_BL2_BASE - \
38 STM32MP_DTB_SIZE)
39
40/*
41 * MAX_MMAP_REGIONS is usually:
42 * BL stm32mp1_mmap size + mmap regions in *_plat_arch_setup
43 */
44#if defined(IMAGE_BL32)
45#define MAX_MMAP_REGIONS 6
46#endif
47
48/*******************************************************************************
49 * STM32MP1 RAW partition offset for MTD devices
50 ******************************************************************************/
51#define STM32MP_NOR_BL33_OFFSET U(0x00080000)
52#ifdef AARCH32_SP_OPTEE
53#define STM32MP_NOR_TEEH_OFFSET U(0x00280000)
54#define STM32MP_NOR_TEED_OFFSET U(0x002C0000)
55#define STM32MP_NOR_TEEX_OFFSET U(0x00300000)
56#endif
57
58#define STM32MP_NAND_BL33_OFFSET U(0x00200000)
59#ifdef AARCH32_SP_OPTEE
60#define STM32MP_NAND_TEEH_OFFSET U(0x00600000)
61#define STM32MP_NAND_TEED_OFFSET U(0x00680000)
62#define STM32MP_NAND_TEEX_OFFSET U(0x00700000)
63#endif
64
65#endif /* STM32MP1_STM32IMAGE_DEF_H */