From: Seung-Woo Kim Date: Tue, 23 Jan 2018 01:34:57 +0000 (+0900) Subject: rpi: tizen-boot: add rpi2 script X-Git-Tag: submit/tizen/20180220.000957~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c0b17919bb9e603799b5e16445d47c37b4af6db9;p=platform%2Fkernel%2Fu-boot.git rpi: tizen-boot: add rpi2 script Add rpi2 tizen-boot script. For rpi2, serial console is different from rpi3. Change-Id: I4548468a3c052361b389be0fb6bdee72187b5e33 Signed-off-by: Seung-Woo Kim --- diff --git a/board/raspberrypi/rpi/tizen-boot-rpi2.scr b/board/raspberrypi/rpi/tizen-boot-rpi2.scr new file mode 100644 index 0000000000..6264cc11c9 --- /dev/null +++ b/board/raspberrypi/rpi/tizen-boot-rpi2.scr @@ -0,0 +1,84 @@ +# U-boot script for tizen +boardname=rpi2 +mmcbootdev=0 +mmcbootpart=1 +mmcrootdev=0 +mmcrootpart=2 +mmcinformpart=9 + +# +# Tizen kernel image is over than 16MB, it will be overlapped with other address. +# To avoid this behaivor, change to 0x02d00000 from 0x01000000 +# +# NOTE: booti command will move kernel image to 0x80000 (text offset), and +# ramdisk is loaded to $ramdisk_addr_r (0x02100000), so kernel should be equal +# or less than 32.5MB to load ramdisk properly. +# +tizen_kernel_addr_r=0x02d00000 + +dummy=0x24000000 +rebootparamfile=reboot-param.bin +# use the ram address of ramdisk before loading ramdisk image +rebootparam_addr=0x3a62b000 +# 0x72677075 is ascii code for representing string "upgr" +upgrade_val=72677075 +# 0x72766372 is ascii code for representing string "rcvr" +recovery_val=72766372 +# 0x6665646e is ascii code for representing string "ndef" +nodef_val=6665646e + +# Normal ramdisk : partition 7 +# Ramdisk Recovery : Partition 8 +ramdiskpart=7 +ramdisksize=800000 +bootmode=ramdisk + +# Device that included the image. +bootdev=mmc + +if test -e $bootdev $mmcbootdev:$mmcinformpart $rebootparamfile; then; + ext4load $bootdev $mmcbootdev:$mmcinformpart $rebootparam_addr $rebootparamfile; + if itest.l *${rebootparam_addr} == ${upgrade_val}; then; + ramdiskpart=8 + ramdisksize=c00000 + bootmode=fota + elif itest.l *${rebootparam_addr} == ${recovery_val}; then; + ramdiskpart=8 + ramdisksize=c00000 + bootmode=recovery + elif itest.l *${rebootparam_addr} == ${nodef_val}; then; + echo "This reboot parameter is not supported..."; + fi +fi + +# boot from ram0 if there is sbin +if test -e $bootdev $mmcrootdev:$ramdiskpart sbin/init; then; +rootdev=ram0 +else +rootdev=mmcblk${mmcrootdev}p${mmcrootpart} +bootmode=normal +fi + +# Kernel image +kernel=zImage +setenv fdtfile \"bcm2709-rpi-2-b.dtb\" +setenv boot_prefixes \"/\" + +# To use comdline for using serial console. /* Normal mode */ +setenv bootargs \"dma.dmachans=0x7f35 bcm2709.serial=0xed6687d3 bcm2709.uart_clock=48000000 smsc95xx.macaddr=${ethaddr} root=/dev/${rootdev} rw bootmode=${bootmode} bcm2709.boardrev=0xa02082 rootwait console=ttyAMA0,115200n8 earlyprintk vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2708_fb.fbswap=1 ${opts}\" + +# Find the ramdisk offset and block count +part start $bootdev $mmcrootdev $ramdiskpart ramdisk_start +part size $bootdev $mmcrootdev $ramdiskpart ramdisk_size + +echo "Searching for kernel in"; for prefix in $boot_prefixes; do +if load $bootdev $mmcbootdev:$mmcbootpart $tizen_kernel_addr_r $prefix$kernel; then; + echo ${bootmode} "boot"; + load $bootdev $mmcbootdev:$mmcbootpart $fdt_addr $fdtfile; + if test -e mmc $mmcrootdev:$ramdiskpart sbin/init; then; + echo "Loading Ramdisk from partition"${ramdiskpart}; + mmc read $ramdisk_addr_r $ramdisk_start $ramdisk_size; + fi + bootz $tizen_kernel_addr_r $ramdisk_addr_r:$ramdisksize $fdt_addr; +fi +done