From: Jaehoon Chung Date: Thu, 18 Jun 2020 04:04:18 +0000 (+0900) Subject: rpi: tizen-boot-rpi3: fix hard-coding value about ramdisksize X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b31a8220f46cff4e47f72576defe197f8683fef9;p=platform%2Fkernel%2Fu-boot.git rpi: tizen-boot-rpi3: fix hard-coding value about ramdisksize 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: I59e4ed5d1c49e82c2bd76474b1d4bc086fb600e1 Signed-off-by: Jaehoon Chung --- diff --git a/board/raspberrypi/rpi/tizen-boot-rpi3-32b.scr b/board/raspberrypi/rpi/tizen-boot-rpi3-32b.scr index deb7231d2f..ccb75bfe64 100644 --- a/board/raspberrypi/rpi/tizen-boot-rpi3-32b.scr +++ b/board/raspberrypi/rpi/tizen-boot-rpi3-32b.scr @@ -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..."; @@ -22,7 +19,6 @@ fi # This is for jumping to flash mode on u-boot. if test "${bootmode}" = "download"; then; setenv ramdiskpart 8 - setenv ramdisksize c00000 setenv bootmode flash fi @@ -71,6 +67,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 diff --git a/board/raspberrypi/rpi/tizen-boot-rpi3.scr b/board/raspberrypi/rpi/tizen-boot-rpi3.scr index 52b45c947e..7f99d97dd6 100644 --- a/board/raspberrypi/rpi/tizen-boot-rpi3.scr +++ b/board/raspberrypi/rpi/tizen-boot-rpi3.scr @@ -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..."; @@ -22,7 +19,6 @@ fi # This is for jumping to flash mode on u-boot. if test "${bootmode}" = "download"; then; setenv ramdiskpart 8 - setenv ramdisksize c00000 setenv bootmode flash fi @@ -71,6 +67,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 booti $tizen_kernel_addr_r $ramdisk_addr_r:$ramdisksize $fdt_addr_r; fi done