From 477abaafdacfae2cd412415ffa0d4fc32a8a53f8 Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Wed, 17 Jun 2020 20:44:37 +0900 Subject: [PATCH] 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 --- board/raspberrypi/rpi/tizen-boot-rpi4-32b.scr | 6 ++---- board/raspberrypi/rpi/tizen-boot-rpi4.scr | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) 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 -- 2.7.4