From: Seung-Woo Kim Date: Tue, 23 Jan 2018 01:24:23 +0000 (+0900) Subject: rpi: tizen-boot: Rename tizen-boot script for rpi3 X-Git-Tag: submit/tizen/20180220.000957~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=56588c9a12e4ac7f8a2d61c54db5e4f0f1d068cb;p=platform%2Fkernel%2Fu-boot.git rpi: tizen-boot: Rename tizen-boot script for rpi3 The tizen-boot script is for rpi3 64bit mode. Rename the script for rpi3 to support other rpi board family. Change-Id: Ic05c2bf94deb9381460c0de4e4a31a31c8f615b6 Signed-off-by: Seung-Woo Kim --- diff --git a/board/raspberrypi/rpi/tizen-boot-rpi3.scr b/board/raspberrypi/rpi/tizen-boot-rpi3.scr new file mode 100644 index 0000000000..e9f8dee063 --- /dev/null +++ b/board/raspberrypi/rpi/tizen-boot-rpi3.scr @@ -0,0 +1,84 @@ +# U-boot script for tizen +boardname=rpi3 +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=Image +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 smsc95xx.macaddr=${ethaddr} root=/dev/${rootdev} rw bootmode=${bootmode} bcm2709.boardrev=0xa02082 rootwait console=ttyS0,115200n8 earlycon=uart8250,mmio32,0x3f215040 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000 ${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_r $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 + booti $tizen_kernel_addr_r $ramdisk_addr_r:$ramdisksize $fdt_addr_r; +fi +done diff --git a/board/raspberrypi/rpi/tizen-boot.scr b/board/raspberrypi/rpi/tizen-boot.scr deleted file mode 100644 index e9f8dee063..0000000000 --- a/board/raspberrypi/rpi/tizen-boot.scr +++ /dev/null @@ -1,84 +0,0 @@ -# U-boot script for tizen -boardname=rpi3 -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=Image -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 smsc95xx.macaddr=${ethaddr} root=/dev/${rootdev} rw bootmode=${bootmode} bcm2709.boardrev=0xa02082 rootwait console=ttyS0,115200n8 earlycon=uart8250,mmio32,0x3f215040 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000 ${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_r $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 - booti $tizen_kernel_addr_r $ramdisk_addr_r:$ramdisksize $fdt_addr_r; -fi -done diff --git a/packaging/u-boot-rpi3.spec b/packaging/u-boot-rpi3.spec index 80a4e5191e..ce3b91fe42 100644 --- a/packaging/u-boot-rpi3.spec +++ b/packaging/u-boot-rpi3.spec @@ -66,7 +66,7 @@ mkenvimage -s 16384 -o uboot.env default_envs.txt rm copy_env_common.o default_envs.txt # Build boot.scr -mkimage -A arm64 -T script -C none -n "Tizen RPI3 u-boot helper" -d ./board/raspberrypi/rpi/tizen-boot.scr ./boot.scr.uimg +mkimage -A arm64 -T script -C none -n "Tizen RPI3 u-boot helper" -d ./board/raspberrypi/rpi/tizen-boot-rpi3.scr ./boot.scr.uimg %install rm -rf %{buildroot}