Porting U-boot (I) Basics: Add a new target board Definition

Source: Internet
Author: User
U-boot practically porting Guide

Author: Aaron Wong

Aaronwong@engineer.com

 

U-boot

Transplantation

(

I

)

Basic: Add a new target board Definition

This article uses the latest U-Boot-1.3.0-rc2
.

U-boot
It supports many development boards. In its source code, each Board corresponds to a Board/
Folder under the directory (
Note: This is not accurate, because some folders are vendor names and there can be multiple target board directories below. Here we only consider the simplest situation)
, And include/configs/
Directory. Therefore, you need to add U-boot
To support our target board, you must first create the target board folder and configure the header file, and modify the relevant makefile.
.

The following describes the instance as U-boot.
Steps and procedures for adding a new target board definition.

(1)
On/
Directory.

The target board of the author is xsbase270.
The processor is PXA270.
. Because U-boot
It supports many development boards and processors. You can find the Development Board with the same or similar processor model as your own, and make subsequent modifications on this basis.

Adsvix
PXA27X is also used.
Processor, so you can use it as a template.

CD board/

CP-ARV adsvix xsbase270

MV xsbase270/adsvix. c xsbase270/xsbase270.c

 

(2)
In include/configs/
Directory.

CD include/configs/

CP adsvix. h xsbase270.h

 

(3)
Modify makefile
.

First, in the total makefile (u-boot
Under the top-level directory of the source code)
Add the compilation configuration option of the target board. For more information, see adsvix.
As long as the target board name is changed to xsbase270
You can:

Adsvix_config: unconfig

@ $ (Mkconfig) $ (@: _ Config =) arm PXA adsvix

Xsbase270
_ Config: unconfig

@ $ (Mkconfig) $ (@: _ Config =) arm
PXA
Xsbase270

Here xsbase270
And board/
Name of the target board folder in the directory xsbase270
.

Note that the makefile
Cross_compile is defined in
To specify the cross compiler during cross-compilation. By default
Cross_compile
Definition:

Ifeq ($ (ARCH), arm)

Cross_compile = arm-Linux-

Endif

That is, the prefix of the Cross-compiler name is arm-Linux-
If you use the toolchain
If the name is different, you need to modify it accordingly. For example, the author uses arm-iwmmxt-Linux-gnueabi-gcc
Therefore, you must change it to cross_compile = arm-iwmmxt-Linux-gnueabi-
.

The second is to modify the Board/xsbase270
Makefile
.

# Cobjs: = adsvix. o pcmcia. o

Cobjs: = xsbase270.o PCMCIA. o

This is because the source file adsvix. C under this directory is
Changed to xsbase270.c
.

 

Now, the new target board xsbase270
To U-boot.
The work is completed. The following command can be compiled to obtain xsbase270
U-boot
:

# Assuming you are at the top directory of U-boot

# Define a build directory to keep object files during make process and also finally U-Boot Image

Export build_dir = ~ U-boot_xsbase270/build/

Make xsbase270_config

# If you edit your source file and want to make again, just type "make distclean" and then call the above commands again.

Make

 

Of course, the compiled U-boot
There is still a lot of work to do, including processor working status, memory ing settings, NIC Driver porting, and so on. Therefore, the title of this article is only in U-boot
Add a "definition" for the new target board instead of "support" for the new target board.
The source code has a general understanding, and combined with the characteristics of the target board to complete. The following sections will be introduced later.

As a supplement to this article, you may still need to understand the following points:

(1)
In makeall
The new target board xsbase270
Add to the following list
Medium:

######################################## #################

# XScale Systems

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.