2016-03-07 04:16:27 +00:00
|
|
|
/*
|
2019-05-29 11:46:08 +01:00
|
|
|
* Copyright (c) 2014-2019, ARM Limited and Contributors. All rights reserved.
|
2016-03-07 04:16:27 +00:00
|
|
|
*
|
2017-05-03 09:38:09 +01:00
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
2016-03-07 04:16:27 +00:00
|
|
|
*/
|
|
|
|
|
2018-12-14 00:18:21 +00:00
|
|
|
#include <common/bl_common.h>
|
|
|
|
#include <common/debug.h>
|
|
|
|
#include <drivers/console.h>
|
2019-01-25 14:30:04 +00:00
|
|
|
#include <plat/arm/common/plat_arm.h>
|
2018-12-14 00:18:21 +00:00
|
|
|
|
2019-01-08 19:10:47 +00:00
|
|
|
#include <plat_private.h>
|
2017-07-14 10:46:32 +01:00
|
|
|
#include <platform_tsp.h>
|
2018-12-14 00:18:21 +00:00
|
|
|
|
2016-03-07 04:16:27 +00:00
|
|
|
/*******************************************************************************
|
|
|
|
* Initialize the UART
|
|
|
|
******************************************************************************/
|
|
|
|
void tsp_early_platform_setup(void)
|
|
|
|
{
|
|
|
|
/*
|
2019-05-29 11:46:08 +01:00
|
|
|
* Register a different console than already in use to display
|
2016-03-07 04:16:27 +00:00
|
|
|
* messages from TSP
|
|
|
|
*/
|
2020-01-25 00:58:35 +00:00
|
|
|
static console_t tsp_boot_console;
|
2019-05-29 11:46:08 +01:00
|
|
|
(void)console_cdns_register(ZYNQMP_UART_BASE,
|
|
|
|
zynqmp_get_uart_clk(),
|
|
|
|
ZYNQMP_UART_BAUDRATE,
|
|
|
|
&tsp_boot_console);
|
2020-01-25 00:58:35 +00:00
|
|
|
console_set_scope(&tsp_boot_console,
|
2019-05-29 11:46:08 +01:00
|
|
|
CONSOLE_FLAG_RUNTIME | CONSOLE_FLAG_BOOT);
|
2016-03-07 04:16:27 +00:00
|
|
|
|
|
|
|
/* Initialize the platform config for future decision making */
|
|
|
|
zynqmp_config_setup();
|
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* Perform platform specific setup placeholder
|
|
|
|
******************************************************************************/
|
|
|
|
void tsp_platform_setup(void)
|
|
|
|
{
|
|
|
|
plat_arm_gic_driver_init();
|
|
|
|
plat_arm_gic_init();
|
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* Perform the very early platform specific architectural setup here. At the
|
|
|
|
* moment this is only intializes the MMU
|
|
|
|
******************************************************************************/
|
|
|
|
void tsp_plat_arch_setup(void)
|
|
|
|
{
|
2018-07-06 16:54:44 +01:00
|
|
|
const mmap_region_t bl_regions[] = {
|
|
|
|
MAP_REGION_FLAT(BL32_BASE, BL32_END - BL32_BASE,
|
|
|
|
MT_MEMORY | MT_RW | MT_SECURE),
|
|
|
|
MAP_REGION_FLAT(BL_CODE_BASE, BL_CODE_END - BL_CODE_BASE,
|
|
|
|
MT_CODE | MT_SECURE),
|
|
|
|
MAP_REGION_FLAT(BL_RO_DATA_BASE, BL_RO_DATA_END - BL_RO_DATA_BASE,
|
|
|
|
MT_RO_DATA | MT_SECURE),
|
|
|
|
MAP_REGION_FLAT(BL_COHERENT_RAM_BASE,
|
|
|
|
BL_COHERENT_RAM_END - BL_COHERENT_RAM_BASE,
|
|
|
|
MT_DEVICE | MT_RW | MT_SECURE),
|
|
|
|
{0}
|
|
|
|
};
|
|
|
|
|
2018-10-19 16:44:18 +01:00
|
|
|
setup_page_tables(bl_regions, plat_arm_get_mmap());
|
2016-05-18 16:11:47 +01:00
|
|
|
enable_mmu_el1(0);
|
2016-03-07 04:16:27 +00:00
|
|
|
}
|