qemu_trp_setup.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) 2024, Arm Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <common/bl_common.h>
  7. #include <platform_def.h>
  8. #include <services/rmm_core_manifest.h>
  9. #include <services/rmmd_svc.h>
  10. #include <services/trp/platform_trp.h>
  11. #include <trp_helpers.h>
  12. #include "../qemu_private.h"
  13. /*******************************************************************************
  14. * Received from boot manifest and populated here
  15. ******************************************************************************/
  16. extern uint32_t trp_boot_manifest_version;
  17. static int qemu_trp_process_manifest(struct rmm_manifest *manifest)
  18. {
  19. /* padding field on the manifest must be RES0 */
  20. assert(manifest->padding == 0U);
  21. /* Verify the Boot Manifest Version. Only the Major is considered */
  22. if (RMMD_MANIFEST_VERSION_MAJOR !=
  23. RMMD_GET_MANIFEST_VERSION_MAJOR(manifest->version)) {
  24. return E_RMM_BOOT_MANIFEST_VERSION_NOT_SUPPORTED;
  25. }
  26. trp_boot_manifest_version = manifest->version;
  27. flush_dcache_range((uintptr_t)manifest, sizeof(struct rmm_manifest));
  28. return 0;
  29. }
  30. void trp_early_platform_setup(struct rmm_manifest *manifest)
  31. {
  32. int rc;
  33. rc = qemu_trp_process_manifest(manifest);
  34. if (rc != 0) {
  35. trp_boot_abort(rc);
  36. }
  37. qemu_console_init();
  38. }