summaryrefslogtreecommitdiff
path: root/board/keymile
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-08-03 12:22:09 -0600
committerTom Rini <trini@konsulko.com>2017-08-16 08:22:18 -0400
commit382bee57f19b4454e2015bc19a010bc2d0ab9337 (patch)
tree8c13efda2a6539cdbf1ac76fc458ffef1e9c966d /board/keymile
parent01510091de905c46620757b9027b2e55c4b3b313 (diff)
downloadu-boot-382bee57f19b4454e2015bc19a010bc2d0ab9337.tar.gz
u-boot-382bee57f19b4454e2015bc19a010bc2d0ab9337.tar.bz2
u-boot-382bee57f19b4454e2015bc19a010bc2d0ab9337.zip
env: Rename setenv() to env_set()
We are now using an env_ prefix for environment functions. Rename setenv() for consistency. Also add function comments in common.h. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'board/keymile')
-rw-r--r--board/keymile/common/common.c16
-rw-r--r--board/keymile/common/ivm.c8
-rw-r--r--board/keymile/km83xx/km83xx.c8
-rw-r--r--board/keymile/km_arm/km_arm.c4
-rw-r--r--board/keymile/kmp204x/kmp204x.c2
5 files changed, 19 insertions, 19 deletions
diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 408079c9a1..56d3044241 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -51,7 +51,7 @@ int set_km_env(void)
pnvramaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM
- CONFIG_KM_PNVRAM;
sprintf((char *)buf, "0x%x", pnvramaddr);
- setenv("pnvramaddr", (char *)buf);
+ env_set("pnvramaddr", (char *)buf);
/* try to read rootfssize (ram image) from environment */
p = getenv("rootfssize");
@@ -60,15 +60,15 @@ int set_km_env(void)
pram = (rootfssize + CONFIG_KM_RESERVED_PRAM + CONFIG_KM_PHRAM +
CONFIG_KM_PNVRAM) / 0x400;
sprintf((char *)buf, "0x%x", pram);
- setenv("pram", (char *)buf);
+ env_set("pram", (char *)buf);
varaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM;
sprintf((char *)buf, "0x%x", varaddr);
- setenv("varaddr", (char *)buf);
+ env_set("varaddr", (char *)buf);
kernelmem = gd->ram_size - 0x400 * pram;
sprintf((char *)buf, "0x%x", kernelmem);
- setenv("kernelmem", (char *)buf);
+ env_set("kernelmem", (char *)buf);
return 0;
}
@@ -169,7 +169,7 @@ static int do_setboardid(cmd_tbl_t *cmdtp, int flag, int argc,
return 1;
}
strcpy((char *)buf, p);
- setenv("boardid", (char *)buf);
+ env_set("boardid", (char *)buf);
printf("set boardid=%s\n", buf);
p = get_local_var("IVM_HWKey");
@@ -178,7 +178,7 @@ static int do_setboardid(cmd_tbl_t *cmdtp, int flag, int argc,
return 1;
}
strcpy((char *)buf, p);
- setenv("hwkey", (char *)buf);
+ env_set("hwkey", (char *)buf);
printf("set hwkey=%s\n", buf);
printf("Execute manually saveenv for persistent storage.\n");
@@ -311,9 +311,9 @@ static int do_checkboardidhwk(cmd_tbl_t *cmdtp, int flag, int argc,
envbid = bid;
envhwkey = hwkey;
sprintf(buf, "%lx", bid);
- setenv("boardid", buf);
+ env_set("boardid", buf);
sprintf(buf, "%lx", hwkey);
- setenv("hwkey", buf);
+ env_set("hwkey", buf);
}
} /* end while( ! found ) */
}
diff --git a/board/keymile/common/ivm.c b/board/keymile/common/ivm.c
index e9e518cf72..dc40a83fc0 100644
--- a/board/keymile/common/ivm.c
+++ b/board/keymile/common/ivm.c
@@ -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..08ae9ae346 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)
@@ -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..095e467ac0 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();