cmd: Convert existing long help messages to the new macro
- 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 <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
diff --git a/board/freescale/common/ngpixis.c b/board/freescale/common/ngpixis.c
index 37a6f77..7be1cce 100644
--- a/board/freescale/common/ngpixis.c
+++ b/board/freescale/common/ngpixis.c
@@ -234,15 +234,13 @@
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,
diff --git a/board/freescale/common/sys_eeprom.c b/board/freescale/common/sys_eeprom.c
index 9363251..64139d4 100644
--- a/board/freescale/common/sys_eeprom.c
+++ b/board/freescale/common/sys_eeprom.c
@@ -624,8 +624,7 @@
}
#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"
@@ -642,12 +641,9 @@
"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);
diff --git a/board/sifive/unmatched/hifive-platform-i2c-eeprom.c b/board/sifive/unmatched/hifive-platform-i2c-eeprom.c
index 3c7ba4e..c82fb57 100644
--- a/board/sifive/unmatched/hifive-platform-i2c-eeprom.c
+++ b/board/sifive/unmatched/hifive-platform-i2c-eeprom.c
@@ -552,10 +552,7 @@
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"
@@ -564,14 +561,9 @@
"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);
diff --git a/board/starfive/visionfive2/visionfive2-i2c-eeprom.c b/board/starfive/visionfive2/visionfive2-i2c-eeprom.c
index dfeddf6..c36de1a 100644
--- a/board/starfive/visionfive2/visionfive2-i2c-eeprom.c
+++ b/board/starfive/visionfive2/visionfive2-i2c-eeprom.c
@@ -541,10 +541,7 @@
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"
@@ -564,14 +561,9 @@
"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);
diff --git a/board/work-microwave/work_92105/work_92105_display.c b/board/work-microwave/work_92105/work_92105_display.c
index 5f625e6..64dd5d4 100644
--- a/board/work-microwave/work_92105/work_92105_display.c
+++ b/board/work-microwave/work_92105/work_92105_display.c
@@ -293,12 +293,10 @@
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 @@
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,
diff --git a/board/xilinx/common/fru.c b/board/xilinx/common/fru.c
index f6ca46c..c916c3d 100644
--- a/board/xilinx/common/fru.c
+++ b/board/xilinx/common/fru.c
@@ -72,17 +72,14 @@
}
/***************************************************/
-#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,
diff --git a/board/xilinx/versal/cmds.c b/board/xilinx/versal/cmds.c
index 148fa51..9cc2cdc 100644
--- a/board/xilinx/versal/cmds.c
+++ b/board/xilinx/versal/cmds.c
@@ -91,12 +91,9 @@
return cmd_process_error(c, ret);
}
-#ifdef CONFIG_SYS_LONGHELP
-static char versal_help_text[] =
+U_BOOT_LONGHELP(versal,
"loadpdi addr len - Load pdi image\n"
- "load pdi image at ddr address 'addr' with pdi image size 'len'\n"
-;
-#endif
+ "load pdi image at ddr address 'addr' with pdi image size 'len'\n");
U_BOOT_CMD(versal, 4, 1, do_versal,
"versal sub-system",
diff --git a/board/xilinx/zynq/cmds.c b/board/xilinx/zynq/cmds.c
index 024fac6..d7c7b2f 100644
--- a/board/xilinx/zynq/cmds.c
+++ b/board/xilinx/zynq/cmds.c
@@ -527,8 +527,7 @@
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 @@
" if operation type is load or loadp, it loads the encrypted\n"
" full or partial bitstream on to PL respectively.\n"
#endif
- ;
-#endif
+ );
U_BOOT_CMD(zynq, 6, 0, do_zynq,
"Zynq specific commands", zynq_help_text
diff --git a/board/xilinx/zynqmp/cmds.c b/board/xilinx/zynqmp/cmds.c
index fadb0ed..f1f3eff 100644
--- a/board/xilinx/zynqmp/cmds.c
+++ b/board/xilinx/zynqmp/cmds.c
@@ -381,8 +381,7 @@
}
/***************************************************/
-#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 @@
" 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,