<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>T-Series中的主题 Re: Unable to read write to CPLD in kernel space : T1040RDB</title>
    <link>https://community.nxp.com/t5/T-Series/Unable-to-read-write-to-CPLD-in-kernel-space-T1040RDB/m-p/565398#M1200</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got the solution. I have to iomap the node of t1040rdb-cpld from dts file. then the base ptr is same. and works.&lt;/P&gt;&lt;P&gt;Thanks for the all support.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Jun 2016 12:00:33 GMT</pubDate>
    <dc:creator>hrishikesh23</dc:creator>
    <dc:date>2016-06-24T12:00:33Z</dc:date>
    <item>
      <title>Unable to read write to CPLD in kernel space : T1040RDB</title>
      <link>https://community.nxp.com/t5/T-Series/Unable-to-read-write-to-CPLD-in-kernel-space-T1040RDB/m-p/565395#M1197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Below is the u-boot log :&lt;/P&gt;&lt;P&gt;U-Boot 2014.07QorIQ-SDK-V1.7+g659b6a2 (Dec 13 2014 - 18:00:52)&lt;/P&gt;&lt;P&gt;CPU0:&amp;nbsp; T1040E, Version: 1.1, (0x85280011)&lt;BR /&gt;Core:&amp;nbsp; e5500, Version: 2.1, (0x80241021)&lt;BR /&gt;Clock Configuration:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CPU0:1400 MHz, CPU1:1400 MHz, CPU2:1400 MHz, CPU3:1400 MHz, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CCB:600&amp;nbsp; MHz,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DDR:800&amp;nbsp; MHz (1600 MT/s data rate) (Asynchronous), IFC:150&amp;nbsp; MHz&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QE:300&amp;nbsp; MHz&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FMAN1: 600 MHz&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QMAN:&amp;nbsp; 300 MHz&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PME:&amp;nbsp;&amp;nbsp; 300 MHz&lt;BR /&gt;L1:&amp;nbsp;&amp;nbsp;&amp;nbsp; D-cache 32 KiB enabled&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I-cache 32 KiB enabled&lt;BR /&gt;Reset Configuration Word (RCW):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 00000000: 0c18000e 0e000000 00000000 00000000&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 00000010: 66000002 80000002 ec027000 01000000&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 00000020: 00000000 00000000 00000000 00032810&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 00000030: 00000000 0342500f 00000000 00000000&lt;BR /&gt;Board: T1040RDB&lt;BR /&gt;Board rev: 0x01 CPLD ver: 0x09, vBank: 0&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here i can see the u-boot code is able to read the cpld version register.&lt;/P&gt;&lt;P&gt;I want to do the same thing from kernel space.&lt;/P&gt;&lt;P&gt;i added some code to in fsl_ifc.c : attached herewith.&lt;/P&gt;&lt;P&gt;i believe there is something with memory mapping the external device. need few pointers to start with.&lt;/P&gt;&lt;P&gt;I have attached a log.txt file herewith :&lt;/P&gt;&lt;P&gt;which details out the register values of IFC,u-boot log and kernel log.&lt;/P&gt;&lt;P&gt;Please do provide suggestion and valuable comments to proceed further.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337187"&gt;log.txt.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337187"&gt;fsl_ifc.c.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2016 13:24:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/T-Series/Unable-to-read-write-to-CPLD-in-kernel-space-T1040RDB/m-p/565395#M1197</guid>
      <dc:creator>hrishikesh23</dc:creator>
      <dc:date>2016-06-23T13:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to read write to CPLD in kernel space : T1040RDB</title>
      <link>https://community.nxp.com/t5/T-Series/Unable-to-read-write-to-CPLD-in-kernel-space-T1040RDB/m-p/565396#M1198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unlike u-Boot, Linux kernel has a non-flat memory model, thus accessing&lt;/P&gt;&lt;P&gt;a memory mapped peripheral without explicitly mapping it first like you do in&lt;/P&gt;&lt;P&gt;cpld_read() is fundamentally wrong and results in errors like you &lt;/P&gt;&lt;P&gt;observe.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suggestions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Study ioremap and use it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fmirror.linux.org.au%2Flinux-mandocs%2F2.6.12%2Fioremap.html" rel="nofollow" target="_blank"&gt;http://mirror.linux.org.au/linux-mandocs/2.6.12/ioremap.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. fsl_ifc.c contains a code that supports the IFC controller by itself,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; not the peripherals connected to it. If you need to access such &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; peripheral from the kernel space, it is a good idea to create a&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; separate module.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;3. Kernel programming is different from u-Boot in many aspects. If you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; are not familiar with&amp;nbsp; it, studying the material at the link below &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; can save you many hours of try-and-fail experience:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.xml.com%2Fldd%2Fchapter%2Fbook%2F" rel="nofollow" target="_blank"&gt;http://www.xml.com/ldd/chapter/book/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;/P&gt;&lt;P&gt;Platon&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2016 17:14:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/T-Series/Unable-to-read-write-to-CPLD-in-kernel-space-T1040RDB/m-p/565396#M1198</guid>
      <dc:creator>bpe</dc:creator>
      <dc:date>2016-06-23T17:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to read write to CPLD in kernel space : T1040RDB</title>
      <link>https://community.nxp.com/t5/T-Series/Unable-to-read-write-to-CPLD-in-kernel-space-T1040RDB/m-p/565397#M1199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Platon,&lt;/P&gt;&lt;P&gt;Thanks for the valuable suggestions from your side.&lt;/P&gt;&lt;P&gt;i tried to figure out the physical address of MY CPLD :&lt;/P&gt;&lt;P&gt;Local Access window Register :&lt;BR /&gt;LAWBARH03: 0x0000000f LAWBARL03: 0xffdf0000 LAWAR03: 0x81f00010&lt;/P&gt;&lt;P&gt;PHYSICAL ADDRESS :&lt;BR /&gt;#define CONFIG_SYS_CPLD_BASE 0xffdf0000&lt;BR /&gt;#define CONFIG_SYS_CPLD_BASE_PHYS (0xf00000000ull | CONFIG_SYS_CPLD_BASE)&lt;/P&gt;&lt;P&gt;base_ptr&amp;nbsp; = ioremap((unsigned long)CONFIG_SYS_CPLD_BASE_PHYS, (1024*4));&lt;/P&gt;&lt;P&gt; if(!base_ptr)&lt;BR /&gt; {&lt;BR /&gt;&amp;nbsp; printk(KERN_INFO " OCU IOREMAP Failed ");&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt;&amp;nbsp; printk(KERN_INFO " OCU IOREMAP successful ");&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt; printk(KERN_INFO "BASE PTR rev: %x",base_ptr);&lt;/P&gt;&lt;P&gt; for(i=0;i&amp;lt;28;i++)&lt;BR /&gt; {&lt;BR /&gt; printk(KERN_INFO "CPLD DATA: 0x%02x\n",readb(base_ptr+i));&lt;BR /&gt; }&lt;BR /&gt; base_ptr value comes out to be 0xf10fe000.&lt;BR /&gt; &lt;BR /&gt; Now when i try to read the cpld version that is (base_ptr + 2) does not match.&lt;BR /&gt; &lt;BR /&gt; With respect to your previous suggestion. yes i am going to write the driver file separately.&lt;BR /&gt; but for now i just need to read/write the cpld. is there a some simple method to prove the simple read write.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2016 10:29:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/T-Series/Unable-to-read-write-to-CPLD-in-kernel-space-T1040RDB/m-p/565397#M1199</guid>
      <dc:creator>hrishikesh23</dc:creator>
      <dc:date>2016-06-24T10:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to read write to CPLD in kernel space : T1040RDB</title>
      <link>https://community.nxp.com/t5/T-Series/Unable-to-read-write-to-CPLD-in-kernel-space-T1040RDB/m-p/565398#M1200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got the solution. I have to iomap the node of t1040rdb-cpld from dts file. then the base ptr is same. and works.&lt;/P&gt;&lt;P&gt;Thanks for the all support.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2016 12:00:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/T-Series/Unable-to-read-write-to-CPLD-in-kernel-space-T1040RDB/m-p/565398#M1200</guid>
      <dc:creator>hrishikesh23</dc:creator>
      <dc:date>2016-06-24T12:00:33Z</dc:date>
    </item>
  </channel>
</rss>

