Kathleen Capella | bde3eab | 2024-12-09 14:04:43 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2024, Arm Limited and Contributors. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #ifndef HOB_H |
| 8 | #define HOB_H |
| 9 | |
| 10 | #include <lib/libc/uuid.h> |
| 11 | #include <stdbool.h> |
| 12 | #include <stdint.h> |
| 13 | |
| 14 | #include <lib/hob/efi_types.h> |
| 15 | #include <lib/utils_def.h> |
| 16 | |
| 17 | /***************************************************************************** |
| 18 | * Hob Generic Header * |
| 19 | *****************************************************************************/ |
| 20 | |
| 21 | /** |
| 22 | * HobType values of EFI_HOB_GENERIC_HEADER. |
| 23 | */ |
| 24 | #define EFI_HOB_TYPE_HANDOFF U(0x0001) |
| 25 | #define EFI_HOB_TYPE_MEMORY_ALLOCATION U(0x0002) |
| 26 | #define EFI_HOB_TYPE_RESOURCE_DESCRIPTOR U(0x0003) |
| 27 | #define EFI_HOB_TYPE_GUID_EXTENSION U(0x0004) |
| 28 | #define EFI_HOB_TYPE_FV U(0x0005) |
| 29 | #define EFI_HOB_TYPE_CPU U(0x0006) |
| 30 | #define EFI_HOB_TYPE_MEMORY_POOL U(0x0007) |
| 31 | #define EFI_HOB_TYPE_FV2 U(0x0009) |
| 32 | #define EFI_HOB_TYPE_LOAD_PEIM_UNUSED U(0x000A) |
| 33 | #define EFI_HOB_TYPE_UEFI_CAPSULE U(0x000B) |
| 34 | #define EFI_HOB_TYPE_FV3 U(0x000C) |
| 35 | #define EFI_HOB_TYPE_UNUSED U(0xFFFE) |
| 36 | #define EFI_HOB_TYPE_END_OF_HOB_LIST U(0xFFFF) |
| 37 | |
| 38 | struct efi_hob_generic_header { |
| 39 | uint16_t hob_type; |
| 40 | uint16_t hob_length; |
| 41 | uint32_t reserved; |
| 42 | }; |
| 43 | |
| 44 | /***************************************************************************** |
| 45 | * PHIT Hob. * |
| 46 | *****************************************************************************/ |
| 47 | |
| 48 | #define EFI_HOB_HANDOFF_TABLE_VERSION U(0x000a) |
| 49 | |
| 50 | struct efi_hob_handoff_info_table { |
| 51 | struct efi_hob_generic_header header; |
| 52 | uint32_t version; |
| 53 | efi_boot_mode_t boot_mode; |
| 54 | efi_physical_address_t efi_memory_top; |
| 55 | efi_physical_address_t efi_memory_bottom; |
| 56 | efi_physical_address_t efi_free_memory_top; |
| 57 | efi_physical_address_t efi_free_memory_bottom; |
| 58 | efi_physical_address_t efi_end_of_hob_list; |
| 59 | }; |
| 60 | |
| 61 | /***************************************************************************** |
| 62 | * Resource Descriptor Hob. * |
| 63 | *****************************************************************************/ |
| 64 | |
| 65 | struct efi_hob_resource_descriptor { |
| 66 | struct efi_hob_generic_header header; |
| 67 | struct efi_guid owner; |
| 68 | efi_resource_type_t resource_type; |
| 69 | efi_resource_attribute_type_t resource_attribute; |
| 70 | efi_physical_address_t physical_start; |
| 71 | uint64_t resource_length; |
| 72 | }; |
| 73 | |
| 74 | /***************************************************************************** |
| 75 | * Guid Extension Hob. * |
| 76 | *****************************************************************************/ |
| 77 | struct efi_hob_guid_type { |
| 78 | struct efi_hob_generic_header header; |
| 79 | struct efi_guid name; |
| 80 | /** |
| 81 | * Guid specific data goes here. |
| 82 | */ |
| 83 | }; |
| 84 | |
| 85 | /***************************************************************************** |
| 86 | * Firmware Volume Hob. * |
| 87 | *****************************************************************************/ |
| 88 | struct efi_hob_firmware_volume { |
| 89 | struct efi_hob_generic_header header; |
| 90 | efi_physical_address_t base_address; |
| 91 | uint64_t length; |
| 92 | }; |
| 93 | |
| 94 | /***************************************************************************** |
| 95 | * Interfaces. * |
| 96 | *****************************************************************************/ |
| 97 | |
Kathleen Capella | 8808a94 | 2025-01-07 15:45:39 -0500 | [diff] [blame] | 98 | void dump_hob_list(struct efi_hob_handoff_info_table *hob_list); |
| 99 | void dump_hob_generic_header(struct efi_hob_generic_header *header); |
Kathleen Capella | bde3eab | 2024-12-09 14:04:43 -0500 | [diff] [blame] | 100 | |
| 101 | #endif /* HOB_H */ |