Tidy up use of CONFIG_CMDLINE
Subsystems (8)
v2 cover Tidy up use of CONFIG_CMDLINE
It should be possible to disable CONFIG_CMDLINE and have all commands and related functionality dropped from U-Boot. This is useful when trying to reduce the size of U-Boot.
Recent changes have stopped this from working.
This series repairs the feature for sandbox and adds a test to stop it breaking again.
Note that quite a lot of functionality is lost if CONFIG_CMDLINE is disabled, e.g. networking and most booting options. Further work is needed to make the option more generally useful.
Changes in v2:
- Move AUTOBOOT_USE_MENUKEY under AUTOBOOT
- Change this to use a Kconfig dependency instead of code failing
- Add new patch to drop discarding of command linker-lists
- Add new patch to unify the U_BOOT_ENV_LOCATION conditions
- Rebase on Tom's LONGHELP series
- Correct 'of' typo
Simon Glass (25):
buildman: Use oldconfig when adjusting the config
bootstd: Correct dependencies on CMDLINE
autoboot: Correct dependencies on CMDLINE
cmd: Add a few more dependencies on CMDLINE
test: Make UNIT_TEST depend on CMDLINE
sifive: Change #ifdef for nop
fastboot: Declare a dependency on CMDLINE
cli: Always build cli_getch
cmd: Use an #ifdef around run_commandf()
Move bootmenu_conv_key() into its own file
pxe: Depend on CMDLINE
env: Split out non-command code into a new file
console: Move SYS_PBSIZE into common/
bootm: Allow building when cleanup functions are missing
fdt: Move working_fdt into fdt_support
net: Depend on CONFIG_CMDLINE
log: Allow use without CONFIG_CMDLINE
video: Allow use without CONFIG_CMDLINE
video: Dont require the font command
efi: Depend on CMDLINE for efi_loader
cmd: Make all commands depend on CMDLINE
sandbox: Avoid requiring cmdline
arm: x86: Drop discarding of command linker-lists
mmc: env: Unify the U_BOOT_ENV_LOCATION conditions
sandbox: Add a test for disabling CONFIG_CMDLINE
Tom Rini (2):
command.h: Add a U_BOOT_LONGHELP macro
cmd: Convert existing long help messages to the new macro
arch/Kconfig | 6 +- arch/arm/cpu/u-boot.lds | 3 - arch/arm/lib/bootm.c | 2 + arch/arm/mach-imx/cmd_nandbcb.c | 6 +- arch/x86/cpu/u-boot-64.lds | 4 - arch/x86/cpu/u-boot-spl.lds | 4 - arch/x86/cpu/u-boot.lds | 4 - board/freescale/common/ngpixis.c | 6 +- .../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 +- boot/Kconfig | 48 ++++--- boot/bootm.c | 10 +- boot/fdt_support.c | 5 + cmd/Kconfig | 25 ++-- cmd/Makefile | 2 +- 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 | 11 +- 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 | 128 +---------------- 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 +- common/Kconfig | 5 + common/Makefile | 3 +- common/cli.c | 2 + common/cli_getch.c | 1 + common/log.c | 4 +- common/menu.c | 40 ------ common/menu_key.c | 49 +++++++ drivers/fastboot/Kconfig | 1 + drivers/video/Kconfig | 2 +- drivers/video/console_truetype.c | 4 + env/Makefile | 1 + env/env_set.c | 132 ++++++++++++++++++ env/mmc.c | 2 +- include/bootm.h | 15 +- include/command.h | 3 + include/env_internal.h | 23 +++ include/k210/pll.h | 2 +- lib/efi_loader/Kconfig | 2 + net/Kconfig | 1 + test/Kconfig | 1 + test/cmd_ut.c | 6 +- test/fuzz/cmd_fuzz.c | 7 +- test/py/tests/test_sandbox_opts.py | 20 +++ tools/buildman/builder.py | 2 +- tools/buildman/builderthread.py | 6 + tools/buildman/func_test.py | 4 +- 93 files changed, 462 insertions(+), 462 deletions(-) create mode 100644 common/menu_key.c create mode 100644 env/env_set.c create mode 100644 test/py/tests/test_sandbox_opts.py
Signature · 1 line
2.42.0.609.gbb76f46606-goog
PATCH v2 1/27 command.h: Add a U_BOOT_LONGHELP macro
From: Tom Rini <[email protected]>
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.
---
(no changes since v1)
include/command.h | 3 +++ 1 file changed, 3 insertions(+)
include/command.h +3 -0
@@ -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[], \
Signature · 1 line
2.42.0.609.gbb76f46606-goog
PATCH v2 2/27 cmd: Convert existing long help messages to the new macro
In reply to Simon GlassFrom: Tom Rini <[email protected]>
- 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.
---
(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(-)
arch/arm/mach-imx/cmd_nandbcb.c +2 -4
@@ -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",
board/freescale/common/ngpixis.c +2 -4
@@ -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 <SYSCLK_freq> - reset with SYSCLK frequency(KHz)\n" ; -#endif +"pixis_reset sysclk <SYSCLK_freq> - reset with SYSCLK frequency(KHz)\n" ); U_BOOT_CMD( pixis_reset, CONFIG_SYS_MAXARGS, 1, pixis_reset_cmd,
board/work-microwave/work_92105/work_92105_display.c +4 -8
@@ -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 <val> - send command <val> to driver;\n" "\thd44780 data <val> - send data <val> to driver;\n" -"\thd44780 str \"<text>\" - send \"<text>\" to driver." ; -#endif +"\thd44780 str \"<text>\" - send \"<text>\" to driver." ); U_BOOT_CMD( hd44780, 6, 1, do_hd44780,
board/xilinx/common/fru.c +2 -5
@@ -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 <addr> - 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 <addr> <manufacturer> <board name> <serial number>\n" " <part number> <revision> - Generate FRU format with\n" " board info area filled based on parameters. <addr> 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,
board/xilinx/versal/cmds.c +2 -5
@@ -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",
board/xilinx/zynq/cmds.c +2 -4
@@ -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 <baseaddr> - 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
board/xilinx/zynqmp/cmds.c +2 -4
@@ -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,
cmd/acpi.c +2 -4
@@ -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 [<addr>] - Set or show address of ACPI tables\n" -"acpi dump <name> - Dump ACPI table" ; -#endif +"acpi dump <name> - Dump ACPI table" ); U_BOOT_CMD_WITH_SUBCMDS(acpi, "ACPI tables", acpi_help_text, U_BOOT_SUBCMD_MKENT(list, 1, 1, do_acpi_list),
cmd/aes.c +2 -4
@@ -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,
cmd/armffa.c +2 -2
@@ -188,13 +188,13 @@ static int do_ffa_devlist(struct cmd_tbl *cmdtp, int flag, int argc, char *constreturn CMD_RET_SUCCESS ; } -static char armffa_help_text[] = +U_BOOT_LONGHELP (armffa,"getpart <partition UUID>\n" " - lists the partition(s) info\n" "ping <partition ID>\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),
cmd/axi.c +2 -2
@@ -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",
cmd/bloblist.c +2 -4
@@ -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),
cmd/bootcount.c +2 -7
@@ -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 );
cmd/bootdev.c +2 -4
@@ -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|<spec>] - use hunt drivers to find bootdevs\n" "bootdev select <bd> - 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),
cmd/bootefi.c +2 -4
@@ -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, "<image address>[:<image size>] [<fdt address>]\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 <fdt address> gets\n" " exposed as EFI configuration table.\n" #endif - ; -#endif + ); U_BOOT_CMD( bootefi, 4, 0, do_bootefi,
cmd/bootflow.c +4 -5
@@ -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] <param> [<value>] - update cmdline" ; + "bootflow cmdline [set|get|clear|delete|auto] <param> [<value>] - 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),
cmd/booti.c +2 -4
@@ -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,
cmd/bootm.c +2 -4
@@ -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,
cmd/bootmeth.c +2 -4
@@ -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 [<bd> ...] - select bootmeth order / subset to use" ; -#endif +"bootmeth order [<bd> ...] - 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),
cmd/bootz.c +2 -4
@@ -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,
cmd/cat.c +2 -4
@@ -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,"<interface> <dev[:part]> <file>\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",
cmd/cedit.c +2 -4
@@ -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 <interface> <dev[:part]> <filename> - load config editor\n" "cedit read_fdt <i/f> <dev[:part]> <filename> - read settings\n" "cedit write_fdt <i/f> <dev[:part]> <filename> - 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),
cmd/clk.c +2 -4
@@ -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);
cmd/conitrace.c +1 -3
@@ -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,
cmd/cpu.c +2 -5
@@ -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),
cmd/cyclic.c +2 -2
@@ -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 <cycletime_ms> <delay_us> - 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),
cmd/dm.c +2 -5
@@ -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),
cmd/efidebug.c +2 -4
@@ -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,
cmd/event.c +2 -4
@@ -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));
cmd/fdt.c +2 -4
@@ -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] <addr> [<size>] - Set the [control] fdt location to <addr>\n" #ifdef CONFIG_OF_LIBFDT_OVERLAY "fdt apply <addr> - 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,
cmd/font.c +2 -4
@@ -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 <name> [<size>] - select font to use\n" -"font size <size> - select font size to" ; -#endif +"font size <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),
cmd/help.c +4 -1
@@ -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'",
cmd/i2c.c +2 -4
@@ -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,
cmd/kaslrseed.c +2 -4
@@ -68,11 +68,9 @@ static int do_kaslr_seed(struct cmd_tbl *cmdtp, int flag, int argc, char *constreturn 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,
cmd/log.c +2 -5
@@ -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 [<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 <category> <level> <file> <line> <func> <message> - " -"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),
cmd/mp.c +2 -4
@@ -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,"<num> reset - Reset cpu <num>\n" "cpu status - Status of all cpus\n" "cpu <num> status - Status of cpu <num>\n"
@@ -86,8 +85,7 @@ static char cpu_help_text[] =" When cpu <num> 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,
cmd/mtd.c +2 -4
@@ -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] <name> <addr> [<off> [<size>]]\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),
cmd/mtdparts.c +2 -4
@@ -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[] ="<size> := standard linux memsize OR '-' to denote all remaining space\n" "<offset> := partition start offset within the device\n" "<name> := '(' NAME ')'\n" -"<ro-flag> := when set to 'ro' makes partition read-only (not used, passed to kernel)" ; -#endif + "<ro-flag> := when set to 'ro' makes partition read-only (not used, passed to kernel)"); U_BOOT_CMD( mtdparts, 6, 0, do_mtdparts,
cmd/mux.c +2 -2
@@ -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 <chip> <id> <state> - Select the given mux state\n" -"deselect <chip> <id> - Deselect the given mux and reset it to its idle state" ; +"deselect <chip> <id> - 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),
cmd/nand.c +2 -4
@@ -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,
cmd/nvedit.c +2 -4
@@ -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,
cmd/osd.c +2 -2
@@ -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,
cmd/pcap.c +2 -2
@@ -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<addr> <max_size>\n"
@@ -60,7 +60,7 @@ static char pcap_help_text[] ="With:\n" "\t<addr>: user address to which pcap will be stored (hexedcimal)\n" "\t<max_size>: 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),
cmd/pci.c +2 -4
@@ -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,
cmd/pci_mps.c +2 -4
@@ -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);
cmd/riscv/sbi.c +2 -5
@@ -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,
cmd/rng.c +2 -4
@@ -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,
cmd/sandbox/exception.c +2 -3
@@ -31,11 +31,10 @@ static struct cmd_tbl cmd_sub[] = { "", ""), }; -static char exception_help_text[] = +U_BOOT_LONGHELP (exception,"<ex>\n" " The following exceptions are available:\n" " undefined - undefined instruction\n" -" sigsegv - illegal memory access\n" - ; +" sigsegv - illegal memory access\n" );#include <exception.h>
cmd/scp03.c +4 -3
@@ -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));
cmd/sf.c +3 -5
@@ -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 );
cmd/source.c +4 -5
@@ -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 )"[<addr>][:[<image>]|#[<config>]]\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 "[<addr>]\n" -"\t- Run script starting at addr" ; -#endif +"\t- Run script starting at addr" #endif + ); U_BOOT_CMD( source, 2, 0, do_source,
cmd/ti/pd.c +5 -5
@@ -175,11 +175,11 @@ static int ti_do_pd(struct cmd_tbl *cmdtp, int flag, int argc, char * const argvreturn 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 );
cmd/vbe.c +2 -4
@@ -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),
cmd/wdt.c +2 -2
@@ -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 [<name>] - get/set current watchdog device\n" "wdt start <timeout ms> [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),
cmd/ximg.c +2 -4
@@ -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 <part> from legacy image at <addr> and copy to <dest>" #if defined(CONFIG_FIT)
@@ -267,8 +266,7 @@ static char imgextract_help_text[] ="addr uname [dest]\n" " - extract <uname> subimage from FIT image at <addr> and copy to <dest>" #endif -"" ; -#endif + ); U_BOOT_CMD( imxtract, 4, 1, do_imgextract,
cmd/xxd.c +2 -4
@@ -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,"<interface> <dev[:part]> <file>\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",
test/cmd_ut.c +2 -4
@@ -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] [<suite>] - run unit tests\n" " -r<runs> 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,
test/fuzz/cmd_fuzz.c +2 -5
@@ -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,
Signature · 1 line
2.42.0.609.gbb76f46606-goog
PATCH v2 3/27 buildman: Use oldconfig when adjusting the config
In reply to Simon GlassWe 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.
---
(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(-)
tools/buildman/builder.py +1 -1
@@ -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()
tools/buildman/builderthread.py +6 -0
@@ -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:
tools/buildman/func_test.py +3 -1
@@ -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
Signature · 1 line
2.42.0.609.gbb76f46606-goog
PATCH v2 4/27 bootstd: Correct dependencies on CMDLINE
In reply to Simon GlassWith 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.
---
(no changes since v1)
boot/Kconfig | 19 ++++++++++++------- lib/efi_loader/Kconfig | 1 + 2 files changed, 13 insertions(+), 7 deletions(-)
boot/Kconfig +12 -7
@@ -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
lib/efi_loader/Kconfig +1 -0
@@ -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
Signature · 1 line
2.42.0.609.gbb76f46606-goog
Re: [PATCH v2 04/27] bootstd: Correct dependencies on CMDLINE
Quoted 3 lines · Simon Glass
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.
How "recent" is this problem?
Signature · 1 line
Tom
Re: [PATCH v2 04/27] bootstd: Correct dependencies on CMDLINE
Hi Tom,
Quoted 8 lines · Tom Rini
Quoted 3 lines · Simon Glass
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.
How "recent" is this problem?
Over the last few years, I think. It was definitely in better shape 3-4 years ago.
I just realised that I sent your patches as part of my series, sorry.
Regards,
Simon
Re: [PATCH v2 04/27] bootstd: Correct dependencies on CMDLINE
Quoted 6 lines · Simon Glass
Hi Tom,
Quoted 3 lines · Tom Rini
On Sat, Oct 07, 2023 at 05:12:23PM -0600, Simon Glass wrote:
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
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.
How "recent" is this problem?
Over the last few years, I think. It was definitely in better shape 3-4 years ago.
OK, that makes a little more sense. But still, this is the wrong approach I think. I've got a little more specific feedback against v2, but I want to see things get unwound from CMDLINE that aren't specifically commands as they're things those other use cases you've described will also need to enable.
Signature · 1 line
Tom
PATCH v2 5/27 autoboot: Correct dependencies on CMDLINE
In reply to Simon GlassMake AUTOBOOT depend on CMDLINE since it is mostly meaningless without it.
---
Changes in v2:
- Move AUTOBOOT_USE_MENUKEY under AUTOBOOT
boot/Kconfig | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-)
boot/Kconfig +19 -10
@@ -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 <Enter> 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
Signature · 1 line
2.42.0.609.gbb76f46606-goog
Re: [PATCH v2 05/27] autoboot: Correct dependencies on CMDLINE
Quoted 3 lines · Simon Glass
Make AUTOBOOT depend on CMDLINE since it is mostly meaningless without it.
Signed-off-by Simon Glass <[email protected]>
Signature · 1 line
Tom
PATCH v2 6/27 cmd: Add a few more dependencies on CMDLINE
In reply to Simon GlassAdd this to some more commands to avoid build errors with sandbox.
---
(no changes since v1)
cmd/Kconfig | 6 ++++++ 1 file changed, 6 insertions(+)
cmd/Kconfig +6 -0
@@ -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
Signature · 1 line
2.42.0.609.gbb76f46606-goog
Re: [PATCH v2 06/27] cmd: Add a few more dependencies on CMDLINE
Quoted 15 lines · Simon Glass
Add this to some more commands to avoid build errors with sandbox.
Signed-off-by Simon Glass <[email protected]>---
(no changes since v1)
cmd/Kconfig | 6 ++++++ 1 file changed, 6 insertions(+)cmd/Kconfig +0
-0
cmd/Kconfig menu "Boot commands" · line 230
Quoted 7 lines
cmd/Kconfig +1
-0@@ -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.
This is the wrong direction. cmd/Kconfig needs to be re-organized to have a menu for the hush options, and then all of the commands should bee under a main commands menu that depends on CMDLINE.
Signature · 1 line
Tom
PATCH v2 7/27 test: Make UNIT_TEST depend on CMDLINE
In reply to Simon GlassMany 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.
---
(no changes since v1)
test/Kconfig | 1 + 1 file changed, 1 insertion(+)
test/Kconfig +1 -0
@@ -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.
Signature · 1 line
2.42.0.609.gbb76f46606-goog
Re: [PATCH v2 07/27] test: Make UNIT_TEST depend on CMDLINE
Quoted 7 lines · Simon Glass
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 <[email protected]>
Signature · 1 line
Tom
PATCH v2 8/27 sifive: Change #ifdef for nop
In reply to Simon GlassThis 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.
---
(no changes since v1)
include/k210/pll.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/k210/pll.h +1 -1
@@ -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
Signature · 1 line
2.42.0.609.gbb76f46606-goog
Re: [PATCH v2 08/27] sifive: Change #ifdef for nop
Quoted 19 lines · Simon Glass
This code is normally compiled for sifive, but sandbox can also compile it. We should not use
UNIT_TESTas a synonym for SANDBOX, since it is possible to disableUNIT_TESTfor sandbox.Correct the condition.
Signed-off-by Simon Glass <[email protected]>---
(no changes since v1)
include/k210/pll.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/k210/pll.h +0
-0
include/k210/pll.h struct k210_pll_config { · line 19
Quoted 8 lines
include/k210/pll.h +1
-1@@ -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
Sean just explained that this is wrong.
Signature · 1 line
Tom
PATCH v2 9/27 fastboot: Declare a dependency on CMDLINE
In reply to Simon GlassWhen CMDLINE is not enabled, this code fails to build. Correct this by adding a condition.
---
Changes in v2:
- Change this to use a Kconfig dependency instead of code failing
drivers/fastboot/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/fastboot/Kconfig +1 -0
@@ -2,6 +2,7 @@ menu "Fastboot support" config FASTBOOT bool + depends on CMDLINE imply ANDROID_BOOT_IMAGE imply CMD_FASTBOOT help
Signature · 1 line
2.42.0.609.gbb76f46606-goog
PATCH v2 10/27 cli: Always build cli_getch
In reply to Simon GlassThis 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.
---
(no changes since v1)
common/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
common/Makefile +2 -1
@@ -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
Signature · 1 line
2.42.0.609.gbb76f46606-goog
PATCH v2 11/27 cmd: Use an #ifdef around run_commandf()
In reply to Simon GlassThis is not available if CMDLINE is disabled, so add an #ifdef to correct this.
---
(no changes since v1)
common/cli.c | 2 ++ 1 file changed, 2 insertions(+)
common/cli.c +2 -0
@@ -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 */ /****************************************************************************/
Signature · 1 line
2.42.0.609.gbb76f46606-goog
PATCH v2 12/27 Move bootmenu_conv_key() into its own file
In reply to Simon GlassThis 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.
---
(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
common/Makefile +1 -1
@@ -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
common/cli_getch.c +1 -0
@@ -8,6 +8,7 @@#include <common.h> #include <cli.h> +#include <menu.h> /** * enum cli_esc_state_t - indicates what to do with an escape character
common/menu.c +0 -40
@@ -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) {
common/menu_key.c new file +49 -0
49 lines not on this page · raw message
Signature · 1 line
2.42.0.609.gbb76f46606-goog
PATCH v2 13/27 pxe: Depend on CMDLINE
In reply to Simon GlassWe cannot use PXE or sysboot commands without CONFIG_CMDLINE so add the required condition.
---
(no changes since v1)
cmd/Kconfig | 2 ++ 1 file changed, 2 insertions(+)
cmd/Kconfig +2 -0
@@ -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
Signature · 1 line
2.42.0.609.gbb76f46606-goog
PATCH v2 14/27 env: Split out non-command code into a new file
In reply to Simon GlassIt 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.
---
(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
cmd/Makefile +1 -1
@@ -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/
cmd/nvedit.c +4 -118
153 lines not on this page · raw message
env/Makefile +1 -0
@@ -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
env/env_set.c new file +132 -0
132 lines not on this page · raw message
include/env_internal.h +23 -0
@@ -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 <name> +* If <value> 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_ */
Signature · 1 line
2.42.0.609.gbb76f46606-goog
PATCH v2 15/27 console: Move SYS_PBSIZE into common/
In reply to Simon GlassThis relates to printing output and does not need a command line. Move it next to the other console-related options.
---
(no changes since v1)
cmd/Kconfig | 5 ----- common/Kconfig | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-)
cmd/Kconfig +0 -5
@@ -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
common/Kconfig +5 -0
@@ -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
Signature · 1 line
2.42.0.609.gbb76f46606-goog
PATCH v2 16/27 bootm: Allow building when cleanup functions are missing
In reply to Simon GlassThere are two cleanup functions needed during boot which depend onCMD_BOOTM: bootm_disable_interrupts() and board_quiesce_devices()
Provide static inline versions of these for when commands are not enabled.
---
(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(-)
arch/arm/lib/bootm.c +2 -0
@@ -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
boot/bootm.c +4 -6
@@ -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")
include/bootm.h +13 -2
@@ -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([email protected]>): 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
Signature · 1 line
2.42.0.609.gbb76f46606-goog
PATCH v2 17/27 fdt: Move working_fdt into fdt_support
In reply to Simon GlassThis 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.
---
(no changes since v1)
boot/fdt_support.c | 5 +++++ cmd/fdt.c | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-)
boot/fdt_support.c +5 -0
@@ -23,6 +23,11 @@#include <fdtdec.h> #include <version.h> +/* +* 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 *
cmd/fdt.c +0 -5
@@ -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;
Signature · 1 line
2.42.0.609.gbb76f46606-goog
PATCH v2 18/27 net: Depend on CONFIG_CMDLINE
In reply to Simon GlassAt present it isn't possible to use networking without the command line enabled. Add this as a condition.
---
(no changes since v1)
cmd/Kconfig | 1 + net/Kconfig | 1 + 2 files changed, 2 insertions(+)
cmd/Kconfig +1 -0
@@ -1687,6 +1687,7 @@ if NET menuconfig CMD_NET bool "Network commands" + depends on CMDLINE default y imply NETDEVICES
net/Kconfig +1 -0
@@ -4,6 +4,7 @@ menuconfig NET bool "Networking support" + depends on CMDLINE default y if NET
Signature · 1 line
2.42.0.609.gbb76f46606-goog
PATCH v2 19/27 log: Allow use without CONFIG_CMDLINE
In reply to Simon GlassWhen 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.
---
(no changes since v1)
common/log.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
common/log.c +2 -2
@@ -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);
Signature · 1 line
2.42.0.609.gbb76f46606-goog
PATCH v2 20/27 video: Allow use without CONFIG_CMDLINE
In reply to Simon GlassProvide a fallback for when CONFIG_SYS_CBSIZE is not provided, so that the console can still be used.
---
(no changes since v1)
drivers/video/console_truetype.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/video/console_truetype.c +4 -0
@@ -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
Signature · 1 line
2.42.0.609.gbb76f46606-goog
PATCH v2 21/27 video: Dont require the font command
In reply to Simon GlassWhile 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.
---
(no changes since v1)
drivers/video/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/Kconfig +1 -1
@@ -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.
Signature · 1 line
2.42.0.609.gbb76f46606-goog
PATCH v2 22/27 efi: Depend on CMDLINE for efi_loader
In reply to Simon GlassThis 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.
---
(no changes since v1)
lib/efi_loader/Kconfig | 1 + 1 file changed, 1 insertion(+)
lib/efi_loader/Kconfig +1 -0
@@ -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
Signature · 1 line
2.42.0.609.gbb76f46606-goog
Re: [PATCH v2 22/27] efi: Depend on CMDLINE for efi_loader
Hi Simon,
Quoted 3 lines · Simon Glass
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.
I a bit doubt this dependency.EFI_LOADER as library functions doesn't rely on command line support. What does is, as you mentioned, "bootefi bootmgr" command. So a more appropriate dependency would be
CMD_BOOTEFI_BOOTMGR
depends on CMDLINE
CMD_BOOTEFI
depends on CMDLINE
CMD_EFICONFIG
depends on CMD_BOOTEFI_BOOTMGR
# CMD_EFIDEBUG can compile without CMD_BOOTEFI_BOOTMGR.
# In my opinion, CMD_BOOTEFI_BOOTMGR should be split into cmd part
and library part.
-Takahiro Akashi
Quoted 23 lines
Signed-off-by Simon Glass <[email protected]>---
(no changes since v1)
lib/efi_loader/Kconfig | 1 + 1 file changed, 1 insertion(+)lib/efi_loader/Kconfig +1
-0@@ -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 driverSignature · 1 line
2.42.0.609.gbb76f46606-goog
PATCH v2 23/27 cmd: Make all commands depend on CMDLINE
In reply to Simon GlassIf 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.
---
(no changes since v1)
cmd/Kconfig | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-)
cmd/Kconfig +8 -21
@@ -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
Signature · 1 line
2.42.0.609.gbb76f46606-goog
PATCH v2 24/27 sandbox: Avoid requiring cmdline
In reply to Simon GlassUse 'imply' rather than 'select' for command-related options, so that it is possible to build sandbox without CONFIG_CMDLINE enabled.
---
(no changes since v1)
arch/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/Kconfig +3 -3
@@ -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"
Signature · 1 line
2.42.0.609.gbb76f46606-goog
PATCH v2 25/27 arm: x86: Drop discarding of command linker-lists
In reply to Simon GlassSince 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.
---
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(-)
arch/arm/cpu/u-boot.lds +0 -3
@@ -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
arch/x86/cpu/u-boot-64.lds +0 -4
@@ -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
arch/x86/cpu/u-boot-spl.lds +0 -4
@@ -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 : {
arch/x86/cpu/u-boot.lds +0 -4
@@ -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 = .;
Signature · 1 line
2.42.0.609.gbb76f46606-goog
PATCH v2 26/27 mmc: env: Unify the U_BOOT_ENV_LOCATION conditions
In reply to Simon GlassThe 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.
---
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(-)
env/mmc.c +1 -1
@@ -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
Signature · 1 line
2.42.0.609.gbb76f46606-goog
PATCH v2 27/27 sandbox: Add a test for disabling CONFIG_CMDLINE
In reply to Simon GlassNow that everything is working, add a test to make sure that this builds correctly.
---
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
test/py/tests/test_sandbox_opts.py new file +20 -0
@@ -0,0 +1,20 @@ +# SPDX-License-Identifier: GPL-2.0 +# Copyright 2022 Google LLC +# Written by Simon Glass <[email protected]> + +import pytest + +import u_boot_utils as util + +# This is needed for Azure, since the default '..' directory is not writeable +TMPDIR = '/tmp/test_cmdline' + [email protected] [email protected]('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])
Signature · 1 line
2.42.0.609.gbb76f46606-goog