1 # U-boot script for tizen RPI4
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,0xfe215040"
55 echo "console: ${console}"
58 setenv fdtfile \"bcm2711-rpi-4-b.dtb\"
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 load $bootdev $mmcbootdev:$mmcbootpart $fdt_addr $fdtfile;
76 if test -e $bootdev $mmcrootdev:$ramdiskpart sbin/init; then;
77 echo "Loading Ramdisk from partition"${ramdiskpart};
78 $bootdev read $ramdisk_addr_r $ramdisk_start $ramdisk_size;
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;