blob: c088ec4cb08f76b91c6efce089b316416c0c6dc8 [file] [log] [blame]
Shawn Guo3af65c32016-04-08 11:06:42 +08001 U-Boot for Odroid X2/U3/XU3/XU4
Przemyslaw Marczak73eca212014-09-01 13:50:53 +02002========================
3
41. Summary
5==========
Hyungwon Hwangd10e9532014-12-12 14:45:46 +09006This is a quick instruction for setup Odroid boards.
7Board config: odroid_config for X2/U3
Shawn Guo3af65c32016-04-08 11:06:42 +08008Board config: odroid-xu3_config for XU3/XU4
Przemyslaw Marczak73eca212014-09-01 13:50:53 +02009
102. Supported devices
11====================
Hyungwon Hwangd10e9532014-12-12 14:45:46 +090012This U-BOOT config can be used on three boards:
Przemyslaw Marczak73eca212014-09-01 13:50:53 +020013- Odroid U3
14- Odroid X2
15with CPU Exynos 4412 rev 2.0 and 2GB of RAM
Hyungwon Hwangd10e9532014-12-12 14:45:46 +090016- Odroid XU3
Shawn Guo3af65c32016-04-08 11:06:42 +080017- Odroid XU4
Hyungwon Hwangd10e9532014-12-12 14:45:46 +090018with CPU Exynos5422 and 2GB of RAM
Przemyslaw Marczak73eca212014-09-01 13:50:53 +020019
203. Boot sequence
21================
22iROM->BL1->(BL2 + TrustZone)->U-BOOT
23
Hyungwon Hwangd10e9532014-12-12 14:45:46 +090024This version of U-BOOT doesn't implement SPL. So, BL1, BL2, and TrustZone
25binaries are needed to boot up.
26
27<< X2/U3 >>
28It can be found in "boot.tar.gz" from here:
Przemyslaw Marczak73eca212014-09-01 13:50:53 +020029http://dev.odroid.com/projects/4412boot/wiki/FrontPage?action=download&value=boot.tar.gz
30or here:
31http://odroid.in/guides/ubuntu-lfs/boot.tar.gz
32
Shawn Guo3af65c32016-04-08 11:06:42 +080033<< XU3/XU4 >>
Hyungwon Hwangd10e9532014-12-12 14:45:46 +090034It can be downloaded from:
Shawn Guo3af65c32016-04-08 11:06:42 +080035https://github.com/hardkernel/u-boot/tree/odroidxu3-v2012.07/sd_fuse/hardkernel_1mb_uboot
Hyungwon Hwangd10e9532014-12-12 14:45:46 +090036
37
Przemyslaw Marczak73eca212014-09-01 13:50:53 +0200384. Boot media layout
39====================
Bin Menga1875592016-02-05 19:30:11 -080040The table below shows SD/eMMC cards layout for U-Boot.
Przemyslaw Marczak73eca212014-09-01 13:50:53 +020041The block offset is starting from 0 and the block size is 512B.
42 -------------------------------------
43| Binary | Block offset| part type |
44| name | SD | eMMC |(eMMC only)|
45 -------------------------------------
46| Bl1 | 1 | 0 | 1 (boot) |
47| Bl2 | 31 | 30 | 1 (boot) |
Bin Menga1875592016-02-05 19:30:11 -080048| U-Boot | 63 | 62 | 1 (boot) |
Przemyslaw Marczak73eca212014-09-01 13:50:53 +020049| Tzsw | 2111 | 2110 | 1 (boot) |
Hyungwon Hwangd10e9532014-12-12 14:45:46 +090050| Uboot Env | 2560 | 2560 | 0 (user) |
Przemyslaw Marczak73eca212014-09-01 13:50:53 +020051 -------------------------------------
52
535. Prepare the SD boot card - with SD card reader
54=================================================
55To prepare bootable media you need boot binaries provided by hardkernel.
Hyungwon Hwangd10e9532014-12-12 14:45:46 +090056From the downloaded files, You can find:
57- bl1.bin
58- tzsw.bin
59- bl2.bin
Przemyslaw Marczak73eca212014-09-01 13:50:53 +020060- sd_fusing.sh
61- u-boot.bin
Hyungwon Hwangd10e9532014-12-12 14:45:46 +090062(The file names can be slightly different, but you can distinguish what they are
63without problem)
Przemyslaw Marczak73eca212014-09-01 13:50:53 +020064
65This is all you need to boot this board. But if you want to use your custom
Bin Menga1875592016-02-05 19:30:11 -080066U-Boot then you need to change u-boot.bin with your own U-Boot binary*
Przemyslaw Marczak73eca212014-09-01 13:50:53 +020067and run the script "sd_fusing.sh" - this script is valid only for SD card.
68
69*note:
Bin Menga1875592016-02-05 19:30:11 -080070The proper binary file of current U-Boot is u-boot-dtb.bin.
Przemyslaw Marczak73eca212014-09-01 13:50:53 +020071
72quick steps for Linux:
Hyungwon Hwangd10e9532014-12-12 14:45:46 +090073- Download all files from the link at point 3 and extract it if needed.
Przemyslaw Marczak73eca212014-09-01 13:50:53 +020074- put any SD card into the SD reader
75- check the device with "dmesg"
76- run ./sd_fusing.sh /dev/sdX - where X is SD card device (but not a partition)
Bin Menga1875592016-02-05 19:30:11 -080077Check if Hardkernel U-Boot is booting, and next do the same with your U-Boot.
Przemyslaw Marczak73eca212014-09-01 13:50:53 +020078
796. Prepare the eMMC boot card
80 with a eMMC card reader (boot from eMMC card slot)
81=====================================================
82To boot the device from the eMMC slot you should use a special card reader
Hyungwon Hwangd10e9532014-12-12 14:45:46 +090083which supports eMMC partition switch. All of the boot binaries are stored
Przemyslaw Marczak73eca212014-09-01 13:50:53 +020084on the eMMC boot partition which is normally hidden.
85
86The "sd_fusing.sh" script can be used after updating offsets of binaries
87according to the table from point 4. Be sure that you are working on the right
88eMMC partition - its size is usually very small, about 1-4 MiB.
89
907. Prepare the eMMC boot card
91 with a SD card reader (boot from SD card slot)
92=================================================
93If you have an eMMC->microSD adapter you can prepare the card as in point 5.
94But then the device can boot only from the SD card slot.
95
Bin Menga1875592016-02-05 19:30:11 -0800968. Prepare the boot media using Hardkernel U-Boot
Przemyslaw Marczak73eca212014-09-01 13:50:53 +020097=================================================
Bin Menga1875592016-02-05 19:30:11 -080098You can update the U-Boot to the custom one if you have a working bootloader
Hyungwon Hwangd10e9532014-12-12 14:45:46 +090099delivered with the board on the eMMC/SD card. Then follow the steps:
Przemyslaw Marczak73eca212014-09-01 13:50:53 +0200100- install the android fastboot tool
101- connect a micro usb cable to the board
Bin Menga1875592016-02-05 19:30:11 -0800102- on the U-Boot prompt, run command: fastboot (as a root)
Przemyslaw Marczak73eca212014-09-01 13:50:53 +0200103- on the host, run command: "fastboot flash bootloader u-boot-dtb.bin"
Bin Menga1875592016-02-05 19:30:11 -0800104- the custom U-Boot should start after the board resets.
Przemyslaw Marczak73eca212014-09-01 13:50:53 +0200105
1069. Partition layout
107====================
Bin Menga1875592016-02-05 19:30:11 -0800108Default U-Boot environment is setup for fixed partition layout.
Przemyslaw Marczak73eca212014-09-01 13:50:53 +0200109
110Partition table: MSDOS. Disk layout and files as listed in the table below.
111 ----- ------ ------ ------ -------- ---------------------------------
112| Num | Name | FS | Size | Offset | Reguired files |
113| | | Type | MiB | MiB | |
114 ----- ------ ------ ------ -------- ---------------------------------
115| 1 | BOOT | fat | 100 | 2 | kernel, fdt** |
116| 2 | ROOT | ext4 | - | | any Linux system |
117 ----- ------ ------ ------ -------- ---------------------------------
118
119**note:
120Supported fdt files are:
121- exynos4412-odroidx2.dtb
122- exynos4412-odroidu3.dtb
Hyungwon Hwangd10e9532014-12-12 14:45:46 +0900123- exynos5422-odroidxu3.dtb
Shawn Guo3af65c32016-04-08 11:06:42 +0800124- exynos5422-odroidxu4.dtb
Przemyslaw Marczak73eca212014-09-01 13:50:53 +0200125
126Supported kernel files are:
127- Image.itb
128- zImage
129- uImage
130
131The default environmental variable "dfu_alt_info" is set* for above layout.
132Each partition size is just an example, dfu_alt_info tries init two partitions.
133The size of each is not important.
134
135*note:
136$dfu_alt_info is set on a boot time and it is concatenated using two variables:
137- $dfu_alt_boot(set dynamically)
138- $dfu_alt_system(from current env).
139
140To add any changes to dfu_alt_info - please modify $dfu_alt_system only.
141Changes are visible after board reset.
142
14310. The environment and booting the kernel
144==========================================
145There are three macros defined in config for various boot options:
146Two for both, kernel with device tree support and also without it:
147- boot_uimg - load uImage
148- boot_zimg - load zImage
149If proper fdt file exists then it will be automatically loaded,
150so for old kernel types, please remove fdt file from boot partition.
151
152The third boot option for multi image support (more info: doc/uImage.FIT/)
153- boot_fit - for binary file: "Image.itb"
154
155Default boot command: "autoboot"
156And the boot sequence is:
157- boot_fit - if "Image.itb" exists
158- boot_zimg - if "zImage" exists
159- boot_uimg - if "uImage" exists
Suriyan Ramasamic8322be2014-11-20 17:26:29 -0800160
16111. USB host support
162====================
Hyungwon Hwangd10e9532014-12-12 14:45:46 +0900163NOTE: This section is only for Odroid X2/U3.
Suriyan Ramasamic8322be2014-11-20 17:26:29 -0800164
165The ethernet can be accessed after starting the USB subsystem in U-Boot.
166The adapter does not come with a preconfigured MAC address, and hence it needs
167to be set before starting USB.
168setenv usbethaddr 02:DE:AD:BE:EF:FF
169
170Note that in this example a locally managed MAC address is chosen. Care should
171be taken to make these MAC addresses unique within the same subnet.
172
173Start the USB subsystem:
174Odroid # setenv usbethaddr 02:DE:AD:BE:EF:FF
175Odroid # usb start
176(Re)start USB...
177USB0: USB EHCI 1.00
178scanning bus 0 for devices... 4 USB Device(s) found
179 scanning usb for storage devices... 1 Storage Device(s) found
180 scanning usb for ethernet devices... 1 Ethernet Device(s) found
181Odroid #
182
183Automatic IP assignment:
184------------------------
185If the ethernet is connected to a DHCP server (router maybe with DHCP enabled),
186then the below will automatically assign an ip address through DHCP.
187setenv autoload no
188dhcp
189
190Odroid # setenv autoload no
191Odroid # dhcp
192Waiting for Ethernet connection... done.
193BOOTP broadcast 1
194DHCP client bound to address 192.168.1.10 (524 ms)
195Odroid #
196
197Note that this automatically sets the many IP address related variables in
198U-Boot that is obtained from the DHCP server.
199
200Odroid # printenv ipaddr netmask gatewayip dnsip
201ipaddr=192.168.1.10
202netmask=255.255.255.0
203gatewayip=192.168.1.1
204dnsip=192.168.1.1
205
206Ping example:
207The ping command can be used a test to check connectivity. In this example,
208192.168.1.27 is a pingable server in the network.
209Odroid # ping 192.168.1.27
210Waiting for Ethernet connection... done.
211Using sms0 device
212host 192.168.1.27 is alive
213Odroid #
214
215Static IP assignment:
216---------------------
217In the case where there are no DHCP servers in the network, or you want to
218set the IP address statically, it can be done by:
219Odroid # setenv ipaddr 192.168.1.10
220Odroid # ping 192.168.1.27
221Waiting for Ethernet connection... done.
222Using sms0 device
223host 192.168.1.27 is alive
224
225TFTP booting:
226-------------
227Say there exists a tftp server in the network with address 192.168.1.27 and
228it serves a kernel image (zImage.3.17) and a DTB blob (exynos4412-odroidu3.dtb)
229that needs to be loaded and booted. It can be accomplished as below:
230(Assumes that you have setenv usbethaddr, and have not set autoload to no)
231
232Odroid # setenv serverip 192.168.1.27
233Odroid # tftpboot 0x40080000 zImage.3.17
234Waiting for Ethernet connection... done.
235Using sms0 device
236TFTP from server 192.168.1.27; our IP address is 192.168.1.10
237Filename 'zImage.3.17'.
238Load address: 0x40080000
239Loading: #################################################################
240 #################################################################
241 #################################################################
242 #######################
243 52.7 KiB/s
244done
245Bytes transferred = 3194200 (30bd58 hex)
246Odroid # tftpboot 0x42000000 exynos4412-odroidu3.dtb
247Waiting for Ethernet connection... done.
248Using sms0 device
249TFTP from server 192.168.1.27; our IP address is 192.168.1.10
250Filename 'exynos4412-odroidu3.dtb'.
251Load address: 0x42000000
252Loading: ####
253 40 KiB/s
254done
255Bytes transferred = 46935 (b757 hex)
256Odroid # printenv bootargs
257bootargs=Please use defined boot
258Odroid # setenv bootargs console=ttySAC1,115200n8 root=/dev/mmcblk0p2 rootwait
259Odroid # bootz 40080000 - 42000000
260Kernel image @ 0x40080000 [ 0x000000 - 0x30bd58 ]
261## Flattened Device Tree blob at 42000000
262 Booting using the fdt blob at 0x42000000
263 Loading Device Tree to 4fff1000, end 4ffff756 ... OK
264
265Starting kernel ...
266
267[ 0.000000] Booting Linux on physical CPU 0xa00
268... etc ...
269
270In the above example you can substitute 'dhcp' for 'tftpboot' as well.
271
272USB Storage booting:
273--------------------
274Similarly we can use the USB storage to load the kernel image/initrd/fdt etc
275and boot. For this example, there is a USB drive plugged in. It has a FAT
2761st partition and an EXT 2nd partition. Using the generic FS (ls/load) makes
277it even easier to work with FAT/EXT file systems.
278For this example the second EXT partition is used for booting and as rootfs.
279The boot files - kernel and the dtb are present in the /boot directory of the
280second partition.
281
282Odroid # usb start
283(Re)start USB...
284USB0: USB EHCI 1.00
285scanning bus 0 for devices... 4 USB Device(s) found
286 scanning usb for storage devices... 1 Storage Device(s) found
287 scanning usb for ethernet devices...
288Error: sms0 address not set. <----- Note the error as usbethaddr
289Warning: failed to set MAC address <----- is not set.
2901 Ethernet Device(s) found
291Odroid # usb part 0
292
293Partition Map for USB device 0 -- Partition Type: DOS
294
295Part Start Sector Num Sectors UUID Type
296 1 3072 263168 000c4046-01 06
297 2 266240 13457408 000c4046-02 83
298
299Odroid # ls usb 0:2 /boot
300<DIR> 4096 .
301<DIR> 4096 ..
302 353 boot.scr
303 281 boot.txt
304 101420 config-3.8.13.23
305 2127254 initrd.img-3.8.13.23
306 2194825 uInitrd
307 2194825 uInitrd-3.8.13.23
308 2453112 zImage
309 101448 config-3.8.13.26
310 2127670 uInitrd-3.8.13.26
311 2127606 initrd.img-3.8.13.26
312 3194200 zImage.3.17 <--- Kernel
313 46935 exynos4412-odroidu3.dtb <--- DTB
314Odroid # load usb 0:2 40080000 /boot/zImage.3.17
3153194200 bytes read in 471 ms (6.5 MiB/s)
316Odroid # load usb 0:2 42000000 /boot/exynos4412-odroidu3.dtb
31746935 bytes read in 233 ms (196.3 KiB/s)
318Odroid # setenv bootargs console=ttySAC1,115200n8 root=/dev/sda2 rootwait
319Odroid # bootz 40080000 - 42000000
320Kernel image @ 0x40080000 [ 0x000000 - 0x30bd58 ]
321## Flattened Device Tree blob at 42000000
322 Booting using the fdt blob at 0x42000000
323 Loading Device Tree to 4fff1000, end 4ffff756 ... OK
324
325Starting kernel ...
326
327[ 0.000000] Booting Linux on physical CPU 0xa00
328
329Please refer to README.usb for additional information.