From patchwork Sat Oct 7 23:12:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844817 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=czxDXUVW; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31bH5SXlz1yqP for ; Sun, 8 Oct 2023 10:24:27 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8518286F49; Sun, 8 Oct 2023 01:14:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="czxDXUVW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 93C7786EF3; Sun, 8 Oct 2023 01:13:26 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) (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 2193386D82 for ; Sun, 8 Oct 2023 01:13:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x135.google.com with SMTP id e9e14a558f8ab-351367c8fcdso13320885ab.3 for ; Sat, 07 Oct 2023 16:13:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720385; x=1697325185; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bsW03jWaWGhm8/3RbHxhPad3FrkkTxavGZCnXJT2/L0=; b=czxDXUVWI3NBnTjroJ3djIG+mP6k6pb9+2f8oR2gNu4Y0Nq0TqIjFhwDQ/CwTISd/z ao/XwfFHlgyOfsKSVF80Qda8Hfq7aORHxq/Z98A4CmAZy7spbwQLq8btsN3kC2jSA078 VEy0CPPUgRPfcuzoaCrwskucwj09E/WO7LlXE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720385; x=1697325185; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bsW03jWaWGhm8/3RbHxhPad3FrkkTxavGZCnXJT2/L0=; b=cS3lk1rOXsSvLyMc6jE5BbZBRWc9UmRoBpolBwNtwapuCs3MrYSL7E+uZehreIp8De pmF5e66y66Y/VxfeKXaD6Ov+/jVK+20sTxX+p6Dpk1TlzIrB1GmXLPuCaza5jZt5xGQ3 yW0loVL2gvQpA19YMHUdXUp2e8AQ6EijJRFHMAgknig9zCs53ArVs0yLupcTcoHXtC4k MhNoA53uFu2E+hRTydBfMhC5m7oNBL7y0N2Ptm063O9k+1vMRHT9Iv2zEsQIUNgCJG6n UQUtUg89etLXwZ70AMHTUZbXLZ/J8Li8xV1hgFFmOzodh9zImBzpO21NjULg/PBAuKrN 9O1Q== X-Gm-Message-State: AOJu0YxaY8QeLfoYjCEI8lauwr+aS+4bQJlvI7sIyV63/7fNyNzZUocu ARBlyhMy6tSuPjlqYeCulO1ukvpy3K6T4kk9FD4= X-Google-Smtp-Source: AGHT+IF0462geNCTZfQad7YfufoR4+K7NeLpfHBol7As1G5xRe4M4nGhWgIVZ/5awGnQaKuRy+ZxsQ== X-Received: by 2002:a05:6e02:160c:b0:351:4dcd:7655 with SMTP id t12-20020a056e02160c00b003514dcd7655mr14024811ilu.31.1696720385222; Sat, 07 Oct 2023 16:13:05 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:05 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v2 01/27] command.h: Add a U_BOOT_LONGHELP macro Date: Sat, 7 Oct 2023 17:12:20 -0600 Message-ID: <20231007231255.277623-2-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean From: Tom Rini In order to be able to discard unused long help texts without further linker lists, add a macro for defining the long help messages which uses __maybe_unused. This allows us to discard them as unreferenced as part of the link. Signed-off-by: Tom Rini Reviewed-by: Simon Glass Signed-off-by: Simon Glass --- (no changes since v1) include/command.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/command.h b/include/command.h index 34ea989b39b4..a836ea795ab6 100644 --- a/include/command.h +++ b/include/command.h @@ -322,6 +322,9 @@ int cmd_source_script(ulong addr, const char *fit_uname, const char *confname); # define _CMD_HELP(x) #endif +#define U_BOOT_LONGHELP(_cmdname, text) \ + static __maybe_unused const char _cmdname##_help_text[] = text; + #define U_BOOT_SUBCMDS_DO_CMD(_cmdname) \ static int do_##_cmdname(struct cmd_tbl *cmdtp, int flag, \ int argc, char *const argv[], \ From patchwork Sat Oct 7 23:12:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844808 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=jMn3puUf; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31YV4DsDz1yqP for ; Sun, 8 Oct 2023 10:22:54 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D71EF86F3B; Sun, 8 Oct 2023 01:14:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="jMn3puUf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9965C86EE9; Sun, 8 Oct 2023 01:13:55 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) (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 21ABC86E22 for ; Sun, 8 Oct 2023 01:13:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x135.google.com with SMTP id e9e14a558f8ab-351574aca7bso12197625ab.3 for ; Sat, 07 Oct 2023 16:13:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720387; x=1697325187; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FogF10Ztwoc9ZjqjlfBzmQKLMeQIOphDNfTK6QPviXA=; b=jMn3puUfDz0JroQxxR91HC3IyUn7kVv/rN3iJ3TlS5UrXT4nYVaKcue6ELmqg1pB7C C6kYU01IaEtGY7gvIFCDb1d47xCVYPZ+xO70cE2W06vZwrsepk7zTuD7pTMYdrvhnezd PzvFdhtgj4JqXEiab8nmkMioP2i9JE9CeSj+A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720387; x=1697325187; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FogF10Ztwoc9ZjqjlfBzmQKLMeQIOphDNfTK6QPviXA=; b=QI5WQvvcOtXcW4ZSnlZElAEC5ynT+UWUa/voMi86a0aYhu8Kz2ve5u6Sl2nlFU23b0 oTyMhqKyvVcYGADkNcKvPyPzevn5h/dCo4WQ1gq2v8huD5phcIUi9MENGm9JjSKLhty9 qgK8dq9j+D/nN+c7/kv+o3HdtTqIRVqJQth/I+5wnMJI+k+Z45zVxp/f9P6jc+cv41WM ti9zNEo3L+L5dSpxdrDpP/jc6F6Z+Iql9jf83fmmfvW2f6KkYrmWIBaGy98jW42v5B8O jm4Pb8yWX0K9TNsF5P7M+nGSv002jF7VxFJhN4EPJpkDK3iWFtuSCVfeYqjn6qario3Z fFOg== X-Gm-Message-State: AOJu0YxQ7WbsC62CBCdoqk3nn3BI46HN7BtHYoewKS8J4fDHLzDxXAP+ HelYzEDfw+OnUnqKjv8218yWHAG0ZmQzt2oXWb8= X-Google-Smtp-Source: AGHT+IFGV4/HrYWkCOZf0ic4X86K5MVdIT+saQe8qxBWvTY2Kna75dNm6rVaa6OWzqNr0qnuGxu8Pw== X-Received: by 2002:a05:6e02:ee8:b0:351:a18:51bf with SMTP id j8-20020a056e020ee800b003510a1851bfmr10672427ilk.13.1696720386135; Sat, 07 Oct 2023 16:13:06 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:05 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v2 02/27] cmd: Convert existing long help messages to the new macro Date: Sat, 7 Oct 2023 17:12:21 -0600 Message-ID: <20231007231255.277623-3-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean From: Tom Rini - Generally we just drop the #ifdef CONFIG_SYS_LONGHELP and endif lines and use U_BOOT_LONGHELP to declare the same variable name as before - In a few places, either rename the variable to follow convention or introduce the variable as it was being done inline before. Signed-off-by: Tom Rini Reviewed-by: Simon Glass Signed-off-by: Simon Glass --- (no changes since v1) arch/arm/mach-imx/cmd_nandbcb.c | 6 ++---- board/freescale/common/ngpixis.c | 6 ++---- board/work-microwave/work_92105/work_92105_display.c | 12 ++++-------- board/xilinx/common/fru.c | 7 ++----- board/xilinx/versal/cmds.c | 7 ++----- board/xilinx/zynq/cmds.c | 6 ++---- board/xilinx/zynqmp/cmds.c | 6 ++---- cmd/acpi.c | 6 ++---- cmd/aes.c | 6 ++---- cmd/armffa.c | 4 ++-- cmd/axi.c | 4 ++-- cmd/bloblist.c | 6 ++---- cmd/bootcount.c | 9 ++------- cmd/bootdev.c | 6 ++---- cmd/bootefi.c | 6 ++---- cmd/bootflow.c | 9 ++++----- cmd/booti.c | 6 ++---- cmd/bootm.c | 6 ++---- cmd/bootmeth.c | 6 ++---- cmd/bootz.c | 6 ++---- cmd/cat.c | 6 ++---- cmd/cedit.c | 6 ++---- cmd/clk.c | 6 ++---- cmd/conitrace.c | 4 +--- cmd/cpu.c | 7 ++----- cmd/cyclic.c | 4 ++-- cmd/dm.c | 7 ++----- cmd/efidebug.c | 6 ++---- cmd/event.c | 6 ++---- cmd/fdt.c | 6 ++---- cmd/font.c | 6 ++---- cmd/help.c | 5 ++++- cmd/i2c.c | 6 ++---- cmd/kaslrseed.c | 6 ++---- cmd/log.c | 7 ++----- cmd/mp.c | 6 ++---- cmd/mtd.c | 6 ++---- cmd/mtdparts.c | 6 ++---- cmd/mux.c | 4 ++-- cmd/nand.c | 6 ++---- cmd/nvedit.c | 6 ++---- cmd/osd.c | 4 ++-- cmd/pcap.c | 4 ++-- cmd/pci.c | 6 ++---- cmd/pci_mps.c | 6 ++---- cmd/riscv/sbi.c | 7 ++----- cmd/rng.c | 6 ++---- cmd/sandbox/exception.c | 5 ++--- cmd/scp03.c | 7 ++++--- cmd/sf.c | 8 +++----- cmd/source.c | 9 ++++----- cmd/ti/pd.c | 10 +++++----- cmd/vbe.c | 6 ++---- cmd/wdt.c | 4 ++-- cmd/ximg.c | 6 ++---- cmd/xxd.c | 6 ++---- test/cmd_ut.c | 6 ++---- test/fuzz/cmd_fuzz.c | 7 ++----- 58 files changed, 129 insertions(+), 230 deletions(-) diff --git a/arch/arm/mach-imx/cmd_nandbcb.c b/arch/arm/mach-imx/cmd_nandbcb.c index c54f52b343c7..70a213a49dd0 100644 --- a/arch/arm/mach-imx/cmd_nandbcb.c +++ b/arch/arm/mach-imx/cmd_nandbcb.c @@ -1561,8 +1561,7 @@ usage: return CMD_RET_USAGE; } -#ifdef CONFIG_SYS_LONGHELP -static char nandbcb_help_text[] = +U_BOOT_LONGHELP(nandbcb, "init addr off|partition len - update 'len' bytes starting at\n" " 'off|part' to memory address 'addr', skipping bad blocks\n" "nandbcb bcbonly off|partition fw1-off fw1-size [fw2-off fw2-size]\n" @@ -1572,8 +1571,7 @@ static char nandbcb_help_text[] = " FIY, BCB isn't erased automatically, so mtd erase should\n" " be called in advance before writing new BCB:\n" " > mtd erase mx7-bcb\n" - "nandbcb dump off|partition - dump/verify boot structures\n"; -#endif + "nandbcb dump off|partition - dump/verify boot structures\n"); U_BOOT_CMD(nandbcb, 7, 1, do_nandbcb, "i.MX NAND Boot Control Blocks write", diff --git a/board/freescale/common/ngpixis.c b/board/freescale/common/ngpixis.c index 37a6f775a057..7be1ccee6383 100644 --- a/board/freescale/common/ngpixis.c +++ b/board/freescale/common/ngpixis.c @@ -234,15 +234,13 @@ int pixis_reset_cmd(struct cmd_tbl *cmdtp, int flag, int argc, return 0; } -#ifdef CONFIG_SYS_LONGHELP -static char pixis_help_text[] = +U_BOOT_LONGHELP(pixis, "- hard reset to default bank\n" "pixis_reset altbank - reset to alternate bank\n" #ifdef DEBUG "pixis_reset dump - display the PIXIS registers\n" #endif - "pixis_reset sysclk - reset with SYSCLK frequency(KHz)\n"; -#endif + "pixis_reset sysclk - reset with SYSCLK frequency(KHz)\n"); U_BOOT_CMD( pixis_reset, CONFIG_SYS_MAXARGS, 1, pixis_reset_cmd, diff --git a/board/work-microwave/work_92105/work_92105_display.c b/board/work-microwave/work_92105/work_92105_display.c index 5f625e6f52ad..64dd5d4072a6 100644 --- a/board/work-microwave/work_92105/work_92105_display.c +++ b/board/work-microwave/work_92105/work_92105_display.c @@ -293,12 +293,10 @@ static int do_max6957aax(struct cmd_tbl *cmdtp, int flag, int argc, return 1; } -#ifdef CONFIG_SYS_LONGHELP -static char max6957aax_help_text[] = +U_BOOT_LONGHELP(max6957aax, "max6957aax - write or read display register:\n" "\tmax6957aax R|r reg - read display register;\n" - "\tmax6957aax reg val - write display register."; -#endif + "\tmax6957aax reg val - write display register."); U_BOOT_CMD( max6957aax, 6, 1, do_max6957aax, @@ -337,13 +335,11 @@ static int do_hd44780(struct cmd_tbl *cmdtp, int flag, int argc, return 0; } -#ifdef CONFIG_SYS_LONGHELP -static char hd44780_help_text[] = +U_BOOT_LONGHELP(hd44780, "hd44780 - control LCD driver:\n" "\thd44780 cmd - send command to driver;\n" "\thd44780 data - send data to driver;\n" - "\thd44780 str \"\" - send \"\" to driver."; -#endif + "\thd44780 str \"\" - send \"\" to driver."); U_BOOT_CMD( hd44780, 6, 1, do_hd44780, diff --git a/board/xilinx/common/fru.c b/board/xilinx/common/fru.c index f6ca46c3cecc..c916c3d6b4c8 100644 --- a/board/xilinx/common/fru.c +++ b/board/xilinx/common/fru.c @@ -72,17 +72,14 @@ static int do_fru(struct cmd_tbl *cmdtp, int flag, int argc, } /***************************************************/ -#ifdef CONFIG_SYS_LONGHELP -static char fru_help_text[] = +U_BOOT_LONGHELP(fru, "capture - Parse and capture FRU table present at address.\n" "fru display - Displays content of FRU table that was captured using\n" " fru capture command\n" "fru board_gen \n" " - Generate FRU format with\n" " board info area filled based on parameters. is\n" - " pointing to place where FRU is generated.\n" - ; -#endif + " pointing to place where FRU is generated.\n"); U_BOOT_CMD( fru, 8, 1, do_fru, diff --git a/board/xilinx/versal/cmds.c b/board/xilinx/versal/cmds.c index 148fa51266d2..9cc2cdcebf1c 100644 --- a/board/xilinx/versal/cmds.c +++ b/board/xilinx/versal/cmds.c @@ -91,12 +91,9 @@ static int do_versal(struct cmd_tbl *cmdtp, int flag, int argc, return cmd_process_error(c, ret); } -#ifdef CONFIG_SYS_LONGHELP -static char versal_help_text[] = +U_BOOT_LONGHELP(versal, "loadpdi addr len - Load pdi image\n" - "load pdi image at ddr address 'addr' with pdi image size 'len'\n" -; -#endif + "load pdi image at ddr address 'addr' with pdi image size 'len'\n"); U_BOOT_CMD(versal, 4, 1, do_versal, "versal sub-system", diff --git a/board/xilinx/zynq/cmds.c b/board/xilinx/zynq/cmds.c index 024fac65f304..d7c7b2f22955 100644 --- a/board/xilinx/zynq/cmds.c +++ b/board/xilinx/zynq/cmds.c @@ -527,8 +527,7 @@ static int do_zynq(struct cmd_tbl *cmdtp, int flag, int argc, return cmd_process_error(zynq_cmd, ret); } -#ifdef CONFIG_SYS_LONGHELP -static char zynq_help_text[] = +U_BOOT_LONGHELP(zynq, "" #ifdef CONFIG_CMD_ZYNQ_RSA "rsa - Verifies the authenticated and encrypted\n" @@ -545,8 +544,7 @@ static char zynq_help_text[] = " if operation type is load or loadp, it loads the encrypted\n" " full or partial bitstream on to PL respectively.\n" #endif - ; -#endif + ); U_BOOT_CMD(zynq, 6, 0, do_zynq, "Zynq specific commands", zynq_help_text diff --git a/board/xilinx/zynqmp/cmds.c b/board/xilinx/zynqmp/cmds.c index fadb0edb24fb..f1f3eff501e1 100644 --- a/board/xilinx/zynqmp/cmds.c +++ b/board/xilinx/zynqmp/cmds.c @@ -381,8 +381,7 @@ static int do_zynqmp(struct cmd_tbl *cmdtp, int flag, int argc, } /***************************************************/ -#ifdef CONFIG_SYS_LONGHELP -static char zynqmp_help_text[] = +U_BOOT_LONGHELP(zynqmp, "secure src len [key_addr] - verifies secure images of $len bytes\n" " long at address $src. Optional key_addr\n" " can be specified if user key needs to\n" @@ -422,8 +421,7 @@ static char zynqmp_help_text[] = " 48 bytes hash value into srcaddr\n" " Optional key_addr can be specified for saving sha3 hash value\n" " Note: srcaddr/srclen should not be 0\n" - ; -#endif + ); U_BOOT_CMD( zynqmp, 9, 1, do_zynqmp, diff --git a/cmd/acpi.c b/cmd/acpi.c index ede9c8c7dcb4..7e397d1a74e1 100644 --- a/cmd/acpi.c +++ b/cmd/acpi.c @@ -171,13 +171,11 @@ static int do_acpi_dump(struct cmd_tbl *cmdtp, int flag, int argc, return 0; } -#ifdef CONFIG_SYS_LONGHELP -static char acpi_help_text[] = +U_BOOT_LONGHELP(acpi, "list - list ACPI tables\n" "acpi items [-d] - List/dump each piece of ACPI data from devices\n" "acpi set [] - Set or show address of ACPI tables\n" - "acpi dump - Dump ACPI table"; -#endif + "acpi dump - Dump ACPI table"); U_BOOT_CMD_WITH_SUBCMDS(acpi, "ACPI tables", acpi_help_text, U_BOOT_SUBCMD_MKENT(list, 1, 1, do_acpi_list), diff --git a/cmd/aes.c b/cmd/aes.c index 1936518824a1..1264675aa01f 100644 --- a/cmd/aes.c +++ b/cmd/aes.c @@ -88,8 +88,7 @@ static int do_aes(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) } /***************************************************/ -#ifdef CONFIG_SYS_LONGHELP -static char aes_help_text[] = +U_BOOT_LONGHELP(aes, "[.128,.192,.256] enc key iv src dst len - Encrypt block of data $len bytes long\n" " at address $src using a key at address\n" " $key with initialization vector at address\n" @@ -101,8 +100,7 @@ static char aes_help_text[] = " $key with initialization vector at address\n" " $iv. Store the result at address $dst.\n" " The $len size must be multiple of 16 bytes.\n" - " The $key and $iv must be 16 bytes long."; -#endif + " The $key and $iv must be 16 bytes long."); U_BOOT_CMD( aes, 7, 1, do_aes, diff --git a/cmd/armffa.c b/cmd/armffa.c index 7e6eafc03ad7..9585150b9627 100644 --- a/cmd/armffa.c +++ b/cmd/armffa.c @@ -188,13 +188,13 @@ static int do_ffa_devlist(struct cmd_tbl *cmdtp, int flag, int argc, char *const return CMD_RET_SUCCESS; } -static char armffa_help_text[] = +U_BOOT_LONGHELP(armffa, "getpart \n" " - lists the partition(s) info\n" "ping \n" " - sends a data pattern to the specified partition\n" "devlist\n" - " - displays information about the FF-A device/driver\n"; + " - displays information about the FF-A device/driver\n"); U_BOOT_CMD_WITH_SUBCMDS(armffa, "Arm FF-A test command", armffa_help_text, U_BOOT_SUBCMD_MKENT(getpart, 2, 1, do_ffa_getpart), diff --git a/cmd/axi.c b/cmd/axi.c index b97b43eb7d01..5620891db28b 100644 --- a/cmd/axi.c +++ b/cmd/axi.c @@ -344,11 +344,11 @@ static int do_ihs_axi(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_USAGE; } -static char axi_help_text[] = +U_BOOT_LONGHELP(axi, "bus - show AXI bus info\n" "axi dev [bus] - show or set current AXI bus to bus number [bus]\n" "axi md size addr [# of objects] - read from AXI device at address [addr] and data width [size] (one of 8, 16, 32)\n" - "axi mw size addr value [count] - write data [value] to AXI device at address [addr] and data width [size] (one of 8, 16, 32)\n"; + "axi mw size addr value [count] - write data [value] to AXI device at address [addr] and data width [size] (one of 8, 16, 32)\n"); U_BOOT_CMD(axi, 7, 1, do_ihs_axi, "AXI sub-system", diff --git a/cmd/bloblist.c b/cmd/bloblist.c index 21e7ff67af20..26548ecf847e 100644 --- a/cmd/bloblist.c +++ b/cmd/bloblist.c @@ -29,11 +29,9 @@ static int do_bloblist_list(struct cmd_tbl *cmdtp, int flag, int argc, return 0; } -#ifdef CONFIG_SYS_LONGHELP -static char bloblist_help_text[] = +U_BOOT_LONGHELP(bloblist, "info - show information about the bloblist\n" - "bloblist list - list blobs in the bloblist"; -#endif + "bloblist list - list blobs in the bloblist"); U_BOOT_CMD_WITH_SUBCMDS(bloblist, "Bloblists", bloblist_help_text, U_BOOT_SUBCMD_MKENT(info, 1, 1, do_bloblist_info), diff --git a/cmd/bootcount.c b/cmd/bootcount.c index 3898d2543d2c..30ce5dba30d9 100644 --- a/cmd/bootcount.c +++ b/cmd/bootcount.c @@ -46,16 +46,11 @@ static int do_bootcount(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_USAGE; } -#if IS_ENABLED(CONFIG_SYS_LONGHELP) -static char bootcount_help_text[] = +U_BOOT_LONGHELP(bootcount, "print - print current bootcounter\n" - "reset - reset the bootcounter" - ; -#endif + "reset - reset the bootcounter"); U_BOOT_CMD(bootcount, 2, 1, do_bootcount, "bootcount", -#if IS_ENABLED(CONFIG_SYS_LONGHELP) bootcount_help_text -#endif ); diff --git a/cmd/bootdev.c b/cmd/bootdev.c index a657de6bd0f6..471189cda480 100644 --- a/cmd/bootdev.c +++ b/cmd/bootdev.c @@ -139,13 +139,11 @@ static int do_bootdev_hunt(struct cmd_tbl *cmdtp, int flag, int argc, return 0; } -#ifdef CONFIG_SYS_LONGHELP -static char bootdev_help_text[] = +U_BOOT_LONGHELP(bootdev, "list [-p] - list all available bootdevs (-p to probe)\n" "bootdev hunt [-l|] - use hunt drivers to find bootdevs\n" "bootdev select - select a bootdev by name | label | seq\n" - "bootdev info [-p] - show information about a bootdev (-p to probe)"; -#endif + "bootdev info [-p] - show information about a bootdev (-p to probe)"); U_BOOT_CMD_WITH_SUBCMDS(bootdev, "Boot devices", bootdev_help_text, U_BOOT_SUBCMD_MKENT(list, 2, 1, do_bootdev_list), diff --git a/cmd/bootefi.c b/cmd/bootefi.c index f73d6eb0e2d8..20e5c94a33a4 100644 --- a/cmd/bootefi.c +++ b/cmd/bootefi.c @@ -698,8 +698,7 @@ static int do_bootefi(struct cmd_tbl *cmdtp, int flag, int argc, return ret; } -#ifdef CONFIG_SYS_LONGHELP -static char bootefi_help_text[] = +U_BOOT_LONGHELP(bootefi, "[:] []\n" " - boot EFI payload\n" #ifdef CONFIG_CMD_BOOTEFI_HELLO @@ -719,8 +718,7 @@ static char bootefi_help_text[] = " If specified, the device tree located at gets\n" " exposed as EFI configuration table.\n" #endif - ; -#endif + ); U_BOOT_CMD( bootefi, 4, 0, do_bootefi, diff --git a/cmd/bootflow.c b/cmd/bootflow.c index 300ad3aaa760..ad39ebe4379f 100644 --- a/cmd/bootflow.c +++ b/cmd/bootflow.c @@ -541,8 +541,7 @@ static int do_bootflow_cmdline(struct cmd_tbl *cmdtp, int flag, int argc, } #endif /* CONFIG_CMD_BOOTFLOW_FULL */ -#ifdef CONFIG_SYS_LONGHELP -static char bootflow_help_text[] = +U_BOOT_LONGHELP(bootflow, #ifdef CONFIG_CMD_BOOTFLOW_FULL "scan [-abeGl] [bdev] - scan for valid bootflows (-l list, -a all, -e errors, -b boot, -G no global)\n" "bootflow list [-e] - list scanned bootflows (-e errors)\n" @@ -551,11 +550,11 @@ static char bootflow_help_text[] = "bootflow read - read all current-bootflow files\n" "bootflow boot - boot current bootflow\n" "bootflow menu [-t] - show a menu of available bootflows\n" - "bootflow cmdline [set|get|clear|delete|auto] [] - update cmdline"; + "bootflow cmdline [set|get|clear|delete|auto] [] - update cmdline" #else - "scan - boot first available bootflow\n"; + "scan - boot first available bootflow\n" #endif -#endif /* CONFIG_SYS_LONGHELP */ + ); U_BOOT_CMD_WITH_SUBCMDS(bootflow, "Boot flows", bootflow_help_text, U_BOOT_SUBCMD_MKENT(scan, 3, 1, do_bootflow_scan), diff --git a/cmd/booti.c b/cmd/booti.c index 6ac39193db80..1d531bdd0658 100644 --- a/cmd/booti.c +++ b/cmd/booti.c @@ -134,8 +134,7 @@ int do_booti(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) return ret; } -#ifdef CONFIG_SYS_LONGHELP -static char booti_help_text[] = +U_BOOT_LONGHELP(booti, "[addr [initrd[:size]] [fdt]]\n" " - boot Linux flat or compressed 'Image' stored at 'addr'\n" "\tThe argument 'initrd' is optional and specifies the address\n" @@ -151,8 +150,7 @@ static char booti_help_text[] = "\tis required. To boot a kernel with a device-tree blob but\n" "\twithout an initrd image, use a '-' for the initrd argument.\n" #endif - ""; -#endif + ); U_BOOT_CMD( booti, CONFIG_SYS_MAXARGS, 1, do_booti, diff --git a/cmd/bootm.c b/cmd/bootm.c index 7968415b6d1e..3e504ccfe811 100644 --- a/cmd/bootm.c +++ b/cmd/bootm.c @@ -168,8 +168,7 @@ int bootm_maybe_autostart(struct cmd_tbl *cmdtp, const char *cmd) return 0; } -#ifdef CONFIG_SYS_LONGHELP -static char bootm_help_text[] = +U_BOOT_LONGHELP(bootm, "[addr [arg ...]]\n - boot application image stored in memory\n" "\tpassing arguments 'arg ...'; when booting a Linux kernel,\n" "\t'arg' can be the address of an initrd image\n" @@ -208,8 +207,7 @@ static char bootm_help_text[] = #if defined(CONFIG_TRACE) "\tfake - OS specific fake start without go\n" #endif - "\tgo - start OS"; -#endif + "\tgo - start OS"); U_BOOT_CMD( bootm, CONFIG_SYS_MAXARGS, 1, do_bootm, diff --git a/cmd/bootmeth.c b/cmd/bootmeth.c index 9fbcccdba7ef..f5b01343c48c 100644 --- a/cmd/bootmeth.c +++ b/cmd/bootmeth.c @@ -104,11 +104,9 @@ static int do_bootmeth_order(struct cmd_tbl *cmdtp, int flag, int argc, return 0; } -#ifdef CONFIG_SYS_LONGHELP -static char bootmeth_help_text[] = +U_BOOT_LONGHELP(bootmeth, "list [-a] - list available bootmeths (-a all)\n" - "bootmeth order [ ...] - select bootmeth order / subset to use"; -#endif + "bootmeth order [ ...] - select bootmeth order / subset to use"); U_BOOT_CMD_WITH_SUBCMDS(bootmeth, "Boot methods", bootmeth_help_text, U_BOOT_SUBCMD_MKENT(list, 2, 1, do_bootmeth_list), diff --git a/cmd/bootz.c b/cmd/bootz.c index f1423573d23d..742889f21de7 100644 --- a/cmd/bootz.c +++ b/cmd/bootz.c @@ -88,8 +88,7 @@ int do_bootz(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) return ret; } -#ifdef CONFIG_SYS_LONGHELP -static char bootz_help_text[] = +U_BOOT_LONGHELP(bootz, "[addr [initrd[:size]] [fdt]]\n" " - boot Linux zImage stored in memory\n" "\tThe argument 'initrd' is optional and specifies the address\n" @@ -102,8 +101,7 @@ static char bootz_help_text[] = "\tuse a '-' for the second argument. If you do not pass a third\n" "\ta bd_info struct will be passed instead\n" #endif - ""; -#endif + ); U_BOOT_CMD( bootz, CONFIG_SYS_MAXARGS, 1, do_bootz, diff --git a/cmd/cat.c b/cmd/cat.c index b059080193d4..18aa6ca7aa67 100644 --- a/cmd/cat.c +++ b/cmd/cat.c @@ -60,11 +60,9 @@ static int do_cat(struct cmd_tbl *cmdtp, int flag, int argc, return 0; } -#ifdef CONFIG_SYS_LONGHELP -static char cat_help_text[] = +U_BOOT_LONGHELP(cat, " \n" - " - Print file from 'dev' on 'interface' to standard output\n"; -#endif + " - Print file from 'dev' on 'interface' to standard output\n"); U_BOOT_CMD(cat, 4, 1, do_cat, "Print file to standard output", diff --git a/cmd/cedit.c b/cmd/cedit.c index 2ff284f4cde6..6352e6369d1e 100644 --- a/cmd/cedit.c +++ b/cmd/cedit.c @@ -270,8 +270,7 @@ static int do_cedit_run(struct cmd_tbl *cmdtp, int flag, int argc, return 0; } -#ifdef CONFIG_SYS_LONGHELP -static char cedit_help_text[] = +U_BOOT_LONGHELP(cedit, "load - load config editor\n" "cedit read_fdt - read settings\n" "cedit write_fdt - write settings\n" @@ -279,8 +278,7 @@ static char cedit_help_text[] = "cedit write_env [-v] - write settings to env vars\n" "cedit read_cmos [-v] [dev] - read settings from CMOS RAM\n" "cedit write_cmos [-v] [dev] - write settings to CMOS RAM\n" - "cedit run - run config editor"; -#endif /* CONFIG_SYS_LONGHELP */ + "cedit run - run config editor"); U_BOOT_CMD_WITH_SUBCMDS(cedit, "Configuration editor", cedit_help_text, U_BOOT_SUBCMD_MKENT(load, 5, 1, do_cedit_load), diff --git a/cmd/clk.c b/cmd/clk.c index ff7c7649a159..c7c379d7a617 100644 --- a/cmd/clk.c +++ b/cmd/clk.c @@ -152,10 +152,8 @@ static int do_clk(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_USAGE; } -#ifdef CONFIG_SYS_LONGHELP -static char clk_help_text[] = +U_BOOT_LONGHELP(clk, "dump - Print clock frequencies\n" - "clk setfreq [clk] [freq] - Set clock frequency"; -#endif + "clk setfreq [clk] [freq] - Set clock frequency"); U_BOOT_CMD(clk, 4, 1, do_clk, "CLK sub-system", clk_help_text); diff --git a/cmd/conitrace.c b/cmd/conitrace.c index d50f3bf3ccbf..9a1bc3518485 100644 --- a/cmd/conitrace.c +++ b/cmd/conitrace.c @@ -41,9 +41,7 @@ static int do_conitrace(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_SUCCESS; } -#ifdef CONFIG_SYS_LONGHELP -static char conitrace_help_text[] = ""; -#endif +U_BOOT_LONGHELP(conitrace, ""); U_BOOT_CMD_COMPLETE( conitrace, 2, 0, do_conitrace, diff --git a/cmd/cpu.c b/cmd/cpu.c index 314852440f1d..245a82fa3eb4 100644 --- a/cmd/cpu.c +++ b/cmd/cpu.c @@ -83,12 +83,9 @@ static int do_cpu_detail(struct cmd_tbl *cmdtp, int flag, int argc, return 0; } -#if IS_ENABLED(CONFIG_SYS_LONGHELP) -static char cpu_help_text[] = +U_BOOT_LONGHELP(cpu, "list - list available CPUs\n" - "cpu detail - show CPU detail" - ; -#endif + "cpu detail - show CPU detail"); U_BOOT_CMD_WITH_SUBCMDS(cpu, "display information about CPUs", cpu_help_text, U_BOOT_SUBCMD_MKENT(list, 1, 1, do_cpu_list), diff --git a/cmd/cyclic.c b/cmd/cyclic.c index 946f1d78184d..ad7fc3b975e1 100644 --- a/cmd/cyclic.c +++ b/cmd/cyclic.c @@ -76,9 +76,9 @@ static int do_cyclic_list(struct cmd_tbl *cmdtp, int flag, int argc, return 0; } -static char cyclic_help_text[] = +U_BOOT_LONGHELP(cyclic, "demo - register cyclic demo function\n" - "cyclic list - list cyclic functions\n"; + "cyclic list - list cyclic functions\n"); U_BOOT_CMD_WITH_SUBCMDS(cyclic, "Cyclic", cyclic_help_text, U_BOOT_SUBCMD_MKENT(demo, 3, 1, do_cyclic_demo), diff --git a/cmd/dm.c b/cmd/dm.c index 1aa86aab9c1c..fb605c2da1a8 100644 --- a/cmd/dm.c +++ b/cmd/dm.c @@ -112,17 +112,14 @@ static int do_dm_dump_uclass(struct cmd_tbl *cmdtp, int flag, int argc, #define DM_MEM #endif -#if IS_ENABLED(CONFIG_SYS_LONGHELP) -static char dm_help_text[] = +U_BOOT_LONGHELP(dm, "compat Dump list of drivers with compatibility strings\n" "dm devres Dump list of device resources for each device\n" "dm drivers Dump list of drivers with uclass and instances\n" DM_MEM_HELP "dm static Dump list of drivers with static platform data\n" "dm tree [-s][-e][name] Dump tree of driver model devices (-s=sort)\n" - "dm uclass [-e][name] Dump list of instances for each uclass" - ; -#endif + "dm uclass [-e][name] Dump list of instances for each uclass"); U_BOOT_CMD_WITH_SUBCMDS(dm, "Driver model low level access", dm_help_text, U_BOOT_SUBCMD_MKENT(compat, 1, 1, do_dm_dump_driver_compat), diff --git a/cmd/efidebug.c b/cmd/efidebug.c index 0be3af3e7630..201531ac19fc 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -1484,8 +1484,7 @@ static int do_efidebug(struct cmd_tbl *cmdtp, int flag, return cp->cmd(cmdtp, flag, argc, argv); } -#ifdef CONFIG_SYS_LONGHELP -static char efidebug_help_text[] = +U_BOOT_LONGHELP(efidebug, " - UEFI Shell-like interface to configure UEFI environment\n" "\n" "efidebug boot add - set UEFI BootXXXX variable\n" @@ -1532,8 +1531,7 @@ static char efidebug_help_text[] = " - run simple bootmgr for test\n" #endif "efidebug query [-nv][-bs][-rt][-at]\n" - " - show size of UEFI variables store\n"; -#endif + " - show size of UEFI variables store\n"); U_BOOT_CMD( efidebug, CONFIG_SYS_MAXARGS, 0, do_efidebug, diff --git a/cmd/event.c b/cmd/event.c index b4b779ffac00..f6cdb55fc913 100644 --- a/cmd/event.c +++ b/cmd/event.c @@ -18,10 +18,8 @@ static int do_event_list(struct cmd_tbl *cmdtp, int flag, int argc, return 0; } -#ifdef CONFIG_SYS_LONGHELP -static char event_help_text[] = - "list - list event spies"; -#endif +U_BOOT_LONGHELP(event, + "list - list event spies"); U_BOOT_CMD_WITH_SUBCMDS(event, "Events", event_help_text, U_BOOT_SUBCMD_MKENT(list, 1, 1, do_event_list)); diff --git a/cmd/fdt.c b/cmd/fdt.c index 2401ea8b44cb..331564c13be9 100644 --- a/cmd/fdt.c +++ b/cmd/fdt.c @@ -1113,8 +1113,7 @@ static int fdt_print(const char *pathp, char *prop, int depth) } /********************************************************************/ -#ifdef CONFIG_SYS_LONGHELP -static char fdt_help_text[] = +U_BOOT_LONGHELP(fdt, "addr [-c] [-q] [] - Set the [control] fdt location to \n" #ifdef CONFIG_OF_LIBFDT_OVERLAY "fdt apply - Apply overlay to the DT\n" @@ -1153,8 +1152,7 @@ static char fdt_help_text[] = " default gd->fdt_blob\n" #endif "NOTE: Dereference aliases by omitting the leading '/', " - "e.g. fdt print ethernet0."; -#endif + "e.g. fdt print ethernet0."); U_BOOT_CMD( fdt, 255, 0, do_fdt, diff --git a/cmd/font.c b/cmd/font.c index fe2d65caaf77..cb39c88063fb 100644 --- a/cmd/font.c +++ b/cmd/font.c @@ -79,12 +79,10 @@ static int do_font_size(struct cmd_tbl *cmdtp, int flag, int argc, } -#ifdef CONFIG_SYS_LONGHELP -static char font_help_text[] = +U_BOOT_LONGHELP(font, "list - list available fonts\n" "font select [] - select font to use\n" - "font size - select font size to"; -#endif + "font size - select font size to"); U_BOOT_CMD_WITH_SUBCMDS(font, "Fonts", font_help_text, U_BOOT_SUBCMD_MKENT(list, 1, 1, do_font_list), diff --git a/cmd/help.c b/cmd/help.c index 8d67d977bf1a..9f8393eefd81 100644 --- a/cmd/help.c +++ b/cmd/help.c @@ -29,7 +29,10 @@ U_BOOT_CMD( ); #ifdef CONFIG_CMDLINE -/* This does not use the U_BOOT_CMD macro as ? can't be used in symbol names */ +/* + * This does not use the U_BOOT_CMD macro as ? can't be used in symbol names + * nor can we rely on the CONFIG_SYS_LONGHELP helper macro + */ ll_entry_declare(struct cmd_tbl, question_mark, cmd) = { "?", CONFIG_SYS_MAXARGS, cmd_always_repeatable, do_help, "alias for 'help'", diff --git a/cmd/i2c.c b/cmd/i2c.c index f0a5fa2e741f..80831561c671 100644 --- a/cmd/i2c.c +++ b/cmd/i2c.c @@ -1969,8 +1969,7 @@ static int do_i2c(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) } /***************************************************/ -#ifdef CONFIG_SYS_LONGHELP -static char i2c_help_text[] = +U_BOOT_LONGHELP(i2c, #if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) || CONFIG_IS_ENABLED(DM_I2C) "bus [muxtype:muxaddr:muxchannel] - show I2C bus info\n" "i2c " /* That's the prefix for the crc32 command below. */ @@ -1999,8 +1998,7 @@ static char i2c_help_text[] = #if defined(CONFIG_CMD_SDRAM) "i2c sdram chip - print SDRAM configuration information\n" #endif - "i2c speed [speed] - show or set I2C bus speed"; -#endif + "i2c speed [speed] - show or set I2C bus speed"); U_BOOT_CMD( i2c, 7, 1, do_i2c, diff --git a/cmd/kaslrseed.c b/cmd/kaslrseed.c index 8a1d8120cdcf..9acb8e163863 100644 --- a/cmd/kaslrseed.c +++ b/cmd/kaslrseed.c @@ -68,11 +68,9 @@ static int do_kaslr_seed(struct cmd_tbl *cmdtp, int flag, int argc, char *const return ret; } -#ifdef CONFIG_SYS_LONGHELP -static char kaslrseed_help_text[] = +U_BOOT_LONGHELP(kaslrseed, "[n]\n" - " - append random bytes to chosen kaslr-seed node\n"; -#endif + " - append random bytes to chosen kaslr-seed node\n"); U_BOOT_CMD( kaslrseed, 1, 0, do_kaslr_seed, diff --git a/cmd/log.c b/cmd/log.c index c377aee85c5e..c9a23e4ae0d3 100644 --- a/cmd/log.c +++ b/cmd/log.c @@ -375,8 +375,7 @@ static int do_log_rec(struct cmd_tbl *cmdtp, int flag, int argc, return 0; } -#ifdef CONFIG_SYS_LONGHELP -static char log_help_text[] = +U_BOOT_LONGHELP(log, "level [] - get/set log level\n" "categories - list log categories\n" "drivers - list log drivers\n" @@ -405,9 +404,7 @@ static char log_help_text[] = "\tc=category, l=level, F=file, L=line number, f=function, m=msg\n" "\tor 'default', or 'all' for all\n" "log rec - " - "output a log record" - ; -#endif + "output a log record"); U_BOOT_CMD_WITH_SUBCMDS(log, "log system", log_help_text, U_BOOT_SUBCMD_MKENT(level, 2, 1, do_log_level), diff --git a/cmd/mp.c b/cmd/mp.c index 8d14401b4944..1b4373f25873 100644 --- a/cmd/mp.c +++ b/cmd/mp.c @@ -66,8 +66,7 @@ cpu_cmd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) return 0; } -#ifdef CONFIG_SYS_LONGHELP -static char cpu_help_text[] = +U_BOOT_LONGHELP(cpu, " reset - Reset cpu \n" "cpu status - Status of all cpus\n" "cpu status - Status of cpu \n" @@ -86,8 +85,7 @@ static char cpu_help_text[] = " When cpu is released r4 and r5 = 0.\n" \ " r7 will contain the size of the initial mapped area" #endif - ""; -#endif + ); U_BOOT_CMD( cpu, CONFIG_SYS_MAXARGS, 1, cpu_cmd, diff --git a/cmd/mtd.c b/cmd/mtd.c index eb6e2d6892ff..e63c011e7910 100644 --- a/cmd/mtd.c +++ b/cmd/mtd.c @@ -541,8 +541,7 @@ static int mtd_name_complete(int argc, char *const argv[], char last_char, } #endif /* CONFIG_AUTO_COMPLETE */ -#ifdef CONFIG_SYS_LONGHELP -static char mtd_help_text[] = +U_BOOT_LONGHELP(mtd, "- generic operations on memory technology devices\n\n" "mtd list\n" "mtd read[.raw][.oob] [ []]\n" @@ -563,8 +562,7 @@ static char mtd_help_text[] = "\t\t* must be a multiple of a block for erase\n" "\t\t* must be a multiple of a page otherwise (special case: default is a page with dump)\n" "\n" - "The .dontskipff option forces writing empty pages, don't use it if unsure.\n"; -#endif + "The .dontskipff option forces writing empty pages, don't use it if unsure.\n"); U_BOOT_CMD_WITH_SUBCMDS(mtd, "MTD utils", mtd_help_text, U_BOOT_SUBCMD_MKENT(list, 1, 1, do_mtd_list), diff --git a/cmd/mtdparts.c b/cmd/mtdparts.c index 0984158f41ea..b31db73ebfc9 100644 --- a/cmd/mtdparts.c +++ b/cmd/mtdparts.c @@ -2079,8 +2079,7 @@ U_BOOT_CMD( " - change active partition (e.g. part-id = nand0,1) of a MTD device" ); -#ifdef CONFIG_SYS_LONGHELP -static char mtdparts_help_text[] = +U_BOOT_LONGHELP(mtdparts, "\n" " - list partition table\n" "mtdparts delall\n" @@ -2122,8 +2121,7 @@ static char mtdparts_help_text[] = " := standard linux memsize OR '-' to denote all remaining space\n" " := partition start offset within the device\n" " := '(' NAME ')'\n" - " := when set to 'ro' makes partition read-only (not used, passed to kernel)"; -#endif + " := when set to 'ro' makes partition read-only (not used, passed to kernel)"); U_BOOT_CMD( mtdparts, 6, 0, do_mtdparts, diff --git a/cmd/mux.c b/cmd/mux.c index c75907af7726..388fb0878a84 100644 --- a/cmd/mux.c +++ b/cmd/mux.c @@ -173,10 +173,10 @@ static int do_mux_deselect(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_SUCCESS; } -static char mux_help_text[] = +U_BOOT_LONGHELP(mux, "list - List all Muxes and their states\n" "select - Select the given mux state\n" - "deselect - Deselect the given mux and reset it to its idle state"; + "deselect - Deselect the given mux and reset it to its idle state"); U_BOOT_CMD_WITH_SUBCMDS(mux, "List, select, and deselect muxes", mux_help_text, U_BOOT_SUBCMD_MKENT(list, 1, 1, do_mux_list), diff --git a/cmd/nand.c b/cmd/nand.c index b41e54ec4229..71b8f9644296 100644 --- a/cmd/nand.c +++ b/cmd/nand.c @@ -919,8 +919,7 @@ usage: return CMD_RET_USAGE; } -#ifdef CONFIG_SYS_LONGHELP -static char nand_help_text[] = +U_BOOT_LONGHELP(nand, "info - show available NAND devices\n" "nand device [dev] - show or set current device\n" "nand read - addr off|partition size\n" @@ -965,8 +964,7 @@ static char nand_help_text[] = "nand env.oob set off|partition - set enviromnent offset\n" "nand env.oob get - get environment offset" #endif - ""; -#endif + ); U_BOOT_CMD( nand, CONFIG_SYS_MAXARGS, 1, do_nand, diff --git a/cmd/nvedit.c b/cmd/nvedit.c index eaa000bd3559..daf1ad37f9be 100644 --- a/cmd/nvedit.c +++ b/cmd/nvedit.c @@ -1238,8 +1238,7 @@ static int do_env(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) return CMD_RET_USAGE; } -#ifdef CONFIG_SYS_LONGHELP -static char env_help_text[] = +U_BOOT_LONGHELP(env, #if defined(CONFIG_CMD_ASKENV) "ask name [message] [size] - ask for environment variable\nenv " #endif @@ -1304,8 +1303,7 @@ static char env_help_text[] = "env set -e [-nv][-bs][-rt][-at][-a][-i addr:size][-v] name [arg ...]\n" " - set UEFI variable; unset if '-i' or 'arg' not specified\n" #endif - "env set [-f] name [arg ...]\n"; -#endif + "env set [-f] name [arg ...]\n"); U_BOOT_CMD( env, CONFIG_SYS_MAXARGS, 1, do_env, diff --git a/cmd/osd.c b/cmd/osd.c index c8c62d4a2ab3..210bc5d4c231 100644 --- a/cmd/osd.c +++ b/cmd/osd.c @@ -278,12 +278,12 @@ static int do_osd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) return CMD_RET_USAGE; } -static char osd_help_text[] = +U_BOOT_LONGHELP(osd, "show - show OSD info\n" "osd dev [dev] - show or set current OSD\n" "write [pos_x] [pos_y] [buffer] [count] - write 8-bit hex encoded buffer to osd memory at a given position\n" "print [pos_x] [pos_y] [color] [text] - write ASCII buffer (given by text data and driver-specific color information) to osd memory\n" - "size [size_x] [size_y] - set OSD XY size in characters\n"; + "size [size_x] [size_y] - set OSD XY size in characters\n"); U_BOOT_CMD( osd, 6, 1, do_osd, diff --git a/cmd/pcap.c b/cmd/pcap.c index ab5c1a7e8737..a0149203fad5 100644 --- a/cmd/pcap.c +++ b/cmd/pcap.c @@ -48,7 +48,7 @@ static int do_pcap_clear(struct cmd_tbl *cmdtp, int flag, int argc, return pcap_clear() ? CMD_RET_FAILURE : CMD_RET_SUCCESS; } -static char pcap_help_text[] = +U_BOOT_LONGHELP(pcap, "- network packet capture\n\n" "pcap\n" "pcap init\t\t\t \n" @@ -60,7 +60,7 @@ static char pcap_help_text[] = "With:\n" "\t: user address to which pcap will be stored (hexedcimal)\n" "\t: Maximum size of pcap file (decimal)\n" - "\n"; + "\n"); U_BOOT_CMD_WITH_SUBCMDS(pcap, "pcap", pcap_help_text, U_BOOT_SUBCMD_MKENT(init, 3, 0, do_pcap_init), diff --git a/cmd/pci.c b/cmd/pci.c index 78b661d15b1c..d89e71c16a04 100644 --- a/cmd/pci.c +++ b/cmd/pci.c @@ -620,8 +620,7 @@ static int do_pci(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) /***************************************************/ -#ifdef CONFIG_SYS_LONGHELP -static char pci_help_text[] = +U_BOOT_LONGHELP(pci, "[bus|*] [long]\n" " - short or long list of PCI devices on bus 'bus'\n" "pci enum\n" @@ -639,8 +638,7 @@ static char pci_help_text[] = "pci modify[.b, .w, .l] b.d.f address\n" " - modify, auto increment CFG address\n" "pci write[.b, .w, .l] b.d.f address value\n" - " - write to CFG address"; -#endif + " - write to CFG address"); U_BOOT_CMD( pci, 5, 1, do_pci, diff --git a/cmd/pci_mps.c b/cmd/pci_mps.c index 555a5fdd8e6b..98161da93a05 100644 --- a/cmd/pci_mps.c +++ b/cmd/pci_mps.c @@ -152,13 +152,11 @@ usage: /***************************************************/ -#ifdef CONFIG_SYS_LONGHELP -static char pci_mps_help_text[] = +U_BOOT_LONGHELP(pci_mps, "safe\n" " - Set PCI Express MPS of all devices to safe values\n" "pci_mps peer2peer\n" - " - Set PCI Express MPS of all devices to support hotplug and peer-to-peer DMA\n"; -#endif + " - Set PCI Express MPS of all devices to support hotplug and peer-to-peer DMA\n"); U_BOOT_CMD(pci_mps, 2, 0, do_pci_mps, "configure PCI Express MPS", pci_mps_help_text); diff --git a/cmd/riscv/sbi.c b/cmd/riscv/sbi.c index 32761c595eb3..940d9bc1681a 100644 --- a/cmd/riscv/sbi.c +++ b/cmd/riscv/sbi.c @@ -119,11 +119,8 @@ static int do_sbi(struct cmd_tbl *cmdtp, int flag, int argc, return 0; } -#ifdef CONFIG_SYS_LONGHELP -static char sbi_help_text[] = - "- display SBI spec version, implementation, and available extensions"; - -#endif +U_BOOT_LONGHELP(sbi, + "- display SBI spec version, implementation, and available extensions"); U_BOOT_CMD_COMPLETE( sbi, 1, 0, do_sbi, diff --git a/cmd/rng.c b/cmd/rng.c index 81a23964b82e..52f722c7af89 100644 --- a/cmd/rng.c +++ b/cmd/rng.c @@ -56,11 +56,9 @@ static int do_rng(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) return ret; } -#ifdef CONFIG_SYS_LONGHELP -static char rng_help_text[] = +U_BOOT_LONGHELP(rng, "[dev [n]]\n" - " - print n random bytes(max 64) read from dev\n"; -#endif + " - print n random bytes(max 64) read from dev\n"); U_BOOT_CMD( rng, 3, 0, do_rng, diff --git a/cmd/sandbox/exception.c b/cmd/sandbox/exception.c index 1aa1d673aed4..c082401ce6b3 100644 --- a/cmd/sandbox/exception.c +++ b/cmd/sandbox/exception.c @@ -31,11 +31,10 @@ static struct cmd_tbl cmd_sub[] = { "", ""), }; -static char exception_help_text[] = +U_BOOT_LONGHELP(exception, "\n" " The following exceptions are available:\n" " undefined - undefined instruction\n" - " sigsegv - illegal memory access\n" - ; + " sigsegv - illegal memory access\n"); #include diff --git a/cmd/scp03.c b/cmd/scp03.c index 216c942dd48b..2b8d5aecf349 100644 --- a/cmd/scp03.c +++ b/cmd/scp03.c @@ -41,11 +41,12 @@ int do_scp03_provision(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_SUCCESS; } -static char text[] = +U_BOOT_LONGHELP(scp03, "provides a command to enable SCP03 and provision the SCP03 keys\n" " enable - enable SCP03 on the TEE\n" - " provision - provision SCP03 on the TEE\n"; + " provision - provision SCP03 on the TEE\n"); -U_BOOT_CMD_WITH_SUBCMDS(scp03, "Secure Channel Protocol 03 control", text, +U_BOOT_CMD_WITH_SUBCMDS(scp03, "Secure Channel Protocol 03 control", + scp03_help_text, U_BOOT_SUBCMD_MKENT(enable, 1, 1, do_scp03_enable), U_BOOT_SUBCMD_MKENT(provision, 1, 1, do_scp03_provision)); diff --git a/cmd/sf.c b/cmd/sf.c index 977ffcb63c10..30b2bd5ef689 100644 --- a/cmd/sf.c +++ b/cmd/sf.c @@ -614,8 +614,7 @@ static int do_spi_flash(struct cmd_tbl *cmdtp, int flag, int argc, return ret; } -#ifdef CONFIG_SYS_LONGHELP -static const char long_help[] = +U_BOOT_LONGHELP(sf, "probe [[bus:]cs] [hz] [mode] - init flash device on given SPI bus\n" " and chip select\n" "sf read addr offset|partition len - read `len' bytes starting at\n" @@ -635,10 +634,9 @@ static const char long_help[] = #ifdef CONFIG_CMD_SF_TEST "\nsf test offset len - run a very basic destructive test" #endif -#endif /* CONFIG_SYS_LONGHELP */ - ; + ); U_BOOT_CMD( sf, 5, 1, do_spi_flash, - "SPI flash sub-system", long_help + "SPI flash sub-system", sf_help_text ); diff --git a/cmd/source.c b/cmd/source.c index 92c7835bf50e..0ba9736b1ab3 100644 --- a/cmd/source.c +++ b/cmd/source.c @@ -54,19 +54,18 @@ static int do_source(struct cmd_tbl *cmdtp, int flag, int argc, return rcode; } -#ifdef CONFIG_SYS_LONGHELP -static char source_help_text[] = +U_BOOT_LONGHELP(source, #if defined(CONFIG_FIT) "[][:[]|#[]]\n" "\t- Run script starting at addr\n" "\t- A FIT config name or subimage name may be specified with : or #\n" "\t (like bootm). If the image or config name is omitted, the\n" - "\t default is used."; + "\t default is used." #else "[]\n" - "\t- Run script starting at addr"; -#endif + "\t- Run script starting at addr" #endif + ); U_BOOT_CMD( source, 2, 0, do_source, diff --git a/cmd/ti/pd.c b/cmd/ti/pd.c index a9a182fc386e..a0492a5fdee3 100644 --- a/cmd/ti/pd.c +++ b/cmd/ti/pd.c @@ -175,11 +175,11 @@ static int ti_do_pd(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv return CMD_RET_USAGE; } -U_BOOT_CMD(pd, 4, 1, ti_do_pd, - "TI power domain control", -#if IS_ENABLED(CONFIG_SYS_LONGHELP) +U_BOOT_LONGHELP(pd, "dump - show power domain status\n" "enable [psc] [lpsc] - enable power domain\n" - "disable [psc] [lpsc] - disable power domain\n" -#endif + "disable [psc] [lpsc] - disable power domain\n"); + +U_BOOT_CMD(pd, 4, 1, ti_do_pd, + "TI power domain control", pd_help_text ); diff --git a/cmd/vbe.c b/cmd/vbe.c index 600690394eb8..0e84b0e97aa4 100644 --- a/cmd/vbe.c +++ b/cmd/vbe.c @@ -104,13 +104,11 @@ static int do_vbe_state(struct cmd_tbl *cmdtp, int flag, int argc, return 0; } -#ifdef CONFIG_SYS_LONGHELP -static char vbe_help_text[] = +U_BOOT_LONGHELP(vbe, "list - list VBE bootmeths\n" "vbe select - select a VBE bootmeth by sequence or name\n" "vbe info - show information about a VBE bootmeth\n" - "vbe state - show VBE state"; -#endif + "vbe state - show VBE state"); U_BOOT_CMD_WITH_SUBCMDS(vbe, "Verified Boot for Embedded", vbe_help_text, U_BOOT_SUBCMD_MKENT(list, 1, 1, do_vbe_list), diff --git a/cmd/wdt.c b/cmd/wdt.c index 27410981e7bf..b9fdf7ad155f 100644 --- a/cmd/wdt.c +++ b/cmd/wdt.c @@ -157,13 +157,13 @@ static int do_wdt_expire(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_SUCCESS; } -static char wdt_help_text[] = +U_BOOT_LONGHELP(wdt, "list - list watchdog devices\n" "wdt dev [] - get/set current watchdog device\n" "wdt start [flags] - start watchdog timer\n" "wdt stop - stop watchdog timer\n" "wdt reset - reset watchdog timer\n" - "wdt expire [flags] - expire watchdog timer immediately\n"; + "wdt expire [flags] - expire watchdog timer immediately\n"); U_BOOT_CMD_WITH_SUBCMDS(wdt, "Watchdog sub-system", wdt_help_text, U_BOOT_SUBCMD_MKENT(list, 1, 1, do_wdt_list), diff --git a/cmd/ximg.c b/cmd/ximg.c index 60ed2c9f6f9e..a50dd20b19aa 100644 --- a/cmd/ximg.c +++ b/cmd/ximg.c @@ -258,8 +258,7 @@ do_imgextract(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) return 0; } -#ifdef CONFIG_SYS_LONGHELP -static char imgextract_help_text[] = +U_BOOT_LONGHELP(imgextract, "addr part [dest]\n" " - extract from legacy image at and copy to " #if defined(CONFIG_FIT) @@ -267,8 +266,7 @@ static char imgextract_help_text[] = "addr uname [dest]\n" " - extract subimage from FIT image at and copy to " #endif - ""; -#endif + ); U_BOOT_CMD( imxtract, 4, 1, do_imgextract, diff --git a/cmd/xxd.c b/cmd/xxd.c index 742a85c7a933..446ac1915ef5 100644 --- a/cmd/xxd.c +++ b/cmd/xxd.c @@ -73,11 +73,9 @@ static int do_xxd(struct cmd_tbl *cmdtp, int flag, int argc, return 0; } -#ifdef CONFIG_SYS_LONGHELP -static char xxd_help_text[] = +U_BOOT_LONGHELP(xxd, " \n" - " - Print file from 'dev' on 'interface' as hexdump to standard output\n"; -#endif + " - Print file from 'dev' on 'interface' as hexdump to standard output\n"); U_BOOT_CMD(xxd, 4, 1, do_xxd, "Print file as hexdump to standard output", diff --git a/test/cmd_ut.c b/test/cmd_ut.c index 0f56409e8031..477d4759521c 100644 --- a/test/cmd_ut.c +++ b/test/cmd_ut.c @@ -166,8 +166,7 @@ static int do_ut(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) return CMD_RET_USAGE; } -#ifdef CONFIG_SYS_LONGHELP -static char ut_help_text[] = +U_BOOT_LONGHELP(ut, "[-r] [-f] [] - run unit tests\n" " -r Number of times to run each test\n" " -f Force 'manual' tests to run as well\n" @@ -237,8 +236,7 @@ static char ut_help_text[] = !defined(CONFIG_SPL_BUILD) && !defined(API_BUILD) "\nunicode - Unicode functions" #endif - ; -#endif /* CONFIG_SYS_LONGHELP */ + ); U_BOOT_CMD( ut, CONFIG_SYS_MAXARGS, 1, do_ut, diff --git a/test/fuzz/cmd_fuzz.c b/test/fuzz/cmd_fuzz.c index e2f44f3ecb61..d0bc7b8d7b76 100644 --- a/test/fuzz/cmd_fuzz.c +++ b/test/fuzz/cmd_fuzz.c @@ -70,11 +70,8 @@ static int do_fuzz(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[] return 1; } -#ifdef CONFIG_SYS_LONGHELP -static char fuzz_help_text[] = - "[fuzz-test-name] - execute the named fuzz test\n" - ; -#endif /* CONFIG_SYS_LONGHELP */ +U_BOOT_LONGHELP(fuzz, + "[fuzz-test-name] - execute the named fuzz test\n"); U_BOOT_CMD( fuzz, CONFIG_SYS_MAXARGS, 1, do_fuzz, From patchwork Sat Oct 7 23:12:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844813 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=lNZBftLr; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31ZQ08BDz1yqP for ; Sun, 8 Oct 2023 10:23:42 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BBD9986F44; Sun, 8 Oct 2023 01:14:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="lNZBftLr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C440686F17; Sun, 8 Oct 2023 01:13:38 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (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 218DE86ACA for ; Sun, 8 Oct 2023 01:13:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12b.google.com with SMTP id e9e14a558f8ab-3512b425662so14043935ab.0 for ; Sat, 07 Oct 2023 16:13:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720387; x=1697325187; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dBTo8W5MIZyktlVvjDLNXNHjKwmQ6Hk1104nqqxuqu0=; b=lNZBftLrQwNcDARS4iKhi1a+heonnqNsVB7GVj87xhWMKkLzLjZyvPx4hj7aKKnEoZ IeCqPW/OHMdv2wlwxgXRzy++xWqJCiHrT2AIR2AUUFRMMAjJPGU8cbU6QAebPbtUlJbu oWZKTc3Oh0H54lck8V+/ah8LSO5SVdY5ZoMgI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720387; x=1697325187; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dBTo8W5MIZyktlVvjDLNXNHjKwmQ6Hk1104nqqxuqu0=; b=sajNPxwNxzkZPpy3AB5cMeeUtiQYF16SDddYuKAYTYw3NclaV+R6rgaNJL2aNkniyM p4Qy+AYAYr158ce6oe8QaJ77auYgd06zGUBoiZ9SWhDdk2u3AJZiK/SoVtIWqu7W4t/B LYESHEBBoBeRrSEcbFHLBmVsiaC+GCUMRgySWwPt8ydxsiKF6fn2/YnpKN8ZWE0oy9AB 8O8Knlqt9FmtJXv9nlYtSiLJ9PTvNWQT2M5sKUkA44JJUDXv3Ew0X4ZrmwysI0Z7le1c Wxzgng/O0JqMolnFSH8CycU+A96jZzADnndccMVW43ZChqKztpMGSdLYhvOmDB3dRw8E K/kg== X-Gm-Message-State: AOJu0Yz0zoy9h9Q0SNfeXk6+T6b+8bn7S7SbWZ5RjdoXqNBRxtMTYQ9T 2Cw7IHwhnbzfne6yNUYaH6y0qgHbuNPwN0nmjLQ= X-Google-Smtp-Source: AGHT+IEKL76c0ZNaG8ra4M9+6JxdVpe526UcKH7S2ItJ72clQRnmFt44si9bapretKsExcQgvABQ1g== X-Received: by 2002:a05:6e02:1c84:b0:34c:bc7e:896c with SMTP id w4-20020a056e021c8400b0034cbc7e896cmr14646835ill.1.1696720386954; Sat, 07 Oct 2023 16:13:06 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:06 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v2 03/27] buildman: Use oldconfig when adjusting the config Date: Sat, 7 Oct 2023 17:12:22 -0600 Message-ID: <20231007231255.277623-4-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean We cannot be sure that the new config is consistent, particularly when changing a major item like CONFIG_CMDLINE. Use 'make oldconfig' to check that and avoid any such problems. Signed-off-by: Simon Glass --- (no changes since v1) tools/buildman/builder.py | 2 +- tools/buildman/builderthread.py | 6 ++++++ tools/buildman/func_test.py | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 5305477c5be6..782e59dd5cca 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -476,7 +476,7 @@ class Builder: Args: commit: Commit object that is being built brd: Board object that is being built - stage: Stage that we are at (mrproper, config, build) + stage: Stage that we are at (mrproper, config, oldconfig, build) cwd: Directory where make should be run args: Arguments to pass to make kwargs: Arguments to pass to command.run_pipe() diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index 6a61f64da1d4..a8599c0bb2a8 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -426,6 +426,12 @@ class BuilderThread(threading.Thread): # Now do the build, if everything looks OK if result.return_code == 0: + if adjust_cfg: + oldc_args = list(args) + ['oldconfig'] + oldc_result = self.make(commit, brd, 'oldconfig', cwd, + *oldc_args, env=env) + if oldc_result.return_code: + return oldc_result result = self._build(commit, brd, cwd, args, env, cmd_list, config_only) if adjust_cfg: diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py index 55dd494fe8ee..6b88ed815d65 100644 --- a/tools/buildman/func_test.py +++ b/tools/buildman/func_test.py @@ -439,6 +439,8 @@ class TestFunctional(unittest.TestCase): tools.write_file(fname, b'CONFIG_SOMETHING=1') return command.CommandResult(return_code=0, combined='Test configuration complete') + elif stage == 'oldconfig': + return command.CommandResult(return_code=0) elif stage == 'build': stderr = '' fname = os.path.join(cwd or '', out_dir, 'u-boot') @@ -461,7 +463,7 @@ Some images are invalid''' return command.CommandResult(return_code=0) # Not handled, so abort - print('make', stage) + print('_HandleMake failure: make', stage) sys.exit(1) # Example function to print output lines From patchwork Sat Oct 7 23:12:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844818 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=f0D8EhbG; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31c76Cvrz1yq7 for ; Sun, 8 Oct 2023 10:25:11 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4BEF286F3F; Sun, 8 Oct 2023 01:14:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="f0D8EhbG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9D8FF86ACA; Sun, 8 Oct 2023 01:13:47 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) (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 21B1086EBF for ; Sun, 8 Oct 2023 01:13:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x131.google.com with SMTP id e9e14a558f8ab-351232a46b3so13296285ab.1 for ; Sat, 07 Oct 2023 16:13:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720388; x=1697325188; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=s/K5pn6KI1EiJKra7ZBE1bm8pvo/60llLpyC4EMoStI=; b=f0D8EhbGp42qcxt1T3hmrDi6mhPVHzElIcN5BRpgHoTH9ZdWhzbeoRGzLWaRI15bEC azC4G4JOwJol87ph6Juhrkh9YLzvMHXlMgr3xzpKIt+Is77t0UdzAc7nkOgENO4h96C2 iTHkEEvzNdrN11GNuRGE2qgV+iBkp3DPOhEWg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720388; x=1697325188; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s/K5pn6KI1EiJKra7ZBE1bm8pvo/60llLpyC4EMoStI=; b=mdOfgOd9ieMpysoE7vsH1PCuCkQjN2EDIzxJ1u/tss4nlbGjN8ljOpc3X1Q4x23LHw m8ifx20wNgmudG4MJrEV1q8/AtkclOrdM6togw+6svW9vSRhk+9tSkRbLJT/iMVWT6LP sM0QE1YWJofC0+YOVPxaZBz+d3si7AIcOnOiGiYy0fH5gXqMJqF3KtxmrPiQQzHOzoU7 KLGdyT1QJkNjAKEoaLmwpm/bPIouRRQRdq+XRVTZeCo+e+DHshqnMm2uceqYBl1T1lbC JS3j2k5pqASwJeTL34Q+shZANXH87DfEgauI668CB2AA444zx8bNoiUIYghQjipOIJ8P vG+w== X-Gm-Message-State: AOJu0Yyu8N4BlZQ2ccqr0bgss1nPDv2hxEVXf34toISojz5P8E3iJots NBcGeLrlTUgY64RqNsvNd+EydXv5hmIrjsb6MFE= X-Google-Smtp-Source: AGHT+IGE036VVLY+hylKpBC8RXLFxzy8v3avA6QbpWT0HZ6J0Sen82o+pxhiJEAENV/IgLFE1i7qOg== X-Received: by 2002:a92:d7cd:0:b0:34d:ee65:a8ca with SMTP id g13-20020a92d7cd000000b0034dee65a8camr11383316ilq.24.1696720387814; Sat, 07 Oct 2023 16:13:07 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:07 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v2 04/27] bootstd: Correct dependencies on CMDLINE Date: Sat, 7 Oct 2023 17:12:23 -0600 Message-ID: <20231007231255.277623-5-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean With recent changes in boot/Kconfig it is no-longer possible to disable CMDLINE. It results in various link errors because some options which require CMDLINE are enabled regardless of whether it is available. Add the necessary conditions to fix this. Note that it would be better to have all commands depend on CMDLINE, but that is extremely difficult at present, since some functions use CMD_xxx to enable feature xxx. For example networking and environment have a number of problems to tease apart. Signed-off-by: Simon Glass --- (no changes since v1) boot/Kconfig | 19 ++++++++++++------- lib/efi_loader/Kconfig | 1 + 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/boot/Kconfig b/boot/Kconfig index a01e6cb8aafe..f74ac7e9cc72 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -342,6 +342,7 @@ endif # FIT config PXE_UTILS bool + depends on CMDLINE select MENU help Utilities for parsing PXE file formats. @@ -357,7 +358,7 @@ config BOOT_DEFAULTS select CMD_PART if PARTITIONS select CMD_DHCP if CMD_NET select CMD_PING if CMD_NET - select CMD_PXE if CMD_NET + select CMD_PXE if CMDLINE && CMD_NET select SUPPORT_RAW_INITRD select ENV_VARS_UBOOT_CONFIG select CMD_BOOTI if ARM64 @@ -461,6 +462,7 @@ config BOOTMETH_GLOBAL config BOOTMETH_CROS bool "Bootdev support for Chromium OS" + depends on CMDLINE depends on X86 || ARM || SANDBOX default y if !ARM select EFI_PARTITION @@ -475,6 +477,7 @@ config BOOTMETH_CROS config BOOTMETH_EXTLINUX bool "Bootdev support for extlinux boot" + depends on CMDLINE select PXE_UTILS default y help @@ -490,7 +493,7 @@ config BOOTMETH_EXTLINUX config BOOTMETH_EXTLINUX_PXE bool "Bootdev support for extlinux boot over network" - depends on CMD_PXE && CMD_NET && DM_ETH + depends on CMDLINE && CMD_PXE && CMD_NET && DM_ETH default y help Enables support for extlinux boot using bootdevs. This makes the @@ -504,7 +507,7 @@ config BOOTMETH_EXTLINUX_PXE config BOOTMETH_EFILOADER bool "Bootdev support for EFI boot" - depends on EFI_LOADER + depends on EFI_LOADER && CMDLINE default y help Enables support for EFI boot using bootdevs. This makes the @@ -536,10 +539,10 @@ config BOOTMETH_VBE config BOOTMETH_DISTRO bool # Options needed to boot any distro - select BOOTMETH_SCRIPT # E.g. Armbian uses scripts - select BOOTMETH_EXTLINUX # E.g. Debian uses these - select BOOTMETH_EXTLINUX_PXE if CMD_PXE && CMD_NET && DM_ETH - select BOOTMETH_EFILOADER if EFI_LOADER # E.g. Ubuntu uses this + select BOOTMETH_SCRIPT if CMDLINE # E.g. Armbian uses scripts + select BOOTMETH_EXTLINUX if CMDLINE # E.g. Debian uses these + select BOOTMETH_EXTLINUX_PXE if CMDLINE && CMD_PXE && CMD_NET && DM_ETH + select BOOTMETH_EFILOADER if CMDLINE && EFI_LOADER # E.g. Ubuntu uses this config SPL_BOOTMETH_VBE bool "Bootdev support for Verified Boot for Embedded (SPL)" @@ -663,6 +666,7 @@ config BOOTMETH_SANDBOX config BOOTMETH_SCRIPT bool "Bootdev support for U-Boot scripts" + depends on CMDLINE default y if BOOTSTD_FULL select HUSH_PARSER help @@ -777,6 +781,7 @@ endmenu # Boot images config DISTRO_DEFAULTS bool "(deprecated) Script-based booting of Linux distributions" + depends on CMDLINE select BOOT_DEFAULTS select AUTO_COMPLETE select CMDLINE_EDITING diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index d20aaab6dba4..621ed5e5b0fb 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -34,6 +34,7 @@ if EFI_LOADER config CMD_BOOTEFI_BOOTMGR bool "UEFI Boot Manager" + depends on CMDLINE default y select BOOTMETH_GLOBAL if BOOTSTD help From patchwork Sat Oct 7 23:12:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844816 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=EHJuJ9/Z; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31Zq3PPtz1yqP for ; Sun, 8 Oct 2023 10:24:03 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 663CC86EE6; Sun, 8 Oct 2023 01:14:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="EHJuJ9/Z"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E622186EFA; Sun, 8 Oct 2023 01:13:35 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) (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 21A6486E08 for ; Sun, 8 Oct 2023 01:13:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x133.google.com with SMTP id e9e14a558f8ab-35133097583so13986755ab.1 for ; Sat, 07 Oct 2023 16:13:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720388; x=1697325188; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8QlcfbZtbZxYHeF5PFWB9VyeGVxDvZaxkZrW7BG3QUo=; b=EHJuJ9/ZP39gVQrUrjWHFAcGxsV/nwFPdnFpRE7jlleFdmYOL6/LDaMfO0wVUvKZle hzV+ijT5/AsJHnLFkYiropMzlPfHEQszRcUUFpM6feQ287mosb0aPHoSZ4QFWhCy5K+D XKwdieiKKTxcX8Kk+mHUesKTDRS9rrYztvW0Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720388; x=1697325188; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8QlcfbZtbZxYHeF5PFWB9VyeGVxDvZaxkZrW7BG3QUo=; b=VHDkp+aQmuCRfNR/7l4bvMn6NpSg5d2W3+nG+zMqK/Ot07LpwkSwuXlFlJbcosVfRb XM3oXxBYXxfozZSjubSbpjrAlG5FXK+ITVns8CRisBaalxoqptDhDK2qKzCDlAzs/GY0 1oZb7HcfpGLJlMwFlgSXNTIt/g4AV/c71FFlTC+Y8W5+bbOT3FqpH0Iyynx1dz/IusXw JIRzRSJMB2XUOVefWpZ9HG13yNhNah+/BSR8Z8+AjmHjwZ6Aa5Pak2EazAXmrjYN/xp0 vNKc/XA8KSnRwv320Nj5Uf+ryGlhSQUNB8jviqLr7IUIZiYmehURFFa3YVmEkmQ5bQ3c JHZg== X-Gm-Message-State: AOJu0Yyafc0N415L91dcH6EInCzbrotRqUErlI5NG75VfQs+aMb2eGX/ uhWQhRx6czCaDdAll30uQeEQXcx4IG/aLIoQd3o= X-Google-Smtp-Source: AGHT+IF53EGebIhANc3181CttEL4RpE4Be4m4GDbt2WyMNLkTLMJsSGLKFLzGjRXoQ/qEGHdsvUkvA== X-Received: by 2002:a92:c24b:0:b0:34f:c7f7:18b with SMTP id k11-20020a92c24b000000b0034fc7f7018bmr14951963ilo.2.1696720388567; Sat, 07 Oct 2023 16:13:08 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:08 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v2 05/27] autoboot: Correct dependencies on CMDLINE Date: Sat, 7 Oct 2023 17:12:24 -0600 Message-ID: <20231007231255.277623-6-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean Make AUTOBOOT depend on CMDLINE since it is mostly meaningless without it. Signed-off-by: Simon Glass Reviewed-by: Tom Rini --- Changes in v2: - Move AUTOBOOT_USE_MENUKEY under AUTOBOOT boot/Kconfig | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/boot/Kconfig b/boot/Kconfig index f74ac7e9cc72..6461f7ebd040 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -1167,14 +1167,16 @@ menu "Autoboot options" config AUTOBOOT bool "Autoboot" + depends on CMDLINE default y help This enables the autoboot. See doc/README.autoboot for detail. +if AUTOBOOT + config BOOTDELAY int "delay in seconds before automatically booting" default 2 - depends on AUTOBOOT help Delay before automatically running bootcmd; set to 0 to autoboot with no delay, but you can stop it by key input. @@ -1196,9 +1198,11 @@ config AUTOBOOT_KEYED U-Boot automatic booting process and bring the device to the U-Boot prompt for user input. +if AUTOBOOT_KEYED + config AUTOBOOT_FLUSH_STDIN bool "Enable flushing stdin before starting to read the password" - depends on AUTOBOOT_KEYED && !SANDBOX + depends on !SANDBOX help When this option is enabled stdin buffer will be flushed before starting to read the password. @@ -1207,7 +1211,6 @@ config AUTOBOOT_FLUSH_STDIN config AUTOBOOT_PROMPT string "Autoboot stop prompt" - depends on AUTOBOOT_KEYED default "Autoboot in %d seconds\\n" help This string is displayed before the boot delay selected by @@ -1223,7 +1226,6 @@ config AUTOBOOT_PROMPT config AUTOBOOT_ENCRYPTION bool "Enable encryption in autoboot stopping" - depends on AUTOBOOT_KEYED help This option allows a string to be entered into U-Boot to stop the autoboot. @@ -1250,7 +1252,7 @@ config AUTOBOOT_SHA256_FALLBACK config AUTOBOOT_DELAY_STR string "Delay autobooting via specific input key / string" - depends on AUTOBOOT_KEYED && !AUTOBOOT_ENCRYPTION + depends on !AUTOBOOT_ENCRYPTION help This option delays the automatic boot feature by issuing a specific input key or string. If CONFIG_AUTOBOOT_DELAY_STR @@ -1262,7 +1264,7 @@ config AUTOBOOT_DELAY_STR config AUTOBOOT_STOP_STR string "Stop autobooting via specific input key / string" - depends on AUTOBOOT_KEYED && !AUTOBOOT_ENCRYPTION + depends on !AUTOBOOT_ENCRYPTION help This option enables stopping (aborting) of the automatic boot feature only by issuing a specific input key or @@ -1274,7 +1276,7 @@ config AUTOBOOT_STOP_STR config AUTOBOOT_KEYED_CTRLC bool "Enable Ctrl-C autoboot interruption" - depends on AUTOBOOT_KEYED && !AUTOBOOT_ENCRYPTION + depends on !AUTOBOOT_ENCRYPTION help This option allows for the boot sequence to be interrupted by ctrl-c, in addition to the "bootdelaykey" and "bootstopkey". @@ -1283,7 +1285,7 @@ config AUTOBOOT_KEYED_CTRLC config AUTOBOOT_NEVER_TIMEOUT bool "Make the password entry never time-out" - depends on AUTOBOOT_KEYED && AUTOBOOT_ENCRYPTION && CRYPT_PW + depends on AUTOBOOT_ENCRYPTION && CRYPT_PW help This option removes the timeout from the password entry when the user first presses the key before entering @@ -1291,7 +1293,7 @@ config AUTOBOOT_NEVER_TIMEOUT config AUTOBOOT_STOP_STR_ENABLE bool "Enable fixed string to stop autobooting" - depends on AUTOBOOT_KEYED && AUTOBOOT_ENCRYPTION + depends on AUTOBOOT_ENCRYPTION help This option enables the feature to add a fixed stop string that is defined at compile time. @@ -1322,9 +1324,12 @@ config AUTOBOOT_STOP_STR_SHA256 includes a ":", the portion prior to the ":" will be treated as a salt value. +endif # AUTOBOOT_KEYED + +if !AUTOBOOT_KEYED + config AUTOBOOT_USE_MENUKEY bool "Allow a specify key to run a menu from the environment" - depends on !AUTOBOOT_KEYED help If a specific key is pressed to stop autoboot, then the commands in the environment variable 'menucmd' are executed before boot starts. @@ -1339,6 +1344,10 @@ config AUTOBOOT_MENUKEY For example, 33 means "!" in ASCII, so pressing ! at boot would take this action. +endif + +endif # AUTOBOOT + config AUTOBOOT_MENU_SHOW bool "Show a menu on boot" depends on CMD_BOOTMENU From patchwork Sat Oct 7 23:12:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844811 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=g6HXy2Ov; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31Z03RZkz1yql for ; Sun, 8 Oct 2023 10:23:20 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0BB7486F55; Sun, 8 Oct 2023 01:14:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="g6HXy2Ov"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 27D2D86F1A; Sun, 8 Oct 2023 01:13:46 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) (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 34ECA86EC6 for ; Sun, 8 Oct 2023 01:13:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12f.google.com with SMTP id e9e14a558f8ab-3515deaa7c1so14216925ab.2 for ; Sat, 07 Oct 2023 16:13:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720389; x=1697325189; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+zaT9mMwoRJjMivhawpct2oEMU8J9bXbSHghNIup9PU=; b=g6HXy2Ov/jELAwiYRzitjDaJY2AmUXvuRk1Eapr6Nsiavfai1l86gN22MuWwG1NKez j4zK84lB5NlL4qNehgD3u9/ofQ4+jyaUCd5+t/XQdsvmfm2Xdoww0uC2DwviZ7hgyWqV /mpqP3kiQ0gi3EfWhV83Wc9PQMfC9XUHZYEJE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720389; x=1697325189; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+zaT9mMwoRJjMivhawpct2oEMU8J9bXbSHghNIup9PU=; b=INWq98T/4iTDVqIwe+Vi1oXYUGyGkS1MUZFxx5WyAc/R+LVCpUqtbxQzIBWc1KE8xN WN8GLsleRS4LJpTvB5M7xH3YnB5gBTO1tyyuo5a3rAIeLThaUlKJ58g/XV0Fcf+PK2TA Thk3Vk7QoHrNy0Aac1VLi6eXIL7fuEB0+lpQit3BaaCHtMNkBgEiIodRJrXmNsnhCaGJ PHJV4eFtC+Uis2rKIlDJ5ceS2gPUgbQDnJ9zLaGvXY3Flge+LnZfsQ/bvqtGkDqvEWnM xCQmdL16KP1paugPyqJIsgnuNT2V4UQtlmaBNHFvYO6byZQDhVUKUWxkracVtzHMoW0M Cxog== X-Gm-Message-State: AOJu0YyCLU3/hhFPZYmGPUwKxRcGI2RIDmj+AQyEPyoc7bBbTrmxPecP SwO1/AJrxtNGDeUanFkMSj1B82GpO/5zlnOP/G0= X-Google-Smtp-Source: AGHT+IECf5XdY2iLXpLK1GIZU2G6RY0n2aWS+Le/yfa4tDJIAd+u0tRGVgNQmEW+COtNxinZAwcpWQ== X-Received: by 2002:a05:6e02:1527:b0:348:8b42:47d with SMTP id i7-20020a056e02152700b003488b42047dmr14788327ilu.28.1696720389352; Sat, 07 Oct 2023 16:13:09 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:09 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v2 06/27] cmd: Add a few more dependencies on CMDLINE Date: Sat, 7 Oct 2023 17:12:25 -0600 Message-ID: <20231007231255.277623-7-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean Add this to some more commands to avoid build errors with sandbox. Signed-off-by: Simon Glass --- (no changes since v1) cmd/Kconfig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/Kconfig b/cmd/Kconfig index 6470b138d2f8..f914da6fe1ac 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -224,6 +224,7 @@ menu "Boot commands" config CMD_BOOTD bool "bootd" + depends on CMDLINE default y help Run the command stored in the environment "bootcmd", i.e. @@ -413,6 +414,7 @@ source lib/efi_selftest/Kconfig config CMD_BOOTMENU bool "bootmenu" + depends on CMDLINE select MENU select CHARSET help @@ -479,6 +481,7 @@ config CMD_GO config CMD_RUN bool "run" + depends on CMDLINE default y help Run the command in the given environment variable. @@ -569,6 +572,7 @@ menu "Environment commands" config CMD_ASKENV bool "ask for env variable" + depends on CMDLINE help Ask for environment variable @@ -2125,6 +2129,7 @@ config CMD_EFICONFIG config CMD_EXCEPTION bool "exception - raise exception" + depends on CMDLINE depends on ARM || RISCV || SANDBOX || X86 help Enable the 'exception' command which allows to raise an exception. @@ -2231,6 +2236,7 @@ config CMD_SYSBOOT config CMD_QFW bool "qfw" + depends on CMDLINE select QFW help This provides access to the QEMU firmware interface. The main From patchwork Sat Oct 7 23:12:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844814 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ibBi7uzo; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31ZW1vgtz1yqP for ; Sun, 8 Oct 2023 10:23:47 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6349186F5D; Sun, 8 Oct 2023 01:14:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="ibBi7uzo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 98AC286EDF; Sun, 8 Oct 2023 01:13:54 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) (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 995D786EE8 for ; Sun, 8 Oct 2023 01:13:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x135.google.com with SMTP id e9e14a558f8ab-3514cddf90bso13351525ab.1 for ; Sat, 07 Oct 2023 16:13:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720390; x=1697325190; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8v87TWASGNP2wMarCMkVkcxW+dmqGfpJkUrgfaIaeDY=; b=ibBi7uzogloKccnMQtxi9gxSaFv6W0beOYuHmq1el/C3okVOw8A0JI0KMWjGhGn0mY 5KcpNdo13CKHnYAkpMdXlwkUHlxPrCeY34DvWgKv0crFh7Zc5jovNMutnWOwSW/hZuEw +gGLFrx8eWcQt2aIGiDfylaGXZQWUf2CQIy1k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720390; x=1697325190; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8v87TWASGNP2wMarCMkVkcxW+dmqGfpJkUrgfaIaeDY=; b=qMdmFmdfcQMQeH2kEbYd6bzRNlEcUQssoEIF0o2OwrPS85KG08GOq949PhU3QFCkJS SWfVQpwuLZLpdRM7rz00xcROs5vHa0F8zbxBd+kBPr8LZyeNhdSik0BuENPIh5nMIG2W VuNrfFe0yesESAacyFDJx75/lqWZJtBJTz1YPg6c76X3SHcLgUjMnV6YGQR/wIwh+k6f l+1/91jNBiIBPq8/9ieYNkuVyrXrhmn7zuiwKjKg3/LyJeMQx3ICfKPfYGoHtT5ygY1n gIMJTNDGdtKRKsXeuX4GK3TYg+f3M/TOQMHgorTq/46pC1ZCpxgQBJdZ1Oei1dVT5ZzK Akfg== X-Gm-Message-State: AOJu0Yz5Qi75p7GcOqRTRYFmqbN2IkpF8qMHlnowbuR+abvlowfpK9Su 9vE5g5WzUxMI2Rbv9gunLcsXPkWRbwrR4mPhLV4= X-Google-Smtp-Source: AGHT+IGPI/LekKCc/0vJ5TKkFUCH6FGhnqOjCRLaedidRSI+6ySl+Nyn+cLQXBqKZ7kVHzrCnljuGQ== X-Received: by 2002:a05:6e02:152e:b0:351:4b68:ec3a with SMTP id i14-20020a056e02152e00b003514b68ec3amr14700507ilu.9.1696720390012; Sat, 07 Oct 2023 16:13:10 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:09 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v2 07/27] test: Make UNIT_TEST depend on CMDLINE Date: Sat, 7 Oct 2023 17:12:26 -0600 Message-ID: <20231007231255.277623-8-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean Many tests make some use of the command line, so require it for all test code. This could be teased apart, perhaps with a test flag indicating that ut uses the command line. Leave that for later. Signed-off-by: Simon Glass Reviewed-by: Tom Rini --- (no changes since v1) test/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Kconfig b/test/Kconfig index 830245b6f9a9..2b4036704f91 100644 --- a/test/Kconfig +++ b/test/Kconfig @@ -2,6 +2,7 @@ menu "Testing" config UNIT_TEST bool "Unit tests" + depends on CMDLINE help Select this to compile in unit tests for various parts of U-Boot. Test suites will be subcommands of the "ut" command. From patchwork Sat Oct 7 23:12:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844826 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=gxI/Lkwe; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31fD4p74z1yq7 for ; Sun, 8 Oct 2023 10:27:00 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9B9E286F48; Sun, 8 Oct 2023 01:16:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="gxI/Lkwe"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 50F7C86E9F; Sun, 8 Oct 2023 01:14:00 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) (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 3464386EE5 for ; Sun, 8 Oct 2023 01:13:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2e.google.com with SMTP id ca18e2360f4ac-7a26fd82847so141434239f.3 for ; Sat, 07 Oct 2023 16:13:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720390; x=1697325190; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dkzDQ/S/CT3zcUpv9qb05eSd0JS/JFyueV4dU8Nfim0=; b=gxI/Lkwe/L+WbpB9520yaXIc7Xzm5pNu4/NMA4ijBLifwXfmd8I3xDBLnPIpkavwjE gEOZUkF3XETCbQpzZR93e2Wi1YFZZCZeccYqrSCS5HwveOKkSub9RqOBkzx8SYyuqZbL kD9EFYXjMn3BmW4BorAA5QHT4qpyVcP9vh6Gg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720390; x=1697325190; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dkzDQ/S/CT3zcUpv9qb05eSd0JS/JFyueV4dU8Nfim0=; b=aA0P+0Fyx8uFTcjvanOKd21eWMikjlUbQVqhr1saaJO22RdEB+C2Mak7DqaCwlDNGw vlbxdScwT2Pe85y7Mmv9egO2rkeas5v4sh0v69zWdrZWPV1q7Zm4oHx7reeU/CyGJceI S7s7pTrOM1VcbMsfEvdAbV5k0Cco+eHv1W0TL8s7LGNemF1novCj6S0MEwjnRyWfnxnl t1CYVA9g8hZ28JganMgZDYT+hiaRvgk2ECNEdO2LkwO39QVEvOm+/7RR1eHTScSbFKYT rsoqH0zSbm0BvZCJmm7+xLJfsTqJ0vqzlvhlrqCX2VQJ7rAk2/9J3r+lT46jdh3rZsfm EAaQ== X-Gm-Message-State: AOJu0YxFYn5EQuCNRQjatiDSYL5/fdCUImemZM3Xf09Wl+vvAKcSY/MI tOMPPhhMvguBBtVCOu6Pruc4F4aity0ANrqGYO8= X-Google-Smtp-Source: AGHT+IEhq9rWgNwhdb9nTe28rlgK/fKug1dgEErR0/yRrIX+STa6UPJOPlUsXffkrbXbi7yMDWEFpg== X-Received: by 2002:a05:6e02:20ee:b0:349:2d48:66ac with SMTP id q14-20020a056e0220ee00b003492d4866acmr15667429ilv.12.1696720390757; Sat, 07 Oct 2023 16:13:10 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:10 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v2 08/27] sifive: Change #ifdef for nop Date: Sat, 7 Oct 2023 17:12:27 -0600 Message-ID: <20231007231255.277623-9-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean This code is normally compiled for sifive, but sandbox can also compile it. We should not use UNIT_TEST as a synonym for SANDBOX, since it is possible to disable UNIT_TEST for sandbox. Correct the condition. Signed-off-by: Simon Glass --- (no changes since v1) include/k210/pll.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/k210/pll.h b/include/k210/pll.h index fd16a89cb203..6dd60b2eb4fc 100644 --- a/include/k210/pll.h +++ b/include/k210/pll.h @@ -13,7 +13,7 @@ struct k210_pll_config { u8 od; }; -#ifdef CONFIG_UNIT_TEST +#ifdef CONFIG_SANDBOX TEST_STATIC int k210_pll_calc_config(u32 rate, u32 rate_in, struct k210_pll_config *best); #ifndef nop From patchwork Sat Oct 7 23:12:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844821 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=mvg0fbmw; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31d537D5z1yq7 for ; Sun, 8 Oct 2023 10:26:01 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B7DDE86F34; Sun, 8 Oct 2023 01:16:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="mvg0fbmw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 890EB86EFA; Sun, 8 Oct 2023 01:13:59 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) (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 CEF8F86EF1 for ; Sun, 8 Oct 2023 01:13:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12d.google.com with SMTP id e9e14a558f8ab-35135b79b6aso13494195ab.0 for ; Sat, 07 Oct 2023 16:13:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720391; x=1697325191; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JAdFTzAv9Q1wHJD86uM0/bfWj5SLUCU1+srVYUe51Nw=; b=mvg0fbmwwpvlVP3/PXBgErDo3sX6HN3eJEVPu7VyQZtn5RHoKO9Fy8dVKfo4dn9jKt eN2wtEKfw++T0+ZTZ4kIT+oTn4MpAhvys8K7oL74yowhWUBGc3l0o4NJ2rE5is597Er6 7Oy2pvhP8P/gbQkWtWnuTE0/OyN2nb/MTF9dE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720391; x=1697325191; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JAdFTzAv9Q1wHJD86uM0/bfWj5SLUCU1+srVYUe51Nw=; b=rabd4n1dIQEVMgeTv5g/tTVPpwlte7JLfnP0v9AUJgQPqlIabmd9Es/4XY2DERGVpL SXufhPiGkLPwL6SbR4v4UfL6Q1BfwL09JMNBMn2hLmnVc4vAHod5rpetUywaz3yM71vC xqIM0IgFE4mMr9tmMGGV1xsBxyLiixl0YQa0OIfGT7n331m7mIleHezljyMntECUS3M4 zDokTeFZV0JOOlWv5/pWwARLaGsd8J9iCgO2+mToPOrL1Wsv+W9JUIh2uDI4k395IHh1 Vl9uH9SYHsz44dSg+AV6cdz6NuApflpH+r5kW0nvk5i6FHy8UmhNqpqJfmciBpc1PUne T5+A== X-Gm-Message-State: AOJu0YwEjrf0XP9rIlsCQLoqAyS/8XoihE/bRu8/C5nczl/HyCl4WUiB v93zCYSjYw+cPfAjvWp2qOvFDT7mByDrePgp9j8= X-Google-Smtp-Source: AGHT+IFSvPlNpeuchf7AAEzDwDV2dOs0hNidpfjoMFkiAc9Ud7GgGcVQ8x9mXCzcTmCfSF5/EuZE+A== X-Received: by 2002:a92:c24a:0:b0:34f:6dbb:6a2a with SMTP id k10-20020a92c24a000000b0034f6dbb6a2amr14647852ilo.7.1696720391439; Sat, 07 Oct 2023 16:13:11 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:11 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v2 09/27] fastboot: Declare a dependency on CMDLINE Date: Sat, 7 Oct 2023 17:12:28 -0600 Message-ID: <20231007231255.277623-10-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean When CMDLINE is not enabled, this code fails to build. Correct this by adding a condition. Signed-off-by: Simon Glass --- Changes in v2: - Change this to use a Kconfig dependency instead of code failing drivers/fastboot/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/fastboot/Kconfig b/drivers/fastboot/Kconfig index 837c6f1180da..24b100f381fe 100644 --- a/drivers/fastboot/Kconfig +++ b/drivers/fastboot/Kconfig @@ -2,6 +2,7 @@ menu "Fastboot support" config FASTBOOT bool + depends on CMDLINE imply ANDROID_BOOT_IMAGE imply CMD_FASTBOOT help From patchwork Sat Oct 7 23:12:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844829 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=OByvGNB8; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31gC5gZsz1yq7 for ; Sun, 8 Oct 2023 10:27:51 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 656D686F5C; Sun, 8 Oct 2023 01:16:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="OByvGNB8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0FDB786E22; Sun, 8 Oct 2023 01:14:10 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) (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 1EBB286EF4 for ; Sun, 8 Oct 2023 01:13:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2c.google.com with SMTP id ca18e2360f4ac-79f82b26abfso123204339f.1 for ; Sat, 07 Oct 2023 16:13:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720392; x=1697325192; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9LGfti9giPvQ69i9t/jK2VoI5oFkbu/Xz9EslvhPFOM=; b=OByvGNB8g+iZt+gaYbf64e/haowk7iSpBhd4dd444UUhii6SXgXNJhLm7pTHdK4n+m d7TkmMqr7UuzWXDvCOPWRMJY07EO2VCka1ar0u/A1cxGBryUDkRxHVIwNtfipOO4pyEg zzYYbymx6xjz64UmuTp5y5nga1xV31rf5LBQs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720392; x=1697325192; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9LGfti9giPvQ69i9t/jK2VoI5oFkbu/Xz9EslvhPFOM=; b=YSq+AWFO7wbRXvT4PiXGvPFjYI0rfMbRiduEcLKFGUE6pI2iqleRo47VlXfMCcsLre owlrfIPjmp83Kk2tu+Yq47V/+IO/x0182Kw464dpMcW1TPQpXzKQWAUZxwohsTOP7t4/ A7lYgGK1zwKj4x5ZUpxB4ZSLvwDqloFqpO42YBBUFvtI7g97Ju9UEe24rFJIjvrcjfTm vTvIfyq2AqynOg1EykRAD8VrUGjINSwjDZfE8vk+ULqdCr3nCOytXz5//cYVyLyL+Bzf CJX82DK3H1A72bKA6o+V5RiyzAMpkCri748bMShZWBrnjos1u3FqNQwaYJPQ3DhfIs/B 6Fqg== X-Gm-Message-State: AOJu0YyXldr4kmvG7q8c9eKdapLl+MCi8OchJGYqasaFhsP3DBV2cd7m +Wg2msl4/x8tKCmEOMU0pRt9pGz5pHW+IsG+fso= X-Google-Smtp-Source: AGHT+IHXknOnMFJmEeaQx2xT1pDqdT8J3eYLvXAtPE79O2g9CkLmEiCTaDMll1+3L/6IgvAw/C0W3Q== X-Received: by 2002:a05:6e02:930:b0:351:2288:e132 with SMTP id o16-20020a056e02093000b003512288e132mr11128448ilt.21.1696720392152; Sat, 07 Oct 2023 16:13:12 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:11 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v2 10/27] cli: Always build cli_getch Date: Sat, 7 Oct 2023 17:12:29 -0600 Message-ID: <20231007231255.277623-11-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean This module is used for user input with menus, not just with the command line. Compile it always, so it is available even when CMDLINE is disabled. Signed-off-by: Simon Glass --- (no changes since v1) common/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/Makefile b/common/Makefile index cdeadf72026c..b21916f15340 100644 --- a/common/Makefile +++ b/common/Makefile @@ -8,6 +8,7 @@ ifndef CONFIG_SPL_BUILD obj-y += init/ obj-y += main.o obj-y += exports.o +obj-y += cli_getch.o obj-$(CONFIG_HUSH_PARSER) += cli_hush.o obj-$(CONFIG_AUTOBOOT) += autoboot.o @@ -37,7 +38,7 @@ obj-$(CONFIG_SPLASH_SOURCE) += splash_source.o obj-$(CONFIG_MENU) += menu.o obj-$(CONFIG_UPDATE_COMMON) += update.o obj-$(CONFIG_USB_KEYBOARD) += usb_kbd.o -obj-$(CONFIG_CMDLINE) += cli_getch.o cli_readline.o cli_simple.o +obj-$(CONFIG_CMDLINE) += cli_readline.o cli_simple.o endif # !CONFIG_SPL_BUILD From patchwork Sat Oct 7 23:12:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844825 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=BQ92U7lO; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31f75W2sz1yq7 for ; Sun, 8 Oct 2023 10:26:55 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D32B086F72; Sun, 8 Oct 2023 01:16:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="BQ92U7lO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9018986F04; Sun, 8 Oct 2023 01:14:46 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (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 A085C86EFC for ; Sun, 8 Oct 2023 01:13:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd33.google.com with SMTP id ca18e2360f4ac-7a2bfd584f0so151499839f.0 for ; Sat, 07 Oct 2023 16:13:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720393; x=1697325193; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LJV+FYEHkmbf62O1TZ5OiIeWFGG0TVWeChGBLylg4r0=; b=BQ92U7lOf8McwqkYJ0+41hpTbNLMqC5++w7hxGsV684uNP3lnoDRMcqlwW4bgEYi/g WLNKrq1XeyokutHGqpjEhrd8fQD3yA/wYzVC3t1j8XULOasMxlEJI6ERddv0K2l/jbKD C/ThtTGL1Rp3YoJ8QQBXHkz3Ju6aNhCqL5WMg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720393; x=1697325193; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LJV+FYEHkmbf62O1TZ5OiIeWFGG0TVWeChGBLylg4r0=; b=ZlXLt4BPnQfrZDGLrCExI8ZycUB+v66UfiAB36Z06ZIvMwNe0VPX6MO+5yZNrIpF7C KqJGKxbvoHh3bqSwAruuhVG/wqPrknb5z2ZwhIj/m3Rqm/Bh4FRSc1wSEmdz3Cb3qEnt HkqsNjtXO53AsyhUoKbreO5RXdDXc8p2kEcKocjr6mtXdXTb63ZnGOJTLBDULs3rscvJ 12kUIspQdsSUJh7iEEyEbPByJOQ3itW10dZDbL0PU382Xpuch9uzmIi1foqEEXvONLlr /GFSrGDCDRST+TS1F70zDmn+ifVB1X3Mzhj3qrHR/gDr55axQjttiMpKI+ZmqSbX4HNb oTkg== X-Gm-Message-State: AOJu0Ywo75vp+43n/6SUxuD4HPlSFnppnRau4Vhl3rUQm/NddYPO9/nO 4w9TrCOmWm1AFRCCcU6ce6fMJDHWX5vwImHZjo0= X-Google-Smtp-Source: AGHT+IHrX3PqMsqtKpm1X9FT8Xt+RQV0Ht/UzHK4O/idT3LGi0SZewIjP9BZKgNUK5aCy7+cSj86PA== X-Received: by 2002:a05:6e02:1561:b0:351:5cdb:225c with SMTP id k1-20020a056e02156100b003515cdb225cmr15332143ilu.17.1696720392856; Sat, 07 Oct 2023 16:13:12 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:12 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v2 11/27] cmd: Use an #ifdef around run_commandf() Date: Sat, 7 Oct 2023 17:12:30 -0600 Message-ID: <20231007231255.277623-12-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean This is not available if CMDLINE is disabled, so add an #ifdef to correct this. Signed-off-by: Simon Glass --- (no changes since v1) common/cli.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/cli.c b/common/cli.c index 3916a7b10a7d..4d0fea4387f2 100644 --- a/common/cli.c +++ b/common/cli.c @@ -129,6 +129,7 @@ int run_command_list(const char *cmd, int len, int flag) return rcode; } +#ifdef CONFIG_CMDLINE int run_commandf(const char *fmt, ...) { va_list args; @@ -153,6 +154,7 @@ int run_commandf(const char *fmt, ...) } return run_command(console_buffer, 0); } +#endif /* CMDLINE */ /****************************************************************************/ From patchwork Sat Oct 7 23:12:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844822 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Rhp6a1XG; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31dK26Jyz1yq7 for ; Sun, 8 Oct 2023 10:26:13 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 52A3D86F23; Sun, 8 Oct 2023 01:16:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="Rhp6a1XG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 13D3786F07; Sun, 8 Oct 2023 01:14:29 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (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 CF5F786EE6 for ; Sun, 8 Oct 2023 01:13:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd29.google.com with SMTP id ca18e2360f4ac-79fa7e33573so140247539f.0 for ; Sat, 07 Oct 2023 16:13:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720393; x=1697325193; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ol7IlMM6QfxaFgBkWoDX7zMirKd6YdBPxM8e+t7twfM=; b=Rhp6a1XGFIy27yqWrhLVs8F32Q/CShGtACdo66zq7BTWOOQN4DS8HphGSsGNt5l8ua KrjJRBRT11hhpq/ClPGEI5RErE6nArp9fTt8WtNBY/HW0MCxniqBZwdmZxr9yx5YfTN/ +ENUyQFq7sTIETkpN4E0VBdhnYvct3wXe5s28= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720393; x=1697325193; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ol7IlMM6QfxaFgBkWoDX7zMirKd6YdBPxM8e+t7twfM=; b=ovAqCh3a3neN5YxgyGJ5oqEg87UdmQgchsLEgF3ITnfuIEiOoaMKogPMeYy1YaS6jk EZK03DIvWEhJIWZ5JA4Ys6dlriYGcXHY9XMBB0d0boUICj9uBKudopgup7sejBveIYCu jZm3+bS0tXgV/2jA/OXrcy72JZOZajPHaVANb/JKkp7xjVd0hvSkxyreeUhUuIoR9h+f b/pu/7Xx1SHjwf8rv1My9onuwlFnDEDxwjTUFLrMZ1mQGpxLY37QZIL8cLwT+pY7e2Zl edS70o2lE/IIk3+fJjXAbbeUORXbCJjDhfZLD9ElCuEm5h57hMHlOu9rntZh8M+/X+zT fDyQ== X-Gm-Message-State: AOJu0Yy/6v3s29wmLFH1niebh/6w1x/L6QXJ7ZmQSoS66rPCsgG0MY4k g2IYomtPRy1SKGlg/7LYLM4DSnvTg+EOW0Sbmhg= X-Google-Smtp-Source: AGHT+IEiPmSmsoPsSImrY6GxMbkccOwfFstdax3py8xQ+/tolhabL3UThYy6HoxeFJ2nkohJT1gG8A== X-Received: by 2002:a92:c90d:0:b0:353:a2d8:463a with SMTP id t13-20020a92c90d000000b00353a2d8463amr6666363ilp.16.1696720393589; Sat, 07 Oct 2023 16:13:13 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:13 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v2 12/27] Move bootmenu_conv_key() into its own file Date: Sat, 7 Oct 2023 17:12:31 -0600 Message-ID: <20231007231255.277623-13-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean This conversion function is used by expo which does not require CMDLINE. The menu feature does require CMDLINE. Move the function into a separate file so that it can be used even when CMDLINE is not enabled. Signed-off-by: Simon Glass --- (no changes since v1) common/Makefile | 2 +- common/cli_getch.c | 1 + common/menu.c | 40 ------------------------------------- common/menu_key.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+), 41 deletions(-) create mode 100644 common/menu_key.c diff --git a/common/Makefile b/common/Makefile index b21916f15340..637066ae6682 100644 --- a/common/Makefile +++ b/common/Makefile @@ -8,7 +8,7 @@ ifndef CONFIG_SPL_BUILD obj-y += init/ obj-y += main.o obj-y += exports.o -obj-y += cli_getch.o +obj-y += cli_getch.o menu_key.o obj-$(CONFIG_HUSH_PARSER) += cli_hush.o obj-$(CONFIG_AUTOBOOT) += autoboot.o diff --git a/common/cli_getch.c b/common/cli_getch.c index 61d4cb261b81..c3332dc27fae 100644 --- a/common/cli_getch.c +++ b/common/cli_getch.c @@ -8,6 +8,7 @@ #include #include +#include /** * enum cli_esc_state_t - indicates what to do with an escape character diff --git a/common/menu.c b/common/menu.c index b55cf7b99967..844d0ec52af3 100644 --- a/common/menu.c +++ b/common/menu.c @@ -483,46 +483,6 @@ enum bootmenu_key bootmenu_autoboot_loop(struct bootmenu_data *menu, return key; } -enum bootmenu_key bootmenu_conv_key(int ichar) -{ - enum bootmenu_key key; - - switch (ichar) { - case '\n': - /* enter key was pressed */ - key = BKEY_SELECT; - break; - case CTL_CH('c'): - case '\e': - /* ^C was pressed */ - key = BKEY_QUIT; - break; - case CTL_CH('p'): - key = BKEY_UP; - break; - case CTL_CH('n'): - key = BKEY_DOWN; - break; - case CTL_CH('s'): - key = BKEY_SAVE; - break; - case '+': - key = BKEY_PLUS; - break; - case '-': - key = BKEY_MINUS; - break; - case ' ': - key = BKEY_SPACE; - break; - default: - key = BKEY_NONE; - break; - } - - return key; -} - enum bootmenu_key bootmenu_loop(struct bootmenu_data *menu, struct cli_ch_state *cch) { diff --git a/common/menu_key.c b/common/menu_key.c new file mode 100644 index 000000000000..4e9c3b426b0c --- /dev/null +++ b/common/menu_key.c @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2010-2011 Calxeda, Inc. + * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. + */ + +#include +#include +#include + +enum bootmenu_key bootmenu_conv_key(int ichar) +{ + enum bootmenu_key key; + + switch (ichar) { + case '\n': + /* enter key was pressed */ + key = BKEY_SELECT; + break; + case CTL_CH('c'): + case '\e': + /* ^C was pressed */ + key = BKEY_QUIT; + break; + case CTL_CH('p'): + key = BKEY_UP; + break; + case CTL_CH('n'): + key = BKEY_DOWN; + break; + case CTL_CH('s'): + key = BKEY_SAVE; + break; + case '+': + key = BKEY_PLUS; + break; + case '-': + key = BKEY_MINUS; + break; + case ' ': + key = BKEY_SPACE; + break; + default: + key = BKEY_NONE; + break; + } + + return key; +} From patchwork Sat Oct 7 23:12:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844820 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=d4SGb9Zx; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31d32ppCz1yq7 for ; Sun, 8 Oct 2023 10:25:59 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C018986F2C; Sun, 8 Oct 2023 01:16:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="d4SGb9Zx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3293486F46; Sun, 8 Oct 2023 01:14:40 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) (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 CF76F86F04 for ; Sun, 8 Oct 2023 01:13:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x133.google.com with SMTP id e9e14a558f8ab-3528bc102adso13851685ab.2 for ; Sat, 07 Oct 2023 16:13:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720394; x=1697325194; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=F8n8d/8TxKJJTR/dDT1+u7DZcg9UxMEXGWGY9/JmIAs=; b=d4SGb9ZxKB93a4t2mbeazhcD7+bNv6IySyGzp+vaQghUN6mgiqTu9VSZSZO8AYTmqw d/P/AFs/uK8rO1CXTXkQfC2ALlV7IyF+zzrOKzWiV9jK6MjQgVSXl+23cjM2VpLzO4pU R3otC9Qs78mjTgk4OLk5L/cc+M7wWWRyGtGrI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720394; x=1697325194; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=F8n8d/8TxKJJTR/dDT1+u7DZcg9UxMEXGWGY9/JmIAs=; b=hn8BVZYobtlaBpoISd/B1vAh+YqwQVdHy7TSlvPem3/paYHVovkUD4qviZdF3T6mYB vWvEq2jFaZhSizR5U3TRz2QXIm2y1a5JPxtL7c3MmTTz0sYG+DlNRCn7BQOMkCamsTKF qnplUf+aFaYVeb0f8K1OfJvtk/hINFXnrwFT1esvcTJ3VVNyWmV9gXWt8fVowEFROXYN MocoYQB+ku6QTcis0uW4geon3MetwlYUeVqWdaxEyeICd1DpcgTtsVRJte0x1u2eWAeY 6w/H0S3RckDUujzvqpyOjbUoM71aQBlmGYtRfImebT/YgCSDN65rCErcbAAVgFIy3j+i cbCg== X-Gm-Message-State: AOJu0YxdWRwAE3hb2MIK7KGye2YKVbIuhkspQE+CDoTdPq50cvJ1L9XE jChsMyYOrhzYoe6Ga1mc5Sl9N2ibpH/bO4ZvzJc= X-Google-Smtp-Source: AGHT+IFtRN22qv69nI2ml0edr7xni3Qv1IfxeshkW56bK6vvqjOxCT2HSRC1OhPkkQfjyYg4ysIOlQ== X-Received: by 2002:a05:6e02:1189:b0:352:a2f8:99a1 with SMTP id y9-20020a056e02118900b00352a2f899a1mr10449814ili.25.1696720394467; Sat, 07 Oct 2023 16:13:14 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:14 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v2 13/27] pxe: Depend on CMDLINE Date: Sat, 7 Oct 2023 17:12:32 -0600 Message-ID: <20231007231255.277623-14-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean We cannot use PXE or sysboot commands without CONFIG_CMDLINE so add the required condition. Signed-off-by: Simon Glass --- (no changes since v1) cmd/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/Kconfig b/cmd/Kconfig index f914da6fe1ac..f9e023730c53 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1995,6 +1995,7 @@ config CMD_ETHSW config CMD_PXE bool "pxe" + depends on CMDLINE select PXE_UTILS help Boot image via network using PXE protocol @@ -2230,6 +2231,7 @@ config CMD_SOUND config CMD_SYSBOOT bool "sysboot" + depends on CMDLINE select PXE_UTILS help Boot image via local extlinux.conf file From patchwork Sat Oct 7 23:12:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844819 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=AvHbGdZl; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31cZ10QGz1yq7 for ; Sun, 8 Oct 2023 10:25:34 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A3AA686EDB; Sun, 8 Oct 2023 01:16:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="AvHbGdZl"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 40CF286F38; Sun, 8 Oct 2023 01:14:31 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) (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 CF9B186F0B for ; Sun, 8 Oct 2023 01:13:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x129.google.com with SMTP id e9e14a558f8ab-3514cddf90bso13351665ab.1 for ; Sat, 07 Oct 2023 16:13:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720395; x=1697325195; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LPz5sJpsb4UIbpQg2HhIJbbbpP/a+RYo1A4Qm34kgS0=; b=AvHbGdZln9svDa0iHbq7PEG/2U+S47/n7w+Y9Ykby6cSYE1Ql6hWoCguiTPezTsbrP yHhbHJvIp/bZcTD0UZQ4pzzeCfbVr2dIWxOFxDhgFhPi4NoVDrvymYAEFEWmqCXG+9Jk EmBdNiU0zSsOuW9wV+mX8O+A8dNamLhxz/R/A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720395; x=1697325195; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LPz5sJpsb4UIbpQg2HhIJbbbpP/a+RYo1A4Qm34kgS0=; b=Y42zn+WbuFl/Kbs7M7LYdTP7JpaDwRH4J+EZi/stfV4nP6dqSDLHfA4pLrobBOgh/1 Q6mFXIiVtxeeLY3cNdELEhG903P7CnBZYPmH0ap/HJ7FY/qgQVDlvJ/C1HObASYsKOWc TdWFu0LukjYJgiB4vQkixiVxBB5YVBq+YogrYItBRA1Q6IQxIaoaBspkTvJcEckIC/Ty AGOzMx8IJxpbUqzlcXGv2Loi/nf/TVpikYM94U6TYYkLlS9+PXRpUZpb9gC0pDIdNRwa sFx79rT8orLG1AJt3jEIHqd+423RdFOhx0WarfujHjF38EWs3Vsl/nGhMEvuwDs6aZ0g dIsg== X-Gm-Message-State: AOJu0Yw+6/xWtnMAigEBOGD3qyLgW5pJsN994ZTtxprXsRJ8V7iRu6fP 2dR1Mav0HQX94Jnvo/sbBXZq2nivRGLCdSGsZIE= X-Google-Smtp-Source: AGHT+IHETkC2J+DmE36qKS+5PScU1VazJDT/JDrUfLyofNyEiYunCexOG0Jf9gEdg+3NU20tV612yg== X-Received: by 2002:a05:6e02:1c84:b0:349:36e1:10fb with SMTP id w4-20020a056e021c8400b0034936e110fbmr14541282ill.18.1696720395289; Sat, 07 Oct 2023 16:13:15 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:15 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Joe Hershberger Subject: [PATCH v2 14/27] env: Split out non-command code into a new file Date: Sat, 7 Oct 2023 17:12:33 -0600 Message-ID: <20231007231255.277623-15-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean It is not possible to set environment variables without having CONFIG_CMD_NVEDIT enabled. When CONFIG_CMDLINE is disabled, we need a way to set variables. Split the setting code out into its own file, so that env_set() is available even when CONFIG_CMDLINE is not. If it is never called, the code will be dropped at link time. Update the Makefile rule to only include the env commands when CONFIG_CMD_NVEDIT is enabled. Signed-off-by: Simon Glass --- (no changes since v1) cmd/Makefile | 2 +- cmd/nvedit.c | 122 ++----------------------------------- env/Makefile | 1 + env/env_set.c | 132 +++++++++++++++++++++++++++++++++++++++++ include/env_internal.h | 23 +++++++ 5 files changed, 161 insertions(+), 119 deletions(-) create mode 100644 env/env_set.c diff --git a/cmd/Makefile b/cmd/Makefile index 9bebf321c397..5be2b4bd3800 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -240,7 +240,7 @@ endif # !CONFIG_SPL_BUILD obj-$(CONFIG_$(SPL_)CMD_TLV_EEPROM) += tlv_eeprom.o # core command -obj-y += nvedit.o +obj-$(CONFIG_$(SPL_)CMDLINE) += nvedit.o obj-$(CONFIG_CMD_BCM_EXT_UTILS) += broadcom/ diff --git a/cmd/nvedit.c b/cmd/nvedit.c index daf1ad37f9be..812d82b157f4 100644 --- a/cmd/nvedit.c +++ b/cmd/nvedit.c @@ -49,20 +49,6 @@ DECLARE_GLOBAL_DATA_PTR; */ #define MAX_ENV_SIZE (1 << 20) /* 1 MiB */ -/* - * This variable is incremented on each do_env_set(), so it can - * be used via env_get_id() as an indication, if the environment - * has changed or not. So it is possible to reread an environment - * variable only if the environment was changed ... done so for - * example in NetInitLoop() - */ -static int env_id = 1; - -int env_get_id(void) -{ - return env_id; -} - #ifndef CONFIG_SPL_BUILD /* * Command interface: print one or all environment variables @@ -195,108 +181,8 @@ DONE: return 0; } -#endif -#endif /* CONFIG_SPL_BUILD */ - -/* - * Set a new environment variable, - * or replace or delete an existing one. - */ -static int _do_env_set(int flag, int argc, char *const argv[], int env_flag) -{ - int i, len; - char *name, *value, *s; - struct env_entry e, *ep; - - debug("Initial value for argc=%d\n", argc); - -#if !IS_ENABLED(CONFIG_SPL_BUILD) && IS_ENABLED(CONFIG_CMD_NVEDIT_EFI) - if (argc > 1 && argv[1][0] == '-' && argv[1][1] == 'e') - return do_env_set_efi(NULL, flag, --argc, ++argv); -#endif - - while (argc > 1 && **(argv + 1) == '-') { - char *arg = *++argv; - - --argc; - while (*++arg) { - switch (*arg) { - case 'f': /* force */ - env_flag |= H_FORCE; - break; - default: - return CMD_RET_USAGE; - } - } - } - debug("Final value for argc=%d\n", argc); - name = argv[1]; - - if (strchr(name, '=')) { - printf("## Error: illegal character '='" - "in variable name \"%s\"\n", name); - return 1; - } - - env_id++; - - /* Delete only ? */ - if (argc < 3 || argv[2] == NULL) { - int rc = hdelete_r(name, &env_htab, env_flag); - - /* If the variable didn't exist, don't report an error */ - return rc && rc != -ENOENT ? 1 : 0; - } - - /* - * Insert / replace new value - */ - for (i = 2, len = 0; i < argc; ++i) - len += strlen(argv[i]) + 1; - - value = malloc(len); - if (value == NULL) { - printf("## Can't malloc %d bytes\n", len); - return 1; - } - for (i = 2, s = value; i < argc; ++i) { - char *v = argv[i]; - - while ((*s++ = *v++) != '\0') - ; - *(s - 1) = ' '; - } - if (s != value) - *--s = '\0'; - - e.key = name; - e.data = value; - hsearch_r(e, ENV_ENTER, &ep, &env_htab, env_flag); - free(value); - if (!ep) { - printf("## Error inserting \"%s\" variable, errno=%d\n", - name, errno); - return 1; - } - - return 0; -} - -int env_set(const char *varname, const char *varvalue) -{ - const char * const argv[4] = { "setenv", varname, varvalue, NULL }; - - /* before import into hashtable */ - if (!(gd->flags & GD_FLG_ENV_READY)) - return 1; - - if (varvalue == NULL || varvalue[0] == '\0') - return _do_env_set(0, 2, (char * const *)argv, H_PROGRAMMATIC); - else - return _do_env_set(0, 3, (char * const *)argv, H_PROGRAMMATIC); -} +#endif /* CONFIG_CMD_GREPENV */ -#ifndef CONFIG_SPL_BUILD static int do_env_set(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { @@ -456,7 +342,7 @@ int do_env_callback(struct cmd_tbl *cmdtp, int flag, int argc, hwalk_r(&env_htab, print_active_callback); return 0; } -#endif +#endif /* CONFIG_CMD_ENV_CALLBACK */ #if defined(CONFIG_CMD_ENV_FLAGS) static int print_static_flags(const char *var_name, const char *flags, @@ -529,7 +415,7 @@ int do_env_flags(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) hwalk_r(&env_htab, print_active_flags); return 0; } -#endif +#endif /* CONFIG_CMD_ENV_FLAGS */ /* * Interactively edit an environment variable @@ -679,7 +565,7 @@ static int do_env_delete(struct cmd_tbl *cmdtp, int flag, } debug("Final value for argc=%d\n", argc); - env_id++; + env_inc_id(); while (--argc > 0) { char *name = *++argv; diff --git a/env/Makefile b/env/Makefile index 673b979fdfa9..5250b6df2cfc 100644 --- a/env/Makefile +++ b/env/Makefile @@ -5,6 +5,7 @@ obj-$(CONFIG_$(SPL_TPL_)ENV_SUPPORT) += common.o obj-$(CONFIG_$(SPL_TPL_)ENV_SUPPORT) += env.o +obj-$(CONFIG_$(SPL_TPL_)ENV_SUPPORT) += env_set.o obj-$(CONFIG_$(SPL_TPL_)ENV_SUPPORT) += attr.o obj-$(CONFIG_$(SPL_TPL_)ENV_SUPPORT) += flags.o diff --git a/env/env_set.c b/env/env_set.c new file mode 100644 index 000000000000..eccbda6a791c --- /dev/null +++ b/env/env_set.c @@ -0,0 +1,132 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * (C) Copyright 2000-2013 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + * + * (C) Copyright 2001 Sysgo Real-Time Solutions, GmbH + * Andreas Heppel + * + * Copyright 2011 Freescale Semiconductor, Inc. + */ + +#include +#include +#include +#include +#include +#include + +DECLARE_GLOBAL_DATA_PTR; + +/* + * This variable is incremented on each do_env_set(), so it can + * be used via env_get_id() as an indication, if the environment + * has changed or not. So it is possible to reread an environment + * variable only if the environment was changed ... done so for + * example in NetInitLoop() + */ +static int env_id = 1; + +int env_get_id(void) +{ + return env_id; +} + +void env_inc_id(void) +{ + env_id++; +} + +int _do_env_set(int flag, int argc, char *const argv[], int env_flag) +{ + int i, len; + char *name, *value, *s; + struct env_entry e, *ep; + + debug("Initial value for argc=%d\n", argc); + +#if !IS_ENABLED(CONFIG_SPL_BUILD) && IS_ENABLED(CONFIG_CMD_NVEDIT_EFI) + if (argc > 1 && argv[1][0] == '-' && argv[1][1] == 'e') + return do_env_set_efi(NULL, flag, --argc, ++argv); +#endif + + while (argc > 1 && **(argv + 1) == '-') { + char *arg = *++argv; + + --argc; + while (*++arg) { + switch (*arg) { + case 'f': /* force */ + env_flag |= H_FORCE; + break; + default: + return CMD_RET_USAGE; + } + } + } + debug("Final value for argc=%d\n", argc); + name = argv[1]; + + if (strchr(name, '=')) { + printf("## Error: illegal character '=' in variable name \"%s\"\n", + name); + return 1; + } + + env_id++; + + /* Delete only ? */ + if (argc < 3 || !argv[2]) { + int rc = hdelete_r(name, &env_htab, env_flag); + + /* If the variable didn't exist, don't report an error */ + return rc && rc != -ENOENT ? 1 : 0; + } + + /* + * Insert / replace new value + */ + for (i = 2, len = 0; i < argc; ++i) + len += strlen(argv[i]) + 1; + + value = malloc(len); + if (!value) { + printf("## Can't malloc %d bytes\n", len); + return 1; + } + for (i = 2, s = value; i < argc; ++i) { + char *v = argv[i]; + + while ((*s++ = *v++) != '\0') + ; + *(s - 1) = ' '; + } + if (s != value) + *--s = '\0'; + + e.key = name; + e.data = value; + hsearch_r(e, ENV_ENTER, &ep, &env_htab, env_flag); + free(value); + if (!ep) { + printf("## Error inserting \"%s\" variable, errno=%d\n", + name, errno); + return 1; + } + + return 0; +} + +int env_set(const char *varname, const char *varvalue) +{ + const char * const argv[4] = { "setenv", varname, varvalue, NULL }; + + /* before import into hashtable */ + if (!(gd->flags & GD_FLG_ENV_READY)) + return 1; + + if (!varvalue || !varvalue[0]) + return _do_env_set(0, 2, (char * const *)argv, H_PROGRAMMATIC); + else + return _do_env_set(0, 3, (char * const *)argv, H_PROGRAMMATIC); +} diff --git a/include/env_internal.h b/include/env_internal.h index 6a6949464689..99e358b6d8a5 100644 --- a/include/env_internal.h +++ b/include/env_internal.h @@ -260,6 +260,29 @@ const char *env_fat_get_intf(void); * Return: string of device and partition */ char *env_fat_get_dev_part(void); + +/* + * _do_env_set() - Add / replace / delete an environment variable + * + * This implements the bulk of the 'env set' command: + * + * env set [-f] name [value] + * + * Sets the value of variable + * If is NULL, it removes the variable + * Use the -f flag to overwrite read-only/write-once variables + * + * @flag: CMD_FLAG_... value + * @argc: Number of arguments + * @args: List of arguments + * @env_flag: H_... flags from search.h + * Return: 0 if OK, 1 on failure, or CMD_RET_USAGE for invalid flag + */ +int _do_env_set(int flag, int argc, char *const argv[], int env_flag); + +/** env_inc_id() - Increment the environment ID */ +void env_inc_id(void); + #endif /* DO_DEPS_ONLY */ #endif /* _ENV_INTERNAL_H_ */ From patchwork Sat Oct 7 23:12:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844823 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=R7PUq6Am; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31dd0Y5Zz1yq7 for ; Sun, 8 Oct 2023 10:26:29 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DD93786F66; Sun, 8 Oct 2023 01:16:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="R7PUq6Am"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0796D86EC6; Sun, 8 Oct 2023 01:14:19 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) (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 CF81186F05 for ; Sun, 8 Oct 2023 01:13:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12c.google.com with SMTP id e9e14a558f8ab-352a1a0348fso13402815ab.1 for ; Sat, 07 Oct 2023 16:13:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720396; x=1697325196; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fBp0HYn+zW7JB7fktd6W1FL9Bcd7GSWvX7ntYSU4Mzk=; b=R7PUq6AmO8O4zLWreQ4hJpuLddMMNDcSfp9SeqcYQIy0AkpJK6L1HcU/MiJf/HVmEs iRfCWqIKhTrFTCoMcNxMlOQUMbjINdRkavFSKlpDCgVb8ZWjIVtRMeEOhuTkC2lcijp7 Lff9kmj12zNzmUYKDdXZBKmfleOEc24cDaOh0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720396; x=1697325196; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fBp0HYn+zW7JB7fktd6W1FL9Bcd7GSWvX7ntYSU4Mzk=; b=ZKH12f1jN5L+IvGzE7QCeh2YDfXH6a7XVHAGjLRdHehe4MFuGqDA4Y9nuqvtmNjqC6 h0DO3TTGE99nOktI4LZcfML8Ctb+e7DODBixAZG6yP46uMcfXl5jMrDqcgI7s5nGvP7r lqOGeTQeZCPvDj/AU9QsHC83OAuade6HYXL/edM9XpAKV5p3voUCXhb/E5MdhXez+p5v A95KyAOIQwdXLpLBm7CrMsmbhdCTFYAt975pBWjCfxB4t+8EJJREpJmd5lGugN/Id7YN 6U/sbGX8p5CAfruvV3RUMEmqee/pDSopTBa58aaX9yJh/3LZdNPDjt7RYdPKjiGkuPai rMgQ== X-Gm-Message-State: AOJu0Yy6xDeXwbZrOvI1WgMtHukV5BU73077+O8RYbAn8wp8aUjYxtaH Sg3jWZBk89KZh9ykUqi7xsEiJ+NCkZHLl9UsJ+M= X-Google-Smtp-Source: AGHT+IGd2UPncUta7KQf8NzgD/JOap4QKZ0Wa261HFLaubMyoX62QVBXNKHgV7g7NUByvZFcQoxTcA== X-Received: by 2002:a05:6e02:1d11:b0:352:a306:9ad1 with SMTP id i17-20020a056e021d1100b00352a3069ad1mr15139158ila.0.1696720396239; Sat, 07 Oct 2023 16:13:16 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:15 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v2 15/27] console: Move SYS_PBSIZE into common/ Date: Sat, 7 Oct 2023 17:12:34 -0600 Message-ID: <20231007231255.277623-16-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean This relates to printing output and does not need a command line. Move it next to the other console-related options. Signed-off-by: Simon Glass --- (no changes since v1) cmd/Kconfig | 5 ----- common/Kconfig | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/Kconfig b/cmd/Kconfig index f9e023730c53..96ea40109abd 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -84,11 +84,6 @@ config SYS_CBSIZE default 256 if M68K || PPC default 1024 -config SYS_PBSIZE - int "Buffer size for console output" - default 1024 if ARCH_SUNXI - default 1044 - config SYS_XTRACE bool "Command execution tracer" depends on CMDLINE diff --git a/common/Kconfig b/common/Kconfig index 5e79b5422178..16601655caf7 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -52,6 +52,11 @@ config CONSOLE_RECORD_IN_SIZE The buffer is allocated immediately after the malloc() region is ready. +config SYS_PBSIZE + int "Buffer size for console output" + default 1024 if ARCH_SUNXI + default 1044 + config DISABLE_CONSOLE bool "Add functionality to disable console completely" help From patchwork Sat Oct 7 23:12:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844812 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=AgQLl7dO; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31ZC1Qm5z1yqP for ; Sun, 8 Oct 2023 10:23:31 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0298A86F4F; Sun, 8 Oct 2023 01:14:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="AgQLl7dO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D976F86DDA; Sun, 8 Oct 2023 01:13:55 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) (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 CF9FD86F0C for ; Sun, 8 Oct 2023 01:13:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2a.google.com with SMTP id ca18e2360f4ac-7a2cc9ee64cso133594639f.1 for ; Sat, 07 Oct 2023 16:13:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720397; x=1697325197; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BnIf55QgYF2oKjcC8nh/6+oYjz38GzbLKRsejGRdy6A=; b=AgQLl7dOOczElCu/j9rj9q6M61LzVe1XND1ld6hU6rwav1jpwYTbUahxg1id/b+ppB 2YNv2HG6NKdd62vCL3t8A5BBJ4f4TH+eovTSJ4+JNK1WUtM92ZRCMVbkRSpmAjI7bZGj w+9bWJXmJormlRjzrycFyQZ61aVc5YcytqdS0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720397; x=1697325197; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BnIf55QgYF2oKjcC8nh/6+oYjz38GzbLKRsejGRdy6A=; b=psf97e3l4dPWGf6JZXNG7OEMe0TudynYXRSa76I/b9iN1b/9PSDEMfFOFTPTUGodJm itz2VbO+bkRFmUQUQpFbMP37Jcwud/M/46xLWX0Revi+zLK7KH6Gj8gWD97dLcZqVxII oNwcAZ/FnSfznDusy9e259fOmLg4sYkSFoqoBwlwEm/SCGQvWScmap20EqQStxHGz+hg +jR5CbR+mSUWSSY/WYI5HaZFpLpxLyx92S+87Tiu4/TlORrGn/avGYVCIbQUtm4cgJMN PEQNEiM0nLTcIfAMIidg7vYbI44PREAMWPWCYj2sY9loSVgnBfSqvB+WV3qnTCpCevSy u4+A== X-Gm-Message-State: AOJu0YzF9DQ6tdPCacG6KcsvENxaym9T7wY8mpSPesJJKwFeJ4QTwBZ0 oYRiBpWlFzwnrx4wUy9jzsTCpgLWqVSiEee8hUA= X-Google-Smtp-Source: AGHT+IGGYJ+T5M3yQY/h2OVqpXfu1tVQ1ad1h/fMStFhsL/V2gNER3TyjXHc3MNRK7rUCg+UrdQwDg== X-Received: by 2002:a05:6e02:11aa:b0:351:59db:a20e with SMTP id 10-20020a056e0211aa00b0035159dba20emr10644774ilj.18.1696720397135; Sat, 07 Oct 2023 16:13:17 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:16 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v2 16/27] bootm: Allow building when cleanup functions are missing Date: Sat, 7 Oct 2023 17:12:35 -0600 Message-ID: <20231007231255.277623-17-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean There are two cleanup functions needed during boot which depend on CMD_BOOTM: bootm_disable_interrupts() and board_quiesce_devices() Provide static inline versions of these for when commands are not enabled. Signed-off-by: Simon Glass --- (no changes since v1) arch/arm/lib/bootm.c | 2 ++ boot/bootm.c | 10 ++++------ include/bootm.h | 15 +++++++++++++-- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index c56285738a26..db8df57cb56e 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -42,9 +42,11 @@ DECLARE_GLOBAL_DATA_PTR; static struct tag *params; +#ifdef CONFIG_CMD_BOOTM __weak void board_quiesce_devices(void) { } +#endif /** * announce_and_cleanup() - Print message and prepare for kernel boot diff --git a/boot/bootm.c b/boot/bootm.c index 8f96a80d4259..7deae058552a 100644 --- a/boot/bootm.c +++ b/boot/bootm.c @@ -47,9 +47,11 @@ static const void *boot_get_kernel(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[], struct bootm_headers *images, ulong *os_data, ulong *os_len); +#ifdef CONFIG_CMD_BOOTM __weak void board_quiesce_devices(void) { } +#endif #ifdef CONFIG_LMB static void boot_start_lmb(struct bootm_headers *images) @@ -470,12 +472,7 @@ static int bootm_load_os(struct bootm_headers *images, int boot_progress) return 0; } -/** - * bootm_disable_interrupts() - Disable interrupts in preparation for load/boot - * - * Return: interrupt flag (0 if interrupts were disabled, non-zero if they were - * enabled) - */ +#ifdef CONFIG_CMD_BOOTM ulong bootm_disable_interrupts(void) { ulong iflag; @@ -505,6 +502,7 @@ ulong bootm_disable_interrupts(void) #endif return iflag; } +#endif #define CONSOLE_ARG "console=" #define NULL_CONSOLE (CONSOLE_ARG "ttynull") diff --git a/include/bootm.h b/include/bootm.h index c3c7336207b1..17c740449efd 100644 --- a/include/bootm.h +++ b/include/bootm.h @@ -50,8 +50,6 @@ int bootm_host_load_images(const void *fit, int cfg_noffset); int boot_selected_os(int argc, char *const argv[], int state, struct bootm_headers *images, boot_os_fn *boot_fn); -ulong bootm_disable_interrupts(void); - /* This is a special function used by booti/bootz */ int bootm_find_images(int flag, int argc, char *const argv[], ulong start, ulong size); @@ -62,6 +60,15 @@ int do_bootm_states(struct cmd_tbl *cmdtp, int flag, int argc, void arch_preboot_os(void); +#ifdef CONFIG_CMD_BOOTM +/** + * bootm_disable_interrupts() - Disable interrupts, stop Ethernet and USB + * + * Return: interrupt flag (0 if interrupts were disabled, non-zero if they were + * enabled) + */ +ulong bootm_disable_interrupts(void); + /* * boards should define this to disable devices when EFI exits from boot * services. @@ -69,6 +76,10 @@ void arch_preboot_os(void); * TODO(sjg@chromium.org>): Update this to use driver model's device_remove(). */ void board_quiesce_devices(void); +#else +static inline ulong bootm_disable_interrupts(void) { return 0; } +static inline void board_quiesce_devices(void) {} +#endif /** * switch_to_non_secure_mode() - switch to non-secure mode From patchwork Sat Oct 7 23:12:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844815 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=SsTv1yh0; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31Zk5STNz1yqP for ; Sun, 8 Oct 2023 10:23:58 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 39E1C86F31; Sun, 8 Oct 2023 01:14:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="SsTv1yh0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BCE4B86E9F; Sun, 8 Oct 2023 01:13:56 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) (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 CF70886F02 for ; Sun, 8 Oct 2023 01:13:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x132.google.com with SMTP id e9e14a558f8ab-3512740906dso13429235ab.0 for ; Sat, 07 Oct 2023 16:13:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720398; x=1697325198; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=U5WPBePYB2Htc96QQockFuBo89KBptoCzmLFnIsGNN0=; b=SsTv1yh0fnOptLKwL3bpDQjQGXHIfIdtk+a/OOZnEOqdVu8bHOYc/UZFeNiSrTBoXo wHANcIS1QMoMpevOMZBKOfdeF+XHjCXCDZsWO3IRWtagDFC7Ja3xnzBb/7L87aC7THHv UejQEMwdsBH61/x52eq9erhi7uLUMXhmO7mng= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720398; x=1697325198; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U5WPBePYB2Htc96QQockFuBo89KBptoCzmLFnIsGNN0=; b=MLcbmZGbvjUJF21JnEGaQ0kRfHrLdSswbwau5gwFmYn/qgSZOMN9Ug11VgJeuhH2TX XSZY7Q9L+ArmLHnzrraTWt3vXxzY/7qHGBrOk5uF+/SSplhM2OV4Q2C77fS8eZ+mTbKX F5By37yyRkNcK0v7BHqHyrg4i0DQewzml1UMf0NwGt2HpcmJ5J34K8lfT5Bk6fF+XLOe eUUjdXrmTYDF6ur4KebUlpE98ty+mvgCy6k2QK6A4Zn3jFa3RpGzNRWGfHGAE3urHf3/ eTMwJjIHpi1piyhPFWjzx2O+wiD13eDhnU97W4ygA2EmiFlsVhBzVwBJTc16BGl4PaIw Nu9Q== X-Gm-Message-State: AOJu0YytNbAf4YHr1M0I6f12RRcU7y3W103DmDV/VfjY768Akurom0Cr 8aCKNwGSPGTeor5FuAPD8M7u5o8uS9ystg9AwZQ= X-Google-Smtp-Source: AGHT+IHJklnmMkyD5BAiV9R9W9rZlb48v7JPNOjSTLgF9BkQEjJ9qZFdm+Z039gIgO6aUkzKZLWQWw== X-Received: by 2002:a05:6e02:1c02:b0:350:ef09:ff82 with SMTP id l2-20020a056e021c0200b00350ef09ff82mr13728779ilh.24.1696720398145; Sat, 07 Oct 2023 16:13:18 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:17 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Jerry Van Baren Subject: [PATCH v2 17/27] fdt: Move working_fdt into fdt_support Date: Sat, 7 Oct 2023 17:12:36 -0600 Message-ID: <20231007231255.277623-18-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean This can be accessed even when commands are not enabled. Move it into the fdt_support.c file, which is where most of the FDT helpers are. Signed-off-by: Simon Glass --- (no changes since v1) boot/fdt_support.c | 5 +++++ cmd/fdt.c | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/boot/fdt_support.c b/boot/fdt_support.c index 5e49078f8c35..6ae7b8e20f65 100644 --- a/boot/fdt_support.c +++ b/boot/fdt_support.c @@ -23,6 +23,11 @@ #include #include +/* + * The working_fdt points to our working flattened device tree. + */ +struct fdt_header *working_fdt; + /** * fdt_getprop_u32_default_node - Return a node's property or a default * diff --git a/cmd/fdt.c b/cmd/fdt.c index 331564c13be9..86e847a41826 100644 --- a/cmd/fdt.c +++ b/cmd/fdt.c @@ -31,11 +31,6 @@ static int fdt_parse_prop(char *const*newval, int count, char *data, int *len); static int fdt_print(const char *pathp, char *prop, int depth); static int is_printable_string(const void *data, int len); -/* - * The working_fdt points to our working flattened device tree. - */ -struct fdt_header *working_fdt; - static void set_working_fdt_addr_quiet(ulong addr) { void *buf; From patchwork Sat Oct 7 23:12:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844810 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=jN7UKAe9; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31Yy6D00z1yqP for ; Sun, 8 Oct 2023 10:23:18 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 685B086F20; Sun, 8 Oct 2023 01:14:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="jN7UKAe9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CF80786EC6; Sun, 8 Oct 2023 01:13:53 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) (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 CF94F86F09 for ; Sun, 8 Oct 2023 01:13:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd30.google.com with SMTP id ca18e2360f4ac-79fa2dbd793so150708939f.2 for ; Sat, 07 Oct 2023 16:13:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720399; x=1697325199; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tDB8/R8mlMj3PKz0t2koAkI/TFpsW7xWQU/JEpFrTl4=; b=jN7UKAe9yFm/bRqjB9UlKMYoBtk0sSrmMwPCAk7L0fKahTjzg9iZc0raxpFRiszu6Y aYrNmGwTt6ESWIWKwTeQYnxMgKYU9LdhO/4AUeht5sZTJB93Kn4AHFsk61SJzUnE1ai0 uxfoefUTuZgEslCoTsOxMdSw92PV3z2X8R8a0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720399; x=1697325199; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tDB8/R8mlMj3PKz0t2koAkI/TFpsW7xWQU/JEpFrTl4=; b=s1tE7U3qoDOHjdHBKO3lSiJZaMtJgrihRYLZ6ekCNsnrd3ktUNlt1Y6cwx82BfyUxc 6gqlTtbzHXzl4ePhkVPS9+gGntoQugPaVeo/0qOtfZDWU3/phxO2g2sase62WbVGees9 lJ93D70s2UPyWnYXFRPsafR3yoV2wozPTHlt36L5YDoBcuRoEQ919JB2AQ5Niezbz4iO eN+djtHposXAovlK5j31WSfsZLresOiwsjP7UYWabHlqAqGIBnN/FUfVh5x31h8SC1Zq PWKWn1Jy1V+L0nyn1voXqfgMeC/XVubXMLwj18aLW4rvAIZQyLRhsgw25DDzgFdkw8qt dIuA== X-Gm-Message-State: AOJu0YyNXDpRyrNW1AA08kkJATEtgX6OaHHNLYh1ITJTA7neN4hkABtC cd17Bqg5+0iq0V8mwrRpwdzX4N8X6nh8D3EnJQY= X-Google-Smtp-Source: AGHT+IEd2zeHnIX0xClnaTFb9fEZfwZa4hnxL/horiB9l6IcTGHt7tJXII+qiW1PIr3froBgN0xirQ== X-Received: by 2002:a92:d24c:0:b0:34f:22a6:7f64 with SMTP id v12-20020a92d24c000000b0034f22a67f64mr11884449ilg.1.1696720398851; Sat, 07 Oct 2023 16:13:18 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:18 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Ramon Fried , Joe Hershberger Subject: [PATCH v2 18/27] net: Depend on CONFIG_CMDLINE Date: Sat, 7 Oct 2023 17:12:37 -0600 Message-ID: <20231007231255.277623-19-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean At present it isn't possible to use networking without the command line enabled. Add this as a condition. Signed-off-by: Simon Glass Reviewed-by: Ramon Fried --- (no changes since v1) cmd/Kconfig | 1 + net/Kconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/cmd/Kconfig b/cmd/Kconfig index 96ea40109abd..c952b2e286cd 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1687,6 +1687,7 @@ if NET menuconfig CMD_NET bool "Network commands" + depends on CMDLINE default y imply NETDEVICES diff --git a/net/Kconfig b/net/Kconfig index 4215889127c9..25d494e1db46 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -4,6 +4,7 @@ menuconfig NET bool "Networking support" + depends on CMDLINE default y if NET From patchwork Sat Oct 7 23:12:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844828 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=JWwqolat; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31ft17DPz1yq7 for ; Sun, 8 Oct 2023 10:27:34 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4886B86F78; Sun, 8 Oct 2023 01:16:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="JWwqolat"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1334986E08; Sun, 8 Oct 2023 01:14:29 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) (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 CF8DB86F07 for ; Sun, 8 Oct 2023 01:13:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x130.google.com with SMTP id e9e14a558f8ab-351365e47f6so12292615ab.1 for ; Sat, 07 Oct 2023 16:13:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720399; x=1697325199; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OP7cMGfjPuWnZo8sZEKOFVIP1vGHAU1h+USGtVez7m4=; b=JWwqolatq2uPWR1Tiyrf9ZqV3Et0KSuhwab0sf1AGiW18vBGEMkZCoC3yaMC33i4KD ymcHBjijMrh5/Gez8Pi0JkPZysiR6/aKbgdr/Vfcx7rpX8GcLTN2iOkfRsdt8N53qPmd C40aQ+8qUljNV7nwpm1c0SeagVm/+NQfBVBiY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720399; x=1697325199; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OP7cMGfjPuWnZo8sZEKOFVIP1vGHAU1h+USGtVez7m4=; b=JuYCZhpAB1/QCmQkXrVClFubwjpXY8FzFFGNWjXXo4fTNC1MSCnuT7Dg/uP/ezepUX 9QiPOkhfFkIzJHcrz2oqf0v3TxP2cQjnQMK3HDyQP2ES8JWYk9dWqKVJN01iTeISVS2i FlwqbDYfe5kpIdAY9CDN6IVR7xz22FDeKimzQepYHX/sP3HFPLMbP4V7agQ30qmJ0W7L zm5evWarLPxDA7Pwqds6jgjgwjdAB90leHJeQJsPlGf0hIjdBXzm5rm+Tcx90RafAn29 6iWqLnndviSZ8eKCclmjKQBOs09acpnwQChYMMeR/PHn0MC/MUil/Zy2xgogSFhPCeVe PXOQ== X-Gm-Message-State: AOJu0YxN96/lwDss01ghIpgukxbE+yxAiuLosJlDtsrDZzcDQarYFY3Z 0QunO+OgRDWzdlSJXSKAMzd/Mb0WzJkntDXBwK8= X-Google-Smtp-Source: AGHT+IHxXOo+WAkvDlQDhpmb+I6quCvocj0ryJmsRsxDOn6VmmZ2NfJ8NQRIfPqqXyKBEgUqQtQCmQ== X-Received: by 2002:a05:6e02:1988:b0:350:f956:91c4 with SMTP id g8-20020a056e02198800b00350f95691c4mr15230539ilf.4.1696720399557; Sat, 07 Oct 2023 16:13:19 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:19 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v2 19/27] log: Allow use without CONFIG_CMDLINE Date: Sat, 7 Oct 2023 17:12:38 -0600 Message-ID: <20231007231255.277623-20-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean When CONFIG_SYS_CBSIZE is not used we need an alternative. For logging it seems that CONFIG_SYS_PBSIZE is a better choice anyway, so update this. Signed-off-by: Simon Glass --- (no changes since v1) common/log.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/log.c b/common/log.c index b2de57fcb3b8..72a4de3274c7 100644 --- a/common/log.c +++ b/common/log.c @@ -206,7 +206,7 @@ static bool log_passes_filters(struct log_device *ldev, struct log_rec *rec) static int log_dispatch(struct log_rec *rec, const char *fmt, va_list args) { struct log_device *ldev; - char buf[CONFIG_SYS_CBSIZE]; + char buf[CONFIG_SYS_PBSIZE]; /* * When a log driver writes messages (e.g. via the network stack) this @@ -268,7 +268,7 @@ int _log(enum log_category_t cat, enum log_level_t level, const char *file, /* display dropped traces with console puts and DEBUG_UART */ if (rec.level <= CONFIG_LOG_DEFAULT_LEVEL || rec.flags & LOGRECF_FORCE_DEBUG) { - char buf[CONFIG_SYS_CBSIZE]; + char buf[CONFIG_SYS_PBSIZE]; va_start(args, fmt); vsnprintf(buf, sizeof(buf), fmt, args); From patchwork Sat Oct 7 23:12:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844824 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=EPJCB/G+; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31dt2rtqz1yq7 for ; Sun, 8 Oct 2023 10:26:42 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3F5A886F43; Sun, 8 Oct 2023 01:16:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="EPJCB/G+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1378186EDF; Sun, 8 Oct 2023 01:14:29 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12a.google.com (mail-il1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) (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 CFA2386F0D for ; Sun, 8 Oct 2023 01:13:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12a.google.com with SMTP id e9e14a558f8ab-353c3c21761so6666935ab.2 for ; Sat, 07 Oct 2023 16:13:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720400; x=1697325200; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JPiSJypWnexMQC24TfdtaO59cIj1LzIK/Zd4rdf5JME=; b=EPJCB/G+aPLPz5117KgRavCkdW2M6bdLSnfu06Jcu86joBGP8KSFlJzMxmT88tfqmV gMagIkG2DfUZixsykt0CHRMJhEuyhEsB9VMpPzHcxtel/qawKE2iuKEzsNw/KBCvDGdN zF3JkbAf8tozQhGdw9pn+0tcAXd2c9s2JNul4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720400; x=1697325200; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JPiSJypWnexMQC24TfdtaO59cIj1LzIK/Zd4rdf5JME=; b=ka/3fEYnA0/b5/l/1k4sAYB/DStGXnZCSX1CEMDQ/TvmENYnvIjrhYsiT1JEUFZWPT 32tNzIAMDacpcFsEctMT6lSaTr87hVitQ0n0CG6xMzNIytJwtXFupnFkGJ0FqX064Mxj Pxpx1qBvy4CDOaUkRVx6t9xzTLHsKwZ2qhJZG1PoxJxhA+GxSyaJ/gUOiCMt1vmWqXno XW0ZVkwhH5UhtWTTKxprTpTmss1wRKUl744Se3Ea1iaGLcg1RmKOi1uXCzzeQofjfP6h 4jpWENqCs5+HuR0LDa1zNR4J4Fdabneg7HnYj4FqxaIrh654SGS6dZXHS82qZbLzGGRK yOQQ== X-Gm-Message-State: AOJu0YyEbDYy2o8chhM8wbJImTEAlA3SAMDKghXE24qYRTMXCD7Dy67f 5x3hlnRfk0sXw0iWcKjWH75xxzqGDa0lYiR4H6w= X-Google-Smtp-Source: AGHT+IGrnpjf67cavUy6v6MjZUSUINK6RzuKmJROHog9o4p4v0S/lvpO4/1g43PS1qxEglJ/ujJxqw== X-Received: by 2002:a05:6e02:1a2c:b0:351:20f4:3a28 with SMTP id g12-20020a056e021a2c00b0035120f43a28mr14784791ile.0.1696720400343; Sat, 07 Oct 2023 16:13:20 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:20 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Anatolij Gustschin Subject: [PATCH v2 20/27] video: Allow use without CONFIG_CMDLINE Date: Sat, 7 Oct 2023 17:12:39 -0600 Message-ID: <20231007231255.277623-21-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean Provide a fallback for when CONFIG_SYS_CBSIZE is not provided, so that the console can still be used. Signed-off-by: Simon Glass --- (no changes since v1) drivers/video/console_truetype.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c index 0f9bb49e44f7..8186b5b49f0b 100644 --- a/drivers/video/console_truetype.c +++ b/drivers/video/console_truetype.c @@ -124,7 +124,11 @@ struct pos_info { * Allow one for each character on the command line plus one for each newline. * This is just an estimate, but it should not be exceeded. */ +#ifdef CONFIG_SYS_CBSIZE #define POS_HISTORY_SIZE (CONFIG_SYS_CBSIZE * 11 / 10) +#else +#define POS_HISTORY_SIZE (250 * 11 / 10) +#endif /** * struct console_tt_metrics - Information about a font / size combination From patchwork Sat Oct 7 23:12:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844827 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=bnkI/uK6; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31fF680Nz1yql for ; Sun, 8 Oct 2023 10:27:01 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C3AD186F7D; Sun, 8 Oct 2023 01:16:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="bnkI/uK6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3581A86F58; Sun, 8 Oct 2023 01:14:40 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) (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 9B3C686F11 for ; Sun, 8 Oct 2023 01:13:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12c.google.com with SMTP id e9e14a558f8ab-3526c9c401aso12619515ab.1 for ; Sat, 07 Oct 2023 16:13:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720401; x=1697325201; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vtSetA4qHjfOloCFtNzvSJJZnoL2c0o/R8elzmRu/HU=; b=bnkI/uK6zxPKVEXjBb1rO52GgOgCUgGrJHyQ15JlvbPq8AxPYurP+S4etMSLGlIkSK ZfxcTPdJSJH4/ca4tgZy2cd/naa0w9pbKDCnEkXv2d2YXl9ntCz1A0Sha5wYwZdsvw5z E2A6MzI9YgTocB9M0bMH8/y9G+oC0VlEy5Z0Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720401; x=1697325201; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vtSetA4qHjfOloCFtNzvSJJZnoL2c0o/R8elzmRu/HU=; b=qUXOBs6ws8nxf7lhceDoZd+k3xgwICQiOFQs4wab04Gxf1sUfUq01x67X7LK1ncLPK c2qoGcYtHLpLLdpV0lOq7TwJ6RHhhgcekKjN42lal2M5K1jAAuji6MmRwi9PN4ErD/QQ 0RMUhiKAm2Wav/tSNtwcOpeKhN7ezkJ7ZsubreTd0ClEvYMw3sXxzq5GZ+sY7HVmXwQR kk/LE8jCzc6n6C9FIJTfer8anzsu/ioKoR+5VRuupTsuFfh5NTd3YnQYCCBDOEgb8cfd lM3OUvMDw7H9cmsNGROzOJWwjgk5DxjoQurtEKGTT99VbyrfLOM5Rsvz0aXqKWcK9zje WZIA== X-Gm-Message-State: AOJu0YyaVMlKk3LG52452phYjbDd7EsJmAqQi1AH8wyVNtnl6Xlhaaxj Vw9BL/QH7q1rJp5UpOm+2JxduSfbNycSRVqhvIg= X-Google-Smtp-Source: AGHT+IFaGZ9KnIa0cwRvMsKlIY6cVUGW1ua09fJAsjeM4U1pmHJUA3+aIm3Y+wwFWRi22Y686CCmzg== X-Received: by 2002:a05:6e02:b24:b0:348:c606:bd1a with SMTP id e4-20020a056e020b2400b00348c606bd1amr7364273ilu.15.1696720401244; Sat, 07 Oct 2023 16:13:21 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:20 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Anatolij Gustschin Subject: [PATCH v2 21/27] video: Dont require the font command Date: Sat, 7 Oct 2023 17:12:40 -0600 Message-ID: <20231007231255.277623-22-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean While it is nice to have the font command, using 'select' makes it impossible to build the console code without it. Change this to use 'imply' instead. Signed-off-by: Simon Glass --- (no changes since v1) drivers/video/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index ab927641bb7a..21ea5c860cca 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -180,7 +180,7 @@ config CONSOLE_ROTATION config CONSOLE_TRUETYPE bool "Support a console that uses TrueType fonts" - select CMD_SELECT_FONT + imply CMD_SELECT_FONT help TrueTrype fonts can provide outline-drawing capability rather than needing to provide a bitmap for each font and size that is needed. From patchwork Sat Oct 7 23:12:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844831 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=AjnfOJgM; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31hH2q4gz1yq7 for ; Sun, 8 Oct 2023 10:28:47 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8D59D86F91; Sun, 8 Oct 2023 01:16:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="AjnfOJgM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DDE0086F04; Sun, 8 Oct 2023 01:14:58 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) (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 7A6FD86F14 for ; Sun, 8 Oct 2023 01:13:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x130.google.com with SMTP id e9e14a558f8ab-352a1a0348fso13403305ab.1 for ; Sat, 07 Oct 2023 16:13:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720402; x=1697325202; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7fWqYwC2ttubNGbxdtaZWKOcqhecCNc3AZkSP7ylyv0=; b=AjnfOJgMm7qatIP4E/OyZ4U15BMZ+Qr+H9G/lBumlRaBq94m/YW3AEEN9jhyS6cbge eRggLQvrOTsEr/p+WM8fUoTJ3Q4UEWFsD2bDqx713xQoZKQT0vMUfjsFu7EGzJLTzAZW p/nHHL5SbK9iSAPtGStXVmsa52oKRoNHwyCvk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720402; x=1697325202; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7fWqYwC2ttubNGbxdtaZWKOcqhecCNc3AZkSP7ylyv0=; b=b7GjEMGmRr3VqXvoYj6Ny7ahUWUUshRdmfiDzMywb41Hw0DMppgK+1A55GkPIfX9My 9eR2SyXUbiyK8Lp5WK4DjLSEIld3asqbbS1dmpLy3GmsoQKXMOfJHHbmoVfO6ULpgNlj OaqBXDbXSt1lSNoIMWkqA2iq+EQpZy+YIbz1qig9OdiMDaQoCQDU6NQhH8AN2mjdUJJ3 MI2NZlvLWnrjsTlVP+TmtCv+ZeExYAgGiyeNfiRH2i3cqwpNAUrU+liL2lcQ3ZozoeLt 47mPhlF+s0UCk/i8wtD2EZ++EIwZkdnOTrU2tf6jNSHh0S5V4bj4duJMMRs2HT576Wc+ zz/g== X-Gm-Message-State: AOJu0YyTlRBqySvibLoEH/tGfcKhibZgBZheYXvt1CnKrXvdinYwZPTE mo8Em5RJUzZQSt/WItOo4JpiioBEDHVXvP0T6yw= X-Google-Smtp-Source: AGHT+IEax7CyQCyDBC9TfmTupyYJK6s210SMCVo6lRAYy1XO443NsBrGH89hXZKS8q5w3JCppv83/A== X-Received: by 2002:a05:6e02:1061:b0:34f:d9db:66c4 with SMTP id q1-20020a056e02106100b0034fd9db66c4mr10788704ilj.30.1696720402123; Sat, 07 Oct 2023 16:13:22 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:21 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v2 22/27] efi: Depend on CMDLINE for efi_loader Date: Sat, 7 Oct 2023 17:12:41 -0600 Message-ID: <20231007231255.277623-23-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean This features currently requires the command line, so make this explicit. Future work could adjust this, but it needs effort within the booting support first, like the bootm command. Signed-off-by: Simon Glass --- (no changes since v1) lib/efi_loader/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index 621ed5e5b0fb..2aef9336034e 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -12,6 +12,7 @@ config EFI_LOADER depends on !EFI_STUB || !X86 || X86_64 || EFI_STUB_32BIT depends on BLK depends on !EFI_APP + depends on CMDLINE default y if !ARM || SYS_CPU = armv7 || SYS_CPU = armv8 select CHARSET # We need to send DM events, dynamically, in the EFI block driver From patchwork Sat Oct 7 23:12:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844835 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ltVSNLln; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31jl0BkHz1yq7 for ; Sun, 8 Oct 2023 10:30:03 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DD18E86F88; Sun, 8 Oct 2023 01:16:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="ltVSNLln"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 727C586EC6; Sun, 8 Oct 2023 01:14:53 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) (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 582BB86F1E for ; Sun, 8 Oct 2023 01:13:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x132.google.com with SMTP id e9e14a558f8ab-35135b79b6aso13494885ab.0 for ; Sat, 07 Oct 2023 16:13:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720403; x=1697325203; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=e2CdtAnI3hL6CqaQfkPBop3ToDaRjFDzyLHkyRcZei0=; b=ltVSNLlnsdt7Pbw+4IvFx9BL4MlZyBIrHvJmVPblUyzHUu72GcfsLIa6hGWBO7Jiep 9cqTzgHXiP8nFk8mbGuJFfmDsZ/oSpAR9bzF5/KElIO2pT/2xk5eS7yJRJ1bwkaRPqcg fbV7CnQiCuCj0qBXE+0auY+716fl5sFKSfkI8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720403; x=1697325203; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=e2CdtAnI3hL6CqaQfkPBop3ToDaRjFDzyLHkyRcZei0=; b=X3aPVKbOIPc4zqsdpemJlN2srAZznxSS+EiSWHOmcJ4qPTXcxDUDPQUozgvVs7WUMM KY0Yw+kofWlPxnMMG7ybgREQrcbRszCNmCGOpuDbXwNDHvbRHyHG1+1bWnu8Ygb/Dfzd nQSGL/Yxszk5QgBy+o7VgBfoFlEUe/lfHq+MMTSiHmabJKnssgYPKpT69a/Cd9Gpz3Sf NR9sl46A0/Qedo374Vrh/A/JbQxSvATnOIYtHxGQN5cm0VimfwPYYJr26pI6yCuKpJQ9 zsv1kvV+ZIofmrVYnWpJrQRUe55pifYSzns/R1FfXfHp9uBH1VZmHjU5rMzUjO7EG2lz BerA== X-Gm-Message-State: AOJu0Yz81bVybpm2kT1NGfh1wkMpaawGJyXzXjlwGIJsvryo6TFPHkWi bXGia3fJRMBbFZt7uIzIXN8QouryPeLquxUTlUk= X-Google-Smtp-Source: AGHT+IFV26HcGWqz/82VCLqAFaXyfnUpYr+/Qw9zfeHlwE8Yjo7ZuLLLpVYaQJDaGmbxNkf9HHlSyg== X-Received: by 2002:a92:cdad:0:b0:34c:c0ad:69e0 with SMTP id g13-20020a92cdad000000b0034cc0ad69e0mr15470014ild.1.1696720402947; Sat, 07 Oct 2023 16:13:22 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:22 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v2 23/27] cmd: Make all commands depend on CMDLINE Date: Sat, 7 Oct 2023 17:12:42 -0600 Message-ID: <20231007231255.277623-24-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean If this option is disabled, commands should not be available. Convert the CMDLINE option into a menuconfig and make every command in cmd/Kconfig depend on it. Signed-off-by: Simon Glass --- (no changes since v1) cmd/Kconfig | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/cmd/Kconfig b/cmd/Kconfig index c952b2e286cd..0a8c3e07242a 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1,7 +1,5 @@ -menu "Command line interface" - -config CMDLINE - bool "Support U-Boot commands" +menuconfig CMDLINE + bool "Command line interface" default y help Enable U-Boot's command-line functions. This provides a means @@ -11,9 +9,10 @@ config CMDLINE Depending on the number of commands enabled, this can add substantially to the size of U-Boot. +if CMDLINE + config HUSH_PARSER bool "Use hush shell" - depends on CMDLINE help This option enables the "hush" shell (from Busybox) as command line interpreter, thus enabling powerful command line syntax like @@ -25,7 +24,6 @@ config HUSH_PARSER config CMDLINE_EDITING bool "Enable command line editing" - depends on CMDLINE default y help Enable editing and History functions for interactive command line @@ -40,15 +38,13 @@ config CMDLINE_PS_SUPPORT config AUTO_COMPLETE bool "Enable auto complete using TAB" - depends on CMDLINE default y help Enable auto completion of commands using TAB. config SYS_LONGHELP bool "Enable long help messages" - depends on CMDLINE - default y if CMDLINE + default y help Defined when you want long help messages included Do not set this option when short of memory. @@ -86,8 +82,7 @@ config SYS_CBSIZE config SYS_XTRACE bool "Command execution tracer" - depends on CMDLINE - default y if CMDLINE + default y help This option enables the possiblity to print all commands before executing them and after all variables are evaluated (similar @@ -219,7 +214,6 @@ menu "Boot commands" config CMD_BOOTD bool "bootd" - depends on CMDLINE default y help Run the command stored in the environment "bootcmd", i.e. @@ -409,7 +403,6 @@ source lib/efi_selftest/Kconfig config CMD_BOOTMENU bool "bootmenu" - depends on CMDLINE select MENU select CHARSET help @@ -476,7 +469,6 @@ config CMD_GO config CMD_RUN bool "run" - depends on CMDLINE default y help Run the command in the given environment variable. @@ -567,7 +559,6 @@ menu "Environment commands" config CMD_ASKENV bool "ask for env variable" - depends on CMDLINE help Ask for environment variable @@ -1687,7 +1678,6 @@ if NET menuconfig CMD_NET bool "Network commands" - depends on CMDLINE default y imply NETDEVICES @@ -1991,7 +1981,6 @@ config CMD_ETHSW config CMD_PXE bool "pxe" - depends on CMDLINE select PXE_UTILS help Boot image via network using PXE protocol @@ -2126,7 +2115,6 @@ config CMD_EFICONFIG config CMD_EXCEPTION bool "exception - raise exception" - depends on CMDLINE depends on ARM || RISCV || SANDBOX || X86 help Enable the 'exception' command which allows to raise an exception. @@ -2227,14 +2215,12 @@ config CMD_SOUND config CMD_SYSBOOT bool "sysboot" - depends on CMDLINE select PXE_UTILS help Boot image via local extlinux.conf file config CMD_QFW bool "qfw" - depends on CMDLINE select QFW help This provides access to the QEMU firmware interface. The main @@ -2883,4 +2869,5 @@ config CMD_MESON default y help Enable useful commands for the Meson Soc family developed by Amlogic Inc. -endmenu + +endif # CMDLINE From patchwork Sat Oct 7 23:12:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844834 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=iDVF8QI4; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31jY4bNMz1yq7 for ; Sun, 8 Oct 2023 10:29:53 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6943886F82; Sun, 8 Oct 2023 01:16:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="iDVF8QI4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AFC3C86EDB; Sun, 8 Oct 2023 01:14:47 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) (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 137D286F28 for ; Sun, 8 Oct 2023 01:13:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd34.google.com with SMTP id ca18e2360f4ac-7a26fbfcf8eso138924239f.2 for ; Sat, 07 Oct 2023 16:13:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720403; x=1697325203; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=c5GXe/IapfLR/XcwmMUH9fUDCn72qO95akcuGcm8OvM=; b=iDVF8QI4Y8ZRR7CWepJzZOGnzGIF8jB6I0Zj24cec8WmUyGpGZDyffSmMXzCAK8LmG FF3TdRbi4Hj7lj8lAY0CRmmQ338+W9ZPp5UBB5/YB1D44YNSIJMSQVIN5RPgNjnubXb4 X1onwt1qbZThuyNsM/P5+FTn6KWpDpH6rwQAg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720403; x=1697325203; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c5GXe/IapfLR/XcwmMUH9fUDCn72qO95akcuGcm8OvM=; b=OhC2RkWjoX+bUBgYEJI8wEwHWJlLzAtvut1EhM0jF4bIJ7MdE7cVQLaBfQqW/mSiJO V+f9bQy+h+wmSYVn4ExmvBPcTyHYQ4oyG5TyECFbMgN+iVWSYIk6O8BHvbM/pd5WCbE1 OqPM6p4Gqmysmb45+3xdNADhYLBiDXAjEYa3Mgx39a1bPAsnNNgiKu6i+Qy+t20jAi4P O7QBpMlu6Oe/S3o6DJyP6i7WNUqymeLJOHVZbgLlQaQD0qgCnaXO3eAK1snEbheUuxBV 2HaHC9cLbxwi7PsNlhpgUeGeWbZwPnrkSEVo8AOcd/6+EJNGo5OBwmjWGMBnRaglX82f zhyg== X-Gm-Message-State: AOJu0YyTgjs8Yw7jqc+0L9aWCeLnFNlF9l2aFU7H5E1M3Wbt7Xjc1eCg 4AVmwqS+7aOrElS7njgC2rjAXl4cqhXE/deamto= X-Google-Smtp-Source: AGHT+IGewAxpigYYUchsj0shqYVjHrxn7oplYFFxz/fKBeseADsagri+Ms5xxi9alwkXQi6wOu6gdA== X-Received: by 2002:a05:6e02:1bcc:b0:34d:ee49:5114 with SMTP id x12-20020a056e021bcc00b0034dee495114mr14045954ilv.23.1696720403646; Sat, 07 Oct 2023 16:13:23 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:23 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v2 24/27] sandbox: Avoid requiring cmdline Date: Sat, 7 Oct 2023 17:12:43 -0600 Message-ID: <20231007231255.277623-25-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean Use 'imply' rather than 'select' for command-related options, so that it is possible to build sandbox without CONFIG_CMDLINE enabled. Signed-off-by: Simon Glass --- (no changes since v1) arch/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig index 19f2891ba1c5..789be7a9f1e8 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -134,7 +134,6 @@ config SANDBOX select ARCH_SUPPORTS_LTO select BOARD_LATE_INIT select BZIP2 - select CMD_POWEROFF select DM select DM_EVENT select DM_FUZZING_ENGINE @@ -152,10 +151,8 @@ config SANDBOX select PCI_ENDPOINT select SPI select SUPPORT_OF_CONTROL - select SYSRESET_CMD_POWEROFF select SYS_CACHE_SHIFT_4 select IRQ - select SUPPORT_EXTENSION_SCAN select SUPPORT_ACPI imply BITREVERSE select BLOBLIST @@ -167,6 +164,7 @@ config SANDBOX imply CMD_IO imply CMD_IOTRACE imply CMD_LZMADEC + imply CMD_POWEROFF imply CMD_SF imply CMD_SF_TEST imply CRC32_VERIFY @@ -208,6 +206,8 @@ config SANDBOX imply PHYSMEM imply GENERATE_ACPI_TABLE imply BINMAN + imply SYSRESET_CMD_POWEROFF + imply SUPPORT_EXTENSION_SCAN config SH bool "SuperH architecture" From patchwork Sat Oct 7 23:12:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844832 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=cJMTiSop; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31hQ2Rqjz1yq7 for ; Sun, 8 Oct 2023 10:28:54 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2CC5886F8C; Sun, 8 Oct 2023 01:16:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="cJMTiSop"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3A88B86DCB; Sun, 8 Oct 2023 01:15:02 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x12a.google.com (mail-il1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) (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 5A6C986F2C for ; Sun, 8 Oct 2023 01:13:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12a.google.com with SMTP id e9e14a558f8ab-351250be257so14405765ab.0 for ; Sat, 07 Oct 2023 16:13:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720404; x=1697325204; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Xxm0206OOO7nse9KspJEPmH6AfQ6j3lrpKe4/0NG9J4=; b=cJMTiSop5fw7xZ1iTqrlau0eCDagM3BU7AakCh2kwboG8A83oSO9SlKSbx197irM3M WCo+FwmK6kM+4Uz9S0nKcc+efBhD89r3q1SH28r4UZAJqGSX3Zo5NwhfrNyW1Zy6W9SA A62s/ebtiCyfTfafo/TzVJSffVg7I+SRRxrOg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720404; x=1697325204; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Xxm0206OOO7nse9KspJEPmH6AfQ6j3lrpKe4/0NG9J4=; b=qr9yjQB9goMrDcsT+i617VFqtq16y8kJ6zFYs32jtmH4qbnXCdT9quc7TSZKC6Hh+w xdpt/IPdIRFhzw05nCCGbeC6+vOQIL+pd2UB4LCIvE+UadaRbRiwhZigDPBjJTELT4fl PEFjp7u5ELmIEbbJMLmhD3flv4fBBvW6BR9G8U8370wjh2p3o6UtHiAhV8n4KpDjKdd1 POexpLN335jCyricPWMDub/jp7ReN0ftH4rW6z3w3gwfdcUpqWDRj+BZ2K+iwcMi7RRa cFgCYhDNsusqGCdCcsg/N5qDAnEF7jKWmrPkzcjqJCL8OKu9SDhCEKna5RE2er9DkDrj SpgQ== X-Gm-Message-State: AOJu0Yxlf0FfxJk1jEZTK0GvaD0b8oFyvRjVdri5t50kk35tAIznr93d TefMzZeNu8umXuL+VnJymDtC9qyGOqHgCXPFNPg= X-Google-Smtp-Source: AGHT+IE96PYqSzxPXvxkr5vmxXqZqZE6Axvkp5JTTwbWNlu2t4kW0h8wRBxNowm6CQ5kK9O+h/BBAA== X-Received: by 2002:a05:6e02:963:b0:34c:e84b:4c5c with SMTP id q3-20020a056e02096300b0034ce84b4c5cmr10148026ilt.27.1696720404477; Sat, 07 Oct 2023 16:13:24 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:24 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Albert Aribaud , Bin Meng Subject: [PATCH v2 25/27] arm: x86: Drop discarding of command linker-lists Date: Sat, 7 Oct 2023 17:12:44 -0600 Message-ID: <20231007231255.277623-26-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean Since we can now cleanly disable CMDLINE when needed, drop the rules which discard the command code. It will not be built in the first place. Signed-off-by: Simon Glass --- Changes in v2: - Add new patch to drop discarding of command linker-lists arch/arm/cpu/u-boot.lds | 3 --- arch/x86/cpu/u-boot-64.lds | 4 ---- arch/x86/cpu/u-boot-spl.lds | 4 ---- arch/x86/cpu/u-boot.lds | 4 ---- 4 files changed, 15 deletions(-) diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds index fc4f63d83489..7724c9332c3b 100644 --- a/arch/arm/cpu/u-boot.lds +++ b/arch/arm/cpu/u-boot.lds @@ -14,9 +14,6 @@ OUTPUT_ARCH(arm) ENTRY(_start) SECTIONS { -#ifndef CONFIG_CMDLINE - /DISCARD/ : { *(__u_boot_list_2_cmd_*) } -#endif #if defined(CONFIG_ARMV7_SECURE_BASE) && defined(CONFIG_ARMV7_NONSEC) /* * If CONFIG_ARMV7_SECURE_BASE is true, secure code will not diff --git a/arch/x86/cpu/u-boot-64.lds b/arch/x86/cpu/u-boot-64.lds index d0398ff00d71..00a6d8691211 100644 --- a/arch/x86/cpu/u-boot-64.lds +++ b/arch/x86/cpu/u-boot-64.lds @@ -11,10 +11,6 @@ ENTRY(_start) SECTIONS { -#ifndef CONFIG_CMDLINE - /DISCARD/ : { *(__u_boot_list_2_cmd_*) } -#endif - #ifdef CONFIG_TEXT_BASE . = CONFIG_TEXT_BASE; /* Location of bootcode in flash */ #endif diff --git a/arch/x86/cpu/u-boot-spl.lds b/arch/x86/cpu/u-boot-spl.lds index a0a2a06a18cd..50b4b1608552 100644 --- a/arch/x86/cpu/u-boot-spl.lds +++ b/arch/x86/cpu/u-boot-spl.lds @@ -11,10 +11,6 @@ ENTRY(_start) SECTIONS { -#ifndef CONFIG_CMDLINE - /DISCARD/ : { *(__u_boot_list_2_cmd_*) } -#endif - . = IMAGE_TEXT_BASE; /* Location of bootcode in flash */ __text_start = .; .text : { diff --git a/arch/x86/cpu/u-boot.lds b/arch/x86/cpu/u-boot.lds index a31f4220a000..c418ff44aa08 100644 --- a/arch/x86/cpu/u-boot.lds +++ b/arch/x86/cpu/u-boot.lds @@ -11,10 +11,6 @@ ENTRY(_start) SECTIONS { -#ifndef CONFIG_CMDLINE - /DISCARD/ : { *(__u_boot_list_2_cmd_*) } -#endif - . = CONFIG_TEXT_BASE; /* Location of bootcode in flash */ __text_start = .; From patchwork Sat Oct 7 23:12:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844830 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=lQlNZByM; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31h421PGz1yq7 for ; Sun, 8 Oct 2023 10:28:36 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E865C86F99; Sun, 8 Oct 2023 01:16:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="lQlNZByM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C0CD286EBF; Sun, 8 Oct 2023 01:15:20 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) (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 06BFB86D82 for ; Sun, 8 Oct 2023 01:13:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x136.google.com with SMTP id e9e14a558f8ab-3529eafb3a9so13404365ab.2 for ; Sat, 07 Oct 2023 16:13:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720405; x=1697325205; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MpybGH7y1JNMcp/jxcY2j7JBFi/eB3zM779IhD+0ooU=; b=lQlNZByMq+wTfMz6lFInymxoTniiSjZAw/hCHWK30+vA7N12/mH8aqEYsrUi5z0VQk n7YeEnuG0UCQQ19uXuuSwkJLvxOhJXkwW/XJnV6rY99ynFX2FmlynGQoudwgnee9DTbL icfQj4OHT0uQ/mThRv3/dds/ROY+4CmSE11ns= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720405; x=1697325205; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MpybGH7y1JNMcp/jxcY2j7JBFi/eB3zM779IhD+0ooU=; b=L8mFfj0XYxbleFsdRcfDtaq6NemhRNKZarJrpMKNjGyAVs4gJt0pPzmf8b3ZXydQd3 1gN09AxQPztNt2RELb2xuxEPukPzxTXRFg2SynaLHolrtCer67z8RvOjPg+ZrFAk0AOl jUCCL7GxL7zTG8Q2XxxszXKKMpABgX1ZMx2RMDui372Xc+5P/Hb1qQLOHQOjHdNfaqcY x94AhYQvtkSXT1iKwrBz3CyjhOSupKzMUfB4PXT3lrtM5UzYKL54vOwD/q3t+8xRTzKk Dbog40pA7YdIQvyZlLaofrnQfyMg6k4kfkOQwaEp0AfAEJgYMtKh+Dhzqn+RoN6WNfTq F8+Q== X-Gm-Message-State: AOJu0YyJbO3Gbnh34hQoiU56v0+v8pDSi6aRZfgMpb9S2kmvDgMNJHD0 6ncpl494vRtu3icFJTmUUsX/1O0cw61vnSx6PTg= X-Google-Smtp-Source: AGHT+IFucwwtWmyz1wmdpac0nmfaAyZGL7A3i0MspPZbwoTkP2CVeq/jAieP4sK967Lvje2C3i0OgA== X-Received: by 2002:a05:6e02:12ea:b0:34a:c2e2:b2a7 with SMTP id l10-20020a056e0212ea00b0034ac2e2b2a7mr14185471iln.25.1696720405465; Sat, 07 Oct 2023 16:13:25 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:25 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Jaehoon Chung , Joe Hershberger , Peng Fan Subject: [PATCH v2 26/27] mmc: env: Unify the U_BOOT_ENV_LOCATION conditions Date: Sat, 7 Oct 2023 17:12:45 -0600 Message-ID: <20231007231255.277623-27-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean The declaration of U_BOOT_ENV_LOCATION() uses a different #ifdef condition from the code it calls. Use the same condition to avoid a build warning if CONFIG_CMD_SAVEENV is disabled. Signed-off-by: Simon Glass --- Changes in v2: - Add new patch to unify the U_BOOT_ENV_LOCATION conditions env/mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/env/mmc.c b/env/mmc.c index cb14bbb58f13..da84cddd74f0 100644 --- a/env/mmc.c +++ b/env/mmc.c @@ -495,7 +495,7 @@ U_BOOT_ENV_LOCATION(mmc) = { .location = ENVL_MMC, ENV_NAME("MMC") .load = env_mmc_load, -#ifndef CONFIG_SPL_BUILD +#if defined(CONFIG_CMD_SAVEENV) && !defined(CONFIG_SPL_BUILD) .save = env_save_ptr(env_mmc_save), .erase = ENV_ERASE_PTR(env_mmc_erase) #endif From patchwork Sat Oct 7 23:12:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1844833 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=LmPr+/Or; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S31hx3phTz1yq7 for ; Sun, 8 Oct 2023 10:29:21 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 27F5886F94; Sun, 8 Oct 2023 01:16:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="LmPr+/Or"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BF79186E08; Sun, 8 Oct 2023 01:15:20 +0200 (CEST) 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) (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 DD5C986F2E for ; Sun, 8 Oct 2023 01:13:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12d.google.com with SMTP id e9e14a558f8ab-3527428a402so12309335ab.0 for ; Sat, 07 Oct 2023 16:13:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696720406; x=1697325206; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=f9Y5zyVtOGpNrfASkWxWb2z1nMrBMT90XqkH7nGJkmc=; b=LmPr+/OrlF2GvItE37F/PSN8YnXteVoC6z9I519dYQnrnNCs2fSEU3+QM/WN49ocrN uvreT/Dvg874MaYM25FQOKJ4Q/5VB/mVg4z8evX2GQC2/L4cTnB1wrvhT3viAjRLdQtN j0CBweyEpm/GqEbk+WxIo5YhHcoUccjB+cC+g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696720406; x=1697325206; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f9Y5zyVtOGpNrfASkWxWb2z1nMrBMT90XqkH7nGJkmc=; b=LAdO5iYlc8x77XYtSTAUdnmHJaSCHlP6ge6ghmawXFPMz51+LgZ1epyzlwNUc4CU1w OLKuLeUQtQtrcW/OXIuejy/kaxXZOKd1Fe3WHdA9TPyBsL4mnv1y2nPC2kQYjEBdYGha PYNtoB+Nis/WedfjgqxmLpIEdXvCvHNNJydu20yRelFZyzXxIsvgnfad7cCArkLGXpK9 MSbX1bdj4mCezkRsZqoKdGHAw74D+xDL4/IjLtiLi9nLFkO1mnAoP4cbG4ZvTvk4niPy mZeuhBlj3VlUgrA/fjeWJPVqYqNyV/6D85V6ZEmnRtm72z3a8+tckDdu8+gVwe29V59T drXg== X-Gm-Message-State: AOJu0YxeSJX+550KxYJA8OC1YocOhwlJRlKVkc0TwqydZpEcJKp0V8h0 T/hty9k9OxDxN2NYKCVoFkJd9oOaPNze5wiVkkI= X-Google-Smtp-Source: AGHT+IElEA6fxoAmJoAMLu5LQ2vghRaOEVgPq5XpMDcMki7U1ll+BfSmA1kZCyBemClOykaaynkV3w== X-Received: by 2002:a05:6e02:20c4:b0:34a:c61f:9e99 with SMTP id 4-20020a056e0220c400b0034ac61f9e99mr13962033ilq.9.1696720406171; Sat, 07 Oct 2023 16:13:26 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x7-20020a92de07000000b0035129b9c61bsm2002320ilm.45.2023.10.07.16.13.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 16:13:25 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v2 27/27] sandbox: Add a test for disabling CONFIG_CMDLINE Date: Sat, 7 Oct 2023 17:12:46 -0600 Message-ID: <20231007231255.277623-28-sjg@chromium.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231007231255.277623-1-sjg@chromium.org> References: <20231007231255.277623-1-sjg@chromium.org> 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.8 at phobos.denx.de X-Virus-Status: Clean Now that everything is working, add a test to make sure that this builds correctly. Signed-off-by: Simon Glass --- Changes in v2: - Rebase on Tom's LONGHELP series - Correct 'of' typo test/py/tests/test_sandbox_opts.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/py/tests/test_sandbox_opts.py diff --git a/test/py/tests/test_sandbox_opts.py b/test/py/tests/test_sandbox_opts.py new file mode 100644 index 000000000000..91790b3374b4 --- /dev/null +++ b/test/py/tests/test_sandbox_opts.py @@ -0,0 +1,20 @@ +# SPDX-License-Identifier: GPL-2.0 +# Copyright 2022 Google LLC +# Written by Simon Glass + +import pytest + +import u_boot_utils as util + +# This is needed for Azure, since the default '..' directory is not writeable +TMPDIR = '/tmp/test_cmdline' + +@pytest.mark.slow +@pytest.mark.boardspec('sandbox') +def test_sandbox_cmdline(u_boot_console): + """Test building sandbox without CONFIG_CMDLINE""" + cons = u_boot_console + + out = util.run_and_log( + cons, ['./tools/buildman/buildman', '-m', '--board', 'sandbox', + '-a', '~CMDLINE', '-o', TMPDIR])