[openwrt/openwrt] uboot-mediatek: unifi6lr: mtd erase before write to flash

LEDE Commits lede-commits at lists.infradead.org
Wed Apr 28 20:55:20 BST 2021


dangole pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/43dad22025597cb535626757301e035187d02b25

commit 43dad22025597cb535626757301e035187d02b25
Author: Chen Minqiang <ptpt52 at gmail.com>
AuthorDate: Tue Apr 27 11:54:34 2021 +0800

    uboot-mediatek: unifi6lr: mtd erase before write to flash
    
    Erase firmware ereas before writing to recovery or production partition
    when updating them via the bootloader menu.
    
    Signed-off-by: Chen Minqiang <ptpt52 at gmail.com>
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 package/boot/uboot-mediatek/patches/412-add-ubnt-unifi-6-lr.patch | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/boot/uboot-mediatek/patches/412-add-ubnt-unifi-6-lr.patch b/package/boot/uboot-mediatek/patches/412-add-ubnt-unifi-6-lr.patch
index 17f0b29f84..1af0da13c5 100644
--- a/package/boot/uboot-mediatek/patches/412-add-ubnt-unifi-6-lr.patch
+++ b/package/boot/uboot-mediatek/patches/412-add-ubnt-unifi-6-lr.patch
@@ -402,8 +402,8 @@
 +reset_factory=mtd erase nor0 0xc0000 0x10000 && reset
 +nor_read_production=mtd read nor0 $loadaddr 0x1000000 0x1000 && imsz $loadaddr image_size && mtd read nor0 $loadaddr 0x1000000 $image_size
 +nor_read_recovery=mtd read nor0 $loadaddr 0x120000 0x1000 && imsz $loadaddr image_size && mtd read nor0 $loadaddr 0x120000 $image_size
-+nor_write_production=mtd write nor0 $loadaddr 0x1000000 $filesize
-+nor_write_recovery=mtd write nor0 $loadaddr 0x120000 $filesize
++nor_write_production=mtd erase nor0 0x1000000 $filesize && mtd write nor0 $loadaddr 0x1000000 $filesize
++nor_write_recovery=mtd erase nor0 0x120000 0xee0000 && mtd write nor0 $loadaddr 0x120000 $filesize
 +_init_env=setenv _init_env ; saveenv
 +_firstboot=setenv _firstboot ; run _switch_to_menu ; run ethaddr_factory ; run _init_env ; run boot_first
 +_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title



More information about the lede-commits mailing list