[[bc10/Software]]

- Contents
#contents

* Summary [#edd10439]
>This section explains the building process of U-Boot, which is used as second bootloader as bc10 starts booting up. This~
building process is originally created for BeagleBoard. Since bc10 is a clone of BeagleBoard, the original building method~
can be used for bc10's U-Boot. The boot process of bc10 and the installation of U-Boot are discussed at [[bc10/booting]].~


* Building U-Boot [#n55aef00]
** Development Environment [#mf98afa2]
>
-Make ready toolchain for bc10.~
-Test whether the toolchains are already built or not.~
-- [[OpenEmbedded Linux toolchain>bc10/OpenEmbedded Linux]] (arm-angstrom-linux-gnueabi-), which is wildly used for the development~
environment of BeagleBoard.~
-- [[rowboat toolchain>bc10/rowboat]] (arm-eabi-), which is employed at rowboat, Android project for OMAP35x.
-- CodeSourcery arm GNU/Linux toolchain (arm-none-linux-gnueabi-), which is developed at CodeSourcery.


** Setting up Environment Variable [#sde19976]

*** OpenEmbedded Toolchain [#fbb7fed4]
>
Make sure that the development environment is already installed into the host environment before toolchain of~
OpenEmbedded Linux is used. The information of setting of the OpenEmbedded development environment is available~
at [[bc10/OpenEmbedded Linux]].~
To use the toolchain,  configure the environment variable.~
 export PATH=${WORK_DIR}/OE/angstrom-dev/cross/armv7a/bin:${PATH}
 export ARCH=arm
 export CROSS_COMPILE=arm-angstrom-linux-gnueabi-

*** rowboat toolchain [#yc5ba812]
>
Please install the rowboat development environment before rowboat's toolchain s is used. For more information about~
setting the development environment for rowboat, please look at [[bc10/rowboat]]. To use the toolchain, set up the~
environment variable.~
 export PATH=${WORK_DIR}/rowboat-eclair-dsp/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin:${PATH}
 export ARCH=arm
 export CROSS_COMPILE=arm-eabi-

** Obtain source code [#z5d51637]
>
Obtain the source code from git repository.~
 git clone git://gitorious.org/bc10/u-boot-bc10.git u-boot-bc10

** Build [#b149a04f]
>
To use OpenEmbedded toolchain, cross-build U-Boot, which is specifically modified for bc10.
 make mrproper
 make omap3_bc10_config
 make 
~
As the build process is successfully completed, '''u-boot.bin''' is produced.~
For more information about placing U-Boot into SD Card, please visit at [[bc10/booting]].~

** Updating source code [#ua46dcdb]
>
As new features are added and/or bugs are fixed, obtain the portions of renewed code.
 cd u-boot-bc10/
 git pull

* About source code repository [#h46973c8]
>
The source code of '''u-boot-bc10''' is managed by Gitorious.
- Project page
-- http://gitorious.org/bc10/u-boot-bc10
- Repository
-- git://gitorious.org/bc10/u-boot-bc10.git

** Branch [#td2a5c6a]
>
The repository of '''u-boot-bc10''' has three branches shown below.~
- master
-- the release branch for bc10
- develop
-- the development branch for bc10
- build
-- Soon to be removed (a build branch for bc10)
~

>
To build a '''u-boot.bin''', which works on bc10, please use the master branch.~

>
The develop branch is used for testing newly added features. It is always implemented the newest~
features, but it sometimes does not work well. Please use the master branch for daily use.~

>
The build branch has been used temporarily until the MACH_TYPE number of bc10 is officially added.~
Right now, since the MACH_TYPE of bc10 is officially supported, the build branch is not updated anymore.~
In the near future, the build branch may possibly be removed. Please do not use the build branch. For this~
matter, please look at '''README''', which is located at the directory of '''Documentation/arm/README''' in~
the kernel source.~ 

** Origin [#v5dd34ef]
>
The source code of '''u-boot-bc10''' is cloned from the U-Boot repository of DENX, the original is modified~
for bc10.
- DENX U-Boot URL
-- http://www.denx.de/wiki/U-Boot
- Repository
-- git://git.denx.de/u-boot.git
- Branch
-- master

* Detail explanations of U-Boot [#uba8092d]
** Basic functions of U-Boot [#nc331c05]
>
This section explains basic functions of U-Boot and how to customize it.~

>
Hush, a shell, is already embedded in U-Boot, and U-Boot can be managed by shell scripts and command lines.~
Hush is used for customizing functions of U-Boot.
 
*** Boot Sequence [#tea127b5]
*** Applying a boot command [#we3c1cd8]
> 
As starting U-Boot, U-Boot waits few seconds. then, it automatically executes commands.~
While U-Boo is waiting, its command prompt appears as user presses any key. U-Boot can be~
managed by command lines. Once the command prompt appears, the boot command is not executed~
automatically~
  +--------+        +-------+ No Inputs   +---------------------+
  |Booting |------>>|Waiting|----------->>| Execute boot command|
  +--------+        +-------+             +---------------------+
                      |
                      | Inputs            +---------------------+
                      +----------------->>| Command line control|
                                          +---------------------+ 

*** Executing a boot command [#we3c1cd8]
>
boot command executes what '''bootcmd''' an environment variable has ordered.~
By the default, '''bootcmd''', an environment variable, is configured as shown below.~
(In the original, this is one-line command line. For sake of legibility, it is spread~
into several lines.)~
 if mmc init; then 
     if run loadbootscript; then 
         run bootscript; 
     else 
         if run loaduimage; then 
             run mmcboot; 
         else 
             run nandboot; 
         fi; 
     fi; 
 else 
     run nandboot; 
 fi

>
mmc command is used for handling MicroSD.~
run command execute a script, which uses the values of the variables. The values of variables~
are predetermined by the parameters.~ 

*** Control via command lines [#g186b80b]
>
Once the prompt of '''Hush''' appears, it can execute commands in the same way as bash and other~
major command~
Considering '''boot''' command itself as the command for executing '''bootcmd''' an environment vairble,~
it is easy to understand that the booting sequence and options can be managed as controlling the~
the environment variable.~

>
To use '''printenv''' command, the environment variable and the details of the environment vaiables are displayed.~
To apply '''setenv''', set up the vales of the environment variables.~

* Reference [#a3a50b2c]
>
-[[U-Boot (www.denx.de):http://www.denx.de/wiki/U-Boot/WebHome]]

* Revision History [#qae88f9d]
>
2010/07/23 Initial release~
2010/09/16 Add bc10 specific source code repository and build process~
2011/01/13 Add the information of the source repository and  the detail explanation of basic mechanics of U-Boot~

Front page   Edit Diff Backup Upload Copy Rename Reload   New List of pages Search Recent changes   RSS of recent changes