Commit 09140113 authored by Simon Glass's avatar Simon Glass Committed by Tom Rini
Browse files

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's avatarSimon Glass <sjg@chromium.org>
parent 691d719d
......@@ -5,6 +5,7 @@
#include <common.h>
#include <bootstage.h>
#include <env.h>
#include <image.h>
#include <irq_func.h>
#include <lmb.h>
......
......@@ -13,7 +13,7 @@ __weak void reset_cpu(ulong addr)
__builtin_arc_brk();
}
int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
printf("Resetting the board...\n");
......
......@@ -8,6 +8,7 @@
#include <common.h>
#include <clock_legacy.h>
#include <command.h>
#include <div64.h>
#include <init.h>
#include <net.h>
......@@ -379,8 +380,8 @@ u32 imx_get_fecclk(void)
}
#endif
int do_mx35_showclocks(cmd_tbl_t *cmdtp,
int flag, int argc, char * const argv[])
int do_mx35_showclocks(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
u32 cpufreq = get_mcu_main_clk();
printf("mx35 cpu clock: %dMHz\n", cpufreq / 1000000);
......
......@@ -10,6 +10,7 @@
*/
#include <common.h>
#include <command.h>
#include <cpu_func.h>
#include <hang.h>
#include <init.h>
......@@ -187,7 +188,8 @@ int print_cpuinfo(void)
}
#endif
int do_mx28_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
int do_mx28_showclocks(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
printf("CPU: %3d MHz\n", mxc_get_clock(MXC_ARM_CLK) / 1000000);
printf("BUS: %3d MHz\n", mxc_get_clock(MXC_AHB_CLK) / 1000000);
......
......@@ -5,6 +5,7 @@
*/
#include <common.h>
#include <command.h>
#include <init.h>
#include <asm/io.h>
#include <asm/arch/hardware.h>
......@@ -81,7 +82,7 @@ int print_cpuinfo(void)
#endif
#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_NAND_ECC_BCH) && defined(CONFIG_NAND_FSMC)
static int do_switch_ecc(cmd_tbl_t *cmdtp, int flag, int argc,
static int do_switch_ecc(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
if (argc != 2)
......
......@@ -182,7 +182,8 @@ static int write_mac(uchar *mac)
}
#endif
int do_chip_config(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
int do_chip_config(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
void (*sram_setfreq) (unsigned int, unsigned int);
unsigned int frequency;
......
......@@ -5,6 +5,7 @@
#include <common.h>
#include <clock_legacy.h>
#include <command.h>
#include <cpu_func.h>
#include <init.h>
#include <net.h>
......@@ -240,8 +241,8 @@ unsigned int mxc_get_clock(enum mxc_clock clk)
}
/* Dump some core clocks */
int do_vf610_showclocks(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
int do_vf610_showclocks(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
printf("\n");
printf("cpu clock : %8d MHz\n", mxc_get_clock(MXC_ARM_CLK) / 1000000);
......
......@@ -5,6 +5,7 @@
*/
#include <common.h>
#include <env.h>
#include <asm/io.h>
#include <linux/errno.h>
#include <asm/arch/fsl_serdes.h>
......
......@@ -260,7 +260,7 @@ int cpu_status(u32 nr)
return 0;
}
int cpu_release(u32 nr, int argc, char * const argv[])
int cpu_release(u32 nr, int argc, char *const argv[])
{
u64 boot_addr;
u64 *table = (u64 *)get_spin_tbl_addr();
......
......@@ -21,7 +21,7 @@
#define MXC_CLK32 32768
#endif
struct cmd_tbl_s;
struct cmd_tbl;
enum mxc_clock {
MXC_ARM_CLK = 0,
......@@ -82,6 +82,6 @@ void enable_thermal_clk(void);
void mxs_set_lcdclk(u32 base_addr, u32 freq);
void select_ldb_di_clock_source(enum ldb_di_clock clk);
void enable_eim_clk(unsigned char enable);
int do_mx6_showclocks(struct cmd_tbl_s *cmdtp, int flag, int argc,
int do_mx6_showclocks(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[]);
#endif /* __ASM_ARCH_CLOCK_H */
......@@ -422,7 +422,7 @@ static void boot_jump_linux(bootm_headers_t *images, int flag)
* DIFFERENCE: Instead of calling prep and go at the end
* they are called if subcommand is equal 0.
*/
int do_bootm_linux(int flag, int argc, char * const argv[],
int do_bootm_linux(int flag, int argc, char *const argv[],
bootm_headers_t *images)
{
/* No need for those on ARM */
......
......@@ -32,7 +32,7 @@
* instructions, otherwise a fault occurs."
*/
unsigned long do_go_exec(ulong (*entry)(int, char * const []),
int argc, char * const argv[])
int argc, char *const argv[])
{
ulong addr = (ulong)entry | 1;
entry = (void *)addr;
......
......@@ -21,6 +21,7 @@
*/
#include <common.h>
#include <command.h>
#include <cpu_func.h>
#include <irq_func.h>
......@@ -28,11 +29,11 @@ __weak void reset_misc(void)
{
}
int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
puts ("resetting ...\n");
udelay (50000); /* wait 50 ms */
mdelay(50); /* wait 50 ms */
disable_interrupts();
......
......@@ -13,6 +13,7 @@
*/
#include <common.h>
#include <command.h>
#include <env.h>
#define SYSOPEN 0x01
#define SYSCLOSE 0x02
......@@ -180,7 +181,8 @@ static int smh_load_file(const char * const name, ulong load_addr,
return 0;
}
static int do_smhload(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
static int do_smhload(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
if (argc == 3 || argc == 4) {
ulong load_addr;
......
......@@ -54,8 +54,8 @@ static int create_usage(char *dest)
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 @@ void add_board_boot_modes(const struct boot_mode *p)
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);
......
......@@ -54,7 +54,8 @@ static int blob_encap_dek(const u8 *src, u8 *dst, u32 len)
* 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;
......
......@@ -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;
......
......@@ -12,6 +12,7 @@
*/
#include <common.h>
#include <command.h>
#include <malloc.h>
#include <nand.h>
#include <dm/devres.h>
......@@ -1048,7 +1049,7 @@ err:
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 @@ static int do_nandbcb_init(int argc, char * const argv[])
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;
......
......@@ -4,6 +4,7 @@
*/
#include <common.h>
#include <command.h>
#include <config.h>
#include <fuse.h>
#include <mapmem.h>
......@@ -291,8 +292,8 @@ static int get_hab_status(void)
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 ulong get_image_ivt_offset(ulong img_addr)
}
}
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 @@ static int do_authenticate_image(cmd_tbl_t *cmdtp, int flag, int argc,
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 @@ static int do_hab_failsafe(cmd_tbl_t *cmdtp, int flag, int argc,
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 @@ static int do_hab_version(cmd_tbl_t *cmdtp, int flag, int argc,
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;
......
......@@ -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 @@ exit:
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 void display_ahab_auth_event(u32 event)
}
}
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 @@ static int confirm_close(void)
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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment