Flush Cache in A5 Linux

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Flush Cache in A5 Linux

ソリューションへジャンプ
3,329件の閲覧回数
carlovalgocela
Contributor III

I encountered some issues writing to a memory that we allocated to be shared both the A5 and M4.

When I write to the shared memory in A5, not all data is being reflected immediately. It will only reflect when we tried to rewrite the data again.

Here is a scenario of what i am doing.

1.  mmap the /dev/mem

2.  update data in the shared memory

3. read in the M4.

    Result: not all are reflected.

4. rewrite again in A5.

5.  read in the M4.

    Result:  all are reflected.

We have similar experience in M4 and we solve it by calling _DCACHE_FLUSH_MLINES(). to flush the data after writing.

Does anybody know what would be the equivalent for flushing DCACHE in A5?

Thanks

ラベル(3)
タグ(3)
0 件の賞賛
1 解決策
2,686件の閲覧回数
CommunityBot
Community Manager
This an automatic process.

We are marking this post as solved, due to the either low activity or any reply marked as correct.

If you have additional questions, please create a new post and reference to this closed post.

NXP Community!

元の投稿で解決策を見る

0 件の賞賛
8 返答(返信)
2,687件の閲覧回数
CommunityBot
Community Manager
This an automatic process.

We are marking this post as solved, due to the either low activity or any reply marked as correct.

If you have additional questions, please create a new post and reference to this closed post.

NXP Community!
0 件の賞賛
2,686件の閲覧回数
timesyssupport
Senior Contributor II

Hello Carlo,

As suggested in the ticket you have open with our Support Engineers, MCC_DECACHE_INVALIDATE_MLINES may be what you are looking for, you can refer to https://linuxlink.timesys.com/system/files/Vybrid_mcc_design.pdf for further insight/examples.

Alternatively, reviewing arch/arm/mm/cache-l2x0.c, you will see the 'l2x0_flush_all()' function, which will flush the entire L2 cache.

Regards,

Timesys Support

2,686件の閲覧回数
carlovalgocela
Contributor III

Hello timesyssupport​,

Currently I am not using the MCC and the A5 application is a userspace not in the kernel.

I used mmap to map the memory.

I found a site that calls a clear cache.  __clear_cache() to flush and invalidate the cache but still not working or I missed some prerequisite.

https://minghuasweblog.wordpress.com/2013/03/29/arm-cache-flush-on-mmapd-buffers-with-clear-cache/

0 件の賞賛
2,686件の閲覧回数
timesyssupport
Senior Contributor II

Hello Carlo,

Does this function not satisfy your needs:

arch/arm/mm/cache-l2x0.c, 'l2x0_flush_all()' function

http://lxr.free-electrons.com/source/arch/arm/mm/cache-l2x0.c?v=3.13#L149

Regards,

Timesys Support

2,686件の閲覧回数
carlovalgocela
Contributor III

Hello Timesys,

I am looking for a userspace function to flush all cache.

0 件の賞賛
2,686件の閲覧回数
timesyssupport
Senior Contributor II

Hello Carlo,

I don't believe this is possible from userspace; most discussion I can find along these lines suggest a kernel driver to flush cache, as userspace would not have permission to modify memory.

Regards,

Timesys Support

0 件の賞賛
2,686件の閲覧回数
karina_valencia
NXP Apps Support
NXP Apps Support

timesyssupport​ please continue with the follow up.

0 件の賞賛
2,686件の閲覧回数
karina_valencia
NXP Apps Support
NXP Apps Support

timesyssupport​ can you help  here?

0 件の賞賛