J-Alves | 3531578 | 2022-01-25 17:58:32 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2022 The Hafnium Authors. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style |
| 5 | * license that can be found in the LICENSE file or at |
| 6 | * https://opensource.org/licenses/BSD-3-Clause. |
| 7 | */ |
| 8 | |
| 9 | #include "hf/boot_info.h" |
| 10 | |
| 11 | #include "hf/assert.h" |
| 12 | #include "hf/dlog.h" |
| 13 | #include "hf/memiter.h" |
| 14 | #include "hf/std.h" |
| 15 | |
| 16 | #include "vmapi/hf/ffa.h" |
| 17 | |
| 18 | /** |
| 19 | * Looks for the FF-A manifest boot information node, and writes the |
| 20 | * requested information into the boot info memory. |
| 21 | */ |
| 22 | bool ffa_boot_info_node(struct fdt_node *boot_info_node, vaddr_t pkg_address, |
| 23 | struct sp_pkg_header *pkg_header) |
| 24 | { |
| 25 | struct memiter data; |
| 26 | |
| 27 | assert(boot_info_node != NULL); |
| 28 | assert(pkg_header != NULL); |
| 29 | |
| 30 | (void)pkg_address; |
| 31 | (void)pkg_header; |
| 32 | |
| 33 | if (!fdt_is_compatible(boot_info_node, "arm,ffa-manifest-boot-info")) { |
| 34 | dlog_verbose("The node 'boot-info' is not compatible.\n"); |
| 35 | return false; |
| 36 | } |
| 37 | |
| 38 | dlog_verbose(" FF-A Boot Info:\n"); |
| 39 | |
| 40 | if (fdt_read_property(boot_info_node, "ffa_manifest", &data) && |
| 41 | memiter_size(&data) == 0U) { |
| 42 | dlog_verbose(" FF-A Manifest\n"); |
| 43 | return true; |
| 44 | } |
| 45 | |
| 46 | return false; |
| 47 | } |