极术小姐姐 · 2020年02月03日

How to flush write buffer when memory attribute is normal_nc

Hi,

I am working on access pcie bar in armv8-a cpu(cortex-A5x) powered soc. Right now, I encounter an issue about (maybe) coherent issue.

When I write data(4 bytes aligned) to pcie bar with ioremap_wc, there is some incorrect data. And it is correct if write data twice. Or I make use of the ioremap which means device_nGnRE attribute.

When I read the armv8 arm, it say that the write of normal_nc is visible for all the observers. I am not sure if the cache maintenance should work. I want to know what is the best practice in these senario. Is there something like flush write buffer helping me flushing data to pcie bar?

There is no coherent between arm cpu and pcie.

Thanks.

1 个回答 得票排序 · 时间排序
棋子 · 2020年02月03日

Hi bamvor_china,

As 42Bastian Schick pointed out, this is a DSB that you need here.

See "K11.5.4 Ordering of Memory-mapped device control with payloads" in the Arm® Architecture Reference Manual Armv8, for Armv8-A architecture profile for example:

Fullscreen

You mention the PCIe in your system is not coherent so you need a DSB ST (store-store, full system) here.

See https://developer.arm.com/doc...

你的回答
关注数
1
收藏数
0
浏览数
2914
棋子
极术微信服务号
关注极术微信号
实时接收点赞提醒和评论通知
安谋科技学堂公众号
关注安谋科技学堂
实时获取安谋科技及 Arm 教学资源
安谋科技招聘公众号
关注安谋科技招聘
实时获取安谋科技中国职位信息