command: Remove the cmd_tbl_t typedef
We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.
Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.
This requires quite a few header-file additions.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/board/freescale/c29xpcie/cpld.c b/board/freescale/c29xpcie/cpld.c
index f57047d..b864a60 100644
--- a/board/freescale/c29xpcie/cpld.c
+++ b/board/freescale/c29xpcie/cpld.c
@@ -89,7 +89,7 @@
#endif
#ifndef CONFIG_SPL_BUILD
-int cpld_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int cpld_cmd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
int rc = 0;
unsigned char value;
diff --git a/board/freescale/common/cmd_esbc_validate.c b/board/freescale/common/cmd_esbc_validate.c
index 36b620c..638aa3c 100644
--- a/board/freescale/common/cmd_esbc_validate.c
+++ b/board/freescale/common/cmd_esbc_validate.c
@@ -8,8 +8,8 @@
#include <env.h>
#include <fsl_validate.h>
-int do_esbc_halt(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+int do_esbc_halt(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
if (fsl_check_boot_mode_secure() == 0) {
printf("Boot Mode is Non-Secure. Not entering spin loop.\n");
@@ -24,8 +24,8 @@
}
#ifndef CONFIG_SPL_BUILD
-static int do_esbc_validate(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_esbc_validate(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
char *hash_str = NULL;
uintptr_t haddr;
diff --git a/board/freescale/common/ngpixis.c b/board/freescale/common/ngpixis.c
index d725401..37a6f77 100644
--- a/board/freescale/common/ngpixis.c
+++ b/board/freescale/common/ngpixis.c
@@ -171,7 +171,8 @@
PIXIS_WRITE(sclk[2], sclk2);
}
-int pixis_reset_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int pixis_reset_cmd(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
unsigned int i;
unsigned long sysclk;
diff --git a/board/freescale/common/pixis.c b/board/freescale/common/pixis.c
index e9b7127..4127fbc 100644
--- a/board/freescale/common/pixis.c
+++ b/board/freescale/common/pixis.c
@@ -266,8 +266,8 @@
/* Disable the watchdog
*
*/
-static int pixis_disable_watchdog_cmd(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int pixis_disable_watchdog_cmd(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
/* Disable the VELA sequencer and the watchdog */
clrbits_8(pixis_base + PIXIS_VCTL, 9);
@@ -285,7 +285,8 @@
/* Enable or disable SGMII mode for a TSEC
*/
-static int pixis_set_sgmii(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int pixis_set_sgmii(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int which_tsec = -1;
unsigned char mask;
@@ -411,7 +412,8 @@
return intval + decval;
}
-static int pixis_reset_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int pixis_reset_cmd(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
unsigned int i;
char *p_cf = NULL;
diff --git a/board/freescale/common/qixis.c b/board/freescale/common/qixis.c
index dd1ee90..5912031 100644
--- a/board/freescale/common/qixis.c
+++ b/board/freescale/common/qixis.c
@@ -233,7 +233,8 @@
puts("Reverse engineering switch is not implemented for this board\n");
}
-static int qixis_reset_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int qixis_reset_cmd(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int i;
diff --git a/board/freescale/common/sys_eeprom.c b/board/freescale/common/sys_eeprom.c
index 71af645..b342105 100644
--- a/board/freescale/common/sys_eeprom.c
+++ b/board/freescale/common/sys_eeprom.c
@@ -383,7 +383,7 @@
update_crc();
}
-int do_mac(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_mac(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char cmd;
diff --git a/board/freescale/common/vid.c b/board/freescale/common/vid.c
index 2085247..dfc6a91 100644
--- a/board/freescale/common/vid.c
+++ b/board/freescale/common/vid.c
@@ -925,9 +925,9 @@
}
-static int do_vdd_override(cmd_tbl_t *cmdtp,
+static int do_vdd_override(struct cmd_tbl *cmdtp,
int flag, int argc,
- char * const argv[])
+ char *const argv[])
{
ulong override;
@@ -941,9 +941,8 @@
return 0;
}
-static int do_vdd_read(cmd_tbl_t *cmdtp,
- int flag, int argc,
- char * const argv[])
+static int do_vdd_read(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
if (argc < 1)
return CMD_RET_USAGE;
diff --git a/board/freescale/imx8mm_evk/imx8mm_evk.c b/board/freescale/imx8mm_evk/imx8mm_evk.c
index 1f95f3b..c43af9b 100644
--- a/board/freescale/imx8mm_evk/imx8mm_evk.c
+++ b/board/freescale/imx8mm_evk/imx8mm_evk.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <env.h>
#include <init.h>
#include <miiphy.h>
#include <netdev.h>
diff --git a/board/freescale/imx8mm_evk/spl.c b/board/freescale/imx8mm_evk/spl.c
index 3abf6be..42b637b 100644
--- a/board/freescale/imx8mm_evk/spl.c
+++ b/board/freescale/imx8mm_evk/spl.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <command.h>
#include <cpu_func.h>
#include <hang.h>
#include <image.h>
diff --git a/board/freescale/imx8mn_evk/imx8mn_evk.c b/board/freescale/imx8mn_evk/imx8mn_evk.c
index 8bd54ea..ea02bb7 100644
--- a/board/freescale/imx8mn_evk/imx8mn_evk.c
+++ b/board/freescale/imx8mn_evk/imx8mn_evk.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <env.h>
#include <init.h>
DECLARE_GLOBAL_DATA_PTR;
diff --git a/board/freescale/imx8mn_evk/spl.c b/board/freescale/imx8mn_evk/spl.c
index fae1f0c..486863e 100644
--- a/board/freescale/imx8mn_evk/spl.c
+++ b/board/freescale/imx8mn_evk/spl.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <command.h>
#include <cpu_func.h>
#include <hang.h>
#include <image.h>
diff --git a/board/freescale/imx8mp_evk/imx8mp_evk.c b/board/freescale/imx8mp_evk/imx8mp_evk.c
index aa5100f..97ba156 100644
--- a/board/freescale/imx8mp_evk/imx8mp_evk.c
+++ b/board/freescale/imx8mp_evk/imx8mp_evk.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <env.h>
#include <errno.h>
#include <init.h>
#include <asm/mach-imx/iomux-v3.h>
diff --git a/board/freescale/imx8mp_evk/spl.c b/board/freescale/imx8mp_evk/spl.c
index e84e470..e03c2c1 100644
--- a/board/freescale/imx8mp_evk/spl.c
+++ b/board/freescale/imx8mp_evk/spl.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <command.h>
#include <cpu_func.h>
#include <hang.h>
#include <image.h>
diff --git a/board/freescale/imxrt1020-evk/imxrt1020-evk.c b/board/freescale/imxrt1020-evk/imxrt1020-evk.c
index 06ad524..08f6ca9 100644
--- a/board/freescale/imxrt1020-evk/imxrt1020-evk.c
+++ b/board/freescale/imxrt1020-evk/imxrt1020-evk.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <dm.h>
+#include <init.h>
#include <ram.h>
#include <spl.h>
#include <asm/io.h>
diff --git a/board/freescale/ls1012ardb/ls1012ardb.c b/board/freescale/ls1012ardb/ls1012ardb.c
index fc929c4..5b814f7 100644
--- a/board/freescale/ls1012ardb/ls1012ardb.c
+++ b/board/freescale/ls1012ardb/ls1012ardb.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <command.h>
#include <fdt_support.h>
#include <hang.h>
#include <i2c.h>
@@ -394,8 +395,8 @@
return ret;
}
-static int flash_bank_cmd(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int flash_bank_cmd(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
if (argc != 2)
return CMD_RET_USAGE;
diff --git a/board/freescale/ls1021atwr/ls1021atwr.c b/board/freescale/ls1021atwr/ls1021atwr.c
index acf146d..c7f7baa 100644
--- a/board/freescale/ls1021atwr/ls1021atwr.c
+++ b/board/freescale/ls1021atwr/ls1021atwr.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <clock_legacy.h>
+#include <command.h>
#include <fdt_support.h>
#include <i2c.h>
#include <init.h>
@@ -612,8 +613,8 @@
cpld_data->system_rst = CONFIG_RESET;
}
-static int flash_bank_cmd(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int flash_bank_cmd(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
if (argc != 2)
return CMD_RET_USAGE;
@@ -633,8 +634,8 @@
"bank[0-upper bank/1-lower bank] (e.g. boot_bank 0)"
);
-static int cpld_reset_cmd(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int cpld_reset_cmd(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct cpld_data *cpld_data = (void *)(CONFIG_SYS_CPLD_BASE);
@@ -692,8 +693,8 @@
printf("B.\n");
}
-static int serdes_mux_cmd(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int serdes_mux_cmd(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
if (argc != 2)
return CMD_RET_USAGE;
diff --git a/board/freescale/ls1043ardb/cpld.c b/board/freescale/ls1043ardb/cpld.c
index 00c70b1..5d2e801 100644
--- a/board/freescale/ls1043ardb/cpld.c
+++ b/board/freescale/ls1043ardb/cpld.c
@@ -133,7 +133,7 @@
*value = rev_val;
}
-int do_cpld(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_cpld(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
int rc = 0;
diff --git a/board/freescale/ls1046ardb/cpld.c b/board/freescale/ls1046ardb/cpld.c
index a657519..548601a 100644
--- a/board/freescale/ls1046ardb/cpld.c
+++ b/board/freescale/ls1046ardb/cpld.c
@@ -129,7 +129,7 @@
*value = rev_val;
}
-int do_cpld(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_cpld(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
int rc = 0;
diff --git a/board/freescale/p1010rdb/p1010rdb.c b/board/freescale/p1010rdb/p1010rdb.c
index 1adc898..66ccc0b 100644
--- a/board/freescale/p1010rdb/p1010rdb.c
+++ b/board/freescale/p1010rdb/p1010rdb.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <command.h>
#include <image.h>
#include <init.h>
#include <net.h>
@@ -708,8 +709,8 @@
}
#ifndef CONFIG_SPL_BUILD
-static int pin_mux_cmd(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int pin_mux_cmd(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
if (argc < 2)
return CMD_RET_USAGE;
diff --git a/board/freescale/p2041rdb/cpld.c b/board/freescale/p2041rdb/cpld.c
index 3037ef8..b042fe3 100644
--- a/board/freescale/p2041rdb/cpld.c
+++ b/board/freescale/p2041rdb/cpld.c
@@ -87,7 +87,7 @@
}
#endif
-int cpld_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int cpld_cmd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
int rc = 0;
diff --git a/board/freescale/t102xrdb/cpld.c b/board/freescale/t102xrdb/cpld.c
index 2b640e0..47c3b16 100644
--- a/board/freescale/t102xrdb/cpld.c
+++ b/board/freescale/t102xrdb/cpld.c
@@ -72,7 +72,7 @@
putc('\n');
}
-int do_cpld(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_cpld(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
int rc = 0;
diff --git a/board/freescale/t102xrdb/t102xrdb.c b/board/freescale/t102xrdb/t102xrdb.c
index 983c723..754fcb0 100644
--- a/board/freescale/t102xrdb/t102xrdb.c
+++ b/board/freescale/t102xrdb/t102xrdb.c
@@ -368,8 +368,8 @@
return 0;
}
-static int switch_cmd(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int switch_cmd(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
if (argc < 2)
return CMD_RET_USAGE;
diff --git a/board/freescale/t104xrdb/cpld.c b/board/freescale/t104xrdb/cpld.c
index f9c8ab3..ac34095 100644
--- a/board/freescale/t104xrdb/cpld.c
+++ b/board/freescale/t104xrdb/cpld.c
@@ -82,7 +82,7 @@
}
#endif
-int do_cpld(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_cpld(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
int rc = 0;
diff --git a/board/freescale/t208xrdb/cpld.c b/board/freescale/t208xrdb/cpld.c
index 9a9b9d8..b9ba62a 100644
--- a/board/freescale/t208xrdb/cpld.c
+++ b/board/freescale/t208xrdb/cpld.c
@@ -43,7 +43,7 @@
CPLD_WRITE(reset_ctl, CPLD_LBMAP_RESET);
}
-int do_cpld(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_cpld(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
int rc = 0;
diff --git a/board/freescale/t4qds/t4240qds.c b/board/freescale/t4qds/t4240qds.c
index 0b00ec6..08ecf9a 100644
--- a/board/freescale/t4qds/t4240qds.c
+++ b/board/freescale/t4qds/t4240qds.c
@@ -902,9 +902,9 @@
}
}
-static int do_vdd_adjust(cmd_tbl_t *cmdtp,
+static int do_vdd_adjust(struct cmd_tbl *cmdtp,
int flag, int argc,
- char * const argv[])
+ char *const argv[])
{
ulong override;
diff --git a/board/freescale/t4rdb/cpld.c b/board/freescale/t4rdb/cpld.c
index 470b5f9..d484509 100644
--- a/board/freescale/t4rdb/cpld.c
+++ b/board/freescale/t4rdb/cpld.c
@@ -95,7 +95,7 @@
#endif
#ifndef CONFIG_SPL_BUILD
-int do_cpld(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_cpld(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
int rc = 0;