summaryrefslogtreecommitdiffstats
path: root/src/drivers/intel/fsp1_1/mma_core.c
blob: 6e503739ef98715919bbdbedf8f6db443040531d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* SPDX-License-Identifier: GPL-2.0-only */

#include <console/console.h>
#include <fsp/util.h>
#include <fsp/romstage.h>
#include <fsp/soc_binding.h>

#define FSP_MMA_RESULTS_GUID	{ 0x8f4e928, 0xf5f, 0x46d4, \
		{ 0x84, 0x10, 0x47, 0x9f, 0xda, 0x27, 0x9d, 0xb6 } }

int fsp_locate_mma_results(const void **mma_hob, size_t *mma_hob_size)
{
	const void *mma_hob_start;
	const EFI_GUID mma_results_guid = FSP_MMA_RESULTS_GUID;

	mma_hob_start = get_first_guid_hob(&mma_results_guid);
	if (!mma_hob_start)
		return -1;
	*mma_hob = GET_GUID_HOB_DATA(mma_hob_start);
	*mma_hob_size = GET_HOB_LENGTH(mma_hob);

	if (!(*mma_hob_size) || !(*mma_hob))
		return -1;
	return 0;
}

void setup_mma(MEMORY_INIT_UPD *memory_cfg)
{
	struct mma_config_param mma_cfg;

	if (mma_locate_param(&mma_cfg)) {
		printk(BIOS_DEBUG, "MMA: set up failed\n");
		return;
	}

	soc_update_memory_params_for_mma(memory_cfg, &mma_cfg);
	printk(BIOS_DEBUG, "MMA: set up completed successfully\n");
}