blob: f286061da5e16099c932c6b4a04e2c827dd18550 [file] [log] [blame]
Patrick Georgiac959032020-05-05 22:49:26 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Lee Leahy37b5ef22016-07-31 14:15:49 -07002
3#include <console/console.h>
4#include <fsp/util.h>
5
6void fsp_print_header_info(const struct fsp_header *hdr)
7{
Johnny Lin5b47d772020-11-13 17:21:25 +08008 union fsp_revision revision;
Anil Kumar57309d32021-11-11 18:56:21 -08009 union extended_fsp_revision ext_revision;
10 ext_revision.val = 0;
Julian Schroeder8a576f62021-11-02 16:32:28 -050011 int i;
Anil Kumar57309d32021-11-11 18:56:21 -080012
13 /* For FSP 2.3 and later use extended image revision field present in header
14 * for build number and revision calculation */
15 if (CONFIG(PLATFORM_USES_FSP2_3))
Julian Schroeder8a576f62021-11-02 16:32:28 -050016 ext_revision.val = hdr->extended_image_revision;
Lee Leahy37b5ef22016-07-31 14:15:49 -070017
Julian Schroeder8a576f62021-11-02 16:32:28 -050018 revision.val = hdr->image_revision;
Lee Leahyb2b97a52017-03-10 08:40:18 -080019 printk(BIOS_SPEW, "Spec version: v%u.%u\n", (hdr->spec_version >> 4),
Lee Leahy7732b352017-03-10 08:48:13 -080020 hdr->spec_version & 0xf);
Lee Leahy37b5ef22016-07-31 14:15:49 -070021 printk(BIOS_SPEW, "Revision: %u.%u.%u, Build Number %u\n",
Anil Kumar57309d32021-11-11 18:56:21 -080022 revision.rev.major,
23 revision.rev.minor,
24 ((ext_revision.rev.revision << 8) | revision.rev.revision),
25 ((ext_revision.rev.bld_num << 8) | revision.rev.bld_num));
Lee Leahy37b5ef22016-07-31 14:15:49 -070026 printk(BIOS_SPEW, "Type: %s/%s\n",
Lee Leahyb2b97a52017-03-10 08:40:18 -080027 (hdr->component_attribute & 1) ? "release" : "debug",
Benjamin Doronb339fbb2021-01-20 20:19:20 +000028 (hdr->component_attribute & 2) ? "official" : "test");
Julian Schroeder8a576f62021-11-02 16:32:28 -050029
30 printk(BIOS_SPEW, "image ID: ");
31 for (i = 0; i < FSP_IMAGE_ID_LENGTH; i++)
32 printk(BIOS_SPEW, "%c", hdr->image_id[i]);
33 printk(BIOS_SPEW, "\n");
34
35 printk(BIOS_SPEW, " base 0x%zx + 0x%zx\n",
36 (size_t)hdr->image_base, (size_t)hdr->image_size);
Lee Leahy37b5ef22016-07-31 14:15:49 -070037 printk(BIOS_SPEW, "\tConfig region 0x%zx + 0x%zx\n",
Patrick Rudolph31218a42020-11-30 15:50:06 +010038 (size_t)hdr->cfg_region_offset, (size_t)hdr->cfg_region_size);
Lee Leahy37b5ef22016-07-31 14:15:49 -070039
40 if ((hdr->component_attribute >> 12) == FSP_HDR_ATTRIB_FSPM) {
41 printk(BIOS_SPEW, "\tMemory init offset 0x%zx\n",
Julian Schroeder8a576f62021-11-02 16:32:28 -050042 (size_t)hdr->fsp_memory_init_entry_offset);
Lee Leahy37b5ef22016-07-31 14:15:49 -070043 }
44
45 if ((hdr->component_attribute >> 12) == FSP_HDR_ATTRIB_FSPS) {
46 printk(BIOS_SPEW, "\tSilicon init offset 0x%zx\n",
Julian Schroeder8a576f62021-11-02 16:32:28 -050047 (size_t)hdr->fsp_silicon_init_entry_offset);
Subrata Banik33d9c4a2020-05-26 18:26:54 +053048 if (CONFIG(PLATFORM_USES_FSP2_2))
49 printk(BIOS_SPEW, "\tMultiPhaseSiInit offset 0x%zx\n",
Julian Schroeder8a576f62021-11-02 16:32:28 -050050 (size_t)hdr->fsp_multi_phase_si_init_entry_offset);
Lee Leahy37b5ef22016-07-31 14:15:49 -070051 printk(BIOS_SPEW, "\tNotify phase offset 0x%zx\n",
Patrick Rudolph31218a42020-11-30 15:50:06 +010052 (size_t)hdr->notify_phase_entry_offset);
Lee Leahy37b5ef22016-07-31 14:15:49 -070053 }
Lee Leahy37b5ef22016-07-31 14:15:49 -070054}