Commit 32cd95f0 authored by Antonio Nino Diaz's avatar Antonio Nino Diaz
Browse files

Replace SP804 timer by generic delay timer on FVP

Added a build flag to select the generic delay timer on FVP instead
of the SP804 timer. By default, the generic one will be selected. The
user guide has been updated.

Change-Id: Ica34425c6d4ed95a187b529c612f6d3b26b78bc6
parent 0bcedb22
...@@ -492,6 +492,9 @@ map is explained in the [Firmware Design]. ...@@ -492,6 +492,9 @@ map is explained in the [Firmware Design].
Trusted Firmware is configured for dual cluster topology and this option Trusted Firmware is configured for dual cluster topology and this option
can be used to override the default value. can be used to override the default value.
* `FVP_USE_SP804_TIMER` : Use the SP804 timer instead of the Generic Timer
for functions that wait for an arbitrary time length (udelay and mdelay).
The default value is 0.
### Debugging options ### Debugging options
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#include <generic_delay_timer.h>
#include <mmio.h> #include <mmio.h>
#include <plat_arm.h> #include <plat_arm.h>
#include <sp804_delay_timer.h> #include <sp804_delay_timer.h>
...@@ -48,6 +49,7 @@ void bl2_platform_setup(void) ...@@ -48,6 +49,7 @@ void bl2_platform_setup(void)
{ {
arm_bl2_platform_setup(); arm_bl2_platform_setup();
#if FVP_USE_SP804_TIMER
/* Enable the clock override for SP804 timer 0, which means that no /* 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 */ * clock dividers are applied and the raw (35 MHz) clock will be used */
mmio_write_32(V2M_SP810_BASE, FVP_SP810_CTRL_TIM0_OV); mmio_write_32(V2M_SP810_BASE, FVP_SP810_CTRL_TIM0_OV);
...@@ -55,4 +57,7 @@ void bl2_platform_setup(void) ...@@ -55,4 +57,7 @@ void bl2_platform_setup(void)
/* Initialize delay timer driver using SP804 dual timer 0 */ /* Initialize delay timer driver using SP804 dual timer 0 */
sp804_timer_init(V2M_SP804_TIMER0_BASE, sp804_timer_init(V2M_SP804_TIMER0_BASE,
SP804_TIMER_CLKMULT, SP804_TIMER_CLKDIV); SP804_TIMER_CLKMULT, SP804_TIMER_CLKDIV);
#else
generic_delay_timer_init();
#endif /* FVP_USE_SP804_TIMER */
} }
...@@ -30,6 +30,11 @@ ...@@ -30,6 +30,11 @@
# Use the GICv3 driver on the FVP by default # Use the GICv3 driver on the FVP by default
FVP_USE_GIC_DRIVER := FVP_GICV3 FVP_USE_GIC_DRIVER := FVP_GICV3
# Use the SP804 timer instead of the generic one
FVP_USE_SP804_TIMER := 0
$(eval $(call assert_boolean,FVP_USE_SP804_TIMER))
$(eval $(call add_define,FVP_USE_SP804_TIMER))
# The FVP platform depends on this macro to build with correct GIC driver. # The FVP platform depends on this macro to build with correct GIC driver.
$(eval $(call add_define,FVP_USE_GIC_DRIVER)) $(eval $(call add_define,FVP_USE_GIC_DRIVER))
...@@ -92,8 +97,7 @@ BL1_SOURCES += drivers/io/io_semihosting.c \ ...@@ -92,8 +97,7 @@ BL1_SOURCES += drivers/io/io_semihosting.c \
${FVP_INTERCONNECT_SOURCES} ${FVP_INTERCONNECT_SOURCES}
BL2_SOURCES += drivers/arm/sp804/sp804_delay_timer.c \ BL2_SOURCES += drivers/io/io_semihosting.c \
drivers/io/io_semihosting.c \
drivers/delay_timer/delay_timer.c \ drivers/delay_timer/delay_timer.c \
lib/semihosting/semihosting.c \ lib/semihosting/semihosting.c \
lib/semihosting/aarch64/semihosting_call.S \ lib/semihosting/aarch64/semihosting_call.S \
...@@ -102,6 +106,12 @@ BL2_SOURCES += drivers/arm/sp804/sp804_delay_timer.c \ ...@@ -102,6 +106,12 @@ BL2_SOURCES += drivers/arm/sp804/sp804_delay_timer.c \
plat/arm/board/fvp/fvp_io_storage.c \ plat/arm/board/fvp/fvp_io_storage.c \
${FVP_SECURITY_SOURCES} ${FVP_SECURITY_SOURCES}
ifeq (${FVP_USE_SP804_TIMER},1)
BL2_SOURCES += drivers/arm/sp804/sp804_delay_timer.c
else
BL2_SOURCES += drivers/delay_timer/generic_delay_timer.c
endif
BL2U_SOURCES += plat/arm/board/fvp/fvp_bl2u_setup.c \ BL2U_SOURCES += plat/arm/board/fvp/fvp_bl2u_setup.c \
${FVP_SECURITY_SOURCES} ${FVP_SECURITY_SOURCES}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment