1 # U-boot script for tizen RPI3
3 if test "${target}" = "mmc0"; then;
6 if test "${target}" = "usb0"; then;
10 echo "Tizen: checking partition layout on boot device"
13 if test -e $bootdev $mmcbootdev:$mmcinformpart $rebootparamfile; then;
14 ext4load $bootdev $mmcbootdev:$mmcinformpart $rebootparam_addr $rebootparamfile;
15 if itest.l *${rebootparam_addr} == ${upgrade_val}; then;
18 elif itest.l *${rebootparam_addr} == ${recovery_val}; then;
20 setenv bootmode recovery
21 elif itest.l *${rebootparam_addr} == ${download_val}; then;
24 elif itest.l *${rebootparam_addr} == ${nodef_val}; then;
25 echo "This reboot parameter is not supported...";
29 # This is for jumping to flash mode on u-boot.
30 if test "${bootmode}" = "download"; then;
35 if test "${bootmode}" = "flash"; then;
36 if test -n "${ipaddr}"; then;
37 ip_opt=\"ip=${ipaddr}::${gateway}:${netmask}\"
41 # boot from ram0 if there is sbin
42 if test -e $bootdev $mmcrootdev:$ramdiskpart sbin/init; then;
45 if test "${bootdev}" = "mmc"; then;
46 setenv rootdev mmcblk${mmcrootdev}p${mmcrootpart}
48 if test "${bootdev}" = "usb"; then;
49 setenv rootdev sda${mmcrootpart}
51 setenv bootmode normal
54 # setting console device if noting is set
55 if test -z "${console}"; then;
56 setenv console "console=ttyS0,115200n8 earlycon=uart8250,mmio32,0x3f215040"
58 echo "console: ${console}"
61 if itest.l ${board_rev} == 0xd; then;
62 setenv fdtfile \"bcm2710-rpi-3-b-plus.dtb\"
64 setenv fdtfile \"bcm2710-rpi-3-b.dtb\"
66 setenv boot_prefixes \"/\"
68 # To use cmdline for using serial console. /* Normal mode */
69 setenv bootargs \"${tizen_bootarg} smsc95xx.macaddr=${ethaddr} root=/dev/${rootdev} rw bootmode=${bootmode} rootwait ${console} ${opts} ${ip_opt}\"
71 # Find the ramdisk offset and block count
72 part start $bootdev $mmcrootdev $ramdiskpart ramdisk_start
73 part size $bootdev $mmcrootdev $ramdiskpart ramdisk_size
75 # Set to ramdisksize with real partition size. (Need to multiply block-size 0x200)
76 setexpr ramdisksize $ramdisk_size * 200
77 setexpr tizen_kernel_addr_r $ramdisk_addr_r + $ramdisksize
79 echo "Searching for kernel in"; for prefix in $boot_prefixes; do
80 if load $bootdev $mmcbootdev:$mmcbootpart $tizen_kernel_addr_r $prefix$kernel; then;
81 echo ${bootmode} "boot";
82 load $bootdev $mmcbootdev:$mmcbootpart $fdt_addr $fdtfile;
83 if test -e $bootdev $mmcrootdev:$ramdiskpart sbin/init; then;
84 echo "Loading Ramdisk from partition"${ramdiskpart};
85 $bootdev read $ramdisk_addr_r $ramdisk_start $ramdisk_size;
88 if test "$kernel" = "zImage"; then;
89 bootz $tizen_kernel_addr_r $ramdisk_addr_r:$ramdisksize $fdt_addr;
91 booti $tizen_kernel_addr_r $ramdisk_addr_r:$ramdisksize $fdt_addr;