blob: 4315c1f37c044d3b8a754e04e0d75f4d6cad7792 [file] [log] [blame]
Achin Gupta4f6ad662013-10-25 09:08:21 +01001/*
Soby Mathew0c306cc2018-01-10 15:59:31 +00002 * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
Achin Gupta4f6ad662013-10-25 09:08:21 +01003 *
dp-arm82cb2c12017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Achin Gupta4f6ad662013-10-25 09:08:21 +01005 */
6
Antonio Nino Diaz32cd95f2016-05-17 09:48:10 +01007#include <generic_delay_timer.h>
Juan Castillo540a5ba2015-12-01 16:10:15 +00008#include <mmio.h>
Dan Handley60eea552015-03-19 19:17:53 +00009#include <plat_arm.h>
Ryan Harkinb49b3222015-03-17 14:54:01 +000010#include <sp804_delay_timer.h>
11#include <v2m_def.h>
12#include "fvp_def.h"
Dan Handley5f0cdb02014-05-14 17:44:19 +010013#include "fvp_private.h"
Achin Gupta4f6ad662013-10-25 09:08:21 +010014
Soby Mathew0c306cc2018-01-10 15:59:31 +000015void bl2_early_platform_setup2(u_register_t arg0, u_register_t arg1, u_register_t arg2, u_register_t arg3)
Achin Gupta4f6ad662013-10-25 09:08:21 +010016{
Soby Mathew0c306cc2018-01-10 15:59:31 +000017 arm_bl2_early_platform_setup((meminfo_t *)arg1);
Achin Gupta4f6ad662013-10-25 09:08:21 +010018
19 /* Initialize the platform config for future decision making */
Dan Handley17a387a2014-05-15 14:53:30 +010020 fvp_config_setup();
Vikram Kanigiri6871c5d2014-05-16 18:48:12 +010021}
Ryan Harkinb49b3222015-03-17 14:54:01 +000022
23void bl2_platform_setup(void)
24{
25 arm_bl2_platform_setup();
26
Antonio Nino Diaz32cd95f2016-05-17 09:48:10 +010027#if FVP_USE_SP804_TIMER
Juan Castillo540a5ba2015-12-01 16:10:15 +000028 /* Enable the clock override for SP804 timer 0, which means that no
29 * clock dividers are applied and the raw (35 MHz) clock will be used */
30 mmio_write_32(V2M_SP810_BASE, FVP_SP810_CTRL_TIM0_OV);
31
Ryan Harkinb49b3222015-03-17 14:54:01 +000032 /* Initialize delay timer driver using SP804 dual timer 0 */
33 sp804_timer_init(V2M_SP804_TIMER0_BASE,
34 SP804_TIMER_CLKMULT, SP804_TIMER_CLKDIV);
Antonio Nino Diaz32cd95f2016-05-17 09:48:10 +010035#else
36 generic_delay_timer_init();
37#endif /* FVP_USE_SP804_TIMER */
Ryan Harkinb49b3222015-03-17 14:54:01 +000038}