summaryrefslogtreecommitdiff
path: root/common/board_r.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2013-06-11 11:14:42 -0700
committerTom Rini <trini@ti.com>2013-06-26 10:16:41 -0400
commit71c52dba2bf42937e6c6b736393eeecb11f10d8f (patch)
tree9d16c328b39782abb71b42cfeb0dedb211016e66 /common/board_r.c
parent5c2aeac5ae3556fd75e63596740d9ce0faf7afa4 (diff)
downloadu-boot-imx-71c52dba2bf42937e6c6b736393eeecb11f10d8f.zip
u-boot-imx-71c52dba2bf42937e6c6b736393eeecb11f10d8f.tar.gz
u-boot-imx-71c52dba2bf42937e6c6b736393eeecb11f10d8f.tar.bz2
Add trace support to generic board
Add hooks for tracing to generic board, including: - allow early tracing to start early as possible in U-Boot - reserve memory for trace buffer - copy early trace buffer to main trace buffer after relocation - setup full tracing support after relocation Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/board_r.c')
-rw-r--r--common/board_r.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/common/board_r.c b/common/board_r.c
index f5649c9..f7a036e 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -58,6 +58,7 @@
#include <serial.h>
#include <spi.h>
#include <stdio_dev.h>
+#include <trace.h>
#include <watchdog.h>
#ifdef CONFIG_ADDR_MAP
#include <asm/mmu.h>
@@ -106,6 +107,15 @@ static int initr_secondary_cpu(void)
return 0;
}
+static int initr_trace(void)
+{
+#ifdef CONFIG_TRACE
+ trace_init(gd->trace_buff, CONFIG_TRACE_BUFFER_SIZE);
+#endif
+
+ return 0;
+}
+
static int initr_reloc(void)
{
gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */
@@ -711,6 +721,7 @@ static int run_main_loop(void)
* TODO: perhaps reset the watchdog in the initcall function after each call?
*/
init_fnc_t init_sequence_r[] = {
+ initr_trace,
initr_reloc,
/* TODO: could x86/PPC have this also perhaps? */
#ifdef CONFIG_ARM