2015-12-07 13:37:10 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2015-2016, ARM Limited and Contributors. All rights reserved.
|
|
|
|
*
|
2017-05-03 09:38:09 +01:00
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
2015-12-07 13:37:10 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <assert.h>
|
2018-12-14 00:18:21 +00:00
|
|
|
|
2015-12-07 13:37:10 +00:00
|
|
|
#include <platform_def.h>
|
2018-12-14 00:18:21 +00:00
|
|
|
|
|
|
|
#include <arch.h>
|
|
|
|
#include <arch_helpers.h>
|
|
|
|
#include <common/bl_common.h>
|
|
|
|
|
2015-12-07 13:37:10 +00:00
|
|
|
#include "qemu_private.h"
|
|
|
|
|
|
|
|
/* Data structure which holds the extents of the trusted SRAM for BL1*/
|
|
|
|
static meminfo_t bl1_tzram_layout;
|
|
|
|
|
|
|
|
|
|
|
|
meminfo_t *bl1_plat_sec_mem_layout(void)
|
|
|
|
{
|
|
|
|
return &bl1_tzram_layout;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* Perform any BL1 specific platform actions.
|
|
|
|
******************************************************************************/
|
|
|
|
void bl1_early_platform_setup(void)
|
|
|
|
{
|
|
|
|
/* Initialize the console to provide early debug support */
|
2018-03-04 07:43:38 +00:00
|
|
|
qemu_console_init();
|
2015-12-07 13:37:10 +00:00
|
|
|
|
|
|
|
/* Allow BL1 to see the whole Trusted RAM */
|
|
|
|
bl1_tzram_layout.total_base = BL_RAM_BASE;
|
|
|
|
bl1_tzram_layout.total_size = BL_RAM_SIZE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* Perform the very early platform specific architecture setup. This only
|
|
|
|
* does basic initialization. Later architectural setup (bl1_arch_setup())
|
|
|
|
* does not do anything platform specific.
|
|
|
|
*****************************************************************************/
|
2019-07-09 22:02:43 +01:00
|
|
|
#ifdef __aarch64__
|
2018-02-02 12:23:22 +00:00
|
|
|
#define QEMU_CONFIGURE_BL1_MMU(...) qemu_configure_mmu_el3(__VA_ARGS__)
|
2019-07-09 22:02:43 +01:00
|
|
|
#else
|
|
|
|
#define QEMU_CONFIGURE_BL1_MMU(...) qemu_configure_mmu_svc_mon(__VA_ARGS__)
|
2018-02-02 12:23:22 +00:00
|
|
|
#endif
|
|
|
|
|
2015-12-07 13:37:10 +00:00
|
|
|
void bl1_plat_arch_setup(void)
|
|
|
|
{
|
2018-02-02 12:23:22 +00:00
|
|
|
QEMU_CONFIGURE_BL1_MMU(bl1_tzram_layout.total_base,
|
2015-12-07 13:37:10 +00:00
|
|
|
bl1_tzram_layout.total_size,
|
2018-02-28 06:36:03 +00:00
|
|
|
BL_CODE_BASE, BL1_CODE_END,
|
|
|
|
BL1_RO_DATA_BASE, BL1_RO_DATA_END,
|
2016-12-28 07:11:41 +00:00
|
|
|
BL_COHERENT_RAM_BASE, BL_COHERENT_RAM_END);
|
2015-12-07 13:37:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void bl1_platform_setup(void)
|
|
|
|
{
|
|
|
|
plat_qemu_io_setup();
|
|
|
|
}
|