3112ecd9d9c5b5aa7635cd4ba0e9db7391cfe3f6
2 * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
4 * SPDX-License-Identifier: BSD-3-Clause
8 #include <platform_def.h>
9 #include <xlat_tables_v2.h>
11 #define UNIPHIER_REG_REGION_BASE 0x50000000ULL
12 #define UNIPHIER_REG_REGION_SIZE 0x20000000ULL
14 void uniphier_mmap_setup(uintptr_t total_base
, size_t total_size
,
15 const struct mmap_region
*mmap
)
17 VERBOSE("Trusted RAM seen by this BL image: %p - %p\n",
18 (void *)total_base
, (void *)(total_base
+ total_size
));
19 mmap_add_region(total_base
, total_base
,
21 MT_MEMORY
| MT_RW
| MT_SECURE
);
23 /* remap the code section */
24 VERBOSE("Code region: %p - %p\n",
25 (void *)BL_CODE_BASE
, (void *)BL_CODE_END
);
26 mmap_add_region(BL_CODE_BASE
, BL_CODE_BASE
,
27 round_up(BL_CODE_END
, PAGE_SIZE
) - BL_CODE_BASE
,
30 /* remap the coherent memory region */
31 VERBOSE("Coherent region: %p - %p\n",
32 (void *)BL_COHERENT_RAM_BASE
, (void *)BL_COHERENT_RAM_END
);
33 mmap_add_region(BL_COHERENT_RAM_BASE
, BL_COHERENT_RAM_BASE
,
34 BL_COHERENT_RAM_END
- BL_COHERENT_RAM_BASE
,
35 MT_DEVICE
| MT_RW
| MT_SECURE
);
38 mmap_add_region(UNIPHIER_REG_REGION_BASE
, UNIPHIER_REG_REGION_BASE
,
39 UNIPHIER_REG_REGION_SIZE
,
40 MT_DEVICE
| MT_RW
| MT_SECURE
);
42 /* additional regions if needed */