2 * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
4 * SPDX-License-Identifier: BSD-3-Clause
10 #include <platform_def.h>
12 #include <arch_helpers.h>
13 #include <common/bl_common.h>
14 #include <drivers/generic_delay_timer.h>
15 #include <plat/common/platform.h>
20 /* Weak definitions may be overridden in specific ARM standard platform */
21 #pragma weak bl2u_platform_setup
22 #pragma weak bl2u_early_platform_setup
23 #pragma weak bl2u_plat_arch_setup
25 #define MAP_BL2U_TOTAL MAP_REGION_FLAT( \
27 BL2U_LIMIT - BL2U_BASE, \
28 MT_MEMORY | MT_RW | MT_SECURE)
31 * Perform ARM standard platform setup for BL2U
33 void arm_bl2u_platform_setup(void)
35 /* Initialize the secure environment */
36 plat_arm_security_setup();
39 void bl2u_platform_setup(void)
41 arm_bl2u_platform_setup();
44 void arm_bl2u_early_platform_setup(struct meminfo
*mem_layout
, void *plat_info
)
46 /* Initialize the console to provide early debug support */
47 arm_console_boot_init();
49 generic_delay_timer_init();
52 /*******************************************************************************
53 * BL1 can pass platform dependent information to BL2U in x1.
54 * In case of ARM CSS platforms x1 contains SCP_BL2U image info.
55 * In case of ARM FVP platforms x1 is not used.
56 * In both cases, x0 contains the extents of the memory available to BL2U
57 ******************************************************************************/
58 void bl2u_early_platform_setup(struct meminfo
*mem_layout
, void *plat_info
)
60 arm_bl2u_early_platform_setup(mem_layout
, plat_info
);
63 /*******************************************************************************
64 * Perform the very early platform specific architectural setup here. At the
65 * moment this is only initializes the mmu in a quick and dirty way.
66 * The memory that is used by BL2U is only mapped.
67 ******************************************************************************/
68 void arm_bl2u_plat_arch_setup(void)
72 /* Ensure ARM platforms dont use coherent memory in BL2U */
73 assert((BL_COHERENT_RAM_END
- BL_COHERENT_RAM_BASE
) == 0U);
76 const mmap_region_t bl_regions
[] = {
86 setup_page_tables(bl_regions
, plat_arm_get_mmap());
89 enable_mmu_svc_mon(0);
96 void bl2u_plat_arch_setup(void)
98 arm_bl2u_plat_arch_setup();