fvp_bl2_setup.c 1.05 KB
Newer Older
1
/*
2
 * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
3
 *
dp-arm's avatar
dp-arm committed
4
 * SPDX-License-Identifier: BSD-3-Clause
5
6
 */

7
#include <generic_delay_timer.h>
Juan Castillo's avatar
Juan Castillo committed
8
#include <mmio.h>
9
#include <plat_arm.h>
Ryan Harkin's avatar
Ryan Harkin committed
10
11
12
#include <sp804_delay_timer.h>
#include <v2m_def.h>
#include "fvp_def.h"
13
#include "fvp_private.h"
14

15
void bl2_early_platform_setup2(u_register_t arg0, u_register_t arg1, u_register_t arg2, u_register_t arg3)
16
{
17
	arm_bl2_early_platform_setup((uintptr_t)arg0, (meminfo_t *)arg1);
18
19

	/* Initialize the platform config for future decision making */
20
	fvp_config_setup();
21
}
Ryan Harkin's avatar
Ryan Harkin committed
22
23
24
25
26

void bl2_platform_setup(void)
{
	arm_bl2_platform_setup();

27
#if FVP_USE_SP804_TIMER
Juan Castillo's avatar
Juan Castillo committed
28
29
30
31
	/* Enable the clock override for SP804 timer 0, which means that no
	 * clock dividers are applied and the raw (35 MHz) clock will be used */
	mmio_write_32(V2M_SP810_BASE, FVP_SP810_CTRL_TIM0_OV);

Ryan Harkin's avatar
Ryan Harkin committed
32
33
34
	/* Initialize delay timer driver using SP804 dual timer 0 */
	sp804_timer_init(V2M_SP804_TIMER0_BASE,
			SP804_TIMER_CLKMULT, SP804_TIMER_CLKDIV);
35
36
37
#else
	generic_delay_timer_init();
#endif /* FVP_USE_SP804_TIMER */
Ryan Harkin's avatar
Ryan Harkin committed
38
}