From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8B94AC433F5 for ; Mon, 31 Jan 2022 02:53:17 +0000 (UTC) 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) 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-Google-Smtp-Source: ABdhPJxhhpfe21Oyskk12GGYLzRha2F+sBhCQuc9ofan5U86FM1GK05UaINISFr+Q06G3RFD/zUQrg== 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 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 "