背景
2450从nandflash启动,CPU会自动拷贝nandflash前8K到CPU内部SRAM中
描述
Block0烧录nboot(steppingstone),主要任务从nandflash上拷贝eboot到地址为0x30038000(物理地址,因为MMU disabled)的RAM上,然后跳转到eboot进入点函数startup中.
Block1烧录TOC,就是image(eboot,NK)的索引,可以看看它的结构
typedef struct _TOC {
DWORD dwSignature;
//怎样启动image,分别设置ImageIndex和ConfigFlags使用哪一个image以什么方式启动(download还是directly launch)
BOOT_CFG BootCfg;
// image描述符索引(包含了eboot,NK)
IMAGE_DESCRIPTOR id[MAX_TOC_DESCRIPTORS];
CHAININFO chainInfo;
} TOC, *PTOC;
typedef struct _IMAGE_DESCRIPTOR {
// File version info
DWORD dwVersion; // e.g: build number
DWORD dwSignature; // e.g: "EBOT", "CFSH", etc
UCHAR ucString[IMAGE_STRING_LEN]; // e.g: "PocketPC_2002"
DWORD dwImageType; // IMAGE_TYPE_ flags
DWORD dwTtlSectors; // TTL image size in sectors.
// We store size in sectors instead of bytes
// to simplify sector reads in Nboot.
DWORD dwLoadAddress; // Virtual address to load image (ImageStart)
DWORD dwJumpAddress; // Virtual address to jump (StartAddress/LaunchAddr)
// This array equates to a sector-based MXIP MultiBINInfo in blcommon.
// Unused entries are zeroed.
// You could chain image descriptors if needed.
SG_SECTOR sgList[MAX_SG_SECTORS];
// BinFS support to load nk region only
//struct
//{
ULONG dwStoreOffset; // byte offset - not needed - remove!
//ULONG RunAddress; // nk dwRegionStart address
//ULONG Length; // nk dwRegionLength in bytes
//ULONG LaunchAddress; // nk dwLaunchAddr
//} NKRegion;
} IMAGE_DESCRIPTOR, *PIMAGE_DESCRIPTOR;
dwLoadAddress作用: 把NK.bin转化为NK.nbx格式,然后拷贝NK.nbx内容到这个虚拟地址地址(这个虚拟地址可以在config.bib中被配置)
dwJumpAddress作用: OAL进入点地址,可以在NK.bin中查询出section address为0,section length就是JumpAddress,也可用viewbin查看NK.bin OAL进入点地址。这个地址在OEMLaunch中用到,调用Launch(dwJumpAddress转化为物理地址),Launch函数中会disable MMU,跳转到OAL的startup函数中....
Block2烧录eboot.bin image
Block3烧录MBR
Block4-Blockx烧录Nk.bin,Block个数根据NK.bin的ImageLength值