Sie sind auf Seite 1von 5

Vanaja Pakalapati ,et al, International Journal of Research in Computer and Communication

technology, IJRCCT, ISSN 2278-5841, Vol 1, Issue 6, November 2012.

Porting and board bring up of Mini2440 using U-boot and NFS


server
Vanaja Pakalapati
M.Tech(Embedded systems)
ATRI
Hyderabad,
Andhrapradesh,500039
Vanaja.107@gmail.com

E.Mahender reddy
Asst.Professor
ATRI
Hyderabad,
Andhrapradesh,500039
mahender_71@yahoo.co.in

Abstract
U-boot (Universal Boot Loader) has more
features and fast updating speed. More over it
supports more number of file systems as
compared to other boot loaders and
customized boot process. This article, through
configuring the U-boot binary file makes it
support the network file system(NFS) by this
the development cycle time will be reduced in
the embedded code development area and
goes successfully through tests by Mini2440
development board.
Keywords- Boot loader; Network file system;
S3C2440

I. Introduction:

In an embedded system, the boot


loaders role is more complicated because these
systems rarely have BIOS to perform initial
system configuration. Although the low-level
initialization of the microprocessor, memory
controllers, and other board-specific hardware
varies from board to board and CPU to CPU, it
must be performed before an OS can execute.As
embedded system is heavily dependent on the
hardware boot loader, in order to write a generic

www.ijrcct.org

Y.N.V.Satyanarayana
HOD of ECE Deportment
Smt.B.Seetha Polytechnic
Bhimavaram,
Andhrapradesh,534201.
S_yadavalli2001@yahoo.co
m

boot loader, it is very difficult and can only


append more processors and operating systems
support in the source code. U-boot, just as its
name Universal Boot Loader, is committed to
supporting as many processors and operating
systems as possible. It is powerful, and like
Linux, it is also open source software that has
now become the premium in boot loaders.

II. Features of U-boot

The main features of U-boot loader are


Customizable footprint
Monitor
Kernel images downloadable via
Ethernet and USB
Environment variables
It has its own commands
It provides a lot of flexibility that is possible
with its commands and environment variables.
With these features U-boot can support network
file system.
Network

HOST
SYSTEM
(PC)

chiefeditor@ijrcct.org

TARGET
SYSTEM
(mini2440)

Block diagram
Page 284

Vanaja Pakalapati ,et al, International Journal of Research in Computer and Communication
technology, IJRCCT, ISSN 2278-5841, Vol 1, Issue 6, November 2012.

III.TRANSPLANTATION
PREPARATION

C. Transplantation Anticipation Aim

A. Target Platform Hardware Configuration


The boot loader is closely related with the
hardware
device,
so
before
starting
transplantation, firstly, we should make clear the
target platforms hardware configuration.
TABLE I :Hardware configuration
Name
of
hardware
sources
CPU

Description of hardware source

SDRAM

HY57V561620FTP(32Mbyte)x
2

Nand Flash

K9F1G08U0B(128Mbyte)

Interface

Interface
series,
JTAG
Interface, Camera Interface

System
crystal
oscillator

12MHz
crystal
without sources

S3C2440

oscillator

B. Nand Flash Memory Space Allocations


The mini2440 development board has prepartitioned Nand Flash memory space. Table 2 is
the Nand Flash memory space of the allocation
target platform. The first 256KB are for the boot
loader, then next the 128KB are for the Linux
boot parameter, and then next the 5MB are used
to store the Linux kernel image, and the final
area is for the root file system area.
TABLE II: Storage Space Allocation in NAND
Flash
Excursion
0x0
0x40000

Size
0x40000
0x20000

0x60000
0x560000

0x500000
Rest

www.ijrcct.org

content
Boot loader
Linux
Boot
Parameter
Linux Kernel
Root
file
system

1. Can successfully port U-boot into target


board;
2. U-boot can run on the target board and see the
serial output;
3. Can read and write Flash device on target
board;
4. Can boot the Linux kernel.
5. Can transplant the root file system.
6. Can run the code on target without dumping
the code on to target board.
D. What is needed to be done
1. To modify target related code of CPU
(S3C2440), mainly to modify the clock
frequency code of CPU;
2. To modify Flash driver, to add the Nand Flash
Boot Support;
3. To modify GPIO settings;
4. To modify the relevant configuration file.
5. To configure the root file system.
E. Process of U-boot Startup
As embedded system boot loader is strictly
dependent on the hardware, especially the CPU,
so the boot loader for embedded systems usually
starts in two stages. The code is closely related
with the CPU. Usually on the first stage, U-boot
starts the first phase of the process, shown in
flowchart 1.
The first stage is to initialize CPU that is CPU
mode setting for the management mode, turning
off the watchdog, setting frequency, close MMU
and the CACHE, the initial connection bit wide
memory, speed, refresh rate, etc.. After that
RAM loading space booting that is for the
second phase of code done by setting the stack,
jumping to the second phase of the C program
entry point. The first stage code is usually
written in assembly language, energetic, and
high efficiency.

chiefeditor@ijrcct.org

Page 285

Vanaja Pakalapati ,et al, International Journal of Research in Computer and Communication
technology, IJRCCT, ISSN 2278-5841, Vol 1, Issue 6, November 2012.
read from the Flash RAM space, and set the
startup environment for the kernel parameters,
and then boot the kernel. This phase function is
more complicated code, usually written using the
C language, so that you can achieve better
readability and a higher portability. This phase
involves the relevant documents to arch / arm /
lib / board.c peripheral target and the
corresponding driver files.

Start

Setting exception
vectors & CPU clock
Initialization of RAM

Booted from
RAM

IV.
HOST
CONFIGURATION

SYSTEM

Host development environment with Linux


operating system, cross compiler tool chain
using arm-linux-gcc-4.3.2, console tools use
minicom (for linux) and hyper terminal (for
windows).

Yes

A)Create the binary file for boot loader by using


following commands
# cd mini2440
# export CROSS_COMPILE=arm-none-linuxgnueabi# make mini2440_config
# make
After this we can observe uboot.bin in mini2440
directory.
B)Create image for kernel with following
commands
# tar -zxf linux-2.6.32.2-mini2440_20110413.tgz
# cd linux-2.6.32.2
# cp config_mini2440_w35 .config
# ARCH=arm CC=arm-linux-gcc make
menuconfig
System Type->Support Thumb user
binaries

No

Prepare data cache &


inner indications of CPU
Prepare RAM space for
next stage2 code

Copy code of stage2 to


RAM &set stack pointer
to jump to stage2

Jump to stage2

Figure1: start flow chart of stage 1 of U-boot


This phase involves the code files for the
platform and the target associated arch /arm /cpu
/arm920t
/start.S
related
board/samsung/smdk2440/lowlevel_init.S.
Start the second phase of the process diagram
shown in Figure 2, this stage is mainly to be used
to complete this stage of hardware and memory
initialization. If you choose to boot the kernel,
then the kernel image and root file system image

www.ijrcct.org

chiefeditor@ijrcct.org

Page 286

Vanaja Pakalapati ,et al, International Journal of Research in Computer and Communication
technology, IJRCCT, ISSN 2278-5841, Vol 1, Issue 6, November 2012.
Entrance

Initialize peripheral devices


Check internal storage mapping
Boot
kernel
U-boot
shell

Copy kernel image to RAM


Set kernel start-up parameters

Start kernel services

The host system should maintain the


NFS server and root file system of the target to
provide the services required by the target.
C)installing NFS server in the host system
1. Install the required packages...
# apt-get install nfs-kernel-server
mkdir -p /export/target/
2. chmod -R 777 /export
3. To export our directories to a local network
192.168.1.0/24
add the following two lines to /etc/exports.
/export/target
*(rw,fsid=0,insecure,no_subtree_check,async)
# /etc/init.d/nfs-kernel-server restart
D) Building the root file system of target on host
system
Create a busybox configuration file for
busybox-1.19.2based on the old fa.config file
from an earlier version eg. busybox-1.13.3 from
the Mini2440 package.
#cd /export/target/
#cp /<PATH>/rootfs.tgz .
#tar -zxvf rootfs.tgz
# mv rootfs/* .
# cp /<PATH>/uImage /tftpboot

V.
TARGET
CONFIGURATION

SYSTEM

Send Request for NFS server


No

Success
Yes

Free the kernel memory and


invoke init process

Figure 2. Start Flow Chart of Stage 2 of


U-boot & kernel
Kernel Features->Use the ARM EABI
# ARCH=arm CC=arm-linux-gcc make
# ARCH=arm CC=arm-linux-gcc make uImage

www.ijrcct.org

Now there is a need to download the kernel


image and configure the boot loader on the target
system to support the NFS and root file system
on host.
MINI2440# setenv ipaddr 192.168.1.253
MINI2440# setenv serverip 192.168.1.9
MINI2440# dynenv set 0x40000
MINI2440#
nand
erase
0x00060000
0x00500000
MINI2440# tftp 0x32000000 uImage
MINI2440# nand write 0x32000000 kernel
0x00300000
MINI2440# setenv bootcmd 'nboot.e kernel ;
bootm'
MINI2440#
setenv
bootargs
'console=ttySAC0,115200 noinitrd init=/sbin/init
mini2440=0tb
root=/dev/nfs
nfsroot=192.168.1.9:/export/target
ip=192.168.1.253:192.168.1.9:192.168.1.9:255.2
55.255.0:mini2440:eth0:off'
MINI2440# saveenv
MINI2440# boot

chiefeditor@ijrcct.org

Page 287

Vanaja Pakalapati ,et al, International Journal of Research in Computer and Communication
technology, IJRCCT, ISSN 2278-5841, Vol 1, Issue 6, November 2012.
With this the target board can support
the Network File System and it can run the code
in root file system of the target on host system
directly by this the development cycle time get
decreased.

Nand flash write cycles. This U-boot


transplantation has been able to develop its
own systems in normal operation.

VI. SUMMARY

1) Huang Zhiwei, Dengyue Ming, Wang Yan.


ARM9 based embedded system design tutorial.
Beijing: Beijing Aeronautics and Astronautics
Press
2) Zhang Hui, Zhang Huachun. U-Boot on the
method of transplant in the S3C2440[J]. Electron
Devices, 2007. 30
3) Mini2440 development board
http://www.arm9.net/mini2440-feature.asp
4)Master Lei. U-Boot's analysis of the S3C2440
and transplantation[J]. Computer Systems &
Applications, 2010.19 .
5) of Entering Feng XW music. S3C2440A
Embedded Linux system
based on the structures[J]. Computer,
6) S3C2440A 32-Bit CMOS Microcontroller
User's Manual Rev
http://www. Samsungsemi.com,2004-07.

U-boot is an open-source boot


loader, supports a lot of processors,
operating systems and file systems. It
provides a lot of flexibility to select its
features by configuring the boot loader with
the help of its commands and Environment
variables. While developing a code
debugging plays very important role
consumes time and eats the Nand flash write
cycles. Flash memory has limited number of
write cycles. This NFS support of U-boot
helps the embedded code developer to
decrease the debugging time or to decrease
the development cycle time and to save the

www.ijrcct.org

REFERENCES

chiefeditor@ijrcct.org

Page 288

Das könnte Ihnen auch gefallen