[HowTo] u-boot mainline for Odroid XU3/XU4

Moderators: mdrjr, odroid, meveric

[HowTo] u-boot mainline for Odroid XU3/XU4

Unread postby moon.linux » Wed Dec 28, 2016 2:26 pm

You can use the u-boot mainline to boot mainline 4.x kernel.
The advantage of this it could support USB 3.0 and tftp boot of image.

Code: Select all
sudo apt-get install device-tree-compiler


Note: These instruction work flawless on following image http://odroid.in/ubuntu_14.04lts/ubuntu ... 212.img.xz
Note: These instruction dose not work on ubuntu 15.X and 16.X image
some how these instruction erase the partition table and boot files in /dev/mmcblk0


Download u-boot
Code: Select all
git clone git://git.denx.de/u-boot.git u-boot-main
cd u-boot-main


Note: you can find more info on in file doc/README.odroid
Code: Select all
U-Boot for Odroid X2/U3/XU3/XU4
========================

1. Summary
==========
This is a quick instruction for setup Odroid boards.
Board config: odroid_config for X2/U3
Board config: odroid-xu3_config for XU3/XU4


Build u-boot mainline : This will build the u-boot-dtb.bin

Code: Select all
u-boot-main$ make odroid-xu3_config
u-boot-main$ make
u-boot-main# cp u-boot-dtb.bin ../hardkernel-xu3/


Build the boot.scr:
Note: You cannot modify the boot.scr command you have to compile this again.
Code: Select all
u-boot-main$ patch -p1 < ../hardkernel-xu3/boot_cmd.patch
u-boot-main$ mkimage -C none -A arm -T script -d board/samsung/common/bootscripts/autoboot.cmd boot.scr
u-boot-main$  cp boot.scr /media/boot/


Upgrade the boot loader
Attached is the script and patches needed

Download the scipt and BL2/BL3 script from the hardkernel repository.
Attached is the script to upgrade u-boot-dtb.bin
make sure you have the update u-boot-dtb.bin that you have build using u-boot-main

Code: Select all
cd hardkernel-xu3

root@odroid:~/Downloads/hardkernel-xu3# ls -la
total 1140
drwxrwxr-x 2 odroid odroid   4096 Dec 28 14:16 .
drwxr-xr-x 4 odroid odroid   4096 Dec 28 14:08 ..
-rwxrwxr-x 1 odroid odroid  15360 Sep 27  2015 bl1.bin.hardkernel
-rw-rw-r-- 1 odroid odroid  14592 Sep 27  2015 bl2.bin.hardkernel
-rwxr-xr-x 1 odroid odroid  14592 Sep 27  2015 bl2.bin.hardkernel.1mb_uboot
-rw-rw-r-- 1 odroid odroid   1125 Dec 28 14:16 boot_cmd.patch
-rwxr-xr-x 1 odroid odroid   3033 Apr 12  2016 boot.scr
-rwxrwxr-x 1 odroid odroid   2297 Sep 27  2015 sd_fusing.sh
-rwxrwxr-x 1 odroid odroid 262144 Sep 27  2015 tzsw.bin.hardkernel
-rwxrwxr-x 1 odroid odroid 275684 Sep 27  2015 u-boot.bin.hardkernel
-rwxrwxr-x 1 odroid odroid 554582 Dec 28 15:23 u-boot-dtb.bin
root@odroid:~hardkernel-xu3#


Flashing the new u-boot-dtb to partition
Note: Make sure this is perform as root user
Code: Select all
hardkernel-xu3# ./sd_fusing.sh
++ device=/dev/mmcblk0
++ D=SDCard
++ '[' -f /sys/block/mmcblk0boot0/force_ro ']'
++ '[' -n '' ']'
++ signed_bl1_position=1
++ bl2_position=31
++ uboot_position=63
++ tzsw_position=2111
++ device=/dev/mmcblk0
++ '[' -f ./u-boot-dtb.bin ']'
++ uboot=./u-boot-dtb.bin
++ echo 'BL1 fusing'
BL1 fusing
++ sudo dd iflag=dsync oflag=dsync if=./bl1.bin.hardkernel of=/dev/mmcblk0 seek=1
30+0 records in
30+0 records out
15360 bytes (15 kB) copied, 0.0519521 s, 296 kB/s
++ echo 'BL2 fusing'
BL2 fusing
++ sudo dd iflag=dsync oflag=dsync if=./bl2.bin.hardkernel.1mb_uboot of=/dev/mmcblk0 seek=31
28+1 records in
28+1 records out
14592 bytes (15 kB) copied, 0.0497417 s, 293 kB/s
++ echo 'u-boot fusing'
u-boot fusing
++ sudo dd iflag=dsync oflag=dsync if=./u-boot-dtb.bin of=/dev/mmcblk0 seek=63
1083+1 records in
1083+1 records out
554582 bytes (555 kB) copied, 1.91156 s, 290 kB/s
++ echo 'TrustZone S/W fusing'
TrustZone S/W fusing
++ sudo dd iflag=dsync oflag=dsync if=./tzsw.bin.hardkernel of=/dev/mmcblk0 seek=2111
512+0 records in
512+0 records out
262144 bytes (262 kB) copied, 0.95657 s, 274 kB/s
++ echo 'U-boot image is fused successfully.'
U-boot image is fused successfully.
++ echo 'Eject SDCard and insert it again.'
Eject SDCard and insert it again.


Before you reboot :
Make shure you have the copy the exynos5422-odroidxu3.dtb to exynos5422-odroidxu4.dtb
As their is board detection algorithm used depeding on the board Id,
Odroid-XU3 exynos5422-odroidxu3.dtb
Odroid-XU4 exynos5422-odroidxu4.dtb


Code: Select all
root@odroid:~/Downloads# cp /media/boot/exynos5422-odroidxu3.dtb /media/boot/exynos5422-odroidxu4.dtb


Booting using new u-boot...
Code: Select all
U-Boot 2017.01-rc2-00064-g4789583-dirty (Dec 28 2016 - 15:19:23 +1030) for ODROID-XU3

CPU:   Exynos5422 @ 800 MHz
Model: Odroid XU3 based on EXYNOS5422
Board: Odroid XU3 based on EXYNOS5422
Type:  xu4
DRAM:  2 GiB
MMC:   EXYNOS DWMMC: 0, EXYNOS DWMMC: 1
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   No ethernet found.
Hit any key to stop autoboot:  0
Card did not respond to voltage select!
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
reading /boot.scr
3174 bytes read in 3 ms (1 MiB/s)
## Executing script at 50000000
Found kernel image: zImage
reading exynos5422-odroidxu4.dtb
52006 bytes read in 24 ms (2.1 MiB/s)
Found ramdisk image.
reading uInitrd
2089628 bytes read in 118 ms (16.9 MiB/s)
reading zImage
3273288 bytes read in 184 ms (17 MiB/s)
Kernel image @ 0x40007fc0 [ 0x000000 - 0x31f248 ]
## Loading init Ramdisk from Legacy Image at 42000000 ...
   Image Name:   uInitrd 3.10.103
   Image Type:   ARM Linux RAMDisk Image (uncompressed)
   Data Size:    2089564 Bytes = 2 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 40800000
   Booting using the fdt blob at 0x40800000
   Loading Ramdisk to 4fe01000, end 4ffff25c ... OK
   Loading Device Tree to 4fdf1000, end 4fe00b25 ... OK

Starting kernel ...

[    0.000000] [c0] Booting Linux on physical CPU 0x100
[    0.000000] [c0] Initializing cgroup subsys cpuset
[    0.000000] [c0] Initializing cgroup subsys cpu
[    0.000000] [c0] Initializing cgroup subsys cpuacct
[    0.000000] [c0] Linux version 3.10.103 (root@1604_builder_armhf) (gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.2) ) #1 SMP PREEMPT Sat Sep 10 14:43:59 UTC 2016
[    0.000000] [c0] CPU: ARMv7 Processor [410fc073] revision 3 (ARMv7), cr=10c5387d
[    0.000000] [c0] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] [c0] Machine: ODROID-XU3, model: Hardkernel odroid-xu3 board based on EXYNOS5422
[    0.000000] [c0] ION: Contiguous 0x6650000 bytes @ 0x0 defined for 0:common
[    0.000000] [c0] ION: Contiguous 0x400000 bytes @ 0x0 defined for 2:mfc_sh
[    0.000000] [c0] ION: Contiguous 0x800000 bytes @ 0x0 defined for 10:g2d_wfd
[    0.000000] [c0] ION: Contiguous 0x6000000 bytes @ 0x0 defined for 11:video
[    0.000000] [c0] ION: Contiguous 0x1000000 bytes @ 0x0 defined for 7:mfc_input
[    0.000000] [c0] ION: Contiguous 0x400000 bytes @ 0x0 defined for 9:sectbl
[    0.000000] [c0] ION: Contiguous 0x400000 bytes @ 0x0 defined for 8:mfc_fw
[    0.000000] [c0] ION: Contiguous 0x400000 bytes @ 0x0 defined for 12:mfc_nfw
[    0.000000] [c0] ION: Contiguous 0x400000 bytes @ 0x0 defined for 13:secdma
[    0.000000] [c0] cma: CMA: reserved 104 MiB at b8000000
[    0.000000] [c0] cma: CMA: reserved 4 MiB at b7c00000
Attachments
hardkernel-xu3.tar.gz
u-boot hardkernel mainline
(439.66 KiB) Downloaded 137 times
moon.linux
 
Posts: 1159
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Return to Ubuntu (All Linux'es)

Who is online

Users browsing this forum: No registered users and 3 guests