2 * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
4 * SPDX-License-Identifier: BSD-3-Clause
14 #include <platform_def.h>
15 #include <platform_tsp.h>
17 #define BL32_END (unsigned long)(&__BL32_END__)
19 /* Weak definitions may be overridden in specific ARM standard platform */
20 #pragma weak tsp_early_platform_setup
21 #pragma weak tsp_platform_setup
22 #pragma weak tsp_plat_arch_setup
24 #define MAP_BL_TSP_TOTAL MAP_REGION_FLAT( \
26 BL32_END - BL32_BASE, \
27 MT_MEMORY | MT_RW | MT_SECURE)
29 /*******************************************************************************
31 ******************************************************************************/
33 static console_pl011_t arm_tsp_runtime_console
;
36 void arm_tsp_early_platform_setup(void)
40 * Initialize a different console than already in use to display
43 int rc
= console_pl011_register(PLAT_ARM_TSP_UART_BASE
,
44 PLAT_ARM_TSP_UART_CLK_IN_HZ
,
46 &arm_tsp_runtime_console
);
50 console_set_scope(&arm_tsp_runtime_console
.console
,
51 CONSOLE_FLAG_BOOT
| CONSOLE_FLAG_RUNTIME
);
53 console_init(PLAT_ARM_TSP_UART_BASE
, PLAT_ARM_TSP_UART_CLK_IN_HZ
,
54 ARM_CONSOLE_BAUDRATE
);
55 #endif /* MULTI_CONSOLE_API */
58 void tsp_early_platform_setup(void)
60 arm_tsp_early_platform_setup();
63 /*******************************************************************************
64 * Perform platform specific setup placeholder
65 ******************************************************************************/
66 void tsp_platform_setup(void)
68 plat_arm_gic_driver_init();
71 /*******************************************************************************
72 * Perform the very early platform specific architectural setup here. At the
73 * moment this is only intializes the MMU
74 ******************************************************************************/
75 void tsp_plat_arch_setup(void)
78 /* Ensure ARM platforms dont use coherent memory in TSP */
79 assert((BL_COHERENT_RAM_END
- BL_COHERENT_RAM_BASE
) == 0U);
82 const mmap_region_t bl_regions
[] = {
88 setup_page_tables(bl_regions
, plat_arm_get_mmap());