Difference between revisions of "The IGEP X-loader"
From IGEP - ISEE Wiki
Manel Caro (talk | contribs) (→VERSION CHANGES) |
Manel Caro (talk | contribs) |
||
Line 176: | Line 176: | ||
= BOOT<br> = | = BOOT<br> = | ||
− | The IGEP X-Loader must reside in the microSD card or in the | + | The IGEP X-Loader must reside in the microSD card or in the Nand Memory.<br> |
== MMC Boot == | == MMC Boot == | ||
Line 184: | Line 184: | ||
You can follow this howto about how [http://code.google.com/p/beagleboard/wiki/LinuxBootDiskFormat prepare the microsd card] or [[How to boot from MicroSD Card]]<br> | You can follow this howto about how [http://code.google.com/p/beagleboard/wiki/LinuxBootDiskFormat prepare the microsd card] or [[How to boot from MicroSD Card]]<br> | ||
− | Get a new | + | Get a new microsd card and create two partitions, the first one must be fat16/32 and the second one can be formated in any format type supported by linux kernel.<br> |
=== Copy the files in the first (FAT) partition === | === Copy the files in the first (FAT) partition === | ||
Line 190: | Line 190: | ||
In the first partition you must copy in this order: | In the first partition you must copy in this order: | ||
− | #x-loader.bin.ift (you must rename this file to MLO) / This is a signed image using contrib/signGP tool | + | #x-loader.bin.ift (you must rename this file to MLO before copy it) / This is a signed image using contrib/signGP tool |
− | #x-loader configuration file [http://git.igep.es/?p=pub/scm/igep-x-loader.git;a=blob;f=scripts/igep.ini;h=7ecda91b2716d8984d48fa6c5eb5c74b8f0b0959;hb=HEAD igep.ini] also you can change the configuration file name editing the file: [http://git.igep.es/?p=pub/scm/igep-x-loader.git;a=blob;f=include/configs/igep0020-sdcard.h | + | #x-loader configuration file [http://git.igep.es/?p=pub/scm/igep-x-loader.git;a=blob;f=scripts/igep.ini;h=7ecda91b2716d8984d48fa6c5eb5c74b8f0b0959;hb=HEAD igep.ini] also you can change the configuration file name editing the file: [http://git.igep.es/?p=pub/scm/igep-x-loader.git;a=blob;f=include/configs/igep0020-sdcard.h igep00x0.h] (#define IGEP_BOOT_CFG_INI_FILE "igep.ini") |
#Your desired kernel image. | #Your desired kernel image. | ||
Line 208: | Line 208: | ||
or you can set the name for your kernel in the configuration file using the tag: kImageName | or you can set the name for your kernel in the configuration file using the tag: kImageName | ||
</pre> | </pre> | ||
− | Don't use a uImage kernel format (from uboot), only standard kernel formats | + | Don't use a uImage kernel format (from uboot), only standard kernel formats be supported. |
'''kernel build command example''': | '''kernel build command example''': | ||
Line 224: | Line 224: | ||
<pre>sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules_install INSTALL_MOD_PATH=[path to your target rootfs] | <pre>sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules_install INSTALL_MOD_PATH=[path to your target rootfs] | ||
</pre> | </pre> | ||
− | == | + | == Nand Boot == |
− | === | + | === Nand Partitions<br> === |
− | We | + | We've defined 3 partitions on the Nand Memory. |
<pre>MTD partitions on "omap2-onenand": | <pre>MTD partitions on "omap2-onenand": | ||
(a) 0x000000000000-0x000000080000 : "X-Loader" | (a) 0x000000000000-0x000000080000 : "X-Loader" | ||
Line 237: | Line 237: | ||
*Not fs formated (onenand raw) | *Not fs formated (onenand raw) | ||
− | * | + | *Size: 0x80000 (512 KiB) |
*The xloader must be signed before copy it into the flash memory. | *The xloader must be signed before copy it into the flash memory. | ||
− | You should copy the x-loader in the firsts 4 blocks (first 512 KiB), this is not a formated partition due the ROM not permits boot from a formated partition in flash, you should use flash_eraseall and | + | You should copy the x-loader in the firsts 4 blocks (first 512 KiB), this is not a formated partition due the ROM not permits boot from a formated partition in flash, you should use flash_eraseall and [http://git.igep.es/?p=pub/scm/writeloader.git;a=summary writeloader] for copy x-loader in the first blocks. |
− | <pre>Suggested procedure: | + | <pre><span class="Apple-style-span">Suggested procedure: |
+ | Sign the x-loader before write it on the flash or microsd card. | ||
+ | </span><span class="Apple-style-span" style="font-family: sans-serif; font-size: 13px; line-height: 19px; white-space: normal; "><pre style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(249, 249, 249); line-height: 1.1em; ">Sign x-loader: | ||
+ | You should execute contrib/signGP for sign the xloader that resides inside the flash memory. | ||
+ | contrib/signGP x-load.bin | ||
+ | The signed x-loader it's named: x-load.bin.ift | ||
+ | </pre><div><br></div></span><span class="Apple-style-span"> | ||
Erase and copy the x-loader into the first flash partition: | Erase and copy the x-loader into the first flash partition: | ||
$nand_eraseall /dev/mtd0 | $nand_eraseall /dev/mtd0 | ||
− | $ | + | $writeloader -i <x-loader.bin.ift> -o /dev/mtd0 |
− | |||
− | |||
− | |||
− | |||
Due the Onenand 512 MiB has two dies it's necessary split the x-loader and convert it to a 1 die binary. | Due the Onenand 512 MiB has two dies it's necessary split the x-loader and convert it to a 1 die binary. | ||
Line 260: | Line 262: | ||
for file in `ls split-a?`; do cat $file >> x-load-ddp.bin.ift; cat $file >> x-load-ddp.bin.ift; done | for file in `ls split-a?`; do cat $file >> x-load-ddp.bin.ift; cat $file >> x-load-ddp.bin.ift; done | ||
− | This last command generate a file named x-load-ddp.bin.ift this is the x-loader for copy it in the OneNand.</pre> | + | This last command generate a file named x-load-ddp.bin.ift this is the x-loader for copy it in the OneNand.</span></pre> |
==== <span style="display: none;" id="1299156619608S"> </span>Boot Partition ==== | ==== <span style="display: none;" id="1299156619608S"> </span>Boot Partition ==== | ||
Line 342: | Line 344: | ||
Also remember you can comment any line using ';' or '#' characters. | Also remember you can comment any line using ';' or '#' characters. | ||
− | </pre> | + | </pre> |
+ | |||
= FAQ = | = FAQ = | ||
Revision as of 22:46, 2 March 2012
Contents
Summary
X-Loader, an initial program loader for Embedded boards based on OMAP processors.
Features and Limitations
Improvements & Modifications
- Added malloc/free functionality.
- Added mtd framework and onenand support, removed the old onenand drivers.
- Added fs jffs2 support using mtd & onenand support (Read Only).
- Added crc32 and zlib.
- Jffs2 zlib compression support (Read Only).
- Dual boot mmc & onenand with mmc highest priority.
- Added Linux kernel boot directly (Support for 2.6.22 and highest version kernels)
- Linux kernel supported images: vmlinuz, bzImage and zImage.
- Support for loading Linux Ram disk (EXPERIMENTAL)
- Added "ini" files parser.
- The configuration resides in a plain txt (ini format file).
- Support Windows & Linux formating ini files.
- boot from mmc, onenand, or mix with mmc highest priority.
- Added codeblocks project and compilation rules.
- Added support for vfat32 extra names.
- Configure TPS65950 voltage to 1.35V if it's used a DM3730 processor.
- Added new parameter MachineID in kernel tag file, with it you can
- - configure the kernel board ID setup
- Added new parameter buddy for kernels 2.6.35.13-3
- Optimize some LPDDR Memory configuration values
- Removed some OneNand Debug information
- Removed some FAT incorrect warnings
- Only support gcc 4.5.2 linaro version
- Added Support Initial Ram disk
- Reconfigure Makefile options
- Support Kernels 2.6.35 and 2.6.37
- Added support for boot ARM binary files (such u-boot or QNX kernel)
- Support for Numonyx, Micron and hynix POP Memories.
- Memory autodetection.
- This software only can be compiled with gcc 4.5
- Added GPTimer functionality.
Limitations
- The ini configuration file it's limited to max size: 16 KiB
- Kernel Command line parameters it's limited to: 4 KiB
- Malloc it's limited to 32 MiB.
TODO
- Remove compilation warnings.
- System Rescue.
STATUS
- Support all IGEP boards.
VERSION CHANGES
[2.1.0-1] This version only can be build with gcc linaro 4.5.2 other compilers be not supported.
[2.1.0-1] Removed some uncontrolled "printf" with incorrect information.
[2.1.0-1] Modified some code under __DEBUG__ option.
[2.1.0-1] Added Support for TPS65950-A3 initialization at 1.35V
[2.1.0-1] Added support for IGEP Module 0030
[2.1.0-1] Added support dynamic Machine ID selection (same xloader boot IGEPv2 & IGEP Module)
[2.1.0-2] ARM Compilation bug resolved
[2.1.0-3] Update SDRAM structure initialization
[2.1.0-3] Added support for Initial RAM disk
[2.1.0-3] Updated Initial RAM disk destination address
[2.2.0-1] Update Makefile structure
[2.2.0-1] Downgrade the boot processor speed
[2.3.0-1] Add NAND flash devices and Micron MT29CXGXXMAXX memories support
[2.3.0-2] Add Hynix NAND memorie and IGEP0032 support
[2.3.0-3] Add Support for execute ARM binaries [2.3.0-3] Bug Fixes related to I and D Cache
[2.4.0-1] Added Memory test feature
[2.4.0-1] Added some boot information
[2.4.0-1] New read_nand_cache function optimized for load from NAND
[2.4.0-1] BUG resolved: Refresh Setup in Micron & Hynix Memories
[2.4.0-1] BUG resolved: Reset Memory controller after initialize Malloc function
[2.4.0-1] BUG resolved: Resolve problems updating the flash content under jffs2
[2.4.0-2] Resolved Memory Autodetection
[2.4.0-2] Better hang board led control
[2.4.0-2] New read_nand_cache function optimized for load from OneNand
[2.4.0-2] Added Hw GPtimer functionality
Pre-Compiled Binaries
Release | Download link | Support |
---|---|---|
2.1.0-2 | igep-x-loader-2.1.0-2.tar.bz2 | All Boards |
2.1.0-3 |
igep-x-loader-2.1.0-3.tar.bz2 | All Boards |
2.2.0-1 |
igep-x-loader-2.2.0-1.tar.bz2 | All Boards |
Build Procedure
Build with Ubuntu Cross Compiler gcc 4.5.2
Install the cross compiler if you not do it before.
Enviroment Ubuntu 10.10
sudo apt-get install cpp-4.5-arm-linux-gnueabi g++-4.5-arm-linux-gnueabi
Enviroment Ubuntu 10.04
sudo add-apt-repository ppa:linaro-maintainers/toolchain
sudo apt-get install cpp-4.5-arm-linux-gnueabi g++-4.5-arm-linux-gnueabi
Setup the board settings
make igep00x0_config
Build
make
Sign the binary x-loader
You should execute contrib/signGP for sign the xloader.
contrib/signGP x-load.bin The signed x-loader it's named: x-load.bin.ift
Build Native
Configure the board settings
make igep00x0_config
Edit the variable CFLAGS and add the option: -fno-stack-protector CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -fno-stack-protector
Build
make CROSS_COMPILE=arm-none-linux-gnueabi-
Sign the binary x-loader
You should execute contrib/signGP for sign the xloader.
contrib/signGP x-load.bin The signed x-loader it's named: x-load.bin.ift
BOOT
The IGEP X-Loader must reside in the microSD card or in the Nand Memory.
MMC Boot
Prepare the microsd card
You can follow this howto about how prepare the microsd card or How to boot from MicroSD Card
Get a new microsd card and create two partitions, the first one must be fat16/32 and the second one can be formated in any format type supported by linux kernel.
Copy the files in the first (FAT) partition
In the first partition you must copy in this order:
- x-loader.bin.ift (you must rename this file to MLO before copy it) / This is a signed image using contrib/signGP tool
- x-loader configuration file igep.ini also you can change the configuration file name editing the file: igep00x0.h (#define IGEP_BOOT_CFG_INI_FILE "igep.ini")
- Your desired kernel image.
Load Order:
48 /* Linux Images */ 49 const char* LinuxImageNames [] = { 50 "kparam" /* Use kparam first */ 51 "zImage", /* jffs2 it's case sensitive */ 52 "zimage", /* fat name it's not case sentitive */ 53 "vmlinuz", 54 "bzImage", 55 "bzimage", 56 0, 57 }; or you can set the name for your kernel in the configuration file using the tag: kImageName
Don't use a uImage kernel format (from uboot), only standard kernel formats be supported.
kernel build command example:
$make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- zImage modules
Second Partition
Copy all your rootfs in this second partition.
Also you can use the linaro 10.11 minimal image download the image and untar (as root) in your microsd card second partition.
Remember install the kernel modules in this partition.
Example:
sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules_install INSTALL_MOD_PATH=[path to your target rootfs]
Nand Boot
Nand Partitions
We've defined 3 partitions on the Nand Memory.
MTD partitions on "omap2-onenand": (a) 0x000000000000-0x000000080000 : "X-Loader" (b) 0x000000080000-0x000000c80000 : "Boot" (c) 0x000000c80000-0x000020000000 : "File System"
X-Loader Partition
- Not fs formated (onenand raw)
- Size: 0x80000 (512 KiB)
- The xloader must be signed before copy it into the flash memory.
You should copy the x-loader in the firsts 4 blocks (first 512 KiB), this is not a formated partition due the ROM not permits boot from a formated partition in flash, you should use flash_eraseall and writeloader for copy x-loader in the first blocks.
<span class="Apple-style-span">Suggested procedure: Sign the x-loader before write it on the flash or microsd card. </span><span class="Apple-style-span" style="font-family: sans-serif; font-size: 13px; line-height: 19px; white-space: normal; "><pre style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(249, 249, 249); line-height: 1.1em; ">Sign x-loader: You should execute contrib/signGP for sign the xloader that resides inside the flash memory. contrib/signGP x-load.bin The signed x-loader it's named: x-load.bin.ift
Erase and copy the x-loader into the first flash partition: $nand_eraseall /dev/mtd0 $writeloader -i <x-loader.bin.ift> -o /dev/mtd0
Due the Onenand 512 MiB has two dies it's necessary split the x-loader and convert it to a 1 die binary.
This is a know OMAP/DM/AM OneNand/Nand boot limitation.
This is the procedure for create the x-loader OneNand binary: You should execute: (You can use copy paste in your console) split -b 2K x-load.bin.ift split- for file in `ls split-a?`; do cat $file >> x-load-ddp.bin.ift; cat $file >> x-load-ddp.bin.ift; done
This last command generate a file named x-load-ddp.bin.ift this is the x-loader for copy it in the OneNand.
</pre>Boot Partition
- fs used jffs2 zlib compressed filesystem.
- Suggested size: 0xC00000 (12 MiB).
X-Loader only support jffs2 partitions for boot partition.
Prepare the boot partition for the first use:
You should follow the same procedure used for copy the x-loader in the first partition.
Suggested procedure: Erase and copy the x-loader into the first flash partition: $flash_eraseall /dev/mtd1 $nandwrite -p /dev/mtd1 <your_boot_initial_jffs2_file> Your initial boot partition can be a empty file the first time.
Next uses:
You can mount the partition over your boot directory in the rootfs
$mount /dev/mtdblck1 /boot
And you can use the cp command for copy your kernel and igep.ini configuration file.
$cp igep.ini /boot
Rootfs Partition
- fs (your prefered fs supported by linux, maybe a good choice it should be ubifs)
- Size, all or you can create more partitions if you wish ...
Boot Priority
XLoader first try load from mmc and if it fails then try from OneNand.
MLO (x-loader), igep.ini, zImage from MMC
If all it's present in the mmc it don't try to boot from Onenand.
MLO (x-loader) in MMC, igep.ini and zImage in Onenand.
If only MLO it's provided this one try to load the other information from the Onenand.
It means that XLoader always try to load the information from MMC and if it fails then try to load from OneNand.
Configuration file: igep.ini
This entry in wikipedia can help you how a ini file it's structured.
Inside the sources/scripts directory you can found a igep.ini example file.
The actual XLoader can handle two kind tags:
[kernel] Used for internal XLoader setup.
[kparams] Used for pass the linux kernel parameters.
TAG: [kernel]
1 [kernel] 2 kaddress=0x80008000 3 rdaddress=0x81600000 4 serial.low=00000001 5 serial.high=00000000 6 revision=0001 7 kImageName=zImage-test 8 kRdImageName=rdImage-test 9 MachineID=xxxx Where Machine ID = 2344 for IGEPv2 and ID = 2717 for IGEP Module
TAG: [kparams]
In this tag you can add all kernel parameters that you need, this is only an example:
10 [kparams] 11 console=ttyS2,115200n8 12 ;earlyprintk=serial,ttyS2,115200 13 mem=512M 14 boot_delay=0 15 ;mpurate=800 16 ;loglevel=7 17 omapfb.mode=dvi:1024x768MR-16@60\r 18 smsc911x.mac=0xb2,0xb0,0x14,0xb5,0xcd,0xde\r 19 ;ubi.mtd=2 20 ;root=ubi0:igep0020-rootfs 21 ;rootfstype=ubifs 22 root=/dev/mmcblk0p2 rw rootwait Also remember you can comment any line using ';' or '#' characters.
FAQ
How I can boot from NFS?
Yes, you should add below parameters in the kparams tag:
#smsc911x.mac fix your mac address smsc911x.mac=0xb2,0xb0,0x14,0xb5,0xcd,0xde # IP set you IP settings <local_ip>:<server_ip>:<gateway>:<network_mask>::<interface>: ip=192.168.2.123:192.168.2.105:192.168.2.1:255.255.255.0::eth0: # Set root as nfs root=/dev/nfs # Set your NFS root path as <server_ip>:<rootfs_path> nfsroot=192.168.2.105:/srv/nfs/linaro_minimal
6 Contribution & Support & Bugs Report
Contributions to this project be welcome and you can send your patches to support@iseebcn.com or you can use the igep forum for it.
You can access to IGEP-x-Loader repository using our git at git.igep.es
IGEP IRC Channel: http://webchat.freenode.net/?channels=igep