blob: ef243d1bde3667a7a52c64085a41cbffe2f417ae [file] [log] [blame]
Bin Meng75574052016-02-05 19:30:11 -08001 U-Boot for Odroid X2/U3/XU3
Przemyslaw Marczaka314d9e2014-09-01 13:50:53 +02002========================
3
41. Summary
5==========
Hyungwon Hwangf8cb12d2014-12-12 14:45:46 +09006This is a quick instruction for setup Odroid boards.
7Board config: odroid_config for X2/U3
8Board config: odroid-xu3_config for XU3
Przemyslaw Marczaka314d9e2014-09-01 13:50:53 +02009
102. Supported devices
11====================
Hyungwon Hwangf8cb12d2014-12-12 14:45:46 +090012This U-BOOT config can be used on three boards:
Przemyslaw Marczaka314d9e2014-09-01 13:50:53 +020013- Odroid U3
14- Odroid X2
15with CPU Exynos 4412 rev 2.0 and 2GB of RAM
Hyungwon Hwangf8cb12d2014-12-12 14:45:46 +090016- Odroid XU3
17with CPU Exynos5422 and 2GB of RAM
Przemyslaw Marczaka314d9e2014-09-01 13:50:53 +020018
193. Boot sequence
20================
21iROM->BL1->(BL2 + TrustZone)->U-BOOT
22
Hyungwon Hwangf8cb12d2014-12-12 14:45:46 +090023This version of U-BOOT doesn't implement SPL. So, BL1, BL2, and TrustZone
24binaries are needed to boot up.
25
26<< X2/U3 >>
27It can be found in "boot.tar.gz" from here:
Przemyslaw Marczaka314d9e2014-09-01 13:50:53 +020028http://dev.odroid.com/projects/4412boot/wiki/FrontPage?action=download&value=boot.tar.gz
29or here:
30http://odroid.in/guides/ubuntu-lfs/boot.tar.gz
31
Hyungwon Hwangf8cb12d2014-12-12 14:45:46 +090032<< XU3 >>
33It can be downloaded from:
34https://github.com/hardkernel/u-boot/tree/odroidxu3-v2012.07/sd_fuse/hardkernel
35
36
Przemyslaw Marczaka314d9e2014-09-01 13:50:53 +0200374. Boot media layout
38====================
Bin Meng75574052016-02-05 19:30:11 -080039The table below shows SD/eMMC cards layout for U-Boot.
Przemyslaw Marczaka314d9e2014-09-01 13:50:53 +020040The 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) |
Bin Meng75574052016-02-05 19:30:11 -080047| U-Boot | 63 | 62 | 1 (boot) |
Przemyslaw Marczaka314d9e2014-09-01 13:50:53 +020048| Tzsw | 2111 | 2110 | 1 (boot) |
Hyungwon Hwangf8cb12d2014-12-12 14:45:46 +090049| Uboot Env | 2560 | 2560 | 0 (user) |
Przemyslaw Marczaka314d9e2014-09-01 13:50:53 +020050 -------------------------------------
51
525. Prepare the SD boot card - with SD card reader
53=================================================
54To prepare bootable media you need boot binaries provided by hardkernel.
Hyungwon Hwangf8cb12d2014-12-12 14:45:46 +090055From the downloaded files, You can find:
56- bl1.bin
57- tzsw.bin
58- bl2.bin
Przemyslaw Marczaka314d9e2014-09-01 13:50:53 +020059- sd_fusing.sh
60- u-boot.bin
Hyungwon Hwangf8cb12d2014-12-12 14:45:46 +090061(The file names can be slightly different, but you can distinguish what they are
62without problem)
Przemyslaw Marczaka314d9e2014-09-01 13:50:53 +020063
64This is all you need to boot this board. But if you want to use your custom
Bin Meng75574052016-02-05 19:30:11 -080065U-Boot then you need to change u-boot.bin with your own U-Boot binary*
Przemyslaw Marczaka314d9e2014-09-01 13:50:53 +020066and run the script "sd_fusing.sh" - this script is valid only for SD card.
67
68*note:
Bin Meng75574052016-02-05 19:30:11 -080069The proper binary file of current U-Boot is u-boot-dtb.bin.
Przemyslaw Marczaka314d9e2014-09-01 13:50:53 +020070
71quick steps for Linux:
Hyungwon Hwangf8cb12d2014-12-12 14:45:46 +090072- Download all files from the link at point 3 and extract it if needed.
Przemyslaw Marczaka314d9e2014-09-01 13:50:53 +020073- 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)
Bin Meng75574052016-02-05 19:30:11 -080076Check if Hardkernel U-Boot is booting, and next do the same with your U-Boot.
Przemyslaw Marczaka314d9e2014-09-01 13:50:53 +020077
786. Prepare the eMMC boot card
79 with a eMMC card reader (boot from eMMC card slot)
80=====================================================
81To boot the device from the eMMC slot you should use a special card reader
Hyungwon Hwangf8cb12d2014-12-12 14:45:46 +090082which supports eMMC partition switch. All of the boot binaries are stored
Przemyslaw Marczaka314d9e2014-09-01 13:50:53 +020083on the eMMC boot partition which is normally hidden.
84
85The "sd_fusing.sh" script can be used after updating offsets of binaries
86according to the table from point 4. Be sure that you are working on the right
87eMMC partition - its size is usually very small, about 1-4 MiB.
88
897. Prepare the eMMC boot card
90 with a SD card reader (boot from SD card slot)
91=================================================
92If you have an eMMC->microSD adapter you can prepare the card as in point 5.
93But then the device can boot only from the SD card slot.
94
Bin Meng75574052016-02-05 19:30:11 -0800958. Prepare the boot media using Hardkernel U-Boot
Przemyslaw Marczaka314d9e2014-09-01 13:50:53 +020096=================================================
Bin Meng75574052016-02-05 19:30:11 -080097You can update the U-Boot to the custom one if you have a working bootloader
Hyungwon Hwangf8cb12d2014-12-12 14:45:46 +090098delivered with the board on the eMMC/SD card. Then follow the steps:
Przemyslaw Marczaka314d9e2014-09-01 13:50:53 +020099- install the android fastboot tool
100- connect a micro usb cable to the board
Bin Meng75574052016-02-05 19:30:11 -0800101- on the U-Boot prompt, run command: fastboot (as a root)
Przemyslaw Marczaka314d9e2014-09-01 13:50:53 +0200102- on the host, run command: "fastboot flash bootloader u-boot-dtb.bin"
Bin Meng75574052016-02-05 19:30:11 -0800103- the custom U-Boot should start after the board resets.
Przemyslaw Marczaka314d9e2014-09-01 13:50:53 +0200104
1059. Partition layout
106====================
Bin Meng75574052016-02-05 19:30:11 -0800107Default U-Boot environment is setup for fixed partition layout.
Przemyslaw Marczaka314d9e2014-09-01 13:50:53 +0200108
109Partition 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 ----- ------ ------ ------ -------- ---------------------------------
117
118**note:
119Supported fdt files are:
120- exynos4412-odroidx2.dtb
121- exynos4412-odroidu3.dtb
Hyungwon Hwangf8cb12d2014-12-12 14:45:46 +0900122- exynos5422-odroidxu3.dtb
Przemyslaw Marczaka314d9e2014-09-01 13:50:53 +0200123
124Supported kernel files are:
125- Image.itb
126- zImage
127- uImage
128
129The default environmental variable "dfu_alt_info" is set* for above layout.
130Each partition size is just an example, dfu_alt_info tries init two partitions.
131The size of each is not important.
132
133*note:
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).
137
138To add any changes to dfu_alt_info - please modify $dfu_alt_system only.
139Changes are visible after board reset.
140
14110. The environment and booting the kernel
142==========================================
143There are three macros defined in config for various boot options:
144Two for both, kernel with device tree support and also without it:
145- boot_uimg - load uImage
146- boot_zimg - load zImage
147If proper fdt file exists then it will be automatically loaded,
148so for old kernel types, please remove fdt file from boot partition.
149
150The third boot option for multi image support (more info: doc/uImage.FIT/)
151- boot_fit - for binary file: "Image.itb"
152
153Default boot command: "autoboot"
154And the boot sequence is:
155- boot_fit - if "Image.itb" exists
156- boot_zimg - if "zImage" exists
157- boot_uimg - if "uImage" exists
Suriyan Ramasami1b398782014-11-20 17:26:29 -0800158
15911. USB host support
160====================
Hyungwon Hwangf8cb12d2014-12-12 14:45:46 +0900161NOTE: This section is only for Odroid X2/U3.
Suriyan Ramasami1b398782014-11-20 17:26:29 -0800162
163The ethernet can be accessed after starting the USB subsystem in U-Boot.
164The adapter does not come with a preconfigured MAC address, and hence it needs
165to be set before starting USB.
166setenv usbethaddr 02:DE:AD:BE:EF:FF
167
168Note that in this example a locally managed MAC address is chosen. Care should
169be taken to make these MAC addresses unique within the same subnet.
170
171Start the USB subsystem:
172Odroid # setenv usbethaddr 02:DE:AD:BE:EF:FF
173Odroid # usb start
174(Re)start USB...
175USB0: USB EHCI 1.00
176scanning 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
179Odroid #
180
181Automatic IP assignment:
182------------------------
183If the ethernet is connected to a DHCP server (router maybe with DHCP enabled),
184then the below will automatically assign an ip address through DHCP.
185setenv autoload no
186dhcp
187
188Odroid # setenv autoload no
189Odroid # dhcp
190Waiting for Ethernet connection... done.
191BOOTP broadcast 1
192DHCP client bound to address 192.168.1.10 (524 ms)
193Odroid #
194
195Note that this automatically sets the many IP address related variables in
196U-Boot that is obtained from the DHCP server.
197
198Odroid # printenv ipaddr netmask gatewayip dnsip
199ipaddr=192.168.1.10
200netmask=255.255.255.0
201gatewayip=192.168.1.1
202dnsip=192.168.1.1
203
204Ping example:
205The ping command can be used a test to check connectivity. In this example,
206192.168.1.27 is a pingable server in the network.
207Odroid # ping 192.168.1.27
208Waiting for Ethernet connection... done.
209Using sms0 device
210host 192.168.1.27 is alive
211Odroid #
212
213Static IP assignment:
214---------------------
215In the case where there are no DHCP servers in the network, or you want to
216set the IP address statically, it can be done by:
217Odroid # setenv ipaddr 192.168.1.10
218Odroid # ping 192.168.1.27
219Waiting for Ethernet connection... done.
220Using sms0 device
221host 192.168.1.27 is alive
222
223TFTP booting:
224-------------
225Say there exists a tftp server in the network with address 192.168.1.27 and
226it serves a kernel image (zImage.3.17) and a DTB blob (exynos4412-odroidu3.dtb)
227that 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)
229
230Odroid # setenv serverip 192.168.1.27
231Odroid # tftpboot 0x40080000 zImage.3.17
232Waiting for Ethernet connection... done.
233Using sms0 device
234TFTP from server 192.168.1.27; our IP address is 192.168.1.10
235Filename 'zImage.3.17'.
236Load address: 0x40080000
237Loading: #################################################################
238 #################################################################
239 #################################################################
240 #######################
241 52.7 KiB/s
242done
243Bytes transferred = 3194200 (30bd58 hex)
244Odroid # tftpboot 0x42000000 exynos4412-odroidu3.dtb
245Waiting for Ethernet connection... done.
246Using sms0 device
247TFTP from server 192.168.1.27; our IP address is 192.168.1.10
248Filename 'exynos4412-odroidu3.dtb'.
249Load address: 0x42000000
250Loading: ####
251 40 KiB/s
252done
253Bytes transferred = 46935 (b757 hex)
254Odroid # printenv bootargs
255bootargs=Please use defined boot
256Odroid # setenv bootargs console=ttySAC1,115200n8 root=/dev/mmcblk0p2 rootwait
257Odroid # bootz 40080000 - 42000000
258Kernel 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
262
263Starting kernel ...
264
265[ 0.000000] Booting Linux on physical CPU 0xa00
266... etc ...
267
268In the above example you can substitute 'dhcp' for 'tftpboot' as well.
269
270USB Storage booting:
271--------------------
272Similarly we can use the USB storage to load the kernel image/initrd/fdt etc
273and boot. For this example, there is a USB drive plugged in. It has a FAT
2741st partition and an EXT 2nd partition. Using the generic FS (ls/load) makes
275it even easier to work with FAT/EXT file systems.
276For this example the second EXT partition is used for booting and as rootfs.
277The boot files - kernel and the dtb are present in the /boot directory of the
278second partition.
279
280Odroid # usb start
281(Re)start USB...
282USB0: USB EHCI 1.00
283scanning 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...
286Error: sms0 address not set. <----- Note the error as usbethaddr
287Warning: failed to set MAC address <----- is not set.
2881 Ethernet Device(s) found
289Odroid # usb part 0
290
291Partition Map for USB device 0 -- Partition Type: DOS
292
293Part Start Sector Num Sectors UUID Type
294 1 3072 263168 000c4046-01 06
295 2 266240 13457408 000c4046-02 83
296
297Odroid # ls usb 0:2 /boot
298<DIR> 4096 .
299<DIR> 4096 ..
300 353 boot.scr
301 281 boot.txt
302 101420 config-3.8.13.23
303 2127254 initrd.img-3.8.13.23
304 2194825 uInitrd
305 2194825 uInitrd-3.8.13.23
306 2453112 zImage
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
312Odroid # load usb 0:2 40080000 /boot/zImage.3.17
3133194200 bytes read in 471 ms (6.5 MiB/s)
314Odroid # load usb 0:2 42000000 /boot/exynos4412-odroidu3.dtb
31546935 bytes read in 233 ms (196.3 KiB/s)
316Odroid # setenv bootargs console=ttySAC1,115200n8 root=/dev/sda2 rootwait
317Odroid # bootz 40080000 - 42000000
318Kernel 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
322
323Starting kernel ...
324
325[ 0.000000] Booting Linux on physical CPU 0xa00
326
327Please refer to README.usb for additional information.