[PATCH 2/2] ARM: i.MX50: Record reset reason as a part of startup

Alexander Kurz akurz at blala.de
Sun May 13 22:26:50 PDT 2018


The given SRSR register location is also valid for the i.MX50.

Signed-off-by: Alexander Kurz <akurz at blala.de>
---
 arch/arm/mach-imx/imx50.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-imx/imx50.c b/arch/arm/mach-imx/imx50.c
index 6d121eaf8..f7cbc9d4b 100644
--- a/arch/arm/mach-imx/imx50.c
+++ b/arch/arm/mach-imx/imx50.c
@@ -21,6 +21,7 @@
 #include <mach/revision.h>
 #include <mach/clock-imx51_53.h>
 #include <mach/generic.h>
+#include <mach/reset-reason.h>
 
 #define SI_REV 0x48
 
@@ -49,7 +50,10 @@ static int imx50_silicon_revision(void)
 
 int imx50_init(void)
 {
+	void __iomem *src = IOMEM(MX50_SRC_BASE_ADDR);
+
 	imx50_silicon_revision();
+	imx_set_reset_reason(src + IMX_SRC_SRSR, imx_reset_reasons);
 	imx53_boot_save_loc();
 
 	return 0;
-- 
2.11.0




More information about the barebox mailing list