rpi: tizen-boot: modify the parameter check logic
authorJunghoon Kim <jhoon20.kim@samsung.com>
Thu, 14 Sep 2017 11:57:24 +0000 (20:57 +0900)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 15 Nov 2021 10:19:26 +0000 (11:19 +0100)
Modify the parameter check logic to support all cases of reboot commands
including "reboot", "reboot fota", "reboot recovery", and undefined reboot
parameter.

Change-Id: I00c7cec03bdd8d9364bda3e8c7142a76ed9b4bd9
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
board/raspberrypi/rpi/tizen-boot.scr

index 437763c796322df0fa7ba9d7afec4450e86904de..e0a303cb48bc7f522aec38c97e5ca8c0f915287e 100644 (file)
@@ -12,14 +12,17 @@ rebootparamfile=reboot-param.bin
 rebootparam_addr=0x3a62b000
 # 0x72677075 is ascii code for representing string "upgr"
 upgrade_val=72677075
-# 0x6d726f6e is ascii code for representing string "norm"
-normal_val=6d726f6e
-
-ramdisksize=800000
+# 0x72766372 is ascii code for representing string "rcvr"
+recovery_val=72766372
+# 0x6665646e is ascii code for representing string "ndef"
+nodef_val=6665646e
 
 # Normal ramdisk : partition 7
 # Ramdisk Recovery : Partition 8
 ramdiskdev=0
+ramdiskpart=7
+ramdisksize=800000
+bootmode=ramdisk
 
 # Device that included the image.
 bootdev=mmc
@@ -28,19 +31,15 @@ if test -e $bootdev $mmcbootdev:$mmcinformpart $rebootparamfile; then;
        ext4load $bootdev $mmcbootdev:$mmcinformpart $rebootparam_addr $rebootparamfile;
        if itest.l *${rebootparam_addr} == ${upgrade_val}; then;
                ramdiskpart=8
-               bootmode=upgrade
                ramdisksize=c00000
-       elif itest.l *${rebootparam_addr} == ${normal_val}; then;
-               ramdiskpart=7
-               bootmode=ramdisk
-       else
+               bootmode=fota
+       elif itest.l *${rebootparam_addr} == ${recovery_val}; then;
+               ramdiskpart=8
+               ramdisksize=c00000
+               bootmode=recovery
+       elif itest.l *${rebootparam_addr} == ${nodef_val}; then;
                echo "This reboot parameter is not supported...";
-               ramdiskpart=7
-               bootmode=ramdisk
        fi
-else
-       ramdiskpart=7
-       bootmode=ramdisk
 fi
 
 # boot from ram0 if there is sbin