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