aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/intel/fsp2_0/debug.c
diff options
context:
space:
mode:
authorLee Leahy <leroy.p.leahy@intel.com>2016-07-24 18:21:13 -0700
committerLee Leahy <leroy.p.leahy@intel.com>2016-08-02 17:15:22 +0200
commit672df16a493a5ddc933e8634772beedefc369a3d (patch)
tree11a1b90057550c80e1c5cec18fd15d34fa465d13 /src/drivers/intel/fsp2_0/debug.c
parent48e0792e4ae8d4267dc2d5fb6af3b2c079a4f61f (diff)
drivers/intel/fsp2_0: Display FSP calls and status
Disable the chatty FSP behavior for normal builds. Use a Kconfig value to enable the display of the FSP call entry points, the call parameters and the returned status for MemoryInit, SiliconInit and FspNotify. The debug code is placed into drivers/intel/fsp2_0/debug.c. TEST=Build and run on Galileo Gen2 Change-Id: Iacae66f72bc5b4ba1469f53fcce4669726234441 Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com> Reviewed-on: https://review.coreboot.org/15989 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/drivers/intel/fsp2_0/debug.c')
-rw-r--r--src/drivers/intel/fsp2_0/debug.c79
1 files changed, 79 insertions, 0 deletions
diff --git a/src/drivers/intel/fsp2_0/debug.c b/src/drivers/intel/fsp2_0/debug.c
new file mode 100644
index 0000000000..31fba2073f
--- /dev/null
+++ b/src/drivers/intel/fsp2_0/debug.c
@@ -0,0 +1,79 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2016 Intel Corp.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include <console/console.h>
+#include <fsp/util.h>
+
+/*-----------
+ * MemoryInit
+ *-----------
+ */
+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)
+{
+ /* Display the call entry point and paramters */
+ if (!IS_ENABLED(CONFIG_DISPLAY_FSP_CALLS_AND_STATUS))
+ return;
+ printk(BIOS_DEBUG, "Calling FspMemoryInit: 0x%p\n", memory_init);
+ printk(BIOS_SPEW, "\t0x%p: raminit_upd\n", fspm_new_upd);
+ printk(BIOS_SPEW, "\t0x%p: &hob_list_ptr\n", hob_list_ptr);
+}
+
+void fsp_debug_after_memory_init(enum fsp_status status,
+ const struct hob_header *hob_list_ptr)
+{
+ if (IS_ENABLED(CONFIG_DISPLAY_FSP_CALLS_AND_STATUS))
+ printk(BIOS_DEBUG, "FspMemoryInit returned 0x%08x\n", status);
+}
+
+/*-----------
+ * SiliconInit
+ *-----------
+ */
+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)
+{
+ /* Display the call to FSP SiliconInit */
+ if (!IS_ENABLED(CONFIG_DISPLAY_FSP_CALLS_AND_STATUS))
+ return;
+ printk(BIOS_SPEW, "Calling FspSiliconInit: 0x%p\n", silicon_init);
+ printk(BIOS_SPEW, "\t0x%p: upd\n", fsps_new_upd);
+}
+
+void fsp_debug_after_silicon_init(enum fsp_status status)
+{
+ if (IS_ENABLED(CONFIG_DISPLAY_FSP_CALLS_AND_STATUS))
+ printk(BIOS_SPEW, "FspSiliconInit returned 0x%08x\n", status);
+}
+
+/*-----------
+ * FspNotify
+ *-----------
+ */
+void fsp_before_debug_notify(fsp_notify_fn notify,
+ const struct fsp_notify_params *notify_params)
+{
+ /* Display the call to FSP SiliconInit */
+ if (!IS_ENABLED(CONFIG_DISPLAY_FSP_CALLS_AND_STATUS))
+ return;
+ printk(BIOS_SPEW, "0x%08x: notify_params->phase\n",
+ notify_params->phase);
+ printk(BIOS_SPEW, "Calling FspNotify: 0x%p\n", notify);
+ printk(BIOS_SPEW, "\t0x%p: notify_params\n", notify_params);
+}
+
+void fsp_debug_after_notify(enum fsp_status status)
+{
+ if (IS_ENABLED(CONFIG_DISPLAY_FSP_CALLS_AND_STATUS))
+ printk(BIOS_SPEW, "FspNotify returned 0x%08x\n", status);
+}