From: Jaehoon Chung Date: Mon, 22 Jun 2020 02:18:46 +0000 (+0900) Subject: rpi: tizen-boot-rpi2: calculate tizen_kernel_addr_r with ramdisk's size X-Git-Tag: accepted/tizen/unified/20200623.080549~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F57%2F236757%2F1;p=platform%2Fkernel%2Fu-boot.git rpi: tizen-boot-rpi2: calculate tizen_kernel_addr_r with ramdisk's size 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: Id65e084a0e076a95ffe005955ef4c12e7554fa07 Signed-off-by: Jaehoon Chung --- diff --git a/board/raspberrypi/rpi/tizen-boot-rpi2.scr b/board/raspberrypi/rpi/tizen-boot-rpi2.scr index 82ceaf2..af0de4e 100644 --- a/board/raspberrypi/rpi/tizen-boot-rpi2.scr +++ b/board/raspberrypi/rpi/tizen-boot-rpi2.scr @@ -42,6 +42,10 @@ setenv bootargs \"dma.dmachans=0x7f35 bcm2709.serial=0xed6687d3 bcm2709.uart_clo 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"; @@ -50,8 +54,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