好文档 - 专业文书写作范文服务资料分享网站

移植u-boot-2012-10到tiny210v2(一)-----基本芯片介绍和启动流程介绍

天下 分享 时间: 加入收藏 我要投稿 点赞

diagram) 1. Disable the Watch-Dog Timer 2. Initialize the instruction cache 3. Initialize the stack region (see “memory map” on chap 2.5) 4. Initialize the heap region. (see “memory map” on chap 2.5) 5. Initialize the Block Device Copy Function. (see “Device Copy Function” on chap 2.7) 6. Initialize the PLL and Set system clock. (see “clock configuration” on chap 2.11) 7. Copy the BL1 to the internal SRAM region (see “Device Copy Function” on chap 2.7) 8. Verify the checksum of BL1. If checksum fails, iROM will try the second boot up. (SD/MMC channel 2) 9. Check if it is secure-boot mode or not. If the security key value is written in S5PV210, It’s secure-boot mode. If it is secure-boot mode, verify the integrity of BL1. 10. Jump to the start address of BL1 从这段英文介绍中我们可以看出BL0做的东西挺多了:关闭看门狗,初始化cache,初始化堆栈,初始化系统时钟,拷贝BL1到IRAM中运行等并且我们知道它为我们提供了好几个拷贝函数,这些函数我们在后面会使用到,既然三星提供给我们了,我们就不用自己写的,何乐而不为呢是吧。可是这里有一个很重要的信息我们没有读取到,三星也没有明显提及,就是我们的BL1该有多大呢?总不可能无限大的,因为我们的IRAM就只有96K,撑死让你全用了,也就是96K。在网络上也存在两种说法,一个说是16K,一个说是8K。到底是多少k呢?这个

问题我也说不准,不过我觉得应该是8K,为什么呢,我们来看SIAN里面的一个memory map的图 这个是我们上面说的那个全部memory map的一部分,就是我们IROM和IRAM的那两个部分,IROM我们就不看的,我们来看IRAM的,我们可以看到从0xD002_0000开始到0xD003_5400这8K的空间中包含了BL1和Reserved,那么我觉得BL1最大只能是8K。但是这也不一定,如果BL0就是拷贝16K过来的呢?这个我没做过实验,如果有星期自己可以做过实验验证一下是不是真的是拷贝16K,而且我们使用友善的那个生成BL1的工具是把它认为是16K的。 既然说到了这个图,那么我们继续对这个图挖掘一下信息。我们可以看到在BL1的前面16个字节是一些关于BL1的基本信息的,其中包含了BL1 size和BL1的cksum值,而在BL0中,貌似只做cksum校验,那么这个cksum我们必须填写正确。具体的自己去看友善的代码。 下面我们要去找拷贝BL1的那个函数,因为我们打算在BL1中拿它来拷贝BL2。 因为我使用的是从SDMMC启动,所以我们会使用到CopySDMMCtoMem这个函数,这个函数被定义在0xD0037F98这个位置,这个函数的原型是:[cpp] view plaincopyprint?/** * This Function copy MMC(MoviNAND/iNand) Card Data to memory. * Always use EPLL source clock. * This function works at

20Mhz. * @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 bool with_init : determined card initialization. * @return bool(u8) - Success or failure. */ #define CopySDMMCtoMem(z,a,b,c,e)(((bool(*)(int, unsigned int, unsigned short, unsigned int*, bool))(*((unsigned int *)0xD0037F98)))(z,a,b,c,e)) <span style=\#ffffff\ /** * This Function copy MMC(MoviNAND/iNand) Card Data to memory. * Always use EPLL source clock. * This function works at 20Mhz. * @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 bool with_init : determined card initialization. * @return bool(u8) - Success or failure. */ #define CopySDMMCtoMem(z,a,b,c,e)(((bool(*)(int, unsigned int, unsigned short, unsigned int*, bool))(*((unsigned int

*)0xD0037F98)))(z,a,b,c,e)) 现在拷贝的函数接口我

们知道了,还有一点我们要说明白的就是,那么我们的BL1和BL2在我们的SD卡上面应该怎么摆放呢,BL2的话还好,因为拷贝是我们自己的BL1拷贝的,可是BL1就不能乱放了,因为这是BL0拷贝的,BL0我们是不可控制它的。在

SIAN中也有这部分的介绍,我们就只看SD的那部分。 从这里我们可以知道,我们SD的第一个Block必须被预留下来,不能使用,BL1存放在Block1中,那么这个N取值多少呢?友善给我们的值是49,所以BL2边放着编号为49的Block中。

移植u-boot-2012-10到tiny210v2(一)-----基本芯片介绍和启动流程介绍

diagram)1.DisabletheWatch-DogTimer2.Initializetheinstructioncache3.Initializethestackregion(see“memorymap”onchap2.5)4.Initializetheheapregion.(see“memorymap”onchap2.
推荐度:
点击下载文档文档为doc格式
0b20w8dwe25ap1c1kzfj507xn0uyj200qk7
领取福利

微信扫码领取福利

微信扫码分享