blob: be8113bdcec1c9a513562a5fe25ea6f198b5df9d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
Odroid XU-4 board with Samsung Exynos 5422 SoC
Introduction
------------
The Odroid XU 4 board is developed and shipped by Hrdkernel (hardkernel.com). It
uses the Samsung Exynos 5422 Soc.
Odroid boot process
-------------------
The odroid boot process requires three stages of boot plus trust zone:
boot level 1
|
V
boot level 2
|
V
u-boot
and they need to be raw copied to the SD card in the following order:
+----------------+----------------+
| boot level 1 | 1 block |
+----------------+----------------+
| boot level 2 | 31 block |
+----------------+----------------+
| u-boot | 63 block |
+----------------+----------------+
| trust zone | 2111 block |
+----------------+----------------+
| boot partition | 4096 block |
+----------------+----------------+
| rootfs | |
+----------------+----------------+
How to build buildroot
----------------------
Forst of all configure the buildroot environment:
$ make odroid-xu4_defconfig
If needed personalize the build
$ make menuconfig
then hit
$ make
At the end of the build you should get in the output/images directory the
following files:
- bl1.bin.hardkernel
Level 1 boot loader
- bl2.bin.hardkernel.1mb_uboot
Level 2 boot loader
- exynos5422-odroidxu4.dtb
Linux Kernel Device Tree blop
- rootfs.tar
Compressed root file system image
- tzsw.bin.hardkernel
ARM Truzt Zone
- u-boot.bin
u-boot image
- zImage
Linux Kernel Image
Set up the bootloader
---------------------
I will assume you will use an sd card which will have as mount point /dev/sdb.
The above images need to be flashed to the SD card to specific addresses, as
follows:
# dd if=bl1.bin.hardkernel of=/dev/sdb seek=1 bs=512
# dd if=bl2.bin.hardkernel.1mb_uboot of=/dev/sdb seek=31 bs=512
# dd if=u-boot.bin of=/dev/sdb seek=63 bs=512
# dd if=tzsw.bin.hardkernel of=/dev/sdb seek=2111 bs=512
With the above we should be able to boot up to the u-boot bootloader.
Set up the SD card
------------------
The SD card will need to partitions, which you can make with your favourite
partitioner. At the end it should look like this:
Device Boot Start End Sectors Size Id Type
/dev/sdb1 4096 135167 131072 64M b W95 FAT32
/dev/sdb2 135168 15523839 15388672 7.3G 83 Linux
IMPORTANT: Please note that the first partition starts at the block 4096 instead
of the default 2048. This is due to the sizes of the binaries we flased earlier,
which go over the 2048 block, therefore, you need to start the first partition
at a further location, e.g. 4096.
Now format the two partitions, the first as vfat FS type, the second as EXT3 or
EXT4:
# mkfs.vfat /dev/sdb1
# mkfs.ext4 /dev/sdb2
Finalize the SD card
--------------------
Now it's time to move Kernel and File System to the SD card. We will start from
the Kernel partition.
First mount it:
# mount /dev/sdb1/ /mnt/
and copy kernel and dtb
# cp <buildroot>/output/images/zImage /mnt/
# cp <buildroot>/output/images/exynos5422-odroidxu4.dtb /mnt/
umount the partition
# sync
# umount /dev/sdb1
Mount the rootfs partition:
# mount /dev/sdb2 /mnt/
# tar
# cp <buildroot>/output/images/rootfs.tar -C /mnt/
Umount the partition
# sync
# umount /dev/sdb2
The SD card is ready, you can boot now your Odroid XU-4.
Automate u-boot commands
------------------------
In order to avoid customizing u-boot from the u-boot system at boot time, you
can use the boot.cmd file in board/odroid-xu4.
Jut run
$ mkimage -A arm -T script -C none -d boot.cmd boot.scr
the output is an u-boot readable binary which needs to be copied in the first
partition of the SD card:
# mount /dev/sdb1 /mnt/
# cp boot.scr /mnt/sdb1
# sync
# umount /dev/sdb1
|