From patchwork Wed Feb 18 22:53:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dileep Katta X-Patchwork-Id: 44803 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0380A21573 for ; Wed, 18 Feb 2015 22:55:24 +0000 (UTC) Received: by lamq1 with SMTP id q1sf2825814lam.0 for ; Wed, 18 Feb 2015 14:55:23 -0800 (PST) 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=P0kZ/iTvtQcWTccwfuQAXlU2n4sMm1swjpbwcM9x7hw=; b=M5AJrnpZeEKuzzZBWqoI0J3vSCol6rb7DcCVSL8Wg6tCzPMYF97KPrpbw0VObE6x4d wYVgX+IHQmmm2tuUqnxINt0yS9tREcJ4kxVxLgqkwZVmzdzwFY7Eew7IVouDHRtB8UGC lm9qLZ4VfN5VffhcbiHRiwjpnmHWhO+t4vb5EhjMyYaz5Km9W5SKjvYdGBA2LB+WApQd mmPs0wlt4Q+fhJkvl/goeXdTrBIdq5CcWm8Y7tmEA+imn1/Qnm61i++hrkEF3rDDnSQS aOplMoZP+vo6hyrN4S3+kkeJHAoA53iST+2YK7vjNu2S8vi92IYHdpS1/AJJMlLel5Cx BPww== X-Gm-Message-State: ALoCoQnjaNam/dRyMxDxsHgsr/3OzdzIcM0QFdG6YYRWGkcmAsM79pFzK+HUtM7fOD21Fe/d8lrT X-Received: by 10.181.13.236 with SMTP id fb12mr327990wid.1.1424300123022; Wed, 18 Feb 2015 14:55:23 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.74 with SMTP id q10ls90019laq.43.gmail; Wed, 18 Feb 2015 14:55:22 -0800 (PST) X-Received: by 10.152.44.137 with SMTP id e9mr1500990lam.100.1424300122848; Wed, 18 Feb 2015 14:55:22 -0800 (PST) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id w6si13581772lad.83.2015.02.18.14.55.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Feb 2015 14:55:22 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by labhz20 with SMTP id hz20so4390476lab.0 for ; Wed, 18 Feb 2015 14:55:22 -0800 (PST) X-Received: by 10.152.37.138 with SMTP id y10mr1512676laj.88.1424300122668; Wed, 18 Feb 2015 14:55:22 -0800 (PST) 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 h5csp133001lbj; Wed, 18 Feb 2015 14:55:22 -0800 (PST) X-Received: by 10.194.158.39 with SMTP id wr7mr3347290wjb.118.1424300122026; Wed, 18 Feb 2015 14:55:22 -0800 (PST) Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id ef10si37597344wic.22.2015.02.18.14.55.21; Wed, 18 Feb 2015 14:55:22 -0800 (PST) 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 144504B660; Wed, 18 Feb 2015 23:55:21 +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 Uora0Dglnf7y; Wed, 18 Feb 2015 23:55:20 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 58CDD4B653; Wed, 18 Feb 2015 23:55:20 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 436BF4B653 for ; Wed, 18 Feb 2015 23:55:17 +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 BbmWJtj9wWVG for ; Wed, 18 Feb 2015 23:55:17 +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-f172.google.com (mail-pd0-f172.google.com [209.85.192.172]) by theia.denx.de (Postfix) with ESMTPS id BACB34B639 for ; Wed, 18 Feb 2015 23:55:14 +0100 (CET) Received: by pdbfl12 with SMTP id fl12so4423888pdb.4 for ; Wed, 18 Feb 2015 14:55:12 -0800 (PST) X-Received: by 10.66.65.108 with SMTP id w12mr2342724pas.115.1424300112851; Wed, 18 Feb 2015 14:55:12 -0800 (PST) Received: from localhost.localdomain ([106.51.142.94]) by mx.google.com with ESMTPSA id qz3sm21951560pab.13.2015.02.18.14.55.09 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Feb 2015 14:55:12 -0800 (PST) From: Dileep Katta To: u-boot@lists.denx.de, robherring2@gmail.com, trini@ti.com, rob.herring@linaro.org, srae@broadcom.com, l.majewski@samsung.com, angelabaker@ti.com Date: Thu, 19 Feb 2015 04:23:55 +0530 Message-Id: <1424300035-19634-2-git-send-email-dileep.katta@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1424300035-19634-1-git-send-email-dileep.katta@linaro.org> References: <1424300035-19634-1-git-send-email-dileep.katta@linaro.org> Cc: Dileep Katta Subject: [U-Boot] [PATCH v1 2/2] fastboot: Add support in fastboot oem command to set QSPI as boot device 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.215.51 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 Fastboot oem command is updated with SPI specific functionality. Signed-off-by: Dileep Katta --- Note: This is on top of Rob Herring patches submitted to support oem format command Ref: https://patchwork.ozlabs.org/patch/433056/ https://patchwork.ozlabs.org/patch/433057/ drivers/usb/gadget/f_fastboot.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index a170eea..04fa4c2 100644 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -591,7 +591,33 @@ static void cb_flash(struct usb_ep *ep, struct usb_request *req) static void cb_oem(struct usb_ep *ep, struct usb_request *req) { char *cmd = req->buf; + #ifdef CONFIG_FASTBOOT_FLASH +#ifdef CONFIG_SPL_SPI_SUPPORT + char *sf_erase[4] = {"sf", "erase", "0", "20000"}; + int status; + char *sf_probe[3] = {"sf", "probe", "0"}; + if (strncmp(req->buf + 4, "spi", 3) == 0) { + boot_from_spi = 1; + status = do_spi_flash(NULL, 0, 3, sf_probe); + if (status) { + fastboot_tx_write_str("FAILcould not probe SPI"); + return; + } + status = do_spi_flash(NULL, 0, 4, sf_erase); + if (status) { + fastboot_tx_write_str("FAILcould not erase SPI"); + return; + } + fastboot_tx_write_str("OKAY"); + return; + } else if (strncmp(req->buf + 4, "mmc", 3) == 0) { + boot_from_spi = 0; + fastboot_tx_write_str("OKAY"); + return; + } +#endif + if (strncmp("format", cmd + 4, 6) == 0) { char cmdbuf[32]; sprintf(cmdbuf, "gpt write mmc %x $partitions",