mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Robert Jarzmik <robert.jarzmik@free.fr>
To: barebox@lists.infradead.org
Subject: [PATCH 2/5] arch/arm: mioa701 make autoboot of Linux work
Date: Tue, 15 May 2012 23:21:14 +0200	[thread overview]
Message-ID: <1337116877-17657-3-git-send-email-robert.jarzmik@free.fr> (raw)
In-Reply-To: <1337116877-17657-1-git-send-email-robert.jarzmik@free.fr>

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@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


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

  parent reply	other threads:[~2012-05-15 21:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-15 21:21 [PATCH 0/5] arch/arm: mioa701 linux booting Robert Jarzmik
2012-05-15 21:21 ` [PATCH 1/5] arm/board: mioa701 align kernel options with kernel mtd Robert Jarzmik
2012-05-15 21:21 ` Robert Jarzmik [this message]
2012-05-15 21:21 ` [PATCH 3/5] arch/arm: mioa701 add IPL and DPS1 updater Robert Jarzmik
2012-05-15 21:21 ` [PATCH 4/5] arch/arm: mioa701 use maximum CPU frequency Robert Jarzmik
2012-05-15 21:21 ` [PATCH 5/5] arch/arm: mioa701 improve barebox_update script Robert Jarzmik
2012-05-16 17:22 ` [PATCH 0/5] arch/arm: mioa701 linux booting Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1337116877-17657-3-git-send-email-robert.jarzmik@free.fr \
    --to=robert.jarzmik@free.fr \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox