This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

why need to configure the cache before DDR3 initialization?

Expert 2985 points

Hi all,

I am testing the DDR3 in our board using the Keystone DDR3 init example code.

In this example, there are some codes before the ddr3 initialization like

CODE1:

int i;

CACHE_setL1PSize(CACHE_L1_32KCACHE);
CACHE_setL1DSize(CACHE_L1_32KCACHE);
CACHE_setL2Size(CACHE_1024KCACHE);
CACHE_invAllL1p(CACHE_WAIT);
CACHE_wbInvAllL1d(CACHE_WAIT);
CACHE_wbInvAllL2(CACHE_WAIT);

/*make other cores local memory cacheable and prefetchable*/
for(i=16; i<24; i++)
        CGEM_regs->MAR[i]=1|(1<<CSL_CGEM_MAR0_PFX_SHIFT);
/*make DDR cacheable and prefetchable*/
for(i=128; i<256; i++)
        CGEM_regs->MAR[i]=1|(1<<CSL_CGEM_MAR0_PFX_SHIFT);
/*make other space non-cacheable and non-prefetchable*/
for(i=24; i<128; i++)
	CGEM_regs->MAR[i]=0;

Then there are the DDR3 initialization codes like
CODE2:

KeyStone_main_PLL_init(624,31);
KeyStone_DDR_PLL_init (79, 2);
TCI6618_EVM_DDR_Init(666.667); 	

After these, I can write or read the DDR3 sdram.

What confuses me is that why need these CODE1 before DDR3 initializtion CODE2.
If I delete the CODE1, I can not w/r the DDR3 correctly.
Can anyone tell me why? Or tell me read which docs.

Thanks a lot!

  • Hi Feng,

    TCI66xx devices such as TCI6618 are supported directly through Local Field Applications Engineers (FAEs.)  These devices are not supported on the E2E forum.  Please contact your local FAE for support of these devices.  If you are not sure who your local FAE is, then please contact your local technical sales representative and they will be able to put you in contact with your local FAE.

    Thanks.