rpi: tizen-boot-rpi4: fix hard-coding value about ramdisksize 93/236493/1
authorJaehoon Chung <jh80.chung@samsung.com>
Wed, 17 Jun 2020 11:44:37 +0000 (20:44 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Wed, 17 Jun 2020 11:49:02 +0000 (20:49 +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: I450ace4f0e795f0a05f5ff36fcd837349bc5a4aa
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
board/raspberrypi/rpi/tizen-boot-rpi4-32b.scr
board/raspberrypi/rpi/tizen-boot-rpi4.scr

index 9be35b16f9f1cf2eb0dd6cb61552cc07b7088015..35bfb05b981bf361342aed0a8a8b7992e3a924dc 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
 
@@ -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
index 3a199dc513c5850b57a5621f6e47495df039bedb..078533958f47cbe4b2c68e4006b912729f3e7f08 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
 
@@ -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