<div dir="ltr">Thanks for reply Haresh. Will try and let u know.<div><br></div><div>Thanks,</div><div>Sri</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Dec 26, 2013 at 5:09 PM, haresh langaraman <span dir="ltr"><<a href="mailto:hareshel@gmail.com" target="_blank">hareshel@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Hi ram, </p>
<p dir="ltr">Can you try to map the address using io_table_init table of kernel initialization code. </p>
<p dir="ltr">Thanks, <br>
Haresh. </p>
<div class="gmail_quote"><div><div class="h5">On 27 Dec 2013 05:12, "Sri Ram Vemulpali" <<a href="mailto:sri.ram.gmu06@gmail.com" target="_blank">sri.ram.gmu06@gmail.com</a>> wrote:<br type="attribution">
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
<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 "ioremap virt mem:%p\n", io_fcp_mem );</div><div><br></div><div> fcp_scratch_pad = ((char*)io_fcp_mem) + 224;</div><div><br></div><div> printk( KERN_CRIT "scratch pad virt mem:%p\n", fcp_scratch_pad );</div>
<div><br></div><div> iowrite8_rep( fcp_scratch_pad, "Hello", 6 );</div><div><br></div><div> ioread8_rep( fcp_scratch_pad, buff, 6 );</div><div><br></div><div> printk( KERN_CRIT "value read from scratch_pad:%s\n", 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>
<br></div></div>_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org" target="_blank">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></blockquote></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Regards,<div>Sri.</div>
</div>