summaryrefslogtreecommitdiffstats
path: root/meta-fsl-extras/recipes/u-boot/u-boot-boundary/0002-Add-recovery-support.patch
blob: d1f5616c1abc7522fdfadccf596820cb0e5a5038 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From 33a5a73cd846c0bbf6a507aa4e658c74815eb1d7 Mon Sep 17 00:00:00 2001
From: Rainer Keller <Rainer.Keller@qt.io>
Date: Wed, 4 May 2016 12:49:40 +0200
Subject: [PATCH] Add recovery support

---
 include/configs/nitrogen6x.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
index bbc613d..9c939e6 100644
--- a/include/configs/nitrogen6x.h
+++ b/include/configs/nitrogen6x.h
@@ -232,6 +232,11 @@
 	"clearenv=if sf probe || sf probe || sf probe 1 ; then " \
 		"sf erase 0xc0000 0x2000 && " \
 		"echo restored environment to factory default ; fi\0" \
+	"recovery_boot=setenv recovery true ; dtype=mmc ; setenv bootpart 3 ; " \
+		"for disk in 0 1 ; do " \
+			"${dtype} dev ${disk} ; " \
+			"load ${dtype} ${disk}:${bootpart} 10008000 /6x_bootscript && source 10008000 ; " \
+		"done\0" \
 	"bootcmd=for dtype in ${bootdevs}" \
 		"; do " \
 			"if itest.s \"xusb\" == \"x${dtype}\" ; then " \
@@ -245,6 +250,8 @@
 					"&& source 10008000 ; " \
 			"done ; " \
 		"done; " \
+		"echo Startup failed, running recovery ; " \
+    "run recovery_boot ; " \
 		"setenv stdout serial,vga ; " \
 		"echo ; echo 6x_bootscript not found ; " \
 		"echo ; echo serial console at 115200, 8N1 ; echo ; " \
-- 
2.7.3