fvp_ve_bl2_setup.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (c) 2019, Arm Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <drivers/arm/sp804_delay_timer.h>
  7. #include <drivers/generic_delay_timer.h>
  8. #include <lib/mmio.h>
  9. #include <plat/arm/common/plat_arm.h>
  10. #include <plat/common/platform.h>
  11. #include <platform_def.h>
  12. #include "fvp_ve_private.h"
  13. void bl2_early_platform_setup2(u_register_t arg0, u_register_t arg1, u_register_t arg2, u_register_t arg3)
  14. {
  15. arm_bl2_early_platform_setup((uintptr_t)arg0, (meminfo_t *)arg1);
  16. /* Initialize the platform config for future decision making */
  17. fvp_ve_config_setup();
  18. }
  19. void bl2_platform_setup(void)
  20. {
  21. arm_bl2_platform_setup();
  22. #if USE_SP804_TIMER
  23. /*
  24. * Enable the clock override for SP804 timer 0, which means that no
  25. * clock dividers are applied and the raw (35 MHz) clock will be used
  26. */
  27. mmio_write_32(V2M_SP810_BASE, FVP_SP810_CTRL_TIM0_OV);
  28. /* Initialize delay timer driver using SP804 dual timer 0 */
  29. sp804_timer_init(V2M_SP804_TIMER0_BASE,
  30. SP804_TIMER_CLKMULT, SP804_TIMER_CLKDIV);
  31. #else
  32. generic_delay_timer_init();
  33. #endif /* USE_SP804_TIMER */
  34. }
  35. int bl2_plat_handle_post_image_load(unsigned int image_id)
  36. {
  37. return arm_bl2_plat_handle_post_image_load(image_id);
  38. }