summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorLee Leahy <leroy.p.leahy@intel.com>2016-02-14 17:01:40 -0800
committerLeroy P Leahy <leroy.p.leahy@intel.com>2016-02-18 00:01:14 +0100
commit106053537ccfd990b678e072d5f941fb0f134e7a (patch)
treeb827d3474d0f39c60cf356b12243b0ab4c713573 /src/lib
parentb43efa694e6ec08eb6594746f57b94cb014ca553 (diff)
lib: Add Kconfig to toggle boot state debugging
Add the DEBUG_BOOT_STATE Kconfig value to enable boot state debugging. Update include/bootstate.h and lib/hardwaremain.c to honor this value. Add a dashed line which displays between the states. Testing on Galileo: * select DEBUG_BOOT_STATE in mainboard/intel/galileo/Kconfig * Build and run on Galileo Change-Id: I6e8a0085aa33c8a1394f31c030e67ab3d5bf7299 Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com> Reviewed-on: https://review.coreboot.org/13716 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/hardwaremain.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/lib/hardwaremain.c b/src/lib/hardwaremain.c
index 34340a5770..10ef96cc0b 100644
--- a/src/lib/hardwaremain.c
+++ b/src/lib/hardwaremain.c
@@ -39,12 +39,6 @@
#include <timestamp.h>
#include <thread.h>
-#if BOOT_STATE_DEBUG
-#define BS_DEBUG_LVL BIOS_DEBUG
-#else
-#define BS_DEBUG_LVL BIOS_NEVER
-#endif
-
static boot_state_t bs_pre_device(void *arg);
static boot_state_t bs_dev_init_chips(void *arg);
static boot_state_t bs_dev_enumerate(void *arg);
@@ -296,12 +290,11 @@ static void bs_call_callbacks(struct boot_state *state,
phase->callbacks = bscb->next;
bscb->next = NULL;
-#if BOOT_STATE_DEBUG
- printk(BS_DEBUG_LVL, "BS: callback (%p) @ %s.\n",
- bscb, bscb->location);
+#if IS_ENABLED(CONFIG_DEBUG_BOOT_STATE)
+ printk(BIOS_DEBUG, "BS: callback (%p) @ %s.\n",
+ bscb, bscb->location);
#endif
bscb->callback(bscb->arg);
-
continue;
}
@@ -341,7 +334,9 @@ static void bs_walk_state_machine(void)
break;
}
- printk(BS_DEBUG_LVL, "BS: Entering %s state.\n", state->name);
+ if (IS_ENABLED(CONFIG_DEBUG_BOOT_STATE))
+ printk(BIOS_DEBUG, "BS: Entering %s state.\n",
+ state->name);
bs_run_timers(0);
@@ -359,12 +354,18 @@ static void bs_walk_state_machine(void)
next_id = state->run_state(state->arg);
- printk(BS_DEBUG_LVL, "BS: Exiting %s state.\n", state->name);
+ if (IS_ENABLED(CONFIG_DEBUG_BOOT_STATE))
+ printk(BIOS_DEBUG, "BS: Exiting %s state.\n",
+ state->name);
bs_sample_time(state);
bs_call_callbacks(state, current_phase.seq);
+ if (IS_ENABLED(CONFIG_DEBUG_BOOT_STATE))
+ printk(BIOS_DEBUG,
+ "----------------------------------------\n");
+
/* Update the current phase with new state id and sequence. */
current_phase.state_id = next_id;
current_phase.seq = BS_ON_ENTRY;