diff options
author | Simon Glass <sjg@chromium.org> | 2017-08-03 12:22:12 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-08-16 08:30:24 -0400 |
commit | 00caae6d47645e68d6e5277aceb69592b49381a6 (patch) | |
tree | c361aa0cea3093b93c1118266fe9e2b44ac6e453 /board | |
parent | fd1e959e91d2b0b2e853d09dd9167dfff18a616c (diff) |
env: Rename getenv/_f() to env_get()
We are now using an env_ prefix for environment functions. Rename these
two functions for consistency. Also add function comments in common.h.
Quite a few places use getenv() in a condition context, provoking a
warning from checkpatch. These are fixed up in this patch also.
Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'board')
88 files changed, 185 insertions, 183 deletions
diff --git a/board/Arcturus/ucp1020/cmd_arc.c b/board/Arcturus/ucp1020/cmd_arc.c index c32f7df4546..0d3ac88fffe 100644 --- a/board/Arcturus/ucp1020/cmd_arc.c +++ b/board/Arcturus/ucp1020/cmd_arc.c @@ -149,7 +149,7 @@ int get_arc_info(void) if (smac[2][0] == 0xFF) { printf("\t<not found>\n"); } else { - char *ret = getenv("ethaddr"); + char *ret = env_get("ethaddr"); if (strcmp(ret, __stringify(CONFIG_ETHADDR)) == 0) { env_set("ethaddr", smac[2]); @@ -169,7 +169,7 @@ int get_arc_info(void) if (smac[1][0] == 0xFF) { printf("\t<not found>\n"); } else { - char *ret = getenv("eth1addr"); + char *ret = env_get("eth1addr"); if (strcmp(ret, __stringify(CONFIG_ETH1ADDR)) == 0) { env_set("eth1addr", smac[1]); @@ -188,7 +188,7 @@ int get_arc_info(void) if (smac[0][0] == 0xFF) { printf("\t<not found>\n"); } else { - char *ret = getenv("eth2addr"); + char *ret = env_get("eth2addr"); if (strcmp(ret, __stringify(CONFIG_ETH2ADDR)) == 0) { env_set("eth2addr", smac[0]); diff --git a/board/Arcturus/ucp1020/ucp1020.c b/board/Arcturus/ucp1020/ucp1020.c index 2cc2e54d5b6..dfdaf0441c9 100644 --- a/board/Arcturus/ucp1020/ucp1020.c +++ b/board/Arcturus/ucp1020/ucp1020.c @@ -64,7 +64,7 @@ void board_gpio_init(void) for (i = 0; i < GPIO_MAX_NUM; i++) { sprintf(envname, "GPIO%d", i); - val = getenv(envname); + val = env_get(envname); if (val) { char direction = toupper(val[0]); char level = toupper(val[1]); @@ -82,7 +82,7 @@ void board_gpio_init(void) } } - val = getenv("PCIE_OFF"); + val = env_get("PCIE_OFF"); if (val) { gpio_direction_input(GPIO_PCIE1_EN); gpio_direction_input(GPIO_PCIE2_EN); @@ -91,7 +91,7 @@ void board_gpio_init(void) gpio_direction_output(GPIO_PCIE2_EN, 1); } - val = getenv("SDHC_CDWP_OFF"); + val = env_get("SDHC_CDWP_OFF"); if (!val) { ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); @@ -214,7 +214,7 @@ int last_stage_init(void) else printf("NCT72(0x%x): ready\n", id2); - kval = getenv("kernelargs"); + kval = env_get("kernelargs"); mmc = find_mmc_device(0); if (mmc) @@ -238,7 +238,7 @@ int last_stage_init(void) get_arc_info(); if (kval) { - sval = getenv("SERIAL"); + sval = env_get("SERIAL"); if (sval) { strcpy(newkernelargs, "SN="); strcat(newkernelargs, sval); diff --git a/board/Barix/ipam390/ipam390.c b/board/Barix/ipam390/ipam390.c index 3a584021ac7..d203429738e 100644 --- a/board/Barix/ipam390/ipam390.c +++ b/board/Barix/ipam390/ipam390.c @@ -157,7 +157,7 @@ u32 get_board_rev(void) u32 maxcpuclk = CONFIG_DA850_EVM_MAX_CPU_CLK; u32 rev = 0; - s = getenv("maxcpuclk"); + s = env_get("maxcpuclk"); if (s) maxcpuclk = simple_strtoul(s, NULL, 10); diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c index eb34de931ec..39a600b5c17 100644 --- a/board/BuR/common/common.c +++ b/board/BuR/common/common.c @@ -263,9 +263,9 @@ static int load_devicetree(void) (size_t *)&dtbsize, NULL, 0x20000, (u_char *)dtbaddr); #else - char *dtbname = getenv("dtb"); - char *dtbdev = getenv("dtbdev"); - char *dtbpart = getenv("dtbpart"); + char *dtbname = env_get("dtb"); + char *dtbdev = env_get("dtbdev"); + char *dtbpart = env_get("dtbpart"); if (!dtbdev || !dtbpart || !dtbname) { printf("%s: <dtbdev>/<dtbpart>/<dtb> missing.\n", __func__); return -1; @@ -405,11 +405,11 @@ static void br_summaryscreen_printenv(char *prefix, char *name, char *altname, char *suffix) { - char *envval = getenv(name); + char *envval = env_get(name); if (0 != envval) { lcd_printf("%s %s %s", prefix, envval, suffix); } else if (0 != altname) { - envval = getenv(altname); + envval = env_get(altname); if (0 != envval) lcd_printf("%s %s %s", prefix, envval, suffix); } else { @@ -657,7 +657,7 @@ int board_eth_init(bd_t *bis) mac_addr[4] = mac_lo & 0xFF; mac_addr[5] = (mac_lo & 0xFF00) >> 8; - if (!getenv("ethaddr")) { + if (!env_get("ethaddr")) { #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_USE_FDT) printf("<ethaddr> not set. trying DTB ... "); mac = dtbmacaddr(0); diff --git a/board/BuS/eb_cpu5282/eb_cpu5282.c b/board/BuS/eb_cpu5282/eb_cpu5282.c index a00a83a4a54..d23b9f3a4f3 100644 --- a/board/BuS/eb_cpu5282/eb_cpu5282.c +++ b/board/BuS/eb_cpu5282/eb_cpu5282.c @@ -139,7 +139,7 @@ void hw_watchdog_init(void) int enable; enable = 1; - s = getenv("watchdog"); + s = env_get("watchdog"); if (s != NULL) if ((strncmp(s, "off", 3) == 0) || (strncmp(s, "0", 1) == 0)) enable = 0; @@ -191,13 +191,13 @@ int drv_video_init(void) unsigned long splash; #endif printf("Init Video as "); - s = getenv("displaywidth"); + s = env_get("displaywidth"); if (s != NULL) display_width = simple_strtoul(s, NULL, 10); else display_width = 256; - s = getenv("displayheight"); + s = env_get("displayheight"); if (s != NULL) display_height = simple_strtoul(s, NULL, 10); else @@ -211,7 +211,7 @@ int drv_video_init(void) vcxk_init(display_width, display_height); #ifdef CONFIG_SPLASH_SCREEN - s = getenv("splashimage"); + s = env_get("splashimage"); if (s != NULL) { splash = simple_strtoul(s, NULL, 16); vcxk_acknowledge_wait(); diff --git a/board/CarMediaLab/flea3/flea3.c b/board/CarMediaLab/flea3/flea3.c index 3cd4dc95fe3..5e75eb0b643 100644 --- a/board/CarMediaLab/flea3/flea3.c +++ b/board/CarMediaLab/flea3/flea3.c @@ -211,7 +211,7 @@ int ft_board_setup(void *blob, bd_t *bd) { "mxc_nand", MTD_DEV_TYPE_NAND, }, /* NAND flash */ }; - if (getenv("fdt_noauto")) { + if (env_get("fdt_noauto")) { puts(" Skiping ft_board_setup (fdt_noauto defined)\n"); return 0; } diff --git a/board/LaCie/net2big_v2/net2big_v2.c b/board/LaCie/net2big_v2/net2big_v2.c index 416af469fa7..f639a37d4da 100644 --- a/board/LaCie/net2big_v2/net2big_v2.c +++ b/board/LaCie/net2big_v2/net2big_v2.c @@ -221,7 +221,7 @@ int misc_init_r(void) { init_fan(); #if defined(CONFIG_CMD_I2C) && defined(CONFIG_SYS_I2C_EEPROM_ADDR) - if (!getenv("ethaddr")) { + if (!env_get("ethaddr")) { uchar mac[6]; if (lacie_read_mac_address(mac) == 0) eth_env_set_enetaddr("ethaddr", mac); diff --git a/board/LaCie/netspace_v2/netspace_v2.c b/board/LaCie/netspace_v2/netspace_v2.c index fa07288d6e2..52f36644a3e 100644 --- a/board/LaCie/netspace_v2/netspace_v2.c +++ b/board/LaCie/netspace_v2/netspace_v2.c @@ -83,7 +83,7 @@ int board_init(void) int misc_init_r(void) { #if defined(CONFIG_CMD_I2C) && defined(CONFIG_SYS_I2C_EEPROM_ADDR) - if (!getenv("ethaddr")) { + if (!env_get("ethaddr")) { uchar mac[6]; if (lacie_read_mac_address(mac) == 0) eth_env_set_enetaddr("ethaddr", mac); diff --git a/board/amazon/kc1/kc1.c b/board/amazon/kc1/kc1.c index 2d8be1804ae..eead98b24eb 100644 --- a/board/amazon/kc1/kc1.c +++ b/board/amazon/kc1/kc1.c @@ -118,7 +118,7 @@ int misc_init_r(void) } if (reboot_mode[0] > 0 && isascii(reboot_mode[0])) { - if (!getenv("reboot-mode")) + if (!env_get("reboot-mode")) env_set("reboot-mode", (char *)reboot_mode); } diff --git a/board/amlogic/odroid-c2/odroid-c2.c b/board/amlogic/odroid-c2/odroid-c2.c index ca9c13bcc1e..611155d3e55 100644 --- a/board/amlogic/odroid-c2/odroid-c2.c +++ b/board/amlogic/odroid-c2/odroid-c2.c @@ -51,7 +51,7 @@ int misc_init_r(void) eth_env_set_enetaddr("ethaddr", mac_addr); } - if (!getenv("serial#")) { + if (!env_get("serial#")) { len = meson_sm_read_efuse(EFUSE_SN_OFFSET, serial, EFUSE_SN_SIZE); if (len == EFUSE_SN_SIZE) diff --git a/board/aristainetos/aristainetos-v2.c b/board/aristainetos/aristainetos-v2.c index bdf41b99c87..698715ca206 100644 --- a/board/aristainetos/aristainetos-v2.c +++ b/board/aristainetos/aristainetos-v2.c @@ -651,7 +651,7 @@ int board_late_init(void) { char *my_bootdelay; char bootmode = 0; - char const *panel = getenv("panel"); + char const *panel = env_get("panel"); /* * Check the boot-source. If booting from NOR Flash, @@ -668,7 +668,7 @@ int board_late_init(void) bootmode |= (gpio_get_value(IMX_GPIO_NR(7, 1)) ? 1 : 0) << 2; if (bootmode == 7) { - my_bootdelay = getenv("nor_bootdelay"); + my_bootdelay = env_get("nor_bootdelay"); if (my_bootdelay != NULL) env_set("bootdelay", my_bootdelay); else diff --git a/board/atmel/sama5d2_xplained/sama5d2_xplained.c b/board/atmel/sama5d2_xplained/sama5d2_xplained.c index 4a06cda6f4a..3f0860c555a 100644 --- a/board/atmel/sama5d2_xplained/sama5d2_xplained.c +++ b/board/atmel/sama5d2_xplained/sama5d2_xplained.c @@ -169,7 +169,7 @@ static int set_ethaddr_from_eeprom(void) const char *ETHADDR_NAME = "ethaddr"; struct udevice *bus, *dev; - if (getenv(ETHADDR_NAME)) + if (env_get(ETHADDR_NAME)) return 0; if (uclass_get_device_by_seq(UCLASS_I2C, 1, &bus)) { diff --git a/board/birdland/bav335x/board.c b/board/birdland/bav335x/board.c index a9d9ce6fa5b..e174336e2c9 100644 --- a/board/birdland/bav335x/board.c +++ b/board/birdland/bav335x/board.c @@ -392,7 +392,7 @@ int board_eth_init(bd_t *bis) #if (defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD)) || \ (defined(CONFIG_SPL_ETH_SUPPORT) && defined(CONFIG_SPL_BUILD)) - if (!getenv("ethaddr")) { + if (!env_get("ethaddr")) { printf("<ethaddr> not set. Validating first E-fuse MAC\n"); if (is_valid_ethaddr(mac_addr)) diff --git a/board/bluegiga/apx4devkit/apx4devkit.c b/board/bluegiga/apx4devkit/apx4devkit.c index 2215c29c9c6..25e5c3d80cd 100644 --- a/board/bluegiga/apx4devkit/apx4devkit.c +++ b/board/bluegiga/apx4devkit/apx4devkit.c @@ -133,8 +133,8 @@ void get_board_serial(struct tag_serialnr *serialnr) #ifdef CONFIG_REVISION_TAG u32 get_board_rev(void) { - if (getenv("revision#") != NULL) - return simple_strtoul(getenv("revision#"), NULL, 10); + if (env_get("revision#") != NULL) + return simple_strtoul(env_get("revision#"), NULL, 10); return 0; } #endif diff --git a/board/bluewater/gurnard/gurnard.c b/board/bluewater/gurnard/gurnard.c index e82c6918414..8733a9af163 100644 --- a/board/bluewater/gurnard/gurnard.c +++ b/board/bluewater/gurnard/gurnard.c @@ -341,7 +341,7 @@ int board_init(void) at91_set_A_periph(AT91_PIN_PE6, 1); /* power up */ /* Select the second timing index for board rev 2 */ - rev_str = getenv("board_rev"); + rev_str = env_get("board_rev"); if (rev_str && !strncmp(rev_str, "2", 1)) { struct udevice *dev; @@ -368,7 +368,7 @@ int board_late_init(void) * Set MAC address so we do not need to init Ethernet before Linux * boot */ - env_str = getenv("ethaddr"); + env_str = env_get("ethaddr"); if (env_str) { struct at91_emac *emac = (struct at91_emac *)ATMEL_BASE_EMAC; /* Parse MAC address */ @@ -385,7 +385,7 @@ int board_late_init(void) &emac->sa2l); writel((env_enetaddr[4] | env_enetaddr[5] << 8), &emac->sa2h); - printf("MAC: %s\n", getenv("ethaddr")); + printf("MAC: %s\n", env_get("ethaddr")); } else { /* Not set in environment */ printf("MAC: not set\n"); diff --git a/board/bosch/shc/board.c b/board/bosch/shc/board.c index b4c6a0b45d3..999ed95c31d 100644 --- a/board/bosch/shc/board.c +++ b/board/bosch/shc/board.c @@ -545,7 +545,7 @@ int board_eth_init(bd_t *bis) #if (defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD)) || \ (defined(CONFIG_SPL_ETH_SUPPORT) && defined(CONFIG_SPL_BUILD)) - if (!getenv("ethaddr")) { + if (!env_get("ethaddr")) { printf("<ethaddr> not set. Validating first E-fuse MAC\n"); if (is_valid_ethaddr(mac_addr)) diff --git a/board/boundary/nitrogen6x/nitrogen6x.c b/board/boundary/nitrogen6x/nitrogen6x.c index 0e2c4fc0ef4..3b92b64f6a4 100644 --- a/board/boundary/nitrogen6x/nitrogen6x.c +++ b/board/boundary/nitrogen6x/nitrogen6x.c @@ -749,7 +749,7 @@ size_t display_count = ARRAY_SIZE(displays); int board_cfb_skip(void) { - return NULL != getenv("novideo"); + return NULL != env_get("novideo"); } static void setup_display(void) @@ -974,7 +974,7 @@ static void preboot_keys(void) char keypress[ARRAY_SIZE(buttons)+1]; numpressed = read_keys(keypress); if (numpressed) { - char *kbd_magic_keys = getenv("magic_keys"); + char *kbd_magic_keys = env_get("magic_keys"); char *suffix; /* * loop over all magic keys @@ -983,7 +983,7 @@ static void preboot_keys(void) char *keys; char magic[sizeof(kbd_magic_prefix) + 1]; sprintf(magic, "%s%c", kbd_magic_prefix, *suffix); - keys = getenv(magic); + keys = env_get(magic); if (keys) { if (!strcmp(keys, keypress)) break; @@ -993,7 +993,7 @@ static void preboot_keys(void) char cmd_name[sizeof(kbd_command_prefix) + 1]; char *cmd; sprintf(cmd_name, "%s%c", kbd_command_prefix, *suffix); - cmd = getenv(cmd_name); + cmd = env_get(cmd_name); if (cmd) { env_set("preboot", cmd); return; diff --git a/board/broadcom/bcm23550_w1d/bcm23550_w1d.c b/board/broadcom/bcm23550_w1d/bcm23550_w1d.c index 5f4c634362a..0267582186a 100644 --- a/board/broadcom/bcm23550_w1d/bcm23550_w1d.c +++ b/board/broadcom/bcm23550_w1d/bcm23550_w1d.c @@ -103,7 +103,7 @@ int board_usb_init(int index, enum usb_init_type init) int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name) { debug("%s\n", __func__); - if (!getenv("serial#")) + if (!env_get("serial#")) g_dnl_set_serialnumber(CONFIG_USB_SERIALNO); return 0; } diff --git a/board/broadcom/bcm28155_ap/bcm28155_ap.c b/board/broadcom/bcm28155_ap/bcm28155_ap.c index f5b94f6430f..8f48ccbf1c5 100644 --- a/board/broadcom/bcm28155_ap/bcm28155_ap.c +++ b/board/broadcom/bcm28155_ap/bcm28155_ap.c @@ -110,7 +110,7 @@ int board_usb_init(int index, enum usb_init_type init) int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name) { debug("%s\n", __func__); - if (!getenv("serial#")) + if (!env_get("serial#")) g_dnl_set_serialnumber(CONFIG_USB_SERIALNO); return 0; } diff --git a/board/cadence/xtfpga/xtfpga.c b/board/cadence/xtfpga/xtfpga.c index 83244c3ad41..f81fa95c18a 100644 --- a/board/cadence/xtfpga/xtfpga.c +++ b/board/cadence/xtfpga/xtfpga.c @@ -86,7 +86,7 @@ int misc_init_r(void) * Default MAC address comes from CONFIG_ETHADDR + DIP switches 1-6. */ - char *s = getenv("ethaddr"); + char *s = env_get("ethaddr"); if (s == 0) { unsigned int x; char s[] = __stringify(CONFIG_ETHBASE); diff --git a/board/compulab/cl-som-am57x/eth.c b/board/compulab/cl-som-am57x/eth.c index d2992d3a633..0ad10056fe9 100644 --- a/board/compulab/cl-som-am57x/eth.c +++ b/board/compulab/cl-som-am57x/eth.c @@ -181,7 +181,7 @@ int board_eth_init(bd_t *bis) gpio_set_value(CL_SOM_AM57X_GPIO_PHY1_RST, 1); mdelay(20); - cpsw_phy_envval = getenv("cpsw_phy"); + cpsw_phy_envval = env_get("cpsw_phy"); if (cpsw_phy_envval != NULL) cpsw_act_phy = simple_strtoul(cpsw_phy_envval, NULL, 0); diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index 23682265465..5a8ee13c8b7 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -114,10 +114,10 @@ int board_video_skip(void) { int ret; struct display_info_t *preset; - char const *panel = getenv("displaytype"); + char const *panel = env_get("displaytype"); if (!panel) /* Also accept panel for backward compatibility */ - panel = getenv("panel"); + panel = env_get("panel"); if (!panel) return -ENOENT; diff --git a/board/compulab/common/omap3_display.c b/board/compulab/common/omap3_display.c index 61707f5b900..ed2077e3617 100644 --- a/board/compulab/common/omap3_display.c +++ b/board/compulab/common/omap3_display.c @@ -400,7 +400,7 @@ void lcd_ctrl_init(void *lcdbase) { struct prcm *prcm = (struct prcm *)PRCM_BASE; char *custom_lcd; - char *displaytype = getenv("displaytype"); + char *displaytype = env_get("displaytype"); if (displaytype == NULL) return; @@ -408,7 +408,7 @@ void lcd_ctrl_init(void *lcdbase) lcd_def = env_parse_displaytype(displaytype); /* If we did not recognize the preset, check if it's an env variable */ if (lcd_def == NONE) { - custom_lcd = getenv(displaytype); + custom_lcd = env_get(displaytype); if (custom_lcd == NULL || parse_customlcd(custom_lcd) < 0) return; } diff --git a/board/congatec/cgtqmx6eval/cgtqmx6eval.c b/board/congatec/cgtqmx6eval/cgtqmx6eval.c index ac66248b3ff..8cd0090887a 100644 --- a/board/congatec/cgtqmx6eval/cgtqmx6eval.c +++ b/board/congatec/cgtqmx6eval/cgtqmx6eval.c @@ -235,7 +235,7 @@ int power_init_board(void) return 0; /* set level of MIPI if specified */ - lv_mipi = getenv("lv_mipi"); + lv_mipi = env_get("lv_mipi"); if (lv_mipi) return 0; @@ -583,7 +583,7 @@ int board_video_skip(void) { int i; int ret; - char const *panel = getenv("panel"); + char const *panel = env_get("panel"); if (!panel) { for (i = 0; i < ARRAY_SIZE(displays); i++) { struct display_info_t const *dev = displays + i; diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c index 8cab357a926..f8c8bff64c2 100644 --- a/board/davinci/da8xxevm/da850evm.c +++ b/board/davinci/da8xxevm/da850evm.c @@ -292,7 +292,7 @@ u32 get_board_rev(void) u32 maxcpuclk = CONFIG_DA850_EVM_MAX_CPU_CLK; u32 rev = 0; - s = getenv("maxcpuclk"); + s = env_get("maxcpuclk"); if (s) maxcpuclk = simple_strtoul(s, NULL, 10); diff --git a/board/davinci/da8xxevm/omapl138_lcdk.c b/board/davinci/da8xxevm/omapl138_lcdk.c index 29296b04781..565020760d5 100644 --- a/board/davinci/da8xxevm/omapl138_lcdk.c +++ b/board/davinci/da8xxevm/omapl138_lcdk.c @@ -293,7 +293,7 @@ static void dspwake(void) if ((REG(CHIP_REV_ID_REG) & 0x3f) == 0x10) return; - if (!strcmp(getenv("dspwake"), "no")) + if (!strcmp(env_get("dspwake"), "no")) return; *resetvect++ = 0x1E000; /* DSP Idle */ @@ -323,7 +323,7 @@ int misc_init_r(void) uint8_t tmp[20], addr[10]; - if (getenv("ethaddr") == NULL) { + if (env_get("ethaddr") == NULL) { /* Read Ethernet MAC address from EEPROM */ if (dvevm_read_mac_address(addr)) { /* Set Ethernet MAC address from EEPROM */ diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c index 93a02ab0eed..0c5900a15a4 100644 --- a/board/esd/meesc/meesc.c +++ b/board/esd/meesc/meesc.c @@ -181,7 +181,7 @@ int checkboard(void) puts("Board: EtherCAN/2 Gateway"); break; } - if (getenv_f("serial#", str, sizeof(str)) > 0) { + if (env_get_f("serial#", str, sizeof(str)) > 0) { puts(", serial# "); puts(str); } @@ -198,7 +198,7 @@ void get_board_serial(struct tag_serialnr *serialnr) { char *str; - char *serial = getenv("serial#"); + char *serial = env_get("serial#"); if (serial) { str = strchr(serial, '_'); if (str && (strlen(str) >= 4)) { @@ -231,7 +231,8 @@ int misc_init_r(void) * In some cases this this needs to be set to 4. * Check the user has set environment mdiv to 4 to change the divisor. */ - if ((str = getenv("mdiv")) && (strcmp(str, "4") == 0)) { + str = env_get("mdiv"); + if (str && (strcmp(str, "4") == 0)) { writel((readl(&pmc->mckr) & ~AT91_PMC_MDIV) | AT91SAM9_PMC_MDIV_4, &pmc->mckr); at91_clock_init(CONFIG_SYS_AT91_MAIN_CLOCK); diff --git a/board/freescale/b4860qds/b4860qds.c b/board/freescale/b4860qds/b4860qds.c index 83a70153e87..1fea91b3b5e 100644 --- a/board/freescale/b4860qds/b4860qds.c +++ b/board/freescale/b4860qds/b4860qds.c @@ -195,7 +195,7 @@ static int adjust_vdd(ulong vdd_override) vid, vdd_target/10); /* check override variable for overriding VDD */ - vdd_string = getenv("b4qds_vdd_mv"); + vdd_string = env_get("b4qds_vdd_mv"); if (vdd_override == 0 && vdd_string && !strict_strtoul(vdd_string, 10, &vdd_string_override)) vdd_override = vdd_string_override; @@ -542,7 +542,7 @@ int configure_vsc3316_3308(void) * Extract hwconfig from environment since environment * is not setup properly yet */ - getenv_f("hwconfig", buffer, sizeof(buffer)); + env_get_f("hwconfig", buffer, sizeof(buffer)); buf = buffer; if (hwconfig_subarg_cmp_f("fsl_b4860_serdes2", diff --git a/board/freescale/common/sys_eeprom.c b/board/freescale/common/sys_eeprom.c index c593cff5e70..152ad84672a 100644 --- a/board/freescale/common/sys_eeprom.c +++ b/board/freescale/common/sys_eeprom.c @@ -478,7 +478,7 @@ int mac_read_from_eeprom(void) /* Only initialize environment variables that are blank * (i.e. have not yet been set) */ - if (!getenv(enetvar)) + if (!env_get(enetvar)) env_set(enetvar, ethaddr); } } diff --git a/board/freescale/common/vid.c b/board/freescale/common/vid.c index 9b65c13b1ab..d6d1bfc8616 100644 --- a/board/freescale/common/vid.c +++ b/board/freescale/common/vid.c @@ -376,7 +376,7 @@ int adjust_vdd(ulong vdd_override) vdd_target = vdd[vid]; /* check override variable for overriding VDD */ - vdd_string = getenv(CONFIG_VID_FLS_ENV); + vdd_string = env_get(CONFIG_VID_FLS_ENV); if (vdd_override == 0 && vdd_string && !strict_strtoul(vdd_string, 10, &vdd_string_override)) vdd_override = vdd_string_override; @@ -560,7 +560,7 @@ int adjust_vdd(ulong vdd_override) vdd_target = vdd[vid]; /* check override variable for overriding VDD */ - vdd_string = getenv(CONFIG_VID_FLS_ENV); + vdd_string = env_get(CONFIG_VID_FLS_ENV); if (vdd_override == 0 && vdd_string && !strict_strtoul(vdd_string, 10, &vdd_string_override)) vdd_override = vdd_string_override; diff --git a/board/freescale/ls2080aqds/eth.c b/board/freescale/ls2080aqds/eth.c index defcac52634..aca29bc3613 100644 --- a/board/freescale/ls2080aqds/eth.c +++ b/board/freescale/ls2080aqds/eth.c @@ -449,7 +449,7 @@ static void initialize_dpmac_to_slot(void) >> FSL_CHASSIS3_RCWSR28_SRDS2_PRTCL_SHIFT; char *env_hwconfig; - env_hwconfig = getenv("hwconfig"); + env_hwconfig = env_get("hwconfig"); switch (serdes1_prtcl) { case 0x07: @@ -603,7 +603,7 @@ void ls2080a_handle_phy_interface_sgmii(int dpmac_id) >> FSL_CHASSIS3_RCWSR28_SRDS2_PRTCL_SHIFT; int *riser_phy_addr; - char *env_hwconfig = getenv("hwconfig"); + char *env_hwconfig = env_get("hwconfig"); if (hwconfig_f("xqsgmii", env_hwconfig)) riser_phy_addr = &xqsgii_riser_phy_addr[0]; @@ -849,7 +849,7 @@ int board_eth_init(bd_t *bis) unsigned int i; char *env_hwconfig; - env_hwconfig = getenv("hwconfig"); + env_hwconfig = env_get("hwconfig"); initialize_dpmac_to_slot(); diff --git a/board/freescale/ls2080aqds/ls2080aqds.c b/board/freescale/ls2080aqds/ls2080aqds.c index f36fb9810bd..83773d0af5d 100644 --- a/board/freescale/ls2080aqds/ls2080aqds.c +++ b/board/freescale/ls2080aqds/ls2080aqds.c @@ -204,7 +204,7 @@ int board_init(void) val = in_le32(dcfg_ccsr + DCFG_RCWSR13 / 4); - env_hwconfig = getenv("hwconfig"); + env_hwconfig = env_get("hwconfig"); if (hwconfig_f("dspi", env_hwconfig) && DCFG_RCWSR13_DSPI == (val & (u32)(0xf << 8))) diff --git a/board/freescale/ls2080ardb/ls2080ardb.c b/board/freescale/ls2080ardb/ls2080ardb.c index d7122b3dfca..07ba0266d57 100644 --- a/board/freescale/ls2080ardb/ls2080ardb.c +++ b/board/freescale/ls2080ardb/ls2080ardb.c @@ -250,7 +250,7 @@ int misc_init_r(void) val = in_le32(dcfg_ccsr + DCFG_RCWSR13 / 4); - env_hwconfig = getenv("hwconfig"); + env_hwconfig = env_get("hwconfig"); if (hwconfig_f("dspi", env_hwconfig) && DCFG_RCWSR13_DSPI == (val & (u32)(0xf << 8))) diff --git a/board/freescale/mpc837xemds/pci.c b/board/freescale/mpc837xemds/pci.c index 39c40e5cc95..e5d3dfd4545 100644 --- a/board/freescale/mpc837xemds/pci.c +++ b/board/freescale/mpc837xemds/pci.c @@ -67,7 +67,7 @@ static struct pci_region pcie_regions_1[] = { static int is_pex_x2(void) { - const char *pex_x2 = getenv("pex_x2"); + const char *pex_x2 = env_get("pex_x2"); if (pex_x2 && !strcmp(pex_x2, "yes")) return 1; diff --git a/board/freescale/mpc837xerdb/mpc837xerdb.c b/board/freescale/mpc837xerdb/mpc837xerdb.c index 319f0479e2c..9a0ab7f2ad2 100644 --- a/board/freescale/mpc837xerdb/mpc837xerdb.c +++ b/board/freescale/mpc837xerdb/mpc837xerdb.c @@ -173,7 +173,7 @@ int board_mmc_init(bd_t *bd) char buffer[HWCONFIG_BUFFER_SIZE] = {0}; int esdhc_hwconfig_enabled = 0; - if (getenv_f("hwconfig", buffer, sizeof(buffer)) > 0) + if (env_get_f("hwconfig", buffer, sizeof(buffer)) > 0) esdhc_hwconfig_enabled = hwconfig_f("esdhc", buffer); if (esdhc_hwconfig_enabled == 0) diff --git a/board/freescale/mx51evk/mx51evk_video.c b/board/freescale/mx51evk/mx51evk_video.c index 86ec7508dbb..cc2c855b88f 100644 --- a/board/freescale/mx51evk/mx51evk_video.c +++ b/board/freescale/mx51evk/mx51evk_video.c @@ -76,7 +76,7 @@ void setup_iomux_lcd(void) int board_video_skip(void) { int ret; - char const *e = getenv("panel"); + char const *e = env_get("panel"); if (e) { if (strcmp(e, "claa") == 0) { diff --git a/board/freescale/mx53loco/mx53loco_video.c b/board/freescale/mx53loco/mx53loco_video.c index bc5e8a9d3e0..5fb0f043876 100644 --- a/board/freescale/mx53loco/mx53loco_video.c +++ b/board/freescale/mx53loco/mx53loco_video.c @@ -92,7 +92,7 @@ void setup_iomux_lcd(void) int board_video_skip(void) { int ret; - char const *e = getenv("panel"); + char const *e = env_get("panel"); if (e) { if (strcmp(e, "seiko") == 0) { diff --git a/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c b/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c index 51217c58e57..9ae38ce1154 100644 --- a/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c +++ b/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c @@ -350,7 +350,8 @@ int board_eth_init(bd_t *bis) #ifdef CONFIG_VSC7385_ENET /* If a VSC7385 microcode image is present, then upload it. */ - if ((tmp = getenv("vscfw_addr")) != NULL) { + tmp = env_get("vscfw_addr"); + if (tmp) { vscfw_addr = simple_strtoul(tmp, NULL, 16); printf("uploading VSC7385 microcode from %x\n", vscfw_addr); if (vsc7385_upload_firmware((void *) vscfw_addr, diff --git a/board/freescale/t4qds/t4240qds.c b/board/freescale/t4qds/t4240qds.c index 8f9e7e82550..2bdd6a349d7 100644 --- a/board/freescale/t4qds/t4240qds.c +++ b/board/freescale/t4qds/t4240qds.c @@ -265,7 +265,7 @@ static int adjust_vdd(ulong vdd_override) vdd_target = vdd[vid]; /* check override variable for overriding VDD */ - vdd_string = getenv("t4240qds_vdd_mv"); + vdd_string = env_get("t4240qds_vdd_mv"); if (vdd_override == 0 && vdd_string && !strict_strtoul(vdd_string, 10, &vdd_string_override)) vdd_override = vdd_string_override; diff --git a/board/gateworks/gw_ventana/common.c b/board/gateworks/gw_ventana/common.c index 46404b4d59f..e9865b4adbf 100644 --- a/board/gateworks/gw_ventana/common.c +++ b/board/gateworks/gw_ventana/common.c @@ -1160,7 +1160,7 @@ void setup_board_gpio(int board, struct ventana_board_info *info) char arg[10]; size_t len; int i; - int quiet = simple_strtol(getenv("quiet"), NULL, 10); + int quiet = simple_strtol(env_get("quiet"), NULL, 10); if (board >= GW_UNKNOWN) return; diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c index 61298ab2fd6..4ddc7e1fa21 100644 --- a/board/gateworks/gw_ventana/gw_ventana.c +++ b/board/gateworks/gw_ventana/gw_ventana.c @@ -298,11 +298,11 @@ int board_eth_init(bd_t *bis) #endif /* default to the first detected enet dev */ - if (!getenv("ethprime")) { + if (!env_get("ethprime")) { struct eth_device *dev = eth_get_dev_by_index(0); if (dev) { env_set("ethprime", dev->name); - printf("set ethprime to %s\n", getenv("ethprime")); + printf("set ethprime to %s\n", env_get("ethprime")); } } @@ -579,7 +579,7 @@ void board_pci_fixup_dev(struct pci_controller *hose, pci_dev_t dev, */ void get_board_serial(struct tag_serialnr *serialnr) { - char *serial = getenv("serial#"); + char *serial = env_get("serial#"); if (serial) { serialnr->high = 0; @@ -658,7 +658,7 @@ int checkboard(void) int quiet; /* Quiet or minimal output mode */ quiet = 0; - p = getenv("quiet"); + p = env_get("quiet"); if (p) quiet = simple_strtol(p, NULL, 10); else @@ -746,7 +746,7 @@ int misc_init_r(void) for (i = 0; i < (sizeof(str)-1) && info->model[i]; i++) str[i] = tolower(info->model[i]); env_set("model", str); - if (!getenv("fdt_file")) { + if (!env_get("fdt_file")) { sprintf(fdt, "%s-%s.dtb", cputype, str); env_set("fdt_file", fdt); } @@ -770,11 +770,11 @@ int misc_init_r(void) /* initialize env from EEPROM */ if (test_bit(EECONFIG_ETH0, info->config) && - !getenv("ethaddr")) { + !env_get("ethaddr")) { eth_env_set_enetaddr("ethaddr", info->mac0); } if (test_bit(EECONFIG_ETH1, info->config) && - !getenv("eth1addr")) { + !env_get("eth1addr")) { eth_env_set_enetaddr("eth1addr", info->mac1); } @@ -788,7 +788,7 @@ int misc_init_r(void) } /* Set a non-initialized hwconfig based on board configuration */ - if (!strcmp(getenv("hwconfig"), "_UNKNOWN_")) { + if (!strcmp(env_get("hwconfig"), "_UNKNOWN_")) { buf[0] = 0; if (gpio_cfg[board_type].rs232_en) strcat(buf, "rs232;"); @@ -1035,7 +1035,7 @@ int fdt_fixup_sky2(void *blob, int np, struct pci_dev *dev) int j; sprintf(mac, "eth1addr"); - tmp = getenv(mac); + tmp = env_get(mac); if (tmp) { for (j = 0; j < 6; j++) { mac_addr[j] = tmp ? @@ -1118,8 +1118,8 @@ int ft_board_setup(void *blob, bd_t *bd) { "sst,w25q256", MTD_DEV_TYPE_NOR, }, /* SPI flash */ { "fsl,imx6q-gpmi-nand", MTD_DEV_TYPE_NAND, }, /* NAND flash */ }; - const char *model = getenv("model"); - const char *display = getenv("display"); + const char *model = env_get("model"); + const char *display = env_get("display"); int i; char rev = 0; @@ -1131,7 +1131,7 @@ int ft_board_setup(void *blob, bd_t *bd) } } - if (getenv("fdt_noauto")) { + if (env_get("fdt_noauto")) { puts(" Skiping ft_board_setup (fdt_noauto defined)\n"); return 0; } @@ -1152,15 +1152,15 @@ int ft_board_setup(void *blob, bd_t *bd) printf(" Adjusting FDT per EEPROM for %s...\n", model); /* board serial number */ - fdt_setprop(blob, 0, "system-serial", getenv("serial#"), - strlen(getenv("serial#")) + 1); + fdt_setprop(blob, 0, "system-serial", env_get("serial#"), + strlen(env_get("serial#")) + 1); /* board (model contains model from device-tree) */ fdt_setprop(blob, 0, "board", info->model, strlen((const char *)info->model) + 1); /* set desired digital video capture format */ - ft_sethdmiinfmt(blob, getenv("hdmiinfmt")); + ft_sethdmiinfmt(blob, env_get("hdmiinfmt")); /* * Board model specific fixups @@ -1315,7 +1315,7 @@ int ft_board_setup(void *blob, bd_t *bd) } #if defined(CONFIG_CMD_PCI) - if (!getenv("nopcifixup")) + if (!env_get("nopcifixup")) ft_board_pci_fixup(blob, bd); #endif @@ -1324,7 +1324,7 @@ int ft_board_setup(void *blob, bd_t *bd) * remove nodes by alias path if EEPROM config tells us the * peripheral is not loaded on the board. */ - if (getenv("fdt_noconfig")) { + if (env_get("fdt_noconfig")) { puts(" Skiping periperhal config (fdt_noconfig defined)\n"); return 0; } diff --git a/board/gateworks/gw_ventana/gw_ventana_spl.c b/board/gateworks/gw_ventana/gw_ventana_spl.c index baa8480b6c4..feea228b3d6 100644 --- a/board/gateworks/gw_ventana/gw_ventana_spl.c +++ b/board/gateworks/gw_ventana/gw_ventana_spl.c @@ -691,7 +691,7 @@ int spl_start_uboot(void) #ifdef CONFIG_SPL_ENV_SUPPORT env_init(); env_load(); - debug("boot_os=%s\n", getenv("boot_os")); + debug("boot_os=%s\n", env_get("boot_os")); if (getenv_yesno("boot_os") == 1) ret = 0; #else diff --git a/board/gdsys/a38x/keyprogram.c b/board/gdsys/a38x/keyprogram.c index a4a6f1cca5e..d75e08b39f5 100644 --- a/board/gdsys/a38x/keyprogram.c +++ b/board/gdsys/a38x/keyprogram.c @@ -129,12 +129,12 @@ int load_and_run_keyprog(void) char *hexprog; struct key_program *prog; - cmd = getenv("loadkeyprogram"); + cmd = env_get("loadkeyprogram"); if (!cmd || run_command(cmd, 0)) return 1; - hexprog = getenv("keyprogram"); + hexprog = env_get("keyprogram"); if (decode_hexstr(hexprog, &binprog)) return 1; diff --git a/board/gdsys/mpc8308/hrcon.c b/board/gdsys/mpc8308/hrcon.c index c6566e9196c..7e485074ce0 100644 --- a/board/gdsys/mpc8308/hrcon.c +++ b/board/gdsys/mpc8308/hrcon.c @@ -103,7 +103,7 @@ int fpga_get_reg(u32 fpga, u16 *reg, off_t regoff, u16 *data) int checkboard(void) { - char *s = getenv("serial#"); + char *s = env_get("serial#"); bool hw_type_cat = pca9698_get_value(0x20, 20); puts("Board: "); diff --git a/board/gdsys/mpc8308/strider.c b/board/gdsys/mpc8308/strider.c index 34e9d1956e2..fec691515d4 100644 --- a/board/gdsys/mpc8308/strider.c +++ b/board/gdsys/mpc8308/strider.c @@ -106,7 +106,7 @@ int fpga_get_reg(u32 fpga, u16 *reg, off_t regoff, u16 *data) int checkboard(void) { - char *s = getenv("serial#"); + char *s = env_get("serial#"); bool hw_type_cat = pca9698_get_value(0x20, 18); puts("Board: "); diff --git a/board/gdsys/p1022/controlcenterd-id.c b/board/gdsys/p1022/controlcenterd-id.c index 95f11fb69f3..61c030a4588 100644 --- a/board/gdsys/p1022/controlcenterd-id.c +++ b/board/gdsys/p1022/controlcenterd-id.c @@ -1043,13 +1043,13 @@ static int second_stage_init(void) goto failure; /* run "prepboot" from env to get "mmcdev" set */ - cptr = getenv("prepboot"); + cptr = env_get("prepboot"); if (cptr && !run_command(cptr, 0)) - mmcdev = getenv("mmcdev"); + mmcdev = env_get("mmcdev"); if (!mmcdev) goto failure; - cptr = getenv("ramdiskimage"); + cptr = env_get("ramdiskimage"); if (cptr) image_path = cptr; diff --git a/board/gdsys/p1022/controlcenterd.c b/board/gdsys/p1022/controlcenterd.c index 01064dcfde1..24e58cbf001 100644 --- a/board/gdsys/p1022/controlcenterd.c +++ b/board/gdsys/p1022/controlcenterd.c @@ -223,7 +223,7 @@ void hw_watchdog_reset(void) #ifdef CONFIG_TRAILBLAZER int do_bootd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { - return run_command(getenv("bootcmd"), flag); + return run_command(env_get("bootcmd"), flag); } int board_early_init_r(void) diff --git a/board/grinn/chiliboard/board.c b/board/grinn/chiliboard/board.c index 2900109bbd3..2f5974a246a 100644 --- a/board/grinn/chiliboard/board.c +++ b/board/grinn/chiliboard/board.c @@ -126,7 +126,7 @@ int board_late_init(void) mac_addr[4] = mac_lo & 0xFF; mac_addr[5] = (mac_lo & 0xFF00) >> 8; - if (!getenv("ethaddr")) { + if (!env_get("ethaddr")) { printf("<ethaddr> not set. Validating first E-fuse MAC\n"); if (is_valid_ethaddr(mac_addr)) @@ -142,7 +142,7 @@ int board_late_init(void) mac_addr[4] = mac_lo & 0xFF; mac_addr[5] = (mac_lo & 0xFF00) >> 8; - if (!getenv("eth1addr")) { + if (!env_get("eth1addr")) { if (is_valid_ethaddr(mac_addr)) eth_env_set_enetaddr("eth1addr", mac_addr); } diff --git a/board/grinn/liteboard/board.c b/board/grinn/liteboard/board.c index 24956927ac4..941e7ea2c8e 100644 --- a/board/grinn/liteboard/board.c +++ b/board/grinn/liteboard/board.c @@ -149,7 +149,7 @@ int board_mmc_init(bd_t *bis) static int check_mmc_autodetect(void) { - char *autodetect_str = getenv("mmcautodetect"); + char *autodetect_str = env_get("mmcautodetect"); if ((autodetect_str != NULL) && (strcmp(autodetect_str, "yes") == 0)) { diff --git a/board/highbank/highbank.c b/board/highbank/highbank.c index e51043aa914..f7c05ab08fa 100644 --- a/board/highbank/highbank.c +++ b/board/highbank/highbank.c @@ -80,7 +80,7 @@ int misc_init_r(void) boot_choice = readl(HB_SREG_A9_BOOT_SRC_STAT) & 0xff; sprintf(envbuffer, "bootcmd%d", boot_choice); - if (getenv(envbuffer)) { + if (env_get(envbuffer)) { sprintf(envbuffer, "run bootcmd%d", boot_choice); env_set("bootcmd", envbuffer); } else diff --git a/board/intel/edison/edison.c b/board/intel/edison/edison.c index aaafae86a80..4b1e6d0f471 100644 --- a/board/intel/edison/edison.c +++ b/board/intel/edison/edison.c @@ -95,10 +95,10 @@ static void assign_hardware_id(void) int board_late_init(void) { - if (!getenv("serial#")) + if (!env_get("serial#")) assign_serial(); - if (!getenv("hardware_id")) + if (!env_get("hardware_id")) assign_hardware_id(); return 0; diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c index 56d30442410..6cd281218ee 100644 --- a/board/keymile/common/common.c +++ b/board/keymile/common/common.c @@ -54,7 +54,7 @@ int set_km_env(void) env_set("pnvramaddr", (char *)buf); /* try to read rootfssize (ram image) from environment */ - p = getenv("rootfssize"); + p = env_get("rootfssize"); if (p != NULL) strict_strtoul(p, 16, &rootfssize); pram = (rootfssize + CONFIG_KM_RESERVED_PRAM + CONFIG_KM_PHRAM + @@ -236,10 +236,10 @@ static int do_checkboardidhwk(cmd_tbl_t *cmdtp, int flag, int argc, } /* now try to read values from environment if available */ - p = getenv("boardid"); + p = env_get("boardid"); if (p != NULL) rc = strict_strtoul(p, 16, &envbid); - p = getenv("hwkey"); + p = env_get("hwkey"); if (p != NULL) rc = strict_strtoul(p, 16, &envhwkey); @@ -253,7 +253,7 @@ static int do_checkboardidhwk(cmd_tbl_t *cmdtp, int flag, int argc, * BoardId/HWkey not available in the environment, so try the * environment variable for BoardId/HWkey list */ - char *bidhwklist = getenv("boardIdListHex"); + char *bidhwklist = env_get("boardIdListHex"); if (bidhwklist) { int found = 0; @@ -355,7 +355,7 @@ static int do_checktestboot(cmd_tbl_t *cmdtp, int flag, int argc, #if defined(CONFIG_POST) testpin = post_hotkeys_pressed(); #endif - s = getenv("test_bank"); + s = env_get("test_bank"); /* when test_bank is not set, act as if testpin is not asserted */ testboot = (testpin != 0) && (s); if (verbose) { diff --git a/board/keymile/common/ivm.c b/board/keymile/common/ivm.c index dc40a83fc08..f1321d9899f 100644 --- a/board/keymile/common/ivm.c +++ b/board/keymile/common/ivm.c @@ -261,7 +261,7 @@ int ivm_analyze_eeprom(unsigned char *buf, int len) GET_STRING("IVM_Symbol", IVM_POS_SYMBOL_ONLY, 8) GET_STRING("IVM_DeviceName", IVM_POS_SHORT_TEXT, 64) - tmp = (unsigned char *) getenv("IVM_DeviceName"); + tmp = (unsigned char *)env_get("IVM_DeviceName"); if (tmp) { int len = strlen((char *)tmp); int i = 0; diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c index 08ae9ae3467..af1ebc4101e 100644 --- a/board/keymile/km_arm/km_arm.c +++ b/board/keymile/km_arm/km_arm.c @@ -201,7 +201,7 @@ int misc_init_r(void) #if defined(CONFIG_KM_MGCOGE3UN) char *wait_for_ne; u8 dip_switch = kw_gpio_get_value(KM_FLASH_ERASE_ENABLE); - wait_for_ne = getenv("waitforne"); + wait_for_ne = env_get("waitforne"); if ((wait_for_ne != NULL) && (dip_switch == 0)) { if (strcmp(wait_for_ne, "true") == 0) { diff --git a/board/keymile/kmp204x/kmp204x.c b/board/keymile/kmp204x/kmp204x.c index 095e467ac0b..671bddfa1cd 100644 --- a/board/keymile/kmp204x/kmp204x.c +++ b/board/keymile/kmp204x/kmp204x.c @@ -239,7 +239,7 @@ void fdt_fixup_fman_mac_addresses(void *blob) unsigned char mac_addr[6]; /* get the mac addr from env */ - tmp = getenv("ethaddr"); + tmp = env_get("ethaddr"); if (!tmp) { printf("ethaddr env variable not defined\n"); return; diff --git a/board/kosagi/novena/novena.c b/board/kosagi/novena/novena.c index baca7223fa3..f0ace03009e 100644 --- a/board/kosagi/novena/novena.c +++ b/board/kosagi/novena/novena.c @@ -240,7 +240,7 @@ int misc_init_r(void) int ret; /* If 'ethaddr' is already set, do nothing. */ - if (getenv("ethaddr")) + if (env_get("ethaddr")) return 0; /* EEPROM is at bus 2. */ diff --git a/board/lg/sniper/sniper.c b/board/lg/sniper/sniper.c index 4906e4f9d22..a299f761f96 100644 --- a/board/lg/sniper/sniper.c +++ b/board/lg/sniper/sniper.c @@ -133,7 +133,7 @@ int misc_init_r(void) } if (reboot_mode[0] > 0 && isascii(reboot_mode[0])) { - if (!getenv("reboot-mode")) + if (!env_get("reboot-mode")) env_set("reboot-mode", (char *)reboot_mode); } diff --git a/board/liebherr/mccmon6/mccmon6.c b/board/liebherr/mccmon6/mccmon6.c index 8d0a66621d8..4f7e018deab 100644 --- a/board/liebherr/mccmon6/mccmon6.c +++ b/board/liebherr/mccmon6/mccmon6.c @@ -467,7 +467,7 @@ int spl_start_uboot(void) return 1; env_init(); - ret = getenv_f("boot_os", s, sizeof(s)); + ret = env_get_f("boot_os", s, sizeof(s)); if ((ret != -1) && (strcmp(s, "no") == 0)) return 1; @@ -481,7 +481,7 @@ int spl_start_uboot(void) * recovery_status = <any value> -> start SWUpdate * */ - ret = getenv_f("recovery_status", s, sizeof(s)); + ret = env_get_f("recovery_status", s, sizeof(s)); if (ret != -1) return 1; diff --git a/board/logicpd/omap3som/omap3logic.c b/board/logicpd/omap3som/omap3logic.c index e86e0c30276..fe3f9e664f9 100644 --- a/board/logicpd/omap3som/omap3logic.c +++ b/board/logicpd/omap3som/omap3logic.c @@ -219,7 +219,7 @@ int board_late_init(void) gd->bd->bi_arch_number = board->machine_id; /* If the user has not set fdtimage, set the default */ - if (!getenv("fdtimage")) + if (!env_get("fdtimage")) env_set("fdtimage", board->fdtfile); } diff --git a/board/micronas/vct/vct.c b/board/micronas/vct/vct.c index 8bf8d5f4e81..510746d35cb 100644 --- a/board/micronas/vct/vct.c +++ b/board/micronas/vct/vct.c @@ -72,7 +72,7 @@ int dram_init(void) int checkboard(void) { char buf[64]; - int i = getenv_f("serial#", buf, sizeof(buf)); + int i = env_get_f("serial#", buf, sizeof(buf)); u32 config0 = read_c0_prid(); if ((config0 & 0xff0000) == PRID_COMP_LEGACY diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c index 889e748f983..77642888117 100644 --- a/board/nokia/rx51/rx51.c +++ b/board/nokia/rx51/rx51.c @@ -234,18 +234,18 @@ void setup_board_tags(struct tag **in_params) params->u.core.rootdev = 0x0; /* append omap atag only if env setup_omap_atag is set to 1 */ - str = getenv("setup_omap_atag"); + str = env_get("setup_omap_atag"); if (!str || str[0] != '1') return; - str = getenv("setup_console_atag"); + str = env_get("setup_console_atag"); if (str && str[0] == '1') setup_console_atag = 1; else setup_console_atag = 0; - setup_boot_reason_atag = getenv("setup_boot_reason_atag"); - setup_boot_mode_atag = getenv("setup_boot_mode_atag"); + setup_boot_reason_atag = env_get("setup_boot_reason_atag"); + setup_boot_mode_atag = env_get("setup_boot_mode_atag"); params = *in_params; t = (struct tag_omap *)¶ms->u; diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index 7ff7b269f9c..530f1496171 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -247,7 +247,7 @@ static void set_fdtfile(void) { const char *fdtfile; - if (getenv("fdtfile")) + if (env_get("fdtfile")) return; fdtfile = model->fdtfile; @@ -260,7 +260,7 @@ static void set_fdtfile(void) */ static void set_fdt_addr(void) { - if (getenv("fdt_addr")) + if (env_get("fdt_addr")) return; if (fdt_magic(fw_dtb_pointer) != FDT_MAGIC) @@ -287,7 +287,7 @@ static void set_usbethaddr(void) if (!model->has_onboard_eth) return; - if (getenv("usbethaddr")) + if (env_get("usbethaddr")) return; BCM2835_MBOX_INIT_HDR(msg); @@ -302,8 +302,8 @@ static void set_usbethaddr(void) eth_env_set_enetaddr("usbethaddr", msg->get_mac_address.body.resp.mac); - if (!getenv("ethaddr")) - env_set("ethaddr", getenv("usbethaddr")); + if (!env_get("ethaddr")) + env_set("ethaddr", env_get("usbethaddr")); return; } @@ -330,7 +330,7 @@ static void set_serial_number(void) int ret; char serial_string[17] = { 0 }; - if (getenv("serial#")) + if (env_get("serial#")) return; BCM2835_MBOX_INIT_HDR(msg); diff --git a/board/samsung/common/exynos5-dt.c b/board/samsung/common/exynos5-dt.c index 44f412db5d8..ae2a6e6bfa6 100644 --- a/board/samsung/common/exynos5-dt.c +++ b/board/samsung/common/exynos5-dt.c @@ -179,7 +179,7 @@ char *get_dfu_alt_system(char *interface, char *devstr) if (board_is_odroidxu4()) return info; - return getenv("dfu_alt_system"); + return env_get("dfu_alt_system"); } char *get_dfu_alt_boot(char *interface, char *devstr) diff --git a/board/samsung/odroid/odroid.c b/board/samsung/odroid/odroid.c index b4cb33240e1..e40a2f6e3a6 100644 --- a/board/samsung/odroid/odroid.c +++ b/board/samsung/odroid/odroid.c @@ -66,7 +66,7 @@ const char *get_board_type(void) #ifdef CONFIG_SET_DFU_ALT_INFO char *get_dfu_alt_system(char *interface, char *devstr) { - return getenv("dfu_alt_system"); + return env_get("dfu_alt_system"); } char *get_dfu_alt_boot(char *interface, char *devstr) diff --git a/board/samtec/vining_2000/vining_2000.c b/board/samtec/vining_2000/vining_2000.c index 125f6e70700..af1a3e75cb5 100644 --- a/board/samtec/vining_2000/vining_2000.c +++ b/board/samtec/vining_2000/vining_2000.c @@ -131,7 +131,7 @@ int board_eth_init(bd_t *bis) /* just to get secound mac address */ imx_get_mac_from_fuse(1, eth1addr); - if (!getenv("eth1addr") && is_valid_ethaddr(eth1addr)) + if (!env_get("eth1addr") && is_valid_ethaddr(eth1addr)) eth_env_set_enetaddr("eth1addr", eth1addr); imx_iomux_v3_setup_multiple_pads(fec1_pads, ARRAY_SIZE(fec1_pads)); diff --git a/board/samtec/vining_fpga/socfpga.c b/board/samtec/vining_fpga/socfpga.c index 760fc71217e..229b12f308c 100644 --- a/board/samtec/vining_fpga/socfpga.c +++ b/board/samtec/vining_fpga/socfpga.c @@ -76,7 +76,7 @@ int misc_init_r(void) } /* If 'unit_serial' is already set, do nothing. */ - if (!getenv("unit_serial")) { + if (!env_get("unit_serial")) { /* This field is Big Endian ! */ serial = (data[0x54] << 24) | (data[0x55] << 16) | (data[0x56] << 8) | (data[0x57] << 0); @@ -85,14 +85,14 @@ int misc_init_r(void) env_set("unit_serial", str); } - if (!getenv("unit_ident")) { + if (!env_get("unit_ident")) { memset(str, 0, sizeof(str)); memcpy(str, &data[0x2e], 18); env_set("unit_ident", str); } /* Set ethernet address from EEPROM. */ - if (!getenv("ethaddr") && is_valid_ethaddr(&data[0x62])) + if (!env_get("ethaddr") && is_valid_ethaddr(&data[0x62])) eth_env_set_enetaddr("ethaddr", &data[0x62]); return 0; diff --git a/board/siemens/common/board.c b/board/siemens/common/board.c index b9672274117..65fa6af2d44 100644 --- a/board/siemens/common/board.c +++ b/board/siemens/common/board.c @@ -121,7 +121,7 @@ unsigned char get_button_state(char * const envname, unsigned char def) char *ptr_env; /* If button is not found we take default */ - ptr_env = getenv(envname); + ptr_env = env_get(envname); if (NULL == ptr_env) { gpio = def; } else { @@ -199,7 +199,7 @@ void set_env_gpios(unsigned char state) strcat(str_tmp, num); /* If env var is not found we stop */ - ptr_env = getenv(str_tmp); + ptr_env = env_get(str_tmp); if (NULL == ptr_env) break; diff --git a/board/siemens/taurus/taurus.c b/board/siemens/taurus/taurus.c index d877a9c7714..8390bdd5f81 100644 --- a/board/siemens/taurus/taurus.c +++ b/board/siemens/taurus/taurus.c @@ -377,7 +377,7 @@ static int upgrade_failure_fallback(void) char *kern_size; char *kern_size_fb; - partitionset_active = getenv("partitionset_active"); + partitionset_active = env_get("partitionset_active"); if (partitionset_active) { if (partitionset_active[0] == 'A') env_set("partitionset_active", "B"); @@ -388,18 +388,18 @@ static int upgrade_failure_fallback(void) return -ENOENT; } - rootfs = getenv("rootfs"); - rootfs_fallback = getenv("rootfs_fallback"); + rootfs = env_get("rootfs"); + rootfs_fallback = env_get("rootfs_fallback"); env_set("rootfs", rootfs_fallback); env_set("rootfs_fallback", rootfs); - kern_size = getenv("kernel_size"); - kern_size_fb = getenv("kernel_size_fallback"); + kern_size = env_get("kernel_size"); + kern_size_fb = env_get("kernel_size_fallback"); 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"); + kern_off = env_get("kernel_Off"); + kern_off_fb = env_get("kernel_Off_fallback"); env_set("kernel_Off", kern_off_fb); env_set("kernel_Off_fallback", kern_off); @@ -418,10 +418,10 @@ static int do_upgrade_available(cmd_tbl_t *cmdtp, int flag, int argc, unsigned long boot_retry = 0; char boot_buf[10]; - upgrade_available = simple_strtoul(getenv("upgrade_available"), NULL, + upgrade_available = simple_strtoul(env_get("upgrade_available"), NULL, 10); if (upgrade_available) { - boot_retry = simple_strtoul(getenv("boot_retries"), NULL, 10); + boot_retry = simple_strtoul(env_get("boot_retries"), NULL, 10); boot_retry++; sprintf(boot_buf, "%lx", boot_retry); env_set("boot_retries", boot_buf); diff --git a/board/socrates/socrates.c b/board/socrates/socrates.c index fb691c22d96..004f37009ae 100644 --- a/board/socrates/socrates.c +++ b/board/socrates/socrates.c @@ -38,7 +38,7 @@ int checkboard (void) volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); char buf[64]; int f; - int i = getenv_f("serial#", buf, sizeof(buf)); + int i = env_get_f("serial#", buf, sizeof(buf)); #ifdef CONFIG_PCI char *src; #endif @@ -409,7 +409,7 @@ void board_backlight_switch (int flag) printf ("hwmon IC init failed\n"); if (flag) { - param = getenv("brightness"); + param = env_get("brightness"); rc = param ? simple_strtol(param, NULL, 10) : -1; if (rc < 0) rc = DEFAULT_BRIGHTNESS; diff --git a/board/st/stm32f429-discovery/stm32f429-discovery.c b/board/st/stm32f429-discovery/stm32f429-discovery.c index 673e7728f1d..d6763c306f8 100644 --- a/board/st/stm32f429-discovery/stm32f429-discovery.c +++ b/board/st/stm32f429-discovery/stm32f429-discovery.c @@ -314,7 +314,7 @@ int misc_init_r(void) char serialno[25]; uint32_t u_id_low, u_id_mid, u_id_high; - if (!getenv("serial#")) { + if (!env_get("serial#")) { u_id_low = readl(&STM32_U_ID->u_id_low); u_id_mid = readl(&STM32_U_ID->u_id_mid); u_id_high = readl(&STM32_U_ID->u_id_high); diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 26732dc40f5..70e01437c4f 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -602,7 +602,7 @@ void get_board_serial(struct tag_serialnr *serialnr) char *serial_string; unsigned long long serial; - serial_string = getenv("serial#"); + serial_string = env_get("serial#"); if (serial_string) { serial = simple_strtoull(serial_string, NULL, 16); @@ -694,7 +694,7 @@ static void setup_environment(const void *fdt) else sprintf(ethaddr, "eth%daddr", i); - if (getenv(ethaddr)) + if (env_get(ethaddr)) continue; /* Non OUI / registered MAC address */ @@ -708,7 +708,7 @@ static void setup_environment(const void *fdt) eth_env_set_enetaddr(ethaddr, mac_addr); } - if (!getenv("serial#")) { + if (!env_get("serial#")) { snprintf(serial_string, sizeof(serial_string), "%08x%08x", sid[0], sid[3]); diff --git a/board/syteco/zmx25/zmx25.c b/board/syteco/zmx25/zmx25.c index e02dcf29950..85fda13188d 100644 --- a/board/syteco/zmx25/zmx25.c +++ b/board/syteco/zmx25/zmx25.c @@ -146,7 +146,7 @@ int board_late_init(void) udelay(5000); #endif - e = getenv("gs_base_board"); + e = env_get("gs_base_board"); if (e != NULL) { if (strcmp(e, "G283") == 0) { int key = gpio_get_value(IMX_GPIO_NR(2, 29)); diff --git a/board/tcl/sl50/board.c b/board/tcl/sl50/board.c index cc65c7b84bf..08af279751a 100644 --- a/board/tcl/sl50/board.c +++ b/board/tcl/sl50/board.c @@ -322,7 +322,7 @@ int board_eth_init(bd_t *bis) #if (defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD)) || \ (defined(CONFIG_SPL_ETH_SUPPORT) && defined(CONFIG_SPL_BUILD)) - if (!getenv("ethaddr")) { + if (!env_get("ethaddr")) { printf("<ethaddr> not set. Validating first E-fuse MAC\n"); if (is_valid_ethaddr(mac_addr)) @@ -340,7 +340,7 @@ int board_eth_init(bd_t *bis) mac_addr[4] = mac_lo & 0xFF; mac_addr[5] = (mac_lo & 0xFF00) >> 8; - if (!getenv("eth1addr")) { + if (!env_get("eth1addr")) { if (is_valid_ethaddr(mac_addr)) eth_env_set_enetaddr("eth1addr", mac_addr); } diff --git a/board/technexion/twister/twister.c b/board/technexion/twister/twister.c index 25aeebc8d0e..8c38f14cded 100644 --- a/board/technexion/twister/twister.c +++ b/board/technexion/twister/twister.c @@ -94,7 +94,7 @@ int misc_init_r(void) omap_die_id_display(); - eth_addr = getenv("ethaddr"); + eth_addr = env_get("ethaddr"); if (eth_addr) return 0; diff --git a/board/teejet/mt_ventoux/mt_ventoux.c b/board/teejet/mt_ventoux/mt_ventoux.c index 6e73ae114a6..9eaae50f27a 100644 --- a/board/teejet/mt_ventoux/mt_ventoux.c +++ b/board/teejet/mt_ventoux/mt_ventoux.c @@ -261,7 +261,7 @@ int misc_init_r(void) if (ret) return 0; - eth_addr = getenv("ethaddr"); + eth_addr = env_get("ethaddr"); if (!eth_addr) TAM3517_READ_MAC_FROM_EEPROM(&info); @@ -311,7 +311,7 @@ int board_video_init(void) fb = (void *)0x88000000; - s = getenv("panel"); + s = env_get("panel"); if (s) { index = simple_strtoul(s, NULL, 10); if (index < ARRAY_SIZE(lcd_cfg)) diff --git a/board/theobroma-systems/puma_rk3399/puma-rk3399.c b/board/theobroma-systems/puma_rk3399/puma-rk3399.c index 733fe96726b..c6f8eed0c98 100644 --- a/board/theobroma-systems/puma_rk3399/puma-rk3399.c +++ b/board/theobroma-systems/puma_rk3399/puma-rk3399.c @@ -63,13 +63,13 @@ static void setup_macaddr(void) { #if CONFIG_IS_ENABLED(CMD_NET) int ret; - const char *cpuid = getenv("cpuid#"); + const char *cpuid = env_get("cpuid#"); u8 hash[SHA256_SUM_LEN]; int size = sizeof(hash); u8 mac_addr[6]; /* Only generate a MAC address, if none is set in the environment */ - if (getenv("ethaddr")) + if (env_get("ethaddr")) return; if (!cpuid) { @@ -165,7 +165,7 @@ void get_board_serial(struct tag_serialnr *serialnr) char *serial_string; u64 serial = 0; - serial_string = getenv("serial#"); + serial_string = env_get("serial#"); if (serial_string) serial = simple_strtoull(serial_string, NULL, 16); diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c index 7bdbc89d5e6..ab835856e5f 100644 --- a/board/ti/am335x/board.c +++ b/board/ti/am335x/board.c @@ -745,7 +745,7 @@ int board_late_init(void) mac_addr[4] = mac_lo & 0xFF; mac_addr[5] = (mac_lo & 0xFF00) >> 8; - if (!getenv("ethaddr")) { + if (!env_get("ethaddr")) { printf("<ethaddr> not set. Validating first E-fuse MAC\n"); if (is_valid_ethaddr(mac_addr)) @@ -761,7 +761,7 @@ int board_late_init(void) mac_addr[4] = mac_lo & 0xFF; mac_addr[5] = (mac_lo & 0xFF00) >> 8; - if (!getenv("eth1addr")) { + if (!env_get("eth1addr")) { if (is_valid_ethaddr(mac_addr)) eth_env_set_enetaddr("eth1addr", mac_addr); } diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c index 933ff31a8ef..2c417e75459 100644 --- a/board/ti/am43xx/board.c +++ b/board/ti/am43xx/board.c @@ -791,7 +791,7 @@ int board_eth_init(bd_t *bis) mac_addr[4] = mac_lo & 0xFF; mac_addr[5] = (mac_lo & 0xFF00) >> 8; - if (!getenv("ethaddr")) { + if (!env_get("ethaddr")) { puts("<ethaddr> not set. Validating first E-fuse MAC\n"); if (is_valid_ethaddr(mac_addr)) eth_env_set_enetaddr("ethaddr", mac_addr); @@ -806,7 +806,7 @@ int board_eth_init(bd_t *bis) mac_addr[4] = mac_lo & 0xFF; mac_addr[5] = (mac_lo & 0xFF00) >> 8; - if (!getenv("eth1addr")) { + if (!env_get("eth1addr")) { if (is_valid_ethaddr(mac_addr)) eth_env_set_enetaddr("eth1addr", mac_addr); } diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c index aaa14642736..7bcbc31042f 100644 --- a/board/ti/am57xx/board.c +++ b/board/ti/am57xx/board.c @@ -933,7 +933,7 @@ int board_eth_init(bd_t *bis) mac_addr[4] = (mac_lo & 0xFF00) >> 8; mac_addr[5] = mac_lo & 0xFF; - if (!getenv("ethaddr")) { + if (!env_get("ethaddr")) { printf("<ethaddr> not set. Validating first E-fuse MAC\n"); if (is_valid_ethaddr(mac_addr)) @@ -949,7 +949,7 @@ int board_eth_init(bd_t *bis) mac_addr[4] = (mac_lo & 0xFF00) >> 8; mac_addr[5] = mac_lo & 0xFF; - if (!getenv("eth1addr")) { + if (!env_get("eth1addr")) { if (is_valid_ethaddr(mac_addr)) eth_env_set_enetaddr("eth1addr", mac_addr); } diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c index 4252074e74c..bdbf7f67969 100644 --- a/board/ti/dra7xx/evm.c +++ b/board/ti/dra7xx/evm.c @@ -893,7 +893,7 @@ int board_eth_init(bd_t *bis) mac_addr[4] = (mac_lo & 0xFF00) >> 8; mac_addr[5] = mac_lo & 0xFF; - if (!getenv("ethaddr")) { + if (!env_get("ethaddr")) { printf("<ethaddr> not set. Validating first E-fuse MAC\n"); if (is_valid_ethaddr(mac_addr)) @@ -909,7 +909,7 @@ int board_eth_init(bd_t *bis) mac_addr[4] = (mac_lo & 0xFF00) >> 8; mac_addr[5] = mac_lo & 0xFF; - if (!getenv("eth1addr")) { + if (!env_get("eth1addr")) { if (is_valid_ethaddr(mac_addr)) eth_env_set_enetaddr("eth1addr", mac_addr); } diff --git a/board/ti/ks2_evm/board.c b/board/ti/ks2_evm/board.c index c61baeeb8cf..ae86dfbe0aa 100644 --- a/board/ti/ks2_evm/board.c +++ b/board/ti/ks2_evm/board.c @@ -74,7 +74,7 @@ int get_eth_env_param(char *env_name) char *env; int res = -1; - env = getenv(env_name); + env = env_get(env_name); if (env) res = simple_strtol(env, NULL, 0); @@ -151,9 +151,9 @@ int ft_board_setup(void *blob, bd_t *bd) u32 ddr3a_size; int unitrd_fixup = 0; - env = getenv("mem_lpae"); + env = env_get("mem_lpae"); lpae = env && simple_strtol(env, NULL, 0); - env = getenv("uinitrd_fixup"); + env = env_get("uinitrd_fixup"); unitrd_fixup = env && simple_strtol(env, NULL, 0); ddr3a_size = 0; @@ -180,13 +180,13 @@ int ft_board_setup(void *blob, bd_t *bd) } /* reserve memory at start of bank */ - env = getenv("mem_reserve_head"); + env = env_get("mem_reserve_head"); if (env) { start[0] += ustrtoul(env, &endp, 0); size[0] -= ustrtoul(env, &endp, 0); } - env = getenv("mem_reserve"); + env = env_get("mem_reserve"); if (env) size[0] -= ustrtoul(env, &endp, 0); @@ -251,7 +251,7 @@ void ft_board_setup_ex(void *blob, bd_t *bd) char *env; u64 *reserve_start; - env = getenv("mem_lpae"); + env = env_get("mem_lpae"); lpae = env && simple_strtol(env, NULL, 0); if (lpae) { diff --git a/board/toradex/apalis_imx6/apalis_imx6.c b/board/toradex/apalis_imx6/apalis_imx6.c index 86a7a159e8c..7a3e493faf1 100644 --- a/board/toradex/apalis_imx6/apalis_imx6.c +++ b/board/toradex/apalis_imx6/apalis_imx6.c @@ -814,7 +814,7 @@ int board_late_init(void) setup_iomux_dce_uart(); /* if using the default device tree, use version for V1.0 HW */ - fdt_env = getenv("fdt_file"); + fdt_env = env_get("fdt_file"); if ((fdt_env != NULL) && (strcmp(FDT_FILE, fdt_env) == 0)) { env_set("fdt_file", FDT_FILE_V1_0); printf("patching fdt_file to " FDT_FILE_V1_0 "\n"); diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c index 1bf8ca8f76d..328c4c0200d 100644 --- a/board/toradex/common/tdx-cfg-block.c +++ b/board/toradex/common/tdx-cfg-block.c @@ -278,7 +278,7 @@ static int get_cfgblock_interactive(void) len = cli_readline(message); it = console_buffer[0]; - soc = getenv("soc"); + soc = env_get("soc"); if (!strcmp("mx6", soc)) { #ifdef CONFIG_MACH_TYPE if (it == 'y' || it == 'Y') diff --git a/board/varisys/common/sys_eeprom.c b/board/varisys/common/sys_eeprom.c index d2358973111..69f596a4ccf 100644 --- a/board/varisys/common/sys_eeprom.c +++ b/board/varisys/common/sys_eeprom.c @@ -486,7 +486,7 @@ int mac_read_from_eeprom_common(void) /* Only initialize environment variables that are blank * (i.e. have not yet been set) */ - if (!getenv(enetvar)) + if (!env_get(enetvar)) env_set(enetvar, ethaddr); } } diff --git a/board/vscom/baltos/board.c b/board/vscom/baltos/board.c index 2e3baeb1188..cb39190c286 100644 --- a/board/vscom/baltos/board.c +++ b/board/vscom/baltos/board.c @@ -453,7 +453,7 @@ int board_eth_init(bd_t *bis) #if (defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD)) || \ (defined(CONFIG_SPL_ETH_SUPPORT) && defined(CONFIG_SPL_BUILD)) - if (!getenv("ethaddr")) { + if (!env_get("ethaddr")) { printf("<ethaddr> not set. Validating first E-fuse MAC\n"); if (is_valid_ethaddr(mac_addr)) diff --git a/board/work-microwave/work_92105/work_92105_display.c b/board/work-microwave/work_92105/work_92105_display.c index 37a736351cb..c997cea6f0d 100644 --- a/board/work-microwave/work_92105/work_92105_display.c +++ b/board/work-microwave/work_92105/work_92105_display.c @@ -228,7 +228,7 @@ void work_92105_display_init(void) i2c_write(0x2c, 0x01, 1, &enable_backlight, 1); /* set display contrast */ - display_contrast_str = getenv("fwopt_dispcontrast"); + display_contrast_str = env_get("fwopt_dispcontrast"); if (display_contrast_str) display_contrast = simple_strtoul(display_contrast_str, NULL, 10); diff --git a/board/xes/common/board.c b/board/xes/common/board.c index 4ed6f50e5cf..b76eb948d50 100644 --- a/board/xes/common/board.c +++ b/board/xes/common/board.c @@ -51,13 +51,13 @@ int checkboard(void) /* Display board specific information */ puts(" "); - i = getenv_f("board_rev", buf, sizeof(buf)); + i = env_get_f("board_rev", buf, sizeof(buf)); if (i > 0) printf("Rev %s, ", buf); - i = getenv_f("serial#", buf, sizeof(buf)); + i = env_get_f("serial#", buf, sizeof(buf)); if (i > 0) printf("Serial# %s, ", buf); - i = getenv_f("board_cfg", buf, sizeof(buf)); + i = env_get_f("board_cfg", buf, sizeof(buf)); if (i > 0) printf("Cfg %s", buf); puts("\n"); diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index b9e8649eb34..d17868b0c2b 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -318,9 +318,9 @@ int board_late_init(void) * and default boot_targets */ new_targets = calloc(1, strlen(mode) + - strlen(getenv("boot_targets")) + 2); + strlen(env_get("boot_targets")) + 2); - sprintf(new_targets, "%s %s", mode, getenv("boot_targets")); + sprintf(new_targets, "%s %s", mode, env_get("boot_targets")); env_set("boot_targets", new_targets); return 0; |