Skip to content

Commit

Permalink
cmd: Convert existing long help messages to the new macro
Browse files Browse the repository at this point in the history
- 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 <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
  • Loading branch information
trini committed Oct 16, 2023
1 parent dec5777 commit 3616218
Show file tree
Hide file tree
Showing 61 changed files with 138 additions and 259 deletions.
6 changes: 2 additions & 4 deletions arch/arm/mach-imx/cmd_nandbcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1561,8 +1561,7 @@ static int do_nandbcb(struct cmd_tbl *cmdtp, int flag, int argc,
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"
Expand All @@ -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",
Expand Down
6 changes: 2 additions & 4 deletions board/freescale/common/ngpixis.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 3 additions & 7 deletions board/freescale/common/sys_eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,8 +624,7 @@ unsigned int get_cpu_board_revision(void)
}
#endif

#ifdef CONFIG_SYS_LONGHELP
static char booti_help_text[] =
U_BOOT_LONGHELP(mac,
"[read|save|id|num|errata|date|ports|port_number]\n"
"mac read\n"
" - read EEPROM content into memory data structure\n"
Expand All @@ -642,12 +641,9 @@ static char booti_help_text[] =
"mac ports N\n"
" - program the number of network ports to integer N\n"
"mac X string\n"
" - program MAC addr for port X [X=0,1..] to colon separated string";
#else
"";
#endif
" - program MAC addr for port X [X=0,1..] to colon separated string");

U_BOOT_CMD(
mac, 3, 1, do_mac,
"display and program the system ID and MAC addresses in EEPROM",
booti_help_text);
mac_help_text);
14 changes: 3 additions & 11 deletions board/sifive/unmatched/hifive-platform-i2c-eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,10 +552,7 @@ u8 get_pcb_revision_from_eeprom(void)
return be.pcb_revision;
}

#ifndef CONFIG_SPL_BUILD

#ifdef CONFIG_SYS_LONGHELP
static char booti_help_text[] =
U_BOOT_LONGHELP(mac,
"- displays memory copy of EEPROM\n"
"mac read_eeprom - reads EEPROM into memory\n"
"mac initialize - initializes memory copy with magic number\n"
Expand All @@ -564,14 +561,9 @@ static char booti_help_text[] =
"mac_address <addr> - sets MAC address in memory\n"
"mac pcb_revision <rev> - sets PCB revision in memory\n"
"mac bom_variant <var> - sets BOM variant in memory\n"
"mac bom_revision <rev> - sets BOM revision in memory\n";
#else
"";
#endif
"mac bom_revision <rev> - sets BOM revision in memory\n");

U_BOOT_CMD(
mac, 3, 1, do_mac,
"display and program the board revision and MAC address in EEPROM",
booti_help_text);

#endif /* CONFIG_SPL_BUILD */
mac_help_text);
14 changes: 3 additions & 11 deletions board/starfive/visionfive2/visionfive2-i2c-eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,10 +541,7 @@ u32 get_ddr_size_from_eeprom(void)
return hextoul(&pbuf.eeprom.atom1.data.pstr[14], NULL);
}

#ifndef CONFIG_SPL_BUILD

#ifdef CONFIG_SYS_LONGHELP
static char booti_help_text[] =
U_BOOT_LONGHELP(mac,
"\n"
" - display EEPROM content\n"
"mac read_eeprom\n"
Expand All @@ -564,14 +561,9 @@ static char booti_help_text[] =
"mac bom_revision <A>\n"
" - stores a StarFive BOM revision into the local EEPROM copy\n"
"mac product_id <VF7110A1-2228-D008E000-xxxxxxxx>\n"
" - stores a StarFive product ID into the local EEPROM copy\n";
#else
"";
#endif
" - stores a StarFive product ID into the local EEPROM copy\n");

U_BOOT_CMD(
mac, 3, 1, do_mac,
"display and program the board revision and MAC address in EEPROM",
booti_help_text);

#endif /* CONFIG_SPL_BUILD */
mac_help_text);
12 changes: 4 additions & 8 deletions board/work-microwave/work_92105/work_92105_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
7 changes: 2 additions & 5 deletions board/xilinx/common/fru.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 2 additions & 5 deletions board/xilinx/versal/cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 2 additions & 4 deletions board/xilinx/zynq/cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
6 changes: 2 additions & 4 deletions board/xilinx/zynqmp/cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 2 additions & 4 deletions cmd/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
6 changes: 2 additions & 4 deletions cmd/aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions cmd/armffa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <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),
Expand Down
4 changes: 2 additions & 2 deletions cmd/axi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 2 additions & 4 deletions cmd/bloblist.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
9 changes: 2 additions & 7 deletions cmd/bootcount.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
6 changes: 2 additions & 4 deletions cmd/bootdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
6 changes: 2 additions & 4 deletions cmd/bootefi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
9 changes: 4 additions & 5 deletions cmd/bootflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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),
Expand Down
Loading

0 comments on commit 3616218

Please sign in to comment.