作者:Jump_jiedB0_666 | 来源:互联网 | 2023-05-17 12:28
在S3C2450开机会执行一段IROM代码,然后把BL1加载到IRAM的前8KB(也就是stepstone)的地址处然后执行它,这8KB的BL1会把整个bootloader再加载到外部SDRAM然后
在S3C2450开机会执行一段IROM代码,然后把BL1加载到IRAM的前8KB(也就是step stone)的地址处然后执行它,这8KB的BL1会把整个bootloader再加载到外部SDRAM然后执行它;
从手头的BL1(step stone)代码和BL2(bootloader)代码感觉还是不好理解S3C2450的启动过程的细节,有两个问题要请教各位
1> IROM是否是S3C2450的内存地址中以0x00000000为起始地址的一段内存呢?
2> 有什么办法把IROM代码抓取出来(二进制机器码),然后分析其行为呢?
10 个解决方案
1)不是。是映射过去的。2)还不如阅读bootloader的汇编代码呢,何必费神
bootloader 上电代码的分析,网上到处都有吧!
我手里有份详细的呢! 可惜一直没看过...
IROM上就两个还是三个函数,似乎就只是一个简单的代码搬移函数,某本手册上有源码的我看到过,但具体是哪本手册记了……似乎是2410的手册上,还有图……实是记不得了……
嗯找到了,手册名:SMDK2450_IROM_APPLICATION NOTE_REV 0.03
共三个函数:
Address Name
0x40004000 NF8_ReadPage
0x40004004 NF8_ReadPage_Adv
0x40004008 CopyMovitoMem
定义:
/**
* This Function copies a block of page to destination memory.( 8-Bit ECC only )
* @param uint32 block : Source block address number to copy.
* @param uint32 page : Source page address number to copy.
* @param uint8 *buffer : Target Buffer pointer.
* @return int32 - Success or failure.
*/
#define NF8_ReadPage(a,b,c) (((int(*)(uint32, uint32, uint8*))(*((uint32 *)0x0C004000)))(a,b,c))
/**
* This Function copies a block of page to destination memory( 8-Bit ECC only )
* @param u32 block : Source block address number to copy.
* @param u32 page : Source page address number to copy.
* @param u8 *buffer : Target Buffer pointer.
* @return int - Success or failure.
*/
#define NF8_ReadPage_Adv(a,b,c) (((int(*)(uint32, uint32, uint8*))(*((uint32 *)0x40004004)))(a,b,c))
/**
* This Function copy MMC(MoviNAND/iNand) Card Data to memory.
* Always use EPLL source clock.
* This function works at 25Mhz.
* @param u32 StartBlkAddress : Source card(MoviNAND/iNand MMC)) Address.(It must block address.)
* @param u16 blockSize : Number of blocks to copy.
* @param u32* memoryPtr : Buffer to copy from.
* @param u32 extClockSpeed : External clock speed(per HZ)
* @param bool with_init : determined card initialization.
* @return bool(u8) - Success or failure.
*/
#define CopyMovitoMem (a,b,c,d,e)(((bool(*)(u32,u16,u32*,u32,bool)) \
(*((u32 *)0x40004008))) (a,b,c,d,e))
PDF下不到可以联系我,JQGuardian@qq.com
s3c6410x的代码是这样的:
Nand Flash Copy Function Address (8-Bit ECC Check, 512Page Size Only)
=====================================================================
/**
* This Function copies a block of page to destination memory.( 8-bit ECC only )
* @param uint32 blcok : Source block address number to copy.
* @param uint32 page : Source page address number to copy.
* @param uint8 *buffer : Target Buffer pointer.
* @return int32 - Success or failure.
*/
#define NF8_ReadPage(a,b,c) (((int(*)(uint32, uint32, uint8*))(*((uint32 *)0x0C004000)))(a,b,c))
Nand Flash Copy Function Address (8-Bit ECC Check, 2K and 4K Page Size Only)
============================================================================
/**
* This Function copies a block of page to destination memory( 8-bit ECC only )
* @param uint32 blcok : Source block address number to copy.
* @param uint32 page : Source page address number to copy.
* @param uint8 *buffer : Target Buffer pointer.
* @return int32 - Success or failure.
*/
#define NF8_ReadPage_Adv(a,b,c) (((int(*)(uint32, uint32, uint8*))(*((uint32 *)0x0C004004)))(a,b,c))
SD/MMC Copy Function
====================
/**
* This Function copies SD/MMC Card Data to memory.
* Always use EPLL source clock.
* @param channel : HSMMC Controller channel number ( Not support. Depend on GPN15, GPN14 and GPN13 )
* @param StartBlkAddress : Source card(SD/MMC) Address.(It must block address.)
* @param blockSize : Number of blocks to copy.
* @param memoryPtr : Buffer to copy from.
* @param with_init : reinitialize or not
* @return bool(unsigend char) - Success or failure.
*/
#define CopyMMCtoMem(z,a,b,c,e) (((bool(*)(int, unsigned int, unsigned short, unsigned int*, bool)) \
(*((unsigned int *)0x0C004008)))(z,a,b,c,e))
OneNAND Copy Function Address
=============================
/**
* Single Word Transfer.
* @param uint32 Controller - OneNAND Controller Number ('0' fixed)
* @param uint32 uBlkAddr - Block Number to read
* @param uint8 uPageAddr - Page Number to read
* @param uint32* aData - Destination Address
* @return bool(uint8) - Success or failure.
*/
#define ONENAND_ReadPage(a,b,c,d) (((bool(*)(uint32,uint32, uint8,uint32*)) \
(*((uint32 *)0x0C00400C)))(a,b,c,d))
OneNAND Copy Function Address (4-Burst)
=======================================
/**
* 4 burst word transfer (for enhanced Read performance)
* @param uint32 Controller - OneNAND Controller Number ('0' fixed)
* @param uint32 uBlkAddr - Block Number to read
* @param uint8 uPageAddr - Page Number to read
* @param uint32* aData - Destination Address
* @return bool(uint8) - Success or failure.
*/
#define ONENAND_ReadPage_4burst(a,b,c,d) (((bool(*)(uint32,uint32,uint8,uint32*)) \
(*((uint32*)0x0C004010))) (a,b,c,d))
OneNAND Copy Function Address (8-Burst)
=======================================
/**
* 8 burst word transfer (for enhanced Read performance)
* bool ONENAND_ReadPage_8burst(u32 Controller, u32 uBlkAddr, u8 uPageAddr, u32* aData)
* @param Controller - OneNand Controller Number ('0' fixed)
* @param uBlkAddr - Block Number to read
* @param uPageAddr - Page Number to read
* @param aData - Destination Address
* @return bool(unsigend char) - Success or failure.
*/
#define ONENAND_ReadPage_8burst(a,b,c,d) (((bool(*)(uint32,uint32,uint8,uint32*)) \
(*((uint32*)0x0C004010))) (a,b,c,d))