rpi: tizen-boot-rpi3: calculate tizen_kernel_addr_r with ramdisk's size 56/236756/1
authorJaehoon Chung <jh80.chung@samsung.com>
Mon, 22 Jun 2020 02:18:03 +0000 (11:18 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Mon, 22 Jun 2020 02:18:03 +0000 (11:18 +0900)
Calculate tizen_kernel_addr_r with ramdisk's size.
When ramdisk size is increased, kernel loading offset will be also
increased. It can prevent to overwrite the images.

Change-Id: Ibbec03b4e3380028841d10eee7157c5e86fa8756
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
board/raspberrypi/rpi/tizen-boot-rpi3-32b.scr
board/raspberrypi/rpi/tizen-boot-rpi3.scr

index ccb75bfe6415df8d38a338e8fbf1fbc4fa34a3e8..7730461fd31368121e1c10f890645984aa28ab99 100644 (file)
@@ -59,6 +59,10 @@ setenv bootargs \"${tizen_bootarg} smsc95xx.macaddr=${ethaddr} root=/dev/${rootd
 part start $bootdev $mmcrootdev $ramdiskpart ramdisk_start
 part size $bootdev $mmcrootdev $ramdiskpart ramdisk_size
 
+# Set to ramdisksize with real partition size. (Need to multiply block-size 0x200)
+setexpr ramdisksize $ramdisk_size * 200
+setexpr tizen_kernel_addr_r $ramdisk_addr_r + $ramdisksize
+
 echo "Searching for kernel in"; for prefix in $boot_prefixes; do
 if load $bootdev $mmcbootdev:$mmcbootpart $tizen_kernel_addr_r $prefix$kernel; then;
        echo ${bootmode} "boot";
@@ -67,8 +71,6 @@ 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
index 7f99d97dd6b8a80ccab88582a80372efa41713b1..cde861ac45a0881e1947285808a52535eecab32d 100644 (file)
@@ -59,6 +59,10 @@ setenv bootargs \"${tizen_bootarg} smsc95xx.macaddr=${ethaddr} root=/dev/${rootd
 part start $bootdev $mmcrootdev $ramdiskpart ramdisk_start
 part size $bootdev $mmcrootdev $ramdiskpart ramdisk_size
 
+# Set to ramdisksize with real partition size. (Need to multiply block-size 0x200)
+setexpr ramdisksize $ramdisk_size * 200
+setexpr tizen_kernel_addr_r $ramdisk_addr_r + $ramdisksize
+
 echo "Searching for kernel in"; for prefix in $boot_prefixes; do
 if load $bootdev $mmcbootdev:$mmcbootpart $tizen_kernel_addr_r $prefix$kernel; then;
        echo ${bootmode} "boot";
@@ -67,8 +71,6 @@ 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
        booti $tizen_kernel_addr_r $ramdisk_addr_r:$ramdisksize $fdt_addr_r;
 fi
 done