From 48bfaa296afbfad18d8446c01b24be453492f0a4 Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Mon, 22 Jun 2020 11:18:03 +0900 Subject: [PATCH] rpi: tizen-boot-rpi3: 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: Ibbec03b4e3380028841d10eee7157c5e86fa8756 Signed-off-by: Jaehoon Chung --- board/raspberrypi/rpi/tizen-boot-rpi3-32b.scr | 6 ++++-- board/raspberrypi/rpi/tizen-boot-rpi3.scr | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/board/raspberrypi/rpi/tizen-boot-rpi3-32b.scr b/board/raspberrypi/rpi/tizen-boot-rpi3-32b.scr index ccb75bfe64..7730461fd3 100644 --- a/board/raspberrypi/rpi/tizen-boot-rpi3-32b.scr +++ b/board/raspberrypi/rpi/tizen-boot-rpi3-32b.scr @@ -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 diff --git a/board/raspberrypi/rpi/tizen-boot-rpi3.scr b/board/raspberrypi/rpi/tizen-boot-rpi3.scr index 7f99d97dd6..cde861ac45 100644 --- a/board/raspberrypi/rpi/tizen-boot-rpi3.scr +++ b/board/raspberrypi/rpi/tizen-boot-rpi3.scr @@ -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 -- 2.34.1