From patchwork Wed Dec 10 20:43:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 419860 X-Patchwork-Delegate: l.majewski@samsung.com 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 55CC21400B7 for ; Thu, 11 Dec 2014 07:43:53 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5CB574B6B2; Wed, 10 Dec 2014 21:43:46 +0100 (CET) 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 7uGIit84wPRq; Wed, 10 Dec 2014 21:43:46 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3F1AC4B823; Wed, 10 Dec 2014 21:43:44 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AF9E24B604 for ; Wed, 10 Dec 2014 21:43:37 +0100 (CET) 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 48dZLp3Z+od9 for ; Wed, 10 Dec 2014 21:43: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-qa0-f47.google.com (mail-qa0-f47.google.com [209.85.216.47]) by theia.denx.de (Postfix) with ESMTPS id 617864B5FB for ; Wed, 10 Dec 2014 21:43:33 +0100 (CET) Received: by mail-qa0-f47.google.com with SMTP id s7so2579093qap.6 for ; Wed, 10 Dec 2014 12:43:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Eg5LcUeEI39h5tH6/0XDdDhp9R2JYjy0BryFfmHwOP8=; b=EiLYK5WtBzItCbDzzaitDZMU+9K7Du9Kf7q2vEJeea5DPc4AAE0RYGXaK4icJhpwNc qST159bpW+sS5BNlJ/tTasnZdEP5vdPouzLpEV9S2Ayzekx6WUd7awJR1XIGgVQXstM1 PtmIjt5y568/6TVJJzKTdFvLXJJdS8Enkxt8y2ksFs5c2cDRPDih/MZzfxWEoLWojaGQ oK4sDgrH2WKk5dTRlc+E6wHSFVzwX3H4Zbcgyh5PF2OBpMyOWqr+lQKSLqhPMog9Hh57 fsCicy04ZmH6WQUmvPWrezDBOqaUCa9m/jusmPQBVmPDCskzcTIo2vj3apKoMGNVMP4n 3qRw== X-Received: by 10.224.167.84 with SMTP id p20mr12474467qay.28.1418244212580; Wed, 10 Dec 2014 12:43:32 -0800 (PST) Received: from localhost.localdomain (c-76-24-48-141.hsd1.nh.comcast.net. [76.24.48.141]) by mx.google.com with ESMTPSA id p14sm5284606qaa.1.2014.12.10.12.43.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Dec 2014 12:43:31 -0800 (PST) From: Rob Herring To: u-boot@lists.denx.de Date: Wed, 10 Dec 2014 14:43:04 -0600 Message-Id: <1418244184-1356-2-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1418244184-1356-1-git-send-email-robherring2@gmail.com> References: <1418244184-1356-1-git-send-email-robherring2@gmail.com> Cc: Marek Vasut , Rob Herring Subject: [U-Boot] [PATCH 2/2] fastboot: add support for continue command X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 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 From: Rob Herring The fastboot continue command is defined to exit fastboot and continue autoboot. This commit implements the continue command and the exiting of fastboot only. Subsequent u-boot commands can be processed after exiting fastboot. Autoboot should implement a boot script such as "fastboot; mmc read <...>; bootm" to fully implement the fastboot continue function. Signed-off-by: Rob Herring Acked-by: Lukasz Majewski Tested-by: Lukasz Majewski --- common/cmd_fastboot.c | 4 ++++ drivers/usb/gadget/f_fastboot.c | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/common/cmd_fastboot.c b/common/cmd_fastboot.c index 909616d..b72f4f3 100644 --- a/common/cmd_fastboot.c +++ b/common/cmd_fastboot.c @@ -15,17 +15,21 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) { int ret; + g_dnl_clear_detach(); ret = g_dnl_register("usb_dnl_fastboot"); if (ret) return ret; while (1) { + if (g_dnl_detach()) + break; if (ctrlc()) break; usb_gadget_handle_interrupts(); } g_dnl_unregister(); + g_dnl_clear_detach(); return CMD_RET_SUCCESS; } diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index 71b62e5..310175a 100644 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -480,6 +480,17 @@ static void cb_boot(struct usb_ep *ep, struct usb_request *req) fastboot_tx_write_str("OKAY"); } +static void do_exit_on_complete(struct usb_ep *ep, struct usb_request *req) +{ + g_dnl_trigger_detach(); +} + +static void cb_continue(struct usb_ep *ep, struct usb_request *req) +{ + fastboot_func->in_req->complete = do_exit_on_complete; + fastboot_tx_write_str("OKAY"); +} + #ifdef CONFIG_FASTBOOT_FLASH static void cb_flash(struct usb_ep *ep, struct usb_request *req) { @@ -520,6 +531,9 @@ static const struct cmd_dispatch_info cmd_dispatch_info[] = { }, { .cmd = "boot", .cb = cb_boot, + }, { + .cmd = "continue", + .cb = cb_continue, }, #ifdef CONFIG_FASTBOOT_FLASH {