Commit f778852e518e2819470e7903ec10af9462b99f40
Committed by
Ye Li
1 parent
eb335355b9
Exists in
smarc_8mq_lf_v2020.04
and in
4 other branches
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 <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)
Showing 5 changed files with 37 additions and 0 deletions Side-by-side Diff
arch/arm/include/asm/arch-mx6/imx-regs.h
... | ... | @@ -1088,6 +1088,19 @@ |
1088 | 1088 | u32 cnr; |
1089 | 1089 | }; |
1090 | 1090 | |
1091 | +struct dbg_monitor_regs { | |
1092 | + u32 ctrl[4]; /* Control */ | |
1093 | + u32 master_en[4]; /* Master enable */ | |
1094 | + u32 irq[4]; /* IRQ */ | |
1095 | + u32 trap_addr_low[4]; /* Trap address low */ | |
1096 | + u32 trap_addr_high[4]; /* Trap address high */ | |
1097 | + u32 trap_id[4]; /* Trap ID */ | |
1098 | + u32 snvs_addr[4]; /* SNVS address */ | |
1099 | + u32 snvs_data[4]; /* SNVS data */ | |
1100 | + u32 snvs_info[4]; /* SNVS info */ | |
1101 | + u32 version[4]; /* Version */ | |
1102 | +}; | |
1103 | + | |
1091 | 1104 | /* |
1092 | 1105 | * If ROM fail back to USB recover mode, USBPH0_PWD will be clear to use USB |
1093 | 1106 | * If boot from the other mode, USB0_PWD will keep reset value |
arch/arm/mach-imx/Kconfig
... | ... | @@ -137,6 +137,14 @@ |
137 | 137 | process. With this tool is possible to authenticate the |
138 | 138 | chip to the OEM's server. |
139 | 139 | |
140 | +config DBG_MONITOR | |
141 | + bool "Enable the AXI debug monitor" | |
142 | + depends on ARCH_MX6 || ARCH_MX7 | |
143 | + help | |
144 | + This option enables the debug monitor which prints out last | |
145 | + failed AXI access info when system reboot is caused by AXI | |
146 | + access failure. | |
147 | + | |
140 | 148 | config NXP_BOARD_REVISION |
141 | 149 | bool "Read NXP board revision from fuses" |
142 | 150 | depends on ARCH_MX6 || ARCH_MX7 |
arch/arm/mach-imx/cpu.c
... | ... | @@ -159,6 +159,10 @@ |
159 | 159 | { |
160 | 160 | u32 cpurev; |
161 | 161 | __maybe_unused u32 max_freq; |
162 | +#if defined(CONFIG_DBG_MONITOR) | |
163 | + struct dbg_monitor_regs *dbg = | |
164 | + (struct dbg_monitor_regs *)DEBUG_MONITOR_BASE_ADDR; | |
165 | +#endif | |
162 | 166 | |
163 | 167 | cpurev = get_cpu_rev(); |
164 | 168 | |
... | ... | @@ -217,6 +221,14 @@ |
217 | 221 | } else { |
218 | 222 | debug(" - invalid sensor device\n"); |
219 | 223 | } |
224 | +#endif | |
225 | + | |
226 | +#if defined(CONFIG_DBG_MONITOR) | |
227 | + if (readl(&dbg->snvs_addr)) | |
228 | + printf("DBG snvs regs addr 0x%x, data 0x%x, info 0x%x\n", | |
229 | + readl(&dbg->snvs_addr), | |
230 | + readl(&dbg->snvs_data), | |
231 | + readl(&dbg->snvs_info)); | |
220 | 232 | #endif |
221 | 233 | |
222 | 234 | printf("Reset cause: %s\n", get_reset_cause()); |
include/configs/mx6sxsabreauto.h
-
mentioned in commit 00e934