--- /dev/null
+# 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
+++ /dev/null
-# 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
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}