drivers/intel/fsp2_0: add log level parameter to fsp_print_guid

Not all functions that call fsp_print_guid print their output with the
BIOS_SPEW log level, so introduce a new log level parameter so that the
caller of fsp_print_guid can specify which log level fsp_print_guid
should use for printing the GUID.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I3b37afe703f506d4913f95a954368c0eec0f862d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69599
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Nikolai Vyssotski <nikolai.vyssotski@amd.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/drivers/intel/fsp2_0/fsp_timestamp.c b/src/drivers/intel/fsp2_0/fsp_timestamp.c
index da14db9..d3f5026 100644
--- a/src/drivers/intel/fsp2_0/fsp_timestamp.c
+++ b/src/drivers/intel/fsp2_0/fsp_timestamp.c
@@ -46,7 +46,7 @@
 static void print_guid_record(const struct generic_event_record *rec)
 {
 	printk(BIOS_INFO, "%5x\t%16llu\t\t", rec->progress_id, TIMESTAMP_MS(rec->timestamp));
-	fsp_print_guid(rec->guid);
+	fsp_print_guid(BIOS_INFO, rec->guid);
 	printk(BIOS_INFO, "\n");
 }
 
@@ -55,7 +55,7 @@
 	size_t str_len = rec->header.length - offsetof(struct generic_event_record, string);
 	printk(BIOS_INFO, "%5x\t%16llu\t\t%*s/",
 	       rec->progress_id, TIMESTAMP_MS(rec->timestamp), (int)str_len, rec->string);
-	fsp_print_guid(rec->guid);
+	fsp_print_guid(BIOS_INFO, rec->guid);
 	printk(BIOS_INFO, "\n");
 }
 
diff --git a/src/drivers/intel/fsp2_0/hand_off_block.c b/src/drivers/intel/fsp2_0/hand_off_block.c
index 2ded33699..f0f580b 100644
--- a/src/drivers/intel/fsp2_0/hand_off_block.c
+++ b/src/drivers/intel/fsp2_0/hand_off_block.c
@@ -190,7 +190,7 @@
 	return CB_ERR;
 }
 
-void fsp_print_guid(const void *base)
+void fsp_print_guid(int level, const void *base)
 {
 	uint32_t big;
 	uint16_t mid[2];
@@ -200,7 +200,7 @@
 	mid[0] = read16(id + 4);
 	mid[1] = read16(id + 6);
 
-	printk(BIOS_SPEW, "%08x-%04x-%04x-%02x%02x%02x%02x%02x%02x%02x%02x",
+	printk(level, "%08x-%04x-%04x-%02x%02x%02x%02x%02x%02x%02x%02x",
 	       big, mid[0], mid[1],
 	       id[8], id[9], id[10], id[11], id[12], id[13], id[14], id[15]);
 }
@@ -216,7 +216,7 @@
 	range_entry_init(re, 0, 0, 0);
 
 	if (fsp_hob_iterator_get_next_guid_resource(&hob_iterator, guid, &fsp_mem) != CB_SUCCESS) {
-		fsp_print_guid(guid);
+		fsp_print_guid(BIOS_SPEW, guid);
 		printk(BIOS_SPEW, " not found!\n");
 		return -1;
 	}
diff --git a/src/drivers/intel/fsp2_0/hob_display.c b/src/drivers/intel/fsp2_0/hob_display.c
index f21ebfe..9340663 100644
--- a/src/drivers/intel/fsp2_0/hob_display.c
+++ b/src/drivers/intel/fsp2_0/hob_display.c
@@ -97,7 +97,7 @@
 	printk(BIOS_SPEW, "\t0x%08llx + 0x%08llx\n", res->addr, res->length);
 	if (!fsp_guid_compare(res->owner_guid, empty_guid)) {
 		printk(BIOS_SPEW, "\tOwner GUID: ");
-		fsp_print_guid(res->owner_guid);
+		fsp_print_guid(BIOS_SPEW, res->owner_guid);
 		printk(BIOS_SPEW, " (%s)\n",
 			fsp_get_guid_name(res->owner_guid));
 	}
@@ -159,7 +159,7 @@
 
 	res = fsp_hob_header_to_resource(hob);
 	printk(BIOS_SPEW, "\t");
-	fsp_print_guid(res->owner_guid);
+	fsp_print_guid(BIOS_SPEW, res->owner_guid);
 	printk(BIOS_SPEW, ": %s\n", fsp_get_guid_name(res->owner_guid));
 
 	/* Some of the SoC FSP specific hobs are of type HOB_TYPE_GUID_EXTENSION */
diff --git a/src/drivers/intel/fsp2_0/include/fsp/debug.h b/src/drivers/intel/fsp2_0/include/fsp/debug.h
index b6f982a..044ce95 100644
--- a/src/drivers/intel/fsp2_0/include/fsp/debug.h
+++ b/src/drivers/intel/fsp2_0/include/fsp/debug.h
@@ -51,7 +51,7 @@
 /* FSP debug utility functions */
 void fsp_display_upd_value(const char *name, size_t size, uint64_t old,
 	uint64_t new);
-void fsp_print_guid(const void *guid);
+void fsp_print_guid(int level, const void *guid);
 void fsp_print_memory_resource_hobs(void);
 void fsp_print_resource_descriptor(const void *base);
 const char *fsp_get_hob_type_name(const struct hob_header *hob);
diff --git a/src/soc/intel/xeon_sp/skx/hob_display.c b/src/soc/intel/xeon_sp/skx/hob_display.c
index efe1038..9c03146 100644
--- a/src/soc/intel/xeon_sp/skx/hob_display.c
+++ b/src/soc/intel/xeon_sp/skx/hob_display.c
@@ -41,7 +41,7 @@
 	printk(BIOS_DEBUG, "\tResource type: 0x%x, attribute: 0x%x, addr: 0x%08llx, len: 0x%08llx\n",
 		res->type, res->attribute_type, res->addr, res->length);
 	printk(BIOS_DEBUG, "\tOwner GUID: ");
-	fsp_print_guid(res->owner_guid);
+	fsp_print_guid(BIOS_DEBUG, res->owner_guid);
 	printk(BIOS_DEBUG, " (%s)\n", fsp_get_guid_name(res->owner_guid));
 
 	if (fsp_guid_compare(res->owner_guid, fsp_hob_iio_uds_guid) == 0)