lib/prog_loaders: Store CBFS type in struct prog

Store the type of the loaded program after locating the file and add a
method to retrieve the type.
Will be used to distinguish between SELF and FIT payloads.

Change-Id: Ic226e7e028d722ab9e3c6f7f1c22bde2a1cd8a85
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/26028
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/lib/prog_loaders.c b/src/lib/prog_loaders.c
index 8a6d6af..04b573e 100644
--- a/src/lib/prog_loaders.c
+++ b/src/lib/prog_loaders.c
@@ -44,6 +44,8 @@
 	if (cbfs_boot_locate(&file, prog_name(prog), NULL))
 		return -1;
 
+	cbfsf_file_type(&file, &prog->cbfs_type);
+
 	cbfs_file_data(prog_rdev(prog), &file);
 
 	return 0;