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