xref: /aosp_15_r20/external/coreboot/src/soc/intel/denverton_ns/include/soc/hob_mem.h (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef _DENVERTON_NS_HOB_MEM_H
4 #define _DENVERTON_NS_HOB_MEM_H
5 
6 #include <console/console.h>
7 #include <fsp/util.h>
8 
9 void soc_display_fsp_smbios_memory_info_hob(
10 		const FSP_SMBIOS_MEMORY_INFO *memory_info_hob);
11 
12 void soc_save_dimm_info(void);
13 
14 #define FSP_SMBIOS_MEMORY_INFO_GUID	\
15 {	\
16 	0x8c, 0x10, 0xa1, 0x01, 0xee, 0x9d, 0x84, 0x49,	\
17 	0x88, 0xc3, 0xee, 0xe8, 0xc4, 0x9e, 0xfb, 0x89	\
18 }
19 
20 static inline const FSP_SMBIOS_MEMORY_INFO *
soc_get_fsp_smbios_memory_info_hob(void)21 soc_get_fsp_smbios_memory_info_hob(void)
22 {
23 	size_t hob_size;
24 	const FSP_SMBIOS_MEMORY_INFO *memory_info_hob;
25 	const uint8_t smbios_memory_info_guid[16] =
26 			FSP_SMBIOS_MEMORY_INFO_GUID;
27 
28 	/* Locate the memory info HOB */
29 	memory_info_hob = fsp_find_extension_hob_by_guid(
30 				smbios_memory_info_guid,
31 				&hob_size);
32 	if (memory_info_hob == NULL || hob_size == 0) {
33 		printk(BIOS_ERR, "SMBIOS MEMORY_INFO_DATA_HOB not found\n");
34 		return NULL;
35 	}
36 
37 	return memory_info_hob;
38 }
39 
40 #endif // _DENVERTON_NS_HOB_MEM_H
41