summaryrefslogtreecommitdiff
path: root/common/board_f.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_f.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_f.c')
-rw-r--r--common/board_f.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/common/board_f.c b/common/board_f.c
index 8efdb63..ab4242a 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -53,6 +53,7 @@
#include <os.h>
#include <post.h>
#include <spi.h>
+#include <trace.h>
#include <watchdog.h>
#include <asm/errno.h>
#include <asm/io.h>
@@ -500,6 +501,18 @@ static int reserve_lcd(void)
}
#endif /* CONFIG_LCD */
+static int reserve_trace(void)
+{
+#ifdef CONFIG_TRACE
+ gd->relocaddr -= CONFIG_TRACE_BUFFER_SIZE;
+ gd->trace_buff = map_sysmem(gd->relocaddr, CONFIG_TRACE_BUFFER_SIZE);
+ debug("Reserving %dk for trace data at: %08lx\n",
+ CONFIG_TRACE_BUFFER_SIZE >> 10, gd->relocaddr);
+#endif
+
+ return 0;
+}
+
#if defined(CONFIG_VIDEO) && (!defined(CONFIG_PPC) || defined(CONFIG_8xx)) \
&& !defined(CONFIG_ARM) && !defined(CONFIG_X86)
static int reserve_video(void)
@@ -818,8 +831,9 @@ static init_fnc_t init_sequence_f[] = {
#ifdef CONFIG_SANDBOX
setup_ram_buf,
#endif
- setup_fdt,
setup_mon_len,
+ setup_fdt,
+ trace_early_init,
#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
/* TODO: can this go into arch_cpu_init()? */
probecpu,
@@ -963,6 +977,7 @@ static init_fnc_t init_sequence_f[] = {
#ifdef CONFIG_LCD
reserve_lcd,
#endif
+ reserve_trace,
/* TODO: Why the dependency on CONFIG_8xx? */
#if defined(CONFIG_VIDEO) && (!defined(CONFIG_PPC) || defined(CONFIG_8xx)) \
&& !defined(CONFIG_ARM) && !defined(CONFIG_X86)