author | Xindong Xu <xindong.xu@amlogic.com> | 2019-07-04 04:28:38 (GMT) |
---|---|---|
committer | Xindong Xu <xindong.xu@amlogic.com> | 2019-07-04 04:28:43 (GMT) |
commit | 76ab5a20f817022f68517fdb55157192eb8fdca9 (patch) | |
tree | b0b401c5ee346c3cf3ec0b202e132ae5e3da3e4f | |
parent | 848957626a4badfdef92fe144ca7d2aef879a49f (diff) | |
download | uboot-76ab5a20f817022f68517fdb55157192eb8fdca9.zip uboot-76ab5a20f817022f68517fdb55157192eb8fdca9.tar.gz uboot-76ab5a20f817022f68517fdb55157192eb8fdca9.tar.bz2 |
fastboot: reset defenv exclued some env args before saveenv [1/1]
PD#SWPL-10357
BUG:132773884
Problem:
1. adb reboot bootloader -> will set bootdelay=-1
2. fastboot reboot -> bootdelay will be clean, no problem
3. if do fastboot flashing unlock first, there is a saveenv operation,
so the bootdelay=-1 will be saved.
then fastboot reboot. the bootdelay is -1, so the probelm is produced.
Solution:
just save some needing env args, reset others to default
Verify:
verify it on franklin
Change-Id: I58fc86ec3531a4e001fad4379382a863fe984c98
-rw-r--r-- | common/cmd_reboot.c | 1 | ||||
-rw-r--r-- | drivers/usb/gadget/f_fastboot.c | 6 |
2 files changed, 3 insertions, 4 deletions
diff --git a/common/cmd_reboot.c b/common/cmd_reboot.c index fc35439..df9f0ca 100644 --- a/common/cmd_reboot.c +++ b/common/cmd_reboot.c @@ -123,7 +123,6 @@ int do_get_rebootmode (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[] } #ifdef CONFIG_CMD_FASTBOOT - setenv("bootdelay", "0"); switch (reboot_mode_val) { case AMLOGIC_FASTBOOT_REBOOT: { setenv("reboot_mode","fastboot"); diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index b476545..26be4f2 100644 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -456,7 +456,7 @@ static int check_lock(void) printf("lock state is NULL \n"); lock_s = "10000000"; setenv("lock", "10000000"); - saveenv(); + run_command("defenv_reserv; saveenv;", 0); } printf("lock state: %s\n", lock_s); @@ -1024,7 +1024,7 @@ static void cb_flashing(struct usb_ep *ep, struct usb_request *req) strcpy(lock_d, "10000000"); lock_s = "10000000"; setenv("lock", "10000000"); - saveenv(); + run_command("defenv_reserv; saveenv;", 0); } else { printf("lock state: %s\n", lock_s); strcpy(lock_d, lock_s); @@ -1148,7 +1148,7 @@ static void cb_flashing(struct usb_ep *ep, struct usb_request *req) sprintf(lock_d, "%d%d00%d%d%d0", info->version_major, info->version_minor, info->lock_state, info->lock_critical_state, info->lock_bootloader); printf("lock_d state: %s\n", lock_d); setenv("lock", lock_d); - saveenv(); + run_command("defenv_reserv; saveenv;", 0); printf("response: %s\n", response); fastboot_tx_write_str(response); |