1 # U-boot script for tizen Amlogic (Odroid-C4/N2, VIM3/VIM3L)
2 # Auto Detection of Monitor settings based on your Screen information
3 # Below values are from Hardkernel ubuntu-20.04.4.0-mate-odroid-c4-hc4-20201020.img
4 # (Hardkernel / Odroid-c4)
5 if test $board_name = "odroid-c4"; then
7 setenv display_autodetect "true"
8 setenv monitor_onoff "false" # true or false
11 setenv voutmode "hdmi"
12 setenv disablehpd "false"
14 setenv max_freq_a55 "1908" # 1.908 GHz, default value
17 # (Hardkernel) Normal HDMI Monitors
18 if test "${cec}" = "true"; then setenv cec_enable "hdmitx=cec3f"; fi
21 setenv boot_args \"voutmode=${voutmode} disablehpd=${disablehpd} overscan=${overscan} monitor_onoff=${monitor_onoff} gpiopower=479 \"
23 elif test $board_name = "odroid-n2"; then
24 # (Hardkernel / Odroid-n2)
25 # Auto Detection of Monitor settings based on your Screen information
26 setenv display_autodetect "true"
29 # Controls if HDMI PHY should output anything to the monitor
30 setenv monitor_onoff "false" # true or false
33 # This value scales down the actual screen size by the percentage below
34 # valid range is 80 to 100
37 ### voutmode : hdmi or dvi
38 setenv voutmode "hdmi"
39 # setenv voutmode "dvi"
41 # HPD enable/disable option
42 setenv disablehpd "false"
44 # max cpu frequency for big core, A73 in MHz unit
45 # setenv max_freq_a73 "2004" # 2.004 GHz
46 # setenv max_freq_a73 "1992" # 1.992 GHz
47 # setenv max_freq_a73 "1908" # 1.908 GHz
48 setenv max_freq_a73 "1800" # 1.8 GHz, default value
49 # setenv max_freq_a73 "1704" # 1.704 GHz
51 # max cpu frequency for little core, A53 in MHz unit
52 # setenv max_freq_a53 "1992" # 1.992 GHz
53 setenv max_freq_a53 "1896" # 1.896 GHz, default value
54 # setenv max_freq_a53 "1704" # 1.704 GHz
58 # CPU's 0 and 1 are the A53 (small cores)
59 # CPU's 2 to 5 are the A73 (big cores)
60 # Lowering this value disables only the bigger cores (the last cores).
66 setenv boot_args \"max_freq_a53=${max_freq_a53} max_freq_a73=${max_freq_a73} maxcpus=${maxcpus} voutmode=${voutmode} disablehpd=${disablehpd} overscan=${overscan} monitor_onoff=${monitor_onoff} \"
69 setenv tizen_tmp_kernel_addr_r "0x1000000"
71 # Enter to recovery mode if reboot_reason is recovery
72 if test "${reason}" = "recovery"; then;
74 setenv bootmode recovery
77 if test -e $bootdev $mmcbootdev:$mmcbootpart $fdtfile2; then;
78 setenv console console=ttyAML0,115200n8 earlycon
79 setenv fdtfile $fdtfile2
80 setenv boot_prefixes "/"
83 # setting console device if noting is set
84 if test -z "${console}"; then;
85 setenv console "console=ttyS0,115200n8 earlycon=aml-uart,0xff803000"
87 echo "console: ${console}"
92 # Find the ramdisk offset and block count
93 part start $bootdev $mmcrootdev $ramdiskpart ramdisk_start
94 part size $bootdev $mmcrootdev $ramdiskpart ramdisk_size
96 # Set to ramdisksize with real partition size. (Need to multiply block-size 0x200)
97 setexpr ramdisksize $ramdisk_size * 200
98 setexpr tizen_kernel_addr_r $ramdisk_addr_r + $ramdisksize
100 # boot from ram0 if there is sbin or it is initramfs
101 if test -e $bootdev $mmcrootdev:$ramdiskpart sbin/init; then;
103 echo "Loading Ramdisk from partition"${ramdiskpart};
104 mmc read $ramdisk_addr_r $ramdisk_start $ramdisk_size;
106 # Check for gzip (initramfs) magic
107 mmc read $ramdisk_addr_r $ramdisk_start 1;
108 if itest.w *$ramdisk_addr_r == 0x8b1f; then;
110 echo "Loading initramfs from partition ${ramdiskpart}";
111 mmc read $ramdisk_addr_r $ramdisk_start $ramdisk_size;
113 setenv rootdev mmcblk${mmcrootdev}p${mmcrootpart}
114 setenv bootmode normal
118 # To use comdline for using serial console. /* Normal mode */
119 setenv bootargs \"root=/dev/${rootdev} rootwait rw no_console_suspend fsck.repair=yes net.ifnames=0 elevator=noop hdmimode=${hdmimode} cvbsmode=576cvbs ${cmode} usb-xhci.tablesize=2 logo=osd0,loaded ${console} ${boot_args} ${opts}\"
121 echo "Searching for kernel in" $boot_prefixes; for prefix in $boot_prefixes; do
122 if load $bootdev $mmcbootdev:$mmcbootpart $tizen_tmp_kernel_addr_r $prefix$kernel; then;
123 echo ${bootmode} "boot";
124 echo "Found kernel ${kernel} in ${prefix}";
125 unzip ${tizen_tmp_kernel_addr_r} ${tizen_kernel_addr_r};
126 load $bootdev $mmcbootdev:$mmcbootpart $fdt_addr_r $fdtfile;
127 booti $tizen_kernel_addr_r $ramdisk_addr_r:$ramdisksize $fdt_addr_r;