blob: 7e1d4e207946c1cdccbff91fc2ee10e433c34f43 [file] [log] [blame]
Nariman Poushin0ece80f2018-02-26 06:52:04 +00001/*
2 * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <arm_def.h>
8#include <bl_common.h>
9#include <ccn.h>
10#include <debug.h>
11#include <plat_arm.h>
12#include <platform.h>
13#include "../../../../bl1/bl1_private.h"
14
15#if USE_COHERENT_MEM
16/*
17 * The next 2 constants identify the extents of the coherent memory region.
18 * These addresses are used by the MMU setup code and therefore they must be
19 * page-aligned. It is the responsibility of the linker script to ensure that
20 * __COHERENT_RAM_START__ and __COHERENT_RAM_END__ linker symbols
21 * refer to page-aligned addresses.
22 */
23#define BL1_COHERENT_RAM_BASE (unsigned long)(&__COHERENT_RAM_START__)
24#define BL1_COHERENT_RAM_LIMIT (unsigned long)(&__COHERENT_RAM_END__)
25#define BL2_COHERENT_RAM_BASE (unsigned long)(&__COHERENT_RAM_START__)
26#define BL2_COHERENT_RAM_LIMIT (unsigned long)(&__COHERENT_RAM_END__)
27
28#define BL31_COHERENT_RAM_BASE (uintptr_t)(&__COHERENT_RAM_START__)
29#define BL31_COHERENT_RAM_LIMIT (uintptr_t)(&__COHERENT_RAM_END__)
30#endif
31
32#define SGI_MAP_FLASH0_RO MAP_REGION_FLAT(V2M_FLASH0_BASE,\
33 V2M_FLASH0_SIZE, \
34 MT_DEVICE | MT_RO | MT_SECURE)
35/*
36 * Table of regions for different BL stages to map using the MMU.
37 * This doesn't include Trusted RAM as the 'mem_layout' argument passed to
38 * arm_configure_mmu_elx() will give the available subset of that.
39 *
40 * Replace or extend the below regions as required
41 */
42#if IMAGE_BL1
43const mmap_region_t plat_arm_mmap[] = {
44 ARM_MAP_SHARED_RAM,
45 SGI_MAP_FLASH0_RO,
46 CSS_SGI_MAP_DEVICE,
47 SOC_CSS_MAP_DEVICE,
48 {0}
49};
50#endif
51#if IMAGE_BL2
52const mmap_region_t plat_arm_mmap[] = {
53 ARM_MAP_SHARED_RAM,
54 SGI_MAP_FLASH0_RO,
55 CSS_SGI_MAP_DEVICE,
56 SOC_CSS_MAP_DEVICE,
57 ARM_MAP_NS_DRAM1,
58#if ARM_BL31_IN_DRAM
59 ARM_MAP_BL31_SEC_DRAM,
60#endif
61 {0}
62};
63#endif
64#if IMAGE_BL31
65const mmap_region_t plat_arm_mmap[] = {
66 ARM_MAP_SHARED_RAM,
67 V2M_MAP_IOFPGA,
68 CSS_SGI_MAP_DEVICE,
69 SOC_CSS_MAP_DEVICE,
70 {0}
71};
72#endif
73
74ARM_CASSERT_MMAP