From patchwork Thu Mar 12 21:12:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dileep Katta X-Patchwork-Id: 45748 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3F3F4214B8 for ; Thu, 12 Mar 2015 21:13:09 +0000 (UTC) Received: by wivz2 with SMTP id z2sf587929wiv.1 for ; Thu, 12 Mar 2015 14:13:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list; bh=C3H7IjYvkUKNfq5zorvvvmyFWPSNPkmHRrnHNXEtXB0=; b=DXY+BNTtZlNIN9ATlqD+2zyi0J9/P15zCTQVjOct3yWvroKi3FU3kydGswLW646aK+ dUceUVmTUkBBj86qQNa9E+BcBd2lNQhENEqL7MsYS190u1cZr0rn572A1UUqCrosvUMT vsuVoU1skmQ8ILUanPrtgZt+HRZ2GpjLO2mJvUhwr3CriX2BCWSPETxvKzi+1PTEI/Ta FY1Xsy5OJnhP5Hl1r+qqNN/baB2JDw6hIRRm14Q0J0u/t3/r2iylBhb0rR9qgo/yFwEo UiURf7AsYVFk8MlQ74MSy/aSQT33CZi78NJ3JGgv5SyKyLr02FSpWCpPIvYfo5FfJ/4i x77Q== X-Gm-Message-State: ALoCoQmBP/Zreou/xhbMIbEDFzmX4E2izgpqpSL09UPpbwZ8vPbOz/uuYFWrkSEsWm1m2UTR3+lX X-Received: by 10.152.6.232 with SMTP id e8mr6689868laa.2.1426194788529; Thu, 12 Mar 2015 14:13:08 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.197.34 with SMTP id ir2ls314474lac.84.gmail; Thu, 12 Mar 2015 14:13:08 -0700 (PDT) X-Received: by 10.112.8.101 with SMTP id q5mr34962311lba.19.1426194788125; Thu, 12 Mar 2015 14:13:08 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id a3si20346lak.61.2015.03.12.14.13.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Mar 2015 14:13:08 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by lbiz11 with SMTP id z11so18879556lbi.3 for ; Thu, 12 Mar 2015 14:13:07 -0700 (PDT) X-Received: by 10.112.130.195 with SMTP id og3mr40049404lbb.112.1426194787888; Thu, 12 Mar 2015 14:13:07 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp492183lbj; Thu, 12 Mar 2015 14:13:07 -0700 (PDT) X-Received: by 10.194.24.103 with SMTP id t7mr89569065wjf.15.1426194786936; Thu, 12 Mar 2015 14:13:06 -0700 (PDT) Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id gh3si30821wjd.141.2015.03.12.14.13.04; Thu, 12 Mar 2015 14:13:06 -0700 (PDT) Received-SPF: none (google.com: u-boot-bounces@lists.denx.de does not designate permitted sender hosts) client-ip=85.214.87.163; Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9A06BA7424; Thu, 12 Mar 2015 22:13:03 +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 tiA7Z9aO5Ngv; Thu, 12 Mar 2015 22:13:03 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 17F10A741F; Thu, 12 Mar 2015 22:13:03 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8657CA741F for ; Thu, 12 Mar 2015 22:12:58 +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 QreaVANP8zKH for ; Thu, 12 Mar 2015 22:12:58 +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-pd0-f176.google.com (mail-pd0-f176.google.com [209.85.192.176]) by theia.denx.de (Postfix) with ESMTPS id 0A241A741D for ; Thu, 12 Mar 2015 22:12:54 +0100 (CET) Received: by pdbfp1 with SMTP id fp1so23081884pdb.7 for ; Thu, 12 Mar 2015 14:12:52 -0700 (PDT) X-Received: by 10.70.34.129 with SMTP id z1mr16802670pdi.113.1426194772418; Thu, 12 Mar 2015 14:12:52 -0700 (PDT) Received: from localhost.localdomain ([106.51.139.45]) by mx.google.com with ESMTPSA id t5sm22947pde.51.2015.03.12.14.12.49 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Mar 2015 14:12:51 -0700 (PDT) From: Dileep Katta To: u-boot@lists.denx.de, robherring2@gmail.com, trini@konsulko.com, rob.herring@linaro.org, srae@broadcom.com, l.majewski@samsung.com, angelabaker@ti.com, marex@denx.de Date: Fri, 13 Mar 2015 02:42:30 +0530 Message-Id: <1426194750-15213-1-git-send-email-dileep.katta@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <201503121828.17823.marex@denx.de> References: <201503121828.17823.marex@denx.de> Cc: Dileep Katta Subject: [U-Boot] [PATCH v2 2/4] fastboot: call board_usb_init() to enable usb X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: dileep.katta@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 g_dnl_gadget_register() fails for dra7xx dwc3 gadget when running cmd_fastboot. Calling board_usb_init() to fix this. fastboot command is now added with an optional controller index argument with default value as 0, to facilitate configurable controller index. Signed-off-by: Angela Stegmaier Signed-off-by: Dileep Katta --- Changes in v2: - Changed fastboot command to facilitate passing controller index - Added board_usb_cleanup() This patch considers the following change by Inha Song, without which the build will be broken on BeagleBone Black platform https://patchwork.ozlabs.org/patch/430303/ common/cmd_fastboot.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/common/cmd_fastboot.c b/common/cmd_fastboot.c index 346ab80..9ca4a2f 100644 --- a/common/cmd_fastboot.c +++ b/common/cmd_fastboot.c @@ -10,11 +10,19 @@ #include #include #include +#include static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) { int ret; + int controller_index = 0; + if (argc == 2) { + char *usb_controller = argv[1]; + controller_index = simple_strtoul(usb_controller, NULL, 0); + } + + board_usb_init(controller_index, USB_INIT_DEVICE); g_dnl_clear_detach(); ret = g_dnl_register("usb_dnl_fastboot"); if (ret) @@ -36,12 +44,13 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) g_dnl_unregister(); g_dnl_clear_detach(); + board_usb_cleanup(controller_index, USB_INIT_DEVICE); return CMD_RET_SUCCESS; } U_BOOT_CMD( - fastboot, 1, 0, do_fastboot, + fastboot, 2, 0, do_fastboot, "use USB Fastboot protocol", - "\n" - " - run as a fastboot usb device" + "[]\n" + " - run as a fastboot usb device via " );