diff options
Diffstat (limited to 'board')
236 files changed, 1113 insertions, 827 deletions
diff --git a/board/Arcturus/ucp1020/cmd_arc.c b/board/Arcturus/ucp1020/cmd_arc.c index fa6b4853f9..0d3ac88fff 100644 --- a/board/Arcturus/ucp1020/cmd_arc.c +++ b/board/Arcturus/ucp1020/cmd_arc.c @@ -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]); } } @@ -149,10 +149,10 @@ 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) { - 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; } @@ -169,10 +169,10 @@ 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) { - 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; } @@ -188,10 +188,10 @@ 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) { - setenv("eth2addr", smac[0]); + env_set("eth2addr", smac[0]); printf("\t%s (factory)\n", smac[0]); } else { printf("\t%s\n", ret); diff --git a/board/Arcturus/ucp1020/spl.c b/board/Arcturus/ucp1020/spl.c index cd484fc44b..b5e7a5db06 100644 --- a/board/Arcturus/ucp1020/spl.c +++ b/board/Arcturus/ucp1020/spl.c @@ -10,6 +10,7 @@ #include <common.h> #include <console.h> +#include <environment.h> #include <ns16550.h> #include <malloc.h> #include <mmc.h> @@ -99,7 +100,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) nand_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE, (uchar *)CONFIG_ENV_ADDR); gd->env_addr = (ulong)(CONFIG_ENV_ADDR); - gd->env_valid = 1; + gd->env_valid = ENV_VALID; #else env_relocate(); #endif diff --git a/board/Arcturus/ucp1020/ucp1020.c b/board/Arcturus/ucp1020/ucp1020.c index 0d086e87fa..3f786a2014 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) @@ -230,21 +230,21 @@ 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(); if (kval) { - sval = getenv("SERIAL"); + sval = env_get("SERIAL"); if (sval) { strcpy(newkernelargs, "SN="); strcat(newkernelargs, sval); strcat(newkernelargs, " "); strcat(newkernelargs, kval); - setenv("kernelargs", newkernelargs); + env_set("kernelargs", newkernelargs); } } else { printf("Error reading kernelargs env variable!\n"); @@ -307,8 +307,8 @@ int ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); - base = getenv_bootm_low(); - size = getenv_bootm_size(); + base = env_get_bootm_low(); + size = env_get_bootm_size(); fdt_fixup_memory(blob, (u64)base, (u64)size); diff --git a/board/Barix/ipam390/ipam390.c b/board/Barix/ipam390/ipam390.c index 3a584021ac..d203429738 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/brppt1/board.c b/board/BuR/brppt1/board.c index a22722122b..6083479f2b 100644 --- a/board/BuR/brppt1/board.c +++ b/board/BuR/brppt1/board.c @@ -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; } diff --git a/board/BuR/brxre1/board.c b/board/BuR/brxre1/board.c index f4bfa410cc..ca08f3cd90 100644 --- a/board/BuR/brxre1/board.c +++ b/board/BuR/brxre1/board.c @@ -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: @@ -282,10 +282,10 @@ int board_late_init(void) snprintf(othbootargs, sizeof(othbootargs), "u=vxWorksFTP pw=vxWorks o=0x%08x;0x%08x;0x%08x;0x%08x", (unsigned int) gd->fb_base-0x20, - (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); + (u32)env_get_ulong("vx_memtop", 16, gd->fb_base-0x20), + (u32)env_get_ulong("vx_romfsbase", 16, 0), + (u32)env_get_ulong("vx_romfssize", 16, 0)); + 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 diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c index c3a56db76a..c1cd010023 100644 --- a/board/BuR/common/common.c +++ b/board/BuR/common/common.c @@ -58,9 +58,9 @@ void lcdbacklight(int on) unsigned int bright = FDTPROP(PATHINF, "brightdef"); unsigned int pwmfrq = FDTPROP(PATHINF, "brightfdim"); #else - unsigned int driver = getenv_ulong("ds1_bright_drv", 16, 0UL); - unsigned int bright = getenv_ulong("ds1_bright_def", 10, 50); - unsigned int pwmfrq = getenv_ulong("ds1_pwmfreq", 10, ~0UL); + unsigned int driver = env_get_ulong("ds1_bright_drv", 16, 0UL); + unsigned int bright = env_get_ulong("ds1_bright_def", 10, 50); + unsigned int pwmfrq = env_get_ulong("ds1_pwmfreq", 10, ~0UL); #endif unsigned int tmp; struct gptimer *timerhw; @@ -184,22 +184,22 @@ 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); - pnltmp.bpp = getenv_ulong("ds1_bpp", 10, ~0UL); - pnltmp.hfp = getenv_ulong("ds1_hfp", 10, ~0UL); - pnltmp.hbp = getenv_ulong("ds1_hbp", 10, ~0UL); - pnltmp.hsw = getenv_ulong("ds1_hsw", 10, ~0UL); - pnltmp.vfp = getenv_ulong("ds1_vfp", 10, ~0UL); - pnltmp.vbp = getenv_ulong("ds1_vbp", 10, ~0UL); - pnltmp.vsw = getenv_ulong("ds1_vsw", 10, ~0UL); - pnltmp.pxl_clk_div = getenv_ulong("ds1_pxlclkdiv", 10, ~0UL); - pnltmp.pol = getenv_ulong("ds1_pol", 16, ~0UL); - pnltmp.pup_delay = getenv_ulong("ds1_pupdelay", 10, ~0UL); - pnltmp.pon_delay = getenv_ulong("ds1_tondelay", 10, ~0UL); - panel_info.vl_rot = getenv_ulong("ds1_rotation", 10, 0); + pnltmp.hactive = env_get_ulong("ds1_hactive", 10, ~0UL); + pnltmp.vactive = env_get_ulong("ds1_vactive", 10, ~0UL); + pnltmp.bpp = env_get_ulong("ds1_bpp", 10, ~0UL); + pnltmp.hfp = env_get_ulong("ds1_hfp", 10, ~0UL); + pnltmp.hbp = env_get_ulong("ds1_hbp", 10, ~0UL); + pnltmp.hsw = env_get_ulong("ds1_hsw", 10, ~0UL); + pnltmp.vfp = env_get_ulong("ds1_vfp", 10, ~0UL); + pnltmp.vbp = env_get_ulong("ds1_vbp", 10, ~0UL); + pnltmp.vsw = env_get_ulong("ds1_vsw", 10, ~0UL); + pnltmp.pxl_clk_div = env_get_ulong("ds1_pxlclkdiv", 10, ~0UL); + pnltmp.pol = env_get_ulong("ds1_pol", 16, ~0UL); + pnltmp.pup_delay = env_get_ulong("ds1_pupdelay", 10, ~0UL); + pnltmp.pon_delay = env_get_ulong("ds1_tondelay", 10, ~0UL); + panel_info.vl_rot = env_get_ulong("ds1_rotation", 10, 0); #endif if ( ~0UL == (pnltmp.hactive) || @@ -251,7 +251,7 @@ static int load_devicetree(void) { int rc; loff_t dtbsize; - u32 dtbaddr = getenv_ulong("dtbaddr", 16, 0UL); + u32 dtbaddr = env_get_ulong("dtbaddr", 16, 0UL); if (dtbaddr == 0) { printf("%s: don't have a valid <dtbaddr> in env!\n", __func__); @@ -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; @@ -375,7 +375,7 @@ int ft_board_setup(void *blob, bd_t *bd) * if no simplefb is requested through environment, we don't set up * one, instead we turn off backlight. */ - if (getenv_ulong("simplefb", 10, 0) == 0) { + if (env_get_ulong("simplefb", 10, 0) == 0) { lcdbacklight(0); return 0; } @@ -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 { @@ -447,7 +447,7 @@ void lcdpower(int on) } pin = FDTPROP(PATHINF, "pwrpin"); #else - pin = getenv_ulong("ds1_pwr", 16, ~0UL); + pin = env_get_ulong("ds1_pwr", 16, ~0UL); #endif if (pin == ~0UL) { puts("no pwrpin in dtb/env, cannot powerup display!\n"); @@ -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); @@ -670,7 +670,7 @@ int board_eth_init(bd_t *bis) if (mac) { printf("using: %pM on ", mac); - eth_setenv_enetaddr("ethaddr", (const u8 *)mac); + eth_env_set_enetaddr("ethaddr", (const u8 *)mac); } } writel(MII_MODE_ENABLE, &cdev->miisel); diff --git a/board/BuS/eb_cpu5282/eb_cpu5282.c b/board/BuS/eb_cpu5282/eb_cpu5282.c index a00a83a4a5..d23b9f3a4f 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/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c index 86926f8050..af66837909 100644 --- a/board/CZ.NIC/turris_omnia/turris_omnia.c +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c @@ -90,7 +90,7 @@ static struct serdes_map board_serdes_map_sata[] = { static bool omnia_detect_sata(void) { struct udevice *bus, *dev; - int ret; + int ret, retry = 3; u16 mode; puts("SERDES0 card detect: "); @@ -106,8 +106,13 @@ static bool omnia_detect_sata(void) return false; } - ret = dm_i2c_read(dev, OMNIA_I2C_MCU_ADDR_STATUS, (uchar *) &mode, 2); - if (ret) { + for (; retry > 0; --retry) { + ret = dm_i2c_read(dev, OMNIA_I2C_MCU_ADDR_STATUS, (uchar *) &mode, 2); + if (!ret) + break; + } + + if (!retry) { puts("I2C read failed! Default PEX\n"); return false; } @@ -280,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 @@ -510,17 +515,17 @@ int misc_init_r(void) mac[5] = mac1[3]; if (is_valid_ethaddr(mac)) - eth_setenv_enetaddr("ethaddr", mac); + eth_env_set_enetaddr("ethaddr", mac); increment_mac(mac); if (is_valid_ethaddr(mac)) - eth_setenv_enetaddr("eth1addr", mac); + eth_env_set_enetaddr("eth1addr", mac); increment_mac(mac); if (is_valid_ethaddr(mac)) - eth_setenv_enetaddr("eth2addr", mac); + eth_env_set_enetaddr("eth2addr", mac); out: #endif diff --git a/board/CarMediaLab/flea3/flea3.c b/board/CarMediaLab/flea3/flea3.c index 3cd4dc95fe..5e75eb0b64 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 2e6e9ef916..f639a37d4d 100644 --- a/board/LaCie/net2big_v2/net2big_v2.c +++ b/board/LaCie/net2big_v2/net2big_v2.c @@ -221,10 +221,10 @@ 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_setenv_enetaddr("ethaddr", mac); + eth_env_set_enetaddr("ethaddr", mac); } #endif init_leds(); diff --git a/board/LaCie/netspace_v2/netspace_v2.c b/board/LaCie/netspace_v2/netspace_v2.c index 16d694716f..52f36644a3 100644 --- a/board/LaCie/netspace_v2/netspace_v2.c +++ b/board/LaCie/netspace_v2/netspace_v2.c @@ -83,10 +83,10 @@ 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_setenv_enetaddr("ethaddr", mac); + eth_env_set_enetaddr("ethaddr", mac); } #endif return 0; diff --git a/board/Synology/ds414/cmd_syno.c b/board/Synology/ds414/cmd_syno.c index 20544e29c4..6313882a52 100644 --- a/board/Synology/ds414/cmd_syno.c +++ b/board/Synology/ds414/cmd_syno.c @@ -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); diff --git a/board/amazon/kc1/kc1.c b/board/amazon/kc1/kc1.c index 13a9c6a0fe..eead98b24e 100644 --- a/board/amazon/kc1/kc1.c +++ b/board/amazon/kc1/kc1.c @@ -118,8 +118,8 @@ int misc_init_r(void) } if (reboot_mode[0] > 0 && isascii(reboot_mode[0])) { - if (!getenv("reboot-mode")) - setenv("reboot-mode", (char *)reboot_mode); + if (!env_get("reboot-mode")) + env_set("reboot-mode", (char *)reboot_mode); } omap_reboot_mode_clear(); diff --git a/board/amlogic/odroid-c2/odroid-c2.c b/board/amlogic/odroid-c2/odroid-c2.c index b29f56d5eb..eac04d8178 100644 --- a/board/amlogic/odroid-c2/odroid-c2.c +++ b/board/amlogic/odroid-c2/odroid-c2.c @@ -44,18 +44,18 @@ int misc_init_r(void) mdelay(10); setbits_le32(GXBB_GPIO_OUT(3), BIT(14)); - if (!eth_getenv_enetaddr("ethaddr", mac_addr)) { + if (!eth_env_get_enetaddr("ethaddr", mac_addr)) { len = meson_sm_read_efuse(EFUSE_MAC_OFFSET, mac_addr, EFUSE_MAC_SIZE); if (len == EFUSE_MAC_SIZE && is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("ethaddr", mac_addr); + 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) - setenv("serial#", serial); + env_set("serial#", serial); } return 0; diff --git a/board/aries/ma5d4evk/ma5d4evk.c b/board/aries/ma5d4evk/ma5d4evk.c index b9294fc881..956c297e72 100644 --- a/board/aries/ma5d4evk/ma5d4evk.c +++ b/board/aries/ma5d4evk/ma5d4evk.c @@ -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; } diff --git a/board/aristainetos/aristainetos-v2.c b/board/aristainetos/aristainetos-v2.c index 6abc2159bb..698715ca20 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,11 +668,11 @@ 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) - 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 */ diff --git a/board/armadeus/apf27/Kconfig b/board/armadeus/apf27/Kconfig index 65544a8448..a342d2e05e 100644 --- a/board/armadeus/apf27/Kconfig +++ b/board/armadeus/apf27/Kconfig @@ -1,5 +1,8 @@ if TARGET_APF27 +config SPL_LDSCRIPT + default "arch/$(ARCH)/cpu/u-boot-spl.lds" + config SYS_BOARD default "apf27" diff --git a/board/armltd/integrator/integrator.c b/board/armltd/integrator/integrator.c index c3bafd453e..858f74e5cf 100644 --- a/board/armltd/integrator/integrator.c +++ b/board/armltd/integrator/integrator.c @@ -116,7 +116,7 @@ extern void cm_remap(void); int misc_init_r (void) { - setenv("verify", "n"); + env_set("verify", "n"); return (0); } diff --git a/board/atmel/sama5d2_xplained/sama5d2_xplained.c b/board/atmel/sama5d2_xplained/sama5d2_xplained.c index 48f45b35ce..3f0860c555 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)) { @@ -192,7 +192,7 @@ static int set_ethaddr_from_eeprom(void) return -1; } - return eth_setenv_enetaddr(ETHADDR_NAME, ethaddr); + return eth_env_set_enetaddr(ETHADDR_NAME, ethaddr); } #else static int set_ethaddr_from_eeprom(void) diff --git a/board/atmel/sama5d3xek/sama5d3xek.c b/board/atmel/sama5d3xek/sama5d3xek.c index c1f2769f1c..88bcd876c9 100644 --- a/board/atmel/sama5d3xek/sama5d3xek.c +++ b/board/atmel/sama5d3xek/sama5d3xek.c @@ -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; } diff --git a/board/bachmann/ot1200/ot1200.c b/board/bachmann/ot1200/ot1200.c index 1ad4ef93cf..df10d6a0d0 100644 --- a/board/bachmann/ot1200/ot1200.c +++ b/board/bachmann/ot1200/ot1200.c @@ -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); diff --git a/board/birdland/bav335x/board.c b/board/birdland/bav335x/board.c index 67aca3cc43..f284568ec9 100644 --- a/board/birdland/bav335x/board.c +++ b/board/birdland/bav335x/board.c @@ -162,8 +162,8 @@ int spl_start_uboot(void) #ifdef CONFIG_SPL_ENV_SUPPORT env_init(); - env_relocate_spec(); - if (getenv_yesno("boot_os") != 1) + env_load(); + if (env_get_yesno("boot_os") != 1) return 1; #endif @@ -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; } @@ -392,11 +392,11 @@ 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)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); } #ifdef CONFIG_DRIVER_TI_CPSW diff --git a/board/bluegiga/apx4devkit/apx4devkit.c b/board/bluegiga/apx4devkit/apx4devkit.c index 2215c29c9c..25e5c3d80c 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 e82c691841..8733a9af16 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 38577f30f1..999ed95c31 100644 --- a/board/bosch/shc/board.c +++ b/board/bosch/shc/board.c @@ -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"); } } @@ -460,7 +460,7 @@ int board_late_init(void) #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG if (shc_eeprom_valid) if (is_valid_ethaddr(header.mac_addr)) - eth_setenv_enetaddr("ethaddr", header.mac_addr); + eth_env_set_enetaddr("ethaddr", header.mac_addr); #endif return 0; @@ -545,11 +545,11 @@ 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)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); } writel(MII_MODE_ENABLE, &cdev->miisel); @@ -565,7 +565,7 @@ int board_eth_init(bd_t *bis) #if defined(CONFIG_USB_ETHER) && \ (!defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_USBETH_SUPPORT)) if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("usbnet_devaddr", mac_addr); + eth_env_set_enetaddr("usbnet_devaddr", mac_addr); rv = usb_eth_initialize(bis); if (rv < 0) diff --git a/board/boundary/nitrogen6x/nitrogen6x.c b/board/boundary/nitrogen6x/nitrogen6x.c index 17fd6f56ea..3b92b64f6a 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) @@ -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; } @@ -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,9 +993,9 @@ 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) { - setenv("preboot", cmd); + env_set("preboot", cmd); return; } } @@ -1021,6 +1021,6 @@ int misc_init_r(void) #ifdef CONFIG_CMD_BMODE add_board_boot_modes(board_boot_modes); #endif - setenv_hex("reset_cause", get_imx_reset_cause()); + env_set_hex("reset_cause", get_imx_reset_cause()); return 0; } diff --git a/board/broadcom/bcm23550_w1d/bcm23550_w1d.c b/board/broadcom/bcm23550_w1d/bcm23550_w1d.c index 5f4c634362..0267582186 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 f5b94f6430..8f48ccbf1c 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/buffalo/lsxl/lsxl.c b/board/buffalo/lsxl/lsxl.c index 0f3734587a..2d01ac25d8 100644 --- a/board/buffalo/lsxl/lsxl.c +++ b/board/buffalo/lsxl/lsxl.c @@ -203,7 +203,7 @@ void check_enetaddr(void) { uchar enetaddr[6]; - if (!eth_getenv_enetaddr("ethaddr", enetaddr)) { + if (!eth_env_get_enetaddr("ethaddr", enetaddr)) { /* signal unset/invalid ethaddr to user */ set_led(LED_INFO_BLINKING); } @@ -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) diff --git a/board/cadence/xtfpga/xtfpga.c b/board/cadence/xtfpga/xtfpga.c index 0265e9bb36..f81fa95c18 100644 --- a/board/cadence/xtfpga/xtfpga.c +++ b/board/cadence/xtfpga/xtfpga.c @@ -86,14 +86,14 @@ 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); 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 */ diff --git a/board/ccv/xpress/xpress.c b/board/ccv/xpress/xpress.c index 542e534270..b65646588a 100644 --- a/board/ccv/xpress/xpress.c +++ b/board/ccv/xpress/xpress.c @@ -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; } diff --git a/board/compulab/cl-som-am57x/eth.c b/board/compulab/cl-som-am57x/eth.c index 0c4bf91c13..b615fb9e7e 100644 --- a/board/compulab/cl-som-am57x/eth.c +++ b/board/compulab/cl-som-am57x/eth.c @@ -95,7 +95,7 @@ static int cl_som_am57x_handle_mac_address(char *env_name, uint port_num) int ret; uint8_t enetaddr[6]; - ret = eth_getenv_enetaddr(env_name, enetaddr); + ret = eth_env_get_enetaddr(env_name, enetaddr); if (ret) return 0; @@ -107,7 +107,7 @@ static int cl_som_am57x_handle_mac_address(char *env_name, uint port_num) if (!is_valid_ethaddr(enetaddr)) return -1; - ret = eth_setenv_enetaddr(env_name, enetaddr); + ret = eth_env_set_enetaddr(env_name, enetaddr); if (ret) printf("cl-som-am57x: Failed to set Eth port %d MAC address\n", port_num); @@ -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 c59884a8c3..a1da2780aa 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; @@ -470,7 +470,7 @@ static int handle_mac_address(char *env_var, uint eeprom_bus) unsigned char enetaddr[6]; int rc; - rc = eth_getenv_enetaddr(env_var, enetaddr); + rc = eth_env_get_enetaddr(env_var, enetaddr); if (rc) return 0; @@ -481,7 +481,7 @@ static int handle_mac_address(char *env_var, uint eeprom_bus) if (!is_valid_ethaddr(enetaddr)) return -1; - return eth_setenv_enetaddr(env_var, enetaddr); + return eth_env_set_enetaddr(env_var, enetaddr); } #define SB_FX6_I2C_EEPROM_BUS 0 @@ -605,13 +605,13 @@ int ft_board_setup(void *blob, bd_t *bd) fdt_shrink_to_minimum(blob, 0); /* Make room for new properties */ /* MAC addr */ - if (eth_getenv_enetaddr("ethaddr", enetaddr)) { + if (eth_env_get_enetaddr("ethaddr", enetaddr)) { fdt_find_and_setprop(blob, "/soc/aips-bus@02100000/ethernet@02188000", "local-mac-address", enetaddr, 6, 1); } - if (eth_getenv_enetaddr("eth1addr", enetaddr)) { + if (eth_env_get_enetaddr("eth1addr", enetaddr)) { fdt_find_and_setprop(blob, "/eth@pcie", "local-mac-address", enetaddr, 6, 1); } diff --git a/board/compulab/cm_t335/cm_t335.c b/board/compulab/cm_t335/cm_t335.c index c4506b910e..6f6ba49af5 100644 --- a/board/compulab/cm_t335/cm_t335.c +++ b/board/compulab/cm_t335/cm_t335.c @@ -106,7 +106,7 @@ static int handle_mac_address(void) uchar enetaddr[6]; int rv; - rv = eth_getenv_enetaddr("ethaddr", enetaddr); + rv = eth_env_get_enetaddr("ethaddr", enetaddr); if (rv) return 0; @@ -117,7 +117,7 @@ static int handle_mac_address(void) if (!is_valid_ethaddr(enetaddr)) return -1; - return eth_setenv_enetaddr("ethaddr", enetaddr); + return eth_env_set_enetaddr("ethaddr", enetaddr); } #define AR8051_PHY_DEBUG_ADDR_REG 0x1d diff --git a/board/compulab/cm_t35/cm_t35.c b/board/compulab/cm_t35/cm_t35.c index f1691257e7..be938eb2cf 100644 --- a/board/compulab/cm_t35/cm_t35.c +++ b/board/compulab/cm_t35/cm_t35.c @@ -398,7 +398,7 @@ void board_mmc_power_init(void) } #endif -#ifdef CONFIG_SYS_I2C_OMAP34XX +#ifdef CONFIG_SYS_I2C_OMAP24XX /* * Routine: reset_net_chip * Description: reset the Ethernet controller via TPS65930 GPIO @@ -434,7 +434,7 @@ static int handle_mac_address(void) unsigned char enetaddr[6]; int rc; - rc = eth_getenv_enetaddr("ethaddr", enetaddr); + rc = eth_env_get_enetaddr("ethaddr", enetaddr); if (rc) return 0; @@ -445,7 +445,7 @@ static int handle_mac_address(void) if (!is_valid_ethaddr(enetaddr)) return -1; - return eth_setenv_enetaddr("ethaddr", enetaddr); + return eth_env_set_enetaddr("ethaddr", enetaddr); } /* diff --git a/board/compulab/cm_t3517/cm_t3517.c b/board/compulab/cm_t3517/cm_t3517.c index 38eb641bc4..0ff49dcdcc 100644 --- a/board/compulab/cm_t3517/cm_t3517.c +++ b/board/compulab/cm_t3517/cm_t3517.c @@ -168,7 +168,7 @@ static int cm_t3517_handle_mac_address(void) unsigned char enetaddr[6]; int ret; - ret = eth_getenv_enetaddr("ethaddr", enetaddr); + ret = eth_env_get_enetaddr("ethaddr", enetaddr); if (ret) return 0; @@ -182,7 +182,7 @@ static int cm_t3517_handle_mac_address(void) if (!is_valid_ethaddr(enetaddr)) return -1; - return eth_setenv_enetaddr("ethaddr", enetaddr); + return eth_env_set_enetaddr("ethaddr", enetaddr); } #define SB_T35_ETH_RST_GPIO 164 diff --git a/board/compulab/cm_t54/cm_t54.c b/board/compulab/cm_t54/cm_t54.c index 6437718415..31730a4d1c 100644 --- a/board/compulab/cm_t54/cm_t54.c +++ b/board/compulab/cm_t54/cm_t54.c @@ -126,7 +126,7 @@ int ft_board_setup(void *blob, bd_t *bd) uint8_t enetaddr[6]; /* MAC addr */ - if (eth_getenv_enetaddr("usbethaddr", enetaddr)) { + if (eth_env_get_enetaddr("usbethaddr", enetaddr)) { fdt_find_and_setprop(blob, "/smsc95xx@0", "mac-address", enetaddr, 6, 1); } @@ -161,7 +161,7 @@ static int handle_mac_address(void) uint8_t enetaddr[6]; int ret; - ret = eth_getenv_enetaddr("usbethaddr", enetaddr); + ret = eth_env_get_enetaddr("usbethaddr", enetaddr); if (ret) return 0; @@ -172,7 +172,7 @@ static int handle_mac_address(void) if (!is_valid_ethaddr(enetaddr)) return -1; - return eth_setenv_enetaddr("usbethaddr", enetaddr); + return eth_env_set_enetaddr("usbethaddr", enetaddr); } int board_eth_init(bd_t *bis) diff --git a/board/compulab/common/omap3_display.c b/board/compulab/common/omap3_display.c index 61707f5b90..ed2077e361 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/Kconfig b/board/congatec/Kconfig index ff5a1d84a1..fb341bf24c 100644 --- a/board/congatec/Kconfig +++ b/board/congatec/Kconfig @@ -24,6 +24,17 @@ config TARGET_CONGA_QEVAL20_QA3_E3845 Note that PCIE_ECAM_BASE is set up by the FSP so the value used by U-Boot matches that value. +config TARGET_THEADORABLE_X86_CONGA_QA3_E3845 + bool "theadorable-x86 baseboard & conga-QA3/E3845" + help + This is the theadorable-x86 baseboard board equipped with the + conga-QA3/E3845-4G SoM. It contains an Atom E3845 with Ethernet, + micro-SD, USB 2, USB 3, SATA, serial console and HDMI 1.3 video + out. It requires some binary blobs - see README.x86 for details. + + Note that PCIE_ECAM_BASE is set up by the FSP so the value used + by U-Boot matches that value. + endchoice source "board/congatec/conga-qeval20-qa3-e3845/Kconfig" diff --git a/board/congatec/cgtqmx6eval/cgtqmx6eval.c b/board/congatec/cgtqmx6eval/cgtqmx6eval.c index 5cb97b4778..8cd0090887 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; @@ -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; diff --git a/board/congatec/conga-qeval20-qa3-e3845/Kconfig b/board/congatec/conga-qeval20-qa3-e3845/Kconfig index c2649d299f..e1fae737ac 100644 --- a/board/congatec/conga-qeval20-qa3-e3845/Kconfig +++ b/board/congatec/conga-qeval20-qa3-e3845/Kconfig @@ -1,5 +1,3 @@ -if TARGET_CONGA_QEVAL20_QA3_E3845 - config SYS_BOARD default "conga-qeval20-qa3-e3845" @@ -10,7 +8,8 @@ config SYS_SOC default "baytrail" config SYS_CONFIG_NAME - default "conga-qeval20-qa3-e3845" + default "conga-qeval20-qa3-e3845" if TARGET_CONGA_QEVAL20_QA3_E3845 + default "theadorable-x86-conga-qa3-e3845" if TARGET_THEADORABLE_X86_CONGA_QA3_E3845 config SYS_TEXT_BASE default 0xfff00000 if !EFI_STUB @@ -24,8 +23,8 @@ config BOARD_SPECIFIC_OPTIONS # dummy select BOARD_EARLY_INIT_F select BOARD_LATE_INIT select SPI_FLASH_STMICRO + imply SPI_FLASH_SPANSION + imply SPI_FLASH_WINBOND config PCIE_ECAM_BASE default 0xe0000000 - -endif diff --git a/board/congatec/conga-qeval20-qa3-e3845/MAINTAINERS b/board/congatec/conga-qeval20-qa3-e3845/MAINTAINERS index 3d7e8e2d61..cceda4f49f 100644 --- a/board/congatec/conga-qeval20-qa3-e3845/MAINTAINERS +++ b/board/congatec/conga-qeval20-qa3-e3845/MAINTAINERS @@ -3,6 +3,9 @@ M: Stefan Roese <sr@denx.de> S: Maintained F: board/congatec/conga-qeval20-qa3-e3845 F: include/configs/conga-qeval20-qa3-e3845.h +F: include/configs/theadorable-x86-conga-qa3-e3845.h F: configs/conga-qeval20-qa3-e3845_defconfig F: configs/conga-qeval20-qa3-e3845-internal-uart_defconfig +F: configs/theadorable-x86-conga-qa3-e3845_defconfig +F: configs/theadorable-x86-conga-qa3-e3845-pcie-x4_defconfig F: arch/x86/dts/conga-qeval20-qa3-e3845.dts diff --git a/board/cssi/MCR3000/MCR3000.c b/board/cssi/MCR3000/MCR3000.c index 43c4cb77bb..c928881804 100644 --- a/board/cssi/MCR3000/MCR3000.c +++ b/board/cssi/MCR3000/MCR3000.c @@ -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; } diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c index 11ea52f240..c2d2e8e882 100644 --- a/board/davinci/da8xxevm/da850evm.c +++ b/board/davinci/da8xxevm/da850evm.c @@ -131,7 +131,7 @@ int misc_init_r(void) uchar env_enetaddr[6]; int enetaddr_found; - enetaddr_found = eth_getenv_enetaddr("ethaddr", env_enetaddr); + enetaddr_found = eth_env_get_enetaddr("ethaddr", env_enetaddr); #ifdef CONFIG_MAC_ADDR_IN_SPIFLASH int spi_mac_read; @@ -147,7 +147,7 @@ int misc_init_r(void) if (!enetaddr_found) { if (!spi_mac_read) { if (is_valid_ethaddr(buff)) { - if (eth_setenv_enetaddr("ethaddr", buff)) { + if (eth_env_set_enetaddr("ethaddr", buff)) { printf("Warning: Failed to " "set MAC address from SPI flash\n"); } @@ -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 52bb7363a7..565020760d 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 */ @@ -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"); } diff --git a/board/dfi/Kconfig b/board/dfi/Kconfig index d2a1d78783..5488f68ed2 100644 --- a/board/dfi/Kconfig +++ b/board/dfi/Kconfig @@ -8,10 +8,9 @@ if VENDOR_DFI choice prompt "Mainboard model" - optional -config TARGET_DFI_BT700 - bool "DFI BT700 BayTrail" +config TARGET_Q7X_151_DFI_BT700 + bool "DFI BT700 BayTrail on DFI Q7X-151 baseboard" imply SCSI help This is the DFI Q7X-151 baseboard equipped with the @@ -23,6 +22,19 @@ config TARGET_DFI_BT700 Note that PCIE_ECAM_BASE is set up by the FSP so the value used by U-Boot matches that value. +config TARGET_THEADORABLE_X86_DFI_BT700 + bool "DFI BT700 BayTrail on theadorable-x86 baseboard" + imply SCSI + help + This is the theadorable-x86 baseboard equipped with the + DFI BayTrail Bt700 SoM. It contains an Atom E3845 with + Ethernet (in non-PCIe-x4 configuration), micro-SD, USB 2, + USB 3, SATA, serial console and DisplayPort video out. + It requires some binary blobs - see README.x86 for details. + + Note that PCIE_ECAM_BASE is set up by the FSP so the value used + by U-Boot matches that value. + endchoice source "board/dfi/dfi-bt700/Kconfig" diff --git a/board/dfi/dfi-bt700/Kconfig b/board/dfi/dfi-bt700/Kconfig index 81a2575d11..4b6c3fc56c 100644 --- a/board/dfi/dfi-bt700/Kconfig +++ b/board/dfi/dfi-bt700/Kconfig @@ -1,5 +1,3 @@ -if TARGET_DFI_BT700 - config SYS_BOARD default "dfi-bt700" @@ -10,7 +8,8 @@ config SYS_SOC default "baytrail" config SYS_CONFIG_NAME - default "dfi-bt700" + default "dfi-bt700" if TARGET_Q7X_151_DFI_BT700 + default "theadorable-x86-dfi-bt700" if TARGET_THEADORABLE_X86_DFI_BT700 config SYS_TEXT_BASE default 0xfff00000 if !EFI_STUB @@ -24,8 +23,8 @@ config BOARD_SPECIFIC_OPTIONS # dummy select BOARD_EARLY_INIT_F select BOARD_LATE_INIT select SPI_FLASH_STMICRO + imply SPI_FLASH_SPANSION + imply SPI_FLASH_WINBOND config PCIE_ECAM_BASE default 0xe0000000 - -endif diff --git a/board/dfi/dfi-bt700/MAINTAINERS b/board/dfi/dfi-bt700/MAINTAINERS index 6639787814..a99a7250b8 100644 --- a/board/dfi/dfi-bt700/MAINTAINERS +++ b/board/dfi/dfi-bt700/MAINTAINERS @@ -3,6 +3,7 @@ M: Stefan Roese <sr@denx.de> S: Maintained F: board/dfi/dfi-bt700 F: include/configs/dfi-bt700.h +F: include/configs/theadorable-x86-dfi-bt700.h F: configs/dfi-bt700-q7x-151_defconfig F: configs/theadorable-x86-dfi-bt700_defconfig F: arch/x86/dts/dfi-bt700.dtsi diff --git a/board/el/el6x/el6x.c b/board/el/el6x/el6x.c index cbe355a600..6b98b5c3eb 100644 --- a/board/el/el6x/el6x.c +++ b/board/el/el6x/el6x.c @@ -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; } diff --git a/board/engicam/common/board.c b/board/engicam/common/board.c index e3bb5698f6..c7ec55ff82 100644 --- a/board/engicam/common/board.c +++ b/board/engicam/common/board.c @@ -21,11 +21,11 @@ static void mmc_late_init(void) char mmcblk[32]; u32 dev_no = mmc_get_env_dev(); - setenv_ulong("mmcdev", dev_no); + env_set_ulong("mmcdev", dev_no); /* 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(); diff --git a/board/engicam/geam6ul/geam6ul.c b/board/engicam/geam6ul/geam6ul.c index bc36fc77ee..ffd383a0ee 100644 --- a/board/engicam/geam6ul/geam6ul.c +++ b/board/engicam/geam6ul/geam6ul.c @@ -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 diff --git a/board/engicam/icorem6/icorem6.c b/board/engicam/icorem6/icorem6.c index 5b2ed066b4..3d4f713c3e 100644 --- a/board/engicam/icorem6/icorem6.c +++ b/board/engicam/icorem6/icorem6.c @@ -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 diff --git a/board/engicam/icorem6_rqs/icorem6_rqs.c b/board/engicam/icorem6_rqs/icorem6_rqs.c index 10a9471730..2a321dca50 100644 --- a/board/engicam/icorem6_rqs/icorem6_rqs.c +++ b/board/engicam/icorem6_rqs/icorem6_rqs.c @@ -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 diff --git a/board/engicam/isiotmx6ul/isiotmx6ul.c b/board/engicam/isiotmx6ul/isiotmx6ul.c index 4dcc9ea11b..fbf17242f8 100644 --- a/board/engicam/isiotmx6ul/isiotmx6ul.c +++ b/board/engicam/isiotmx6ul/isiotmx6ul.c @@ -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 } } diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c index 93a02ab0ee..0c5900a15a 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 83a70153e8..5d872fdfd9 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", @@ -1197,8 +1197,8 @@ int ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); - base = getenv_bootm_low(); - size = getenv_bootm_size(); + base = env_get_bootm_low(); + size = env_get_bootm_size(); fdt_fixup_memory(blob, (u64)base, (u64)size); diff --git a/board/freescale/b4860qds/spl.c b/board/freescale/b4860qds/spl.c index 60d7f0d48a..b1824b07a2 100644 --- a/board/freescale/b4860qds/spl.c +++ b/board/freescale/b4860qds/spl.c @@ -5,6 +5,7 @@ #include <common.h> #include <console.h> +#include <environment.h> #include <asm/spl.h> #include <malloc.h> #include <ns16550.h> @@ -101,7 +102,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) nand_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE, (uchar *)CONFIG_ENV_ADDR); gd->env_addr = (ulong)(CONFIG_ENV_ADDR); - gd->env_valid = 1; + gd->env_valid = ENV_VALID; #endif i2c_init_all(); diff --git a/board/freescale/bsc9131rdb/bsc9131rdb.c b/board/freescale/bsc9131rdb/bsc9131rdb.c index fb8bb39d87..c642e88a09 100644 --- a/board/freescale/bsc9131rdb/bsc9131rdb.c +++ b/board/freescale/bsc9131rdb/bsc9131rdb.c @@ -65,8 +65,8 @@ int ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); - base = getenv_bootm_low(); - size = getenv_bootm_size(); + base = env_get_bootm_low(); + size = env_get_bootm_size(); fdt_fixup_memory(blob, (u64)base, (u64)size); #ifdef CONFIG_FDT_FIXUP_PARTITIONS diff --git a/board/freescale/bsc9132qds/bsc9132qds.c b/board/freescale/bsc9132qds/bsc9132qds.c index a7772c4bf4..ed0b453e54 100644 --- a/board/freescale/bsc9132qds/bsc9132qds.c +++ b/board/freescale/bsc9132qds/bsc9132qds.c @@ -370,8 +370,8 @@ int ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); - base = getenv_bootm_low(); - size = getenv_bootm_size(); + base = env_get_bootm_low(); + size = env_get_bootm_size(); #if defined(CONFIG_PCI) FT_FSL_PCI_SETUP; diff --git a/board/freescale/c29xpcie/c29xpcie.c b/board/freescale/c29xpcie/c29xpcie.c index 45f463f01f..23901a4f96 100644 --- a/board/freescale/c29xpcie/c29xpcie.c +++ b/board/freescale/c29xpcie/c29xpcie.c @@ -138,8 +138,8 @@ int ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); - base = getenv_bootm_low(); - size = getenv_bootm_size(); + base = env_get_bootm_low(); + size = env_get_bootm_size(); #if defined(CONFIG_PCI) FT_FSL_PCI_SETUP; diff --git a/board/freescale/c29xpcie/spl.c b/board/freescale/c29xpcie/spl.c index 94093f11a8..28541a72cb 100644 --- a/board/freescale/c29xpcie/spl.c +++ b/board/freescale/c29xpcie/spl.c @@ -5,6 +5,7 @@ #include <common.h> #include <console.h> +#include <environment.h> #include <ns16550.h> #include <malloc.h> #include <mmc.h> @@ -63,7 +64,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) nand_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE, (uchar *)CONFIG_ENV_ADDR); gd->env_addr = (ulong)(CONFIG_ENV_ADDR); - gd->env_valid = 1; + gd->env_valid = ENV_VALID; i2c_init_all(); diff --git a/board/freescale/common/cmd_esbc_validate.c b/board/freescale/common/cmd_esbc_validate.c index cefe3cc531..b3e5f019b8 100644 --- a/board/freescale/common/cmd_esbc_validate.c +++ b/board/freescale/common/cmd_esbc_validate.c @@ -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; diff --git a/board/freescale/common/fsl_chain_of_trust.c b/board/freescale/common/fsl_chain_of_trust.c index dfe5d204d4..6e750b08bc 100644 --- a/board/freescale/common/fsl_chain_of_trust.c +++ b/board/freescale/common/fsl_chain_of_trust.c @@ -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; diff --git a/board/freescale/common/ns_access.c b/board/freescale/common/ns_access.c index 1c2287d22a..0c3a54cae5 100644 --- a/board/freescale/common/ns_access.c +++ b/board/freescale/common/ns_access.c @@ -10,15 +10,15 @@ #include <asm/arch/ns_access.h> #include <asm/arch/fsl_serdes.h> -void set_devices_ns_access(struct csu_ns_dev *ns_dev, u16 val) +void set_devices_ns_access(unsigned long index, u16 val) { u32 *base = (u32 *)CONFIG_SYS_FSL_CSU_ADDR; u32 *reg; uint32_t tmp; - reg = base + ns_dev->ind / 2; + reg = base + index / 2; tmp = in_be32(reg); - if (ns_dev->ind % 2 == 0) { + if (index % 2 == 0) { tmp &= 0x0000ffff; tmp |= val << 16; } else { @@ -34,7 +34,7 @@ static void enable_devices_ns_access(struct csu_ns_dev *ns_dev, uint32_t num) int i; for (i = 0; i < num; i++) - set_devices_ns_access(ns_dev + i, ns_dev[i].val); + set_devices_ns_access(ns_dev[i].ind, ns_dev[i].val); } void enable_layerscape_ns_access(void) @@ -50,20 +50,20 @@ void set_pcie_ns_access(int pcie, u16 val) switch (pcie) { #ifdef CONFIG_PCIE1 case PCIE1: - set_devices_ns_access(&ns_dev[CSU_CSLX_PCIE1], val); - set_devices_ns_access(&ns_dev[CSU_CSLX_PCIE1_IO], val); + set_devices_ns_access(CSU_CSLX_PCIE1, val); + set_devices_ns_access(CSU_CSLX_PCIE1_IO, val); return; #endif #ifdef CONFIG_PCIE2 case PCIE2: - set_devices_ns_access(&ns_dev[CSU_CSLX_PCIE2], val); - set_devices_ns_access(&ns_dev[CSU_CSLX_PCIE2_IO], val); + set_devices_ns_access(CSU_CSLX_PCIE2, val); + set_devices_ns_access(CSU_CSLX_PCIE2_IO, val); return; #endif #ifdef CONFIG_PCIE3 case PCIE3: - set_devices_ns_access(&ns_dev[CSU_CSLX_PCIE3], val); - set_devices_ns_access(&ns_dev[CSU_CSLX_PCIE3_IO], val); + set_devices_ns_access(CSU_CSLX_PCIE3, val); + set_devices_ns_access(CSU_CSLX_PCIE3_IO, val); return; #endif default: diff --git a/board/freescale/common/sys_eeprom.c b/board/freescale/common/sys_eeprom.c index 29aa778dbe..152ad84672 100644 --- a/board/freescale/common/sys_eeprom.c +++ b/board/freescale/common/sys_eeprom.c @@ -478,8 +478,8 @@ int mac_read_from_eeprom(void) /* Only initialize environment variables that are blank * (i.e. have not yet been set) */ - if (!getenv(enetvar)) - setenv(enetvar, ethaddr); + if (!env_get(enetvar)) + env_set(enetvar, ethaddr); } } diff --git a/board/freescale/common/vid.c b/board/freescale/common/vid.c index 9b65c13b1a..d6d1bfc861 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/corenet_ds/corenet_ds.c b/board/freescale/corenet_ds/corenet_ds.c index 93e1258295..132650c938 100644 --- a/board/freescale/corenet_ds/corenet_ds.c +++ b/board/freescale/corenet_ds/corenet_ds.c @@ -191,8 +191,8 @@ int ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); - base = getenv_bootm_low(); - size = getenv_bootm_size(); + base = env_get_bootm_low(); + size = env_get_bootm_size(); fdt_fixup_memory(blob, (u64)base, (u64)size); diff --git a/board/freescale/ls1021aiot/ls1021aiot.c b/board/freescale/ls1021aiot/ls1021aiot.c index 3340e4db80..5854e2dbba 100644 --- a/board/freescale/ls1021aiot/ls1021aiot.c +++ b/board/freescale/ls1021aiot/ls1021aiot.c @@ -201,10 +201,6 @@ int board_init(void) ls102xa_smmu_stream_id_init(); -#ifdef CONFIG_LAYERSCAPE_NS_ACCESS - enable_layerscape_ns_access(); -#endif - return 0; } diff --git a/board/freescale/ls1021atwr/ls1021atwr.c b/board/freescale/ls1021atwr/ls1021atwr.c index ff32d5cb28..2da06773c4 100644 --- a/board/freescale/ls1021atwr/ls1021atwr.c +++ b/board/freescale/ls1021atwr/ls1021atwr.c @@ -435,7 +435,6 @@ void board_init_f(ulong dummy) /* Allow OCRAM access permission as R/W */ #ifdef CONFIG_LAYERSCAPE_NS_ACCESS enable_layerscape_ns_access(); - enable_layerscape_ns_access(); #endif /* diff --git a/board/freescale/ls1046aqds/ls1046aqds.c b/board/freescale/ls1046aqds/ls1046aqds.c index 057a11daa8..883abf7358 100644 --- a/board/freescale/ls1046aqds/ls1046aqds.c +++ b/board/freescale/ls1046aqds/ls1046aqds.c @@ -261,10 +261,6 @@ int board_init(void) config_serdes_mux(); #endif -#ifdef CONFIG_LAYERSCAPE_NS_ACCESS - enable_layerscape_ns_access(); -#endif - if (adjust_vdd(0)) printf("Warning: Adjusting core voltage failed.\n"); diff --git a/board/freescale/ls1046ardb/ls1046ardb.c b/board/freescale/ls1046ardb/ls1046ardb.c index 1dd5e69882..33f1afdc73 100644 --- a/board/freescale/ls1046ardb/ls1046ardb.c +++ b/board/freescale/ls1046ardb/ls1046ardb.c @@ -69,10 +69,6 @@ int board_init(void) { struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR; -#ifdef CONFIG_LAYERSCAPE_NS_ACCESS - enable_layerscape_ns_access(); -#endif - #ifdef CONFIG_SECURE_BOOT /* * In case of Secure Boot, the IBR configures the SMMU diff --git a/board/freescale/ls1046ardb/ls1046ardb_rcw_emmc.cfg b/board/freescale/ls1046ardb/ls1046ardb_rcw_emmc.cfg index 6a5076e099..ccedf87e84 100644 --- a/board/freescale/ls1046ardb/ls1046ardb_rcw_emmc.cfg +++ b/board/freescale/ls1046ardb/ls1046ardb_rcw_emmc.cfg @@ -1,7 +1,7 @@ #PBL preamble and RCW header aa55aa55 01ee0100 # RCW -0c150010 0e000000 00000000 00000000 +0c150012 0e000000 00000000 00000000 11335559 40000012 60040000 c1000000 00000000 00000000 00000000 00238800 20124000 00003000 00000096 00000001 diff --git a/board/freescale/ls1046ardb/ls1046ardb_rcw_sd.cfg b/board/freescale/ls1046ardb/ls1046ardb_rcw_sd.cfg index d5265b846f..d3b152282f 100644 --- a/board/freescale/ls1046ardb/ls1046ardb_rcw_sd.cfg +++ b/board/freescale/ls1046ardb/ls1046ardb_rcw_sd.cfg @@ -1,7 +1,7 @@ #PBL preamble and RCW header aa55aa55 01ee0100 # RCW -0c150010 0e000000 00000000 00000000 +0c150012 0e000000 00000000 00000000 11335559 40005012 60040000 c1000000 00000000 00000000 00000000 00238800 20124000 00003101 00000096 00000001 diff --git a/board/freescale/ls2080aqds/eth.c b/board/freescale/ls2080aqds/eth.c index defcac5263..aca29bc361 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 f36fb9810b..83773d0af5 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 df2d768718..07ba0266d5 100644 --- a/board/freescale/ls2080ardb/ls2080ardb.c +++ b/board/freescale/ls2080ardb/ls2080ardb.c @@ -204,25 +204,12 @@ int config_board_mux(int ctrl_type) int board_init(void) { - char *env_hwconfig; - u32 __iomem *dcfg_ccsr = (u32 __iomem *)DCFG_BASE; #ifdef CONFIG_FSL_MC_ENET u32 __iomem *irq_ccsr = (u32 __iomem *)ISC_BASE; #endif - u32 val; init_final_memctl_regs(); - val = in_le32(dcfg_ccsr + DCFG_RCWSR13 / 4); - - env_hwconfig = getenv("hwconfig"); - - if (hwconfig_f("dspi", env_hwconfig) && - DCFG_RCWSR13_DSPI == (val & (u32)(0xf << 8))) - config_board_mux(MUX_TYPE_DSPI); - else - config_board_mux(MUX_TYPE_SDHC); - #ifdef CONFIG_ENV_IS_NOWHERE gd->env_addr = (ulong)&default_environment[0]; #endif @@ -257,31 +244,31 @@ int board_early_init_f(void) int misc_init_r(void) { -#ifdef CONFIG_FSL_QIXIS - /* - * LS2081ARDB has smart voltage translator which needs - * to be programmed as below - */ -#ifndef CONFIG_TARGET_LS2081ARDB - u8 sw; + char *env_hwconfig; + u32 __iomem *dcfg_ccsr = (u32 __iomem *)DCFG_BASE; + u32 val; + + val = in_le32(dcfg_ccsr + DCFG_RCWSR13 / 4); + + env_hwconfig = env_get("hwconfig"); + + if (hwconfig_f("dspi", env_hwconfig) && + DCFG_RCWSR13_DSPI == (val & (u32)(0xf << 8))) + config_board_mux(MUX_TYPE_DSPI); + else + config_board_mux(MUX_TYPE_SDHC); - sw = QIXIS_READ(arch); /* - * LS2080ARDB/LS2088ARDB RevF board has smart voltage translator + * LS2081ARDB RevF board has smart voltage translator * which needs to be programmed to enable high speed SD interface * by setting GPIO4_10 output to zero */ - if ((sw & 0xf) == 0x5) { -#endif +#ifdef CONFIG_TARGET_LS2081ARDB out_le32(GPIO4_GPDIR_ADDR, (1 << 21 | in_le32(GPIO4_GPDIR_ADDR))); out_le32(GPIO4_GPDAT_ADDR, (~(1 << 21) & in_le32(GPIO4_GPDAT_ADDR))); -#ifndef CONFIG_TARGET_LS2081ARDB - } #endif -#endif - if (hwconfig("sdhc")) config_board_mux(MUX_TYPE_SDHC); @@ -341,6 +328,32 @@ void board_quiesce_devices(void) #endif #ifdef CONFIG_OF_BOARD_SETUP +void fsl_fdt_fixup_flash(void *fdt) +{ + int offset; + +/* + * IFC and QSPI are muxed on board. + * So disable IFC node in dts if QSPI is enabled or + * disable QSPI node in dts in case QSPI is not enabled. + */ +#ifdef CONFIG_FSL_QSPI + offset = fdt_path_offset(fdt, "/soc/ifc"); + + if (offset < 0) + offset = fdt_path_offset(fdt, "/ifc"); +#else + offset = fdt_path_offset(fdt, "/soc/quadspi"); + + if (offset < 0) + offset = fdt_path_offset(fdt, "/quadspi"); +#endif + if (offset < 0) + return; + + fdt_status_disabled(fdt, offset); +} + int ft_board_setup(void *blob, bd_t *bd) { u64 base[CONFIG_NR_DRAM_BANKS]; @@ -368,6 +381,8 @@ int ft_board_setup(void *blob, bd_t *bd) fsl_fdt_fixup_dr_usb(blob, bd); + fsl_fdt_fixup_flash(blob); + #ifdef CONFIG_FSL_MC_ENET fdt_fixup_board_enet(blob); #endif diff --git a/board/freescale/mpc8323erdb/mpc8323erdb.c b/board/freescale/mpc8323erdb/mpc8323erdb.c index f30a1510ee..b715d8363e 100644 --- a/board/freescale/mpc8323erdb/mpc8323erdb.c +++ b/board/freescale/mpc8323erdb/mpc8323erdb.c @@ -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); } } } diff --git a/board/freescale/mpc837xemds/pci.c b/board/freescale/mpc837xemds/pci.c index 39c40e5cc9..e5d3dfd454 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 319f0479e2..9a0ab7f2ad 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/mpc8572ds/mpc8572ds.c b/board/freescale/mpc8572ds/mpc8572ds.c index ed6836a930..93d54f5c4a 100644 --- a/board/freescale/mpc8572ds/mpc8572ds.c +++ b/board/freescale/mpc8572ds/mpc8572ds.c @@ -239,8 +239,8 @@ int ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); - base = getenv_bootm_low(); - size = getenv_bootm_size(); + base = env_get_bootm_low(); + size = env_get_bootm_size(); fdt_fixup_memory(blob, (u64)base, (u64)size); diff --git a/board/freescale/mx31ads/u-boot.lds b/board/freescale/mx31ads/u-boot.lds index 8a4a8a2f07..71a63f188e 100644 --- a/board/freescale/mx31ads/u-boot.lds +++ b/board/freescale/mx31ads/u-boot.lds @@ -30,7 +30,7 @@ SECTIONS drivers/mtd/built-in.o (.text*) . = DEFINED(env_offset) ? env_offset : .; - common/env_embedded.o(.text*) + env/embedded.o(.text*) *(.text*) } diff --git a/board/freescale/mx31pdk/Kconfig b/board/freescale/mx31pdk/Kconfig index 055545c930..b9fc2d5177 100644 --- a/board/freescale/mx31pdk/Kconfig +++ b/board/freescale/mx31pdk/Kconfig @@ -1,5 +1,8 @@ if TARGET_MX31PDK +config SPL_LDSCRIPT + default "arch/$(ARCH)/cpu/u-boot-spl.lds" + config SYS_BOARD default "mx31pdk" diff --git a/board/freescale/mx51evk/mx51evk_video.c b/board/freescale/mx51evk/mx51evk_video.c index 86ec7508db..cc2c855b88 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.c b/board/freescale/mx53loco/mx53loco.c index 27d606f310..ea36603686 100644 --- a/board/freescale/mx53loco/mx53loco.c +++ b/board/freescale/mx53loco/mx53loco.c @@ -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); diff --git a/board/freescale/mx53loco/mx53loco_video.c b/board/freescale/mx53loco/mx53loco_video.c index bc5e8a9d3e..5fb0f04387 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/mx6sabreauto/mx6sabreauto.c b/board/freescale/mx6sabreauto/mx6sabreauto.c index a5703a35b1..ea78091744 100644 --- a/board/freescale/mx6sabreauto/mx6sabreauto.c +++ b/board/freescale/mx6sabreauto/mx6sabreauto.c @@ -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; diff --git a/board/freescale/mx6sabresd/mx6sabresd.c b/board/freescale/mx6sabresd/mx6sabresd.c index e4160420fa..19aa6f44d0 100644 --- a/board/freescale/mx6sabresd/mx6sabresd.c +++ b/board/freescale/mx6sabresd/mx6sabresd.c @@ -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; diff --git a/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c b/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c index a30c379e4d..cf7a069c56 100644 --- a/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c +++ b/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c @@ -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; diff --git a/board/freescale/mx6ullevk/mx6ullevk.c b/board/freescale/mx6ullevk/mx6ullevk.c index 66b08f823e..cebcec738f 100644 --- a/board/freescale/mx6ullevk/mx6ullevk.c +++ b/board/freescale/mx6ullevk/mx6ullevk.c @@ -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; diff --git a/board/freescale/p1010rdb/p1010rdb.c b/board/freescale/p1010rdb/p1010rdb.c index 65bb575a96..aa04e993c4 100644 --- a/board/freescale/p1010rdb/p1010rdb.c +++ b/board/freescale/p1010rdb/p1010rdb.c @@ -453,8 +453,8 @@ int ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); - base = getenv_bootm_low(); - size = getenv_bootm_size(); + base = env_get_bootm_low(); + size = env_get_bootm_size(); #if defined(CONFIG_PCI) FT_FSL_PCI_SETUP; diff --git a/board/freescale/p1010rdb/spl.c b/board/freescale/p1010rdb/spl.c index 2cebc2c002..001308874e 100644 --- a/board/freescale/p1010rdb/spl.c +++ b/board/freescale/p1010rdb/spl.c @@ -5,6 +5,7 @@ #include <common.h> #include <console.h> +#include <environment.h> #include <ns16550.h> #include <malloc.h> #include <mmc.h> @@ -87,7 +88,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) nand_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE, (uchar *)CONFIG_ENV_ADDR); gd->env_addr = (ulong)(CONFIG_ENV_ADDR); - gd->env_valid = 1; + gd->env_valid = ENV_VALID; #else env_relocate(); #endif diff --git a/board/freescale/p1022ds/p1022ds.c b/board/freescale/p1022ds/p1022ds.c index 345feac0b2..bf493262d0 100644 --- a/board/freescale/p1022ds/p1022ds.c +++ b/board/freescale/p1022ds/p1022ds.c @@ -339,8 +339,8 @@ int ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); - base = getenv_bootm_low(); - size = getenv_bootm_size(); + base = env_get_bootm_low(); + size = env_get_bootm_size(); fdt_fixup_memory(blob, (u64)base, (u64)size); diff --git a/board/freescale/p1022ds/spl.c b/board/freescale/p1022ds/spl.c index a117dc3a2c..94b357d446 100644 --- a/board/freescale/p1022ds/spl.c +++ b/board/freescale/p1022ds/spl.c @@ -6,6 +6,7 @@ #include <common.h> #include <console.h> +#include <environment.h> #include <ns16550.h> #include <malloc.h> #include <mmc.h> @@ -100,7 +101,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) (uchar *)CONFIG_ENV_ADDR); gd->env_addr = (ulong)(CONFIG_ENV_ADDR); - gd->env_valid = 1; + gd->env_valid = ENV_VALID; #else env_relocate(); #endif diff --git a/board/freescale/p1023rdb/p1023rdb.c b/board/freescale/p1023rdb/p1023rdb.c index 0451722603..ccda824125 100644 --- a/board/freescale/p1023rdb/p1023rdb.c +++ b/board/freescale/p1023rdb/p1023rdb.c @@ -137,8 +137,8 @@ int ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); - base = getenv_bootm_low(); - size = getenv_bootm_size(); + base = env_get_bootm_low(); + size = env_get_bootm_size(); fdt_fixup_memory(blob, (u64)base, (u64)size); 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 51217c58e5..31c8ed9ae1 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, @@ -438,8 +439,8 @@ int ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); - base = getenv_bootm_low(); - size = getenv_bootm_size(); + base = env_get_bootm_low(); + size = env_get_bootm_size(); fdt_fixup_memory(blob, (u64)base, (u64)size); diff --git a/board/freescale/p1_p2_rdb_pc/spl.c b/board/freescale/p1_p2_rdb_pc/spl.c index ca7ba5754e..c1d4c36b06 100644 --- a/board/freescale/p1_p2_rdb_pc/spl.c +++ b/board/freescale/p1_p2_rdb_pc/spl.c @@ -6,6 +6,7 @@ #include <common.h> #include <console.h> +#include <environment.h> #include <ns16550.h> #include <malloc.h> #include <mmc.h> @@ -92,7 +93,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) nand_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE, (uchar *)CONFIG_ENV_ADDR); gd->env_addr = (ulong)(CONFIG_ENV_ADDR); - gd->env_valid = 1; + gd->env_valid = ENV_VALID; #else env_relocate(); #endif diff --git a/board/freescale/p1_twr/p1_twr.c b/board/freescale/p1_twr/p1_twr.c index f54a6ff8dc..02c89998cb 100644 --- a/board/freescale/p1_twr/p1_twr.c +++ b/board/freescale/p1_twr/p1_twr.c @@ -268,8 +268,8 @@ int ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); - base = getenv_bootm_low(); - size = getenv_bootm_size(); + base = env_get_bootm_low(); + size = env_get_bootm_size(); fdt_fixup_memory(blob, (u64)base, (u64)size); diff --git a/board/freescale/p2041rdb/p2041rdb.c b/board/freescale/p2041rdb/p2041rdb.c index 21fb66f184..78ee74770c 100644 --- a/board/freescale/p2041rdb/p2041rdb.c +++ b/board/freescale/p2041rdb/p2041rdb.c @@ -219,8 +219,8 @@ int ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); - base = getenv_bootm_low(); - size = getenv_bootm_size(); + base = env_get_bootm_low(); + size = env_get_bootm_size(); fdt_fixup_memory(blob, (u64)base, (u64)size); diff --git a/board/freescale/qemu-ppce500/qemu-ppce500.c b/board/freescale/qemu-ppce500/qemu-ppce500.c index 0c65ec72d2..cf5023c505 100644 --- a/board/freescale/qemu-ppce500/qemu-ppce500.c +++ b/board/freescale/qemu-ppce500/qemu-ppce500.c @@ -211,10 +211,10 @@ int last_stage_init(void) /* -kernel boot */ prop = fdt_getprop(fdt, chosen, "qemu,boot-kernel", &len); if (prop && (len >= 8)) - setenv_hex("qemu_kernel_addr", *prop); + env_set_hex("qemu_kernel_addr", *prop); /* Give the user a variable for the host fdt */ - setenv_hex("fdt_addr_r", (ulong)fdt); + env_set_hex("fdt_addr_r", (ulong)fdt); return 0; } diff --git a/board/freescale/t102xqds/spl.c b/board/freescale/t102xqds/spl.c index b987ecea1d..3aa19e6715 100644 --- a/board/freescale/t102xqds/spl.c +++ b/board/freescale/t102xqds/spl.c @@ -5,6 +5,7 @@ #include <common.h> #include <console.h> +#include <environment.h> #include <malloc.h> #include <ns16550.h> #include <nand.h> @@ -138,7 +139,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) #endif gd->env_addr = (ulong)(CONFIG_ENV_ADDR); - gd->env_valid = 1; + gd->env_valid = ENV_VALID; i2c_init_all(); diff --git a/board/freescale/t102xqds/t102xqds.c b/board/freescale/t102xqds/t102xqds.c index 1b2f6b2487..20374baf48 100644 --- a/board/freescale/t102xqds/t102xqds.c +++ b/board/freescale/t102xqds/t102xqds.c @@ -363,8 +363,8 @@ int ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); - base = getenv_bootm_low(); - size = getenv_bootm_size(); + base = env_get_bootm_low(); + size = env_get_bootm_size(); fdt_fixup_memory(blob, (u64)base, (u64)size); diff --git a/board/freescale/t102xrdb/spl.c b/board/freescale/t102xrdb/spl.c index dc6d9eeef6..ca1e49ffa7 100644 --- a/board/freescale/t102xrdb/spl.c +++ b/board/freescale/t102xrdb/spl.c @@ -5,6 +5,7 @@ #include <common.h> #include <console.h> +#include <environment.h> #include <malloc.h> #include <ns16550.h> #include <nand.h> @@ -125,7 +126,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) #endif gd->env_addr = (ulong)(CONFIG_ENV_ADDR); - gd->env_valid = 1; + gd->env_valid = ENV_VALID; i2c_init_all(); diff --git a/board/freescale/t102xrdb/t102xrdb.c b/board/freescale/t102xrdb/t102xrdb.c index f370f72baa..8885a546fa 100644 --- a/board/freescale/t102xrdb/t102xrdb.c +++ b/board/freescale/t102xrdb/t102xrdb.c @@ -186,8 +186,8 @@ int ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); - base = getenv_bootm_low(); - size = getenv_bootm_size(); + base = env_get_bootm_low(); + size = env_get_bootm_size(); fdt_fixup_memory(blob, (u64)base, (u64)size); diff --git a/board/freescale/t1040qds/t1040qds.c b/board/freescale/t1040qds/t1040qds.c index 5466fbf5f6..a36997b48c 100644 --- a/board/freescale/t1040qds/t1040qds.c +++ b/board/freescale/t1040qds/t1040qds.c @@ -245,8 +245,8 @@ int ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); - base = getenv_bootm_low(); - size = getenv_bootm_size(); + base = env_get_bootm_low(); + size = env_get_bootm_size(); fdt_fixup_memory(blob, (u64)base, (u64)size); diff --git a/board/freescale/t104xrdb/spl.c b/board/freescale/t104xrdb/spl.c index 2e43307b2d..4fb9323873 100644 --- a/board/freescale/t104xrdb/spl.c +++ b/board/freescale/t104xrdb/spl.c @@ -5,6 +5,7 @@ #include <common.h> #include <console.h> +#include <environment.h> #include <malloc.h> #include <ns16550.h> #include <nand.h> @@ -119,7 +120,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) (uchar *)CONFIG_ENV_ADDR); #endif gd->env_addr = (ulong)(CONFIG_ENV_ADDR); - gd->env_valid = 1; + gd->env_valid = ENV_VALID; i2c_init_all(); diff --git a/board/freescale/t104xrdb/t104xrdb.c b/board/freescale/t104xrdb/t104xrdb.c index d4c3d4dcb4..2818cdf274 100644 --- a/board/freescale/t104xrdb/t104xrdb.c +++ b/board/freescale/t104xrdb/t104xrdb.c @@ -132,8 +132,8 @@ int ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); - base = getenv_bootm_low(); - size = getenv_bootm_size(); + base = env_get_bootm_low(); + size = env_get_bootm_size(); fdt_fixup_memory(blob, (u64)base, (u64)size); diff --git a/board/freescale/t208xqds/spl.c b/board/freescale/t208xqds/spl.c index d7d716b690..36961dc9b0 100644 --- a/board/freescale/t208xqds/spl.c +++ b/board/freescale/t208xqds/spl.c @@ -5,6 +5,7 @@ #include <common.h> #include <console.h> +#include <environment.h> #include <malloc.h> #include <ns16550.h> #include <nand.h> @@ -124,7 +125,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) #endif gd->env_addr = (ulong)(CONFIG_ENV_ADDR); - gd->env_valid = 1; + gd->env_valid = ENV_VALID; i2c_init_all(); diff --git a/board/freescale/t208xqds/t208xqds.c b/board/freescale/t208xqds/t208xqds.c index 26093ea9d2..ed3d3f4b71 100644 --- a/board/freescale/t208xqds/t208xqds.c +++ b/board/freescale/t208xqds/t208xqds.c @@ -451,8 +451,8 @@ int ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); - base = getenv_bootm_low(); - size = getenv_bootm_size(); + base = env_get_bootm_low(); + size = env_get_bootm_size(); fdt_fixup_memory(blob, (u64)base, (u64)size); diff --git a/board/freescale/t208xrdb/spl.c b/board/freescale/t208xrdb/spl.c index b43140148b..f0cc34d788 100644 --- a/board/freescale/t208xrdb/spl.c +++ b/board/freescale/t208xrdb/spl.c @@ -5,6 +5,7 @@ #include <common.h> #include <console.h> +#include <environment.h> #include <malloc.h> #include <ns16550.h> #include <nand.h> @@ -94,7 +95,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) #endif gd->env_addr = (ulong)(CONFIG_ENV_ADDR); - gd->env_valid = 1; + gd->env_valid = ENV_VALID; i2c_init_all(); diff --git a/board/freescale/t208xrdb/t208xrdb.c b/board/freescale/t208xrdb/t208xrdb.c index 1ab05ec9fd..619495e6ab 100644 --- a/board/freescale/t208xrdb/t208xrdb.c +++ b/board/freescale/t208xrdb/t208xrdb.c @@ -118,8 +118,8 @@ int ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); - base = getenv_bootm_low(); - size = getenv_bootm_size(); + base = env_get_bootm_low(); + size = env_get_bootm_size(); fdt_fixup_memory(blob, (u64)base, (u64)size); diff --git a/board/freescale/t4qds/spl.c b/board/freescale/t4qds/spl.c index 9ecdaedda3..750f155493 100644 --- a/board/freescale/t4qds/spl.c +++ b/board/freescale/t4qds/spl.c @@ -5,6 +5,7 @@ #include <common.h> #include <console.h> +#include <environment.h> #include <asm/spl.h> #include <malloc.h> #include <ns16550.h> @@ -129,7 +130,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) #endif gd->env_addr = (ulong)(CONFIG_ENV_ADDR); - gd->env_valid = 1; + gd->env_valid = ENV_VALID; i2c_init_all(); diff --git a/board/freescale/t4qds/t4240emu.c b/board/freescale/t4qds/t4240emu.c index 35ad19e045..7136acafea 100644 --- a/board/freescale/t4qds/t4240emu.c +++ b/board/freescale/t4qds/t4240emu.c @@ -70,8 +70,8 @@ int ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); - base = getenv_bootm_low(); - size = getenv_bootm_size(); + base = env_get_bootm_low(); + size = env_get_bootm_size(); fdt_fixup_memory(blob, (u64)base, (u64)size); diff --git a/board/freescale/t4qds/t4240qds.c b/board/freescale/t4qds/t4240qds.c index 8f9e7e8255..7b71b541fd 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; @@ -684,8 +684,8 @@ int ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); - base = getenv_bootm_low(); - size = getenv_bootm_size(); + base = env_get_bootm_low(); + size = env_get_bootm_size(); fdt_fixup_memory(blob, (u64)base, (u64)size); diff --git a/board/freescale/t4rdb/spl.c b/board/freescale/t4rdb/spl.c index 5feab1cfcd..932954e93d 100644 --- a/board/freescale/t4rdb/spl.c +++ b/board/freescale/t4rdb/spl.c @@ -8,6 +8,7 @@ #include <common.h> #include <console.h> +#include <environment.h> #include <asm/spl.h> #include <malloc.h> #include <ns16550.h> @@ -87,7 +88,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) (uchar *)CONFIG_ENV_ADDR); gd->env_addr = (ulong)(CONFIG_ENV_ADDR); - gd->env_valid = 1; + gd->env_valid = ENV_VALID; i2c_init_all(); diff --git a/board/freescale/t4rdb/t4240rdb.c b/board/freescale/t4rdb/t4240rdb.c index bdd6f4ef49..f511706b9f 100644 --- a/board/freescale/t4rdb/t4240rdb.c +++ b/board/freescale/t4rdb/t4240rdb.c @@ -97,8 +97,8 @@ int ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); - base = getenv_bootm_low(); - size = getenv_bootm_size(); + base = env_get_bootm_low(); + size = env_get_bootm_size(); fdt_fixup_memory(blob, (u64)base, (u64)size); diff --git a/board/gateworks/gw_ventana/common.c b/board/gateworks/gw_ventana/common.c index 46404b4d59..e9865b4adb 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 89848c8f07..4ddc7e1fa2 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) { - setenv("ethprime", dev->name); - printf("set ethprime to %s\n", getenv("ethprime")); + env_set("ethprime", dev->name); + 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,11 +658,11 @@ 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 - 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); - if (!getenv("fdt_file")) { + env_set("model", str); + if (!env_get("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,30 +765,30 @@ 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 */ if (test_bit(EECONFIG_ETH0, info->config) && - !getenv("ethaddr")) { - eth_setenv_enetaddr("ethaddr", info->mac0); + !env_get("ethaddr")) { + eth_env_set_enetaddr("ethaddr", info->mac0); } if (test_bit(EECONFIG_ETH1, info->config) && - !getenv("eth1addr")) { - eth_setenv_enetaddr("eth1addr", info->mac1); + !env_get("eth1addr")) { + eth_env_set_enetaddr("eth1addr", info->mac1); } /* 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 */ - if (!strcmp(getenv("hwconfig"), "_UNKNOWN_")) { + if (!strcmp(env_get("hwconfig"), "_UNKNOWN_")) { buf[0] = 0; if (gpio_cfg[board_type].rs232_en) strcat(buf, "rs232;"); @@ -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 */ @@ -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 69a638d71d..9524da7daf 100644 --- a/board/gateworks/gw_ventana/gw_ventana_spl.c +++ b/board/gateworks/gw_ventana/gw_ventana_spl.c @@ -690,9 +690,9 @@ int spl_start_uboot(void) debug("%s\n", __func__); #ifdef CONFIG_SPL_ENV_SUPPORT env_init(); - env_relocate_spec(); - debug("boot_os=%s\n", getenv("boot_os")); - if (getenv_yesno("boot_os") == 1) + env_load(); + debug("boot_os=%s\n", env_get("boot_os")); + if (env_get_yesno("boot_os") == 1) ret = 0; #else /* use i2c-0:0x50:0x00 for falcon boot mode (0=linux, else uboot) */ diff --git a/board/gdsys/a38x/keyprogram.c b/board/gdsys/a38x/keyprogram.c index a4a6f1cca5..d75e08b39f 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 c6566e9196..7e485074ce 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 34e9d1956e..fec691515d 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 95f11fb69f..1813a58e60 100644 --- a/board/gdsys/p1022/controlcenterd-id.c +++ b/board/gdsys/p1022/controlcenterd-id.c @@ -217,7 +217,7 @@ static u8 *get_2nd_stage_bl_location(ulong target_addr) { ulong addr; #ifdef CCDM_SECOND_STAGE - addr = getenv_ulong("loadaddr", 16, CONFIG_LOADADDR); + addr = env_get_ulong("loadaddr", 16, CONFIG_LOADADDR); #else addr = target_addr; #endif @@ -235,7 +235,7 @@ static u8 *get_image_location(void) { ulong addr; /* TODO use other area? */ - addr = getenv_ulong("loadaddr", 16, CONFIG_LOADADDR); + addr = env_get_ulong("loadaddr", 16, CONFIG_LOADADDR); return (u8 *)(addr); } #endif @@ -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 01064dcfde..9fb814d8c7 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) @@ -335,8 +335,8 @@ int ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); - base = getenv_bootm_low(); - size = getenv_bootm_size(); + base = env_get_bootm_low(); + size = env_get_bootm_size(); fdt_fixup_memory(blob, (u64)base, (u64)size); diff --git a/board/grinn/chiliboard/board.c b/board/grinn/chiliboard/board.c index e3f82b0a80..2f5974a246 100644 --- a/board/grinn/chiliboard/board.c +++ b/board/grinn/chiliboard/board.c @@ -126,11 +126,11 @@ 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)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); } mac_lo = readl(&cdev->macid1l); @@ -142,9 +142,9 @@ 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_setenv_enetaddr("eth1addr", mac_addr); + eth_env_set_enetaddr("eth1addr", mac_addr); } #endif diff --git a/board/grinn/liteboard/board.c b/board/grinn/liteboard/board.c index 817e22fd45..941e7ea2c8 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)) { @@ -168,12 +168,12 @@ void board_late_mmc_init(void) if (!check_mmc_autodetect()) return; - setenv_ulong("mmcdev", dev_no); + env_set_ulong("mmcdev", dev_no); /* 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); diff --git a/board/gumstix/pepper/board.c b/board/gumstix/pepper/board.c index d76c28bd3c..bfc5fd1c46 100644 --- a/board/gumstix/pepper/board.c +++ b/board/gumstix/pepper/board.c @@ -239,7 +239,7 @@ int board_eth_init(bd_t *bis) uint32_t mac_hi, mac_lo; const char *devname; - if (!eth_getenv_enetaddr("ethaddr", mac_addr)) { + if (!eth_env_get_enetaddr("ethaddr", mac_addr)) { /* try reading mac address from efuse */ mac_lo = readl(&cdev->macid0l); mac_hi = readl(&cdev->macid0h); @@ -250,7 +250,7 @@ int board_eth_init(bd_t *bis) mac_addr[4] = mac_lo & 0xFF; mac_addr[5] = (mac_lo & 0xFF00) >> 8; if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); } writel((RGMII_MODE_ENABLE | RGMII_INT_DELAY), &cdev->miisel); diff --git a/board/highbank/highbank.c b/board/highbank/highbank.c index 1af2207867..f7c05ab08f 100644 --- a/board/highbank/highbank.c +++ b/board/highbank/highbank.c @@ -80,11 +80,11 @@ 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); - setenv("bootcmd", envbuffer); + env_set("bootcmd", envbuffer); } else - setenv("bootcmd", ""); + env_set("bootcmd", ""); return 0; } diff --git a/board/hisilicon/hikey/hikey.c b/board/hisilicon/hikey/hikey.c index 47bce4daa6..c513d0af10 100644 --- a/board/hisilicon/hikey/hikey.c +++ b/board/hisilicon/hikey/hikey.c @@ -345,7 +345,7 @@ int board_init(void) static int init_dwmmc(void) { - int ret; + int ret = 0; #ifdef CONFIG_MMC_DW diff --git a/board/htkw/mcx/mcx.c b/board/htkw/mcx/mcx.c index 1deb2bdd8b..0a02e44046 100644 --- a/board/htkw/mcx/mcx.c +++ b/board/htkw/mcx/mcx.c @@ -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; } diff --git a/board/intel/edison/edison.c b/board/intel/edison/edison.c index a1a7d4d7c8..4b1e6d0f47 100644 --- a/board/intel/edison/edison.c +++ b/board/intel/edison/edison.c @@ -5,6 +5,7 @@ */ #include <common.h> #include <dwc3-uboot.h> +#include <environment.h> #include <mmc.h> #include <u-boot/md5.h> #include <usb.h> @@ -63,14 +64,14 @@ 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) - saveenv(); + env_save(); #endif } @@ -85,19 +86,19 @@ 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) - saveenv(); + env_save(); #endif } 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/isee/igep003x/board.c b/board/isee/igep003x/board.c index e33170d65f..d33dc960a5 100644 --- a/board/isee/igep003x/board.c +++ b/board/isee/igep003x/board.c @@ -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 @@ -264,7 +264,7 @@ int board_eth_init(bd_t *bis) uint8_t mac_addr[6]; uint32_t mac_hi, mac_lo; - if (!eth_getenv_enetaddr("ethaddr", mac_addr)) { + if (!eth_env_get_enetaddr("ethaddr", mac_addr)) { /* try reading mac address from efuse */ mac_lo = readl(&cdev->macid0l); mac_hi = readl(&cdev->macid0h); @@ -275,7 +275,7 @@ int board_eth_init(bd_t *bis) mac_addr[4] = mac_lo & 0xFF; mac_addr[5] = (mac_lo & 0xFF00) >> 8; if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); } writel((GMII1_SEL_RMII | RMII1_IO_CLK_EN), diff --git a/board/isee/igep00x0/igep00x0.c b/board/isee/igep00x0/igep00x0.c index 843d35eb2d..a7a75601dd 100644 --- a/board/isee/igep00x0/igep00x0.c +++ b/board/isee/igep00x0/igep00x0.c @@ -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; } } diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c index 408079c9a1..6cd281218e 100644 --- a/board/keymile/common/common.c +++ b/board/keymile/common/common.c @@ -51,24 +51,24 @@ 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"); + p = env_get("rootfssize"); if (p != NULL) strict_strtoul(p, 16, &rootfssize); 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"); @@ -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; @@ -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 ) */ } @@ -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 e9e518cf72..f1321d9899 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; @@ -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; diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c index 8020c379fd..5e07faa818 100644 --- a/board/keymile/km83xx/km83xx.c +++ b/board/keymile/km83xx/km83xx.c @@ -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(); diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c index 85785ffc02..af1ebc4101 100644 --- a/board/keymile/km_arm/km_arm.c +++ b/board/keymile/km_arm/km_arm.c @@ -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) @@ -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) { @@ -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 diff --git a/board/keymile/kmp204x/kmp204x.c b/board/keymile/kmp204x/kmp204x.c index abb20196c5..8c9d6b167d 100644 --- a/board/keymile/kmp204x/kmp204x.c +++ b/board/keymile/kmp204x/kmp204x.c @@ -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(); @@ -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; @@ -271,8 +271,8 @@ int ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); - base = getenv_bootm_low(); - size = getenv_bootm_size(); + base = env_get_bootm_low(); + size = env_get_bootm_size(); fdt_fixup_memory(blob, (u64)base, (u64)size); diff --git a/board/kosagi/novena/novena.c b/board/kosagi/novena/novena.c index 980cd6288c..f0ace03009 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. */ @@ -264,7 +264,7 @@ int misc_init_r(void) } /* Set ethernet address from EEPROM. */ - eth_setenv_enetaddr("ethaddr", data.mac); + eth_env_set_enetaddr("ethaddr", data.mac); return ret; } diff --git a/board/lg/sniper/sniper.c b/board/lg/sniper/sniper.c index f924645dc0..a299f761f9 100644 --- a/board/lg/sniper/sniper.c +++ b/board/lg/sniper/sniper.c @@ -133,8 +133,8 @@ int misc_init_r(void) } if (reboot_mode[0] > 0 && isascii(reboot_mode[0])) { - if (!getenv("reboot-mode")) - setenv("reboot-mode", (char *)reboot_mode); + if (!env_get("reboot-mode")) + env_set("reboot-mode", (char *)reboot_mode); } omap_reboot_mode_clear(); diff --git a/board/liebherr/mccmon6/mccmon6.c b/board/liebherr/mccmon6/mccmon6.c index e265e2a732..4f7e018dea 100644 --- a/board/liebherr/mccmon6/mccmon6.c +++ b/board/liebherr/mccmon6/mccmon6.c @@ -367,7 +367,7 @@ int board_init(void) int board_late_init(void) { - setenv("board_name", "mccmon6"); + env_set("board_name", "mccmon6"); return 0; } @@ -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/am3517evm/am3517evm.c b/board/logicpd/am3517evm/am3517evm.c index 5d2d997e42..c18a5a3140 100644 --- a/board/logicpd/am3517evm/am3517evm.c +++ b/board/logicpd/am3517evm/am3517evm.c @@ -105,7 +105,7 @@ int misc_init_r(void) volatile unsigned int ctr; u32 reset; -#ifdef CONFIG_SYS_I2C_OMAP34XX +#ifdef CONFIG_SYS_I2C_OMAP24XX i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE); #endif diff --git a/board/logicpd/imx6/imx6logic.c b/board/logicpd/imx6/imx6logic.c index 0a7d4124a6..78fc5466b6 100644 --- a/board/logicpd/imx6/imx6logic.c +++ b/board/logicpd/imx6/imx6logic.c @@ -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; diff --git a/board/logicpd/omap3som/omap3logic.c b/board/logicpd/omap3som/omap3logic.c index 7990dd2513..fe3f9e664f 100644 --- a/board/logicpd/omap3som/omap3logic.c +++ b/board/logicpd/omap3som/omap3logic.c @@ -219,8 +219,8 @@ 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")) - setenv("fdtimage", board->fdtfile); + if (!env_get("fdtimage")) + env_set("fdtimage", board->fdtfile); } /* restore hsusb0_data5 pin as hsusb0_data5 */ @@ -320,7 +320,7 @@ void set_muxconf_regs(void) MUX_VAL(CP(SDRC_DQS2), (IEN | PTD | DIS | M0)); /*SDRC_DQS2*/ MUX_VAL(CP(SDRC_DQS3), (IEN | PTD | DIS | M0)); /*SDRC_DQS3*/ MUX_VAL(CP(SDRC_CKE0), (IDIS | PTU | EN | M0)); /*SDRC_CKE0*/ - MUX_VAL(CP(SDRC_CKE1), (IDIS | PTD | DIS | M7)); /*SDRC_CKE1*/ + MUX_VAL(CP(SDRC_CKE1), (IDIS | PTU | DIS | M0)); /*SDRC_CKE1*/ MUX_VAL(CP(GPMC_A1), (IDIS | PTU | EN | M0)); /*GPMC_A1*/ MUX_VAL(CP(GPMC_A2), (IDIS | PTU | EN | M0)); /*GPMC_A2*/ diff --git a/board/logicpd/zoom1/zoom1.c b/board/logicpd/zoom1/zoom1.c index e91f874a2b..e6c2526ea1 100644 --- a/board/logicpd/zoom1/zoom1.c +++ b/board/logicpd/zoom1/zoom1.c @@ -130,10 +130,10 @@ int board_eth_init(bd_t *bis) uchar eth_addr[6]; rc = smc911x_initialize(0, CONFIG_SMC911X_BASE); - if (!eth_getenv_enetaddr(STR_ENV_ETHADDR, eth_addr)) { + if (!eth_env_get_enetaddr(STR_ENV_ETHADDR, eth_addr)) { dev = eth_get_dev_by_index(0); if (dev) { - eth_setenv_enetaddr(STR_ENV_ETHADDR, dev->enetaddr); + eth_env_set_enetaddr(STR_ENV_ETHADDR, dev->enetaddr); } else { printf("zoom1: Couldn't get eth device\n"); rc = -1; diff --git a/board/micronas/vct/vct.c b/board/micronas/vct/vct.c index 8bf8d5f4e8..510746d35c 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 6a4427a42e..7764288811 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; @@ -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(); diff --git a/board/overo/overo.c b/board/overo/overo.c index adf33cfd37..140e34d4dd 100644 --- a/board/overo/overo.c +++ b/board/overo/overo.c @@ -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; } diff --git a/board/phytec/pcm051/board.c b/board/phytec/pcm051/board.c index 4f3853ac42..52ad5b64de 100644 --- a/board/phytec/pcm051/board.c +++ b/board/phytec/pcm051/board.c @@ -216,7 +216,7 @@ int board_eth_init(bd_t *bis) uint8_t mac_addr[6]; uint32_t mac_hi, mac_lo; - if (!eth_getenv_enetaddr("ethaddr", mac_addr)) { + if (!eth_env_get_enetaddr("ethaddr", mac_addr)) { printf("<ethaddr> not set. Reading from E-fuse\n"); /* try reading mac address from efuse */ mac_lo = readl(&cdev->macid0l); @@ -229,7 +229,7 @@ int board_eth_init(bd_t *bis) mac_addr[5] = (mac_lo & 0xFF00) >> 8; if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); else goto try_usbether; } diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.c b/board/qualcomm/dragonboard410c/dragonboard410c.c index 37d0b85e0e..848e27848b 100644 --- a/board/qualcomm/dragonboard410c/dragonboard410c.c +++ b/board/qualcomm/dragonboard410c/dragonboard410c.c @@ -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"); } diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index d3c6ba580f..530f149617 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -247,11 +247,11 @@ static void set_fdtfile(void) { const char *fdtfile; - if (getenv("fdtfile")) + if (env_get("fdtfile")) return; fdtfile = model->fdtfile; - setenv("fdtfile", fdtfile); + env_set("fdtfile", fdtfile); } /* @@ -260,13 +260,13 @@ 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) return; - setenv_hex("fdt_addr", fw_dtb_pointer); + env_set_hex("fdt_addr", fw_dtb_pointer); } /* @@ -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); @@ -300,10 +300,10 @@ static void set_usbethaddr(void) return; } - eth_setenv_enetaddr("usbethaddr", msg->get_mac_address.body.resp.mac); + eth_env_set_enetaddr("usbethaddr", msg->get_mac_address.body.resp.mac); - if (!getenv("ethaddr")) - setenv("ethaddr", getenv("usbethaddr")); + if (!env_get("ethaddr")) + env_set("ethaddr", env_get("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 */ @@ -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); @@ -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) diff --git a/board/renesas/alt/alt.c b/board/renesas/alt/alt.c index b35b6a3ad1..0bf8160f1f 100644 --- a/board/renesas/alt/alt.c +++ b/board/renesas/alt/alt.c @@ -143,7 +143,7 @@ int board_eth_init(bd_t *bis) unsigned char enetaddr[6]; ret = sh_eth_initialize(bis); - if (!eth_getenv_enetaddr("ethaddr", enetaddr)) + if (!eth_env_get_enetaddr("ethaddr", enetaddr)) return ret; /* Set Mac address */ diff --git a/board/renesas/blanche/blanche.c b/board/renesas/blanche/blanche.c index 5156eafeb4..574dcda01b 100644 --- a/board/renesas/blanche/blanche.c +++ b/board/renesas/blanche/blanche.c @@ -418,10 +418,10 @@ int board_eth_init(bd_t *bis) rc = smc911x_initialize(0, CONFIG_SMC911X_BASE); - if (!eth_getenv_enetaddr(STR_ENV_ETHADDR, eth_addr)) { + if (!eth_env_get_enetaddr(STR_ENV_ETHADDR, eth_addr)) { dev = eth_get_dev_by_index(0); if (dev) { - eth_setenv_enetaddr(STR_ENV_ETHADDR, dev->enetaddr); + eth_env_set_enetaddr(STR_ENV_ETHADDR, dev->enetaddr); } else { printf("blanche: Couldn't get eth device\n"); rc = -1; diff --git a/board/renesas/ecovec/ecovec.c b/board/renesas/ecovec/ecovec.c index 28b557a5b0..e4bb440d24 100644 --- a/board/renesas/ecovec/ecovec.c +++ b/board/renesas/ecovec/ecovec.c @@ -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); diff --git a/board/renesas/gose/gose.c b/board/renesas/gose/gose.c index 359f95e264..54e126985b 100644 --- a/board/renesas/gose/gose.c +++ b/board/renesas/gose/gose.c @@ -126,7 +126,7 @@ int board_eth_init(bd_t *bis) #ifdef CONFIG_SH_ETHER ret = sh_eth_initialize(bis); - if (!eth_getenv_enetaddr("ethaddr", enetaddr)) + if (!eth_env_get_enetaddr("ethaddr", enetaddr)) return ret; /* Set Mac address */ diff --git a/board/renesas/koelsch/koelsch.c b/board/renesas/koelsch/koelsch.c index dd62145ac9..8fa648e40a 100644 --- a/board/renesas/koelsch/koelsch.c +++ b/board/renesas/koelsch/koelsch.c @@ -131,7 +131,7 @@ int board_eth_init(bd_t *bis) unsigned char enetaddr[6]; ret = sh_eth_initialize(bis); - if (!eth_getenv_enetaddr("ethaddr", enetaddr)) + if (!eth_env_get_enetaddr("ethaddr", enetaddr)) return ret; /* Set Mac address */ diff --git a/board/renesas/lager/lager.c b/board/renesas/lager/lager.c index 2ada816006..562be04760 100644 --- a/board/renesas/lager/lager.c +++ b/board/renesas/lager/lager.c @@ -136,7 +136,7 @@ int board_eth_init(bd_t *bis) unsigned char enetaddr[6]; ret = sh_eth_initialize(bis); - if (!eth_getenv_enetaddr("ethaddr", enetaddr)) + if (!eth_env_get_enetaddr("ethaddr", enetaddr)) return ret; /* Set Mac address */ diff --git a/board/renesas/porter/porter.c b/board/renesas/porter/porter.c index 926a657511..5b1a167906 100644 --- a/board/renesas/porter/porter.c +++ b/board/renesas/porter/porter.c @@ -126,7 +126,7 @@ int board_eth_init(bd_t *bis) unsigned char enetaddr[6]; ret = sh_eth_initialize(bis); - if (!eth_getenv_enetaddr("ethaddr", enetaddr)) + if (!eth_env_get_enetaddr("ethaddr", enetaddr)) return ret; /* Set Mac address */ diff --git a/board/renesas/sh7752evb/sh7752evb.c b/board/renesas/sh7752evb/sh7752evb.c index 525d979724..4a76fb73ee 100644 --- a/board/renesas/sh7752evb/sh7752evb.c +++ b/board/renesas/sh7752evb/sh7752evb.c @@ -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); } diff --git a/board/renesas/sh7753evb/sh7753evb.c b/board/renesas/sh7753evb/sh7753evb.c index 3d1eedaa5f..ca9e144743 100644 --- a/board/renesas/sh7753evb/sh7753evb.c +++ b/board/renesas/sh7753evb/sh7753evb.c @@ -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); } diff --git a/board/renesas/sh7757lcr/sh7757lcr.c b/board/renesas/sh7757lcr/sh7757lcr.c index 0a04a9d39d..3f970fc401 100644 --- a/board/renesas/sh7757lcr/sh7757lcr.c +++ b/board/renesas/sh7757lcr/sh7757lcr.c @@ -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); } diff --git a/board/renesas/silk/silk.c b/board/renesas/silk/silk.c index e13a38f5ea..a8de402d20 100644 --- a/board/renesas/silk/silk.c +++ b/board/renesas/silk/silk.c @@ -135,7 +135,7 @@ int board_eth_init(bd_t *bis) unsigned char enetaddr[6]; ret = sh_eth_initialize(bis); - if (!eth_getenv_enetaddr("ethaddr", enetaddr)) + if (!eth_env_get_enetaddr("ethaddr", enetaddr)) return ret; /* Set Mac address */ diff --git a/board/renesas/stout/stout.c b/board/renesas/stout/stout.c index fe8dd3d952..d681148273 100644 --- a/board/renesas/stout/stout.c +++ b/board/renesas/stout/stout.c @@ -137,7 +137,7 @@ int board_eth_init(bd_t *bis) unsigned char enetaddr[6]; ret = sh_eth_initialize(bis); - if (!eth_getenv_enetaddr("ethaddr", enetaddr)) + if (!eth_env_get_enetaddr("ethaddr", enetaddr)) return ret; /* Set Mac address */ diff --git a/board/rockchip/evb_px5/evb-px5.c b/board/rockchip/evb_px5/evb-px5.c index 6dca1fc74b..6a47642b57 100644 --- a/board/rockchip/evb_px5/evb-px5.c +++ b/board/rockchip/evb_px5/evb-px5.c @@ -4,30 +4,6 @@ * SPDX-License-Identifier: GPL-2.0+ */ #include <common.h> -#include <asm/io.h> -#include <fdtdec.h> -#include <asm/arch/clock.h> -#include <asm/arch/grf_rk3368.h> - -DECLARE_GLOBAL_DATA_PTR; - -int mach_cpu_init(void) -{ - struct rk3368_pmu_grf *pmugrf; - int node; - - node = fdt_node_offset_by_compatible(gd->fdt_blob, -1, "rockchip,rk3368-pmugrf"); - pmugrf = (struct rk3368_pmu_grf *)fdtdec_get_addr(gd->fdt_blob, node, "reg"); - - rk_clrsetreg(&pmugrf->gpio0d_iomux, - GPIO0D0_MASK | GPIO0D1_MASK | - GPIO0D2_MASK | GPIO0D3_MASK, - GPIO0D0_GPIO << GPIO0D0_SHIFT | - GPIO0D1_GPIO << GPIO0D1_SHIFT | - GPIO0D2_UART4_SOUT << GPIO0D2_SHIFT | - GPIO0D3_UART4_SIN << GPIO0D3_SHIFT); - return 0; -} int board_init(void) { diff --git a/board/rockchip/kylin_rk3036/kylin_rk3036.c b/board/rockchip/kylin_rk3036/kylin_rk3036.c index 7e2edf4a56..9134994874 100644 --- a/board/rockchip/kylin_rk3036/kylin_rk3036.c +++ b/board/rockchip/kylin_rk3036/kylin_rk3036.c @@ -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; diff --git a/board/rockchip/tinker_rk3288/tinker-rk3288.c b/board/rockchip/tinker_rk3288/tinker-rk3288.c index c2872e7330..790a921515 100644 --- a/board/rockchip/tinker_rk3288/tinker-rk3288.c +++ b/board/rockchip/tinker_rk3288/tinker-rk3288.c @@ -29,7 +29,7 @@ int rk_board_late_init(void) return 0; if (is_valid_ethaddr(ethaddr)) - eth_setenv_enetaddr("ethaddr", ethaddr); + eth_env_set_enetaddr("ethaddr", ethaddr); return 0; } diff --git a/board/samsung/common/exynos5-dt.c b/board/samsung/common/exynos5-dt.c index 44f412db5d..ae2a6e6bfa 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/common/misc.c b/board/samsung/common/misc.c index b18eed2fac..4157349d02 100644 --- a/board/samsung/common/misc.c +++ b/board/samsung/common/misc.c @@ -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 */ diff --git a/board/samsung/odroid/odroid.c b/board/samsung/odroid/odroid.c index b4cb33240e..e40a2f6e3a 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/samsung/trats/trats.c b/board/samsung/trats/trats.c index 00059a1317..f0913383b9 100644 --- a/board/samsung/trats/trats.c +++ b/board/samsung/trats/trats.c @@ -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 diff --git a/board/samsung/universal_c210/universal.c b/board/samsung/universal_c210/universal.c index cc6eaf7ad0..549ac8b48a 100644 --- a/board/samsung/universal_c210/universal.c +++ b/board/samsung/universal_c210/universal.c @@ -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 diff --git a/board/samtec/vining_2000/vining_2000.c b/board/samtec/vining_2000/vining_2000.c index 5c8b436776..af1a3e75cb 100644 --- a/board/samtec/vining_2000/vining_2000.c +++ b/board/samtec/vining_2000/vining_2000.c @@ -131,8 +131,8 @@ 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)) - eth_setenv_enetaddr("eth1addr", 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)); @@ -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; } diff --git a/board/samtec/vining_fpga/socfpga.c b/board/samtec/vining_fpga/socfpga.c index f888ecbbc1..229b12f308 100644 --- a/board/samtec/vining_fpga/socfpga.c +++ b/board/samtec/vining_fpga/socfpga.c @@ -69,31 +69,31 @@ 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; } /* 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); memset(str, 0, sizeof(str)); sprintf(str, "%07i", serial); - setenv("unit_serial", str); + env_set("unit_serial", str); } - if (!getenv("unit_ident")) { + if (!env_get("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. */ - if (!getenv("ethaddr") && is_valid_ethaddr(&data[0x62])) - eth_setenv_enetaddr("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 b967227411..65fa6af2d4 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/common/factoryset.c b/board/siemens/common/factoryset.c index 6c869ed2b0..b4f027af28 100644 --- a/board/siemens/common/factoryset.c +++ b/board/siemens/common/factoryset.c @@ -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]; @@ -292,15 +292,15 @@ static int factoryset_mac_setenv(void) } } - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); 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; diff --git a/board/siemens/common/factoryset.h b/board/siemens/common/factoryset.h index 3f23d5ebf4..8602627d2e 100644 --- a/board/siemens/common/factoryset.h +++ b/board/siemens/common/factoryset.h @@ -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 */ diff --git a/board/siemens/draco/board.c b/board/siemens/draco/board.c index d8869a09dd..c705b5ab0f 100644 --- a/board/siemens/draco/board.c +++ b/board/siemens/draco/board.c @@ -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); diff --git a/board/siemens/pxm2/board.c b/board/siemens/pxm2/board.c index 750f338897..8bbb03561b 100644 --- a/board/siemens/pxm2/board.c +++ b/board/siemens/pxm2/board.c @@ -225,7 +225,7 @@ int board_eth_init(bd_t *bis) if (!is_valid_ethaddr(factory_dat.mac)) printf("Error: no valid mac address\n"); else - eth_setenv_enetaddr("ethaddr", factory_dat.mac); + eth_env_set_enetaddr("ethaddr", factory_dat.mac); #endif /* #ifdef CONFIG_FACTORYSET */ /* Set rgmii mode and enable rmii clock to be sourced from chip */ @@ -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"); } diff --git a/board/siemens/rut/board.c b/board/siemens/rut/board.c index b3c666c054..2a97414baf 100644 --- a/board/siemens/rut/board.c +++ b/board/siemens/rut/board.c @@ -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"); diff --git a/board/siemens/taurus/taurus.c b/board/siemens/taurus/taurus.c index 4aa8d64869..8390bdd5f8 100644 --- a/board/siemens/taurus/taurus.c +++ b/board/siemens/taurus/taurus.c @@ -15,6 +15,7 @@ #include <command.h> #include <common.h> #include <dm.h> +#include <environment.h> #include <asm/io.h> #include <asm/arch/at91sam9260_matrix.h> #include <asm/arch/at91sam9_smc.h> @@ -376,36 +377,36 @@ 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') - 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; } - rootfs = getenv("rootfs"); - rootfs_fallback = getenv("rootfs_fallback"); - setenv("rootfs", rootfs_fallback); - setenv("rootfs_fallback", rootfs); + 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"); - setenv("kernel_size", kern_size_fb); - setenv("kernel_size_fallback", kern_size); + 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"); - setenv("kernel_Off", kern_off_fb); - setenv("kernel_Off_fallback", kern_off); + 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); - setenv("bootargs", '\0'); - setenv("upgrade_available", '\0'); - setenv("boot_retries", '\0'); - saveenv(); + env_set("bootargs", '\0'); + env_set("upgrade_available", '\0'); + env_set("boot_retries", '\0'); + env_save(); return 0; } @@ -417,14 +418,14 @@ 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); - setenv("boot_retries", boot_buf); - saveenv(); + env_set("boot_retries", boot_buf); + env_save(); /* * Here the boot_retries count is checked, and if the diff --git a/board/silica/pengwyn/board.c b/board/silica/pengwyn/board.c index 1f5a5868cb..0429e6f0c7 100644 --- a/board/silica/pengwyn/board.c +++ b/board/silica/pengwyn/board.c @@ -171,7 +171,7 @@ int board_eth_init(bd_t *bis) uint8_t mac_addr[6]; uint32_t mac_hi, mac_lo; - if (!eth_getenv_enetaddr("ethaddr", mac_addr)) { + if (!eth_env_get_enetaddr("ethaddr", mac_addr)) { printf("<ethaddr> not set. Reading from E-fuse\n"); /* try reading mac address from efuse */ mac_lo = readl(&cdev->macid0l); @@ -184,7 +184,7 @@ int board_eth_init(bd_t *bis) mac_addr[5] = (mac_lo & 0xFF00) >> 8; if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); else return n; } diff --git a/board/socrates/socrates.c b/board/socrates/socrates.c index fb691c22d9..004f37009a 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/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c index 1ccdfa8e05..7e59fb259e 100644 --- a/board/solidrun/mx6cuboxi/mx6cuboxi.c +++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c @@ -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; diff --git a/board/spear/common/spr_misc.c b/board/spear/common/spr_misc.c index d6a84dba60..a02304f49e 100644 --- a/board/spear/common/spr_misc.c +++ b/board/spear/common/spr_misc.c @@ -53,15 +53,15 @@ int misc_init_r(void) #if defined(CONFIG_CMD_NET) uchar mac_id[6]; - if (!eth_getenv_enetaddr("ethaddr", mac_id) && !i2c_read_mac(mac_id)) - eth_setenv_enetaddr("ethaddr", mac_id); + if (!eth_env_get_enetaddr("ethaddr", mac_id) && !i2c_read_mac(mac_id)) + eth_env_set_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(); diff --git a/board/spear/x600/Kconfig b/board/spear/x600/Kconfig index 6a1c5c7b40..59f2b1ef56 100644 --- a/board/spear/x600/Kconfig +++ b/board/spear/x600/Kconfig @@ -1,5 +1,8 @@ if TARGET_X600 +config SPL_LDSCRIPT + default "arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds" + config SYS_BOARD default "x600" diff --git a/board/st/stm32f429-discovery/stm32f429-discovery.c b/board/st/stm32f429-discovery/stm32f429-discovery.c index 8c8abf6a06..d6763c306f 100644 --- a/board/st/stm32f429-discovery/stm32f429-discovery.c +++ b/board/st/stm32f429-discovery/stm32f429-discovery.c @@ -314,13 +314,13 @@ 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); sprintf(serialno, "%08x%08x%08x", u_id_high, u_id_mid, u_id_low); - setenv("serial#", serialno); + env_set("serial#", serialno); } return 0; diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 800f412b38..70e01437c4 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); @@ -646,7 +646,7 @@ static void parse_spl_header(const uint32_t spl_addr) return; } /* otherwise assume .scr format (mkimage-type script) */ - setenv_hex("fel_scriptaddr", spl->fel_script_address); + env_set_hex("fel_scriptaddr", spl->fel_script_address); } /* @@ -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 */ @@ -705,14 +705,14 @@ static void setup_environment(const void *fdt) mac_addr[4] = (sid[3] >> 8) & 0xff; mac_addr[5] = (sid[3] >> 0) & 0xff; - eth_setenv_enetaddr(ethaddr, mac_addr); + 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]); - 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); } diff --git a/board/syteco/zmx25/zmx25.c b/board/syteco/zmx25/zmx25.c index bdbf02a067..85fda13188 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)); @@ -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"); } } diff --git a/board/tcl/sl50/board.c b/board/tcl/sl50/board.c index e89ee35d30..f79bb9dcdd 100644 --- a/board/tcl/sl50/board.c +++ b/board/tcl/sl50/board.c @@ -76,8 +76,8 @@ int spl_start_uboot(void) #ifdef CONFIG_SPL_ENV_SUPPORT env_init(); - env_relocate_spec(); - if (getenv_yesno("boot_os") != 1) + env_load(); + if (env_get_yesno("boot_os") != 1) return 1; #endif @@ -322,11 +322,11 @@ 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)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); } #ifdef CONFIG_DRIVER_TI_CPSW @@ -340,9 +340,9 @@ 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_setenv_enetaddr("eth1addr", mac_addr); + eth_env_set_enetaddr("eth1addr", mac_addr); } @@ -373,7 +373,7 @@ int board_eth_init(bd_t *bis) #if defined(CONFIG_USB_ETHER) && \ (!defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_USBETH_SUPPORT)) if (is_valid_ether_addr(mac_addr)) - eth_setenv_enetaddr("usbnet_devaddr", mac_addr); + eth_env_set_enetaddr("usbnet_devaddr", mac_addr); rv = usb_eth_initialize(bis); if (rv < 0) diff --git a/board/technexion/twister/twister.c b/board/technexion/twister/twister.c index 25aeebc8d0..8c38f14cde 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/technologic/ts4800/ts4800.c b/board/technologic/ts4800/ts4800.c index 94251c6d91..8fe26a75e8 100644 --- a/board/technologic/ts4800/ts4800.c +++ b/board/technologic/ts4800/ts4800.c @@ -178,7 +178,7 @@ static int fec_get_mac_from_register(uint32_t base_addr) ethaddr[i] = (reg_mac[i / 4] >> ((i % 4) * 8)) & 0xFF; if (is_valid_ethaddr(ethaddr)) { - eth_setenv_enetaddr("ethaddr", ethaddr); + eth_env_set_enetaddr("ethaddr", ethaddr); return 0; } diff --git a/board/teejet/mt_ventoux/mt_ventoux.c b/board/teejet/mt_ventoux/mt_ventoux.c index 6e73ae114a..9eaae50f27 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/lion_rk3368/Kconfig b/board/theobroma-systems/lion_rk3368/Kconfig new file mode 100644 index 0000000000..d7aa487abd --- /dev/null +++ b/board/theobroma-systems/lion_rk3368/Kconfig @@ -0,0 +1,15 @@ +if TARGET_LION_RK3368 + +config SYS_BOARD + default "lion_rk3368" + +config SYS_VENDOR + default "theobroma-systems" + +config SYS_CONFIG_NAME + default "lion_rk3368" + +config BOARD_SPECIFIC_OPTIONS # dummy + def_bool y + +endif diff --git a/board/theobroma-systems/lion_rk3368/MAINTAINERS b/board/theobroma-systems/lion_rk3368/MAINTAINERS new file mode 100644 index 0000000000..857f784d21 --- /dev/null +++ b/board/theobroma-systems/lion_rk3368/MAINTAINERS @@ -0,0 +1,10 @@ +LION-RK3368 (RK3368-uQ7 system-on-module) +M: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> +M: Klaus Goger <klaus.goger@theobroma-systems.com> +S: Maintained +F: board/theobroma-systems/lion_rk3368 +F: include/configs/lion_rk3368.h +F: arch/arm/dts/rk3368-lion.dts +F: configs/lion-rk3368_defconfig +W: https://www.theobroma-systems.com/rk3368-uq7/tech-specs +T: git git://git.theobroma-systems.com/lion-u-boot.git diff --git a/board/theobroma-systems/lion_rk3368/Makefile b/board/theobroma-systems/lion_rk3368/Makefile new file mode 100644 index 0000000000..f13a20b21e --- /dev/null +++ b/board/theobroma-systems/lion_rk3368/Makefile @@ -0,0 +1,7 @@ +# +# Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += lion_rk3368.o diff --git a/board/theobroma-systems/lion_rk3368/README b/board/theobroma-systems/lion_rk3368/README new file mode 100644 index 0000000000..47304fcba6 --- /dev/null +++ b/board/theobroma-systems/lion_rk3368/README @@ -0,0 +1,60 @@ +Here is the step-by-step to boot to U-Boot on RK3368-uQ7 + +Get the Source and build ATF +============================ + + > git clone git://git.theobroma-systems.com/arm-trusted-firmware.git + > cd arm-trusted-firmware + > make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3368 bl31 + > cp build/rk3368/release/bl31.bin ../u-boot/bl31-rk3368.bin + +Configure U-Boot +================ + + > cd ../u-boot + > make lion-rk3368_defconfig + +Build the TPL/SPL stage +======================= + + > make CROSS_COMPILE=aarch64-unknown-elf- ARCH=arm + > tools/mkimage -n rk3368 -T rksd -d tpl/u-boot-tpl.bin spl-3368.img + > cat spl/u-boot-spl-dtb.bin >> spl-3368.img + +Build the full U-Boot and a FIT image including the ATF +======================================================= + + > make CROSS_COMPILE=aarch64-unknown-elf- ARCH=arm u-boot.itb + +Write to a SD-card +================== + + > dd if=spl-3368.img of=/dev/sdb seek=64 + > dd if=u-boot.itb of=/dev/sdb seek=512 + + +If everything went according to plan, you should see the following +output on UART0: + +<debug_uart> U-Boot TPL board init +Trying to boot from BOOTROM +Returning to boot ROM... +Trying to boot from MMC1 +NOTICE: BL31: v1.3(release):v1.2-1320-gbf43a443 +NOTICE: BL31: Built : 18:04:47, Jul 5 2017 + + +U-Boot 2017.07-00158-g2395e99858 (Jul 18 2017 - 21:03:31 +0200) + +Model: Theobroma Systems RK3368-uQ7 SoM +DRAM: 2 GiB +MMC: dwmmc@ff0c0000: 1, dwmmc@ff0f0000: 0 +Using default environment + +In: serial@ff180000 +Out: serial@ff180000 +Err: serial@ff180000 +Net: +Warning: ethernet@ff290000 (eth0) using random MAC address - d2:69:35:7e:d0:1e +eth0: ethernet@ff290000 +Hit any key to stop autoboot: 2 diff --git a/board/theobroma-systems/lion_rk3368/fit_spl_atf.its b/board/theobroma-systems/lion_rk3368/fit_spl_atf.its new file mode 100644 index 0000000000..405750f351 --- /dev/null +++ b/board/theobroma-systems/lion_rk3368/fit_spl_atf.its @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2017 Theobroma Systems Design und Consulting GmbH + * + * Minimal dts for a SPL FIT image payload. + * + * SPDX-License-Identifier: GPL-2.0+ X11 + */ + +/dts-v1/; + +/ { + description = "FIT image with U-Boot proper, ATF bl31, DTB"; + #address-cells = <1>; + + images { + uboot { + description = "U-Boot (64-bit)"; + data = /incbin/("../../../u-boot-nodtb.bin"); + type = "standalone"; + arch = "arm64"; + compression = "none"; + load = <0x00200000>; + }; + atf { + description = "ARM Trusted Firmware"; + data = /incbin/("../../../bl31-rk3368.bin"); + type = "firmware"; + arch = "arm64"; + compression = "none"; + load = <0x00010000>; + entry = <0x00010000>; + }; + + fdt { + description = "RK3368-uQ7 (Lion) flat device-tree"; + data = /incbin/("../../../u-boot.dtb"); + type = "flat_dt"; + compression = "none"; + }; + }; + + configurations { + default = "conf"; + conf { + description = "Theobroma Systems RK3368-uQ7 (Puma) SoM"; + firmware = "uboot"; + loadables = "atf"; + fdt = "fdt"; + }; + }; +}; diff --git a/board/theobroma-systems/lion_rk3368/lion_rk3368.c b/board/theobroma-systems/lion_rk3368/lion_rk3368.c new file mode 100644 index 0000000000..73b14883c3 --- /dev/null +++ b/board/theobroma-systems/lion_rk3368/lion_rk3368.c @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH + * + * SPDX-License-Identifier: GPL-2.0+ + */ +#include <common.h> +#include <dm.h> +#include <ram.h> +#include <asm/io.h> +#include <asm/arch/clock.h> +#include <asm/arch/grf_rk3368.h> +#include <asm/arch/timer.h> +#include <syscon.h> + +DECLARE_GLOBAL_DATA_PTR; + +int mach_cpu_init(void) +{ + return 0; +} + +int board_init(void) +{ + return 0; +} diff --git a/board/theobroma-systems/puma_rk3399/README b/board/theobroma-systems/puma_rk3399/README index 250e3459a3..214281a329 100644 --- a/board/theobroma-systems/puma_rk3399/README +++ b/board/theobroma-systems/puma_rk3399/README @@ -37,7 +37,7 @@ Compile the ATF > cd arm-trusted-firmware > make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 bl31 - > cp build/rk3399/release/bl31.bin ../u-boot + > cp build/rk3399/release/bl31.bin ../u-boot/bl31-rk3399.bin Compile the M0 firmware ======================= diff --git a/board/theobroma-systems/puma_rk3399/fit_spl_atf.its b/board/theobroma-systems/puma_rk3399/fit_spl_atf.its index f93c251927..520f846d66 100644 --- a/board/theobroma-systems/puma_rk3399/fit_spl_atf.its +++ b/board/theobroma-systems/puma_rk3399/fit_spl_atf.its @@ -13,7 +13,7 @@ #address-cells = <1>; images { - uboot@1 { + uboot { description = "U-Boot (64-bit)"; data = /incbin/("../../../u-boot-nodtb.bin"); type = "standalone"; @@ -21,23 +21,23 @@ compression = "none"; load = <0x00200000>; }; - atf@1 { + atf { description = "ARM Trusted Firmware"; - data = /incbin/("../../../bl31.bin"); + data = /incbin/("../../../bl31-rk3399.bin"); type = "firmware"; arch = "arm64"; compression = "none"; load = <0x00001000>; entry = <0x00001000>; }; - pmu@1 { + pmu { description = "Cortex-M0 firmware"; data = /incbin/("../../../rk3399m0.bin"); type = "pmu-firmware"; compression = "none"; load = <0xff8c0000>; }; - fdt@1 { + fdt { description = "RK3399-Q7 (Puma) flat device-tree"; data = /incbin/("../../../u-boot.dtb"); type = "flat_dt"; @@ -46,12 +46,12 @@ }; configurations { - default = "conf@1"; - conf@1 { + default = "conf"; + conf { description = "Theobroma Systems RK3399-Q7 (Puma) SoM"; - firmware = "uboot@1"; - loadables = "atf@1"; - fdt = "fdt@1"; + firmware = "uboot"; + loadables = "atf"; + fdt = "fdt"; }; }; }; diff --git a/board/theobroma-systems/puma_rk3399/puma-rk3399.c b/board/theobroma-systems/puma_rk3399/puma-rk3399.c index 9347329eac..c6f8eed0c9 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) { @@ -89,7 +89,7 @@ static void setup_macaddr(void) /* Make this a valid MAC address and set it */ mac_addr[0] &= 0xfe; /* clear multicast bit */ mac_addr[0] |= 0x02; /* set local assignment bit (IEEE802) */ - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); #endif return; @@ -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; @@ -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 0a16529b5f..1a52bffc00 100644 --- a/board/ti/am335x/board.c +++ b/board/ti/am335x/board.c @@ -249,8 +249,8 @@ int spl_start_uboot(void) #ifdef CONFIG_SPL_ENV_SUPPORT env_init(); - env_relocate_spec(); - if (getenv_yesno("boot_os") != 1) + env_load(); + if (env_get_yesno("boot_os") != 1) return 1; #endif @@ -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) @@ -745,11 +745,11 @@ 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)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); } mac_lo = readl(&cdev->macid1l); @@ -761,9 +761,9 @@ 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_setenv_enetaddr("eth1addr", mac_addr); + eth_env_set_enetaddr("eth1addr", mac_addr); } #endif @@ -908,7 +908,7 @@ int board_eth_init(bd_t *bis) #if defined(CONFIG_USB_ETHER) && \ (!defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_USBETH_SUPPORT)) if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("usbnet_devaddr", mac_addr); + eth_env_set_enetaddr("usbnet_devaddr", mac_addr); rv = usb_eth_initialize(bis); if (rv < 0) diff --git a/board/ti/am3517crane/am3517crane.c b/board/ti/am3517crane/am3517crane.c index 5fa319d615..136cc43884 100644 --- a/board/ti/am3517crane/am3517crane.c +++ b/board/ti/am3517crane/am3517crane.c @@ -43,7 +43,7 @@ int board_init(void) */ int misc_init_r(void) { -#ifdef CONFIG_SYS_I2C_OMAP34XX +#ifdef CONFIG_SYS_I2C_OMAP24XX i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE); #endif diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c index 933596d59c..2c417e7545 100644 --- a/board/ti/am43xx/board.c +++ b/board/ti/am43xx/board.c @@ -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; } @@ -791,10 +791,10 @@ 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_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); } mac_lo = readl(&cdev->macid1l); @@ -806,9 +806,9 @@ 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_setenv_enetaddr("eth1addr", mac_addr); + eth_env_set_enetaddr("eth1addr", mac_addr); } if (board_is_eposevm()) { diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c index 00a31a97fd..7e7056cf71 100644 --- a/board/ti/am57xx/board.c +++ b/board/ti/am57xx/board.c @@ -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 @@ -742,8 +742,8 @@ int spl_start_uboot(void) #ifdef CONFIG_SPL_ENV_SUPPORT env_init(); - env_relocate_spec(); - if (getenv_yesno("boot_os") != 1) + env_load(); + if (env_get_yesno("boot_os") != 1) return 1; #endif @@ -933,11 +933,11 @@ 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)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); } mac_lo = readl((*ctrl)->control_core_mac_id_1_lo); @@ -949,9 +949,9 @@ 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_setenv_enetaddr("eth1addr", mac_addr); + eth_env_set_enetaddr("eth1addr", mac_addr); } ctrl_val = readl((*ctrl)->control_core_control_io1) & (~0x33); @@ -986,9 +986,9 @@ int board_eth_init(bd_t *bis) for (i = 0; i < num_macs; i++) { u64_to_mac(mac1 + i, mac_addr); if (is_valid_ethaddr(mac_addr)) { - eth_setenv_enetaddr_by_index("eth", - i + 2, - mac_addr); + eth_env_set_enetaddr_by_index("eth", + i + 2, + mac_addr); } } } diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c index 887b577b6a..2f62fbec69 100644 --- a/board/ti/beagle/beagle.c +++ b/board/ti/beagle/beagle.c @@ -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()) { diff --git a/board/ti/common/Kconfig b/board/ti/common/Kconfig index c81baa12be..c21eb8c2d2 100644 --- a/board/ti/common/Kconfig +++ b/board/ti/common/Kconfig @@ -42,4 +42,3 @@ config TI_COMMON_CMD_OPTIONS imply CMD_SPI imply CMD_TIME imply CMD_USB if USB - imply ENV_IS_IN_FAT if MMC_OMAP_HS diff --git a/board/ti/common/board_detect.c b/board/ti/common/board_detect.c index 1da5ace923..6f07ec331a 100644 --- a/board/ti/common/board_detect.c +++ b/board/ti/common/board_detect.c @@ -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]) @@ -451,8 +451,8 @@ void board_ti_set_ethaddr(int index) for (i = 0; i < num_macs; i++) { u64_to_mac(mac1 + i, mac_addr); if (is_valid_ethaddr(mac_addr)) { - eth_setenv_enetaddr_by_index("eth", i + index, - mac_addr); + eth_env_set_enetaddr_by_index("eth", i + index, + mac_addr); } } } diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c index 7d36f03fa1..93d3d0b54e 100644 --- a/board/ti/dra7xx/evm.c +++ b/board/ti/dra7xx/evm.c @@ -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(); @@ -825,8 +825,8 @@ int spl_start_uboot(void) #ifdef CONFIG_SPL_ENV_SUPPORT env_init(); - env_relocate_spec(); - if (getenv_yesno("boot_os") != 1) + env_load(); + if (env_get_yesno("boot_os") != 1) return 1; #endif @@ -893,11 +893,11 @@ 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)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); } mac_lo = readl((*ctrl)->control_core_mac_id_1_lo); @@ -909,9 +909,9 @@ 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_setenv_enetaddr("eth1addr", mac_addr); + eth_env_set_enetaddr("eth1addr", mac_addr); } ctrl_val = readl((*ctrl)->control_core_control_io1) & (~0x33); diff --git a/board/ti/evm/MAINTAINERS b/board/ti/evm/MAINTAINERS index 612a08ace0..cd315c1635 100644 --- a/board/ti/evm/MAINTAINERS +++ b/board/ti/evm/MAINTAINERS @@ -1,5 +1,5 @@ EVM BOARD -M: Tom Rini <trini@konsulko.com> +M: Derald D. Woods <woods.technical@gmail.com> S: Maintained F: board/ti/evm/ F: include/configs/omap3_evm.h diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c index fe8e79312f..6bf57f9269 100644 --- a/board/ti/evm/evm.c +++ b/board/ti/evm/evm.c @@ -12,6 +12,8 @@ * SPDX-License-Identifier: GPL-2.0+ */ #include <common.h> +#include <dm.h> +#include <ns16550.h> #include <netdev.h> #include <asm/io.h> #include <asm/arch/mem.h> @@ -22,14 +24,35 @@ #include <i2c.h> #include <twl4030.h> #include <asm/mach-types.h> +#include <asm/omap_musb.h> #include <linux/mtd/nand.h> +#include <linux/usb/ch9.h> +#include <linux/usb/gadget.h> +#include <linux/usb/musb.h> #include "evm.h" -#define OMAP3EVM_GPIO_ETH_RST_GEN1 64 -#define OMAP3EVM_GPIO_ETH_RST_GEN2 7 +#ifdef CONFIG_USB_EHCI_HCD +#include <usb.h> +#include <asm/ehci-omap.h> +#endif + +#define OMAP3EVM_GPIO_ETH_RST_GEN1 64 +#define OMAP3EVM_GPIO_ETH_RST_GEN2 7 DECLARE_GLOBAL_DATA_PTR; +static const struct ns16550_platdata omap3_evm_serial = { + .base = OMAP34XX_UART1, + .reg_shift = 2, + .clock = V_NS16550_CLK, + .fcr = UART_FCR_DEFVAL, +}; + +U_BOOT_DEVICE(omap3_evm_uart) = { + "ns16550_serial", + &omap3_evm_serial +}; + static u32 omap3_evm_version; u32 get_omap3_evm_rev(void) @@ -60,25 +83,19 @@ static void omap3_evm_get_revision(void) default: omap3_evm_version = OMAP3EVM_BOARD_GEN_2; } -#else +#else /* !CONFIG_CMD_NET */ #if defined(CONFIG_STATIC_BOARD_REV) - /* - * Look for static defintion of the board revision - */ + /* Look for static defintion of the board revision */ omap3_evm_version = CONFIG_STATIC_BOARD_REV; #else - /* - * Fallback to the default above. - */ + /* Fallback to the default above */ omap3_evm_version = OMAP3EVM_BOARD_GEN_2; -#endif -#endif /* CONFIG_CMD_NET */ +#endif /* CONFIG_STATIC_BOARD_REV */ +#endif /* CONFIG_CMD_NET */ } -#ifdef CONFIG_USB_OMAP3 -/* - * MUSB port on OMAP3EVM Rev >= E requires extvbus programming. - */ +#if defined(CONFIG_USB_MUSB_GADGET) || defined(CONFIG_USB_MUSB_HOST) +/* MUSB port on OMAP3EVM Rev >= E requires extvbus programming. */ u8 omap3_evm_need_extvbus(void) { u8 retval = 0; @@ -88,7 +105,7 @@ u8 omap3_evm_need_extvbus(void) return retval; } -#endif +#endif /* CONFIG_USB_MUSB_{GADGET,HOST} */ /* * Routine: board_init @@ -105,7 +122,7 @@ int board_init(void) return 0; } -#ifdef CONFIG_SPL_BUILD +#if defined(CONFIG_SPL_BUILD) /* * Routine: get_board_mem_timings * Description: If we use SPL then there is no x-loader nor config header @@ -138,7 +155,34 @@ void get_board_mem_timings(struct board_sdrc_timings *timings) timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz; timings->mr = MICRON_V_MR_165; } -#endif +#endif /* CONFIG_SPL_BUILD */ + +#if defined(CONFIG_USB_MUSB_OMAP2PLUS) +static struct musb_hdrc_config musb_config = { + .multipoint = 1, + .dyn_fifo = 1, + .num_eps = 16, + .ram_bits = 12, +}; + +static struct omap_musb_board_data musb_board_data = { + .interface_type = MUSB_INTERFACE_ULPI, +}; + +static struct musb_hdrc_platform_data musb_plat = { +#if defined(CONFIG_USB_MUSB_HOST) + .mode = MUSB_HOST, +#elif defined(CONFIG_USB_MUSB_GADGET) + .mode = MUSB_PERIPHERAL, +#else +#error "Please define either CONFIG_USB_MUSB_HOST or CONFIG_USB_MUSB_GADGET" +#endif /* CONFIG_USB_MUSB_{GADGET,HOST} */ + .config = &musb_config, + .power = 100, + .platform_ops = &omap2430_ops, + .board_data = &musb_board_data, +}; +#endif /* CONFIG_USB_MUSB_OMAP2PLUS */ /* * Routine: misc_init_r @@ -146,8 +190,9 @@ void get_board_mem_timings(struct board_sdrc_timings *timings) */ int misc_init_r(void) { + twl4030_power_init(); -#ifdef CONFIG_SYS_I2C_OMAP34XX +#ifdef CONFIG_SYS_I2C_OMAP24XX i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE); #endif @@ -161,6 +206,13 @@ int misc_init_r(void) #endif omap_die_id_display(); +#if defined(CONFIG_USB_MUSB_OMAP2PLUS) + musb_register(&musb_plat, &musb_board_data, (void *)MUSB_BASE); +#endif + +#if defined(CONFIG_USB_ETHER) && defined(CONFIG_USB_MUSB_GADGET) + omap_die_id_usbethaddr(); +#endif return 0; } @@ -175,7 +227,7 @@ void set_muxconf_regs(void) MUX_EVM(); } -#ifdef CONFIG_CMD_NET +#if defined(CONFIG_CMD_NET) /* * Routine: setup_net_chip * Description: Setting up the configuration GPMC registers specific to the @@ -237,7 +289,7 @@ static void reset_net_chip(void) int board_eth_init(bd_t *bis) { int rc = 0; -#ifdef CONFIG_SMC911X +#if defined(CONFIG_SMC911X) #define STR_ENV_ETHADDR "ethaddr" struct eth_device *dev; @@ -245,16 +297,16 @@ int board_eth_init(bd_t *bis) rc = smc911x_initialize(0, CONFIG_SMC911X_BASE); - if (!eth_getenv_enetaddr(STR_ENV_ETHADDR, eth_addr)) { + if (!eth_env_get_enetaddr(STR_ENV_ETHADDR, eth_addr)) { dev = eth_get_dev_by_index(0); if (dev) { - eth_setenv_enetaddr(STR_ENV_ETHADDR, dev->enetaddr); + eth_env_set_enetaddr(STR_ENV_ETHADDR, dev->enetaddr); } else { printf("omap3evm: Couldn't get eth device\n"); rc = -1; } } -#endif +#endif /* CONFIG_SMC911X */ return rc; } #endif /* CONFIG_CMD_NET */ @@ -264,11 +316,35 @@ int board_mmc_init(bd_t *bis) { return omap_mmc_init(0, 0, 0, -1, -1); } -#endif -#if defined(CONFIG_MMC) void board_mmc_power_init(void) { twl4030_power_mmc_init(0); } -#endif +#endif /* CONFIG_MMC */ + +#if defined(CONFIG_USB_EHCI_HCD) +static struct omap_usbhs_board_data usbhs_bdata = { + .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED, + .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, + .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED +}; + +int ehci_hcd_init(int index, enum usb_init_type init, + struct ehci_hccr **hccr, struct ehci_hcor **hcor) +{ + return omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor); +} + +int ehci_hcd_stop(int index) +{ + return omap_ehci_hcd_stop(); +} +#endif /* CONFIG_USB_EHCI_HCD */ + +#if defined(CONFIG_USB_ETHER) && defined(CONFIG_USB_MUSB_GADGET) && !defined(CONFIG_CMD_NET) +int board_eth_init(bd_t *bis) +{ + return usb_eth_initialize(bis); +} +#endif /* CONFIG_USB_ETHER */ diff --git a/board/ti/evm/evm.h b/board/ti/evm/evm.h index 91e9b88c54..0f8268b33e 100644 --- a/board/ti/evm/evm.h +++ b/board/ti/evm/evm.h @@ -278,12 +278,19 @@ static void reset_net_chip(void); /* TS_PEN_IRQ */\ MUX_VAL(CP(MCSPI1_CS2), (IEN | PTU | DIS | M4)) /*GPIO_176*/\ /* - LAN_INTR*/\ - MUX_VAL(CP(MCSPI1_CS3), (IEN | PTD | EN | M0)) /*McSPI1_CS3*/\ - MUX_VAL(CP(MCSPI2_CLK), (IEN | PTD | DIS | M0)) /*McSPI2_CLK*/\ - MUX_VAL(CP(MCSPI2_SIMO), (IEN | PTD | DIS | M0)) /*McSPI2_SIMO*/\ - MUX_VAL(CP(MCSPI2_SOMI), (IEN | PTD | DIS | M0)) /*McSPI2_SOMI*/\ - MUX_VAL(CP(MCSPI2_CS0), (IEN | PTD | EN | M0)) /*McSPI2_CS0*/\ - MUX_VAL(CP(MCSPI2_CS1), (IEN | PTD | EN | M0)) /*McSPI2_CS1*/\ + /* USB EHCI (port 2) */\ + MUX_VAL(CP(MCSPI1_CS3), (IEN | PTD | EN | M3)) /*HSUSB2_DATA2*/\ + MUX_VAL(CP(MCSPI2_CLK), (IEN | PTD | EN | M3)) /*HSUSB2_DATA7*/\ + MUX_VAL(CP(MCSPI2_SIMO), (IEN | PTD | EN | M3)) /*HSUSB2_DATA4*/\ + MUX_VAL(CP(MCSPI2_SOMI), (IEN | PTD | EN | M3)) /*HSUSB2_DATA5*/\ + MUX_VAL(CP(MCSPI2_CS0), (IEN | PTD | EN | M3)) /*HSUSB2_DATA6*/\ + MUX_VAL(CP(MCSPI2_CS1), (IEN | PTD | EN | M3)) /*HSUSB2_DATA3*/\ + MUX_VAL(CP(ETK_D10_ES2), (IDIS | PTD | DIS | M3)) /*HSUSB2_CLK*/\ + MUX_VAL(CP(ETK_D11_ES2), (IDIS | PTD | DIS | M3)) /*HSUSB2_STP*/\ + MUX_VAL(CP(ETK_D12_ES2), (IEN | PTD | EN | M3)) /*HSUSB2_DIR*/\ + MUX_VAL(CP(ETK_D13_ES2), (IEN | PTD | EN | M3)) /*HSUSB2_NXT*/\ + MUX_VAL(CP(ETK_D14_ES2), (IEN | PTD | EN | M3)) /*HSUSB2_DATA0*/\ + MUX_VAL(CP(ETK_D15_ES2), (IEN | PTD | EN | M3)) /*HSUSB2_DATA1*/\ /*Control and debug */\ MUX_VAL(CP(SYS_32K), (IEN | PTD | DIS | M0)) /*SYS_32K*/\ MUX_VAL(CP(SYS_CLKREQ), (IEN | PTD | DIS | M0)) /*SYS_CLKREQ*/\ @@ -318,12 +325,6 @@ static void reset_net_chip(void); MUX_VAL(CP(ETK_D7_ES2 ), (IEN | PTD | DIS | M0)) /*ETK_D7*/\ MUX_VAL(CP(ETK_D8_ES2 ), (IEN | PTD | DIS | M0)) /*ETK_D8*/\ MUX_VAL(CP(ETK_D9_ES2 ), (IEN | PTD | DIS | M0)) /*ETK_D9*/\ - MUX_VAL(CP(ETK_D10_ES2), (IEN | PTD | DIS | M0)) /*ETK_D10*/\ - MUX_VAL(CP(ETK_D11_ES2), (IEN | PTD | DIS | M0)) /*ETK_D11*/\ - MUX_VAL(CP(ETK_D12_ES2), (IEN | PTD | DIS | M0)) /*ETK_D12*/\ - MUX_VAL(CP(ETK_D13_ES2), (IEN | PTD | DIS | M0)) /*ETK_D13*/\ - MUX_VAL(CP(ETK_D14_ES2), (IEN | PTD | DIS | M0)) /*ETK_D14*/\ - MUX_VAL(CP(ETK_D15_ES2), (IEN | PTD | DIS | M0)) /*ETK_D15*/\ /*Die to Die */\ MUX_VAL(CP(D2D_MCAD1), (IEN | PTD | EN | M0)) /*d2d_mcad1*/\ MUX_VAL(CP(D2D_MCAD2), (IEN | PTD | EN | M0)) /*d2d_mcad2*/\ diff --git a/board/ti/ks2_evm/README b/board/ti/ks2_evm/README index 5430c7daf2..a26b7f8131 100644 --- a/board/ti/ks2_evm/README +++ b/board/ti/ks2_evm/README @@ -61,7 +61,7 @@ configs/k2g_evm_defconfig Supported boot modes: - SPI NOR boot - - AEMIF NAND boot + - AEMIF NAND boot (K2E, K2L and K2HK) - UART boot - MMC boot (Only on K2G) @@ -69,7 +69,7 @@ Supported image formats: - u-boot.bin: for loading and running u-boot.bin through Texas Instruments code composure studio (CCS) and for UART boot. - u-boot-spi.gph: gpimage for programming SPI NOR flash for SPI NOR boot - - MLO: gpimage for programming AEMIF NAND flash for NAND boot, MMC boot. + - MLO: gpimage for programming NAND flash for NAND boot, MMC boot. Build instructions: =================== diff --git a/board/ti/ks2_evm/board.c b/board/ti/ks2_evm/board.c index c61baeeb8c..ae86dfbe0a 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/ti/ks2_evm/board_k2g.c b/board/ti/ks2_evm/board_k2g.c index 21605762ef..15f0f54af6 100644 --- a/board/ti/ks2_evm/board_k2g.c +++ b/board/ti/ks2_evm/board_k2g.c @@ -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; } diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c index 6ffb53c4c6..c59e58a82a 100644 --- a/board/ti/panda/panda.c +++ b/board/ti/panda/panda.c @@ -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 } diff --git a/board/ti/ti814x/evm.c b/board/ti/ti814x/evm.c index 055a29d9c6..cdde6a8ca3 100644 --- a/board/ti/ti814x/evm.c +++ b/board/ti/ti814x/evm.c @@ -166,7 +166,7 @@ int board_eth_init(bd_t *bis) uint8_t mac_addr[6]; uint32_t mac_hi, mac_lo; - if (!eth_getenv_enetaddr("ethaddr", mac_addr)) { + if (!eth_env_get_enetaddr("ethaddr", mac_addr)) { printf("<ethaddr> not set. Reading from E-fuse\n"); /* try reading mac address from efuse */ mac_lo = readl(&cdev->macid0l); @@ -179,7 +179,7 @@ int board_eth_init(bd_t *bis) mac_addr[5] = (mac_lo & 0xFF00) >> 8; if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); else printf("Unable to read MAC address. Set <ethaddr>\n"); } diff --git a/board/ti/ti816x/evm.c b/board/ti/ti816x/evm.c index 9d6c3d6b5d..cb40cc5f47 100644 --- a/board/ti/ti816x/evm.c +++ b/board/ti/ti816x/evm.c @@ -38,7 +38,7 @@ int board_eth_init(bd_t *bis) uint32_t mac_hi, mac_lo; struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE; - if (!eth_getenv_enetaddr("ethaddr", mac_addr)) { + if (!eth_env_get_enetaddr("ethaddr", mac_addr)) { printf("<ethaddr> not set. Reading from E-fuse\n"); /* try reading mac address from efuse */ mac_lo = readl(&cdev->macid0l); @@ -51,7 +51,7 @@ int board_eth_init(bd_t *bis) mac_addr[5] = (mac_lo & 0xFF00) >> 8; if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); else printf("Unable to read MAC address. Set <ethaddr>\n"); } diff --git a/board/timll/devkit8000/devkit8000.c b/board/timll/devkit8000/devkit8000.c index d31eeb878a..741b3acce2 100644 --- a/board/timll/devkit8000/devkit8000.c +++ b/board/timll/devkit8000/devkit8000.c @@ -102,7 +102,7 @@ int misc_init_r(void) CONFIG_DM9000_BASE, GPMC_SIZE_16M); /* Use OMAP DIE_ID as MAC address */ - if (!eth_getenv_enetaddr("ethaddr", enetaddr)) { + if (!eth_env_get_enetaddr("ethaddr", enetaddr)) { printf("ethaddr not set, using Die ID\n"); die_id_0 = readl(&id_base->die_id_0); enetaddr[0] = 0x02; /* locally administered */ @@ -111,7 +111,7 @@ int misc_init_r(void) enetaddr[3] = (die_id_0 & 0x00ff0000) >> 16; enetaddr[4] = (die_id_0 & 0x0000ff00) >> 8; enetaddr[5] = (die_id_0 & 0x000000ff); - eth_setenv_enetaddr("ethaddr", enetaddr); + eth_env_set_enetaddr("ethaddr", enetaddr); } #endif diff --git a/board/toradex/apalis_imx6/apalis_imx6.c b/board/toradex/apalis_imx6/apalis_imx6.c index 8e5613cb12..7a3e493faf 100644 --- a/board/toradex/apalis_imx6/apalis_imx6.c +++ b/board/toradex/apalis_imx6/apalis_imx6.c @@ -9,6 +9,7 @@ #include <common.h> #include <dm.h> +#include <environment.h> #include <asm/arch/clock.h> #include <asm/arch/crm_regs.h> #include <asm/arch/mxc_hdmi.h> @@ -803,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) { @@ -813,12 +814,12 @@ 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)) { - 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 - saveenv(); + env_save(); #endif } } diff --git a/board/toradex/colibri_imx6/colibri_imx6.c b/board/toradex/colibri_imx6/colibri_imx6.c index cbf7aa952a..dbcd233782 100644 --- a/board/toradex/colibri_imx6/colibri_imx6.c +++ b/board/toradex/colibri_imx6/colibri_imx6.c @@ -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; diff --git a/board/toradex/colibri_vf/colibri_vf.c b/board/toradex/colibri_vf/colibri_vf.c index 46dd15bac8..3858af9c40 100644 --- a/board/toradex/colibri_vf/colibri_vf.c +++ b/board/toradex/colibri_vf/colibri_vf.c @@ -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; diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c index 1bf8ca8f76..328c4c0200 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/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c index 0d267877fa..b4e4727e63 100644 --- a/board/toradex/common/tdx-common.c +++ b/board/toradex/common/tdx-common.c @@ -80,24 +80,24 @@ 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, * set the one from config block if not */ - if (!eth_getenv_enetaddr("ethaddr", ethaddr)) - eth_setenv_enetaddr("ethaddr", (u8 *)&tdx_eth_addr); + if (!eth_env_get_enetaddr("ethaddr", ethaddr)) + eth_env_set_enetaddr("ethaddr", (u8 *)&tdx_eth_addr); #ifdef CONFIG_TDX_CFG_BLOCK_2ND_ETHADDR - if (!eth_getenv_enetaddr("eth1addr", ethaddr)) { + if (!eth_env_get_enetaddr("eth1addr", ethaddr)) { /* * Secondary MAC address is allocated from block * 0x100000 higher then the first MAC address */ memcpy(ethaddr, &tdx_eth_addr, 6); ethaddr[3] += 0x10; - eth_setenv_enetaddr("eth1addr", ethaddr); + eth_env_set_enetaddr("eth1addr", ethaddr); } #endif diff --git a/board/tqc/tqma6/tqma6.c b/board/tqc/tqma6/tqma6.c index fcdea34f05..14991fdb00 100644 --- a/board/tqc/tqma6/tqma6.c +++ b/board/tqc/tqma6/tqma6.c @@ -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(); diff --git a/board/udoo/neo/neo.c b/board/udoo/neo/neo.c index 276c625cfd..7fa1289de0 100644 --- a/board/udoo/neo/neo.c +++ b/board/udoo/neo/neo.c @@ -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; diff --git a/board/udoo/udoo.c b/board/udoo/udoo.c index 7534935dde..a359626b81 100644 --- a/board/udoo/udoo.c +++ b/board/udoo/udoo.c @@ -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; } diff --git a/board/varisys/common/sys_eeprom.c b/board/varisys/common/sys_eeprom.c index b55ab818e6..69f596a4cc 100644 --- a/board/varisys/common/sys_eeprom.c +++ b/board/varisys/common/sys_eeprom.c @@ -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; @@ -486,8 +486,8 @@ int mac_read_from_eeprom_common(void) /* Only initialize environment variables that are blank * (i.e. have not yet been set) */ - if (!getenv(enetvar)) - setenv(enetvar, ethaddr); + if (!env_get(enetvar)) + env_set(enetvar, ethaddr); } } diff --git a/board/varisys/cyrus/cyrus.c b/board/varisys/cyrus/cyrus.c index 74f4473877..30f518abe8 100644 --- a/board/varisys/cyrus/cyrus.c +++ b/board/varisys/cyrus/cyrus.c @@ -87,8 +87,8 @@ int ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); - base = getenv_bootm_low(); - size = getenv_bootm_size(); + base = env_get_bootm_low(); + size = env_get_bootm_size(); fdt_fixup_memory(blob, (u64)base, (u64)size); diff --git a/board/vscom/baltos/board.c b/board/vscom/baltos/board.c index d3b1f1564f..cb39190c28 100644 --- a/board/vscom/baltos/board.c +++ b/board/vscom/baltos/board.c @@ -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; @@ -453,11 +453,11 @@ 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)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); } #ifdef CONFIG_DRIVER_TI_CPSW diff --git a/board/wandboard/wandboard.c b/board/wandboard/wandboard.c index 1dbc966b6e..adfcf48562 100644 --- a/board/wandboard/wandboard.c +++ b/board/wandboard/wandboard.c @@ -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; } diff --git a/board/work-microwave/work_92105/Kconfig b/board/work-microwave/work_92105/Kconfig index 1fde4b29aa..4bc34ed01f 100644 --- a/board/work-microwave/work_92105/Kconfig +++ b/board/work-microwave/work_92105/Kconfig @@ -17,4 +17,11 @@ config CMD_HD44760 help This controls the LCD driver. +config CMD_MAX6957 + bool "Enable 'max6957aax' PMIC command" + help + DEPRECATED: Needs conversion to driver model. + + This allows PMIC registers to be read and written. + endif diff --git a/board/work-microwave/work_92105/work_92105_display.c b/board/work-microwave/work_92105/work_92105_display.c index 37a736351c..c997cea6f0 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 4ed6f50e5c..b76eb948d5 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/zynq/board.c b/board/xilinx/zynq/board.c index b2fbecf6de..90ef542458 100644 --- a/board/xilinx/zynq/board.c +++ b/board/xilinx/zynq/board.c @@ -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; } diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index aebd3df8a9..d17868b0c2 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -318,10 +318,10 @@ 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")); - setenv("boot_targets", new_targets); + sprintf(new_targets, "%s %s", mode, env_get("boot_targets")); + env_set("boot_targets", new_targets); return 0; } |