From patchwork Wed Jan 16 19:25:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Hesselbarth X-Patchwork-Id: 213031 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 145122C0040 for ; Thu, 17 Jan 2013 06:34:09 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4F0B94A09D; Wed, 16 Jan 2013 20:34:05 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rL9rDzZwCkcg; Wed, 16 Jan 2013 20:34:05 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4688D4A0B5; Wed, 16 Jan 2013 20:33:59 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BDB524A052 for ; Wed, 16 Jan 2013 20:33:54 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jkOS0WWIIrXn for ; Wed, 16 Jan 2013 20:33:53 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com [209.85.214.53]) by theia.denx.de (Postfix) with ESMTPS id 242984A033 for ; Wed, 16 Jan 2013 20:33:51 +0100 (CET) Received: by mail-bk0-f53.google.com with SMTP id j5so920304bkw.26 for ; Wed, 16 Jan 2013 11:33:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=slI1/xXfe1IekUJsSaepxvbI1BbO1qx4eLnovcqXLnc=; b=QAjEebvgcm+TLTOZehY5qdbHxQPBIP4IhkElO9n0bADn7FqgY/WQsSGW2qYjmxa/82 6Vk0MSAby/mw4YkJHds1VaKo/b51xhLpR6hwaeyRlz/aIYNr/TSH2lB5C5TYhxbaIIjy 56W9bY3Y4mX1F26N0H2PGkdQlYEFjkbsq1klUh7PZQQ53kg50CRrcDY+JppIrPJjCF24 a38wDD91cVgkdoD7ceusDXM8y50NIlgKqNPl6gDbT97+7DdQSpIdzL4nZI5Ws/lwrqYC MbsfLPQK7iq+e9fFjARbxwFvEwdYQINYlPBo4StLeUBAy0dgucSN4FVfK1xlB44m3cU2 0FCw== X-Received: by 10.204.10.88 with SMTP id o24mr787875bko.19.1358364355680; Wed, 16 Jan 2013 11:25:55 -0800 (PST) Received: from nijin.lan (dslc-082-083-232-148.pools.arcor-ip.net. [82.83.232.148]) by mx.google.com with ESMTPS id y11sm16633062bkw.8.2013.01.16.11.25.53 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Jan 2013 11:25:54 -0800 (PST) From: Sebastian Hesselbarth To: Sebastian Hesselbarth Date: Wed, 16 Jan 2013 20:25:28 +0100 Message-Id: <1358364328-14904-11-git-send-email-sebastian.hesselbarth@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1358364328-14904-1-git-send-email-sebastian.hesselbarth@gmail.com> References: <1354609923-27320-1-git-send-email-sebastian.hesselbarth@gmail.com> <1358364328-14904-1-git-send-email-sebastian.hesselbarth@gmail.com> Cc: Rabeeh Khoury , Luka Perkov , u-boot@lists.denx.de, Daniel Stodden , Andy Fleming Subject: [U-Boot] [PATCH v3 10/10] tools: Add support for Dove to kwboot X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de On Dove kwboot can also be used to boot an u-boot image into RAM. In contrast to Kirkwood, Dove does not support the UART boot mode sequence but requires the UART boot mode to be selected through strap pins. The SolidRun CuBox has a push button to allow uart boot mode but fails on the boot sequence sent by kwboot. This patch adds another cmdline option to allow to send a boot image without the boot sequence and adds support for Dove. Signed-off-by: Sebastian Hesselbarth Signed-off-by: Daniel Stodden Acked-By: Prafulla Wadaskar --- Cc: u-boot@lists.denx.de Cc: Sebastian Hesselbarth Cc: Rabeeh Khoury Cc: Albert Aribaud Cc: Prafulla Wadaskar Cc: Andy Fleming Cc: Joe Hershberger Cc: Daniel Stodden Cc: Luka Perkov --- doc/kwboot.1 | 13 ++++++++++--- tools/Makefile | 2 ++ tools/kwboot.c | 25 +++++++++++++++++++------ 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/doc/kwboot.1 b/doc/kwboot.1 index 25fe69a..ab4551b 100644 --- a/doc/kwboot.1 +++ b/doc/kwboot.1 @@ -1,17 +1,18 @@ -.TH KWBOOT 1 "2012-05-19" +.TH KWBOOT 1 "2013-01-16" .SH NAME -kwboot \- Boot Marvell Kirkwood SoCs over a serial link. +kwboot \- Boot Marvell Kirkwood/Dove SoCs over a serial link. .SH SYNOPSIS .B kwboot .RB [ "-b \fIimage\fP" ] +.RB [ "-n" ] .RB [ "-p" ] .RB [ "-t" ] .RB [ "-B \fIbaudrate\fP" ] .RB \fITTY\fP .SH "DESCRIPTION" -The \fBmkimage\fP program boots boards based on Marvell's Kirkwood +The \fBmkimage\fP program boots boards based on Marvell's Kirkwood/Dove platform over their integrated UART. Boot image files will typically contain a second stage boot loader, such as U-Boot. The image file must conform to Marvell's BootROM firmware image format @@ -68,6 +69,12 @@ If standard I/O streams connect to a console, this mode will terminate after receiving 'ctrl-\\' followed by 'c' from console input. .TP +.BI "\-u" +Disables the UART boot mode sequence for platforms that do not support +it (e.g. Dove). Usually, the UART boot mode must be selected by pressing +a push button on power-up. + +.TP .BI "\-B \fIbaudrate\fP" Adjust the baud rate on \fITTY\fP. Default rate is 115200. diff --git a/tools/Makefile b/tools/Makefile index 686840a..4816812 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -72,6 +72,7 @@ BIN_FILES-$(CONFIG_SMDK5250) += mksmdk5250spl$(SFX) BIN_FILES-$(CONFIG_MX28) += mxsboot$(SFX) BIN_FILES-$(CONFIG_NETCONSOLE) += ncb$(SFX) BIN_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1$(SFX) +BIN_FILES-$(CONFIG_DOVE) += kwboot$(SFX) BIN_FILES-$(CONFIG_KIRKWOOD) += kwboot$(SFX) # Source files which exist outside the tools directory @@ -103,6 +104,7 @@ OBJ_FILES-$(CONFIG_NETCONSOLE) += ncb.o NOPED_OBJ_FILES-y += os_support.o OBJ_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1.o NOPED_OBJ_FILES-y += ublimage.o +OBJ_FILES-$(CONFIG_DOVE) += kwboot.o OBJ_FILES-$(CONFIG_KIRKWOOD) += kwboot.o # Don't build by default diff --git a/tools/kwboot.c b/tools/kwboot.c index e773f01..1e4edb6 100644 --- a/tools/kwboot.c +++ b/tools/kwboot.c @@ -37,6 +37,10 @@ static unsigned char kwboot_msg_boot[] = { 0xBB, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 }; +static unsigned char kwboot_msg_none[] = { + 0x00 +}; + #define KWBOOT_MSG_REQ_DELAY 10 /* ms */ #define KWBOOT_MSG_RSP_TIMEO 50 /* ms */ @@ -268,17 +272,21 @@ kwboot_bootmsg(int tty, void *msg) int rc; char c; - kwboot_printv("Sending boot message. Please reboot the target..."); + kwboot_printv(msg != kwboot_msg_none + ? "Sending boot message. Please reboot the target..." + : "Sensing target. Please reboot target into UART mode..."); do { rc = tcflush(tty, TCIOFLUSH); if (rc) break; - rc = kwboot_tty_send(tty, msg, 8); - if (rc) { - usleep(KWBOOT_MSG_REQ_DELAY * 1000); - continue; + if (msg != kwboot_msg_none) { + rc = kwboot_tty_send(tty, msg, 8); + if (rc) { + usleep(KWBOOT_MSG_REQ_DELAY * 1000); + continue; + } } rc = kwboot_tty_recv(tty, &c, 1, KWBOOT_MSG_RSP_TIMEO); @@ -607,6 +615,7 @@ kwboot_usage(FILE *stream, char *progname) fprintf(stream, " -b : boot \n"); fprintf(stream, " -p: patch to type 0x69 (uart boot)\n"); fprintf(stream, "\n"); + fprintf(stream, " -n: don't send boot message\n"); fprintf(stream, " -t: mini terminal\n"); fprintf(stream, "\n"); fprintf(stream, " -B : set baud rate\n"); @@ -636,7 +645,7 @@ main(int argc, char **argv) kwboot_verbose = isatty(STDOUT_FILENO); do { - int c = getopt(argc, argv, "hb:ptB:"); + int c = getopt(argc, argv, "hb:nptB:"); if (c < 0) break; @@ -646,6 +655,10 @@ main(int argc, char **argv) imgpath = optarg; break; + case 'n': + bootmsg = kwboot_msg_none; + break; + case 'p': patch = 1; break;