From e1c98a672e50fd0405686b74dad50680a75a8a9f Mon Sep 17 00:00:00 2001 From: "Ye.Li" Date: Wed, 11 Jun 2014 15:34:49 +0800 Subject: ENGR00315894-55 iMX6SX: add debug monitor support Debug monitor will print out last failed AXI access info when system reboot is caused by AXI access failure, only works when debug monitor is enabled. Enable this module on i.MX6SX. Signed-off-by: Anson Huang Signed-off-by: Ye.Li (cherry picked from commit df6ac8531d498021ed379c74fc1847bd2cec7179) Signed-off-by: Peng Fan (cherry picked from commit 4f4ecdbf6fe2673b8ad117df1a4974bdb7e6aa4a) --- arch/arm/imx-common/Kconfig | 8 ++++++++ arch/arm/imx-common/cpu.c | 12 ++++++++++++ include/configs/mx6sxsabreauto.h | 2 ++ 3 files changed, 22 insertions(+) diff --git a/arch/arm/imx-common/Kconfig b/arch/arm/imx-common/Kconfig index 6e91c7c..c75a38e 100644 --- a/arch/arm/imx-common/Kconfig +++ b/arch/arm/imx-common/Kconfig @@ -39,3 +39,11 @@ config SECURE_BOOT help This option enables the support for secure boot (HAB). See doc/README.mxc_hab for more details. + +config DBG_MONITOR + bool "Enable the AXI debug monitor" + depends on ARCH_MX6 || ARCH_MX7 + help + This option enables the debug monitor which prints out last + failed AXI access info when system reboot is caused by AXI + access failure. diff --git a/arch/arm/imx-common/cpu.c b/arch/arm/imx-common/cpu.c index b409f84..b857e5e 100644 --- a/arch/arm/imx-common/cpu.c +++ b/arch/arm/imx-common/cpu.c @@ -180,6 +180,10 @@ int print_cpuinfo(void) { u32 cpurev; __maybe_unused u32 max_freq; +#if defined(CONFIG_DBG_MONITOR) + struct dbg_monitor_regs *dbg = + (struct dbg_monitor_regs *)DEBUG_MONITOR_BASE_ADDR; +#endif cpurev = get_cpu_rev(); @@ -236,6 +240,14 @@ int print_cpuinfo(void) } #endif +#if defined(CONFIG_DBG_MONITOR) + if (readl(&dbg->snvs_addr)) + printf("DBG snvs regs addr 0x%x, data 0x%x, info 0x%x\n", + readl(&dbg->snvs_addr), + readl(&dbg->snvs_data), + readl(&dbg->snvs_info)); +#endif + printf("Reset cause: %s\n", get_reset_cause()); return 0; } diff --git a/include/configs/mx6sxsabreauto.h b/include/configs/mx6sxsabreauto.h index ece744b..0f1ce4d 100644 --- a/include/configs/mx6sxsabreauto.h +++ b/include/configs/mx6sxsabreauto.h @@ -11,6 +11,8 @@ #include "mx6_common.h" +#define CONFIG_DBG_MONITOR + /* Size of malloc() pool */ #define CONFIG_SYS_MALLOC_LEN (32 * SZ_1M) -- cgit v1.1