1 # U-boot script for tizen RPI4
3 if test "${target}" = "mmc0"; then;
6 if test "${target}" = "usb0"; then;
8 setenv opts "${opts} rootdelay=2"
11 if test -e $bootdev $mmcbootdev:$mmcinformpart $rebootparamfile; then;
12 ext4load $bootdev $mmcbootdev:$mmcinformpart $rebootparam_addr $rebootparamfile;
13 if itest.l *${rebootparam_addr} == ${upgrade_val}; then;
16 elif itest.l *${rebootparam_addr} == ${recovery_val}; then;
18 setenv bootmode recovery
19 elif itest.l *${rebootparam_addr} == ${download_val}; then;
22 elif itest.l *${rebootparam_addr} == ${nodef_val}; then;
23 echo "This reboot parameter is not supported...";
27 # This is for jumping to flash mode on u-boot.
28 if test "${bootmode}" = "download"; then;
33 if test "${bootmode}" = "flash"; then;
34 if test -n "${ipaddr}"; then;
35 ip_opt=\"ip=${ipaddr}::${gateway}:${netmask}\"
39 # boot from ram0 if there is sbin
40 if test -e $bootdev $mmcrootdev:$ramdiskpart sbin/init; then;
43 if test "${bootdev}" = "mmc"; then;
44 setenv rootdev mmcblk${mmcrootdev}p${mmcrootpart}
46 if test "${bootdev}" = "usb"; then;
47 setenv rootdev sda${mmcrootpart}
49 setenv bootmode normal
52 # setting console device if noting is set
53 if test -z "${console}"; then;
54 setenv console "console=ttyS0,115200n8 earlycon=uart8250,mmio32,0xfe215040"
56 echo "console: ${console}"
59 setenv boot_prefixes \"/\"
61 # To use cmdline for using serial console. /* Normal mode */
62 setenv bootargs \"${tizen_bootarg} root=/dev/${rootdev} rw bootmode=${bootmode} rootwait ${console} ${opts} ${ip_opt}\"
64 # Find the ramdisk offset and block count
65 part start $bootdev $mmcrootdev $ramdiskpart ramdisk_start
66 part size $bootdev $mmcrootdev $ramdiskpart ramdisk_size
68 # Set to ramdisksize with real partition size. (Need to multiply block-size 0x200)
69 setexpr ramdisksize $ramdisk_size * 200
70 setexpr tizen_kernel_addr_r $ramdisk_addr_r + $ramdisksize
72 echo "Searching for kernel in"; for prefix in $boot_prefixes; do
73 if load $bootdev $mmcbootdev:$mmcbootpart $tizen_kernel_addr_r $prefix$kernel; then;
74 echo ${bootmode} "boot";
75 if test -e $bootdev $mmcrootdev:$ramdiskpart sbin/init; then;
76 echo "Loading Ramdisk from partition"${ramdiskpart};
77 $bootdev read $ramdisk_addr_r $ramdisk_start $ramdisk_size;
80 # use fdt already preloaded by the firmware available at $fdt_addr
81 if test "$kernel" = "zImage"; then;
82 bootz $tizen_kernel_addr_r $ramdisk_addr_r:$ramdisksize $fdt_addr;
84 booti $tizen_kernel_addr_r $ramdisk_addr_r:$ramdisksize $fdt_addr;