2440從NANDFlash啟動(dòng)之bootloader運(yùn)行以前
掃描二維碼
隨時(shí)隨地手機(jī)看文章
一直對(duì)2440上電以后怎么從nandflash中啟動(dòng)不是很清楚,閑來(lái)無(wú)事看了下s3c2440的用戶手冊(cè),看到下面這樣一段話:
S3C2440A boot code can be executed on an external NAND flash memory. In order to support NAND flash bootloader, the S3C2440A is equipped with an internal SRAM buffer called "Steppingstone". When booting, the first 4KBytes of the NAND flash memory will be loaded into Steppingstone and the boot code loaded into Steppingstone will be executed.
Generally, the boot code will copy NAND flash content to SDRAM. Using hardware ECC generating, the NAND flash data validity will be checked. Upon the completion of the copy, the main program will be executed on the SDRAM.
雖然大家都看得懂上面的eng,但是為了自己以后看得方便一些,在此稍微解釋一下:
2440的啟動(dòng)代碼可以從外部的nandflash上執(zhí)行。為了能支持nboot,2440需要帶有一個(gè)叫做steppingstone的內(nèi)部sram緩 沖區(qū)。在啟動(dòng)加載的時(shí)候,nandflash的前4k的內(nèi)容(nboot部分)要被先load到steppingstone中去(此時(shí) steppingstone被映射為物理地址的0x0,復(fù)位后執(zhí)行的第一條指令就是從這里取的),并且接著就是在steppingstone中去執(zhí)行該啟 動(dòng)代碼。這部分代碼(nboot)的作用是會(huì)將nandflash中的bootloader step2部分拷貝到sdram中去,并跳到sdram中去執(zhí)行以加載內(nèi)核(nk)。
nboot從nandflash被load到 steppingstone中的過(guò)程為:在上點(diǎn)的時(shí)候,nandflash控制器通過(guò)幾個(gè)引腳的狀態(tài)(NCON-Adv flash;GPG13-Page size;GPG14-Address cycle;GPG15-Bus width)來(lái)得到nandflash的相關(guān)信息,之后nandflash控制器就會(huì)自動(dòng)load nandflash中前4k的啟動(dòng)代碼到steppingstone中去,并在其中執(zhí)行了。