0. 在S5PV210.dat允许SD启动
1. 初始化并进入到OEMPlatformInit
1.1 SDHC_INIT(SDMMCDRV.c)
全局变量初始化->内存映射->...
1.2 BP_Init
Sets up locations for various objects in memory provided by caller
全部变量g_FlashInfo、g_partStateTable...等初始化。
1.3 FMD_GetInfo
Provides information on the NAND flash
pFlashInfo等全局变量初始化
1.4 TOC_Read(NAND.CPP)
Try to retrieve TOC (and Boot config) from boot media
1.4.1 TOC_Init
1.4.1.1 BootConfigInit
Set default boot configuration values,g_pBootCfg初始化
1.4.2 TOC_Write
1.5 SetCPUClock()
1.6 OEMPMICInit()
1.7 InitializeDisplay()
2. OEMPreDownload
根据g_bDownloadImage返回跳转或下载
3 DownloadImage
根据第2步返回的为下载进入此函数
3.1 GetImageType
从内存中获得前七个字节(假设SD卡中的NK.BIN已经搬入内存中)
3.2 根据3.1得到的类型进行下载
3.2.1 DownloadSignedBin(其中一个是Bin类型)
3.2.1.1 memset()
Clearing memory ensures no garbage between sparse .bin records, so that
our post-download checksum will be accurate.
3.2..1.2 OEMIsFlashAddr
判断是否为Flash地址
3.2.1.3 OEMStartEraseFlash
擦除Flash
3.2.1.4 OEMReadData (RANDOM_SEED_LENGTH, (LPBYTE) &packetData.bRandomSeed)
read random seed at start of signed .bin file
3.2.1.5 OEMReadData (...) Download signed packets (.bin records or record chunks)
3.2.1.6 OEMReadData (...) Read the .bin record header
... ...
3.2.1.7 ComputeChecksum
3.2.1.8 WriteImageToFlash(FLASH.c)
3.2.1.8.1 OEMWriteFlash(FLASH.c)->WriteFlashNK
3.2.1.8.1.1 (NOSDBOOT)
FMD_ReadSector(NOSDBOOT)
BP_LowLevelFormat
BP_OpenPartition
BP_GetPartitionInfo
EraseBlocks
FMD_WriteSector
BP_SetDataPointer
BP_WriteData
TOC_Write
3.2.1.8.1.2 (SDBOOT)
FMD_ReadSector(NOSDBOOT)
BP_LowLevelFormat
BP_OpenPartition
BP_GetPartitionInfo
EraseBlocks
FMD_WriteSector
BP_OpenPartition
BP_Storage_Init
BP_OpenStoragePartition
SDHC_WRITE
BP_SetDataPointer
BP_WriteData
TOC_Write
4. 根据第2步得到的类型进行跳转
1. 初始化并进入到OEMPlatformInit
1.1 SDHC_INIT(SDMMCDRV.c)
全局变量初始化->内存映射->...
1.2 BP_Init
Sets up locations for various objects in memory provided by caller
全部变量g_FlashInfo、g_partStateTable...等初始化。
1.3 FMD_GetInfo
Provides information on the NAND flash
pFlashInfo等全局变量初始化
1.4 TOC_Read(NAND.CPP)
Try to retrieve TOC (and Boot config) from boot media
1.4.1 TOC_Init
1.4.1.1 BootConfigInit
Set default boot configuration values,g_pBootCfg初始化
1.4.2 TOC_Write
1.5 SetCPUClock()
1.6 OEMPMICInit()
1.7 InitializeDisplay()
2. OEMPreDownload
根据g_bDownloadImage返回跳转或下载
3 DownloadImage
根据第2步返回的为下载进入此函数
3.1 GetImageType
从内存中获得前七个字节(假设SD卡中的NK.BIN已经搬入内存中)
3.2 根据3.1得到的类型进行下载
3.2.1 DownloadSignedBin(其中一个是Bin类型)
3.2.1.1 memset()
Clearing memory ensures no garbage between sparse .bin records, so that
our post-download checksum will be accurate.
3.2..1.2 OEMIsFlashAddr
判断是否为Flash地址
3.2.1.3 OEMStartEraseFlash
擦除Flash
3.2.1.4 OEMReadData (RANDOM_SEED_LENGTH, (LPBYTE) &packetData.bRandomSeed)
read random seed at start of signed .bin file
3.2.1.5 OEMReadData (...) Download signed packets (.bin records or record chunks)
3.2.1.6 OEMReadData (...) Read the .bin record header
... ...
3.2.1.7 ComputeChecksum
3.2.1.8 WriteImageToFlash(FLASH.c)
3.2.1.8.1 OEMWriteFlash(FLASH.c)->WriteFlashNK
3.2.1.8.1.1 (NOSDBOOT)
FMD_ReadSector(NOSDBOOT)
BP_LowLevelFormat
BP_OpenPartition
BP_GetPartitionInfo
EraseBlocks
FMD_WriteSector
BP_SetDataPointer
BP_WriteData
TOC_Write
3.2.1.8.1.2 (SDBOOT)
FMD_ReadSector(NOSDBOOT)
BP_LowLevelFormat
BP_OpenPartition
BP_GetPartitionInfo
EraseBlocks
FMD_WriteSector
BP_OpenPartition
BP_Storage_Init
BP_OpenStoragePartition
SDHC_WRITE
BP_SetDataPointer
BP_WriteData
TOC_Write
4. 根据第2步得到的类型进行跳转