1 /*
2  * Copyright (c) 2019, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #include <assert.h>
8 
9 #include <common/debug.h>
10 #include <lib/mmio.h>
11 #include <platform_def.h>
12 #include <plat/arm/common/arm_config.h>
13 #include <plat/arm/common/plat_arm.h>
14 
15 #define MAP_DEVICE0	MAP_REGION_FLAT(DEVICE0_BASE,			\
16 					DEVICE0_SIZE,			\
17 					MT_DEVICE | MT_RW | MT_SECURE)
18 
19 #ifdef IMAGE_BL1
20 const mmap_region_t plat_arm_mmap[] = {
21 	ARM_MAP_SHARED_RAM,
22 	V2M_MAP_FLASH1_RW,
23 	V2M_MAP_IOFPGA,
24 	{0}
25 };
26 #endif
27 #ifdef IMAGE_BL2
28 const mmap_region_t plat_arm_mmap[] = {
29 	ARM_MAP_SHARED_RAM,
30 	V2M_MAP_FLASH1_RW,
31 	V2M_MAP_IOFPGA,
32 	ARM_MAP_NS_DRAM1,
33 	{0}
34 };
35 #endif
36 #ifdef IMAGE_BL32
37 const mmap_region_t plat_arm_mmap[] = {
38 	ARM_MAP_SHARED_RAM,
39 	V2M_MAP_IOFPGA,
40 	MAP_DEVICE0,
41 	{0}
42 };
43 #endif
44 
45 ARM_CASSERT_MMAP
46 
fvp_ve_config_setup(void)47 void __init fvp_ve_config_setup(void)
48 {
49 	unsigned int sys_id, arch;
50 
51 	sys_id = mmio_read_32(V2M_SYSREGS_BASE + V2M_SYS_ID);
52 	arch = (sys_id >> V2M_SYS_ID_ARCH_SHIFT) & V2M_SYS_ID_ARCH_MASK;
53 
54 	if (arch != ARCH_MODEL_VE) {
55 		ERROR("This firmware is for FVP VE models\n");
56 		panic();
57 	}
58 }
59 
plat_get_syscnt_freq2(void)60 unsigned int plat_get_syscnt_freq2(void)
61 {
62 	return FVP_VE_TIMER_BASE_FREQUENCY;
63 }
64