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/arch/arm/mach-imx/cmd_bmode.c b/arch/arm/mach-imx/cmd_bmode.c
index 2d4d6efe..19bfd9f 100644
--- a/arch/arm/mach-imx/cmd_bmode.c
+++ b/arch/arm/mach-imx/cmd_bmode.c
@@ -54,8 +54,8 @@
return size;
}
-static int do_boot_mode(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_boot_mode(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
const struct boot_mode *p;
int reset_requested = 1;
@@ -87,7 +87,7 @@
int size;
char *dest;
- cmd_tbl_t *entry = ll_entry_get(cmd_tbl_t, bmode, cmd);
+ struct cmd_tbl *entry = ll_entry_get(struct cmd_tbl, bmode, cmd);
if (entry->usage) {
free(entry->usage);
diff --git a/arch/arm/mach-imx/cmd_dek.c b/arch/arm/mach-imx/cmd_dek.c
index 1b111ba..5f21d2b 100644
--- a/arch/arm/mach-imx/cmd_dek.c
+++ b/arch/arm/mach-imx/cmd_dek.c
@@ -54,7 +54,8 @@
* Returns zero on success, CMD_RET_USAGE in case of misuse and negative
* on error.
*/
-static int do_dek_blob(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+static int do_dek_blob(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
uint32_t src_addr, dst_addr, len;
uint8_t *src_ptr, *dst_ptr;
diff --git a/arch/arm/mach-imx/cmd_hdmidet.c b/arch/arm/mach-imx/cmd_hdmidet.c
index 6aa7d82..e2571ad 100644
--- a/arch/arm/mach-imx/cmd_hdmidet.c
+++ b/arch/arm/mach-imx/cmd_hdmidet.c
@@ -3,11 +3,13 @@
* Copyright (C) 2012 Boundary Devices Inc.
*/
#include <common.h>
+#include <command.h>
#include <asm/arch/imx-regs.h>
#include <asm/arch/mxc_hdmi.h>
#include <asm/io.h>
-static int do_hdmidet(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_hdmidet(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct hdmi_regs *hdmi = (struct hdmi_regs *)HDMI_ARB_BASE_ADDR;
return (readb(&hdmi->phy_stat0) & HDMI_DVI_STAT) ? 0 : 1;
diff --git a/arch/arm/mach-imx/cmd_nandbcb.c b/arch/arm/mach-imx/cmd_nandbcb.c
index 94cae14..cc4c890 100644
--- a/arch/arm/mach-imx/cmd_nandbcb.c
+++ b/arch/arm/mach-imx/cmd_nandbcb.c
@@ -12,6 +12,7 @@
*/
#include <common.h>
+#include <command.h>
#include <malloc.h>
#include <nand.h>
#include <dm/devres.h>
@@ -1048,7 +1049,7 @@
return ret;
}
-static int do_nandbcb_bcbonly(int argc, char * const argv[])
+static int do_nandbcb_bcbonly(int argc, char *const argv[])
{
struct fcb_block *fcb;
struct dbbt_block *dbbt;
@@ -1458,8 +1459,8 @@
return ret == 0 ? CMD_RET_SUCCESS : CMD_RET_FAILURE;
}
-static int do_nandbcb(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_nandbcb(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
const char *cmd;
int ret = 0;
diff --git a/arch/arm/mach-imx/hab.c b/arch/arm/mach-imx/hab.c
index 30db820..d0757d8 100644
--- a/arch/arm/mach-imx/hab.c
+++ b/arch/arm/mach-imx/hab.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <command.h>
#include <config.h>
#include <fuse.h>
#include <mapmem.h>
@@ -291,8 +292,8 @@
return 0;
}
-static int do_hab_status(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_hab_status(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
if ((argc != 1)) {
cmd_usage(cmdtp);
@@ -324,8 +325,8 @@
}
}
-static int do_authenticate_image(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_authenticate_image(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong addr, length, ivt_offset;
int rcode = 0;
@@ -349,8 +350,8 @@
return rcode;
}
-static int do_hab_failsafe(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_hab_failsafe(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
hab_rvt_failsafe_t *hab_rvt_failsafe;
@@ -365,8 +366,8 @@
return 0;
}
-static int do_hab_version(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_hab_version(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct hab_hdr *hdr = (struct hab_hdr *)HAB_RVT_BASE;
@@ -380,8 +381,8 @@
return 0;
}
-static int do_authenticate_image_or_failover(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_authenticate_image_or_failover(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
int ret = CMD_RET_FAILURE;
diff --git a/arch/arm/mach-imx/imx8/ahab.c b/arch/arm/mach-imx/imx8/ahab.c
index 6d25abe..6439447 100644
--- a/arch/arm/mach-imx/imx8/ahab.c
+++ b/arch/arm/mach-imx/imx8/ahab.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <command.h>
#include <errno.h>
#include <asm/io.h>
#include <asm/arch/sci/sci.h>
@@ -149,8 +150,8 @@
return ret;
}
-static int do_authenticate(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_authenticate(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong addr;
@@ -250,8 +251,8 @@
}
}
-static int do_ahab_status(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_ahab_status(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int err;
u8 idx = 0U;
@@ -297,8 +298,8 @@
return 0;
}
-static int do_ahab_close(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_ahab_close(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int err;
u16 lc;
diff --git a/arch/arm/mach-imx/imx8/snvs_security_sc.c b/arch/arm/mach-imx/imx8/snvs_security_sc.c
index 73f5651..564d1bf 100644
--- a/arch/arm/mach-imx/imx8/snvs_security_sc.c
+++ b/arch/arm/mach-imx/imx8/snvs_security_sc.c
@@ -626,7 +626,8 @@
"ALL values should be in hexadecimal format";
#define NB_REGISTERS 18
-static int do_snvs_cfg(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+static int do_snvs_cfg(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int err = 0;
u32 idx = 0;
@@ -677,7 +678,7 @@
"\n"
"ALL values should be in hexadecimal format";
-static int do_snvs_dgo_cfg(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_snvs_dgo_cfg(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
int err = 0;
@@ -713,7 +714,7 @@
"\n"
"ALL values should be in hexadecimal format";
-static int do_tamper_pin_cfg(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_tamper_pin_cfg(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
int err = 0;
@@ -748,8 +749,8 @@
"Write the status registers with the value provided,"
" clearing the status";
-static int do_snvs_clear_status(cmd_tbl_t *cmdtp, int flag, int argc,
- char *const argv[])
+static int do_snvs_clear_status(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int scierr = 0;
u32 idx = 0;
@@ -788,7 +789,7 @@
"snvs_sec_status\n"
"Display information about the security related to tamper and secvio";
-static int do_snvs_sec_status(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_snvs_sec_status(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
int scierr;
diff --git a/arch/arm/mach-imx/imx8m/clock_imx8mq.c b/arch/arm/mach-imx/imx8m/clock_imx8mq.c
index ee18cde..52205b0 100644
--- a/arch/arm/mach-imx/imx8m/clock_imx8mq.c
+++ b/arch/arm/mach-imx/imx8m/clock_imx8mq.c
@@ -6,6 +6,7 @@
*/
#include <common.h>
+#include <command.h>
#include <asm/arch/clock.h>
#include <asm/arch/imx-regs.h>
#include <asm/io.h>
@@ -755,8 +756,8 @@
* Dump some clockes.
*/
#ifndef CONFIG_SPL_BUILD
-static int do_imx8m_showclocks(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_imx8m_showclocks(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
u32 freq;
diff --git a/arch/arm/mach-imx/imx_bootaux.c b/arch/arm/mach-imx/imx_bootaux.c
index ec0da11..ca823e6 100644
--- a/arch/arm/mach-imx/imx_bootaux.c
+++ b/arch/arm/mach-imx/imx_bootaux.c
@@ -92,7 +92,8 @@
* The TCMUL is mapped to (M4_BOOTROM_BASE_ADDR) at A core side for
* accessing the M4 TCMUL.
*/
-static int do_bootaux(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_bootaux(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong addr;
int ret, up;
diff --git a/arch/arm/mach-imx/mx5/clock.c b/arch/arm/mach-imx/mx5/clock.c
index 2fabdd2..09c4c89 100644
--- a/arch/arm/mach-imx/mx5/clock.c
+++ b/arch/arm/mach-imx/mx5/clock.c
@@ -7,6 +7,7 @@
*/
#include <common.h>
+#include <command.h>
#include <asm/io.h>
#include <linux/errno.h>
#include <asm/arch/imx-regs.h>
@@ -943,7 +944,8 @@
/*
* Dump some core clockes.
*/
-static int do_mx5_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_mx5_showclocks(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
u32 freq;
diff --git a/arch/arm/mach-imx/mx6/clock.c b/arch/arm/mach-imx/mx6/clock.c
index 6a9e673..9f3d62f 100644
--- a/arch/arm/mach-imx/mx6/clock.c
+++ b/arch/arm/mach-imx/mx6/clock.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <command.h>
#include <div64.h>
#include <asm/io.h>
#include <linux/errno.h>
@@ -1305,7 +1306,8 @@
/*
* Dump some core clockes.
*/
-int do_mx6_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_mx6_showclocks(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
u32 freq;
freq = decode_pll(PLL_SYS, MXC_HCLK);
diff --git a/arch/arm/mach-imx/mx7/clock.c b/arch/arm/mach-imx/mx7/clock.c
index 75be4f8..f552037 100644
--- a/arch/arm/mach-imx/mx7/clock.c
+++ b/arch/arm/mach-imx/mx7/clock.c
@@ -8,6 +8,7 @@
#include <common.h>
#include <clock_legacy.h>
+#include <command.h>
#include <div64.h>
#include <asm/io.h>
#include <linux/errno.h>
@@ -1100,7 +1101,8 @@
/*
* Dump some core clockes.
*/
-int do_mx7_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_mx7_showclocks(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
u32 freq;
freq = decode_pll(PLL_CORE, MXC_HCLK);
diff --git a/arch/arm/mach-imx/mx7ulp/clock.c b/arch/arm/mach-imx/mx7ulp/clock.c
index 3c0bccc..a987ff2 100644
--- a/arch/arm/mach-imx/mx7ulp/clock.c
+++ b/arch/arm/mach-imx/mx7ulp/clock.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <clock_legacy.h>
+#include <command.h>
#include <div64.h>
#include <asm/io.h>
#include <errno.h>
@@ -329,7 +330,8 @@
/*
* Dump some core clockes.
*/
-int do_mx7_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_mx7_showclocks(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
u32 addr = 0;
u32 freq;