how to avoid caching when using mmap()
<p>I'm writing a driver in petalinux for a device in my FPGA and I have implemented the mmap function in order to control the device in the user space. My problem is that, also if I'm using </p>

<pre><code>vma-&gt;vm_page_prot = pgprot_noncached(vma-&gt;vm_page_prot);
</code></pre>

<p>in the mmap function and <code>MAP_SHARED</code> flag in the user application, it seems that the cache is enabled.</p>

<p>The test I did is to write a value (say 5) to a specific register of my mmaped device that actually stores only the least significant bit of the data coming from the AXI bus. If I read immediately after the write operation, I expect to read 1 (this happened when using a bare metal application on Microblaze), instead I read 5. However, the value is correctly wrote in the register, because what has to happen....happens.</p>

<p>Thanks in advance.</p>