Analysis of I. mx21 platform for Windows CE 5.0 eboot

Source: Internet
Author: User
For general eboot concepts, refer to "Process Analysis of Windows CE 5.0 Boot Loader. on the mx21 platform, the Windows CE 5.0 eboot code is used to describe the story behind the scenes from the power-on of the Board to the running of wince and the role of various sections of code. Reading this article against the source code will have better results.

 

The related code directory is as follows:

% Wince/platform/imx21ads/src/bootloader/eboot

% Wince/platform/common/src/ARM/Freescale/mx21/startup

% Wince/platform/imx21ads/src/kernel/oal

% Wince/public/common/oak/Drivers/ethdbg/blcommon. c

 

(1) % wince/platform/common/src/ARM/Freescale/mx21/startup. s

Function: Initialize the core module of the I. mx21 processor before the OEM board-level initialization.

The main functions and procedures are analyzed as follows:

1. startup () --- this part of the code is shared by the boot loader and OAL.

After the Board is powered on, the first step is to set the processor to the privileged mode, jump to the mmucachedisable (), make TLB and cache, write buffer invalid, and disable MMU and cache. Set the aipi register, jump to oalsetupsystemcontrol and oalsetupfrequencies, and initialize the system control mode and clock frequency. The next step of the program is to enable I cache and jump to oalisimageinram and oalsetupextmemories to initialize the external storage device. Next is a piece of code that sets the max register, configures the AITC interrupt controller, and shields and clears the interrupt. Next, the program jumps to oalsetupgpio and oalsetupkeypad, that is, initializing the system gpio and keyboard devices. Finally, the program jumps to oalstartup (), loads g_oaladdresstable address, and then jumps to kernelstart (). This completes code redirection and starts eboot from Ram.

The preceding kernelstart () function jumps to the oalisimageinram program section to determine whether the image is running in Ram. If not, code will be relocated in the next relocateeboot program segment. If it is already in Ram, jump to the ramstart program segment and set the address of the connection register LR, loading oemaddresstable, and page table, then jump to the mmusetup function, set MMU according to oemaddresstable, enable MMU, and enable cache. After MMU is set, the program jumps to bootloadermain () in blcommon. C. This eboot master function calls a series of OEM functions in Main. C to start the CE system on the board.

The file where the above mentioned function is located is as follows: oalsetupsystemcontrol, kernel, kernel, oalsetupgpio, and oalsetupkeypad functions are located in % wince/platform/imx21/imx21ads/src/kernel/oal/oal_startup; oalisimageinram and oalstartup are located at % wince/platform/imx21ads/src/kernel/oal/startup. s. Kernelstart is located in % wince/platform/imx21ads/src/bootloader/eboot/startup. S.

 

2. mmucachedisable () --- invalidate TLB, cache, and write buffer, and disable MMU and cache.

 

3. mmusetup () --- this function will be called by % eboot/startup. S. It sets MMU Based on oemaddresstable and enables MMU and cache.

 

(2) Main. c

Basic Process:

Initialize the debugging port --- initialize the basic device of the platform --- print the user menu --- initialize the network parameters --- download the kernel --- start the OS

 

Main functions and functions:

Oemreporterror () ---- used to light the LED and print an error message

 

Oemmultibinnotify () ---- It is used to prompt the user which bin to download when the system has multiple binfiles

 

Oemdebuginit () ------- call oeminitdebugserial () to initialize the serial port

 

Oemplatforminit () ----- initialize the device on the board

① Print the eboot version information through the debug serial port

② Call initethdevice () to initialize the Ethernet controller

③ Set the MAC address, initialize the oal and eboot sharing parameters, rtc

④ Call mainmenu () and interact with users through the serial port to set startup options and Parameters

 

Oempredownload () --- determine whether to download, call oalkitlcreatename () to set the device name, initialize the IP parameter, and call ebootinitethertransport () to initialize the TFTP Parameter

 

Oemreaddata () ----- internal data is transmitted through oemethgetframe ()

 

Oemlaunch () ----------- update the oal and eboot sharing Parameters Based on the settings in Pb, determine whether to burn NK to NAND Flash, and finally call eboot/startup. the launch () in S starts the wince kernel.

 

Another important function in Main. C is manimenu (). It provides the following menu options:

0) MAC Address Settings

1) static IP settings

2) Static mask settings

3) enable DHCP

4) restore to factory settings

5) Save the current eboot settings

D) download

E) Erase nor flash

L) Start from nor flash

R) Start from Ram

 

In general, on the I. mx21 platform, WinCE eboot continuously redirects between the following files:

% Startup/startup. s --- oal_startup.c --- % oal/startup. s --- % eboot/startup. s --- blcommon. c --- main. c

PS: if you are interested in the assembly code initialized by the system in the initial phase of I. mx21 power-on, you can refer to "startup. s code analysis on the I. mx21 platform ".

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.