juno_bl31_setup.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <assert.h>
  7. #include <common/debug.h>
  8. #include <lib/fconf/fconf.h>
  9. #include <lib/fconf/fconf_dyn_cfg_getter.h>
  10. #include <plat/arm/common/plat_arm.h>
  11. void __init bl31_early_platform_setup2(u_register_t arg0,
  12. u_register_t arg1, u_register_t arg2, u_register_t arg3)
  13. {
  14. const struct dyn_cfg_dtb_info_t *soc_fw_config_info;
  15. INFO("BL31 FCONF: FW_CONFIG address = %lx\n", (uintptr_t)arg1);
  16. /* Fill the properties struct with the info from the config dtb */
  17. fconf_populate("FW_CONFIG", arg1);
  18. soc_fw_config_info = FCONF_GET_PROPERTY(dyn_cfg, dtb, SOC_FW_CONFIG_ID);
  19. if (soc_fw_config_info != NULL) {
  20. arg1 = soc_fw_config_info->config_addr;
  21. }
  22. arm_bl31_early_platform_setup((void *)arg0, arg1, arg2, (void *)arg3);
  23. /*
  24. * Initialize Interconnect for this cluster during cold boot.
  25. * No need for locks as no other CPU is active.
  26. */
  27. plat_arm_interconnect_init();
  28. /*
  29. * Enable Interconnect coherency for the primary CPU's cluster.
  30. * Earlier bootloader stages might already do this (e.g. Trusted
  31. * Firmware's BL1 does it) but we can't assume so. There is no harm in
  32. * executing this code twice anyway.
  33. * Platform specific PSCI code will enable coherency for other
  34. * clusters.
  35. */
  36. plat_arm_interconnect_enter_coherency();
  37. }
  38. void __init bl31_plat_arch_setup(void)
  39. {
  40. arm_bl31_plat_arch_setup();
  41. /* HW_CONFIG was also loaded by BL2 */
  42. const struct dyn_cfg_dtb_info_t *hw_config_info;
  43. hw_config_info = FCONF_GET_PROPERTY(dyn_cfg, dtb, HW_CONFIG_ID);
  44. assert(hw_config_info != NULL);
  45. fconf_populate("HW_CONFIG", hw_config_info->config_addr);
  46. }