1. 概述
本文档描述AT91SAM9260 NORFLASH系统启动的设计方案;
AT91SAM9260 支持多种boot策略,具体取决于系统reset时BMS的状态,当BMS=0时系统从连接到CS0上的外部静态非易失性存储器boot。
Norflash接口和SRAM类似,并且数据读取操作简单,CPU的SMC(静态存储控制器)可以直接读取。理论上可以用来存放boot及应用代码。
2. 官方支持的boot方案
ATMEL支持的比较成熟的boot方案是DATAFLASH或NANDFLASH启动,为了实现DATAFLASH和NANDFLASH启动,首先在CPU在内部ROM中固化了boot program,当BMS=1时,CPU从内部ROM boot。
该boot program主要实现了2个功能,
1. 系统初始化
RESET后进入系统初始化阶段:
1. FIQ Initialization
2. Stack setup for ARM supervisor mode
3. External Clock Detection
4. Switch Master Clock on Main Oscillator
5. C variable initialization
6. Main oscillator frequency detection if no external clock detected
7. PLL setup:
2. 1级bootloader的功能,
初始化完成后进入Bootloader阶段:
8. Initialization of the DBGU serial port (115200 bauds, 8, N, 1) only if OSCSEL = 1
9. Enable the user reset
10. Jump to DataFlash Boot sequence through NPCS0. If DataFlash Boot succeeds, perform a remap and jump to 0x0.
11. Jump to DataFlash Boot sequence through NPCS1. If DataFlash Boot succeeds, perform a remap and jump to 0x0.
12. Jump to NAND Flash Boot sequence. If NAND Flash Boot succeeds, perform a
remap and jump to 0x0.
13. Activation of the Instruction Cache
14. Jump to SAM-BA Boot sequence
15. Disable the WatchDog
16. Initialization of the USB Device Port
除此之外,ATMEL在PC端还提供了SAM-BA应用程序实现对DataFlash以及Nandflash的烧写功能。
图2.1 SAM-BA应用程序界面
3. Norflash boot实现方案
不论是片内的boot program还是上位机SAM-BA工具都不提供