Przemyslaw Marczak | a314d9e | 2014-09-01 13:50:53 +0200 | [diff] [blame^] | 1 | U-boot for Odroid X2/U3 |
| 2 | ======================== |
| 3 | |
| 4 | 1. Summary |
| 5 | ========== |
| 6 | This is a quick instruction for setup Odroid boards based on Exynos4412. |
| 7 | Board config: odroid_config |
| 8 | |
| 9 | 2. Supported devices |
| 10 | ==================== |
| 11 | This U-BOOT config can be used on two boards: |
| 12 | - Odroid U3 |
| 13 | - Odroid X2 |
| 14 | with CPU Exynos 4412 rev 2.0 and 2GB of RAM |
| 15 | |
| 16 | 3. Boot sequence |
| 17 | ================ |
| 18 | iROM->BL1->(BL2 + TrustZone)->U-BOOT |
| 19 | |
| 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 |
| 23 | or here: |
| 24 | http://odroid.in/guides/ubuntu-lfs/boot.tar.gz |
| 25 | |
| 26 | 4. Boot media layout |
| 27 | ==================== |
| 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 | ------------------------------------- |
| 40 | |
| 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 |
| 47 | - bl2.signed.bin |
| 48 | - sd_fusing.sh |
| 49 | - u-boot.bin |
| 50 | |
| 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. |
| 54 | |
| 55 | *note: |
| 56 | The proper binary file of current U-boot is u-boot-dtb.bin. |
| 57 | |
| 58 | quick steps for Linux: |
| 59 | - extract boot.tar.gz |
| 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. |
| 64 | |
| 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. |
| 71 | |
| 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. |
| 75 | |
| 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. |
| 81 | |
| 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. |
| 91 | |
| 92 | 9. Partition layout |
| 93 | ==================== |
| 94 | Default U-boot environment is setup for fixed partiion layout. |
| 95 | |
| 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 | ----- ------ ------ ------ -------- --------------------------------- |
| 104 | |
| 105 | **note: |
| 106 | Supported fdt files are: |
| 107 | - exynos4412-odroidx2.dtb |
| 108 | - exynos4412-odroidu3.dtb |
| 109 | |
| 110 | Supported kernel files are: |
| 111 | - Image.itb |
| 112 | - zImage |
| 113 | - uImage |
| 114 | |
| 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. |
| 118 | |
| 119 | *note: |
| 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). |
| 123 | |
| 124 | To add any changes to dfu_alt_info - please modify $dfu_alt_system only. |
| 125 | Changes are visible after board reset. |
| 126 | |
| 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. |
| 135 | |
| 136 | The third boot option for multi image support (more info: doc/uImage.FIT/) |
| 137 | - boot_fit - for binary file: "Image.itb" |
| 138 | |
| 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 |