samsung: tizen_riscv: add dedicated bootcmd for Tizen
authorŁukasz Stelmach <l.stelmach@samsung.com>
Wed, 2 Aug 2023 13:14:13 +0000 (15:14 +0200)
committerJaehoon Chung <jh80.chung@samsung.com>
Tue, 17 Oct 2023 11:02:45 +0000 (20:02 +0900)
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 <l.stelmach@samsung.com>
configs/tizen_starfive_visionfive2_defconfig
include/samsung/tizen_riscv.h

index d73aa63..e407f65 100644 (file)
@@ -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"
index 1226bee..b852195 100644 (file)
        "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 */