env: Rename setenv() to env_set()
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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user