From: Jaehoon Chung Date: Wed, 28 Jun 2017 11:46:00 +0000 (+0900) Subject: rpi: tizen-boot: support the booting without ramdisk image X-Git-Tag: accepted/tizen/unified/20221108.163909~330 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f78488f98a08139672c5de7036596ed96cbfb91d;p=platform%2Fkernel%2Fu-boot.git rpi: tizen-boot: support the booting without ramdisk image If there is not ramdisk image, target can't be booted. This modification is supported that target can be booted anyway. NOTE: Assume that ramdisk partition has "sbin". If want to mount the MMC device, you have to clear the ramdisk partition. Change-Id: Ibae4fd7216d0aa7ca11e92842c099dfc5212b714 Signed-off-by: Jaehoon Chung --- diff --git a/board/raspberrypi/rpi/tizen-boot.scr b/board/raspberrypi/rpi/tizen-boot.scr index 4475d58..5b7453e 100644 --- a/board/raspberrypi/rpi/tizen-boot.scr +++ b/board/raspberrypi/rpi/tizen-boot.scr @@ -23,11 +23,16 @@ ramdiskpart=8 bootmode=fota else ramdiskpart=7 -bootmode=normal +bootmode=ramdisk fi -# Device for booting from ram0 -bootramdev=ram0 +# boot from ram0 if there is sbin +if test -e $bootdev $mmcrootdev:$ramdiskpart sbin; then; +rootdev=ram0 +else +rootdev=mmcblk${mmcrootdev}p${mmcrootpart} +bootmode=normal +fi # Kernel image kernel=Image @@ -35,7 +40,7 @@ setenv fdtfile \"bcm2710-rpi-3-b.dtb\" setenv boot_prefixes \"/\" # To use comdline for using serial console. /* Normal mode */ -setenv bootargs \"8250.nr_uarts=1 dma.dmachans=0x7f35 bcm2709.serial=0xed6687d3 bcm2709.uart_clock=48000000 root=/dev/${bootramdev} rw bootmode=${bootmode} bcm2709.boardrev=0xa02082 rootwait earlyprintk console=ttyS0,115200n8 console=tty1 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000\" +setenv bootargs \"8250.nr_uarts=1 dma.dmachans=0x7f35 bcm2709.serial=0xed6687d3 bcm2709.uart_clock=48000000 root=/dev/${rootdev} rw bootmode=${bootmode} bcm2709.boardrev=0xa02082 rootwait earlyprintk console=ttyS0,115200n8 console=tty1 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000\" # Find the ramdisk offset and block count part start $bootdev $ramdiskdev $ramdiskpart ramdisk_start @@ -46,8 +51,10 @@ if load $bootdev $mmcbootdev:$mmcbootpart $kernel_addr_r $kernel; then; echo ${bootmode} "boot"; load $bootdev $mmcbootdev:$mmcbootpart $fdt_addr_r $fdtfile; load $bootdev $mmcbootdev:$mmcbootpart $kernel_addr_r $prefix$kernel; - echo "Loading Ramdisk from partition"${ramdiskpart}; - mmc read $ramdisk_addr_r $ramdisk_start $ramdisk_size; + if test -e mmc $mmcrootdev:$ramdiskpart sbin; then; + echo "Loading Ramdisk from partition"${ramdiskpart}; + mmc read $ramdisk_addr_r $ramdisk_start $ramdisk_size; + fi booti $kernel_addr_r $ramdisk_addr_r:$ramdisksize $fdt_addr_r; fi done