SkyEye : SkyeyeUboot

Step by Step run u-boot in the "skyeye" simulator (translation)


By faif

1. Brief Introduction


Skyeye is a desirable board level SOC simulator based on the ARM CPU core chips.

U-boot is a boot program running on the main boards which have different CPUs such as arm,mips and PowerPC. It looks like BIOS of PC but is more powerful than the normal BIOS. For example, it can support the network boot and can boot all kinds of kernel, and even a simple shell etc.

Both of them are Open Source free software found on GPL.

This article shows you how to use Skyeye to run u-boot by simulating an EP7312 main board and modifying the minimum of code.

2. Establish the developing environment


2.1 Installation of the Skyeye Simulator

The Skyeye Simulator runs on LINUX and the operating system need to support GTK. First download, decompress and install the source code package of Skyeye -0.8.5.1 according to the readme. When doing them, please login as root. For the different versions of Linux, the installing notice can be found in the BBS. After a successful installation, the directory of Skyeye has been set as a default path and Skyeye can run on any directory you want.

2.2 Installation of a cross compiler

A cross compiler is a compiler which can compile the code for the different system architecture CPU. For instance, in order to compile the code on Linux running on X86 CPU for the arm CPU, a cross compiler, not a normal one, is required. Setting up a cross compiler by the gcc source code is inconvenient and demand too much time. However, the author of u-boot has implemented a good cross compiler called ELDK(Embedded Linux development kit). I use it and of course you can the other cross compilers from other embed company. The mirror web site for ELDK can be found from the following address:

http://www.denx.de/twiki/bin/view/DULG/ELDKAvailability (The current version is 3.1.1 released at 2005-03-06)

There are three versions of ELDK :MIPS,ARM and PPC.A cross complier found on ARM can be downloaded from the following address:

http://sunsite.utk.edu/ftp/pub/linux/eldk/3.1.1/arm-linux-x86/iso/

The file name is "arm-2005-03-06.iso" and it supports ARM7, ARM9, XScale, AT91RM9200 and other ARM based systems. First mount the iso image into your cdrom mount point.

mount -o loop -t iso9660 arm-2005-03-06.iso /mnt/cdrom/


Then run "install" to install tools. It was installed in my own directory ?/opt/x86-arm/? by the following command:

/mnt/cdrom/install -d /opt/x86-arm/


After the installation, a convenient user environment may be set by the following command:

export PATH="${PATH}:/opt/x86-arm/usr/bin:/opt/x86-arm/bin"
export CROSS_COMPILE=arm-linux-


Now the cross compiler can run on any directory.

A test can be done:

arm-linux-gcc -o testarm test.c
file testarm
testarm: ELF 32-bit LSB executable, ARM, version 1 (ARM), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped.

When the result is displayed, it shows the file has been compiled as the arm binary code and the arm-linux-gcc can be used to compile your program.

3. Modification of u-boot


A new u-boot source code can be downloaded from the web sites:
http://u-boot.sourceforge.net/
ftp://ftp.denx.de/pub/u-boot/

The u-boot source code is a very good example to study the embed systems because of the clear structure and the detailed notations.

The u-boot which is the new version 1.1.2 has been downloaded by me. Because the main board chip, EP7312, we want to simulate have been supported by u-boot, only some modification of the configuration about EP7312 in u-boot need to be done.
The configure files in u-boot are saved in the directory: ?include/configs/?.The file,?include/configs/ep7312.h?, can be found and should be modified.

In this file,
#define CONFIG_DRIVER_CS8900    1 

should be changed into
#define CONFIG_DRIVER_CS8900    0 


and
#define CONFIG_COMMANDS  (CONFIG_CMD_DFL | CFG_CMD_JFFS2) 

should be changed into
#define CONFIG_COMMANDS  (CONFIG_CMD_DFL) /*Skyeye doesn't have jffs2*/ 


#define CONFIG_BOOTDELAY 3

should be changed into
#define CONFIG_BOOTDELAY 150  /* To increase this number ,let you have enough time to cancel auto-net-boot function by typing 'enter' or just change it into be '-1' to cancel  auto-net-boot function automaticly */ 


Then come back the root directory of u-boot, configure and compile:

make ep7312_config
make all

After them, two files should be found: u-boot. bin and u-boot. U-boot.bin is a raw binary file and u-boot is an ELF formatted file.

4. Configuration of skyeye and Running u-boot


First, a new directory should be created to represent your main board and keep the file system tidy.
mkdir board01

After that , copy u-boot.bin into this directory.Skyeye supports both of formations, the raw binary file and the ELF formatted file. However, in here the raw binary file is used.

Finally, edit a configure file for the main board called skyeye.conf .The detail explanation can found in the relevant skyeye documents .
The following is my skyeye.conf:
#skyeye config file for uboot
cpu: arm720t
mach: ep7312

mem_bank: map=I, type=RW, addr=0x80000000, size=0x00010000

#skyeye for uboot flash 16M bank 1
mem_bank: map=M, type=RW, addr=0x00000000, size=0x01000000, file=./u-boot.bin,boot=yes

#skyeye for uboot sdram 16m bank 1
mem_bank: map=M, type=RW, addr=0xc0000000, size=0x01000000


Notice: the memory address and allocation of capability in this file have been adjusted according to the configure file for ep7312 in u-boot in order to minimize the modification of the u-boot code.

Now your configuration for the skyeye-ep7312 has been completed and you may try to run it:

In your current directory, input:
skyeye

In the interface of skyeye, input: (For Skyeye1.0, this step shoul be ignored and u-boot will start directly.)
target sim
run

At this time , the interface and prompt of u-boot can be saw and then when inputting ?help?, all commands in u-boot can be showed or when inputting ?version?, the current u-boot version can be displayed etc.

5. Further jobs

Because the content in this article is basic and introductory, further jobs may be tried to do.

For example:

1 For skyeye has not supported the flash memory, is it possible to modify the code about the flash memory for ep7312 in u-boot to satisfy our temporary demand. Otherwise, for the configuration of u-boot environment parameters, we only can modify the default parameters in the source code.

2 Both of skyeye and u-boot support Ethernet controller, is it possible to use the u-boot net on skyeye.

3 For the development of the flash memory, u-boot can be used as a test tool because there are many flash memory drivers for all kinds of main boards in u-boot.

I hope more experts will give more suggestions to help me improve.

Translator: NewOne

There are no comments on this page. [Add comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.3
Page was generated in 0.1531 seconds