From: Jaehoon Chung Date: Wed, 17 Jun 2020 11:44:37 +0000 (+0900) Subject: rpi: tizen-boot-rpi4: fix hard-coding value about ramdisksize X-Git-Tag: accepted/tizen/unified/20200623.080549~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F93%2F236493%2F1;p=platform%2Fkernel%2Fu-boot.git rpi: tizen-boot-rpi4: 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: I450ace4f0e795f0a05f5ff36fcd837349bc5a4aa Signed-off-by: Jaehoon Chung --- diff --git a/board/raspberrypi/rpi/tizen-boot-rpi4-32b.scr b/board/raspberrypi/rpi/tizen-boot-rpi4-32b.scr index 9be35b1..35bfb05 100644 --- a/board/raspberrypi/rpi/tizen-boot-rpi4-32b.scr +++ b/board/raspberrypi/rpi/tizen-boot-rpi4-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 @@ -67,6 +63,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-rpi4.scr b/board/raspberrypi/rpi/tizen-boot-rpi4.scr index 3a199dc..0785339 100644 --- a/board/raspberrypi/rpi/tizen-boot-rpi4.scr +++ b/board/raspberrypi/rpi/tizen-boot-rpi4.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 @@ -67,6 +63,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