ENGR00315894-55 iMX6SX: add debug monitor support
authorYe.Li <B37916@freescale.com>
Wed, 11 Jun 2014 07:34:49 +0000 (15:34 +0800)
committerYe Li <ye.li@nxp.com>
Thu, 29 Apr 2021 05:03:36 +0000 (22:03 -0700)
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 <b20788@freescale.com>
Signed-off-by: Ye.Li <B37916@freescale.com>
(cherry picked from commit df6ac8531d498021ed379c74fc1847bd2cec7179)
Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
(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
arch/arm/mach-imx/Kconfig
arch/arm/mach-imx/cpu.c
include/configs/mx6sxsabreauto.h
include/configs/mx6sxsabresd.h

index 2806338..e5a96bf 100644 (file)
@@ -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
index 2a3e42b..299ca13 100644 (file)
@@ -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
index 33be2f8..08e9ca0 100644 (file)
@@ -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;
 }
index 58cc3f0..787b4a7 100644 (file)
@@ -10,6 +10,8 @@
 
 #include "mx6_common.h"
 
+#define CONFIG_DBG_MONITOR
+
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN          (3 * SZ_1M)
 
index 036881f..f24ec33 100644 (file)
@@ -12,6 +12,8 @@
 
 #include "mx6_common.h"
 
+#define CONFIG_DBG_MONITOR
+
 #ifdef CONFIG_SPL
 #include "imx6_spl.h"
 #endif