Learn about Linux driver development. Chapter 2: start the first step of U-Boot porting

Source: Internet
Author: User

My wife went shopping. I don't know if I had to pay for the phone bill for my province. I have had very little talk time in recent days, and I don't know if she had enough living expenses there, and I won't ask her to pay for it, it's estimated that I'm hungry, my wife ...... She went shopping, so I had to continue to work hard. In order to take good care of her in the future, hehe :)

When I bought tiny6410, although everything was done for us, it was also all done, so that we could get nothing, such as the LED driver above, etc, neither of them is in the form of modules, or they cannot be uninstalled. Therefore, I want to learn how to port a Linux system. Will I learn more about writing a driver, these days I have been struggling with the methodology of learning. Finally, the practical school beat the theoretical school. So I started ............

The first step is to build the development environment. Needless to say, the arm-GCC cross compiler should be installed. Remember to add environment variables for ease of use.

In addition, you can download the source code of U-boot and Linux kernel. Go to the official website and do not go anywhere else.

The U-boot version used here is the u-boot-2010.09, And the Linux version is the linux-2.6.29.

U-boot-2010.09 this version is actually for a lot of CPU is directly supported, first go to the board directory to take a look, my tiny6410 is used by Samsung's cloud6410, enter the Board/Samsung/directory, we found that smdk2400, smdk2410, and smdk6400 were found. Unfortunately, no 6410 was found. However, we have learned that Samsung 6400 and 6410 are almost the same, and they should be able to be modified on the basis.

 

1) Create the Development Board project folder under the Board/Samsung/, name it tiny6410, copy all the things in the smdk6400 folder, and modify the file name ,.

2) Go to the U-boot root directory/include/configs/, copy smdk6410.h and paste it to tiny6410.h.

3) Go To The MAKEFILE file in the U-boot root directory and specify the cross compiler to find cross_compile? = Add the arm-Linux-after the equal sign, and find the configuration information of the smdk6400.

######################################## #################################
# Arm1176 Systems
######################################## #################################
Tiny6410_nousb_config \
Tiny6410_config: unconfig
# Note that the following should be Tab key and cannot be replaced by four spaces
@ Mkdir-p $ (OBJ) include $ (OBJ) Board/Samsung/tiny6410
@ Mkdir-p $ (OBJ) nand_spl/board/Samsung/tiny6410
@ Echo "# define config_nand_u_boot"> $ (OBJ) include/config. h
@ Echo "config_nand_u_boot = y"> $ (OBJ) include/config. mk
@ If [-z "$ (findstring tiny6410_nousb_config, $ @)"]; then \
Echo "ram_text = 0x57e00000" >$ (OBJ) Board/Samsung/tiny6410/config. tmp ;\
Else \
Echo "ram_text = 0xc7e00000" >$ (OBJ) Board/Samsung/tiny6410/config. tmp ;\
Fi
@ $ (Mkconfig) tiny6410 arm arm1176 tiny6410 Samsung cloud64xx
@ Echo "config_nand_u_boot = y"> $ (OBJ) include/config. mk

4) test and compile the new th6410 Development Board Project

The message listing ing for tiny6410 board... appears, indicating that the setting is successful. Continue

# Make arch = arm // After compilation, the u-boot.bin file will appear in the root directory, the first step of U-Boot porting is completed

Of course, compilation takes some time. Please wait, but don't be too happy. Some people may say this is too simple, in fact, the u-boot.bin compiled here for their own tiny6410 Development Board is no use, the above transplantation is just to build a tiny6410 Development Board U-boot framework, to make its function implementation, you can also modify the U-boot source code based on the specific resources of the tiny6410 Development Board, such as the crystal oscillator frequency.

Bytes ------------------------------------------------------------------------------------------------------------------

Author: PANG Hui

Source: http://www.cnblogs.com/pang123hui/

This article is based on the signature 2.5 mainland China license agreement. You are welcome to repost, interpret, or use it for commercial purposes. However, you must keep the signature Pang Hui (including the link) of this Article ).

  

  

  

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.