From: Jaehoon Chung Date: Tue, 9 Jul 2024 07:16:30 +0000 (+0900) Subject: Add support for setting upgrade type X-Git-Tag: accepted/tizen/8.0/unified/20240710.161347^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=29ab0db761c97229602c98e99a6dc23b4ce0e6a3;p=platform%2Fkernel%2Fu-boot.git Add support for setting upgrade type Upgrade type (online or offline) is set by HAL API. Depending on the type selected during bootmode=FOTA ramdisk (online) or ramdisk-recovery (offline) will be picked as boot partition. This patch is based on commit 3b26e4c27a53 of tizen branch. - riscv doesn't publish on tizen_8.0, so it doesn't need to update codes of riscv. Change-Id: I46b6994eebc0db5ef420f94962065580c7d29eb5 Signed-off-by: Mateusz Moscicki Signed-off-by: Jaehoon Chung --- diff --git a/include/samsung/tizen_rpi.h b/include/samsung/tizen_rpi.h index 6ae160ff1e..e06762f06e 100644 --- a/include/samsung/tizen_rpi.h +++ b/include/samsung/tizen_rpi.h @@ -129,6 +129,7 @@ # 0x72766372 is ascii code for representing string "rcvr" # 0x6665646e is ascii code for representing string "ndef" # 0x6c6e7764 is ascii code for representing string "dwnl" +# 0x696c6e6f is ascii code for representing string "onli" */ #define TIZEN_ENV_SETTING \ "kernel=" KERNEL_NAME "\0" \ @@ -139,9 +140,12 @@ "mmcrootpart=2\0" \ "mmcinformpart=9\0" \ "rebootparamfile=reboot-param.bin\0" \ + "upgradetypefile=upgrade-type.info\0" \ "slotfile=partition-ab.info\0" \ "slot_addr=0x02200000\0" \ "rebootparam_addr=0x02100000\0" \ + "upgradetype_addr=0x02300000\0" \ + "upgradetype_online_val=696c6e6f\0" \ "upgrade_val=72677075\0" \ "recovery_val=72766372\0" \ "nodef_val=6665646e\0" \ diff --git a/tizen/bootscript/tizen-boot-rpi4.scr b/tizen/bootscript/tizen-boot-rpi4.scr index bc34f03bc9..8a009968c9 100644 --- a/tizen/bootscript/tizen-boot-rpi4.scr +++ b/tizen/bootscript/tizen-boot-rpi4.scr @@ -36,6 +36,12 @@ if test -e $bootdev $mmcbootdev:$mmcinformpart $rebootparamfile; then; setenv partition_name "ramdisk-recovery" setenv partition_fallback ${legacy_recovery_part} setenv bootmode "fota" + if test -e $devtype $devnum:$informpart $upgradetypefile; then; + ext4load $devtype $devnum:$informpart $upgradetype_addr $upgradetypefile; + if itest.l *${upgradetype_addr} == ${upgradetype_online_val}; then; + setenv partition_name "ramdisk" + fi + fi elif itest.l *${rebootparam_addr} == ${recovery_val}; then; setenv partition_name "ramdisk-recovery" setenv partition_fallback ${legacy_recovery_part}