uboot transplantation on 2440

Publisher:SerendipityLoveLatest update time:2016-09-05 Source: eefocusKeywords:uboot Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
       Bootloard code is a section of code executed after the chip is reset and before entering the operating system. It is mainly used to complete the transition from hardware startup to operating system startup, thereby providing a basic operating environment for the operating system, such as initializing the CPU, stack, storage system, etc. Since the Bootloard code is related to the core structure of the CPU chip, the specific model, the configuration of the application system, and the operating system used, its function is similar to the BIOS of a PC. Therefore, it is impossible to have a universal Bootloard, and it should be transplanted according to the specific configuration during development.

       Why do we need U-BOOT? Obviously, the operating system can be burned directly into the flash for execution, but it is indispensable for software upgrades and program patches.

U-BOOT directory structure analysis:

1. board: development board related directory
2. common: common command functions

3. cpu: directories related to specific CPU architectures, such as arm920t
4. doc: uboot development and usage documentation

5. drivers: device drivers supported by uboot, such as serial port, nandflash, network card
6. fs: supported file systems, Uboot now supports cramfs, fat, fdos, jffs2 and registerfs.

7. include: header files and development board configuration files. The configuration files of the development board are in the configs directory
. 8. lib_xxxx: library files related to the architecture. For example, libraries related to ARM are placed in lib_arm.

9. lib_generic: Generic library functions

10. net: various network protocols, TFTP protocol, NFS protocol, etc.

11. tools: uboot built-in tools

U-BOOT startup is divided into two stages

Phase 1: 1) Set the CPU working mode

2) Turn off the watchdog

3) Set the system clock

4) Turn off MMU and CACHE

5) Prepare RAM space for the second stage (borad/smdk2410/lowlevel_init.s)

6) Set up the stack

7) Jump to the second stage C entry point (lib_arm/board.c)

The second stage: 1) start_armboot function
 init_sequence:
    initialize CPU, set system clock, initialize timer, initialize environment parameters, initialize serial console, detect memory mapping
2) flash_init: initialize NORFLASH
3) env_relocate: initialize environment variables
4) initialize system peripherals
5) finally call main_loop (command/main.c) (download mode and boot mode are here)        

U-BOOT does not have a graphical configuration interface, we can only configure it by manually modifying the file

1) A cross compiler is required for the porting process (I use arm_linux_gcc_3.3.2)       

2) Specify the environment variable vi /etc/profile, specify the path, comment out the unused ones, then save and exit

3) Source /etc/profile to make it effective, then you can check the version arm-linux-gcc -v to see if it is the current version

4) vi cpu/arm920t/config.mk Comment out the soft floating point because we use hard floating point compilation PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -ffixed-r8 \
 # -msoft-float /*Comment out*/

5) Modification

在smdk2410_config :       unconfig
        @$(MKCONFIG) $(@:_config=) arm arm920t smdk2410 NULL s3c24x0

Plus

TX2440_config :    unconfig
        @$(MKCONFIG) $(@:_config=) arm arm920t TX2440 NULL s3c24x0

The meanings of each item are as follows:
  arm: CPU architecture (ARCH)
 arm920t: CPU type (CPU), which corresponds to the cpu/arm920t subdirectory.
 TX2440: Development board model (BOARD), which corresponds to the board/TX2440 directory.
 NULL: Developer/or distributor (vender).
 s3c24x0: System on chip (SOC).

At line 128:

ifeq ($(ARCH),arm)

CROSS_COMPILE = arm-linux- specifies the cross compiler, ( http://xgc94418297.blog.163.com/blog/static/112966040200952971543686/ )

6) Change smdk2410 to TX2440 (you can change it as you like, as long as it is consistent) mv smdk2410 TX2440

7) Delete other directories under board and keep only TX2440. Method: mv TX2440 ../ to move to the upper level

                                                                           rm -rf * //Delete all directories at the same level

                                                                           mv ../TX2440 ./ //Move the TX2440 on the upper layer to this layer

8) Here you can test whether the compilation is successful 

make TX2440_config

The message "Configuring for TX2440 board...." appears, indicating that the compilation is successful.   

9) Configure SDRAM (modify BANK and refresh frequency in lowlevel_Init.s)

10) Modify the clock code in TX2440.C. 

Available in include/configs/TX2440.h

#define CFG_PROMPT and then modify the command prompt you like.

Keywords:uboot Reference address:uboot transplantation on 2440

Previous article:Using STM32 to complete the design of intelligent motor protector
Next article:Detailed explanation of uboot transplantation

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号