From 624bae310a17392ee686ef4d82a8852a482c9c6f Mon Sep 17 00:00:00 2001 From: Junghoon Kim Date: Tue, 25 Jul 2017 15:36:18 +0900 Subject: [PATCH] rpi: tizen-boot: check reboot parameter to determine booting mode The "reboot-param.bin" file is used for passing reboot parameter. For example, the word "upgr" means that target should be booted with upgrade mode. Check the contents of "reboot-param.bin" file to determine booting mode. Change-Id: I62a6598f84c677c251df3559da9dd58a545e859c Signed-off-by: Junghoon Kim --- board/raspberrypi/rpi/tizen-boot.scr | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/board/raspberrypi/rpi/tizen-boot.scr b/board/raspberrypi/rpi/tizen-boot.scr index daa0a44..89c1f55 100644 --- a/board/raspberrypi/rpi/tizen-boot.scr +++ b/board/raspberrypi/rpi/tizen-boot.scr @@ -4,10 +4,16 @@ mmcbootdev=0 mmcbootpart=1 mmcrootdev=0 mmcrootpart=2 -mmcusrpart=5 +mmcinformpart=9 dummy=0x24000000 -fotaname=fota +rebootparamfile=reboot-param.bin +# use the ram address of ramdisk before loading ramdisk image +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 @@ -18,12 +24,22 @@ ramdiskdev=0 # Device that included the image. bootdev=mmc -if test -e $bootdev $mmcbootdev:$mmcusrpart $fotaname; then; -ramdiskpart=8 -bootmode=fota +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 + elif itest.l *${rebootparam_addr} == ${normal_val}; then; + ramdiskpart=7 + bootmode=ramdisk + else + echo "This reboot parameter is not supported..."; + ramdiskpart=7 + bootmode=ramdisk + fi else -ramdiskpart=7 -bootmode=ramdisk + ramdiskpart=7 + bootmode=ramdisk fi # boot from ram0 if there is sbin -- 2.7.4