Sanitise includes across codebase
[project/bcm63xx/atf.git] / plat / arm / board / fvp / fvp_bl2_setup.c
1 /*
2 * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7 #include <drivers/arm/sp804_delay_timer.h>
8 #include <drivers/generic_delay_timer.h>
9 #include <lib/mmio.h>
10 #include <plat/common/platform.h>
11
12 #include <plat_arm.h>
13 #include <v2m_def.h>
14 #include "fvp_def.h"
15 #include "fvp_private.h"
16
17 void bl2_early_platform_setup2(u_register_t arg0, u_register_t arg1, u_register_t arg2, u_register_t arg3)
18 {
19 arm_bl2_early_platform_setup((uintptr_t)arg0, (meminfo_t *)arg1);
20
21 /* Initialize the platform config for future decision making */
22 fvp_config_setup();
23 }
24
25 void bl2_platform_setup(void)
26 {
27 arm_bl2_platform_setup();
28
29 #if FVP_USE_SP804_TIMER
30 /* Enable the clock override for SP804 timer 0, which means that no
31 * clock dividers are applied and the raw (35 MHz) clock will be used */
32 mmio_write_32(V2M_SP810_BASE, FVP_SP810_CTRL_TIM0_OV);
33
34 /* Initialize delay timer driver using SP804 dual timer 0 */
35 sp804_timer_init(V2M_SP804_TIMER0_BASE,
36 SP804_TIMER_CLKMULT, SP804_TIMER_CLKDIV);
37 #else
38 generic_delay_timer_init();
39 #endif /* FVP_USE_SP804_TIMER */
40 }