<div dir="ltr"><div>Hi All,</div><div><br></div>I am using custom board MPC8641d. It has all evaluation board devices connected. Apart from that an external FPGA device connected through localbus. <div><br></div><div>The localbus is at address 0xF5005000 directly connected to processor. The FPGA address in the processor realm is 0xF3800000. As per spec FPGA target interface is CS3 (chip select 3). 32-bit peripheral address bus as seen by FPGA is 0xF3800000. The global address of FPGA is 0x0BFC0000.</div>
<div><br></div><div><br></div><div>I am implementing driver for FPGA. I am using ioremap() to map to FPGA registers at location 0xF3800000. The virtual address returned by ioremap() when used with write32(), read32() at memory locations shows no response from device. FPGA has special scratch pad to which one can write and read to validate the memory map is working. When I write and read I see no value.</div>
<div><br></div><div><div>#define FCP_ADDRESS_START 0xF3800000</div><div>#define FCP_ADDRESS_END   0xF3808000</div><div>#define FCP_ADDRESS_RANGE (FCP_ADDRESS_END - FCP_ADDRESS_START)</div></div><div><br></div><div><div> void *fcp_scratch_pad;</div>
<div> char buff[10];</div></div><div><br></div><div> io_fcp_mem = ioremap_nocache( FCP_ADDRESS_START, FCP_ADDRESS_RANGE );<br></div><div><div><br></div><div>        if( ! io_fcp_mem ) {</div><div>                return -ENODEV;</div>
<div>        }</div><div><br></div><div>        printk( KERN_CRIT &quot;ioremap virt mem:%p\n&quot;, io_fcp_mem );</div><div><br></div><div>        fcp_scratch_pad = ((char*)io_fcp_mem) + 224;</div><div><br></div><div>        printk( KERN_CRIT &quot;scratch pad virt mem:%p\n&quot;, fcp_scratch_pad );</div>
<div><br></div><div>        iowrite8_rep( fcp_scratch_pad, &quot;Hello&quot;, 6 );</div><div><br></div><div>        ioread8_rep( fcp_scratch_pad, buff, 6 );</div><div><br></div><div>        printk( KERN_CRIT &quot;value read from scratch_pad:%s\n&quot;, buff );</div>
<div><br></div><div>        return 0;</div></div><div><br></div><div><br></div><div>Attached is the device tree of the board.</div><div><br></div><div>Can anyone please direct me or point where I am doing wrong. It seems I am unable to access FPGA device memory. Thanks.<br clear="all">
<div><br></div>--<br>Regards,<div>Sri.</div>
</div></div>