2015-10-14 15:28:11 +01:00
|
|
|
/*
|
2018-02-12 12:36:17 +00:00
|
|
|
* Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
|
2015-10-14 15:28:11 +01:00
|
|
|
*
|
2017-05-03 09:38:09 +01:00
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
2015-10-14 15:28:11 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <arch_helpers.h>
|
|
|
|
#include <arm_def.h>
|
|
|
|
#include <bl_common.h>
|
|
|
|
#include <console.h>
|
2018-03-06 15:22:55 +00:00
|
|
|
#include <generic_delay_timer.h>
|
2015-10-14 15:28:11 +01:00
|
|
|
#include <plat_arm.h>
|
2017-07-14 10:48:25 +01:00
|
|
|
#include <platform_def.h>
|
2018-02-12 12:36:17 +00:00
|
|
|
#include <platform.h>
|
2015-10-14 15:28:11 +01:00
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
/* Weak definitions may be overridden in specific ARM standard platform */
|
|
|
|
#pragma weak bl2u_platform_setup
|
|
|
|
#pragma weak bl2u_early_platform_setup
|
|
|
|
#pragma weak bl2u_plat_arch_setup
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Perform ARM standard platform setup for BL2U
|
|
|
|
*/
|
|
|
|
void arm_bl2u_platform_setup(void)
|
|
|
|
{
|
|
|
|
/* Initialize the secure environment */
|
|
|
|
plat_arm_security_setup();
|
|
|
|
}
|
|
|
|
|
|
|
|
void bl2u_platform_setup(void)
|
|
|
|
{
|
|
|
|
arm_bl2u_platform_setup();
|
|
|
|
}
|
|
|
|
|
|
|
|
void arm_bl2u_early_platform_setup(meminfo_t *mem_layout, void *plat_info)
|
|
|
|
{
|
|
|
|
/* Initialize the console to provide early debug support */
|
|
|
|
console_init(PLAT_ARM_BOOT_UART_BASE, PLAT_ARM_BOOT_UART_CLK_IN_HZ,
|
|
|
|
ARM_CONSOLE_BAUDRATE);
|
2018-03-06 15:22:55 +00:00
|
|
|
generic_delay_timer_init();
|
2015-10-14 15:28:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* BL1 can pass platform dependent information to BL2U in x1.
|
|
|
|
* In case of ARM CSS platforms x1 contains SCP_BL2U image info.
|
|
|
|
* In case of ARM FVP platforms x1 is not used.
|
|
|
|
* In both cases, x0 contains the extents of the memory available to BL2U
|
|
|
|
******************************************************************************/
|
|
|
|
void bl2u_early_platform_setup(meminfo_t *mem_layout, void *plat_info)
|
|
|
|
{
|
|
|
|
arm_bl2u_early_platform_setup(mem_layout, plat_info);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* Perform the very early platform specific architectural setup here. At the
|
|
|
|
* moment this is only initializes the mmu in a quick and dirty way.
|
|
|
|
* The memory that is used by BL2U is only mapped.
|
|
|
|
******************************************************************************/
|
|
|
|
void arm_bl2u_plat_arch_setup(void)
|
|
|
|
{
|
2016-06-20 10:10:40 +01:00
|
|
|
arm_setup_page_tables(BL2U_BASE,
|
2015-10-14 15:28:11 +01:00
|
|
|
BL31_LIMIT,
|
2016-07-08 14:38:16 +01:00
|
|
|
BL_CODE_BASE,
|
2017-01-17 17:10:08 +00:00
|
|
|
BL_CODE_END,
|
2016-07-08 14:38:16 +01:00
|
|
|
BL_RO_DATA_BASE,
|
2017-01-17 17:10:08 +00:00
|
|
|
BL_RO_DATA_END
|
2015-10-14 15:28:11 +01:00
|
|
|
#if USE_COHERENT_MEM
|
|
|
|
,
|
2016-12-28 07:11:41 +00:00
|
|
|
BL_COHERENT_RAM_BASE,
|
|
|
|
BL_COHERENT_RAM_END
|
2015-10-14 15:28:11 +01:00
|
|
|
#endif
|
|
|
|
);
|
2016-11-22 11:06:03 +00:00
|
|
|
#ifdef AARCH32
|
|
|
|
enable_mmu_secure(0);
|
|
|
|
#else
|
2016-05-18 16:11:47 +01:00
|
|
|
enable_mmu_el1(0);
|
2016-11-22 11:06:03 +00:00
|
|
|
#endif
|
2015-10-14 15:28:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void bl2u_plat_arch_setup(void)
|
|
|
|
{
|
|
|
|
arm_bl2u_plat_arch_setup();
|
|
|
|
}
|