[PATCH 5/6] eukrea-cpuimx25: enable dfu sequence conditionaly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



this can be useful on the evaluation board but we don't want
the sequence to launch on custom board when there is not the
switch button on gpio 82

Signed-off-by: Eric Bénard <eric@xxxxxxxxxx>
---
 arch/arm/boards/eukrea_cpuimx25/env/bin/init_board | 26 ++++++++++++----------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/arch/arm/boards/eukrea_cpuimx25/env/bin/init_board b/arch/arm/boards/eukrea_cpuimx25/env/bin/init_board
index 58e07e0..8f4151c 100644
--- a/arch/arm/boards/eukrea_cpuimx25/env/bin/init_board
+++ b/arch/arm/boards/eukrea_cpuimx25/env/bin/init_board
@@ -9,24 +9,26 @@ elif [ -f /env/logo.bmp.lzo ]; then
 	fb0.enable=1
 fi
 
-gpio_get_value 82
-if [ $? -eq 0 ]; then
-	gpio_set_value 83 0
-	usbserial
-	timeout -s -a 2
+if [ ! -z $use_dfu ]; then
 	gpio_get_value 82
 	if [ $? -eq 0 ]; then
-		usbserial -d
-		dfu -V 0x1234 -P 0x1234 /dev/nand0.barebox.bb(barebox)sr,/dev/nand0.kernel.bb(kernel)r,/dev/nand0.root.bb(root)r
+		gpio_set_value 83 0
+		usbserial
+		timeout -s -a 2
 		gpio_get_value 82
 		if [ $? -eq 0 ]; then
-			usbserial
-			autoboot_timeout=60
+			usbserial -d
+			dfu -V 0x1234 -P 0x1234 /dev/nand0.barebox.bb(barebox)sr,/dev/nand0.kernel.bb(kernel)r,/dev/nand0.root.bb(root)r
+			gpio_get_value 82
+			if [ $? -eq 0 ]; then
+				usbserial
+				autoboot_timeout=60
+			else
+				reset
+			fi
 		else
-			reset
+			autoboot_timeout=28
 		fi
-	else
-		autoboot_timeout=28
 	fi
 fi
 
-- 
2.4.3


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux