script: add the boot_script for rpi3
authorJaehoon Chung <jh80.chung@samsung.com>
Mon, 27 Mar 2017 09:36:16 +0000 (18:36 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Thu, 10 Oct 2019 04:38:38 +0000 (13:38 +0900)
Add the boot_script for rpi3.
It will load this boot script from ditro_bootcmd.
Usage:
$./tools/mkimage -A arm64 -T script -C none -n "Tizen RPI3 u-boot helper"
-d ./board/raspberrypi/rpi/tizen-boot.scr ./boot.scr.uimg

Change-Id: Ia468ee8ce4368c3776b8b9b48fb0d91c1d01db08
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
board/raspberrypi/rpi/tizen-boot.scr [new file with mode: 0644]

diff --git a/board/raspberrypi/rpi/tizen-boot.scr b/board/raspberrypi/rpi/tizen-boot.scr
new file mode 100644 (file)
index 0000000..4475d58
--- /dev/null
@@ -0,0 +1,53 @@
+# U-boot script for tizen
+boardname=rpi3
+mmcbootdev=0
+mmcbootpart=1
+mmcrootdev=0
+mmcrootpart=2
+mmcusrpart=5
+
+dummy=0x24000000
+fotaname=fota
+
+ramdisksize=800000
+
+# Normal ramdisk : partition 7
+# Ramdisk Recovery : Partition 8
+ramdiskdev=0
+
+# Device that included the image.
+bootdev=mmc
+
+if test -e $bootdev $mmcbootdev:$mmcusrpart $fotaname; then;
+ramdiskpart=8
+bootmode=fota
+else
+ramdiskpart=7
+bootmode=normal
+fi
+
+# Device for booting from ram0
+bootramdev=ram0
+
+# 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 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\"
+
+# Find the ramdisk offset and block count
+part start $bootdev $ramdiskdev $ramdiskpart ramdisk_start
+part size $bootdev $ramdiskdev $ramdiskpart ramdisk_size
+
+echo "Searching for kernel in"; for prefix in $boot_prefixes; do
+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;
+       booti $kernel_addr_r $ramdisk_addr_r:$ramdisksize $fdt_addr_r;
+fi
+done