diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2019-11-06 06:32:27 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2019-11-08 07:49:15 +0000 |
commit | c86fc8e63d81251a5da80ed55e4fbc9900a900d9 (patch) | |
tree | 66cefc92a8cb97ac02693b4df42ec30fb77337a8 /src/soc/intel | |
parent | 82c0e7e3d50cca20ed98d650d511071329e9f3a0 (diff) |
sb,soc/intel: Reduce preprocessor use with ME debugging
Change-Id: Iedd54730f140b6a7a40834f00d558ed99a345077
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36639
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/soc/intel')
-rw-r--r-- | src/soc/intel/broadwell/include/soc/me.h | 4 | ||||
-rw-r--r-- | src/soc/intel/broadwell/me.c | 26 | ||||
-rw-r--r-- | src/soc/intel/broadwell/me_status.c | 6 |
3 files changed, 14 insertions, 22 deletions
diff --git a/src/soc/intel/broadwell/include/soc/me.h b/src/soc/intel/broadwell/include/soc/me.h index a213e37047..69b75b49a0 100644 --- a/src/soc/intel/broadwell/include/soc/me.h +++ b/src/soc/intel/broadwell/include/soc/me.h @@ -493,11 +493,7 @@ struct me_fwcaps { void intel_me_hsio_version(uint16_t *version, uint16_t *checksum); -#if (CONFIG_DEFAULT_CONSOLE_LOGLEVEL >= BIOS_DEBUG) /* Defined in me_status.c for both romstage and ramstage */ void intel_me_status(void); -#else -static inline void intel_me_status(void) { } -#endif #endif diff --git a/src/soc/intel/broadwell/me.c b/src/soc/intel/broadwell/me.c index 6be17489e1..0461428ba5 100644 --- a/src/soc/intel/broadwell/me.c +++ b/src/soc/intel/broadwell/me.c @@ -58,11 +58,13 @@ static const char *me_bios_path_values[] = { /* MMIO base address for MEI interface */ static u8 *mei_base_address; -#if CONFIG(DEBUG_INTEL_ME) static void mei_dump(void *ptr, int dword, int offset, const char *type) { struct mei_csr *csr; + if (!CONFIG(DEBUG_INTEL_ME)) + return; + printk(BIOS_SPEW, "%-9s[%02x] : ", type, offset); switch (offset) { @@ -88,9 +90,6 @@ static void mei_dump(void *ptr, int dword, int offset, const char *type) break; } } -#else -# define mei_dump(ptr, dword, offset, type) do {} while (0) -#endif /* * ME/MEI access helpers using memcpy to avoid aliasing. @@ -483,7 +482,6 @@ static void me_print_fw_version(mbp_fw_version_name *vers_name) vers_name->hotfix_version, vers_name->build_version); } -#if CONFIG(DEBUG_INTEL_ME) static inline void print_cap(const char *name, int state) { printk(BIOS_DEBUG, "ME Capability: %-41s : %sabled\n", @@ -536,7 +534,6 @@ static void me_print_fwcaps(mbp_mefwcaps *cap) print_cap("TLS", cap->tls); print_cap("Wireless LAN (WLAN)", cap->wlan); } -#endif /* Send END OF POST message to the ME */ static int mkhi_end_of_post(void) @@ -804,9 +801,8 @@ static void intel_me_print_mbp(me_bios_payload *mbp_data) { me_print_fw_version(mbp_data->fw_version_name); -#if CONFIG(DEBUG_INTEL_ME) - me_print_fwcaps(mbp_data->fw_capabilities); -#endif + if (CONFIG(DEBUG_INTEL_ME)) + me_print_fwcaps(mbp_data->fw_capabilities); if (mbp_data->plat_time) { printk(BIOS_DEBUG, "ME: Wake Event to ME Reset: %u ms\n", @@ -912,12 +908,12 @@ static int intel_me_read_mbp(me_bios_payload *mbp_data, struct device *dev) } /* Dump out the MBP contents. */ -#if CONFIG(DEBUG_INTEL_ME) - printk(BIOS_INFO, "ME MBP: Header: items: %d, size dw: %d\n", - mbp->header.num_entries, mbp->header.mbp_size); - for (i = 0; i < mbp->header.mbp_size - 1; i++) - printk(BIOS_INFO, "ME MBP: %04x: 0x%08x\n", i, mbp->data[i]); -#endif + if (CONFIG(DEBUG_INTEL_ME)) { + printk(BIOS_INFO, "ME MBP: Header: items: %d, size dw: %d\n", + mbp->header.num_entries, mbp->header.mbp_size); + for (i = 0; i < mbp->header.mbp_size - 1; i++) + printk(BIOS_INFO, "ME MBP: %04x: 0x%08x\n", i, mbp->data[i]); + } #define ASSIGN_FIELD_PTR(field_, val_) \ { \ diff --git a/src/soc/intel/broadwell/me_status.c b/src/soc/intel/broadwell/me_status.c index 08fd48f845..1880da158b 100644 --- a/src/soc/intel/broadwell/me_status.c +++ b/src/soc/intel/broadwell/me_status.c @@ -34,8 +34,6 @@ static inline void me_read_dword_ptr(void *ptr, int offset) memcpy(ptr, &dword, sizeof(dword)); } -#if (CONFIG_DEFAULT_CONSOLE_LOGLEVEL >= BIOS_DEBUG) - /* HFS1[3:0] Current Working State Values */ static const char *me_cws_values[] = { [ME_HFS_CWS_RESET] = "Reset", @@ -210,6 +208,9 @@ static const char *me_progress_policy_values[] = { void intel_me_status(void) { + if (CONFIG_DEFAULT_CONSOLE_LOGLEVEL < BIOS_DEBUG) + return; + struct me_hfs _hfs, *hfs = &_hfs; struct me_hfs2 _hfs2, *hfs2 = &_hfs2; @@ -302,7 +303,6 @@ void intel_me_status(void) } printk(BIOS_DEBUG, "\n"); } -#endif void intel_me_hsio_version(uint16_t *version, uint16_t *checksum) { |