summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-05-19 10:51:43 -0400
committerTom Rini <trini@konsulko.com>2020-05-19 10:51:43 -0400
commitc2279d784e35fa25ee3a9fa28a74a1ba545f8c1e (patch)
tree158fd30f3d06142f6a99cbae6ed8ccb0f3be567b /cmd
parented9a3aa6452f57af65eb74f73bd2a54c3a2f4b03 (diff)
parentcd93d625fd751d55c729c78b10f82109d56a5f1d (diff)
downloadu-boot-c2279d784e35fa25ee3a9fa28a74a1ba545f8c1e.tar.gz
Merge branch '2020-05-18-reduce-size-of-common.h'WIP/19May2020
Bring in the latest round of Simon's changes to reduce what's in <common.h> overall.
Diffstat (limited to 'cmd')
-rw-r--r--cmd/ab_select.c9
-rw-r--r--cmd/abootimg.c32
-rw-r--r--cmd/acpi.c4
-rw-r--r--cmd/adc.c8
-rw-r--r--cmd/adtimg.c26
-rw-r--r--cmd/aes.c2
-rw-r--r--cmd/arm/exception.c14
-rw-r--r--cmd/arm/exception64.c6
-rw-r--r--cmd/armflash.c3
-rw-r--r--cmd/avb.c40
-rw-r--r--cmd/axi.c23
-rw-r--r--cmd/bcb.c36
-rw-r--r--cmd/bdinfo.c30
-rw-r--r--cmd/bedbug.c25
-rw-r--r--cmd/bind.c5
-rw-r--r--cmd/binop.c3
-rw-r--r--cmd/blk_common.c3
-rw-r--r--cmd/blkcache.c17
-rw-r--r--cmd/blob.c3
-rw-r--r--cmd/bmp.c13
-rw-r--r--cmd/boot.c4
-rw-r--r--cmd/bootcount.c16
-rw-r--r--cmd/bootefi.c4
-rw-r--r--cmd/booti.c7
-rw-r--r--cmd/bootm.c23
-rw-r--r--cmd/bootmenu.c4
-rw-r--r--cmd/bootstage.c20
-rw-r--r--cmd/bootz.c7
-rw-r--r--cmd/btrfs.c2
-rw-r--r--cmd/cache.c6
-rw-r--r--cmd/cbfs.c8
-rw-r--r--cmd/clk.c8
-rw-r--r--cmd/cls.c2
-rw-r--r--cmd/config.c3
-rw-r--r--cmd/conitrace.c5
-rw-r--r--cmd/console.c3
-rw-r--r--cmd/cpu.c12
-rw-r--r--cmd/cramfs.c5
-rw-r--r--cmd/cros_ec.c9
-rw-r--r--cmd/dataflash_mmc_mux.c3
-rw-r--r--cmd/date.c3
-rw-r--r--cmd/demo.c22
-rw-r--r--cmd/dfu.c3
-rw-r--r--cmd/diag.c2
-rw-r--r--cmd/disk.c6
-rw-r--r--cmd/dm.c22
-rw-r--r--cmd/echo.c3
-rw-r--r--cmd/eeprom.c5
-rw-r--r--cmd/efi.c10
-rw-r--r--cmd/efidebug.c71
-rw-r--r--cmd/elf.c8
-rw-r--r--cmd/ethsw.c6
-rw-r--r--cmd/exit.c3
-rw-r--r--cmd/ext2.c7
-rw-r--r--cmd/ext4.c10
-rw-r--r--cmd/fastboot.c4
-rw-r--r--cmd/fat.c29
-rw-r--r--cmd/fdt.c5
-rw-r--r--cmd/fitupd.c3
-rw-r--r--cmd/flash.c52
-rw-r--r--cmd/fpga.c43
-rw-r--r--cmd/fpgad.c2
-rw-r--r--cmd/fs.c23
-rw-r--r--cmd/fs_uuid.c4
-rw-r--r--cmd/fuse.c3
-rw-r--r--cmd/gettime.c4
-rw-r--r--cmd/gpio.c4
-rw-r--r--cmd/gpt.c23
-rw-r--r--cmd/hash.c3
-rw-r--r--cmd/help.c9
-rw-r--r--cmd/host.c37
-rw-r--r--cmd/i2c.c63
-rw-r--r--cmd/ide.c4
-rw-r--r--cmd/ini.c2
-rw-r--r--cmd/io.c4
-rw-r--r--cmd/iotrace.c6
-rw-r--r--cmd/irq.c6
-rw-r--r--cmd/itest.c3
-rw-r--r--cmd/jffs2.c10
-rw-r--r--cmd/led.c2
-rw-r--r--cmd/legacy_led.c2
-rw-r--r--cmd/license.c3
-rw-r--r--cmd/load.c13
-rw-r--r--cmd/log.c17
-rw-r--r--cmd/lzmadec.c3
-rw-r--r--cmd/mac.c3
-rw-r--r--cmd/md5sum.c6
-rw-r--r--cmd/mdio.c3
-rw-r--r--cmd/mem.c68
-rw-r--r--cmd/mfsl.c6
-rw-r--r--cmd/mii.c2
-rw-r--r--cmd/misc.c7
-rw-r--r--cmd/mmc.c113
-rw-r--r--cmd/mp.c2
-rw-r--r--cmd/mtd.c17
-rw-r--r--cmd/mtdparts.c8
-rw-r--r--cmd/mvebu/bubt.c4
-rw-r--r--cmd/nand.c13
-rw-r--r--cmd/net.c39
-rw-r--r--cmd/nvedit.c65
-rw-r--r--cmd/nvedit_efi.c13
-rw-r--r--cmd/nvme.c4
-rw-r--r--cmd/onenand.c33
-rw-r--r--cmd/osd.c27
-rw-r--r--cmd/part.c21
-rw-r--r--cmd/pcap.c20
-rw-r--r--cmd/pci.c3
-rw-r--r--cmd/pinmux.c17
-rw-r--r--cmd/pmc.c12
-rw-r--r--cmd/pmic.c23
-rw-r--r--cmd/pxe.c19
-rw-r--r--cmd/pxe_utils.c30
-rw-r--r--cmd/pxe_utils.h10
-rw-r--r--cmd/qfw.c19
-rw-r--r--cmd/read.c4
-rw-r--r--cmd/reginfo.c4
-rw-r--r--cmd/regulator.c35
-rw-r--r--cmd/reiser.c8
-rw-r--r--cmd/remoteproc.c14
-rw-r--r--cmd/riscv/exception.c6
-rw-r--r--cmd/rng.c2
-rw-r--r--cmd/rockusb.c3
-rw-r--r--cmd/sata.c4
-rw-r--r--cmd/sb.c13
-rw-r--r--cmd/scsi.c7
-rw-r--r--cmd/setexpr.c4
-rw-r--r--cmd/sf.c18
-rw-r--r--cmd/sha1sum.c2
-rw-r--r--cmd/smccc.c3
-rw-r--r--cmd/sound.c13
-rw-r--r--cmd/source.c14
-rw-r--r--cmd/spi.c2
-rw-r--r--cmd/spl.c17
-rw-r--r--cmd/strings.c2
-rw-r--r--cmd/sysboot.c12
-rw-r--r--cmd/terminal.c2
-rw-r--r--cmd/test.c10
-rw-r--r--cmd/thordown.c3
-rw-r--r--cmd/ti/ddr3.c6
-rw-r--r--cmd/time.c3
-rw-r--r--cmd/tlv_eeprom.c4
-rw-r--r--cmd/tpm-common.c10
-rw-r--r--cmd/tpm-user-utils.h9
-rw-r--r--cmd/tpm-v1.c85
-rw-r--r--cmd/tpm-v2.c43
-rw-r--r--cmd/tpm_test.c12
-rw-r--r--cmd/trace.c8
-rw-r--r--cmd/tsi148.c3
-rw-r--r--cmd/ubi.c2
-rw-r--r--cmd/ubifs.c18
-rw-r--r--cmd/ufs.c2
-rw-r--r--cmd/universe.c2
-rw-r--r--cmd/unlz4.c3
-rw-r--r--cmd/unzip.c8
-rw-r--r--cmd/usb.c7
-rw-r--r--cmd/usb_gadget_sdp.c3
-rw-r--r--cmd/usb_mass_storage.c10
-rw-r--r--cmd/version.c3
-rw-r--r--cmd/virtio.c4
-rw-r--r--cmd/w1.c2
-rw-r--r--cmd/wdt.c12
-rw-r--r--cmd/wol.c2
-rw-r--r--cmd/x86/exception.c6
-rw-r--r--cmd/x86/fsp.c8
-rw-r--r--cmd/x86/hob.c3
-rw-r--r--cmd/x86/mtrr.c6
-rw-r--r--cmd/ximg.c3
-rw-r--r--cmd/yaffs2.c28
-rw-r--r--cmd/zfs.c11
-rw-r--r--cmd/zip.c2
170 files changed, 1226 insertions, 931 deletions
diff --git a/cmd/ab_select.c b/cmd/ab_select.c
index 7c8f2ee8eb..6298fcfb60 100644
--- a/cmd/ab_select.c
+++ b/cmd/ab_select.c
@@ -3,15 +3,18 @@
* Copyright (C) 2017 The Android Open Source Project
*/
+#include <common.h>
#include <android_ab.h>
#include <command.h>
+#include <env.h>
+#include <part.h>
-static int do_ab_select(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_ab_select(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int ret;
struct blk_desc *dev_desc;
- disk_partition_t part_info;
+ struct disk_partition part_info;
char slot[2];
if (argc != 4)
diff --git a/cmd/abootimg.c b/cmd/abootimg.c
index 670bcb3aaa..40e8978f15 100644
--- a/cmd/abootimg.c
+++ b/cmd/abootimg.c
@@ -6,6 +6,8 @@
#include <android_image.h>
#include <common.h>
+#include <command.h>
+#include <image.h>
#include <mapmem.h>
#define abootimg_addr() \
@@ -14,7 +16,7 @@
/* Please use abootimg_addr() macro to obtain the boot image address */
static ulong _abootimg_addr = -1;
-static int abootimg_get_ver(int argc, char * const argv[])
+static int abootimg_get_ver(int argc, char *const argv[])
{
const struct andr_img_hdr *hdr;
int res = CMD_RET_SUCCESS;
@@ -39,7 +41,7 @@ exit:
return res;
}
-static int abootimg_get_recovery_dtbo(int argc, char * const argv[])
+static int abootimg_get_recovery_dtbo(int argc, char *const argv[])
{
ulong addr;
u32 size;
@@ -61,7 +63,7 @@ static int abootimg_get_recovery_dtbo(int argc, char * const argv[])
return CMD_RET_SUCCESS;
}
-static int abootimg_get_dtb_load_addr(int argc, char * const argv[])
+static int abootimg_get_dtb_load_addr(int argc, char *const argv[])
{
const struct andr_img_hdr *hdr;
int res = CMD_RET_SUCCESS;
@@ -92,7 +94,7 @@ exit:
return res;
}
-static int abootimg_get_dtb_by_index(int argc, char * const argv[])
+static int abootimg_get_dtb_by_index(int argc, char *const argv[])
{
const char *index_str;
u32 num;
@@ -139,7 +141,7 @@ static int abootimg_get_dtb_by_index(int argc, char * const argv[])
return CMD_RET_SUCCESS;
}
-static int abootimg_get_dtb(int argc, char * const argv[])
+static int abootimg_get_dtb(int argc, char *const argv[])
{
if (argc < 1)
return CMD_RET_USAGE;
@@ -150,8 +152,8 @@ static int abootimg_get_dtb(int argc, char * const argv[])
return CMD_RET_USAGE;
}
-static int do_abootimg_addr(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_abootimg_addr(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
char *endp;
ulong img_addr;
@@ -169,8 +171,8 @@ static int do_abootimg_addr(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_SUCCESS;
}
-static int do_abootimg_get(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_abootimg_get(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
const char *param;
@@ -192,8 +194,8 @@ static int do_abootimg_get(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_USAGE;
}
-static int do_abootimg_dump(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_abootimg_dump(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
if (argc != 2)
return CMD_RET_USAGE;
@@ -208,16 +210,16 @@ static int do_abootimg_dump(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_SUCCESS;
}
-static cmd_tbl_t cmd_abootimg_sub[] = {
+static struct cmd_tbl cmd_abootimg_sub[] = {
U_BOOT_CMD_MKENT(addr, 2, 1, do_abootimg_addr, "", ""),
U_BOOT_CMD_MKENT(dump, 2, 1, do_abootimg_dump, "", ""),
U_BOOT_CMD_MKENT(get, 5, 1, do_abootimg_get, "", ""),
};
-static int do_abootimg(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_abootimg(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
- cmd_tbl_t *cp;
+ struct cmd_tbl *cp;
cp = find_cmd_tbl(argv[1], cmd_abootimg_sub,
ARRAY_SIZE(cmd_abootimg_sub));
diff --git a/cmd/acpi.c b/cmd/acpi.c
index 203bd93bd5..e9a9161a91 100644
--- a/cmd/acpi.c
+++ b/cmd/acpi.c
@@ -137,7 +137,7 @@ static int list_rsdp(struct acpi_rsdp *rsdp)
return 0;
}
-static int do_acpi_list(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_acpi_list(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
struct acpi_rsdp *rsdp;
@@ -153,7 +153,7 @@ static int do_acpi_list(cmd_tbl_t *cmdtp, int flag, int argc,
return 0;
}
-static int do_acpi_dump(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_acpi_dump(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
const char *name;
diff --git a/cmd/adc.c b/cmd/adc.c
index 381961cf51..16f914a030 100644
--- a/cmd/adc.c
+++ b/cmd/adc.c
@@ -8,7 +8,7 @@
#include <dm.h>
#include <adc.h>
-static int do_adc_list(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_adc_list(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
struct udevice *dev;
@@ -31,7 +31,7 @@ static int do_adc_list(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_SUCCESS;
}
-static int do_adc_info(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_adc_info(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
struct udevice *dev;
@@ -68,7 +68,7 @@ static int do_adc_info(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_SUCCESS;
}
-static int do_adc_single(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_adc_single(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
struct udevice *dev;
@@ -95,7 +95,7 @@ static int do_adc_single(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_SUCCESS;
}
-static int do_adc_scan(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_adc_scan(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
struct adc_channel ch[ADC_MAX_CHANNEL];
diff --git a/cmd/adtimg.c b/cmd/adtimg.c
index 60bb01c349..aa943007f3 100644
--- a/cmd/adtimg.c
+++ b/cmd/adtimg.c
@@ -5,6 +5,7 @@
* Eugeniu Rosca <rosca.eugeniu@gmail.com>
*/
+#include <command.h>
#include <env.h>
#include <image-android-dt.h>
#include <common.h>
@@ -17,8 +18,8 @@
*/
static ulong working_img;
-static int do_adtimg_addr(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_adtimg_addr(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
char *endp;
ulong hdr_addr;
@@ -56,8 +57,8 @@ static int adtimg_check_working_img(void)
return CMD_RET_SUCCESS;
}
-static int do_adtimg_dump(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_adtimg_dump(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
if (argc != 1)
return CMD_RET_USAGE;
@@ -99,7 +100,7 @@ static int adtimg_getopt_u32(char * const opt, char * const name, u32 *optval)
return CMD_RET_SUCCESS;
}
-static int adtimg_getopt_index(int argc, char * const argv[], u32 *index,
+static int adtimg_getopt_index(int argc, char *const argv[], u32 *index,
char **avar, char **svar)
{
int ret;
@@ -124,7 +125,7 @@ static int adtimg_getopt_index(int argc, char * const argv[], u32 *index,
return CMD_RET_SUCCESS;
}
-static int adtimg_get_dt_by_index(int argc, char * const argv[])
+static int adtimg_get_dt_by_index(int argc, char *const argv[])
{
ulong addr;
u32 index, size;
@@ -163,7 +164,7 @@ static int adtimg_get_dt_by_index(int argc, char * const argv[])
return CMD_RET_SUCCESS;
}
-static int adtimg_get_dt(int argc, char * const argv[])
+static int adtimg_get_dt(int argc, char *const argv[])
{
if (argc < 2) {
printf("Error: No options passed to '%s'\n", argv[0]);
@@ -181,8 +182,8 @@ static int adtimg_get_dt(int argc, char * const argv[])
return CMD_RET_FAILURE;
}
-static int do_adtimg_get(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_adtimg_get(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
if (argc < 2) {
printf("Error: No arguments passed to '%s'\n", argv[0]);
@@ -203,15 +204,16 @@ static int do_adtimg_get(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_FAILURE;
}
-static cmd_tbl_t cmd_adtimg_sub[] = {
+static struct cmd_tbl cmd_adtimg_sub[] = {
U_BOOT_CMD_MKENT(addr, CONFIG_SYS_MAXARGS, 1, do_adtimg_addr, "", ""),
U_BOOT_CMD_MKENT(dump, CONFIG_SYS_MAXARGS, 1, do_adtimg_dump, "", ""),
U_BOOT_CMD_MKENT(get, CONFIG_SYS_MAXARGS, 1, do_adtimg_get, "", ""),
};
-static int do_adtimg(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_adtimg(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
- cmd_tbl_t *cp;
+ struct cmd_tbl *cp;
cp = find_cmd_tbl(argv[1], cmd_adtimg_sub, ARRAY_SIZE(cmd_adtimg_sub));
diff --git a/cmd/aes.c b/cmd/aes.c
index 8c5b42fd2c..4c0dad9932 100644
--- a/cmd/aes.c
+++ b/cmd/aes.c
@@ -35,7 +35,7 @@ u32 aes_get_key_len(char *command)
* Returns zero on success, CMD_RET_USAGE in case of misuse and negative
* on error.
*/
-static int do_aes(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+static int do_aes(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
uint32_t key_addr, iv_addr, src_addr, dst_addr, len;
uint8_t *key_ptr, *iv_ptr, *src_ptr, *dst_ptr;
diff --git a/cmd/arm/exception.c b/cmd/arm/exception.c
index 33bc75976f..522f6dff53 100644
--- a/cmd/arm/exception.c
+++ b/cmd/arm/exception.c
@@ -8,8 +8,8 @@
#include <common.h>
#include <command.h>
-static int do_unaligned(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_unaligned(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
/*
* The LDRD instruction requires the data source to be four byte aligned
@@ -23,15 +23,15 @@ static int do_unaligned(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_FAILURE;
}
-static int do_breakpoint(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_breakpoint(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
asm volatile ("BKPT #123\n");
return CMD_RET_FAILURE;
}
-static int do_undefined(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_undefined(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
/*
* 0xe7f...f. is undefined in ARM mode
@@ -41,7 +41,7 @@ static int do_undefined(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_FAILURE;
}
-static cmd_tbl_t cmd_sub[] = {
+static struct cmd_tbl cmd_sub[] = {
U_BOOT_CMD_MKENT(breakpoint, CONFIG_SYS_MAXARGS, 1, do_breakpoint,
"", ""),
U_BOOT_CMD_MKENT(unaligned, CONFIG_SYS_MAXARGS, 1, do_unaligned,
diff --git a/cmd/arm/exception64.c b/cmd/arm/exception64.c
index a363818532..d5de50a080 100644
--- a/cmd/arm/exception64.c
+++ b/cmd/arm/exception64.c
@@ -8,8 +8,8 @@
#include <common.h>
#include <command.h>
-static int do_undefined(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_undefined(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
/*
* 0xe7f...f. is undefined in ARM mode
@@ -19,7 +19,7 @@ static int do_undefined(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_FAILURE;
}
-static cmd_tbl_t cmd_sub[] = {
+static struct cmd_tbl cmd_sub[] = {
U_BOOT_CMD_MKENT(undefined, CONFIG_SYS_MAXARGS, 1, do_undefined,
"", ""),
};
diff --git a/cmd/armflash.c b/cmd/armflash.c
index 6872b0dde3..5e7315eb7c 100644
--- a/cmd/armflash.c
+++ b/cmd/armflash.c
@@ -8,6 +8,7 @@
#include <common.h>
#include <command.h>
#include <console.h>
+#include <flash.h>
#include <asm/io.h>
#define MAX_REGIONS 4
@@ -266,7 +267,7 @@ static int exists(const char * const name)
return CMD_RET_FAILURE;
}
-static int do_afs(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_afs(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
int ret = CMD_RET_SUCCESS;
diff --git a/cmd/avb.c b/cmd/avb.c
index a4de5c40a2..398ad3ba97 100644
--- a/cmd/avb.c
+++ b/cmd/avb.c
@@ -15,7 +15,7 @@
#define AVB_BOOTARGS "avb_bootargs"
static struct AvbOps *avb_ops;
-int do_avb_init(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_avb_init(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
unsigned long mmc_dev;
@@ -36,7 +36,8 @@ int do_avb_init(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return CMD_RET_FAILURE;
}
-int do_avb_read_part(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_avb_read_part(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
const char *part;
s64 offset;
@@ -68,7 +69,7 @@ int do_avb_read_part(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return CMD_RET_FAILURE;
}
-int do_avb_read_part_hex(cmd_tbl_t *cmdtp, int flag, int argc,
+int do_avb_read_part_hex(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
const char *part;
@@ -114,7 +115,8 @@ int do_avb_read_part_hex(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_FAILURE;
}
-int do_avb_write_part(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_avb_write_part(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
const char *part;
s64 offset;
@@ -145,7 +147,8 @@ int do_avb_write_part(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return CMD_RET_FAILURE;
}
-int do_avb_read_rb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_avb_read_rb(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
size_t index;
u64 rb_idx;
@@ -171,7 +174,8 @@ int do_avb_read_rb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return CMD_RET_FAILURE;
}
-int do_avb_write_rb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_avb_write_rb(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
size_t index;
u64 rb_idx;
@@ -196,8 +200,8 @@ int do_avb_write_rb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return CMD_RET_FAILURE;
}
-int do_avb_get_uuid(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+int do_avb_get_uuid(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
const char *part;
char buffer[UUID_STR_LEN + 1];
@@ -224,7 +228,7 @@ int do_avb_get_uuid(cmd_tbl_t *cmdtp, int flag,
return CMD_RET_FAILURE;
}
-int do_avb_verify_part(cmd_tbl_t *cmdtp, int flag,
+int do_avb_verify_part(struct cmd_tbl *cmdtp, int flag,
int argc, char *const argv[])
{
const char * const requested_partitions[] = {"boot", NULL};
@@ -315,8 +319,8 @@ int do_avb_verify_part(cmd_tbl_t *cmdtp, int flag,
return res;
}
-int do_avb_is_unlocked(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+int do_avb_is_unlocked(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
bool unlock;
@@ -341,8 +345,8 @@ int do_avb_is_unlocked(cmd_tbl_t *cmdtp, int flag,
return CMD_RET_FAILURE;
}
-int do_avb_read_pvalue(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+int do_avb_read_pvalue(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
const char *name;
size_t bytes;
@@ -382,8 +386,8 @@ int do_avb_read_pvalue(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_FAILURE;
}
-int do_avb_write_pvalue(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+int do_avb_write_pvalue(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
const char *name;
const char *value;
@@ -411,7 +415,7 @@ int do_avb_write_pvalue(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_FAILURE;
}
-static cmd_tbl_t cmd_avb[] = {
+static struct cmd_tbl cmd_avb[] = {
U_BOOT_CMD_MKENT(init, 2, 0, do_avb_init, "", ""),
U_BOOT_CMD_MKENT(read_rb, 2, 0, do_avb_read_rb, "", ""),
U_BOOT_CMD_MKENT(write_rb, 3, 0, do_avb_write_rb, "", ""),
@@ -427,9 +431,9 @@ static cmd_tbl_t cmd_avb[] = {
#endif
};
-static int do_avb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_avb(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
- cmd_tbl_t *cp;
+ struct cmd_tbl *cp;
cp = find_cmd_tbl(argv[1], cmd_avb, ARRAY_SIZE(cmd_avb));
diff --git a/cmd/axi.c b/cmd/axi.c
index 588098fddd..c9d53c049e 100644
--- a/cmd/axi.c
+++ b/cmd/axi.c
@@ -14,6 +14,7 @@
#include <command.h>
#include <console.h>
#include <dm.h>
+#include <log.h>
/* Currently selected AXI bus device */
static struct udevice *axi_cur_bus;
@@ -96,8 +97,8 @@ static int axi_get_cur_bus(struct udevice **busp)
* Command handlers
*/
-static int do_axi_show_bus(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_axi_show_bus(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *dummy;
@@ -135,8 +136,8 @@ static int do_axi_show_bus(cmd_tbl_t *cmdtp, int flag, int argc,
return 0;
}
-static int do_axi_bus_num(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_axi_bus_num(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int ret = 0;
int bus_no;
@@ -163,7 +164,8 @@ static int do_axi_bus_num(cmd_tbl_t *cmdtp, int flag, int argc,
return ret ? CMD_RET_FAILURE : 0;
}
-static int do_axi_md(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_axi_md(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
/* Print that many bytes per line */
const uint DISP_LINE_LEN = 16;
@@ -261,7 +263,8 @@ static int do_axi_md(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return 0;
}
-static int do_axi_mw(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_axi_mw(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
u32 writeval;
ulong addr, count, size;
@@ -312,17 +315,17 @@ static int do_axi_mw(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return 0;
}
-static cmd_tbl_t cmd_axi_sub[] = {
+static struct cmd_tbl cmd_axi_sub[] = {
U_BOOT_CMD_MKENT(bus, 1, 1, do_axi_show_bus, "", ""),
U_BOOT_CMD_MKENT(dev, 1, 1, do_axi_bus_num, "", ""),
U_BOOT_CMD_MKENT(md, 4, 1, do_axi_md, "", ""),
U_BOOT_CMD_MKENT(mw, 5, 1, do_axi_mw, "", ""),
};
-static int do_ihs_axi(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_ihs_axi(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/cmd/bcb.c b/cmd/bcb.c
index 9626f2c69e..e03218066b 100644
--- a/cmd/bcb.c
+++ b/cmd/bcb.c
@@ -8,6 +8,8 @@
#include <android_bootloader_message.h>
#include <command.h>
#include <common.h>
+#include <log.h>
+#include <part.h>
enum bcb_cmd {
BCB_CMD_LOAD,
@@ -108,11 +110,11 @@ static int bcb_field_get(char *name, char **fieldp, int *sizep)
return 0;
}
-static int do_bcb_load(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_bcb_load(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct blk_desc *desc;
- disk_partition_t info;
+ struct disk_partition info;
u64 cnt;
char *endp;
int part, ret;
@@ -161,8 +163,8 @@ err:
return CMD_RET_FAILURE;
}
-static int do_bcb_set(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_bcb_set(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int size, len;
char *field, *str, *found;
@@ -188,8 +190,8 @@ static int do_bcb_set(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_SUCCESS;
}
-static int do_bcb_clear(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_bcb_clear(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int size;
char *field;
@@ -207,8 +209,8 @@ static int do_bcb_clear(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_SUCCESS;
}
-static int do_bcb_test(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_bcb_test(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int size;
char *field;
@@ -234,8 +236,8 @@ static int do_bcb_test(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_FAILURE;
}
-static int do_bcb_dump(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_bcb_dump(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int size;
char *field;
@@ -248,11 +250,11 @@ static int do_bcb_dump(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_SUCCESS;
}
-static int do_bcb_store(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_bcb_store(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct blk_desc *desc;
- disk_partition_t info;
+ struct disk_partition info;
u64 cnt;
int ret;
@@ -280,7 +282,7 @@ err:
return CMD_RET_FAILURE;
}
-static cmd_tbl_t cmd_bcb_sub[] = {
+static struct cmd_tbl cmd_bcb_sub[] = {
U_BOOT_CMD_MKENT(load, CONFIG_SYS_MAXARGS, 1, do_bcb_load, "", ""),
U_BOOT_CMD_MKENT(set, CONFIG_SYS_MAXARGS, 1, do_bcb_set, "", ""),
U_BOOT_CMD_MKENT(clear, CONFIG_SYS_MAXARGS, 1, do_bcb_clear, "", ""),
@@ -289,9 +291,9 @@ static cmd_tbl_t cmd_bcb_sub[] = {
U_BOOT_CMD_MKENT(store, CONFIG_SYS_MAXARGS, 1, do_bcb_store, "", ""),
};
-static int do_bcb(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+static int do_bcb(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/cmd/bdinfo.c b/cmd/bdinfo.c
index 9edcf8d74e..dba552b03f 100644
--- a/cmd/bdinfo.c
+++ b/cmd/bdinfo.c
@@ -10,7 +10,9 @@
#include <common.h>
#include <command.h>
#include <env.h>
+#include <net.h>
#include <vsprintf.h>
+#include <asm/cache.h>
#include <linux/compiler.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -175,7 +177,7 @@ void __weak board_detail(void)
/* Please define board_detail() for your platform */
}
-int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
bd_t *bd = gd->bd;
@@ -220,7 +222,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#elif defined(CONFIG_NIOS2)
-int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
bd_t *bd = gd->bd;
@@ -241,7 +243,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#elif defined(CONFIG_MICROBLAZE)
-int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
bd_t *bd = gd->bd;
@@ -267,7 +269,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#elif defined(CONFIG_M68K)
-int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
bd_t *bd = gd->bd;
@@ -299,7 +301,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#elif defined(CONFIG_MIPS)
-int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
print_std_bdinfo(gd->bd);
print_num("relocaddr", gd->relocaddr);
@@ -311,8 +313,8 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#elif defined(CONFIG_ARM)
-static int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
bd_t *bd = gd->bd;
@@ -372,7 +374,7 @@ static int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc,
#elif defined(CONFIG_SH)
-int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
bd_t *bd = gd->bd;
@@ -387,7 +389,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#elif defined(CONFIG_X86)
-int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
bd_t *bd = gd->bd;
@@ -409,7 +411,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#elif defined(CONFIG_SANDBOX)
-int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
bd_t *bd = gd->bd;
@@ -427,7 +429,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#elif defined(CONFIG_NDS32)
-int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
bd_t *bd = gd->bd;
@@ -443,7 +445,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#elif defined(CONFIG_RISCV)
-int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
bd_t *bd = gd->bd;
@@ -460,7 +462,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#elif defined(CONFIG_ARC)
-int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
bd_t *bd = gd->bd;
@@ -474,7 +476,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#elif defined(CONFIG_XTENSA)
-int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
print_std_bdinfo(gd->bd);
return 0;
diff --git a/cmd/bedbug.c b/cmd/bedbug.c
index d3e31212ea..81ce256480 100644
--- a/cmd/bedbug.c
+++ b/cmd/bedbug.c
@@ -6,6 +6,7 @@
#include <cli.h>
#include <command.h>
#include <console.h>
+#include <asm/ptrace.h>
#include <linux/ctype.h>
#include <net.h>
#include <bedbug/type.h>
@@ -56,7 +57,8 @@ int bedbug_init(void)
* Entry point from the interpreter to the disassembler. Repeated calls
* will resume from the last disassembled address.
* ====================================================================== */
-int do_bedbug_dis (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+int do_bedbug_dis(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong addr; /* Address to start disassembly from */
ulong len; /* # of instructions to disassemble */
@@ -96,7 +98,8 @@ U_BOOT_CMD (ds, 3, 1, do_bedbug_dis,
* instructions in consecutive memory locations until a '.' (period) is
* entered on a line by itself.
* ====================================================================== */
-int do_bedbug_asm (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+int do_bedbug_asm(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
long mem_addr; /* Address to assemble into */
unsigned long instr; /* Machine code for text */
@@ -146,7 +149,8 @@ U_BOOT_CMD (as, 2, 0, do_bedbug_asm,
* CPU-specific break point set routine.
* ====================================================================== */
-int do_bedbug_break (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+int do_bedbug_break(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
/* -------------------------------------------------- */
if (bug_ctx.do_break)
@@ -242,7 +246,8 @@ void bedbug_main_loop (unsigned long addr, struct pt_regs *regs)
* stopped flag in the context so that the breakpoint routine will
* return.
* ====================================================================== */
-int do_bedbug_continue (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+int do_bedbug_continue(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
/* -------------------------------------------------- */
@@ -265,7 +270,8 @@ U_BOOT_CMD (continue, 1, 0, do_bedbug_continue,
* the address passes control to the CPU-specific set breakpoint routine
* for the current breakpoint number.
* ====================================================================== */
-int do_bedbug_step (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+int do_bedbug_step(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
unsigned long addr; /* Address to stop at */
@@ -296,7 +302,8 @@ U_BOOT_CMD (step, 1, 1, do_bedbug_step,
* the address passes control to the CPU-specific set breakpoint routine
* for the current breakpoint number.
* ====================================================================== */
-int do_bedbug_next (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+int do_bedbug_next(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
unsigned long addr; /* Address to stop at */
@@ -325,7 +332,8 @@ U_BOOT_CMD (next, 1, 1, do_bedbug_next,
* Interpreter command to print the current stack. This assumes an EABI
* architecture, so it starts with GPR R1 and works back up the stack.
* ====================================================================== */
-int do_bedbug_stack (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+int do_bedbug_stack(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
unsigned long sp; /* Stack pointer */
unsigned long func; /* LR from stack */
@@ -370,7 +378,8 @@ U_BOOT_CMD (where, 1, 1, do_bedbug_stack,
* Interpreter command to dump the registers. Calls the CPU-specific
* show registers routine.
* ====================================================================== */
-int do_bedbug_rdump (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+int do_bedbug_rdump(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
/* -------------------------------------------------- */
diff --git a/cmd/bind.c b/cmd/bind.c
index 44a5f17f0d..068b1399ab 100644
--- a/cmd/bind.c
+++ b/cmd/bind.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <command.h>
#include <dm.h>
#include <dm/device-internal.h>
#include <dm/lists.h>
@@ -194,8 +195,8 @@ static int unbind_by_node_path(const char *path)
return 0;
}
-static int do_bind_unbind(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_bind_unbind(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int ret = 0;
bool bind;
diff --git a/cmd/binop.c b/cmd/binop.c
index 6d2df5f3dd..c85cb51568 100644
--- a/cmd/binop.c
+++ b/cmd/binop.c
@@ -64,7 +64,8 @@ void write_to_mem(char *varname, u8 *result, ulong len)
unmap_sysmem(buf);
}
-static int do_binop(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_binop(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong len;
u8 *result, *src1, *src2;
diff --git a/cmd/blk_common.c b/cmd/blk_common.c
index cc6e161ba0..87f94b5abb 100644
--- a/cmd/blk_common.c
+++ b/cmd/blk_common.c
@@ -10,8 +10,9 @@
#include <common.h>
#include <blk.h>
+#include <command.h>
-int blk_common_cmd(int argc, char * const argv[], enum if_type if_type,
+int blk_common_cmd(int argc, char *const argv[], enum if_type if_type,
int *cur_devnump)
{
const char *if_name = blk_get_if_type_name(if_type);
diff --git a/cmd/blkcache.c b/cmd/blkcache.c
index 2cc65a9ee7..25f252e455 100644
--- a/cmd/blkcache.c
+++ b/cmd/blkcache.c
@@ -4,13 +4,14 @@
* Author: Eric Nelson<eric@nelint.com>
*
*/
+#include <command.h>
#include <config.h>
#include <common.h>
#include <malloc.h>
#include <part.h>
-static int blkc_show(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int blkc_show(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
struct block_cache_stats stats;
blkcache_stats(&stats);
@@ -25,8 +26,8 @@ static int blkc_show(cmd_tbl_t *cmdtp, int flag,
return 0;
}
-static int blkc_configure(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int blkc_configure(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
unsigned blocks_per_entry, max_entries;
if (argc != 3)
@@ -40,7 +41,7 @@ static int blkc_configure(cmd_tbl_t *cmdtp, int flag,
return 0;
}
-static cmd_tbl_t cmd_blkc_sub[] = {
+static struct cmd_tbl cmd_blkc_sub[] = {
U_BOOT_CMD_MKENT(show, 0, 0, blkc_show, "", ""),
U_BOOT_CMD_MKENT(configure, 3, 0, blkc_configure, "", ""),
};
@@ -55,10 +56,10 @@ static __maybe_unused void blkc_reloc(void)
};
}
-static int do_blkcache(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_blkcache(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
- cmd_tbl_t *c;
+ struct cmd_tbl *c;
#ifdef CONFIG_NEEDS_MANUAL_RELOC
blkc_reloc();
diff --git a/cmd/blob.c b/cmd/blob.c
index 80478b8802..c80e6977b4 100644
--- a/cmd/blob.c
+++ b/cmd/blob.c
@@ -48,7 +48,8 @@ __weak int blob_encap(u8 *key_mod, u8 *src, u8 *dst, u32 len)
* Returns zero on success, CMD_RET_USAGE in case of misuse and negative
* on error.
*/
-static int do_blob(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+static int do_blob(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong key_addr, src_addr, dst_addr, len;
uint8_t *km_ptr, *src_ptr, *dst_ptr;
diff --git a/cmd/bmp.c b/cmd/bmp.c
index edf4f56426..6040fa5d95 100644
--- a/cmd/bmp.c
+++ b/cmd/bmp.c
@@ -15,6 +15,7 @@
#include <gzip.h>
#include <image.h>
#include <lcd.h>
+#include <log.h>
#include <malloc.h>
#include <mapmem.h>
#include <splash.h>
@@ -91,7 +92,8 @@ struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp,
}
#endif
-static int do_bmp_info(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+static int do_bmp_info(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong addr;
@@ -109,7 +111,8 @@ static int do_bmp_info(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[
return (bmp_info(addr));
}
-static int do_bmp_display(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+static int do_bmp_display(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong addr;
int x = 0, y = 0;
@@ -141,7 +144,7 @@ static int do_bmp_display(cmd_tbl_t * cmdtp, int flag, int argc, char * const ar
return (bmp_display(addr, x, y));
}
-static cmd_tbl_t cmd_bmp_sub[] = {
+static struct cmd_tbl cmd_bmp_sub[] = {
U_BOOT_CMD_MKENT(info, 3, 0, do_bmp_info, "", ""),
U_BOOT_CMD_MKENT(display, 5, 0, do_bmp_display, "", ""),
};
@@ -162,9 +165,9 @@ void bmp_reloc(void) {
* Return: None
*
*/
-static int do_bmp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_bmp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
- cmd_tbl_t *c;
+ struct cmd_tbl *c;
/* Strip off leading 'bmp' command argument */
argc--;
diff --git a/cmd/boot.c b/cmd/boot.c
index 9150fce80b..36aba22b30 100644
--- a/cmd/boot.c
+++ b/cmd/boot.c
@@ -16,12 +16,12 @@
/* Allow ports to override the default behavior */
__attribute__((weak))
unsigned long do_go_exec(ulong (*entry)(int, char * const []), int argc,
- char * const argv[])
+ char *const argv[])
{
return entry (argc, argv);
}
-static int do_go(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_go(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
ulong addr, rc;
int rcode = 0;
diff --git a/cmd/bootcount.c b/cmd/bootcount.c
index c358418ebe..654bbb805c 100644
--- a/cmd/bootcount.c
+++ b/cmd/bootcount.c
@@ -4,15 +4,15 @@
#include <command.h>
#include <bootcount.h>
-static int do_bootcount_print(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_bootcount_print(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
printf("%lu\n", bootcount_load());
return CMD_RET_SUCCESS;
}
-static int do_bootcount_reset(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_bootcount_reset(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
/*
* note that we're explicitly not resetting the environment
@@ -22,15 +22,15 @@ static int do_bootcount_reset(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_SUCCESS;
}
-static cmd_tbl_t bootcount_sub[] = {
+static struct cmd_tbl bootcount_sub[] = {
U_BOOT_CMD_MKENT(print, 1, 1, do_bootcount_print, "", ""),
U_BOOT_CMD_MKENT(reset, 1, 1, do_bootcount_reset, "", ""),
};
-static int do_bootcount(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_bootcount(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
- cmd_tbl_t *cp;
+ struct cmd_tbl *cp;
if (argc < 2)
return CMD_RET_USAGE;
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 9849eb4f99..0f6d0f7750 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -13,6 +13,7 @@
#include <efi_selftest.h>
#include <env.h>
#include <errno.h>
+#include <image.h>
#include <malloc.h>
#include <linux/libfdt.h>
#include <linux/libfdt_env.h>
@@ -594,7 +595,8 @@ static int do_efi_selftest(void)
* @argv: command line arguments
* Return: status code
*/
-static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_bootefi(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
efi_status_t ret;
void *fdt;
diff --git a/cmd/booti.c b/cmd/booti.c
index 4fff8cfcf6..ae37975494 100644
--- a/cmd/booti.c
+++ b/cmd/booti.c
@@ -10,6 +10,7 @@
#include <image.h>
#include <irq_func.h>
#include <lmb.h>
+#include <log.h>
#include <mapmem.h>
#include <linux/kernel.h>
#include <linux/sizes.h>
@@ -18,8 +19,8 @@ DECLARE_GLOBAL_DATA_PTR;
/*
* Image booting support
*/
-static int booti_start(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[], bootm_headers_t *images)
+static int booti_start(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[], bootm_headers_t *images)
{
int ret;
ulong ld;
@@ -98,7 +99,7 @@ static int booti_start(cmd_tbl_t *cmdtp, int flag, int argc,
return 0;
}
-int do_booti(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_booti(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
int ret;
diff --git a/cmd/bootm.c b/cmd/bootm.c
index 931d53f0c7..d5f877cb54 100644
--- a/cmd/bootm.c
+++ b/cmd/bootm.c
@@ -34,12 +34,13 @@ extern flash_info_t flash_info[]; /* info for FLASH chips */
#endif
#if defined(CONFIG_CMD_IMLS) || defined(CONFIG_CMD_IMLS_NAND)
-static int do_imls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
+static int do_imls(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[]);
#endif
/* we overload the cmd field with our state machine info instead of a
* function pointer */
-static cmd_tbl_t cmd_bootm_sub[] = {
+static struct cmd_tbl cmd_bootm_sub[] = {
U_BOOT_CMD_MKENT(start, 0, 1, (void *)BOOTM_STATE_START, "", ""),
U_BOOT_CMD_MKENT(loados, 0, 1, (void *)BOOTM_STATE_LOADOS, "", ""),
#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
@@ -55,12 +56,12 @@ static cmd_tbl_t cmd_bootm_sub[] = {
U_BOOT_CMD_MKENT(go, 0, 1, (void *)BOOTM_STATE_OS_GO, "", ""),
};
-static int do_bootm_subcommand(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_bootm_subcommand(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int ret = 0;
long state;
- cmd_tbl_t *c;
+ struct cmd_tbl *c;
c = find_cmd_tbl(argv[0], &cmd_bootm_sub[0], ARRAY_SIZE(cmd_bootm_sub));
argc--; argv++;
@@ -89,7 +90,7 @@ static int do_bootm_subcommand(cmd_tbl_t *cmdtp, int flag, int argc,
/* bootm - boot application image from image in memory */
/*******************************************************************/
-int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_bootm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
#ifdef CONFIG_NEEDS_MANUAL_RELOC
static int relocated = 0;
@@ -136,7 +137,7 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
BOOTM_STATE_OS_GO, &images, 1);
}
-int bootm_maybe_autostart(cmd_tbl_t *cmdtp, const char *cmd)
+int bootm_maybe_autostart(struct cmd_tbl *cmdtp, const char *cmd)
{
const char *ep = env_get("autostart");
@@ -201,7 +202,7 @@ U_BOOT_CMD(
/* bootd - boot default image */
/*******************************************************************/
#if defined(CONFIG_CMD_BOOTD)
-int do_bootd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_bootd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
return run_command(env_get("bootcmd"), flag);
}
@@ -226,7 +227,8 @@ U_BOOT_CMD(
/* iminfo - print header info for a requested image */
/*******************************************************************/
#if defined(CONFIG_CMD_IMI)
-static int do_iminfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_iminfo(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int arg;
ulong addr;
@@ -519,7 +521,8 @@ static int do_imls_nand(void)
#endif
#if defined(CONFIG_CMD_IMLS) || defined(CONFIG_CMD_IMLS_NAND)
-static int do_imls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_imls(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int ret_nor = 0, ret_nand = 0;
diff --git a/cmd/bootmenu.c b/cmd/bootmenu.c
index 6af0617e65..18efe25751 100644
--- a/cmd/bootmenu.c
+++ b/cmd/bootmenu.c
@@ -7,9 +7,11 @@
#include <command.h>
#include <ansi.h>
#include <env.h>
+#include <log.h>
#include <menu.h>
#include <watchdog.h>
#include <malloc.h>
+#include <linux/delay.h>
#include <linux/string.h>
/* maximum bootmenu entries */
@@ -482,7 +484,7 @@ int menu_show(int bootdelay)
}
#endif
-int do_bootmenu(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_bootmenu(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char *delay_str = NULL;
int delay = 10;
diff --git a/cmd/bootstage.c b/cmd/bootstage.c
index ed0b0ff1fc..0e623f216b 100644
--- a/cmd/bootstage.c
+++ b/cmd/bootstage.c
@@ -4,16 +4,18 @@
*/
#include <common.h>
+#include <bootstage.h>
+#include <command.h>
-static int do_bootstage_report(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_bootstage_report(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
bootstage_report();
return 0;
}
-static int get_base_size(int argc, char * const argv[], ulong *basep,
+static int get_base_size(int argc, char *const argv[], ulong *basep,
ulong *sizep)
{
char *endp;
@@ -34,8 +36,8 @@ static int get_base_size(int argc, char * const argv[], ulong *basep,
return 0;
}
-static int do_bootstage_stash(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_bootstage_stash(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong base, size;
int ret;
@@ -57,7 +59,7 @@ static int do_bootstage_stash(cmd_tbl_t *cmdtp, int flag, int argc,
return 0;
}
-static cmd_tbl_t cmd_bootstage_sub[] = {
+static struct cmd_tbl cmd_bootstage_sub[] = {
U_BOOT_CMD_MKENT(report, 2, 1, do_bootstage_report, "", ""),
U_BOOT_CMD_MKENT(stash, 4, 0, do_bootstage_stash, "", ""),
U_BOOT_CMD_MKENT(unstash, 4, 0, do_bootstage_stash, "", ""),
@@ -66,10 +68,10 @@ static cmd_tbl_t cmd_bootstage_sub[] = {
/*
* Process a bootstage sub-command
*/
-static int do_boostage(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_boostage(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
- cmd_tbl_t *c;
+ struct cmd_tbl *c;
/* Strip off leading 'bootstage' command argument */
argc--;
diff --git a/cmd/bootz.c b/cmd/bootz.c
index f14a5fefbf..bc15fd8ec4 100644
--- a/cmd/bootz.c
+++ b/cmd/bootz.c
@@ -10,6 +10,7 @@
#include <image.h>
#include <irq_func.h>
#include <lmb.h>
+#include <log.h>
#include <linux/compiler.h>
int __weak bootz_setup(ulong image, ulong *start, ulong *end)
@@ -23,8 +24,8 @@ int __weak bootz_setup(ulong image, ulong *start, ulong *end)
/*
* zImage booting support
*/
-static int bootz_start(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[], bootm_headers_t *images)
+static int bootz_start(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[], bootm_headers_t *images)
{
int ret;
ulong zi_start, zi_end;
@@ -59,7 +60,7 @@ static int bootz_start(cmd_tbl_t *cmdtp, int flag, int argc,
return 0;
}
-int do_bootz(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_bootz(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
int ret;
diff --git a/cmd/btrfs.c b/cmd/btrfs.c
index faa1239cc8..7e3cbe12ce 100644
--- a/cmd/btrfs.c
+++ b/cmd/btrfs.c
@@ -8,7 +8,7 @@
#include <btrfs.h>
#include <fs.h>
-int do_btrsubvol(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_btrsubvol(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
if (argc != 3)
return CMD_RET_USAGE;
diff --git a/cmd/cache.c b/cmd/cache.c
index 7678615dd8..b68d45b98b 100644
--- a/cmd/cache.c
+++ b/cmd/cache.c
@@ -24,7 +24,8 @@ __weak void noncached_set_region(void)
{
}
-static int do_icache(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_icache(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
switch (argc) {
case 2: /* on / off / flush */
@@ -58,7 +59,8 @@ void __weak flush_dcache_all(void)
/* please define arch specific flush_dcache_all */
}
-static int do_dcache(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_dcache(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
switch (argc) {
case 2: /* on / off / flush */
diff --git a/cmd/cbfs.c b/cmd/cbfs.c
index 98e652a4e7..8e91d4bb8c 100644
--- a/cmd/cbfs.c
+++ b/cmd/cbfs.c
@@ -11,7 +11,7 @@
#include <env.h>
#include <cbfs.h>
-static int do_cbfs_init(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_cbfs_init(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
uintptr_t end_of_rom = 0xffffffff;
@@ -45,7 +45,7 @@ U_BOOT_CMD(
" CBFS is in. It defaults to 0xFFFFFFFF\n"
);
-static int do_cbfs_fsload(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_cbfs_fsload(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
const struct cbfs_cachenode *file;
@@ -92,7 +92,7 @@ U_BOOT_CMD(
" - load binary file 'filename' from the cbfs to address 'addr'\n"
);
-static int do_cbfs_ls(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_cbfs_ls(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
const struct cbfs_cachenode *file = file_cbfs_get_first();
@@ -201,7 +201,7 @@ U_BOOT_CMD(
" - list the files in the cbfs\n"
);
-static int do_cbfs_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_cbfs_fsinfo(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
const struct cbfs_header *header = file_cbfs_get_header();
diff --git a/cmd/clk.c b/cmd/clk.c
index 74ad868500..439736d072 100644
--- a/cmd/clk.c
+++ b/cmd/clk.c
@@ -72,7 +72,7 @@ int __weak soc_clk_dump(void)
}
#endif
-static int do_clk_dump(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_clk_dump(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
int ret;
@@ -86,14 +86,14 @@ static int do_clk_dump(cmd_tbl_t *cmdtp, int flag, int argc,
return ret;
}
-static cmd_tbl_t cmd_clk_sub[] = {
+static struct cmd_tbl cmd_clk_sub[] = {
U_BOOT_CMD_MKENT(dump, 1, 1, do_clk_dump, "", ""),
};
-static int do_clk(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_clk(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/cmd/cls.c b/cmd/cls.c
index f1ce6e8df1..eab4e6993b 100644
--- a/cmd/cls.c
+++ b/cmd/cls.c
@@ -11,7 +11,7 @@
#include <lcd.h>
#include <video.h>
-static int do_video_clear(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_video_clear(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
#if defined(CONFIG_DM_VIDEO)
diff --git a/cmd/config.c b/cmd/config.c
index d2810d573b..cf30841a35 100644
--- a/cmd/config.c
+++ b/cmd/config.c
@@ -11,7 +11,8 @@
#include "config_data_gz.h"
#include "config_data_size.h"
-static int do_config(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_config(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
char *dst;
unsigned long len = data_size;
diff --git a/cmd/conitrace.c b/cmd/conitrace.c
index 85c5422b7e..88850db541 100644
--- a/cmd/conitrace.c
+++ b/cmd/conitrace.c
@@ -7,9 +7,10 @@
*/
#include <common.h>
#include <command.h>
+#include <linux/delay.h>
-static int do_conitrace(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_conitrace(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
bool first = true;
diff --git a/cmd/console.c b/cmd/console.c
index 3f1d98b17b..9a1db83c7c 100644
--- a/cmd/console.c
+++ b/cmd/console.c
@@ -12,7 +12,8 @@
#include <stdio_dev.h>
extern void _do_coninfo (void);
-static int do_coninfo(cmd_tbl_t *cmd, int flag, int argc, char * const argv[])
+static int do_coninfo(struct cmd_tbl *cmd, int flag, int argc,
+ char *const argv[])
{
int l;
struct list_head *list = stdio_get_list();
diff --git a/cmd/cpu.c b/cmd/cpu.c
index 8c0abc1756..ff553c16c4 100644
--- a/cmd/cpu.c
+++ b/cmd/cpu.c
@@ -64,7 +64,7 @@ static int print_cpu_list(bool detail)
return 0;
}
-static int do_cpu_list(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_cpu_list(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
if (print_cpu_list(false))
@@ -73,7 +73,7 @@ static int do_cpu_list(cmd_tbl_t *cmdtp, int flag, int argc,
return 0;
}
-static int do_cpu_detail(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_cpu_detail(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
if (print_cpu_list(true))
@@ -82,7 +82,7 @@ static int do_cpu_detail(cmd_tbl_t *cmdtp, int flag, int argc,
return 0;
}
-static cmd_tbl_t cmd_cpu_sub[] = {
+static struct cmd_tbl cmd_cpu_sub[] = {
U_BOOT_CMD_MKENT(list, 2, 1, do_cpu_list, "", ""),
U_BOOT_CMD_MKENT(detail, 4, 0, do_cpu_detail, "", ""),
};
@@ -90,10 +90,10 @@ static cmd_tbl_t cmd_cpu_sub[] = {
/*
* Process a cpu sub-command
*/
-static int do_cpu(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_cpu(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
- cmd_tbl_t *c = NULL;
+ struct cmd_tbl *c = NULL;
/* Strip off leading 'cpu' command argument */
argc--;
diff --git a/cmd/cramfs.c b/cmd/cramfs.c
index ad232deae0..1aeb56702c 100644
--- a/cmd/cramfs.c
+++ b/cmd/cramfs.c
@@ -94,7 +94,8 @@ extern int cramfs_info (struct part_info *info);
* @param argv arguments list
* @return 0 on success, 1 otherwise
*/
-int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_cramfs_load(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
char *filename;
int size;
@@ -162,7 +163,7 @@ int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
* @param argv arguments list
* @return 0 on success, 1 otherwise
*/
-int do_cramfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_cramfs_ls(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char *filename = "/";
int ret;
diff --git a/cmd/cros_ec.c b/cmd/cros_ec.c
index 9e2f1b06f3..ce1f59a740 100644
--- a/cmd/cros_ec.c
+++ b/cmd/cros_ec.c
@@ -10,6 +10,8 @@
#include <command.h>
#include <cros_ec.h>
#include <dm.h>
+#include <flash.h>
+#include <log.h>
#include <dm/device-internal.h>
#include <dm/uclass-internal.h>
@@ -23,7 +25,7 @@ static const char * const ec_current_image_name[] = {"unknown", "RO", "RW"};
* @param argv List of remaining parameters
* @return flash region (EC_FLASH_REGION_...) or -1 on error
*/
-static int cros_ec_decode_region(int argc, char * const argv[])
+static int cros_ec_decode_region(int argc, char *const argv[])
{
if (argc > 0) {
if (0 == strcmp(*argv, "rw"))
@@ -50,7 +52,7 @@ static int cros_ec_decode_region(int argc, char * const argv[])
* (negative EC_RES_...)
*/
static int do_read_write(struct udevice *dev, int is_write, int argc,
- char * const argv[])
+ char *const argv[])
{
uint32_t offset, size = -1U, region_size;
unsigned long addr;
@@ -92,7 +94,8 @@ static int do_read_write(struct udevice *dev, int is_write, int argc,
return 0;
}
-static int do_cros_ec(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_cros_ec(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *dev;
const char *cmd;
diff --git a/cmd/dataflash_mmc_mux.c b/cmd/dataflash_mmc_mux.c
index 9f271b6f61..73876e9464 100644
--- a/cmd/dataflash_mmc_mux.c
+++ b/cmd/dataflash_mmc_mux.c
@@ -9,7 +9,8 @@
static int mmc_nspi (const char *);
-int do_dataflash_mmc_mux (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_dataflash_mmc_mux(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
switch (argc) {
case 2: /* on / off */
diff --git a/cmd/date.c b/cmd/date.c
index 7fa950a902..75a032cd27 100644
--- a/cmd/date.c
+++ b/cmd/date.c
@@ -29,7 +29,8 @@ int mk_date (const char *, struct rtc_time *);
static struct rtc_time default_tm = { 0, 0, 0, 1, 1, 2000, 6, 0, 0 };
-static int do_date(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_date(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct rtc_time tm;
int rcode = 0;
diff --git a/cmd/demo.c b/cmd/demo.c
index 52c6e7ec15..9da06f5e4d 100644
--- a/cmd/demo.c
+++ b/cmd/demo.c
@@ -7,14 +7,15 @@
*/
#include <common.h>
+#include <command.h>
#include <dm-demo.h>
#include <mapmem.h>
#include <asm/io.h>
struct udevice *demo_dev;
-static int do_demo_hello(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_demo_hello(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int ch = 0;
@@ -24,8 +25,8 @@ static int do_demo_hello(cmd_tbl_t *cmdtp, int flag, int argc,
return demo_hello(demo_dev, ch);
}
-static int do_demo_status(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_demo_status(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int status;
int ret;
@@ -39,8 +40,8 @@ static int do_demo_status(cmd_tbl_t *cmdtp, int flag, int argc,
return 0;
}
-static int do_demo_light(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_demo_light(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int light;
int ret;
@@ -59,7 +60,7 @@ static int do_demo_light(cmd_tbl_t *cmdtp, int flag, int argc,
return ret;
}
-int do_demo_list(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_demo_list(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
struct udevice *dev;
int i, ret;
@@ -78,16 +79,17 @@ int do_demo_list(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return cmd_process_error(cmdtp, ret);
}
-static cmd_tbl_t demo_commands[] = {
+static struct cmd_tbl demo_commands[] = {
U_BOOT_CMD_MKENT(list, 0, 1, do_demo_list, "", ""),
U_BOOT_CMD_MKENT(hello, 2, 1, do_demo_hello, "", ""),
U_BOOT_CMD_MKENT(light, 2, 1, do_demo_light, "", ""),
U_BOOT_CMD_MKENT(status, 1, 1, do_demo_status, "", ""),
};
-static int do_demo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_demo(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
- cmd_tbl_t *demo_cmd;
+ struct cmd_tbl *demo_cmd;
int devnum = 0;
int ret;
diff --git a/cmd/dfu.c b/cmd/dfu.c
index b30f8a5667..7310595a02 100644
--- a/cmd/dfu.c
+++ b/cmd/dfu.c
@@ -11,6 +11,7 @@
*/
#include <common.h>
+#include <command.h>
#include <watchdog.h>
#include <dfu.h>
#include <console.h>
@@ -18,7 +19,7 @@
#include <usb.h>
#include <net.h>
-static int do_dfu(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_dfu(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
if (argc < 2)
diff --git a/cmd/diag.c b/cmd/diag.c
index 8d21c7dde8..f51536dbfa 100644
--- a/cmd/diag.c
+++ b/cmd/diag.c
@@ -11,7 +11,7 @@
#include <command.h>
#include <post.h>
-int do_diag (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+int do_diag(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
unsigned int i;
diff --git a/cmd/disk.c b/cmd/disk.c
index 15973b7d13..8060e753eb 100644
--- a/cmd/disk.c
+++ b/cmd/disk.c
@@ -4,19 +4,21 @@
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*/
#include <common.h>
+#include <bootstage.h>
#include <command.h>
#include <cpu_func.h>
#include <image.h>
+#include <log.h>
#include <part.h>
-int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
+int common_diskboot(struct cmd_tbl *cmdtp, const char *intf, int argc,
char *const argv[])
{
__maybe_unused int dev;
int part;
ulong addr = CONFIG_SYS_LOAD_ADDR;
ulong cnt;
- disk_partition_t info;
+ struct disk_partition info;
#if defined(CONFIG_LEGACY_IMAGE_FORMAT)
image_header_t *hdr;
#endif
diff --git a/cmd/dm.c b/cmd/dm.c
index 7a90685f8b..4e307ac524 100644
--- a/cmd/dm.c
+++ b/cmd/dm.c
@@ -16,39 +16,39 @@
#include <dm/root.h>
#include <dm/util.h>
-static int do_dm_dump_all(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_dm_dump_all(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
dm_dump_all();
return 0;
}
-static int do_dm_dump_uclass(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_dm_dump_uclass(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
dm_dump_uclass();
return 0;
}
-static int do_dm_dump_devres(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_dm_dump_devres(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
dm_dump_devres();
return 0;
}
-static int do_dm_dump_drivers(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_dm_dump_drivers(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
dm_dump_drivers();
return 0;
}
-static cmd_tbl_t test_commands[] = {
+static struct cmd_tbl test_commands[] = {
U_BOOT_CMD_MKENT(tree, 0, 1, do_dm_dump_all, "", ""),
U_BOOT_CMD_MKENT(uclass, 1, 1, do_dm_dump_uclass, "", ""),
U_BOOT_CMD_MKENT(devres, 1, 1, do_dm_dump_devres, "", ""),
@@ -65,9 +65,9 @@ static __maybe_unused void dm_reloc(void)
}
}
-static int do_dm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_dm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
- cmd_tbl_t *test_cmd;
+ struct cmd_tbl *test_cmd;
int ret;
#ifdef CONFIG_NEEDS_MANUAL_RELOC
diff --git a/cmd/echo.c b/cmd/echo.c
index 5b018d9349..d02a4cfd58 100644
--- a/cmd/echo.c
+++ b/cmd/echo.c
@@ -7,7 +7,8 @@
#include <common.h>
#include <command.h>
-static int do_echo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_echo(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int i;
int putnl = 1;
diff --git a/cmd/eeprom.c b/cmd/eeprom.c
index 792415ef93..7fa62bba8f 100644
--- a/cmd/eeprom.c
+++ b/cmd/eeprom.c
@@ -25,6 +25,7 @@
#include <eeprom.h>
#include <i2c.h>
#include <eeprom_layout.h>
+#include <linux/delay.h>
#ifndef CONFIG_SYS_I2C_SPEED
#define CONFIG_SYS_I2C_SPEED 50000
@@ -237,7 +238,7 @@ static int parse_numeric_param(char *str)
* @returns: number of arguments parsed or CMD_RET_USAGE if error
*/
static int parse_i2c_bus_addr(int *i2c_bus, ulong *i2c_addr, int argc,
- char * const argv[], int argc_no_bus_addr)
+ char *const argv[], int argc_no_bus_addr)
{
int argc_no_bus = argc_no_bus_addr + 1;
int argc_bus_addr = argc_no_bus_addr + 2;
@@ -355,7 +356,7 @@ static int eeprom_execute_command(enum eeprom_action action, int i2c_bus,
}
#define NEXT_PARAM(argc, index) { (argc)--; (index)++; }
-int do_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_eeprom(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
int layout_ver = LAYOUT_VERSION_AUTODETECT;
enum eeprom_action action = EEPROM_ACTION_INVALID;
diff --git a/cmd/efi.c b/cmd/efi.c
index ea239a01f0..9aeb913ff3 100644
--- a/cmd/efi.c
+++ b/cmd/efi.c
@@ -8,6 +8,7 @@
#include <command.h>
#include <efi.h>
#include <errno.h>
+#include <log.h>
#include <malloc.h>
#include <sort.h>
@@ -191,7 +192,8 @@ static void efi_print_mem_table(struct efi_entry_memmap *map,
printf("*Some areas are merged (use 'all' to see)\n");
}
-static int do_efi_mem(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_efi_mem(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct efi_mem_desc *desc;
struct efi_entry_memmap *map;
@@ -231,13 +233,13 @@ done:
return ret ? CMD_RET_FAILURE : 0;
}
-static cmd_tbl_t efi_commands[] = {
+static struct cmd_tbl efi_commands[] = {
U_BOOT_CMD_MKENT(mem, 1, 1, do_efi_mem, "", ""),
};
-static int do_efi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_efi(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
- cmd_tbl_t *efi_cmd;
+ struct cmd_tbl *efi_cmd;
int ret;
if (argc < 2)
diff --git a/cmd/efidebug.c b/cmd/efidebug.c
index f020d95dbb..703dab0c20 100644
--- a/cmd/efidebug.c
+++ b/cmd/efidebug.c
@@ -11,6 +11,7 @@
#include <efi_loader.h>
#include <exports.h>
#include <hexdump.h>
+#include <log.h>
#include <malloc.h>
#include <mapmem.h>
#include <search.h>
@@ -60,8 +61,8 @@ static const char sep[] = "================";
* Implement efidebug "devices" sub-command.
* Show all UEFI devices and their information.
*/
-static int do_efi_show_devices(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_efi_show_devices(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
efi_handle_t *handles;
efi_uintn_t num, i;
@@ -139,8 +140,8 @@ static int efi_get_driver_handle_info(efi_handle_t handle, u16 **driver_name,
* Implement efidebug "drivers" sub-command.
* Show all UEFI drivers and their information.
*/
-static int do_efi_show_drivers(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_efi_show_drivers(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
efi_handle_t *handles;
efi_uintn_t num, i;
@@ -311,8 +312,8 @@ static const char *get_guid_text(const void *guid)
* Show all UEFI handles and their information, currently all protocols
* added to handle.
*/
-static int do_efi_show_handles(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_efi_show_handles(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
efi_handle_t *handles;
efi_guid_t **guid;
@@ -371,8 +372,8 @@ static int do_efi_show_handles(cmd_tbl_t *cmdtp, int flag,
* Implement efidebug "images" sub-command.
* Show all UEFI loaded images and their information.
*/
-static int do_efi_show_images(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_efi_show_images(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
efi_print_image_infos(NULL);
@@ -453,8 +454,8 @@ static void print_memory_attributes(u64 attributes)
* Implement efidebug "memmap" sub-command.
* Show UEFI memory map.
*/
-static int do_efi_show_memmap(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_efi_show_memmap(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
struct efi_mem_desc *memmap = NULL, *map;
efi_uintn_t map_size = 0;
@@ -521,8 +522,8 @@ static int do_efi_show_memmap(cmd_tbl_t *cmdtp, int flag,
* Implement efidebug "tables" sub-command.
* Show UEFI configuration tables.
*/
-static int do_efi_show_tables(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_efi_show_tables(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
efi_uintn_t i;
const char *guid_str;
@@ -551,8 +552,8 @@ static int do_efi_show_tables(cmd_tbl_t *cmdtp, int flag,
*
* efidebug boot add <id> <label> <interface> <devnum>[:<part>] <file> <options>
*/
-static int do_efi_boot_add(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_efi_boot_add(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
int id;
char *endp;
@@ -650,8 +651,8 @@ out:
*
* efidebug boot rm <id> ...
*/
-static int do_efi_boot_rm(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_efi_boot_rm(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
efi_guid_t guid;
int id, i;
@@ -787,8 +788,8 @@ static int u16_tohex(u16 c)
*
* efidebug boot dump
*/
-static int do_efi_boot_dump(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_efi_boot_dump(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
u16 *var_name16, *p;
efi_uintn_t buf_size, size;
@@ -956,8 +957,8 @@ out:
*
* efidebug boot next <id>
*/
-static int do_efi_boot_next(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_efi_boot_next(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
u16 bootnext;
efi_uintn_t size;
@@ -1005,8 +1006,8 @@ out:
*
* efidebug boot order [<id> ...]
*/
-static int do_efi_boot_order(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_efi_boot_order(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
u16 *bootorder = NULL;
efi_uintn_t size;
@@ -1054,7 +1055,7 @@ out:
return r;
}
-static cmd_tbl_t cmd_efidebug_boot_sub[] = {
+static struct cmd_tbl cmd_efidebug_boot_sub[] = {
U_BOOT_CMD_MKENT(add, CONFIG_SYS_MAXARGS, 1, do_efi_boot_add, "", ""),
U_BOOT_CMD_MKENT(rm, CONFIG_SYS_MAXARGS, 1, do_efi_boot_rm, "", ""),
U_BOOT_CMD_MKENT(dump, CONFIG_SYS_MAXARGS, 1, do_efi_boot_dump, "", ""),
@@ -1075,10 +1076,10 @@ static cmd_tbl_t cmd_efidebug_boot_sub[] = {
*
* Implement efidebug "boot" sub-command.
*/
-static int do_efi_boot_opt(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_efi_boot_opt(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
- cmd_tbl_t *cp;
+ struct cmd_tbl *cp;
if (argc < 2)
return CMD_RET_USAGE;
@@ -1108,7 +1109,7 @@ static int do_efi_boot_opt(cmd_tbl_t *cmdtp, int flag,
*
* efidebug test bootmgr
*/
-static int do_efi_test_bootmgr(cmd_tbl_t *cmdtp, int flag,
+static int do_efi_test_bootmgr(struct cmd_tbl *cmdtp, int flag,
int argc, char * const argv[])
{
efi_handle_t image;
@@ -1130,7 +1131,7 @@ static int do_efi_test_bootmgr(cmd_tbl_t *cmdtp, int flag,
return CMD_RET_SUCCESS;
}
-static cmd_tbl_t cmd_efidebug_test_sub[] = {
+static struct cmd_tbl cmd_efidebug_test_sub[] = {
U_BOOT_CMD_MKENT(bootmgr, CONFIG_SYS_MAXARGS, 1, do_efi_test_bootmgr,
"", ""),
};
@@ -1147,10 +1148,10 @@ static cmd_tbl_t cmd_efidebug_test_sub[] = {
*
* Implement efidebug "test" sub-command.
*/
-static int do_efi_test(cmd_tbl_t *cmdtp, int flag,
+static int do_efi_test(struct cmd_tbl *cmdtp, int flag,
int argc, char * const argv[])
{
- cmd_tbl_t *cp;
+ struct cmd_tbl *cp;
if (argc < 2)
return CMD_RET_USAGE;
@@ -1178,7 +1179,7 @@ static int do_efi_test(cmd_tbl_t *cmdtp, int flag,
* Implement efidebug "test" sub-command.
*/
-static int do_efi_query_info(cmd_tbl_t *cmdtp, int flag,
+static int do_efi_query_info(struct cmd_tbl *cmdtp, int flag,
int argc, char * const argv[])
{
efi_status_t ret;
@@ -1217,7 +1218,7 @@ static int do_efi_query_info(cmd_tbl_t *cmdtp, int flag,
return CMD_RET_SUCCESS;
}
-static cmd_tbl_t cmd_efidebug_sub[] = {
+static struct cmd_tbl cmd_efidebug_sub[] = {
U_BOOT_CMD_MKENT(boot, CONFIG_SYS_MAXARGS, 1, do_efi_boot_opt, "", ""),
U_BOOT_CMD_MKENT(devices, CONFIG_SYS_MAXARGS, 1, do_efi_show_devices,
"", ""),
@@ -1250,10 +1251,10 @@ static cmd_tbl_t cmd_efidebug_sub[] = {
* Implement efidebug command which allows us to display and
* configure UEFI environment.
*/
-static int do_efidebug(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_efidebug(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
- cmd_tbl_t *cp;
+ struct cmd_tbl *cp;
efi_status_t r;
if (argc < 2)
diff --git a/cmd/elf.c b/cmd/elf.c
index 10e8264d3c..d44b95d903 100644
--- a/cmd/elf.c
+++ b/cmd/elf.c
@@ -10,17 +10,19 @@
#include <elf.h>
#include <env.h>
#include <image.h>
+#include <log.h>
#include <net.h>
#include <vxworks.h>
#ifdef CONFIG_X86
#include <vbe.h>
+#include <asm/cache.h>
#include <asm/e820.h>
#include <linux/linkage.h>
#endif
/* Allow ports to override the default behavior */
static unsigned long do_bootelf_exec(ulong (*entry)(int, char * const[]),
- int argc, char * const argv[])
+ int argc, char *const argv[])
{
unsigned long ret;
@@ -34,7 +36,7 @@ static unsigned long do_bootelf_exec(ulong (*entry)(int, char * const[]),
}
/* Interpreter command to boot an arbitrary ELF image from memory */
-int do_bootelf(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_bootelf(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
unsigned long addr; /* Address of the ELF image */
unsigned long rc; /* Return value from user code */
@@ -90,7 +92,7 @@ int do_bootelf(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
* be either an ELF image or a raw binary. Will attempt to setup the
* bootline and other parameters correctly.
*/
-int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_bootvx(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
unsigned long addr; /* Address of image */
unsigned long bootaddr = 0; /* Address to put the bootline */
diff --git a/cmd/ethsw.c b/cmd/ethsw.c
index 8d271ce1f3..f8b8a798bf 100644
--- a/cmd/ethsw.c
+++ b/cmd/ethsw.c
@@ -11,6 +11,7 @@
#include <errno.h>
#include <env_flags.h>
#include <ethsw.h>
+#include <net.h>
static const char *ethsw_name;
@@ -999,7 +1000,7 @@ static void cmd_keywords_check(struct ethsw_command_def *parsed_cmd,
}
/* find all the keywords in the command */
-static int keywords_find(int argc, char * const argv[],
+static int keywords_find(int argc, char *const argv[],
struct ethsw_command_def *parsed_cmd)
{
int i;
@@ -1064,7 +1065,8 @@ static void command_def_init(struct ethsw_command_def *parsed_cmd)
}
/* function to interpret commands starting with "ethsw " */
-static int do_ethsw(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_ethsw(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct ethsw_command_def parsed_cmd;
int rc = CMD_RET_SUCCESS;
diff --git a/cmd/exit.c b/cmd/exit.c
index f40d0686e1..7bf241ec73 100644
--- a/cmd/exit.c
+++ b/cmd/exit.c
@@ -7,7 +7,8 @@
#include <common.h>
#include <command.h>
-static int do_exit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_exit(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int r;
diff --git a/cmd/ext2.c b/cmd/ext2.c
index dc56ab25ff..57a99516a6 100644
--- a/cmd/ext2.c
+++ b/cmd/ext2.c
@@ -19,9 +19,12 @@
/*
* Ext2fs support
*/
+#include <common.h>
+#include <command.h>
#include <fs.h>
-static int do_ext2ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_ext2ls(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return do_ls(cmdtp, flag, argc, argv, FS_TYPE_EXT);
}
@@ -29,7 +32,7 @@ static int do_ext2ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
/******************************************************************************
* Ext2fs boot command intepreter. Derived from diskboot
*/
-int do_ext2load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_ext2load(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
return do_load(cmdtp, flag, argc, argv, FS_TYPE_EXT);
}
diff --git a/cmd/ext4.c b/cmd/ext4.c
index d2fa7f1db1..4791b69fd9 100644
--- a/cmd/ext4.c
+++ b/cmd/ext4.c
@@ -41,25 +41,23 @@
#include <usb.h>
#endif
-int do_ext4_size(cmd_tbl_t *cmdtp, int flag, int argc,
- char *const argv[])
+int do_ext4_size(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
return do_size(cmdtp, flag, argc, argv, FS_TYPE_EXT);
}
-int do_ext4_load(cmd_tbl_t *cmdtp, int flag, int argc,
- char *const argv[])
+int do_ext4_load(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
return do_load(cmdtp, flag, argc, argv, FS_TYPE_EXT);
}
-int do_ext4_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_ext4_ls(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
return do_ls(cmdtp, flag, argc, argv, FS_TYPE_EXT);
}
#if defined(CONFIG_CMD_EXT4_WRITE)
-int do_ext4_write(cmd_tbl_t *cmdtp, int flag, int argc,
+int do_ext4_write(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
return do_save(cmdtp, flag, argc, argv, FS_TYPE_EXT);
diff --git a/cmd/fastboot.c b/cmd/fastboot.c
index 1b4215114d..ad5c064911 100644
--- a/cmd/fastboot.c
+++ b/cmd/fastboot.c
@@ -14,6 +14,7 @@
#include <net.h>
#include <usb.h>
#include <watchdog.h>
+#include <linux/stringify.h>
static int do_fastboot_udp(int argc, char *const argv[],
uintptr_t buf_addr, size_t buf_size)
@@ -93,7 +94,8 @@ exit:
#endif
}
-static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+static int do_fastboot(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
uintptr_t buf_addr = (uintptr_t)NULL;
size_t buf_size = 0;
diff --git a/cmd/fat.c b/cmd/fat.c
index abce2f1e0c..b438ce16c9 100644
--- a/cmd/fat.c
+++ b/cmd/fat.c
@@ -8,11 +8,14 @@
* Boot support
*/
#include <common.h>
+#include <command.h>
#include <mapmem.h>
#include <fat.h>
#include <fs.h>
+#include <part.h>
+#include <asm/cache.h>
-int do_fat_size(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_fat_size(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
return do_size(cmdtp, flag, argc, argv, FS_TYPE_FAT);
}
@@ -25,7 +28,7 @@ U_BOOT_CMD(
" and determine its size."
);
-int do_fat_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_fat_fsload(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
return do_load(cmdtp, flag, argc, argv, FS_TYPE_FAT);
}
@@ -46,7 +49,8 @@ U_BOOT_CMD(
" be printed and performance will suffer for the load."
);
-static int do_fat_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_fat_ls(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return do_ls(cmdtp, flag, argc, argv, FS_TYPE_FAT);
}
@@ -58,12 +62,12 @@ U_BOOT_CMD(
" - list files from 'dev' on 'interface' in a 'directory'"
);
-static int do_fat_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_fat_fsinfo(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int dev, part;
struct blk_desc *dev_desc;
- disk_partition_t info;
+ struct disk_partition info;
if (argc < 2) {
printf("usage: fatinfo <interface> [<dev[:part]>]\n");
@@ -91,8 +95,8 @@ U_BOOT_CMD(
);
#ifdef CONFIG_FAT_WRITE
-static int do_fat_fswrite(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_fat_fswrite(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
loff_t size;
int ret;
@@ -100,7 +104,7 @@ static int do_fat_fswrite(cmd_tbl_t *cmdtp, int flag,
unsigned long count;
long offset;
struct blk_desc *dev_desc = NULL;
- disk_partition_t info;
+ struct disk_partition info;
int dev = 0;
int part = 1;
void *buf;
@@ -146,7 +150,8 @@ U_BOOT_CMD(
" to 'dev' on 'interface'"
);
-static int do_fat_rm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_fat_rm(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return do_rm(cmdtp, flag, argc, argv, FS_TYPE_FAT);
}
@@ -158,8 +163,8 @@ U_BOOT_CMD(
" - delete a file from 'dev' on 'interface'"
);
-static int do_fat_mkdir(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_fat_mkdir(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return do_mkdir(cmdtp, flag, argc, argv, FS_TYPE_FAT);
}
diff --git a/cmd/fdt.c b/cmd/fdt.c
index 36cc726540..99b1b5b3fc 100644
--- a/cmd/fdt.c
+++ b/cmd/fdt.c
@@ -10,6 +10,7 @@
#include <common.h>
#include <command.h>
#include <env.h>
+#include <image.h>
#include <linux/ctype.h>
#include <linux/types.h>
#include <asm/global_data.h>
@@ -87,7 +88,7 @@ static const char * const fdt_member_table[] = {
"size_dt_struct",
};
-static int fdt_get_header_value(int argc, char * const argv[])
+static int fdt_get_header_value(int argc, char *const argv[])
{
fdt32_t *fdtp = (fdt32_t *)working_fdt;
ulong val;
@@ -111,7 +112,7 @@ static int fdt_get_header_value(int argc, char * const argv[])
/*
* Flattened Device Tree command, see the help for parameter definitions.
*/
-static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_fdt(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
if (argc < 2)
return CMD_RET_USAGE;
diff --git a/cmd/fitupd.c b/cmd/fitupd.c
index 1e5edd9f9b..f6270d9c15 100644
--- a/cmd/fitupd.c
+++ b/cmd/fitupd.c
@@ -12,7 +12,8 @@
#error "CONFIG_UPDATE_TFTP required"
#endif
-static int do_fitupd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_fitupd(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong addr = 0UL;
diff --git a/cmd/flash.c b/cmd/flash.c
index cd1758d7e2..240871e808 100644
--- a/cmd/flash.c
+++ b/cmd/flash.c
@@ -9,6 +9,8 @@
*/
#include <common.h>
#include <command.h>
+#include <log.h>
+#include <uuid.h>
#if defined(CONFIG_CMD_MTDPARTS)
#include <jffs2/jffs2.h>
@@ -88,7 +90,7 @@ abbrev_spec (char *str, flash_info_t ** pinfo, int *psf, int *psl)
/*
* Take *addr in Flash and adjust it to fall on the end of its sector
*/
-int flash_sect_roundb (ulong *addr)
+int flash_sect_roundb(ulong *addr)
{
flash_info_t *info;
ulong bank, sector_end_addr;
@@ -268,7 +270,8 @@ flash_fill_sect_ranges (ulong addr_first, ulong addr_last,
}
#endif /* CONFIG_MTD_NOR_FLASH */
-static int do_flinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_flinfo(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
#ifdef CONFIG_MTD_NOR_FLASH
ulong bank;
@@ -279,7 +282,7 @@ static int do_flinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
for (bank=0; bank <CONFIG_SYS_MAX_FLASH_BANKS; ++bank) {
printf ("\nBank # %ld: ", bank+1);
- flash_print_info (&flash_info[bank]);
+ flash_print_info(&flash_info[bank]);
}
return 0;
}
@@ -291,12 +294,13 @@ static int do_flinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return 1;
}
printf ("\nBank # %ld: ", bank);
- flash_print_info (&flash_info[bank-1]);
+ flash_print_info(&flash_info[bank - 1]);
#endif /* CONFIG_MTD_NOR_FLASH */
return 0;
}
-static int do_flerase(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_flerase(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
#ifdef CONFIG_MTD_NOR_FLASH
flash_info_t *info = NULL;
@@ -316,7 +320,7 @@ static int do_flerase(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
for (bank=1; bank<=CONFIG_SYS_MAX_FLASH_BANKS; ++bank) {
printf ("Erase Flash Bank # %ld ", bank);
info = &flash_info[bank-1];
- rcode = flash_erase (info, 0, info->sector_count-1);
+ rcode = flash_erase(info, 0, info->sector_count - 1);
}
return rcode;
}
@@ -370,7 +374,7 @@ static int do_flerase(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
}
printf ("Erase Flash Bank # %ld ", bank);
info = &flash_info[bank-1];
- rcode = flash_erase (info, 0, info->sector_count-1);
+ rcode = flash_erase(info, 0, info->sector_count - 1);
return rcode;
}
@@ -390,7 +394,7 @@ static int do_flerase(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
}
#ifdef CONFIG_MTD_NOR_FLASH
-int flash_sect_erase (ulong addr_first, ulong addr_last)
+int flash_sect_erase(ulong addr_first, ulong addr_last)
{
flash_info_t *info;
ulong bank;
@@ -408,14 +412,14 @@ int flash_sect_erase (ulong addr_first, ulong addr_last)
++bank, ++info) {
if (s_first[bank]>=0) {
erased += s_last[bank] - s_first[bank] + 1;
- debug ("Erase Flash from 0x%08lx to 0x%08lx "
- "in Bank # %ld ",
- info->start[s_first[bank]],
- (s_last[bank] == info->sector_count) ?
- info->start[0] + info->size - 1:
- info->start[s_last[bank]+1] - 1,
- bank+1);
- rcode = flash_erase (info, s_first[bank], s_last[bank]);
+ debug("Erase Flash from 0x%08lx to 0x%08lx in Bank # %ld ",
+ info->start[s_first[bank]],
+ (s_last[bank] == info->sector_count) ?
+ info->start[0] + info->size - 1 :
+ info->start[s_last[bank] + 1] - 1,
+ bank + 1);
+ rcode = flash_erase(info, s_first[bank],
+ s_last[bank]);
}
}
if (rcode == 0)
@@ -429,7 +433,8 @@ int flash_sect_erase (ulong addr_first, ulong addr_last)
}
#endif /* CONFIG_MTD_NOR_FLASH */
-static int do_protect(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_protect(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int rcode = 0;
#ifdef CONFIG_MTD_NOR_FLASH
@@ -526,7 +531,8 @@ static int do_protect(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
p ? "" : "Un", argv[1],
bank, addr_first, addr_last);
- rcode = flash_sect_protect (p, addr_first, addr_last);
+ rcode = flash_sect_protect(p, addr_first,
+ addr_last);
return rcode;
}
@@ -580,13 +586,13 @@ static int do_protect(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
if (addr_first >= addr_last)
return CMD_RET_USAGE;
- rcode = flash_sect_protect (p, addr_first, addr_last);
+ rcode = flash_sect_protect(p, addr_first, addr_last);
#endif /* CONFIG_MTD_NOR_FLASH */
return rcode;
}
#ifdef CONFIG_MTD_NOR_FLASH
-int flash_sect_protect (int p, ulong addr_first, ulong addr_last)
+int flash_sect_protect(int p, ulong addr_first, ulong addr_last)
{
flash_info_t *info;
ulong bank;
@@ -606,9 +612,9 @@ int flash_sect_protect (int p, ulong addr_first, ulong addr_last)
}
if (s_first[bank]>=0 && s_first[bank]<=s_last[bank]) {
- debug ("%sProtecting sectors %d..%d in bank %ld\n",
- p ? "" : "Un-",
- s_first[bank], s_last[bank], bank+1);
+ debug("%sProtecting sectors %d..%d in bank %ld\n",
+ p ? "" : "Un-", s_first[bank],
+ s_last[bank], bank + 1);
protected += s_last[bank] - s_first[bank] + 1;
for (i=s_first[bank]; i<=s_last[bank]; ++i) {
#if defined(CONFIG_SYS_FLASH_PROTECTION)
diff --git a/cmd/fpga.c b/cmd/fpga.c
index b1c7b5453b..8ae1c936fb 100644
--- a/cmd/fpga.c
+++ b/cmd/fpga.c
@@ -13,6 +13,8 @@
#include <fpga.h>
#include <fs.h>
#include <gzip.h>
+#include <image.h>
+#include <log.h>
#include <malloc.h>
static long do_fpga_get_device(char *arg)
@@ -33,7 +35,8 @@ static long do_fpga_get_device(char *arg)
}
static int do_fpga_check_params(long *dev, long *fpga_data, size_t *data_size,
- cmd_tbl_t *cmdtp, int argc, char *const argv[])
+ struct cmd_tbl *cmdtp, int argc,
+ char *const argv[])
{
size_t local_data_size;
long local_fpga_data;
@@ -65,7 +68,7 @@ static int do_fpga_check_params(long *dev, long *fpga_data, size_t *data_size,
}
#if defined(CONFIG_CMD_FPGA_LOAD_SECURE)
-int do_fpga_loads(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_fpga_loads(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
size_t data_size = 0;
long fpga_data, dev;
@@ -117,7 +120,7 @@ int do_fpga_loads(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
#endif
#if defined(CONFIG_CMD_FPGA_LOADFS)
-static int do_fpga_loadfs(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_fpga_loadfs(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
size_t data_size = 0;
@@ -140,16 +143,16 @@ static int do_fpga_loadfs(cmd_tbl_t *cmdtp, int flag, int argc,
}
#endif
-static int do_fpga_info(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_fpga_info(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
long dev = do_fpga_get_device(argv[0]);
return fpga_info(dev);
}
-static int do_fpga_dump(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_fpga_dump(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
size_t data_size = 0;
long fpga_data, dev;
@@ -163,8 +166,8 @@ static int do_fpga_dump(cmd_tbl_t *cmdtp, int flag, int argc,
return fpga_dump(dev, (void *)fpga_data, data_size);
}
-static int do_fpga_load(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_fpga_load(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
size_t data_size = 0;
long fpga_data, dev;
@@ -178,8 +181,8 @@ static int do_fpga_load(cmd_tbl_t *cmdtp, int flag, int argc,
return fpga_load(dev, (void *)fpga_data, data_size, BIT_FULL);
}
-static int do_fpga_loadb(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_fpga_loadb(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
size_t data_size = 0;
long fpga_data, dev;
@@ -194,8 +197,8 @@ static int do_fpga_loadb(cmd_tbl_t *cmdtp, int flag, int argc,
}
#if defined(CONFIG_CMD_FPGA_LOADP)
-static int do_fpga_loadp(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_fpga_loadp(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
size_t data_size = 0;
long fpga_data, dev;
@@ -211,8 +214,8 @@ static int do_fpga_loadp(cmd_tbl_t *cmdtp, int flag, int argc,
#endif
#if defined(CONFIG_CMD_FPGA_LOADBP)
-static int do_fpga_loadbp(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_fpga_loadbp(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
size_t data_size = 0;
long fpga_data, dev;
@@ -229,8 +232,8 @@ static int do_fpga_loadbp(cmd_tbl_t *cmdtp, int flag, int argc,
#endif
#if defined(CONFIG_CMD_FPGA_LOADMK)
-static int do_fpga_loadmk(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_fpga_loadmk(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
size_t data_size = 0;
void *fpga_data = NULL;
@@ -362,7 +365,7 @@ static int do_fpga_loadmk(cmd_tbl_t *cmdtp, int flag, int argc,
}
#endif
-static cmd_tbl_t fpga_commands[] = {
+static struct cmd_tbl fpga_commands[] = {
U_BOOT_CMD_MKENT(info, 1, 1, do_fpga_info, "", ""),
U_BOOT_CMD_MKENT(dump, 3, 1, do_fpga_dump, "", ""),
U_BOOT_CMD_MKENT(load, 3, 1, do_fpga_load, "", ""),
@@ -384,10 +387,10 @@ static cmd_tbl_t fpga_commands[] = {
#endif
};
-static int do_fpga_wrapper(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_fpga_wrapper(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
- cmd_tbl_t *fpga_cmd;
+ struct cmd_tbl *fpga_cmd;
int ret;
if (argc < 2)
diff --git a/cmd/fpgad.c b/cmd/fpgad.c
index 0d55453eaa..fb2fe63e78 100644
--- a/cmd/fpgad.c
+++ b/cmd/fpgad.c
@@ -25,7 +25,7 @@ static uint dp_last_length = 0x40;
* fpgad {fpga} {addr} {len}
*/
#define DISP_LINE_LEN 16
-int do_fpga_md(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_fpga_md(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
unsigned int k;
unsigned int fpga;
diff --git a/cmd/fs.c b/cmd/fs.c
index db74767b7b..3a0c465c15 100644
--- a/cmd/fs.c
+++ b/cmd/fs.c
@@ -9,7 +9,8 @@
#include <command.h>
#include <fs.h>
-static int do_size_wrapper(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_size_wrapper(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return do_size(cmdtp, flag, argc, argv, FS_TYPE_ANY);
}
@@ -22,8 +23,8 @@ U_BOOT_CMD(
" and determine its size."
);
-static int do_load_wrapper(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_load_wrapper(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return do_load(cmdtp, flag, argc, argv, FS_TYPE_ANY);
}
@@ -40,8 +41,8 @@ U_BOOT_CMD(
" If 'pos' is 0 or omitted, the file is read from the start."
)
-static int do_save_wrapper(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_save_wrapper(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return do_save(cmdtp, flag, argc, argv, FS_TYPE_ANY);
}
@@ -57,8 +58,8 @@ U_BOOT_CMD(
" If 'pos' is 0 or omitted, the file is written from the start."
)
-static int do_ls_wrapper(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_ls_wrapper(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return do_ls(cmdtp, flag, argc, argv, FS_TYPE_ANY);
}
@@ -71,8 +72,8 @@ U_BOOT_CMD(
" device type 'interface' instance 'dev'."
)
-static int do_ln_wrapper(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_ln_wrapper(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return do_ln(cmdtp, flag, argc, argv, FS_TYPE_ANY);
}
@@ -85,8 +86,8 @@ U_BOOT_CMD(
" device type 'interface' instance 'dev'."
)
-static int do_fstype_wrapper(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_fstype_wrapper(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return do_fs_type(cmdtp, flag, argc, argv);
}
diff --git a/cmd/fs_uuid.c b/cmd/fs_uuid.c
index 02ae9b7f3c..5dc94aa640 100644
--- a/cmd/fs_uuid.c
+++ b/cmd/fs_uuid.c
@@ -9,8 +9,8 @@
#include <command.h>
#include <fs.h>
-static int do_fs_uuid_wrapper(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_fs_uuid_wrapper(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return do_fs_uuid(cmdtp, flag, argc, argv, FS_TYPE_ANY);
}
diff --git a/cmd/fuse.c b/cmd/fuse.c
index 42d74fa883..e001619d17 100644
--- a/cmd/fuse.c
+++ b/cmd/fuse.c
@@ -40,7 +40,8 @@ static int confirm_prog(void)
return 0;
}
-static int do_fuse(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+static int do_fuse(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
const char *op = argc >= 2 ? argv[1] : NULL;
int confirmed = argc >= 3 && !strcmp(argv[2], "-y");
diff --git a/cmd/gettime.c b/cmd/gettime.c
index 863bd87590..2e74e02b49 100644
--- a/cmd/gettime.c
+++ b/cmd/gettime.c
@@ -14,8 +14,8 @@
#include <common.h>
#include <command.h>
-static int do_gettime(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_gettime(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
unsigned long int val = get_timer(0);
diff --git a/cmd/gpio.c b/cmd/gpio.c
index 408a942455..4fdb3135fc 100644
--- a/cmd/gpio.c
+++ b/cmd/gpio.c
@@ -10,6 +10,7 @@
#include <command.h>
#include <errno.h>
#include <dm.h>
+#include <log.h>
#include <malloc.h>
#include <asm/gpio.h>
#include <linux/err.h>
@@ -117,7 +118,8 @@ static int do_gpio_status(bool all, const char *gpio_name)
}
#endif
-static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_gpio(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
unsigned int gpio;
enum gpio_cmd sub_cmd;
diff --git a/cmd/gpt.c b/cmd/gpt.c
index b8d11c167d..df759416c8 100644
--- a/cmd/gpt.c
+++ b/cmd/gpt.c
@@ -11,11 +11,15 @@
*/
#include <common.h>
+#include <blk.h>
#include <env.h>
+#include <log.h>
#include <malloc.h>
#include <command.h>
+#include <part.h>
#include <part_efi.h>
#include <exports.h>
+#include <uuid.h>
#include <linux/ctype.h>
#include <div64.h>
#include <memalign.h>
@@ -188,7 +192,8 @@ static void del_gpt_info(void)
}
}
-static struct disk_part *allocate_disk_part(disk_partition_t *info, int partnum)
+static struct disk_part *allocate_disk_part(struct disk_partition *info,
+ int partnum)
{
struct disk_part *newpart;
newpart = calloc(1, sizeof(struct disk_part));
@@ -309,7 +314,7 @@ static int get_gpt_info(struct blk_desc *dev_desc)
{
/* start partition numbering at 1, as U-Boot does */
int valid_parts = 0, p, ret;
- disk_partition_t info;
+ struct disk_partition info;
struct disk_part *new_disk_part;
/*
@@ -374,14 +379,14 @@ static int do_get_gpt_info(struct blk_desc *dev_desc)
static int set_gpt_info(struct blk_desc *dev_desc,
const char *str_part,
char **str_disk_guid,
- disk_partition_t **partitions,
+ struct disk_partition **partitions,
u8 *parts_count)
{
char *tok, *str, *s;
int i;
char *val, *p;
int p_count;
- disk_partition_t *parts;
+ struct disk_partition *parts;
int errno = 0;
uint64_t size_ll, start_ll;
lbaint_t offset = 0;
@@ -439,7 +444,7 @@ static int set_gpt_info(struct blk_desc *dev_desc,
}
/* allocate memory for partitions */
- parts = calloc(sizeof(disk_partition_t), p_count);
+ parts = calloc(sizeof(struct disk_partition), p_count);
if (parts == NULL)
return -ENOMEM;
@@ -556,7 +561,7 @@ static int gpt_default(struct blk_desc *blk_dev_desc, const char *str_part)
int ret;
char *str_disk_guid;
u8 part_count = 0;
- disk_partition_t *partitions = NULL;
+ struct disk_partition *partitions = NULL;
/* fill partitions */
ret = set_gpt_info(blk_dev_desc, str_part,
@@ -583,7 +588,7 @@ static int gpt_verify(struct blk_desc *blk_dev_desc, const char *str_part)
{
ALLOC_CACHE_ALIGN_BUFFER_PAD(gpt_header, gpt_head, 1,
blk_dev_desc->blksz);
- disk_partition_t *partitions = NULL;
+ struct disk_partition *partitions = NULL;
gpt_entry *gpt_pte = NULL;
char *str_disk_guid;
u8 part_count = 0;
@@ -639,7 +644,7 @@ static int do_rename_gpt_parts(struct blk_desc *dev_desc, char *subcomm,
{
struct list_head *pos;
struct disk_part *curr;
- disk_partition_t *new_partitions = NULL;
+ struct disk_partition *new_partitions = NULL;
char disk_guid[UUID_STR_LEN + 1];
char *partitions_list, *str_disk_guid = NULL;
u8 part_count = 0;
@@ -790,7 +795,7 @@ static int do_rename_gpt_parts(struct blk_desc *dev_desc, char *subcomm,
*
* @return zero on success; otherwise error
*/
-static int do_gpt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_gpt(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
int ret = CMD_RET_SUCCESS;
int dev = 0;
diff --git a/cmd/hash.c b/cmd/hash.c
index dff943ac9f..e163cd6774 100644
--- a/cmd/hash.c
+++ b/cmd/hash.c
@@ -14,7 +14,8 @@
#include <hash.h>
#include <linux/ctype.h>
-static int do_hash(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_hash(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
char *s;
int flags = HASH_FLAG_ENV;
diff --git a/cmd/help.c b/cmd/help.c
index a1a0b99b6f..8d67d977bf 100644
--- a/cmd/help.c
+++ b/cmd/help.c
@@ -7,11 +7,12 @@
#include <common.h>
#include <command.h>
-static int do_help(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_help(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
#ifdef CONFIG_CMDLINE
- cmd_tbl_t *start = ll_entry_start(cmd_tbl_t, cmd);
- const int len = ll_entry_count(cmd_tbl_t, cmd);
+ struct cmd_tbl *start = ll_entry_start(struct cmd_tbl, cmd);
+ const int len = ll_entry_count(struct cmd_tbl, cmd);
return _do_help(start, len, cmdtp, flag, argc, argv);
#else
return 0;
@@ -29,7 +30,7 @@ U_BOOT_CMD(
#ifdef CONFIG_CMDLINE
/* This does not use the U_BOOT_CMD macro as ? can't be used in symbol names */
-ll_entry_declare(cmd_tbl_t, question_mark, cmd) = {
+ll_entry_declare(struct cmd_tbl, question_mark, cmd) = {
"?", CONFIG_SYS_MAXARGS, cmd_always_repeatable, do_help,
"alias for 'help'",
#ifdef CONFIG_SYS_LONGHELP
diff --git a/cmd/host.c b/cmd/host.c
index eefc4f255e..cd9c9677f0 100644
--- a/cmd/host.c
+++ b/cmd/host.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <command.h>
#include <dm.h>
#include <fs.h>
#include <part.h>
@@ -13,32 +14,32 @@
static int host_curr_device = -1;
-static int do_host_load(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_host_load(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return do_load(cmdtp, flag, argc, argv, FS_TYPE_SANDBOX);
}
-static int do_host_ls(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_host_ls(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return do_ls(cmdtp, flag, argc, argv, FS_TYPE_SANDBOX);
}
-static int do_host_size(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_host_size(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return do_size(cmdtp, flag, argc, argv, FS_TYPE_SANDBOX);
}
-static int do_host_save(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_host_save(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return do_save(cmdtp, flag, argc, argv, FS_TYPE_SANDBOX);
}
-static int do_host_bind(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_host_bind(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
if (argc < 2 || argc > 3)
return CMD_RET_USAGE;
@@ -53,8 +54,8 @@ static int do_host_bind(cmd_tbl_t *cmdtp, int flag, int argc,
return host_dev_bind(dev, file);
}
-static int do_host_info(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_host_info(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
if (argc < 1 || argc > 2)
return CMD_RET_USAGE;
@@ -100,8 +101,8 @@ static int do_host_info(cmd_tbl_t *cmdtp, int flag, int argc,
return 0;
}
-static int do_host_dev(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_host_dev(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int dev;
char *ep;
@@ -140,7 +141,7 @@ static int do_host_dev(cmd_tbl_t *cmdtp, int flag, int argc,
return 0;
}
-static cmd_tbl_t cmd_host_sub[] = {
+static struct cmd_tbl cmd_host_sub[] = {
U_BOOT_CMD_MKENT(load, 7, 0, do_host_load, "", ""),
U_BOOT_CMD_MKENT(ls, 3, 0, do_host_ls, "", ""),
U_BOOT_CMD_MKENT(save, 6, 0, do_host_save, "", ""),
@@ -150,10 +151,10 @@ static cmd_tbl_t cmd_host_sub[] = {
U_BOOT_CMD_MKENT(dev, 0, 1, do_host_dev, "", ""),
};
-static int do_host(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_host(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
- cmd_tbl_t *c;
+ struct cmd_tbl *c;
/* Skip past 'host' */
argc--;
diff --git a/cmd/i2c.c b/cmd/i2c.c
index 43a76299b3..cc01119b21 100644
--- a/cmd/i2c.c
+++ b/cmd/i2c.c
@@ -73,9 +73,11 @@
#include <edid.h>
#include <errno.h>
#include <i2c.h>
+#include <log.h>
#include <malloc.h>
#include <asm/byteorder.h>
#include <linux/compiler.h>
+#include <linux/delay.h>
#include <u-boot/crc.h>
/* Display values from last command.
@@ -288,7 +290,8 @@ static int i2c_report_err(int ret, enum i2c_err_op op)
* Syntax:
* i2c read {i2c_chip} {devaddr}{.0, .1, .2} {len} {memaddr}
*/
-static int do_i2c_read ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_i2c_read(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
uint chip;
uint devaddr, length;
@@ -341,7 +344,8 @@ static int do_i2c_read ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
return 0;
}
-static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_i2c_write(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
uint chip;
uint devaddr, length;
@@ -432,7 +436,7 @@ static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[
}
#ifdef CONFIG_DM_I2C
-static int do_i2c_flags(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_i2c_flags(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
struct udevice *dev;
@@ -462,7 +466,8 @@ static int do_i2c_flags(cmd_tbl_t *cmdtp, int flag, int argc,
return 0;
}
-static int do_i2c_olen(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+static int do_i2c_olen(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *dev;
uint olen;
@@ -507,7 +512,8 @@ static int do_i2c_olen(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
* Syntax:
* i2c md {i2c_chip} {addr}{.0, .1, .2} {len}
*/
-static int do_i2c_md ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_i2c_md(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
uint chip;
uint addr, length;
@@ -626,7 +632,8 @@ static int do_i2c_md ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
* Syntax:
* i2c mw {i2c_chip} {addr}{.0, .1, .2} {data} [{count}]
*/
-static int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_i2c_mw(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
uint chip;
ulong addr;
@@ -712,7 +719,8 @@ static int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
* Syntax:
* i2c crc32 {i2c_chip} {addr}{.0, .1, .2} {count}
*/
-static int do_i2c_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_i2c_crc(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
uint chip;
ulong addr;
@@ -796,8 +804,8 @@ static int do_i2c_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
* i2c mm{.b, .w, .l} {i2c_chip} {addr}{.0, .1, .2}
* i2c nm{.b, .w, .l} {i2c_chip} {addr}{.0, .1, .2}
*/
-static int
-mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[])
+static int mod_i2c_mem(struct cmd_tbl *cmdtp, int incrflag, int flag, int argc,
+ char *const argv[])
{
uint chip;
ulong addr;
@@ -945,7 +953,8 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const arg
*
* Returns zero (success) if one or more I2C devices was found
*/
-static int do_i2c_probe (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_i2c_probe(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int j;
int addr = -1;
@@ -1020,7 +1029,8 @@ static int do_i2c_probe (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
* {length} - Number of bytes to read
* {delay} - A DECIMAL number and defaults to 1000 uSec
*/
-static int do_i2c_loop(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_i2c_loop(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
uint chip;
int alen;
@@ -1146,7 +1156,8 @@ static void decode_bits (u_char const b, char const *str[], int const do_once)
* Syntax:
* i2c sdram {i2c_chip}
*/
-static int do_sdram (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+static int do_sdram(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
enum { unknown, EDO, SDRAM, DDR, DDR2, DDR3, DDR4 } type;
@@ -1648,7 +1659,7 @@ static int do_sdram (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
* i2c edid {i2c_chip}
*/
#if defined(CONFIG_I2C_EDID)
-int do_edid(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_edid(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
uint chip;
struct edid1_info edid;
@@ -1715,8 +1726,8 @@ static void show_bus(struct udevice *bus)
* Returns zero always.
*/
#if defined(CONFIG_SYS_I2C) || defined(CONFIG_DM_I2C)
-static int do_i2c_show_bus(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_i2c_show_bus(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
if (argc == 1) {
/* show all busses */
@@ -1802,8 +1813,8 @@ static int do_i2c_show_bus(cmd_tbl_t *cmdtp, int flag, int argc,
*/
#if defined(CONFIG_SYS_I2C) || defined(CONFIG_I2C_MULTI_BUS) || \
defined(CONFIG_DM_I2C)
-static int do_i2c_bus_num(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_i2c_bus_num(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int ret = 0;
int bus_no;
@@ -1853,7 +1864,8 @@ static int do_i2c_bus_num(cmd_tbl_t *cmdtp, int flag, int argc,
* Returns zero on success, CMD_RET_USAGE in case of misuse and negative
* on error.
*/
-static int do_i2c_bus_speed(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+static int do_i2c_bus_speed(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int speed, ret=0;
@@ -1896,7 +1908,8 @@ static int do_i2c_bus_speed(cmd_tbl_t * cmdtp, int flag, int argc, char * const
* Returns zero on success, CMD_RET_USAGE in case of misuse and negative
* on error.
*/
-static int do_i2c_mm(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+static int do_i2c_mm(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return mod_i2c_mem (cmdtp, 1, flag, argc, argv);
}
@@ -1911,7 +1924,8 @@ static int do_i2c_mm(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
* Returns zero on success, CMD_RET_USAGE in case of misuse and negative
* on error.
*/
-static int do_i2c_nm(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+static int do_i2c_nm(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return mod_i2c_mem (cmdtp, 0, flag, argc, argv);
}
@@ -1925,7 +1939,8 @@ static int do_i2c_nm(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
*
* Returns zero always.
*/
-static int do_i2c_reset(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+static int do_i2c_reset(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
#if defined(CONFIG_DM_I2C)
struct udevice *bus;
@@ -1944,7 +1959,7 @@ static int do_i2c_reset(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv
return 0;
}
-static cmd_tbl_t cmd_i2c_sub[] = {
+static struct cmd_tbl cmd_i2c_sub[] = {
#if defined(CONFIG_SYS_I2C) || defined(CONFIG_DM_I2C)
U_BOOT_CMD_MKENT(bus, 1, 1, do_i2c_show_bus, "", ""),
#endif
@@ -1995,9 +2010,9 @@ static __maybe_unused void i2c_reloc(void)
* Returns zero on success, CMD_RET_USAGE in case of misuse and negative
* on error.
*/
-static int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+static int do_i2c(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
- cmd_tbl_t *c;
+ struct cmd_tbl *c;
#ifdef CONFIG_NEEDS_MANUAL_RELOC
i2c_reloc();
diff --git a/cmd/ide.c b/cmd/ide.c
index 2f93ba7904..b78c38e159 100644
--- a/cmd/ide.c
+++ b/cmd/ide.c
@@ -27,7 +27,7 @@
/* Current I/O Device */
static int curr_device;
-int do_ide(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_ide(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
if (argc == 2) {
if (strncmp(argv[1], "res", 3) == 0) {
@@ -40,7 +40,7 @@ int do_ide(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
return blk_common_cmd(argc, argv, IF_TYPE_IDE, &curr_device);
}
-int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_diskboot(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
return common_diskboot(cmdtp, "ide", argc, argv);
}
diff --git a/cmd/ini.c b/cmd/ini.c
index 0c425262d0..c075be623c 100644
--- a/cmd/ini.c
+++ b/cmd/ini.c
@@ -226,7 +226,7 @@ static int ini_handler(void *user, char *section, char *name, char *value)
return 1;
}
-static int do_ini(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_ini(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
const char *section;
char *file_address;
diff --git a/cmd/io.c b/cmd/io.c
index 7fee9674a2..c7e964153b 100644
--- a/cmd/io.c
+++ b/cmd/io.c
@@ -24,7 +24,7 @@ static ulong base_address;
* Syntax:
* iod{.b, .w, .l} {addr}
*/
-int do_io_iod(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_io_iod(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
ulong addr, length, bytes;
u8 buf[DISP_LINE_LEN];
@@ -90,7 +90,7 @@ int do_io_iod(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
return 0;
}
-int do_io_iow(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_io_iow(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
ulong addr, val;
int size;
diff --git a/cmd/iotrace.c b/cmd/iotrace.c
index fa6c68b198..652ebefb89 100644
--- a/cmd/iotrace.c
+++ b/cmd/iotrace.c
@@ -55,7 +55,7 @@ static void do_print_trace(void)
}
}
-static int do_set_buffer(int argc, char * const argv[])
+static int do_set_buffer(int argc, char *const argv[])
{
ulong addr = 0, size = 0;
@@ -71,7 +71,7 @@ static int do_set_buffer(int argc, char * const argv[])
return 0;
}
-static int do_set_region(int argc, char * const argv[])
+static int do_set_region(int argc, char *const argv[])
{
ulong addr = 0, size = 0;
@@ -87,7 +87,7 @@ static int do_set_region(int argc, char * const argv[])
return 0;
}
-int do_iotrace(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_iotrace(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
const char *cmd = argc < 2 ? NULL : argv[1];
diff --git a/cmd/irq.c b/cmd/irq.c
index 52d06b3eed..1d3e28cb3c 100644
--- a/cmd/irq.c
+++ b/cmd/irq.c
@@ -8,8 +8,8 @@
#include <command.h>
#include <irq_func.h>
-static int do_interrupts(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_interrupts(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
if (argc != 2)
@@ -31,7 +31,7 @@ U_BOOT_CMD(
);
/* Implemented in $(CPU)/interrupts.c */
-int do_irqinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
+int do_irqinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
U_BOOT_CMD(
irqinfo, 1, 1, do_irqinfo,
diff --git a/cmd/itest.c b/cmd/itest.c
index e21e1f1b1b..a0cf4bee04 100644
--- a/cmd/itest.c
+++ b/cmd/itest.c
@@ -175,7 +175,8 @@ static int binary_test(char *op, char *arg1, char *arg2, int w)
}
/* command line interface to the shell test */
-static int do_itest(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_itest(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int value, w;
diff --git a/cmd/jffs2.c b/cmd/jffs2.c
index da2580d85d..9540988e33 100644
--- a/cmd/jffs2.c
+++ b/cmd/jffs2.c
@@ -73,9 +73,11 @@
#include <common.h>
#include <command.h>
#include <env.h>
+#include <flash.h>
#include <image.h>
#include <malloc.h>
#include <jffs2/jffs2.h>
+#include <linux/bug.h>
#include <linux/list.h>
#include <linux/ctype.h>
#include <cramfs/cramfs_fs.h>
@@ -471,7 +473,8 @@ static struct part_info* jffs2_part_info(struct mtd_device *dev, unsigned int pa
* @param argv arguments list
* @return 0 on success, 1 otherwise
*/
-int do_jffs2_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_jffs2_fsload(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
char *fsname;
char *filename;
@@ -533,7 +536,7 @@ int do_jffs2_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
* @param argv arguments list
* @return 0 on success, 1 otherwise
*/
-int do_jffs2_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_jffs2_ls(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char *filename = "/";
int ret;
@@ -571,7 +574,8 @@ int do_jffs2_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
* @param argv arguments list
* @return 0 on success, 1 otherwise
*/
-int do_jffs2_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_jffs2_fsinfo(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct part_info *part;
char *fsname;
diff --git a/cmd/led.c b/cmd/led.c
index 50ffa509ab..9433fa886c 100644
--- a/cmd/led.c
+++ b/cmd/led.c
@@ -71,7 +71,7 @@ static int list_leds(void)
return 0;
}
-int do_led(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_led(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
enum led_state_t cmd;
const char *led_label;
diff --git a/cmd/legacy_led.c b/cmd/legacy_led.c
index 7d40d8db58..86cd969e40 100644
--- a/cmd/legacy_led.c
+++ b/cmd/legacy_led.c
@@ -85,7 +85,7 @@ void __weak __led_blink(led_id_t mask, int freq)
{
}
-int do_legacy_led(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_legacy_led(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
int i, match = 0;
enum led_cmd cmd;
diff --git a/cmd/license.c b/cmd/license.c
index c5b04c331b..15411b5a92 100644
--- a/cmd/license.c
+++ b/cmd/license.c
@@ -12,7 +12,8 @@
#include "license_data_gz.h"
#include "license_data_size.h"
-static int do_license(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_license(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
char *dst;
unsigned long len = data_size;
diff --git a/cmd/load.c b/cmd/load.c
index fab30fe894..63a9414543 100644
--- a/cmd/load.c
+++ b/cmd/load.c
@@ -19,6 +19,8 @@
#include <exports.h>
#include <serial.h>
#include <xyzModem.h>
+#include <asm/cache.h>
+#include <linux/delay.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -40,8 +42,8 @@ static int do_echo = 1;
/* -------------------------------------------------------------------- */
#if defined(CONFIG_CMD_LOADS)
-static int do_load_serial(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_load_serial(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
long offset = 0;
ulong addr;
@@ -241,7 +243,8 @@ static int read_record(char *buf, ulong len)
#if defined(CONFIG_CMD_SAVES)
-int do_save_serial (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_save_serial(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong offset = 0;
ulong size = 0;
@@ -418,8 +421,8 @@ static int his_pad_count; /* number of pad chars he needs */
static char his_pad_char; /* pad chars he needs */
static char his_quote; /* quote chars he'll use */
-static int do_load_serial_bin(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_load_serial_bin(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong offset = 0;
ulong addr;
diff --git a/cmd/log.c b/cmd/log.c
index 1e3936aeeb..664f7bd7ac 100644
--- a/cmd/log.c
+++ b/cmd/log.c
@@ -11,8 +11,8 @@
static char log_fmt_chars[LOGF_COUNT] = "clFLfm";
-static int do_log_level(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_log_level(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
if (argc > 1)
gd->default_log_level = simple_strtol(argv[1], NULL, 10);
@@ -22,8 +22,8 @@ static int do_log_level(cmd_tbl_t *cmdtp, int flag, int argc,
return 0;
}
-static int do_log_format(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_log_format(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int i;
@@ -58,7 +58,8 @@ static int do_log_format(cmd_tbl_t *cmdtp, int flag, int argc,
return 0;
}
-static int do_log_rec(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_log_rec(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
enum log_category_t cat;
enum log_level_t level;
@@ -94,7 +95,7 @@ static int do_log_rec(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return 0;
}
-static cmd_tbl_t log_sub[] = {
+static struct cmd_tbl log_sub[] = {
U_BOOT_CMD_MKENT(level, CONFIG_SYS_MAXARGS, 1, do_log_level, "", ""),
#ifdef CONFIG_LOG_TEST
U_BOOT_CMD_MKENT(test, 2, 1, do_log_test, "", ""),
@@ -103,9 +104,9 @@ static cmd_tbl_t log_sub[] = {
U_BOOT_CMD_MKENT(rec, CONFIG_SYS_MAXARGS, 1, do_log_rec, "", ""),
};
-static int do_log(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_log(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
- cmd_tbl_t *cp;
+ struct cmd_tbl *cp;
if (argc < 2)
return CMD_RET_USAGE;
diff --git a/cmd/lzmadec.c b/cmd/lzmadec.c
index e3b9cc75ac..3b8db0a853 100644
--- a/cmd/lzmadec.c
+++ b/cmd/lzmadec.c
@@ -17,7 +17,8 @@
#include <lzma/LzmaTools.h>
-static int do_lzmadec(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+static int do_lzmadec(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
unsigned long src, dst;
SizeT src_len = ~0UL, dst_len = ~0UL;
diff --git a/cmd/mac.c b/cmd/mac.c
index 4227d10936..a39e1168a5 100644
--- a/cmd/mac.c
+++ b/cmd/mac.c
@@ -7,7 +7,8 @@
#include <common.h>
#include <command.h>
-extern int do_mac(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
+extern int do_mac(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[]);
U_BOOT_CMD(
mac, 3, 1, do_mac,
diff --git a/cmd/md5sum.c b/cmd/md5sum.c
index 63cbae0364..5ae3ddf85f 100644
--- a/cmd/md5sum.c
+++ b/cmd/md5sum.c
@@ -10,6 +10,7 @@
#include <common.h>
#include <command.h>
#include <env.h>
+#include <image.h>
#include <mapmem.h>
#include <u-boot/md5.h>
#include <asm/io.h>
@@ -72,7 +73,7 @@ static int parse_verify_sum(char *verify_str, u8 *vsum)
return 0;
}
-int do_md5sum(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_md5sum(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
ulong addr, len;
unsigned int i;
@@ -135,7 +136,8 @@ int do_md5sum(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return 0;
}
#else
-static int do_md5sum(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_md5sum(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
unsigned long addr, len;
unsigned int i;
diff --git a/cmd/mdio.c b/cmd/mdio.c
index 22c8fbe856..c48bb51237 100644
--- a/cmd/mdio.c
+++ b/cmd/mdio.c
@@ -190,7 +190,8 @@ static int extract_phy_range(char *const argv[], int argc, struct mii_dev **bus,
}
/* ---------------------------------------------------------------- */
-static int do_mdio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_mdio(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
char op[2];
int addrlo, addrhi, reglo, reghi, devadlo, devadhi;
diff --git a/cmd/mem.c b/cmd/mem.c
index 18f0510098..9b97f7bf69 100644
--- a/cmd/mem.c
+++ b/cmd/mem.c
@@ -18,14 +18,22 @@
#include <console.h>
#include <flash.h>
#include <hash.h>
+#include <log.h>
#include <mapmem.h>
+#include <rand.h>
#include <watchdog.h>
#include <asm/io.h>
+#include <linux/bitops.h>
#include <linux/compiler.h>
+#include <linux/delay.h>
DECLARE_GLOBAL_DATA_PTR;
-static int mod_mem(cmd_tbl_t *, int, int, int, char * const []);
+#ifndef CONFIG_SYS_MEMTEST_SCRATCH
+#define CONFIG_SYS_MEMTEST_SCRATCH 0
+#endif
+
+static int mod_mem(struct cmd_tbl *, int, int, int, char * const []);
/* Display values from last command.
* Memory modify remembered values are different from display memory.
@@ -42,7 +50,8 @@ static ulong base_address = 0;
* md{.b, .w, .l, .q} {addr} {len}
*/
#define DISP_LINE_LEN 16
-static int do_mem_md(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_mem_md(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong addr, length, bytes;
const void *buf;
@@ -92,16 +101,20 @@ static int do_mem_md(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return (rc);
}
-static int do_mem_mm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_mem_mm(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return mod_mem (cmdtp, 1, flag, argc, argv);
}
-static int do_mem_nm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+
+static int do_mem_nm(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return mod_mem (cmdtp, 0, flag, argc, argv);
}
-static int do_mem_mw(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_mem_mw(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
#ifdef MEM_SUPPORT_64BIT_DATA
u64 writeval;
@@ -162,7 +175,8 @@ static int do_mem_mw(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
}
#ifdef CONFIG_CMD_MX_CYCLIC
-static int do_mem_mdc(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_mem_mdc(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int i;
ulong count;
@@ -177,7 +191,7 @@ static int do_mem_mdc(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
/* delay for <count> ms... */
for (i=0; i<count; i++)
- udelay (1000);
+ udelay(1000);
/* check for ctrl-c to abort... */
if (ctrlc()) {
@@ -189,7 +203,8 @@ static int do_mem_mdc(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return 0;
}
-static int do_mem_mwc(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_mem_mwc(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int i;
ulong count;
@@ -204,7 +219,7 @@ static int do_mem_mwc(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
/* delay for <count> ms... */
for (i=0; i<count; i++)
- udelay (1000);
+ udelay(1000);
/* check for ctrl-c to abort... */
if (ctrlc()) {
@@ -217,7 +232,8 @@ static int do_mem_mwc(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
}
#endif /* CONFIG_CMD_MX_CYCLIC */
-static int do_mem_cmp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_mem_cmp(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong addr1, addr2, count, ngood, bytes;
int size;
@@ -297,7 +313,8 @@ static int do_mem_cmp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return rcode;
}
-static int do_mem_cp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_mem_cp(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong addr, dest, count;
void *src, *dst;
@@ -355,8 +372,8 @@ static int do_mem_cp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return 0;
}
-static int do_mem_base(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_mem_base(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
if (argc > 1) {
/* Set new base address.
@@ -369,8 +386,8 @@ static int do_mem_base(cmd_tbl_t *cmdtp, int flag, int argc,
return 0;
}
-static int do_mem_loop(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_mem_loop(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong addr, length, i, bytes;
int size;
@@ -467,8 +484,8 @@ static int do_mem_loop(cmd_tbl_t *cmdtp, int flag, int argc,
}
#ifdef CONFIG_LOOPW
-static int do_mem_loopw(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_mem_loopw(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong addr, length, i, bytes;
int size;
@@ -914,8 +931,8 @@ static ulong mem_test_quick(vu_long *buf, ulong start_addr, ulong end_addr,
* configured using CONFIG_SYS_ALT_MEMTEST. The complete test loops until
* interrupted by ctrl-c or by a failure of one of the sub-tests.
*/
-static int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_mem_mtest(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong start, end;
vu_long scratch_space;
@@ -1002,7 +1019,8 @@ static int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc,
* nm{.b, .w, .l, .q} {addr}
*/
static int
-mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[])
+mod_mem(struct cmd_tbl *cmdtp, int incrflag, int flag, int argc,
+ char *const argv[])
{
ulong addr;
#ifdef MEM_SUPPORT_64BIT_DATA
@@ -1106,7 +1124,8 @@ mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[])
#ifdef CONFIG_CMD_CRC32
-static int do_mem_crc(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_mem_crc(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int flags = 0;
int ac;
@@ -1131,7 +1150,8 @@ static int do_mem_crc(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#endif
#ifdef CONFIG_CMD_RANDOM
-static int do_random(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_random(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
unsigned long addr, len;
unsigned long seed; // NOT INITIALIZED ON PURPOSE
@@ -1259,8 +1279,8 @@ U_BOOT_CMD(
#endif
#ifdef CONFIG_CMD_MEMINFO
-static int do_mem_info(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_mem_info(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
puts("DRAM: ");
print_size(gd->ram_size, "\n");
diff --git a/cmd/mfsl.c b/cmd/mfsl.c
index 583762a345..31f5b36ade 100644
--- a/cmd/mfsl.c
+++ b/cmd/mfsl.c
@@ -14,7 +14,7 @@
#include <command.h>
#include <asm/asm.h>
-int do_frd (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+int do_frd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
unsigned int fslnum;
unsigned int num;
@@ -169,7 +169,7 @@ int do_frd (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
return 0;
}
-int do_fwr (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+int do_fwr(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
unsigned int fslnum;
unsigned int num;
@@ -324,7 +324,7 @@ int do_fwr (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
}
-int do_rspr (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+int do_rspr(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
unsigned int reg = 0;
unsigned int val = 0;
diff --git a/cmd/mii.c b/cmd/mii.c
index 23ee1e6cfa..b52a55dc33 100644
--- a/cmd/mii.c
+++ b/cmd/mii.c
@@ -277,7 +277,7 @@ static void extract_range(
}
/* ---------------------------------------------------------------- */
-static int do_mii(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_mii(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char op[2];
unsigned char addrlo, addrhi, reglo, reghi;
diff --git a/cmd/misc.c b/cmd/misc.c
index a1eef72a6c..20ab943494 100644
--- a/cmd/misc.c
+++ b/cmd/misc.c
@@ -10,8 +10,10 @@
#include <common.h>
#include <command.h>
#include <console.h>
+#include <linux/delay.h>
-static int do_sleep(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_sleep(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong start = get_timer(0);
ulong mdelay = 0;
@@ -58,7 +60,8 @@ U_BOOT_CMD(
);
#ifdef CONFIG_CMD_TIMER
-static int do_timer(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_timer(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
static ulong start;
diff --git a/cmd/mmc.c b/cmd/mmc.c
index 6142ec8e20..97e5d91859 100644
--- a/cmd/mmc.c
+++ b/cmd/mmc.c
@@ -5,9 +5,11 @@
*/
#include <common.h>
+#include <blk.h>
#include <command.h>
#include <console.h>
#include <mmc.h>
+#include <part.h>
#include <sparse_format.h>
#include <image-sparse.h>
@@ -140,7 +142,9 @@ static struct mmc *init_mmc_device(int dev, bool force_init)
return mmc;
}
-static int do_mmcinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+
+static int do_mmcinfo(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct mmc *mmc;
@@ -173,8 +177,9 @@ static int confirm_key_prog(void)
puts("Authentication key programming aborted\n");
return 0;
}
-static int do_mmcrpmb_key(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+
+static int do_mmcrpmb_key(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
void *key_addr;
struct mmc *mmc = find_mmc_device(curr_device);
@@ -191,8 +196,9 @@ static int do_mmcrpmb_key(cmd_tbl_t *cmdtp, int flag,
}
return CMD_RET_SUCCESS;
}
-static int do_mmcrpmb_read(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+
+static int do_mmcrpmb_read(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
u16 blk, cnt;
void *addr;
@@ -219,8 +225,9 @@ static int do_mmcrpmb_read(cmd_tbl_t *cmdtp, int flag,
return CMD_RET_FAILURE;
return CMD_RET_SUCCESS;
}
-static int do_mmcrpmb_write(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+
+static int do_mmcrpmb_write(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
u16 blk, cnt;
void *addr;
@@ -245,8 +252,9 @@ static int do_mmcrpmb_write(cmd_tbl_t *cmdtp, int flag,
return CMD_RET_FAILURE;
return CMD_RET_SUCCESS;
}
-static int do_mmcrpmb_counter(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+
+static int do_mmcrpmb_counter(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
unsigned long counter;
struct mmc *mmc = find_mmc_device(curr_device);
@@ -257,17 +265,17 @@ static int do_mmcrpmb_counter(cmd_tbl_t *cmdtp, int flag,
return CMD_RET_SUCCESS;
}
-static cmd_tbl_t cmd_rpmb[] = {
+static struct cmd_tbl cmd_rpmb[] = {
U_BOOT_CMD_MKENT(key, 2, 0, do_mmcrpmb_key, "", ""),
U_BOOT_CMD_MKENT(read, 5, 1, do_mmcrpmb_read, "", ""),
U_BOOT_CMD_MKENT(write, 5, 0, do_mmcrpmb_write, "", ""),
U_BOOT_CMD_MKENT(counter, 1, 1, do_mmcrpmb_counter, "", ""),
};
-static int do_mmcrpmb(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_mmcrpmb(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
- cmd_tbl_t *cp;
+ struct cmd_tbl *cp;
struct mmc *mmc;
char original_part;
int ret;
@@ -314,8 +322,8 @@ static int do_mmcrpmb(cmd_tbl_t *cmdtp, int flag,
}
#endif
-static int do_mmc_read(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_mmc_read(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
struct mmc *mmc;
u32 blk, cnt, n;
@@ -356,8 +364,8 @@ static lbaint_t mmc_sparse_reserve(struct sparse_storage *info,
return blkcnt;
}
-static int do_mmc_sparse_write(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_mmc_sparse_write(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
struct sparse_storage sparse;
struct blk_desc *dev_desc;
@@ -407,8 +415,8 @@ static int do_mmc_sparse_write(cmd_tbl_t *cmdtp, int flag,
#endif
#if CONFIG_IS_ENABLED(MMC_WRITE)
-static int do_mmc_write(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_mmc_write(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
struct mmc *mmc;
u32 blk, cnt, n;
@@ -437,8 +445,9 @@ static int do_mmc_write(cmd_tbl_t *cmdtp, int flag,
return (n == cnt) ? CMD_RET_SUCCESS : CMD_RET_FAILURE;
}
-static int do_mmc_erase(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+
+static int do_mmc_erase(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
struct mmc *mmc;
u32 blk, cnt, n;
@@ -467,8 +476,8 @@ static int do_mmc_erase(cmd_tbl_t *cmdtp, int flag,
}
#endif
-static int do_mmc_rescan(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_mmc_rescan(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
struct mmc *mmc;
@@ -478,8 +487,9 @@ static int do_mmc_rescan(cmd_tbl_t *cmdtp, int flag,
return CMD_RET_SUCCESS;
}
-static int do_mmc_part(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+
+static int do_mmc_part(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
struct blk_desc *mmc_dev;
struct mmc *mmc;
@@ -497,8 +507,9 @@ static int do_mmc_part(cmd_tbl_t *cmdtp, int flag,
puts("get mmc type error!\n");
return CMD_RET_FAILURE;
}
-static int do_mmc_dev(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+
+static int do_mmc_dev(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
int dev, part = 0, ret;
struct mmc *mmc;
@@ -538,8 +549,9 @@ static int do_mmc_dev(cmd_tbl_t *cmdtp, int flag,
return CMD_RET_SUCCESS;
}
-static int do_mmc_list(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+
+static int do_mmc_list(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
print_mmc_devices('\n');
return CMD_RET_SUCCESS;
@@ -547,7 +559,7 @@ static int do_mmc_list(cmd_tbl_t *cmdtp, int flag,
#if CONFIG_IS_ENABLED(MMC_HW_PARTITIONING)
static int parse_hwpart_user(struct mmc_hwpart_conf *pconf,
- int argc, char * const argv[])
+ int argc, char *const argv[])
{
int i = 0;
@@ -581,7 +593,7 @@ static int parse_hwpart_user(struct mmc_hwpart_conf *pconf,
}
static int parse_hwpart_gp(struct mmc_hwpart_conf *pconf, int pidx,
- int argc, char * const argv[])
+ int argc, char *const argv[])
{
int i;
@@ -614,8 +626,8 @@ static int parse_hwpart_gp(struct mmc_hwpart_conf *pconf, int pidx,
return i;
}
-static int do_mmc_hwpartition(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_mmc_hwpartition(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
struct mmc *mmc;
struct mmc_hwpart_conf pconf = { };
@@ -698,8 +710,8 @@ static int do_mmc_hwpartition(cmd_tbl_t *cmdtp, int flag,
#endif
#ifdef CONFIG_SUPPORT_EMMC_BOOT
-static int do_mmc_bootbus(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_mmc_bootbus(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
int dev;
struct mmc *mmc;
@@ -724,8 +736,9 @@ static int do_mmc_bootbus(cmd_tbl_t *cmdtp, int flag,
/* acknowledge to be sent during boot operation */
return mmc_set_boot_bus_width(mmc, width, reset, mode);
}
-static int do_mmc_boot_resize(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+
+static int do_mmc_boot_resize(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
int dev;
struct mmc *mmc;
@@ -777,8 +790,8 @@ static int mmc_partconf_print(struct mmc *mmc)
return CMD_RET_SUCCESS;
}
-static int do_mmc_partconf(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_mmc_partconf(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
int dev;
struct mmc *mmc;
@@ -808,8 +821,9 @@ static int do_mmc_partconf(cmd_tbl_t *cmdtp, int flag,
/* acknowledge to be sent during boot operation */
return mmc_set_part_conf(mmc, ack, part_num, access);
}
-static int do_mmc_rst_func(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+
+static int do_mmc_rst_func(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
int dev;
struct mmc *mmc;
@@ -843,8 +857,8 @@ static int do_mmc_rst_func(cmd_tbl_t *cmdtp, int flag,
return mmc_set_rst_n_function(mmc, enable);
}
#endif
-static int do_mmc_setdsr(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_mmc_setdsr(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
struct mmc *mmc;
u32 val;
@@ -872,8 +886,8 @@ static int do_mmc_setdsr(cmd_tbl_t *cmdtp, int flag,
}
#ifdef CONFIG_CMD_BKOPS_ENABLE
-static int do_mmc_bkops_enable(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_mmc_bkops_enable(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
int dev;
struct mmc *mmc;
@@ -896,7 +910,7 @@ static int do_mmc_bkops_enable(cmd_tbl_t *cmdtp, int flag,
}
#endif
-static int do_mmc_boot_wp(cmd_tbl_t *cmdtp, int flag,
+static int do_mmc_boot_wp(struct cmd_tbl *cmdtp, int flag,
int argc, char * const argv[])
{
int err;
@@ -916,7 +930,7 @@ static int do_mmc_boot_wp(cmd_tbl_t *cmdtp, int flag,
return CMD_RET_SUCCESS;
}
-static cmd_tbl_t cmd_mmc[] = {
+static struct cmd_tbl cmd_mmc[] = {
U_BOOT_CMD_MKENT(info, 1, 0, do_mmcinfo, "", ""),
U_BOOT_CMD_MKENT(read, 4, 1, do_mmc_read, "", ""),
U_BOOT_CMD_MKENT(wp, 1, 0, do_mmc_boot_wp, "", ""),
@@ -949,9 +963,10 @@ static cmd_tbl_t cmd_mmc[] = {
#endif
};
-static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_mmcops(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
- cmd_tbl_t *cp;
+ struct cmd_tbl *cp;
cp = find_cmd_tbl(argv[1], cmd_mmc, ARRAY_SIZE(cmd_mmc));
diff --git a/cmd/mp.c b/cmd/mp.c
index 4c8f5fc3fa..c2b5235a37 100644
--- a/cmd/mp.c
+++ b/cmd/mp.c
@@ -26,7 +26,7 @@ static int cpu_status_all(void)
}
static int
-cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+cpu_cmd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
unsigned long cpuid;
diff --git a/cmd/mtd.c b/cmd/mtd.c
index f407c5e445..485a963bdd 100644
--- a/cmd/mtd.c
+++ b/cmd/mtd.c
@@ -195,8 +195,8 @@ static bool mtd_oob_write_is_empty(struct mtd_oob_ops *op)
return true;
}
-static int do_mtd_list(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_mtd_list(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct mtd_info *mtd;
int dev_nb = 0;
@@ -240,7 +240,8 @@ static int mtd_special_write_oob(struct mtd_info *mtd, u64 off,
return ret;
}
-static int do_mtd_io(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_mtd_io(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
bool dump, read, raw, woob, write_empty_pages, has_pages = false;
u64 start_off, off, len, remaining, default_len;
@@ -382,8 +383,8 @@ out_put_mtd:
return ret;
}
-static int do_mtd_erase(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_mtd_erase(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct erase_info erase_op = {};
struct mtd_info *mtd;
@@ -454,8 +455,8 @@ out_put_mtd:
return ret;
}
-static int do_mtd_bad(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_mtd_bad(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct mtd_info *mtd;
loff_t off;
@@ -485,7 +486,7 @@ out_put_mtd:
}
#ifdef CONFIG_AUTO_COMPLETE
-static int mtd_name_complete(int argc, char * const argv[], char last_char,
+static int mtd_name_complete(int argc, char *const argv[], char last_char,
int maxv, char *cmdv[])
{
int len = 0, n_found = 0;
diff --git a/cmd/mtdparts.c b/cmd/mtdparts.c
index b40c2afadd..5220142b9a 100644
--- a/cmd/mtdparts.c
+++ b/cmd/mtdparts.c
@@ -73,6 +73,7 @@
#include <common.h>
#include <command.h>
#include <env.h>
+#include <log.h>
#include <malloc.h>
#include <jffs2/load_kernel.h>
#include <linux/list.h>
@@ -1915,7 +1916,8 @@ static struct part_info* mtd_part_info(struct mtd_device *dev, unsigned int part
* @param argv arguments list
* @return 0 on success, 1 otherwise
*/
-static int do_chpart(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_chpart(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
/* command line only */
struct mtd_device *dev;
@@ -1953,8 +1955,8 @@ static int do_chpart(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
* @param argv arguments list
* @return 0 on success, 1 otherwise
*/
-static int do_mtdparts(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_mtdparts(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
if (argc == 2) {
if (strcmp(argv[1], "default") == 0) {
diff --git a/cmd/mvebu/bubt.c b/cmd/mvebu/bubt.c
index ef53153c46..a27b0df8ae 100644
--- a/cmd/mvebu/bubt.c
+++ b/cmd/mvebu/bubt.c
@@ -8,7 +8,9 @@
#include <common.h>
#include <command.h>
#include <env.h>
+#include <flash.h>
#include <image.h>
+#include <net.h>
#include <vsprintf.h>
#include <errno.h>
#include <dm.h>
@@ -827,7 +829,7 @@ else
#endif
#endif /* DEFAULT_BUBT_DST */
-int do_bubt_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_bubt_cmd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
struct bubt_dev *src, *dst;
size_t image_size;
diff --git a/cmd/nand.c b/cmd/nand.c
index 4de6892a01..92d039af8f 100644
--- a/cmd/nand.c
+++ b/cmd/nand.c
@@ -20,7 +20,9 @@
*/
#include <common.h>
+#include <bootstage.h>
#include <image.h>
+#include <asm/cache.h>
#include <linux/mtd/mtd.h>
#include <command.h>
#include <console.h>
@@ -187,7 +189,7 @@ static void do_nand_status(struct mtd_info *mtd)
#ifdef CONFIG_ENV_OFFSET_OOB
unsigned long nand_env_oob_offset;
-int do_nand_env_oob(cmd_tbl_t *cmdtp, int argc, char *const argv[])
+int do_nand_env_oob(struct cmd_tbl *cmdtp, int argc, char *const argv[])
{
int ret;
uint32_t oob_buf[ENV_OFFSET_SIZE/sizeof(uint32_t)];
@@ -374,7 +376,8 @@ static void adjust_size_for_badblocks(loff_t *size, loff_t offset, int dev)
}
}
-static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_nand(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int i, ret = 0;
ulong addr;
@@ -843,7 +846,7 @@ U_BOOT_CMD(
"NAND sub-system", nand_help_text
);
-static int nand_load_image(cmd_tbl_t *cmdtp, struct mtd_info *mtd,
+static int nand_load_image(struct cmd_tbl *cmdtp, struct mtd_info *mtd,
ulong offset, ulong addr, char *cmd)
{
int r;
@@ -931,8 +934,8 @@ static int nand_load_image(cmd_tbl_t *cmdtp, struct mtd_info *mtd,
return bootm_maybe_autostart(cmdtp, cmd);
}
-static int do_nandboot(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_nandboot(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
char *boot_device = NULL;
int idx;
diff --git a/cmd/net.c b/cmd/net.c
index 1b724cc570..25390b0474 100644
--- a/cmd/net.c
+++ b/cmd/net.c
@@ -8,15 +8,17 @@
* Boot support
*/
#include <common.h>
+#include <bootstage.h>
#include <command.h>
#include <env.h>
#include <image.h>
#include <net.h>
-static int netboot_common(enum proto_t, cmd_tbl_t *, int, char * const []);
+static int netboot_common(enum proto_t, struct cmd_tbl *, int, char * const []);
#ifdef CONFIG_CMD_BOOTP
-static int do_bootp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_bootp(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return netboot_common(BOOTP, cmdtp, argc, argv);
}
@@ -29,7 +31,7 @@ U_BOOT_CMD(
#endif
#ifdef CONFIG_CMD_TFTPBOOT
-int do_tftpb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_tftpb(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
int ret;
@@ -47,7 +49,8 @@ U_BOOT_CMD(
#endif
#ifdef CONFIG_CMD_TFTPPUT
-static int do_tftpput(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_tftpput(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return netboot_common(TFTPPUT, cmdtp, argc, argv);
}
@@ -60,7 +63,8 @@ U_BOOT_CMD(
#endif
#ifdef CONFIG_CMD_TFTPSRV
-static int do_tftpsrv(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+static int do_tftpsrv(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return netboot_common(TFTPSRV, cmdtp, argc, argv);
}
@@ -77,7 +81,7 @@ U_BOOT_CMD(
#ifdef CONFIG_CMD_RARP
-int do_rarpb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_rarpb(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
return netboot_common(RARP, cmdtp, argc, argv);
}
@@ -90,7 +94,8 @@ U_BOOT_CMD(
#endif
#if defined(CONFIG_CMD_DHCP)
-static int do_dhcp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return netboot_common(DHCP, cmdtp, argc, argv);
}
@@ -103,7 +108,8 @@ U_BOOT_CMD(
#endif
#if defined(CONFIG_CMD_NFS)
-static int do_nfs(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_nfs(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return netboot_common(NFS, cmdtp, argc, argv);
}
@@ -176,8 +182,8 @@ static void netboot_update_env(void)
#endif
}
-static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
- char * const argv[])
+static int netboot_common(enum proto_t proto, struct cmd_tbl *cmdtp, int argc,
+ char *const argv[])
{
char *s;
char *end;
@@ -272,7 +278,8 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
}
#if defined(CONFIG_CMD_PING)
-static int do_ping(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_ping(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
if (argc < 2)
return CMD_RET_USAGE;
@@ -320,7 +327,7 @@ static void cdp_update_env(void)
}
}
-int do_cdp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_cdp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
int r;
@@ -343,7 +350,7 @@ U_BOOT_CMD(
#endif
#if defined(CONFIG_CMD_SNTP)
-int do_sntp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_sntp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char *toff;
@@ -384,7 +391,7 @@ U_BOOT_CMD(
#endif
#if defined(CONFIG_CMD_DNS)
-int do_dns(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_dns(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
if (argc == 1)
return CMD_RET_USAGE;
@@ -430,8 +437,8 @@ U_BOOT_CMD(
#endif /* CONFIG_CMD_DNS */
#if defined(CONFIG_CMD_LINK_LOCAL)
-static int do_link_local(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_link_local(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
char tmp[22];
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 966c134059..08d49df220 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -29,10 +29,13 @@
#include <console.h>
#include <env.h>
#include <env_internal.h>
+#include <log.h>
+#include <net.h>
#include <search.h>
#include <errno.h>
#include <malloc.h>
#include <mapmem.h>
+#include <linux/bitops.h>
#include <u-boot/crc.h>
#include <watchdog.h>
#include <linux/stddef.h>
@@ -120,8 +123,8 @@ static int env_print(char *name, int flag)
return 0;
}
-static int do_env_print(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_env_print(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int i;
int rcode = 0;
@@ -162,8 +165,8 @@ static int do_env_print(cmd_tbl_t *cmdtp, int flag, int argc,
}
#ifdef CONFIG_CMD_GREPENV
-static int do_env_grep(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_env_grep(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
char *res = NULL;
int len, grep_how, grep_what;
@@ -222,7 +225,7 @@ DONE:
* Set a new environment variable,
* or replace or delete an existing one.
*/
-static int _do_env_set(int flag, int argc, char * const argv[], int env_flag)
+static int _do_env_set(int flag, int argc, char *const argv[], int env_flag)
{
int i, len;
char *name, *value, *s;
@@ -378,7 +381,8 @@ int eth_env_set_enetaddr(const char *name, const uint8_t *enetaddr)
}
#ifndef CONFIG_SPL_BUILD
-static int do_env_set(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_env_set(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
if (argc < 2)
return CMD_RET_USAGE;
@@ -390,7 +394,7 @@ static int do_env_set(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
* Prompt for environment variable
*/
#if defined(CONFIG_CMD_ASKENV)
-int do_env_ask(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_env_ask(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char message[CONFIG_SYS_CBSIZE];
int i, len, pos, size;
@@ -508,7 +512,8 @@ static int print_active_callback(struct env_entry *entry)
/*
* Print the callbacks available and what they are bound to
*/
-int do_env_callback(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_env_callback(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct env_clbk_tbl *clbkp;
int i;
@@ -576,7 +581,7 @@ static int print_active_flags(struct env_entry *entry)
/*
* Print the flags available and what variables have flags
*/
-int do_env_flags(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_env_flags(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
/* Print the available variable types */
printf("Available variable type flags (position %d):\n",
@@ -618,8 +623,8 @@ int do_env_flags(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
* Interactively edit an environment variable
*/
#if defined(CONFIG_CMD_EDITENV)
-static int do_env_edit(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_env_edit(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
char buffer[CONFIG_SYS_CBSIZE];
char *init_val;
@@ -763,8 +768,8 @@ ulong env_get_ulong(const char *name, int base, ulong default_val)
#ifndef CONFIG_SPL_BUILD
#if defined(CONFIG_CMD_SAVEENV) && defined(ENV_IS_IN_DEVICE)
-static int do_env_save(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_env_save(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return env_save() ? 1 : 0;
}
@@ -776,8 +781,8 @@ U_BOOT_CMD(
);
#if defined(CONFIG_CMD_ERASEENV)
-static int do_env_erase(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_env_erase(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return env_erase() ? 1 : 0;
}
@@ -807,8 +812,8 @@ int env_match(uchar *s1, int i2)
}
#ifndef CONFIG_SPL_BUILD
-static int do_env_default(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_env_default(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
int all = 0, env_flag = H_INTERACTIVE;
@@ -845,8 +850,8 @@ static int do_env_default(cmd_tbl_t *cmdtp, int flag,
return cmd_usage(cmdtp);
}
-static int do_env_delete(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_env_delete(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
int env_flag = H_INTERACTIVE;
int ret = 0;
@@ -926,8 +931,8 @@ static int do_env_delete(cmd_tbl_t *cmdtp, int flag,
*
* => env import -d -t ${backup_addr}
*/
-static int do_env_export(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_env_export(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
char buf[32];
ulong addr;
@@ -1059,8 +1064,8 @@ sep_err:
* the environment at address 'addr'. Without arguments, the whole
* environment gets imported.
*/
-static int do_env_import(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_env_import(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
ulong addr;
char *cmd, *ptr;
@@ -1220,8 +1225,8 @@ static int print_env_info(void)
* env info [-d] - evaluate whether default environment is used
* env info [-p] - evaluate whether environment can be persisted
*/
-static int do_env_info(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_env_info(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
int eval_flags = 0;
int eval_results = 0;
@@ -1277,8 +1282,8 @@ static int do_env_info(cmd_tbl_t *cmdtp, int flag,
#endif
#if defined(CONFIG_CMD_ENV_EXISTS)
-static int do_env_exists(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_env_exists(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct env_entry e, *ep;
@@ -1296,7 +1301,7 @@ static int do_env_exists(cmd_tbl_t *cmdtp, int flag, int argc,
/*
* New command line interface: "env" command with subcommands
*/
-static cmd_tbl_t cmd_env_sub[] = {
+static struct cmd_tbl cmd_env_sub[] = {
#if defined(CONFIG_CMD_ASKENV)
U_BOOT_CMD_MKENT(ask, CONFIG_SYS_MAXARGS, 1, do_env_ask, "", ""),
#endif
@@ -1346,9 +1351,9 @@ void env_reloc(void)
}
#endif
-static int do_env(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_env(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
- cmd_tbl_t *cp;
+ struct cmd_tbl *cp;
if (argc < 2)
return CMD_RET_USAGE;
diff --git a/cmd/nvedit_efi.c b/cmd/nvedit_efi.c
index 6f69a84fea..29cad38e19 100644
--- a/cmd/nvedit_efi.c
+++ b/cmd/nvedit_efi.c
@@ -14,6 +14,7 @@
#include <hexdump.h>
#include <malloc.h>
#include <mapmem.h>
+#include <uuid.h>
#include <linux/kernel.h>
/*
@@ -137,7 +138,7 @@ out:
*
* Show information encoded in named UEFI variables
*/
-static int efi_dump_vars(int argc, char * const argv[],
+static int efi_dump_vars(int argc, char *const argv[],
const efi_guid_t *guid, bool verbose)
{
u16 *var_name16, *p;
@@ -171,7 +172,7 @@ static int efi_dump_vars(int argc, char * const argv[],
return CMD_RET_SUCCESS;
}
-static bool match_name(int argc, char * const argv[], u16 *var_name16)
+static bool match_name(int argc, char *const argv[], u16 *var_name16)
{
char *buf, *p;
size_t buflen;
@@ -209,7 +210,7 @@ out:
*
* Show information encoded in all the UEFI variables
*/
-static int efi_dump_var_all(int argc, char * const argv[],
+static int efi_dump_var_all(int argc, char *const argv[],
const efi_guid_t *guid_p, bool verbose)
{
u16 *var_name16, *p;
@@ -274,7 +275,8 @@ static int efi_dump_var_all(int argc, char * const argv[],
* If one or more variable names are specified, show information
* named UEFI variables, otherwise show all the UEFI variables.
*/
-int do_env_print_efi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_env_print_efi(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
efi_guid_t guid;
const efi_guid_t *guid_p;
@@ -464,7 +466,8 @@ out:
* Encode values specified and set given UEFI variable.
* If no value is specified, delete the variable.
*/
-int do_env_set_efi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_env_set_efi(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
char *var_name, *value, *ep;
ulong addr;
diff --git a/cmd/nvme.c b/cmd/nvme.c
index 5da903bd52..e715c570a3 100644
--- a/cmd/nvme.c
+++ b/cmd/nvme.c
@@ -5,13 +5,15 @@
*/
#include <common.h>
+#include <blk.h>
#include <command.h>
#include <dm.h>
#include <nvme.h>
static int nvme_curr_dev;
-static int do_nvme(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_nvme(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int ret;
diff --git a/cmd/onenand.c b/cmd/onenand.c
index d97844fa7a..216458bb47 100644
--- a/cmd/onenand.c
+++ b/cmd/onenand.c
@@ -24,7 +24,7 @@ static struct mtd_info *mtd;
static loff_t next_ofs;
static loff_t skip_ofs;
-static int arg_off_size_onenand(int argc, char * const argv[], ulong *off,
+static int arg_off_size_onenand(int argc, char *const argv[], ulong *off,
size_t *size)
{
if (argc >= 1) {
@@ -358,13 +358,15 @@ static int onenand_dump(struct mtd_info *mtd, ulong off, int only_oob)
return 0;
}
-static int do_onenand_info(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+static int do_onenand_info(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
printf("%s\n", mtd->name);
return 0;
}
-static int do_onenand_bad(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+static int do_onenand_bad(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong ofs;
@@ -379,7 +381,8 @@ static int do_onenand_bad(cmd_tbl_t * cmdtp, int flag, int argc, char * const ar
return 0;
}
-static int do_onenand_read(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+static int do_onenand_read(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
char *s;
int oob = 0;
@@ -408,7 +411,8 @@ static int do_onenand_read(cmd_tbl_t * cmdtp, int flag, int argc, char * const a
return ret == 0 ? 0 : 1;
}
-static int do_onenand_write(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+static int do_onenand_write(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong addr, ofs;
size_t len;
@@ -434,7 +438,8 @@ static int do_onenand_write(cmd_tbl_t * cmdtp, int flag, int argc, char * const
return ret == 0 ? 0 : 1;
}
-static int do_onenand_erase(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+static int do_onenand_erase(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong ofs;
int ret = 0;
@@ -470,7 +475,8 @@ static int do_onenand_erase(cmd_tbl_t * cmdtp, int flag, int argc, char * const
return ret == 0 ? 0 : 1;
}
-static int do_onenand_test(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+static int do_onenand_test(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong ofs;
int ret = 0;
@@ -495,7 +501,8 @@ static int do_onenand_test(cmd_tbl_t * cmdtp, int flag, int argc, char * const a
return ret == 0 ? 0 : 1;
}
-static int do_onenand_dump(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+static int do_onenand_dump(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong ofs;
int ret = 0;
@@ -515,7 +522,8 @@ static int do_onenand_dump(cmd_tbl_t * cmdtp, int flag, int argc, char * const a
return ret == 0 ? 1 : 0;
}
-static int do_onenand_markbad(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+static int do_onenand_markbad(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int ret = 0;
ulong addr;
@@ -545,7 +553,7 @@ static int do_onenand_markbad(cmd_tbl_t * cmdtp, int flag, int argc, char * cons
return ret;
}
-static cmd_tbl_t cmd_onenand_sub[] = {
+static struct cmd_tbl cmd_onenand_sub[] = {
U_BOOT_CMD_MKENT(info, 1, 0, do_onenand_info, "", ""),
U_BOOT_CMD_MKENT(bad, 1, 0, do_onenand_bad, "", ""),
U_BOOT_CMD_MKENT(read, 4, 0, do_onenand_read, "", ""),
@@ -563,9 +571,10 @@ void onenand_reloc(void) {
}
#endif
-static int do_onenand(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+static int do_onenand(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/cmd/osd.c b/cmd/osd.c
index 0b1fa49936..bdad5d8e96 100644
--- a/cmd/osd.c
+++ b/cmd/osd.c
@@ -10,6 +10,7 @@
*/
#include <common.h>
+#include <command.h>
#include <dm.h>
#include <hexdump.h>
#include <video_osd.h>
@@ -80,8 +81,8 @@ static void show_osd(struct udevice *osd)
printf("\n");
}
-static int do_osd_write(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_osd_write(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
uint x, y;
uint count;
@@ -131,8 +132,8 @@ static int do_osd_write(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_SUCCESS;
}
-static int do_osd_print(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_osd_print(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
uint x, y;
u8 color;
@@ -161,8 +162,8 @@ static int do_osd_print(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_SUCCESS;
}
-static int do_osd_size(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_osd_size(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
uint x, y;
int res;
@@ -187,8 +188,8 @@ static int do_osd_size(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_SUCCESS;
}
-static int do_show_osd(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_show_osd(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *osd;
@@ -223,8 +224,8 @@ static int do_show_osd(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_SUCCESS;
}
-static int do_osd_num(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_osd_num(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int osd_no;
int res = 0;
@@ -250,7 +251,7 @@ static int do_osd_num(cmd_tbl_t *cmdtp, int flag, int argc,
return res ? CMD_RET_FAILURE : CMD_RET_SUCCESS;
}
-static cmd_tbl_t cmd_osd_sub[] = {
+static struct cmd_tbl cmd_osd_sub[] = {
U_BOOT_CMD_MKENT(show, 1, 1, do_show_osd, "", ""),
U_BOOT_CMD_MKENT(dev, 1, 1, do_osd_num, "", ""),
U_BOOT_CMD_MKENT(write, 4, 1, do_osd_write, "", ""),
@@ -258,9 +259,9 @@ static cmd_tbl_t cmd_osd_sub[] = {
U_BOOT_CMD_MKENT(size, 2, 1, do_osd_size, "", ""),
};
-static int do_osd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_osd(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/cmd/part.c b/cmd/part.c
index 5e4e45ca6d..216f14bf5d 100644
--- a/cmd/part.c
+++ b/cmd/part.c
@@ -28,11 +28,11 @@ enum cmd_part_info {
CMD_PART_INFO_NUMBER
};
-static int do_part_uuid(int argc, char * const argv[])
+static int do_part_uuid(int argc, char *const argv[])
{
int part;
struct blk_desc *dev_desc;
- disk_partition_t info;
+ struct disk_partition info;
if (argc < 2)
return CMD_RET_USAGE;
@@ -51,7 +51,7 @@ static int do_part_uuid(int argc, char * const argv[])
return 0;
}
-static int do_part_list(int argc, char * const argv[])
+static int do_part_list(int argc, char *const argv[])
{
int ret;
struct blk_desc *desc;
@@ -90,7 +90,7 @@ static int do_part_list(int argc, char * const argv[])
if (var != NULL) {
int p;
char str[512] = { '\0', };
- disk_partition_t info;
+ struct disk_partition info;
for (p = 1; p < MAX_SEARCH_PARTITIONS; p++) {
char t[5];
@@ -114,10 +114,10 @@ static int do_part_list(int argc, char * const argv[])
return 0;
}
-static int do_part_info(int argc, char * const argv[], enum cmd_part_info param)
+static int do_part_info(int argc, char *const argv[], enum cmd_part_info param)
{
struct blk_desc *desc;
- disk_partition_t info;
+ struct disk_partition info;
char buf[512] = { 0 };
char *endp;
int part;
@@ -167,22 +167,23 @@ static int do_part_info(int argc, char * const argv[], enum cmd_part_info param)
return 0;
}
-static int do_part_start(int argc, char * const argv[])
+static int do_part_start(int argc, char *const argv[])
{
return do_part_info(argc, argv, CMD_PART_INFO_START);
}
-static int do_part_size(int argc, char * const argv[])
+static int do_part_size(int argc, char *const argv[])
{
return do_part_info(argc, argv, CMD_PART_INFO_SIZE);
}
-static int do_part_number(int argc, char * const argv[])
+static int do_part_number(int argc, char *const argv[])
{
return do_part_info(argc, argv, CMD_PART_INFO_NUMBER);
}
-static int do_part(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_part(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
if (argc < 2)
return CMD_RET_USAGE;
diff --git a/cmd/pcap.c b/cmd/pcap.c
index 980603f7bd..d0172f3fff 100644
--- a/cmd/pcap.c
+++ b/cmd/pcap.c
@@ -9,8 +9,8 @@
#include <net.h>
#include <net/pcap.h>
-static int do_pcap_init(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_pcap_init(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
phys_addr_t addr;
unsigned int size;
@@ -24,26 +24,26 @@ static int do_pcap_init(cmd_tbl_t *cmdtp, int flag, int argc,
return pcap_init(addr, size) ? CMD_RET_FAILURE : CMD_RET_SUCCESS;
}
-static int do_pcap_start(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_pcap_start(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return pcap_start_stop(true) ? CMD_RET_FAILURE : CMD_RET_SUCCESS;
}
-static int do_pcap_stop(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_pcap_stop(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return pcap_start_stop(false) ? CMD_RET_FAILURE : CMD_RET_SUCCESS;
}
-static int do_pcap_status(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_pcap_status(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return pcap_print_status() ? CMD_RET_FAILURE : CMD_RET_SUCCESS;
}
-static int do_pcap_clear(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_pcap_clear(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return pcap_clear() ? CMD_RET_FAILURE : CMD_RET_SUCCESS;
}
diff --git a/cmd/pci.c b/cmd/pci.c
index 0043471fc7..f91a4eb8ed 100644
--- a/cmd/pci.c
+++ b/cmd/pci.c
@@ -18,6 +18,7 @@
#include <command.h>
#include <console.h>
#include <dm.h>
+#include <init.h>
#include <asm/processor.h>
#include <asm/io.h>
#include <pci.h>
@@ -655,7 +656,7 @@ static void pci_show_regions(struct udevice *bus)
* pci modify[.b, .w, .l] bus.device.function [addr]
* pci write[.b, .w, .l] bus.device.function addr value
*/
-static int do_pci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_pci(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
ulong addr = 0, value = 0, cmd_size = 0;
enum pci_size_t size = PCI_SIZE_32;
diff --git a/cmd/pinmux.c b/cmd/pinmux.c
index de909a163d..9942b15419 100644
--- a/cmd/pinmux.c
+++ b/cmd/pinmux.c
@@ -14,7 +14,8 @@
static struct udevice *currdev;
-static int do_dev(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_dev(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
const char *name;
int ret;
@@ -75,7 +76,8 @@ static int show_pinmux(struct udevice *dev)
return 0;
}
-static int do_status(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_status(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *dev;
int ret = CMD_RET_USAGE;
@@ -99,7 +101,8 @@ static int do_status(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return ret;
}
-static int do_list(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_list(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *dev;
@@ -118,16 +121,16 @@ static int do_list(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return CMD_RET_SUCCESS;
}
-static cmd_tbl_t pinmux_subcmd[] = {
+static struct cmd_tbl pinmux_subcmd[] = {
U_BOOT_CMD_MKENT(dev, 2, 1, do_dev, "", ""),
U_BOOT_CMD_MKENT(list, 1, 1, do_list, "", ""),
U_BOOT_CMD_MKENT(status, 2, 1, do_status, "", ""),
};
-static int do_pinmux(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_pinmux(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
- cmd_tbl_t *cmd;
+ struct cmd_tbl *cmd;
argc--;
argv++;
diff --git a/cmd/pmc.c b/cmd/pmc.c
index cafeba9fcc..9a3ba2bffc 100644
--- a/cmd/pmc.c
+++ b/cmd/pmc.c
@@ -30,7 +30,8 @@ static int get_pmc_dev(struct udevice **devp)
return 0;
}
-static int do_pmc_init(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+static int do_pmc_init(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *dev;
int ret;
@@ -42,7 +43,8 @@ static int do_pmc_init(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
return 0;
}
-static int do_pmc_info(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+static int do_pmc_info(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *dev;
int ret;
@@ -55,14 +57,14 @@ static int do_pmc_info(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
return 0;
}
-static cmd_tbl_t cmd_pmc_sub[] = {
+static struct cmd_tbl cmd_pmc_sub[] = {
U_BOOT_CMD_MKENT(init, 0, 1, do_pmc_init, "", ""),
U_BOOT_CMD_MKENT(info, 0, 1, do_pmc_info, "", ""),
};
-static int do_pmc(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+static int do_pmc(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
- const cmd_tbl_t *cp;
+ const struct cmd_tbl *cp;
if (argc < 2) /* no subcommand */
return cmd_usage(cmdtp);
diff --git a/cmd/pmic.c b/cmd/pmic.c
index 2400bfb601..3bda0534a3 100644
--- a/cmd/pmic.c
+++ b/cmd/pmic.c
@@ -4,6 +4,7 @@
* Przemyslaw Marczak <p.marczak@samsung.com>
*/
#include <common.h>
+#include <command.h>
#include <errno.h>
#include <dm.h>
#include <dm/uclass-internal.h>
@@ -21,7 +22,7 @@ static int failure(int ret)
return CMD_RET_FAILURE;
}
-static int do_dev(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_dev(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char *name;
int ret = -ENODEV;
@@ -46,7 +47,8 @@ static int do_dev(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return CMD_RET_SUCCESS;
}
-static int do_list(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_list(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *dev;
int ret;
@@ -73,7 +75,8 @@ static int do_list(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return CMD_RET_SUCCESS;
}
-static int do_dump(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_dump(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct uc_pmic_priv *priv;
struct udevice *dev;
@@ -118,7 +121,8 @@ static int do_dump(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return CMD_RET_SUCCESS;
}
-static int do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_read(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct uc_pmic_priv *priv;
struct udevice *dev;
@@ -157,7 +161,8 @@ static int do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return CMD_RET_SUCCESS;
}
-static int do_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_write(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *dev;
uint reg, value;
@@ -191,7 +196,7 @@ static int do_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return CMD_RET_SUCCESS;
}
-static cmd_tbl_t subcmd[] = {
+static struct cmd_tbl subcmd[] = {
U_BOOT_CMD_MKENT(dev, 2, 1, do_dev, "", ""),
U_BOOT_CMD_MKENT(list, 1, 1, do_list, "", ""),
U_BOOT_CMD_MKENT(dump, 1, 1, do_dump, "", ""),
@@ -199,10 +204,10 @@ static cmd_tbl_t subcmd[] = {
U_BOOT_CMD_MKENT(write, 3, 1, do_write, "", ""),
};
-static int do_pmic(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_pmic(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
- cmd_tbl_t *cmd;
+ struct cmd_tbl *cmd;
argc--;
argv++;
diff --git a/cmd/pxe.c b/cmd/pxe.c
index bce6728875..6372fc9871 100644
--- a/cmd/pxe.c
+++ b/cmd/pxe.c
@@ -24,7 +24,8 @@ const char *pxe_default_paths[] = {
NULL
};
-static int do_get_tftp(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr)
+static int do_get_tftp(struct cmd_tbl *cmdtp, const char *file_path,
+ char *file_addr)
{
char *tftp_argv[] = {"tftp", NULL, NULL, NULL};
@@ -42,7 +43,7 @@ static int do_get_tftp(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr)
*
* Returns 1 on success or < 0 on error.
*/
-static int pxe_uuid_path(cmd_tbl_t *cmdtp, unsigned long pxefile_addr_r)
+static int pxe_uuid_path(struct cmd_tbl *cmdtp, unsigned long pxefile_addr_r)
{
char *uuid_str;
@@ -60,7 +61,7 @@ static int pxe_uuid_path(cmd_tbl_t *cmdtp, unsigned long pxefile_addr_r)
*
* Returns 1 on success or < 0 on error.
*/
-static int pxe_mac_path(cmd_tbl_t *cmdtp, unsigned long pxefile_addr_r)
+static int pxe_mac_path(struct cmd_tbl *cmdtp, unsigned long pxefile_addr_r)
{
char mac_str[21];
int err;
@@ -80,7 +81,7 @@ static int pxe_mac_path(cmd_tbl_t *cmdtp, unsigned long pxefile_addr_r)
*
* Returns 1 on success or < 0 on error.
*/
-static int pxe_ipaddr_paths(cmd_tbl_t *cmdtp, unsigned long pxefile_addr_r)
+static int pxe_ipaddr_paths(struct cmd_tbl *cmdtp, unsigned long pxefile_addr_r)
{
char ip_addr[9];
int mask_pos, err;
@@ -113,7 +114,7 @@ static int pxe_ipaddr_paths(cmd_tbl_t *cmdtp, unsigned long pxefile_addr_r)
* Returns 0 on success or 1 on error.
*/
static int
-do_pxe_get(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+do_pxe_get(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char *pxefile_addr_str;
unsigned long pxefile_addr_r;
@@ -166,7 +167,7 @@ do_pxe_get(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
* Returns 0 on success, 1 on error.
*/
static int
-do_pxe_boot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+do_pxe_boot(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
unsigned long pxefile_addr_r;
struct pxe_menu *cfg;
@@ -206,14 +207,14 @@ do_pxe_boot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return 0;
}
-static cmd_tbl_t cmd_pxe_sub[] = {
+static struct cmd_tbl cmd_pxe_sub[] = {
U_BOOT_CMD_MKENT(get, 1, 1, do_pxe_get, "", ""),
U_BOOT_CMD_MKENT(boot, 2, 1, do_pxe_boot, "", "")
};
-static int do_pxe(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_pxe(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
- cmd_tbl_t *cp;
+ struct cmd_tbl *cp;
if (argc < 2)
return CMD_RET_USAGE;
diff --git a/cmd/pxe_utils.c b/cmd/pxe_utils.c
index c244bfb10d..8716e782f6 100644
--- a/cmd/pxe_utils.c
+++ b/cmd/pxe_utils.c
@@ -5,11 +5,14 @@
*/
#include <common.h>
+#include <command.h>
#include <env.h>
#include <image.h>
+#include <log.h>
#include <malloc.h>
#include <mapmem.h>
#include <lcd.h>
+#include <net.h>
#include <linux/string.h>
#include <linux/ctype.h>
#include <errno.h>
@@ -99,7 +102,8 @@ static int get_bootfile_path(const char *file_path, char *bootfile_path,
return 1;
}
-int (*do_getfile)(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr);
+int (*do_getfile)(struct cmd_tbl *cmdtp, const char *file_path,
+ char *file_addr);
/*
* As in pxelinux, paths to files referenced from files we retrieve are
@@ -109,7 +113,7 @@ int (*do_getfile)(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr);
*
* Returns 1 for success, or < 0 on error.
*/
-static int get_relfile(cmd_tbl_t *cmdtp, const char *file_path,
+static int get_relfile(struct cmd_tbl *cmdtp, const char *file_path,
unsigned long file_addr)
{
size_t path_len;
@@ -147,7 +151,7 @@ static int get_relfile(cmd_tbl_t *cmdtp, const char *file_path,
*
* Returns 1 on success, or < 0 for error.
*/
-int get_pxe_file(cmd_tbl_t *cmdtp, const char *file_path,
+int get_pxe_file(struct cmd_tbl *cmdtp, const char *file_path,
unsigned long file_addr)
{
unsigned long config_file_size;
@@ -188,7 +192,7 @@ int get_pxe_file(cmd_tbl_t *cmdtp, const char *file_path,
*
* Returns 1 on success or < 0 on error.
*/
-int get_pxelinux_path(cmd_tbl_t *cmdtp, const char *file,
+int get_pxelinux_path(struct cmd_tbl *cmdtp, const char *file,
unsigned long pxefile_addr_r)
{
size_t base_len = strlen(PXELINUX_DIR);
@@ -212,7 +216,7 @@ int get_pxelinux_path(cmd_tbl_t *cmdtp, const char *file,
*
* Returns 1 on success or < 0 on error.
*/
-static int get_relfile_envaddr(cmd_tbl_t *cmdtp, const char *file_path,
+static int get_relfile_envaddr(struct cmd_tbl *cmdtp, const char *file_path,
const char *envaddr_name)
{
unsigned long file_addr;
@@ -342,7 +346,7 @@ static int label_localboot(struct pxe_label *label)
* If the label specifies an 'append' line, its contents will overwrite that
* of the 'bootargs' environment variable.
*/
-static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label)
+static int label_boot(struct cmd_tbl *cmdtp, struct pxe_label *label)
{
char *bootm_argv[] = { "bootm", NULL, NULL, NULL, NULL };
char initrd_str[28];
@@ -821,7 +825,7 @@ static int parse_integer(char **c, int *dst)
return 1;
}
-static int parse_pxefile_top(cmd_tbl_t *cmdtp, char *p, unsigned long base,
+static int parse_pxefile_top(struct cmd_tbl *cmdtp, char *p, unsigned long base,
struct pxe_menu *cfg, int nest_level);
/*
@@ -832,7 +836,7 @@ static int parse_pxefile_top(cmd_tbl_t *cmdtp, char *p, unsigned long base,
* include, nest_level has already been incremented and doesn't need to be
* incremented here.
*/
-static int handle_include(cmd_tbl_t *cmdtp, char **c, unsigned long base,
+static int handle_include(struct cmd_tbl *cmdtp, char **c, unsigned long base,
struct pxe_menu *cfg, int nest_level)
{
char *include_path;
@@ -872,7 +876,7 @@ static int handle_include(cmd_tbl_t *cmdtp, char **c, unsigned long base,
* nest_level should be 1 when parsing the top level pxe file, 2 when parsing
* a file it includes, 3 when parsing a file included by that file, and so on.
*/
-static int parse_menu(cmd_tbl_t *cmdtp, char **c, struct pxe_menu *cfg,
+static int parse_menu(struct cmd_tbl *cmdtp, char **c, struct pxe_menu *cfg,
unsigned long base, int nest_level)
{
struct token t;
@@ -1085,7 +1089,7 @@ static int parse_label(char **c, struct pxe_menu *cfg)
*
* Returns 1 on success, < 0 on error.
*/
-static int parse_pxefile_top(cmd_tbl_t *cmdtp, char *p, unsigned long base,
+static int parse_pxefile_top(struct cmd_tbl *cmdtp, char *p, unsigned long base,
struct pxe_menu *cfg, int nest_level)
{
struct token t;
@@ -1193,7 +1197,7 @@ void destroy_pxe_menu(struct pxe_menu *cfg)
* files it includes). The resulting pxe_menu struct can be free()'d by using
* the destroy_pxe_menu() function.
*/
-struct pxe_menu *parse_pxefile(cmd_tbl_t *cmdtp, unsigned long menucfg)
+struct pxe_menu *parse_pxefile(struct cmd_tbl *cmdtp, unsigned long menucfg)
{
struct pxe_menu *cfg;
char *buf;
@@ -1277,7 +1281,7 @@ static struct menu *pxe_menu_to_menu(struct pxe_menu *cfg)
/*
* Try to boot any labels we have yet to attempt to boot.
*/
-static void boot_unattempted_labels(cmd_tbl_t *cmdtp, struct pxe_menu *cfg)
+static void boot_unattempted_labels(struct cmd_tbl *cmdtp, struct pxe_menu *cfg)
{
struct list_head *pos;
struct pxe_label *label;
@@ -1302,7 +1306,7 @@ static void boot_unattempted_labels(cmd_tbl_t *cmdtp, struct pxe_menu *cfg)
* If this function returns, there weren't any labels that successfully
* booted, or the user interrupted the menu selection via ctrl+c.
*/
-void handle_pxe_menu(cmd_tbl_t *cmdtp, struct pxe_menu *cfg)
+void handle_pxe_menu(struct cmd_tbl *cmdtp, struct pxe_menu *cfg)
{
void *choice;
struct menu *m;
diff --git a/cmd/pxe_utils.h b/cmd/pxe_utils.h
index a38ac81a47..77d2588875 100644
--- a/cmd/pxe_utils.h
+++ b/cmd/pxe_utils.h
@@ -74,15 +74,15 @@ struct pxe_menu {
extern bool is_pxe;
-extern int (*do_getfile)(cmd_tbl_t *cmdtp, const char *file_path,
+extern int (*do_getfile)(struct cmd_tbl *cmdtp, const char *file_path,
char *file_addr);
void destroy_pxe_menu(struct pxe_menu *cfg);
-int get_pxe_file(cmd_tbl_t *cmdtp, const char *file_path,
+int get_pxe_file(struct cmd_tbl *cmdtp, const char *file_path,
unsigned long file_addr);
-int get_pxelinux_path(cmd_tbl_t *cmdtp, const char *file,
+int get_pxelinux_path(struct cmd_tbl *cmdtp, const char *file,
unsigned long pxefile_addr_r);
-void handle_pxe_menu(cmd_tbl_t *cmdtp, struct pxe_menu *cfg);
-struct pxe_menu *parse_pxefile(cmd_tbl_t *cmdtp, unsigned long menucfg);
+void handle_pxe_menu(struct cmd_tbl *cmdtp, struct pxe_menu *cfg);
+struct pxe_menu *parse_pxefile(struct cmd_tbl *cmdtp, unsigned long menucfg);
int format_mac_pxe(char *outbuf, size_t outbuf_len);
#endif /* __PXE_UTILS_H */
diff --git a/cmd/qfw.c b/cmd/qfw.c
index af826627a2..bb571487f0 100644
--- a/cmd/qfw.c
+++ b/cmd/qfw.c
@@ -93,8 +93,8 @@ static int qemu_fwcfg_list_firmware(void)
return 0;
}
-static int qemu_fwcfg_do_list(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int qemu_fwcfg_do_list(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
if (qemu_fwcfg_list_firmware() < 0)
return CMD_RET_FAILURE;
@@ -102,8 +102,8 @@ static int qemu_fwcfg_do_list(cmd_tbl_t *cmdtp, int flag,
return 0;
}
-static int qemu_fwcfg_do_cpus(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int qemu_fwcfg_do_cpus(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
int ret = qemu_fwcfg_online_cpus();
if (ret < 0) {
@@ -116,8 +116,8 @@ static int qemu_fwcfg_do_cpus(cmd_tbl_t *cmdtp, int flag,
return 0;
}
-static int qemu_fwcfg_do_load(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int qemu_fwcfg_do_load(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
char *env;
void *load_addr;
@@ -156,16 +156,17 @@ static int qemu_fwcfg_do_load(cmd_tbl_t *cmdtp, int flag,
return qemu_fwcfg_setup_kernel(load_addr, initrd_addr);
}
-static cmd_tbl_t fwcfg_commands[] = {
+static struct cmd_tbl fwcfg_commands[] = {
U_BOOT_CMD_MKENT(list, 0, 1, qemu_fwcfg_do_list, "", ""),
U_BOOT_CMD_MKENT(cpus, 0, 1, qemu_fwcfg_do_cpus, "", ""),
U_BOOT_CMD_MKENT(load, 2, 1, qemu_fwcfg_do_load, "", ""),
};
-static int do_qemu_fw(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_qemu_fw(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int ret;
- cmd_tbl_t *fwcfg_cmd;
+ struct cmd_tbl *fwcfg_cmd;
if (!qemu_fwcfg_present()) {
printf("QEMU fw_cfg interface not found\n");
diff --git a/cmd/read.c b/cmd/read.c
index 82c2d9ad99..34f53f9a29 100644
--- a/cmd/read.c
+++ b/cmd/read.c
@@ -12,13 +12,13 @@
#include <command.h>
#include <part.h>
-int do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_read(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char *ep;
struct blk_desc *dev_desc = NULL;
int dev;
int part = 0;
- disk_partition_t part_info;
+ struct disk_partition part_info;
ulong offset = 0u;
ulong limit = 0u;
void *addr;
diff --git a/cmd/reginfo.c b/cmd/reginfo.c
index de94dd8071..c8a04b1754 100644
--- a/cmd/reginfo.c
+++ b/cmd/reginfo.c
@@ -8,8 +8,8 @@
#include <command.h>
#include <asm/ppc.h>
-static int do_reginfo(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_reginfo(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
print_reginfo();
diff --git a/cmd/regulator.c b/cmd/regulator.c
index ed8d778c82..aa06c9a9fc 100644
--- a/cmd/regulator.c
+++ b/cmd/regulator.c
@@ -4,6 +4,7 @@
* Przemyslaw Marczak <p.marczak@samsung.com>
*/
#include <common.h>
+#include <command.h>
#include <errno.h>
#include <dm.h>
#include <dm/uclass-internal.h>
@@ -22,7 +23,7 @@ static int failure(int ret)
return CMD_RET_FAILURE;
}
-static int do_dev(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_dev(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
struct dm_regulator_uclass_platdata *uc_pdata;
const char *name;
@@ -82,7 +83,8 @@ static int curr_dev_and_platdata(struct udevice **devp,
return CMD_RET_SUCCESS;
}
-static int do_list(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_list(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct dm_regulator_uclass_platdata *uc_pdata;
struct udevice *dev;
@@ -137,7 +139,8 @@ static const char *get_mode_name(struct dm_regulator_mode *mode,
return NULL;
}
-static int do_info(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_info(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *dev;
struct dm_regulator_uclass_platdata *uc_pdata;
@@ -231,7 +234,8 @@ static void do_status_line(struct udevice *dev)
printf("\n");
}
-static int do_status(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_status(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct dm_regulator_uclass_platdata *uc_pdata;
struct udevice *dev;
@@ -255,7 +259,8 @@ static int do_status(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return CMD_RET_SUCCESS;
}
-static int do_value(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_value(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *dev;
struct dm_regulator_uclass_platdata *uc_pdata;
@@ -304,7 +309,8 @@ static int do_value(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return CMD_RET_SUCCESS;
}
-static int do_current(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_current(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *dev;
struct dm_regulator_uclass_platdata *uc_pdata;
@@ -343,7 +349,8 @@ static int do_current(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return CMD_RET_SUCCESS;
}
-static int do_mode(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_mode(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *dev;
struct dm_regulator_uclass_platdata *uc_pdata;
@@ -378,7 +385,8 @@ static int do_mode(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return CMD_RET_SUCCESS;
}
-static int do_enable(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_enable(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *dev;
struct dm_regulator_uclass_platdata *uc_pdata;
@@ -397,7 +405,8 @@ static int do_enable(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return CMD_RET_SUCCESS;
}
-static int do_disable(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_disable(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *dev;
struct dm_regulator_uclass_platdata *uc_pdata;
@@ -416,7 +425,7 @@ static int do_disable(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return CMD_RET_SUCCESS;
}
-static cmd_tbl_t subcmd[] = {
+static struct cmd_tbl subcmd[] = {
U_BOOT_CMD_MKENT(dev, 2, 1, do_dev, "", ""),
U_BOOT_CMD_MKENT(list, 1, 1, do_list, "", ""),
U_BOOT_CMD_MKENT(info, 2, 1, do_info, "", ""),
@@ -428,10 +437,10 @@ static cmd_tbl_t subcmd[] = {
U_BOOT_CMD_MKENT(disable, 1, 1, do_disable, "", ""),
};
-static int do_regulator(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_regulator(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
- cmd_tbl_t *cmd;
+ struct cmd_tbl *cmd;
argc--;
argv++;
diff --git a/cmd/reiser.c b/cmd/reiser.c
index 598fab48b3..3db926f806 100644
--- a/cmd/reiser.c
+++ b/cmd/reiser.c
@@ -30,12 +30,12 @@
#define PRINTF(fmt,args...)
#endif
-int do_reiserls (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_reiserls(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char *filename = "/";
int dev, part;
struct blk_desc *dev_desc = NULL;
- disk_partition_t info;
+ struct disk_partition info;
if (argc < 3)
return CMD_RET_USAGE;
@@ -76,12 +76,12 @@ U_BOOT_CMD(
/******************************************************************************
* Reiserfs boot command intepreter. Derived from diskboot
*/
-int do_reiserload (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_reiserload(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char *filename = NULL;
int dev, part;
ulong addr = 0, filelen;
- disk_partition_t info;
+ struct disk_partition info;
struct blk_desc *dev_desc = NULL;
unsigned long count;
char *addr_str;
diff --git a/cmd/remoteproc.c b/cmd/remoteproc.c
index da6f3fc8cc..e8b9178e74 100644
--- a/cmd/remoteproc.c
+++ b/cmd/remoteproc.c
@@ -69,7 +69,7 @@ static int print_remoteproc_list(void)
*
* Return: 0 if no error, else returns appropriate error value.
*/
-static int do_rproc_init(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_rproc_init(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
int id;
@@ -102,7 +102,7 @@ static int do_rproc_init(cmd_tbl_t *cmdtp, int flag, int argc,
*
* Return: 0 if no error, else returns appropriate error value.
*/
-static int do_remoteproc_list(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_remoteproc_list(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
if (print_remoteproc_list())
@@ -120,7 +120,7 @@ static int do_remoteproc_list(cmd_tbl_t *cmdtp, int flag, int argc,
*
* Return: 0 if no error, else returns appropriate error value.
*/
-static int do_remoteproc_load(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_remoteproc_load(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
ulong addr, size;
@@ -159,7 +159,7 @@ static int do_remoteproc_load(cmd_tbl_t *cmdtp, int flag, int argc,
*
* Return: 0 if no error, else returns appropriate error value.
*/
-static int do_remoteproc_wrapper(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_remoteproc_wrapper(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
int id, ret = CMD_RET_USAGE;
@@ -201,7 +201,7 @@ static int do_remoteproc_wrapper(cmd_tbl_t *cmdtp, int flag, int argc,
return ret ? CMD_RET_FAILURE : 0;
}
-static cmd_tbl_t cmd_remoteproc_sub[] = {
+static struct cmd_tbl cmd_remoteproc_sub[] = {
U_BOOT_CMD_MKENT(init, 1, 1, do_rproc_init,
"Enumerate and initialize the remote processor(s)",
"id - ID of the remote processor\n"
@@ -242,10 +242,10 @@ static cmd_tbl_t cmd_remoteproc_sub[] = {
*
* Return: 0 if no error, else returns appropriate error value.
*/
-static int do_remoteproc(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_remoteproc(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
- cmd_tbl_t *c = NULL;
+ struct cmd_tbl *c = NULL;
/* Strip off leading 'rproc' command argument */
argc--;
diff --git a/cmd/riscv/exception.c b/cmd/riscv/exception.c
index 547fb7d132..3c8dbbec0e 100644
--- a/cmd/riscv/exception.c
+++ b/cmd/riscv/exception.c
@@ -8,14 +8,14 @@
#include <common.h>
#include <command.h>
-static int do_undefined(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_undefined(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
asm volatile (".word 0xffffffff\n");
return CMD_RET_FAILURE;
}
-static cmd_tbl_t cmd_sub[] = {
+static struct cmd_tbl cmd_sub[] = {
U_BOOT_CMD_MKENT(undefined, CONFIG_SYS_MAXARGS, 1, do_undefined,
"", ""),
};
diff --git a/cmd/rng.c b/cmd/rng.c
index 76367fed94..9747c11be4 100644
--- a/cmd/rng.c
+++ b/cmd/rng.c
@@ -11,7 +11,7 @@
#include <malloc.h>
#include <rng.h>
-static int do_rng(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_rng(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
size_t n = 0x40;
struct udevice *dev;
diff --git a/cmd/rockusb.c b/cmd/rockusb.c
index 9b70c6a6af..f181ec6111 100644
--- a/cmd/rockusb.c
+++ b/cmd/rockusb.c
@@ -10,7 +10,8 @@
#include <usb.h>
#include <asm/arch-rockchip/f_rockusb.h>
-static int do_rockusb(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+static int do_rockusb(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int controller_index, dev_index;
char *usb_controller;
diff --git a/cmd/sata.c b/cmd/sata.c
index 6bdb516cb5..aa396c1bbd 100644
--- a/cmd/sata.c
+++ b/cmd/sata.c
@@ -11,6 +11,7 @@
#include <common.h>
#include <ahci.h>
+#include <blk.h>
#include <dm.h>
#include <command.h>
#include <part.h>
@@ -78,7 +79,8 @@ int sata_probe(int devnum)
#endif
}
-static int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_sata(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int rc = 0;
diff --git a/cmd/sb.c b/cmd/sb.c
index 5701e03797..f7eb921f43 100644
--- a/cmd/sb.c
+++ b/cmd/sb.c
@@ -5,11 +5,12 @@
*/
#include <common.h>
+#include <command.h>
#include <dm.h>
#include <spl.h>
#include <asm/state.h>
-static int do_sb_handoff(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_sb_handoff(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
#if CONFIG_IS_ENABLED(HANDOFF)
@@ -26,8 +27,8 @@ static int do_sb_handoff(cmd_tbl_t *cmdtp, int flag, int argc,
#endif
}
-static int do_sb_state(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_sb_state(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct sandbox_state *state;
@@ -37,14 +38,14 @@ static int do_sb_state(cmd_tbl_t *cmdtp, int flag, int argc,
return 0;
}
-static cmd_tbl_t cmd_sb_sub[] = {
+static struct cmd_tbl cmd_sb_sub[] = {
U_BOOT_CMD_MKENT(handoff, 1, 0, do_sb_handoff, "", ""),
U_BOOT_CMD_MKENT(state, 1, 0, do_sb_state, "", ""),
};
-static int do_sb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_sb(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
- cmd_tbl_t *c;
+ struct cmd_tbl *c;
/* Skip past 'sb' */
argc--;
diff --git a/cmd/scsi.c b/cmd/scsi.c
index 67de1a3bdc..5f710d2895 100644
--- a/cmd/scsi.c
+++ b/cmd/scsi.c
@@ -8,6 +8,7 @@
* SCSI support.
*/
#include <common.h>
+#include <blk.h>
#include <command.h>
#include <scsi.h>
@@ -16,7 +17,8 @@ static int scsi_curr_dev; /* current device */
/*
* scsi boot command intepreter. Derived from diskboot
*/
-static int do_scsiboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+static int do_scsiboot(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return common_diskboot(cmdtp, "scsi", argc, argv);
}
@@ -24,7 +26,8 @@ static int do_scsiboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
/*
* scsi command intepreter
*/
-static int do_scsi(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+static int do_scsi(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int ret;
diff --git a/cmd/setexpr.c b/cmd/setexpr.c
index 0182f19938..770dc24d2b 100644
--- a/cmd/setexpr.c
+++ b/cmd/setexpr.c
@@ -12,6 +12,7 @@
#include <config.h>
#include <command.h>
#include <env.h>
+#include <log.h>
#include <mapmem.h>
static ulong get_arg(char *s, int w)
@@ -290,7 +291,8 @@ static int regex_sub(const char *name,
}
#endif
-static int do_setexpr(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_setexpr(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong a, b;
ulong value;
diff --git a/cmd/sf.c b/cmd/sf.c
index e993b3e5ad..727837d9cd 100644
--- a/cmd/sf.c
+++ b/cmd/sf.c
@@ -6,12 +6,16 @@
*/
#include <common.h>
+#include <command.h>
#include <div64.h>
#include <dm.h>
+#include <flash.h>
+#include <log.h>
#include <malloc.h>
#include <mapmem.h>
#include <spi.h>
#include <spi_flash.h>
+#include <asm/cache.h>
#include <jffs2/jffs2.h>
#include <linux/mtd/mtd.h>
@@ -79,7 +83,7 @@ static ulong bytes_per_second(unsigned int len, ulong start_ms)
return 1024 * len / max(get_timer(start_ms), 1UL);
}
-static int do_spi_flash_probe(int argc, char * const argv[])
+static int do_spi_flash_probe(int argc, char *const argv[])
{
unsigned int bus = CONFIG_SF_DEFAULT_BUS;
unsigned int cs = CONFIG_SF_DEFAULT_CS;
@@ -259,7 +263,7 @@ static int spi_flash_update(struct spi_flash *flash, u32 offset,
return 0;
}
-static int do_spi_flash_read_write(int argc, char * const argv[])
+static int do_spi_flash_read_write(int argc, char *const argv[])
{
unsigned long addr;
void *buf;
@@ -317,7 +321,7 @@ static int do_spi_flash_read_write(int argc, char * const argv[])
return ret == 0 ? 0 : 1;
}
-static int do_spi_flash_erase(int argc, char * const argv[])
+static int do_spi_flash_erase(int argc, char *const argv[])
{
int ret;
int dev = 0;
@@ -349,7 +353,7 @@ static int do_spi_flash_erase(int argc, char * const argv[])
return ret == 0 ? 0 : 1;
}
-static int do_spi_protect(int argc, char * const argv[])
+static int do_spi_protect(int argc, char *const argv[])
{
int ret = 0;
loff_t start, len;
@@ -498,7 +502,7 @@ static int spi_flash_test(struct spi_flash *flash, uint8_t *buf, ulong len,
return 0;
}
-static int do_spi_flash_test(int argc, char * const argv[])
+static int do_spi_flash_test(int argc, char *const argv[])
{
unsigned long offset;
unsigned long len;
@@ -542,8 +546,8 @@ static int do_spi_flash_test(int argc, char * const argv[])
}
#endif /* CONFIG_CMD_SF_TEST */
-static int do_spi_flash(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_spi_flash(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
const char *cmd;
int ret;
diff --git a/cmd/sha1sum.c b/cmd/sha1sum.c
index 3c50fc27ce..bcc665a5a6 100644
--- a/cmd/sha1sum.c
+++ b/cmd/sha1sum.c
@@ -12,7 +12,7 @@
#include <hash.h>
#include <u-boot/sha1.h>
-int do_sha1sum(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_sha1sum(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
int flags = HASH_FLAG_ENV;
int ac;
diff --git a/cmd/smccc.c b/cmd/smccc.c
index 8b1475c2fe..0b19f6c68c 100644
--- a/cmd/smccc.c
+++ b/cmd/smccc.c
@@ -10,7 +10,8 @@
#include <linux/compiler.h>
#include <linux/psci.h>
-static int do_call(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_call(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct arm_smccc_res res;
diff --git a/cmd/sound.c b/cmd/sound.c
index 638f29df21..7fc19678ea 100644
--- a/cmd/sound.c
+++ b/cmd/sound.c
@@ -13,7 +13,8 @@
DECLARE_GLOBAL_DATA_PTR;
/* Initilaise sound subsystem */
-static int do_init(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+static int do_init(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *dev;
int ret;
@@ -30,7 +31,8 @@ static int do_init(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
}
/* play sound from buffer */
-static int do_play(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+static int do_play(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *dev;
int ret = 0;
@@ -53,15 +55,16 @@ static int do_play(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
return 0;
}
-static cmd_tbl_t cmd_sound_sub[] = {
+static struct cmd_tbl cmd_sound_sub[] = {
U_BOOT_CMD_MKENT(init, 0, 1, do_init, "", ""),
U_BOOT_CMD_MKENT(play, 2, 1, do_play, "", ""),
};
/* process sound command */
-static int do_sound(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+static int do_sound(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
- cmd_tbl_t *c;
+ struct cmd_tbl *c;
if (argc < 1)
return CMD_RET_USAGE;
diff --git a/cmd/source.c b/cmd/source.c
index 92f8f77ee6..b6c709a3d2 100644
--- a/cmd/source.c
+++ b/cmd/source.c
@@ -18,6 +18,7 @@
#include <command.h>
#include <env.h>
#include <image.h>
+#include <log.h>
#include <malloc.h>
#include <mapmem.h>
#include <asm/byteorder.h>
@@ -154,13 +155,14 @@ int image_source_script(ulong addr, const char *fit_uname)
return 1;
}
- debug ("** Script length: %ld\n", len);
+ debug("** Script length: %ld\n", len);
return run_command_list((char *)data, len, 0);
}
/**************************************************/
#if defined(CONFIG_CMD_SOURCE)
-static int do_source(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_source(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong addr;
int rcode;
@@ -169,16 +171,16 @@ static int do_source(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
/* Find script image */
if (argc < 2) {
addr = CONFIG_SYS_LOAD_ADDR;
- debug ("* source: default load address = 0x%08lx\n", addr);
+ debug("* source: default load address = 0x%08lx\n", addr);
#if defined(CONFIG_FIT)
} else if (fit_parse_subimage(argv[1], image_load_addr, &addr,
&fit_uname)) {
- debug ("* source: subimage '%s' from FIT image at 0x%08lx\n",
- fit_uname, addr);
+ debug("* source: subimage '%s' from FIT image at 0x%08lx\n",
+ fit_uname, addr);
#endif
} else {
addr = simple_strtoul(argv[1], NULL, 16);
- debug ("* source: cmdline image address = 0x%08lx\n", addr);
+ debug("* source: cmdline image address = 0x%08lx\n", addr);
}
printf ("## Executing script at %08lx\n", addr);
diff --git a/cmd/spi.c b/cmd/spi.c
index bfa185b6ae..aec912167c 100644
--- a/cmd/spi.c
+++ b/cmd/spi.c
@@ -97,7 +97,7 @@ done:
* The command prints out the hexadecimal string received via SPI.
*/
-int do_spi (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_spi(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char *cp = 0;
uchar tmp;
diff --git a/cmd/spl.c b/cmd/spl.c
index 56051b8a4b..28b40dd31e 100644
--- a/cmd/spl.c
+++ b/cmd/spl.c
@@ -8,6 +8,8 @@
#include <command.h>
#include <cmd_spl.h>
#include <env.h>
+#include <image.h>
+#include <log.h>
#include <linux/libfdt.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -49,7 +51,7 @@ static const char **subcmd_list[] = {
};
/* Calls bootm with the parameters given */
-static int call_bootm(int argc, char * const argv[], const char *subcommand[])
+static int call_bootm(int argc, char *const argv[], const char *subcommand[])
{
char *bootm_argv[5];
@@ -95,14 +97,15 @@ static int call_bootm(int argc, char * const argv[], const char *subcommand[])
return 0;
}
-static cmd_tbl_t cmd_spl_export_sub[] = {
+static struct cmd_tbl cmd_spl_export_sub[] = {
U_BOOT_CMD_MKENT(fdt, 0, 1, (void *)SPL_EXPORT_FDT, "", ""),
U_BOOT_CMD_MKENT(atags, 0, 1, (void *)SPL_EXPORT_ATAGS, "", ""),
};
-static int spl_export(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int spl_export(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
- const cmd_tbl_t *c;
+ const struct cmd_tbl *c;
if (argc < 2) /* no subcommand */
return cmd_usage(cmdtp);
@@ -141,13 +144,13 @@ static int spl_export(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return 0;
}
-static cmd_tbl_t cmd_spl_sub[] = {
+static struct cmd_tbl cmd_spl_sub[] = {
U_BOOT_CMD_MKENT(export, 0, 1, (void *)SPL_EXPORT, "", ""),
};
-static int do_spl(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_spl(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
- const cmd_tbl_t *c;
+ const struct cmd_tbl *c;
int cmd;
if (argc < 2) /* no subcommand */
diff --git a/cmd/strings.c b/cmd/strings.c
index 41b1665926..85fdc34f08 100644
--- a/cmd/strings.c
+++ b/cmd/strings.c
@@ -12,7 +12,7 @@
static char *start_addr, *last_addr;
-int do_strings(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_strings(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
if (argc == 1)
return CMD_RET_USAGE;
diff --git a/cmd/sysboot.c b/cmd/sysboot.c
index 793d67d2f5..af6a2f1b7f 100644
--- a/cmd/sysboot.c
+++ b/cmd/sysboot.c
@@ -8,7 +8,8 @@
static char *fs_argv[5];
-static int do_get_ext2(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr)
+static int do_get_ext2(struct cmd_tbl *cmdtp, const char *file_path,
+ char *file_addr)
{
#ifdef CONFIG_CMD_EXT2
fs_argv[0] = "ext2load";
@@ -21,7 +22,8 @@ static int do_get_ext2(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr)
return -ENOENT;
}
-static int do_get_fat(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr)
+static int do_get_fat(struct cmd_tbl *cmdtp, const char *file_path,
+ char *file_addr)
{
#ifdef CONFIG_CMD_FAT
fs_argv[0] = "fatload";
@@ -34,7 +36,8 @@ static int do_get_fat(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr)
return -ENOENT;
}
-static int do_get_any(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr)
+static int do_get_any(struct cmd_tbl *cmdtp, const char *file_path,
+ char *file_addr)
{
#ifdef CONFIG_CMD_FS_GENERIC
fs_argv[0] = "load";
@@ -52,7 +55,8 @@ static int do_get_any(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr)
*
* Returns 0 on success, 1 on error.
*/
-static int do_sysboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_sysboot(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
unsigned long pxefile_addr_r;
struct pxe_menu *cfg;
diff --git a/cmd/terminal.c b/cmd/terminal.c
index e1ec66ed71..f6e4d2539e 100644
--- a/cmd/terminal.c
+++ b/cmd/terminal.c
@@ -12,7 +12,7 @@
#include <stdio_dev.h>
#include <serial.h>
-int do_terminal(cmd_tbl_t * cmd, int flag, int argc, char * const argv[])
+int do_terminal(struct cmd_tbl *cmd, int flag, int argc, char *const argv[])
{
int last_tilde = 0;
struct stdio_dev *dev = NULL;
diff --git a/cmd/test.c b/cmd/test.c
index 258bfd8806..fa7c48fb9f 100644
--- a/cmd/test.c
+++ b/cmd/test.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <command.h>
#include <fs.h>
+#include <log.h>
#define OP_INVALID 0
#define OP_NOT 1
@@ -50,7 +51,8 @@ const struct {
{0, "-e", OP_FILE_EXISTS, 4},
};
-static int do_test(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_test(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
char * const *ap;
int i, op, left, adv, expr, last_expr, last_unop, last_binop;
@@ -190,7 +192,8 @@ U_BOOT_CMD(
"[args..]"
);
-static int do_false(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_false(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return 1;
}
@@ -201,7 +204,8 @@ U_BOOT_CMD(
NULL
);
-static int do_true(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_true(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return 0;
}
diff --git a/cmd/thordown.c b/cmd/thordown.c
index 8dae024e31..ae20dddfdd 100644
--- a/cmd/thordown.c
+++ b/cmd/thordown.c
@@ -7,12 +7,13 @@
*/
#include <common.h>
+#include <command.h>
#include <thor.h>
#include <dfu.h>
#include <g_dnl.h>
#include <usb.h>
-int do_thor_down(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_thor_down(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
if (argc < 4)
return CMD_RET_USAGE;
diff --git a/cmd/ti/ddr3.c b/cmd/ti/ddr3.c
index a452fe7876..623b63b0f9 100644
--- a/cmd/ti/ddr3.c
+++ b/cmd/ti/ddr3.c
@@ -6,7 +6,9 @@
*/
#include <cpu_func.h>
+#include <env.h>
#include <init.h>
+#include <log.h>
#include <asm/arch/hardware.h>
#include <asm/cache.h>
#include <asm/emif.h>
@@ -276,8 +278,8 @@ static int is_ecc_enabled(void)
(ecc_ctrl & EMIF_ECC_REG_RMW_EN_MASK);
}
-static int do_ddr_test(cmd_tbl_t *cmdtp,
- int flag, int argc, char * const argv[])
+static int do_ddr_test(struct cmd_tbl *cmdtp,
+ int flag, int argc, char *const argv[])
{
u32 start_addr, end_addr, size, ecc_err;
diff --git a/cmd/time.c b/cmd/time.c
index 51cde9749f..db8c1892df 100644
--- a/cmd/time.c
+++ b/cmd/time.c
@@ -24,7 +24,8 @@ static void report_time(ulong cycles)
printf(" %lu.%03lu seconds\n", seconds, milliseconds);
}
-static int do_time(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_time(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong cycles = 0;
int retval = 0;
diff --git a/cmd/tlv_eeprom.c b/cmd/tlv_eeprom.c
index 211ab2680f..eab0531c96 100644
--- a/cmd/tlv_eeprom.c
+++ b/cmd/tlv_eeprom.c
@@ -15,6 +15,8 @@
#include <i2c.h>
#include <i2c_eeprom.h>
#include <env.h>
+#include <init.h>
+#include <net.h>
#include <linux/ctype.h>
#include <u-boot/crc.h>
@@ -423,7 +425,7 @@ void show_tlv_code_list(void)
*
* This function implements the tlv_eeprom command.
*/
-int do_tlv_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_tlv_eeprom(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char cmd;
struct tlvinfo_header *eeprom_hdr = to_header(eeprom);
diff --git a/cmd/tpm-common.c b/cmd/tpm-common.c
index 3014255229..88c9e08e31 100644
--- a/cmd/tpm-common.c
+++ b/cmd/tpm-common.c
@@ -296,7 +296,7 @@ int get_tpm(struct udevice **devp)
return 0;
}
-int do_tpm_device(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_tpm_device(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
unsigned long num;
int rc;
@@ -314,7 +314,7 @@ int do_tpm_device(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
return rc;
}
-int do_tpm_info(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_tpm_info(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
struct udevice *dev;
char buf[80];
@@ -333,7 +333,7 @@ int do_tpm_info(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
return 0;
}
-int do_tpm_init(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_tpm_init(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
struct udevice *dev;
int rc;
@@ -347,9 +347,9 @@ int do_tpm_init(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return report_return_code(tpm_init(dev));
}
-int do_tpm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_tpm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
- cmd_tbl_t *tpm_commands, *cmd;
+ struct cmd_tbl *tpm_commands, *cmd;
struct tpm_chip_priv *priv;
struct udevice *dev;
unsigned int size;
diff --git a/cmd/tpm-user-utils.h b/cmd/tpm-user-utils.h
index a851d9c4af..358ddff576 100644
--- a/cmd/tpm-user-utils.h
+++ b/cmd/tpm-user-utils.h
@@ -17,9 +17,10 @@ int type_string_pack(const char *type_str, char * const values[], u8 *data);
int type_string_write_vars(const char *type_str, u8 *data, char * const vars[]);
int get_tpm(struct udevice **devp);
-int do_tpm_device(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]);
-int do_tpm_init(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]);
-int do_tpm_info(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]);
-int do_tpm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
+int do_tpm_device(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[]);
+int do_tpm_init(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
+int do_tpm_info(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
+int do_tpm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
#endif /* __TPM_USER_UTILS_H */
diff --git a/cmd/tpm-v1.c b/cmd/tpm-v1.c
index bc34e0654f..0e2168aea6 100644
--- a/cmd/tpm-v1.c
+++ b/cmd/tpm-v1.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <command.h>
#include <env.h>
#include <malloc.h>
#include <asm/unaligned.h>
@@ -11,8 +12,8 @@
#include <tpm-v1.h>
#include "tpm-user-utils.h"
-static int do_tpm_startup(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm_startup(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
enum tpm_startup_type mode;
struct udevice *dev;
@@ -37,8 +38,8 @@ static int do_tpm_startup(cmd_tbl_t *cmdtp, int flag, int argc,
return report_return_code(tpm_startup(dev, mode));
}
-static int do_tpm_nv_define_space(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm_nv_define_space(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
u32 index, perm, size;
struct udevice *dev;
@@ -57,8 +58,8 @@ static int do_tpm_nv_define_space(cmd_tbl_t *cmdtp, int flag, int argc,
return report_return_code(tpm_nv_define_space(dev, index, perm, size));
}
-static int do_tpm_nv_read_value(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm_nv_read_value(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
u32 index, count, rc;
struct udevice *dev;
@@ -83,8 +84,8 @@ static int do_tpm_nv_read_value(cmd_tbl_t *cmdtp, int flag, int argc,
return report_return_code(rc);
}
-static int do_tpm_nv_write_value(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm_nv_write_value(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *dev;
u32 index, rc;
@@ -110,8 +111,8 @@ static int do_tpm_nv_write_value(cmd_tbl_t *cmdtp, int flag, int argc,
return report_return_code(rc);
}
-static int do_tpm_extend(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm_extend(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
u8 in_digest[20], out_digest[20];
struct udevice *dev;
@@ -138,8 +139,8 @@ static int do_tpm_extend(cmd_tbl_t *cmdtp, int flag, int argc,
return report_return_code(rc);
}
-static int do_tpm_pcr_read(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm_pcr_read(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
u32 index, count, rc;
struct udevice *dev;
@@ -164,8 +165,8 @@ static int do_tpm_pcr_read(cmd_tbl_t *cmdtp, int flag, int argc,
return report_return_code(rc);
}
-static int do_tpm_tsc_physical_presence(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm_tsc_physical_presence(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
struct udevice *dev;
u16 presence;
@@ -182,8 +183,8 @@ static int do_tpm_tsc_physical_presence(cmd_tbl_t *cmdtp, int flag, int argc,
return report_return_code(tpm_tsc_physical_presence(dev, presence));
}
-static int do_tpm_read_pubek(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm_read_pubek(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *dev;
u32 count, rc;
@@ -207,8 +208,8 @@ static int do_tpm_read_pubek(cmd_tbl_t *cmdtp, int flag, int argc,
return report_return_code(rc);
}
-static int do_tpm_physical_set_deactivated(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm_physical_set_deactivated(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
struct udevice *dev;
u8 state;
@@ -225,8 +226,8 @@ static int do_tpm_physical_set_deactivated(cmd_tbl_t *cmdtp, int flag, int argc,
return report_return_code(tpm_physical_set_deactivated(dev, state));
}
-static int do_tpm_get_capability(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm_get_capability(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
u32 cap_area, sub_cap, rc;
void *cap;
@@ -253,8 +254,8 @@ static int do_tpm_get_capability(cmd_tbl_t *cmdtp, int flag, int argc,
return report_return_code(rc);
}
-static int do_tpm_raw_transfer(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm_raw_transfer(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *dev;
void *command;
@@ -282,8 +283,8 @@ static int do_tpm_raw_transfer(cmd_tbl_t *cmdtp, int flag, int argc,
return report_return_code(rc);
}
-static int do_tpm_nv_define(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm_nv_define(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
u32 index, perm, size;
struct udevice *dev;
@@ -306,8 +307,8 @@ static int do_tpm_nv_define(cmd_tbl_t *cmdtp, int flag, int argc,
return report_return_code(tpm_nv_define_space(dev, index, perm, size));
}
-static int do_tpm_nv_read(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm_nv_read(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
u32 index, count, err;
struct udevice *dev;
@@ -341,8 +342,8 @@ static int do_tpm_nv_read(cmd_tbl_t *cmdtp, int flag, int argc,
return report_return_code(err);
}
-static int do_tpm_nv_write(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm_nv_write(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
u32 index, count, err;
struct udevice *dev;
@@ -377,8 +378,8 @@ static int do_tpm_nv_write(cmd_tbl_t *cmdtp, int flag, int argc,
#ifdef CONFIG_TPM_AUTH_SESSIONS
-static int do_tpm_oiap(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm_oiap(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
u32 auth_handle, err;
struct udevice *dev;
@@ -394,8 +395,8 @@ static int do_tpm_oiap(cmd_tbl_t *cmdtp, int flag, int argc,
}
#ifdef CONFIG_TPM_LOAD_KEY_BY_SHA1
-static int do_tpm_load_key_by_sha1(cmd_tbl_t *cmdtp, int flag, int argc, char *
- const argv[])
+static int do_tpm_load_key_by_sha1(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
u32 parent_handle = 0;
u32 key_len, key_handle, err;
@@ -437,8 +438,8 @@ static int do_tpm_load_key_by_sha1(cmd_tbl_t *cmdtp, int flag, int argc, char *
}
#endif /* CONFIG_TPM_LOAD_KEY_BY_SHA1 */
-static int do_tpm_load_key2_oiap(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm_load_key2_oiap(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
u32 parent_handle, key_len, key_handle, err;
u8 usage_auth[DIGEST_LENGTH];
@@ -468,8 +469,8 @@ static int do_tpm_load_key2_oiap(cmd_tbl_t *cmdtp, int flag, int argc,
return report_return_code(err);
}
-static int do_tpm_get_pub_key_oiap(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm_get_pub_key_oiap(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
u32 key_handle, err;
u8 usage_auth[DIGEST_LENGTH];
@@ -504,8 +505,8 @@ TPM_COMMAND_NO_ARG(tpm_end_oiap)
#endif /* CONFIG_TPM_AUTH_SESSIONS */
#ifdef CONFIG_TPM_FLUSH_RESOURCES
-static int do_tpm_flush(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm_flush(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *dev;
int type = 0;
@@ -577,8 +578,8 @@ static int do_tpm_flush(cmd_tbl_t *cmdtp, int flag, int argc,
#endif /* CONFIG_TPM_FLUSH_RESOURCES */
#ifdef CONFIG_TPM_LIST_RESOURCES
-static int do_tpm_list(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm_list(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int type = 0;
u16 res_count;
@@ -644,7 +645,7 @@ TPM_COMMAND_NO_ARG(tpm_force_clear)
TPM_COMMAND_NO_ARG(tpm_physical_enable)
TPM_COMMAND_NO_ARG(tpm_physical_disable)
-static cmd_tbl_t tpm1_commands[] = {
+static struct cmd_tbl tpm1_commands[] = {
U_BOOT_CMD_MKENT(device, 0, 1, do_tpm_device, "", ""),
U_BOOT_CMD_MKENT(info, 0, 1, do_tpm_info, "", ""),
U_BOOT_CMD_MKENT(init, 0, 1, do_tpm_init, "", ""),
@@ -710,7 +711,7 @@ static cmd_tbl_t tpm1_commands[] = {
#endif /* CONFIG_TPM_LIST_RESOURCES */
};
-cmd_tbl_t *get_tpm1_commands(unsigned int *size)
+struct cmd_tbl *get_tpm1_commands(unsigned int *size)
{
*size = ARRAY_SIZE(tpm1_commands);
diff --git a/cmd/tpm-v2.c b/cmd/tpm-v2.c
index 0cd39821bf..e6742656f5 100644
--- a/cmd/tpm-v2.c
+++ b/cmd/tpm-v2.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <command.h>
#include <dm.h>
#include <log.h>
#include <mapmem.h>
@@ -12,8 +13,8 @@
#include <tpm-v2.h>
#include "tpm-user-utils.h"
-static int do_tpm2_startup(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm2_startup(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
enum tpm2_startup_types mode;
struct udevice *dev;
@@ -37,8 +38,8 @@ static int do_tpm2_startup(cmd_tbl_t *cmdtp, int flag, int argc,
return report_return_code(tpm2_startup(dev, mode));
}
-static int do_tpm2_self_test(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm2_self_test(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
enum tpm2_yes_no full_test;
struct udevice *dev;
@@ -62,8 +63,8 @@ static int do_tpm2_self_test(cmd_tbl_t *cmdtp, int flag, int argc,
return report_return_code(tpm2_self_test(dev, full_test));
}
-static int do_tpm2_clear(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm2_clear(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
u32 handle = 0;
const char *pw = (argc < 3) ? NULL : argv[2];
@@ -91,8 +92,8 @@ static int do_tpm2_clear(cmd_tbl_t *cmdtp, int flag, int argc,
return report_return_code(tpm2_clear(dev, handle, pw, pw_sz));
}
-static int do_tpm2_pcr_extend(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm2_pcr_extend(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *dev;
struct tpm_chip_priv *priv;
@@ -122,8 +123,8 @@ static int do_tpm2_pcr_extend(cmd_tbl_t *cmdtp, int flag, int argc,
return report_return_code(rc);
}
-static int do_tpm_pcr_read(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm_pcr_read(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *dev;
struct tpm_chip_priv *priv;
@@ -160,8 +161,8 @@ static int do_tpm_pcr_read(cmd_tbl_t *cmdtp, int flag, int argc,
return report_return_code(rc);
}
-static int do_tpm_get_capability(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm_get_capability(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
u32 capability, property, rc;
u8 *data;
@@ -203,7 +204,7 @@ unmap_data:
return report_return_code(rc);
}
-static int do_tpm_dam_reset(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_tpm_dam_reset(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
const char *pw = (argc < 2) ? NULL : argv[1];
@@ -224,7 +225,7 @@ static int do_tpm_dam_reset(cmd_tbl_t *cmdtp, int flag, int argc,
return report_return_code(tpm2_dam_reset(dev, pw, pw_sz));
}
-static int do_tpm_dam_parameters(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_tpm_dam_parameters(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
const char *pw = (argc < 5) ? NULL : argv[4];
@@ -268,7 +269,7 @@ static int do_tpm_dam_parameters(cmd_tbl_t *cmdtp, int flag, int argc,
lockout_recovery));
}
-static int do_tpm_change_auth(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_tpm_change_auth(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
u32 handle;
@@ -304,8 +305,8 @@ static int do_tpm_change_auth(cmd_tbl_t *cmdtp, int flag, int argc,
oldpw, oldpw_sz));
}
-static int do_tpm_pcr_setauthpolicy(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_tpm_pcr_setauthpolicy(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
u32 index = simple_strtoul(argv[1], NULL, 0);
char *key = argv[2];
@@ -328,8 +329,8 @@ static int do_tpm_pcr_setauthpolicy(cmd_tbl_t *cmdtp, int flag, int argc,
key));
}
-static int do_tpm_pcr_setauthvalue(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_tpm_pcr_setauthvalue(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
u32 index = simple_strtoul(argv[1], NULL, 0);
char *key = argv[2];
@@ -353,7 +354,7 @@ static int do_tpm_pcr_setauthvalue(cmd_tbl_t *cmdtp, int flag,
key, key_sz));
}
-static cmd_tbl_t tpm2_commands[] = {
+static struct cmd_tbl tpm2_commands[] = {
U_BOOT_CMD_MKENT(device, 0, 1, do_tpm_device, "", ""),
U_BOOT_CMD_MKENT(info, 0, 1, do_tpm_info, "", ""),
U_BOOT_CMD_MKENT(init, 0, 1, do_tpm_init, "", ""),
@@ -372,7 +373,7 @@ static cmd_tbl_t tpm2_commands[] = {
do_tpm_pcr_setauthvalue, "", ""),
};
-cmd_tbl_t *get_tpm2_commands(unsigned int *size)
+struct cmd_tbl *get_tpm2_commands(unsigned int *size)
{
*size = ARRAY_SIZE(tpm2_commands);
diff --git a/cmd/tpm_test.c b/cmd/tpm_test.c
index 2cde517d7a..ebfb25cab0 100644
--- a/cmd/tpm_test.c
+++ b/cmd/tpm_test.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
#include <cpu_func.h>
+#include <log.h>
#include <tpm-v1.h>
#include "tpm-user-utils.h"
@@ -483,8 +484,8 @@ static int test_write_limit(struct udevice *dev)
}
#define VOIDTEST(XFUNC) \
- int do_test_##XFUNC(cmd_tbl_t *cmd_tbl, int flag, int argc, \
- char * const argv[]) \
+ int do_test_##XFUNC(struct cmd_tbl *cmd_tbl, int flag, int argc, \
+ char *const argv[]) \
{ \
struct udevice *dev; \
int ret; \
@@ -513,7 +514,7 @@ VOIDTEST(timing)
VOIDTEST(write_limit)
VOIDTEST(timer)
-static cmd_tbl_t cmd_cros_tpm_sub[] = {
+static struct cmd_tbl cmd_cros_tpm_sub[] = {
VOIDENT(early_extend)
VOIDENT(early_nvram)
VOIDENT(early_nvram2)
@@ -530,9 +531,10 @@ static cmd_tbl_t cmd_cros_tpm_sub[] = {
VOIDENT(timer)
};
-static int do_tpmtest(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_tpmtest(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
- cmd_tbl_t *c;
+ struct cmd_tbl *c;
int i;
printf("argc = %d, argv = ", argc);
diff --git a/cmd/trace.c b/cmd/trace.c
index 392b129536..4ce47c7627 100644
--- a/cmd/trace.c
+++ b/cmd/trace.c
@@ -10,7 +10,7 @@
#include <trace.h>
#include <asm/io.h>
-static int get_args(int argc, char * const argv[], char **buff,
+static int get_args(int argc, char *const argv[], char **buff,
size_t *buff_ptr, size_t *buff_size)
{
if (argc < 2)
@@ -29,7 +29,7 @@ static int get_args(int argc, char * const argv[], char **buff,
return 0;
}
-static int create_func_list(int argc, char * const argv[])
+static int create_func_list(int argc, char *const argv[])
{
size_t buff_size, avail, buff_ptr, needed, used;
char *buff;
@@ -52,7 +52,7 @@ static int create_func_list(int argc, char * const argv[])
return 0;
}
-static int create_call_list(int argc, char * const argv[])
+static int create_call_list(int argc, char *const argv[])
{
size_t buff_size, avail, buff_ptr, needed, used;
char *buff;
@@ -76,7 +76,7 @@ static int create_call_list(int argc, char * const argv[])
return 0;
}
-int do_trace(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_trace(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
const char *cmd = argc < 2 ? NULL : argv[1];
diff --git a/cmd/tsi148.c b/cmd/tsi148.c
index 369a2b5ab3..2eae14f87f 100644
--- a/cmd/tsi148.c
+++ b/cmd/tsi148.c
@@ -9,6 +9,7 @@
#include <common.h>
#include <command.h>
+#include <log.h>
#include <malloc.h>
#include <asm/io.h>
#include <pci.h>
@@ -382,7 +383,7 @@ int tsi148_vme_crg_window(unsigned int vmeAddr, int vam)
/*
* Tundra Tsi148 configuration
*/
-int do_tsi148(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_tsi148(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
ulong addr1 = 0, addr2 = 0, size = 0, vam = 0, vdw = 0;
char cmd = 'x';
diff --git a/cmd/ubi.c b/cmd/ubi.c
index 54d128dbc5..171377cc66 100644
--- a/cmd/ubi.c
+++ b/cmd/ubi.c
@@ -528,7 +528,7 @@ int ubi_part(char *part_name, const char *vid_header_offset)
return 0;
}
-static int do_ubi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_ubi(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
int64_t size = 0;
ulong addr = 0;
diff --git a/cmd/ubifs.c b/cmd/ubifs.c
index e4000b7ad1..a26b653d61 100644
--- a/cmd/ubifs.c
+++ b/cmd/ubifs.c
@@ -14,6 +14,7 @@
#include <common.h>
#include <config.h>
#include <command.h>
+#include <log.h>
#include <ubifs_uboot.h>
static int ubifs_initialized;
@@ -38,8 +39,9 @@ int cmd_ubifs_mount(char *vol_name)
return ret;
}
-static int do_ubifs_mount(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+
+static int do_ubifs_mount(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
char *vol_name;
@@ -70,8 +72,8 @@ int cmd_ubifs_umount(void)
return 0;
}
-static int do_ubifs_umount(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_ubifs_umount(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
if (argc != 1)
return CMD_RET_USAGE;
@@ -79,8 +81,8 @@ static int do_ubifs_umount(cmd_tbl_t *cmdtp, int flag, int argc,
return cmd_ubifs_umount();
}
-static int do_ubifs_ls(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_ubifs_ls(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
char *filename = "/";
int ret;
@@ -103,8 +105,8 @@ static int do_ubifs_ls(cmd_tbl_t *cmdtp, int flag, int argc,
return ret;
}
-static int do_ubifs_load(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_ubifs_load(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
char *filename;
char *endp;
diff --git a/cmd/ufs.c b/cmd/ufs.c
index 5b25788656..858cd49b59 100644
--- a/cmd/ufs.c
+++ b/cmd/ufs.c
@@ -9,7 +9,7 @@
#include <command.h>
#include <ufs.h>
-static int do_ufs(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_ufs(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
int dev, ret;
diff --git a/cmd/universe.c b/cmd/universe.c
index dc9a8b5617..5ff47dde4f 100644
--- a/cmd/universe.c
+++ b/cmd/universe.c
@@ -298,7 +298,7 @@ int universe_vme_slave_window(unsigned int vmeAddr, unsigned int pciAddr, int si
/*
* Tundra Universe configuration
*/
-int do_universe(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_universe(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
ulong addr1 = 0, addr2 = 0, size = 0, vam = 0, pms = 0, vdw = 0;
char cmd = 'x';
diff --git a/cmd/unlz4.c b/cmd/unlz4.c
index 5320b378d3..4ae7f34d36 100644
--- a/cmd/unlz4.c
+++ b/cmd/unlz4.c
@@ -9,7 +9,8 @@
#include <env.h>
#include <lz4.h>
-static int do_unlz4(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_unlz4(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
unsigned long src, dst;
size_t src_len = ~0UL, dst_len = ~0UL;
diff --git a/cmd/unzip.c b/cmd/unzip.c
index afd58e7cdb..9b28328a1d 100644
--- a/cmd/unzip.c
+++ b/cmd/unzip.c
@@ -8,8 +8,10 @@
#include <command.h>
#include <env.h>
#include <gzip.h>
+#include <part.h>
-static int do_unzip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_unzip(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
unsigned long src, dst;
unsigned long src_len = ~0UL, dst_len = ~0UL;
@@ -41,8 +43,8 @@ U_BOOT_CMD(
"srcaddr dstaddr [dstsize]"
);
-static int do_gzwrite(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_gzwrite(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
struct blk_desc *bdev;
int ret;
diff --git a/cmd/usb.c b/cmd/usb.c
index dd9ac0bc97..b9ec29a845 100644
--- a/cmd/usb.c
+++ b/cmd/usb.c
@@ -11,6 +11,8 @@
*/
#include <common.h>
+#include <blk.h>
+#include <bootstage.h>
#include <command.h>
#include <console.h>
#include <dm.h>
@@ -554,7 +556,8 @@ static int usb_test(struct usb_device *dev, int port, char* arg)
* usb boot command intepreter. Derived from diskboot
*/
#ifdef CONFIG_USB_STORAGE
-static int do_usbboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_usbboot(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return common_diskboot(cmdtp, "usb", argc, argv);
}
@@ -623,7 +626,7 @@ static void usb_show_info(struct usb_device *udev)
/******************************************************************************
* usb command intepreter
*/
-static int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_usb(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
struct usb_device *udev = NULL;
int i;
diff --git a/cmd/usb_gadget_sdp.c b/cmd/usb_gadget_sdp.c
index 2ead06be9f..1af82e1136 100644
--- a/cmd/usb_gadget_sdp.c
+++ b/cmd/usb_gadget_sdp.c
@@ -7,11 +7,12 @@
*/
#include <common.h>
+#include <command.h>
#include <g_dnl.h>
#include <sdp.h>
#include <usb.h>
-static int do_sdp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_sdp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
int ret;
diff --git a/cmd/usb_mass_storage.c b/cmd/usb_mass_storage.c
index c5c6899787..d565635c6c 100644
--- a/cmd/usb_mass_storage.c
+++ b/cmd/usb_mass_storage.c
@@ -6,16 +6,18 @@
* Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved.
*/
-#include <errno.h>
#include <common.h>
+#include <blk.h>
#include <command.h>
#include <console.h>
+#include <errno.h>
#include <g_dnl.h>
#include <malloc.h>
#include <part.h>
#include <usb.h>
#include <usb_mass_storage.h>
#include <watchdog.h>
+#include <linux/delay.h>
static int ums_read_sector(struct ums *ums_dev,
ulong start, lbaint_t blkcnt, void *buf)
@@ -55,7 +57,7 @@ static int ums_init(const char *devtype, const char *devnums_part_str)
{
char *s, *t, *devnum_part_str, *name;
struct blk_desc *block_dev;
- disk_partition_t info;
+ struct disk_partition info;
int partnum;
int ret = -1;
struct ums *ums_new;
@@ -134,8 +136,8 @@ cleanup:
return ret;
}
-static int do_usb_mass_storage(cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+static int do_usb_mass_storage(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
{
const char *usb_controller;
const char *devtype;
diff --git a/cmd/version.c b/cmd/version.c
index b2fffe9977..3686b87332 100644
--- a/cmd/version.c
+++ b/cmd/version.c
@@ -14,7 +14,8 @@
const char __weak version_string[] = U_BOOT_VERSION_STRING;
-static int do_version(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_version(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
char buf[DISPLAY_OPTIONS_BANNER_LENGTH];
diff --git a/cmd/virtio.c b/cmd/virtio.c
index b7082bc63a..3dace5344f 100644
--- a/cmd/virtio.c
+++ b/cmd/virtio.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <blk.h>
#include <command.h>
#include <dm.h>
#include <virtio_types.h>
@@ -12,7 +13,8 @@
static int virtio_curr_dev;
-static int do_virtio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_virtio(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
if (argc == 2 && !strcmp(argv[1], "scan")) {
/* make sure all virtio devices are enumerated */
diff --git a/cmd/w1.c b/cmd/w1.c
index 9c95fcf9cd..92be1f2531 100644
--- a/cmd/w1.c
+++ b/cmd/w1.c
@@ -103,7 +103,7 @@ static int w1_read(int argc, char *const argv[])
return CMD_RET_SUCCESS;
}
-int do_w1(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_w1(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
if (argc < 2)
return CMD_RET_USAGE;
diff --git a/cmd/wdt.c b/cmd/wdt.c
index 647d9899b4..27410981e7 100644
--- a/cmd/wdt.c
+++ b/cmd/wdt.c
@@ -12,7 +12,7 @@
static struct udevice *currdev;
-static int do_wdt_list(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_wdt_list(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
struct udevice *dev;
@@ -29,7 +29,7 @@ static int do_wdt_list(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_SUCCESS;
}
-static int do_wdt_dev(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_wdt_dev(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
int ret;
@@ -60,7 +60,7 @@ static int check_currdev(void)
return 0;
}
-static int do_wdt_start(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_wdt_start(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
int ret;
@@ -90,7 +90,7 @@ static int do_wdt_start(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_SUCCESS;
}
-static int do_wdt_stop(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_wdt_stop(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
int ret;
@@ -111,7 +111,7 @@ static int do_wdt_stop(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_SUCCESS;
}
-static int do_wdt_reset(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_wdt_reset(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
int ret;
@@ -132,7 +132,7 @@ static int do_wdt_reset(cmd_tbl_t *cmdtp, int flag, int argc,
return CMD_RET_SUCCESS;
}
-static int do_wdt_expire(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_wdt_expire(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
int ret;
diff --git a/cmd/wol.c b/cmd/wol.c
index 8a756f373c..f0d6343227 100644
--- a/cmd/wol.c
+++ b/cmd/wol.c
@@ -14,7 +14,7 @@
#if defined(CONFIG_CMD_WOL)
void wol_set_timeout(ulong);
-int do_wol(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_wol(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
/* Validate arguments */
if (argc < 2)
diff --git a/cmd/x86/exception.c b/cmd/x86/exception.c
index ade1e2ea92..82faaa913e 100644
--- a/cmd/x86/exception.c
+++ b/cmd/x86/exception.c
@@ -8,14 +8,14 @@
#include <common.h>
#include <command.h>
-static int do_undefined(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_undefined(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
asm volatile (".word 0xffff\n");
return CMD_RET_FAILURE;
}
-static cmd_tbl_t cmd_sub[] = {
+static struct cmd_tbl cmd_sub[] = {
U_BOOT_CMD_MKENT(undefined, CONFIG_SYS_MAXARGS, 1, do_undefined,
"", ""),
};
diff --git a/cmd/x86/fsp.c b/cmd/x86/fsp.c
index 6e485fb144..8017eda387 100644
--- a/cmd/x86/fsp.c
+++ b/cmd/x86/fsp.c
@@ -9,7 +9,7 @@
DECLARE_GLOBAL_DATA_PTR;
-static int do_hdr(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_hdr(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
struct fsp_header *hdr;
u32 img_addr;
@@ -80,13 +80,13 @@ static int do_hdr(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return 0;
}
-static cmd_tbl_t fsp_commands[] = {
+static struct cmd_tbl fsp_commands[] = {
U_BOOT_CMD_MKENT(hdr, 0, 1, do_hdr, "", ""),
};
-static int do_fsp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_fsp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
- cmd_tbl_t *fsp_cmd;
+ struct cmd_tbl *fsp_cmd;
int ret;
if (argc < 2)
diff --git a/cmd/x86/hob.c b/cmd/x86/hob.c
index 3967a7ca5a..6b1f7bda5b 100644
--- a/cmd/x86/hob.c
+++ b/cmd/x86/hob.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
#include <efi.h>
+#include <uuid.h>
#include <asm/hob.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -25,7 +26,7 @@ static char *hob_type[] = {
"Capsule",
};
-static int do_hob(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_hob(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
const struct hob_header *hdr;
uint type;
diff --git a/cmd/x86/mtrr.c b/cmd/x86/mtrr.c
index d3fd959235..2c40e711a1 100644
--- a/cmd/x86/mtrr.c
+++ b/cmd/x86/mtrr.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <command.h>
#include <asm/msr.h>
#include <asm/mtrr.h>
@@ -43,7 +44,7 @@ static int do_mtrr_list(void)
return 0;
}
-static int do_mtrr_set(uint reg, int argc, char * const argv[])
+static int do_mtrr_set(uint reg, int argc, char *const argv[])
{
const char *typename = argv[0];
struct mtrr_state state;
@@ -98,7 +99,8 @@ static int mtrr_set_valid(int reg, bool valid)
return 0;
}
-static int do_mtrr(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_mtrr(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
const char *cmd;
uint reg;
diff --git a/cmd/ximg.c b/cmd/ximg.c
index 770f6a3eed..159ba51648 100644
--- a/cmd/ximg.c
+++ b/cmd/ximg.c
@@ -24,6 +24,7 @@
#include <bzlib.h>
#endif
#include <asm/byteorder.h>
+#include <asm/cache.h>
#include <asm/io.h>
#ifndef CONFIG_SYS_XIMG_LEN
@@ -32,7 +33,7 @@
#endif
static int
-do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+do_imgextract(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
ulong addr = image_load_addr;
ulong dest = 0;
diff --git a/cmd/yaffs2.c b/cmd/yaffs2.c
index 9244606bda..f29ebcc026 100644
--- a/cmd/yaffs2.c
+++ b/cmd/yaffs2.c
@@ -43,7 +43,7 @@ extern void cmd_yaffs_mv(const char *oldPath, const char *newPath);
extern int yaffs_dump_dev(const char *path);
/* ytrace - show/set yaffs trace mask */
-int do_ytrace(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_ytrace(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
if (argc > 1)
cmd_yaffs_tracemask(1, simple_strtol(argv[1], NULL, 16));
@@ -54,7 +54,7 @@ int do_ytrace(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
}
/* ydevls - lists yaffs mount points. */
-int do_ydevls(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_ydevls(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
cmd_yaffs_dev_ls();
@@ -62,7 +62,7 @@ int do_ydevls(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
}
/* ydevconfig mount_pt mtd_dev_num start_block end_block */
-int do_ydevconfig(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_ydevconfig(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char *mtpoint;
int mtd_dev;
@@ -85,7 +85,7 @@ int do_ydevconfig(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
return 0;
}
-int do_ymount(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_ymount(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char *mtpoint;
@@ -102,7 +102,7 @@ int do_ymount(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
return 0;
}
-int do_yumount(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_yumount(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char *mtpoint;
@@ -118,7 +118,7 @@ int do_yumount(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
return 0;
}
-int do_yls(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_yls(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char *dirname;
@@ -134,7 +134,7 @@ int do_yls(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
return 0;
}
-int do_yrd(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_yrd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char *filename;
@@ -153,7 +153,7 @@ int do_yrd(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
return 0;
}
-int do_ywr(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_ywr(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char *filename;
ulong value;
@@ -177,7 +177,7 @@ int do_ywr(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
return 0;
}
-int do_yrdm(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_yrdm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char *filename;
ulong addr;
@@ -195,7 +195,7 @@ int do_yrdm(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
return 0;
}
-int do_ywrm(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_ywrm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char *filename;
ulong addr;
@@ -215,7 +215,7 @@ int do_ywrm(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
return 0;
}
-int do_ymkdir(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_ymkdir(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char *dirname;
@@ -230,7 +230,7 @@ int do_ymkdir(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
return 0;
}
-int do_yrmdir(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_yrmdir(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char *dirname;
@@ -245,7 +245,7 @@ int do_yrmdir(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
return 0;
}
-int do_yrm(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_yrm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char *name;
@@ -261,7 +261,7 @@ int do_yrm(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
return 0;
}
-int do_ymv(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_ymv(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
char *oldPath;
char *newPath;
diff --git a/cmd/zfs.c b/cmd/zfs.c
index 9c237a5758..e429ac88d7 100644
--- a/cmd/zfs.c
+++ b/cmd/zfs.c
@@ -32,13 +32,14 @@
#define DOS_FS_TYPE_OFFSET 0x36
#define DOS_FS32_TYPE_OFFSET 0x52
-static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_zfs_load(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
char *filename = NULL;
int dev;
int part;
ulong addr = 0;
- disk_partition_t info;
+ struct disk_partition info;
struct blk_desc *dev_desc;
unsigned long count;
const char *addr_str;
@@ -129,13 +130,13 @@ int zfs_print(const char *entry, const struct zfs_dirhook_info *data)
}
-
-static int do_zfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_zfs_ls(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
const char *filename = "/";
int part;
struct blk_desc *dev_desc;
- disk_partition_t info;
+ struct disk_partition info;
struct device_s vdev;
if (argc < 2)
diff --git a/cmd/zip.c b/cmd/zip.c
index 8ef46e9815..b433f1889f 100644
--- a/cmd/zip.c
+++ b/cmd/zip.c
@@ -8,7 +8,7 @@
#include <command.h>
#include <env.h>
-static int do_zip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_zip(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
unsigned long src, dst;
unsigned long src_len, dst_len = ~0UL;