1 U-boot for Odroid X2/U3
2 ========================
6 This is a quick instruction for setup Odroid boards based on Exynos4412.
7 Board config: odroid_config
11 This U-BOOT config can be used on two boards:
14 with CPU Exynos 4412 rev 2.0 and 2GB of RAM
18 iROM->BL1->(BL2 + TrustZone)->U-BOOT
20 This version of U-BOOT doesn't implement SPL but it is required(BL2)
21 and can be found in "boot.tar.gz" from here:
22 http://dev.odroid.com/projects/4412boot/wiki/FrontPage?action=download&value=boot.tar.gz
24 http://odroid.in/guides/ubuntu-lfs/boot.tar.gz
28 The table below shows SD/eMMC cards layout for U-boot.
29 The block offset is starting from 0 and the block size is 512B.
30 -------------------------------------
31 | Binary | Block offset| part type |
32 | name | SD | eMMC |(eMMC only)|
33 -------------------------------------
34 | Bl1 | 1 | 0 | 1 (boot) |
35 | Bl2 | 31 | 30 | 1 (boot) |
36 | U-boot | 63 | 62 | 1 (boot) |
37 | Tzsw | 2111 | 2110 | 1 (boot) |
38 | Uboot Env | 2500 | 2500 | 0 (user) |
39 -------------------------------------
41 5. Prepare the SD boot card - with SD card reader
42 =================================================
43 To prepare bootable media you need boot binaries provided by hardkernel.
44 File "boot.tar.gz" (link in point 3.) contains:
45 - E4412_S.bl1.HardKernel.bin
46 - E4412_S.tzsw.signed.bin
51 This is all you need to boot this board. But if you want to use your custom
52 u-boot then you need to change u-boot.bin with your own u-boot binary*
53 and run the script "sd_fusing.sh" - this script is valid only for SD card.
56 The proper binary file of current U-boot is u-boot-dtb.bin.
58 quick steps for Linux:
60 - put any SD card into the SD reader
61 - check the device with "dmesg"
62 - run ./sd_fusing.sh /dev/sdX - where X is SD card device (but not a partition)
63 Check if Hardkernel U-boot is booting, and next do the same with your U-boot.
65 6. Prepare the eMMC boot card
66 with a eMMC card reader (boot from eMMC card slot)
67 =====================================================
68 To boot the device from the eMMC slot you should use a special card reader
69 which supports eMMC partiion switch. All of the boot binaries are stored
70 on the eMMC boot partition which is normally hidden.
72 The "sd_fusing.sh" script can be used after updating offsets of binaries
73 according to the table from point 4. Be sure that you are working on the right
74 eMMC partition - its size is usually very small, about 1-4 MiB.
76 7. Prepare the eMMC boot card
77 with a SD card reader (boot from SD card slot)
78 =================================================
79 If you have an eMMC->microSD adapter you can prepare the card as in point 5.
80 But then the device can boot only from the SD card slot.
82 8. Prepare the boot media using Hardkernel U-boot
83 =================================================
84 You can update the U-boot to the custom one if you have an working bootloader
85 delivered with the board on a eMMC/SD card. Then follow the steps:
86 - install the android fastboot tool
87 - connect a micro usb cable to the board
88 - on the U-boot prompt, run command: fastboot (as a root)
89 - on the host, run command: "fastboot flash bootloader u-boot-dtb.bin"
90 - the custom U-boot should start after the board resets.
94 Default U-boot environment is setup for fixed partiion layout.
96 Partition table: MSDOS. Disk layout and files as listed in the table below.
97 ----- ------ ------ ------ -------- ---------------------------------
98 | Num | Name | FS | Size | Offset | Reguired files |
99 | | | Type | MiB | MiB | |
100 ----- ------ ------ ------ -------- ---------------------------------
101 | 1 | BOOT | fat | 100 | 2 | kernel, fdt** |
102 | 2 | ROOT | ext4 | - | | any Linux system |
103 ----- ------ ------ ------ -------- ---------------------------------
106 Supported fdt files are:
107 - exynos4412-odroidx2.dtb
108 - exynos4412-odroidu3.dtb
110 Supported kernel files are:
115 The default environmental variable "dfu_alt_info" is set* for above layout.
116 Each partition size is just an example, dfu_alt_info tries init two partitions.
117 The size of each is not important.
120 $dfu_alt_info is set on a boot time and it is concatenated using two variables:
121 - $dfu_alt_boot(set dynamically)
122 - $dfu_alt_system(from current env).
124 To add any changes to dfu_alt_info - please modify $dfu_alt_system only.
125 Changes are visible after board reset.
127 10. The environment and booting the kernel
128 ==========================================
129 There are three macros defined in config for various boot options:
130 Two for both, kernel with device tree support and also without it:
131 - boot_uimg - load uImage
132 - boot_zimg - load zImage
133 If proper fdt file exists then it will be automatically loaded,
134 so for old kernel types, please remove fdt file from boot partition.
136 The third boot option for multi image support (more info: doc/uImage.FIT/)
137 - boot_fit - for binary file: "Image.itb"
139 Default boot command: "autoboot"
140 And the boot sequence is:
141 - boot_fit - if "Image.itb" exists
142 - boot_zimg - if "zImage" exists
143 - boot_uimg - if "uImage" exists
148 The ethernet can be accessed after starting the USB subsystem in U-Boot.
149 The adapter does not come with a preconfigured MAC address, and hence it needs
150 to be set before starting USB.
151 setenv usbethaddr 02:DE:AD:BE:EF:FF
153 Note that in this example a locally managed MAC address is chosen. Care should
154 be taken to make these MAC addresses unique within the same subnet.
156 Start the USB subsystem:
157 Odroid # setenv usbethaddr 02:DE:AD:BE:EF:FF
161 scanning bus 0 for devices... 4 USB Device(s) found
162 scanning usb for storage devices... 1 Storage Device(s) found
163 scanning usb for ethernet devices... 1 Ethernet Device(s) found
166 Automatic IP assignment:
167 ------------------------
168 If the ethernet is connected to a DHCP server (router maybe with DHCP enabled),
169 then the below will automatically assign an ip address through DHCP.
173 Odroid # setenv autoload no
175 Waiting for Ethernet connection... done.
177 DHCP client bound to address 192.168.1.10 (524 ms)
180 Note that this automatically sets the many IP address related variables in
181 U-Boot that is obtained from the DHCP server.
183 Odroid # printenv ipaddr netmask gatewayip dnsip
185 netmask=255.255.255.0
186 gatewayip=192.168.1.1
190 The ping command can be used a test to check connectivity. In this example,
191 192.168.1.27 is a pingable server in the network.
192 Odroid # ping 192.168.1.27
193 Waiting for Ethernet connection... done.
195 host 192.168.1.27 is alive
198 Static IP assignment:
199 ---------------------
200 In the case where there are no DHCP servers in the network, or you want to
201 set the IP address statically, it can be done by:
202 Odroid # setenv ipaddr 192.168.1.10
203 Odroid # ping 192.168.1.27
204 Waiting for Ethernet connection... done.
206 host 192.168.1.27 is alive
210 Say there exists a tftp server in the network with address 192.168.1.27 and
211 it serves a kernel image (zImage.3.17) and a DTB blob (exynos4412-odroidu3.dtb)
212 that needs to be loaded and booted. It can be accomplished as below:
213 (Assumes that you have setenv usbethaddr, and have not set autoload to no)
215 Odroid # setenv serverip 192.168.1.27
216 Odroid # tftpboot 0x40080000 zImage.3.17
217 Waiting for Ethernet connection... done.
219 TFTP from server 192.168.1.27; our IP address is 192.168.1.10
220 Filename 'zImage.3.17'.
221 Load address: 0x40080000
222 Loading: #################################################################
223 #################################################################
224 #################################################################
225 #######################
228 Bytes transferred = 3194200 (30bd58 hex)
229 Odroid # tftpboot 0x42000000 exynos4412-odroidu3.dtb
230 Waiting for Ethernet connection... done.
232 TFTP from server 192.168.1.27; our IP address is 192.168.1.10
233 Filename 'exynos4412-odroidu3.dtb'.
234 Load address: 0x42000000
238 Bytes transferred = 46935 (b757 hex)
239 Odroid # printenv bootargs
240 bootargs=Please use defined boot
241 Odroid # setenv bootargs console=ttySAC1,115200n8 root=/dev/mmcblk0p2 rootwait
242 Odroid # bootz 40080000 - 42000000
243 Kernel image @ 0x40080000 [ 0x000000 - 0x30bd58 ]
244 ## Flattened Device Tree blob at 42000000
245 Booting using the fdt blob at 0x42000000
246 Loading Device Tree to 4fff1000, end 4ffff756 ... OK
250 [ 0.000000] Booting Linux on physical CPU 0xa00
253 In the above example you can substitute 'dhcp' for 'tftpboot' as well.
257 Similarly we can use the USB storage to load the kernel image/initrd/fdt etc
258 and boot. For this example, there is a USB drive plugged in. It has a FAT
259 1st partition and an EXT 2nd partition. Using the generic FS (ls/load) makes
260 it even easier to work with FAT/EXT file systems.
261 For this example the second EXT partition is used for booting and as rootfs.
262 The boot files - kernel and the dtb are present in the /boot directory of the
268 scanning bus 0 for devices... 4 USB Device(s) found
269 scanning usb for storage devices... 1 Storage Device(s) found
270 scanning usb for ethernet devices...
271 Error: sms0 address not set. <----- Note the error as usbethaddr
272 Warning: failed to set MAC address <----- is not set.
273 1 Ethernet Device(s) found
276 Partition Map for USB device 0 -- Partition Type: DOS
278 Part Start Sector Num Sectors UUID Type
279 1 3072 263168 000c4046-01 06
280 2 266240 13457408 000c4046-02 83
282 Odroid # ls usb 0:2 /boot
287 101420 config-3.8.13.23
288 2127254 initrd.img-3.8.13.23
290 2194825 uInitrd-3.8.13.23
292 101448 config-3.8.13.26
293 2127670 uInitrd-3.8.13.26
294 2127606 initrd.img-3.8.13.26
295 3194200 zImage.3.17 <--- Kernel
296 46935 exynos4412-odroidu3.dtb <--- DTB
297 Odroid # load usb 0:2 40080000 /boot/zImage.3.17
298 3194200 bytes read in 471 ms (6.5 MiB/s)
299 Odroid # load usb 0:2 42000000 /boot/exynos4412-odroidu3.dtb
300 46935 bytes read in 233 ms (196.3 KiB/s)
301 Odroid # setenv bootargs console=ttySAC1,115200n8 root=/dev/sda2 rootwait
302 Odroid # bootz 40080000 - 42000000
303 Kernel image @ 0x40080000 [ 0x000000 - 0x30bd58 ]
304 ## Flattened Device Tree blob at 42000000
305 Booting using the fdt blob at 0x42000000
306 Loading Device Tree to 4fff1000, end 4ffff756 ... OK
310 [ 0.000000] Booting Linux on physical CPU 0xa00
312 Please refer to README.usb for additional information.