DM8168样板制作过程,CCS测试DDR3时,GEL加载不通过:
遇到EVM816x DDR2/3 PRCM Init is Done .....卡住的问题。
一般是三个原因:
①fly-by结构的地址时钟命令线焊接不良。
②DDR3某芯片异常。
③时序参数改变,而寄存器并没有被正确配置。
①③情况还好解决,碰到②可以通过修改EMIF映射的方式回避损坏的DDR3芯片。
比如现成的案例是EMIF0异常,EMIF1正常,那么就可以只使用EMIF1。
EMIF0异常、EMIF1正常是怎么判断的呢?
GEL文件部分代码如下:
if(DDR3)
{
/* Setup a small refresh period */
WR_MEM_32(EMIF4_0_SDRAM_REF_CTRL, 0x0000613B); // Initially a large refresh period
WR_MEM_32(EMIF4_0_SDRAM_REF_CTRL, 0x1000613B); // Trigger initialization
WR_MEM_32(EMIF4_0_SDRAM_REF_CTRL, (0x10000000|SDREF)); // Move to a smaller more correct one
if(TWO_EMIF)
{
GEL_TextOut("\tInitializing EMIF1 ..... \n","Output",1,1,1);
/* Setup a small refresh period */
WR_MEM_32(EMIF4_1_SDRAM_REF_CTRL, 0x0000613B); // Initially a large refresh period
WR_MEM_32(EMIF4_1_SDRAM_REF_CTRL, 0x1000613B); // Trigger initialization
WR_MEM_32(EMIF4_1_SDRAM_REF_CTRL, (0x10000000|SDREF)); // Move to a smaller more correct one
}
}
不修改代码时,GEL文件初始化异常,停在EVM816x DDR2/3 PRCM Init is Done .....
将这段代码修改为if(DDR3)
{
/* Setup a small refresh period */
WR_MEM_32(EMIF4_1_SDRAM_REF_CTRL, 0x0000613B); // Initially a large refresh period
WR_MEM_32(EMIF4_1_SDRAM_REF_CTRL, 0x1000613B); // Trigger initialization
WR_MEM_32(EMIF4_1_SDRAM_REF_CTRL, (0x10000000|SDREF)); // Move to a smaller more correct one
if(TWO_EMIF)
{
GEL_TextOut("\tInitializing EMIF1 ..... \n","Output",1,1,1);
/* Setup a small refresh period */
WR_MEM_32(EMIF4_1_SDRAM_REF_CTRL, 0x0000613B); // Initially a large refresh period
WR_MEM_32(EMIF4_1_SDRAM_REF_CTRL, 0x1000613B); // Trigger initialization
WR_MEM_32(EMIF4_1_SDRAM_REF_CTRL, (0x10000000|SDREF)); // Move to a smaller more correct one
}
}
既可正常通过。这段代码将EMIF0忽略掉能通过,因此EMIF0异常,EMIF1正常。
那么可以采用只使用EMIF1的方法来暂时挽救这块板,从而启动linux。
修改映射方法:修改DMM_LISA_MAP寄存器,系统默认该寄存器的值为0x80640300
现我们将DMM_LISA_MAP设置为512MB section,No interleaving,Mapped on SDRC 1 only(not interleaved)
即,该值为0x80500200。
因此,在GEL中,将相应代码段修改为以下内容,EMIF1就成了从0x80000000开始的连续内存:
WR_MEM_32(DMM_LISA_MAP__0, 0x80640300);
WR_MEM_32(DMM_LISA_MAP__1, 0xC0640320);
WR_MEM_32(DMM_LISA_MAP__2, 0x80640300);
WR_MEM_32(DMM_LISA_MAP__3, 0xC0640320);
修改为
WR_MEM_32(DMM_LISA_MAP__0, 0x80500200);
WR_MEM_32(DMM_LISA_MAP__1, 0xC0500220);
WR_MEM_32(DMM_LISA_MAP__2, 0x80500200);
WR_MEM_32(DMM_LISA_MAP__3, 0xC0500220);
在U-boot中修改board/ti/ti8168/evm.c:
即可在EMIF0异常的情况下,启动操作系统。
evm.c修改内容大致为,屏蔽EMIF0的初始化,修改DMM_LISA_MAP参数。修改详情:evm.c