基于S3C2410A的WINCE下Stepldr程序移植详细分析


在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中,主要是分析汇编代码部分。见

  • 1
  • 2
  • 3
  • 下一页

相关内容