From afd05b07c1f1f820f9da9b5f7dcffe7d06c0e3fd Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Fri, 19 Jun 2020 12:56:33 +0900 Subject: [PATCH] rpi: tizen-boot-rpi4: 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: Icc900b726f46683e5104be7f8ab31f36934f12b5 Signed-off-by: Jaehoon Chung --- board/raspberrypi/rpi/tizen-boot-rpi4-32b.scr | 7 +++++-- board/raspberrypi/rpi/tizen-boot-rpi4.scr | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/board/raspberrypi/rpi/tizen-boot-rpi4-32b.scr b/board/raspberrypi/rpi/tizen-boot-rpi4-32b.scr index 35bfb05..194793f 100644 --- a/board/raspberrypi/rpi/tizen-boot-rpi4-32b.scr +++ b/board/raspberrypi/rpi/tizen-boot-rpi4-32b.scr @@ -55,6 +55,10 @@ setenv bootargs \"${tizen_bootarg} root=/dev/${rootdev} rw bootmode=${bootmode} 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"; @@ -63,8 +67,7 @@ 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-rpi4.scr b/board/raspberrypi/rpi/tizen-boot-rpi4.scr index 0785339..a213668 100644 --- a/board/raspberrypi/rpi/tizen-boot-rpi4.scr +++ b/board/raspberrypi/rpi/tizen-boot-rpi4.scr @@ -55,6 +55,10 @@ setenv bootargs \"${tizen_bootarg} root=/dev/${rootdev} rw bootmode=${bootmode} 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"; @@ -63,8 +67,7 @@ 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.7.4