Difference between revisions of "BootLoader"
(→Update U-Boot) |
(→Customize the flash memory organization) |
||
Line 112: | Line 112: | ||
==Customize the flash memory organization== | ==Customize the flash memory organization== | ||
TBD | TBD | ||
+ | == Installing Target software from uboot == | ||
+ | |||
+ | [[InstallTargetSoftware|InstallTargetSoftware]] | ||
==Booting Linux== | ==Booting Linux== |
Revision as of 08:21, 7 August 2008
Contents
- 1 Introduction
- 2 Build U-Boot
- 3 Install or restore from scratch
- 4 Modify your environment variables
- 5 Update U-Boot
- 6 Advanced Linux Boot
- 7 Customize the flash memory organization
- 8 Installing Target software from uboot
- 9 Booting Linux
- 10 Customize Linux boot mode
- 11 Typical Kermit (.kermrc) config file
- 12 Links
Introduction
This page describe the U-Boot installation/usage in the Armadeus context.
Build U-Boot
Build process is now part of the Armadeus automated build (see Install Armadeus software). To only build U-Boot you can launch:
$ make u-boot
Compiled binary files will be put in the buildroot/binaries/armadeus/ subdirectory.
- u-boot.bin is a binary image file that can be downloaded and flashed from U-Boot itself (see below)
- u-boot-brec is a boostrap record file compatible with the Freescale bootstrap inside the i.MXL.
The following informations are only kept here for historical reasons and only usefull for a manual build process.
- Download Das U-Boot source code archive from: http://sourceforge.net/project/showfiles.php?group_id=65938
- Uncompress it:
tar jxvf u-boot-1.1.6.tar.bz2
- Get Armadeus patches in armadeus tree armadeus/buildroot/target/device/armadeus/u-boot/patches and copy it to the U-Boot directory.
- Go inside the U-Boot directory and apply the patches (here for u-boot-1.1.6):
patch -p1 < 100-apx9328.patch patch -p1 < 101-u-boot-apx9328.patch and so on..
If you have a 8 or 16MB apf9328 board, edit the include/configs/apx9328.h. look for a #define SDRAM_xxxMBIT change it to a:
* #define SDRAM_64MBIT /* for 8MB */ * #define SDRAM_128MBIT /* for 16MB */ * #define SDRAM_256MBIT /* for 32MB */
Then build U-Boot:
make apf9328_config make
this produce u-boot.bin and u-boot.brec files described hereabove.
Install or restore from scratch
If your Armadeus board doesn't boot anymore (flash content erased or dammaged), you will have to use the bootstrap mode of the i.MX.
In that case the uboot_recover python script is used to flash a new U-Boot version; this tool is located in the armadeus/software/uboot_recover/ folder of the Armadeus project tree.
Take a look a the INSTALL file the first time you want to use the recover tool.
Remark: the serial port must support a baud rate of 57600 bps per second.
Modify your environment variables
There is a set of variables you can customize to your needs. The commande printenv show you most of them and their current state. Use the command setenv to change one of these variable. For instance:
setenv ipaddr 192.168.0.3
Use the command saveenv to save the state of your environment variables in flash memory.
In order to use network features with u-boot you have to set the network environment variables:
setenv netmask 255.255.255.0 (default value should be fine in most situations) setenv ipaddr 192.168.0.3 setenv serverip 192.168.0.5 (the IP adresse of your tftp host server to download update files ) setenv rootpath "/tftpboot/root" (to boot linux over nfs)
You can use the dhcp command to configure these variable from your dhcp server. Probably you will have to adjust the serverip variable manually.
BIOS> dhcp dm9000 i/o: 0x15c00000, id: 0x90000a46 MAC: 00:0e:32:00:00:01 operating at 100M full duplex mode BOOTP broadcast 1 DHCP client bound to address 192.168.0.3 BIOS>setenv serverip 192.168.0.5 BIOS>saveenv
Do not forget to save your changes in flash with saveenv to have them available at power up.
Update U-Boot
There are 2 steps to update U-Boot:
- 1] Load the new U-Boot code in RAM (You can use the following commands to download U-boot)
- With ethernet and a TFTP server:
BIOS> tftpboot 08000000 /tftpboot_path_to_buildroot/u-boot.bin
- With ethernet and a NFS server:
BIOS> nfs 08000000 host_ip_addr:/nfs_path_to_buildroot/u-boot.bin
- With the kermit and a serial line:
- With ethernet and a TFTP server:
BIOS> loadb <CTRL><ALT GR>\ c send path_to_buildroot/u_boot.bin c
- 2] Transfer code from RAM to Flash memory (there is a simple U-Boot command/script to do that):
BIOS> run flash_uboot
Advanced Linux Boot
The command "boot" is the common way to run linux from flash memory. This command is equivalent to the macro:
run jffsboot
This is the default command stored the u-boot variable: bootcmd.
bootcmd=run jffsboot
U-boot also supports the commands to boot from a network or a sd/mmc card.
- nfs boot
run nfsboot
This command boots linux rootfs from an nfs server. Change the u-boot variables serverip and rootpath to fit with your host pc.
serverip=192.168.0.2 rootpath="/tftpboot/root"
- mmc boot
run mmcboot
This command boots linux rootfs from an sd/mmc memory card. Adapt the variables: mmcroot and mmcrootfstype to your extension card boot partition.
mmcroot=/dev/mmcblk0p1 mmcrootfstype=ext2
Customize the flash memory organization
TBD
Installing Target software from uboot
Booting Linux
The Install Armadeus software on target provide some information to install linux on Armadeus board
Customize Linux boot mode
Typical Kermit (.kermrc) config file
set line /dev/ttyS0 set speed 115200 set carrier-watch off set handshake none set flow-control none robust set file type bin set file name lit set rec pack 1000 set send pack 1000 set window 5 set transmit linefeed on