blob: c98715b9a2211eecd511d44c1761d9c263f6f6af [file] [log] [blame]
Antonio Nino Diazae6779e2017-11-06 14:49:04 +00001/*
Antonio Nino Diaz1f470022018-03-27 09:39:47 +01002 * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
Antonio Nino Diazae6779e2017-11-06 14:49:04 +00003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <arch.h>
8#include <arch_helpers.h>
9#include <bl_common.h>
Antonio Nino Diazae6779e2017-11-06 14:49:04 +000010#include <platform_def.h>
11#include <xlat_mmu_helpers.h>
12#include <xlat_tables_defs.h>
13
14#include "../../bl1/bl1_private.h"
15#include "rpi3_private.h"
16
17/* Data structure which holds the extents of the trusted SRAM for BL1 */
18static meminfo_t bl1_tzram_layout;
19
20meminfo_t *bl1_plat_sec_mem_layout(void)
21{
22 return &bl1_tzram_layout;
23}
24
25/*******************************************************************************
26 * Perform any BL1 specific platform actions.
27 ******************************************************************************/
28void bl1_early_platform_setup(void)
29{
30 /* Initialize the console to provide early debug support */
Antonio Nino Diaz1f470022018-03-27 09:39:47 +010031 rpi3_console_init();
Antonio Nino Diazae6779e2017-11-06 14:49:04 +000032
33 /* Allow BL1 to see the whole Trusted RAM */
34 bl1_tzram_layout.total_base = BL_RAM_BASE;
35 bl1_tzram_layout.total_size = BL_RAM_SIZE;
36}
37
38/******************************************************************************
39 * Perform the very early platform specific architecture setup. This only
40 * does basic initialization. Later architectural setup (bl1_arch_setup())
41 * does not do anything platform specific.
42 *****************************************************************************/
43void bl1_plat_arch_setup(void)
44{
45 rpi3_setup_page_tables(bl1_tzram_layout.total_base,
46 bl1_tzram_layout.total_size,
47 BL_CODE_BASE, BL1_CODE_END,
48 BL1_RO_DATA_BASE, BL1_RO_DATA_END
49#if USE_COHERENT_MEM
50 , BL_COHERENT_RAM_BASE, BL_COHERENT_RAM_END
51#endif
52 );
53
54 enable_mmu_el3(0);
55}
56
57void bl1_platform_setup(void)
58{
59 /* Initialise the IO layer and register platform IO devices */
60 plat_rpi3_io_setup();
61}