From patchwork Wed Dec 5 22:15:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Stodden X-Patchwork-Id: 203980 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 5EAD32C00A9 for ; Thu, 6 Dec 2012 09:15:47 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0EEFC4A0F7; Wed, 5 Dec 2012 23:15:44 +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 uUAOB41dSZ3O; Wed, 5 Dec 2012 23:15:43 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1D4AA4A0C6; Wed, 5 Dec 2012 23:15:42 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D68EB4A0C6 for ; Wed, 5 Dec 2012 23:15:38 +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 6u-QDn05gz7o for ; Wed, 5 Dec 2012 23:15:37 +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-pb0-f44.google.com (mail-pb0-f44.google.com [209.85.160.44]) by theia.denx.de (Postfix) with ESMTPS id 4A3044A0C5 for ; Wed, 5 Dec 2012 23:15:34 +0100 (CET) Received: by mail-pb0-f44.google.com with SMTP id uo1so3792273pbc.3 for ; Wed, 05 Dec 2012 14:15:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :content-type:x-mailer:mime-version; bh=YK6lYwmwwc2vl8BqBImXRVG/qYLRAjbPdzyYxNyZCe8=; b=dBWwgIkJK7tUehwT0Y88d7T+lEtNxI0WiawgvtW4VrsfAuth4ZpRne4akr9JzWT/GE xmzjlmJVTnov2nlQGJ5uze3FTSmejbKspJ8wudLdpVEmZiOsmEYG2jupcMsLWunC6epb zy+qSJRlFEbqmFQq6WSUs4Nw6Lx6ljRv4XBbVplI3ERTedcWlwF9/vp33Qn3ifR7EpJY KRZ+a9CIhxugj5ygrPZg2hmloxJx+vTVdG1ki1s3AKIaEJYuPQwkWrdAvAcGTIz8IR69 jjvv925oOModU7I7I3yuGVw/ZIJZjwNHk5MLU6OCplNSQ3ginZQtYgRKAOAtDYEuCw7q rcHQ== Received: by 10.68.189.102 with SMTP id gh6mr160737pbc.37.1354745732698; Wed, 05 Dec 2012 14:15:32 -0800 (PST) Received: from [10.128.0.140] (S01060050568d178e.vc.shawcable.net. [24.85.224.3]) by mx.google.com with ESMTPS id xk2sm3532691pbc.45.2012.12.05.14.15.30 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 05 Dec 2012 14:15:31 -0800 (PST) Message-ID: <1354745722.7112.352.camel@espiritosanto.int.convergent.io> From: Daniel Stodden To: Luka Perkov Date: Wed, 05 Dec 2012 14:15:22 -0800 In-Reply-To: <20121202191514-1245@mutt-kz> References: <1354458982-14403-1-git-send-email-sebastian.hesselbarth@gmail.com> <1354458982-14403-11-git-send-email-sebastian.hesselbarth@gmail.com> <20121202191514-1245@mutt-kz> X-Mailer: Evolution 3.2.3-0ubuntu6 Mime-Version: 1.0 Cc: Dieter@theia.denx.de, Kiermaier , Rabeeh Khoury , u-boot@lists.denx.de, Andy Fleming Subject: Re: [U-Boot] [PATCH 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de On Sun, 2012-12-02 at 20:15 +0100, Luka Perkov wrote: > Hi Sebastian, > > On Sun, Dec 02, 2012 at 03:36:22PM +0100, Sebastian Hesselbarth wrote: > > 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 > > --- > > 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: Dieter Kiermaier > > --- > > tools/Makefile | 2 ++ > > tools/kwboot.c | 44 ++++++++++++++++++++++++++++++++++++++++---- > > 2 files changed, 42 insertions(+), 4 deletions(-) > > Please update the documentation too (doc/kwboot.1). Second that. Hey Sebastian, since the protocol remains the same, and just doesn't take a boot message while polling, better to keep the bootmsg_call() intact and just make the option parsing flip the message type? The original BootROM had a couple more message, the tool just no immediate use for that. Eventual options to change message type wasn't unanticipated. Ok, no message at all was. Sketchy patch attached for your consideration. Beware, I can't test it right now. Also, while I've got nothing against adding a flag for that, I'm partly wondering whether this took a patch at all -- what's the target behavior if you keep shooting it with the original boot message? I would assume it would keep responding with NAKs. But doesn't? Cheers, Daniel diff --git a/tools/kwboot.c b/tools/kwboot.c index e773f01..f598dc1 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); @@ -646,6 +654,10 @@ main(int argc, char **argv) imgpath = optarg; break; + case 'n': + bootmsg = kwboot_msg_none; + break; + case 'p': patch = 1; break;