diff --git a/api/api.c b/api/api.c index 9f03f1a35bb2511fd8a69a615c91e05d991a90e6..8a41b7cce771c66dc175149703b8b4bd8afea151 100644 --- a/api/api.c +++ b/api/api.c @@ -8,6 +8,7 @@ #include <config.h> #include <command.h> #include <common.h> +#include <env.h> #include <malloc.h> #include <environment.h> #include <linux/types.h> diff --git a/arch/arm/mach-tegra/cboot.c b/arch/arm/mach-tegra/cboot.c index a829ef794f2df61cdc909b17bf9a09c4e15c9e84..bd4f33686da02a4f69de14ece05a7ee142994589 100644 --- a/arch/arm/mach-tegra/cboot.c +++ b/arch/arm/mach-tegra/cboot.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <env.h> #include <environment.h> #include <fdt_support.h> #include <fdtdec.h> diff --git a/arch/arm/mach-uniphier/board_late_init.c b/arch/arm/mach-uniphier/board_late_init.c index 3180b24330b4d788734c90cf90ee977b71e61cc1..14b61fc7dfda80c3e2502258ba07fda04eac8aaa 100644 --- a/arch/arm/mach-uniphier/board_late_init.c +++ b/arch/arm/mach-uniphier/board_late_init.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <env.h> #include <spl.h> #include <linux/libfdt.h> #include <nand.h> diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c index 89087d7dba00dd5478f2b3d59646a934abadada4..148fc9075e4fffb098b6e61d599ff66d0bcc71c3 100644 --- a/board/BuR/common/common.c +++ b/board/BuR/common/common.c @@ -10,6 +10,7 @@ */ #include <version.h> #include <common.h> +#include <env.h> #include <fdtdec.h> #include <i2c.h> #include <lcd.h> diff --git a/board/boundary/nitrogen6x/nitrogen6x.c b/board/boundary/nitrogen6x/nitrogen6x.c index 867eade4bd32551f2337e4f68c39ed12df1b7925..26af3f710250e506ad10e9c797bc46b07c2c61ae 100644 --- a/board/boundary/nitrogen6x/nitrogen6x.c +++ b/board/boundary/nitrogen6x/nitrogen6x.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <env.h> #include <asm/io.h> #include <asm/arch/clock.h> #include <asm/arch/imx-regs.h> diff --git a/board/broadcom/bcmstb/bcmstb.c b/board/broadcom/bcmstb/bcmstb.c index 7f8e0f951d47b15426005bcecffcb3ccb061a378..5fc2c0591b84159b2bea60774517585d273e7b1a 100644 --- a/board/broadcom/bcmstb/bcmstb.c +++ b/board/broadcom/bcmstb/bcmstb.c @@ -8,6 +8,7 @@ #include <linux/types.h> #include <common.h> +#include <env.h> #include <asm/io.h> #include <asm/bootm.h> #include <mach/timer.h> diff --git a/board/emulation/qemu-riscv/qemu-riscv.c b/board/emulation/qemu-riscv/qemu-riscv.c index d6167aaef153ddee8fbba9af19f277b49ac20cf1..49e304f7eb0e1927fb1f973363d9a921a8f6e4f9 100644 --- a/board/emulation/qemu-riscv/qemu-riscv.c +++ b/board/emulation/qemu-riscv/qemu-riscv.c @@ -5,6 +5,7 @@ #include <common.h> #include <dm.h> +#include <env.h> #include <fdtdec.h> #include <virtio_types.h> #include <virtio.h> diff --git a/board/freescale/qemu-ppce500/qemu-ppce500.c b/board/freescale/qemu-ppce500/qemu-ppce500.c index 42a6b5427abb40b6a5e649b9042f9911b5915e75..fb36d8366c98b6b9eb2deba59cb02ee3e9c19af8 100644 --- a/board/freescale/qemu-ppce500/qemu-ppce500.c +++ b/board/freescale/qemu-ppce500/qemu-ppce500.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/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index 617c892dde0f7df7397129d754225d43be18a9ab..104589bff16b7cc98c7b6b5e8d05d0aaa589ed17 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -6,6 +6,7 @@ #include <common.h> #include <config.h> #include <dm.h> +#include <env.h> #include <environment.h> #include <efi_loader.h> #include <fdt_support.h> diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 98bc3cd0c13cd5c03a4e404a4079957a526ec83b..bb425cbf66da3ed1c9029ba5f5e2bbfc1823d0f1 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -12,6 +12,7 @@ #include <common.h> #include <dm.h> +#include <env.h> #include <mmc.h> #include <axp_pmic.h> #include <generic-phy.h> diff --git a/board/xilinx/zynqmp/cmds.c b/board/xilinx/zynqmp/cmds.c index 321670d4e3eaada1392640e819d59284a1fa65c9..ed7ba58c6475ad9a1b6961e90fd647ac66573bf8 100644 --- a/board/xilinx/zynqmp/cmds.c +++ b/board/xilinx/zynqmp/cmds.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <env.h> #include <malloc.h> #include <asm/arch/hardware.h> #include <asm/arch/sys_proto.h> diff --git a/cmd/cbfs.c b/cmd/cbfs.c index c118a952ac20ae93dd8ca5512f94f92731a6ea58..3d1fc959720f09c5d33c9d9f41bc179f9bd60acb 100644 --- a/cmd/cbfs.c +++ b/cmd/cbfs.c @@ -8,6 +8,7 @@ */ #include <common.h> #include <command.h> +#include <env.h> #include <cbfs.h> static int do_cbfs_init(cmd_tbl_t *cmdtp, int flag, int argc, diff --git a/cmd/cramfs.c b/cmd/cramfs.c index 598028cfadbdedbae33933a2387da55a87818f69..2188910b2a77833c393ed113c84176cffd1dbdf3 100644 --- a/cmd/cramfs.c +++ b/cmd/cramfs.c @@ -12,6 +12,7 @@ */ #include <common.h> #include <command.h> +#include <env.h> #include <malloc.h> #include <mapmem.h> #include <linux/list.h> diff --git a/cmd/fdt.c b/cmd/fdt.c index 10d8f3230bb009224b91d88722632e9b810598ed..25a6ed40d203aa10ca33113c43e144d5867015c8 100644 --- a/cmd/fdt.c +++ b/cmd/fdt.c @@ -9,6 +9,7 @@ #include <common.h> #include <command.h> +#include <env.h> #include <linux/ctype.h> #include <linux/types.h> #include <asm/global_data.h> diff --git a/cmd/jffs2.c b/cmd/jffs2.c index 64621f2546602af59bcf862d7628b04ae50f64f2..b47cd3d98930a4a80ee4fbdc55d4afaad036c795 100644 --- a/cmd/jffs2.c +++ b/cmd/jffs2.c @@ -72,6 +72,7 @@ */ #include <common.h> #include <command.h> +#include <env.h> #include <malloc.h> #include <jffs2/jffs2.h> #include <linux/list.h> diff --git a/cmd/load.c b/cmd/load.c index dd1e8dac13b2b76fc528a29e92a99fbfed2dd8d9..713fe56b5557a08a2886f966216ed93f9a5ab2c7 100644 --- a/cmd/load.c +++ b/cmd/load.c @@ -10,6 +10,7 @@ #include <common.h> #include <command.h> #include <console.h> +#include <env.h> #include <s_record.h> #include <net.h> #include <exports.h> diff --git a/cmd/lzmadec.c b/cmd/lzmadec.c index 6860b5f75856bf23b33e90eb4b56712e7c921c5a..e3b9cc75ac2b9a90a383baa1e7e3b3b4f87ea2d8 100644 --- a/cmd/lzmadec.c +++ b/cmd/lzmadec.c @@ -11,6 +11,7 @@ #include <common.h> #include <command.h> +#include <env.h> #include <mapmem.h> #include <asm/io.h> diff --git a/cmd/nand.c b/cmd/nand.c index 899d504533752a581f3b8c4f417c2bef35a41b2d..27efef20bc95c0962a62c473521b9cb861fd2166 100644 --- a/cmd/nand.c +++ b/cmd/nand.c @@ -23,6 +23,7 @@ #include <linux/mtd/mtd.h> #include <command.h> #include <console.h> +#include <env.h> #include <watchdog.h> #include <malloc.h> #include <asm/byteorder.h> diff --git a/cmd/reiser.c b/cmd/reiser.c index 2c0bca1c54f9637cb6bd6bf722bcb6fe272ef56d..7f51b927a47548c074390cbab4939e98a9f5d498 100644 --- a/cmd/reiser.c +++ b/cmd/reiser.c @@ -11,6 +11,7 @@ #include <common.h> #include <config.h> #include <command.h> +#include <env.h> #include <image.h> #include <linux/ctype.h> #include <asm/byteorder.h> diff --git a/cmd/setexpr.c b/cmd/setexpr.c index 1a6cecdedacd2a44130c49b63f5adf8ea26780b3..0182f1993846cdb4f6d027c6ddf7e6707d7b2d99 100644 --- a/cmd/setexpr.c +++ b/cmd/setexpr.c @@ -11,6 +11,7 @@ #include <common.h> #include <config.h> #include <command.h> +#include <env.h> #include <mapmem.h> static ulong get_arg(char *s, int w) diff --git a/cmd/spl.c b/cmd/spl.c index 038f48818d9403762c3fad4a6aee83b823639212..56051b8a4be926c8882b7a7e4909816375bf84b0 100644 --- a/cmd/spl.c +++ b/cmd/spl.c @@ -7,6 +7,7 @@ #include <common.h> #include <command.h> #include <cmd_spl.h> +#include <env.h> #include <linux/libfdt.h> DECLARE_GLOBAL_DATA_PTR; diff --git a/cmd/tpm-v1.c b/cmd/tpm-v1.c index b75e0933a1c0c50e74db8537cf4d8e8a84c2b86e..2807331524aa811d10d17357406baae2f3f5d535 100644 --- a/cmd/tpm-v1.c +++ b/cmd/tpm-v1.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <env.h> #include <malloc.h> #include <asm/unaligned.h> #include <tpm-common.h> diff --git a/cmd/trace.c b/cmd/trace.c index 7d328f88be518f64ecf60da928d90bdac8ebe4fc..392b129536176dbbbfb097f7751199d50442591c 100644 --- a/cmd/trace.c +++ b/cmd/trace.c @@ -5,6 +5,7 @@ #include <common.h> #include <command.h> +#include <env.h> #include <mapmem.h> #include <trace.h> #include <asm/io.h> diff --git a/cmd/ubi.c b/cmd/ubi.c index c511a2fb7601f8d49b2a4353b48f289f04d23770..ca5dc9021b128d1b57bb338a0272a51ea35cd393 100644 --- a/cmd/ubi.c +++ b/cmd/ubi.c @@ -13,6 +13,7 @@ #include <common.h> #include <command.h> +#include <env.h> #include <exports.h> #include <memalign.h> #include <mtd.h> diff --git a/cmd/unzip.c b/cmd/unzip.c index 8474d9becf8c5d2edc1211b34b934641632c932c..afd58e7cdb12757c3cf333919e2087d711213ecd 100644 --- a/cmd/unzip.c +++ b/cmd/unzip.c @@ -6,6 +6,7 @@ #include <common.h> #include <command.h> +#include <env.h> #include <gzip.h> static int do_unzip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) diff --git a/cmd/ximg.c b/cmd/ximg.c index 920a80edc88036d6d7aca6985efc5fcd5df5cb17..a9481004f0369ebf95ebf4b6ee9f6fd25b806f9d 100644 --- a/cmd/ximg.c +++ b/cmd/ximg.c @@ -13,6 +13,7 @@ */ #include <common.h> #include <command.h> +#include <env.h> #include <gzip.h> #include <image.h> #include <mapmem.h> diff --git a/cmd/zfs.c b/cmd/zfs.c index 384ac4c9396cc288c5169aaac2210f49321849fd..ed5402bb139e541d78528b68b4a80259f994fd1f 100644 --- a/cmd/zfs.c +++ b/cmd/zfs.c @@ -12,6 +12,7 @@ #include <part.h> #include <config.h> #include <command.h> +#include <env.h> #include <image.h> #include <linux/ctype.h> #include <asm/byteorder.h> diff --git a/cmd/zip.c b/cmd/zip.c index 9cd400a7e80f2053edfa7054a164b44c971ebf90..8ef46e9815f7fd173eecb90d5177bd2f30dc9201 100644 --- a/cmd/zip.c +++ b/cmd/zip.c @@ -6,6 +6,7 @@ #include <common.h> #include <command.h> +#include <env.h> static int do_zip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { diff --git a/common/autoboot.c b/common/autoboot.c index 7a91736a00fc200007aec2fa27ac528885177e44..b28bd6823d824e73557b64b66fd6ad202ad8a592 100644 --- a/common/autoboot.c +++ b/common/autoboot.c @@ -9,6 +9,7 @@ #include <bootretry.h> #include <cli.h> #include <console.h> +#include <env.h> #include <fdtdec.h> #include <hash.h> #include <memalign.h> diff --git a/common/bootm.c b/common/bootm.c index 4629cdd82d4acb330fbf983fa8afae153cd1f57a..02295daf79f1f6452a6e2120be64e8955b22c07c 100644 --- a/common/bootm.c +++ b/common/bootm.c @@ -7,6 +7,7 @@ #ifndef USE_HOSTCC #include <common.h> #include <bootstage.h> +#include <env.h> #include <errno.h> #include <fdt_support.h> #include <lmb.h> diff --git a/common/bootm_os.c b/common/bootm_os.c index 855c471c28e6b73ae45c4686d9a4ce93377a550a..6fb7d658da69846035f6cfbc901f6360e14c8c95 100644 --- a/common/bootm_os.c +++ b/common/bootm_os.c @@ -6,6 +6,7 @@ #include <common.h> #include <bootm.h> +#include <env.h> #include <fdt_support.h> #include <linux/libfdt.h> #include <malloc.h> diff --git a/drivers/fastboot/fb_command.c b/drivers/fastboot/fb_command.c index 200f9910c5666af794c3a3156ac97aaae15df417..4864344853c2786670b4f20a4d593ce5879eb888 100644 --- a/drivers/fastboot/fb_command.c +++ b/drivers/fastboot/fb_command.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/net/fm/fm.c b/drivers/net/fm/fm.c index 0a43dfe74e961a20d0e2f277163183899c394d79..ce0f1678fd0be22c12d6dc511bb1a17d9312d214 100644 --- a/drivers/net/fm/fm.c +++ b/drivers/net/fm/fm.c @@ -4,6 +4,7 @@ * Dave Liu <daveliu@freescale.com> */ #include <common.h> +#include <env.h> #include <malloc.h> #include <asm/io.h> #include <linux/errno.h> diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c index fab7ce6f97b202ed1881c34c57937bdbd11a515d..bcd1c5d47c107d2c06fdabdb44fd2e73d405434c 100644 --- a/drivers/usb/gadget/f_sdp.c +++ b/drivers/usb/gadget/f_sdp.c @@ -19,6 +19,7 @@ #include <errno.h> #include <common.h> #include <console.h> +#include <env.h> #include <malloc.h> #include <linux/usb/ch9.h> diff --git a/fs/fs.c b/fs/fs.c index 48d8f1f6dab88ada6d4debf1cd51d299300c783d..d8a4ced4698ec97b2b6c5e7d11959b94f6545dee 100644 --- a/fs/fs.c +++ b/fs/fs.c @@ -6,6 +6,7 @@ #include <config.h> #include <errno.h> #include <common.h> +#include <env.h> #include <mapmem.h> #include <part.h> #include <ext4fs.h> diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c index 72e8a24d3b9aef161c0bc6ea758cf54536cc62ec..67a0e8caae709759a88c6b93657d1803e0aca5a4 100644 --- a/fs/ubifs/ubifs.c +++ b/fs/ubifs/ubifs.c @@ -12,6 +12,7 @@ */ #include <common.h> +#include <env.h> #include <gzip.h> #include <memalign.h> #include "ubifs.h" diff --git a/include/common.h b/include/common.h index 26ec18ded4700b95651da44a1880a4876803be25..100eac6e5e97ff7621a93ddf424329ef91936386 100644 --- a/include/common.h +++ b/include/common.h @@ -209,27 +209,6 @@ int env_set(const char *varname, const char *value); */ int env_set_ulong(const char *varname, ulong value); -/** - * env_set_hex() - set an environment variable to a hex value - * - * @varname: Variable to adjust - * @value: Value to set for the variable (will be converted to a hex string) - * @return 0 if OK, 1 on error - */ -int env_set_hex(const char *varname, ulong value); - -/** - * env_set_addr - Set an environment variable to an address in hex - * - * @varname: Environment variable to set - * @addr: Value to set it to - * @return 0 if ok, 1 on error - */ -static inline int env_set_addr(const char *varname, const void *addr) -{ - return env_set_hex(varname, (ulong)addr); -} - void pci_init_board(void); /* common/exports.c */ diff --git a/include/env.h b/include/env.h index bf34ac3f8620c9a9174ee3f015dced0ebbb0deff..5c780f30d619b729053f1d1e50079fa3533b7845 100644 --- a/include/env.h +++ b/include/env.h @@ -10,6 +10,7 @@ #define __ENV_H #include <stdbool.h> +#include <linux/types.h> /** * env_get_id() - Gets a sequence number for the environment @@ -62,6 +63,27 @@ int env_match(unsigned char *name, int index); */ int env_get_f(const char *name, char *buf, unsigned int len); +/** + * env_set_hex() - set an environment variable to a hex value + * + * @varname: Variable to adjust + * @value: Value to set for the variable (will be converted to a hex string) + * @return 0 if OK, 1 on error + */ +int env_set_hex(const char *varname, ulong value); + +/** + * env_set_addr - Set an environment variable to an address in hex + * + * @varname: Environment variable to set + * @addr: Value to set it to + * @return 0 if ok, 1 on error + */ +static inline int env_set_addr(const char *varname, const void *addr) +{ + return env_set_hex(varname, (ulong)addr); +} + /** * env_complete() - return an auto-complete for environment variables * diff --git a/net/net.c b/net/net.c index 58b0417cbe9401a7e267d73b286bdfc9dd04cbdb..1a175c45973dc0f57d65a8698f27b7f0c21cafb2 100644 --- a/net/net.c +++ b/net/net.c @@ -90,6 +90,7 @@ #include <common.h> #include <command.h> #include <console.h> +#include <env.h> #include <environment.h> #include <errno.h> #include <net.h>