rpi: tizen-boot-rpi3: fix hard-coding value about ramdisksize 43/236543/1
authorJaehoon Chung <jh80.chung@samsung.com>
Thu, 18 Jun 2020 04:04:18 +0000 (13:04 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Thu, 18 Jun 2020 04:04:18 +0000 (13:04 +0900)
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 <jh80.chung@samsung.com>
board/raspberrypi/rpi/tizen-boot-rpi3-32b.scr
board/raspberrypi/rpi/tizen-boot-rpi3.scr

index deb7231d2fcab7e8949cf9ccd53b677dfd931d8a..ccb75bfe6415df8d38a338e8fbf1fbc4fa34a3e8 100644 (file)
@@ -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
index 52b45c947e3dd5d81545029cc07667925fb6458e..7f99d97dd6b8a80ccab88582a80372efa41713b1 100644 (file)
@@ -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