1 U-Boot for Odroid X2/U3/XU3
2 ========================
6 This is a quick instruction for setup Odroid boards.
7 Board config: odroid_config for X2/U3
8 Board config: odroid-xu3_config for XU3
12 This U-BOOT config can be used on three boards:
15 with CPU Exynos 4412 rev 2.0 and 2GB of RAM
17 with CPU Exynos5422 and 2GB of RAM
21 iROM->BL1->(BL2 + TrustZone)->U-BOOT
23 This version of U-BOOT doesn't implement SPL. So, BL1, BL2, and TrustZone
24 binaries are needed to boot up.
27 It can be found in "boot.tar.gz" from here:
28 http://dev.odroid.com/projects/4412boot/wiki/FrontPage?action=download&value=boot.tar.gz
30 http://odroid.in/guides/ubuntu-lfs/boot.tar.gz
33 It can be downloaded from:
34 https://github.com/hardkernel/u-boot/tree/odroidxu3-v2012.07/sd_fuse/hardkernel
39 The table below shows SD/eMMC cards layout for U-Boot.
40 The block offset is starting from 0 and the block size is 512B.
41 -------------------------------------
42 | Binary | Block offset| part type |
43 | name | SD | eMMC |(eMMC only)|
44 -------------------------------------
45 | Bl1 | 1 | 0 | 1 (boot) |
46 | Bl2 | 31 | 30 | 1 (boot) |
47 | U-Boot | 63 | 62 | 1 (boot) |
48 | Tzsw | 2111 | 2110 | 1 (boot) |
49 | Uboot Env | 2560 | 2560 | 0 (user) |
50 -------------------------------------
52 5. Prepare the SD boot card - with SD card reader
53 =================================================
54 To prepare bootable media you need boot binaries provided by hardkernel.
55 From the downloaded files, You can find:
61 (The file names can be slightly different, but you can distinguish what they are
64 This is all you need to boot this board. But if you want to use your custom
65 U-Boot then you need to change u-boot.bin with your own U-Boot binary*
66 and run the script "sd_fusing.sh" - this script is valid only for SD card.
69 The proper binary file of current U-Boot is u-boot-dtb.bin.
71 quick steps for Linux:
72 - Download all files from the link at point 3 and extract it if needed.
73 - put any SD card into the SD reader
74 - check the device with "dmesg"
75 - run ./sd_fusing.sh /dev/sdX - where X is SD card device (but not a partition)
76 Check if Hardkernel U-Boot is booting, and next do the same with your U-Boot.
78 6. Prepare the eMMC boot card
79 with a eMMC card reader (boot from eMMC card slot)
80 =====================================================
81 To boot the device from the eMMC slot you should use a special card reader
82 which supports eMMC partition switch. All of the boot binaries are stored
83 on the eMMC boot partition which is normally hidden.
85 The "sd_fusing.sh" script can be used after updating offsets of binaries
86 according to the table from point 4. Be sure that you are working on the right
87 eMMC partition - its size is usually very small, about 1-4 MiB.
89 7. Prepare the eMMC boot card
90 with a SD card reader (boot from SD card slot)
91 =================================================
92 If you have an eMMC->microSD adapter you can prepare the card as in point 5.
93 But then the device can boot only from the SD card slot.
95 8. Prepare the boot media using Hardkernel U-Boot
96 =================================================
97 You can update the U-Boot to the custom one if you have a working bootloader
98 delivered with the board on the eMMC/SD card. Then follow the steps:
99 - install the android fastboot tool
100 - connect a micro usb cable to the board
101 - on the U-Boot prompt, run command: fastboot (as a root)
102 - on the host, run command: "fastboot flash bootloader u-boot-dtb.bin"
103 - the custom U-Boot should start after the board resets.
107 Default U-Boot environment is setup for fixed partition layout.
109 Partition table: MSDOS. Disk layout and files as listed in the table below.
110 ----- ------ ------ ------ -------- ---------------------------------
111 | Num | Name | FS | Size | Offset | Reguired files |
112 | | | Type | MiB | MiB | |
113 ----- ------ ------ ------ -------- ---------------------------------
114 | 1 | BOOT | fat | 100 | 2 | kernel, fdt** |
115 | 2 | ROOT | ext4 | - | | any Linux system |
116 ----- ------ ------ ------ -------- ---------------------------------
119 Supported fdt files are:
120 - exynos4412-odroidx2.dtb
121 - exynos4412-odroidu3.dtb
122 - exynos5422-odroidxu3.dtb
124 Supported kernel files are:
129 The default environmental variable "dfu_alt_info" is set* for above layout.
130 Each partition size is just an example, dfu_alt_info tries init two partitions.
131 The size of each is not important.
134 $dfu_alt_info is set on a boot time and it is concatenated using two variables:
135 - $dfu_alt_boot(set dynamically)
136 - $dfu_alt_system(from current env).
138 To add any changes to dfu_alt_info - please modify $dfu_alt_system only.
139 Changes are visible after board reset.
141 10. The environment and booting the kernel
142 ==========================================
143 There are three macros defined in config for various boot options:
144 Two for both, kernel with device tree support and also without it:
145 - boot_uimg - load uImage
146 - boot_zimg - load zImage
147 If proper fdt file exists then it will be automatically loaded,
148 so for old kernel types, please remove fdt file from boot partition.
150 The third boot option for multi image support (more info: doc/uImage.FIT/)
151 - boot_fit - for binary file: "Image.itb"
153 Default boot command: "autoboot"
154 And the boot sequence is:
155 - boot_fit - if "Image.itb" exists
156 - boot_zimg - if "zImage" exists
157 - boot_uimg - if "uImage" exists
161 NOTE: This section is only for Odroid X2/U3.
163 The ethernet can be accessed after starting the USB subsystem in U-Boot.
164 The adapter does not come with a preconfigured MAC address, and hence it needs
165 to be set before starting USB.
166 setenv usbethaddr 02:DE:AD:BE:EF:FF
168 Note that in this example a locally managed MAC address is chosen. Care should
169 be taken to make these MAC addresses unique within the same subnet.
171 Start the USB subsystem:
172 Odroid # setenv usbethaddr 02:DE:AD:BE:EF:FF
176 scanning bus 0 for devices... 4 USB Device(s) found
177 scanning usb for storage devices... 1 Storage Device(s) found
178 scanning usb for ethernet devices... 1 Ethernet Device(s) found
181 Automatic IP assignment:
182 ------------------------
183 If the ethernet is connected to a DHCP server (router maybe with DHCP enabled),
184 then the below will automatically assign an ip address through DHCP.
188 Odroid # setenv autoload no
190 Waiting for Ethernet connection... done.
192 DHCP client bound to address 192.168.1.10 (524 ms)
195 Note that this automatically sets the many IP address related variables in
196 U-Boot that is obtained from the DHCP server.
198 Odroid # printenv ipaddr netmask gatewayip dnsip
200 netmask=255.255.255.0
201 gatewayip=192.168.1.1
205 The ping command can be used a test to check connectivity. In this example,
206 192.168.1.27 is a pingable server in the network.
207 Odroid # ping 192.168.1.27
208 Waiting for Ethernet connection... done.
210 host 192.168.1.27 is alive
213 Static IP assignment:
214 ---------------------
215 In the case where there are no DHCP servers in the network, or you want to
216 set the IP address statically, it can be done by:
217 Odroid # setenv ipaddr 192.168.1.10
218 Odroid # ping 192.168.1.27
219 Waiting for Ethernet connection... done.
221 host 192.168.1.27 is alive
225 Say there exists a tftp server in the network with address 192.168.1.27 and
226 it serves a kernel image (zImage.3.17) and a DTB blob (exynos4412-odroidu3.dtb)
227 that needs to be loaded and booted. It can be accomplished as below:
228 (Assumes that you have setenv usbethaddr, and have not set autoload to no)
230 Odroid # setenv serverip 192.168.1.27
231 Odroid # tftpboot 0x40080000 zImage.3.17
232 Waiting for Ethernet connection... done.
234 TFTP from server 192.168.1.27; our IP address is 192.168.1.10
235 Filename 'zImage.3.17'.
236 Load address: 0x40080000
237 Loading: #################################################################
238 #################################################################
239 #################################################################
240 #######################
243 Bytes transferred = 3194200 (30bd58 hex)
244 Odroid # tftpboot 0x42000000 exynos4412-odroidu3.dtb
245 Waiting for Ethernet connection... done.
247 TFTP from server 192.168.1.27; our IP address is 192.168.1.10
248 Filename 'exynos4412-odroidu3.dtb'.
249 Load address: 0x42000000
253 Bytes transferred = 46935 (b757 hex)
254 Odroid # printenv bootargs
255 bootargs=Please use defined boot
256 Odroid # setenv bootargs console=ttySAC1,115200n8 root=/dev/mmcblk0p2 rootwait
257 Odroid # bootz 40080000 - 42000000
258 Kernel image @ 0x40080000 [ 0x000000 - 0x30bd58 ]
259 ## Flattened Device Tree blob at 42000000
260 Booting using the fdt blob at 0x42000000
261 Loading Device Tree to 4fff1000, end 4ffff756 ... OK
265 [ 0.000000] Booting Linux on physical CPU 0xa00
268 In the above example you can substitute 'dhcp' for 'tftpboot' as well.
272 Similarly we can use the USB storage to load the kernel image/initrd/fdt etc
273 and boot. For this example, there is a USB drive plugged in. It has a FAT
274 1st partition and an EXT 2nd partition. Using the generic FS (ls/load) makes
275 it even easier to work with FAT/EXT file systems.
276 For this example the second EXT partition is used for booting and as rootfs.
277 The boot files - kernel and the dtb are present in the /boot directory of the
283 scanning bus 0 for devices... 4 USB Device(s) found
284 scanning usb for storage devices... 1 Storage Device(s) found
285 scanning usb for ethernet devices...
286 Error: sms0 address not set. <----- Note the error as usbethaddr
287 Warning: failed to set MAC address <----- is not set.
288 1 Ethernet Device(s) found
291 Partition Map for USB device 0 -- Partition Type: DOS
293 Part Start Sector Num Sectors UUID Type
294 1 3072 263168 000c4046-01 06
295 2 266240 13457408 000c4046-02 83
297 Odroid # ls usb 0:2 /boot
302 101420 config-3.8.13.23
303 2127254 initrd.img-3.8.13.23
305 2194825 uInitrd-3.8.13.23
307 101448 config-3.8.13.26
308 2127670 uInitrd-3.8.13.26
309 2127606 initrd.img-3.8.13.26
310 3194200 zImage.3.17 <--- Kernel
311 46935 exynos4412-odroidu3.dtb <--- DTB
312 Odroid # load usb 0:2 40080000 /boot/zImage.3.17
313 3194200 bytes read in 471 ms (6.5 MiB/s)
314 Odroid # load usb 0:2 42000000 /boot/exynos4412-odroidu3.dtb
315 46935 bytes read in 233 ms (196.3 KiB/s)
316 Odroid # setenv bootargs console=ttySAC1,115200n8 root=/dev/sda2 rootwait
317 Odroid # bootz 40080000 - 42000000
318 Kernel image @ 0x40080000 [ 0x000000 - 0x30bd58 ]
319 ## Flattened Device Tree blob at 42000000
320 Booting using the fdt blob at 0x42000000
321 Loading Device Tree to 4fff1000, end 4ffff756 ... OK
325 [ 0.000000] Booting Linux on physical CPU 0xa00
327 Please refer to README.usb for additional information.