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/xilinx/common/board.c b/board/xilinx/common/board.c
index 294a59d..b8cdaaa 100644
--- a/board/xilinx/common/board.c
+++ b/board/xilinx/common/board.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <env.h>
 #include <asm/sections.h>
 #include <dm/uclass.h>
 #include <i2c.h>
diff --git a/board/xilinx/microblaze-generic/microblaze-generic.c b/board/xilinx/microblaze-generic/microblaze-generic.c
index 0e33f6a..0f81df3 100644
--- a/board/xilinx/microblaze-generic/microblaze-generic.c
+++ b/board/xilinx/microblaze-generic/microblaze-generic.c
@@ -12,6 +12,7 @@
 
 #include <common.h>
 #include <config.h>
+#include <env.h>
 #include <init.h>
 #include <dm/lists.h>
 #include <fdtdec.h>
diff --git a/board/xilinx/versal/board.c b/board/xilinx/versal/board.c
index 24cff0c..44cc65e 100644
--- a/board/xilinx/versal/board.c
+++ b/board/xilinx/versal/board.c
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <cpu_func.h>
+#include <env.h>
 #include <fdtdec.h>
 #include <init.h>
 #include <malloc.h>
diff --git a/board/xilinx/zynq/cmds.c b/board/xilinx/zynq/cmds.c
index 27d44b7..3358934 100644
--- a/board/xilinx/zynq/cmds.c
+++ b/board/xilinx/zynq/cmds.c
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <command.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/sys_proto.h>
@@ -408,8 +409,8 @@
 	return 0;
 }
 
-static int do_zynq_rsa(cmd_tbl_t *cmdtp, int flag, int argc,
-		       char * const argv[])
+static int do_zynq_rsa(struct cmd_tbl *cmdtp, int flag, int argc,
+		       char *const argv[])
 {
 	u32 src_ptr;
 	char *endp;
@@ -429,8 +430,8 @@
 #endif
 
 #ifdef CONFIG_CMD_ZYNQ_AES
-static int zynq_decrypt_image(cmd_tbl_t *cmdtp, int flag, int argc,
-			      char * const argv[])
+static int zynq_decrypt_image(struct cmd_tbl *cmdtp, int flag, int argc,
+			      char *const argv[])
 {
 	char *endp;
 	u32 srcaddr, srclen, dstaddr, dstlen;
@@ -469,7 +470,7 @@
 }
 #endif
 
-static cmd_tbl_t zynq_commands[] = {
+static struct cmd_tbl zynq_commands[] = {
 #ifdef CONFIG_CMD_ZYNQ_RSA
 	U_BOOT_CMD_MKENT(rsa, 3, 1, do_zynq_rsa, "", ""),
 #endif
@@ -478,9 +479,10 @@
 #endif
 };
 
-static int do_zynq(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_zynq(struct cmd_tbl *cmdtp, int flag, int argc,
+		   char *const argv[])
 {
-	cmd_tbl_t *zynq_cmd;
+	struct cmd_tbl *zynq_cmd;
 	int ret;
 
 	if (!ARRAY_SIZE(zynq_commands)) {
diff --git a/board/xilinx/zynqmp/cmds.c b/board/xilinx/zynqmp/cmds.c
index 893616b..0f1f269 100644
--- a/board/xilinx/zynqmp/cmds.c
+++ b/board/xilinx/zynqmp/cmds.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <command.h>
 #include <cpu_func.h>
 #include <env.h>
 #include <malloc.h>
@@ -13,8 +14,8 @@
 #include <asm/arch/sys_proto.h>
 #include <asm/io.h>
 
-static int do_zynqmp_verify_secure(cmd_tbl_t *cmdtp, int flag, int argc,
-				   char * const argv[])
+static int do_zynqmp_verify_secure(struct cmd_tbl *cmdtp, int flag, int argc,
+				   char *const argv[])
 {
 	u64 src_addr, addr;
 	u32 len, src_lo, src_hi;
@@ -65,8 +66,8 @@
 	return ret;
 }
 
-static int do_zynqmp_mmio_read(cmd_tbl_t *cmdtp, int flag, int argc,
-			       char * const argv[])
+static int do_zynqmp_mmio_read(struct cmd_tbl *cmdtp, int flag, int argc,
+			       char *const argv[])
 {
 	u32 read_val, addr;
 	int ret;
@@ -86,8 +87,8 @@
 	return ret;
 }
 
-static int do_zynqmp_mmio_write(cmd_tbl_t *cmdtp, int flag, int argc,
-				char * const argv[])
+static int do_zynqmp_mmio_write(struct cmd_tbl *cmdtp, int flag, int argc,
+				char *const argv[])
 {
 	u32 addr, mask, val;
 	int ret;
@@ -107,8 +108,8 @@
 }
 
 #ifdef CONFIG_DEFINE_TCM_OCM_MMAP
-static int do_zynqmp_tcm_init(cmd_tbl_t *cmdtp, int flag, int argc,
-			      char * const argv[])
+static int do_zynqmp_tcm_init(struct cmd_tbl *cmdtp, int flag, int argc,
+			      char *const argv[])
 {
 	u8 mode;
 
@@ -129,7 +130,7 @@
 }
 #endif
 
-static cmd_tbl_t cmd_zynqmp_sub[] = {
+static struct cmd_tbl cmd_zynqmp_sub[] = {
 	U_BOOT_CMD_MKENT(secure, 5, 0, do_zynqmp_verify_secure, "", ""),
 	U_BOOT_CMD_MKENT(mmio_read, 3, 0, do_zynqmp_mmio_read, "", ""),
 	U_BOOT_CMD_MKENT(mmio_write, 5, 0, do_zynqmp_mmio_write, "", ""),
@@ -149,10 +150,10 @@
  *
  * Return: return 0 on success and CMD_RET_USAGE incase of misuse and error
  */
-static int do_zynqmp(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_zynqmp(struct cmd_tbl *cmdtp, int flag, int argc,
 		     char *const argv[])
 {
-	cmd_tbl_t *c;
+	struct cmd_tbl *c;
 
 	if (argc < 2)
 		return CMD_RET_USAGE;
diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index 6aad135..7a8c745 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <command.h>
 #include <cpu_func.h>
 #include <debug_uart.h>
 #include <env.h>
@@ -415,7 +416,7 @@
 }
 
 unsigned long do_go_exec(ulong (*entry)(int, char * const []), int argc,
-			 char * const argv[])
+			 char *const argv[])
 {
 	int ret = 0;