aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/intel/fsp2_0/hand_off_block.c
diff options
context:
space:
mode:
authorLee Leahy <leroy.p.leahy@intel.com>2016-08-01 15:47:42 -0700
committerLee Leahy <leroy.p.leahy@intel.com>2016-08-03 06:16:16 +0200
commit52d0c682bf3bb39584a1edd6e7326a6f4c1267f7 (patch)
treeca7e32dcbffa4f5b9922327347d70209139be01b /src/drivers/intel/fsp2_0/hand_off_block.c
parentac3b0a6e9f78cf7c4f2b32a6f97a42e7528aedd6 (diff)
drivers/intel/fsp2_0: Verify HOBs returned by FspMemoryInit
Verify that FSP is properly returning: * HOB list pointer * FSP_BOOTLOADER_TOLUM_HOB * FSP_RESERVED_MEMORY_RESOURCE_HOB TEST=Build and run on Galileo Gen2 Change-Id: I23005d10f7f3ccf06a2e29dab5fa11c7ed79f187 Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com> Reviewed-on: https://review.coreboot.org/15850 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/drivers/intel/fsp2_0/hand_off_block.c')
-rw-r--r--src/drivers/intel/fsp2_0/hand_off_block.c34
1 files changed, 31 insertions, 3 deletions
diff --git a/src/drivers/intel/fsp2_0/hand_off_block.c b/src/drivers/intel/fsp2_0/hand_off_block.c
index a979ac6cff..0dd4a527b1 100644
--- a/src/drivers/intel/fsp2_0/hand_off_block.c
+++ b/src/drivers/intel/fsp2_0/hand_off_block.c
@@ -34,6 +34,11 @@ enum resource_type {
};
/* GUIDs in little-endian, so they can be used with memcmp() */
+const uint8_t fsp_bootloader_tolum_guid[16] = {
+ 0x56, 0x4f, 0xff, 0x73, 0x8e, 0xaa, 0x51, 0x44,
+ 0xb3, 0x16, 0x36, 0x35, 0x36, 0x67, 0xad, 0x44,
+};
+
const uint8_t fsp_reserved_memory_guid[16] = {
0x59, 0x97, 0xa7, 0x69, 0x73, 0x13, 0x67, 0x43,
0xa6, 0xc4, 0xc7, 0xf5, 0x9e, 0xfd, 0x98, 0x6e,
@@ -146,20 +151,43 @@ struct hob_resource *find_resource_hob_by_guid(const struct hob_header *hob,
return NULL;
}
-void fsp_find_reserved_memory(struct range_entry *re)
+void fsp_print_guid(const void *base)
+{
+ uint32_t big;
+ uint16_t mid[2];
+
+ const uint8_t *id = base;
+ big = read32(id + 0);
+ mid[0] = read16(id + 4);
+ mid[1] = read16(id + 6);
+
+ printk(BIOS_SPEW, "%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]);
+}
+
+int fsp_find_range_hob(struct range_entry *re, const uint8_t guid[16])
{
const struct hob_resource *fsp_mem;
const void *hob_list = fsp_get_hob_list();
range_entry_init(re, 0, 0, 0);
- fsp_mem = find_resource_hob_by_guid(hob_list, fsp_reserved_memory_guid);
+ fsp_mem = find_resource_hob_by_guid(hob_list, guid);
if (!fsp_mem) {
- return;
+ fsp_print_guid(guid);
+ printk(BIOS_SPEW, " not found!\n");
+ return -1;
}
range_entry_init(re, fsp_mem->addr, fsp_mem->addr + fsp_mem->length, 0);
+ return 0;
+}
+
+int fsp_find_reserved_memory(struct range_entry *re)
+{
+ return fsp_find_range_hob(re, fsp_reserved_memory_guid);
}
const void *fsp_find_extension_hob_by_guid(const uint8_t *guid, size_t *size)