在SAMSUNG公司提供的S3C2440A的BSP中有一個Stepldr引導程序。現在我把它移植到S3C2410A上了,已經移植成功。需要修改的地方就是NAND FLASH驅動部分,因為S3C2410A的NAND FLASH寄存器和S3C2440A的NAND FLASH寄存器是有點不一樣滴。相比較而言:S3C2440A的NAND FLASH的寄存器豐富一些。而S3C2410A的就比較少。不說廢話了。說正文,先分析一下Stepldr.bib文件吧:
;
; Copyright (c) Microsoft Corporation. All rights reserved.
;
;
; Use of this source code is subject to the terms of the Microsoft end-user
; license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
; If you did not accept the terms of the EULA, you are not authorized to use
; this source code. For a copy of the EULA, please see the LICENSE.RTF on your
; install media.
;
; NOTE: The Steppingstone loader can only be 4096 bytes in length max. Romimage
; will need to create and page-align the .pdata section and the linker generates
; a 1-page header on the file. In this .bib file we'll call the size 0x3000,
; but we'll post-process the .nb0 file to remove the .pdata section and the header.
;
; NOTE: The Steppingstone loader and the IPL are concatenated and stored in the
; first two SmartMedia NAND flash blocks. If the size of either loader is
; altered in the .bib file, the bootloader code will need to be updated as
; it makes an assumption about the first two NAND flash blocks being reserved.
;
MEMORY
; Name Start Size Type
; ------- -------- -------- ----
STEPLDR 00000000 00003000 RAMIMAGE
STACK 33ff5800 00001000 RESERVED
RAM 33ff0000 00001000 RAM
CONFIG
COMPRESSION=ON
PROFILE=OFF
KERNELFIXUPS=ON
ROMSTART=00000000
ROMWIDTH=32
ROMSIZE=00001000
MODULES
; Name Path Memory Type
; ---------- -------------------------------------------------------------- -----------
nk.exe $(_TARGETPLATROOT)/target/$(_TGTCPU)/$(WINCEDEBUG)/stepldr.exe STEPLDR
紅色部分請注意:由於S3C2410A的芯片的特性,在NAND FLASH作為啟動模式時,芯片會自動把NAND FLASH的最開始的4K程序映射到內部的4K SRAM中。同時又由於PB5.0這個軟件不能編譯小於4K的程序[好像是小於4K時,會有點小問題],解決辦法就是將ROMSIZE設置為4K。STEPLDR的RAMIMAGE設置為12K。這樣的話,就會產生stepldr.nb0,stepldr.nb1,stepldr.nb2共三個文件。我們只需要燒錄stepldr.nb1就可以了。用什麼燒錄呢。當然是SJF2410A這個JTAG燒錄工具啦。嘿嘿。相信大家都會有這個工具吧。沒有還學什麼ARM呢。。
堆棧的起始地位為:0x33FF5800 大小為:1K的保留區域,不能作為其它用途。
下一篇將詳細分析Stepldr如何移植到S3C2410A中,主要是分析匯編代碼部分。見 http://www.linuxidc.com/Linux/2012-02/54651p2.htm