Difference between revisions of "The bootloader U-Boot"

From IGEP - ISEE Wiki

Jump to: navigation, search
(U-Boot v2009.11 (stable))
(Download Binary package)
 
(145 intermediate revisions by 12 users not shown)
Line 1: Line 1:
== How to cross compile U-Boot ==
+
__TOC__
  
=== Overview of How-To ===
+
==Overview==
 +
<span style="color: #000000;">This page is meant to be a starting point for people to learn build a u-boot image and show to people the current status of different u-boot versions for IGEP Processor Boards.</span>
  
This How-To is meant to be a starting point for people to learn build the u-boot software for IGEP v2 devices as quickly and easily as possible.
+
===<span style="color: #000000;">What is U-Boot?</span>===
 +
<span style="color: #000000;">[http://www.denx.de/wiki/U-Boot/ Das U-Boot] (Universal Bootloader) is an open source, primary boot loader used in embedded devices. Its primary purpose in the shipping system is to load some operating system.</span>
  
This How-To works with the Ubuntu 8.04 IGEP v2.0 SDK Virtual Machine but most of the contents are valid also for other GNU/Linux distributions. We do not issue any guarantee that this will work on other distributions.
+
<span style="color: #000000;">That means that U-Boot is necessary to perform a certain task, but it's nothing you want to throw any significant resources at. Typically U-Boot is stored in relatively small NOR flash memory, which is expensive compared to the much larger NAND devices often used to store the operating system and the application.</span>
  
=== Requirements ===
 
  
*'''Ubuntu 8.04 IGEP v2.0 SDK Virtual Machine'''
 
  
=== Feedback and Contributing ===
+
==Necessary package==
 +
In order to compile the u-boot it is '''necessary''' to set up the Cross Compiler correctly. In this [[Set Up the Cross Compiler|post]] it is detailed how to set up correctly the Cross Compiler (and the desired version).
  
At any point, if you see a mistake you can contribute to this How-To.
+
{{Message/Information Message|message=The following steps has been tested using '''Ubuntu 16.04''' and the '''4.9 version''' of the '''arm-linux-'''<span class="mw-headline">'''gnueabihf''' compiler</span>}}
  
=== U-Boot for IGEP v2 ===
+
In order to install the Compiler we can use this command:
  
First of all setup the build environment sourcing this script
+
sudo apt install gcc-arm-linux-gnueabihf
<pre>
+
==Download U-Boot Source==
$ source /usr/local/poky/eabi-glibc/arm/environment-setup
+
 First of all, will be a distintion between '''NXP'''-processors products and '''ARM'''-processors products. Because there are different kinds of U-Boot depending of each processor.
</pre>
 
or
 
<pre>
 
$ source /usr/local/poky/eabi-glibc/environment-setup-arm-none-linux-gnueabi
 
</pre>
 
if you have updated your SDK environment to latest version (see [[Ubuntu 8.04 IGEP v2.0 SDK Virtual Machine]])
 
  
==== U-Boot v2009.11 (stable) ====
+
{| class="contenttable sortable" style="width: 887px;"
 +
|-
 +
! style="width: 344px;"|<span style="color: #000000;">'''Commercial Name'''</span>
 +
! style="width: 527px;"|<span style="color: #000000;">'''U-Boot Series'''</span>
 +
|-
 +
| style="width: 344px;"|<span style="color: #000000;">IGEPv2 DM3730</span>
 +
| style="width: 527px;"|<span dir="auto">U-boot-ARM</span>
 +
|-
 +
| style="width: 344px;"|<span style="color: #000000;">IGEP COM MODULE </span>DM3730/AM3703
 +
| style="width: 527px;"|<span dir="auto">U-boot-ARM</span> 
 +
|-
 +
| style="width: 344px;"|<span style="color: #000000;">IGEP COM AQUILA AM335x</span>
 +
| style="width: 527px;"|<span style="color: #000000;"><span dir="auto">U-boot-ARM</span> </span>
 +
|-
 +
| style="width: 344px;"|<span style="color: #000000;">IGEPv5 OMAP5432</span>
 +
| style="width: 527px;"|<span dir="auto">U-boot-ARM</span> 
 +
|-
 +
| style="width: 344px;"|<span style="color: #000000;">IGEP SMARC AM335x</span>
 +
| style="width: 527px;"|<span dir="auto">U-boot-ARM</span> 
 +
|-
 +
| style="width: 344px;"|<span style="color: #000000;">IGEP SMARC iMX6 </span>
 +
| style="width: 527px;"|<span dir="auto">U-boot-</span>Freescale-NXP
 +
|}
  
This version support full OneNAND DDP
+
* Once we know which U-Boot have we will clone the corresponding git repository.
  
Download the IGEP v2 U-Boot sources and follow next steps:
 
<pre>
 
$ wget http://downloads.igep.es/sources/u-boot-arm-2009.11-1.tar.gz
 
$ tar xzf u-boot-arm-2009.11-0.tar.gz
 
$ cd u-boot-arm-2009.11-0
 
$ make CROSS_COMPILE=arm-none-linux-gnueabi- omap3_igep0020_config
 
$ make CROSS_COMPILE=arm-none-linux-gnueabi-
 
</pre>
 
The result will be an u-boot.bin file in arch/arm/boot directory.
 
  
==== U-Boot mainline tree (development) ====
+
====<span dir="auto">U-Boot '''ARM''' Series</span>====
 +
: If we have an ARM series we will follow this table to get our source of U-Boot
 +
{| class="contenttable sortable" style="width: 881px; height: 298px;"
 +
|- style="height: 16.5781px;"
 +
! style="width: 855px; height: 16.5781px; text-align: center; vertical-align: middle;" colspan="2"|'''Downloading binary files/U-Boot Source'''
 +
|- style="height: 44px;"
 +
! style="background-color: #ffffff; width: 225px; height: 44px;"|'''<span id="Clone_the_u-boot_repo" class="mw-headline">Clone the u-boot repository</span>'''
 +
| style="width: 621px; height: 44px;"|
 +
Clone the u-boot repository using git address:
  
Clone the GIT repository from git.myigep.com
+
<span style="color: #000000;"> <code>git clone https://git.isee.biz/cgit/arm-boot/u-boot-arm.git</code></span>
<pre>
 
$ git clone git://git.igep.es/pub/scm/u-boot-arm.git
 
$ cd u-boot-arm
 
$ git checkout origin/u-boot-2009.11.y -b u-boot-2009.11.y
 
</pre>
 
and build with
 
<pre>
 
$ make CROSS_COMPILE=arm-none-linux-gnueabi- omap3_igep0020b_config
 
$ make CROSS_COMPILE=arm-none-linux-gnueabi-
 
</pre>
 
The result will be an u-boot.bin file in arch/arm/boot directory.
 
  
=== Annex: default u-boot environment ===
+
|- style="height: 110px;"
 +
! style="background-color: #ffffff; width: 225px; height: 110px;"|<span id="Checkout_u-boot_repo" class="mw-headline">Checkout u-boot repository</span>
 +
| style="width: 621px; height: 110px;"|
 +
Go to the u-boot-arm directory and checkout the isee_v2017.03 as:
  
<pre>
+
<span style="color: #002d87;"><code><span style="color: #002d87;"><span style="color: #000000;">cd u-boot-arm</span></span></code></span>
setenv distro poky
 
setenv machine igep0020
 
setenv project poky-image-sato
 
setenv ethaddr ac:de:48:00:02:54
 
setenv ipaddr 192.168.254.254
 
setenv netmask 255.255.255.0
 
setenv gatewayip 192.168.254.10
 
setenv serverip 192.168.254.10
 
setenv addip 'setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}::eth0:'
 
setenv bootargs-base 'mem=512M console=ttyS2,115200n8 console=tty0 omapfb.mode=dvi:1024x768MR-16@60'
 
setenv mmc-bootargs 'setenv bootargs ${bootargs-base} root=/dev/mmcblk0p2 rw rootwait'
 
setenv mmc-boot 'mmc init 0; if fatload mmc 0 80000000 boot.ini; then source; else if fatload mmc 0 80000000 uImage; then run mmc-bootargs; bootm; fi; fi'
 
setenv onenand-bootargs 'setenv bootargs ${bootargs-base} root=/dev/mtdblock4 rootfstype=jffs2 ; run addip'
 
setenv onenand-boot 'run onenand-bootargs; onenand read 80000000 280000 400000 ; bootm 80000000'
 
setenv nfs-bootargs 'setenv bootargs ${bootargs-base} root=/dev/nfs nfsroot=${serverip}:/srv/nfs/${distro}/${project}/${machine} ; run addip'
 
setenv nfs-boot 'if ping ${serverip}; then run nfs-bootargs; tftp 0x80000000 ${distro}/${project}/${machine}/uImage; bootm; fi;'
 
setenv bootcmd 'run mmc-boot; run nfs-boot; run onenand-boot'
 
</pre>
 
  
--- That's all folks ---
+
<span style="color: #000000;"><code>git checkout -b isee_v2017.03 origin/isee_v2017.03</code></span>
  
[[Category:Software|Uboot]]
+
|}
 +
 
 +
====<span dir="auto">U-Boot '''Freescale-NXP'''  Serie</span>====
 +
<div class="clearfix">
 +
: If we have an Freescale-NXP series we will follow this table to get our source of U-Boot
 +
</div>
 +
{| class="contenttable sortable" style="width: 883px; height: 263px;"
 +
|- style="height: 22px;"
 +
! style="width: 849px; height: 22px; text-align: center; vertical-align: middle;" colspan="2"|'''Downloading binary files/U-Boot Source'''
 +
|- style="height: 44px;"
 +
! style="background-color: #ffffff; width: 223px;"|'''<span id="Clone_the_u-boot_repo" class="mw-headline">Clone the u-boot repository</span>'''
 +
| style="width: 626px; height: 44px;"|
 +
<span style="color: #000000;">Clone the u-boot repository using git address:</span>
 +
 
 +
<span style="color: #000000;"><code>git clone https://git.isee.biz/cgit/arm-boot/u-boot-imx.git</code></span>
 +
 
 +
|- style="height: 89px;"
 +
! style="background-color: #ffffff; width: 223px;"|'''<span id="Checkout_u-boot_repo" class="mw-headline">Checkout u-boot repository</span>'''
 +
| style="width: 626px; height: 89px;"|
 +
<span style="color: #000000;">Go to the u-boot-imx directory and checkout the isee_imx_v2017.03.y as:</span>
 +
 
 +
<span style="color: #000000;"><code>cd u-boot-imx</code></span>
 +
 
 +
<span style="color: #000000;"><code>git checkout origin/isee_imx_v2017.03_4.9.11_1.0.0_ga -b isee_imx_v2017.03_4.9.11_1.0.0_ga </code></span>
 +
 
 +
|}
 +
 
 +
==Prepare your U-BOOT==
 +
Once we have downloaded the U-Boot source. We will '''execute''' the file called '''defconfig''' (default configuration) that it variates in function of each model.
 +
 
 +
In order to load the default configuration of the target board, we have to write the following command:
 +
 
 +
<span style="color: #000000;"> make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- [your_defconfig]</span>
 +
* In the following table it can be found the name of each default configuration associated to each IGEP PROCESSORS BOARDS:
 +
 
 +
 
 +
 
 +
{| class="contenttable sortable" style="width: 872px; height: 317px;"
 +
|-
 +
! style="width: 196px;"|Module
 +
! style="width: 10px;"|Defconfig
 +
! style="width: 644px;"|Example
 +
|-
 +
| style="width: 196px;"|IGEPv2 DM3730
 +
| style="width: 10px;"|igep0020_defconfig
 +
| style="width: 644px;"|<span style="color: #000000;"><code>make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- igep0020_defconfig</code></span>
 +
|-
 +
| style="width: 196px;"|IGEP COM MODULE DM3730/AM3703
 +
| style="width: 10px;"|igep0030_defconfig
 +
| style="width: 644px;"|<span style="color: #000000;"><code>make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- igep0030_defconfig</code></span>
 +
|-
 +
| style="width: 196px;"|IGEP COM AQUILA AM335x
 +
| style="width: 10px;"|
 +
am335x_igep0033_defconfig
 +
 
 +
| style="width: 644px;"|<span style="color: #000000;"><code>make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am335x_igep0033_defconfig</code></span>
 +
|-
 +
| style="width: 196px;"|IGEPv5 OMAP5432
 +
| style="width: 10px;"| 
 +
| style="width: 644px;"|<span style="color: #000000;"><code>make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-</code></span>
 +
|-
 +
| style="width: 196px;"|IGEP SMARC AM335x
 +
| style="width: 10px;"|am335x_igep0034_defconfig
 +
| style="width: 644px;"|<span style="color: #000000;"><code>make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am335x_igep0034_defconfig</code></span>
 +
|-
 +
| style="width: 196px;"|IGEP SMARC iMX6 Solo/Dual Lite
 +
| style="width: 10px;"|igep0046_imx6dl_2G_defconfig
 +
| style="width: 644px;"|<span style="color: #000000;"><code>make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- igep0046_imx6dl_2G_defconfig</code></span>
 +
|-
 +
| style="width: 196px;"|IGEP SMARC iMX6 Dual/ Quad
 +
| style="width: 10px;"|igep0046_imx6q_2G_defconfig
 +
| style="width: 644px;"|<span style="color: #000000;"><code>make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- igep0046_imx6q_2G_defconfig</code></span>
 +
|-
 +
| style="width: 196px;"|IGEP SMARC iMX6 Ultra-Lite / Ultra Ultra-Lite
 +
| style="width: 10px;"|igep0146_imx6ul_512M_defconfig
 +
| style="width: 644px;"|<span style="color: #000000;"><code>make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- igep0146_imx6ul_512M_defconfig<br /></code></span>
 +
|}
 +
 
 +
==Build your U-BOOT==
 +
After running the defconfig. You can build the U-Boot by executing this command:
 +
 
 +
<span style="color: #000000;">  make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-</span>
 +
Once the compile process has sucesfully finished, we will find the resulting files inside the u-boot root folder. Depending on the processor the generated files will be different:
 +
 
 +
* The result for '''ARM''' processor based board will be a '''MLO''' and '''u-boot.img'''.
 +
* The result for '''Freescale'''-'''NXP'''<strong style="font-size: 0.939em;"> </strong><span style="font-size: 0.939em;">processor based will be a </span><strong style="font-size: 0.939em;">u-boot.imx.</strong>
 +
 
 +
 
 +
Finally we can copy this files in a '''boot device''', for example, a microSD Memory Card. It is explained in the following [[How to prepare a bootable MicroSD Card|post]].
 +
 
 +
{{Message/Information Message|title=TITLE|message= <span style="color: #000000;">In case of the Freescale-NXP Porcessor Boards, it is not possible to copy directly the u-boot.imx file. It is necessary to copy in the first blocks of the boot device using the dd command. It is explained in the following post [[How to prepare a bootable MicroSD Card|How to prepare a bootable MicroSD Card]].</span>}}
 +
 
 +
 
 +
 
 +
==Download Binary package==
 +
[http://downloads.isee.biz/ You can download binary packages from here.]
 +
 
 +
==<span id="What_next..." class="mw-headline">What next...</span>==
 +
After build u-boot you have to download and compile [[Linux Kernel 4.9.y|kernel]]

Latest revision as of 16:27, 12 October 2023

Overview

This page is meant to be a starting point for people to learn build a u-boot image and show to people the current status of different u-boot versions for IGEP Processor Boards.

What is U-Boot?

Das U-Boot (Universal Bootloader) is an open source, primary boot loader used in embedded devices. Its primary purpose in the shipping system is to load some operating system.

That means that U-Boot is necessary to perform a certain task, but it's nothing you want to throw any significant resources at. Typically U-Boot is stored in relatively small NOR flash memory, which is expensive compared to the much larger NAND devices often used to store the operating system and the application.


Necessary package

In order to compile the u-boot it is necessary to set up the Cross Compiler correctly. In this post it is detailed how to set up correctly the Cross Compiler (and the desired version).

Information.jpg The following steps has been tested using Ubuntu 16.04 and the 4.9 version of the arm-linux-gnueabihf compiler

In order to install the Compiler we can use this command:

sudo apt install gcc-arm-linux-gnueabihf

Download U-Boot Source

 First of all, will be a distintion between NXP-processors products and ARM-processors products. Because there are different kinds of U-Boot depending of each processor.

Commercial Name U-Boot Series
IGEPv2 DM3730 U-boot-ARM
IGEP COM MODULE DM3730/AM3703 U-boot-ARM 
IGEP COM AQUILA AM335x U-boot-ARM 
IGEPv5 OMAP5432 U-boot-ARM 
IGEP SMARC AM335x U-boot-ARM 
IGEP SMARC iMX6  U-boot-Freescale-NXP
  • Once we know which U-Boot have we will clone the corresponding git repository.


U-Boot ARM Series

If we have an ARM series we will follow this table to get our source of U-Boot
Downloading binary files/U-Boot Source
Clone the u-boot repository

Clone the u-boot repository using git address:

 git clone https://git.isee.biz/cgit/arm-boot/u-boot-arm.git

Checkout u-boot repository

Go to the u-boot-arm directory and checkout the isee_v2017.03 as:

cd u-boot-arm

git checkout -b isee_v2017.03 origin/isee_v2017.03

U-Boot Freescale-NXP  Serie

If we have an Freescale-NXP series we will follow this table to get our source of U-Boot
Downloading binary files/U-Boot Source
Clone the u-boot repository

Clone the u-boot repository using git address:

git clone https://git.isee.biz/cgit/arm-boot/u-boot-imx.git

Checkout u-boot repository

Go to the u-boot-imx directory and checkout the isee_imx_v2017.03.y as:

cd u-boot-imx

git checkout origin/isee_imx_v2017.03_4.9.11_1.0.0_ga -b isee_imx_v2017.03_4.9.11_1.0.0_ga 

Prepare your U-BOOT

Once we have downloaded the U-Boot source. We will execute the file called defconfig (default configuration) that it variates in function of each model.

In order to load the default configuration of the target board, we have to write the following command:

 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- [your_defconfig]
  • In the following table it can be found the name of each default configuration associated to each IGEP PROCESSORS BOARDS:


Module Defconfig Example
IGEPv2 DM3730 igep0020_defconfig make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- igep0020_defconfig
IGEP COM MODULE DM3730/AM3703 igep0030_defconfig make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- igep0030_defconfig
IGEP COM AQUILA AM335x

am335x_igep0033_defconfig

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am335x_igep0033_defconfig
IGEPv5 OMAP5432   make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
IGEP SMARC AM335x am335x_igep0034_defconfig make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am335x_igep0034_defconfig
IGEP SMARC iMX6 Solo/Dual Lite igep0046_imx6dl_2G_defconfig make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- igep0046_imx6dl_2G_defconfig
IGEP SMARC iMX6 Dual/ Quad igep0046_imx6q_2G_defconfig make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- igep0046_imx6q_2G_defconfig
IGEP SMARC iMX6 Ultra-Lite / Ultra Ultra-Lite igep0146_imx6ul_512M_defconfig make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- igep0146_imx6ul_512M_defconfig

Build your U-BOOT

After running the defconfig. You can build the U-Boot by executing this command:

  make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-

Once the compile process has sucesfully finished, we will find the resulting files inside the u-boot root folder. Depending on the processor the generated files will be different:

  • The result for ARM processor based board will be a MLO and u-boot.img.
  • The result for Freescale-NXP processor based will be a u-boot.imx.


Finally we can copy this files in a boot device, for example, a microSD Memory Card. It is explained in the following post.

Information.jpg In case of the Freescale-NXP Porcessor Boards, it is not possible to copy directly the u-boot.imx file. It is necessary to copy in the first blocks of the boot device using the dd command. It is explained in the following post How to prepare a bootable MicroSD Card.


Download Binary package

You can download binary packages from here.

What next...

After build u-boot you have to download and compile kernel