From patchwork Mon Jan 31 02:52:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masami Hiramatsu X-Patchwork-Id: 538477 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp1405901imr; Sun, 30 Jan 2022 18:53:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJzSaTr5d3aCE4VemHxlLiSREWbr8c37lBs+hMNwPyqoaPqAkrzg+vVjV+okolkJwTIacs/q X-Received: by 2002:a17:906:4fcd:: with SMTP id i13mr14989803ejw.644.1643597597226; Sun, 30 Jan 2022 18:53:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643597597; cv=none; d=google.com; s=arc-20160816; b=K9CXZFVe6JV+4Yjv6ZhKJJkN/3JU0y4BIvfto5H3S+zC3JHW2bWVXqefdIBB0s4GCX l+95KWnbzjqDWQ7ihiKZs28fRybA82eGMjXN3i5UDZz1anwEMVL9PBp77+bsAMH38BPL qckXAgKPSUIwCuE+6EYSjb9RAer/SZcuMGNLE4hAhPPRE7agIIoLXolsUAmeSGfFi24J rVx9MYSH+jabqDQObhQPqqapKVfaMcuIYBdIpm953d57rpZ2AAvBAkDe7EIOhy7OLpMv eNdr6Cy7ucqduzqmDyM4OHreQxtmX6G/spAl2ydXjdZw13mNI4YI/2K4eGDsj8Xvnts3 hTuw== 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:content-transfer-encoding :mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=QixfSxC73opvidNTp3ooyYomH4KG6pzub50jFwg54aE=; b=FMJUvMwOZsUNoij/AMYnvUKj5u8q38jooj+58sEh2yTu943H+FvILMak5f2yPSmS3k kkZhnGiBXBnJDkWPCgcdhrXHHew8hveJxsO18sdG2spwLoZemN3lIHrilY37QHhHu5KL 4tg33+Al20BIi4R2nkDkDAGpHviv6Im2JfKnGaPaDzVn6I5SHljIvwcZUSDomn8VhKVU 2te0OhAw9wJ8UJL2lH/VXZcOf//cJ6MZtM6vnSR6t+jY/3LT38/IkSBMKr0SSoJmgOlk rCWzN0V5hYlnK/6iMGPDusOWXqUqtv8is6GoPeEYWWtdhkZF2Vx3uMsp+mDEJhEmAzVT MDCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NK0B0TTc; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id z21si7981447edb.187.2022.01.30.18.53.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jan 2022 18:53:17 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NK0B0TTc; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BB69C836B8; Mon, 31 Jan 2022 03:53:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="NK0B0TTc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 738FB836AC; Mon, 31 Jan 2022 03:53:05 +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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 21F80836BF for ; Mon, 31 Jan 2022 03:52:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masami.hiramatsu@linaro.org Received: by mail-pl1-x62f.google.com with SMTP id x11so11277681plg.6 for ; Sun, 30 Jan 2022 18:52:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=QixfSxC73opvidNTp3ooyYomH4KG6pzub50jFwg54aE=; b=NK0B0TTcwc85CFyTQHtpSITGciehe1Xx95L8lblR9Au4vn0crqt7MciKRQ/0jq3Eow yfUDd4Pdfvx33e3eJ9eXE1rMjJV2tbA7P/8UZHo5i7+y+To/qvCNOBvGWERHUhZHk6vJ DyWR7jfMVmiOK9dYiirxCeCs2GS7a7Zei9Ta22QxyljNtT/ygFVr9UN+N7ufctPMd9kC CuyJX7YhcooOG/sj7FXvs8AONYHYaKosh3qF4x77ZRWIzi8Y1y17vJbAAnPWHo04nWCB 335dsKihAn0S85DkqJkxiVmMY9X52UzUmroNf850jXB0rP5rLEP3Im9VSqY+47DH0bCT oisA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=QixfSxC73opvidNTp3ooyYomH4KG6pzub50jFwg54aE=; b=mj/wPZYgZBlTlV5fhWOcUs33qlryggFcE+BNT4Fj7f8T2NaqribOZotnvfIPNGTJaX Rhi5/lV5G+fYcdBLMBG7LgyvoaMzYLDllhOIUYLPRjPV/X0d0L7zydc/OGSTNcSytZVh rrrPFQ94eoMAbrGW1ABtyrYg78CFaRzpg970BTxEdwF6HfWunZz4qoCY8VcJuDGJEk48 lUZ6FkUpF4fZcv7eoPuwvgD70gt+cmmFPi5oFrWy7cs3Tulz15kt2lRhTKE9s7vKlCBB omrHCx3NHaZOTcPtOPcha1FkWhY44rKFl1K4KDgxpPjdyMqlfYm/EUlmSFt7sBmQk2WO LE6A== X-Gm-Message-State: AOAM532qc6rNMrjFRu/7pA8zSMxMKxyzIZwfpJMzJv/OqA4oUkzesGue So5jSZU5c9eCPw7W+Ztg+5DNwA== X-Received: by 2002:a17:903:124f:: with SMTP id u15mr18876408plh.15.1643597577430; Sun, 30 Jan 2022 18:52:57 -0800 (PST) Received: from localhost.localdomain (113x37x226x201.ap113.ftth.ucom.ne.jp. [113.37.226.201]) by smtp.gmail.com with ESMTPSA id h6sm16692961pfc.96.2022.01.30.18.52.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jan 2022 18:52:57 -0800 (PST) From: Masami Hiramatsu To: Tom Rini , Lukasz Majewski Cc: u-boot@lists.denx.de, ilias.apalodimas@linaro.org, sughosh.ganu@linaro.org, jaswinder.singh@linaro.org Subject: [PATCH v2 5/5] cmd/dfu: Enable 'dfu list' command without DFU_OVER_USB Date: Mon, 31 Jan 2022 11:52:54 +0900 Message-Id: <164359757437.280839.2615214689304951773.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <164359753172.280839.8310577813724924540.stgit@localhost> References: <164359753172.280839.8310577813724924540.stgit@localhost> User-Agent: StGit/0.19 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Since dfu is not only used for USB, and some platform only supports DFU_OVER_TFTP or EFI capsule update, dfu_alt_info is defined on such platforms too. For such platform, 'dfu list' command is useful to check how the current dfu_alt_info setting is parsed. Signed-off-by: Masami Hiramatsu --- Changes in v2: Fix a compile error if CONFIG_DFU_OVER_USB=n && CONFIG_DFU_OVER_TFTP=n. --- cmd/dfu.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cmd/dfu.c b/cmd/dfu.c index 4a288f74c2..d7bfb535dc 100644 --- a/cmd/dfu.c +++ b/cmd/dfu.c @@ -28,7 +28,6 @@ static int do_dfu(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) #ifdef CONFIG_DFU_OVER_USB char *usb_controller = argv[1]; #endif -#if defined(CONFIG_DFU_OVER_USB) || defined(CONFIG_DFU_OVER_TFTP) char *interface = NULL; char *devstring = NULL; #if defined(CONFIG_DFU_TIMEOUT) || defined(CONFIG_DFU_OVER_TFTP) @@ -42,7 +41,6 @@ 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) if (argc == 5 || argc == 3) value = simple_strtoul(argv[argc - 1], NULL, 0); -#endif #endif int ret = 0; @@ -50,7 +48,6 @@ static int do_dfu(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) if (!strcmp(argv[1], "tftp")) return update_tftp(value, interface, devstring); #endif -#ifdef CONFIG_DFU_OVER_USB ret = dfu_init_env_entities(interface, devstring); if (ret) goto done; @@ -65,6 +62,7 @@ static int do_dfu(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) goto done; } +#ifdef CONFIG_DFU_OVER_USB int controller_index = simple_strtoul(usb_controller, NULL, 0); bool retry = false; do { @@ -79,9 +77,9 @@ static int do_dfu(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) } } while (retry); +#endif done: dfu_free_entities(); -#endif return ret; } @@ -100,8 +98,8 @@ U_BOOT_CMD(dfu, CONFIG_SYS_MAXARGS, 1, do_dfu, #ifdef CONFIG_DFU_TIMEOUT " [] - specify inactivity timeout in seconds\n" #endif - " [list] - list available alt settings\n" #endif + " [list] - list available alt settings\n" #ifdef CONFIG_DFU_OVER_TFTP #ifdef CONFIG_DFU_OVER_USB "dfu "