rpi: tizen-boot-rpi2: fix hard-coding value about ramdisksize
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 18 Jun 2020 04:20:35 +0000 (13:20 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Tue, 20 Oct 2020 06:13:49 +0000 (15:13 +0900)
Current ramdisksize is set to hard-condig value as 0xc00000 or 0x800000.
If ramdisk's size is changed to other, it also needs to change.
But we're getting the number of block about ramdisk partition.
Use its value to load a ramdisk image. Then it's more clear than now.

Change-Id: I96e1e383d4603f2375a45193a72a95f261bb996d
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
board/raspberrypi/rpi/tizen-boot-rpi2.scr

index c20978e022aa59acf442968a6502af04af85895f..82ceaf2ccb56213db0379115b332c7f98a59aa16 100644 (file)
@@ -4,15 +4,12 @@ if test -e $bootdev $mmcbootdev:$mmcinformpart $rebootparamfile; then;
        ext4load $bootdev $mmcbootdev:$mmcinformpart $rebootparam_addr $rebootparamfile;
        if itest.l *${rebootparam_addr} == ${upgrade_val}; then;
                setenv ramdiskpart 8
-               setenv ramdisksize c00000
                setenv bootmode fota
        elif itest.l *${rebootparam_addr} == ${recovery_val}; then;
                setenv ramdiskpart 8
-               setenv ramdisksize c00000
                setenv bootmode recovery
        elif itest.l *${rebootparam_addr} == ${download_val}; then;
                setenv ramdiskpart 8
-               setenv ramdisksize c00000
                setenv bootmode flash
        elif itest.l *${rebootparam_addr} == ${nodef_val}; then;
                echo "This reboot parameter is not supported...";
@@ -53,6 +50,8 @@ if load $bootdev $mmcbootdev:$mmcbootpart $tizen_kernel_addr_r $prefix$kernel; t
                echo "Loading Ramdisk from partition"${ramdiskpart};
                mmc read $ramdisk_addr_r $ramdisk_start $ramdisk_size;
        fi
+# Set to ramdisksize with real partition size. (Need to multiply block-size 0x200)
+       setexpr ramdisksize $ramdisk_size * 200
        bootz $tizen_kernel_addr_r $ramdisk_addr_r:$ramdisksize $fdt_addr;
 fi
 done