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