x86: slimbootloader: Add memory configuration
[oweals/u-boot.git] / arch / x86 / include / asm / arch-slimbootloader / slimbootloader.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2019 Intel Corporation <www.intel.com>
4  */
5
6 #ifndef __SLIMBOOTLOADER_ARCH_H__
7 #define __SLIMBOOTLOADER_ARCH_H__
8
9 #include <common.h>
10 #include <asm/hob.h>
11
12 /**
13  * A GUID to get MemoryMap info hob which is provided by Slim Bootloader
14  */
15 #define SBL_MEMORY_MAP_INFO_GUID \
16         EFI_GUID(0xa1ff7424, 0x7a1a, 0x478e, \
17                 0xa9, 0xe4, 0x92, 0xf3, 0x57, 0xd1, 0x28, 0x32)
18
19 /**
20  * A single entry of memory map information
21  *
22  * @addr: start address of a memory map entry
23  * @size: size of a memory map entry
24  * @type: usable:1, reserved:2, acpi:3, nvs:4, unusable:5
25  * @flag: only used in Slim Bootloader
26  * @rsvd: padding for alignment
27  */
28 struct sbl_memory_map_entry {
29         u64     addr;
30         u64     size;
31         u8      type;
32         u8      flag;
33         u8      rsvd[6];
34 };
35
36 /**
37  * This includes all memory map entries which is sorted based on physical start
38  * address, from low to high, and carved out reserved, acpi nvs, acpi reclaim
39  * and usable memory.
40  *
41  * @rev  : revision of memory_map_info structure. currently 1.
42  * @rsvd : padding for alignment
43  * @count: the number of memory map entries
44  * @entry: array of all memory map entries
45  */
46 struct sbl_memory_map_info {
47         u8      rev;
48         u8      rsvd[3];
49         u32     count;
50         struct sbl_memory_map_entry     entry[0];
51 };
52
53 #endif /* __SLIMBOOTLOADER_ARCH_H__ */