]> git.sur5r.net Git - u-boot/commitdiff
env: Rename setenv() to env_set()
authorSimon Glass <sjg@chromium.org>
Thu, 3 Aug 2017 18:22:09 +0000 (12:22 -0600)
committerTom Rini <trini@konsulko.com>
Wed, 16 Aug 2017 12:22:18 +0000 (08:22 -0400)
We are now using an env_ prefix for environment functions. Rename setenv()
for consistency. Also add function comments in common.h.

Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
156 files changed:
api/api.c
arch/arm/cpu/armv7/vf610/generic.c
arch/arm/lib/semihosting.c
arch/arm/mach-imx/mx6/opos6ul.c
arch/arm/mach-imx/mx7/soc.c
arch/arm/mach-omap2/boot-common.c
arch/arm/mach-omap2/utils.c
arch/arm/mach-rockchip/rk3036-board.c
arch/arm/mach-rockchip/rk322x-board.c
arch/arm/mach-rockchip/rk3288-board.c
arch/arm/mach-socfpga/misc_gen5.c
arch/arm/mach-tegra/board2.c
arch/arm/mach-tegra/tegra186/nvtboot_board.c
arch/arm/mach-uniphier/board_late_init.c
board/Arcturus/ucp1020/cmd_arc.c
board/Arcturus/ucp1020/ucp1020.c
board/BuR/brppt1/board.c
board/BuR/brxre1/board.c
board/BuR/common/common.c
board/CZ.NIC/turris_omnia/turris_omnia.c
board/Synology/ds414/cmd_syno.c
board/amazon/kc1/kc1.c
board/amlogic/odroid-c2/odroid-c2.c
board/aries/ma5d4evk/ma5d4evk.c
board/aristainetos/aristainetos-v2.c
board/armltd/integrator/integrator.c
board/atmel/sama5d3xek/sama5d3xek.c
board/bachmann/ot1200/ot1200.c
board/birdland/bav335x/board.c
board/bosch/shc/board.c
board/boundary/nitrogen6x/nitrogen6x.c
board/buffalo/lsxl/lsxl.c
board/cadence/xtfpga/xtfpga.c
board/ccv/xpress/xpress.c
board/congatec/cgtqmx6eval/cgtqmx6eval.c
board/cssi/MCR3000/MCR3000.c
board/davinci/da8xxevm/omapl138_lcdk.c
board/el/el6x/el6x.c
board/engicam/common/board.c
board/engicam/geam6ul/geam6ul.c
board/engicam/icorem6/icorem6.c
board/engicam/icorem6_rqs/icorem6_rqs.c
board/engicam/isiotmx6ul/isiotmx6ul.c
board/freescale/common/cmd_esbc_validate.c
board/freescale/common/fsl_chain_of_trust.c
board/freescale/common/sys_eeprom.c
board/freescale/mpc8323erdb/mpc8323erdb.c
board/freescale/mx53loco/mx53loco.c
board/freescale/mx6sabreauto/mx6sabreauto.c
board/freescale/mx6sabresd/mx6sabresd.c
board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c
board/freescale/mx6ullevk/mx6ullevk.c
board/gateworks/gw_ventana/gw_ventana.c
board/grinn/liteboard/board.c
board/highbank/highbank.c
board/htkw/mcx/mcx.c
board/intel/edison/edison.c
board/isee/igep003x/board.c
board/isee/igep00x0/igep00x0.c
board/keymile/common/common.c
board/keymile/common/ivm.c
board/keymile/km83xx/km83xx.c
board/keymile/km_arm/km_arm.c
board/keymile/kmp204x/kmp204x.c
board/lg/sniper/sniper.c
board/liebherr/mccmon6/mccmon6.c
board/logicpd/imx6/imx6logic.c
board/logicpd/omap3som/omap3logic.c
board/nokia/rx51/rx51.c
board/overo/overo.c
board/qualcomm/dragonboard410c/dragonboard410c.c
board/raspberrypi/rpi/rpi.c
board/renesas/ecovec/ecovec.c
board/renesas/sh7752evb/sh7752evb.c
board/renesas/sh7753evb/sh7753evb.c
board/renesas/sh7757lcr/sh7757lcr.c
board/rockchip/kylin_rk3036/kylin_rk3036.c
board/samsung/common/misc.c
board/samsung/trats/trats.c
board/samsung/universal_c210/universal.c
board/samtec/vining_2000/vining_2000.c
board/samtec/vining_fpga/socfpga.c
board/siemens/common/factoryset.c
board/siemens/common/factoryset.h
board/siemens/draco/board.c
board/siemens/pxm2/board.c
board/siemens/rut/board.c
board/siemens/taurus/taurus.c
board/solidrun/mx6cuboxi/mx6cuboxi.c
board/spear/common/spr_misc.c
board/st/stm32f429-discovery/stm32f429-discovery.c
board/sunxi/board.c
board/syteco/zmx25/zmx25.c
board/theobroma-systems/puma_rk3399/puma-rk3399.c
board/ti/am335x/board.c
board/ti/am43xx/board.c
board/ti/am57xx/board.c
board/ti/beagle/beagle.c
board/ti/common/board_detect.c
board/ti/dra7xx/evm.c
board/ti/ks2_evm/board_k2g.c
board/ti/panda/panda.c
board/toradex/apalis_imx6/apalis_imx6.c
board/toradex/colibri_imx6/colibri_imx6.c
board/toradex/colibri_vf/colibri_vf.c
board/toradex/common/tdx-common.c
board/tqc/tqma6/tqma6.c
board/udoo/neo/neo.c
board/udoo/udoo.c
board/varisys/common/sys_eeprom.c
board/vscom/baltos/board.c
board/wandboard/wandboard.c
board/xilinx/zynq/board.c
board/xilinx/zynqmp/zynqmp.c
cmd/fdt.c
cmd/gpt.c
cmd/ini.c
cmd/md5sum.c
cmd/mtdparts.c
cmd/net.c
cmd/nvedit.c
cmd/part.c
cmd/pxe.c
cmd/qfw.c
cmd/setexpr.c
common/board_r.c
common/bootm.c
common/cli_hush.c
common/console.c
common/hash.c
common/hwconfig.c
common/image-android.c
common/main.c
common/spl/Kconfig
common/spl/spl_dfu.c
common/spl/spl_net.c
common/update.c
doc/README.enetaddr
drivers/mtd/dataflash.c
drivers/net/sandbox-raw.c
fs/fs.c
include/_exports.h
include/common.h
include/configs/tam3517-common.h
include/dataflash.h
include/exports.h
include/search.h
lib/uuid.c
net/arp.c
net/bootp.c
net/dns.c
net/eth_common.c
test/dm/eth.c
tools/env/fw_env.c
tools/env/fw_env.h
tools/env/fw_env_main.c

index 4fae95d2801db2d1d7e304559630500949d405db..6ae9af74b5741cfb1a6d0ee350de67029bd79cf3 100644 (file)
--- a/api/api.c
+++ b/api/api.c
@@ -481,7 +481,7 @@ static int API_env_set(va_list ap)
        if ((value = (char *)va_arg(ap, uintptr_t)) == NULL)
                return API_EINVAL;
 
-       setenv(name, value);
+       env_set(name, value);
 
        return 0;
 }
index ac2d8d1a3f83280011170fafda3032f3f7bc3dae..88f3f4dd163348cf47508520cffec2119afc2638 100644 (file)
@@ -329,7 +329,7 @@ int arch_misc_init(void)
 
        strcpy(soc, "vf");
        strcat(soc, soc_type);
-       setenv("soc", soc);
+       env_set("soc", soc);
 
        return 0;
 }
index 415ac89de9f1fe9d7f20e39d7e3928ed282617ae..bcd16ee5911f78ab44da48c53240351f1688bd16 100644 (file)
@@ -200,7 +200,7 @@ static int do_smhload(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                /* Optionally save returned end to the environment */
                if (argc == 4) {
                        sprintf(end_str, "0x%08lx", end_addr);
-                       setenv(argv[3], end_str);
+                       env_set(argv[3], end_str);
                }
        } else {
                return CMD_RET_USAGE;
index 22b244079b055d36ec10b925fb447a185ac49cdc..f8d7e8ee680c865e984888b0bb38f6696d9a4194 100644 (file)
@@ -132,7 +132,7 @@ int board_late_init(void)
        /* In bootstrap don't use the env vars */
        if (((reg & 0x3000000) >> 24) == 0x1) {
                set_default_env(NULL);
-               setenv("preboot", "");
+               env_set("preboot", "");
        }
 
        return opos6ul_board_late_init();
index 4cf977e20a30ea8dbfbda83f99645561b75c8909..7152c847d0a736cf82f8661f3497339b15b8fd62 100644 (file)
@@ -256,9 +256,9 @@ int arch_misc_init(void)
 {
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
        if (is_mx7d())
-               setenv("soc", "imx7d");
+               env_set("soc", "imx7d");
        else
-               setenv("soc", "imx7s");
+               env_set("soc", "imx7s");
 #endif
 
        return 0;
index 2bcc8e9f979c894fbde2ce9e20b693afb27c1ce5..26245aa1694e47283c2acdeac8e322ed06fe1b76 100644 (file)
@@ -241,7 +241,7 @@ void arch_preboot_os(void)
 int fb_set_reboot_flag(void)
 {
        printf("Setting reboot to fastboot flag ...\n");
-       setenv("dofastboot", "1");
+       env_set("dofastboot", "1");
        env_save();
        return 0;
 }
index 1946641eb902af291e357c0a7fc3c1c3208fefdd..b7074638bda009a8e61113c0a87610cbfc298ad3 100644 (file)
@@ -40,7 +40,7 @@ static void omap_set_fastboot_cpu(void)
                printf("Warning: fastboot.cpu: unknown CPU rev: %u\n", cpu_rev);
        }
 
-       setenv("fastboot.cpu", cpu);
+       env_set("fastboot.cpu", cpu);
 }
 
 static void omap_set_fastboot_secure(void)
@@ -63,7 +63,7 @@ static void omap_set_fastboot_secure(void)
                printf("Warning: fastboot.secure: unknown CPU sec: %u\n", dev);
        }
 
-       setenv("fastboot.secure", secure);
+       env_set("fastboot.secure", secure);
 }
 
 static void omap_set_fastboot_board_rev(void)
@@ -74,7 +74,7 @@ static void omap_set_fastboot_board_rev(void)
        if (board_rev == NULL)
                printf("Warning: fastboot.board_rev: unknown board revision\n");
 
-       setenv("fastboot.board_rev", board_rev);
+       env_set("fastboot.board_rev", board_rev);
 }
 
 #ifdef CONFIG_FASTBOOT_FLASH_MMC_DEV
@@ -118,7 +118,7 @@ static void omap_set_fastboot_userdata_size(void)
                sprintf(buf, "%u", sz_kb);
        }
 
-       setenv("fastboot.userdata_size", buf);
+       env_set("fastboot.userdata_size", buf);
 }
 #else
 static inline void omap_set_fastboot_userdata_size(void)
@@ -173,7 +173,7 @@ void omap_die_id_serial(void)
                snprintf(serial_string, sizeof(serial_string),
                        "%08x%08x", die_id[0], die_id[3]);
 
-               setenv("serial#", serial_string);
+               env_set("serial#", serial_string);
        }
 }
 
index 26ea23b01400686a76a7dbf0ae23340f99ae4742..a3457f391449a9f943675a8c296ac6f3d9b0d0a3 100644 (file)
@@ -34,11 +34,11 @@ static void setup_boot_mode(void)
        switch (boot_mode) {
        case BOOT_FASTBOOT:
                printf("enter fastboot!\n");
-               setenv("preboot", "setenv preboot; fastboot usb0");
+               env_set("preboot", "setenv preboot; fastboot usb0");
                break;
        case BOOT_UMS:
                printf("enter UMS!\n");
-               setenv("preboot", "setenv preboot; ums mmc 0");
+               env_set("preboot", "setenv preboot; ums mmc 0");
                break;
        }
 }
index b6543a5108216bfd692d0348e665046a6b83a491..1e79c19309656cc76ba7b708975f4887cb117b19 100644 (file)
@@ -30,11 +30,11 @@ static void setup_boot_mode(void)
        switch (boot_mode) {
        case BOOT_FASTBOOT:
                printf("enter fastboot!\n");
-               setenv("preboot", "setenv preboot; fastboot usb0");
+               env_set("preboot", "setenv preboot; fastboot usb0");
                break;
        case BOOT_UMS:
                printf("enter UMS!\n");
-               setenv("preboot", "setenv preboot; ums mmc 0");
+               env_set("preboot", "setenv preboot; ums mmc 0");
                break;
        }
 }
index d5f568c7932fe0501153361796a0e081ad1fd31e..74c6cc14a140e51b9cd78fe61c9754485b27b9c3 100644 (file)
@@ -37,11 +37,11 @@ static void setup_boot_mode(void)
        switch (boot_mode) {
        case BOOT_FASTBOOT:
                printf("enter fastboot!\n");
-               setenv("preboot", "setenv preboot; fastboot usb0");
+               env_set("preboot", "setenv preboot; fastboot usb0");
                break;
        case BOOT_UMS:
                printf("enter UMS!\n");
-               setenv("preboot", "setenv preboot; if mmc dev 0;"
+               env_set("preboot", "setenv preboot; if mmc dev 0;"
                       "then ums mmc 0; else ums mmc 1;fi");
                break;
        }
index 49b26b3570f9ea418833b8582098c261cba668d1..2f1da740fbe0ffe53fdf70e270ad000b8772cab8 100644 (file)
@@ -219,9 +219,9 @@ int arch_misc_init(void)
 {
        const u32 bsel = readl(&sysmgr_regs->bootinfo) & 0x7;
        const int fpga_id = socfpga_fpga_id(0);
-       setenv("bootmode", bsel_str[bsel].mode);
+       env_set("bootmode", bsel_str[bsel].mode);
        if (fpga_id >= 0)
-               setenv("fpgatype", socfpga_fpga_model[fpga_id].var);
+               env_set("fpgatype", socfpga_fpga_model[fpga_id].var);
        return socfpga_eth_reset();
 }
 #endif
index bd137969f07b20b386e08a3c8a06115aac132661..0426b7a95a963c547b22ecffa9b30c73671023fc 100644 (file)
@@ -214,9 +214,9 @@ int board_late_init(void)
 #if defined(CONFIG_TEGRA_SUPPORT_NON_SECURE)
        if (tegra_cpu_is_non_secure()) {
                printf("CPU is in NS mode\n");
-               setenv("cpu_ns_mode", "1");
+               env_set("cpu_ns_mode", "1");
        } else {
-               setenv("cpu_ns_mode", "");
+               env_set("cpu_ns_mode", "");
        }
 #endif
        start_cpu_fan();
index feb935f0d9085618537aa7013a5d6595b415d098..56650efd4fcaa6e1dc952046eccdd8456ec1f39e 100644 (file)
@@ -49,7 +49,7 @@ static int set_ethaddr_from_nvtboot(void)
                return -ENOENT;
        }
 
-       ret = setenv("ethaddr", (void *)prop);
+       ret = env_set("ethaddr", (void *)prop);
        if (ret) {
                printf("Failed to set ethaddr from nvtboot DTB: %d\n", ret);
                return ret;
index 4bfa10b374ad8b2306f052d1ee75fb5f8e4dfe1a..e6d600e41fcdc2a33a501ba2d07c4e201e96c7d2 100644 (file)
@@ -55,7 +55,7 @@ static int uniphier_set_fdt_file(void)
 
        strncat(dtb_name, ".dtb", buf_len);
 
-       return setenv("fdt_file", dtb_name);
+       return env_set("fdt_file", dtb_name);
 }
 
 int board_late_init(void)
@@ -65,20 +65,20 @@ int board_late_init(void)
        switch (uniphier_boot_device_raw()) {
        case BOOT_DEVICE_MMC1:
                printf("eMMC Boot");
-               setenv("bootmode", "emmcboot");
+               env_set("bootmode", "emmcboot");
                break;
        case BOOT_DEVICE_NAND:
                printf("NAND Boot");
-               setenv("bootmode", "nandboot");
+               env_set("bootmode", "nandboot");
                nand_denali_wp_disable();
                break;
        case BOOT_DEVICE_NOR:
                printf("NOR Boot");
-               setenv("bootmode", "norboot");
+               env_set("bootmode", "norboot");
                break;
        case BOOT_DEVICE_USB:
                printf("USB Boot");
-               setenv("bootmode", "usbboot");
+               env_set("bootmode", "usbboot");
                break;
        default:
                printf("Unknown");
index fa6b4853f9b063ce2d042f8618928d127f330a84..c32f7df4546cdd04a5c459b79f7a2e68a310173b 100644 (file)
@@ -138,7 +138,7 @@ int get_arc_info(void)
                        printf("\t<not found>\n");
                } else {
                        printf("\t%s\n", smac[3]);
-                       setenv("SERIAL", smac[3]);
+                       env_set("SERIAL", smac[3]);
                }
        }
 
@@ -152,7 +152,7 @@ int get_arc_info(void)
                char *ret = getenv("ethaddr");
 
                if (strcmp(ret, __stringify(CONFIG_ETHADDR)) == 0) {
-                       setenv("ethaddr", smac[2]);
+                       env_set("ethaddr", smac[2]);
                        printf("\t%s (factory)\n", smac[2]);
                } else {
                        printf("\t%s\n", ret);
@@ -160,8 +160,8 @@ int get_arc_info(void)
        }
 
        if (strcmp(smac[1], "00:00:00:00:00:00") == 0) {
-               setenv("eth1addr", smac[2]);
-               setenv("eth2addr", smac[2]);
+               env_set("eth1addr", smac[2]);
+               env_set("eth2addr", smac[2]);
                return 0;
        }
 
@@ -172,7 +172,7 @@ int get_arc_info(void)
                char *ret = getenv("eth1addr");
 
                if (strcmp(ret, __stringify(CONFIG_ETH1ADDR)) == 0) {
-                       setenv("eth1addr", smac[1]);
+                       env_set("eth1addr", smac[1]);
                        printf("\t%s (factory)\n", smac[1]);
                } else {
                        printf("\t%s\n", ret);
@@ -180,7 +180,7 @@ int get_arc_info(void)
        }
 
        if (strcmp(smac[0], "00:00:00:00:00:00") == 0) {
-               setenv("eth2addr", smac[1]);
+               env_set("eth2addr", smac[1]);
                return 0;
        }
 
@@ -191,7 +191,7 @@ int get_arc_info(void)
                char *ret = getenv("eth2addr");
 
                if (strcmp(ret, __stringify(CONFIG_ETH2ADDR)) == 0) {
-                       setenv("eth2addr", smac[0]);
+                       env_set("eth2addr", smac[0]);
                        printf("\t%s (factory)\n", smac[0]);
                } else {
                        printf("\t%s\n", ret);
index 0d086e87fa30db1f8864efdcaa4c1b0b8ffb01c7..2cc2e54d5b66a51199e03c4e666a7cd2cf081b1b 100644 (file)
@@ -230,9 +230,9 @@ int last_stage_init(void)
                                strcat(newkernelargs, mmckargs);
                                strcat(newkernelargs, " ");
                                strcat(newkernelargs, &tmp[n]);
-                               setenv("kernelargs", newkernelargs);
+                               env_set("kernelargs", newkernelargs);
                        } else {
-                               setenv("kernelargs", mmckargs);
+                               env_set("kernelargs", mmckargs);
                        }
                }
        get_arc_info();
@@ -244,7 +244,7 @@ int last_stage_init(void)
                        strcat(newkernelargs, sval);
                        strcat(newkernelargs, " ");
                        strcat(newkernelargs, kval);
-                       setenv("kernelargs", newkernelargs);
+                       env_set("kernelargs", newkernelargs);
                }
        } else {
                printf("Error reading kernelargs env variable!\n");
index a22722122bd680f8657391e6f46e56fad9c0fb3e..6083479f2b07006fac21a2294a5cccd5cb720787 100644 (file)
@@ -167,7 +167,7 @@ int board_late_init(void)
                lcd_position_cursor(1, 8);
                lcd_puts(
                "switching to network-console ...       ");
-               setenv("bootcmd", "run netconsole");
+               env_set("bootcmd", "run netconsole");
        }
        return 0;
 }
index f4bfa410cc60ec7b21b8ae763db86ed909f54fa8..cdbc93a8ec5732c94837be43ea8a222ec8f6090b 100644 (file)
@@ -203,7 +203,7 @@ int board_late_init(void)
                                lcd_position_cursor(1, 8);
                                lcd_puts(
                                "switching to network-console ...       ");
-                               setenv("bootcmd", "run netconsole");
+                               env_set("bootcmd", "run netconsole");
                                cnt = 4;
                                break;
                        } else if (!gpio_get_value(ESC_KEY) &&
@@ -211,7 +211,7 @@ int board_late_init(void)
                                lcd_position_cursor(1, 8);
                                lcd_puts(
                                "starting u-boot script from USB ...    ");
-                               setenv("bootcmd", "run usbscript");
+                               env_set("bootcmd", "run usbscript");
                                cnt = 4;
                                break;
                        } else if ((!gpio_get_value(ESC_KEY) &&
@@ -221,7 +221,7 @@ int board_late_init(void)
                                lcd_position_cursor(1, 8);
                                lcd_puts(
                                "starting script from network ...      ");
-                               setenv("bootcmd", "run netscript");
+                               env_set("bootcmd", "run netscript");
                                cnt = 4;
                                break;
                        } else if (!gpio_get_value(ESC_KEY)) {
@@ -232,19 +232,19 @@ int board_late_init(void)
                lcd_position_cursor(1, 8);
                lcd_puts(
                "starting vxworks from network ...      ");
-               setenv("bootcmd", "run netboot");
+               env_set("bootcmd", "run netboot");
                cnt = 4;
        } else if (scratchreg == 0xCD) {
                lcd_position_cursor(1, 8);
                lcd_puts(
                "starting script from network ...      ");
-               setenv("bootcmd", "run netscript");
+               env_set("bootcmd", "run netscript");
                cnt = 4;
        } else if (scratchreg == 0xCE) {
                lcd_position_cursor(1, 8);
                lcd_puts(
                "starting AR from eMMC ...             ");
-               setenv("bootcmd", "run mmcboot");
+               env_set("bootcmd", "run mmcboot");
                cnt = 4;
        }
 
@@ -252,7 +252,7 @@ int board_late_init(void)
        switch (cnt) {
        case 0:
                lcd_puts("entering BOOT-mode.                    ");
-               setenv("bootcmd", "run defaultAR");
+               env_set("bootcmd", "run defaultAR");
                buf = 0x0000;
                break;
        case 1:
@@ -285,7 +285,7 @@ int board_late_init(void)
                 (u32)getenv_ulong("vx_memtop", 16, gd->fb_base-0x20),
                 (u32)getenv_ulong("vx_romfsbase", 16, 0),
                 (u32)getenv_ulong("vx_romfssize", 16, 0));
-       setenv("othbootargs", othbootargs);
+       env_set("othbootargs", othbootargs);
        /*
         * reset VBAR registers to its reset location, VxWorks 6.9.3.2 does
         * expect that vectors are there, original u-boot moves them to _start
index c3a56db76a69aab37a6ad26aa9dcdd4e22566fb7..6bea9a4383f55c7367ad6816ce898f8ff543a050 100644 (file)
@@ -184,7 +184,7 @@ int load_lcdtiming(struct am335x_lcdpanel *panel)
                puts("no 'factory-settings / rotation' in dtb!\n");
        }
        snprintf(buf, sizeof(buf), "fbcon=rotate:%d", panel_info.vl_rot);
-       setenv("optargs_rot", buf);
+       env_set("optargs_rot", buf);
 #else
        pnltmp.hactive = getenv_ulong("ds1_hactive", 10, ~0UL);
        pnltmp.vactive = getenv_ulong("ds1_vactive", 10, ~0UL);
index a4275091d21573c42ee7b605d3a33b29a7b609e7..f63e3b6c50c857d1a69cad5783aab063e6a1d322 100644 (file)
@@ -285,7 +285,7 @@ static int set_regdomain(void)
                puts("EEPROM regdomain read failed.\n");
 
        printf("Regdomain set to %s\n", rd);
-       return setenv("regdomain", rd);
+       return env_set("regdomain", rd);
 }
 #endif
 
index 20544e29c45325985f8a4e396891213ded37d533..6313882a5285dd68e1b57a8b911a27c08dadb6c5 100644 (file)
@@ -81,7 +81,7 @@ static int do_syno_populate(int argc, char * const argv[])
                         ethaddr[0], ethaddr[1], ethaddr[2],
                         ethaddr[3], ethaddr[4], ethaddr[5]);
                printf("parsed %s = %s\n", var, val);
-               setenv(var, val);
+               env_set(var, val);
        }
        if (!strncmp(buf + 32, SYNO_SN_TAG, strlen(SYNO_SN_TAG))) {
                char *snp, *csump;
@@ -111,7 +111,7 @@ static int do_syno_populate(int argc, char * const argv[])
                        goto out_unmap;
                }
                printf("parsed SN = %s\n", snp);
-               setenv("SN", snp);
+               env_set("SN", snp);
        } else {        /* old style format */
                unsigned char csum = 0;
 
@@ -125,7 +125,7 @@ static int do_syno_populate(int argc, char * const argv[])
                }
                bufp[n] = '\0';
                printf("parsed SN = %s\n", buf + 32);
-               setenv("SN", buf + 32);
+               env_set("SN", buf + 32);
        }
 out_unmap:
        unmap_physmem(buf, len);
index 13a9c6a0fe10e5b314ca98a0e09a125e98238afc..2d8be1804ae0fc678c531c6a817ce3b4e63bfe00 100644 (file)
@@ -119,7 +119,7 @@ int misc_init_r(void)
 
        if (reboot_mode[0] > 0 && isascii(reboot_mode[0])) {
                if (!getenv("reboot-mode"))
-                       setenv("reboot-mode", (char *)reboot_mode);
+                       env_set("reboot-mode", (char *)reboot_mode);
        }
 
        omap_reboot_mode_clear();
index b29f56d5ebc0b0ac4539ad7425ce05ca3901e072..f2a394a72ba68e0ac4d2b2d3f031ec03c14b6858 100644 (file)
@@ -55,7 +55,7 @@ int misc_init_r(void)
                len = meson_sm_read_efuse(EFUSE_SN_OFFSET, serial,
                        EFUSE_SN_SIZE);
                if (len == EFUSE_SN_SIZE) 
-                       setenv("serial#", serial);
+                       env_set("serial#", serial);
        }
 
        return 0;
index b9294fc881bec328e6fd2ecacbc40ef9001bdf85..956c297e72de6c4e9244ff9556d0c429f800195f 100644 (file)
@@ -325,7 +325,7 @@ int board_init(void)
 
 int board_late_init(void)
 {
-       setenv("bootmode", boot_mode_sf ? "sf" : "emmc");
+       env_set("bootmode", boot_mode_sf ? "sf" : "emmc");
        return 0;
 }
 
index 6abc2159bbc59bc34bc52482a225a41cba1e5f6e..bdf41b99c8745777f7e4e674a9cf3cc1aa9f5885 100644 (file)
@@ -670,9 +670,9 @@ int board_late_init(void)
        if (bootmode == 7) {
                my_bootdelay = getenv("nor_bootdelay");
                if (my_bootdelay != NULL)
-                       setenv("bootdelay", my_bootdelay);
+                       env_set("bootdelay", my_bootdelay);
                else
-                       setenv("bootdelay", "-2");
+                       env_set("bootdelay", "-2");
        }
 
        /* if we have the lg panel, we can initialze it now */
index c3bafd453ebea8956631550bfbd2d8389a4dccd4..858f74e5cf0bcb137ece5bb3152ac9864e1e4c56 100644 (file)
@@ -116,7 +116,7 @@ extern void cm_remap(void);
 
 int misc_init_r (void)
 {
-       setenv("verify", "n");
+       env_set("verify", "n");
        return (0);
 }
 
index c1f2769f1c556d788b2acf58824f9279747c3c09..88bcd876c9562e4f17ab8e77ef8096f68e50282d 100644 (file)
@@ -267,7 +267,7 @@ int board_late_init(void)
                *p = tolower(*p);
 
        strcat(name, "ek.dtb");
-       setenv("dtb_name", name);
+       env_set("dtb_name", name);
 #endif
        return 0;
 }
index 1ad4ef93cfc7e5f2d11a7f1116b62a52b576d8b7..df10d6a0d0406c1b36a764979832da11ae1952b3 100644 (file)
@@ -312,9 +312,9 @@ int board_eth_init(bd_t *bis)
 
        /* depending on the phy address we can detect our board version */
        if (phydev->addr == 0)
-               setenv("boardver", "");
+               env_set("boardver", "");
        else
-               setenv("boardver", "mr");
+               env_set("boardver", "mr");
 
        printf("using phy at %d\n", phydev->addr);
        ret = fec_probe(bis, -1, base, bus, phydev);
index b49365e157a7a8bf0f63ac3eab28644029a2b75f..c5122253cfc04a0994bedbb7d01efe8dcf0abf28 100644 (file)
@@ -301,8 +301,8 @@ int board_init(void)
 int board_late_init(void)
 {
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
-       setenv("board_name", "BAV335xB");
-       setenv("board_rev", "B"); /* Fix me, but why bother.. */
+       env_set("board_name", "BAV335xB");
+       env_set("board_rev", "B"); /* Fix me, but why bother.. */
 #endif
        return 0;
 }
index 38577f30f15ab91a9dd68f59343cca8f711e4958..2c830a219cc2e772854e33da9b50ed976d2ea022 100644 (file)
@@ -251,7 +251,7 @@ static void check_button_status(void)
 
        if (value == 0) {
                printf("front button activated !\n");
-               setenv("harakiri", "1");
+               env_set("harakiri", "1");
        }
 }
 
index 17fd6f56eafb3fdebd3410a679b1f1a09eef97d1..c04926c0bbed6fd9771e64c1eb613160b81b2f13 100644 (file)
@@ -954,7 +954,7 @@ static int do_kbd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        char envvalue[ARRAY_SIZE(buttons)+1];
        int numpressed = read_keys(envvalue);
-       setenv("keybd", envvalue);
+       env_set("keybd", envvalue);
        return numpressed == 0;
 }
 
@@ -995,7 +995,7 @@ static void preboot_keys(void)
                        sprintf(cmd_name, "%s%c", kbd_command_prefix, *suffix);
                        cmd = getenv(cmd_name);
                        if (cmd) {
-                               setenv("preboot", cmd);
+                               env_set("preboot", cmd);
                                return;
                        }
                }
index 0f3734587a5d83cac741592437f7b81f858b6ebf..5b31e056bac93bcc0cfdeb095ea7efc8ecb48e33 100644 (file)
@@ -228,7 +228,7 @@ static void erase_environment(void)
 static void rescue_mode(void)
 {
        printf("Entering rescue mode..\n");
-       setenv("bootsource", "rescue");
+       env_set("bootsource", "rescue");
 }
 
 static void check_push_button(void)
index 0265e9bb360b74d9422eecd833585f02d4440349..83244c3ad4195e5b00385bbde94d7cb9ba6b1538 100644 (file)
@@ -93,7 +93,7 @@ int misc_init_r(void)
                x = (*(volatile u32 *)CONFIG_SYS_FPGAREG_DIPSW)
                        & FPGAREG_MAC_MASK;
                sprintf(&s[15], "%02x", x);
-               setenv("ethaddr", s);
+               env_set("ethaddr", s);
        }
 #endif /* CONFIG_CMD_NET */
 
index 542e534270e02389805a0f9433bf5183881b2834..b65646588a9d229a0e4ec275129b9739b72f93bf 100644 (file)
@@ -318,7 +318,7 @@ static const struct boot_mode board_boot_modes[] = {
 int board_late_init(void)
 {
        add_board_boot_modes(board_boot_modes);
-       setenv("board_name", "xpress");
+       env_set("board_name", "xpress");
 
        return 0;
 }
index 5cb97b4778721c258720ab4c397cb18e139c7bb7..ac66248b3ff794181cd345f0a96a99fc94479513 100644 (file)
@@ -755,9 +755,9 @@ int board_late_init(void)
 {
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
        if (is_mx6dq())
-               setenv("board_rev", "MX6Q");
+               env_set("board_rev", "MX6Q");
        else
-               setenv("board_rev", "MX6DL");
+               env_set("board_rev", "MX6DL");
 #endif
 
        return 0;
index 43c4cb77bb137cc3ca64f6f2cc3f5e629babb896..c92888180496d09fef7e7e5135fd934963fef439 100644 (file)
@@ -123,7 +123,7 @@ int misc_init_r(void)
 
        /* if BTN_ACQ_AL is pressed then bootdelay is changed to 60 second */
        if ((in_be16(&iop->iop_pcdat) & 0x0004) == 0)
-               setenv("bootdelay", "60");
+               env_set("bootdelay", "60");
 
        return 0;
 }
index 52bb7363a7e279903242ca33c49699ee8380336f..29296b04781dfff797072e04946bb2814c9d9082 100644 (file)
@@ -337,7 +337,7 @@ int misc_init_r(void)
                                addr[0], addr[1], addr[2], addr[3], addr[4],
                                addr[5]);
 
-                       setenv("ethaddr", (char *)tmp);
+                       env_set("ethaddr", (char *)tmp);
                } else {
                        printf("Invalid MAC address read.\n");
                }
index cbe355a600a3eb21add00e3f3490305701fed01d..6b98b5c3ebda90c4788d57ef939c3d70930a09f7 100644 (file)
@@ -466,7 +466,7 @@ int board_late_init(void)
        add_board_boot_modes(board_boot_modes);
 #endif
 
-       setenv("board_name", BOARD_NAME);
+       env_set("board_name", BOARD_NAME);
        return 0;
 }
 
index e3bb5698f63c316e2930bd9723de182c4634575a..56112d34593664bbb3cc8440be9b33eb09538f4a 100644 (file)
@@ -25,7 +25,7 @@ static void mmc_late_init(void)
 
        /* Set mmcblk env */
        sprintf(mmcblk, "/dev/mmcblk%dp2 rootwait rw", dev_no);
-       setenv("mmcroot", mmcblk);
+       env_set("mmcroot", mmcblk);
 
        sprintf(cmd, "mmc dev %d", dev_no);
        run_command(cmd, 0);
@@ -43,20 +43,20 @@ int board_late_init(void)
 #ifdef CONFIG_ENV_IS_IN_MMC
                mmc_late_init();
 #endif
-               setenv("modeboot", "mmcboot");
+               env_set("modeboot", "mmcboot");
                break;
        case IMX6_BMODE_NAND:
-               setenv("modeboot", "nandboot");
+               env_set("modeboot", "nandboot");
                break;
        default:
-               setenv("modeboot", "");
+               env_set("modeboot", "");
                break;
        }
 
        if (is_mx6ul())
-               setenv("console", "ttymxc0");
+               env_set("console", "ttymxc0");
        else
-               setenv("console", "ttymxc3");
+               env_set("console", "ttymxc3");
 
        setenv_fdt_file();
 
index bc36fc77ee5b5ab3ba9c0637b7edbb22dd18e6c3..ffd383a0eecac0b57df8dbb7094974c81aebd269 100644 (file)
@@ -93,7 +93,7 @@ void setup_gpmi_nand(void)
 void setenv_fdt_file(void)
 {
        if (is_mx6ul())
-               setenv("fdt_file", "imx6ul-geam-kit.dtb");
+               env_set("fdt_file", "imx6ul-geam-kit.dtb");
 }
 
 #ifdef CONFIG_SPL_BUILD
index 5b2ed066b49ae85bc3be5d6b8a0479b19b1f87fb..3d4f713c3e2b80783e1ee7ee5cc328390225043a 100644 (file)
@@ -195,9 +195,9 @@ void setup_display(void)
 void setenv_fdt_file(void)
 {
        if (is_mx6dq())
-               setenv("fdt_file", "imx6q-icore.dtb");
+               env_set("fdt_file", "imx6q-icore.dtb");
        else if(is_mx6dl() || is_mx6solo())
-               setenv("fdt_file", "imx6dl-icore.dtb");
+               env_set("fdt_file", "imx6dl-icore.dtb");
 }
 
 #ifdef CONFIG_SPL_BUILD
index 10a947173032e510ccb9da8a3dcfee1938e2777c..2a321dca50eacd96dd9c84ef216b480c206caf50 100644 (file)
@@ -35,9 +35,9 @@ int board_mmc_get_env_dev(int devno)
 void setenv_fdt_file(void)
 {
        if (is_mx6dq())
-               setenv("fdt_file", "imx6q-icore-rqs.dtb");
+               env_set("fdt_file", "imx6q-icore-rqs.dtb");
        else if(is_mx6dl() || is_mx6solo())
-               setenv("fdt_file", "imx6dl-icore-rqs.dtb");
+               env_set("fdt_file", "imx6dl-icore-rqs.dtb");
 }
 
 #ifdef CONFIG_SPL_BUILD
index 4dcc9ea11baa3b34c68287f8a5d6f94d4f9a834f..fbf17242f87ef60972372720e3d480cee3cf388d 100644 (file)
@@ -102,9 +102,9 @@ void setenv_fdt_file(void)
 {
        if (is_mx6ul()) {
 #ifdef CONFIG_ENV_IS_IN_MMC
-               setenv("fdt_file", "imx6ul-isiot-emmc.dtb");
+               env_set("fdt_file", "imx6ul-isiot-emmc.dtb");
 #else
-               setenv("fdt_file", "imx6ul-isiot-nand.dtb");
+               env_set("fdt_file", "imx6ul-isiot-nand.dtb");
 #endif
        }
 }
index cefe3cc531741687a229599d5e7c73d1177f3fd4..b3e5f019b87b2094a72880517f827ad4dd126893 100644 (file)
@@ -52,7 +52,7 @@ static int do_esbc_validate(cmd_tbl_t *cmdtp, int flag, int argc,
         * to continue U-Boot
         */
        sprintf(buf, "%lx", img_addr);
-       setenv("img_addr", buf);
+       env_set("img_addr", buf);
 
        if (ret)
                return 1;
index dfe5d204d4a3e3ed1184f961cdd82a432c9d1776..6e750b08bcd6e6a4fa34b4f0cf614da449891fe0 100644 (file)
@@ -80,12 +80,12 @@ int fsl_setenv_chain_of_trust(void)
         * bootdelay = 0 (To disable Boot Prompt)
         * bootcmd = CONFIG_CHAIN_BOOT_CMD (Validate and execute Boot script)
         */
-       setenv("bootdelay", "0");
+       env_set("bootdelay", "0");
 
 #ifdef CONFIG_ARM
-       setenv("secureboot", "y");
+       env_set("secureboot", "y");
 #else
-       setenv("bootcmd", CONFIG_CHAIN_BOOT_CMD);
+       env_set("bootcmd", CONFIG_CHAIN_BOOT_CMD);
 #endif
 
        return 0;
index 29aa778dbeca4524788d982b517f74ce1d160b66..c593cff5e703c656706026f1d50ee5c803807643 100644 (file)
@@ -479,7 +479,7 @@ int mac_read_from_eeprom(void)
                         * (i.e. have not yet been set)
                         */
                        if (!getenv(enetvar))
-                               setenv(enetvar, ethaddr);
+                               env_set(enetvar, ethaddr);
                }
        }
 
index f30a1510ee406c1537d2368e4fbff30089777f08..b715d8363ea2dd1fc82adc5ea7e46108a3fe0bd3 100644 (file)
@@ -216,7 +216,7 @@ int mac_read_from_eeprom(void)
                                                buf[i * 6 + 4], buf[i * 6 + 5]);
                                        sprintf((char *)enetvar,
                                                i ? "eth%daddr" : "ethaddr", i);
-                                       setenv((char *)enetvar, str);
+                                       env_set((char *)enetvar, str);
                                }
                        }
                }
index 27d606f3105bcfe5085a7560864a41b25298c65f..ea3660368603bbc0cf1be49a4564db8ab00a8bc3 100644 (file)
@@ -246,7 +246,7 @@ static int power_init(void)
                if (!p)
                        return -ENODEV;
 
-               setenv("fdt_file", "imx53-qsb.dtb");
+               env_set("fdt_file", "imx53-qsb.dtb");
 
                /* Set VDDA to 1.25V */
                val = DA9052_BUCKCORE_BCOREEN | DA_BUCKCORE_VBCORE_1_250V;
@@ -289,7 +289,7 @@ static int power_init(void)
                if (!p)
                        return -ENODEV;
 
-               setenv("fdt_file", "imx53-qsrb.dtb");
+               env_set("fdt_file", "imx53-qsrb.dtb");
 
                /* Set VDDGP to 1.25V for 1GHz on SW1 */
                pmic_reg_read(p, REG_SW_0, &val);
index a5703a35b16381fc16abff2ca97d7b1f5b8db957..ea780917446cc726c0c6ddf35183f15c6f50c4b2 100644 (file)
@@ -687,14 +687,14 @@ int board_late_init(void)
 #endif
 
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
-       setenv("board_name", "SABREAUTO");
+       env_set("board_name", "SABREAUTO");
 
        if (is_mx6dqp())
-               setenv("board_rev", "MX6QP");
+               env_set("board_rev", "MX6QP");
        else if (is_mx6dq())
-               setenv("board_rev", "MX6Q");
+               env_set("board_rev", "MX6Q");
        else if (is_mx6sdl())
-               setenv("board_rev", "MX6DL");
+               env_set("board_rev", "MX6DL");
 #endif
 
        return 0;
index e4160420fa8b393d792c05b1433f39cb331dee1e..19aa6f44d01a90df0dc17ba341a23dd298c11ed0 100644 (file)
@@ -700,14 +700,14 @@ int board_late_init(void)
 #endif
 
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
-       setenv("board_name", "SABRESD");
+       env_set("board_name", "SABRESD");
 
        if (is_mx6dqp())
-               setenv("board_rev", "MX6QP");
+               env_set("board_rev", "MX6QP");
        else if (is_mx6dq())
-               setenv("board_rev", "MX6Q");
+               env_set("board_rev", "MX6Q");
        else if (is_mx6sdl())
-               setenv("board_rev", "MX6DL");
+               env_set("board_rev", "MX6DL");
 #endif
 
        return 0;
index a30c379e4ddd5a9e895844bf8d28bf867f050be1..cf7a069c56ecd89fde0da339469fda1b9813e4db 100644 (file)
@@ -674,12 +674,12 @@ int board_late_init(void)
 #endif
 
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
-       setenv("board_name", "EVK");
+       env_set("board_name", "EVK");
 
        if (is_mx6ul_9x9_evk())
-               setenv("board_rev", "9X9");
+               env_set("board_rev", "9X9");
        else
-               setenv("board_rev", "14X14");
+               env_set("board_rev", "14X14");
 #endif
 
        return 0;
index 66b08f823e3fabcae29f4814317495fa24e8ef1c..cebcec738fc074b1221bc9f53c41b0b31848849c 100644 (file)
@@ -84,8 +84,8 @@ int board_late_init(void)
 #endif
 
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
-       setenv("board_name", "EVK");
-       setenv("board_rev", "14X14");
+       env_set("board_name", "EVK");
+       env_set("board_rev", "14X14");
 #endif
 
        return 0;
index 89848c8f075d46b29a40b9484c4aba9ebea791c3..efadb0c324d7829c7de57919d7a1c32cd00023b8 100644 (file)
@@ -301,7 +301,7 @@ int board_eth_init(bd_t *bis)
        if (!getenv("ethprime")) {
                struct eth_device *dev = eth_get_dev_by_index(0);
                if (dev) {
-                       setenv("ethprime", dev->name);
+                       env_set("ethprime", dev->name);
                        printf("set ethprime to %s\n", getenv("ethprime"));
                }
        }
@@ -662,7 +662,7 @@ int checkboard(void)
        if (p)
                quiet = simple_strtol(p, NULL, 10);
        else
-               setenv("quiet", "0");
+               env_set("quiet", "0");
 
        puts("\nGateworks Corporation Copyright 2014\n");
        if (info->model[0]) {
@@ -737,26 +737,26 @@ int misc_init_r(void)
                else if (is_cpu_type(MXC_CPU_MX6DL) ||
                         is_cpu_type(MXC_CPU_MX6SOLO))
                        cputype = "imx6dl";
-               setenv("soctype", cputype);
+               env_set("soctype", cputype);
                if (8 << (ventana_info.nand_flash_size-1) >= 2048)
-                       setenv("flash_layout", "large");
+                       env_set("flash_layout", "large");
                else
-                       setenv("flash_layout", "normal");
+                       env_set("flash_layout", "normal");
                memset(str, 0, sizeof(str));
                for (i = 0; i < (sizeof(str)-1) && info->model[i]; i++)
                        str[i] = tolower(info->model[i]);
-               setenv("model", str);
+               env_set("model", str);
                if (!getenv("fdt_file")) {
                        sprintf(fdt, "%s-%s.dtb", cputype, str);
-                       setenv("fdt_file", fdt);
+                       env_set("fdt_file", fdt);
                }
                p = strchr(str, '-');
                if (p) {
                        *p++ = 0;
 
-                       setenv("model_base", str);
+                       env_set("model_base", str);
                        sprintf(fdt, "%s-%s.dtb", cputype, str);
-                       setenv("fdt_file1", fdt);
+                       env_set("fdt_file1", fdt);
                        if (board_type != GW551x &&
                            board_type != GW552x &&
                            board_type != GW553x &&
@@ -765,7 +765,7 @@ int misc_init_r(void)
                        str[5] = 'x';
                        str[6] = 0;
                        sprintf(fdt, "%s-%s.dtb", cputype, str);
-                       setenv("fdt_file2", fdt);
+                       env_set("fdt_file2", fdt);
                }
 
                /* initialize env from EEPROM */
@@ -780,11 +780,11 @@ int misc_init_r(void)
 
                /* board serial-number */
                sprintf(str, "%6d", info->serial);
-               setenv("serial#", str);
+               env_set("serial#", str);
 
                /* memory MB */
                sprintf(str, "%d", (int) (gd->ram_size >> 20));
-               setenv("mem_mb", str);
+               env_set("mem_mb", str);
        }
 
        /* Set a non-initialized hwconfig based on board configuration */
@@ -798,7 +798,7 @@ int misc_init_r(void)
                        if (strlen(buf) + strlen(buf1) < sizeof(buf))
                                strcat(buf, buf1);
                }
-               setenv("hwconfig", buf);
+               env_set("hwconfig", buf);
        }
 
        /* setup baseboard specific GPIO based on board and env */
index 817e22fd455518d4ed2af1e550457aa4e20b2378..835be99b961e4cb5c8f657c1ee8e31c06121c34f 100644 (file)
@@ -173,7 +173,7 @@ void board_late_mmc_init(void)
        /* Set mmcblk env */
        sprintf(mmcblk, "/dev/mmcblk%dp2 rootwait rw",
                dev_no);
-       setenv("mmcroot", mmcblk);
+       env_set("mmcroot", mmcblk);
 
        sprintf(cmd, "mmc dev %d", dev_no);
        run_command(cmd, 0);
index 1af220786795cb74770bc0843dc35c603a8428c5..e51043aa91472ed221b93c7ee2b34cecfd9abec4 100644 (file)
@@ -82,9 +82,9 @@ int misc_init_r(void)
        sprintf(envbuffer, "bootcmd%d", boot_choice);
        if (getenv(envbuffer)) {
                sprintf(envbuffer, "run bootcmd%d", boot_choice);
-               setenv("bootcmd", envbuffer);
+               env_set("bootcmd", envbuffer);
        } else
-               setenv("bootcmd", "");
+               env_set("bootcmd", "");
 
        return 0;
 }
index 1deb2bdd8b7b8e26439a1ecc606362dbd35fe0b7..0a02e44046d08b4b060d9c6985cdb8aa00eae41a 100644 (file)
@@ -83,7 +83,7 @@ int board_late_init(void)
        if (gpio_get_value(HOT_WATER_BUTTON))
                return 0;
 
-       setenv("bootcmd", "run swupdate");
+       env_set("bootcmd", "run swupdate");
 
        return 0;
 }
index 80f9b544b00cb0e3fd6ea0890c92469c0bcaf97f..aaafae86a80fcf2eee4c3ae97fc5086dd7123a11 100644 (file)
@@ -64,11 +64,11 @@ static void assign_serial(void)
 
        snprintf(usb0addr, sizeof(usb0addr), "02:00:86:%02x:%02x:%02x",
                 ssn[13], ssn[14], ssn[15]);
-       setenv("usb0addr", usb0addr);
+       env_set("usb0addr", usb0addr);
 
        for (i = 0; i < 16; i++)
                snprintf(&serial[2 * i], 3, "%02x", ssn[i]);
-       setenv("serial#", serial);
+       env_set("serial#", serial);
 
 #if defined(CONFIG_CMD_SAVEENV) && !defined(CONFIG_ENV_IS_NOWHERE)
        env_save();
@@ -86,7 +86,7 @@ static void assign_hardware_id(void)
                printf("Can't retrieve hardware revision\n");
 
        snprintf(hardware_id, sizeof(hardware_id), "%02X", v.hardware_id);
-       setenv("hardware_id", hardware_id);
+       env_set("hardware_id", hardware_id);
 
 #if defined(CONFIG_CMD_SAVEENV) && !defined(CONFIG_ENV_IS_NOWHERE)
        env_save();
index e33170d65f9d102262207f47c733b5593c6cfa31..24687e22e4fd03307919957b813ee52e3e0be2e0 100644 (file)
@@ -194,13 +194,13 @@ int board_late_init(void)
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
        switch (get_board_revision()) {
                case 0:
-                       setenv("board_name", "igep0034-lite");
+                       env_set("board_name", "igep0034-lite");
                        break;
                case 1:
-                       setenv("board_name", "igep0034");
+                       env_set("board_name", "igep0034");
                        break;
                default:
-                       setenv("board_name", "igep0033");
+                       env_set("board_name", "igep0033");
                        break;
        }
 #endif
index 843d35eb2d0ff18c9394e6f297f8ee42b5c923fa..a7a75601dd3ee959849221b45f6678f5021d3201 100644 (file)
@@ -251,10 +251,10 @@ void set_fdt(void)
 {
        switch (gd->bd->bi_arch_number) {
        case MACH_TYPE_IGEP0020:
-               setenv("fdtfile", "omap3-igep0020.dtb");
+               env_set("fdtfile", "omap3-igep0020.dtb");
                break;
        case MACH_TYPE_IGEP0030:
-               setenv("fdtfile", "omap3-igep0030.dtb");
+               env_set("fdtfile", "omap3-igep0030.dtb");
                break;
        }
 }
index 408079c9a14976386137159f563b0dc3e334f811..56d304424108f4897a3da0705537ebd99f486021 100644 (file)
@@ -51,7 +51,7 @@ int set_km_env(void)
        pnvramaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM
                        - CONFIG_KM_PNVRAM;
        sprintf((char *)buf, "0x%x", pnvramaddr);
-       setenv("pnvramaddr", (char *)buf);
+       env_set("pnvramaddr", (char *)buf);
 
        /* try to read rootfssize (ram image) from environment */
        p = getenv("rootfssize");
@@ -60,15 +60,15 @@ int set_km_env(void)
        pram = (rootfssize + CONFIG_KM_RESERVED_PRAM + CONFIG_KM_PHRAM +
                CONFIG_KM_PNVRAM) / 0x400;
        sprintf((char *)buf, "0x%x", pram);
-       setenv("pram", (char *)buf);
+       env_set("pram", (char *)buf);
 
        varaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM;
        sprintf((char *)buf, "0x%x", varaddr);
-       setenv("varaddr", (char *)buf);
+       env_set("varaddr", (char *)buf);
 
        kernelmem = gd->ram_size - 0x400 * pram;
        sprintf((char *)buf, "0x%x", kernelmem);
-       setenv("kernelmem", (char *)buf);
+       env_set("kernelmem", (char *)buf);
 
        return 0;
 }
@@ -169,7 +169,7 @@ static int do_setboardid(cmd_tbl_t *cmdtp, int flag, int argc,
                return 1;
        }
        strcpy((char *)buf, p);
-       setenv("boardid", (char *)buf);
+       env_set("boardid", (char *)buf);
        printf("set boardid=%s\n", buf);
 
        p = get_local_var("IVM_HWKey");
@@ -178,7 +178,7 @@ static int do_setboardid(cmd_tbl_t *cmdtp, int flag, int argc,
                return 1;
        }
        strcpy((char *)buf, p);
-       setenv("hwkey", (char *)buf);
+       env_set("hwkey", (char *)buf);
        printf("set hwkey=%s\n", buf);
        printf("Execute manually saveenv for persistent storage.\n");
 
@@ -311,9 +311,9 @@ static int do_checkboardidhwk(cmd_tbl_t *cmdtp, int flag, int argc,
                                        envbid   = bid;
                                        envhwkey = hwkey;
                                        sprintf(buf, "%lx", bid);
-                                       setenv("boardid", buf);
+                                       env_set("boardid", buf);
                                        sprintf(buf, "%lx", hwkey);
-                                       setenv("hwkey", buf);
+                                       env_set("hwkey", buf);
                                }
                        } /* end while( ! found ) */
                }
index e9e518cf7257165d0e647d340ff6a865639d2ee1..dc40a83fc08c247915196a344f1895b0a9739ae1 100644 (file)
@@ -310,11 +310,11 @@ static int ivm_populate_env(unsigned char *buf, int len)
 #ifndef CONFIG_KMTEGR1
        /* if an offset is defined, add it */
        process_mac(valbuf, page2, CONFIG_PIGGY_MAC_ADRESS_OFFSET, true);
-       setenv((char *)"ethaddr", (char *)valbuf);
+       env_set((char *)"ethaddr", (char *)valbuf);
 #ifdef CONFIG_KMVECT1
 /* KMVECT1 has two ethernet interfaces */
        process_mac(valbuf, page2, 1, true);
-       setenv((char *)"eth1addr", (char *)valbuf);
+       env_set((char *)"eth1addr", (char *)valbuf);
 #endif
 #else
 /* KMTEGR1 has a special setup. eth0 has no connection to the outside and
@@ -322,9 +322,9 @@ static int ivm_populate_env(unsigned char *buf, int len)
  * gets the official MAC address from the IVM
  */
        process_mac(valbuf, page2, CONFIG_PIGGY_MAC_ADRESS_OFFSET, false);
-       setenv((char *)"ethaddr", (char *)valbuf);
+       env_set((char *)"ethaddr", (char *)valbuf);
        process_mac(valbuf, page2, CONFIG_PIGGY_MAC_ADRESS_OFFSET, true);
-       setenv((char *)"eth1addr", (char *)valbuf);
+       env_set((char *)"eth1addr", (char *)valbuf);
 #endif
 
        return 0;
index 8020c379fdb1947705b9c1ec1435c66d0fb552f3..5e07faa818aa6c34b68b37e475f46188bd4bb39b 100644 (file)
@@ -263,11 +263,11 @@ int last_stage_init(void)
        mv88e_sw_reset(name, CONFIG_KM_MVEXTSW_ADDR);
 
        if (piggy_present()) {
-               setenv("ethact", "UEC2");
-               setenv("netdev", "eth1");
+               env_set("ethact", "UEC2");
+               env_set("netdev", "eth1");
                puts("using PIGGY for network boot\n");
        } else {
-               setenv("netdev", "eth0");
+               env_set("netdev", "eth0");
                puts("using frontport for network boot\n");
        }
 #endif
@@ -280,7 +280,7 @@ int last_stage_init(void)
        if (dip_switch != 0) {
                /* start bootloader */
                puts("DIP:   Enabled\n");
-               setenv("actual_bank", "0");
+               env_set("actual_bank", "0");
        }
 #endif
        set_km_env();
index 85785ffc02b1d5d8fdab31972fe03e4bf5097393..08ae9ae3467937607172ea58f27de816dce6b639 100644 (file)
@@ -193,7 +193,7 @@ static void set_bootcount_addr(void)
        unsigned int bootcountaddr;
        bootcountaddr = gd->ram_size - BOOTCOUNT_ADDR;
        sprintf((char *)buf, "0x%x", bootcountaddr);
-       setenv("bootcountaddr", (char *)buf);
+       env_set("bootcountaddr", (char *)buf);
 }
 
 int misc_init_r(void)
@@ -299,7 +299,7 @@ int board_late_init(void)
        if (dip_switch != 0) {
                /* start bootloader */
                puts("DIP:   Enabled\n");
-               setenv("actual_bank", "0");
+               env_set("actual_bank", "0");
        }
 #endif
 
index abb20196c55c1bef68088ba70fe7a9cf7ef1a933..095e467ac0b3f285938e39837c42700a8af98b23 100644 (file)
@@ -222,7 +222,7 @@ int last_stage_init(void)
        if (dip_switch != 0) {
                /* start bootloader */
                puts("DIP:   Enabled\n");
-               setenv("actual_bank", "0");
+               env_set("actual_bank", "0");
        }
 #endif
        set_km_env();
index f924645dc0788cd5fadf9cef090a7384aa0a5d36..4906e4f9d223cb8178c46fe4f33a2c2635df51cc 100644 (file)
@@ -134,7 +134,7 @@ int misc_init_r(void)
 
        if (reboot_mode[0] > 0 && isascii(reboot_mode[0])) {
                if (!getenv("reboot-mode"))
-                       setenv("reboot-mode", (char *)reboot_mode);
+                       env_set("reboot-mode", (char *)reboot_mode);
        }
 
        omap_reboot_mode_clear();
index e265e2a73291f5b0643d6c403569a852aad52495..8d0a66621d89fe5daeb325d17770dded50c36353 100644 (file)
@@ -367,7 +367,7 @@ int board_init(void)
 
 int board_late_init(void)
 {
-       setenv("board_name", "mccmon6");
+       env_set("board_name", "mccmon6");
 
        return 0;
 }
index 0a7d4124a62830f4aa07ae58221a16c7c977a34e..78fc5466b692522afc41666bba6ce9b86a3c84ad 100644 (file)
@@ -173,11 +173,11 @@ int board_init(void)
 
 int board_late_init(void)
 {
-       setenv("board_name", "imx6logic");
+       env_set("board_name", "imx6logic");
 
        if (is_mx6dq()) {
-               setenv("board_rev", "MX6DQ");
-               setenv("fdt_file", "imx6q-logicpd.dtb");
+               env_set("board_rev", "MX6DQ");
+               env_set("fdt_file", "imx6q-logicpd.dtb");
        }
 
        return 0;
index f8b9f687fb1b8c46dd58113a196dcac40bc8b6cb..e86e0c30276474db53f3200d988f289d89a1d0ff 100644 (file)
@@ -220,7 +220,7 @@ int board_late_init(void)
 
                /* If the user has not set fdtimage, set the default */
                if (!getenv("fdtimage"))
-                       setenv("fdtimage", board->fdtfile);
+                       env_set("fdtimage", board->fdtfile);
        }
 
        /* restore hsusb0_data5 pin as hsusb0_data5 */
index 6a4427a42e2b91dd08839dd8a34dd6fc7d541415..889e748f983e9f12f591cdf16652916ca80027d9 100644 (file)
@@ -413,7 +413,7 @@ int misc_init_r(void)
 
        /* set env variable attkernaddr for relocated kernel */
        sprintf(buf, "%#x", KERNEL_ADDRESS);
-       setenv("attkernaddr", buf);
+       env_set("attkernaddr", buf);
 
        /* initialize omap tags */
        init_omap_tags();
index adf33cfd37e328558f122306592b5bbd24598ef5..140e34d4dd6147e5e9f8aaeaebc897b69e76bfc5 100644 (file)
@@ -172,47 +172,47 @@ int misc_init_r(void)
                        expansion_config.revision,
                        expansion_config.fab_revision);
                MUX_GUMSTIX();
-               setenv("defaultdisplay", "dvi");
-               setenv("expansionname", "summit");
+               env_set("defaultdisplay", "dvi");
+               env_set("expansionname", "summit");
                break;
        case GUMSTIX_TOBI:
                printf("Recognized Tobi expansion board (rev %d %s)\n",
                        expansion_config.revision,
                        expansion_config.fab_revision);
                MUX_GUMSTIX();
-               setenv("defaultdisplay", "dvi");
-               setenv("expansionname", "tobi");
+               env_set("defaultdisplay", "dvi");
+               env_set("expansionname", "tobi");
                break;
        case GUMSTIX_TOBI_DUO:
                printf("Recognized Tobi Duo expansion board (rev %d %s)\n",
                        expansion_config.revision,
                        expansion_config.fab_revision);
                MUX_GUMSTIX();
-               setenv("expansionname", "tobiduo");
+               env_set("expansionname", "tobiduo");
                break;
        case GUMSTIX_PALO35:
                printf("Recognized Palo35 expansion board (rev %d %s)\n",
                        expansion_config.revision,
                        expansion_config.fab_revision);
                MUX_GUMSTIX();
-               setenv("defaultdisplay", "lcd35");
-               setenv("expansionname", "palo35");
+               env_set("defaultdisplay", "lcd35");
+               env_set("expansionname", "palo35");
                break;
        case GUMSTIX_PALO43:
                printf("Recognized Palo43 expansion board (rev %d %s)\n",
                        expansion_config.revision,
                        expansion_config.fab_revision);
                MUX_GUMSTIX();
-               setenv("defaultdisplay", "lcd43");
-               setenv("expansionname", "palo43");
+               env_set("defaultdisplay", "lcd43");
+               env_set("expansionname", "palo43");
                break;
        case GUMSTIX_CHESTNUT43:
                printf("Recognized Chestnut43 expansion board (rev %d %s)\n",
                        expansion_config.revision,
                        expansion_config.fab_revision);
                MUX_GUMSTIX();
-               setenv("defaultdisplay", "lcd43");
-               setenv("expansionname", "chestnut43");
+               env_set("defaultdisplay", "lcd43");
+               env_set("expansionname", "chestnut43");
                break;
        case GUMSTIX_PINTO:
                printf("Recognized Pinto expansion board (rev %d %s)\n",
@@ -225,8 +225,8 @@ int misc_init_r(void)
                        expansion_config.revision,
                        expansion_config.fab_revision);
                MUX_GUMSTIX();
-               setenv("defaultdisplay", "lcd43");
-               setenv("expansionname", "gallop43");
+               env_set("defaultdisplay", "lcd43");
+               env_set("expansionname", "gallop43");
                break;
        case GUMSTIX_ALTO35:
                printf("Recognized Alto35 expansion board (rev %d %s)\n",
@@ -234,8 +234,8 @@ int misc_init_r(void)
                        expansion_config.fab_revision);
                MUX_GUMSTIX();
                MUX_ALTO35();
-               setenv("defaultdisplay", "lcd35");
-               setenv("expansionname", "alto35");
+               env_set("defaultdisplay", "lcd35");
+               env_set("expansionname", "alto35");
                break;
        case GUMSTIX_STAGECOACH:
                printf("Recognized Stagecoach expansion board (rev %d %s)\n",
@@ -261,8 +261,8 @@ int misc_init_r(void)
                        expansion_config.fab_revision);
                MUX_GUMSTIX();
                MUX_ARBOR43C();
-               setenv("defaultdisplay", "lcd43");
-               setenv("expansionname", "arbor43c");
+               env_set("defaultdisplay", "lcd43");
+               env_set("expansionname", "arbor43c");
                break;
        case ETTUS_USRP_E:
                printf("Recognized Ettus Research USRP-E (rev %d %s)\n",
@@ -270,13 +270,13 @@ int misc_init_r(void)
                        expansion_config.fab_revision);
                MUX_GUMSTIX();
                MUX_USRP_E();
-               setenv("defaultdisplay", "dvi");
+               env_set("defaultdisplay", "dvi");
                break;
        case GUMSTIX_NO_EEPROM:
        case GUMSTIX_EMPTY_EEPROM:
                puts("No or empty EEPROM on expansion board\n");
                MUX_GUMSTIX();
-               setenv("expansionname", "tobi");
+               env_set("expansionname", "tobi");
                break;
        default:
                printf("Unrecognized expansion board 0x%08x\n", expansion_id);
@@ -284,14 +284,14 @@ int misc_init_r(void)
        }
 
        if (expansion_config.content == 1)
-               setenv(expansion_config.env_var, expansion_config.env_setting);
+               env_set(expansion_config.env_var, expansion_config.env_setting);
 
        omap_die_id_display();
 
        if (get_cpu_family() == CPU_OMAP34XX)
-               setenv("boardname", "overo");
+               env_set("boardname", "overo");
        else
-               setenv("boardname", "overo-storm");
+               env_set("boardname", "overo-storm");
 
        return 0;
 }
index 37d0b85e0eacb7f6417d8b0b83965bbac8c89e3e..848e27848b743a3d7c31b43966b127e5064a2b4b 100644 (file)
@@ -128,7 +128,7 @@ int misc_init_r(void)
        }
 
        if (dm_gpio_get_value(&resin)) {
-               setenv("bootdelay", "-1");
+               env_set("bootdelay", "-1");
                printf("Power button pressed - dropping to console.\n");
        }
 
index d3c6ba580f5cadf7e1b387a2d580424c5dcde138..c1985fd41839e24cdd345e8b78992f9143c0a013 100644 (file)
@@ -251,7 +251,7 @@ static void set_fdtfile(void)
                return;
 
        fdtfile = model->fdtfile;
-       setenv("fdtfile", fdtfile);
+       env_set("fdtfile", fdtfile);
 }
 
 /*
@@ -303,7 +303,7 @@ static void set_usbethaddr(void)
        eth_setenv_enetaddr("usbethaddr", msg->get_mac_address.body.resp.mac);
 
        if (!getenv("ethaddr"))
-               setenv("ethaddr", getenv("usbethaddr"));
+               env_set("ethaddr", getenv("usbethaddr"));
 
        return;
 }
@@ -314,13 +314,13 @@ static void set_board_info(void)
        char s[11];
 
        snprintf(s, sizeof(s), "0x%X", revision);
-       setenv("board_revision", s);
+       env_set("board_revision", s);
        snprintf(s, sizeof(s), "%d", rev_scheme);
-       setenv("board_rev_scheme", s);
+       env_set("board_rev_scheme", s);
        /* Can't rename this to board_rev_type since it's an ABI for scripts */
        snprintf(s, sizeof(s), "0x%X", rev_type);
-       setenv("board_rev", s);
-       setenv("board_name", model->name);
+       env_set("board_rev", s);
+       env_set("board_name", model->name);
 }
 #endif /* CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG */
 
@@ -345,7 +345,7 @@ static void set_serial_number(void)
 
        snprintf(serial_string, sizeof(serial_string), "%016" PRIx64,
                 msg->get_board_serial.body.resp.serial);
-       setenv("serial#", serial_string);
+       env_set("serial#", serial_string);
 }
 
 int misc_init_r(void)
index 28b557a5b08ad76a4a81bbd4bf3277c01bbf7f0f..e4bb440d2455d8eb306d9a55208fc96a1bd785a4 100644 (file)
@@ -55,7 +55,7 @@ int board_late_init(void)
        /* Set MAC address */
        sprintf(env_mac, "%02X:%02X:%02X:%02X:%02X:%02X",
                mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
-       setenv("ethaddr", env_mac);
+       env_set("ethaddr", env_mac);
 
        debug_led(0x0F);
 
index 525d9797242ddeac2ab7e1663b668d76f7aa2510..4a76fb73ee963bb9d8b8d0742a7d0f8fe4b6cb75 100644 (file)
@@ -221,10 +221,10 @@ static void init_ethernet_mac(void)
        for (i = 0; i < SH7752EVB_ETHERNET_NUM_CH; i++) {
                get_sh_eth_mac(i, mac_string, buf);
                if (i == 0)
-                       setenv("ethaddr", mac_string);
+                       env_set("ethaddr", mac_string);
                else {
                        sprintf(env_string, "eth%daddr", i);
-                       setenv(env_string, mac_string);
+                       env_set(env_string, mac_string);
                }
                set_mac_to_sh_giga_eth_register(i, mac_string);
        }
index 3d1eedaa5f520562799f963a659061e6fa7be01a..ca9e1447438334f66531dc2a1bdbc6c6794d8cae 100644 (file)
@@ -237,10 +237,10 @@ static void init_ethernet_mac(void)
        for (i = 0; i < SH7753EVB_ETHERNET_NUM_CH; i++) {
                get_sh_eth_mac(i, mac_string, buf);
                if (i == 0)
-                       setenv("ethaddr", mac_string);
+                       env_set("ethaddr", mac_string);
                else {
                        sprintf(env_string, "eth%daddr", i);
-                       setenv(env_string, mac_string);
+                       env_set(env_string, mac_string);
                }
                set_mac_to_sh_giga_eth_register(i, mac_string);
        }
index 0a04a9d39dcbb9c21d8e7ea5559365c360eed6a3..3f970fc401bfe1773f7553812778a5108beb0af0 100644 (file)
@@ -278,10 +278,10 @@ static void init_ethernet_mac(void)
        for (i = 0; i < SH7757LCR_ETHERNET_NUM_CH; i++) {
                get_sh_eth_mac(i, mac_string, buf);
                if (i == 0)
-                       setenv("ethaddr", mac_string);
+                       env_set("ethaddr", mac_string);
                else {
                        sprintf(env_string, "eth%daddr", i);
-                       setenv(env_string, mac_string);
+                       env_set(env_string, mac_string);
                }
 
                set_mac_to_sh_eth_register(i, mac_string);
@@ -291,7 +291,7 @@ static void init_ethernet_mac(void)
        for (i = 0; i < SH7757LCR_GIGA_ETHERNET_NUM_CH; i++) {
                get_sh_eth_mac(i + SH7757LCR_ETHERNET_NUM_CH, mac_string, buf);
                sprintf(env_string, "eth%daddr", i + SH7757LCR_ETHERNET_NUM_CH);
-               setenv(env_string, mac_string);
+               env_set(env_string, mac_string);
 
                set_mac_to_sh_giga_eth_register(i, mac_string);
        }
index 7e2edf4a566a3f3dd4a7b6d275cb65551982e3ca..91349948740bcbe01c5096dad653fa8faeffeddc 100644 (file)
@@ -44,7 +44,7 @@ int rk_board_late_init(void)
 {
        if (fastboot_key_pressed()) {
                printf("enter fastboot!\n");
-               setenv("preboot", "setenv preboot; fastboot usb0");
+               env_set("preboot", "setenv preboot; fastboot usb0");
        }
 
        return 0;
index b18eed2facbc83d2f9e046dea0f684674978959b..4157349d028b0c0eb488c1e6d364b3b36acfc742 100644 (file)
@@ -51,7 +51,7 @@ void set_dfu_alt_info(char *interface, char *devstr)
 
        alt_setting = get_dfu_alt_boot(interface, devstr);
        if (alt_setting) {
-               setenv("dfu_alt_boot", alt_setting);
+               env_set("dfu_alt_boot", alt_setting);
                offset = snprintf(buf, buf_size, "%s", alt_setting);
        }
 
@@ -71,7 +71,7 @@ void set_dfu_alt_info(char *interface, char *devstr)
                status = "done\n";
        }
 
-       setenv("dfu_alt_info", alt_info);
+       env_set("dfu_alt_info", alt_info);
        puts(status);
 }
 #endif
@@ -83,14 +83,14 @@ void set_board_info(void)
 
        snprintf(info, ARRAY_SIZE(info), "%u.%u", (s5p_cpu_rev & 0xf0) >> 4,
                 s5p_cpu_rev & 0xf);
-       setenv("soc_rev", info);
+       env_set("soc_rev", info);
 
        snprintf(info, ARRAY_SIZE(info), "%x", s5p_cpu_id);
-       setenv("soc_id", info);
+       env_set("soc_id", info);
 
 #ifdef CONFIG_REVISION_TAG
        snprintf(info, ARRAY_SIZE(info), "%x", get_board_rev());
-       setenv("board_rev", info);
+       env_set("board_rev", info);
 #endif
 #ifdef CONFIG_OF_LIBFDT
        const char *bdtype = "";
@@ -102,11 +102,11 @@ void set_board_info(void)
                bdtype = "";
 
        sprintf(info, "%s%s", bdname, bdtype);
-       setenv("boardname", info);
+       env_set("boardname", info);
 #endif
        snprintf(info, ARRAY_SIZE(info),  "%s%x-%s%s.dtb",
                 CONFIG_SYS_SOC, s5p_cpu_id, bdname, bdtype);
-       setenv("fdtfile", info);
+       env_set("fdtfile", info);
 #endif
 }
 #endif /* CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG */
index 00059a13174af9968da5afa3bbe8138512b42361..f0913383b97b1d76d3171433d7518d76f474fc48 100644 (file)
@@ -469,7 +469,7 @@ void exynos_lcd_misc_init(vidinfo_t *vid)
 #endif
 #ifdef CONFIG_S6E8AX0
        s6e8ax0_init();
-       setenv("lcdinfo", "lcd=s6e8ax0");
+       env_set("lcdinfo", "lcd=s6e8ax0");
 #endif
 }
 #endif
index cc6eaf7ad0fe33e9b1b5b8bdde64d0d1250db77c..549ac8b48aeb27b86d1a72fd55a8870ff3f96770 100644 (file)
@@ -397,6 +397,6 @@ void exynos_lcd_misc_init(vidinfo_t *vid)
        vid->pclk_name = 1;     /* MPLL */
        vid->sclk_div = 1;
 
-       setenv("lcdinfo", "lcd=ld9040");
+       env_set("lcdinfo", "lcd=ld9040");
 }
 #endif
index 5c8b4367767bb127c525290b510c2408a8592426..d15f2a9c1d5b6cd9211128ce9abe19841294c23a 100644 (file)
@@ -413,11 +413,11 @@ static int set_pin_state(void)
                return ret;
 
        if (val >= VAL_UPPER)
-               setenv("pin_state", "connected");
+               env_set("pin_state", "connected");
        else if (val < VAL_UPPER && val > VAL_LOWER)
-               setenv("pin_state", "open");
+               env_set("pin_state", "open");
        else
-               setenv("pin_state", "button");
+               env_set("pin_state", "button");
 
        return ret;
 }
index f888ecbbc19602601f2084f22d95dbaf510583fd..2ee6d3b554904239db26dcd1f982322af7c6c847 100644 (file)
@@ -69,9 +69,9 @@ int misc_init_r(void)
        /* Check EEPROM signature. */
        if (!(data[0] == 0xa5 && data[1] == 0x5a)) {
                puts("Invalid I2C EEPROM signature.\n");
-               setenv("unit_serial", "invalid");
-               setenv("unit_ident", "VINing-xxxx-STD");
-               setenv("hostname", "vining-invalid");
+               env_set("unit_serial", "invalid");
+               env_set("unit_ident", "VINing-xxxx-STD");
+               env_set("hostname", "vining-invalid");
                return 0;
        }
 
@@ -82,13 +82,13 @@ int misc_init_r(void)
                         (data[0x56] << 8) | (data[0x57] << 0);
                memset(str, 0, sizeof(str));
                sprintf(str, "%07i", serial);
-               setenv("unit_serial", str);
+               env_set("unit_serial", str);
        }
 
        if (!getenv("unit_ident")) {
                memset(str, 0, sizeof(str));
                memcpy(str, &data[0x2e], 18);
-               setenv("unit_ident", str);
+               env_set("unit_ident", str);
        }
 
        /* Set ethernet address from EEPROM. */
index 6c869ed2b035a0e9f840e1f6f960fe0e6ac824e5..4e5ad58d44cc2038acd90cc83fea0180242dab0d 100644 (file)
@@ -266,7 +266,7 @@ err:
 
 static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
 
-static int factoryset_mac_setenv(void)
+static int factoryset_mac_env_set(void)
 {
        uint8_t mac_addr[6];
 
@@ -296,11 +296,11 @@ static int factoryset_mac_setenv(void)
        return 0;
 }
 
-int factoryset_setenv(void)
+int factoryset_env_set(void)
 {
        int ret = 0;
 
-       if (factoryset_mac_setenv() < 0)
+       if (factoryset_mac_env_set() < 0)
                ret = -1;
 
        return ret;
index 3f23d5ebf4126fd1eb1f711e45d473bac3d15e71..8602627d2e18fa52f935516bdab366e6c07a78f0 100644 (file)
@@ -25,7 +25,7 @@ struct factorysetcontainer {
 };
 
 int factoryset_read_eeprom(int i2c_addr);
-int factoryset_setenv(void);
+int factoryset_env_set(void);
 extern struct factorysetcontainer factory_dat;
 
 #endif /* __FACTORYSET_H */
index d8869a09dd007072d9eff554caa20f3acf69529c..c705b5ab0f6f63ff9f9c9a0eb085a9335fc67f76 100644 (file)
@@ -272,13 +272,13 @@ int board_late_init(void)
 #ifdef CONFIG_FACTORYSET
        /* Set ASN in environment*/
        if (factory_dat.asn[0] != 0) {
-               setenv("dtb_name", (char *)factory_dat.asn);
+               env_set("dtb_name", (char *)factory_dat.asn);
        } else {
                /* dtb suffix gets added in load script */
-               setenv("dtb_name", "am335x-draco");
+               env_set("dtb_name", "am335x-draco");
        }
 #else
-       setenv("dtb_name", "am335x-draco");
+       env_set("dtb_name", "am335x-draco");
 #endif
 
        return 0;
@@ -330,7 +330,7 @@ int board_eth_init(bd_t *bis)
        int n = 0;
        int rv;
 
-       factoryset_setenv();
+       factoryset_env_set();
 
        /* Set rgmii mode and enable rmii clock to be sourced from chip */
        writel((RMII_MODE_ENABLE | RMII_CHIPCKL_ENABLE), &cdev->miisel);
index 750f33889742d86cd84f2f71a9b54ebf21c2d91f..012974d8ebde567a9e8ddf6614a0aaec18d71a01 100644 (file)
@@ -446,12 +446,12 @@ int board_late_init(void)
                        factory_dat.pxm50 = 0;
                sprintf(tmp, "%s_%s", factory_dat.asn,
                        factory_dat.comp_version);
-               ret = setenv("boardid", tmp);
+               ret = env_set("boardid", tmp);
                if (ret)
                        printf("error setting board id\n");
        } else {
                factory_dat.pxm50 = 1;
-               ret = setenv("boardid", "PXM50_1.0");
+               ret = env_set("boardid", "PXM50_1.0");
                if (ret)
                        printf("error setting board id\n");
        }
index b3c666c054f1060fccc61edfd5679d2801cdbc00..2a97414bafa508d4a59137d35ef04426676b3521 100644 (file)
@@ -182,7 +182,7 @@ int board_eth_init(bd_t *bis)
        int rv;
 
 #ifndef CONFIG_SPL_BUILD
-       factoryset_setenv();
+       factoryset_env_set();
 #endif
 
        /* Set rgmii mode and enable rmii clock to be sourced from chip */
@@ -482,7 +482,7 @@ int board_late_init(void)
        else
                strcpy(tmp, "QMX7.E38_4.0");
 
-       ret = setenv("boardid", tmp);
+       ret = env_set("boardid", tmp);
        if (ret)
                printf("error setting board id\n");
 
index 3b742ebc224599bf48241cf0492803d218158a64..d877a9c77145994d19bd888112fc1e20618d8987 100644 (file)
@@ -380,9 +380,9 @@ static int upgrade_failure_fallback(void)
        partitionset_active = getenv("partitionset_active");
        if (partitionset_active) {
                if (partitionset_active[0] == 'A')
-                       setenv("partitionset_active", "B");
+                       env_set("partitionset_active", "B");
                else
-                       setenv("partitionset_active", "A");
+                       env_set("partitionset_active", "A");
        } else {
                printf("partitionset_active missing.\n");
                return -ENOENT;
@@ -390,22 +390,22 @@ static int upgrade_failure_fallback(void)
 
        rootfs = getenv("rootfs");
        rootfs_fallback = getenv("rootfs_fallback");
-       setenv("rootfs", rootfs_fallback);
-       setenv("rootfs_fallback", rootfs);
+       env_set("rootfs", rootfs_fallback);
+       env_set("rootfs_fallback", rootfs);
 
        kern_size = getenv("kernel_size");
        kern_size_fb = getenv("kernel_size_fallback");
-       setenv("kernel_size", kern_size_fb);
-       setenv("kernel_size_fallback", kern_size);
+       env_set("kernel_size", kern_size_fb);
+       env_set("kernel_size_fallback", kern_size);
 
        kern_off = getenv("kernel_Off");
        kern_off_fb = getenv("kernel_Off_fallback");
-       setenv("kernel_Off", kern_off_fb);
-       setenv("kernel_Off_fallback", kern_off);
+       env_set("kernel_Off", kern_off_fb);
+       env_set("kernel_Off_fallback", kern_off);
 
-       setenv("bootargs", '\0');
-       setenv("upgrade_available", '\0');
-       setenv("boot_retries", '\0');
+       env_set("bootargs", '\0');
+       env_set("upgrade_available", '\0');
+       env_set("boot_retries", '\0');
        env_save();
 
        return 0;
@@ -424,7 +424,7 @@ static int do_upgrade_available(cmd_tbl_t *cmdtp, int flag, int argc,
                boot_retry = simple_strtoul(getenv("boot_retries"), NULL, 10);
                boot_retry++;
                sprintf(boot_buf, "%lx", boot_retry);
-               setenv("boot_retries", boot_buf);
+               env_set("boot_retries", boot_buf);
                env_save();
 
                /*
index 1ccdfa8e056064cc7446cd85a8920d3468f043ed..7e59fb259e118fd99400261453088d0ab7231da4 100644 (file)
@@ -376,14 +376,14 @@ int board_late_init(void)
 {
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
        if (is_hummingboard())
-               setenv("board_name", "HUMMINGBOARD");
+               env_set("board_name", "HUMMINGBOARD");
        else
-               setenv("board_name", "CUBOXI");
+               env_set("board_name", "CUBOXI");
 
        if (is_mx6dq())
-               setenv("board_rev", "MX6Q");
+               env_set("board_rev", "MX6Q");
        else
-               setenv("board_rev", "MX6DL");
+               env_set("board_rev", "MX6DL");
 #endif
 
        return 0;
index d6a84dba60eb346c94830ac67378da78c27f9009..3bb4ff14d9ebf951cb48022c45294842ff3f22ee 100644 (file)
@@ -56,12 +56,12 @@ int misc_init_r(void)
        if (!eth_getenv_enetaddr("ethaddr", mac_id) && !i2c_read_mac(mac_id))
                eth_setenv_enetaddr("ethaddr", mac_id);
 #endif
-       setenv("verify", "n");
+       env_set("verify", "n");
 
 #if defined(CONFIG_SPEAR_USBTTY)
-       setenv("stdin", "usbtty");
-       setenv("stdout", "usbtty");
-       setenv("stderr", "usbtty");
+       env_set("stdin", "usbtty");
+       env_set("stdout", "usbtty");
+       env_set("stderr", "usbtty");
 
 #ifndef CONFIG_SYS_NO_DCACHE
        dcache_enable();
index 8c8abf6a0670cfca1b6ee5d5826c5bd121c6e08c..673e7728f1d69f1ce6a59c03a81cfb77bd31eb5b 100644 (file)
@@ -320,7 +320,7 @@ int misc_init_r(void)
                u_id_high = readl(&STM32_U_ID->u_id_high);
                sprintf(serialno, "%08x%08x%08x",
                        u_id_high, u_id_mid, u_id_low);
-               setenv("serial#", serialno);
+               env_set("serial#", serialno);
        }
 
        return 0;
index 800f412b383ddf9ac90972e50a684c534d40fea4..b1fcd9d0b90ac9ced69271509e28a2968e856f6a 100644 (file)
@@ -712,7 +712,7 @@ static void setup_environment(const void *fdt)
                        snprintf(serial_string, sizeof(serial_string),
                                "%08x%08x", sid[0], sid[3]);
 
-                       setenv("serial#", serial_string);
+                       env_set("serial#", serial_string);
                }
        }
 }
@@ -721,11 +721,11 @@ int misc_init_r(void)
 {
        __maybe_unused int ret;
 
-       setenv("fel_booted", NULL);
-       setenv("fel_scriptaddr", NULL);
+       env_set("fel_booted", NULL);
+       env_set("fel_scriptaddr", NULL);
        /* determine if we are running in FEL mode */
        if (!is_boot0_magic(SPL_ADDR + 4)) { /* eGON.BT0 */
-               setenv("fel_booted", "1");
+               env_set("fel_booted", "1");
                parse_spl_header(SPL_ADDR);
        }
 
index bdbf02a06769cfcd89d7318f7f02d8484f970a5f..e02dcf299506f3b99b4db42f01c4e3e90c73f46c 100644 (file)
@@ -156,9 +156,9 @@ int board_late_init(void)
                                gpio_set_value(IMX_GPIO_NR(1, 29), 0);
                                gpio_set_value(IMX_GPIO_NR(4, 21), 0);
 
-                               setenv("preboot", "run gs_slow_boot");
+                               env_set("preboot", "run gs_slow_boot");
                        } else
-                               setenv("preboot", "run gs_fast_boot");
+                               env_set("preboot", "run gs_fast_boot");
                }
        }
 
index 9347329eac8820aef75d128503b7b08f7cf60b9b..fd3b6384660a447789e053ba63701c70f4b7bd60 100644 (file)
@@ -144,8 +144,8 @@ static void setup_serial(void)
        serialno |= (u64)crc32_no_comp(serialno, high, 8) << 32;
        snprintf(serialno_str, sizeof(serialno_str), "%llx", serialno);
 
-       setenv("cpuid#", cpuid_str);
-       setenv("serial#", serialno_str);
+       env_set("cpuid#", cpuid_str);
+       env_set("serial#", serialno_str);
 #endif
 
        return;
index ac0592b725e00997ee3eb977b33ad24520eb4126..5751b814ca263f5649ad718634e7cb40c2ee8210 100644 (file)
@@ -731,7 +731,7 @@ int board_late_init(void)
         * on HS devices.
         */
        if (get_device_type() == HS_DEVICE)
-               setenv("boot_fit", "1");
+               env_set("boot_fit", "1");
 #endif
 
 #if !defined(CONFIG_SPL_BUILD)
index 933596d59c8276738ddb80b94da13126f388be23..55098bf81661f51afc98b883817263200bc21502 100644 (file)
@@ -626,7 +626,7 @@ int board_late_init(void)
         * on HS devices.
         */
        if (get_device_type() == HS_DEVICE)
-               setenv("boot_fit", "1");
+               env_set("boot_fit", "1");
 #endif
        return 0;
 }
index 126c9ef694f93185fe34a17476a68fe0fd118883..bd94a90f8f72c0b1bd0c20e1abb5a87bd7c7db02 100644 (file)
@@ -592,7 +592,7 @@ void am57x_idk_lcd_detect(void)
                /* we will let default be "no lcd" */
        }
 out:
-       setenv("idk_lcd", idk_lcd);
+       env_set("idk_lcd", idk_lcd);
        return;
 }
 
@@ -612,7 +612,7 @@ int board_late_init(void)
         * on HS devices.
         */
        if (get_device_type() == HS_DEVICE)
-               setenv("boot_fit", "1");
+               env_set("boot_fit", "1");
 
        /*
         * Set the GPIO7 Pad to POWERHOLD. This has higher priority
index 887b577b6adf940f709c36a037e38f22c17dae66..2f62fbec69e92ed47d56820ddb45744e8e238b48 100644 (file)
@@ -341,16 +341,16 @@ int misc_init_r(void)
        switch (get_board_revision()) {
        case REVISION_AXBX:
                printf("Beagle Rev Ax/Bx\n");
-               setenv("beaglerev", "AxBx");
+               env_set("beaglerev", "AxBx");
                break;
        case REVISION_CX:
                printf("Beagle Rev C1/C2/C3\n");
-               setenv("beaglerev", "Cx");
+               env_set("beaglerev", "Cx");
                MUX_BEAGLE_C();
                break;
        case REVISION_C4:
                printf("Beagle Rev C4\n");
-               setenv("beaglerev", "C4");
+               env_set("beaglerev", "C4");
                MUX_BEAGLE_C();
                /* Set VAUX2 to 1.8V for EHCI PHY */
                twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
@@ -360,7 +360,7 @@ int misc_init_r(void)
                break;
        case REVISION_XM_AB:
                printf("Beagle xM Rev A/B\n");
-               setenv("beaglerev", "xMAB");
+               env_set("beaglerev", "xMAB");
                MUX_BEAGLE_XM();
                /* Set VAUX2 to 1.8V for EHCI PHY */
                twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
@@ -371,7 +371,7 @@ int misc_init_r(void)
                break;
        case REVISION_XM_C:
                printf("Beagle xM Rev C\n");
-               setenv("beaglerev", "xMC");
+               env_set("beaglerev", "xMC");
                MUX_BEAGLE_XM();
                /* Set VAUX2 to 1.8V for EHCI PHY */
                twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
@@ -397,14 +397,14 @@ int misc_init_r(void)
                        expansion_config.revision,
                        expansion_config.fab_revision);
                MUX_TINCANTOOLS_ZIPPY();
-               setenv("buddy", "zippy");
+               env_set("buddy", "zippy");
                break;
        case TINCANTOOLS_ZIPPY2:
                printf("Recognized Tincantools Zippy2 board (rev %d %s)\n",
                        expansion_config.revision,
                        expansion_config.fab_revision);
                MUX_TINCANTOOLS_ZIPPY();
-               setenv("buddy", "zippy2");
+               env_set("buddy", "zippy2");
                break;
        case TINCANTOOLS_TRAINER:
                printf("Recognized Tincantools Trainer board (rev %d %s)\n",
@@ -412,37 +412,37 @@ int misc_init_r(void)
                        expansion_config.fab_revision);
                MUX_TINCANTOOLS_ZIPPY();
                MUX_TINCANTOOLS_TRAINER();
-               setenv("buddy", "trainer");
+               env_set("buddy", "trainer");
                break;
        case TINCANTOOLS_SHOWDOG:
                printf("Recognized Tincantools Showdow board (rev %d %s)\n",
                        expansion_config.revision,
                        expansion_config.fab_revision);
                /* Place holder for DSS2 definition for showdog lcd */
-               setenv("defaultdisplay", "showdoglcd");
-               setenv("buddy", "showdog");
+               env_set("defaultdisplay", "showdoglcd");
+               env_set("buddy", "showdog");
                break;
        case KBADC_BEAGLEFPGA:
                printf("Recognized KBADC Beagle FPGA board\n");
                MUX_KBADC_BEAGLEFPGA();
-               setenv("buddy", "beaglefpga");
+               env_set("buddy", "beaglefpga");
                break;
        case LW_BEAGLETOUCH:
                printf("Recognized Liquidware BeagleTouch board\n");
-               setenv("buddy", "beagletouch");
+               env_set("buddy", "beagletouch");
                break;
        case BRAINMUX_LCDOG:
                printf("Recognized Brainmux LCDog board\n");
-               setenv("buddy", "lcdog");
+               env_set("buddy", "lcdog");
                break;
        case BRAINMUX_LCDOGTOUCH:
                printf("Recognized Brainmux LCDog Touch board\n");
-               setenv("buddy", "lcdogtouch");
+               env_set("buddy", "lcdogtouch");
                break;
        case BBTOYS_WIFI:
                printf("Recognized BeagleBoardToys WiFi board\n");
                MUX_BBTOYS_WIFI()
-               setenv("buddy", "bbtoys-wifi");
+               env_set("buddy", "bbtoys-wifi");
                break;
        case BBTOYS_VGA:
                printf("Recognized BeagleBoardToys VGA board\n");
@@ -459,20 +459,20 @@ int misc_init_r(void)
        case LSR_COM6L_ADPT:
                printf("Recognized LSR COM6L Adapter Board\n");
                MUX_BBTOYS_WIFI()
-               setenv("buddy", "lsr-com6l-adpt");
+               env_set("buddy", "lsr-com6l-adpt");
                break;
        case BEAGLE_NO_EEPROM:
                printf("No EEPROM on expansion board\n");
-               setenv("buddy", "none");
+               env_set("buddy", "none");
                break;
        default:
                printf("Unrecognized expansion board: %x\n",
                        expansion_config.device_vendor);
-               setenv("buddy", "unknown");
+               env_set("buddy", "unknown");
        }
 
        if (expansion_config.content == 1)
-               setenv(expansion_config.env_var, expansion_config.env_setting);
+               env_set(expansion_config.env_var, expansion_config.env_setting);
 
        twl4030_power_init();
        switch (get_board_revision()) {
index 1da5ace9236d7d8d17e0d2c67d99ad9ad7a8ef5f..c4ef28282f9ec66b3d909d725295bb8d49baf325 100644 (file)
@@ -379,21 +379,21 @@ void __maybe_unused set_board_info_env(char *name)
        struct ti_common_eeprom *ep = TI_EEPROM_DATA;
 
        if (name)
-               setenv("board_name", name);
+               env_set("board_name", name);
        else if (ep->name)
-               setenv("board_name", ep->name);
+               env_set("board_name", ep->name);
        else
-               setenv("board_name", unknown);
+               env_set("board_name", unknown);
 
        if (ep->version)
-               setenv("board_rev", ep->version);
+               env_set("board_rev", ep->version);
        else
-               setenv("board_rev", unknown);
+               env_set("board_rev", unknown);
 
        if (ep->serial)
-               setenv("board_serial", ep->serial);
+               env_set("board_serial", ep->serial);
        else
-               setenv("board_serial", unknown);
+               env_set("board_serial", unknown);
 }
 
 static u64 mac_to_u64(u8 mac[6])
index 23be2c70e47ae9a7e1877c9c9b82da93d26d4392..5c43561bb7e425acf09025c7631ec97c51851ab5 100644 (file)
@@ -558,7 +558,7 @@ int board_late_init(void)
         * on HS devices.
         */
        if (get_device_type() == HS_DEVICE)
-               setenv("boot_fit", "1");
+               env_set("boot_fit", "1");
 
        omap_die_id_serial();
        omap_set_fastboot_vars();
index 21605762ef51a59dc1bfdad80397c529e66d5cf5..15f0f54af633c61cc6877aa4432dcfbfaa88ce38 100644 (file)
@@ -310,9 +310,9 @@ int board_late_init(void)
 
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
        if (board_is_k2g_gp())
-               setenv("board_name", "66AK2GGP\0");
+               env_set("board_name", "66AK2GGP\0");
        else if (board_is_k2g_ice())
-               setenv("board_name", "66AK2GIC\0");
+               env_set("board_name", "66AK2GIC\0");
 #endif
        return 0;
 }
index 6ffb53c4c618d55cd4a602e75f5e4f1f8dd14642..c59e58a82a55ea28a672ca6da216b9c09fedb7d1 100644 (file)
@@ -103,7 +103,7 @@ int get_board_revision(void)
                board_id4 = gpio_get_value(PANDA_ES_BOARD_ID_4_GPIO);
 
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
-               setenv("board_name", "panda-es");
+               env_set("board_name", "panda-es");
 #endif
                board_id = ((board_id4 << 4) | (board_id3 << 3) |
                        (board_id2 << 2) | (board_id1 << 1) | (board_id0));
@@ -117,7 +117,7 @@ int get_board_revision(void)
 
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
                if ((board_id >= 0x3) && (processor_rev == OMAP4430_ES2_3))
-                       setenv("board_name", "panda-a4");
+                       env_set("board_name", "panda-a4");
 #endif
        }
 
index e41547bbee693ef26a2f5e7e7a77ab7d7c2f082f..86a7a159e8cddac6b32f385facaf03a03c99de56 100644 (file)
@@ -804,7 +804,7 @@ int board_late_init(void)
 
        rev = get_board_rev();
        snprintf(env_str, ARRAY_SIZE(env_str), "%.4x", rev);
-       setenv("board_rev", env_str);
+       env_set("board_rev", env_str);
 
 #ifndef CONFIG_TDX_APALIS_IMX6_V1_0
        if ((rev & 0xfff0) == 0x0100) {
@@ -816,7 +816,7 @@ int board_late_init(void)
                /* if using the default device tree, use version for V1.0 HW */
                fdt_env = getenv("fdt_file");
                if ((fdt_env != NULL) && (strcmp(FDT_FILE, fdt_env) == 0)) {
-                       setenv("fdt_file", FDT_FILE_V1_0);
+                       env_set("fdt_file", FDT_FILE_V1_0);
                        printf("patching fdt_file to " FDT_FILE_V1_0 "\n");
 #ifndef CONFIG_ENV_IS_NOWHERE
                        env_save();
index cbf7aa952a90cef3ecdbbac237c769c57dd31ff6..dbcd2337829dbfb62231b34d5055c0927eea0d37 100644 (file)
@@ -676,7 +676,7 @@ int board_late_init(void)
 
        rev = get_board_rev();
        snprintf(env_str, ARRAY_SIZE(env_str), "%.4x", rev);
-       setenv("board_rev", env_str);
+       env_set("board_rev", env_str);
 #endif
 
        return 0;
index 46dd15bac81e3c6a8f66452f810e929421c51f23..3858af9c404e09fe19557971433e22ecdc82679a 100644 (file)
@@ -535,7 +535,7 @@ int board_late_init(void)
        if (((src->sbmr2 & SRC_SBMR2_BMOD_MASK) >> SRC_SBMR2_BMOD_SHIFT)
                        == SRC_SBMR2_BMOD_SERIAL) {
                printf("Serial Downloader recovery mode, disable autoboot\n");
-               setenv("bootdelay", "-1");
+               env_set("bootdelay", "-1");
        }
 
        return 0;
index 0d267877fa4f38ba3b8b8a67cb70855d956a8cef..77ebb8831753a6ba26d68e13fadeb91f1888f2ae 100644 (file)
@@ -80,7 +80,7 @@ int show_board_info(void)
                tdx_hw_tag.ver_minor,
                (char)tdx_hw_tag.ver_assembly + 'A');
 
-       setenv("serial#", tdx_serial_str);
+       env_set("serial#", tdx_serial_str);
 
        /*
         * Check if environment contains a valid MAC address,
index fcdea34f050a06f6f61d1765e4be2aee2036973e..14991fdb00c078dd1512cbf5c8548db7f3207d91 100644 (file)
@@ -251,7 +251,7 @@ int power_init_board(void)
 
 int board_late_init(void)
 {
-       setenv("board_name", tqma6_get_boardname());
+       env_set("board_name", tqma6_get_boardname());
 
        tqma6_bb_board_late_init();
 
index 276c625cfd813683725bc14ba8509469f02c3370..7fa1289de0410799a267d5bad598f5476cfea2fb 100644 (file)
@@ -437,7 +437,7 @@ int checkboard(void)
 int board_late_init(void)
 {
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
-       setenv("board_name", board_string());
+       env_set("board_name", board_string());
 #endif
 
        return 0;
index 7534935dde0f64ce7f590161cb98a68f3fdbae03..a359626b818a727d3e83ecf61c3d428afac02e5d 100644 (file)
@@ -255,9 +255,9 @@ int board_late_init(void)
 {
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
        if (is_cpu_type(MXC_CPU_MX6Q))
-               setenv("board_rev", "MX6Q");
+               env_set("board_rev", "MX6Q");
        else
-               setenv("board_rev", "MX6DL");
+               env_set("board_rev", "MX6DL");
 #endif
        return 0;
 }
index b55ab818e6989dbd49f66328526fe41dbbe15b62..d23589731113760d496ab0ee7c88820d96a697e4 100644 (file)
@@ -401,7 +401,7 @@ int mac_read_from_generic_eeprom(const char *envvar, int chip,
                        mac[5]);
 
                printf("MAC: %s\n", ethaddr);
-               setenv(envvar, ethaddr);
+               env_set(envvar, ethaddr);
        }
 
        return ret;
@@ -487,7 +487,7 @@ int mac_read_from_eeprom_common(void)
                         * (i.e. have not yet been set)
                         */
                        if (!getenv(enetvar))
-                               setenv(enetvar, ethaddr);
+                               env_set(enetvar, ethaddr);
                }
        }
 
index d3b1f1564f3cd75344eeccb1aee3fd3c23d013c8..5f730b8fd0d3f6b5cc3bd7b46013161729ff3579 100644 (file)
@@ -68,7 +68,7 @@ static int baltos_set_console(void)
        printf("DIPs: 0x%1x\n", (~dips) & 0xf);
 
        if ((dips & 0xf) == 0xe)
-               setenv("console", "ttyUSB0,115200n8");
+               env_set("console", "ttyUSB0,115200n8");
 
        return 0;
 }
@@ -373,7 +373,7 @@ int board_late_init(void)
                return -ENODEV;
        }
 
-       setenv("board_name", model);
+       env_set("board_name", model);
 #endif
 
        return 0;
index 1dbc966b6eedab437ce37a0d4b2e47a4814ec09c..adfcf485627d899f95f7101813ef3558a84c4603 100644 (file)
@@ -425,14 +425,14 @@ int board_late_init(void)
 
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
        if (is_mx6dq())
-               setenv("board_rev", "MX6Q");
+               env_set("board_rev", "MX6Q");
        else
-               setenv("board_rev", "MX6DL");
+               env_set("board_rev", "MX6DL");
 
        if (is_revc1())
-               setenv("board_name", "C1");
+               env_set("board_name", "C1");
        else
-               setenv("board_name", "B1");
+               env_set("board_name", "B1");
 #endif
        return 0;
 }
index b2fbecf6dedd513213ae205e9a42007ebf6d678b..90ef542458a9c7a19e64be1c031282fe5f5cf3f6 100644 (file)
@@ -86,22 +86,22 @@ int board_late_init(void)
 {
        switch ((zynq_slcr_get_boot_mode()) & ZYNQ_BM_MASK) {
        case ZYNQ_BM_QSPI:
-               setenv("modeboot", "qspiboot");
+               env_set("modeboot", "qspiboot");
                break;
        case ZYNQ_BM_NAND:
-               setenv("modeboot", "nandboot");
+               env_set("modeboot", "nandboot");
                break;
        case ZYNQ_BM_NOR:
-               setenv("modeboot", "norboot");
+               env_set("modeboot", "norboot");
                break;
        case ZYNQ_BM_SD:
-               setenv("modeboot", "sdboot");
+               env_set("modeboot", "sdboot");
                break;
        case ZYNQ_BM_JTAG:
-               setenv("modeboot", "jtagboot");
+               env_set("modeboot", "jtagboot");
                break;
        default:
-               setenv("modeboot", "");
+               env_set("modeboot", "");
                break;
        }
 
index aebd3df8a9768a8b4c6f18099cea49dc9cd99ff7..b9e8649eb34a5beddda34f9edb499e85ba551987 100644 (file)
@@ -321,7 +321,7 @@ int board_late_init(void)
                                strlen(getenv("boot_targets")) + 2);
 
        sprintf(new_targets, "%s %s", mode, getenv("boot_targets"));
-       setenv("boot_targets", new_targets);
+       env_set("boot_targets", new_targets);
 
        return 0;
 }
index 05e19f8a72bf2be0146d3e4789b09bbea81ceb58..7af9bfec5fc251d3ce273edf2e3d41a3d831407a 100644 (file)
--- a/cmd/fdt.c
+++ b/cmd/fdt.c
@@ -49,15 +49,15 @@ void set_working_fdt_addr(ulong addr)
 /*
  * Get a value from the fdt and format it to be set in the environment
  */
-static int fdt_value_setenv(const void *nodep, int len, const char *var)
+static int fdt_value_env_set(const void *nodep, int len, const char *var)
 {
        if (is_printable_string(nodep, len))
-               setenv(var, (void *)nodep);
+               env_set(var, (void *)nodep);
        else if (len == 4) {
                char buf[11];
 
                sprintf(buf, "0x%08X", fdt32_to_cpu(*(fdt32_t *)nodep));
-               setenv(var, buf);
+               env_set(var, buf);
        } else if (len%4 == 0 && len <= 20) {
                /* Needed to print things like sha1 hashes. */
                char buf[41];
@@ -66,7 +66,7 @@ static int fdt_value_setenv(const void *nodep, int len, const char *var)
                for (i = 0; i < len; i += sizeof(unsigned int))
                        sprintf(buf + (i * 2), "%08x",
                                *(unsigned int *)(nodep + i));
-               setenv(var, buf);
+               env_set(var, buf);
        } else {
                printf("error: unprintable value\n");
                return 1;
@@ -358,10 +358,12 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                                if (curDepth == startDepth + 1)
                                        curIndex++;
                                if (subcmd[0] == 'n' && curIndex == reqIndex) {
-                                       const char *nodeName = fdt_get_name(
-                                           working_fdt, nextNodeOffset, NULL);
+                                       const char *node_name;
 
-                                       setenv(var, (char *)nodeName);
+                                       node_name = fdt_get_name(working_fdt,
+                                                                nextNodeOffset,
+                                                                NULL);
+                                       env_set(var, node_name);
                                        return 0;
                                }
                                nextNodeOffset = fdt_next_node(
@@ -382,13 +384,14 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                                working_fdt, nodeoffset, prop, &len);
                        if (len == 0) {
                                /* no property value */
-                               setenv(var, "");
+                               env_set(var, "");
                                return 0;
                        } else if (nodep && len > 0) {
                                if (subcmd[0] == 'v') {
                                        int ret;
 
-                                       ret = fdt_value_setenv(nodep, len, var);
+                                       ret = fdt_value_env_set(nodep, len,
+                                                               var);
                                        if (ret != 0)
                                                return ret;
                                } else if (subcmd[0] == 'a') {
@@ -396,13 +399,13 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                                        char buf[11];
 
                                        sprintf(buf, "0x%p", nodep);
-                                       setenv(var, buf);
+                                       env_set(var, buf);
                                } else if (subcmd[0] == 's') {
                                        /* Get size */
                                        char buf[11];
 
                                        sprintf(buf, "0x%08X", len);
-                                       setenv(var, buf);
+                                       env_set(var, buf);
                                } else
                                        return CMD_RET_USAGE;
                                return 0;
index 6f08f611168d422c4f44b10cd83533c58b9e9a0d..fbfbe7b1aae0b6f02d57cf0481a2a73e0c022992 100644 (file)
--- a/cmd/gpt.c
+++ b/cmd/gpt.c
@@ -60,7 +60,7 @@ static int extract_env(const char *str, char **env)
 #ifdef CONFIG_RANDOM_UUID
                debug("%s unset. ", str);
                gen_rand_uuid_str(uuid_str, UUID_STR_FORMAT_GUID);
-               setenv(s, uuid_str);
+               env_set(s, uuid_str);
 
                e = getenv(s);
                if (e) {
@@ -626,7 +626,7 @@ static int do_disk_guid(struct blk_desc *dev_desc, char * const namestr)
                return CMD_RET_FAILURE;
 
        if (namestr)
-               setenv(namestr, disk_guid);
+               env_set(namestr, disk_guid);
        else
                printf("%s\n", disk_guid);
 
index 727fd1c66407f2f253a59beff3cf1ab6d6c51f7c..449f6e9f51b108b6132774b57b756cf0d7077b79 100644 (file)
--- a/cmd/ini.c
+++ b/cmd/ini.c
@@ -219,7 +219,7 @@ static int ini_handler(void *user, char *section, char *name, char *value)
                for (i = 0; i < strlen(value); i++)
                        value[i] = tolower(value[i]);
 #endif
-               setenv(name, value);
+               env_set(name, value);
                printf("ini: Imported %s as %s\n", name, value);
        }
 
index 23bb81e88cbf02ca73224b244e1c2359cd9c9f2a..1b2352ea5538df7792f8402c67e122b94c52f07f 100644 (file)
@@ -35,7 +35,7 @@ static void store_result(const u8 *sum, const char *dest)
                        sprintf(str_ptr, "%02x", sum[i]);
                        str_ptr += 2;
                }
-               setenv(dest, str_output);
+               env_set(dest, str_output);
        }
 }
 
index 683c48bdad1bc0a9a1c023d8d3802f138d115da2..a2433503c40da738925f06921084462b6c5baf4b 100644 (file)
@@ -246,12 +246,12 @@ static void index_partitions(void)
                }
 
                part = mtd_part_info(current_mtd_dev, current_mtd_partnum);
-               setenv("mtddevname", part->name);
+               env_set("mtddevname", part->name);
 
                debug("=> mtddevnum %d,\n=> mtddevname %s\n", mtddevnum, part->name);
        } else {
-               setenv("mtddevnum", NULL);
-               setenv("mtddevname", NULL);
+               env_set("mtddevnum", NULL);
+               env_set("mtddevname", NULL);
 
                debug("=> mtddevnum NULL\n=> mtddevname NULL\n");
        }
@@ -270,12 +270,12 @@ static void current_save(void)
                sprintf(buf, "%s%d,%d", MTD_DEV_TYPE(current_mtd_dev->id->type),
                                        current_mtd_dev->id->num, current_mtd_partnum);
 
-               setenv("partition", buf);
+               env_set("partition", buf);
                strncpy(last_partition, buf, 16);
 
                debug("=> partition %s\n", buf);
        } else {
-               setenv("partition", NULL);
+               env_set("partition", NULL);
                last_partition[0] = '\0';
 
                debug("=> partition NULL\n");
@@ -1213,9 +1213,9 @@ static int generate_mtdparts_save(char *buf, u32 buflen)
        ret = generate_mtdparts(buf, buflen);
 
        if ((buf[0] != '\0') && (ret == 0))
-               setenv("mtdparts", buf);
+               env_set("mtdparts", buf);
        else
-               setenv("mtdparts", NULL);
+               env_set("mtdparts", NULL);
 
        return ret;
 }
@@ -1764,7 +1764,7 @@ int mtdparts_init(void)
                if (mtdids_default) {
                        debug("mtdids variable not defined, using default\n");
                        ids = mtdids_default;
-                       setenv("mtdids", (char *)ids);
+                       env_set("mtdids", (char *)ids);
                } else {
                        printf("mtdids not defined, no default present\n");
                        return 1;
@@ -1780,7 +1780,7 @@ int mtdparts_init(void)
        if (!parts) {
                if (mtdparts_default && use_defaults) {
                        parts = mtdparts_default;
-                       if (setenv("mtdparts", (char *)parts) == 0)
+                       if (env_set("mtdparts", (char *)parts) == 0)
                                use_defaults = 0;
                } else
                        printf("mtdparts variable not set, see 'help mtdparts'\n");
@@ -1956,9 +1956,9 @@ static int do_mtdparts(cmd_tbl_t *cmdtp, int flag, int argc,
 {
        if (argc == 2) {
                if (strcmp(argv[1], "default") == 0) {
-                       setenv("mtdids", NULL);
-                       setenv("mtdparts", NULL);
-                       setenv("partition", NULL);
+                       env_set("mtdids", NULL);
+                       env_set("mtdparts", NULL);
+                       env_set("partition", NULL);
                        use_defaults = 1;
 
                        mtdparts_init();
@@ -1967,7 +1967,7 @@ static int do_mtdparts(cmd_tbl_t *cmdtp, int flag, int argc,
                        /* this may be the first run, initialize lists if needed */
                        mtdparts_init();
 
-                       setenv("mtdparts", NULL);
+                       env_set("mtdparts", NULL);
 
                        /* mtd_devices_init() calls current_save() */
                        return mtd_devices_init();
index 5e91d3ab8a19584bc404f8117518b5dbb20fbac5..ae8eeb79b258edce441b031ad3e72f615adbb31d 100644 (file)
--- a/cmd/net.c
+++ b/cmd/net.c
@@ -116,23 +116,23 @@ static void netboot_update_env(void)
 
        if (net_gateway.s_addr) {
                ip_to_string(net_gateway, tmp);
-               setenv("gatewayip", tmp);
+               env_set("gatewayip", tmp);
        }
 
        if (net_netmask.s_addr) {
                ip_to_string(net_netmask, tmp);
-               setenv("netmask", tmp);
+               env_set("netmask", tmp);
        }
 
        if (net_hostname[0])
-               setenv("hostname", net_hostname);
+               env_set("hostname", net_hostname);
 
        if (net_root_path[0])
-               setenv("rootpath", net_root_path);
+               env_set("rootpath", net_root_path);
 
        if (net_ip.s_addr) {
                ip_to_string(net_ip, tmp);
-               setenv("ipaddr", tmp);
+               env_set("ipaddr", tmp);
        }
 #if !defined(CONFIG_BOOTP_SERVERIP)
        /*
@@ -141,32 +141,32 @@ static void netboot_update_env(void)
         */
        if (net_server_ip.s_addr) {
                ip_to_string(net_server_ip, tmp);
-               setenv("serverip", tmp);
+               env_set("serverip", tmp);
        }
 #endif
        if (net_dns_server.s_addr) {
                ip_to_string(net_dns_server, tmp);
-               setenv("dnsip", tmp);
+               env_set("dnsip", tmp);
        }
 #if defined(CONFIG_BOOTP_DNS2)
        if (net_dns_server2.s_addr) {
                ip_to_string(net_dns_server2, tmp);
-               setenv("dnsip2", tmp);
+               env_set("dnsip2", tmp);
        }
 #endif
        if (net_nis_domain[0])
-               setenv("domain", net_nis_domain);
+               env_set("domain", net_nis_domain);
 
 #if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_TIMEOFFSET)
        if (net_ntp_time_offset) {
                sprintf(tmp, "%d", net_ntp_time_offset);
-               setenv("timeoffset", tmp);
+               env_set("timeoffset", tmp);
        }
 #endif
 #if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_NTPSERVER)
        if (net_ntp_server.s_addr) {
                ip_to_string(net_ntp_server, tmp);
-               setenv("ntpserverip", tmp);
+               env_set("ntpserverip", tmp);
        }
 #endif
 }
@@ -291,14 +291,14 @@ static void cdp_update_env(void)
                printf("CDP offered appliance VLAN %d\n",
                       ntohs(cdp_appliance_vlan));
                vlan_to_string(cdp_appliance_vlan, tmp);
-               setenv("vlan", tmp);
+               env_set("vlan", tmp);
                net_our_vlan = cdp_appliance_vlan;
        }
 
        if (cdp_native_vlan != htons(-1)) {
                printf("CDP offered native VLAN %d\n", ntohs(cdp_native_vlan));
                vlan_to_string(cdp_native_vlan, tmp);
-               setenv("nvlan", tmp);
+               env_set("nvlan", tmp);
                net_native_vlan = cdp_native_vlan;
        }
 }
@@ -423,14 +423,14 @@ static int do_link_local(cmd_tbl_t *cmdtp, int flag, int argc,
 
        net_gateway.s_addr = 0;
        ip_to_string(net_gateway, tmp);
-       setenv("gatewayip", tmp);
+       env_set("gatewayip", tmp);
 
        ip_to_string(net_netmask, tmp);
-       setenv("netmask", tmp);
+       env_set("netmask", tmp);
 
        ip_to_string(net_ip, tmp);
-       setenv("ipaddr", tmp);
-       setenv("llipaddr", tmp); /* store this for next time */
+       env_set("ipaddr", tmp);
+       env_set("llipaddr", tmp); /* store this for next time */
 
        return CMD_RET_SUCCESS;
 }
index 4431ef66d8520d52b7c0eeee4c6438df199c8fb0..1b1e9667b539babd06b91412cca89166ab0322e4 100644 (file)
@@ -283,7 +283,7 @@ static int _do_env_set(int flag, int argc, char * const argv[], int env_flag)
        return 0;
 }
 
-int setenv(const char *varname, const char *varvalue)
+int env_set(const char *varname, const char *varvalue)
 {
        const char * const argv[4] = { "setenv", varname, varvalue, NULL };
 
@@ -309,7 +309,7 @@ int setenv_ulong(const char *varname, ulong value)
        /* TODO: this should be unsigned */
        char *str = simple_itoa(value);
 
-       return setenv(varname, str);
+       return env_set(varname, str);
 }
 
 /**
@@ -324,7 +324,7 @@ int setenv_hex(const char *varname, ulong value)
        char str[17];
 
        sprintf(str, "%lx", value);
-       return setenv(varname, str);
+       return env_set(varname, str);
 }
 
 ulong getenv_hex(const char *varname, ulong default_val)
@@ -931,7 +931,7 @@ NXTARG:             ;
                        return 1;
                }
                sprintf(buf, "%zX", (size_t)len);
-               setenv("filesize", buf);
+               env_set("filesize", buf);
 
                return 0;
        }
index 8ba05984e474921883462640b0b1479c5019251e..746bf40b2d0a8ad50c78b7d3e49d96ab7a074990 100644 (file)
@@ -38,7 +38,7 @@ static int do_part_uuid(int argc, char * const argv[])
                return 1;
 
        if (argc > 2)
-               setenv(argv[2], info.uuid);
+               env_set(argv[2], info.uuid);
        else
                printf("%s\n", info.uuid);
 
@@ -99,7 +99,7 @@ static int do_part_list(int argc, char * const argv[])
                        sprintf(t, "%s%x", str[0] ? " " : "", p);
                        strcat(str, t);
                }
-               setenv(var, str);
+               env_set(var, str);
                return 0;
        }
 
@@ -135,7 +135,7 @@ static int do_part_start(int argc, char * const argv[])
        snprintf(buf, sizeof(buf), LBAF, info.start);
 
        if (argc > 3)
-               setenv(argv[3], buf);
+               env_set(argv[3], buf);
        else
                printf("%s\n", buf);
 
@@ -169,7 +169,7 @@ static int do_part_size(int argc, char * const argv[])
        snprintf(buf, sizeof(buf), LBAF, info.size);
 
        if (argc > 3)
-               setenv(argv[3], buf);
+               env_set(argv[3], buf);
        else
                printf("%s\n", buf);
 
index 0a07f14ca8fa94a8e15097cd9b394fc7705344ae..357b96940c0da203fd6455cdc5da5ae77eaac160 100644 (file)
--- a/cmd/pxe.c
+++ b/cmd/pxe.c
@@ -591,7 +591,7 @@ static int label_localboot(struct pxe_label *label)
                char bootargs[CONFIG_SYS_CBSIZE];
 
                cli_simple_process_macros(label->append, bootargs);
-               setenv("bootargs", bootargs);
+               env_set("bootargs", bootargs);
        }
 
        debug("running: %s\n", localcmd);
@@ -695,7 +695,7 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label)
                strcat(bootargs, mac_str);
 
                cli_simple_process_macros(bootargs, finalbootargs);
-               setenv("bootargs", finalbootargs);
+               env_set("bootargs", finalbootargs);
                printf("append: %s\n", finalbootargs);
        }
 
@@ -1674,7 +1674,7 @@ static int do_sysboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                filename = getenv("bootfile");
        else {
                filename = argv[5];
-               setenv("bootfile", filename);
+               env_set("bootfile", filename);
        }
 
        if (strstr(argv[3], "ext2"))
index 12436ec9b4efcba1884a01c27894a65bc716c40d..9b12ab40ca22f4579efb6259a4d932ad767ab762 100644 (file)
--- a/cmd/qfw.c
+++ b/cmd/qfw.c
@@ -55,7 +55,7 @@ static int qemu_fwcfg_setup_kernel(void *load_addr, void *initrd_addr)
                 * when invoking qemu), do not update bootargs
                 */
                if (*data_addr != '\0') {
-                       if (setenv("bootargs", data_addr) < 0)
+                       if (env_set("bootargs", data_addr) < 0)
                                printf("warning: unable to change bootargs\n");
                }
        }
index e7194fc4f4137a1652250c0de047200aed75469c..e9058c4a0ac84ccbba8b03ab22d0d9211e7c1896 100644 (file)
@@ -282,11 +282,11 @@ static int regex_sub(const char *name,
                if (!global)
                        break;
        }
-       debug("## FINAL (now setenv()) :  %s\n", data);
+       debug("## FINAL (now env_set()) :  %s\n", data);
 
        printf("%s=%s\n", name, data);
 
-       return setenv(name, data);
+       return env_set(name, data);
 }
 #endif
 
index 985aa95c2aea2c664169d5acf453d0f557e663b1..a4a7384f8b4af042f49c943203af19626b7f2b22 100644 (file)
@@ -658,7 +658,7 @@ int initr_mem(void)
        pram += (LOGBUFF_LEN + LOGBUFF_OVERHEAD) / 1024;
 # endif
        sprintf(memsz, "%ldk", (long int) ((gd->ram_size / 1024) - pram));
-       setenv("mem", memsz);
+       env_set("mem", memsz);
 
        return 0;
 }
index b2c09126cecd380d914483de00c0e147c513928c..f5ecc06d52a8fc6abe2b952600ac23ea4e994215 100644 (file)
@@ -569,7 +569,7 @@ static void fixup_silent_linux(void)
                env_val = CONSOLE_ARG;
        }
 
-       setenv("bootargs", env_val);
+       env_set("bootargs", env_val);
        debug("after silent fix-up: %s\n", env_val);
        free(buf);
 }
index 00861e2d9e4b56c114a4dcae71fdbb0f89a996aa..280289639c041ccd512dc0857d0ea44a52020f3c 100644 (file)
@@ -2265,7 +2265,7 @@ void unset_local_var(const char *name)
                        } else {
 #ifndef __U_BOOT__
                                if(cur->flg_export)
-                                       unsetenv(cur->name);
+                                       unenv_set(cur->name);
 #endif
                                free(cur->name);
                                free(cur->value);
index ec4af3bd90dfdca971b912ec65034d46754d024c..3f7ca2baa7ad429c54414da7b4d7ec4d78e604bc 100644 (file)
@@ -801,7 +801,7 @@ done:
 #ifdef CONFIG_SYS_CONSOLE_ENV_OVERWRITE
        /* set the environment variables (will overwrite previous env settings) */
        for (i = 0; i < 3; i++) {
-               setenv(stdio_names[i], stdio_devices[i]->name);
+               env_set(stdio_names[i], stdio_devices[i]->name);
        }
 #endif /* CONFIG_SYS_CONSOLE_ENV_OVERWRITE */
 
@@ -880,7 +880,7 @@ int console_init_r(void)
 
        /* Setting environment variables */
        for (i = 0; i < 3; i++) {
-               setenv(stdio_names[i], stdio_devices[i]->name);
+               env_set(stdio_names[i], stdio_devices[i]->name);
        }
 
        gd->flags |= GD_FLG_DEVINIT;    /* device initialization completed */
index 771d8fa87f9424521ce0b5d3ceb465f079404ea8..fda636d34aff934f98790e227b669cc94552350e 100644 (file)
@@ -302,7 +302,7 @@ static void store_result(struct hash_algo *algo, const uint8_t *sum,
                        str_ptr += 2;
                }
                *str_ptr = '\0';
-               setenv(dest, str_output);
+               env_set(dest, str_output);
        } else {
                ulong addr;
                void *buf;
index 4ae042ee33efe9327b5a647af910f343cb6fe3e5..85aaabbb85529eb9413cc6548848e9f402eb0cfb 100644 (file)
@@ -243,7 +243,7 @@ int main()
        const char *ret;
        size_t len;
 
-       setenv("hwconfig", "key1:subkey1=value1,subkey2=value2;key2:value3;;;;"
+       env_set("hwconfig", "key1:subkey1=value1,subkey2=value2;key2:value3;;;;"
                           "key3;:,:=;key4", 1);
 
        ret = hwconfig_arg("key1", &len);
@@ -274,7 +274,7 @@ int main()
        assert(hwconfig_arg("key4", &len) == NULL);
        assert(hwconfig_arg("bogus", &len) == NULL);
 
-       unsetenv("hwconfig");
+       unenv_set("hwconfig");
 
        assert(hwconfig(NULL) == 0);
        assert(hwconfig("") == 0);
index c668407817c8701a7bcce11450f300362ab0b390..018c7594fe71026b9be0f9d446c98577392a348a 100644 (file)
@@ -90,7 +90,7 @@ int android_image_get_kernel(const struct andr_img_hdr *hdr, int verify,
        if (*hdr->cmdline)
                strcat(newbootargs, hdr->cmdline);
 
-       setenv("bootargs", newbootargs);
+       env_set("bootargs", newbootargs);
 
        if (os_data) {
                *os_data = (ulong)hdr;
index 2116a9e0a2e0bc5d25993b43ad50aed9aab19e97..07fc31b716eead0722549675fb41681cdfaafa29 100644 (file)
@@ -48,7 +48,7 @@ void main_loop(void)
        bootstage_mark_name(BOOTSTAGE_ID_MAIN_LOOP, "main_loop");
 
 #ifdef CONFIG_VERSION_VARIABLE
-       setenv("ver", version_string);  /* set version variable */
+       env_set("ver", version_string);  /* set version variable */
 #endif /* CONFIG_VERSION_VARIABLE */
 
        cli_init();
index 51768575064dbc0ed4a8033c0b4bc581368d1017..3c887b34050a603df3706bcf1e1dca6e11dbc280 100644 (file)
@@ -279,7 +279,7 @@ config SPL_ENV_SUPPORT
          configuration. But some boards use this to support 'Falcon' boot
          on EXT2 and FAT, where SPL boots directly into Linux without
          starting U-Boot first. Enabling this option will make getenv()
-         and setenv() available in SPL.
+         and env_set() available in SPL.
 
 config SPL_SAVEENV
        bool "Support save environment"
index e8d0ba18e63beac632770a595a36d0f784b9d268..f5ec0fb396b3c3fc49746457a0d42dfd804ed1e6 100644 (file)
@@ -46,7 +46,7 @@ int spl_dfu_cmd(int usbctrl, char *dfu_alt_info, char *interface, char *devstr)
                return -EINVAL;
        }
 
-       ret = setenv("dfu_alt_info", str_env);
+       ret = env_set("dfu_alt_info", str_env);
        if (ret) {
                error("unable to set env variable \"dfu_alt_info\"!\n");
                return -EINVAL;
index 85fe508b1760f0a2ebec85057d96dddffa0e1811..88831097fa60cb6dd681ad210ebe62a1ecad9680 100644 (file)
@@ -33,14 +33,14 @@ static int spl_net_load_image(struct spl_image_info *spl_image,
 
        env_init();
        env_relocate();
-       setenv("autoload", "yes");
+       env_set("autoload", "yes");
        rv = eth_initialize();
        if (rv == 0) {
                printf("No Ethernet devices found\n");
                return -ENODEV;
        }
        if (bootdev->boot_device_name)
-               setenv("ethact", bootdev->boot_device_name);
+               env_set("ethact", bootdev->boot_device_name);
        rv = net_loop(BOOTP);
        if (rv < 0) {
                printf("Problem booting with BOOTP\n");
index 0767fcbcb554042263472d139ce29922d1bdf2c0..061a5541b1d86bfca65c40781246ac30476e46b6 100644 (file)
@@ -67,7 +67,7 @@ static int update_load(char *filename, ulong msec_max, int cnt_max, ulong addr)
        tftp_timeout_count_max = cnt_max;
 
        /* we don't want to retry the connection if errors occur */
-       setenv("netretry", "no");
+       env_set("netretry", "no");
 
        /* download the update file */
        load_addr = addr;
@@ -83,7 +83,7 @@ static int update_load(char *filename, ulong msec_max, int cnt_max, ulong addr)
        tftp_timeout_ms = saved_timeout_msecs;
        tftp_timeout_count_max = saved_timeout_count;
 
-       setenv("netretry", saved_netretry);
+       env_set("netretry", saved_netretry);
        if (saved_netretry != NULL)
                free(saved_netretry);
 
index 50e4899787792246face19fcb4561afe0eafca1e..bf994d4e41dc64b93e0210bf514cda69c763efea 100644 (file)
@@ -101,7 +101,7 @@ if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
        * int eth_setenv_enetaddr(char *name, const uchar *enetaddr);
 
 Store the MAC address into the named environment variable.  The return value is
-the same as the setenv() function.
+the same as the env_set() function.
 uchar enetaddr[6] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 };
 eth_setenv_enetaddr("ethaddr", enetaddr);
 /* the "ethaddr" env var should now be set to "00:11:22:33:44:55" */
index 2d2c318adfb3e3341307229c365fc94512c47c28..e961f518b085107e34636cb868f2316cc6508fdd 100644 (file)
@@ -155,7 +155,7 @@ int AT91F_DataflashInit (void)
        return found[0];
 }
 
-void AT91F_DataflashSetEnv (void)
+void AT91F_Dataflashenv_set(void)
 {
        int i, j;
        int part;
@@ -169,8 +169,9 @@ void AT91F_DataflashSetEnv (void)
                        /* Set the environment according to the label...*/
                        if((env & FLAG_SETENV) == FLAG_SETENV) {
                                start = dataflash_info[i].Device.area_list[j].start;
-                               sprintf((char*) s,"%lX",start);
-                               setenv((char*) area_list[part].label,(char*) s);
+                               sprintf((char *)s, "%lX", start);
+                               env_set((char *)area_list[part].label,
+                                       (char *)s);
                        }
                        part++;
                }
index f5fa0e8533b6b8acc207742d5324c68f0708cb32..590ae0c0fcdec98e6e245c16bd1e31011b26b929 100644 (file)
@@ -33,8 +33,8 @@ static int sb_eth_raw_start(struct udevice *dev)
 
        if (strcmp(interface, "lo") == 0) {
                priv->local = 1;
-               setenv("ipaddr", "127.0.0.1");
-               setenv("serverip", "127.0.0.1");
+               env_set("ipaddr", "127.0.0.1");
+               env_set("serverip", "127.0.0.1");
        }
        return sandbox_eth_raw_os_start(interface, pdata->enetaddr, priv);
 }
diff --git a/fs/fs.c b/fs/fs.c
index 595ff1fe69b5bc446ebd32c3d7badd7726348d63..ef41b7482686ee7b23da9f3b79855899002bb36f 100644 (file)
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -509,7 +509,7 @@ int do_fs_uuid(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
                return CMD_RET_FAILURE;
 
        if (argc == 4)
-               setenv(argv[3], uuid);
+               env_set(argv[3], uuid);
        else
                printf("%s\n", uuid);
 
@@ -529,7 +529,7 @@ int do_fs_type(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        info = fs_get_info(fs_type);
 
        if (argc == 4)
-               setenv(argv[3], info->name);
+               env_set(argv[3], info->name);
        else
                printf("%s\n", info->name);
 
index 6ff4364e443d25af802d4dd3c997450bf576a5f5..9deed7737814bd9cefb012bf02f772b4676415a7 100644 (file)
@@ -32,7 +32,7 @@
        EXPORT_FUNC(do_reset, int, do_reset, cmd_tbl_t *,
                    int , int , char * const [])
        EXPORT_FUNC(getenv, char  *, getenv, const char*)
-       EXPORT_FUNC(setenv, int, setenv, const char *, const char *)
+       EXPORT_FUNC(env_set, int, env_set, const char *, const char *)
        EXPORT_FUNC(simple_strtoul, unsigned long, simple_strtoul,
                    const char *, char **, unsigned int)
        EXPORT_FUNC(strict_strtoul, int, strict_strtoul,
index 030c179fba776b95c0b0258d554cfecc94e94e99..0b543f3dba2f34a54c2d76fe773da5db7d3f60de 100644 (file)
@@ -336,7 +336,19 @@ ulong getenv_hex(const char *varname, ulong default_val);
  * Return -1 if variable does not exist (default to true)
  */
 int getenv_yesno(const char *var);
-int    setenv       (const char *, const char *);
+
+/**
+ * env_set() - set an environment variable
+ *
+ * This sets or deletes the value of an environment variable. For setting the
+ * value the variable is created if it does not already exist.
+ *
+ * @varname: Variable to adjust
+ * @value: Value to set for the variable, or NULL or "" to delete the variable
+ * @return 0 if OK, 1 on error
+ */
+int env_set(const char *varname, const char *value);
+
 int setenv_ulong(const char *varname, ulong value);
 int setenv_hex(const char *varname, ulong value);
 /**
index 54223c475adca04aa943bf178be0068847dd2484..433625105a5050a0c57443b0cf75984431593c0e 100644 (file)
@@ -334,7 +334,7 @@ do {                                                                \
                else                                            \
                        strcpy(ethname, "ethaddr");             \
                printf("Setting %s from EEPROM with %s\n", ethname, buf);\
-               setenv(ethname, buf);                           \
+               env_set(ethname, buf);                          \
        }                                                       \
 } while (0)
 
index 84a56c30ce2608c0c60f9e177a86bab7796f35c4..c9f22200cfd721421017042ee356b5b2713cd47e 100644 (file)
@@ -197,7 +197,7 @@ extern int AT91F_DataflashInit(void);
 
 extern void dataflash_print_info (void);
 extern void dataflash_perror (int err);
-extern void AT91F_DataflashSetEnv (void);
+extern void AT91F_Dataflashenv_set(void);
 
 extern struct dataflash_addr cs[CONFIG_SYS_MAX_DATAFLASH_BANKS];
 extern dataflash_protect_t area_list[NB_DATAFLASH_AREA];
index 1d81bc4b289815707a98a0d5b4baf4e1474bfa8e..6522d78facb43d1f667489670abcdc9040192f0f 100644 (file)
@@ -28,7 +28,7 @@ int vprintf(const char *, va_list);
 unsigned long simple_strtoul(const char *cp, char **endp, unsigned int base);
 int strict_strtoul(const char *cp, unsigned int base, unsigned long *res);
 char *getenv (const char *name);
-int setenv (const char *varname, const char *varvalue);
+int env_set(const char *varname, const char *value);
 long simple_strtol(const char *cp, char **endp, unsigned int base);
 int strcmp(const char *cs, const char *ct);
 unsigned long ustrtoul(const char *cp, char **endp, unsigned int base);
index 402dfd84fba315a76e322e5e7ec9a821dbfeb890..df5d61c2eb884b1f49f35a60cc546bce435efc55 100644 (file)
@@ -118,7 +118,7 @@ extern int hwalk_r(struct hsearch_data *__htab, int (*callback)(ENTRY *));
 #define H_MATCH_SUBSTR (1 << 7) /* search for substring matches             */
 #define H_MATCH_REGEX  (1 << 8) /* search for regular expression matches    */
 #define H_MATCH_METHOD (H_MATCH_IDENT | H_MATCH_SUBSTR | H_MATCH_REGEX)
-#define H_PROGRAMMATIC (1 << 9) /* indicate that an import is from setenv() */
+#define H_PROGRAMMATIC (1 << 9) /* indicate that an import is from env_set() */
 #define H_ORIGIN_FLAGS (H_INTERACTIVE | H_PROGRAMMATIC)
 
 #endif /* _SEARCH_H_ */
index c8584edcb861ad7e15ad207a8a27d83e822be56a..1536c027da27c82df8953be81207296c979a1111 100644 (file)
@@ -291,7 +291,7 @@ int do_uuid(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        if (argc == 1)
                printf("%s\n", uuid);
        else
-               setenv(argv[1], uuid);
+               env_set(argv[1], uuid);
 
        return CMD_RET_SUCCESS;
 }
index f3ceff9ed89c3886f90e5b10efd2cec624017f78..4c79e09ccbf6d8cb3ba49a31f98bf26aedaa0ae2 100644 (file)
--- a/net/arp.c
+++ b/net/arp.c
@@ -194,7 +194,7 @@ void arp_receive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len)
                if (net_server_ip.s_addr == net_arp_wait_packet_ip.s_addr) {
                        char buf[20];
                        sprintf(buf, "%pM", &arp->ar_sha);
-                       setenv("serveraddr", buf);
+                       env_set("serveraddr", buf);
                }
 #endif
 
index be8f710e0c5ca9bb0a2a884891932966c86d21c6..579515687b7567e0e2069ff316ac60129f0da846 100644 (file)
@@ -170,7 +170,7 @@ static void store_net_params(struct bootp_hdr *bp)
         * not contain a new value
         */
        if (*net_boot_file_name)
-               setenv("bootfile", net_boot_file_name);
+               env_set("bootfile", net_boot_file_name);
 #endif
        net_copy_ip(&net_ip, &bp->bp_yiaddr);
 }
index 7017bac75af5faf7a99ce2e17ee088bcc6fd5a32..eee8a02f7c4fbe2485263b8b6666a38546f27be7 100644 (file)
--- a/net/dns.c
+++ b/net/dns.c
@@ -184,7 +184,7 @@ static void dns_handler(uchar *pkt, unsigned dest, struct in_addr sip,
                        ip_to_string(ip_addr, ip_str);
                        printf("%s\n", ip_str);
                        if (net_dns_env_var)
-                               setenv(net_dns_env_var, ip_str);
+                               env_set(net_dns_env_var, ip_str);
                } else {
                        puts("server responded with invalid IP number\n");
                }
index 58fa295771020639ba8924d906787dc3f9d78430..ef97da72679dfd26e3e2e07a67cc6a8ed74da985 100644 (file)
@@ -39,7 +39,7 @@ int eth_setenv_enetaddr(const char *name, const uchar *enetaddr)
 
        sprintf(buf, "%pM", enetaddr);
 
-       return setenv(name, buf);
+       return env_set(name, buf);
 }
 
 int eth_getenv_enetaddr_by_index(const char *base_name, int index,
@@ -97,14 +97,14 @@ void eth_current_changed(void)
        /* update current ethernet name */
        if (eth_get_dev()) {
                if (act == NULL || strcmp(act, eth_get_name()) != 0)
-                       setenv("ethact", eth_get_name());
+                       env_set("ethact", eth_get_name());
        }
        /*
         * remove the variable completely if there is no active
         * interface
         */
        else if (act != NULL)
-               setenv("ethact", NULL);
+               env_set("ethact", NULL);
 }
 
 void eth_try_another(int first_restart)
index 564ad36916016f241909fc90971e1cae91e4fe54..f824d704c69f36ca4ad6d23e4e4345f3703a89e5 100644 (file)
@@ -26,15 +26,15 @@ static int dm_test_eth(struct unit_test_state *uts)
 {
        net_ping_ip = string_to_ip("1.1.2.2");
 
-       setenv("ethact", "eth@10002000");
+       env_set("ethact", "eth@10002000");
        ut_assertok(net_loop(PING));
        ut_asserteq_str("eth@10002000", getenv("ethact"));
 
-       setenv("ethact", "eth@10003000");
+       env_set("ethact", "eth@10003000");
        ut_assertok(net_loop(PING));
        ut_asserteq_str("eth@10003000", getenv("ethact"));
 
-       setenv("ethact", "eth@10004000");
+       env_set("ethact", "eth@10004000");
        ut_assertok(net_loop(PING));
        ut_asserteq_str("eth@10004000", getenv("ethact"));
 
@@ -45,20 +45,20 @@ DM_TEST(dm_test_eth, DM_TESTF_SCAN_FDT);
 static int dm_test_eth_alias(struct unit_test_state *uts)
 {
        net_ping_ip = string_to_ip("1.1.2.2");
-       setenv("ethact", "eth0");
+       env_set("ethact", "eth0");
        ut_assertok(net_loop(PING));
        ut_asserteq_str("eth@10002000", getenv("ethact"));
 
-       setenv("ethact", "eth1");
+       env_set("ethact", "eth1");
        ut_assertok(net_loop(PING));
        ut_asserteq_str("eth@10004000", getenv("ethact"));
 
        /* Expected to fail since eth2 is not defined in the device tree */
-       setenv("ethact", "eth2");
+       env_set("ethact", "eth2");
        ut_assertok(net_loop(PING));
        ut_asserteq_str("eth@10002000", getenv("ethact"));
 
-       setenv("ethact", "eth5");
+       env_set("ethact", "eth5");
        ut_assertok(net_loop(PING));
        ut_asserteq_str("eth@10003000", getenv("ethact"));
 
@@ -71,14 +71,14 @@ static int dm_test_eth_prime(struct unit_test_state *uts)
        net_ping_ip = string_to_ip("1.1.2.2");
 
        /* Expected to be "eth@10003000" because of ethprime variable */
-       setenv("ethact", NULL);
-       setenv("ethprime", "eth5");
+       env_set("ethact", NULL);
+       env_set("ethprime", "eth5");
        ut_assertok(net_loop(PING));
        ut_asserteq_str("eth@10003000", getenv("ethact"));
 
        /* Expected to be "eth@10002000" because it is first */
-       setenv("ethact", NULL);
-       setenv("ethprime", NULL);
+       env_set("ethact", NULL);
+       env_set("ethprime", NULL);
        ut_assertok(net_loop(PING));
        ut_asserteq_str("eth@10002000", getenv("ethact"));
 
@@ -121,26 +121,26 @@ static int dm_test_eth_act(struct unit_test_state *uts)
                /* Invalidate MAC address */
                strcpy(ethaddr[i], getenv(addrname[i]));
                /* Must disable access protection for ethaddr before clearing */
-               setenv(".flags", addrname[i]);
-               setenv(addrname[i], NULL);
+               env_set(".flags", addrname[i]);
+               env_set(addrname[i], NULL);
        }
 
        /* Set ethact to "eth@10002000" */
-       setenv("ethact", ethname[0]);
+       env_set("ethact", ethname[0]);
 
        /* Segment fault might happen if something is wrong */
        ut_asserteq(-ENODEV, net_loop(PING));
 
        for (i = 0; i < DM_TEST_ETH_NUM; i++) {
                /* Restore the env */
-               setenv(".flags", addrname[i]);
-               setenv(addrname[i], ethaddr[i]);
+               env_set(".flags", addrname[i]);
+               env_set(addrname[i], ethaddr[i]);
 
                /* Probe the device again */
                ut_assertok(device_probe(dev[i]));
        }
-       setenv(".flags", NULL);
-       setenv("ethact", NULL);
+       env_set(".flags", NULL);
+       env_set("ethact", NULL);
 
        return 0;
 }
@@ -150,13 +150,13 @@ DM_TEST(dm_test_eth_act, DM_TESTF_SCAN_FDT);
 static int _dm_test_eth_rotate1(struct unit_test_state *uts)
 {
        /* Make sure that the default is to rotate to the next interface */
-       setenv("ethact", "eth@10004000");
+       env_set("ethact", "eth@10004000");
        ut_assertok(net_loop(PING));
        ut_asserteq_str("eth@10002000", getenv("ethact"));
 
        /* If ethrotate is no, then we should fail on a bad MAC */
-       setenv("ethact", "eth@10004000");
-       setenv("ethrotate", "no");
+       env_set("ethact", "eth@10004000");
+       env_set("ethrotate", "no");
        ut_asserteq(-EINVAL, net_loop(PING));
        ut_asserteq_str("eth@10004000", getenv("ethact"));
 
@@ -166,12 +166,12 @@ static int _dm_test_eth_rotate1(struct unit_test_state *uts)
 static int _dm_test_eth_rotate2(struct unit_test_state *uts)
 {
        /* Make sure we can skip invalid devices */
-       setenv("ethact", "eth@10004000");
+       env_set("ethact", "eth@10004000");
        ut_assertok(net_loop(PING));
        ut_asserteq_str("eth@10004000", getenv("ethact"));
 
        /* Make sure we can handle device name which is not eth# */
-       setenv("ethact", "sbe5");
+       env_set("ethact", "sbe5");
        ut_assertok(net_loop(PING));
        ut_asserteq_str("sbe5", getenv("ethact"));
 
@@ -189,29 +189,29 @@ static int dm_test_eth_rotate(struct unit_test_state *uts)
        /* Invalidate eth1's MAC address */
        strcpy(ethaddr, getenv("eth1addr"));
        /* Must disable access protection for eth1addr before clearing */
-       setenv(".flags", "eth1addr");
-       setenv("eth1addr", NULL);
+       env_set(".flags", "eth1addr");
+       env_set("eth1addr", NULL);
 
        retval = _dm_test_eth_rotate1(uts);
 
        /* Restore the env */
-       setenv("eth1addr", ethaddr);
-       setenv("ethrotate", NULL);
+       env_set("eth1addr", ethaddr);
+       env_set("ethrotate", NULL);
 
        if (!retval) {
                /* Invalidate eth0's MAC address */
                strcpy(ethaddr, getenv("ethaddr"));
                /* Must disable access protection for ethaddr before clearing */
-               setenv(".flags", "ethaddr");
-               setenv("ethaddr", NULL);
+               env_set(".flags", "ethaddr");
+               env_set("ethaddr", NULL);
 
                retval = _dm_test_eth_rotate2(uts);
 
                /* Restore the env */
-               setenv("ethaddr", ethaddr);
+               env_set("ethaddr", ethaddr);
        }
        /* Restore the env */
-       setenv(".flags", NULL);
+       env_set(".flags", NULL);
 
        return retval;
 }
@@ -225,8 +225,8 @@ static int _dm_test_net_retry(struct unit_test_state *uts)
         * the active device should be eth0
         */
        sandbox_eth_disable_response(1, true);
-       setenv("ethact", "eth@10004000");
-       setenv("netretry", "yes");
+       env_set("ethact", "eth@10004000");
+       env_set("netretry", "yes");
        sandbox_eth_skip_timeout();
        ut_assertok(net_loop(PING));
        ut_asserteq_str("eth@10002000", getenv("ethact"));
@@ -235,8 +235,8 @@ static int _dm_test_net_retry(struct unit_test_state *uts)
         * eth1 is disabled and netretry is no, so the ping should fail and the
         * active device should be eth1
         */
-       setenv("ethact", "eth@10004000");
-       setenv("netretry", "no");
+       env_set("ethact", "eth@10004000");
+       env_set("netretry", "no");
        sandbox_eth_skip_timeout();
        ut_asserteq(-ETIMEDOUT, net_loop(PING));
        ut_asserteq_str("eth@10004000", getenv("ethact"));
@@ -253,7 +253,7 @@ static int dm_test_net_retry(struct unit_test_state *uts)
        retval = _dm_test_net_retry(uts);
 
        /* Restore the env */
-       setenv("netretry", NULL);
+       env_set("netretry", NULL);
        sandbox_eth_disable_response(1, false);
 
        return retval;
index c9c79e066dc1282a57baadb6249df937f0ff1ab2..e50c0755597dab5cf8aa392336e6fa146ad754e4 100644 (file)
@@ -468,7 +468,7 @@ int fw_env_write(char *name, char *value)
  *         modified or deleted
  *
  */
-int fw_setenv(int argc, char *argv[], struct env_opts *opts)
+int fw_env_set(int argc, char *argv[], struct env_opts *opts)
 {
        int i;
        size_t len;
index 04bb64602b2561dfbb9982faa128eb2327296407..2d37eb505309601ad6720533d02389a831c5a6b0 100644 (file)
@@ -44,7 +44,7 @@ int parse_aes_key(char *key, uint8_t *bin_key);
 int fw_printenv(int argc, char *argv[], int value_only, struct env_opts *opts);
 
 /**
- * fw_setenv() - adds or removes one variable to the environment
+ * fw_env_set() - adds or removes one variable to the environment
  *
  * @argc: number of strings in argv, argv[0] is variable name,
  *          argc==1 means erase variable, argc > 1 means add a variable
@@ -61,7 +61,7 @@ int fw_printenv(int argc, char *argv[], int value_only, struct env_opts *opts);
  * ERRORS:
  *  EROFS - some variables ("ethaddr", "serial#") cannot be modified
  */
-int fw_setenv(int argc, char *argv[], struct env_opts *opts);
+int fw_env_set(int argc, char *argv[], struct env_opts *opts);
 
 /**
  * fw_parse_script() - adds or removes multiple variables with a batch script
index b8bff264eb4ef5e0da6f90d3aff3b2aed3406d6e..6e278ca80b4dd5676d2364657d7bb35b0658c751 100644 (file)
@@ -78,7 +78,7 @@ void usage_printenv(void)
                "\n");
 }
 
-void usage_setenv(void)
+void usage_env_set(void)
 {
        fprintf(stderr,
                "Usage: fw_setenv [OPTIONS]... [VARIABLE]...\n"
@@ -142,7 +142,7 @@ static void parse_common_args(int argc, char *argv[])
                        env_opts.lockname = optarg;
                        break;
                case 'h':
-                       do_printenv ? usage_printenv() : usage_setenv();
+                       do_printenv ? usage_printenv() : usage_env_set();
                        exit(EXIT_SUCCESS);
                        break;
                default:
@@ -202,7 +202,7 @@ int parse_setenv_args(int argc, char *argv[])
                        /* ignore common options */
                        break;
                default: /* '?' */
-                       usage_setenv();
+                       usage_env_set();
                        exit(EXIT_FAILURE);
                        break;
                }
@@ -273,7 +273,7 @@ int main(int argc, char *argv[])
                        retval = EXIT_FAILURE;
        } else {
                if (!script_file) {
-                       if (fw_setenv(argc, argv, &env_opts) != 0)
+                       if (fw_env_set(argc, argv, &env_opts) != 0)
                                retval = EXIT_FAILURE;
                } else {
                        if (fw_parse_script(script_file, &env_opts) != 0)