brcm_common.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright (c) 2019-2020, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <assert.h>
  7. #include <arch.h>
  8. #include <arch_helpers.h>
  9. #include <common/debug.h>
  10. #include <plat/common/platform.h>
  11. #include <plat_brcm.h>
  12. #include <platform_def.h>
  13. /* Weak definitions may be overridden in specific BRCM platform */
  14. #pragma weak plat_get_ns_image_entrypoint
  15. #pragma weak plat_brcm_get_mmap
  16. uintptr_t plat_get_ns_image_entrypoint(void)
  17. {
  18. #ifdef PRELOADED_BL33_BASE
  19. return PRELOADED_BL33_BASE;
  20. #else
  21. return PLAT_BRCM_NS_IMAGE_OFFSET;
  22. #endif
  23. }
  24. uint32_t brcm_get_spsr_for_bl32_entry(void)
  25. {
  26. /*
  27. * The Secure Payload Dispatcher service is responsible for
  28. * setting the SPSR prior to entry into the BL32 image.
  29. */
  30. return 0;
  31. }
  32. uint32_t brcm_get_spsr_for_bl33_entry(void)
  33. {
  34. unsigned int mode;
  35. uint32_t spsr;
  36. /* Figure out what mode we enter the non-secure world in */
  37. mode = el_implemented(2) ? MODE_EL2 : MODE_EL1;
  38. /*
  39. * TODO: Consider the possibility of specifying the SPSR in
  40. * the FIP ToC and allowing the platform to have a say as
  41. * well.
  42. */
  43. spsr = SPSR_64(mode, MODE_SP_ELX, DISABLE_ALL_EXCEPTIONS);
  44. return spsr;
  45. }
  46. const mmap_region_t *plat_brcm_get_mmap(void)
  47. {
  48. return plat_brcm_mmap;
  49. }