Enabling Data Cache in MPC5675K

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Enabling Data Cache in MPC5675K

832 Views
komodo
Contributor I

Hello All,

Would like to enable the data cache at startup assembly file. Can anyone guide me how to access the control registers and what are the steps I need to follow?

Thanks in advance for your time and help!

Tags (1)
0 Kudos
4 Replies

499 Views
marius_grigoras
NXP Employee
NXP Employee

Hi,

Taking a look in the RM for e200 core [1] , this should be something like:

asm ("mfspr3,1010");/* enable d-cache */
asm ("ori3, 3, 0x0001");
asm ("mtspr1010,3");

asm ("mfspr3,1013");/* enable branch prediction in BUCSR */
asm ("ori3, 3, 0x0001");
asm ("mtspr1013,3");

asm ("isync");
asm ("msync");

Note that 1010 is an index for L1CSR0 core register and 1013 is an index for BUCSR core register.

Regards,

Marius

[1] http://www.freescale.com/files/32bit/doc/ref_manual/e200z760RM.pdf

499 Views
komodo
Contributor I

Hi,

Thanks for the info!

In my task I have to specify a portion of SRAM for Data as DATA CACHE using MMU TLB table. I am not sure how MMU works with PPC. If any help to configure the memory as a data cacheable would be appreciated. Something like how to assign the RAM memory and command the controller that is use as Internal data cache.

Thanks.

0 Kudos

499 Views
marius_grigoras
NXP Employee
NXP Employee

Hi,

Please find below an example about how can configure cacheable a TLB entry:

// 1GB  TLB entry  1: 0x00000000 - 0x3FFFFFFF; cacheable
asm ("lis5, 0x1001");
asm ("ori5, 5, 0x0000");
asm ("mtspr624, 5");

asm ("lis5, 0x8000");
asm ("ori5, 5, 0x0A00");
asm ("mtspr625, 5");

asm ("lis5, 0x0000");
asm ("ori5, 5, 0x0000");
asm ("mtspr626, 5");

asm ("lis5, 0x0000");
asm ("ori5, 5, 0x0015");
asm ("mtspr627, 5");

asm ("tlbwe");
asm ("msync");

asm ("isync");

For SRAM initialization you can take a look in the processor Reference Manual.

Regards,

Marius

499 Views
komodo
Contributor I

Thank you very much! This helps me.

0 Kudos