1 # U-boot script for tizen VF2 and QEMU
3 if test -z "${devtype}"; then
4 setenv devtype "${bootdevtype}"
5 if test "${target}" = "virtio0"; then;
8 if test "${target}" = "mmc0" -o "${target}" = "mmc1"; then;
11 if test "${target}" = "usb0"; then;
15 if test "${devtype}" = "usb"; then;
16 setenv opts "${opts} rootdelay=2"
19 if test -e $devtype $devnum:$informpart $slotfile; then;
20 ext4load $devtype $devnum:$informpart $slot_addr $slotfile;
21 if itest.b *${slot_addr} == 0x62; then;
22 setenv ramdiskpart 0xf
25 echo "boot from slot_b";
30 echo "boot from slot_a";
36 echo "boot from slot_a";
39 if test -e $devtype $devnum:$informpart $rebootparamfile; then;
40 ext4load $devtype $devnum:$informpart $rebootparam_addr $rebootparamfile;
41 if itest.l *${rebootparam_addr} == ${upgrade_val}; then;
42 if test "${partition_ab}" = "b"; then
43 setenv ramdiskpart 0x10
50 elif itest.l *${rebootparam_addr} == ${recovery_val}; then;
51 if test "${partition_ab}" = "b"; then
52 setenv ramdiskpart 0x10
58 setenv bootmode recovery
59 elif itest.l *${rebootparam_addr} == ${download_val}; then;
60 if test "${partition_ab}" = "b"; then
61 setenv ramdiskpart 0x10
68 elif itest.l *${rebootparam_addr} == ${nodef_val}; then;
69 echo "This reboot parameter is not supported...";
73 # This is for jumping to flash mode on u-boot.
74 if test "${bootmode}" = "download"; then;
75 if test "${partition_ab}" = "b"; then
76 setenv ramdiskpart 0x10
85 if test "${bootmode}" = "flash"; then;
86 if test -n "${ipaddr}"; then;
87 ip_opt=\"ip=${ipaddr}::${gateway}:${netmask}\"
91 # boot from ramdisk if there is sbin
92 if test -e $devtype $devnum:$ramdiskpart sbin/init; then;
95 if test "${devtype}" = "mmc"; then;
96 setenv rootdev mmcblk${devnum}p${rootpart}
98 if test "${devtype}" = "usb"; then;
99 setenv rootdev sda${rootpart}
101 if test "${devtype}" = "virtio"; then;
102 setenv rootdev vda${rootpart}
104 setenv bootmode normal
107 # setting console device if noting is set
108 if test -z "${console}"; then;
109 setenv console "console=ttyS0,115200 earlycon"
111 echo "console: ${console}"
114 setenv boot_prefixes \"/\"
116 # To use cmdline for using serial console. /* Normal mode */
117 setenv bootargs \"${tizen_bootarg} root=/dev/${rootdev} rw bootmode=${bootmode} partition_ab=${partition_ab} rootwait ${console} ${opts} ${ip_opt} stmmaceth=chain_mode:1\"
119 # Find the ramdisk offset and block count
120 part start $devtype $devnum $ramdiskpart ramdisk_start
121 part size $devtype $devnum $ramdiskpart ramdisk_size
123 # Set to ramdisksize with real partition size. (Need to multiply block-size 0x200)
124 setexpr ramdisksize $ramdisk_size * 200
125 setexpr tizen_kernel_addr_r $ramdisk_addr_r + $ramdisksize
127 echo "Searching for kernel in"; for prefix in $boot_prefixes; do
128 if load $devtype $devnum:$distro_bootpart $tizen_kernel_addr_r $prefix$kernel; then;
129 echo ${bootmode} "boot";
131 if test -e $devtype $devnum:$ramdiskpart sbin/init; then;
132 echo "Loading Ramdisk from partition" ${part};
133 echo "Environment value of ramdiskpart is" ${ramdiskpart};
135 $devtype read $ramdisk_addr_r $ramdisk_start $ramdisk_size;
138 if test "${board_name}" = "qemu-riscv"; then
139 # If running in QEMU use the DeviceTree provided by
140 # the emulator. It is the most accurate description of
142 fdt move $fdt_addr $fdt_addr_r
144 load $devtype $devnum:$distro_bootpart $fdt_addr_r $prefix$fdtfile
146 booti $tizen_kernel_addr_r $ramdisk_addr_r:$ramdisksize $fdt_addr_r;