env: Move env_set_hex() to env.h

Move env_set_hex() over to the new header file along with env_set_addr()
which uses it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
Simon Glass 2019-08-01 09:46:46 -06:00 committed by Tom Rini
parent b9ca02c2d5
commit c7694dd483
39 changed files with 59 additions and 21 deletions

View File

@ -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>

View File

@ -4,6 +4,7 @@
*/
#include <common.h>
#include <env.h>
#include <environment.h>
#include <fdt_support.h>
#include <fdtdec.h>

View File

@ -6,6 +6,7 @@
*/
#include <common.h>
#include <env.h>
#include <spl.h>
#include <linux/libfdt.h>
#include <nand.h>

View File

@ -10,6 +10,7 @@
*/
#include <version.h>
#include <common.h>
#include <env.h>
#include <fdtdec.h>
#include <i2c.h>
#include <lcd.h>

View File

@ -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>

View File

@ -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>

View File

@ -5,6 +5,7 @@
#include <common.h>
#include <dm.h>
#include <env.h>
#include <fdtdec.h>
#include <virtio_types.h>
#include <virtio.h>

View File

@ -5,6 +5,7 @@
#include <common.h>
#include <command.h>
#include <env.h>
#include <pci.h>
#include <asm/processor.h>
#include <asm/mmu.h>

View File

@ -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>

View File

@ -12,6 +12,7 @@
#include <common.h>
#include <dm.h>
#include <env.h>
#include <mmc.h>
#include <axp_pmic.h>
#include <generic-phy.h>

View File

@ -5,6 +5,7 @@
*/
#include <common.h>
#include <env.h>
#include <malloc.h>
#include <asm/arch/hardware.h>
#include <asm/arch/sys_proto.h>

View File

@ -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,

View File

@ -12,6 +12,7 @@
*/
#include <common.h>
#include <command.h>
#include <env.h>
#include <malloc.h>
#include <mapmem.h>
#include <linux/list.h>

View File

@ -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>

View File

@ -72,6 +72,7 @@
*/
#include <common.h>
#include <command.h>
#include <env.h>
#include <malloc.h>
#include <jffs2/jffs2.h>
#include <linux/list.h>

View File

@ -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>

View File

@ -11,6 +11,7 @@
#include <common.h>
#include <command.h>
#include <env.h>
#include <mapmem.h>
#include <asm/io.h>

View File

@ -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>

View File

@ -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>

View File

@ -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)

View File

@ -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;

View File

@ -4,6 +4,7 @@
*/
#include <common.h>
#include <env.h>
#include <malloc.h>
#include <asm/unaligned.h>
#include <tpm-common.h>

View File

@ -5,6 +5,7 @@
#include <common.h>
#include <command.h>
#include <env.h>
#include <mapmem.h>
#include <trace.h>
#include <asm/io.h>

View File

@ -13,6 +13,7 @@
#include <common.h>
#include <command.h>
#include <env.h>
#include <exports.h>
#include <memalign.h>
#include <mtd.h>

View File

@ -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[])

View File

@ -13,6 +13,7 @@
*/
#include <common.h>
#include <command.h>
#include <env.h>
#include <gzip.h>
#include <image.h>
#include <mapmem.h>

View File

@ -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>

View File

@ -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[])
{

View File

@ -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>

View File

@ -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>

View File

@ -6,6 +6,7 @@
#include <common.h>
#include <bootm.h>
#include <env.h>
#include <fdt_support.h>
#include <linux/libfdt.h>
#include <malloc.h>

View File

@ -4,6 +4,7 @@
*/
#include <common.h>
#include <env.h>
#include <fastboot.h>
#include <fastboot-internal.h>
#include <fb_mmc.h>

View File

@ -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>

View File

@ -19,6 +19,7 @@
#include <errno.h>
#include <common.h>
#include <console.h>
#include <env.h>
#include <malloc.h>
#include <linux/usb/ch9.h>

View File

@ -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>

View File

@ -12,6 +12,7 @@
*/
#include <common.h>
#include <env.h>
#include <gzip.h>
#include <memalign.h>
#include "ubifs.h"

View File

@ -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 */

View File

@ -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
*

View File

@ -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>