sp_min_plat_setup.c 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. * Copyright (c) 2016-2019, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <assert.h>
  7. #include <platform_def.h>
  8. #include <arch_helpers.h>
  9. #include <common/bl_common.h>
  10. #include <common/debug.h>
  11. #include <common/desc_image_load.h>
  12. #include <drivers/console.h>
  13. #include <drivers/generic_delay_timer.h>
  14. #include <drivers/ti/uart/uart_16550.h>
  15. #include <lib/mmio.h>
  16. #include <plat_private.h>
  17. #include <plat/common/platform.h>
  18. static entry_point_info_t bl33_ep_info;
  19. /*******************************************************************************
  20. * Return a pointer to the 'entry_point_info' structure of the next image for
  21. * the security state specified. BL33 corresponds to the non-secure image type.
  22. * A NULL pointer is returned if the image does not exist.
  23. ******************************************************************************/
  24. entry_point_info_t *sp_min_plat_get_bl33_ep_info(void)
  25. {
  26. entry_point_info_t *next_image_info;
  27. next_image_info = &bl33_ep_info;
  28. if (next_image_info->pc == 0U) {
  29. return NULL;
  30. }
  31. return next_image_info;
  32. }
  33. #pragma weak params_early_setup
  34. void params_early_setup(u_register_t plat_param_from_bl2)
  35. {
  36. }
  37. unsigned int plat_is_my_cpu_primary(void);
  38. /*******************************************************************************
  39. * Perform any BL32 specific platform actions.
  40. ******************************************************************************/
  41. void sp_min_early_platform_setup2(u_register_t arg0, u_register_t arg1,
  42. u_register_t arg2, u_register_t arg3)
  43. {
  44. static console_t console;
  45. params_early_setup(arg1);
  46. if (rockchip_get_uart_base() != 0)
  47. console_16550_register(rockchip_get_uart_base(),
  48. rockchip_get_uart_clock(),
  49. rockchip_get_uart_baudrate(), &console);
  50. VERBOSE("sp_min_setup\n");
  51. bl31_params_parse_helper(arg0, NULL, &bl33_ep_info);
  52. }
  53. /*******************************************************************************
  54. * Perform any sp_min platform setup code
  55. ******************************************************************************/
  56. void sp_min_platform_setup(void)
  57. {
  58. generic_delay_timer_init();
  59. plat_rockchip_soc_init();
  60. /* Initialize the gic cpu and distributor interfaces */
  61. plat_rockchip_gic_driver_init();
  62. plat_rockchip_gic_init();
  63. plat_rockchip_pmu_init();
  64. }
  65. /*******************************************************************************
  66. * Perform the very early platform specific architectural setup here. At the
  67. * moment this is only initializes the mmu in a quick and dirty way.
  68. ******************************************************************************/
  69. void sp_min_plat_arch_setup(void)
  70. {
  71. plat_cci_init();
  72. plat_cci_enable();
  73. plat_configure_mmu_svc_mon(BL_CODE_BASE,
  74. BL_COHERENT_RAM_END - BL_CODE_BASE,
  75. BL_CODE_BASE,
  76. BL_CODE_END,
  77. BL_COHERENT_RAM_BASE,
  78. BL_COHERENT_RAM_END);
  79. }
  80. void sp_min_plat_fiq_handler(uint32_t id)
  81. {
  82. VERBOSE("[sp_min] interrupt #%d\n", id);
  83. }