From 905a6acb3360c279ef74dee37a43a068ff4cc8f0 Mon Sep 17 00:00:00 2001 From: Mupceet Date: Fri, 15 Jul 2022 14:54:38 +0800 Subject: [PATCH] fstab Signed-off-by: Mupceet Change-Id: I92304ddb5785d8453b64ffbe2baaa840a75222bf --- .../board/hisilicon/hi3516dv300/hi3516dv300.c | 35 ++++++++++++++----- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/u-boot-2020.01/board/hisilicon/hi3516dv300/hi3516dv300.c b/u-boot-2020.01/board/hisilicon/hi3516dv300/hi3516dv300.c index c6b4f89d78..afd20d8918 100755 --- a/u-boot-2020.01/board/hisilicon/hi3516dv300/hi3516dv300.c +++ b/u-boot-2020.01/board/hisilicon/hi3516dv300/hi3516dv300.c @@ -677,6 +677,9 @@ int do_ota_auto_update(void) int misc_init_r(void) { const char cmdBuf[] = "mmc read 0x0 0x80000000 0x800 0x4800; bootm 0x80000000"; + // 0x80000000: boot img load addr; 0x84000000: updater img load addr + const char updater_cmdBuf[] = "mmc read 0x0 0x80000000 0x800 0x4800; mmc read 0x0 0x84000000 0x8000 0xA000; " + "bootm 0x80000000 0x84000000"; #ifdef CONFIG_RANDOM_ETHADDR random_init_r(); @@ -695,28 +698,42 @@ int misc_init_r(void) "clk_ignore_unused androidboot.selinux=permissive skip_initramfs rootdelay=10 hardware=Hi3516DV300 " "default_boot_device=soc/10100000.himci.eMMC init=/init " "root=/dev/ram0 blkdevparts=mmcblk0:1M(boot),15M(kernel),20M(updater)," - "2M(misc),4M(ramdisk),3303M(system),256M(vendor),50M(sys_prod),50M(chip_prod),-(userdata) initrd=0x84000000,0xA24000"; + "2M(misc),4M(ramdisk),3303M(system),256M(vendor),50M(sys_prod),50M(chip_prod),-(userdata) initrd=0x84000000,0x400000 " + "ohos.required_mount.system=/dev/block/platform/soc/10100000.himci.eMMC/by-name/system@/usr@ext4@ro,barrier=1@wait,required " + "ohos.required_mount.vendor=/dev/block/platform/soc/10100000.himci.eMMC/by-name/vendor@/vendor@ext4@ro,barrier=1@wait,required " + "ohos.required_mount.misc=/dev/block/platform/soc/10100000.himci.eMMC/by-name/misc@none@none@none@wait,required"; const char bootcmd_with_ramdisk[] = "mmc read 0x0 0x80000000 0x800 0x4800; " "mmc read 0x0 0x84000000 0x13000 0x2000; " - "bootm 0x80000000 0x84000000:0xA24000"; + "bootm 0x80000000 0x84000000:0x400000"; + const char bootargs_with_updater[] = "mem=640M console=ttyAMA0,115200 mmz=anonymous,0,0xA8000000,384M " + "clk_ignore_unused androidboot.selinux=permissive skip_initramfs rootdelay=10 hardware=Hi3516DV300 " + "default_boot_device=soc/10100000.himci.eMMC init=/init " + "root=/dev/ram0 blkdevparts=mmcblk0:1M(boot),15M(kernel),20M(updater)," + "2M(misc),4M(ramdisk),3303M(system),256M(vendor),50M(sys_prod),50M(chip_prod),-(userdata) initrd=0x84000000,0x1400000"; + const char bootcmd_with_updater[] = "mmc read 0x0 0x80000000 0x800 0x4800; " + "mmc read 0x0 0x84000000 0x8000 0xA000; " + "bootm 0x80000000 0x84000000:0x1400000"; memset(g_bootArgsStr, 0, ARG_SZ); - memcpy(g_bootArgsStr, bootargs_with_ramdisk, strlen(bootargs_with_ramdisk)); - env_set("bootcmd", bootcmd_with_ramdisk); + if (g_isRecovery) { + memcpy(g_bootArgsStr, bootargs_with_updater, strlen(bootargs_with_updater)); + env_set("bootcmd", bootcmd_with_updater); + } else { + memcpy(g_bootArgsStr, bootargs_with_ramdisk, strlen(bootargs_with_ramdisk)); + env_set("bootcmd", bootcmd_with_ramdisk); + } #endif ChangeBootArgs(); - // 0x80000000: boot img load addr; 0x84000000: updater img load addr - const char updater_cmdBuf[] = "mmc read 0x0 0x80000000 0x800 0x4800; mmc read 0x0 0x84000000 0x8000 0xB000; " - "bootm 0x80000000 0x84000000"; env_set("bootargs", g_bootArgsStr); #ifndef INDEPENDENT_RAMDISK_PARTITION - env_set("bootcmd", cmdBuf); -#endif if (g_isRecovery) { env_set("bootcmd", updater_cmdBuf); + } else { + env_set("bootcmd", cmdBuf); } +#endif /* auto update flag */ if (is_auto_update()) -- Gitee