1 /* 2 * Copyright (c) 2024, Arm Limited and Contributors. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-2-Clause 5 */ 6 7 #ifndef MMRAM_H 8 #define MMRAM_H 9 10 #include <lib/hob/efi_types.h> 11 12 /** 13 * MMRAM states and capabilities 14 * See UEFI Platform Initialization Specification Version 1.8, IV-5.3.5 15 */ 16 #define EFI_MMRAM_OPEN U(0x00000001) 17 #define EFI_MMRAM_CLOSED U(0x00000002) 18 #define EFI_MMRAM_LOCKED U(0x00000004) 19 #define EFI_CACHEABLE U(0x00000008) 20 #define EFI_ALLOCATED U(0x00000010) 21 #define EFI_NEEDS_TESTING U(0x00000020) 22 #define EFI_NEEDS_ECC_INITIALIZATION U(0x00000040) 23 24 #define EFI_SMRAM_OPEN EFI_MMRAM_OPEN 25 #define EFI_SMRAM_CLOSED EFI_MMRAM_CLOSED 26 #define EFI_SMRAM_LOCKED EFI_MMRAM_LOCKED 27 28 struct efi_mmram_descriptor { 29 efi_physical_address_t physical_start; 30 efi_physical_address_t cpu_start; 31 uint64_t physical_size; 32 uint64_t region_state; 33 }; 34 35 /** 36 * MMRAM block descriptor 37 * This definition comes from 38 * https://github.com/tianocore/edk2/blob/master/StandaloneMmPkg/Include/Guid/MmramMemoryReserve.h 39 */ 40 struct efi_mmram_hob_descriptor_block { 41 uint32_t number_of_mm_reserved_regions; 42 struct efi_mmram_descriptor descriptor[]; 43 }; 44 45 #endif /* MMRAM_H */ 46