diff options
author | Lee Leahy <leroy.p.leahy@intel.com> | 2016-07-27 07:40:25 -0700 |
---|---|---|
committer | Lee Leahy <leroy.p.leahy@intel.com> | 2016-08-03 06:15:47 +0200 |
commit | ac3b0a6e9f78cf7c4f2b32a6f97a42e7528aedd6 (patch) | |
tree | f3ec1ae156213d847e09c2b4fa61e482a607e442 /src/drivers/intel/fsp2_0/include/fsp | |
parent | e6f2f74b2977fd57f1133fdad182bb718e8b8ddc (diff) | |
download | coreboot-ac3b0a6e9f78cf7c4f2b32a6f97a42e7528aedd6.tar.xz |
drivers/intel/fsp2_0: Add display HOB support
Add support to display the HOBs returned by FSP:
* Add Kconfig value to enable HOB display
* Move hob_header, hob_resource and uuid_name structures into util.h
* Move hob_type enum into util.h
* Remove static from the debug utility functions
* Add fsp_ prefix to the debug utility functions
* Declare the debug utility functions in debug.h
* Add HOB type name table
* Add more GUID values
* Add new GUID name table for additional GUIDs
* Add routine to convert EDK-II GUID into a name
* Add SOC specific routine to handle unknown GUID types
* Add routine to convert HOB type into a name
* Add SOC specific routine to handle unknown HOB types
* Add routine to display the hobs
TEST=Build and run on Galileo Gen2
Change-Id: I10606d752859fff0f4f08a5ac03ab129b2c96d1f
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/15851
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/drivers/intel/fsp2_0/include/fsp')
-rw-r--r-- | src/drivers/intel/fsp2_0/include/fsp/debug.h | 19 | ||||
-rw-r--r-- | src/drivers/intel/fsp2_0/include/fsp/util.h | 52 |
2 files changed, 52 insertions, 19 deletions
diff --git a/src/drivers/intel/fsp2_0/include/fsp/debug.h b/src/drivers/intel/fsp2_0/include/fsp/debug.h index 21e175478f..ca433e2ea2 100644 --- a/src/drivers/intel/fsp2_0/include/fsp/debug.h +++ b/src/drivers/intel/fsp2_0/include/fsp/debug.h @@ -17,9 +17,8 @@ /* FSP debug API */ void fsp_debug_before_memory_init(fsp_memory_init_fn memory_init, const struct FSPM_UPD *fspm_old_upd, - const struct FSPM_UPD *fspm_new_upd, void **hob_list_ptr); -void fsp_debug_after_memory_init(enum fsp_status status, - const struct hob_header *hob_list_ptr); + const struct FSPM_UPD *fspm_new_upd); +void fsp_debug_after_memory_init(enum fsp_status status); void fsp_debug_before_silicon_init(fsp_silicon_init_fn silicon_init, const struct FSPS_UPD *fsps_old_upd, const struct FSPS_UPD *fsps_new_upd); @@ -29,6 +28,7 @@ void fsp_before_debug_notify(fsp_notify_fn notify, void fsp_debug_after_notify(enum fsp_status status); void fspm_display_upd_values(const struct FSPM_UPD *old, const struct FSPM_UPD *new); +void fsp_display_hobs(void); /* Callbacks for displaying UPD parameters - place in a separate file * that is conditionally build with CONFIG_DISPLAY_UPD_DATA. @@ -38,8 +38,21 @@ void soc_display_fspm_upd_params(const struct FSPM_UPD *fspm_old_upd, void soc_display_fsps_upd_params(const struct FSPS_UPD *fsps_old_upd, const struct FSPS_UPD *fsps_new_upd); +/* Callbacks for displaying HOBs - place in a separate file that is + * conditionally build with CONFIG_DISPLAY_HOBS. + */ +const char *soc_get_hob_type_name(const struct hob_header *hob); +const char *soc_get_guid_name(const uint8_t *guid); +void soc_display_hob(const struct hob_header *hob); + /* 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_memory_resource_hobs(void); +void fsp_print_resource_descriptor(const void *base); +const char *fsp_get_hob_type_name(const struct hob_header *hob); +const char *fsp_get_guid_name(const uint8_t *guid); +void fsp_print_guid_extension_hob(const struct hob_header *hob); #endif /* _FSP2_0_DEBUG_H_ */ diff --git a/src/drivers/intel/fsp2_0/include/fsp/util.h b/src/drivers/intel/fsp2_0/include/fsp/util.h index b16a6ec964..36bb7b0af9 100644 --- a/src/drivers/intel/fsp2_0/include/fsp/util.h +++ b/src/drivers/intel/fsp2_0/include/fsp/util.h @@ -29,21 +29,43 @@ struct fsp_notify_params { enum fsp_notify_phase phase; }; -/* - * Hand-off-block handling functions that depend on CBMEM, and thus can only - * be used after cbmem_initialize(). - */ -void fsp_save_hob_list(void *hob_list_ptr); +struct hob_resource { + uint8_t owner_guid[16]; + uint32_t type; + uint32_t attribute_type; + uint64_t addr; + uint64_t length; +} __attribute__((packed)); + +enum hob_type { + HOB_TYPE_HANDOFF = 0x0001, + HOB_TYPE_MEMORY_ALLOCATION = 0x0002, + HOB_TYPE_RESOURCE_DESCRIPTOR = 0x0003, + HOB_TYPE_GUID_EXTENSION = 0x0004, + HOB_TYPE_FV = 0x0005, + HOB_TYPE_CPU = 0x0006, + HOB_TYPE_MEMORY_POOL = 0x0007, + HOB_TYPE_FV2 = 0x0009, + HOB_TYPE_LOAD_PEIM_UNUSED = 0x000A, + HOB_TYPE_UCAPSULE = 0x000B, + HOB_TYPE_UNUSED = 0xFFFE, + HOB_TYPE_END_OF_HOB_LIST = 0xFFFF, +}; + +extern const uint8_t fsp_graphics_info_guid[16]; +extern const uint8_t fsp_nv_storage_guid[16]; +extern const uint8_t fsp_reserved_memory_guid[16]; + const void *fsp_get_hob_list(void); -const void *fsp_find_extension_hob_by_uuid(const uint8_t *uuid, size_t *size); +void *fsp_get_hob_list_ptr(void); +const void *fsp_find_extension_hob_by_guid(const uint8_t *guid, size_t *size); const void *fsp_find_nv_storage_data(size_t *size); enum cb_err fsp_fill_lb_framebuffer(struct lb_framebuffer *framebuffer); -/* - * Hand-off-block utilities which do not depend on CBMEM, but need to be passed - * the HOB list explicitly. - */ -void fsp_find_reserved_memory(struct range_entry *re, const void *hob_list); -void fsp_print_memory_resource_hobs(const void *hob_list); +void fsp_find_reserved_memory(struct range_entry *re); +const struct hob_resource *fsp_hob_header_to_resource( + const struct hob_header *hob); +const struct hob_header *fsp_next_hob(const struct hob_header *parent); +bool fsp_guid_compare(const uint8_t guid1[16], const uint8_t guid2[16]); /* Fill in header and validate sanity of component within region device. */ enum cb_err fsp_validate_component(struct fsp_header *hdr, @@ -65,10 +87,8 @@ void chipset_handle_reset(enum fsp_status status); typedef asmlinkage enum fsp_status (*fsp_memory_init_fn) (void *raminit_upd, void **hob_list); -typedef asmlinkage enum fsp_status (*fsp_silicon_init_fn) - (void *silicon_upd); -typedef asmlinkage enum fsp_status (*fsp_notify_fn) - (struct fsp_notify_params *); +typedef asmlinkage enum fsp_status (*fsp_silicon_init_fn)(void *silicon_upd); +typedef asmlinkage enum fsp_status (*fsp_notify_fn)(struct fsp_notify_params *); #include <fsp/debug.h> #endif /* _FSP2_0_UTIL_H_ */ |