summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2025-05-29 08:29:24 -0600
committerTom Rini <trini@konsulko.com>2025-05-29 08:29:24 -0600
commite50dbb3a0a31e6c41a752605e136c09df98d8800 (patch)
tree12701d8efa45cfa3eb803f8ba7bf53d531f0a0ae
parent23be77e18d19ddb9c2ecdf71638bacfbc369fd13 (diff)
parent1e50f7457fcaaba2caf642132cf4f00f1eba29a9 (diff)
Merge patch series "Start removing <env.h> from headers when not required"
Tom Rini <trini@konsulko.com> says: Given Simon's series at [1] I started looking in to what brings in <env.h> when not strictly required and in turn has some unintended implicit includes. This series takes care of the places where, commonly, <linux/string.h> or <env.h> itself were required along with a few other less common cases. This sets aside for the moment what to do about net-common.h and env_get_ip() as I'm not entirely sure what's best there. [1]: https://patchwork.ozlabs.org/project/uboot/list/?series=454939&state=* Link: https://lore.kernel.org/r/20250514225002.15361-1-trini@konsulko.com
-rw-r--r--arch/arm/cpu/armv8/fsl-layerscape/fdt.c1
-rw-r--r--arch/arm/mach-apple/board.c1
-rw-r--r--arch/arm/mach-imx/mx5/clock.c1
-rw-r--r--arch/arm/mach-k3/r5/common.c1
-rw-r--r--arch/arm/mach-keystone/cmd_clock.c1
-rw-r--r--arch/arm/mach-socfpga/board.c1
-rw-r--r--arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c1
-rw-r--r--arch/arm/mach-tegra/tegra124/bct.c1
-rw-r--r--arch/arm/mach-tegra/tegra20/bct.c1
-rw-r--r--arch/arm/mach-tegra/tegra30/bct.c1
-rw-r--r--arch/arm/mach-uniphier/dram/cmd_ddrmphy.c1
-rw-r--r--arch/arm/mach-uniphier/dram/cmd_ddrphy.c1
-rw-r--r--board/freescale/common/qixis.c1
-rw-r--r--board/freescale/ls1043ardb/cpld.c1
-rw-r--r--board/freescale/ls1046ardb/cpld.c1
-rw-r--r--board/freescale/p2041rdb/cpld.c1
-rw-r--r--board/freescale/t102xrdb/cpld.c1
-rw-r--r--board/freescale/t104xrdb/cpld.c1
-rw-r--r--board/freescale/t208xrdb/cpld.c1
-rw-r--r--board/freescale/t4rdb/cpld.c1
-rw-r--r--board/liebherr/mccmon6/spl.c1
-rw-r--r--board/siemens/common/board_am335x.c1
-rw-r--r--board/socionext/developerbox/fwu_plat.c1
-rw-r--r--board/toradex/apalis_imx6/do_fuse.c1
-rw-r--r--board/toradex/colibri_imx6/do_fuse.c1
-rw-r--r--boot/bootmeth_android.c1
-rw-r--r--boot/image-pre-load.c1
-rw-r--r--cmd/2048.c1
-rw-r--r--cmd/abootimg.c1
-rw-r--r--cmd/adc.c1
-rw-r--r--cmd/armflash.c2
-rw-r--r--cmd/bcb.c1
-rw-r--r--cmd/blkmap.c1
-rw-r--r--cmd/bootflow.c1
-rw-r--r--cmd/booti.c1
-rw-r--r--cmd/bootmeth.c1
-rw-r--r--cmd/bootstage.c1
-rw-r--r--cmd/broadcom/nitro_image_load.c1
-rw-r--r--cmd/cache.c1
-rw-r--r--cmd/diag.c1
-rw-r--r--cmd/dm.c1
-rw-r--r--cmd/echo.c1
-rw-r--r--cmd/extension_board.c1
-rw-r--r--cmd/flash.c1
-rw-r--r--cmd/fuse.c1
-rw-r--r--cmd/hash.c1
-rw-r--r--cmd/irq.c1
-rw-r--r--cmd/legacy_led.c1
-rw-r--r--cmd/mbr.c1
-rw-r--r--cmd/mem.c2
-rw-r--r--cmd/mmc.c1
-rw-r--r--cmd/mp.c1
-rw-r--r--cmd/optee.c1
-rw-r--r--cmd/sandbox/exception.c1
-rw-r--r--cmd/seama.c1
-rw-r--r--cmd/sha1sum.c1
-rw-r--r--cmd/sleep.c1
-rw-r--r--cmd/smccc.c1
-rw-r--r--cmd/spawn.c1
-rw-r--r--cmd/stackprot_test.c1
-rw-r--r--cmd/strings.c1
-rw-r--r--cmd/test.c1
-rw-r--r--cmd/timer.c1
-rw-r--r--cmd/ufs.c1
-rw-r--r--cmd/upl.c1
-rw-r--r--cmd/x86/mtrr.c1
-rw-r--r--cmd/x86/zboot.c1
-rw-r--r--common/usb.c1
-rw-r--r--drivers/gpio/pca953x.c1
-rw-r--r--drivers/power/axp221.c1
-rw-r--r--drivers/tpm/sandbox_common.c1
-rw-r--r--drivers/video/nexell_display.c1
-rw-r--r--include/command.h1
-rw-r--r--lib/efi_loader/efi_firmware.c1
-rw-r--r--test/boot/bootdev.c1
-rw-r--r--test/boot/bootflow.c1
-rw-r--r--test/boot/bootm.c1
-rw-r--r--test/boot/bootmeth.c1
-rw-r--r--test/boot/measurement.c1
-rw-r--r--test/boot/upl.c1
-rw-r--r--test/cmd/fdt.c1
-rw-r--r--test/cmd/hash.c1
-rw-r--r--test/cmd/mem_copy.c1
-rw-r--r--test/cmd/mem_search.c1
-rw-r--r--test/cmd/setexpr.c1
-rw-r--r--test/common/test_autoboot.c1
-rw-r--r--test/dm/blkmap.c1
-rw-r--r--test/dm/button.c1
-rw-r--r--test/dm/fastboot.c1
-rw-r--r--test/dm/part.c1
-rw-r--r--test/env/fdt.c1
-rw-r--r--test/hush/dollar.c1
-rw-r--r--test/hush/if.c1
-rw-r--r--test/hush/loop.c1
94 files changed, 95 insertions, 1 deletions
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
index ca6be3626fb..e8d2339f1a3 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
@@ -7,6 +7,7 @@
#include <config.h>
#include <clock_legacy.h>
#include <efi_loader.h>
+#include <env.h>
#include <log.h>
#include <asm/cache.h>
#include <linux/libfdt.h>
diff --git a/arch/arm/mach-apple/board.c b/arch/arm/mach-apple/board.c
index 2644a04a622..2604c5a710e 100644
--- a/arch/arm/mach-apple/board.c
+++ b/arch/arm/mach-apple/board.c
@@ -6,6 +6,7 @@
#include <dm.h>
#include <dm/uclass-internal.h>
#include <efi_loader.h>
+#include <env.h>
#include <lmb.h>
#include <asm/armv8/mmu.h>
diff --git a/arch/arm/mach-imx/mx5/clock.c b/arch/arm/mach-imx/mx5/clock.c
index 41116e2c6a2..9901f8a7b56 100644
--- a/arch/arm/mach-imx/mx5/clock.c
+++ b/arch/arm/mach-imx/mx5/clock.c
@@ -10,6 +10,7 @@
#include <log.h>
#include <asm/io.h>
#include <linux/errno.h>
+#include <linux/string.h>
#include <asm/arch/imx-regs.h>
#include <asm/arch/crm_regs.h>
#include <asm/arch/clock.h>
diff --git a/arch/arm/mach-k3/r5/common.c b/arch/arm/mach-k3/r5/common.c
index 0b6604039f3..fa146549f13 100644
--- a/arch/arm/mach-k3/r5/common.c
+++ b/arch/arm/mach-k3/r5/common.c
@@ -5,6 +5,7 @@
* Copyright (C) 2023 Texas Instruments Incorporated - https://www.ti.com/
*/
+#include <env.h>
#include <linux/printk.h>
#include <linux/types.h>
#include <asm/hardware.h>
diff --git a/arch/arm/mach-keystone/cmd_clock.c b/arch/arm/mach-keystone/cmd_clock.c
index e9ecc05953a..7b94a80b725 100644
--- a/arch/arm/mach-keystone/cmd_clock.c
+++ b/arch/arm/mach-keystone/cmd_clock.c
@@ -8,6 +8,7 @@
#include <vsprintf.h>
#include <command.h>
+#include <linux/string.h>
#include <asm/arch/hardware.h>
#include <asm/arch/clock.h>
#include <asm/arch/psc_defs.h>
diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach-socfpga/board.c
index 8506d510413..bda12324803 100644
--- a/arch/arm/mach-socfpga/board.c
+++ b/arch/arm/mach-socfpga/board.c
@@ -7,6 +7,7 @@
#include <config.h>
#include <errno.h>
+#include <env.h>
#include <fdtdec.h>
#include <log.h>
#include <init.h>
diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
index 04640e476e6..506ecac2ef0 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
+++ b/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
@@ -6,6 +6,7 @@
#include <bootm.h>
#include <command.h>
#include <dfu.h>
+#include <env.h>
#include <image.h>
#include <asm/arch/stm32prog.h>
#include <linux/printk.h>
diff --git a/arch/arm/mach-tegra/tegra124/bct.c b/arch/arm/mach-tegra/tegra124/bct.c
index a71aa87fce1..4dc4b7138ab 100644
--- a/arch/arm/mach-tegra/tegra124/bct.c
+++ b/arch/arm/mach-tegra/tegra124/bct.c
@@ -7,6 +7,7 @@
#include <command.h>
#include <log.h>
#include <vsprintf.h>
+#include <linux/string.h>
#include <asm/arch-tegra/crypto.h>
#include "bct.h"
#include "uboot_aes.h"
diff --git a/arch/arm/mach-tegra/tegra20/bct.c b/arch/arm/mach-tegra/tegra20/bct.c
index b647b6b26d2..253cb243676 100644
--- a/arch/arm/mach-tegra/tegra20/bct.c
+++ b/arch/arm/mach-tegra/tegra20/bct.c
@@ -7,6 +7,7 @@
#include <command.h>
#include <log.h>
#include <vsprintf.h>
+#include <linux/string.h>
#include <asm/arch-tegra/crypto.h>
#include "bct.h"
#include "uboot_aes.h"
diff --git a/arch/arm/mach-tegra/tegra30/bct.c b/arch/arm/mach-tegra/tegra30/bct.c
index 250009ea8d8..398ba1de386 100644
--- a/arch/arm/mach-tegra/tegra30/bct.c
+++ b/arch/arm/mach-tegra/tegra30/bct.c
@@ -7,6 +7,7 @@
#include <command.h>
#include <log.h>
#include <vsprintf.h>
+#include <linux/string.h>
#include <asm/arch-tegra/crypto.h>
#include "bct.h"
#include "uboot_aes.h"
diff --git a/arch/arm/mach-uniphier/dram/cmd_ddrmphy.c b/arch/arm/mach-uniphier/dram/cmd_ddrmphy.c
index 629f8b90c9d..be4ce3265bb 100644
--- a/arch/arm/mach-uniphier/dram/cmd_ddrmphy.c
+++ b/arch/arm/mach-uniphier/dram/cmd_ddrmphy.c
@@ -9,6 +9,7 @@
#include <linux/io.h>
#include <linux/printk.h>
#include <linux/sizes.h>
+#include <linux/string.h>
#include "../soc-info.h"
#include "ddrmphy-regs.h"
diff --git a/arch/arm/mach-uniphier/dram/cmd_ddrphy.c b/arch/arm/mach-uniphier/dram/cmd_ddrphy.c
index ca519d1c7e0..3ccafe20638 100644
--- a/arch/arm/mach-uniphier/dram/cmd_ddrphy.c
+++ b/arch/arm/mach-uniphier/dram/cmd_ddrphy.c
@@ -10,6 +10,7 @@
#include <linux/io.h>
#include <linux/printk.h>
#include <linux/sizes.h>
+#include <linux/string.h>
#include "../soc-info.h"
#include "ddrphy-regs.h"
diff --git a/board/freescale/common/qixis.c b/board/freescale/common/qixis.c
index 7815ba2dbce..04cad48f033 100644
--- a/board/freescale/common/qixis.c
+++ b/board/freescale/common/qixis.c
@@ -12,6 +12,7 @@
#include <asm/io.h>
#include <linux/compiler.h>
#include <linux/time.h>
+#include <linux/string.h>
#include <i2c.h>
#include "qixis.h"
diff --git a/board/freescale/ls1043ardb/cpld.c b/board/freescale/ls1043ardb/cpld.c
index bda2f3ac3a6..39b6c6449cf 100644
--- a/board/freescale/ls1043ardb/cpld.c
+++ b/board/freescale/ls1043ardb/cpld.c
@@ -7,6 +7,7 @@
#include <config.h>
#include <command.h>
+#include <linux/string.h>
#include <asm/io.h>
#include "cpld.h"
diff --git a/board/freescale/ls1046ardb/cpld.c b/board/freescale/ls1046ardb/cpld.c
index 7f8ca2e857f..26a5962bd6e 100644
--- a/board/freescale/ls1046ardb/cpld.c
+++ b/board/freescale/ls1046ardb/cpld.c
@@ -7,6 +7,7 @@
#include <config.h>
#include <command.h>
+#include <linux/string.h>
#include <asm/io.h>
#include "cpld.h"
diff --git a/board/freescale/p2041rdb/cpld.c b/board/freescale/p2041rdb/cpld.c
index 915a8b994d5..2bba377d4d4 100644
--- a/board/freescale/p2041rdb/cpld.c
+++ b/board/freescale/p2041rdb/cpld.c
@@ -12,6 +12,7 @@
*/
#include <command.h>
+#include <linux/string.h>
#include <asm/io.h>
#include "cpld.h"
diff --git a/board/freescale/t102xrdb/cpld.c b/board/freescale/t102xrdb/cpld.c
index cc933ccd544..00ea9d8f503 100644
--- a/board/freescale/t102xrdb/cpld.c
+++ b/board/freescale/t102xrdb/cpld.c
@@ -9,6 +9,7 @@
#include <config.h>
#include <command.h>
+#include <linux/string.h>
#include <asm/io.h>
#include "cpld.h"
diff --git a/board/freescale/t104xrdb/cpld.c b/board/freescale/t104xrdb/cpld.c
index c2d526ae15a..038e40e2fae 100644
--- a/board/freescale/t104xrdb/cpld.c
+++ b/board/freescale/t104xrdb/cpld.c
@@ -12,6 +12,7 @@
#include <config.h>
#include <command.h>
+#include <linux/string.h>
#include <asm/io.h>
#include "cpld.h"
diff --git a/board/freescale/t208xrdb/cpld.c b/board/freescale/t208xrdb/cpld.c
index d2226af6278..838d88d977e 100644
--- a/board/freescale/t208xrdb/cpld.c
+++ b/board/freescale/t208xrdb/cpld.c
@@ -7,6 +7,7 @@
#include <config.h>
#include <command.h>
+#include <linux/string.h>
#include <asm/io.h>
#include "cpld.h"
diff --git a/board/freescale/t4rdb/cpld.c b/board/freescale/t4rdb/cpld.c
index f076350c1c5..258581eee96 100644
--- a/board/freescale/t4rdb/cpld.c
+++ b/board/freescale/t4rdb/cpld.c
@@ -16,6 +16,7 @@
#include <config.h>
#include <command.h>
+#include <linux/string.h>
#include <asm/io.h>
#include "cpld.h"
diff --git a/board/liebherr/mccmon6/spl.c b/board/liebherr/mccmon6/spl.c
index b1f6881275d..e612d9e9ce0 100644
--- a/board/liebherr/mccmon6/spl.c
+++ b/board/liebherr/mccmon6/spl.c
@@ -5,6 +5,7 @@
* Richard Hu <hakahu@gmail.com>
*/
+#include <env.h>
#include <image.h>
#include <init.h>
#include <asm/arch/clock.h>
diff --git a/board/siemens/common/board_am335x.c b/board/siemens/common/board_am335x.c
index daf0bb930ec..939ff81797d 100644
--- a/board/siemens/common/board_am335x.c
+++ b/board/siemens/common/board_am335x.c
@@ -10,6 +10,7 @@
*/
#include <command.h>
+#include <env.h>
#include <serial.h>
#include <watchdog.h>
#include <asm/arch/clock.h>
diff --git a/board/socionext/developerbox/fwu_plat.c b/board/socionext/developerbox/fwu_plat.c
index a8b111477ef..5d2f40f241c 100644
--- a/board/socionext/developerbox/fwu_plat.c
+++ b/board/socionext/developerbox/fwu_plat.c
@@ -4,6 +4,7 @@
*/
#include <efi_loader.h>
+#include <env.h>
#include <fwu.h>
#include <fwu_mdata.h>
#include <memalign.h>
diff --git a/board/toradex/apalis_imx6/do_fuse.c b/board/toradex/apalis_imx6/do_fuse.c
index 698b05bc5ad..8721276bed8 100644
--- a/board/toradex/apalis_imx6/do_fuse.c
+++ b/board/toradex/apalis_imx6/do_fuse.c
@@ -11,6 +11,7 @@
#include <command.h>
#include <console.h>
#include <fuse.h>
+#include <linux/string.h>
static int mfgr_fuse(void)
{
diff --git a/board/toradex/colibri_imx6/do_fuse.c b/board/toradex/colibri_imx6/do_fuse.c
index 698b05bc5ad..8721276bed8 100644
--- a/board/toradex/colibri_imx6/do_fuse.c
+++ b/board/toradex/colibri_imx6/do_fuse.c
@@ -11,6 +11,7 @@
#include <command.h>
#include <console.h>
#include <fuse.h>
+#include <linux/string.h>
static int mfgr_fuse(void)
{
diff --git a/boot/bootmeth_android.c b/boot/bootmeth_android.c
index 654ebfdf1fc..8c2bde10e17 100644
--- a/boot/bootmeth_android.c
+++ b/boot/bootmeth_android.c
@@ -18,6 +18,7 @@
#include <bootm.h>
#include <bootmeth.h>
#include <dm.h>
+#include <env.h>
#include <image.h>
#include <malloc.h>
#include <mapmem.h>
diff --git a/boot/image-pre-load.c b/boot/image-pre-load.c
index adf3b341a20..2f851ebb28c 100644
--- a/boot/image-pre-load.c
+++ b/boot/image-pre-load.c
@@ -7,6 +7,7 @@
#include "mkimage.h"
#else
#include <asm/global_data.h>
+#include <env.h>
#include <mapmem.h>
DECLARE_GLOBAL_DATA_PTR;
#endif /* !USE_HOSTCC*/
diff --git a/cmd/2048.c b/cmd/2048.c
index 42cd171b0e4..aa0f82721dc 100644
--- a/cmd/2048.c
+++ b/cmd/2048.c
@@ -8,6 +8,7 @@
#include <rand.h>
#include <vsprintf.h>
#include <linux/delay.h>
+#include <linux/string.h>
#define SIZE 4
static uint score;
diff --git a/cmd/abootimg.c b/cmd/abootimg.c
index ae7a1a7c83b..44de00fb9c9 100644
--- a/cmd/abootimg.c
+++ b/cmd/abootimg.c
@@ -6,6 +6,7 @@
#include <android_image.h>
#include <command.h>
+#include <env.h>
#include <image.h>
#include <mapmem.h>
diff --git a/cmd/adc.c b/cmd/adc.c
index 4d3b5b61f6f..334ba7fdeca 100644
--- a/cmd/adc.c
+++ b/cmd/adc.c
@@ -5,6 +5,7 @@
*/
#include <command.h>
#include <dm.h>
+#include <env.h>
#include <adc.h>
#include <linux/printk.h>
diff --git a/cmd/armflash.c b/cmd/armflash.c
index e292cf85c45..cde275c881b 100644
--- a/cmd/armflash.c
+++ b/cmd/armflash.c
@@ -7,8 +7,10 @@
*/
#include <command.h>
#include <console.h>
+#include <env.h>
#include <flash.h>
#include <vsprintf.h>
+#include <linux/string.h>
#include <asm/io.h>
#define MAX_REGIONS 4
diff --git a/cmd/bcb.c b/cmd/bcb.c
index 16eabfe00f5..d6d944bd6b3 100644
--- a/cmd/bcb.c
+++ b/cmd/bcb.c
@@ -8,6 +8,7 @@
#include <android_bootloader_message.h>
#include <bcb.h>
#include <command.h>
+#include <env.h>
#include <android_ab.h>
#include <display_options.h>
#include <log.h>
diff --git a/cmd/blkmap.c b/cmd/blkmap.c
index 86a123b1cd3..65edec899e2 100644
--- a/cmd/blkmap.c
+++ b/cmd/blkmap.c
@@ -7,6 +7,7 @@
#include <blk.h>
#include <blkmap.h>
#include <command.h>
+#include <env.h>
#include <malloc.h>
#include <dm/device.h>
diff --git a/cmd/bootflow.c b/cmd/bootflow.c
index a1fd59a69f4..d4f7d336150 100644
--- a/cmd/bootflow.c
+++ b/cmd/bootflow.c
@@ -13,6 +13,7 @@
#include <command.h>
#include <console.h>
#include <dm.h>
+#include <env.h>
#include <mapmem.h>
/**
diff --git a/cmd/booti.c b/cmd/booti.c
index ced2c1047ab..f5ae58139da 100644
--- a/cmd/booti.c
+++ b/cmd/booti.c
@@ -6,6 +6,7 @@
#include <bootm.h>
#include <command.h>
+#include <env.h>
#include <image.h>
#include <irq_func.h>
#include <lmb.h>
diff --git a/cmd/bootmeth.c b/cmd/bootmeth.c
index 2f41fa1bec6..ea4b3f47db8 100644
--- a/cmd/bootmeth.c
+++ b/cmd/bootmeth.c
@@ -11,6 +11,7 @@
#include <bootstd.h>
#include <command.h>
#include <dm.h>
+#include <env.h>
#include <malloc.h>
#include <dm/uclass-internal.h>
diff --git a/cmd/bootstage.c b/cmd/bootstage.c
index 8248c41ca82..5c6d5a3ab45 100644
--- a/cmd/bootstage.c
+++ b/cmd/bootstage.c
@@ -6,6 +6,7 @@
#include <bootstage.h>
#include <command.h>
#include <vsprintf.h>
+#include <linux/string.h>
static int do_bootstage_report(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
diff --git a/cmd/broadcom/nitro_image_load.c b/cmd/broadcom/nitro_image_load.c
index 289b184e9af..fe08679840e 100644
--- a/cmd/broadcom/nitro_image_load.c
+++ b/cmd/broadcom/nitro_image_load.c
@@ -4,6 +4,7 @@
*/
#include <command.h>
+#include <env.h>
#include <vsprintf.h>
#define FW_IMAGE_SIG 0xff123456
diff --git a/cmd/cache.c b/cmd/cache.c
index 3049f5c305f..b7007877ab0 100644
--- a/cmd/cache.c
+++ b/cmd/cache.c
@@ -10,6 +10,7 @@
#include <command.h>
#include <cpu_func.h>
#include <linux/compiler.h>
+#include <linux/string.h>
static int parse_argv(const char *);
diff --git a/cmd/diag.c b/cmd/diag.c
index c6da5aae3fc..4a88ab00a07 100644
--- a/cmd/diag.c
+++ b/cmd/diag.c
@@ -9,6 +9,7 @@
*/
#include <command.h>
#include <post.h>
+#include <linux/string.h>
int do_diag(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
diff --git a/cmd/dm.c b/cmd/dm.c
index ec9cfd85376..1f212c0f030 100644
--- a/cmd/dm.c
+++ b/cmd/dm.c
@@ -9,6 +9,7 @@
#include <command.h>
#include <dm/root.h>
#include <dm/util.h>
+#include <linux/string.h>
static int do_dm_dump_driver_compat(struct cmd_tbl *cmdtp, int flag, int argc,
char * const argv[])
diff --git a/cmd/echo.c b/cmd/echo.c
index 973213a03a6..d1346504cfb 100644
--- a/cmd/echo.c
+++ b/cmd/echo.c
@@ -5,6 +5,7 @@
*/
#include <command.h>
+#include <linux/string.h>
static int do_echo(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
diff --git a/cmd/extension_board.c b/cmd/extension_board.c
index 6c14d0ddebd..317b260bf36 100644
--- a/cmd/extension_board.c
+++ b/cmd/extension_board.c
@@ -7,6 +7,7 @@
#include <bootdev.h>
#include <command.h>
#include <dm.h>
+#include <env.h>
#include <malloc.h>
#include <extension_board.h>
#include <mapmem.h>
diff --git a/cmd/flash.c b/cmd/flash.c
index fd660ec477c..76aa387ba59 100644
--- a/cmd/flash.c
+++ b/cmd/flash.c
@@ -10,6 +10,7 @@
#include <command.h>
#include <log.h>
#include <vsprintf.h>
+#include <linux/string.h>
#include <u-boot/uuid.h>
#if defined(CONFIG_CMD_MTDPARTS)
diff --git a/cmd/fuse.c b/cmd/fuse.c
index 6c42c096809..e2206cdf0d5 100644
--- a/cmd/fuse.c
+++ b/cmd/fuse.c
@@ -14,6 +14,7 @@
#include <mapmem.h>
#include <vsprintf.h>
#include <linux/errno.h>
+#include <linux/string.h>
static int confirm_prog(void)
{
diff --git a/cmd/hash.c b/cmd/hash.c
index 5b40982b098..96d0e443a5b 100644
--- a/cmd/hash.c
+++ b/cmd/hash.c
@@ -10,6 +10,7 @@
*/
#include <command.h>
+#include <env.h>
#include <hash.h>
#include <linux/ctype.h>
diff --git a/cmd/irq.c b/cmd/irq.c
index da223b4b2cc..58483d04de8 100644
--- a/cmd/irq.c
+++ b/cmd/irq.c
@@ -6,6 +6,7 @@
#include <config.h>
#include <command.h>
#include <irq_func.h>
+#include <linux/string.h>
static int do_interrupts(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
diff --git a/cmd/legacy_led.c b/cmd/legacy_led.c
index 50de7e89d8f..db312ae6e2d 100644
--- a/cmd/legacy_led.c
+++ b/cmd/legacy_led.c
@@ -12,6 +12,7 @@
#include <command.h>
#include <status_led.h>
#include <vsprintf.h>
+#include <linux/string.h>
struct led_tbl_s {
char *string; /* String for use in the command */
diff --git a/cmd/mbr.c b/cmd/mbr.c
index 7e1f92a13bb..7fe6c9e103a 100644
--- a/cmd/mbr.c
+++ b/cmd/mbr.c
@@ -10,6 +10,7 @@
#include <blk.h>
#include <command.h>
+#include <env.h>
#include <malloc.h>
#include <part.h>
#include <vsprintf.h>
diff --git a/cmd/mem.c b/cmd/mem.c
index 9e716776393..b8afe62e474 100644
--- a/cmd/mem.c
+++ b/cmd/mem.c
@@ -14,8 +14,10 @@
#include <bootretry.h>
#include <cli.h>
#include <command.h>
+#include <compiler.h>
#include <console.h>
#include <display_options.h>
+#include <env.h>
#ifdef CONFIG_MTD_NOR_FLASH
#include <flash.h>
#endif
diff --git a/cmd/mmc.c b/cmd/mmc.c
index fe7899ec793..5340a58be8e 100644
--- a/cmd/mmc.c
+++ b/cmd/mmc.c
@@ -8,6 +8,7 @@
#include <command.h>
#include <console.h>
#include <display_options.h>
+#include <env.h>
#include <mapmem.h>
#include <memalign.h>
#include <mmc.h>
diff --git a/cmd/mp.c b/cmd/mp.c
index 261bb8a07d4..686e1f8a82f 100644
--- a/cmd/mp.c
+++ b/cmd/mp.c
@@ -6,6 +6,7 @@
#include <command.h>
#include <cpu_func.h>
#include <vsprintf.h>
+#include <linux/string.h>
static int cpu_status_all(void)
{
diff --git a/cmd/optee.c b/cmd/optee.c
index e3aae5e9f9b..155c9f1bb73 100644
--- a/cmd/optee.c
+++ b/cmd/optee.c
@@ -6,6 +6,7 @@
#include <errno.h>
#include <tee.h>
#include <vsprintf.h>
+#include <linux/string.h>
#define TA_HELLO_WORLD_CMD_INC_VALUE 0
/* This needs to match the UUID of the Hello World TA. */
diff --git a/cmd/sandbox/exception.c b/cmd/sandbox/exception.c
index f9c847d8ff2..e015acf60e2 100644
--- a/cmd/sandbox/exception.c
+++ b/cmd/sandbox/exception.c
@@ -6,6 +6,7 @@
*/
#include <command.h>
+#include <env.h>
static int do_sigsegv(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
diff --git a/cmd/seama.c b/cmd/seama.c
index 3c8e8199234..d6287978090 100644
--- a/cmd/seama.c
+++ b/cmd/seama.c
@@ -5,6 +5,7 @@
*/
#include <command.h>
+#include <env.h>
#include <nand.h>
/*
diff --git a/cmd/sha1sum.c b/cmd/sha1sum.c
index 52aa26c78d2..f2757146bba 100644
--- a/cmd/sha1sum.c
+++ b/cmd/sha1sum.c
@@ -9,6 +9,7 @@
#include <command.h>
#include <hash.h>
+#include <linux/string.h>
#include <u-boot/sha1.h>
int do_sha1sum(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
diff --git a/cmd/sleep.c b/cmd/sleep.c
index 7616fed7556..a8c896e0c5e 100644
--- a/cmd/sleep.c
+++ b/cmd/sleep.c
@@ -9,6 +9,7 @@
#include <time.h>
#include <vsprintf.h>
#include <linux/delay.h>
+#include <linux/string.h>
static int do_sleep(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
diff --git a/cmd/smccc.c b/cmd/smccc.c
index 3a4d885e37e..fa04bb05ca4 100644
--- a/cmd/smccc.c
+++ b/cmd/smccc.c
@@ -9,6 +9,7 @@
#include <linux/arm-smccc.h>
#include <linux/compiler.h>
#include <linux/psci.h>
+#include <linux/string.h>
static int do_call(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
diff --git a/cmd/spawn.c b/cmd/spawn.c
index 37737b8627c..8829aa9728d 100644
--- a/cmd/spawn.c
+++ b/cmd/spawn.c
@@ -5,6 +5,7 @@
#include <command.h>
#include <console.h>
+#include <env.h>
#include <malloc.h>
#include <vsprintf.h>
#include <uthread.h>
diff --git a/cmd/stackprot_test.c b/cmd/stackprot_test.c
index e7ff4a06158..78e9beba5bf 100644
--- a/cmd/stackprot_test.c
+++ b/cmd/stackprot_test.c
@@ -4,6 +4,7 @@
*/
#include <command.h>
+#include <linux/string.h>
static int do_test_stackprot_fail(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
diff --git a/cmd/strings.c b/cmd/strings.c
index 5bcb0f2b567..beac2a6e6b3 100644
--- a/cmd/strings.c
+++ b/cmd/strings.c
@@ -9,6 +9,7 @@
#include <config.h>
#include <command.h>
#include <vsprintf.h>
+#include <linux/string.h>
static char *start_addr, *last_addr;
diff --git a/cmd/test.c b/cmd/test.c
index a42a523d33d..a9ac07e6143 100644
--- a/cmd/test.c
+++ b/cmd/test.c
@@ -9,6 +9,7 @@
#include <log.h>
#include <slre.h>
#include <vsprintf.h>
+#include <linux/string.h>
#define OP_INVALID 0
#define OP_NOT 1
diff --git a/cmd/timer.c b/cmd/timer.c
index 04fcd84ac6a..427309e108d 100644
--- a/cmd/timer.c
+++ b/cmd/timer.c
@@ -6,6 +6,7 @@
#include <command.h>
#include <time.h>
+#include <linux/string.h>
static int do_timer(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
diff --git a/cmd/ufs.c b/cmd/ufs.c
index 6e21fbb1685..790dab50f18 100644
--- a/cmd/ufs.c
+++ b/cmd/ufs.c
@@ -8,6 +8,7 @@
#include <command.h>
#include <ufs.h>
#include <vsprintf.h>
+#include <linux/string.h>
static int do_ufs(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
diff --git a/cmd/upl.c b/cmd/upl.c
index c9a823bbc06..ef2183d8528 100644
--- a/cmd/upl.c
+++ b/cmd/upl.c
@@ -12,6 +12,7 @@
#include <alist.h>
#include <command.h>
#include <display_options.h>
+#include <env.h>
#include <mapmem.h>
#include <string.h>
#include <upl.h>
diff --git a/cmd/x86/mtrr.c b/cmd/x86/mtrr.c
index 289865515ef..91130453039 100644
--- a/cmd/x86/mtrr.c
+++ b/cmd/x86/mtrr.c
@@ -6,6 +6,7 @@
#include <command.h>
#include <log.h>
#include <vsprintf.h>
+#include <linux/string.h>
#include <asm/msr.h>
#include <asm/mp.h>
#include <asm/mtrr.h>
diff --git a/cmd/x86/zboot.c b/cmd/x86/zboot.c
index 94e602b8a5b..3876d163236 100644
--- a/cmd/x86/zboot.c
+++ b/cmd/x86/zboot.c
@@ -8,6 +8,7 @@
#define LOG_CATEGORY LOGC_BOOT
#include <command.h>
+#include <env.h>
#include <mapmem.h>
#include <vsprintf.h>
#include <asm/zimage.h>
diff --git a/common/usb.c b/common/usb.c
index 7a8435296c6..6a4ad346f4b 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -28,6 +28,7 @@
#include <command.h>
#include <dm.h>
#include <dm/device_compat.h>
+#include <env.h>
#include <log.h>
#include <malloc.h>
#include <memalign.h>
diff --git a/drivers/gpio/pca953x.c b/drivers/gpio/pca953x.c
index 2fb14590c0f..f0a79b92b02 100644
--- a/drivers/gpio/pca953x.c
+++ b/drivers/gpio/pca953x.c
@@ -13,6 +13,7 @@
#include <i2c.h>
#include <pca953x.h>
#include <vsprintf.h>
+#include <asm/byteorder.h>
/* Default to an address that hopefully won't corrupt other i2c devices */
#ifndef CFG_SYS_I2C_PCA953X_ADDR
diff --git a/drivers/power/axp221.c b/drivers/power/axp221.c
index c22ca03f469..f5daa243082 100644
--- a/drivers/power/axp221.c
+++ b/drivers/power/axp221.c
@@ -10,6 +10,7 @@
*/
#include <command.h>
+#include <env.h>
#include <errno.h>
#include <asm/arch/pmic_bus.h>
#include <axp_pmic.h>
diff --git a/drivers/tpm/sandbox_common.c b/drivers/tpm/sandbox_common.c
index 596e0156389..9d386fc32e5 100644
--- a/drivers/tpm/sandbox_common.c
+++ b/drivers/tpm/sandbox_common.c
@@ -9,6 +9,7 @@
#include <tpm-v1.h>
#include <tpm-v2.h>
+#include <linux/string.h>
#include <asm/unaligned.h>
#include "sandbox_common.h"
diff --git a/drivers/video/nexell_display.c b/drivers/video/nexell_display.c
index 7bda33fb16e..ea3776258a0 100644
--- a/drivers/video/nexell_display.c
+++ b/drivers/video/nexell_display.c
@@ -10,6 +10,7 @@
#include <config.h>
#include <command.h>
#include <dm.h>
+#include <env.h>
#include <mapmem.h>
#include <malloc.h>
#include <linux/compat.h>
diff --git a/include/command.h b/include/command.h
index 4158ca11b0e..5d225cd197f 100644
--- a/include/command.h
+++ b/include/command.h
@@ -10,7 +10,6 @@
#ifndef __COMMAND_H
#define __COMMAND_H
-#include <env.h>
#include <linker_lists.h>
#include <linux/compiler_attributes.h>
diff --git a/lib/efi_loader/efi_firmware.c b/lib/efi_loader/efi_firmware.c
index d44dc09813e..75501e21557 100644
--- a/lib/efi_loader/efi_firmware.c
+++ b/lib/efi_loader/efi_firmware.c
@@ -12,6 +12,7 @@
#include <dfu.h>
#include <efi_loader.h>
#include <efi_variable.h>
+#include <env.h>
#include <fwu.h>
#include <image.h>
#include <signatures.h>
diff --git a/test/boot/bootdev.c b/test/boot/bootdev.c
index 9af94786870..a5f3d4462a9 100644
--- a/test/boot/bootdev.c
+++ b/test/boot/bootdev.c
@@ -10,6 +10,7 @@
#include <dm.h>
#include <bootdev.h>
#include <bootflow.h>
+#include <env.h>
#include <mapmem.h>
#include <os.h>
#include <test/ut.h>
diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c
index b261bd5f620..a930d2cc309 100644
--- a/test/boot/bootflow.c
+++ b/test/boot/bootflow.c
@@ -14,6 +14,7 @@
#include <dm.h>
#include <efi.h>
#include <efi_loader.h>
+#include <env.h>
#include <expo.h>
#include <mapmem.h>
#ifdef CONFIG_SANDBOX
diff --git a/test/boot/bootm.c b/test/boot/bootm.c
index 1d1efe71ad5..ed60094f3c1 100644
--- a/test/boot/bootm.c
+++ b/test/boot/bootm.c
@@ -6,6 +6,7 @@
*/
#include <bootm.h>
+#include <env.h>
#include <asm/global_data.h>
#include <test/test.h>
#include <test/ut.h>
diff --git a/test/boot/bootmeth.c b/test/boot/bootmeth.c
index 577f259fb37..2ef3569ad83 100644
--- a/test/boot/bootmeth.c
+++ b/test/boot/bootmeth.c
@@ -9,6 +9,7 @@
#include <bootmeth.h>
#include <bootstd.h>
#include <dm.h>
+#include <env.h>
#include <test/ut.h>
#include "bootstd_common.h"
diff --git a/test/boot/measurement.c b/test/boot/measurement.c
index 1d38663fc0f..71f503f1567 100644
--- a/test/boot/measurement.c
+++ b/test/boot/measurement.c
@@ -7,6 +7,7 @@
*/
#include <bootm.h>
+#include <env.h>
#include <malloc.h>
#include <test/test.h>
#include <test/ut.h>
diff --git a/test/boot/upl.c b/test/boot/upl.c
index eec89026fc3..e2dc3d51eda 100644
--- a/test/boot/upl.c
+++ b/test/boot/upl.c
@@ -7,6 +7,7 @@
*/
#include <abuf.h>
+#include <env.h>
#include <mapmem.h>
#include <upl.h>
#include <dm/ofnode.h>
diff --git a/test/cmd/fdt.c b/test/cmd/fdt.c
index c11c181c807..96a8488e172 100644
--- a/test/cmd/fdt.c
+++ b/test/cmd/fdt.c
@@ -6,6 +6,7 @@
*/
#include <console.h>
+#include <env.h>
#include <fdt_support.h>
#include <mapmem.h>
#include <asm/global_data.h>
diff --git a/test/cmd/hash.c b/test/cmd/hash.c
index 296dd762b31..bb96380c351 100644
--- a/test/cmd/hash.c
+++ b/test/cmd/hash.c
@@ -6,6 +6,7 @@
*/
#include <command.h>
+#include <env.h>
#include <dm.h>
#include <dm/test.h>
#include <test/test.h>
diff --git a/test/cmd/mem_copy.c b/test/cmd/mem_copy.c
index 3e904fc4e4b..8e551f18a85 100644
--- a/test/cmd/mem_copy.c
+++ b/test/cmd/mem_copy.c
@@ -4,6 +4,7 @@
*/
#include <command.h>
+#include <compiler.h>
#include <console.h>
#include <mapmem.h>
#include <dm/test.h>
diff --git a/test/cmd/mem_search.c b/test/cmd/mem_search.c
index df8938bdb6c..61de0dfb9a9 100644
--- a/test/cmd/mem_search.c
+++ b/test/cmd/mem_search.c
@@ -7,6 +7,7 @@
*/
#include <console.h>
+#include <env.h>
#include <mapmem.h>
#include <dm/test.h>
#include <test/ut.h>
diff --git a/test/cmd/setexpr.c b/test/cmd/setexpr.c
index 85803eb54b8..93b0c4b68f5 100644
--- a/test/cmd/setexpr.c
+++ b/test/cmd/setexpr.c
@@ -7,6 +7,7 @@
*/
#include <console.h>
+#include <env.h>
#include <mapmem.h>
#include <dm/test.h>
#include <test/ut.h>
diff --git a/test/common/test_autoboot.c b/test/common/test_autoboot.c
index e3050d02c60..5feff57c271 100644
--- a/test/common/test_autoboot.c
+++ b/test/common/test_autoboot.c
@@ -6,6 +6,7 @@
*/
#include <autoboot.h>
+#include <env.h>
#include <test/common.h>
#include <test/test.h>
#include <test/ut.h>
diff --git a/test/dm/blkmap.c b/test/dm/blkmap.c
index a6a0b4d4e20..d04b68b50ae 100644
--- a/test/dm/blkmap.c
+++ b/test/dm/blkmap.c
@@ -7,6 +7,7 @@
#include <blk.h>
#include <blkmap.h>
#include <dm.h>
+#include <env.h>
#include <asm/test.h>
#include <dm/test.h>
#include <test/test.h>
diff --git a/test/dm/button.c b/test/dm/button.c
index 3612f308f02..f05f4ca27ce 100644
--- a/test/dm/button.c
+++ b/test/dm/button.c
@@ -8,6 +8,7 @@
#include <dm.h>
#include <adc.h>
#include <button.h>
+#include <env.h>
#include <power/regulator.h>
#include <power/sandbox_pmic.h>
#include <asm/gpio.h>
diff --git a/test/dm/fastboot.c b/test/dm/fastboot.c
index 73c43f82924..5b51b6bf9dd 100644
--- a/test/dm/fastboot.c
+++ b/test/dm/fastboot.c
@@ -4,6 +4,7 @@
*/
#include <dm.h>
+#include <env.h>
#include <fastboot.h>
#include <fb_mmc.h>
#include <mmc.h>
diff --git a/test/dm/part.c b/test/dm/part.c
index c5c4b3fdba1..caae23bd4aa 100644
--- a/test/dm/part.c
+++ b/test/dm/part.c
@@ -4,6 +4,7 @@
*/
#include <dm.h>
+#include <env.h>
#include <mmc.h>
#include <part.h>
#include <part_efi.h>
diff --git a/test/env/fdt.c b/test/env/fdt.c
index c495ac7b307..3652563f330 100644
--- a/test/env/fdt.c
+++ b/test/env/fdt.c
@@ -1,4 +1,5 @@
#include <command.h>
+#include <env.h>
#include <env_attr.h>
#include <test/env.h>
#include <test/ut.h>
diff --git a/test/hush/dollar.c b/test/hush/dollar.c
index 820110799a2..b83a64d091d 100644
--- a/test/hush/dollar.c
+++ b/test/hush/dollar.c
@@ -5,6 +5,7 @@
*/
#include <command.h>
+#include <env.h>
#include <env_attr.h>
#include <test/hush.h>
#include <test/ut.h>
diff --git a/test/hush/if.c b/test/hush/if.c
index 8939b7a6c86..ea615b246a9 100644
--- a/test/hush/if.c
+++ b/test/hush/if.c
@@ -5,6 +5,7 @@
*/
#include <command.h>
+#include <env.h>
#include <env_attr.h>
#include <vsprintf.h>
#include <test/hush.h>
diff --git a/test/hush/loop.c b/test/hush/loop.c
index 7154b9bc0ae..ea72ac773ba 100644
--- a/test/hush/loop.c
+++ b/test/hush/loop.c
@@ -5,6 +5,7 @@
*/
#include <command.h>
+#include <env.h>
#include <env_attr.h>
#include <test/hush.h>
#include <test/ut.h>