注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

liuyue18301的个人主页

追逐梦想 光辉岁月

 
 
 

日志

 
 

BOOT  

2009-10-29 17:02:02|  分类: uboot |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

MODE 选择:

外部AEMIF:

 BTSEL[1:0] = 01,EMIF BOOT for oneFLASH

内部ROM,用RBL 

– BTSEL[1:0] = 00 - ARM NAND Boot
– BTSEL[1:0] = 10 - ARM MMC/SD Boot
– BTSEL[1:0] = 11 - ARM UART Boot

启动过程:NAND BOOT失败,  则试MMC/SD Boot

          MMC/SD Boot失败,则再试MMC/SD Boot

          UART boot失败,  则再试UART boot
RBL用GIO61(接LED)指示BOOT状态:

          RESET后,GIO61拉低,LED OFF,

          NAND BOOT失败,MMC/SD Boot失败后,LED 4HZ闪,且重试MMC/SD Boot

          UART boot失败后,LED 2HZ闪,且重试UART boot

          BOOT成功后,在程式控制权给UBL之前,GIO61拉高,LED一直亮。

 用DM355 TIMER0 来产生LED频率

 ARM ROM Boot:

  1. NAND FLASH:(nand中存放的内容: UBL、uboot、LINUX的内核映像uimage、文件系统,下载到NAND,UBL,UBOOT用NAND_programmer,后两个可用UBOOT)

   

   -从NAND FLASH COPY UBL到ARM内部RAM(AIM),而后传递控制权给UBL。

   -支持NAND 最大PAGE到2K

   -错误侦测,加载UBL可重试24次

   -支持30KB UBL (32KB IRAM - ~2KB for RBL stack)

   -执行RBL时支持I-CACHE,及DMA

   -只支持8 BIT NAND FLASH

   -只支持4-bit ECC

过程:读取DEVICE ID,读取BLOCK ,PAGE 大小从RBL设备表,查找UBL描述从块的O PAGE

      若未找UBL,则查找下一块,可查找到24块,24块查完后,没有则转到MMC/SD

      若找到UBL,则记录此块号(1-24),到ARM内存(0x7ffc-0x8000)的最后32BITS

      当用户指定起始条件设置好后,COPY UBL到内部RAM(从0x0000: 0020)

                          NAND UBL Descriptor
Page 0 Address    32-Bits                                      Description
              0xA1AC EDxx                              Magic number (0xA1ACEDxx)
              Entry Point Address of UBL             Entry point address for the user boot-                                                       loader (absolute address)
              Number of pages in UBL                 Number of pages (size of user boot-                                                        loader in number of pages)
12               Starting Block # of UBL                Block number where user boot-                                                       loader is present
16               Starting Page # of UBL          Page number where user boot-loader is present

注:The first 32-bytes of AIM are the ARM’s system interrupt vector table (IVT) (8 vectors,
4-bytes each). The UBL copy starts after the 32-byte IVT.

    不同的NAND BOOT方式需设定不同的MAGIC IDs in the UBL descriptor

                     UBL Signatures and Special Modes
   Mode                        Value                                       Description
UBL_MAGIC_SAFE           0x A1AC ED00                                    Safe boot mode
UBL_MAGIC_DMA            0x A1AC ED11                                    DMA boot mode
UBL_MAGIC_IC             0x A1AC ED22                                    I Cache boot mode
UBL_MAGIC_FAST           0x A1AC ED33                                   Fast EMIF boot mode
UBL_MAGIC_DMA_IC         0x A1AC ED44                                  DMA + I Cache boot mode
UBL_MAGIC_DMA_IC_FAST    0x A1AC ED55                      DMA + I Cache + Fast EMIF boot mode

 

详细流程:

1.初始化STACK,用RAM1上面的2K空间(0x4000-0x7FFF),不要用最下面32BIT(0x7ffc-0x8000),它用来记录有效块号(1-24)

2.Disable all interrupts, IRQ and FIQ

3.读FASTBOOT bit in the BOOTCFG register in the System Module,判断是a normal boot还是 a fastboot,外部引脚DEEPSLEEPZ/GIO0在 normal boot模式下芯片RESET时拉高,fastboot下拉低

4.读device Id of NAND,从ROM取得NAND参数

5.初始化NAND按照NAND FLASH参数

6.查找UBL magic number(在CIS/IDI page (CIS/IDI is generally
block 0, page 0),只会从PAGE0 OF blocks 1 to 24查找,

    UBL Descriptor定义:

  1)入口地址(下载UBL之后的绝对入口点),需在0x0020 - 0x781C之间

  2) UBL在占用NAND页数,

     *需连续页

    *可横跨块

  3)UBL大小<=30KB(size of IRAM - ~2KB stack space)

  4) UBL开始块(和UBL Descriptor在同一块)

  5)UBL开始页(可以不和UBL Descriptor同页)

  6)COPY UBL到IRAM(同时ECC)

    从块1-24查找UBL Descriptor,直到找到为止,24块都没有,则转到MMC/SD  

  7)跳到UBL程式入口执行 

                                     NAND IDs Supported
Device ID    Number of pages   Bytes per page       Block shift value   No. of address cycles

                per Block   (including extra data)    (For address)
0xE3            16               512+16                  12                   3
0xE5            16               512+16                  12                   3
0xE6            16               512+16                  12                   3
0x39            16               512+16                  12                   3
0x6B            16               512+16                  12                   3
0x73            32               512+16                  13                   3
0x33            32               512+16                  13                   3
0x75            32               512+16                  13                   3
0x35            32               512+16                  13                   3
0x76            32               512+16                  13                   4
0x36            32               512+16                  13                   4
0x79            32               512+16                  13                   4
0x71            32               512+16                  13                   4
0x46            32               512+16                  13                   4
0x56            32               512+16                  13                   4
0x74            32               512+16                  13                   4
0xF1            32               2048+64                 22                   4
0xA1            64               2048+64                 22                   4
0xAA            64               2048+64                 22                   5
0xDA            64               2048+64                 22                   5
0xAC            64               2048+64                 22                   5
0xDC            64               2048+64                 22                   5
0xB1            64               2048+64                 22                   5
0xC1            64               2048+64                 22                   5
other(1)        64               2048+64                 22                   5

 

Fast Nand Boot

 DM355不支持Fast Nand Boot,但可用Deep Sleep mode代替

 

 

2. MMC/SD Mode

   -从MMC/SD COPY UBL到ARM内部RAM(AIM),而后传递控制权给用户软件

   -只支持MMC/SD NATIVE协议,不支持SPI

   - -错误侦测,加载UBL可重试24次

   -支持30KB UBL (32KB IRAM - ~2KB for RBL stack)

  3.UART mode

   -从UARTCOPY UBL到ARM内部RAM(AIM),而后传递控制权给用户软件

   -支持30KB UBL (32KB IRAM - ~2KB for RBL stack)

 

 

  评论这张
 
阅读(213)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018