1 # U-boot script for tizen
10 # Tizen kernel image is over than 16MB, it will be overlapped with other address.
11 # To avoid this behaivor, change to 0x02d00000 from 0x01000000
13 # NOTE: booti command will move kernel image to 0x80000 (text offset), and
14 # ramdisk is loaded to $ramdisk_addr_r (0x02100000), so kernel should be equal
15 # or less than 32.5MB to load ramdisk properly.
17 tizen_kernel_addr_r=0x02d00000
20 rebootparamfile=reboot-param.bin
21 # use the ram address of ramdisk before loading ramdisk image
22 rebootparam_addr=0x3a62b000
23 # 0x72677075 is ascii code for representing string "upgr"
25 # 0x72766372 is ascii code for representing string "rcvr"
27 # 0x6665646e is ascii code for representing string "ndef"
29 # 0x6c6e7764 is ascii code for representing string "dwnl"
32 # Normal ramdisk : partition 7
33 # Ramdisk Recovery : Partition 8
38 # Device that included the image.
41 if test -e $bootdev $mmcbootdev:$mmcinformpart $rebootparamfile; then;
42 ext4load $bootdev $mmcbootdev:$mmcinformpart $rebootparam_addr $rebootparamfile;
43 if itest.l *${rebootparam_addr} == ${upgrade_val}; then;
47 elif itest.l *${rebootparam_addr} == ${recovery_val}; then;
51 elif itest.l *${rebootparam_addr} == ${download_val}; then;
55 elif itest.l *${rebootparam_addr} == ${nodef_val}; then;
56 echo "This reboot parameter is not supported...";
60 if test "${bootmode}" = "flash"; then;
61 if test -n "${ipaddr}"; then;
62 ip_opt=\"ip=${ipaddr}::${gateway}:${netmask}\"
68 # boot from ram0 if there is sbin
69 if test -e $bootdev $mmcrootdev:$ramdiskpart sbin/init; then;
72 rootdev=mmcblk${mmcrootdev}p${mmcrootpart}
76 # setting console device if noting is set
77 if test -z "${console}"; then;
78 setenv console "console=ttyS0,115200n8 earlycon=uart8250,mmio32,0x3f215040"
80 echo "console: ${console}"
85 if itest.l ${board_rev} == 0xd; then;
86 setenv fdtfile \"bcm2710-rpi-3-b-plus.dtb\"
88 setenv fdtfile \"bcm2710-rpi-3-b.dtb\"
90 setenv boot_prefixes \"/\"
92 # To use comdline for using serial console. /* Normal mode */
93 setenv bootargs \"8250.nr_uarts=1 dma.dmachans=0x7f35 bcm2709.serial=0xed6687d3 bcm2709.uart_clock=48000000 smsc95xx.macaddr=${ethaddr} root=/dev/${rootdev} rw bootmode=${bootmode} bcm2709.boardrev=0xa02082 rootwait ${console} vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000 dwc_otg.lpm_enable=0 ${opts} ${ip_opt}\"
95 # Find the ramdisk offset and block count
96 part start $bootdev $mmcrootdev $ramdiskpart ramdisk_start
97 part size $bootdev $mmcrootdev $ramdiskpart ramdisk_size
99 echo "Searching for kernel in"; for prefix in $boot_prefixes; do
100 if load $bootdev $mmcbootdev:$mmcbootpart $tizen_kernel_addr_r $prefix$kernel; then;
101 echo ${bootmode} "boot";
102 load $bootdev $mmcbootdev:$mmcbootpart $fdt_addr_r $fdtfile;
103 if test -e mmc $mmcrootdev:$ramdiskpart sbin/init; then;
104 echo "Loading Ramdisk from partition"${ramdiskpart};
105 mmc read $ramdisk_addr_r $ramdisk_start $ramdisk_size;
107 booti $tizen_kernel_addr_r $ramdisk_addr_r:$ramdisksize $fdt_addr_r;