~~NOCACHE~~
{{template>en:templates:tabs_power_bootstrap|lang="en"|mod_name="tqmp2020"|mod_name_head="TQMP2020"|mod_arch="power"|bsp_name="linux"|bsp_name_head="Linux"}}
===== Build system =====
====== ELDK 5.2.1 ======
==== Preparing the development host ====
* TQ Ubuntu virtual machine
* [[http://www.denx.de/wiki/view/ELDK-5|Build system installation]]
* [[http://www.denx.de/wiki/view/ELDK-5/WebHome#Section_1.7.|Toolchain installation]]
==== Using the build system ====
* [[http://www.denx.de/wiki/view/ELDK-5/WebHome#Section_1.8.|Configuration]]
* Compilation
* Deployment
* Bootloader
* Kernel
* Root file system
==== Using different boot media ====
* NFS
* NOR-Flash
* eMMC
* SD-Card
====== ELDK 4.2 ======
===== Installation=====
The ftp download server for the iso image of the ELDK CD is: http://ftp.denx.de/pub/eldk/4.2/ppc-linux-x86/iso/ppc-2008-04-01.iso
Before running the installation you have to create a direcotry for the installation. After that you can run the install skript.
tq@ubuntu:/media/ppc-2008-04-01$ sudo mkdir /opt/eldk
tq@ubuntu:/media/ppc-2008-04-01$ sudo chown tq:tq /opt/eldk
tq@ubuntu:/media/ppc-2008-04-01$ ./install -d /opt/eldk @arch@
After a successful run of the install skript you need to make the ELDK rootfs able to boot. Run the two skripts with ''sudo'' enabled.
tq@ubuntu:/media/ppc-2008-04-01$ sudo ./ELDK_MAKEDEV -d /opt/eldk/
tq@ubuntu:/media/ppc-2008-04-01$ sudo ./ELDK_FIXOWNER -d /opt/eldk/
===== Configuring the ELDK Cross Compiler =====
The configuration of the environment variables ''$PATH'' and ''$CROSS_COMPILE'' should be written in the file ''/opt/eldk/setup_eldk''.
tq@ubuntu:/opt/eldk$ echo 'PATH=$PATH:/opt/eldk/usr/bin:/opt/eldk/bin
export CROSS_COMPILE="@arch@-"
export ARCH=powerpc' > setup_eldk & chmod u+x setup_eldk
To use the ELDK toolchain for cross compiling you can simply source the created configuration file.
tq@ubuntu:~$ source /opt/eldk/setup_eldk
If you are using just this version of ELDK with only one architecture you can write the settings permanent in the file ''~/.bashrc''. Open your favourite texteditor and and append the following line.
source /opt/eldk/setup_eldk
Alternatively you can do it with a small command:
tq@ubuntu:~$ echo 'source /opt/eldk/setup_eldk' >> ~/.bashrc
===== Compiling U-Boot =====
Download the archive with the patches and unpack it (e.g. to ''~/src/BSP/UBoot/patches''). Download the basic version with ''git''.
user@ubuntu:~/src$ git clone http://git.denx.de/u-boot.git
user@ubuntu:~/src$ cd u-boot/
user@ubuntu:~/src/u-boot$ git checkout -b P2020 v2011.03
user@ubuntu:~/src/u-boot$ stg init
user@ubuntu:~/src/u-boot$ stg import -t -s ~/src/BSP/UBoot/patches/series
The environment variables ''ARCH'' and ''CROSS_COMPILE'' were set according to section [[#configuring_the_eldk_cross_compiler|Configuring the ELDK Cross Compiler]].
The following commands have to be executed: to configure and compile with ''make'':
user@ubuntu:/.../src/u-boot$ make distclean
user@ubuntu:/.../src/u-boot$ make TQMP2020_config
user@ubuntu:/.../src/u-boot$ make all
== Sources ==
* http://www.denx.de/wiki/view/DULG/UBootConfiguration
* http://cache.freescale.com/files/dsp/doc/app_note/AN4172.pdf?fsrch=1&sr=1
===== Compiling Linux kernel =====
==== Used versions ====
* Ubuntu 10.04 i386 (VMware Virtual Machine)
* ELDK 4.2
==== Preparation ====
Install the git source code management system.
user@ubuntu:~$ sudo apt-get install git-core stgit uboot-mkimage
Create a directory for the Linux source code:
tq@ubuntu:~$ mkdir ~/src
tq@ubuntu:~$ cd ~/src
=== Get source code ===
The current BSP (October 2011) is based on the 2.6.39 kernel of Denx software engineering. The base version of this source code you get from the Git server http://git.denx.de.
tq@ubuntu:~/src$ git clone http://git.denx.de/linux-denx.git
tq@ubuntu:~/src$ cd linux-denx
Create local branch named p2020 with the source code of version DENX-v2.6.39:
tq@ubuntu:~/src/linux-denx$ git checkout -b p2020 DENX-v2.6.39
=== Patch sources ===
Unpack the archive with the patches into a local folder e.g. to ''~/src/BSP/Linux/patches''.
You can find the patches on the [[http://www.tq-group.com/tqmp2020#product-downloads|TQ product page]].
The patches are now applied to the kernel sources:
tq@ubuntu:~/src/linux-denx$ stg init
tq@ubuntu:~/src/linux-denx$ stg import -t -s ~/src/BSP/Linux/patches/series
==== Build kernel ====
If the ELDK has been
[[en:tqmp2020:installation_eldk_toolchain#eldk_cross_compiler_configuration|configured]]
according to the instructions the cross compilation toolchain is ready to compile the kernel.
Configure and build:
tq@ubuntu:~/src/linux-denx$ make 85xx/tqmp2020_defconfig
tq@ubuntu:~/src/linux-denx$ make uImage
If the following error occurs when configuring the kernel source code:
*** Can't find default configuration "arch/x86/configs/85xx/tqmp2020_defconfig"!
then the environment is not configured correctly. For more information see section
[[en:tqmp2020:installation_eldk_toolchain|Installation of the ELDK Toolchain]].
=== Download kernel via TFTP ===
To load the kernel ''uImage'' in the directory ''arch/powerpc/boot'', it has to be copied to the [[en:tftp|TFTP]] root directory. Depending on the configuration of the [[en:tftp|TFTP]] server it is e.g. ''/tftpboot''. Starting from the source directory the ''uImage'' is copied to the ''/tftpboot'' directory with the following command.
tq@ubuntu:~/src/linux-denx$ cp arch/powerpc/boot/uImage /tftpboot