From dba10850f3ef0b83f176e404514e8347ac148809 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Stelmach?= Date: Wed, 2 Aug 2023 15:14:13 +0200 Subject: [PATCH] samsung: tizen_riscv: add dedicated bootcmd for Tizen MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Compile in bootcmd and other scripts previously in uEnv.txt The default value of bootcmd environment variable cannot be overriden in platform specific header files. It needs to be set in .config. Change-Id: I1c5430895911fc9a499f79a6e9575ed2ad4e833f Signed-off-by: Łukasz Stelmach --- configs/tizen_starfive_visionfive2_defconfig | 1 + include/samsung/tizen_riscv.h | 21 ++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/configs/tizen_starfive_visionfive2_defconfig b/configs/tizen_starfive_visionfive2_defconfig index d73aa63535..e407f65257 100644 --- a/configs/tizen_starfive_visionfive2_defconfig +++ b/configs/tizen_starfive_visionfive2_defconfig @@ -26,6 +26,7 @@ CONFIG_QSPI_BOOT=y CONFIG_SD_BOOT=y CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="console=ttyS0,115200 debug rootwait earlycon=sbi" +CONFIG_BOOTCOMMAND="load ${bootdevtype} ${bootdevnum}:${bootpart} ${scriptaddr} ${prefix}${script}; devtype=${bootdevtype}; devnum=${bootdevnum}; distro_bootpart=${bootpart}; source ${scriptaddr}" CONFIG_USE_PREBOOT=y CONFIG_PREBOOT="setenv fdt_addr ${fdtcontroladdr};fdt addr ${fdtcontroladdr};" CONFIG_DEFAULT_FDT_FILE="jh7110-starfive-visionfive-2-v1.3b.dtb" diff --git a/include/samsung/tizen_riscv.h b/include/samsung/tizen_riscv.h index 1226beea96..b852195f12 100644 --- a/include/samsung/tizen_riscv.h +++ b/include/samsung/tizen_riscv.h @@ -54,6 +54,27 @@ "tizen_bootarg= \0" \ "opts=loglevel=7\0" \ "reboot_param_clear=" CLEAR_REBOOT_PARAM "\0" \ + "script=boot.scr.uimg\0" \ + "prefix=/\0" \ + "set_to_part_a=" \ + "if test -e ${bootdevtype} ${bootdevnum}:${informpart} ${slotfile}; then; " \ + "load ${bootdevtype} ${bootdevnum}:${informpart} ${slot_addr} /${slotfile} 2; " \ + "fi; " \ + "mw.b ${slot_addr} 0x61; " \ + "ext4write ${bootdevtype} ${bootdevnum}:${informpart} ${slot_addr} /${slotfile} 2;\0" \ + "set_to_part_b=" \ + "if test -e ${bootdevtype} ${bootdevnum}:${informpart} ${slotfile}; then; " \ + "load ${bootdevtype} ${bootdevnum}:${informpart} ${slot_addr} /${slotfile} 2; " \ + "fi; " \ + "mw.b ${slot_addr} 0x62; " \ + "ext4write ${bootdevtype} ${bootdevnum}:${informpart} ${slot_addr} /${slotfile} 2;\0" \ + "bootenv=uEnv.txt\0" \ + "loadbootenv=" \ + "if test -e ${bootdevtype} ${bootdevnum}:${bootpart} ${loadaddr} ${prefix}${bootenv}; then " \ + "load ${bootdevtype} ${bootdevnum}:${bootpart} ${loadaddr} ${prefix}${bootenv}; " \ + "fi;\0" \ + "importbootenv=echo Importing environment from ${bootdevtype} ...; " \ + "env import -t $loadaddr $filesize;\0" \ "" #endif /* __CONFIG_TIZEN_RISCV_H */ -- 2.34.1