summaryrefslogtreecommitdiff
path: root/src/soc/amd/common/fsp/fsp_validate.c
blob: 4d6a8f72bc45ace3d5d5395080649416a811a1d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* SPDX-License-Identifier: GPL-2.0-only */

#include <console/console.h>
#include <fsp/util.h>
#include <types.h>

/* Validate the FSP-M header in romstage */
void soc_validate_fspm_header(const struct fsp_header *hdr)
{
	/* Check if the image fits into the reserved memory region */
	if (hdr->image_size > CONFIG_FSP_M_SIZE)
		die("The FSP-M binary is %u bytes larger than the memory region allocated for "
			"it. Increase FSP_M_SIZE to make it fit.\n",
			hdr->image_size - CONFIG_FSP_M_SIZE);
}