aboutsummaryrefslogtreecommitdiff
path: root/src/soc/intel/quark/bootblock
diff options
context:
space:
mode:
authorLee Leahy <leroy.p.leahy@intel.com>2016-12-28 11:43:10 -0800
committerLee Leahy <leroy.p.leahy@intel.com>2017-01-03 21:04:42 +0100
commita765090f0d2f77cb099a60c23da8acaff62cb171 (patch)
tree1ea5e703e4d9c91a2478f06c166bb3e89679f448 /src/soc/intel/quark/bootblock
parent73f6a282a191c39d8f5e72e6cd2ce172821cdef4 (diff)
soc/intel/quark: Add early debugging code
Add Kconfig values and early debugging code to better segment and debug the early code in bootblock by using the SD LED as an indicator. Update the help text for the debug Kconfig values to point to the various failure locations. TEST=Build and run on Galileo Gen2 Change-Id: I1cd62eba3e9547cb1dd7f547aaec5d4827e14633 Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com> Reviewed-on: https://review.coreboot.org/17985 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/soc/intel/quark/bootblock')
-rw-r--r--src/soc/intel/quark/bootblock/bootblock.c14
-rw-r--r--src/soc/intel/quark/bootblock/esram_init.S23
2 files changed, 29 insertions, 8 deletions
diff --git a/src/soc/intel/quark/bootblock/bootblock.c b/src/soc/intel/quark/bootblock/bootblock.c
index 3c90de9636..c974cb12b4 100644
--- a/src/soc/intel/quark/bootblock/bootblock.c
+++ b/src/soc/intel/quark/bootblock/bootblock.c
@@ -22,6 +22,8 @@
#include <soc/pci_devs.h>
#include <soc/reg_access.h>
+extern void asmlinkage light_sd_led(void);
+
static const struct reg_script legacy_gpio_init[] = {
/* Temporarily enable the legacy GPIO controller */
REG_PCI_WRITE32(R_QNC_LPC_GBA_BASE, IO_ADDRESS_VALID
@@ -77,11 +79,17 @@ static const struct reg_script mtrr_init[] = {
void asmlinkage bootblock_c_entry(uint64_t base_timestamp)
{
+ if (IS_ENABLED(CONFIG_ENABLE_DEBUG_LED_BOOTBLOCK_ENTRY))
+ light_sd_led();
+
bootblock_main_with_timestamp(base_timestamp);
}
void bootblock_soc_early_init(void)
{
+ if (IS_ENABLED(CONFIG_ENABLE_DEBUG_LED_SOC_EARLY_INIT_ENTRY))
+ light_sd_led();
+
/* Initialize the MTRRs */
reg_script_run(mtrr_init);
@@ -94,10 +102,16 @@ void bootblock_soc_early_init(void)
reg_script_run_on_dev(HSUART0_BDF, hsuart_init);
if (IS_ENABLED(CONFIG_ENABLE_BUILTIN_HSUART1))
reg_script_run_on_dev(HSUART1_BDF, hsuart_init);
+
+ if (IS_ENABLED(CONFIG_ENABLE_DEBUG_LED_SOC_EARLY_INIT_EXIT))
+ light_sd_led();
}
void bootblock_soc_init(void)
{
+ if (IS_ENABLED(CONFIG_ENABLE_DEBUG_LED_SOC_INIT_ENTRY))
+ light_sd_led();
+
/* Display the MTRRs */
soc_display_mtrrs();
}
diff --git a/src/soc/intel/quark/bootblock/esram_init.S b/src/soc/intel/quark/bootblock/esram_init.S
index d982cdd2f9..f173f5c10b 100644
--- a/src/soc/intel/quark/bootblock/esram_init.S
+++ b/src/soc/intel/quark/bootblock/esram_init.S
@@ -507,14 +507,7 @@ L43:
L44:
#if IS_ENABLED(CONFIG_ENABLE_DEBUG_LED_ESRAM)
- /* Turn on SD LED to indicate ESRAM successfully initialized */
- movl $SD_HOST_CTRL, %ebx
- movb 0(%ebx), %al
- orb $1, %al
- movb %al, 0(%ebx)
-
- /* Loop forever */
- jmp .
+ jmp light_sd_led
#endif /* CONFIG_ENABLE_DEBUG_LED_ESRAM */
#endif /* CONFIG_ENABLE_DEBUG_LED */
@@ -537,3 +530,17 @@ before_carstage:
call bootblock_c_entry
/* Never reached */
+
+ .global light_sd_led
+
+light_sd_led:
+ /* Turn on SD LED to indicate ESRAM successfully initialized */
+ movl $SD_HOST_CTRL, %ebx
+ movb 0(%ebx), %al
+ orb $1, %al
+ movb %al, 0(%ebx)
+
+ /* Loop forever */
+die:
+ hlt
+ jmp die