tc_bl2_setup.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (c) 2021, ARM Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <assert.h>
  7. #include <common/bl_common.h>
  8. #include <common/desc_image_load.h>
  9. #include <lib/fconf/fconf.h>
  10. #include <lib/fconf/fconf_dyn_cfg_getter.h>
  11. #include <plat/arm/common/plat_arm.h>
  12. /*******************************************************************************
  13. * This function returns the list of executable images
  14. ******************************************************************************/
  15. struct bl_params *plat_get_next_bl_params(void)
  16. {
  17. struct bl_params *arm_bl_params = arm_get_next_bl_params();
  18. const struct dyn_cfg_dtb_info_t *fw_config_info;
  19. bl_mem_params_node_t *param_node;
  20. uintptr_t fw_config_base = 0U;
  21. entry_point_info_t *ep_info;
  22. /* Get BL31 image node */
  23. param_node = get_bl_mem_params_node(BL31_IMAGE_ID);
  24. assert(param_node != NULL);
  25. /* Get fw_config load address */
  26. fw_config_info = FCONF_GET_PROPERTY(dyn_cfg, dtb, FW_CONFIG_ID);
  27. assert(fw_config_info != NULL);
  28. fw_config_base = fw_config_info->config_addr;
  29. assert(fw_config_base != 0U);
  30. /*
  31. * Get the entry point info of BL31 image and override
  32. * arg1 of entry point info with fw_config base address
  33. */
  34. ep_info = &param_node->ep_info;
  35. ep_info->args.arg1 = (uint32_t)fw_config_base;
  36. return arm_bl_params;
  37. }