Message ID | 20201217121030.6352-5-m.szyprowski@samsung.com |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp1110290jai; Thu, 17 Dec 2020 04:12:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJylKzS+DMUnGrKY3Epn1icXHDIpic/k9IJ3GEnayIyqBMs+kfnfaxOI3gdqDEySwH8+o9+n X-Received: by 2002:a17:906:8152:: with SMTP id z18mr35883786ejw.317.1608207134453; Thu, 17 Dec 2020 04:12:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608207134; cv=none; d=google.com; s=arc-20160816; b=aKaB/M1yUOAwhX947eHmDoMpinGOWitP/TtmDZmbex7PITiLatzdHXOJyvFQ3Is37I Tk3MV7dzBZGGsOBtyBWLb0+Zh5Kh7t/QPc4bw4vM5WE3fUiGODaJKhEhv5si8rKKR8uK aXdiQ0Seq5x4Un0Z5taqAH4cEpqtP4wMg3P6d+ZQ67IQhMRi8JVCp95GH27LAYacn4BI vlFVKuIgnS0RFkBowt+PybaDZzkntfqBCfV2jnjjNkn674a2k5tuMyIzuAcRvewzUuVz wyhfRhmsI9vTtj2Axilm5pJMfPJf0eoJgtqx7ScBBNk0BQhUnQpwsc2PBSJtymoYjVRp Lyeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=sshgK0Im2ELhFhRgA4dQqQnUo1OEKg3KPZMl3NeTvhI=; b=GIvAx8ousvSjUTlPYS1MqLcj2KlqYxVWsJNhVsbvyX9d1MFQ712AgzR7923JidzWVu JeZ1LG1f3kdP/1OjYb7vCm2tdh/ZAo4K4tcNbs+oSfm8mgkSxbXYxDTDSykopEzapzzw LXaC+XQqrFp8SdJJuVQdYQto87yuoFPgPVxeDiYUNB4nkPmE6TUognEYA1cQz+dNrkwH 79c4CVI+1aCw0mnipBEmibfHOoqLClxcfTvTgyq5p6p1VijfTqjeH9oxqXlocvw9bQfi jfY4FKPtq8jIgoohpjlJG+5NMN3Z/4l41I4bcU0BtJRshFAAwnC0xQ8InFbojNP8aGkI B6pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=CMgt4+z1; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: <u-boot-bounces@lists.denx.de> Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id c9si4244338edr.4.2020.12.17.04.12.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 04:12:14 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=CMgt4+z1; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7CD6F82BCC; Thu, 17 Dec 2020 13:11:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=samsung.com header.i=@samsung.com header.b="CMgt4+z1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7B38D82BAD; Thu, 17 Dec 2020 13:11:07 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7B7FE82BB0 for <u-boot@lists.denx.de>; Thu, 17 Dec 2020 13:10:58 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=m.szyprowski@samsung.com Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201217121048euoutp02200692b082beca50fddbc5d50295396f~Rf8omRuJ92104421044euoutp02W for <u-boot@lists.denx.de>; Thu, 17 Dec 2020 12:10:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201217121048euoutp02200692b082beca50fddbc5d50295396f~Rf8omRuJ92104421044euoutp02W DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1608207048; bh=sshgK0Im2ELhFhRgA4dQqQnUo1OEKg3KPZMl3NeTvhI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CMgt4+z1rFfeOjspQtz6iCIQRWTdmRhBWlbNgWrsiOy/dDRNgi9kjs8GGslSB6GGb K7148lKuMcPNHD8eIFUvSg2AzI4Z3xFszR8P7SLy3CVm6p2sVMX1hgBvC1vM+Qo8m6 wNdqtDVLJ7LvnAB0DGpog73Cjaor8wx1RbNxvE/w= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201217121042eucas1p1de909daab8ff29f1d00999e5888036b7~Rf8jpSSEj1299512995eucas1p15; Thu, 17 Dec 2020 12:10:42 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id BA.A0.45488.2CA4BDF5; Thu, 17 Dec 2020 12:10:42 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201217121042eucas1p1b388f34fd6e3ead2bfb3bef71eedd06f~Rf8jS40gF0436004360eucas1p1v; Thu, 17 Dec 2020 12:10:42 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201217121042eusmtrp2a343f12684ff7c621ac144e5cb3ab0d7~Rf8jSP30J1817818178eusmtrp2S; Thu, 17 Dec 2020 12:10:42 +0000 (GMT) X-AuditID: cbfec7f5-1f69da800000b1b0-3d-5fdb4ac2fd6b Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 46.08.16282.2CA4BDF5; Thu, 17 Dec 2020 12:10:42 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201217121042eusmtip1c8547efe315cc59a146e17f4ab66ea44~Rf8i3wriK0407904079eusmtip1o; Thu, 17 Dec 2020 12:10:41 +0000 (GMT) From: Marek Szyprowski <m.szyprowski@samsung.com> To: u-boot@lists.denx.de Cc: Marek Szyprowski <m.szyprowski@samsung.com>, Lukasz Majewski <lukma@denx.de>, Marek Vasut <marex@denx.de>, Jaehoon Chung <jh80.chung@samsung.com>, Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Subject: [PATCH 4/5] dfu: add support for the dfu_alt_info reintialization from the flashed script Date: Thu, 17 Dec 2020 13:10:29 +0100 Message-Id: <20201217121030.6352-5-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201217121030.6352-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrAIsWRmVeSWpSXmKPExsWy7djP87qHvG7HG0ycrm2xccZ6Vosbv9pY LZ6/u8xksfbIXXaLN22NjBZv93ayO7B5zJt1gsXj7J0djB59W1YxBjBHcdmkpOZklqUW6dsl cGW8PX6TseACT8XEXXuZGxincnUxcnBICJhIXF+U1sXIxSEksIJR4viK9+wQzhdGid6m52wQ zmdGiZMbJrJ2MXKCdUxduJARxBYSWM4oMfV9NlxH57OvYAk2AUOJrrddbCC2iICExK/+q2Bx ZoGLjBK//xuD2MICKRJf5u9kAbFZBFQlZs44BbaAV8BG4tiBCYwQy+QlVm84wAxicwrYSnSc fAd2kYRAI4fE5+tzoYpcJL6fh7GFJV4d38IOYctI/N85nwmioZlR4uG5tewQTg+jxOWmGVAd 1hJ3zv1iA4UGs4CmxPpd+hBhR4mp+yezQQKJT+LGW0GIB/gkJm2bzgwR5pXoaBOCqFaTmHV8 HdzagxcuMUPYHhJPT92BhuIERomeJU2MExjlZyEsW8DIuIpRPLW0ODc9tdg4L7Vcrzgxt7g0 L10vOT93EyMwEZz+d/zrDsYVrz7qHWJk4mA8xCjBwawkwptw4Ga8EG9KYmVValF+fFFpTmrx IUZpDhYlcd5dW9fECwmkJ5akZqemFqQWwWSZODilGpgs5wrbKH9bsW95fsrB9lql7sz2LaVL /Q3/TmvZn7a0+dfTxCtp8yun8FSd4bOZnO91zf7ItuKKtxsL/ywKXsMWaL46IkkscfGGJpHT zrvEjs80yMtfOVd+ZlvkmyTOux0P82U+8X7fbL/smNHGR8yxr8+wJwWGdabJLWu61pd5REWW 26qYdcYEbontJ/4kmNuvcv7RVZl0K+RLyl73quT2m/bsxoYxcQYRuvHiwg0LFTZ9df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CdpX5j2Y0mH+KUDmRrUS S3FGoqEWc1FxIgB6ubNn1gIAAA== X-CMS-MailID: 20201217121042eucas1p1b388f34fd6e3ead2bfb3bef71eedd06f X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20201217121042eucas1p1b388f34fd6e3ead2bfb3bef71eedd06f X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201217121042eucas1p1b388f34fd6e3ead2bfb3bef71eedd06f References: <20201217121030.6352-1-m.szyprowski@samsung.com> <CGME20201217121042eucas1p1b388f34fd6e3ead2bfb3bef71eedd06f@eucas1p1.samsung.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean |
Series |
DFU: new entity types and minor improvements
|
expand
|
diff --git a/cmd/dfu.c b/cmd/dfu.c index 7310595a02..89b1b2268e 100644 --- a/cmd/dfu.c +++ b/cmd/dfu.c @@ -34,6 +34,7 @@ static int do_dfu(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) #if defined(CONFIG_DFU_TIMEOUT) || defined(CONFIG_DFU_OVER_TFTP) unsigned long value = 0; #endif + bool retry = false; if (argc >= 4) { interface = argv[2]; @@ -68,7 +69,18 @@ static int do_dfu(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) int controller_index = simple_strtoul(usb_controller, NULL, 0); - run_usb_dnl_gadget(controller_index, "usb_dnl_dfu"); + do { + retry = false; + run_usb_dnl_gadget(controller_index, "usb_dnl_dfu"); + + if (dfu_reinit_needed) { + dfu_free_entities(); + ret = dfu_init_env_entities(interface, devstring); + if (ret) + goto done; + retry = true; + } + } while (retry); done: dfu_free_entities(); diff --git a/common/dfu.c b/common/dfu.c index d23cf67f19..16bd1ba588 100644 --- a/common/dfu.c +++ b/common/dfu.c @@ -98,6 +98,9 @@ int run_usb_dnl_gadget(int usbctrl_index, char *usb_dnl_gadget) } #endif + if (dfu_reinit_needed) + goto exit; + WATCHDOG_RESET(); usb_gadget_handle_interrupts(usbctrl_index); }
Reinitialize DFU USB gadget after flashing the 'SCRIPT' entity to ensure that the potential changes to the 'dfu_alt_info' environment variable are applied. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> --- cmd/dfu.c | 14 +++++++++++++- common/dfu.c | 3 +++ 2 files changed, 16 insertions(+), 1 deletion(-) -- 2.17.1