[e500] enabling hardware data cache coherency in Linux

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

[e500] enabling hardware data cache coherency in Linux

601 Views
aleksander
Contributor I

Hello!

I am trying to enable hardware enforced coherency in P2020 in order to speed up communication between core and eTSEC.

Unfortunately, I cannot find, how to set/clear proper bits in MAS2 register, using standard linux kernel API. Is there any way to do this clean way, or should I just hack my way out?

The only proof that Linux might set those bits is in [2], function, but that doesn't lead me to any generic kernel api function.

[1] http://www.freescale.com/files/32bit/doc/app_note/AN3544.pdf

[2] Linux/arch/powerpc/mm/fsl_booke_mmu.c - Linux Cross Reference - Free Electrons

regards

Aleksander

Labels (1)
Tags (3)
0 Kudos
3 Replies

464 Views
scottwood
NXP Employee
NXP Employee

Linux already uses coherent DMA on e500-family chips.

0 Kudos

464 Views
aleksander
Contributor I

Can you show how it's done? I suppose, using functions from  <linux/dma-mapping.h> you somehow assures, you set proper MAS2 bits, but I'd like to know where it is done.

thanks

Aleksander

0 Kudos

464 Views
scottwood
NXP Employee
NXP Employee

MAS2[M] is relevant for SMP (and will be set on SMP kernels), not for DMA coherence on e500v2 (e500mc is another matter).  As long the device is generating snoops (e.g. TDSEN/TBDSEN/RDSEN/RBDSEN are set), the DMA will be coherent.

0 Kudos