I don’t know how to read dipsw_pio component of FPGA in Linux driver code ?
Should I using ioremap(0xFF200000 + 0x10080, 0x100) in Linux driver code to get virtual address and access LWAXI bridge ? or need some procedure to get the information of dipsw_pio ?
[Environment]
Board: Altera Cyclone V SoC Dev Kit .
Quartus project: GHRD 13.1
Linux Kernel: v3.9
dipsw_pio BASE address = 0x10080
You first have to call request_mem_region() to let the kernel know you are going to be using that memory region.Then you can call ioremap. You may not want accesses cached, in which case use the _nocache variant. LDD3 has a good section on this.
void __iomem * base_address;
request_mem_region(region_start, region_size, DEVNAME);
base_address = ioremap_nocache(region_start, region_size);
Also, you should not hard-code your addresses, but instead read it from the device tree. I think this tutorial is the clearest that I’ve seen so far.