From f7da7a8bc0ec3fbdcb3020ec8699952c94dd0d8d Mon Sep 17 00:00:00 2001 From: "Ye.Li" Date: Wed, 11 Jun 2014 15:34:49 +0800 Subject: [PATCH] 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) (cherry picked from commit e1c98a672e50fd0405686b74dad50680a75a8a9f) (cherry picked from commit 5265a3052505fae2a212af292412a62b20a16f97) (cherry picked from commit 9939631045b77617572a74283dd637d5c476cd53) (cherry picked from commit f778852e518e2819470e7903ec10af9462b99f40) --- arch/arm/include/asm/arch-mx6/imx-regs.h | 13 +++++++++++++ arch/arm/mach-imx/Kconfig | 8 ++++++++ arch/arm/mach-imx/cpu.c | 12 ++++++++++++ include/configs/mx6sxsabreauto.h | 2 ++ include/configs/mx6sxsabresd.h | 2 ++ 5 files changed, 37 insertions(+) diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h b/arch/arm/include/asm/arch-mx6/imx-regs.h index 28063388b2..e5a96bfd53 100644 --- a/arch/arm/include/asm/arch-mx6/imx-regs.h +++ b/arch/arm/include/asm/arch-mx6/imx-regs.h @@ -1051,6 +1051,19 @@ struct pwm_regs { u32 cnr; }; +struct dbg_monitor_regs { + u32 ctrl[4]; /* Control */ + u32 master_en[4]; /* Master enable */ + u32 irq[4]; /* IRQ */ + u32 trap_addr_low[4]; /* Trap address low */ + u32 trap_addr_high[4]; /* Trap address high */ + u32 trap_id[4]; /* Trap ID */ + u32 snvs_addr[4]; /* SNVS address */ + u32 snvs_data[4]; /* SNVS data */ + u32 snvs_info[4]; /* SNVS info */ + u32 version[4]; /* Version */ +}; + /* * If ROM fail back to USB recover mode, USBPH0_PWD will be clear to use USB * If boot from the other mode, USB0_PWD will keep reset value diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index 2a3e42b3f7..299ca1335c 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig @@ -126,6 +126,14 @@ config FSL_MFGPROT process. With this tool is possible to authenticate the chip to the OEM's server. +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. + config NXP_BOARD_REVISION bool "Read NXP board revision from fuses" depends on ARCH_MX6 || ARCH_MX7 diff --git a/arch/arm/mach-imx/cpu.c b/arch/arm/mach-imx/cpu.c index 33be2f8485..08e9ca07ef 100644 --- a/arch/arm/mach-imx/cpu.c +++ b/arch/arm/mach-imx/cpu.c @@ -181,6 +181,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(); @@ -238,6 +242,14 @@ int print_cpuinfo(void) puts("\n"); #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 58cc3f0ee2..787b4a70e8 100644 --- a/include/configs/mx6sxsabreauto.h +++ b/include/configs/mx6sxsabreauto.h @@ -10,6 +10,8 @@ #include "mx6_common.h" +#define CONFIG_DBG_MONITOR + /* Size of malloc() pool */ #define CONFIG_SYS_MALLOC_LEN (3 * SZ_1M) diff --git a/include/configs/mx6sxsabresd.h b/include/configs/mx6sxsabresd.h index 036881f6ea..f24ec336a5 100644 --- a/include/configs/mx6sxsabresd.h +++ b/include/configs/mx6sxsabresd.h @@ -12,6 +12,8 @@ #include "mx6_common.h" +#define CONFIG_DBG_MONITOR + #ifdef CONFIG_SPL #include "imx6_spl.h" #endif -- 2.17.1