Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 1 | /* |
Soby Mathew | 7d5a2e7 | 2018-01-10 15:59:31 +0000 | [diff] [blame] | 2 | * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved. |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 5 | */ |
| 6 | |
Antonio Nino Diaz | 664adb6 | 2016-05-17 09:48:10 +0100 | [diff] [blame] | 7 | #include <generic_delay_timer.h> |
Juan Castillo | fd383b4 | 2015-12-01 16:10:15 +0000 | [diff] [blame] | 8 | #include <mmio.h> |
Dan Handley | 2b6b574 | 2015-03-19 19:17:53 +0000 | [diff] [blame] | 9 | #include <plat_arm.h> |
Soby Mathew | cc36484 | 2018-02-21 01:16:39 +0000 | [diff] [blame] | 10 | #include <platform.h> |
Ryan Harkin | f96fc8f | 2015-03-17 14:54:01 +0000 | [diff] [blame] | 11 | #include <sp804_delay_timer.h> |
| 12 | #include <v2m_def.h> |
| 13 | #include "fvp_def.h" |
Dan Handley | ed6ff95 | 2014-05-14 17:44:19 +0100 | [diff] [blame] | 14 | #include "fvp_private.h" |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 15 | |
Soby Mathew | 7d5a2e7 | 2018-01-10 15:59:31 +0000 | [diff] [blame] | 16 | void bl2_early_platform_setup2(u_register_t arg0, u_register_t arg1, u_register_t arg2, u_register_t arg3) |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 17 | { |
Soby Mathew | 96a1c6b | 2018-01-15 14:45:33 +0000 | [diff] [blame] | 18 | arm_bl2_early_platform_setup((uintptr_t)arg0, (meminfo_t *)arg1); |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 19 | |
| 20 | /* Initialize the platform config for future decision making */ |
Dan Handley | ea45157 | 2014-05-15 14:53:30 +0100 | [diff] [blame] | 21 | fvp_config_setup(); |
Vikram Kanigiri | d8c9d26 | 2014-05-16 18:48:12 +0100 | [diff] [blame] | 22 | } |
Ryan Harkin | f96fc8f | 2015-03-17 14:54:01 +0000 | [diff] [blame] | 23 | |
| 24 | void bl2_platform_setup(void) |
| 25 | { |
| 26 | arm_bl2_platform_setup(); |
| 27 | |
Antonio Nino Diaz | 664adb6 | 2016-05-17 09:48:10 +0100 | [diff] [blame] | 28 | #if FVP_USE_SP804_TIMER |
Juan Castillo | fd383b4 | 2015-12-01 16:10:15 +0000 | [diff] [blame] | 29 | /* Enable the clock override for SP804 timer 0, which means that no |
| 30 | * clock dividers are applied and the raw (35 MHz) clock will be used */ |
| 31 | mmio_write_32(V2M_SP810_BASE, FVP_SP810_CTRL_TIM0_OV); |
| 32 | |
Ryan Harkin | f96fc8f | 2015-03-17 14:54:01 +0000 | [diff] [blame] | 33 | /* Initialize delay timer driver using SP804 dual timer 0 */ |
| 34 | sp804_timer_init(V2M_SP804_TIMER0_BASE, |
| 35 | SP804_TIMER_CLKMULT, SP804_TIMER_CLKDIV); |
Antonio Nino Diaz | 664adb6 | 2016-05-17 09:48:10 +0100 | [diff] [blame] | 36 | #else |
| 37 | generic_delay_timer_init(); |
| 38 | #endif /* FVP_USE_SP804_TIMER */ |
Ryan Harkin | f96fc8f | 2015-03-17 14:54:01 +0000 | [diff] [blame] | 39 | } |