[PATCH 2/5] arch/arm: mioa701 make autoboot of Linux work

Robert Jarzmik robert.jarzmik at free.fr
Tue May 15 17:21:14 EDT 2012


Make the autoboot work :
 - if no USB cuable is plugged, continue directly to
   autoboot
 - if an USB cable is plugged, wait for 3 seconds for
   any input on the USB serial gadget, and if none
   happens, continue to autoboot linux kernel
 - else interrupt autoboot and interact on barebox
   console

Signed-off-by: Robert Jarzmik <robert.jarzmik at free.fr>
---
 arch/arm/boards/mioa701/env/bin/init |   17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boards/mioa701/env/bin/init b/arch/arm/boards/mioa701/env/bin/init
index 2e806b9..494d067 100644
--- a/arch/arm/boards/mioa701/env/bin/init
+++ b/arch/arm/boards/mioa701/env/bin/init
@@ -22,12 +22,17 @@ if [ $? = 0 ]; then
 fi
 
 echo "No custom environment found"
-echo -n "Hit any key to stop autoboot: "
-timeout -a $autoboot_timeout
-if [ $? != 0 ]; then
-	echo
-	echo "Welcome to barebox console"
-	exit
+
+gpio_get_value 22
+is_usb_connected=$?
+if [ $is_usb_connected != 0 ]; then
+	echo -n "Hit any key to stop autoboot: "
+	timeout -a $autoboot_timeout
+	if [ $? != 0 ]; then
+		echo
+		echo "Welcome to barebox console"
+		exit
+	fi
 fi
 
 echo "Booting linux kernel on docg3 chip ..."
-- 
1.7.10




More information about the barebox mailing list