summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-08-01 09:46:52 -0600
committerTom Rini <trini@konsulko.com>2019-08-11 16:43:41 -0400
commit7b51b576d6db714e8668a98de67e93651e18123c (patch)
tree568a39b82f10fabc191cfe6da0fa6e17c251bd08
parent9fb625ce05539fe6876a59ce1dcadb76b33c6f6e (diff)
env: Move env_get() to env.h
Move env_get() over to the new header file. Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--arch/arm/lib/bootm.c1
-rw-r--r--arch/arm/mach-imx/video.c1
-rw-r--r--arch/arm/mach-kirkwood/cpu.c1
-rw-r--r--arch/m68k/lib/bootm.c1
-rw-r--r--arch/microblaze/lib/bootm.c1
-rw-r--r--arch/nds32/lib/bootm.c1
-rw-r--r--arch/powerpc/cpu/mpc85xx/mp.c1
-rw-r--r--arch/powerpc/lib/bootm.c1
-rw-r--r--arch/xtensa/lib/bootm.c1
-rw-r--r--board/BuS/eb_cpu5282/eb_cpu5282.c1
-rw-r--r--board/CarMediaLab/flea3/flea3.c1
-rw-r--r--board/bluegiga/apx4devkit/apx4devkit.c1
-rw-r--r--board/bluewater/gurnard/gurnard.c1
-rw-r--r--board/broadcom/bcm23550_w1d/bcm23550_w1d.c1
-rw-r--r--board/broadcom/bcm28155_ap/bcm28155_ap.c1
-rw-r--r--board/compulab/common/omap3_display.c1
-rw-r--r--board/freescale/bsc9131rdb/bsc9131rdb.c1
-rw-r--r--board/freescale/bsc9132qds/bsc9132qds.c1
-rw-r--r--board/freescale/c29xpcie/c29xpcie.c1
-rw-r--r--board/freescale/common/vid.c1
-rw-r--r--board/freescale/corenet_ds/corenet_ds.c1
-rw-r--r--board/freescale/ls1088a/eth_ls1088aqds.c1
-rw-r--r--board/freescale/ls1088a/ls1088a.c1
-rw-r--r--board/freescale/ls2080aqds/eth.c1
-rw-r--r--board/freescale/ls2080aqds/ls2080aqds.c1
-rw-r--r--board/freescale/lx2160a/eth_lx2160aqds.c1
-rw-r--r--board/freescale/mpc837xemds/pci.c1
-rw-r--r--board/freescale/mpc8572ds/mpc8572ds.c1
-rw-r--r--board/freescale/mx51evk/mx51evk_video.c1
-rw-r--r--board/freescale/mx53loco/mx53loco_video.c1
-rw-r--r--board/freescale/p1010rdb/p1010rdb.c1
-rw-r--r--board/freescale/p1022ds/p1022ds.c1
-rw-r--r--board/freescale/p1023rdb/p1023rdb.c1
-rw-r--r--board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c1
-rw-r--r--board/freescale/p1_twr/p1_twr.c1
-rw-r--r--board/freescale/p2041rdb/p2041rdb.c1
-rw-r--r--board/freescale/t102xqds/t102xqds.c1
-rw-r--r--board/freescale/t102xrdb/t102xrdb.c1
-rw-r--r--board/freescale/t1040qds/t1040qds.c1
-rw-r--r--board/freescale/t104xrdb/t104xrdb.c1
-rw-r--r--board/freescale/t208xqds/t208xqds.c1
-rw-r--r--board/freescale/t208xrdb/t208xrdb.c1
-rw-r--r--board/freescale/t4qds/t4240emu.c1
-rw-r--r--board/freescale/t4qds/t4240qds.c1
-rw-r--r--board/freescale/t4rdb/t4240rdb.c1
-rw-r--r--board/gateworks/gw_ventana/common.c1
-rw-r--r--board/gdsys/a38x/keyprogram.c1
-rw-r--r--board/gdsys/mpc8308/hrcon.c1
-rw-r--r--board/gdsys/mpc8308/strider.c1
-rw-r--r--board/gdsys/p1022/controlcenterd.c1
-rw-r--r--board/hisilicon/poplar/poplar.c1
-rw-r--r--board/menlo/m53menlo/m53menlo.c1
-rw-r--r--board/nvidia/p2371-2180/p2371-2180.c1
-rw-r--r--board/nvidia/p2771-0000/p2771-0000.c1
-rw-r--r--board/renesas/alt/alt.c1
-rw-r--r--board/renesas/gose/gose.c1
-rw-r--r--board/renesas/koelsch/koelsch.c1
-rw-r--r--board/renesas/lager/lager.c1
-rw-r--r--board/renesas/porter/porter.c1
-rw-r--r--board/renesas/silk/silk.c1
-rw-r--r--board/renesas/stout/stout.c1
-rw-r--r--board/samsung/common/exynos5-dt.c1
-rw-r--r--board/samsung/odroid/odroid.c1
-rw-r--r--board/siemens/common/board.c1
-rw-r--r--board/ti/ks2_evm/board.c1
-rw-r--r--board/toradex/common/tdx-cfg-block.c1
-rw-r--r--board/varisys/cyrus/cyrus.c1
-rw-r--r--board/work-microwave/work_92105/work_92105_display.c1
-rw-r--r--cmd/bdinfo.c1
-rw-r--r--cmd/bootefi.c1
-rw-r--r--cmd/bootm.c1
-rw-r--r--cmd/bootmenu.c1
-rw-r--r--cmd/fpga.c1
-rw-r--r--cmd/itest.c1
-rw-r--r--cmd/mvebu/bubt.c1
-rw-r--r--common/bootretry.c1
-rw-r--r--common/cli.c1
-rw-r--r--common/cli_simple.c1
-rw-r--r--common/fdt_support.c1
-rw-r--r--common/image.c1
-rw-r--r--common/spl/spl_ext.c1
-rw-r--r--common/spl/spl_fat.c1
-rw-r--r--common/splash.c1
-rw-r--r--common/splash_source.c1
-rw-r--r--common/usb_hub.c1
-rw-r--r--common/usb_kbd.c1
-rw-r--r--disk/part.c1
-rw-r--r--disk/part_amiga.c1
-rw-r--r--drivers/dfu/dfu.c1
-rw-r--r--drivers/fastboot/fb_common.c1
-rw-r--r--drivers/fastboot/fb_getvar.c1
-rw-r--r--drivers/fastboot/fb_mmc.c1
-rw-r--r--drivers/input/i8042.c1
-rw-r--r--drivers/input/input.c1
-rw-r--r--drivers/misc/fs_loader.c1
-rw-r--r--drivers/net/dc2114x.c1
-rw-r--r--drivers/net/fm/fdt.c1
-rw-r--r--drivers/net/fsl-mc/mc.c1
-rw-r--r--drivers/net/fsl_mcdmafec.c1
-rw-r--r--drivers/net/ftmac100.c1
-rw-r--r--drivers/net/mcffec.c1
-rw-r--r--drivers/net/phy/micrel_ksz90x1.c1
-rw-r--r--drivers/net/sh_eth.c1
-rw-r--r--drivers/pci/fsl_pci_init.c1
-rw-r--r--drivers/pci/pci.c1
-rw-r--r--drivers/pci/pci_common.c1
-rw-r--r--drivers/reset/reset-socfpga.c1
-rw-r--r--drivers/rtc/m41t60.c1
-rw-r--r--drivers/serial/usbtty.c1
-rw-r--r--drivers/usb/gadget/designware_udc.c1
-rw-r--r--drivers/usb/gadget/f_dfu.c1
-rw-r--r--drivers/usb/gadget/f_fastboot.c1
-rw-r--r--drivers/usb/gadget/f_rockusb.c1
-rw-r--r--drivers/usb/host/ehci-fsl.c1
-rw-r--r--drivers/video/ati_radeon_fb.c1
-rw-r--r--drivers/video/cfb_console.c1
-rw-r--r--drivers/video/mb862xx.c1
-rw-r--r--drivers/video/mx3fb.c1
-rw-r--r--drivers/video/mxsfb.c1
-rw-r--r--drivers/video/videomodes.c1
-rw-r--r--env/callback.c1
-rw-r--r--env/eeprom.c1
-rw-r--r--env/nvram.c1
-rw-r--r--include/common.h12
-rw-r--r--include/env.h12
-rw-r--r--lib/efi_loader/efi_console.c1
-rw-r--r--lib/smbios.c1
-rw-r--r--net/link_local.c1
-rw-r--r--net/tftp.c1
129 files changed, 139 insertions, 12 deletions
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index bf68a5ba622..1638f1e81d7 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -15,6 +15,7 @@
#include <command.h>
#include <dm.h>
#include <dm/root.h>
+#include <env.h>
#include <image.h>
#include <u-boot/zlib.h>
#include <asm/byteorder.h>
diff --git a/arch/arm/mach-imx/video.c b/arch/arm/mach-imx/video.c
index 22a371a212d..1bc9b7cc7e1 100644
--- a/arch/arm/mach-imx/video.c
+++ b/arch/arm/mach-imx/video.c
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0+
#include <common.h>
+#include <env.h>
#include <linux/errno.h>
#include <asm/mach-imx/video.h>
diff --git a/arch/arm/mach-kirkwood/cpu.c b/arch/arm/mach-kirkwood/cpu.c
index 8f8e3003854..6ad25434386 100644
--- a/arch/arm/mach-kirkwood/cpu.c
+++ b/arch/arm/mach-kirkwood/cpu.c
@@ -6,6 +6,7 @@
*/
#include <common.h>
+#include <env.h>
#include <netdev.h>
#include <asm/cache.h>
#include <asm/io.h>
diff --git a/arch/m68k/lib/bootm.c b/arch/m68k/lib/bootm.c
index 1b154302979..5b7a68b2501 100644
--- a/arch/m68k/lib/bootm.c
+++ b/arch/m68k/lib/bootm.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <image.h>
#include <u-boot/zlib.h>
#include <bzlib.h>
diff --git a/arch/microblaze/lib/bootm.c b/arch/microblaze/lib/bootm.c
index 083a43c3a5c..ec332944d8e 100644
--- a/arch/microblaze/lib/bootm.c
+++ b/arch/microblaze/lib/bootm.c
@@ -9,6 +9,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <fdt_support.h>
#include <image.h>
#include <u-boot/zlib.h>
diff --git a/arch/nds32/lib/bootm.c b/arch/nds32/lib/bootm.c
index 0cfdc52b465..a472f6a1873 100644
--- a/arch/nds32/lib/bootm.c
+++ b/arch/nds32/lib/bootm.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <image.h>
#include <u-boot/zlib.h>
#include <asm/byteorder.h>
diff --git a/arch/powerpc/cpu/mpc85xx/mp.c b/arch/powerpc/cpu/mpc85xx/mp.c
index 119d4b3510a..3882c95f92e 100644
--- a/arch/powerpc/cpu/mpc85xx/mp.c
+++ b/arch/powerpc/cpu/mpc85xx/mp.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <env.h>
#include <asm/processor.h>
+#include <env.h>
#include <ioports.h>
#include <lmb.h>
#include <asm/io.h>
diff --git a/arch/powerpc/lib/bootm.c b/arch/powerpc/lib/bootm.c
index 15e9c2a83e5..52bcd4e6f16 100644
--- a/arch/powerpc/lib/bootm.c
+++ b/arch/powerpc/lib/bootm.c
@@ -8,6 +8,7 @@
#include <common.h>
+#include <env.h>
#include <watchdog.h>
#include <command.h>
#include <image.h>
diff --git a/arch/xtensa/lib/bootm.c b/arch/xtensa/lib/bootm.c
index aceed153d75..93eea53c5f2 100644
--- a/arch/xtensa/lib/bootm.c
+++ b/arch/xtensa/lib/bootm.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <u-boot/zlib.h>
#include <asm/byteorder.h>
#include <asm/addrspace.h>
diff --git a/board/BuS/eb_cpu5282/eb_cpu5282.c b/board/BuS/eb_cpu5282/eb_cpu5282.c
index 379194803a8..0b916d2482c 100644
--- a/board/BuS/eb_cpu5282/eb_cpu5282.c
+++ b/board/BuS/eb_cpu5282/eb_cpu5282.c
@@ -11,6 +11,7 @@
#include <command.h>
#include "asm/m5282.h"
#include <bmp_layout.h>
+#include <env.h>
#include <status_led.h>
#include <bus_vcxk.h>
diff --git a/board/CarMediaLab/flea3/flea3.c b/board/CarMediaLab/flea3/flea3.c
index 9eec1b78381..be0bc228ec7 100644
--- a/board/CarMediaLab/flea3/flea3.c
+++ b/board/CarMediaLab/flea3/flea3.c
@@ -9,6 +9,7 @@
#include <common.h>
#include <asm/io.h>
+#include <env.h>
#include <linux/errno.h>
#include <asm/arch/imx-regs.h>
#include <asm/arch/crm_regs.h>
diff --git a/board/bluegiga/apx4devkit/apx4devkit.c b/board/bluegiga/apx4devkit/apx4devkit.c
index 9aa87f5ccf0..9268aa0daaf 100644
--- a/board/bluegiga/apx4devkit/apx4devkit.c
+++ b/board/bluegiga/apx4devkit/apx4devkit.c
@@ -21,6 +21,7 @@
#include <asm/arch/iomux-mx28.h>
#include <asm/arch/clock.h>
#include <asm/arch/sys_proto.h>
+#include <env.h>
#include <linux/mii.h>
#include <miiphy.h>
#include <netdev.h>
diff --git a/board/bluewater/gurnard/gurnard.c b/board/bluewater/gurnard/gurnard.c
index 3cda2fafab2..48e31d9065a 100644
--- a/board/bluewater/gurnard/gurnard.c
+++ b/board/bluewater/gurnard/gurnard.c
@@ -12,6 +12,7 @@
#include <atmel_lcdc.h>
#include <atmel_mci.h>
#include <dm.h>
+#include <env.h>
#include <lcd.h>
#include <net.h>
#ifndef CONFIG_DM_ETH
diff --git a/board/broadcom/bcm23550_w1d/bcm23550_w1d.c b/board/broadcom/bcm23550_w1d/bcm23550_w1d.c
index 72a32a27659..ce9f0494ee5 100644
--- a/board/broadcom/bcm23550_w1d/bcm23550_w1d.c
+++ b/board/broadcom/bcm23550_w1d/bcm23550_w1d.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <asm/io.h>
#include <asm/mach-types.h>
+#include <env.h>
#include <mmc.h>
#include <asm/kona-common/kona_sdhci.h>
#include <asm/kona-common/clk.h>
diff --git a/board/broadcom/bcm28155_ap/bcm28155_ap.c b/board/broadcom/bcm28155_ap/bcm28155_ap.c
index 6faeb6a5154..87616386cb8 100644
--- a/board/broadcom/bcm28155_ap/bcm28155_ap.c
+++ b/board/broadcom/bcm28155_ap/bcm28155_ap.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <asm/io.h>
#include <asm/mach-types.h>
+#include <env.h>
#include <mmc.h>
#include <asm/kona-common/kona_sdhci.h>
#include <asm/kona-common/clk.h>
diff --git a/board/compulab/common/omap3_display.c b/board/compulab/common/omap3_display.c
index bc9f31ab87d..cb9ebae7f96 100644
--- a/board/compulab/common/omap3_display.c
+++ b/board/compulab/common/omap3_display.c
@@ -10,6 +10,7 @@
#include <common.h>
#include <asm/gpio.h>
#include <asm/io.h>
+#include <env.h>
#include <stdio_dev.h>
#include <asm/arch/dss.h>
#include <lcd.h>
diff --git a/board/freescale/bsc9131rdb/bsc9131rdb.c b/board/freescale/bsc9131rdb/bsc9131rdb.c
index 9d9c83f7167..30e7a1f7ed9 100644
--- a/board/freescale/bsc9131rdb/bsc9131rdb.c
+++ b/board/freescale/bsc9131rdb/bsc9131rdb.c
@@ -9,6 +9,7 @@
#include <asm/cache.h>
#include <asm/immap_85xx.h>
#include <asm/io.h>
+#include <env.h>
#include <miiphy.h>
#include <linux/libfdt.h>
#include <fdt_support.h>
diff --git a/board/freescale/bsc9132qds/bsc9132qds.c b/board/freescale/bsc9132qds/bsc9132qds.c
index 36a55285e81..dd9ad905085 100644
--- a/board/freescale/bsc9132qds/bsc9132qds.c
+++ b/board/freescale/bsc9132qds/bsc9132qds.c
@@ -9,6 +9,7 @@
#include <asm/cache.h>
#include <asm/immap_85xx.h>
#include <asm/io.h>
+#include <env.h>
#include <miiphy.h>
#include <linux/libfdt.h>
#include <fdt_support.h>
diff --git a/board/freescale/c29xpcie/c29xpcie.c b/board/freescale/c29xpcie/c29xpcie.c
index 8ee3e140bbf..6d103be7ffc 100644
--- a/board/freescale/c29xpcie/c29xpcie.c
+++ b/board/freescale/c29xpcie/c29xpcie.c
@@ -9,6 +9,7 @@
#include <asm/cache.h>
#include <asm/immap_85xx.h>
#include <asm/io.h>
+#include <env.h>
#include <miiphy.h>
#include <linux/libfdt.h>
#include <fdt_support.h>
diff --git a/board/freescale/common/vid.c b/board/freescale/common/vid.c
index 0ca389c9aeb..b8049719816 100644
--- a/board/freescale/common/vid.c
+++ b/board/freescale/common/vid.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <i2c.h>
#include <asm/io.h>
#ifdef CONFIG_FSL_LSCH2
diff --git a/board/freescale/corenet_ds/corenet_ds.c b/board/freescale/corenet_ds/corenet_ds.c
index b166faf3265..3ce9a76aae1 100644
--- a/board/freescale/corenet_ds/corenet_ds.c
+++ b/board/freescale/corenet_ds/corenet_ds.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <netdev.h>
#include <linux/compiler.h>
#include <asm/mmu.h>
diff --git a/board/freescale/ls1088a/eth_ls1088aqds.c b/board/freescale/ls1088a/eth_ls1088aqds.c
index f16b78cf03f..d4ab9791e96 100644
--- a/board/freescale/ls1088a/eth_ls1088aqds.c
+++ b/board/freescale/ls1088a/eth_ls1088aqds.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <netdev.h>
#include <asm/io.h>
#include <asm/arch/fsl_serdes.h>
diff --git a/board/freescale/ls1088a/ls1088a.c b/board/freescale/ls1088a/ls1088a.c
index 6d11a134dc9..a1c9eb3f468 100644
--- a/board/freescale/ls1088a/ls1088a.c
+++ b/board/freescale/ls1088a/ls1088a.c
@@ -3,6 +3,7 @@
* Copyright 2017-2018 NXP
*/
#include <common.h>
+#include <env.h>
#include <i2c.h>
#include <malloc.h>
#include <errno.h>
diff --git a/board/freescale/ls2080aqds/eth.c b/board/freescale/ls2080aqds/eth.c
index f706fd4cb6a..1b4e6c65fb9 100644
--- a/board/freescale/ls2080aqds/eth.c
+++ b/board/freescale/ls2080aqds/eth.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <env.h>
#include <netdev.h>
#include <asm/io.h>
#include <asm/arch/fsl_serdes.h>
diff --git a/board/freescale/ls2080aqds/ls2080aqds.c b/board/freescale/ls2080aqds/ls2080aqds.c
index a0a33016916..e9e0999a186 100644
--- a/board/freescale/ls2080aqds/ls2080aqds.c
+++ b/board/freescale/ls2080aqds/ls2080aqds.c
@@ -3,6 +3,7 @@
* Copyright 2015 Freescale Semiconductor
*/
#include <common.h>
+#include <env.h>
#include <malloc.h>
#include <errno.h>
#include <netdev.h>
diff --git a/board/freescale/lx2160a/eth_lx2160aqds.c b/board/freescale/lx2160a/eth_lx2160aqds.c
index f6e22d7337b..92c06e5060f 100644
--- a/board/freescale/lx2160a/eth_lx2160aqds.c
+++ b/board/freescale/lx2160a/eth_lx2160aqds.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <env.h>
#include <hwconfig.h>
#include <command.h>
#include <netdev.h>
diff --git a/board/freescale/mpc837xemds/pci.c b/board/freescale/mpc837xemds/pci.c
index 42176389521..41b78cf5e4d 100644
--- a/board/freescale/mpc837xemds/pci.c
+++ b/board/freescale/mpc837xemds/pci.c
@@ -6,6 +6,7 @@
#include <asm/mmu.h>
#include <asm/io.h>
#include <common.h>
+#include <env.h>
#include <mpc83xx.h>
#include <pci.h>
#include <i2c.h>
diff --git a/board/freescale/mpc8572ds/mpc8572ds.c b/board/freescale/mpc8572ds/mpc8572ds.c
index 6abeeba43b5..89f4d6c05f2 100644
--- a/board/freescale/mpc8572ds/mpc8572ds.c
+++ b/board/freescale/mpc8572ds/mpc8572ds.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <pci.h>
#include <asm/processor.h>
#include <asm/mmu.h>
diff --git a/board/freescale/mx51evk/mx51evk_video.c b/board/freescale/mx51evk/mx51evk_video.c
index 995fb9a9abb..3715c5d738f 100644
--- a/board/freescale/mx51evk/mx51evk_video.c
+++ b/board/freescale/mx51evk/mx51evk_video.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <env.h>
#include <linux/list.h>
#include <asm/gpio.h>
#include <asm/arch/iomux-mx51.h>
diff --git a/board/freescale/mx53loco/mx53loco_video.c b/board/freescale/mx53loco/mx53loco_video.c
index 160af1ef0df..ff3fc8ce3e6 100644
--- a/board/freescale/mx53loco/mx53loco_video.c
+++ b/board/freescale/mx53loco/mx53loco_video.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <env.h>
#include <linux/list.h>
#include <asm/gpio.h>
#include <asm/arch/iomux-mx53.h>
diff --git a/board/freescale/p1010rdb/p1010rdb.c b/board/freescale/p1010rdb/p1010rdb.c
index b0db353167a..449df937e6a 100644
--- a/board/freescale/p1010rdb/p1010rdb.c
+++ b/board/freescale/p1010rdb/p1010rdb.c
@@ -9,6 +9,7 @@
#include <asm/cache.h>
#include <asm/immap_85xx.h>
#include <asm/io.h>
+#include <env.h>
#include <miiphy.h>
#include <linux/libfdt.h>
#include <fdt_support.h>
diff --git a/board/freescale/p1022ds/p1022ds.c b/board/freescale/p1022ds/p1022ds.c
index 835ede562e9..9406e755170 100644
--- a/board/freescale/p1022ds/p1022ds.c
+++ b/board/freescale/p1022ds/p1022ds.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <pci.h>
#include <asm/processor.h>
#include <asm/mmu.h>
diff --git a/board/freescale/p1023rdb/p1023rdb.c b/board/freescale/p1023rdb/p1023rdb.c
index d0012ea38b7..7db04043ca5 100644
--- a/board/freescale/p1023rdb/p1023rdb.c
+++ b/board/freescale/p1023rdb/p1023rdb.c
@@ -8,6 +8,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <pci.h>
#include <asm/io.h>
#include <asm/cache.h>
diff --git a/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c b/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c
index 4b151e8ef38..a04a73528f8 100644
--- a/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c
+++ b/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <hwconfig.h>
#include <pci.h>
#include <i2c.h>
diff --git a/board/freescale/p1_twr/p1_twr.c b/board/freescale/p1_twr/p1_twr.c
index fe99ebf4b20..01cac181b34 100644
--- a/board/freescale/p1_twr/p1_twr.c
+++ b/board/freescale/p1_twr/p1_twr.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <hwconfig.h>
#include <pci.h>
#include <i2c.h>
diff --git a/board/freescale/p2041rdb/p2041rdb.c b/board/freescale/p2041rdb/p2041rdb.c
index 6324027c8ab..baf1506908e 100644
--- a/board/freescale/p2041rdb/p2041rdb.c
+++ b/board/freescale/p2041rdb/p2041rdb.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <netdev.h>
#include <linux/compiler.h>
#include <asm/mmu.h>
diff --git a/board/freescale/t102xqds/t102xqds.c b/board/freescale/t102xqds/t102xqds.c
index d770aebebb9..6c754503d19 100644
--- a/board/freescale/t102xqds/t102xqds.c
+++ b/board/freescale/t102xqds/t102xqds.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <i2c.h>
#include <netdev.h>
#include <linux/compiler.h>
diff --git a/board/freescale/t102xrdb/t102xrdb.c b/board/freescale/t102xrdb/t102xrdb.c
index acc0be07c5a..793f54d69ea 100644
--- a/board/freescale/t102xrdb/t102xrdb.c
+++ b/board/freescale/t102xrdb/t102xrdb.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <i2c.h>
#include <netdev.h>
#include <linux/compiler.h>
diff --git a/board/freescale/t1040qds/t1040qds.c b/board/freescale/t1040qds/t1040qds.c
index 911190b1fe0..55516b9f067 100644
--- a/board/freescale/t1040qds/t1040qds.c
+++ b/board/freescale/t1040qds/t1040qds.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <i2c.h>
#include <netdev.h>
#include <linux/compiler.h>
diff --git a/board/freescale/t104xrdb/t104xrdb.c b/board/freescale/t104xrdb/t104xrdb.c
index c9557b465f2..c7a645108f4 100644
--- a/board/freescale/t104xrdb/t104xrdb.c
+++ b/board/freescale/t104xrdb/t104xrdb.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <hwconfig.h>
#include <netdev.h>
#include <linux/compiler.h>
diff --git a/board/freescale/t208xqds/t208xqds.c b/board/freescale/t208xqds/t208xqds.c
index abd069fdfe6..86d6b1defe9 100644
--- a/board/freescale/t208xqds/t208xqds.c
+++ b/board/freescale/t208xqds/t208xqds.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <i2c.h>
#include <netdev.h>
#include <linux/compiler.h>
diff --git a/board/freescale/t208xrdb/t208xrdb.c b/board/freescale/t208xrdb/t208xrdb.c
index adae3f96ca2..d03d48bcfaf 100644
--- a/board/freescale/t208xrdb/t208xrdb.c
+++ b/board/freescale/t208xrdb/t208xrdb.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <i2c.h>
#include <netdev.h>
#include <linux/compiler.h>
diff --git a/board/freescale/t4qds/t4240emu.c b/board/freescale/t4qds/t4240emu.c
index 512229a380d..d9cb967c220 100644
--- a/board/freescale/t4qds/t4240emu.c
+++ b/board/freescale/t4qds/t4240emu.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <i2c.h>
#include <netdev.h>
#include <linux/compiler.h>
diff --git a/board/freescale/t4qds/t4240qds.c b/board/freescale/t4qds/t4240qds.c
index 125bfa31bf3..bb18b97e6a2 100644
--- a/board/freescale/t4qds/t4240qds.c
+++ b/board/freescale/t4qds/t4240qds.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <i2c.h>
#include <netdev.h>
#include <linux/compiler.h>
diff --git a/board/freescale/t4rdb/t4240rdb.c b/board/freescale/t4rdb/t4240rdb.c
index 3bfebb62147..0c95607762e 100644
--- a/board/freescale/t4rdb/t4240rdb.c
+++ b/board/freescale/t4rdb/t4240rdb.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <i2c.h>
#include <netdev.h>
#include <linux/compiler.h>
diff --git a/board/gateworks/gw_ventana/common.c b/board/gateworks/gw_ventana/common.c
index a5439166153..1240a9da174 100644
--- a/board/gateworks/gw_ventana/common.c
+++ b/board/gateworks/gw_ventana/common.c
@@ -10,6 +10,7 @@
#include <asm/arch/sys_proto.h>
#include <asm/gpio.h>
#include <asm/mach-imx/mxc_i2c.h>
+#include <env.h>
#include <fsl_esdhc_imx.h>
#include <hwconfig.h>
#include <power/pmic.h>
diff --git a/board/gdsys/a38x/keyprogram.c b/board/gdsys/a38x/keyprogram.c
index 291edc340df..000897984a6 100644
--- a/board/gdsys/a38x/keyprogram.c
+++ b/board/gdsys/a38x/keyprogram.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <env.h>
#include <tpm-v1.h>
#include <malloc.h>
#include <linux/ctype.h>
diff --git a/board/gdsys/mpc8308/hrcon.c b/board/gdsys/mpc8308/hrcon.c
index d14a28ec94d..60faa4688cf 100644
--- a/board/gdsys/mpc8308/hrcon.c
+++ b/board/gdsys/mpc8308/hrcon.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <env.h>
#include <hwconfig.h>
#include <i2c.h>
#include <spi.h>
diff --git a/board/gdsys/mpc8308/strider.c b/board/gdsys/mpc8308/strider.c
index 1fdea675bda..886bc2b035d 100644
--- a/board/gdsys/mpc8308/strider.c
+++ b/board/gdsys/mpc8308/strider.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <env.h>
#include <hwconfig.h>
#include <i2c.h>
#include <spi.h>
diff --git a/board/gdsys/p1022/controlcenterd.c b/board/gdsys/p1022/controlcenterd.c
index 7bdc924a89d..6eb3d6c5d06 100644
--- a/board/gdsys/p1022/controlcenterd.c
+++ b/board/gdsys/p1022/controlcenterd.c
@@ -23,6 +23,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <pci.h>
#include <asm/processor.h>
#include <asm/mmu.h>
diff --git a/board/hisilicon/poplar/poplar.c b/board/hisilicon/poplar/poplar.c
index 77948445e26..4926419a905 100644
--- a/board/hisilicon/poplar/poplar.c
+++ b/board/hisilicon/poplar/poplar.c
@@ -155,6 +155,7 @@ static void usb2_phy_init(void)
}
#if defined(CONFIG_USB_GADGET) && defined(CONFIG_USB_GADGET_DWC2_OTG)
+#include <env.h>
#include <usb.h>
#include <usb/dwc2_udc.h>
#include <g_dnl.h>
diff --git a/board/menlo/m53menlo/m53menlo.c b/board/menlo/m53menlo/m53menlo.c
index a63af5fae05..bda5f0df5bc 100644
--- a/board/menlo/m53menlo/m53menlo.c
+++ b/board/menlo/m53menlo/m53menlo.c
@@ -18,6 +18,7 @@
#include <asm/mach-imx/video.h>
#include <asm/gpio.h>
#include <asm/spl.h>
+#include <env.h>
#include <fdt_support.h>
#include <fsl_esdhc_imx.h>
#include <gzip.h>
diff --git a/board/nvidia/p2371-2180/p2371-2180.c b/board/nvidia/p2371-2180/p2371-2180.c
index 4985302d6bc..b1da5c9982d 100644
--- a/board/nvidia/p2371-2180/p2371-2180.c
+++ b/board/nvidia/p2371-2180/p2371-2180.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <env.h>
#include <environment.h>
#include <fdtdec.h>
#include <i2c.h>
diff --git a/board/nvidia/p2771-0000/p2771-0000.c b/board/nvidia/p2771-0000/p2771-0000.c
index d294c7ae013..8c91b75f967 100644
--- a/board/nvidia/p2771-0000/p2771-0000.c
+++ b/board/nvidia/p2771-0000/p2771-0000.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <env.h>
#include <environment.h>
#include <fdtdec.h>
#include <i2c.h>
diff --git a/board/renesas/alt/alt.c b/board/renesas/alt/alt.c
index 0726776a573..77979704be2 100644
--- a/board/renesas/alt/alt.c
+++ b/board/renesas/alt/alt.c
@@ -6,6 +6,7 @@
*/
#include <common.h>
+#include <env.h>
#include <malloc.h>
#include <dm.h>
#include <dm/platform_data/serial_sh.h>
diff --git a/board/renesas/gose/gose.c b/board/renesas/gose/gose.c
index 7c610087395..bffa85c2325 100644
--- a/board/renesas/gose/gose.c
+++ b/board/renesas/gose/gose.c
@@ -6,6 +6,7 @@
*/
#include <common.h>
+#include <env.h>
#include <malloc.h>
#include <dm.h>
#include <dm/platform_data/serial_sh.h>
diff --git a/board/renesas/koelsch/koelsch.c b/board/renesas/koelsch/koelsch.c
index d07a7ca2aba..1bb3b492e29 100644
--- a/board/renesas/koelsch/koelsch.c
+++ b/board/renesas/koelsch/koelsch.c
@@ -7,6 +7,7 @@
*/
#include <common.h>
+#include <env.h>
#include <malloc.h>
#include <dm.h>
#include <dm/platform_data/serial_sh.h>
diff --git a/board/renesas/lager/lager.c b/board/renesas/lager/lager.c
index f062bb01725..bda3295badb 100644
--- a/board/renesas/lager/lager.c
+++ b/board/renesas/lager/lager.c
@@ -8,6 +8,7 @@
*/
#include <common.h>
+#include <env.h>
#include <environment.h>
#include <malloc.h>
#include <netdev.h>
diff --git a/board/renesas/porter/porter.c b/board/renesas/porter/porter.c
index 2e15a4cbbdc..d3afc2a4004 100644
--- a/board/renesas/porter/porter.c
+++ b/board/renesas/porter/porter.c
@@ -7,6 +7,7 @@
*/
#include <common.h>
+#include <env.h>
#include <malloc.h>
#include <dm.h>
#include <dm/platform_data/serial_sh.h>
diff --git a/board/renesas/silk/silk.c b/board/renesas/silk/silk.c
index 59ba262ad73..bda6a414e65 100644
--- a/board/renesas/silk/silk.c
+++ b/board/renesas/silk/silk.c
@@ -7,6 +7,7 @@
*/
#include <common.h>
+#include <env.h>
#include <malloc.h>
#include <dm.h>
#include <dm/platform_data/serial_sh.h>
diff --git a/board/renesas/stout/stout.c b/board/renesas/stout/stout.c
index 7c515950d67..95b5711fdb8 100644
--- a/board/renesas/stout/stout.c
+++ b/board/renesas/stout/stout.c
@@ -9,6 +9,7 @@
*/
#include <common.h>
+#include <env.h>
#include <malloc.h>
#include <netdev.h>
#include <dm.h>
diff --git a/board/samsung/common/exynos5-dt.c b/board/samsung/common/exynos5-dt.c
index 87eb381345d..387d1b91809 100644
--- a/board/samsung/common/exynos5-dt.c
+++ b/board/samsung/common/exynos5-dt.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <dm.h>
#include <dwc3-uboot.h>
+#include <env.h>
#include <fdtdec.h>
#include <asm/io.h>
#include <errno.h>
diff --git a/board/samsung/odroid/odroid.c b/board/samsung/odroid/odroid.c
index 3e594fd8501..9aa97f0f2ca 100644
--- a/board/samsung/odroid/odroid.c
+++ b/board/samsung/odroid/odroid.c
@@ -12,6 +12,7 @@
#include <asm/gpio.h>
#include <asm/arch/cpu.h>
#include <dm.h>
+#include <env.h>
#include <power/pmic.h>
#include <power/regulator.h>
#include <power/max77686_pmic.h>
diff --git a/board/siemens/common/board.c b/board/siemens/common/board.c
index 622bde5f9f4..676935a8432 100644
--- a/board/siemens/common/board.c
+++ b/board/siemens/common/board.c
@@ -10,6 +10,7 @@
*/
#include <common.h>
+#include <env.h>
#include <errno.h>
#include <spl.h>
#include <asm/arch/cpu.h>
diff --git a/board/ti/ks2_evm/board.c b/board/ti/ks2_evm/board.c
index eed62e9cac2..e9bc68049b4 100644
--- a/board/ti/ks2_evm/board.c
+++ b/board/ti/ks2_evm/board.c
@@ -8,6 +8,7 @@
#include <common.h>
#include "board.h"
+#include <env.h>
#include <spl.h>
#include <exports.h>
#include <fdt_support.h>
diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c
index c19d7611c2f..9c86230595b 100644
--- a/board/toradex/common/tdx-cfg-block.c
+++ b/board/toradex/common/tdx-cfg-block.c
@@ -21,6 +21,7 @@
#endif
#include <cli.h>
#include <console.h>
+#include <env.h>
#include <flash.h>
#include <malloc.h>
#include <mmc.h>
diff --git a/board/varisys/cyrus/cyrus.c b/board/varisys/cyrus/cyrus.c
index 4ccce8a7361..fa02fefefa5 100644
--- a/board/varisys/cyrus/cyrus.c
+++ b/board/varisys/cyrus/cyrus.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <netdev.h>
#include <linux/compiler.h>
#include <asm/mmu.h>
diff --git a/board/work-microwave/work_92105/work_92105_display.c b/board/work-microwave/work_92105/work_92105_display.c
index ffa0fcfa874..db04dcabc7b 100644
--- a/board/work-microwave/work_92105/work_92105_display.c
+++ b/board/work-microwave/work_92105/work_92105_display.c
@@ -15,6 +15,7 @@
#include <asm/arch/cpu.h>
#include <asm/arch/emc.h>
#include <asm/gpio.h>
+#include <env.h>
#include <spi.h>
#include <i2c.h>
#include <version.h>
diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c
index 86c17dc427b..ae6006f85ff 100644
--- a/cmd/bdinfo.c
+++ b/cmd/bdinfo.c
@@ -9,6 +9,7 @@
*/
#include <common.h>
#include <command.h>
+#include <env.h>
#include <linux/compiler.h>
DECLARE_GLOBAL_DATA_PTR;
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index a45bfd139fc..f613cce7e26 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -11,6 +11,7 @@
#include <dm.h>
#include <efi_loader.h>
#include <efi_selftest.h>
+#include <env.h>
#include <errno.h>
#include <linux/libfdt.h>
#include <linux/libfdt_env.h>
diff --git a/cmd/bootm.c b/cmd/bootm.c
index 41b341e2e53..b326ac9b431 100644
--- a/cmd/bootm.c
+++ b/cmd/bootm.c
@@ -10,6 +10,7 @@
#include <common.h>
#include <bootm.h>
#include <command.h>
+#include <env.h>
#include <environment.h>
#include <errno.h>
#include <image.h>
diff --git a/cmd/bootmenu.c b/cmd/bootmenu.c
index 0ae9d5a6815..3dc2c854aca 100644
--- a/cmd/bootmenu.c
+++ b/cmd/bootmenu.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
#include <ansi.h>
+#include <env.h>
#include <menu.h>
#include <watchdog.h>
#include <malloc.h>
diff --git a/cmd/fpga.c b/cmd/fpga.c
index 9fc2df699d7..b1c7b5453b3 100644
--- a/cmd/fpga.c
+++ b/cmd/fpga.c
@@ -9,6 +9,7 @@
*/
#include <common.h>
#include <command.h>
+#include <env.h>
#include <fpga.h>
#include <fs.h>
#include <gzip.h>
diff --git a/cmd/itest.c b/cmd/itest.c
index fd6f4166f16..8b630d71e62 100644
--- a/cmd/itest.c
+++ b/cmd/itest.c
@@ -14,6 +14,7 @@
#include <common.h>
#include <config.h>
#include <command.h>
+#include <env.h>
#include <mapmem.h>
#include <asm/io.h>
diff --git a/cmd/mvebu/bubt.c b/cmd/mvebu/bubt.c
index b4d371f3056..84d2d531f0d 100644
--- a/cmd/mvebu/bubt.c
+++ b/cmd/mvebu/bubt.c
@@ -7,6 +7,7 @@
#include <config.h>
#include <common.h>
#include <command.h>
+#include <env.h>
#include <vsprintf.h>
#include <errno.h>
#include <dm.h>
diff --git a/common/bootretry.c b/common/bootretry.c
index 072055b0105..47aaaa82201 100644
--- a/common/bootretry.c
+++ b/common/bootretry.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <bootretry.h>
#include <cli.h>
+#include <env.h>
#include <errno.h>
#include <watchdog.h>
diff --git a/common/cli.c b/common/cli.c
index f4054fb1fc8..49b910666b9 100644
--- a/common/cli.c
+++ b/common/cli.c
@@ -12,6 +12,7 @@
#include <cli.h>
#include <cli_hush.h>
#include <console.h>
+#include <env.h>
#include <fdtdec.h>
#include <malloc.h>
diff --git a/common/cli_simple.c b/common/cli_simple.c
index 311880ad56a..6c881c133c6 100644
--- a/common/cli_simple.c
+++ b/common/cli_simple.c
@@ -12,6 +12,7 @@
#include <bootretry.h>
#include <cli.h>
#include <console.h>
+#include <env.h>
#include <linux/ctype.h>
#define DEBUG_PARSER 0 /* set to 1 to debug */
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 86de5b8f05b..baf7924ff61 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -7,6 +7,7 @@
*/
#include <common.h>
+#include <env.h>
#include <mapmem.h>
#include <stdio_dev.h>
#include <linux/ctype.h>
diff --git a/common/image.c b/common/image.c
index 719229cc439..4a578f3ef08 100644
--- a/common/image.c
+++ b/common/image.c
@@ -8,6 +8,7 @@
#ifndef USE_HOSTCC
#include <common.h>
+#include <env.h>
#include <watchdog.h>
#ifdef CONFIG_SHOW_BOOT_PROGRESS
diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c
index fe052236053..2a6252229ca 100644
--- a/common/spl/spl_ext.c
+++ b/common/spl/spl_ext.c
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0+
#include <common.h>
+#include <env.h>
#include <spl.h>
#include <asm/u-boot.h>
#include <ext4fs.h>
diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c
index 163e540622b..aa371ab52c5 100644
--- a/common/spl/spl_fat.c
+++ b/common/spl/spl_fat.c
@@ -9,6 +9,7 @@
*/
#include <common.h>
+#include <env.h>
#include <spl.h>
#include <asm/u-boot.h>
#include <fat.h>
diff --git a/common/splash.c b/common/splash.c
index 79d50577ee1..e15cc847b68 100644
--- a/common/splash.c
+++ b/common/splash.c
@@ -21,6 +21,7 @@
*/
#include <common.h>
+#include <env.h>
#include <splash.h>
#include <lcd.h>
diff --git a/common/splash_source.c b/common/splash_source.c
index 8f276a34ca5..d37b4b304c2 100644
--- a/common/splash_source.c
+++ b/common/splash_source.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <bmp_layout.h>
+#include <env.h>
#include <errno.h>
#include <fs.h>
#include <fdt_support.h>
diff --git a/common/usb_hub.c b/common/usb_hub.c
index 9069f4b33aa..25c2ac43450 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -24,6 +24,7 @@
#include <common.h>
#include <command.h>
#include <dm.h>
+#include <env.h>
#include <errno.h>
#include <memalign.h>
#include <asm/processor.h>
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index cc99c6be072..38737374614 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -9,6 +9,7 @@
#include <common.h>
#include <console.h>
#include <dm.h>
+#include <env.h>
#include <errno.h>
#include <malloc.h>
#include <memalign.h>
diff --git a/disk/part.c b/disk/part.c
index 7e842147317..8982ef3baed 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <errno.h>
#include <ide.h>
#include <malloc.h>
diff --git a/disk/part_amiga.c b/disk/part_amiga.c
index 86d008d476e..5a2bb718b59 100644
--- a/disk/part_amiga.c
+++ b/disk/part_amiga.c
@@ -6,6 +6,7 @@
*/
#include <common.h>
#include <command.h>
+#include <env.h>
#include <ide.h>
#include "part_amiga.h"
diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
index 318949529b3..d2b67b18cf0 100644
--- a/drivers/dfu/dfu.c
+++ b/drivers/dfu/dfu.c
@@ -7,6 +7,7 @@
*/
#include <common.h>
+#include <env.h>
#include <errno.h>
#include <malloc.h>
#include <mmc.h>
diff --git a/drivers/fastboot/fb_common.c b/drivers/fastboot/fb_common.c
index 17eca73be02..e76af8ecc32 100644
--- a/drivers/fastboot/fb_common.c
+++ b/drivers/fastboot/fb_common.c
@@ -11,6 +11,7 @@
*/
#include <common.h>
+#include <env.h>
#include <fastboot.h>
#include <net/fastboot.h>
diff --git a/drivers/fastboot/fb_getvar.c b/drivers/fastboot/fb_getvar.c
index ebe5c8a1043..95cb4341895 100644
--- a/drivers/fastboot/fb_getvar.c
+++ b/drivers/fastboot/fb_getvar.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <env.h>
#include <fastboot.h>
#include <fastboot-internal.h>
#include <fb_mmc.h>
diff --git a/drivers/fastboot/fb_mmc.c b/drivers/fastboot/fb_mmc.c
index 0a335db3a61..b0b19c57625 100644
--- a/drivers/fastboot/fb_mmc.c
+++ b/drivers/fastboot/fb_mmc.c
@@ -6,6 +6,7 @@
#include <config.h>
#include <common.h>
#include <blk.h>
+#include <env.h>
#include <fastboot.h>
#include <fastboot-internal.h>
#include <fb_mmc.h>
diff --git a/drivers/input/i8042.c b/drivers/input/i8042.c
index 9a5dc46207c..98015899f21 100644
--- a/drivers/input/i8042.c
+++ b/drivers/input/i8042.c
@@ -8,6 +8,7 @@
#include <common.h>
#include <dm.h>
+#include <env.h>
#include <errno.h>
#include <i8042.h>
#include <input.h>
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 4f514dba56d..6ab378b979b 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -9,6 +9,7 @@
#include <common.h>
#include <console.h>
#include <dm.h>
+#include <env.h>
#include <errno.h>
#include <stdio_dev.h>
#include <input.h>
diff --git a/drivers/misc/fs_loader.c b/drivers/misc/fs_loader.c
index f42eeff8f63..88e486e9d57 100644
--- a/drivers/misc/fs_loader.c
+++ b/drivers/misc/fs_loader.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
#include <dm.h>
+#include <env.h>
#include <errno.h>
#include <blk.h>
#include <fs.h>
diff --git a/drivers/net/dc2114x.c b/drivers/net/dc2114x.c
index e3c403c13fc..43c2253f10d 100644
--- a/drivers/net/dc2114x.c
+++ b/drivers/net/dc2114x.c
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0+
#include <common.h>
+#include <env.h>
#include <malloc.h>
#include <net.h>
#include <netdev.h>
diff --git a/drivers/net/fm/fdt.c b/drivers/net/fm/fdt.c
index 61257971258..72d12947514 100644
--- a/drivers/net/fm/fdt.c
+++ b/drivers/net/fm/fdt.c
@@ -3,6 +3,7 @@
* Copyright 2016 Freescale Semiconductor, Inc.
*/
#include <asm/io.h>
+#include <env.h>
#include <fsl_qe.h> /* For struct qe_firmware */
#ifdef CONFIG_SYS_DPAA_FMAN
diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c
index cc59b21f9f4..1d96e4bdc2f 100644
--- a/drivers/net/fsl-mc/mc.c
+++ b/drivers/net/fsl-mc/mc.c
@@ -5,6 +5,7 @@
* Copyright 2017-2018 NXP
*/
#include <common.h>
+#include <env.h>
#include <errno.h>
#include <linux/bug.h>
#include <asm/io.h>
diff --git a/drivers/net/fsl_mcdmafec.c b/drivers/net/fsl_mcdmafec.c
index 88309b186cd..41752c0b6af 100644
--- a/drivers/net/fsl_mcdmafec.c
+++ b/drivers/net/fsl_mcdmafec.c
@@ -8,6 +8,7 @@
*/
#include <common.h>
+#include <env.h>
#include <environment.h>
#include <malloc.h>
#include <command.h>
diff --git a/drivers/net/ftmac100.c b/drivers/net/ftmac100.c
index c08889c4b11..d8f1dde6579 100644
--- a/drivers/net/ftmac100.c
+++ b/drivers/net/ftmac100.c
@@ -8,6 +8,7 @@
#include <config.h>
#include <common.h>
+#include <env.h>
#include <malloc.h>
#include <net.h>
#include <linux/io.h>
diff --git a/drivers/net/mcffec.c b/drivers/net/mcffec.c
index 2b54e3a5499..a8553cbbc2f 100644
--- a/drivers/net/mcffec.c
+++ b/drivers/net/mcffec.c
@@ -8,6 +8,7 @@
*/
#include <common.h>
+#include <env.h>
#include <environment.h>
#include <malloc.h>
diff --git a/drivers/net/phy/micrel_ksz90x1.c b/drivers/net/phy/micrel_ksz90x1.c
index f18e40a2fea..0105fc5af1e 100644
--- a/drivers/net/phy/micrel_ksz90x1.c
+++ b/drivers/net/phy/micrel_ksz90x1.c
@@ -10,6 +10,7 @@
*/
#include <common.h>
#include <dm.h>
+#include <env.h>
#include <errno.h>
#include <micrel.h>
#include <phy.h>
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
index 2d5c97062fd..e2ca4749f70 100644
--- a/drivers/net/sh_eth.c
+++ b/drivers/net/sh_eth.c
@@ -10,6 +10,7 @@
#include <config.h>
#include <common.h>
+#include <env.h>
#include <environment.h>
#include <malloc.h>
#include <net.h>
diff --git a/drivers/pci/fsl_pci_init.c b/drivers/pci/fsl_pci_init.c
index b4c85566861..ab5e49941f3 100644
--- a/drivers/pci/fsl_pci_init.c
+++ b/drivers/pci/fsl_pci_init.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <env.h>
#include <malloc.h>
#include <asm/fsl_serdes.h>
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index e2195726c8a..5db24f1c51d 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -17,6 +17,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <errno.h>
#include <asm/processor.h>
#include <asm/io.h>
diff --git a/drivers/pci/pci_common.c b/drivers/pci/pci_common.c
index 9f2d2678e37..5231b69dc9a 100644
--- a/drivers/pci/pci_common.c
+++ b/drivers/pci/pci_common.c
@@ -11,6 +11,7 @@
#include <common.h>
#include <dm.h>
+#include <env.h>
#include <errno.h>
#include <pci.h>
#include <asm/io.h>
diff --git a/drivers/reset/reset-socfpga.c b/drivers/reset/reset-socfpga.c
index 822a3fe2659..93ec9cfdb64 100644
--- a/drivers/reset/reset-socfpga.c
+++ b/drivers/reset/reset-socfpga.c
@@ -16,6 +16,7 @@
#include <dm.h>
#include <dm/lists.h>
#include <dm/of_access.h>
+#include <env.h>
#include <reset-uclass.h>
#include <linux/bitops.h>
#include <linux/io.h>
diff --git a/drivers/rtc/m41t60.c b/drivers/rtc/m41t60.c
index c84c8e11b3b..532d2105e12 100644
--- a/drivers/rtc/m41t60.c
+++ b/drivers/rtc/m41t60.c
@@ -17,6 +17,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <rtc.h>
#include <i2c.h>
diff --git a/drivers/serial/usbtty.c b/drivers/serial/usbtty.c
index d0465b844ed..76d9c8a3a6d 100644
--- a/drivers/serial/usbtty.c
+++ b/drivers/serial/usbtty.c
@@ -10,6 +10,7 @@
#include <common.h>
#include <config.h>
#include <circbuf.h>
+#include <env.h>
#include <stdio_dev.h>
#include <asm/unaligned.h>
#include "usbtty.h"
diff --git a/drivers/usb/gadget/designware_udc.c b/drivers/usb/gadget/designware_udc.c
index fa947dade68..432f312cee4 100644
--- a/drivers/usb/gadget/designware_udc.c
+++ b/drivers/usb/gadget/designware_udc.c
@@ -10,6 +10,7 @@
#include <common.h>
#include <asm/io.h>
+#include <env.h>
#include <usbdevice.h>
#include "ep0.h"
#include <usb/designware_udc.h>
diff --git a/drivers/usb/gadget/f_dfu.c b/drivers/usb/gadget/f_dfu.c
index e27f1466052..67561551330 100644
--- a/drivers/usb/gadget/f_dfu.c
+++ b/drivers/usb/gadget/f_dfu.c
@@ -14,6 +14,7 @@
* (C) Copyright 2006 by Harald Welte <hwelte at hmw-consulting.de>
*/
+#include <env.h>
#include <errno.h>
#include <common.h>
#include <malloc.h>
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index 3ad4346f2d0..fc27dbe8de4 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -11,6 +11,7 @@
*/
#include <config.h>
#include <common.h>
+#include <env.h>
#include <errno.h>
#include <fastboot.h>
#include <malloc.h>
diff --git a/drivers/usb/gadget/f_rockusb.c b/drivers/usb/gadget/f_rockusb.c
index f3d24772cde..1cfeabcd31a 100644
--- a/drivers/usb/gadget/f_rockusb.c
+++ b/drivers/usb/gadget/f_rockusb.c
@@ -6,6 +6,7 @@
*/
#include <config.h>
#include <common.h>
+#include <env.h>
#include <errno.h>
#include <malloc.h>
#include <memalign.h>
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index b8f8e7a794f..ced295ef0fa 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -8,6 +8,7 @@
*/
#include <common.h>
+#include <env.h>
#include <pci.h>
#include <usb.h>
#include <asm/io.h>
diff --git a/drivers/video/ati_radeon_fb.c b/drivers/video/ati_radeon_fb.c
index 87557e52c07..6fce0336369 100644
--- a/drivers/video/ati_radeon_fb.c
+++ b/drivers/video/ati_radeon_fb.c
@@ -19,6 +19,7 @@
#include <command.h>
#include <bios_emul.h>
+#include <env.h>
#include <pci.h>
#include <asm/processor.h>
#include <linux/errno.h>
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index ac02921d463..e5c077e4f52 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -65,6 +65,7 @@
*/
#include <common.h>
+#include <env.h>
#include <fdtdec.h>
#include <gzip.h>
#include <version.h>
diff --git a/drivers/video/mb862xx.c b/drivers/video/mb862xx.c
index 1a3c970b3d7..301c1f0df17 100644
--- a/drivers/video/mb862xx.c
+++ b/drivers/video/mb862xx.c
@@ -12,6 +12,7 @@
#include <common.h>
#include <asm/io.h>
+#include <env.h>
#include <pci.h>
#include <video_fb.h>
#include "videomodes.h"
diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c
index 176ae70b7ce..a984443ef9d 100644
--- a/drivers/video/mx3fb.c
+++ b/drivers/video/mx3fb.c
@@ -6,6 +6,7 @@
* HALE electronic GmbH, <helmut.raiger@hale.at>
*/
#include <common.h>
+#include <env.h>
#include <malloc.h>
#include <video_fb.h>
diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index 6c9a7c05e82..6922a130c61 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -6,6 +6,7 @@
*/
#include <common.h>
#include <dm.h>
+#include <env.h>
#include <linux/errno.h>
#include <malloc.h>
#include <video.h>
diff --git a/drivers/video/videomodes.c b/drivers/video/videomodes.c
index d7614329ffe..ac25b45f819 100644
--- a/drivers/video/videomodes.c
+++ b/drivers/video/videomodes.c
@@ -58,6 +58,7 @@
#include <common.h>
#include <edid.h>
+#include <env.h>
#include <errno.h>
#include <linux/ctype.h>
diff --git a/env/callback.c b/env/callback.c
index 54d2de4a962..95be80d4542 100644
--- a/env/callback.c
+++ b/env/callback.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <env.h>
#include <environment.h>
#if defined(CONFIG_NEEDS_MANUAL_RELOC)
diff --git a/env/eeprom.c b/env/eeprom.c
index ac2689cc148..8d82cf892ce 100644
--- a/env/eeprom.c
+++ b/env/eeprom.c
@@ -9,6 +9,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <environment.h>
#include <linux/stddef.h>
#if defined(CONFIG_I2C_ENV_EEPROM_BUS)
diff --git a/env/nvram.c b/env/nvram.c
index df1b37913d5..a5b1873aaff 100644
--- a/env/nvram.c
+++ b/env/nvram.c
@@ -25,6 +25,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <environment.h>
#include <linux/stddef.h>
#include <search.h>
diff --git a/include/common.h b/include/common.h
index 739bbd400a4..70f40daa9ee 100644
--- a/include/common.h
+++ b/include/common.h
@@ -145,18 +145,6 @@ int do_fat_fsload(cmd_tbl_t *, int, int, char * const []);
/* common/cmd_ext2.c */
int do_ext2load(cmd_tbl_t *, int, int, char * const []);
-/**
- * env_get() - Look up the value of an environment variable
- *
- * In U-Boot proper this can be called before relocation (which is when the
- * environment is loaded from storage, i.e. GD_FLG_ENV_READY is 0). In that
- * case this function calls env_get_f().
- *
- * @varname: Variable to look up
- * @return value of variable, or NULL if not found
- */
-char *env_get(const char *varname);
-
void pci_init_board(void);
/* common/exports.c */
diff --git a/include/env.h b/include/env.h
index 6770a6176df..297fd7a071f 100644
--- a/include/env.h
+++ b/include/env.h
@@ -52,6 +52,18 @@ void env_relocate(void);
int env_match(unsigned char *name, int index);
/**
+ * env_get() - Look up the value of an environment variable
+ *
+ * In U-Boot proper this can be called before relocation (which is when the
+ * environment is loaded from storage, i.e. GD_FLG_ENV_READY is 0). In that
+ * case this function calls env_get_f().
+ *
+ * @varname: Variable to look up
+ * @return value of variable, or NULL if not found
+ */
+char *env_get(const char *varname);
+
+/**
* env_get_f() - Look up the value of an environment variable (early)
*
* This function is called from env_get() if the environment has not been
diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
index 6c8229da42a..d4765afb984 100644
--- a/lib/efi_loader/efi_console.c
+++ b/lib/efi_loader/efi_console.c
@@ -9,6 +9,7 @@
#include <charset.h>
#include <dm/device.h>
#include <efi_loader.h>
+#include <env.h>
#include <stdio_dev.h>
#include <video_console.h>
diff --git a/lib/smbios.c b/lib/smbios.c
index e8ee55c4aeb..7b74971f687 100644
--- a/lib/smbios.c
+++ b/lib/smbios.c
@@ -6,6 +6,7 @@
*/
#include <common.h>
+#include <env.h>
#include <mapmem.h>
#include <smbios.h>
#include <tables_csum.h>
diff --git a/net/link_local.c b/net/link_local.c
index 31cdef4083a..dd9fcad0874 100644
--- a/net/link_local.c
+++ b/net/link_local.c
@@ -12,6 +12,7 @@
*/
#include <common.h>
+#include <env.h>
#include <net.h>
#include "arp.h"
#include "net_rand.h"
diff --git a/net/tftp.c b/net/tftp.c
index 34488b76c84..5a69bca6413 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -9,6 +9,7 @@
#include <common.h>
#include <command.h>
#include <efi_loader.h>
+#include <env.h>
#include <mapmem.h>
#include <net.h>
#include <net/tftp.h>