aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/android_ab.c11
-rw-r--r--common/autoboot.c2
-rw-r--r--common/bedbug.c1
-rw-r--r--common/board_f.c7
-rw-r--r--common/board_info.c1
-rw-r--r--common/board_r.c12
-rw-r--r--common/boot_fit.c1
-rw-r--r--common/bootm.c30
-rw-r--r--common/bootm_os.c50
-rw-r--r--common/bootstage.c2
-rw-r--r--common/bouncebuf.c2
-rw-r--r--common/cli.c5
-rw-r--r--common/cli_hush.c4
-rw-r--r--common/cli_readline.c1
-rw-r--r--common/cli_simple.c1
-rw-r--r--common/command.c76
-rw-r--r--common/common_fit.c1
-rw-r--r--common/console.c1
-rw-r--r--common/cros_ec.c1
-rw-r--r--common/dfu.c2
-rw-r--r--common/dlmalloc.c1
-rw-r--r--common/edid.c1
-rw-r--r--common/exports.c1
-rw-r--r--common/fdt_region.c1
-rw-r--r--common/fdt_support.c2
-rw-r--r--common/flash.c24
-rw-r--r--common/hash.c8
-rw-r--r--common/hwconfig.c1
-rw-r--r--common/image-cipher.c2
-rw-r--r--common/image-fdt.c6
-rw-r--r--common/image-fit-sig.c1
-rw-r--r--common/image-fit.c2
-rw-r--r--common/image-sig.c3
-rw-r--r--common/image.c17
-rw-r--r--common/init/board_init.c2
-rw-r--r--common/iotrace.c1
-rw-r--r--common/kgdb.c3
-rw-r--r--common/kgdb_stubs.c1
-rw-r--r--common/lcd.c3
-rw-r--r--common/lcd_console.c6
-rw-r--r--common/log_syslog.c1
-rw-r--r--common/main.c2
-rw-r--r--common/malloc_simple.c1
-rw-r--r--common/miiphyutil.c2
-rw-r--r--common/spl/spl.c7
-rw-r--r--common/spl/spl_atf.c3
-rw-r--r--common/spl/spl_ext.c5
-rw-r--r--common/spl/spl_fat.c1
-rw-r--r--common/spl/spl_fit.c2
-rw-r--r--common/spl/spl_legacy.c2
-rw-r--r--common/spl/spl_mmc.c4
-rw-r--r--common/spl/spl_nand.c3
-rw-r--r--common/spl/spl_net.c2
-rw-r--r--common/spl/spl_nor.c2
-rw-r--r--common/spl/spl_onenand.c2
-rw-r--r--common/spl/spl_opensbi.c2
-rw-r--r--common/spl/spl_ram.c2
-rw-r--r--common/spl/spl_sdp.c1
-rw-r--r--common/spl/spl_spi.c2
-rw-r--r--common/spl/spl_ubi.c1
-rw-r--r--common/spl/spl_usb.c1
-rw-r--r--common/spl/spl_xip.c2
-rw-r--r--common/spl/spl_ymodem.c2
-rw-r--r--common/splash_source.c1
-rw-r--r--common/stdio.c1
-rw-r--r--common/usb.c2
-rw-r--r--common/usb_hub.c2
-rw-r--r--common/usb_kbd.c1
-rw-r--r--common/usb_storage.c4
69 files changed, 243 insertions, 117 deletions
diff --git a/common/android_ab.c b/common/android_ab.c
index e0fe32d24d..4943f26d53 100644
--- a/common/android_ab.c
+++ b/common/android_ab.c
@@ -5,9 +5,12 @@
#include <common.h>
#include <android_ab.h>
#include <android_bootloader_message.h>
+#include <blk.h>
+#include <log.h>
#include <malloc.h>
-#include <linux/err.h>
+#include <part.h>
#include <memalign.h>
+#include <linux/err.h>
#include <u-boot/crc.h>
#include <u-boot/crc.h>
@@ -81,7 +84,7 @@ static int ab_control_default(struct bootloader_control *abc)
* @return 0 on success and a negative on error
*/
static int ab_control_create_from_disk(struct blk_desc *dev_desc,
- const disk_partition_t *part_info,
+ const struct disk_partition *part_info,
struct bootloader_control **abc)
{
ulong abc_offset, abc_blocks, ret;
@@ -131,7 +134,7 @@ static int ab_control_create_from_disk(struct blk_desc *dev_desc,
* @return 0 on success and a negative on error
*/
static int ab_control_store(struct blk_desc *dev_desc,
- const disk_partition_t *part_info,
+ const struct disk_partition *part_info,
struct bootloader_control *abc)
{
ulong abc_offset, abc_blocks, ret;
@@ -178,7 +181,7 @@ static int ab_compare_slots(const struct slot_metadata *a,
return 0;
}
-int ab_select_slot(struct blk_desc *dev_desc, disk_partition_t *part_info)
+int ab_select_slot(struct blk_desc *dev_desc, struct disk_partition *part_info)
{
struct bootloader_control *abc = NULL;
u32 crc32_le;
diff --git a/common/autoboot.c b/common/autoboot.c
index 4ea9be6da9..6d78716a26 100644
--- a/common/autoboot.c
+++ b/common/autoboot.c
@@ -13,11 +13,13 @@
#include <env.h>
#include <fdtdec.h>
#include <hash.h>
+#include <log.h>
#include <malloc.h>
#include <memalign.h>
#include <menu.h>
#include <post.h>
#include <time.h>
+#include <linux/delay.h>
#include <u-boot/sha256.h>
#include <bootcount.h>
diff --git a/common/bedbug.c b/common/bedbug.c
index 42ecf61eff..18a35ca23e 100644
--- a/common/bedbug.c
+++ b/common/bedbug.c
@@ -1,6 +1,7 @@
/* $Id$ */
#include <common.h>
+#include <asm/ptrace.h>
#include <linux/ctype.h>
#include <bedbug/bedbug.h>
diff --git a/common/board_f.c b/common/board_f.c
index a5ead31ca7..01194eaa0e 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -11,6 +11,7 @@
#include <common.h>
#include <bloblist.h>
+#include <bootstage.h>
#include <clock_legacy.h>
#include <console.h>
#include <cpu.h>
@@ -25,6 +26,7 @@
#include <init.h>
#include <initcall.h>
#include <lcd.h>
+#include <log.h>
#include <malloc.h>
#include <mapmem.h>
#include <os.h>
@@ -40,6 +42,7 @@
#include <trace.h>
#include <video.h>
#include <watchdog.h>
+#include <asm/cache.h>
#ifdef CONFIG_MACH_TYPE
#include <asm/mach-types.h>
#endif
@@ -822,9 +825,9 @@ static int initf_dm(void)
#if defined(CONFIG_DM) && CONFIG_VAL(SYS_MALLOC_F_LEN)
int ret;
- bootstage_start(BOOTSTATE_ID_ACCUM_DM_F, "dm_f");
+ bootstage_start(BOOTSTAGE_ID_ACCUM_DM_F, "dm_f");
ret = dm_init_and_scan(true);
- bootstage_accum(BOOTSTATE_ID_ACCUM_DM_F);
+ bootstage_accum(BOOTSTAGE_ID_ACCUM_DM_F);
if (ret)
return ret;
#endif
diff --git a/common/board_info.c b/common/board_info.c
index a392bece62..a6db087f96 100644
--- a/common/board_info.c
+++ b/common/board_info.c
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0+
#include <common.h>
+#include <init.h>
#include <linux/libfdt.h>
#include <linux/compiler.h>
diff --git a/common/board_r.c b/common/board_r.c
index 96034b874e..bce87cbf01 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -11,12 +11,16 @@
#include <common.h>
#include <api.h>
+#include <bootstage.h>
#include <cpu_func.h>
#include <exports.h>
+#include <flash.h>
#include <hang.h>
#include <image.h>
#include <irq_func.h>
+#include <log.h>
#include <net.h>
+#include <asm/cache.h>
#include <u-boot/crc.h>
/* TODO: can we just include all these headers whether needed or not? */
#if defined(CONFIG_CMD_BEDBUG)
@@ -310,9 +314,9 @@ static int initr_dm(void)
#ifdef CONFIG_TIMER
gd->timer = NULL;
#endif
- bootstage_start(BOOTSTATE_ID_ACCUM_DM_R, "dm_r");
+ bootstage_start(BOOTSTAGE_ID_ACCUM_DM_R, "dm_r");
ret = dm_init_and_scan(false);
- bootstage_accum(BOOTSTATE_ID_ACCUM_DM_R);
+ bootstage_accum(BOOTSTAGE_ID_ACCUM_DM_R);
if (ret)
return ret;
@@ -354,8 +358,8 @@ static int initr_announce(void)
#ifdef CONFIG_NEEDS_MANUAL_RELOC
static int initr_manual_reloc_cmdtable(void)
{
- fixup_cmdtable(ll_entry_start(cmd_tbl_t, cmd),
- ll_entry_count(cmd_tbl_t, cmd));
+ fixup_cmdtable(ll_entry_start(struct cmd_tbl, cmd),
+ ll_entry_count(struct cmd_tbl, cmd));
return 0;
}
#endif
diff --git a/common/boot_fit.c b/common/boot_fit.c
index ffa4d740eb..dfc2a3117d 100644
--- a/common/boot_fit.c
+++ b/common/boot_fit.c
@@ -10,6 +10,7 @@
#include <common.h>
#include <errno.h>
#include <image.h>
+#include <log.h>
#include <linux/libfdt.h>
static int fdt_offset(const void *fit)
diff --git a/common/bootm.c b/common/bootm.c
index db4362a643..2ed7521520 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -13,8 +13,11 @@
#include <fdt_support.h>
#include <irq_func.h>
#include <lmb.h>
+#include <log.h>
#include <malloc.h>
#include <mapmem.h>
+#include <net.h>
+#include <asm/cache.h>
#include <asm/io.h>
#if defined(CONFIG_CMD_USB)
#include <usb.h>
@@ -40,8 +43,8 @@ DECLARE_GLOBAL_DATA_PTR;
bootm_headers_t images; /* pointers to os/initrd/fdt images */
-static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[], bootm_headers_t *images,
+static const void *boot_get_kernel(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[], bootm_headers_t *images,
ulong *os_data, ulong *os_len);
__weak void board_quiesce_devices(void)
@@ -65,8 +68,8 @@ static void boot_start_lmb(bootm_headers_t *images)
static inline void boot_start_lmb(bootm_headers_t *images) { }
#endif
-static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int bootm_start(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
memset((void *)&images, 0, sizeof(images));
images.verify = env_get_yesno("verify");
@@ -79,8 +82,8 @@ static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc,
return 0;
}
-static int bootm_find_os(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int bootm_find_os(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
const void *os_hdr;
bool ep_found = false;
@@ -236,7 +239,7 @@ static int bootm_find_os(cmd_tbl_t *cmdtp, int flag, int argc,
* 0, if all existing images were loaded correctly
* 1, if an image is found but corrupted, or invalid
*/
-int bootm_find_images(int flag, int argc, char * const argv[])
+int bootm_find_images(int flag, int argc, char *const argv[])
{
int ret;
@@ -283,8 +286,8 @@ int bootm_find_images(int flag, int argc, char * const argv[])
return 0;
}
-static int bootm_find_other(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int bootm_find_other(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
if (((images.os.type == IH_TYPE_KERNEL) ||
(images.os.type == IH_TYPE_KERNEL_NOLOAD) ||
@@ -518,8 +521,9 @@ static void fixup_silent_linux(void)
* then the intent is to boot an OS, so this function will not return
* unless the image type is standalone.
*/
-int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
- int states, bootm_headers_t *images, int boot_progress)
+int do_bootm_states(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[], int states, bootm_headers_t *images,
+ int boot_progress)
{
boot_os_fn *boot_fn;
ulong iflag = 0;
@@ -702,8 +706,8 @@ static image_header_t *image_get_kernel(ulong img_addr, int verify)
* pointer to image header if valid image was found, plus kernel start
* address and length, otherwise NULL
*/
-static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[], bootm_headers_t *images,
+static const void *boot_get_kernel(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[], bootm_headers_t *images,
ulong *os_data, ulong *os_len)
{
#if CONFIG_IS_ENABLED(LEGACY_IMAGE_FORMAT)
diff --git a/common/bootm_os.c b/common/bootm_os.c
index 1d58462509..55296483f7 100644
--- a/common/bootm_os.c
+++ b/common/bootm_os.c
@@ -6,10 +6,14 @@
#include <common.h>
#include <bootm.h>
+#include <bootstage.h>
#include <cpu_func.h>
#include <efi_loader.h>
#include <env.h>
#include <fdt_support.h>
+#include <image.h>
+#include <lmb.h>
+#include <log.h>
#include <linux/libfdt.h>
#include <malloc.h>
#include <mapmem.h>
@@ -18,7 +22,7 @@
DECLARE_GLOBAL_DATA_PTR;
-static int do_bootm_standalone(int flag, int argc, char * const argv[],
+static int do_bootm_standalone(int flag, int argc, char *const argv[],
bootm_headers_t *images)
{
char *s;
@@ -40,7 +44,7 @@ static int do_bootm_standalone(int flag, int argc, char * const argv[],
/*******************************************************************/
#if defined(CONFIG_BOOTM_NETBSD) || defined(CONFIG_BOOTM_PLAN9)
-static void copy_args(char *dest, int argc, char * const argv[], char delim)
+static void copy_args(char *dest, int argc, char *const argv[], char delim)
{
int i;
@@ -54,8 +58,8 @@ static void copy_args(char *dest, int argc, char * const argv[], char delim)
#endif
#ifdef CONFIG_BOOTM_NETBSD
-static int do_bootm_netbsd(int flag, int argc, char * const argv[],
- bootm_headers_t *images)
+static int do_bootm_netbsd(int flag, int argc, char *const argv[],
+ bootm_headers_t *images)
{
void (*loader)(bd_t *, image_header_t *, char *, char *);
image_header_t *os_hdr, *hdr;
@@ -126,8 +130,8 @@ static int do_bootm_netbsd(int flag, int argc, char * const argv[],
#endif /* CONFIG_BOOTM_NETBSD*/
#ifdef CONFIG_LYNXKDI
-static int do_bootm_lynxkdi(int flag, int argc, char * const argv[],
- bootm_headers_t *images)
+static int do_bootm_lynxkdi(int flag, int argc, char *const argv[],
+ bootm_headers_t *images)
{
image_header_t *hdr = &images->legacy_hdr_os_copy;
@@ -148,8 +152,8 @@ static int do_bootm_lynxkdi(int flag, int argc, char * const argv[],
#endif /* CONFIG_LYNXKDI */
#ifdef CONFIG_BOOTM_RTEMS
-static int do_bootm_rtems(int flag, int argc, char * const argv[],
- bootm_headers_t *images)
+static int do_bootm_rtems(int flag, int argc, char *const argv[],
+ bootm_headers_t *images)
{
void (*entry_point)(bd_t *);
@@ -181,8 +185,8 @@ static int do_bootm_rtems(int flag, int argc, char * const argv[],
#endif /* CONFIG_BOOTM_RTEMS */
#if defined(CONFIG_BOOTM_OSE)
-static int do_bootm_ose(int flag, int argc, char * const argv[],
- bootm_headers_t *images)
+static int do_bootm_ose(int flag, int argc, char *const argv[],
+ bootm_headers_t *images)
{
void (*entry_point)(void);
@@ -214,8 +218,8 @@ static int do_bootm_ose(int flag, int argc, char * const argv[],
#endif /* CONFIG_BOOTM_OSE */
#if defined(CONFIG_BOOTM_PLAN9)
-static int do_bootm_plan9(int flag, int argc, char * const argv[],
- bootm_headers_t *images)
+static int do_bootm_plan9(int flag, int argc, char *const argv[],
+ bootm_headers_t *images)
{
void (*entry_point)(void);
char *s;
@@ -321,7 +325,7 @@ static void do_bootvx_fdt(bootm_headers_t *images)
puts("## vxWorks terminated\n");
}
-static int do_bootm_vxworks_legacy(int flag, int argc, char * const argv[],
+static int do_bootm_vxworks_legacy(int flag, int argc, char *const argv[],
bootm_headers_t *images)
{
if (flag != BOOTM_STATE_OS_GO)
@@ -339,7 +343,7 @@ static int do_bootm_vxworks_legacy(int flag, int argc, char * const argv[],
return 1;
}
-int do_bootm_vxworks(int flag, int argc, char * const argv[],
+int do_bootm_vxworks(int flag, int argc, char *const argv[],
bootm_headers_t *images)
{
char *bootargs;
@@ -376,8 +380,8 @@ int do_bootm_vxworks(int flag, int argc, char * const argv[],
#endif
#if defined(CONFIG_CMD_ELF)
-static int do_bootm_qnxelf(int flag, int argc, char * const argv[],
- bootm_headers_t *images)
+static int do_bootm_qnxelf(int flag, int argc, char *const argv[],
+ bootm_headers_t *images)
{
char *local_args[2];
char str[16];
@@ -414,8 +418,8 @@ static int do_bootm_qnxelf(int flag, int argc, char * const argv[],
#endif
#ifdef CONFIG_INTEGRITY
-static int do_bootm_integrity(int flag, int argc, char * const argv[],
- bootm_headers_t *images)
+static int do_bootm_integrity(int flag, int argc, char *const argv[],
+ bootm_headers_t *images)
{
void (*entry_point)(void);
@@ -447,8 +451,8 @@ static int do_bootm_integrity(int flag, int argc, char * const argv[],
#endif
#ifdef CONFIG_BOOTM_OPENRTOS
-static int do_bootm_openrtos(int flag, int argc, char * const argv[],
- bootm_headers_t *images)
+static int do_bootm_openrtos(int flag, int argc, char *const argv[],
+ bootm_headers_t *images)
{
void (*entry_point)(void);
@@ -473,7 +477,7 @@ static int do_bootm_openrtos(int flag, int argc, char * const argv[],
#endif
#ifdef CONFIG_BOOTM_OPTEE
-static int do_bootm_tee(int flag, int argc, char * const argv[],
+static int do_bootm_tee(int flag, int argc, char *const argv[],
bootm_headers_t *images)
{
int ret;
@@ -501,7 +505,7 @@ static int do_bootm_tee(int flag, int argc, char * const argv[],
#endif
#ifdef CONFIG_BOOTM_EFI
-static int do_bootm_efi(int flag, int argc, char * const argv[],
+static int do_bootm_efi(int flag, int argc, char *const argv[],
bootm_headers_t *images)
{
int ret;
@@ -604,7 +608,7 @@ __weak void board_preboot_os(void)
/* please define board specific board_preboot_os() */
}
-int boot_selected_os(int argc, char * const argv[], int state,
+int boot_selected_os(int argc, char *const argv[], int state,
bootm_headers_t *images, boot_os_fn *boot_fn)
{
arch_preboot_os();
diff --git a/common/bootstage.c b/common/bootstage.c
index d2ed33663b..5f87358fd8 100644
--- a/common/bootstage.c
+++ b/common/bootstage.c
@@ -10,7 +10,9 @@
*/
#include <common.h>
+#include <bootstage.h>
#include <hang.h>
+#include <log.h>
#include <malloc.h>
#include <sort.h>
#include <spl.h>
diff --git a/common/bouncebuf.c b/common/bouncebuf.c
index 0ace152b98..6d98920de6 100644
--- a/common/bouncebuf.c
+++ b/common/bouncebuf.c
@@ -7,9 +7,11 @@
#include <common.h>
#include <cpu_func.h>
+#include <log.h>
#include <malloc.h>
#include <errno.h>
#include <bouncebuf.h>
+#include <asm/cache.h>
static int addr_aligned(struct bounce_buffer *state)
{
diff --git a/common/cli.c b/common/cli.c
index 38bba17585..6635ab2bcf 100644
--- a/common/cli.c
+++ b/common/cli.c
@@ -9,6 +9,7 @@
*/
#include <common.h>
+#include <bootstage.h>
#include <cli.h>
#include <cli_hush.h>
#include <command.h>
@@ -128,7 +129,7 @@ int run_command_list(const char *cmd, int len, int flag)
/****************************************************************************/
#if defined(CONFIG_CMD_RUN)
-int do_run(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_run(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
int i;
@@ -182,7 +183,7 @@ bool cli_process_fdt(const char **cmdp)
void cli_secure_boot_cmd(const char *cmd)
{
#ifdef CONFIG_CMDLINE
- cmd_tbl_t *cmdtp;
+ struct cmd_tbl *cmdtp;
#endif
int rc;
diff --git a/common/cli_hush.c b/common/cli_hush.c
index a62af07cc5..5b1f119074 100644
--- a/common/cli_hush.c
+++ b/common/cli_hush.c
@@ -3664,8 +3664,8 @@ static char *make_string(char **inp, int *nonnull)
}
#ifdef __U_BOOT__
-static int do_showvar(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+static int do_showvar(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int i, k;
int rcode = 0;
diff --git a/common/cli_readline.c b/common/cli_readline.c
index 6ef7a3e564..1f1e28c6d8 100644
--- a/common/cli_readline.c
+++ b/common/cli_readline.c
@@ -11,6 +11,7 @@
#include <common.h>
#include <bootretry.h>
#include <cli.h>
+#include <command.h>
#include <time.h>
#include <watchdog.h>
diff --git a/common/cli_simple.c b/common/cli_simple.c
index 358e9b7fe1..7d91316a0f 100644
--- a/common/cli_simple.c
+++ b/common/cli_simple.c
@@ -14,6 +14,7 @@
#include <command.h>
#include <console.h>
#include <env.h>
+#include <log.h>
#include <linux/ctype.h>
#define DEBUG_PARSER 0 /* set to 1 to debug */
diff --git a/common/command.c b/common/command.c
index 0d8bf244be..4f49f15bfd 100644
--- a/common/command.c
+++ b/common/command.c
@@ -12,6 +12,7 @@
#include <command.h>
#include <console.h>
#include <env.h>
+#include <log.h>
#include <linux/ctype.h>
/*
@@ -19,14 +20,14 @@
* for long help messages
*/
-int _do_help(cmd_tbl_t *cmd_start, int cmd_items, cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+int _do_help(struct cmd_tbl *cmd_start, int cmd_items, struct cmd_tbl *cmdtp,
+ int flag, int argc, char *const argv[])
{
int i;
int rcode = 0;
if (argc == 1) { /* show list of commands */
- cmd_tbl_t *cmd_array[cmd_items];
+ struct cmd_tbl *cmd_array[cmd_items];
int i, j, swaps;
/* Make array of commands from .uboot_cmd section */
@@ -41,7 +42,7 @@ int _do_help(cmd_tbl_t *cmd_start, int cmd_items, cmd_tbl_t *cmdtp, int flag,
for (j = 0; j < i; ++j) {
if (strcmp(cmd_array[j]->name,
cmd_array[j + 1]->name) > 0) {
- cmd_tbl_t *tmp;
+ struct cmd_tbl *tmp;
tmp = cmd_array[j];
cmd_array[j] = cmd_array[j + 1];
cmd_array[j + 1] = tmp;
@@ -83,11 +84,12 @@ int _do_help(cmd_tbl_t *cmd_start, int cmd_items, cmd_tbl_t *cmdtp, int flag,
}
/* find command table entry for a command */
-cmd_tbl_t *find_cmd_tbl(const char *cmd, cmd_tbl_t *table, int table_len)
+struct cmd_tbl *find_cmd_tbl(const char *cmd, struct cmd_tbl *table,
+ int table_len)
{
#ifdef CONFIG_CMDLINE
- cmd_tbl_t *cmdtp;
- cmd_tbl_t *cmdtp_temp = table; /* Init value */
+ struct cmd_tbl *cmdtp;
+ struct cmd_tbl *cmdtp_temp = table; /* Init value */
const char *p;
int len;
int n_found = 0;
@@ -117,14 +119,14 @@ cmd_tbl_t *find_cmd_tbl(const char *cmd, cmd_tbl_t *table, int table_len)
return NULL; /* not found or ambiguous command */
}
-cmd_tbl_t *find_cmd(const char *cmd)
+struct cmd_tbl *find_cmd(const char *cmd)
{
- 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 find_cmd_tbl(cmd, start, len);
}
-int cmd_usage(const cmd_tbl_t *cmdtp)
+int cmd_usage(const struct cmd_tbl *cmdtp)
{
printf("%s - %s\n\n", cmdtp->name, cmdtp->usage);
@@ -145,7 +147,8 @@ int cmd_usage(const cmd_tbl_t *cmdtp)
#ifdef CONFIG_AUTO_COMPLETE
static char env_complete_buf[512];
-int var_complete(int argc, char * const argv[], char last_char, int maxv, char *cmdv[])
+int var_complete(int argc, char *const argv[], char last_char, int maxv,
+ char *cmdv[])
{
int space;
@@ -163,7 +166,7 @@ int var_complete(int argc, char * const argv[], char last_char, int maxv, char *
return 0;
}
-static int dollar_complete(int argc, char * const argv[], char last_char,
+static int dollar_complete(int argc, char *const argv[], char last_char,
int maxv, char *cmdv[])
{
/* Make sure the last argument starts with a $. */
@@ -177,12 +180,12 @@ static int dollar_complete(int argc, char * const argv[], char last_char,
/*************************************************************************************/
-int complete_subcmdv(cmd_tbl_t *cmdtp, int count, int argc,
- char * const argv[], char last_char,
+int complete_subcmdv(struct cmd_tbl *cmdtp, int count, int argc,
+ char *const argv[], char last_char,
int maxv, char *cmdv[])
{
#ifdef CONFIG_CMDLINE
- const cmd_tbl_t *cmdend = cmdtp + count;
+ const struct cmd_tbl *cmdend = cmdtp + count;
const char *p;
int len, clen;
int n_found = 0;
@@ -254,12 +257,12 @@ int complete_subcmdv(cmd_tbl_t *cmdtp, int count, int argc,
#endif
}
-static int complete_cmdv(int argc, char * const argv[], char last_char,
+static int complete_cmdv(int argc, char *const argv[], char last_char,
int maxv, char *cmdv[])
{
#ifdef CONFIG_CMDLINE
- return complete_subcmdv(ll_entry_start(cmd_tbl_t, cmd),
- ll_entry_count(cmd_tbl_t, cmd), argc, argv,
+ return complete_subcmdv(ll_entry_start(struct cmd_tbl, cmd),
+ ll_entry_count(struct cmd_tbl, cmd), argc, argv,
last_char, maxv, cmdv);
#else
return 0;
@@ -296,7 +299,8 @@ static int make_argv(char *s, int argvsz, char *argv[])
return argc;
}
-static void print_argv(const char *banner, const char *leader, const char *sep, int linemax, char * const argv[])
+static void print_argv(const char *banner, const char *leader, const char *sep,
+ int linemax, char *const argv[])
{
int ll = leader != NULL ? strlen(leader) : 0;
int sl = sep != NULL ? strlen(sep) : 0;
@@ -323,7 +327,7 @@ static void print_argv(const char *banner, const char *leader, const char *sep,
printf("\n");
}
-static int find_common_prefix(char * const argv[])
+static int find_common_prefix(char *const argv[])
{
int i, len;
char *anchor, *s, *t;
@@ -486,7 +490,7 @@ int cmd_get_data_size(char* arg, int default_size)
#if defined(CONFIG_NEEDS_MANUAL_RELOC)
DECLARE_GLOBAL_DATA_PTR;
-void fixup_cmdtable(cmd_tbl_t *cmdtp, int size)
+void fixup_cmdtable(struct cmd_tbl *cmdtp, int size)
{
int i;
@@ -498,7 +502,7 @@ void fixup_cmdtable(cmd_tbl_t *cmdtp, int size)
addr = (ulong)(cmdtp->cmd_rep) + gd->reloc_off;
cmdtp->cmd_rep =
- (int (*)(struct cmd_tbl_s *, int, int,
+ (int (*)(struct cmd_tbl *, int, int,
char * const [], int *))addr;
addr = (ulong)(cmdtp->cmd) + gd->reloc_off;
@@ -506,8 +510,8 @@ void fixup_cmdtable(cmd_tbl_t *cmdtp, int size)
printf("Command \"%s\": 0x%08lx => 0x%08lx\n",
cmdtp->name, (ulong)(cmdtp->cmd), addr);
#endif
- cmdtp->cmd =
- (int (*)(struct cmd_tbl_s *, int, int, char * const []))addr;
+ cmdtp->cmd = (int (*)(struct cmd_tbl *, int, int,
+ char *const []))addr;
addr = (ulong)(cmdtp->name) + gd->reloc_off;
cmdtp->name = (char *)addr;
if (cmdtp->usage) {
@@ -532,24 +536,24 @@ void fixup_cmdtable(cmd_tbl_t *cmdtp, int size)
}
#endif
-int cmd_always_repeatable(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[], int *repeatable)
+int cmd_always_repeatable(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[], int *repeatable)
{
*repeatable = 1;
return cmdtp->cmd(cmdtp, flag, argc, argv);
}
-int cmd_never_repeatable(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[], int *repeatable)
+int cmd_never_repeatable(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[], int *repeatable)
{
*repeatable = 0;
return cmdtp->cmd(cmdtp, flag, argc, argv);
}
-int cmd_discard_repeatable(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+int cmd_discard_repeatable(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
int repeatable;
@@ -568,8 +572,8 @@ int cmd_discard_repeatable(cmd_tbl_t *cmdtp, int flag, int argc,
* @param repeatable Can the command be repeated
* @return 0 if command succeeded, else non-zero (CMD_RET_...)
*/
-static int cmd_call(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
- int *repeatable)
+static int cmd_call(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[], int *repeatable)
{
int result;
@@ -579,11 +583,11 @@ static int cmd_call(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
return result;
}
-enum command_ret_t cmd_process(int flag, int argc, char * const argv[],
+enum command_ret_t cmd_process(int flag, int argc, char *const argv[],
int *repeatable, ulong *ticks)
{
enum command_ret_t rc = CMD_RET_SUCCESS;
- cmd_tbl_t *cmdtp;
+ struct cmd_tbl *cmdtp;
#if defined(CONFIG_SYS_XTRACE)
char *xtrace;
@@ -638,7 +642,7 @@ enum command_ret_t cmd_process(int flag, int argc, char * const argv[],
return rc;
}
-int cmd_process_error(cmd_tbl_t *cmdtp, int err)
+int cmd_process_error(struct cmd_tbl *cmdtp, int err)
{
if (err == CMD_RET_USAGE)
return CMD_RET_USAGE;
diff --git a/common/common_fit.c b/common/common_fit.c
index 41305d8aa6..a993308100 100644
--- a/common/common_fit.c
+++ b/common/common_fit.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <errno.h>
#include <image.h>
+#include <log.h>
#include <linux/libfdt.h>
ulong fdt_getprop_u32(const void *fdt, int node, const char *prop)
diff --git a/common/console.c b/common/console.c
index e398530a13..1deca3cb78 100644
--- a/common/console.c
+++ b/common/console.c
@@ -19,6 +19,7 @@
#include <exports.h>
#include <env_internal.h>
#include <watchdog.h>
+#include <linux/delay.h>
DECLARE_GLOBAL_DATA_PTR;
diff --git a/common/cros_ec.c b/common/cros_ec.c
index e66471ebd1..249d1f1941 100644
--- a/common/cros_ec.c
+++ b/common/cros_ec.c
@@ -12,6 +12,7 @@
#include <cros_ec.h>
#include <dm.h>
#include <errno.h>
+#include <log.h>
struct udevice *board_get_cros_ec_dev(void)
{
diff --git a/common/dfu.c b/common/dfu.c
index da6289b218..d23cf67f19 100644
--- a/common/dfu.c
+++ b/common/dfu.c
@@ -11,6 +11,8 @@
*/
#include <common.h>
+#include <command.h>
+#include <log.h>
#include <watchdog.h>
#include <dfu.h>
#include <console.h>
diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index e8f07f14f9..b29a7cfd93 100644
--- a/common/dlmalloc.c
+++ b/common/dlmalloc.c
@@ -1,4 +1,5 @@
#include <common.h>
+#include <log.h>
#if CONFIG_IS_ENABLED(UNIT_TEST)
#define DEBUG
diff --git a/common/edid.c b/common/edid.c
index f99f42dc40..553ab8fd01 100644
--- a/common/edid.c
+++ b/common/edid.c
@@ -13,6 +13,7 @@
#include <edid.h>
#include <errno.h>
#include <fdtdec.h>
+#include <log.h>
#include <linux/ctype.h>
#include <linux/string.h>
diff --git a/common/exports.c b/common/exports.c
index 18af38a5f6..6253b55694 100644
--- a/common/exports.c
+++ b/common/exports.c
@@ -1,4 +1,5 @@
#include <common.h>
+#include <command.h>
#include <exports.h>
#include <malloc.h>
#include <spi.h>
diff --git a/common/fdt_region.c b/common/fdt_region.c
index bf0a9be730..667659054a 100644
--- a/common/fdt_region.c
+++ b/common/fdt_region.c
@@ -5,6 +5,7 @@
* Written by Simon Glass <sjg@chromium.org>
*/
+#include <fdt_support.h>
#include <linux/libfdt_env.h>
#include <fdt_region.h>
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 02cf5c6241..3778de5368 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -8,7 +8,9 @@
#include <common.h>
#include <env.h>
+#include <log.h>
#include <mapmem.h>
+#include <net.h>
#include <stdio_dev.h>
#include <linux/ctype.h>
#include <linux/types.h>
diff --git a/common/flash.c b/common/flash.c
index 5f155aefd1..bb82385c1f 100644
--- a/common/flash.c
+++ b/common/flash.c
@@ -8,6 +8,8 @@
#include <common.h>
#include <flash.h>
+#include <log.h>
+#include <uuid.h>
#include <mtd/cfi_flash.h>
@@ -24,7 +26,7 @@ extern flash_info_t flash_info[]; /* info for FLASH chips */
* If necessary you have to map the second bank at lower addresses.
*/
void
-flash_protect (int flag, ulong from, ulong to, flash_info_t *info)
+flash_protect(int flag, ulong from, ulong to, flash_info_t *info)
{
ulong b_end;
short s_end;
@@ -38,10 +40,10 @@ flash_protect (int flag, ulong from, ulong to, flash_info_t *info)
s_end = info->sector_count - 1; /* index of last sector */
b_end = info->start[0] + info->size - 1; /* bank end address */
- debug ("flash_protect %s: from 0x%08lX to 0x%08lX\n",
- (flag & FLAG_PROTECT_SET) ? "ON" :
- (flag & FLAG_PROTECT_CLEAR) ? "OFF" : "???",
- from, to);
+ debug("%s %s: from 0x%08lX to 0x%08lX\n", __func__,
+ (flag & FLAG_PROTECT_SET) ? "ON" :
+ (flag & FLAG_PROTECT_CLEAR) ? "OFF" : "???",
+ from, to);
/* There is nothing to do if we have no data about the flash
* or the protect range and flash range don't overlap.
@@ -66,7 +68,7 @@ flash_protect (int flag, ulong from, ulong to, flash_info_t *info)
#else
info->protect[i] = 0;
#endif /* CONFIG_SYS_FLASH_PROTECTION */
- debug ("protect off %d\n", i);
+ debug("protect off %d\n", i);
}
else if (flag & FLAG_PROTECT_SET) {
#if defined(CONFIG_SYS_FLASH_PROTECTION)
@@ -74,7 +76,7 @@ flash_protect (int flag, ulong from, ulong to, flash_info_t *info)
#else
info->protect[i] = 1;
#endif /* CONFIG_SYS_FLASH_PROTECTION */
- debug ("protect on %d\n", i);
+ debug("protect on %d\n", i);
}
}
}
@@ -84,7 +86,7 @@ flash_protect (int flag, ulong from, ulong to, flash_info_t *info)
*/
flash_info_t *
-addr2info (ulong addr)
+addr2info(ulong addr)
{
flash_info_t *info;
int i;
@@ -119,12 +121,12 @@ addr2info (ulong addr)
* (only some targets require alignment)
*/
int
-flash_write (char *src, ulong addr, ulong cnt)
+flash_write(char *src, ulong addr, ulong cnt)
{
int i;
ulong end = addr + cnt - 1;
- flash_info_t *info_first = addr2info (addr);
- flash_info_t *info_last = addr2info (end );
+ flash_info_t *info_first = addr2info(addr);
+ flash_info_t *info_last = addr2info(end);
flash_info_t *info;
__maybe_unused char *src_orig = src;
__maybe_unused char *addr_orig = (char *)addr;
diff --git a/common/hash.c b/common/hash.c
index ff4986a619..8c00659d25 100644
--- a/common/hash.c
+++ b/common/hash.c
@@ -13,19 +13,21 @@
#include <common.h>
#include <command.h>
#include <env.h>
+#include <log.h>
#include <malloc.h>
#include <mapmem.h>
#include <hw_sha.h>
+#include <asm/cache.h>
#include <asm/io.h>
#include <linux/errno.h>
#include <u-boot/crc.h>
#else
#include "mkimage.h"
#include <time.h>
-#include <image.h>
#endif /* !USE_HOSTCC*/
#include <hash.h>
+#include <image.h>
#include <u-boot/crc.h>
#include <u-boot/sha1.h>
#include <u-boot/sha256.h>
@@ -443,8 +445,8 @@ static void hash_show(struct hash_algo *algo, ulong addr, ulong len, uint8_t *ou
printf("%02x", output[i]);
}
-int hash_command(const char *algo_name, int flags, cmd_tbl_t *cmdtp, int flag,
- int argc, char * const argv[])
+int hash_command(const char *algo_name, int flags, struct cmd_tbl *cmdtp,
+ int flag, int argc, char *const argv[])
{
ulong addr, len;
diff --git a/common/hwconfig.c b/common/hwconfig.c
index 72f3c4e0fa..daf3eea5f9 100644
--- a/common/hwconfig.c
+++ b/common/hwconfig.c
@@ -14,6 +14,7 @@
#include <env.h>
#include <exports.h>
#include <hwconfig.h>
+#include <log.h>
#include <linux/types.h>
#include <linux/string.h>
#else
diff --git a/common/image-cipher.c b/common/image-cipher.c
index f50c3d31bd..09869f7846 100644
--- a/common/image-cipher.c
+++ b/common/image-cipher.c
@@ -10,7 +10,7 @@
#include <common.h>
#include <malloc.h>
DECLARE_GLOBAL_DATA_PTR;
-#endif /* !USE_HOSTCC*/
+#endif /* !USE_HOSdTCC*/
#include <image.h>
#include <uboot_aes.h>
#include <u-boot/aes.h>
diff --git a/common/image-fdt.c b/common/image-fdt.c
index 3002948b6b..b63e772bd6 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -14,6 +14,8 @@
#include <env.h>
#include <errno.h>
#include <image.h>
+#include <lmb.h>
+#include <log.h>
#include <malloc.h>
#include <linux/libfdt.h>
#include <mapmem.h>
@@ -263,8 +265,8 @@ error:
* 1, if fdt image is found but corrupted
* of_flat_tree and of_size are set to 0 if no fdt exists
*/
-int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch,
- bootm_headers_t *images, char **of_flat_tree, ulong *of_size)
+int boot_get_fdt(int flag, int argc, char *const argv[], uint8_t arch,
+ bootm_headers_t *images, char **of_flat_tree, ulong *of_size)
{
#if CONFIG_IS_ENABLED(LEGACY_IMAGE_FORMAT)
const image_header_t *fdt_hdr;
diff --git a/common/image-fit-sig.c b/common/image-fit-sig.c
index a3a0c61bcb..cc1967109e 100644
--- a/common/image-fit-sig.c
+++ b/common/image-fit-sig.c
@@ -8,6 +8,7 @@
#include <time.h>
#else
#include <common.h>
+#include <log.h>
#include <malloc.h>
DECLARE_GLOBAL_DATA_PTR;
#endif /* !USE_HOSTCC*/
diff --git a/common/image-fit.c b/common/image-fit.c
index 368b73088a..1ece100a21 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -11,12 +11,14 @@
#ifdef USE_HOSTCC
#include "mkimage.h"
#include <time.h>
+#include <linux/libfdt.h>
#include <u-boot/crc.h>
#else
#include <linux/compiler.h>
#include <linux/kconfig.h>
#include <common.h>
#include <errno.h>
+#include <log.h>
#include <mapmem.h>
#include <asm/io.h>
#include <malloc.h>
diff --git a/common/image-sig.c b/common/image-sig.c
index 84b2c0439c..498969d641 100644
--- a/common/image-sig.c
+++ b/common/image-sig.c
@@ -5,9 +5,12 @@
#ifdef USE_HOSTCC
#include "mkimage.h"
+#include <fdt_support.h>
#include <time.h>
+#include <linux/libfdt.h>
#else
#include <common.h>
+#include <log.h>
#include <malloc.h>
DECLARE_GLOBAL_DATA_PTR;
#endif /* !USE_HOSTCC*/
diff --git a/common/image.c b/common/image.c
index d8d14e871c..e1ca1a7905 100644
--- a/common/image.c
+++ b/common/image.c
@@ -8,9 +8,13 @@
#ifndef USE_HOSTCC
#include <common.h>
+#include <bootstage.h>
#include <cpu_func.h>
#include <env.h>
+#include <lmb.h>
+#include <log.h>
#include <malloc.h>
+#include <asm/cache.h>
#include <u-boot/crc.h>
#include <watchdog.h>
@@ -44,7 +48,8 @@
#include <lzma/LzmaTools.h>
#ifdef CONFIG_CMD_BDI
-extern int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
+extern int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[]);
#endif
DECLARE_GLOBAL_DATA_PTR;
@@ -1072,8 +1077,8 @@ int genimg_has_config(bootm_headers_t *images)
* 1, if ramdisk image is found but corrupted, or invalid
* rd_start and rd_end are set to 0 if no ramdisk exists
*/
-int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,
- uint8_t arch, ulong *rd_start, ulong *rd_end)
+int boot_get_ramdisk(int argc, char *const argv[], bootm_headers_t *images,
+ uint8_t arch, ulong *rd_start, ulong *rd_end)
{
ulong rd_addr, rd_load;
ulong rd_data, rd_len;
@@ -1368,7 +1373,7 @@ int boot_get_setup(bootm_headers_t *images, uint8_t arch,
#if IMAGE_ENABLE_FIT
#if defined(CONFIG_FPGA)
-int boot_get_fpga(int argc, char * const argv[], bootm_headers_t *images,
+int boot_get_fpga(int argc, char *const argv[], bootm_headers_t *images,
uint8_t arch, const ulong *ld_start, ulong * const ld_len)
{
ulong tmp_img_addr, img_data, img_len;
@@ -1469,8 +1474,8 @@ static void fit_loadable_process(uint8_t img_type,
fit_loadable_handler->handler(img_data, img_len);
}
-int boot_get_loadable(int argc, char * const argv[], bootm_headers_t *images,
- uint8_t arch, const ulong *ld_start, ulong * const ld_len)
+int boot_get_loadable(int argc, char *const argv[], bootm_headers_t *images,
+ uint8_t arch, const ulong *ld_start, ulong * const ld_len)
{
/*
* These variables are used to hold the current image location
diff --git a/common/init/board_init.c b/common/init/board_init.c
index f7c8a173ff..8c8a5eac05 100644
--- a/common/init/board_init.c
+++ b/common/init/board_init.c
@@ -7,6 +7,8 @@
*/
#include <common.h>
+#include <bootstage.h>
+#include <init.h>
DECLARE_GLOBAL_DATA_PTR;
diff --git a/common/iotrace.c b/common/iotrace.c
index 295ee07b72..7225ee4404 100644
--- a/common/iotrace.c
+++ b/common/iotrace.c
@@ -9,6 +9,7 @@
#include <mapmem.h>
#include <time.h>
#include <asm/io.h>
+#include <linux/bug.h>
#include <u-boot/crc.h>
DECLARE_GLOBAL_DATA_PTR;
diff --git a/common/kgdb.c b/common/kgdb.c
index daf53bed7a..4493a15919 100644
--- a/common/kgdb.c
+++ b/common/kgdb.c
@@ -88,6 +88,7 @@
****************************************************************************/
#include <common.h>
+#include <asm/ptrace.h>
#include <kgdb.h>
#include <command.h>
@@ -574,7 +575,7 @@ breakpoint(void)
}
int
-do_kgdb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+do_kgdb(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
printf("Entering KGDB mode via exception handler...\n\n");
kgdb_breakpoint(argc - 1, argv + 1);
diff --git a/common/kgdb_stubs.c b/common/kgdb_stubs.c
index c061126bed..66aed7cea1 100644
--- a/common/kgdb_stubs.c
+++ b/common/kgdb_stubs.c
@@ -11,6 +11,7 @@
#include <cpu_func.h>
#include <kgdb.h>
#include <serial.h>
+#include <asm/ptrace.h>
int (*debugger_exception_handler)(struct pt_regs *);
diff --git a/common/lcd.c b/common/lcd.c
index f8bc1ceba7..02f2db3a99 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -12,6 +12,9 @@
#include <command.h>
#include <cpu_func.h>
#include <env_callback.h>
+#include <log.h>
+#include <asm/cache.h>
+#include <init.h>
#include <linux/types.h>
#include <stdio_dev.h>
#include <lcd.h>
diff --git a/common/lcd_console.c b/common/lcd_console.c
index d34bc2fa83..1a246c492c 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -7,7 +7,9 @@
*/
#include <common.h>
+#include <command.h>
#include <lcd.h>
+#include <log.h>
#include <serial.h>
#include <video_font.h> /* Get font data, width and height */
#if defined(CONFIG_LCD_LOGO)
@@ -219,7 +221,7 @@ void lcd_printf(const char *fmt, ...)
lcd_puts(buf);
}
-static int do_lcd_setcursor(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_lcd_setcursor(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
unsigned int col, row;
@@ -234,7 +236,7 @@ static int do_lcd_setcursor(cmd_tbl_t *cmdtp, int flag, int argc,
return 0;
}
-static int do_lcd_puts(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_lcd_puts(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
if (argc != 2)
diff --git a/common/log_syslog.c b/common/log_syslog.c
index 5e3e20e8a4..698c585fa1 100644
--- a/common/log_syslog.c
+++ b/common/log_syslog.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <log.h>
+#include <net.h>
DECLARE_GLOBAL_DATA_PTR;
diff --git a/common/main.c b/common/main.c
index 06d7ff56d6..4b3cd302c3 100644
--- a/common/main.c
+++ b/common/main.c
@@ -8,11 +8,13 @@
#include <common.h>
#include <autoboot.h>
+#include <bootstage.h>
#include <cli.h>
#include <command.h>
#include <console.h>
#include <env.h>
#include <init.h>
+#include <net.h>
#include <version.h>
static void run_preboot_environment_command(void)
diff --git a/common/malloc_simple.c b/common/malloc_simple.c
index eabbb70128..34f0b49093 100644
--- a/common/malloc_simple.c
+++ b/common/malloc_simple.c
@@ -8,6 +8,7 @@
#define LOG_CATEGORY LOGC_ALLOC
#include <common.h>
+#include <log.h>
#include <malloc.h>
#include <mapmem.h>
#include <asm/io.h>
diff --git a/common/miiphyutil.c b/common/miiphyutil.c
index 2db067876e..7d4d15ed91 100644
--- a/common/miiphyutil.c
+++ b/common/miiphyutil.c
@@ -11,8 +11,10 @@
#include <common.h>
#include <dm.h>
+#include <log.h>
#include <miiphy.h>
#include <phy.h>
+#include <linux/delay.h>
#include <asm/types.h>
#include <linux/list.h>
diff --git a/common/spl/spl.c b/common/spl/spl.c
index fc5cbbbeba..7ea0b06a80 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -9,10 +9,13 @@
#include <common.h>
#include <bloblist.h>
#include <binman_sym.h>
+#include <bootstage.h>
#include <dm.h>
#include <handoff.h>
#include <hang.h>
+#include <init.h>
#include <irq_func.h>
+#include <log.h>
#include <serial.h>
#include <spl.h>
#include <asm/u-boot.h>
@@ -423,11 +426,11 @@ static int spl_common_init(bool setup_malloc)
}
}
if (CONFIG_IS_ENABLED(DM)) {
- bootstage_start(BOOTSTATE_ID_ACCUM_DM_SPL,
+ bootstage_start(BOOTSTAGE_ID_ACCUM_DM_SPL,
spl_phase() == PHASE_TPL ? "dm tpl" : "dm_spl");
/* With CONFIG_SPL_OF_PLATDATA, bring in all devices */
ret = dm_init_and_scan(!CONFIG_IS_ENABLED(OF_PLATDATA));
- bootstage_accum(BOOTSTATE_ID_ACCUM_DM_SPL);
+ bootstage_accum(BOOTSTAGE_ID_ACCUM_DM_SPL);
if (ret) {
debug("dm_init_and_scan() returned error %d\n", ret);
return ret;
diff --git a/common/spl/spl_atf.c b/common/spl/spl_atf.c
index 702367b2a2..b54b4f0d22 100644
--- a/common/spl/spl_atf.c
+++ b/common/spl/spl_atf.c
@@ -13,7 +13,10 @@
#include <atf_common.h>
#include <cpu_func.h>
#include <errno.h>
+#include <image.h>
+#include <log.h>
#include <spl.h>
+#include <asm/cache.h>
static struct bl2_to_bl31_params_mem bl31_params_mem;
static struct bl31_params *bl2_to_bl31_params;
diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c
index 2a6252229c..3898041d10 100644
--- a/common/spl/spl_ext.c
+++ b/common/spl/spl_ext.c
@@ -2,6 +2,7 @@
#include <common.h>
#include <env.h>
+#include <part.h>
#include <spl.h>
#include <asm/u-boot.h>
#include <ext4fs.h>
@@ -15,7 +16,7 @@ int spl_load_image_ext(struct spl_image_info *spl_image,
s32 err;
struct image_header *header;
loff_t filelen, actlen;
- disk_partition_t part_info = {};
+ struct disk_partition part_info = {};
header = spl_get_load_buffer(-sizeof(*header), sizeof(*header));
@@ -69,7 +70,7 @@ int spl_load_image_ext_os(struct spl_image_info *spl_image,
{
int err;
__maybe_unused loff_t filelen, actlen;
- disk_partition_t part_info = {};
+ struct disk_partition part_info = {};
__maybe_unused char *file;
if (part_get_info(block_dev, partition, &part_info)) {
diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c
index aa371ab52c..c2eb097365 100644
--- a/common/spl/spl_fat.c
+++ b/common/spl/spl_fat.c
@@ -10,6 +10,7 @@
#include <common.h>
#include <env.h>
+#include <log.h>
#include <spl.h>
#include <asm/u-boot.h>
#include <fat.h>
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index c51e4beb1c..f581a22421 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -10,8 +10,10 @@
#include <fpga.h>
#include <gzip.h>
#include <image.h>
+#include <log.h>
#include <malloc.h>
#include <spl.h>
+#include <asm/cache.h>
#include <linux/libfdt.h>
DECLARE_GLOBAL_DATA_PTR;
diff --git a/common/spl/spl_legacy.c b/common/spl/spl_legacy.c
index 29d3ec7073..82d0326806 100644
--- a/common/spl/spl_legacy.c
+++ b/common/spl/spl_legacy.c
@@ -4,6 +4,8 @@
*/
#include <common.h>
+#include <image.h>
+#include <log.h>
#include <malloc.h>
#include <spl.h>
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index a68cdec8dc..add2785b4e 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -7,6 +7,8 @@
*/
#include <common.h>
#include <dm.h>
+#include <log.h>
+#include <part.h>
#include <spl.h>
#include <linux/compiler.h>
#include <errno.h>
@@ -168,7 +170,7 @@ static int mmc_load_image_raw_partition(struct spl_image_info *spl_image,
struct mmc *mmc, int partition,
unsigned long sector)
{
- disk_partition_t info;
+ struct disk_partition info;
int err;
#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE
diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c
index 5f8a111a2f..48c97549eb 100644
--- a/common/spl/spl_nand.c
+++ b/common/spl/spl_nand.c
@@ -5,6 +5,9 @@
*/
#include <common.h>
#include <config.h>
+#include <fdt_support.h>
+#include <image.h>
+#include <log.h>
#include <spl.h>
#include <asm/io.h>
#include <nand.h>
diff --git a/common/spl/spl_net.c b/common/spl/spl_net.c
index 30c050c0b3..e140a6306f 100644
--- a/common/spl/spl_net.c
+++ b/common/spl/spl_net.c
@@ -9,6 +9,8 @@
#include <common.h>
#include <env.h>
#include <errno.h>
+#include <image.h>
+#include <log.h>
#include <spl.h>
#include <net.h>
#include <linux/libfdt.h>
diff --git a/common/spl/spl_nor.c b/common/spl/spl_nor.c
index 3f03ffe6a3..5270401db0 100644
--- a/common/spl/spl_nor.c
+++ b/common/spl/spl_nor.c
@@ -4,6 +4,8 @@
*/
#include <common.h>
+#include <image.h>
+#include <log.h>
#include <spl.h>
static ulong spl_nor_load_read(struct spl_load_info *load, ulong sector,
diff --git a/common/spl/spl_onenand.c b/common/spl/spl_onenand.c
index ee30f328e6..93cbf47e82 100644
--- a/common/spl/spl_onenand.c
+++ b/common/spl/spl_onenand.c
@@ -9,6 +9,8 @@
*/
#include <common.h>
#include <config.h>
+#include <image.h>
+#include <log.h>
#include <spl.h>
#include <asm/io.h>
#include <onenand_uboot.h>
diff --git a/common/spl/spl_opensbi.c b/common/spl/spl_opensbi.c
index 3519c34299..e88136e6f3 100644
--- a/common/spl/spl_opensbi.c
+++ b/common/spl/spl_opensbi.c
@@ -9,9 +9,11 @@
#include <cpu_func.h>
#include <errno.h>
#include <hang.h>
+#include <image.h>
#include <spl.h>
#include <asm/smp.h>
#include <opensbi.h>
+#include <linux/libfdt.h>
DECLARE_GLOBAL_DATA_PTR;
diff --git a/common/spl/spl_ram.c b/common/spl/spl_ram.c
index 954e91a004..df1d5b43d8 100644
--- a/common/spl/spl_ram.c
+++ b/common/spl/spl_ram.c
@@ -11,6 +11,8 @@
*/
#include <common.h>
#include <binman_sym.h>
+#include <image.h>
+#include <log.h>
#include <mapmem.h>
#include <spl.h>
#include <linux/libfdt.h>
diff --git a/common/spl/spl_sdp.c b/common/spl/spl_sdp.c
index 644dfa8cc3..e7f7b68411 100644
--- a/common/spl/spl_sdp.c
+++ b/common/spl/spl_sdp.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <log.h>
#include <spl.h>
#include <usb.h>
#include <g_dnl.h>
diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c
index 288dbb5fa9..2744fb5d52 100644
--- a/common/spl/spl_spi.c
+++ b/common/spl/spl_spi.c
@@ -9,6 +9,8 @@
*/
#include <common.h>
+#include <image.h>
+#include <log.h>
#include <spi.h>
#include <spi_flash.h>
#include <errno.h>
diff --git a/common/spl/spl_ubi.c b/common/spl/spl_ubi.c
index 0cb5080882..de6a63bd2d 100644
--- a/common/spl/spl_ubi.c
+++ b/common/spl/spl_ubi.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <config.h>
+#include <image.h>
#include <nand.h>
#include <onenand_uboot.h>
#include <ubispl.h>
diff --git a/common/spl/spl_usb.c b/common/spl/spl_usb.c
index e29d579b0d..08837b38fc 100644
--- a/common/spl/spl_usb.c
+++ b/common/spl/spl_usb.c
@@ -9,6 +9,7 @@
*/
#include <common.h>
+#include <log.h>
#include <spl.h>
#include <asm/u-boot.h>
#include <errno.h>
diff --git a/common/spl/spl_xip.c b/common/spl/spl_xip.c
index 1af4da8725..8ce0a09ef3 100644
--- a/common/spl/spl_xip.c
+++ b/common/spl/spl_xip.c
@@ -5,6 +5,8 @@
*/
#include <common.h>
+#include <image.h>
+#include <log.h>
#include <spl.h>
static int spl_xip(struct spl_image_info *spl_image,
diff --git a/common/spl/spl_ymodem.c b/common/spl/spl_ymodem.c
index 8500ee8ba5..284512478f 100644
--- a/common/spl/spl_ymodem.c
+++ b/common/spl/spl_ymodem.c
@@ -10,6 +10,8 @@
*/
#include <common.h>
#include <gzip.h>
+#include <image.h>
+#include <log.h>
#include <spl.h>
#include <xyzModem.h>
#include <asm/u-boot.h>
diff --git a/common/splash_source.c b/common/splash_source.c
index 2ff15208a7..f51ca5ddf3 100644
--- a/common/splash_source.c
+++ b/common/splash_source.c
@@ -13,6 +13,7 @@
#include <fs.h>
#include <fdt_support.h>
#include <image.h>
+#include <log.h>
#include <nand.h>
#include <sata.h>
#include <spi.h>
diff --git a/common/stdio.c b/common/stdio.c
index 54ecc9b53d..2119204b98 100644
--- a/common/stdio.c
+++ b/common/stdio.c
@@ -12,6 +12,7 @@
#include <common.h>
#include <dm.h>
#include <errno.h>
+#include <log.h>
#include <stdarg.h>
#include <malloc.h>
#include <stdio_dev.h>
diff --git a/common/usb.c b/common/usb.c
index 686f09a77d..aad13fd9c5 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -28,6 +28,7 @@
#include <common.h>
#include <command.h>
#include <dm.h>
+#include <log.h>
#include <malloc.h>
#include <memalign.h>
#include <asm/processor.h>
@@ -37,6 +38,7 @@
#include <asm/unaligned.h>
#include <errno.h>
#include <usb.h>
+#include <linux/delay.h>
#define USB_BUFSIZ 512
diff --git a/common/usb_hub.c b/common/usb_hub.c
index c642b683e7..e578f0be28 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -26,11 +26,13 @@
#include <dm.h>
#include <env.h>
#include <errno.h>
+#include <log.h>
#include <malloc.h>
#include <memalign.h>
#include <asm/processor.h>
#include <asm/unaligned.h>
#include <linux/ctype.h>
+#include <linux/delay.h>
#include <linux/list.h>
#include <asm/byteorder.h>
#ifdef CONFIG_SANDBOX
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index a6221ef716..b316807844 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -11,6 +11,7 @@
#include <dm.h>
#include <env.h>
#include <errno.h>
+#include <log.h>
#include <malloc.h>
#include <memalign.h>
#include <stdio_dev.h>
diff --git a/common/usb_storage.c b/common/usb_storage.c
index b291ac55d1..ff25441995 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -33,15 +33,19 @@
#include <common.h>
+#include <blk.h>
#include <command.h>
#include <dm.h>
#include <errno.h>
+#include <log.h>
#include <mapmem.h>
#include <memalign.h>
#include <asm/byteorder.h>
+#include <asm/cache.h>
#include <asm/processor.h>
#include <dm/device-internal.h>
#include <dm/lists.h>
+#include <linux/delay.h>
#include <part.h>
#include <usb.h>