欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
中國linux公社 - 基于atmel at91rm9200的armlinux的bootloader啟動(dòng)代碼分析
基于A(yíng)tmel at91rm9200的armlinux的bootloader啟動(dòng)代碼分析
  貼出者為 balancesli
balancesli寫(xiě)著(zhù) ‘ 前階段做了一次基于at91rm9200引導部分的技術(shù)分析,主要采用了u-boot,這里只面向使用at91rm9200板子的的朋友做個(gè)簡(jiǎn)單的推敲,希望起到拋磚引玉的作用

Author : balancesli
mail : balancesli@thizlinux.com.cn

前階段做了一次基于at91rm9200引導部分的技術(shù)分析,主要采用了u-boot,這里只面向使用at91rm9200板子的
的朋友做個(gè)簡(jiǎn)單的推敲,希望起到拋磚引玉的作用.

關(guān)鍵詞 :
u-boot: 一個(gè)開(kāi)源的面向多個(gè)目標平臺(ppc, mips, arm, x86)的bootloader.
at91rm9200 : Atmel 公司生產(chǎn)的基于arm9核的Soc處理器.

以下先給出at91rm9200引導流程圖

Boot program Flow Diagram

Device Setup
|
|
Boot SPI DataFlash Boot --> Download from DataFlash --> run
|
|
TWI EEPROM Boot --> Download from EEPROM --> run
|
|
Parallel Boot --> Download from 8-bit Device -->
|
| Xmodem protocol
| |---DBGU Serial Download ---------------------> run
|____|
| DFU protocol
|-----USB download -----------------------> run

在這里我主要介紹通過(guò)片內引導和片外引導, 片內引導主要采用串口下載并引導u-boot,并完成程序被燒寫(xiě)到Flash上,
然后就可以通過(guò)跳線(xiàn)的方式從片外引導執行已經(jīng)燒寫(xiě)到片外Flash上的引導程序(bootloader).

這里要提及的是at91rm9200內部本身有128k的片內rom,其固化了一個(gè)bootloader和uploader, 用來(lái)支持程序的
下載和引導,而且其內部固化的程序提供了很多內部服務(wù)接口(Internel Service)供我們來(lái)使用,例如Xmodem,Tempo
DataFlash, CRC, Sine服務(wù)接口,這樣我們就可以利用它所提供的Service interface API完成程序的下載。
這里主要介紹Xmodem接口服務(wù)。

at91rm9200內部固化的代碼在設計上采用了面向對象的設計方法,如下:


typedef struct _AT91S_Service
{
char data;
char (*MainMethod)();
char (*ChildMethod)();
}AT91S_Service, *AT91PS_Service;

char AT91F_MainMethod()
{

}
char AT91F_ChildMethod()
{

}

/*init the Service */
AT91PS_Service AT91F_OpenDevice(AT91PS_Service pService)
{
pService->data = 0;
pService->MainMethod = AT91F_MainMethod;
pService->ChildMethod = AT91F_ChildMethod;
}

//使用方法如下
AT91S_Service service;
AT91PS_Service pService = AT91F_OpenDevice(&service);
pService->AT91F_MainMethmod();
.....

通過(guò)如上代碼片斷可以看出它采用了類(lèi)似面向對象的設計方法。
其實(shí)如果各位朋友接觸過(guò)的話(huà)或者看過(guò)這本書(shū)的話(huà),應該很容易便接受它。
下面以Xmodem服務(wù)為例子介紹:


at91rm9200內部提供的服務(wù)包含了幾個(gè)服務(wù)對象, 這些對象在片內啟動(dòng)xmodem協(xié)議Host端和Targe端通訊時(shí)會(huì )用到.


typedef struct _AT91S_RomBoot
{
const unsigned int version;
// Peripheral descriptors
const AT91S_MEMCDesc MEMC_DESC;
const AT91S_STDesc SYSTIMER_DESC;
const AT91S_Pio2Desc PIOA_DESC;
const AT91S_Pio2Desc PIOB_DESC;
const AT91S_USART2Desc DBGU_DESC;
const AT91S_USART2Desc USART0_DESC;
const AT91S_USART2Desc USART1_DESC;
const AT91S_USART2Desc USART2_DESC;
const AT91S_USART2Desc USART3_DESC;
const AT91S_TWIDesc TWI_DESC;
const AT91S_SPIDesc SPI_DESC;

// Objects entry
const AT91PF_OpenPipe OpenPipe;
const AT91PF_OpenSBuffer OpenSBuffer;
const AT91PF_OpenSvcUdp OpenSvcUdp;
const AT91PF_OpenSvcXmodem OpenSvcXmodem;
const AT91PF_OpenCtlTempo OpenCtlTempo;
const AT91PF_OpenDfuDesc OpenDfuDesc;
const AT91PF_OpenUsbDesc OpenUsbDesc;
const AT91PF_OpenSvcDataFlash OpenSvcDataFlash;
const AT91PF_SVC_CRC16 CRC16;
const AT91PF_SVC_CRCCCITT CRCCCITT;
const AT91PF_SVC_CRCHDLC CRCHDLC;
const AT91PF_SVC_CRC32 CRC32;
// Array
const AT91PS_SVC_CRC_BIT_REV Bit_Reverse_Array;
const AT91PS_SINE_TAB SineTab;
const AT91PF_Sinus Sine;
} AT91S_RomBoot;

//AT91S_Pipe
typedef struct _AT91S_Pipe
{
// A pipe is linked with a peripheral and a buffer
AT91PS_SvcComm pSvcComm;
AT91PS_Buffer pBuffer;

// Callback functions with their arguments
void (*WriteCallback) (AT91S_PipeStatus, void *);
void (*ReadCallback) (AT91S_PipeStatus, void *);
void *pPrivateReadData;
void *pPrivateWriteData;

// Pipe methods
AT91S_PipeStatus (*Write) (
struct _AT91S_Pipe *pPipe,
char const * pData,
unsigned int size,
void (*callback) (AT91S_PipeStatus, void *),
void *privateData
);

AT91S_PipeStatus (*Read) (
struct _AT91S_Pipe *pPipe,
char *pData,
unsigned int size,
void (*callback) (AT91S_PipeStatus, void *),
void *privateData
);

AT91S_PipeStatus (*AbortWrite)(struct _AT91S_Pipe *pPipe);
AT91S_PipeStatus (*AbortRead)(struct _AT91S_Pipe *pPipe);
AT91S_PipeStatus (*AbortRead)(struct _AT91S_Pipe *pPipe);
AT91S_PipeStatus (*Reset)(struct _AT91S_Pipe *pPipe);
char (*IsWritten)(struct _AT91S_Pipe *pPipe, char const *pVoid);
char (*IsReceived) (struct _AT91S_Pipe *pPipe, char const *pVoid);
} AT91S_Pipe;

//AT91S_Buff
typedef struct _AT91S_SBuffer
{
AT91S_Buffer parent;
char *pRdBuffer;
char const *pWrBuffer;
unsigned int szRdBuffer;
unsigned int szWrBuffer;
unsigned int stRdBuffer;
unsigned int stWrBuffer;
} AT91S_SBuffer;

// AT91S_SvcTempo
typedef struct _AT91S_SvcTempo
{

// Methods:
AT91S_TempoStatus (*Start) (
struct _AT91S_SvcTempo *pSvc,
unsigned int timeout,
unsigned int reload,
void (*callback) (AT91S_TempoStatus, void *),
void *pData);
AT91S_TempoStatus (*Stop) (struct _AT91S_SvcTempo *pSvc);

struct _AT91S_SvcTempo *pPreviousTempo;
struct _AT91S_SvcTempo *pNextTempo;

// Data
unsigned int TickTempo; //* timeout value
unsigned int ReloadTempo;//* Reload value for periodic execution
void (*TempoCallback)(AT91S_TempoStatus, void *);
void *pPrivateData;
AT91E_SvcTempo flag;
} AT91S_SvcTempo;

// AT91S_CtrlTempo
typedef struct _AT91S_CtlTempo
{
// Members:

// Start and stop for Timer hardware
AT91S_TempoStatus (*CtlTempoStart) (void *pTimer);
AT91S_TempoStatus (*CtlTempoStop) (void *pTimer);

// Start and stop for Tempo service
AT91S_TempoStatus (*SvcTempoStart) (
struct _AT91S_SvcTempo *pSvc,
unsigned int timeout,
unsigned int reload,
void (*callback) (AT91S_TempoStatus, void *),
void *pData);
AT91S_TempoStatus (*SvcTempoStop) (struct _AT91S_SvcTempo *pSvc);
AT91S_TempoStatus (*CtlTempoSetTime)(struct _AT91S_CtlTempo *pCtrl, unsigned int NewTime);
AT91S_TempoStatus (*CtlTempoGetTime)(struct _AT91S_CtlTempo *pCtrl);
AT91S_TempoStatus (*CtlTempoIsStart)(struct _AT91S_CtlTempo *pCtrl);
AT91S_TempoStatus (*CtlTempoCreate) (struct _AT91S_CtlTempo *pCtrl,struct _AT91S_SvcTempo *pTempo);
AT91S_TempoStatus (*CtlTempoRemove) (struct _AT91S_CtlTempo *pCtrl,struct _AT91S_SvcTempo *pTempo);
AT91S_TempoStatus (*CtlTempoTick) (struct _AT91S_CtlTempo *pCtrl);

// Data:

void *pPrivateData; // Pointer to devived class
void const *pTimer; // hardware
AT91PS_SvcTempo pFirstTempo;
AT91PS_SvcTempo pNewTempo;
} AT91S_CtlTempo;



//以下代碼是上面幾個(gè)對象的使用范例,通過(guò)這樣就可以完成Host端和Targe端之間的xmodem通訊,并可以下載代碼了。

AT91S_RomBoot const *pAT91;
AT91S_SBuffer sXmBuffer;
AT91S_SvcXmodem svcXmodem;
AT91S_Pipe xmodemPipe;
AT91S_CtlTempo ctlTempo;

AT91PS_Buffer pXmBuffer;
AT91PS_SvcComm pSvcXmodem;
unsigned int SizeDownloaded;

/* Init of ROM services structure */
pAT91 = AT91C_ROM_BOOT_ADDRESS;//這里取得內部ROM服務(wù)的入口地址

/* Tempo Initialization */
pAT91->OpenCtlTempo(&ctlTempo, (void *) &(pAT91->SYSTIMER_DESC));
ctlTempo.CtlTempoStart((void *) &(pAT91->SYSTIMER_DESC));

/* Xmodem Initialization */
pXmBuffer = pAT91->OpenSBuffer(&sXmBuffer);
pSvcXmodem = pAT91->OpenSvcXmodem(&svcXmodem, (AT91PS_USART)AT91C_BASE_DBGU, &ctlTempo);
pAT91->OpenPipe(&xmodemPipe, pSvcXmodem, pXmBuffer);
xmodemPipe.Read(&xmodemPipe, (char *)AT91C_UBOOT_BASE_ADDRESS, AT91C_UBOOT_MAXSIZE,
AT91F_XmodemProtocol, 0);
while(XmodemComplete !=1);



//上面部分主要針對at91rm9200片內啟動(dòng)時(shí)我們可以使用的片內接口服務(wù)介紹,玩H9200的朋友可以參考一下便知道緣由。

下面主要介紹at91rm9200片外啟動(dòng)時(shí)所使用的bootloader-->u-boot.

一. bootloader
BootLoader(引導裝載程序)是嵌入式系統軟件開(kāi)發(fā)的非常重要的環(huán)節,它把操作系統和硬件平臺銜接在一起,
是跟硬件體系密切相關(guān)的。



1.1 典型的嵌入式系統軟件部分Image memory layout : bootloader , bootloader param, kernel, rootfs.

1.2 引導模式 : 1. bootstrap或download
2. autoboot
1.3 u-boot簡(jiǎn)介 :
u-boot是由Wolfgang Denk開(kāi)發(fā),它支持(mips, ppc, arm, x86)等目標體系,
可以在http://sourceforge.net 上下載獲得源碼,

1.4 u-boot源代碼目錄結構

board:開(kāi)發(fā)板相關(guān)的源碼,不同的板子對應一個(gè)子目錄,內部放著(zhù)主板相關(guān)代碼。

at91rm9200dk/at91rm9200.c, config.mk, Makefile, flash.c ,u-boot.lds等都和具體開(kāi)發(fā)板的硬件和地址分配有關(guān)。

common:與體系結構無(wú)關(guān)的代碼文件,實(shí)現了u-boot所有命令,
其中內置了一個(gè)shell腳本解釋器(hush.c, a prototype Bourne shell grammar parser), busybox中也使用了它.


cpu:與cpu相關(guān)代碼文件,其中的所有子目錄都是以u-boot所支持的cpu命名.

at91rm9200/at45.c, at91rm9200_ether.c, cpu.c, interrupts.c serial.c, start.S, config.mk, Makefile等.
其中cpu.c負責初始化CPU、設置指令Cache和數據Cache等;

interrupt.c負責設置系統的各種中斷和異常,比如快速中斷、開(kāi)關(guān)中斷、時(shí)鐘中斷、軟件中斷、
預取中止和未定義指令等;

start.S負責u-boot啟動(dòng)時(shí)執行的第一個(gè)文件,它主要是設置系統堆棧和工作方式,為跳轉到C程序入口點(diǎn).

disk:設備分區處理代碼。

doc:u-boot相關(guān)文檔。


drivers:u-boot所支持的設備驅動(dòng)代碼, 網(wǎng)卡、支持CFI的Flash、串口和USB總線(xiàn)等。

fs: u-boot所支持支持文件系統訪(fǎng)問(wèn)存取代碼, 如jffs2.

include:u-boot head文件,主要是與各種硬件平臺相關(guān)的頭文件,
如include/asm-arm/arch-at91rm9200/, include/asm-arm/proc-armv

net:與網(wǎng)絡(luò )有關(guān)的代碼,BOOTP協(xié)議、TFTP協(xié)議、RARP協(xié)議代碼實(shí)現.

lib_arm:與arm體系相關(guān)的代碼。(這里我們主要面向的是ARM體系,所以該目錄是我們主要研究對象)

tools:編譯后會(huì )生成mkimage工具,用來(lái)對生成的raw bin文件加入u-boot特定的image_header.


1.5 u-boot的功能介紹


 u-boot支持SCC/FEC以太網(wǎng)、OOTP/TFTP引導、IP和MAC的功能.

讀寫(xiě)Flash、DOC、IDE、IIC、EEROM、RTC

支持串行口kermit和S-record下載代碼, 并直接從串口下載并執行。

在我們生成的內核鏡像時(shí),要做如下處理.
1. arm-linux-objcopy -O binary -R.note -R.comment -S vmlinux linux.bin
2. gzip -9 linux.bin
3. mkimage -A arm -O linux -T kernel -C gzip -a 0xc0008000 -e 0xc0008000 -n
"Linux-2.4.19-rmk7” -d linux.bin.gz uImage

即在Linux內核鏡像vmLinux前添加了一個(gè)特殊的頭,這個(gè)頭在include/image.h中定義,
typedef struct image_header
{
uint32_t ih_magic; /* Image Header Magic Number */
uint32_t ih_hcrc; /* Image Header CRC Checksum */
uint32_t ih_time; /* Image Creation Timestamp */
uint32_t ih_size; /* Image Data Size */
uint32_t ih_load; /* Data Load Address */
uint32_t ih_ep; /* Entry Point Address */
uint32_t ih_dcrc; /* Image Data CRC Checksum */
uint8_t ih_os; /* Operating System */
uint8_t ih_arch; /* CPU architecture */
uint8_t ih_type; /* Image Type */
uint8_t ih_comp; /* Compression Type */
uint8_t ih_name[IH_NMLEN]; /* Image Name */
} image_header_t;

當u-boot引導時(shí)會(huì )對這個(gè)文件頭進(jìn)行CRC校驗,如果正確,才會(huì )跳到內核執行.

如果u-boot啟動(dòng)以后會(huì )出現
u-boot>
敲入help, 會(huì )出現大量的命令提示,Monitor command
go - start application at address ‘a(chǎn)ddr‘
run - run commands in an environment variable
bootm - boot application image from memory
bootp - boot image via network using BootP/TFTP protocol
tftpboot- boot image via network using TFTP protocol
and env variables "ipaddr" and "serverip"
(and eventually "gatewayip")
rarpboot- boot image via network using RARP/TFTP protocol
diskboot- boot from IDE devicebootd - boot default, i.e., run ‘bootcmd‘
loads - load S-Record file over serial line
loadb - load binary file over serial line (kermit mode)
md - memory display
mm - memory modify (auto-incrementing)
nm - memory modify (constant address)
mw - memory write (fill)
cp - memory copy
cmp - memory compare
crc32 - checksum calculation
imd - i2c memory display
imm - i2c memory modify (auto-incrementing)
inm - i2c memory modify (constant address)
imw - i2c memory write (fill)
icrc32 - i2c checksum calculation
iprobe - probe to discover valid I2C chip addresses
iloop - infinite loop on address range
isdram - print SDRAM configuration information
sspi - SPI utility commands
base - print or set address offset
printenv- print environment variables
setenv - set environment variables
saveenv - save environment variables to persistent storage
protect - enable or disable FLASH write protection
erase - erase FLASH memory
flinfo - print FLASH memory information
bdinfo - print Board Info structure
iminfo - print header information for application image
coninfo - print console devices and informations
ide - IDE sub-system
loop - infinite loop on address range
mtest - simple RAM test
icache - enable or disable instruction cache
dcache - enable or disable data cache
reset - Perform RESET of the CPU
echo - echo args to console
version - print monitor version
help - print online help
- alias for ‘help‘

u-boot支持大量的命令可用, 這里就不作介紹,大家有興趣可以看看u-boot 的README文檔
3.3 對u-boot-1.0.0的修改和移植

1.6 關(guān)于u-boot的移植如下,由于u-boot的軟件設計體系非常清晰,它的移植工作并不復雜,
相信各位的代碼閱讀功力不錯的話(huà),參照如下就可以完成。

If the system board that you have is not listed, then you will need
to port U-Boot to your hardware platform. To do this, follow these
steps:

1. Add a new configuration option for your board to the toplevel
"Makefile" and to the "MAKEALL" script, using the existing
entries as examples. Note that here and at many other places
boards and other names are listed in alphabetical sort order. Please
keep this order.

2. Create a new directory to hold your board specific code. Add any
files you need. In your board directory, you will need at least
the "Makefile", a ".c", "flash.c" and "u-boot.lds".

3. Create a new configuration file "include/configs/.h" for
your board

4. If you‘re porting U-Boot to a new CPU, then also create a new
directory to hold your CPU specific code. Add any files you need.

5. Run "make _config" with your new name.

6. Type "make", and you should get a working "u-boot.srec" file

7. Debug and solve any problems that might arise.
[Of course, this last step is much harder than it sounds.]

為了使u-boot-1.0.0支持新的開(kāi)發(fā)板,一種簡(jiǎn)便的做法是在u-boot已經(jīng)支持的開(kāi)發(fā)板中參考選擇一種較接近板的進(jìn)行修改,
幸運的是在u-boot-1.0.0中已經(jīng)有了at91rm9200的支持。

1.7 與at91rm9200相關(guān)的u-boot代碼

在include/configs/at91rm9200dk.h 它包括開(kāi)發(fā)板的CPU、系統時(shí)鐘、RAM、Flash系統及其它相關(guān)的配置信息。
在include/asm-arm/AT91RM9200.h, 該文件描述了H9200寄存器的結構及若干宏定義。
具體內容要參考相關(guān)處理器手冊。
在cpu/at91rm9200/目錄下別為cpu.c、interrupts.c和serial.c等文件.
在board/at91rm9200dk/目錄下分別為flash.c、at91rm9200dk.c, config.mk, Makefile,u-boot.lds

flash.c : u-boot讀、寫(xiě)和刪除Flash設備的源代碼文件。由于不同開(kāi)發(fā)板中Flash存儲器的種類(lèi)各不相同,
所以,修改flash.c時(shí)需參考相應的Flash芯片手冊。它包括如下幾個(gè)函數:
unsigned long flash_init (void ),Flash初始化;
void flash_print_info (flash_info_t *info),打印Flash信息;
int flash_erase (flash_info_t *info, int s_first, int s_last),Flash擦除;
volatile static int write_dword (flash_info_t *info, ulong dest, ulong data),Flash寫(xiě)入;
int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt),從內存復制數據。

u-boot.lds :linker scripte, 設置u-boot中各個(gè)目標文件的連接地址.

網(wǎng)口設備控制程序

  在drivers/目錄中網(wǎng)口設備控制程序cs8900, bcm570x等, 還可以添加其他網(wǎng)卡驅動(dòng)
int eth_init (bd_t *bd) : 初始化網(wǎng)絡(luò )設備;
void eth_halt (void) : 關(guān)閉網(wǎng)絡(luò )設備;
int eth_send (volatile void *packet,int len) : 發(fā)送數據包;
int eth_rx (void) : 接收數據包。


Makefile

  在u-boot-1.0.0/Makefile中
at91rm9200dk_config : unconfig
./mkconfig $(@:_config=) arm at91rm9200 at91rm9200dk

1.8 編譯u-boot

  make at91rm9200_config
Configuring for at91rm9200 board...
make all
生成三個(gè)文件:u-boot.bin, u-boot, u-boot.srec

u-boot.bin is a raw binary image
u-boot is an image in ELF binary format
u-boot.srec is in Motorola S-Record format (objcopy -O srec -R.note -R.comment -S [inputfile] [outfile]


以上工作完成我們可以通過(guò)串口將u-boot.bin下載到主板的SDRAM中,它會(huì )自動(dòng)執行, 并出現uboot>
這里我們可以通過(guò)串口把boot.bin, u-boot.bin.gz下載到主板,再用u-boot的提供的寫(xiě)flash功能分別
把boot.bin, u-boot.bin.gz寫(xiě)入到flash中,完成以上工作后,對主板跳線(xiàn)選擇片外啟動(dòng),
板子復位后會(huì )自動(dòng)啟動(dòng)u-boot.




二.loader.bin, boot.bin, u-boot.bin代碼執行流分析.

以上三個(gè)文件時(shí)at91rm9200啟動(dòng)所需要的三個(gè)bin,他們的實(shí)現代碼并不難。
如果是你是采用at91rm9200的評估版,應該能得到其源碼。

2.1 loader.bin 執行流程,這個(gè)文件主要在片內啟動(dòng)從串口下載代碼時(shí)會(huì )用到
loader/entry.S init cpu
b main ---> crt0.S
--> copydata --> clearbss --> b boot
main.c --> boot -->
/*Get internel rom service address*/
/* Init of ROM services structure */
pAT91 = AT91C_ROM_BOOT_ADDRESS;

/* Xmodem Initialization */
--> pAT91->OpenSBuffer
--> pAT91->OpenSvcXmodem
/* System Timer initialization */
---> AT91F_AIC_ConfigureIt
/* Enable ST interrupt */
AT91F_AIC_EnableIt
AT91F_DBGU_Printk("XMODEM: Download U-BOOT ");

Jump.S
// Jump to Uboot BaseAddr exec
Jump((unsigned int)AT91C_UBOOT_BASE_ADDRESS)



2.2 boot.bin執行流程 該文件會(huì )在從片內啟動(dòng)時(shí)被下載到板子上,以后還會(huì )被燒寫(xiě)到片外Flash中,以便在片外啟動(dòng)時(shí)
用它來(lái)引導并解壓u-boot.gz,并跳轉到u-boot來(lái)執行。
boot/entry.S
b main --> crt0.S --> copydata --> clearbss --> b boot

T91F_DBGU_Printk(" ");
AT91F_DBGU_Printk("************************************** ");
AT91F_DBGU_Printk("** Welcome to at91rm9200 ** ");
AT91F_DBGU_Printk("************************************** ");

boot/misc.s /* unzip uboot.bin.gz */
----> decompress_image(SRC,DST,LEN) --> gunzip

//jump to ubootBaseAddr exec 這里跳轉到解壓u-boot.gz的地址處直接開(kāi)始執行u-boot
asm("mov pc,%0" : : "r" (DST));

2.3 uboot.bin執行流程
u-boot/cpu/at91rm9200/start.S
start --->reset
---> copyex ---> cpu_init_crit
---> /* set up the stack */ --> start_armboot
u-boot/lib_arm/board.c

init_fnc_t *init_sequence[] = {
cpu_init, /* basic cpu dependent setup */
board_init, /* basic board dependent setup */
interrupt_init, /* set up exceptions */
env_init, /* initialize environment */
init_baudrate, /* initialze baudrate settings */
serial_init, /* serial communications setup */
console_init_f, /* stage 1 init of console */
display_banner, /* say that we are here */
dram_init, /* configure available RAM banks */
display_dram_config,
checkboard,
NULL,
};

---> start_armboot ---> call init_sequence
---> flash_init --> display_flash_config
---> nand_init ---> AT91F_DataflashInit
---> dataflash_print_info --> env_relocate
---> drv_vfd_init --> devices_init --> jumptable_init
---> console_init_r --> misc_init_r --> enable_interrupts
---> cs8900_get_enetaddr --> board_post_init -->

u-boot/common/main.c
for (;;)
{ /* shell parser */
main_loop () --> u_boot_hush_start --> readline
--> abortboot
-->printf("Hit any key to stop autoboot: %2d ", bootdelay);
}


以上是at91rm9200啟動(dòng)并進(jìn)入u-boot的執行流分析。后面u-boot還會(huì )將uImage解壓到特定的位置并開(kāi)始執行內核代碼。


三. 綜述
總之, 不同廠(chǎng)商的出的Soc片子在啟動(dòng)方式大都提供片內和片外啟動(dòng)兩種方式,一般都是在片內固化一段小程序
方便于程序開(kāi)發(fā)而已,在其DataSheet文檔中有詳盡的描述。若是對at92rm9200有興趣或玩過(guò)的朋友,可以與我共同探討相互學(xué)習?!?
本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
淺析setup_arch()函數tag_list的uboot[u-boot]由來(lái)
Linux內核訪(fǎng)問(wèn)外設I/O資源的方式(z)
嵌入式linux驅動(dòng)之中斷架構
【轉】ARM Linux靜態(tài)映射分析
Linux中斷處理體系結構分析
linux中斷處理之IRQ中斷
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久